| | |
| | | import com.java110.common.constant.CommonConstant; |
| | | import com.java110.common.constant.ResponseConstant; |
| | | import com.java110.common.exception.BusinessException; |
| | | import com.java110.common.factory.DataTransactionFactory; |
| | | import com.java110.core.factory.DataTransactionFactory; |
| | | import com.java110.common.log.LoggerEngine; |
| | | import com.java110.common.util.Assert; |
| | | import com.java110.common.util.StringUtil; |
| | |
| | | * @param dataQuery |
| | | */ |
| | | private void doExecuteUpdateSql(DataQuery dataQuery) throws BusinessException{ |
| | | |
| | | JSONObject business = null; |
| | | try { |
| | | JSONObject params = dataQuery.getRequestParams(); |
| | | JSONObject sqlObj = JSONObject.parseObject(dataQuery.getServiceSql().getSql()); |
| | | JSONObject templateObj = JSONObject.parseObject(dataQuery.getServiceSql().getTemplate()); |
| | | business = JSONObject.parseObject(templateObj.getString("TEMPLATE")); |
| | | List<Object> currentParams = new ArrayList<Object>(); |
| | | String currentSql = ""; |
| | | for(String key : sqlObj.keySet()) { |
| | |
| | | continue; |
| | | } |
| | | currentSqlNew += "?"; |
| | | currentParams.add(params.get(sqls[sqlIndex]) instanceof Integer ? params.getInteger(sqls[sqlIndex]) : "'" + params.getString(sqls[sqlIndex]) + "'"); |
| | | currentParams.add(params.get(sqls[sqlIndex]) instanceof Integer ? params.getInteger(sqls[sqlIndex]) : "" + params.getString(sqls[sqlIndex]) + ""); |
| | | //currentSqlNew += params.get(sqls[sqlIndex]) instanceof Integer ? params.getInteger(sqls[sqlIndex]) : "'" + params.getString(sqls[sqlIndex]) + "'"; |
| | | } |
| | | |
| | |
| | | logger.error("数据交互异常:",e); |
| | | throw new BusinessException(ResponseConstant.RESULT_CODE_INNER_ERROR,"数据交互异常。。。"); |
| | | } |
| | | |
| | | dataQuery.setResponseInfo(DataTransactionFactory.createBusinessResponseJson(ResponseConstant.RESULT_CODE_SUCCESS, |
| | | "成功",business)); |
| | | } |
| | | |
| | | /** |
| | |
| | | if(StringUtil.isNullOrNone(values[1])){ |
| | | return ; |
| | | } |
| | | obj.put(values[1], new JSONObject()); |
| | | obj.put(values[1], values[2].equals("Object")?new JSONObject():new JSONArray()); |
| | | return; |
| | | } |
| | | if (values[2].equals("Object")) { |