diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/mdmDistribute/plugin/MdmModulePluginInitializer.java b/buildpackage/src/main/java/com/hzya/frame/plugin/mdmDistribute/plugin/MdmModulePluginInitializer.java index 74c5e2b9..0d53b4ff 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/mdmDistribute/plugin/MdmModulePluginInitializer.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/mdmDistribute/plugin/MdmModulePluginInitializer.java @@ -1,5 +1,6 @@ package com.hzya.frame.plugin.mdmDistribute.plugin; +import cn.dev33.satoken.stp.StpUtil; import cn.hutool.core.util.StrUtil; import cn.hutool.json.JSONUtil; import com.alibaba.fastjson.JSON; @@ -101,7 +102,7 @@ public class MdmModulePluginInitializer extends PluginBaseEntity { @Override public String getPluginName() { - return "MdmModulePlugin插件"; + return "主数据下发"; } @Override @@ -247,6 +248,7 @@ public class MdmModulePluginInitializer extends PluginBaseEntity { map.put("tableName",mdmModuleDbEntities.get(i).getDbName()); map.put("documentRule",documentRule); object = mdmModuleDao.queryMdmST(map); + object = toLowerCaseKeys(object); if(object.getString("id") == null || "".equals(object.getString("id")) ){ taskDetailEntity.setResult("当前数据不存在"); taskLivingDetailsService.updateLogFailToSuccess(taskDetailEntity); @@ -258,6 +260,8 @@ public class MdmModulePluginInitializer extends PluginBaseEntity { checkData.put("documentRule",documentRule); checkData.put("mdmModuleDistributeDetailEntities",mdmModuleDistributeDetailEntities); JSONObject object1 = mdmModuleDao.queryMdmST(checkData); + object1 = toLowerCaseKeys(object1); + if(object1.getString("id") == null || "".equals(object1.getString("id")) ){ taskDetailEntity.setResult("当前数据不符合规则不发送"); taskLivingDetailsService.updateLogFailToSuccess(taskDetailEntity); @@ -278,6 +282,7 @@ public class MdmModulePluginInitializer extends PluginBaseEntity { String[] idss = ids.split(","); mapDetail.put("id", idss[idss.length-1]); JSONObject objectDetail = mdmModuleDao.queryMdmST(mapDetail); + objectDetail = toLowerCaseKeys(objectDetail); object.put(mdmModuleDbFiledsEntities.get(i2).getEnName(),objectDetail); } } @@ -295,6 +300,8 @@ public class MdmModulePluginInitializer extends PluginBaseEntity { map.put("tableName",mdmModuleDbEntities.get(i).getDbName()); map.put("formmainId",object.getString("id")); List detail = mdmModuleDao.queryMdmSTDetail(map); + detail = toLowerCaseKeys(detail); + //查看主表是否有字段是关联的 if(detail != null && detail.size() > 0){ if(mdmModuleDbFiledsRuleEntities != null && mdmModuleDbFiledsRuleEntities.size() > 0){ @@ -312,6 +319,8 @@ public class MdmModulePluginInitializer extends PluginBaseEntity { mapDetail.put("id", idss[idss.length-1]); JSONObject objectDetail = mdmModuleDao.queryMdmST(mapDetail); + objectDetail = toLowerCaseKeys(objectDetail); + detail.get(i3).put(mdmModuleDbFiledsEntities.get(i2).getEnName(),objectDetail); } @@ -417,6 +426,7 @@ public class MdmModulePluginInitializer extends PluginBaseEntity { } //查询下发的配置 没有直接跳过 for (int i = 0; i < mdmModuleEntities.size(); i++) { + Long mdmCode = mdmModuleEntities.get(i).getMdmCode(); MdmModuleDistributeEntity queryMdmModuleDistributeEntity = new MdmModuleDistributeEntity(); queryMdmModuleDistributeEntity.setMdmId(mdmModuleEntities.get(i).getId()); queryMdmModuleDistributeEntity.setEnabledType("1"); @@ -446,11 +456,11 @@ public class MdmModulePluginInitializer extends PluginBaseEntity { List mdmModuleDbFiledsRuleEntities = mdmModuleDbFiledsRuleDao.queryBase(queryFildRule); //新增 - doAdd(mdmModuleDbEntities,mdmModuleDistributeEntities,mdmModuleDbFiledsRuleEntities,mdmModuleDbFiledsEntities); + doAdd(mdmCode,mdmModuleDbEntities,mdmModuleDistributeEntities,mdmModuleDbFiledsRuleEntities,mdmModuleDbFiledsEntities); //修改 - doUpdate(mdmModuleDbEntities,mdmModuleDistributeEntities,mdmModuleDbFiledsRuleEntities,mdmModuleDbFiledsEntities); + //doUpdate(mdmCode,mdmModuleDbEntities,mdmModuleDistributeEntities,mdmModuleDbFiledsRuleEntities,mdmModuleDbFiledsEntities); //删除 - doDelete(mdmModuleDbEntities,mdmModuleDistributeEntities,mdmModuleDbFiledsRuleEntities,mdmModuleDbFiledsEntities); + //doDelete(mdmCode,mdmModuleDbEntities,mdmModuleDistributeEntities,mdmModuleDbFiledsRuleEntities,mdmModuleDbFiledsEntities); } @@ -464,7 +474,7 @@ public class MdmModulePluginInitializer extends PluginBaseEntity { return BaseResult.getSuccessMessageEntity("执行成功"); } - private void doDelete(List mdmModuleDbEntities, List mdmModuleDistributeEntities, List mdmModuleDbFiledsRuleEntities, List mdmModuleDbFiledsEntities) { + private void doDelete(Long mainCode,List mdmModuleDbEntities, List mdmModuleDistributeEntities, List mdmModuleDbFiledsRuleEntities, List mdmModuleDbFiledsEntities) throws Exception { //查询一千条数据 String mainDb = null; List objects = new ArrayList<>(); @@ -480,8 +490,9 @@ public class MdmModulePluginInitializer extends PluginBaseEntity { map1.put("tableName",mainDb); map1.put("dataStatus", "N"); map1.put("deleteStatus", "0"); - map1.put("size", 1000); + map1.put("size", 10); objects = mdmModuleDao.queryMdmSTs(map1); + objects = toLowerCaseKeys(objects); if(objects == null || objects.size() == 0){ return; @@ -500,26 +511,28 @@ public class MdmModulePluginInitializer extends PluginBaseEntity { map.put("mdmModuleDistributeDetailEntities", mdmModuleDistributeDetailEntities); map.put("ids", objects); List doObjects = mdmModuleDao.queryMdmSTs(map); + doObjects = toLowerCaseKeys(doObjects); + if(doObjects == null || doObjects.size() == 0){ continue; } if(mdmModuleDistributeEntities.get(i1).getDeleteApi() == null || "".equals(mdmModuleDistributeEntities.get(i1).getDeleteApi())){ for (int i = 0; i < doObjects.size(); i++) { - saveMdmModuleSendLogEntity("2","删除接口未设置",mainDb,objects.get(i).getString("id"),null,null,doObjects.get(i).toJSONString(),"3"); + saveMdmModuleSendLogEntity(mainCode,mdmModuleDistributeEntities.get(i1).getId(),"2","删除接口未设置",mainDb,objects.get(i).getString("id"),null,null,doObjects.get(i).toJSONString(),"3"); } return ; } SysApplicationApiEntity apiEntity = sysApplicationApiDao.get(mdmModuleDistributeEntities.get(i1).getDeleteApi()); if(apiEntity == null || apiEntity.getId() == null ){ for (int i = 0; i < doObjects.size(); i++) { - saveMdmModuleSendLogEntity("2","删除接口未找到",mainDb,objects.get(i).getString("id"),null,null,doObjects.get(i).toJSONString(),"3"); + saveMdmModuleSendLogEntity(mainCode,mdmModuleDistributeEntities.get(i1).getId(),"2","删除接口未找到",mainDb,objects.get(i).getString("id"),null,null,doObjects.get(i).toJSONString(),"3"); } return ; } SysApplicationEntity sysApplicationEntity = sysApplicationDao.get(apiEntity.getAppId()); if(sysApplicationEntity == null || sysApplicationEntity.getId() == null ){ for (int i = 0; i < doObjects.size(); i++) { - saveMdmModuleSendLogEntity("2","删除接口的应用未找到",mainDb,objects.get(i).getString("id"),null,apiEntity.getApiName(),doObjects.get(i).toJSONString(),"3"); + saveMdmModuleSendLogEntity(mainCode,mdmModuleDistributeEntities.get(i1).getId(),"2","删除接口的应用未找到",mainDb,objects.get(i).getString("id"),null,apiEntity.getApiName(),doObjects.get(i).toJSONString(),"3"); } return ; } @@ -529,7 +542,7 @@ public class MdmModulePluginInitializer extends PluginBaseEntity { scriptEntity = sysApplicationScriptDao.get(mdmModuleDistributeEntities.get(i1).getDeleteScript()); if(scriptEntity == null || scriptEntity.getId() == null ){ for (int i = 0; i < doObjects.size(); i++) { - saveMdmModuleSendLogEntity("2","删除接口脚本未找到",mainDb,objects.get(i).getString("id"),sysApplicationEntity.getName(),apiEntity.getApiName(),doObjects.get(i).toJSONString(),"3"); + saveMdmModuleSendLogEntity(mainCode,mdmModuleDistributeEntities.get(i1).getId(),"2","删除接口脚本未找到",mainDb,objects.get(i).getString("id"),sysApplicationEntity.getName(),apiEntity.getApiName(),doObjects.get(i).toJSONString(),"3"); } return ; } @@ -576,7 +589,7 @@ public class MdmModulePluginInitializer extends PluginBaseEntity { querys = jsonResultEntity.getString("querys"); bodys = jsonResultEntity.getString("bodys"); }catch (Exception e){ - saveMdmModuleSendLogEntity("2","脚本处理失败",mainDb,objects.get(i).getString("id"),sysApplicationEntity.getName(),apiEntity.getApiName(),doObjects.get(i).toJSONString(),"3"); + saveMdmModuleSendLogEntity(mainCode,mdmModuleDistributeEntities.get(i1).getId(),"2","脚本处理失败",mainDb,objects.get(i).getString("id"),sysApplicationEntity.getName(),apiEntity.getApiName(),doObjects.get(i).toJSONString(),"3"); continue; } } @@ -592,7 +605,7 @@ public class MdmModulePluginInitializer extends PluginBaseEntity { //找到登陆接口 SysApplicationApiEntity loginApi = sysApplicationApiDao.get(apiEntity.getAuthenticationPort()); if (null == loginApi) { - saveMdmModuleSendLogEntity("2","发送错误,认证接口不存在",mainDb,objects.get(i).getString("id"),sysApplicationEntity.getName(),apiEntity.getApiName(),doObjects.get(i).toJSONString(),"1"); + saveMdmModuleSendLogEntity(mainCode,mdmModuleDistributeEntities.get(i1).getId(),"2","发送错误,认证接口不存在",mainDb,objects.get(i).getString("id"),sysApplicationEntity.getName(),apiEntity.getApiName(),doObjects.get(i).toJSONString(),"1"); continue; } String rzquerys = getQuery(loginApi,null,null); @@ -605,7 +618,7 @@ public class MdmModulePluginInitializer extends PluginBaseEntity { String rzbodys = getBodys(loginApi,null,null); JsonResultEntity rzjsonResultEntity = sendData(loginApi,rzheaders,rzbodys,rzquerys); if (!rzjsonResultEntity.isFlag()) { - saveMdmModuleSendLogEntity("2","发送错误,认证接口错误",mainDb,objects.get(i).getString("id"),sysApplicationEntity.getName(),apiEntity.getApiName(),doObjects.get(i).toJSONString(),"1"); + saveMdmModuleSendLogEntity(mainCode,mdmModuleDistributeEntities.get(i1).getId(),"2","发送错误,认证接口错误",mainDb,objects.get(i).getString("id"),sysApplicationEntity.getName(),apiEntity.getApiName(),doObjects.get(i).toJSONString(),"1"); continue; } JSONObject attritube = JSONObject.parseObject(rzjsonResultEntity.getAttribute().toString()); @@ -617,11 +630,11 @@ public class MdmModulePluginInitializer extends PluginBaseEntity { JsonResultEntity jsonResultEntity = sendData(apiEntity,headers,bodys,querys); if(jsonResultEntity.isFlag()){ //保存日志 - saveMdmModuleSendLogEntity("1","发送成功",mainDb,objects.get(i).getString("id"),sysApplicationEntity.getName(),apiEntity.getApiName(),doObjects.get(i).toJSONString(),"3"); + saveMdmModuleSendLogEntity(mainCode,mdmModuleDistributeEntities.get(i1).getId(),"1","发送成功",mainDb,objects.get(i).getString("id"),sysApplicationEntity.getName(),apiEntity.getApiName(),doObjects.get(i).toJSONString(),"3"); continue; }else { //保存日志 - saveMdmModuleSendLogEntity("2","转发失败",mainDb,objects.get(i).getString("id"),sysApplicationEntity.getName(),apiEntity.getApiName(),doObjects.get(i).toJSONString(),"3"); + saveMdmModuleSendLogEntity(mainCode,mdmModuleDistributeEntities.get(i1).getId(),"2","转发失败",mainDb,objects.get(i).getString("id"),sysApplicationEntity.getName(),apiEntity.getApiName(),doObjects.get(i).toJSONString(),"3"); continue; } } @@ -639,7 +652,7 @@ public class MdmModulePluginInitializer extends PluginBaseEntity { } } - private void doUpdate(List mdmModuleDbEntities, List mdmModuleDistributeEntities, List mdmModuleDbFiledsRuleEntities, List mdmModuleDbFiledsEntities) { + private void doUpdate(Long mainCode,List mdmModuleDbEntities, List mdmModuleDistributeEntities, List mdmModuleDbFiledsRuleEntities, List mdmModuleDbFiledsEntities) throws Exception { //查询一千条数据 String mainDb = null; List objects = new ArrayList<>(); @@ -655,8 +668,9 @@ public class MdmModulePluginInitializer extends PluginBaseEntity { map1.put("tableName",mainDb); //map1.put("dataStatus", "F"); map1.put("updateStatus", "0"); - map1.put("size", 1000); + map1.put("size", 10); objects = mdmModuleDao.queryMdmSTs(map1); + objects = toLowerCaseKeys(objects); if(objects == null || objects.size() == 0){ return; @@ -675,26 +689,28 @@ public class MdmModulePluginInitializer extends PluginBaseEntity { map.put("mdmModuleDistributeDetailEntities", mdmModuleDistributeDetailEntities); map.put("ids", objects); List doObjects = mdmModuleDao.queryMdmSTs(map); + doObjects = toLowerCaseKeys(doObjects); + if(doObjects == null || doObjects.size() == 0){ continue; } if(mdmModuleDistributeEntities.get(i1).getUpdateApi() == null || "".equals(mdmModuleDistributeEntities.get(i1).getUpdateApi())){ for (int i = 0; i < doObjects.size(); i++) { - saveMdmModuleSendLogEntity("2","修改接口未设置",mainDb,objects.get(i).getString("id"),null,null,doObjects.get(i).toJSONString(),"2"); + saveMdmModuleSendLogEntity(mainCode,mdmModuleDistributeEntities.get(i1).getId(),"2","修改接口未设置",mainDb,objects.get(i).getString("id"),null,null,doObjects.get(i).toJSONString(),"2"); } return ; } SysApplicationApiEntity apiEntity = sysApplicationApiDao.get(mdmModuleDistributeEntities.get(i1).getUpdateApi()); if(apiEntity == null || apiEntity.getId() == null ){ for (int i = 0; i < doObjects.size(); i++) { - saveMdmModuleSendLogEntity("2","修改接口未查找到",mainDb,objects.get(i).getString("id"),null,null,doObjects.get(i).toJSONString(),"2"); + saveMdmModuleSendLogEntity(mainCode,mdmModuleDistributeEntities.get(i1).getId(),"2","修改接口未查找到",mainDb,objects.get(i).getString("id"),null,null,doObjects.get(i).toJSONString(),"2"); } return ; } SysApplicationEntity sysApplicationEntity = sysApplicationDao.get(apiEntity.getAppId()); if(sysApplicationEntity == null || sysApplicationEntity.getId() == null ){ for (int i = 0; i < doObjects.size(); i++) { - saveMdmModuleSendLogEntity("2","应用未查找到",mainDb,objects.get(i).getString("id"),null,apiEntity.getApiName(),doObjects.get(i).toJSONString(),"2"); + saveMdmModuleSendLogEntity(mainCode,mdmModuleDistributeEntities.get(i1).getId(),"2","应用未查找到",mainDb,objects.get(i).getString("id"),null,apiEntity.getApiName(),doObjects.get(i).toJSONString(),"2"); } return ; } @@ -704,7 +720,7 @@ public class MdmModulePluginInitializer extends PluginBaseEntity { scriptEntity = sysApplicationScriptDao.get(mdmModuleDistributeEntities.get(i1).getUpdateScript()); if(scriptEntity == null || scriptEntity.getId() == null ){ for (int i = 0; i < doObjects.size(); i++) { - saveMdmModuleSendLogEntity("2","脚本未查找到",mainDb,objects.get(i).getString("id"),sysApplicationEntity.getName(),apiEntity.getApiName(),doObjects.get(i).toJSONString(),"2"); + saveMdmModuleSendLogEntity(mainCode,mdmModuleDistributeEntities.get(i1).getId(),"2","脚本未查找到",mainDb,objects.get(i).getString("id"),sysApplicationEntity.getName(),apiEntity.getApiName(),doObjects.get(i).toJSONString(),"2"); } return ; } @@ -742,7 +758,7 @@ public class MdmModulePluginInitializer extends PluginBaseEntity { querys = jsonResultEntity.getString("querys"); bodys = jsonResultEntity.getString("bodys"); }catch (Exception e){ - saveMdmModuleSendLogEntity("2","脚本处理失败",mainDb,objects.get(i).getString("id"),sysApplicationEntity.getName(),apiEntity.getApiName(),doObjects.get(i).toJSONString(),"2"); + saveMdmModuleSendLogEntity(mainCode,mdmModuleDistributeEntities.get(i1).getId(),"2","脚本处理失败",mainDb,objects.get(i).getString("id"),sysApplicationEntity.getName(),apiEntity.getApiName(),doObjects.get(i).toJSONString(),"2"); continue; } } @@ -758,7 +774,7 @@ public class MdmModulePluginInitializer extends PluginBaseEntity { //找到登陆接口 SysApplicationApiEntity loginApi = sysApplicationApiDao.get(apiEntity.getAuthenticationPort()); if (null == loginApi) { - saveMdmModuleSendLogEntity("2","发送错误,认证接口不存在",mainDb,objects.get(i).getString("id"),sysApplicationEntity.getName(),apiEntity.getApiName(),doObjects.get(i).toJSONString(),"1"); + saveMdmModuleSendLogEntity(mainCode,mdmModuleDistributeEntities.get(i1).getId(),"2","发送错误,认证接口不存在",mainDb,objects.get(i).getString("id"),sysApplicationEntity.getName(),apiEntity.getApiName(),doObjects.get(i).toJSONString(),"1"); continue; } String rzquerys = getQuery(loginApi,null,null); @@ -771,7 +787,7 @@ public class MdmModulePluginInitializer extends PluginBaseEntity { String rzbodys = getBodys(loginApi,null,null); JsonResultEntity rzjsonResultEntity = sendData(loginApi,rzheaders,rzbodys,rzquerys); if (!rzjsonResultEntity.isFlag()) { - saveMdmModuleSendLogEntity("2","发送错误,认证接口错误",mainDb,objects.get(i).getString("id"),sysApplicationEntity.getName(),apiEntity.getApiName(),doObjects.get(i).toJSONString(),"1"); + saveMdmModuleSendLogEntity(mainCode,mdmModuleDistributeEntities.get(i1).getId(),"2","发送错误,认证接口错误",mainDb,objects.get(i).getString("id"),sysApplicationEntity.getName(),apiEntity.getApiName(),doObjects.get(i).toJSONString(),"1"); continue; } JSONObject attritube = JSONObject.parseObject(rzjsonResultEntity.getAttribute().toString()); @@ -783,11 +799,11 @@ public class MdmModulePluginInitializer extends PluginBaseEntity { JsonResultEntity jsonResultEntity = sendData(apiEntity,headers,bodys,querys); if(jsonResultEntity.isFlag()){ //保存日志 - saveMdmModuleSendLogEntity("1","发送成功",mainDb,objects.get(i).getString("id"),sysApplicationEntity.getName(),apiEntity.getApiName(),doObjects.get(i).toJSONString(),"2"); + saveMdmModuleSendLogEntity(mainCode,mdmModuleDistributeEntities.get(i1).getId(),"1","发送成功",mainDb,objects.get(i).getString("id"),sysApplicationEntity.getName(),apiEntity.getApiName(),doObjects.get(i).toJSONString(),"2"); continue; }else { //保存日志 - saveMdmModuleSendLogEntity("2","转发失败",mainDb,objects.get(i).getString("id"),sysApplicationEntity.getName(),apiEntity.getApiName(),doObjects.get(i).toJSONString(),"2"); + saveMdmModuleSendLogEntity(mainCode,mdmModuleDistributeEntities.get(i1).getId(),"2","转发失败",mainDb,objects.get(i).getString("id"),sysApplicationEntity.getName(),apiEntity.getApiName(),doObjects.get(i).toJSONString(),"2"); continue; } } @@ -812,7 +828,7 @@ public class MdmModulePluginInitializer extends PluginBaseEntity { * @param mdmModuleDistributeEntities * @return void **/ - private void doAdd(List mdmModuleDbEntities, List mdmModuleDistributeEntities,List mdmModuleDbFiledsRuleEntities,List mdmModuleDbFiledsEntities ) { + private void doAdd(Long mainCode,List mdmModuleDbEntities, List mdmModuleDistributeEntities,List mdmModuleDbFiledsRuleEntities,List mdmModuleDbFiledsEntities ) throws Exception { //查询一千条数据 String mainDb = null; List objects = new ArrayList<>(); @@ -828,8 +844,9 @@ public class MdmModulePluginInitializer extends PluginBaseEntity { map1.put("tableName",mainDb); //map1.put("dataStatus", "Y"); map1.put("addStatus", "0"); - map1.put("size", 1000); + map1.put("size", 10); objects = mdmModuleDao.queryMdmSTs(map1); + objects = toLowerCaseKeys(objects); if(objects == null || objects.size() == 0){ return; @@ -848,26 +865,29 @@ public class MdmModulePluginInitializer extends PluginBaseEntity { map.put("mdmModuleDistributeDetailEntities", mdmModuleDistributeDetailEntities); map.put("ids", objects); List doObjects = mdmModuleDao.queryMdmSTs(map); + doObjects = toLowerCaseKeys(doObjects); + if(doObjects == null || doObjects.size() == 0){ continue; } if(mdmModuleDistributeEntities.get(i1).getAddApi() == null || "".equals(mdmModuleDistributeEntities.get(i1).getAddApi())){ for (int i = 0; i < doObjects.size(); i++) { - saveMdmModuleSendLogEntity("2","新增接口未设置",mainDb,objects.get(i).getString("id"),null,null,doObjects.get(i).toJSONString(),"1"); + //taskLivingDetailsService.saveLogToSuccess(); + saveMdmModuleSendLogEntity( mainCode,mdmModuleDistributeEntities.get(i1).getId(),"2","新增接口未设置",mainDb,objects.get(i).getString("id"),null,null,doObjects.get(i).toJSONString(),"1"); } return ; } SysApplicationApiEntity apiEntity = sysApplicationApiDao.get(mdmModuleDistributeEntities.get(i1).getAddApi()); if(apiEntity == null || apiEntity.getId() == null ){ for (int i = 0; i < doObjects.size(); i++) { - saveMdmModuleSendLogEntity("2","新增接口未查找到",mainDb,objects.get(i).getString("id"),null,null,doObjects.get(i).toJSONString(),"1"); + saveMdmModuleSendLogEntity(mainCode,mdmModuleDistributeEntities.get(i1).getId(),"2","新增接口未查找到",mainDb,objects.get(i).getString("id"),null,null,doObjects.get(i).toJSONString(),"1"); } return ; } SysApplicationEntity sysApplicationEntity = sysApplicationDao.get(apiEntity.getAppId()); if(sysApplicationEntity == null || sysApplicationEntity.getId() == null ){ for (int i = 0; i < doObjects.size(); i++) { - saveMdmModuleSendLogEntity("2","应用未查找到",mainDb,objects.get(i).getString("id"),null,apiEntity.getApiName(),doObjects.get(i).toJSONString(),"1"); + saveMdmModuleSendLogEntity(mainCode,mdmModuleDistributeEntities.get(i1).getId(),"2","应用未查找到",mainDb,objects.get(i).getString("id"),null,apiEntity.getApiName(),doObjects.get(i).toJSONString(),"1"); } return ; } @@ -877,7 +897,7 @@ public class MdmModulePluginInitializer extends PluginBaseEntity { scriptEntity = sysApplicationScriptDao.get(mdmModuleDistributeEntities.get(i1).getAddScript()); if(scriptEntity == null || scriptEntity.getId() == null ){ for (int i = 0; i < doObjects.size(); i++) { - saveMdmModuleSendLogEntity("2","脚本未查找到",mainDb,objects.get(i).getString("id"),sysApplicationEntity.getName(),apiEntity.getApiName(),doObjects.get(i).toJSONString(),"1"); + saveMdmModuleSendLogEntity(mainCode,mdmModuleDistributeEntities.get(i1).getId(),"2","脚本未查找到",mainDb,objects.get(i).getString("id"),sysApplicationEntity.getName(),apiEntity.getApiName(),doObjects.get(i).toJSONString(),"1"); } return ; } @@ -924,7 +944,7 @@ public class MdmModulePluginInitializer extends PluginBaseEntity { querys = jsonResultEntity.getString("querys"); bodys = jsonResultEntity.getString("bodys"); }catch (Exception e){ - saveMdmModuleSendLogEntity("2","脚本处理失败",mainDb,objects.get(i).getString("id"),sysApplicationEntity.getName(),apiEntity.getApiName(),doObjects.get(i).toJSONString(),"1"); + saveMdmModuleSendLogEntity(mainCode,mdmModuleDistributeEntities.get(i1).getId(),"2","脚本处理失败",mainDb,objects.get(i).getString("id"),sysApplicationEntity.getName(),apiEntity.getApiName(),doObjects.get(i).toJSONString(),"1"); continue; } } @@ -940,7 +960,7 @@ public class MdmModulePluginInitializer extends PluginBaseEntity { //找到登陆接口 SysApplicationApiEntity loginApi = sysApplicationApiDao.get(apiEntity.getAuthenticationPort()); if (null == loginApi) { - saveMdmModuleSendLogEntity("2","发送错误,认证接口不存在",mainDb,objects.get(i).getString("id"),sysApplicationEntity.getName(),apiEntity.getApiName(),doObjects.get(i).toJSONString(),"1"); + saveMdmModuleSendLogEntity(mainCode,mdmModuleDistributeEntities.get(i1).getId(),"2","发送错误,认证接口不存在",mainDb,objects.get(i).getString("id"),sysApplicationEntity.getName(),apiEntity.getApiName(),doObjects.get(i).toJSONString(),"1"); continue; } String rzquerys = getQuery(loginApi,null,null); @@ -953,7 +973,7 @@ public class MdmModulePluginInitializer extends PluginBaseEntity { String rzbodys = getBodys(loginApi,null,null); JsonResultEntity rzjsonResultEntity = sendData(loginApi,rzheaders,rzbodys,rzquerys); if (!rzjsonResultEntity.isFlag()) { - saveMdmModuleSendLogEntity("2","发送错误,认证接口错误",mainDb,objects.get(i).getString("id"),sysApplicationEntity.getName(),apiEntity.getApiName(),doObjects.get(i).toJSONString(),"1"); + saveMdmModuleSendLogEntity(mainCode,mdmModuleDistributeEntities.get(i1).getId(),"2","发送错误,认证接口错误",mainDb,objects.get(i).getString("id"),sysApplicationEntity.getName(),apiEntity.getApiName(),doObjects.get(i).toJSONString(),"1"); continue; } JSONObject attritube = JSONObject.parseObject(rzjsonResultEntity.getAttribute().toString()); @@ -966,11 +986,11 @@ public class MdmModulePluginInitializer extends PluginBaseEntity { JsonResultEntity jsonResultEntity = sendData(apiEntity,headers,bodys,querys); if(jsonResultEntity.isFlag()){ //保存日志 - saveMdmModuleSendLogEntity("1","发送成功",mainDb,objects.get(i).getString("id"),sysApplicationEntity.getName(),apiEntity.getApiName(),doObjects.get(i).toJSONString(),"1"); + saveMdmModuleSendLogEntity(mainCode,mdmModuleDistributeEntities.get(i1).getId(),"1","发送成功",mainDb,objects.get(i).getString("id"),sysApplicationEntity.getName(),apiEntity.getApiName(),doObjects.get(i).toJSONString(),"1"); continue; }else { //保存日志 - saveMdmModuleSendLogEntity("2","转发失败",mainDb,objects.get(i).getString("id"),sysApplicationEntity.getName(),apiEntity.getApiName(),doObjects.get(i).toJSONString(),"1"); + saveMdmModuleSendLogEntity(mainCode,mdmModuleDistributeEntities.get(i1).getId(),"2","转发失败",mainDb,objects.get(i).getString("id"),sysApplicationEntity.getName(),apiEntity.getApiName(),doObjects.get(i).toJSONString(),"1"); continue; } } @@ -987,7 +1007,7 @@ public class MdmModulePluginInitializer extends PluginBaseEntity { } } - private void saveMdmModuleSendLogEntity(String dataType,String remark,String dbname,String formmain_id, String target_app, String target_api, String source_data, String option_type) { + private void saveMdmModuleSendLogEntity(Long mdmCode,String distributeId,String dataType,String remark,String dbname,String formmain_id, String target_app, String target_api, String source_data, String option_type) throws Exception { MdmModuleSendLogEntity mdmModuleSendLogEntity = new MdmModuleSendLogEntity(); mdmModuleSendLogEntity.setTableName(dbname+"_send_log"); mdmModuleSendLogEntity.setId(UUIDUtils.getUUID()); @@ -1006,6 +1026,35 @@ public class MdmModulePluginInitializer extends PluginBaseEntity { mdmModuleSendLogEntity.setDataType(dataType); mdmModuleSendLogEntity.setRemark(remark); mdmModuleSendLogDao.save(mdmModuleSendLogEntity); + + + JSONObject jsonObject = JSONObject.parseObject(source_data); + IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = new IntegrationTaskLivingDetailsEntity(); + integrationTaskLivingDetailsEntity.setId(UUIDUtils.getUUID()); + integrationTaskLivingDetailsEntity.setSts("Y"); + integrationTaskLivingDetailsEntity.setCreate_user_id("1"); + integrationTaskLivingDetailsEntity.setModify_user_id("1"); + integrationTaskLivingDetailsEntity.setCreate_time(new Date()); + integrationTaskLivingDetailsEntity.setModify_time(new Date()); + integrationTaskLivingDetailsEntity.setOrg_id("0"); + integrationTaskLivingDetailsEntity.setCompanyId("0"); + JSONObject aa = new JSONObject(); + aa.put("mdmCode",mdmCode);//主数据编码 + aa.put("documentRule",jsonObject.getString("document_rule"));//行数据的单据规则编码 + aa.put("distributeId",distributeId);//发送表id + aa.put("type",option_type);//发送类型,1、新增2、修改3、删除 + integrationTaskLivingDetailsEntity.setRootAppPk(aa.toJSONString()); + integrationTaskLivingDetailsEntity.setRootAppBill(jsonObject.getString("document_rule")); + integrationTaskLivingDetailsEntity.setPluginId("MdmModulePlugin"); + integrationTaskLivingDetailsEntity.setRootAppNewData(source_data); + integrationTaskLivingDetailsEntity.setNewTransmitInfo(remark); + if("1".equals(dataType)){ + taskLivingDetailsService.saveLogToSuccess(integrationTaskLivingDetailsEntity); + }else { + taskLivingDetailsService.saveLogToFail(integrationTaskLivingDetailsEntity); + + } + } private JSONObject getDetailData(List mdmModuleDbEntities, JSONObject object, List mdmModuleDbFiledsRuleEntities,List mdmModuleDbFiledsEntities) { @@ -1016,6 +1065,8 @@ public class MdmModulePluginInitializer extends PluginBaseEntity { map.put("tableName",mdmModuleDbEntities.get(i).getDbName()); map.put("formmainId",object.getString("id")); List detail = mdmModuleDao.queryMdmSTDetail(map); + detail = toLowerCaseKeys(detail); + //查看主表是否有字段是关联的 if(detail != null && detail.size() > 0){ if(mdmModuleDbFiledsRuleEntities != null && mdmModuleDbFiledsRuleEntities.size() > 0){ @@ -1032,6 +1083,8 @@ public class MdmModulePluginInitializer extends PluginBaseEntity { String[] idss = ids.split(","); mapDetail.put("id", idss[idss.length-1]); JSONObject objectDetail = mdmModuleDao.queryMdmST(mapDetail); + objectDetail = toLowerCaseKeys(objectDetail); + detail.get(i3).put(mdmModuleDbFiledsEntities.get(i2).getEnName(),objectDetail); } } @@ -1275,4 +1328,23 @@ public class MdmModulePluginInitializer extends PluginBaseEntity { } return sendData.toString(); } + public JSONObject toLowerCaseKeys(JSONObject jsonObject) { + JSONObject lowerCaseJson = new JSONObject(); + if (jsonObject != null) { + for (String key : jsonObject.keySet()) { + Object value = jsonObject.get(key); + lowerCaseJson.put(key.toLowerCase(), value); + } + } + return lowerCaseJson; + } + public List toLowerCaseKeys(List list) { + List jsonObjects = new ArrayList<>(); + if (list != null && list.size() > 0) { + for (int i = 0; i < list.size(); i++) { + jsonObjects.add(toLowerCaseKeys(list.get(i))); + } + } + return jsonObjects; + } } diff --git a/buildpackage/src/main/resources/application-llg.yml b/buildpackage/src/main/resources/application-llg.yml index c1e105f8..5ea08d90 100644 --- a/buildpackage/src/main/resources/application-llg.yml +++ b/buildpackage/src/main/resources/application-llg.yml @@ -22,12 +22,15 @@ spring: # password: 62e4295b615a30dbf3b8ee96f41c820b # driver-class-name: dm.jdbc.driver.DmDriver # type: com.alibaba.druid.pool.DruidDataSource - url: jdbc:mysql://hzya.ufyct.com:9014/businesscenter?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF8&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowLoadLocalInfile=false&autoReconnect=true&failOverReadOnly=false&connectTimeout=30000&socketTimeout=30000&autoReconnectForPools=true - username: root - password: 62e4295b615a30dbf3b8ee96f41c820b - driver-class-name: com.mysql.jdbc.Driver # 3.2.0开始支持SPI可省略此配置 +# url: jdbc:mysql://hzya.ufyct.com:9014/businesscenter?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF8&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowLoadLocalInfile=false&autoReconnect=true&failOverReadOnly=false&connectTimeout=30000&socketTimeout=30000&autoReconnectForPools=true +# username: root +# password: 62e4295b615a30dbf3b8ee96f41c820b +# driver-class-name: com.mysql.jdbc.Driver # 3.2.0开始支持SPI可省略此配置 # url: jdbc:dm://hzya.ufyct.com:9040/businesscenter?zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf-8 - + url: jdbc:dm://hzya.ufyct.com:9040?schema=businesscenter&zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf-8&compatibleMode=oracle + username: hzyazt + password: 62e4295b615a30dbf3b8ee96f41c820b + driver-class-name: dm.jdbc.driver.DmDriver savefile: # 文件保存路径 path: /Users/apple/Desktop/log/local diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModule/dao/IMdmModuleDao.java b/service/src/main/java/com/hzya/frame/mdm/mdmModule/dao/IMdmModuleDao.java index 9a3aca15..7e82e37b 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModule/dao/IMdmModuleDao.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModule/dao/IMdmModuleDao.java @@ -63,6 +63,6 @@ public interface IMdmModuleDao extends IBaseDao { * @param * @return java.util.List **/ - List queryMdMFields(Map maps); + //List queryMdMFields(Map maps); } diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModule/dao/impl/MdmModuleDaoImpl.java b/service/src/main/java/com/hzya/frame/mdm/mdmModule/dao/impl/MdmModuleDaoImpl.java index 8ad07591..c65d5056 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModule/dao/impl/MdmModuleDaoImpl.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModule/dao/impl/MdmModuleDaoImpl.java @@ -114,10 +114,10 @@ public class MdmModuleDaoImpl extends MybatisGenericDao @Override public List> queryMdmShowData(MdmQuery entity) { - HashMap maps = new HashMap<>(); - maps.put("tableName",entity.getTableName()); - List fields = queryMdMFields(maps); - entity.setFields(fields); + //HashMap maps = new HashMap<>(); + //maps.put("tableName",entity.getTableName()); + //List fields = queryMdMFields(maps); + //entity.setFields(fields); List> o = (List>) super.selectList(getSqlIdPrifx() + "queryMdmShowData", entity); return o; } @@ -155,9 +155,8 @@ public class MdmModuleDaoImpl extends MybatisGenericDao @Override public JSONObject queryMdmST(Map maps) { - - List fields = queryMdMFields(maps); - maps.put("fields",fields); + //List fields = queryMdMFields(maps); + //maps.put("fields",fields); JSONObject o = (JSONObject) super.selectOne(getSqlIdPrifx() + "queryMdmST", maps); return o; } @@ -172,16 +171,16 @@ public class MdmModuleDaoImpl extends MybatisGenericDao super.update(getSqlIdPrifx() + "updateMdmSTs", maps); } - @Override - public List queryMdMFields(Map maps) { - List o = (List) super.selectList(getSqlIdPrifx() + "queryMdMFields", maps); - return o; - } + //@Override + //public List queryMdMFields(Map maps) { + // List o = (List) super.selectList(getSqlIdPrifx() + "queryMdMFields", maps); + // return o; + //} @Override public List queryMdmSTDetail(Map maps) { - List fields = queryMdMFields(maps); - maps.put("fields", fields ); + //List fields = queryMdMFields(maps); + //maps.put("fields", fields ); List o = (List) super.selectList(getSqlIdPrifx() + "queryMdmSTDetail", maps); return o; } diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModule/entity/MdmModuleEntity.xml b/service/src/main/java/com/hzya/frame/mdm/mdmModule/entity/MdmModuleEntity.xml index 74181086..b8866446 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModule/entity/MdmModuleEntity.xml +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModule/entity/MdmModuleEntity.xml @@ -554,10 +554,7 @@ where id = #{id} - - - a.${field} - + a.* from ${tableName} a @@ -663,11 +660,61 @@ where id = #{id} - modify_time = now(), where id = #{id} + + insert into ${tableName}( + + + + + ${item.filedsName}, + + + create_user_id, + modify_user_id, + + + + create_time, + modify_time, + sts, + + document_rule, + document_rule_num, + + + )values + ( + + + + + #{item.filedsValue}, + + + #{item.filedsValue}, + #{item.filedsValue}, + + + + now(), + now(), + 'Y', + + + + concat(#{documentRule}, + LPAD( CAST( ( SELECT IFNULL( MAX(f.document_rule_num), 0 )+ 1 FROM ${tableName} f WHERE DATE_FORMAT( f.create_time, '%Y-%m' ) = DATE_FORMAT( now(), '%Y-%m' ) ) AS varchar(50) ), ${documentRuleNum} , '0' ) + ), + (SELECT IFNULL( MAX(f.document_rule_num), 0 )+ 1 FROM ${tableName} f WHERE DATE_FORMAT( f.create_time, '%Y-%m' ) = DATE_FORMAT( now(), '%Y-%m' ) + ) + + + ) + insert into ${tableName}( @@ -822,9 +869,15 @@ where id = #{id} diff --git a/service/src/main/java/com/hzya/frame/mdm/service/impl/MdmServiceImpl.java b/service/src/main/java/com/hzya/frame/mdm/service/impl/MdmServiceImpl.java index 28451124..6c202849 100644 --- a/service/src/main/java/com/hzya/frame/mdm/service/impl/MdmServiceImpl.java +++ b/service/src/main/java/com/hzya/frame/mdm/service/impl/MdmServiceImpl.java @@ -610,7 +610,7 @@ public class MdmServiceImpl implements IMdmService { if (entity == null) { return BaseResult.getFailureMessageEntity("参数不允许为空"); } - if(entity.getMdmCode() != null && !"".equals(entity.getMdmCode())){ + if (entity.getMdmCode() != null && !"".equals(entity.getMdmCode())) { MdmModuleEntity mdmModuleEntity = mdmServiceCache.getMdmModuleEntity(entity.getMdmCode()); if (mdmModuleEntity == null || mdmModuleEntity.getId() == null) { return BaseResult.getFailureMessageEntity("主数据设置错误"); @@ -619,11 +619,25 @@ public class MdmServiceImpl implements IMdmService { mdmModuleDbEntity.setMdmId(mdmModuleEntity.getId()); mdmModuleDbEntity.setSts("Y"); List mdmModuleDbEntities = mdmServiceCache.queryMdmModuleDb(mdmModuleDbEntity); + MdmModuleDbFiledsEntity mdmModuleDbFiledsEntity = new MdmModuleDbFiledsEntity(); + mdmModuleDbFiledsEntity.setMdmId(mdmModuleEntity.getId()); + mdmModuleDbFiledsEntity.setSts("Y"); + List mdmModuleDbFiledsEntities = mdmServiceCache.queryMdmModuleDbFileds(mdmModuleDbFiledsEntity); if (mdmModuleDbEntities == null || mdmModuleDbEntities.size() == 0) { return BaseResult.getFailureMessageEntity("主数据设置错误"); } + if (mdmModuleDbFiledsEntities == null || mdmModuleDbFiledsEntities.size() == 0) { + return BaseResult.getFailureMessageEntity("主数据设置错误"); + } for (int i = 0; i < mdmModuleDbEntities.size(); i++) { if ("1".equals(mdmModuleDbEntities.get(i).getDbType())) { + List returnField = new ArrayList<>(); + for (int i1 = 0; i1 < mdmModuleDbFiledsEntities.size(); i1++) { + if (mdmModuleDbEntities.get(i).getId().equals(mdmModuleDbFiledsEntities.get(i1).getDbId())) { + returnField.add(mdmModuleDbFiledsEntities.get(i1).getEnName()); + } + } + entity.setReturnField(returnField); entity.setTableName(mdmModuleDbEntities.get(i).getDbName()); break; } @@ -642,8 +656,9 @@ public class MdmServiceImpl implements IMdmService { PageInfo pageInfo = new PageInfo(businessResult); return BaseResult.getSuccessMessageEntity("查询数据成功", pageInfo); } + //强制转换数据库字段为小写,出问题在说 - public static void convertKeysToLowerCase(List> list) { + public void convertKeysToLowerCase(List> list) { for (HashMap map : list) { HashMap lowerCaseMap = new HashMap<>(); for (Map.Entry entry : map.entrySet()) { @@ -653,6 +668,16 @@ public class MdmServiceImpl implements IMdmService { map.putAll(lowerCaseMap); // 将转换后的Map全部放回原位 } } + + //强制转换数据库字段为小写,出问题在说 + public void convertKeysToLowerCase(HashMap list) { + HashMap lowerCaseMap = new HashMap<>(); + for (Map.Entry entry : list.entrySet()) { + lowerCaseMap.put(entry.getKey().toLowerCase(), entry.getValue()); + } + list.clear(); // 清空原来的Map,避免重复存储 + list.putAll(lowerCaseMap); // 将转换后的Map全部放回原位 + } // ///** // * @param object @@ -761,10 +786,12 @@ public class MdmServiceImpl implements IMdmService { if (entity.getPageNum() != null && entity.getPageSize() != null) { PageHelper.startPage(entity.getPageNum(), entity.getPageSize()); List> mapList = mdmModuleDao.querySelectData(entity); + convertKeysToLowerCase(mapList); PageInfo pageInfo = new PageInfo(mapList); return BaseResult.getSuccessMessageEntity("查询数据成功", pageInfo); } else { List> mapList = mdmModuleDao.querySelectData(entity); + convertKeysToLowerCase(mapList); return BaseResult.getSuccessMessageEntity("查询数据成功", mapList); } } @@ -792,7 +819,7 @@ public class MdmServiceImpl implements IMdmService { if (entity.getUpId() == null || "".equals(entity.getUpId())) { return BaseResult.getFailureMessageEntity("系统错误"); } - if(entity.getMdmCode() != null && !"".equals(entity.getMdmCode())){ + if (entity.getMdmCode() != null && !"".equals(entity.getMdmCode())) { //查询模版 MdmModuleEntity mdmModuleEntities = mdmServiceCache.getMdmModuleEntity(entity.getMdmCode()); if (mdmModuleEntities == null) { @@ -812,6 +839,7 @@ public class MdmServiceImpl implements IMdmService { break; } } + entity.setTableName(mdmModuleDbEntity.getDbName()); } @@ -827,6 +855,7 @@ public class MdmServiceImpl implements IMdmService { List> returnList = new ArrayList<>(); return BaseResult.getSuccessMessageEntity("查询数据成功", returnList); } + convertKeysToLowerCase(mapList); List> returnList = gettochilder(strArray, 0, mapList); return BaseResult.getSuccessMessageEntity("查询数据成功", returnList); } else { @@ -835,8 +864,12 @@ public class MdmServiceImpl implements IMdmService { List> returnList = new ArrayList<>(); return BaseResult.getSuccessMessageEntity("查询数据成功", returnList); } + HashMap lowerCaseMap = new HashMap<>(); + for (Map.Entry entry : mapList.entrySet()) { + lowerCaseMap.put(entry.getKey().toLowerCase(), entry.getValue()); + } List> returnList = new ArrayList<>(); - returnList.add(mapList); + returnList.add(lowerCaseMap); return BaseResult.getSuccessMessageEntity("查询数据成功", returnList); } } else { @@ -844,6 +877,7 @@ public class MdmServiceImpl implements IMdmService { List> returnList = new ArrayList<>(); if (mapList != null && mapList.size() > 0) { + convertKeysToLowerCase(mapList); for (int i = 0; i < mapList.size(); i++) { //默认为根 if (mapList.get(i).get(entity.getUpId()) == null || "".equals(mapList.get(i).get(entity.getUpId()))) { @@ -1315,7 +1349,7 @@ public class MdmServiceImpl implements IMdmService { //String tablename = null; JSONObject jsonObject = new JSONObject(); for (int i = 0; i < mdmModuleDbEntityList.size(); i++) { - if("1".equals(mdmModuleDbEntityList.get(i).getDbType()) || "2".equals(mdmModuleDbEntityList.get(i).getDbType())){ + if ("1".equals(mdmModuleDbEntityList.get(i).getDbType()) || "2".equals(mdmModuleDbEntityList.get(i).getDbType())) { //查询数据 Map queryData = new HashMap<>(); queryData.put("tableName", mdmModuleDbEntityList.get(i).getDbName());//表名 @@ -1323,12 +1357,15 @@ public class MdmServiceImpl implements IMdmService { queryData.put("detailFlag", false);//是否明细 queryData.put("id", entity.getId());//字段 HashMap datas = mdmModuleDbDao.getServiceDataById(queryData); + convertKeysToLowerCase(datas); + jsonObject.put(mdmModuleDbEntityList.get(i).getDbName(), datas); //tablename = mdmModuleDbEntityList.get(i).getDbName() + "_distribute"; } else { queryData.put("detailFlag", true);//是否明细 queryData.put("id", entity.getId());//字段 List> datas = mdmModuleDbDao.getServiceByFormmainId(queryData); + convertKeysToLowerCase(datas); jsonObject.put(mdmModuleDbEntityList.get(i).getDbName(), datas); } } @@ -1380,7 +1417,7 @@ public class MdmServiceImpl implements IMdmService { if (mdmModuleDbEntityList == null || mdmModuleDbEntityList.size() == 0) { return BaseResult.getFailureMessageEntity("系统错误"); } - String res = checkDataOnly(jsonObject.getInteger("mdmCode"), saveData, true, mdmModuleEntity, mdmModuleDbEntityList,"界面修改"); + String res = checkDataOnly(jsonObject.getInteger("mdmCode"), saveData, true, mdmModuleEntity, mdmModuleDbEntityList, "界面修改"); if (res == null || "".equals(res)) { return BaseResult.getSuccessMessageEntity("修改数据成功"); @@ -1426,7 +1463,7 @@ public class MdmServiceImpl implements IMdmService { } - String res = checkDataOnly(jsonObject.getInteger("mdmCode"), saveData, false, mdmModuleEntity, mdmModuleDbEntityList,"界面新增"); + String res = checkDataOnly(jsonObject.getInteger("mdmCode"), saveData, false, mdmModuleEntity, mdmModuleDbEntityList, "界面新增"); if (res == null || "".equals(res)) { return BaseResult.getSuccessMessageEntity("保存数据成功"); @@ -1435,9 +1472,9 @@ public class MdmServiceImpl implements IMdmService { } } - private void saveOption(String dbname ,Long mdmCode ,JSONObject jsonObject,String id,String msg) { + private void saveOption(String dbname, Long mdmCode, JSONObject jsonObject, String id, String msg) { MdmModuleOptionLogEntity mdmModuleOptionLogEntity = new MdmModuleOptionLogEntity(); - mdmModuleOptionLogEntity.setTableName(dbname+"_option_log"); + mdmModuleOptionLogEntity.setTableName(dbname + "_option_log"); mdmModuleOptionLogEntity.setMdmCode(mdmCode); mdmModuleOptionLogEntity.setFormmainId(id); mdmModuleOptionLogEntity.setSourceName("数智中台"); @@ -1447,7 +1484,7 @@ public class MdmServiceImpl implements IMdmService { mdmModuleOptionLogEntity.setSourceData(jsonObject.toJSONString()); mdmModuleOptionLogEntity.setOptionType(msg); SysUserEntity sysUserEntity = sysUserDao.get(StpUtil.getLoginIdAsString()); - if(sysUserEntity != null){ + if (sysUserEntity != null) { mdmModuleOptionLogEntity.setOptionName(sysUserEntity.getPersonName()); } mdmModuleOptionLogEntity.setCreate(); @@ -1516,6 +1553,8 @@ public class MdmServiceImpl implements IMdmService { queryData.put("detailFlag", false);//是否明细 queryData.put("id", jsonObject.getString("id"));//字段 HashMap datas = mdmModuleDbDao.getServiceDataById(queryData); + convertKeysToLowerCase(datas); + String upValue = null; if (datas != null && datas.get(mdmModuleViewEntity.getUpIdFiled()) != null) { upValue = datas.get(mdmModuleViewEntity.getUpIdFiled()).toString(); @@ -1540,10 +1579,31 @@ public class MdmServiceImpl implements IMdmService { } - saveOption(dbname,mdmModuleEntity.getMdmCode(),jsonObject,jsonObject.getString("id"),"界面删除"); + saveOption(dbname, mdmModuleEntity.getMdmCode(), jsonObject, jsonObject.getString("id"), "界面删除"); return BaseResult.getSuccessMessageEntity("删除数据成功"); } + public JSONObject toLowerCaseKeys(JSONObject jsonObject) { + JSONObject lowerCaseJson = new JSONObject(); + if (jsonObject != null) { + for (String key : jsonObject.keySet()) { + Object value = jsonObject.get(key); + lowerCaseJson.put(key.toLowerCase(), value); + } + } + return lowerCaseJson; + } + + public List toLowerCaseKeys(List list) { + List jsonObjects = new ArrayList<>(); + if (list != null && list.size() > 0) { + for (int i = 0; i < list.size(); i++) { + jsonObjects.add(toLowerCaseKeys(list.get(i))); + } + } + return jsonObjects; + } + /** * @param jsonStr * @return com.hzya.frame.web.entity.JsonResultEntity @@ -1660,6 +1720,7 @@ public class MdmServiceImpl implements IMdmService { map.put("tableName", mdmModuleDbEntities.get(i).getDbName()); map.put("id", id); object = mdmModuleDao.queryMdmST(map); + object = toLowerCaseKeys(object); if (object.getString("id") == null || "".equals(object.getString("id"))) { return BaseResult.getFailureMessageEntity("当前数据不存在"); } @@ -1669,6 +1730,7 @@ public class MdmServiceImpl implements IMdmService { checkData.put("id", id); checkData.put("mdmModuleDistributeDetailEntities", mdmModuleDistributeDetailEntities); JSONObject object1 = mdmModuleDao.queryMdmST(checkData); + object1 = toLowerCaseKeys(object1); if (object1 == null || object1.getString("id") == null || "".equals(object1.getString("id"))) { return BaseResult.getFailureMessageEntity("当前数据不符合规则不发送"); } @@ -1680,13 +1742,14 @@ public class MdmServiceImpl implements IMdmService { if (mdmModuleDbFiledsEntities != null && mdmModuleDbFiledsEntities.size() > 0) { for (int i2 = 0; i2 < mdmModuleDbFiledsEntities.size(); i2++) { if (mdmModuleDbFiledsRuleEntities.get(i1).getFiledId().equals(mdmModuleDbFiledsEntities.get(i2).getId())) { - if(object.getString(mdmModuleDbFiledsEntities.get(i2).getEnName()) != null){ + if (object.getString(mdmModuleDbFiledsEntities.get(i2).getEnName()) != null) { Map mapDetail = new HashMap<>(); mapDetail.put("tableName", mdmModuleDbFiledsRuleEntities.get(i1).getRuleValue()); String ids = object.getString(mdmModuleDbFiledsEntities.get(i2).getEnName()); String[] idss = ids.split(","); - mapDetail.put("id", idss[idss.length-1]); + mapDetail.put("id", idss[idss.length - 1]); JSONObject objectDetail = mdmModuleDao.queryMdmST(mapDetail); + objectDetail = toLowerCaseKeys(objectDetail); object.put(mdmModuleDbFiledsEntities.get(i2).getEnName(), objectDetail); } } @@ -1706,6 +1769,7 @@ public class MdmServiceImpl implements IMdmService { List detail = mdmModuleDao.queryMdmSTDetail(map); //查看主表是否有字段是关联的 if (detail != null && detail.size() > 0) { + detail = toLowerCaseKeys(detail); if (mdmModuleDbFiledsRuleEntities != null && mdmModuleDbFiledsRuleEntities.size() > 0) { for (int i1 = 0; i1 < mdmModuleDbFiledsRuleEntities.size(); i1++) { if (mdmModuleDbFiledsRuleEntities.get(i1).getDbId().equals(mdmModuleDbEntities.get(i).getId())) { @@ -1713,13 +1777,15 @@ public class MdmServiceImpl implements IMdmService { for (int i2 = 0; i2 < mdmModuleDbFiledsEntities.size(); i2++) { if (mdmModuleDbFiledsRuleEntities.get(i1).getFiledId().equals(mdmModuleDbFiledsEntities.get(i2).getId())) { for (int i3 = 0; i3 < detail.size(); i3++) { - if(detail.get(i3).getString(mdmModuleDbFiledsEntities.get(i2).getEnName()) != null){ + if (detail.get(i3).getString(mdmModuleDbFiledsEntities.get(i2).getEnName()) != null) { Map mapDetail = new HashMap<>(); mapDetail.put("tableName", mdmModuleDbFiledsRuleEntities.get(i1).getRuleValue()); - String ids = detail.get(i3).getString(mdmModuleDbFiledsEntities.get(i2).getEnName()); + String ids = detail.get(i3).getString(mdmModuleDbFiledsEntities.get(i2).getEnName()); String[] idss = ids.split(","); - mapDetail.put("id", idss[idss.length-1]); + mapDetail.put("id", idss[idss.length - 1]); JSONObject objectDetail = mdmModuleDao.queryMdmST(mapDetail); + objectDetail = toLowerCaseKeys(objectDetail); + detail.get(i3).put(mdmModuleDbFiledsEntities.get(i2).getEnName(), objectDetail); } } @@ -1777,41 +1843,42 @@ public class MdmServiceImpl implements IMdmService { //找到登陆接口 SysApplicationApiEntity loginApi = sysApplicationApiDao.get(apiEntity.getAuthenticationPort()); if (null == loginApi) { - saveMdmModuleSendLogEntity("2","转发失败,认证接口不存在",dbname,object.getString("id"), sysApplicationEntity.getName(), apiEntity.getApiName(), object.toJSONString(), type); + saveMdmModuleSendLogEntity("2", "转发失败,认证接口不存在", dbname, object.getString("id"), sysApplicationEntity.getName(), apiEntity.getApiName(), object.toJSONString(), type); return BaseResult.getFailureMessageEntity("发送错误,认证接口不存在"); } - String rzquerys = getQuery(loginApi,null,null); + String rzquerys = getQuery(loginApi, null, null); Map headersa = new HashMap<>(); headersa.put("publicKey", "ZJYAWb7lhAUTYqekPkU+uHJv1/ObJxb7dT7sD8HPRDGAgyhCe7eDIk+3zDUT+v578prj"); headersa.put("secretKey", "fviZnLBsQUAGF8w8FSOdJi7XlIm/XAZclMxRagDLfTyJFlvnIBF3w66Hrpfzs8cYj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA="); headersa.put("appId", sysApplicationEntity.getAppId().toString()); headersa.put("apiCode", loginApi.getApiCode().toString()); - Map rzheaders = getHeaders(loginApi,headersa,null); - String rzbodys = getBodys(loginApi,null,null); - JsonResultEntity rzjsonResultEntity = sendData(loginApi,rzheaders,rzbodys,rzquerys); + Map rzheaders = getHeaders(loginApi, headersa, null); + String rzbodys = getBodys(loginApi, null, null); + JsonResultEntity rzjsonResultEntity = sendData(loginApi, rzheaders, rzbodys, rzquerys); if (!rzjsonResultEntity.isFlag()) { - saveMdmModuleSendLogEntity("2","转发失败,认证接口调用失败",dbname,object.getString("id"), sysApplicationEntity.getName(), apiEntity.getApiName(), object.toJSONString(), type); - return BaseResult.getFailureMessageEntity("发送错误:"+rzjsonResultEntity.getMsg()); + saveMdmModuleSendLogEntity("2", "转发失败,认证接口调用失败", dbname, object.getString("id"), sysApplicationEntity.getName(), apiEntity.getApiName(), object.toJSONString(), type); + return BaseResult.getFailureMessageEntity("发送错误:" + rzjsonResultEntity.getMsg()); } JSONObject attritube = JSONObject.parseObject(rzjsonResultEntity.getAttribute().toString()); //JSONObject attritube = attritube1.getJSONObject("attribute"); - querys = getQuery(apiEntity,querys,attritube); - headers = getHeaders(apiEntity,headers,attritube); - bodys = getBodys(apiEntity,bodys,attritube); + querys = getQuery(apiEntity, querys, attritube); + headers = getHeaders(apiEntity, headers, attritube); + bodys = getBodys(apiEntity, bodys, attritube); } //组装数据发送 - JsonResultEntity jsonResultEntity = sendData(apiEntity, headers,bodys,querys); + JsonResultEntity jsonResultEntity = sendData(apiEntity, headers, bodys, querys); if (jsonResultEntity.isFlag()) { - saveMdmModuleSendLogEntity("1","发送成功",dbname,object.getString("id"), sysApplicationEntity.getName(), apiEntity.getApiName(), object.toJSONString(), type); + saveMdmModuleSendLogEntity("1", "发送成功", dbname, object.getString("id"), sysApplicationEntity.getName(), apiEntity.getApiName(), object.toJSONString(), type); return BaseResult.getSuccessMessageEntity("发送成功"); } else { - saveMdmModuleSendLogEntity("2","转发失败",dbname,object.getString("id"), sysApplicationEntity.getName(), apiEntity.getApiName(), object.toJSONString(), type); - return BaseResult.getFailureMessageEntity("发送错误:"+jsonResultEntity.getMsg()); + saveMdmModuleSendLogEntity("2", "转发失败", dbname, object.getString("id"), sysApplicationEntity.getName(), apiEntity.getApiName(), object.toJSONString(), type); + return BaseResult.getFailureMessageEntity("发送错误:" + jsonResultEntity.getMsg()); } } - private Map getHeaders(SysApplicationApiEntity loginApi,Map map,JSONObject loginData) { - if(loginData == null){ + + private Map getHeaders(SysApplicationApiEntity loginApi, Map map, JSONObject loginData) { + if (loginData == null) { loginData = new JSONObject(); } if (loginApi.getHeaderIn() != null && !"".equals(loginApi.getHeaderIn())) { @@ -1831,11 +1898,11 @@ public class MdmServiceImpl implements IMdmService { } } else { if (querys.getString(SysEnum.EXAMPLE.getValue()) != null && !"".equals(querys.getString(SysEnum.EXAMPLE.getValue()))) {//入参没有值用实例值,如果没有不添加 - if(map.get(querys.getString(SysEnum.PARAMETERNAME.getValue())) == null){ + if (map.get(querys.getString(SysEnum.PARAMETERNAME.getValue())) == null) { map.put(querys.getString(SysEnum.PARAMETERNAME.getValue()), querys.getString(SysEnum.EXAMPLE.getValue())); } } else {//没有值直接拼接 - if(map.get(querys.getString(SysEnum.PARAMETERNAME.getValue())) == null){ + if (map.get(querys.getString(SysEnum.PARAMETERNAME.getValue())) == null) { map.put(querys.getString(SysEnum.PARAMETERNAME.getValue()), ""); } } @@ -1846,27 +1913,25 @@ public class MdmServiceImpl implements IMdmService { return map; - - } - private String getQuery(SysApplicationApiEntity loginApi,String sendDatastr,JSONObject loginData) { + private String getQuery(SysApplicationApiEntity loginApi, String sendDatastr, JSONObject loginData) { Map map = new HashMap<>(); - if(sendDatastr != null){ + if (sendDatastr != null) { String[] parts = sendDatastr.split("&"); - if(parts != null && parts.length > 0){ + if (parts != null && parts.length > 0) { for (int i = 0; i < parts.length; i++) { String[] part = parts[i].split("="); - if(part != null && part.length >=2 ){ + if (part != null && part.length >= 2) { for (int a = 0; a < part.length; a++) { - map.put(part[0],part[1]); + map.put(part[0], part[1]); } } } } } - if(loginData == null){ + if (loginData == null) { loginData = new JSONObject(); } if (loginApi.getQueryIn() != null && !"".equals(loginApi.getQueryIn())) { @@ -1887,11 +1952,11 @@ public class MdmServiceImpl implements IMdmService { } else { //不是认证类型直接取值 if (querys.getString(SysEnum.EXAMPLE.getValue()) != null && !"".equals(querys.getString(SysEnum.EXAMPLE.getValue()))) {//入参没有值用实例值,如果没有不添加 - if(map.get(querys.getString(SysEnum.PARAMETERNAME.getValue())) == null){ + if (map.get(querys.getString(SysEnum.PARAMETERNAME.getValue())) == null) { map.put(querys.getString(SysEnum.PARAMETERNAME.getValue()), querys.getString(SysEnum.EXAMPLE.getValue())); } } else {//没有值直接拼接 - if(map.get(querys.getString(SysEnum.PARAMETERNAME.getValue())) == null){ + if (map.get(querys.getString(SysEnum.PARAMETERNAME.getValue())) == null) { map.put(querys.getString(SysEnum.PARAMETERNAME.getValue()), ""); } } @@ -1900,17 +1965,18 @@ public class MdmServiceImpl implements IMdmService { } } StringBuffer returnStr = new StringBuffer(); - if(map != null && map.size() > 0){ + if (map != null && map.size() > 0) { for (String key : map.keySet()) { - if("".equals(returnStr)){ + if ("".equals(returnStr)) { returnStr.append(key).append("=").append(map.get(key)); - }else { + } else { returnStr.append("&").append(key).append("=").append(map.get(key)); } } } return returnStr.toString(); } + /** * @param loginData * @param example @@ -1936,12 +2002,13 @@ public class MdmServiceImpl implements IMdmService { } return values; } - private String getBodys(SysApplicationApiEntity loginApi,String sendDatastr, JSONObject loginData) { + + private String getBodys(SysApplicationApiEntity loginApi, String sendDatastr, JSONObject loginData) { JSONObject sendData = new JSONObject(); - if(sendDatastr != null ){ + if (sendDatastr != null) { sendData = JSONObject.parseObject(sendDatastr); } - if(loginData == null){ + if (loginData == null) { loginData = new JSONObject(); } if (loginApi.getBodyIn() != null && !"".equals(loginApi.getBodyIn())) { @@ -1955,7 +2022,7 @@ public class MdmServiceImpl implements IMdmService { if (query != null && !"".equals(query)) { JSONArray example = JSONArray.parseArray(query); String logValue = getObjectValue(loginData, example); - sendData.put(querys.getString(SysEnum.PARAMETERNAME.getValue()),logValue); + sendData.put(querys.getString(SysEnum.PARAMETERNAME.getValue()), logValue); } } } @@ -1963,6 +2030,7 @@ public class MdmServiceImpl implements IMdmService { } return sendData.toString(); } + /** * @param querys 设置的字段属性 * @param sendData 发送数据 @@ -2077,15 +2145,15 @@ public class MdmServiceImpl implements IMdmService { //设置api的参数 //返回数据 JSONArray sendArray = sendData.getJSONArray(querys.getString(SysEnum.PARAMETERNAME.getValue())); - if(sendArray == null || sendArray.size() == 0){ + if (sendArray == null || sendArray.size() == 0) { return new JSONArray(); } String childers = querys.getString(SysEnum.CHILDREN.getValue()); - if(childers == null || "".equals(childers)){ + if (childers == null || "".equals(childers)) { return new JSONArray(); } JSONArray childersObj = JSONArray.parseArray(childers); - if(childersObj == null || childersObj.size() == 0){ + if (childersObj == null || childersObj.size() == 0) { return new JSONArray(); } JSONArray obj = new JSONArray(); @@ -2194,9 +2262,9 @@ public class MdmServiceImpl implements IMdmService { } } - private void saveMdmModuleSendLogEntity(String dataType,String remark,String dbname,String formmain_id, String target_app, String target_api, String source_data, String option_type) { + private void saveMdmModuleSendLogEntity(String dataType, String remark, String dbname, String formmain_id, String target_app, String target_api, String source_data, String option_type) { MdmModuleSendLogEntity mdmModuleSendLogEntity = new MdmModuleSendLogEntity(); - mdmModuleSendLogEntity.setTableName(dbname+"_send_log"); + mdmModuleSendLogEntity.setTableName(dbname + "_send_log"); mdmModuleSendLogEntity.setCreate(); mdmModuleSendLogEntity.setId(UUIDUtils.getUUID()); mdmModuleSendLogEntity.setSts("Y"); @@ -2228,11 +2296,11 @@ public class MdmServiceImpl implements IMdmService { * @Description 校验数据 * @Date 11:20 上午 2023/11/6 **/ - private String checkDataOnly(long mdmCode, JSONObject saveData, boolean flag, MdmModuleEntity mdmModuleEntity, List mdmModuleDbEntityList,String msg) { + private String checkDataOnly(long mdmCode, JSONObject saveData, boolean flag, MdmModuleEntity mdmModuleEntity, List mdmModuleDbEntityList, String msg) { StringBuffer str = new StringBuffer(); String dbname = null; for (int i = 0; i < mdmModuleDbEntityList.size(); i++) { - if("1".equals(mdmModuleDbEntityList.get(i).getDbType())){ + if ("1".equals(mdmModuleDbEntityList.get(i).getDbType())) { dbname = mdmModuleDbEntityList.get(i).getDbName(); } } @@ -2398,10 +2466,27 @@ public class MdmServiceImpl implements IMdmService { List mdmDataFiledDtos = new ArrayList<>(); for (int i1 = 0; i1 < fileds.size(); i1++) { if (jsonObject.get(fileds.get(i1).getEnName()) != null) { - MdmDataFiledDto mdmDataFiledDto = new MdmDataFiledDto(); - mdmDataFiledDto.setFiledsName(fileds.get(i1).getEnName()); - mdmDataFiledDto.setFiledsValue(jsonObject.getString(fileds.get(i1).getEnName())); - mdmDataFiledDtos.add(mdmDataFiledDto); + if (flag && "update_status".equals(fileds.get(i1).getEnName())) { + MdmDataFiledDto update_status = new MdmDataFiledDto(); + update_status.setFiledsName("update_status"); + update_status.setFiledsValue("0"); + mdmDataFiledDtos.add(update_status); + }else if(flag && "data_status".equals(fileds.get(i1).getEnName())) { + MdmDataFiledDto data_status = new MdmDataFiledDto(); + data_status.setFiledsName("data_status"); + data_status.setFiledsValue("F"); + mdmDataFiledDtos.add(data_status); + }else if(flag && "modify_user_id".equals(fileds.get(i1).getEnName())) { + MdmDataFiledDto data_status = new MdmDataFiledDto(); + data_status.setFiledsName("modify_user_id"); + data_status.setFiledsValue("F"); + //mdmDataFiledDtos.add(data_status); + }else { + MdmDataFiledDto mdmDataFiledDto = new MdmDataFiledDto(); + mdmDataFiledDto.setFiledsName(fileds.get(i1).getEnName()); + mdmDataFiledDto.setFiledsValue(jsonObject.getString(fileds.get(i1).getEnName())); + mdmDataFiledDtos.add(mdmDataFiledDto); + } } } MdmDataFiledDto mdmDataFiledDto = new MdmDataFiledDto(); @@ -2412,15 +2497,7 @@ public class MdmServiceImpl implements IMdmService { if (flag) { mdmDataDto.setId(jsonObject.getString("id")); id = jsonObject.getString("id"); - MdmDataFiledDto update_status = new MdmDataFiledDto(); - update_status.setFiledsName("update_status"); - update_status.setFiledsValue("0"); - mdmDataFiledDtos.add(update_status); - MdmDataFiledDto data_status = new MdmDataFiledDto(); - data_status.setFiledsName("data_status"); - data_status.setFiledsValue("F"); - ; - mdmDataFiledDtos.add(data_status); + int a = mdmModuleDao.updateForm(mdmDataDto); } else { @@ -2496,7 +2573,7 @@ public class MdmServiceImpl implements IMdmService { mdmDataDto.setTableName(mdmModuleDbEntityList.get(i).getDbName()); List mdmDataFiledDtos = new ArrayList<>(); for (int i1 = 0; i1 < fileds.size(); i1++) { - if("id".equals(fileds.get(i1).getEnName())){ + if ("id".equals(fileds.get(i1).getEnName())) { if (jsonObject.getString("id") != null) { MdmDataFiledDto ids = new MdmDataFiledDto(); ids.setFiledsName("id"); @@ -2508,12 +2585,12 @@ public class MdmServiceImpl implements IMdmService { ids.setFiledsValue(UUIDUtils.getUUID()); mdmDataFiledDtos.add(ids); } - }else if("formmain_id".equals(fileds.get(i1).getEnName())){ + } else if ("formmain_id".equals(fileds.get(i1).getEnName())) { MdmDataFiledDto formain_id = new MdmDataFiledDto(); formain_id.setFiledsName("formmain_id"); formain_id.setFiledsValue(id); mdmDataFiledDtos.add(formain_id); - }else if("data_status".equals(fileds.get(i1).getEnName())){ + } else if ("data_status".equals(fileds.get(i1).getEnName())) { if (jsonObject.getString("id") != null) { MdmDataFiledDto ids = new MdmDataFiledDto(); ids.setFiledsName("data_status"); @@ -2525,9 +2602,9 @@ public class MdmServiceImpl implements IMdmService { ids.setFiledsValue("Y"); mdmDataFiledDtos.add(ids); } - }else if("sorts".equals(fileds.get(i1).getEnName())){ + } else if ("sorts".equals(fileds.get(i1).getEnName())) { - }else if("create_user_id".equals(fileds.get(i1).getEnName())){ + } else if ("create_user_id".equals(fileds.get(i1).getEnName())) { //if (jsonObject.getString("id") != null) { // //} else { @@ -2536,28 +2613,28 @@ public class MdmServiceImpl implements IMdmService { // ids.setFiledsValue(UUIDUtils.getUUID()); // mdmDataFiledDtos.add(ids); //} - }else if("create_time".equals(fileds.get(i1).getEnName())){ + } else if ("create_time".equals(fileds.get(i1).getEnName())) { - }else if("modify_user_id".equals(fileds.get(i1).getEnName())){ + } else if ("modify_user_id".equals(fileds.get(i1).getEnName())) { //MdmDataFiledDto ids = new MdmDataFiledDto(); //ids.setFiledsName("modify_user_id"); //ids.setFiledsValue(UUIDUtils.getUUID()); //mdmDataFiledDtos.add(ids); - }else if("company_id".equals(fileds.get(i1).getEnName())){ + } else if ("company_id".equals(fileds.get(i1).getEnName())) { MdmDataFiledDto ids = new MdmDataFiledDto(); ids.setFiledsName("company_id"); ids.setFiledsValue("0"); mdmDataFiledDtos.add(ids); - }else if("org_id".equals(fileds.get(i1).getEnName())){ + } else if ("org_id".equals(fileds.get(i1).getEnName())) { MdmDataFiledDto ids = new MdmDataFiledDto(); ids.setFiledsName("org_id"); ids.setFiledsValue("0"); mdmDataFiledDtos.add(ids); - }else if("modify_time".equals(fileds.get(i1).getEnName())){ + } else if ("modify_time".equals(fileds.get(i1).getEnName())) { - }else if("sts".equals(fileds.get(i1).getEnName())){ + } else if ("sts".equals(fileds.get(i1).getEnName())) { - }else { + } else { MdmDataFiledDto mdmDataFiledDto = new MdmDataFiledDto(); mdmDataFiledDto.setFiledsName(fileds.get(i1).getEnName()); mdmDataFiledDto.setFiledsValue(jsonObject.getString(fileds.get(i1).getEnName())); @@ -2581,7 +2658,7 @@ public class MdmServiceImpl implements IMdmService { } } } - saveOption(dbname,mdmCode,saveData,id,msg); + saveOption(dbname, mdmCode, saveData, id, msg); } return str.toString(); } @@ -2639,15 +2716,15 @@ public class MdmServiceImpl implements IMdmService { } return flag; } - /*** - * 查询所有的字段根据表名称 - * @content: - * @author 👻👻👻👻👻👻👻👻 gjh - * @date 2024-06-27 16:29 - * @param - * @return java.util.List - **/ - private List queryMdMFields(Map maps){ - return mdmModuleDao.queryMdMFields(maps); - } + ///*** + // * 查询所有的字段根据表名称 + // * @content: + // * @author 👻👻👻👻👻👻👻👻 gjh + // * @date 2024-06-27 16:29 + // * @param + // * @return java.util.List + // **/ + //private List queryMdMFields(Map maps){ + // return mdmModuleDao.queryMdMFields(maps); + //} } diff --git a/service/src/main/java/com/hzya/frame/sysnew/comparison/masterData/service/impl/MasterDataServiceImpl.java b/service/src/main/java/com/hzya/frame/sysnew/comparison/masterData/service/impl/MasterDataServiceImpl.java index b113e27e..0ef63943 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/comparison/masterData/service/impl/MasterDataServiceImpl.java +++ b/service/src/main/java/com/hzya/frame/sysnew/comparison/masterData/service/impl/MasterDataServiceImpl.java @@ -262,7 +262,7 @@ public class MasterDataServiceImpl extends BaseService jsonStr.put("jsonStr", hashMap); JsonResultEntity result = comparisonServiceimpl.updateEntity(jsonStr); if(!result.isFlag()){ - throw new BaseSystemException("主数据更新失败"+ result.getMsg()); + //throw new BaseSystemException("主数据更新失败"+ result.getMsg()); } } } diff --git a/service/src/main/java/com/hzya/frame/sysnew/integtationTask/entity/IntegrationTaskEntity.xml b/service/src/main/java/com/hzya/frame/sysnew/integtationTask/entity/IntegrationTaskEntity.xml index 359c64f0..c21235c5 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/integtationTask/entity/IntegrationTaskEntity.xml +++ b/service/src/main/java/com/hzya/frame/sysnew/integtationTask/entity/IntegrationTaskEntity.xml @@ -318,5 +318,25 @@ where id = #{id} concat(replace(replace(DATE_FORMAT(now(),'%Y-%m-%d'),'-',''),'-',ifnull(max(right(task_code,4)), 0)+1)) end as task_code from integration_task where sts='Y' and task_code like concat('%',substring(replace(DATE_FORMAT(now(),'%Y-%m-%d'),'-',''),1,10),'%') + +