From 4e42a1fcf55121f064dcac083d82a7a74f45806d Mon Sep 17 00:00:00 2001 From: xiang2lin <251481237@qq.com> Date: Fri, 21 Jun 2024 17:55:21 +0800 Subject: [PATCH 01/22] =?UTF-8?q?cap4=E6=97=A0=E6=B5=81=E7=A8=8B=E8=A1=A8?= =?UTF-8?q?=E5=8D=95=E5=AF=BC=E5=85=A5=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../frame/seeyon/cap4/form/dto/FormDTO.java | 74 +++++++++++++++++++ .../seeyon/cap4/form/dto/FormDataDTO.java | 36 +++++++++ .../seeyon/cap4/form/dto/MasterTableDTO.java | 45 +++++++++++ .../frame/seeyon/cap4/form/dto/RecordDTO.java | 34 +++++++++ .../seeyon/cap4/form/dto/RecordFieldDTO.java | 52 +++++++++++++ .../seeyon/cap4/form/dto/SubTableDTO.java | 9 +++ 6 files changed, 250 insertions(+) create mode 100644 service/src/main/java/com/hzya/frame/seeyon/cap4/form/dto/FormDTO.java create mode 100644 service/src/main/java/com/hzya/frame/seeyon/cap4/form/dto/FormDataDTO.java create mode 100644 service/src/main/java/com/hzya/frame/seeyon/cap4/form/dto/MasterTableDTO.java create mode 100644 service/src/main/java/com/hzya/frame/seeyon/cap4/form/dto/RecordDTO.java create mode 100644 service/src/main/java/com/hzya/frame/seeyon/cap4/form/dto/RecordFieldDTO.java create mode 100644 service/src/main/java/com/hzya/frame/seeyon/cap4/form/dto/SubTableDTO.java diff --git a/service/src/main/java/com/hzya/frame/seeyon/cap4/form/dto/FormDTO.java b/service/src/main/java/com/hzya/frame/seeyon/cap4/form/dto/FormDTO.java new file mode 100644 index 00000000..e9fe54b8 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/seeyon/cap4/form/dto/FormDTO.java @@ -0,0 +1,74 @@ +package com.hzya.frame.seeyon.cap4.form.dto; + +import com.alibaba.fastjson.annotation.JSONField; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.List; + +/** + * @Description 无流程表单批量保存请求参数 + * @Author xiangerlin + * @Date 2024/1/8 11:18 + **/ +public class FormDTO { + @JSONField(ordinal = 4) + private String formCode;//模版编号 + @JSONField(ordinal = 5) + private String loginName;//模版编号 + @JSONField(ordinal = 2) + private String rightId;//权限id,找到无流程表单,点新增,弹出的窗口上会有这个参数 + @JSONField(ordinal = 3) + private List dataList;//导入的数据 + @JSONField(ordinal = 1) + private String[] uniqueFiled;//更新用的唯一标识 + @JSONField(ordinal = 6) + private Boolean doTrigger;//是否执行触发(Since V8.0sp2),测试中发现传了这个参数会报错 + + public String getFormCode() { + return formCode; + } + + public void setFormCode(String formCode) { + this.formCode = formCode; + } + + public String getLoginName() { + return loginName; + } + + public void setLoginName(String loginName) { + this.loginName = loginName; + } + + public String getRightId() { + return rightId; + } + + public void setRightId(String rightId) { + this.rightId = rightId; + } + + public List getDataList() { + return dataList; + } + + public void setDataList(List dataList) { + this.dataList = dataList; + } + + public String[] getUniqueFiled() { + return uniqueFiled; + } + + public void setUniqueFiled(String[] uniqueFiled) { + this.uniqueFiled = uniqueFiled; + } + + public Boolean getDoTrigger() { + return doTrigger; + } + + public void setDoTrigger(Boolean doTrigger) { + this.doTrigger = doTrigger; + } +} diff --git a/service/src/main/java/com/hzya/frame/seeyon/cap4/form/dto/FormDataDTO.java b/service/src/main/java/com/hzya/frame/seeyon/cap4/form/dto/FormDataDTO.java new file mode 100644 index 00000000..b69031d6 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/seeyon/cap4/form/dto/FormDataDTO.java @@ -0,0 +1,36 @@ +package com.hzya.frame.seeyon.cap4.form.dto; + +import com.alibaba.fastjson.annotation.JSONField; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.List; + +/** + * @Description dataList节点 + * @Author xiangerlin + * @Date 2024/1/8 11:26 + **/ +public class FormDataDTO { + @JSONField(ordinal = 1) + private MasterTableDTO masterTable;//主表数据 + @JSONField(ordinal = 2) + private List subTables;//子表数据 + + //private List<> attachmentInfos;//附件列表 + + public MasterTableDTO getMasterTable() { + return masterTable; + } + + public void setMasterTable(MasterTableDTO masterTable) { + this.masterTable = masterTable; + } + + public List getSubTables() { + return subTables; + } + + public void setSubTables(List subTables) { + this.subTables = subTables; + } +} diff --git a/service/src/main/java/com/hzya/frame/seeyon/cap4/form/dto/MasterTableDTO.java b/service/src/main/java/com/hzya/frame/seeyon/cap4/form/dto/MasterTableDTO.java new file mode 100644 index 00000000..56f5f9fb --- /dev/null +++ b/service/src/main/java/com/hzya/frame/seeyon/cap4/form/dto/MasterTableDTO.java @@ -0,0 +1,45 @@ +package com.hzya.frame.seeyon.cap4.form.dto; + +import com.alibaba.fastjson.annotation.JSONField; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.List; + +/** + * @Description 主表数据 + * @Author xiangerlin + * @Date 2024/1/8 11:29 + **/ + +public class MasterTableDTO { + @JSONField(ordinal = 1) + private String name;//表名 + @JSONField(ordinal = 2) + private RecordDTO record;//数据 + @JSONField(ordinal = 3) + private List changedFields;//需要计算的字段 + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public RecordDTO getRecord() { + return record; + } + + public void setRecord(RecordDTO record) { + this.record = record; + } + + public List getChangedFields() { + return changedFields; + } + + public void setChangedFields(List changedFields) { + this.changedFields = changedFields; + } +} diff --git a/service/src/main/java/com/hzya/frame/seeyon/cap4/form/dto/RecordDTO.java b/service/src/main/java/com/hzya/frame/seeyon/cap4/form/dto/RecordDTO.java new file mode 100644 index 00000000..cc3857e0 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/seeyon/cap4/form/dto/RecordDTO.java @@ -0,0 +1,34 @@ +package com.hzya.frame.seeyon.cap4.form.dto; + +import com.alibaba.fastjson.annotation.JSONField; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.List; + +/** + * @Description record节点 + * @Author xiangerlin + * @Date 2024/1/8 11:31 + **/ +public class RecordDTO { + @JSONField(ordinal = 1) + private long id;//数据id,测试中发现新增时这个参数随便填写 不影响导入 + @JSONField(ordinal = 2) + private List fields;//字段列表 + + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + public List getFields() { + return fields; + } + + public void setFields(List fields) { + this.fields = fields; + } +} diff --git a/service/src/main/java/com/hzya/frame/seeyon/cap4/form/dto/RecordFieldDTO.java b/service/src/main/java/com/hzya/frame/seeyon/cap4/form/dto/RecordFieldDTO.java new file mode 100644 index 00000000..a2bfa15b --- /dev/null +++ b/service/src/main/java/com/hzya/frame/seeyon/cap4/form/dto/RecordFieldDTO.java @@ -0,0 +1,52 @@ +package com.hzya.frame.seeyon.cap4.form.dto; + +import com.alibaba.fastjson.annotation.JSONField; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * @Description masterTable—record—fields的结构 + * @Author xiangerlin + * @Date 2024/1/8 11:32 + **/ +public class RecordFieldDTO { + @JSONField(ordinal = 1) + private String name;//数据域名称 ,fieldxxxx + @JSONField(ordinal = 2) + private String value;//数据值(优先) + @JSONField(ordinal = 3) + private String showValue;//显示值 + + public RecordFieldDTO() { + + } + + public RecordFieldDTO(String name, String value, String showValue) { + this.name = name; + this.value = value; + this.showValue = showValue; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + public String getShowValue() { + return showValue; + } + + public void setShowValue(String showValue) { + this.showValue = showValue; + } +} diff --git a/service/src/main/java/com/hzya/frame/seeyon/cap4/form/dto/SubTableDTO.java b/service/src/main/java/com/hzya/frame/seeyon/cap4/form/dto/SubTableDTO.java new file mode 100644 index 00000000..8d5e5226 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/seeyon/cap4/form/dto/SubTableDTO.java @@ -0,0 +1,9 @@ +package com.hzya.frame.seeyon.cap4.form.dto; + +/** + * @Description 子表数据 + * @Author xiangerlin + * @Date 2024/1/8 11:29 + **/ +public class SubTableDTO { +} From c2e6863913569c6414e33d2ee84f4901a5f42d0e Mon Sep 17 00:00:00 2001 From: hecan <1718492867@qq.com> Date: Mon, 24 Jun 2024 10:25:53 +0800 Subject: [PATCH 02/22] =?UTF-8?q?=E8=B0=83=E6=95=B4=E9=80=9A=E7=94=A8?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E4=BF=9D=E5=AD=98=E5=92=8C=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E8=BF=94=E5=9B=9E=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../entity/ComparisonDetailsEntity.xml | 2 +- .../service/impl/ComparisonServiceImpl.java | 125 ++++++++++-------- 2 files changed, 72 insertions(+), 55 deletions(-) diff --git a/service/src/main/java/com/hzya/frame/sysnew/comparison/entity/ComparisonDetailsEntity.xml b/service/src/main/java/com/hzya/frame/sysnew/comparison/entity/ComparisonDetailsEntity.xml index 0d1ca13f..754cca03 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/comparison/entity/ComparisonDetailsEntity.xml +++ b/service/src/main/java/com/hzya/frame/sysnew/comparison/entity/ComparisonDetailsEntity.xml @@ -48,7 +48,7 @@ ${key} =#{value} - where formmain_id=#{formmainId} and sts='Y' + where id=#{id} and sts='Y' diff --git a/service/src/main/java/com/hzya/frame/sysnew/comparison/service/impl/ComparisonServiceImpl.java b/service/src/main/java/com/hzya/frame/sysnew/comparison/service/impl/ComparisonServiceImpl.java index 0045280f..286af9cc 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/comparison/service/impl/ComparisonServiceImpl.java +++ b/service/src/main/java/com/hzya/frame/sysnew/comparison/service/impl/ComparisonServiceImpl.java @@ -135,9 +135,6 @@ public class ComparisonServiceImpl extends BaseService if (!checkStr(jsonObject.getString("optionName"))) { return BaseResult.getFailureMessageEntity("操作人为空"); } - /*if (!checkStr(jsonObject.getString("rulePrefix"))) { - return BaseResult.getFailureMessageEntity("规则为空"); - }*/ ComparisonEntity comparisonEntity = jsonObject.toJavaObject(ComparisonEntity.class); ComparisonDetailsEntity comparisonDetailsEntity=new ComparisonDetailsEntity(); List comparisonEntities=new ArrayList<>(); @@ -156,10 +153,9 @@ public class ComparisonServiceImpl extends BaseService JSONObject jsonObjectMain = JSONObject.parseObject(main); if(jsonObjectMain != null ) { Map map = new HashMap<>();//将主表数据存到map中 - Map mapDetails = new HashMap<>();//将子表数据存到map中 + List> mapDetails = new ArrayList<>();//将子表数据存到map中 if (comparisonEntities != null && comparisonEntities.size() > 0) { - map = spliceMainMap(comparisonEntities, jsonObjectMain, map, comparisonEntity); - mapDetails = spliceDetailMap(comparisonEntities, mapDetails, comparisonDetailsEntity, jsonArray); + map = spliceMainMap(comparisonEntities, jsonObjectMain, map, comparisonEntity,comparisonDetailsEntity); String uuid = null; if (jsonObjectMain.getString("id") == null) { uuid = UUIDUtils.getUUID(); @@ -182,8 +178,7 @@ public class ComparisonServiceImpl extends BaseService //查询单据规则 只查询主表得,明细表不用 try { ComparisonEntity comparisonEntityRules = comparisonDao.queryComparisonById(comparisonEntityRule); - String documentRule = comparisonEntityRules.getDocumentRule(); - ; //"KH-2024-05-30-1"; + String documentRule = comparisonEntityRules.getDocumentRule();//"KH-2024-05-30-1"; logger.info("通用数据保存接口中根据mId查询出来的单据规则为:{}", documentRule); if (documentRule != null) { //获取规则前缀 CK @@ -214,30 +209,41 @@ public class ComparisonServiceImpl extends BaseService return BaseResult.getFailureMessageEntity("保存失败"); } try { + List list=new ArrayList<>(); + JSONObject jsonObjectList=new JSONObject(); //保存主表数据 ComparisonEntity comparisonEntityOne = comparisonDao.saveComparison(comparisonEntityRule); + jsonObjectList.put(comparisonEntityOne.getDbName(),map); //保存子表数据 - if (mapDetails != null && mapDetails.size() > 0) { - String uuidDetail = UUIDUtils.getUUID(); - mapDetails.put("id", uuidDetail); - mapDetails.put("formmain_id", uuid); - mapDetails.put("create_user_id", "c796fd9ba4c9f5ff3cc2fa41a040e443"); - mapDetails.put("modify_user_id", "c796fd9ba4c9f5ff3cc2fa41a040e443"); - mapDetails.put("org_id", "0"); - mapDetails.put("create_time", new Date()); - mapDetails.put("modify_time", new Date()); - mapDetails.put("sts", "Y"); - mapDetails.put("data_status","Y");//新增状态 - comparisonDetailsEntity.setMapDetails(mapDetails); - ComparisonDetailsEntity comparisonDetailsEntityOne = comparisonDetailsDao.saveComparisonDetails(comparisonDetailsEntity); - //comparisonEntityOne.setComparisonDetailsEntity(comparisonDetailsEntityOne); - map.put("details",mapDetails); - //保存操作日志 - //controlsLogDaoimpl.saveControlsLog(uuidDetail,jsonObject.getString("appName"),jsonObject.getString("appCode"),jsonObject.toJSONString(),"接口新增",jsonObject.getString("optionName"),comparisonDetailsEntity.getDbName()+"_option_log"); + if (jsonArray != null && jsonArray.size() > 0) { + mapDetails = spliceDetailMap(comparisonEntities, mapDetails, jsonArray); + if(mapDetails.size()>0 && mapDetails!=null){ + for (Map mapDetail : mapDetails) { + String uuidDetail = UUIDUtils.getUUID(); + mapDetail.put("id", uuidDetail); + mapDetail.put("formmain_id", uuid); + mapDetail.put("create_user_id", "c796fd9ba4c9f5ff3cc2fa41a040e443"); + mapDetail.put("modify_user_id", "c796fd9ba4c9f5ff3cc2fa41a040e443"); + mapDetail.put("org_id", "0"); + mapDetail.put("create_time", new Date()); + mapDetail.put("modify_time", new Date()); + mapDetail.put("sts", "Y"); + mapDetail.put("data_status","Y");//新增状态 + comparisonDetailsEntity.setMapDetails(mapDetail); + ComparisonDetailsEntity comparisonDetailsEntityOne = comparisonDetailsDao.saveComparisonDetails(comparisonDetailsEntity); + //comparisonEntityOne.setComparisonDetailsEntity(comparisonDetailsEntityOne); + //保存操作日志 + //controlsLogDaoimpl.saveControlsLog(uuidDetail,jsonObject.getString("appName"),jsonObject.getString("appCode"),jsonObject.toJSONString(),"接口新增",jsonObject.getString("optionName"),comparisonDetailsEntity.getDbName()+"_option_log"); + } + jsonObjectList.put(comparisonDetailsEntity.getDbName(),mapDetails); + } + }else{ + jsonObjectList.put(comparisonDetailsEntity.getDbName(),new ArrayList<>()); } + list.add(jsonObjectList); //保存操作日志 controlsLogDaoimpl.saveControlsLog(uuid,jsonObject.getString("appName"),jsonObject.getString("appCode"),jsonObject.toJSONString(),"接口新增",jsonObject.getString("optionName"),comparisonEntityRule.getDbName()+"_option_log"); - return BaseResult.getSuccessMessageEntity("保存成功", map); + return BaseResult.getSuccessMessageEntity("保存成功", list); } catch (Exception e) { logger.info("保存通用数据时候错误:{}", e.getMessage()); return BaseResult.getFailureMessageEntity("保存失败"); @@ -279,10 +285,9 @@ public class ComparisonServiceImpl extends BaseService return BaseResult.getFailureMessageEntity("更新失败"); } Map map=new HashMap<>();//将主表数据存到map中 - Map mapDetails=new HashMap<>();//将子表数据存到map中 + List> mapDetails=new ArrayList<>();//将子表数据存到map中 if(comparisonEntities !=null && comparisonEntities.size()>0) { - map=spliceMainMap(comparisonEntities,jsonObjectMain,map,comparisonEntity); - mapDetails=spliceDetailMap(comparisonEntities,mapDetails,comparisonDetailsEntity,jsonArray); + map=spliceMainMap(comparisonEntities,jsonObjectMain,map,comparisonEntity,comparisonDetailsEntity); map.put("create_user_id", "c796fd9ba4c9f5ff3cc2fa41a040e443"); map.put("modify_user_id", "c796fd9ba4c9f5ff3cc2fa41a040e443"); map.put("org_id", "0"); @@ -303,26 +308,37 @@ public class ComparisonServiceImpl extends BaseService return BaseResult.getFailureMessageEntity("更新失败",e.getMessage()); }*/ try { + List jsonObjects=new ArrayList<>(); + JSONObject jsonObjectList=new JSONObject(); //保存主表数据 Integer integer = comparisonDao.updateComparisonByType(comparisonEntity); - if (integer > 0) { + jsonObjectList.put(comparisonEntity.getDbName(),map); + if (integer>0) { //保存子表数据 - if (mapDetails != null && mapDetails.size() > 0) { - mapDetails.put("create_user_id", "c796fd9ba4c9f5ff3cc2fa41a040e443"); - mapDetails.put("modify_user_id", "c796fd9ba4c9f5ff3cc2fa41a040e443"); - mapDetails.put("org_id", "0"); - mapDetails.put("modify_time", new Date()); - mapDetails.put("sts", "Y"); - mapDetails.put("data_status","F");//数据状态 - comparisonDetailsEntity.setFormmainId(jsonObjectMain.getString("id")); - comparisonDetailsEntity.setMapDetails(mapDetails); - comparisonDetailsDao.updateComparisonDetailsByType(comparisonDetailsEntity); - //保存操作日志 - // controlsLogDaoimpl.saveControlsLog(comparisonDetailsEntity.getId(),jsonObject.getString("appName"),jsonObject.getString("appCode"),jsonObject.toJSONString(),"接口更新",jsonObject.getString("optionName"),comparisonDetailsEntity.getDbName()+"_option_log"); + if (jsonArray != null && jsonArray.size() > 0) { + mapDetails=spliceDetailMap(comparisonEntities,mapDetails,jsonArray); + for (Map mapDetail : mapDetails) { + mapDetail.put("create_user_id", "c796fd9ba4c9f5ff3cc2fa41a040e443"); + mapDetail.put("modify_user_id", "c796fd9ba4c9f5ff3cc2fa41a040e443"); + mapDetail.put("org_id", "0"); + mapDetail.put("modify_time", new Date()); + mapDetail.put("sts", "Y"); + mapDetail.put("data_status","F");//数据状态 + //comparisonDetailsEntity.setFormmainId(jsonObjectMain.getString("id")); + comparisonDetailsEntity.setId(String.valueOf(mapDetail.get("id"))); + comparisonDetailsEntity.setMapDetails(mapDetail); + comparisonDetailsDao.updateComparisonDetailsByType(comparisonDetailsEntity); + //保存操作日志 + // controlsLogDaoimpl.saveControlsLog(comparisonDetailsEntity.getId(),jsonObject.getString("appName"),jsonObject.getString("appCode"),jsonObject.toJSONString(),"接口更新",jsonObject.getString("optionName"),comparisonDetailsEntity.getDbName()+"_option_log"); + } + jsonObjectList.put(comparisonDetailsEntity.getDbName(),mapDetails); + }else{ + jsonObjectList.put(comparisonDetailsEntity.getDbName(),new ArrayList<>()); } + jsonObjects.add(jsonObjectList); //保存操作日志 controlsLogDaoimpl.saveControlsLog(comparisonEntity.getId(),jsonObject.getString("appName"),jsonObject.getString("appCode"),jsonObject.toJSONString(),"接口更新",jsonObject.getString("optionName"),comparisonEntity.getDbName()+"_option_log"); - return BaseResult.getSuccessMessageEntity("更新成功", integer); + return BaseResult.getSuccessMessageEntity("更新成功", jsonObjects); }else{ return BaseResult.getFailureMessageEntity("更新失败"); } @@ -436,7 +452,7 @@ public class ComparisonServiceImpl extends BaseService } //得到主表数据 - private Map spliceMainMap(List comparisonEntities,JSONObject jsonObjectMain,Map map,ComparisonEntity comparisonEntity){ + private Map spliceMainMap(List comparisonEntities,JSONObject jsonObjectMain,Map map,ComparisonEntity comparisonEntity,ComparisonDetailsEntity comparisonDetailsEntity){ for (ComparisonEntity entity : comparisonEntities) { //遍历主表下面的所有key,字段名 for (String key : jsonObjectMain.keySet()) { @@ -447,27 +463,29 @@ public class ComparisonServiceImpl extends BaseService map.put(key, jsonObjectMain.getString(key)); } } + if(entity.getDbType().equals("2")){ + comparisonDetailsEntity.setDbName(entity.getDbName()); + } } } return map; } //得到明细表数据 - private Map spliceDetailMap(List comparisonEntities,Map mapDetails,ComparisonDetailsEntity comparisonDetailsEntity,JSONArray jsonArray){ + private List> spliceDetailMap(List comparisonEntities,List> mapDetails,JSONArray jsonArray){ if (jsonArray != null && jsonArray.size() > 0) { for (Object object : jsonArray) { JSONObject jsonObjectDetails = (JSONObject) JSON.toJSON(object); - for (ComparisonEntity entity : comparisonEntities) { - //遍历主表下面的所有key,字段名 - for (String key : jsonObjectDetails.keySet()) { - if (entity.getDbType().equals("2")) { - comparisonDetailsEntity.setDbName(entity.getDbName()); - if(entity.getEnName().equals(key)){ - mapDetails.put(key, jsonObjectDetails.getString(key)); - } + JSONObject jsonObject=new JSONObject(); + //遍历主表下面的所有key,字段名 + for (String key : jsonObjectDetails.keySet()) { + for (ComparisonEntity entity : comparisonEntities) { + if (entity.getDbType().equals("2") && entity.getEnName().equals(key)) { + jsonObject.put(key,jsonObjectDetails.getString(key)); } } } + mapDetails.add(jsonObject); } } return mapDetails; @@ -518,7 +536,6 @@ public class ComparisonServiceImpl extends BaseService } break; case "option": - //获取主表和明细表的字段信息 if(moduleDbEntity.getDbType().equals("3")){ MdmModuleDbFiledsEntity mdmModuleDbFiledsEntity=new MdmModuleDbFiledsEntity(); mdmModuleDbFiledsEntity.setDbId(moduleDbEntity.getId()); From 9effdca0c85f06dd01651898b52709b76b3a6961 Mon Sep 17 00:00:00 2001 From: lvleigang <957075182@qq.com> Date: Mon, 24 Jun 2024 11:57:31 +0800 Subject: [PATCH 03/22] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=BA=90=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0dm?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/hzya/frame/serviceUtil/DsDataSourceUtil.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/service/src/main/java/com/hzya/frame/serviceUtil/DsDataSourceUtil.java b/service/src/main/java/com/hzya/frame/serviceUtil/DsDataSourceUtil.java index b88c5880..1e59eda9 100644 --- a/service/src/main/java/com/hzya/frame/serviceUtil/DsDataSourceUtil.java +++ b/service/src/main/java/com/hzya/frame/serviceUtil/DsDataSourceUtil.java @@ -147,6 +147,8 @@ public class DsDataSourceUtil { driveClass = DataSourceUtilProperties.SQL2000DRIVER; } else if ("2".equalsIgnoreCase(dataSourceEntity.getSourceType())) { driveClass = DataSourceUtilProperties.SQL2005DRIVER; + }else if ("4".equalsIgnoreCase(dataSourceEntity.getSourceType())) { + driveClass = DataSourceUtilProperties.dm; } try { //测试连接 From 9c6996e0ca313a11a954c7116267d9dd40ff6587 Mon Sep 17 00:00:00 2001 From: lvleigang <957075182@qq.com> Date: Mon, 24 Jun 2024 13:37:49 +0800 Subject: [PATCH 04/22] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=BA=90=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0dm?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- buildpackage/src/main/resources/application.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/buildpackage/src/main/resources/application.yml b/buildpackage/src/main/resources/application.yml index 9a669fa1..1f564c28 100644 --- a/buildpackage/src/main/resources/application.yml +++ b/buildpackage/src/main/resources/application.yml @@ -91,8 +91,7 @@ mybatis-plus: db-config: id-type: auto # 主键策略 zt: - url: -# 积木报表工具 + url: http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface #JimuReport[minidao配置] minidao : base-package: org.jeecg.modules.jmreport.desreport.dao* From e3a6525c73872d9db609405cb3038bfdad5d8e33 Mon Sep 17 00:00:00 2001 From: lvleigang <957075182@qq.com> Date: Mon, 24 Jun 2024 14:10:59 +0800 Subject: [PATCH 05/22] =?UTF-8?q?=E6=B7=BB=E5=8A=A0dm=E4=BE=9D=E8=B5=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pom.xml b/pom.xml index 383d109f..3f21aeaa 100644 --- a/pom.xml +++ b/pom.xml @@ -244,12 +244,12 @@ - - - - - - + + + com.dameng + Dm8JdbcDriver18 + 8.1.1.49 + From c5dc5449d093429cde987f87747bf5ac2d591362 Mon Sep 17 00:00:00 2001 From: hecan <1718492867@qq.com> Date: Mon, 24 Jun 2024 15:49:23 +0800 Subject: [PATCH 06/22] =?UTF-8?q?=E6=A0=B9=E6=8D=AE=E8=A1=A8=E5=90=8D?= =?UTF-8?q?=E7=A7=B0=E5=92=8C=E8=A1=A8=E7=B1=BB=E5=9E=8B=E8=BF=9B=E8=A1=8C?= =?UTF-8?q?=E5=88=86=E7=BB=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/ComparisonServiceImpl.java | 223 ++++++++++-------- 1 file changed, 119 insertions(+), 104 deletions(-) diff --git a/service/src/main/java/com/hzya/frame/sysnew/comparison/service/impl/ComparisonServiceImpl.java b/service/src/main/java/com/hzya/frame/sysnew/comparison/service/impl/ComparisonServiceImpl.java index 286af9cc..31873512 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/comparison/service/impl/ComparisonServiceImpl.java +++ b/service/src/main/java/com/hzya/frame/sysnew/comparison/service/impl/ComparisonServiceImpl.java @@ -28,6 +28,7 @@ import org.springframework.stereotype.Service; import sun.java2d.pipe.AAShapePipe; import java.util.*; +import java.util.stream.Collectors; @Service(value = "comparisonServiceImpl") public class ComparisonServiceImpl extends BaseService implements IComparisonService { @@ -50,7 +51,6 @@ public class ComparisonServiceImpl extends BaseService } //分页查询通用数据数据 - @DS("master") @Override public JsonResultEntity queryEntityPage(JSONObject json) { JSONObject jsonObject = json.getJSONObject("jsonStr"); @@ -122,7 +122,6 @@ public class ComparisonServiceImpl extends BaseService } //新增通用数据数据 - @DS("master") @Override public JsonResultEntity saveEntity(JSONObject json) { JSONObject jsonObject = json.getJSONObject("jsonStr"); @@ -148,108 +147,124 @@ public class ComparisonServiceImpl extends BaseService logger.info("根据主数据编码查询信息错误:{}",e.getMessage()); return BaseResult.getFailureMessageEntity("保存失败"); } - String main = jsonObject.getString("main");//获取主表数据 - JSONArray jsonArray = jsonObject.getJSONArray("details");//获取子表数据 - JSONObject jsonObjectMain = JSONObject.parseObject(main); - if(jsonObjectMain != null ) { - Map map = new HashMap<>();//将主表数据存到map中 - List> mapDetails = new ArrayList<>();//将子表数据存到map中 - if (comparisonEntities != null && comparisonEntities.size() > 0) { - map = spliceMainMap(comparisonEntities, jsonObjectMain, map, comparisonEntity,comparisonDetailsEntity); - String uuid = null; - if (jsonObjectMain.getString("id") == null) { - uuid = UUIDUtils.getUUID(); - map.put("id", uuid); - } else { - uuid = jsonObjectMain.getString("id"); - map.put("id", jsonObjectMain.getString("id")); - } - map.put("create_user_id", "c796fd9ba4c9f5ff3cc2fa41a040e443"); - map.put("modify_user_id", "c796fd9ba4c9f5ff3cc2fa41a040e443"); - map.put("org_id", "0"); - map.put("create_time", new Date()); - map.put("modify_time", new Date()); - map.put("sts", "Y"); - map.put("data_status", "Y");//新增状态 - map.put("add_status", "0");//新增状态 - map.put("update_status", "1");//修改状态 - map.put("delete_status", "1");//删除状态 - ComparisonEntity comparisonEntityRule = comparisonEntities.get(0); - //查询单据规则 只查询主表得,明细表不用 - try { - ComparisonEntity comparisonEntityRules = comparisonDao.queryComparisonById(comparisonEntityRule); - String documentRule = comparisonEntityRules.getDocumentRule();//"KH-2024-05-30-1"; - logger.info("通用数据保存接口中根据mId查询出来的单据规则为:{}", documentRule); - if (documentRule != null) { - //获取规则前缀 CK - String rulePrefix = documentRule.substring(0, documentRule.indexOf("-")); - //获取规则中间日期 yyyy-MM-dd - String ruleDate = documentRule.substring(documentRule.indexOf("-") + 1, documentRule.lastIndexOf("-")); - String ruleMiddle = getRuleDate(ruleDate); - //获取规则后缀 - String ruleSuffixLength = documentRule.substring(documentRule.lastIndexOf("-") + 1); - int ruleSuffix = ruleSuffixLength.length(); - //生成单据规则 - comparisonEntityRule.setRulePrefix(rulePrefix); - comparisonEntityRule.setRuleMiddle(ruleMiddle); - comparisonEntityRule.setRuleSuffix(ruleSuffix); - try { - //新生成单据规则保存到数据库 - ComparisonEntity comparisonEntityRuleGz = comparisonDao.queryComparisonRule(comparisonEntityRule); - map.put("document_rule", comparisonEntityRuleGz.getDocumentRule());//单据规则 - map.put("document_rule_num", comparisonEntityRuleGz.getDocumentRuleNum());//单据规则流水号 - comparisonEntityRule.setMap(map); - } catch (Exception e) { - logger.info("保存通用数据时候生成单据规则错误:{}", e.getMessage()); - return BaseResult.getFailureMessageEntity("保存失败"); - } - } - } catch (Exception e) { - logger.info("通用数据保存接口中查询单据规则错误:{}", e.getMessage()); - return BaseResult.getFailureMessageEntity("保存失败"); - } - try { - List list=new ArrayList<>(); - JSONObject jsonObjectList=new JSONObject(); - //保存主表数据 - ComparisonEntity comparisonEntityOne = comparisonDao.saveComparison(comparisonEntityRule); - jsonObjectList.put(comparisonEntityOne.getDbName(),map); - //保存子表数据 - if (jsonArray != null && jsonArray.size() > 0) { - mapDetails = spliceDetailMap(comparisonEntities, mapDetails, jsonArray); - if(mapDetails.size()>0 && mapDetails!=null){ - for (Map mapDetail : mapDetails) { - String uuidDetail = UUIDUtils.getUUID(); - mapDetail.put("id", uuidDetail); - mapDetail.put("formmain_id", uuid); - mapDetail.put("create_user_id", "c796fd9ba4c9f5ff3cc2fa41a040e443"); - mapDetail.put("modify_user_id", "c796fd9ba4c9f5ff3cc2fa41a040e443"); - mapDetail.put("org_id", "0"); - mapDetail.put("create_time", new Date()); - mapDetail.put("modify_time", new Date()); - mapDetail.put("sts", "Y"); - mapDetail.put("data_status","Y");//新增状态 - comparisonDetailsEntity.setMapDetails(mapDetail); - ComparisonDetailsEntity comparisonDetailsEntityOne = comparisonDetailsDao.saveComparisonDetails(comparisonDetailsEntity); - //comparisonEntityOne.setComparisonDetailsEntity(comparisonDetailsEntityOne); - //保存操作日志 - //controlsLogDaoimpl.saveControlsLog(uuidDetail,jsonObject.getString("appName"),jsonObject.getString("appCode"),jsonObject.toJSONString(),"接口新增",jsonObject.getString("optionName"),comparisonDetailsEntity.getDbName()+"_option_log"); - } - jsonObjectList.put(comparisonDetailsEntity.getDbName(),mapDetails); - } - }else{ - jsonObjectList.put(comparisonDetailsEntity.getDbName(),new ArrayList<>()); - } - list.add(jsonObjectList); - //保存操作日志 - controlsLogDaoimpl.saveControlsLog(uuid,jsonObject.getString("appName"),jsonObject.getString("appCode"),jsonObject.toJSONString(),"接口新增",jsonObject.getString("optionName"),comparisonEntityRule.getDbName()+"_option_log"); - return BaseResult.getSuccessMessageEntity("保存成功", list); - } catch (Exception e) { - logger.info("保存通用数据时候错误:{}", e.getMessage()); - return BaseResult.getFailureMessageEntity("保存失败"); - } - } - } + JSONObject jsonObjectMain=new JSONObject(); + JSONArray jsonArray=new JSONArray(); + //根据dbtype和dbname分组,拿到表名称和表类型 + Map>> collect = comparisonEntities.stream().collect(Collectors.groupingBy(ComparisonEntity::getDbName, Collectors.groupingBy(ComparisonEntity::getDbType))); + List> keyPairs = collect.entrySet().stream() + .flatMap(e1 -> e1.getValue().keySet().stream() + .map(dbname -> new AbstractMap.SimpleEntry<>(e1.getKey(), dbname))) + .collect(Collectors.toList()); + for (Map.Entry keyPair : keyPairs) { + if(keyPair.getValue().equals("1")){ + String main = jsonObject.getString(keyPair.getKey()); + if(main!=null){ + jsonObjectMain = JSONObject.parseObject(main); + } + } + if(keyPair.getValue().equals("2")){ + jsonArray= jsonObject.getJSONArray(keyPair.getKey()); + } + } + if(jsonObjectMain!=null && jsonObjectMain.size()>0) { + Map map = new HashMap<>();//将主表数据存到map中 + List> mapDetails = new ArrayList<>();//将子表数据存到map中 + if (comparisonEntities != null && comparisonEntities.size() > 0) { + map = spliceMainMap(comparisonEntities, jsonObjectMain, map, comparisonEntity, comparisonDetailsEntity); + String uuid = null; + if (jsonObjectMain.getString("id") == null) { + uuid = UUIDUtils.getUUID(); + map.put("id", uuid); + } else { + uuid = jsonObjectMain.getString("id"); + map.put("id", jsonObjectMain.getString("id")); + } + map.put("create_user_id", "c796fd9ba4c9f5ff3cc2fa41a040e443"); + map.put("modify_user_id", "c796fd9ba4c9f5ff3cc2fa41a040e443"); + map.put("org_id", "0"); + map.put("create_time", new Date()); + map.put("modify_time", new Date()); + map.put("sts", "Y"); + map.put("data_status", "Y");//新增状态 + map.put("add_status", "0");//新增状态 + map.put("update_status", "1");//修改状态 + map.put("delete_status", "1");//删除状态 + ComparisonEntity comparisonEntityRule = comparisonEntities.get(0); + //查询单据规则 只查询主表得,明细表不用 + try { + ComparisonEntity comparisonEntityRules = comparisonDao.queryComparisonById(comparisonEntityRule); + String documentRule = comparisonEntityRules.getDocumentRule();//"KH-2024-05-30-1"; + logger.info("通用数据保存接口中根据mId查询出来的单据规则为:{}", documentRule); + if (documentRule != null) { + //获取规则前缀 CK + String rulePrefix = documentRule.substring(0, documentRule.indexOf("-")); + //获取规则中间日期 yyyy-MM-dd + String ruleDate = documentRule.substring(documentRule.indexOf("-") + 1, documentRule.lastIndexOf("-")); + String ruleMiddle = getRuleDate(ruleDate); + //获取规则后缀 + String ruleSuffixLength = documentRule.substring(documentRule.lastIndexOf("-") + 1); + int ruleSuffix = ruleSuffixLength.length(); + //生成单据规则 + comparisonEntityRule.setRulePrefix(rulePrefix); + comparisonEntityRule.setRuleMiddle(ruleMiddle); + comparisonEntityRule.setRuleSuffix(ruleSuffix); + try { + //新生成单据规则保存到数据库 + ComparisonEntity comparisonEntityRuleGz = comparisonDao.queryComparisonRule(comparisonEntityRule); + map.put("document_rule", comparisonEntityRuleGz.getDocumentRule());//单据规则 + map.put("document_rule_num", comparisonEntityRuleGz.getDocumentRuleNum());//单据规则流水号 + comparisonEntityRule.setMap(map); + } catch (Exception e) { + logger.info("保存通用数据时候生成单据规则错误:{}", e.getMessage()); + return BaseResult.getFailureMessageEntity("保存失败"); + } + } + } catch (Exception e) { + logger.info("通用数据保存接口中查询单据规则错误:{}", e.getMessage()); + return BaseResult.getFailureMessageEntity("保存失败"); + } + try { + List list = new ArrayList<>(); + JSONObject jsonObjectList = new JSONObject(); + //保存主表数据 + //ComparisonEntity comparisonEntityOne = comparisonDao.saveComparison(comparisonEntityRule); + // jsonObjectList.put(comparisonEntityOne.getDbName(),map); + //保存子表数据 + if (jsonArray != null && jsonArray.size() > 0) { + mapDetails = spliceDetailMap(comparisonEntities, mapDetails, jsonArray); + if (mapDetails.size() > 0 && mapDetails != null) { + for (Map mapDetail : mapDetails) { + String uuidDetail = UUIDUtils.getUUID(); + mapDetail.put("id", uuidDetail); + mapDetail.put("formmain_id", uuid); + mapDetail.put("create_user_id", "c796fd9ba4c9f5ff3cc2fa41a040e443"); + mapDetail.put("modify_user_id", "c796fd9ba4c9f5ff3cc2fa41a040e443"); + mapDetail.put("org_id", "0"); + mapDetail.put("create_time", new Date()); + mapDetail.put("modify_time", new Date()); + mapDetail.put("sts", "Y"); + mapDetail.put("data_status", "Y");//新增状态 + comparisonDetailsEntity.setMapDetails(mapDetail); + //ComparisonDetailsEntity comparisonDetailsEntityOne = comparisonDetailsDao.saveComparisonDetails(comparisonDetailsEntity); + //comparisonEntityOne.setComparisonDetailsEntity(comparisonDetailsEntityOne); + //保存操作日志 + //controlsLogDaoimpl.saveControlsLog(uuidDetail,jsonObject.getString("appName"),jsonObject.getString("appCode"),jsonObject.toJSONString(),"接口新增",jsonObject.getString("optionName"),comparisonDetailsEntity.getDbName()+"_option_log"); + } + jsonObjectList.put(comparisonDetailsEntity.getDbName(), mapDetails); + } + } else { + jsonObjectList.put(comparisonDetailsEntity.getDbName(), new ArrayList<>()); + } + list.add(jsonObjectList); + //保存操作日志 + // controlsLogDaoimpl.saveControlsLog(uuid,jsonObject.getString("appName"),jsonObject.getString("appCode"),jsonObject.toJSONString(),"接口新增",jsonObject.getString("optionName"),comparisonEntityRule.getDbName()+"_option_log"); + return BaseResult.getSuccessMessageEntity("保存成功", list); + } catch (Exception e) { + logger.info("保存通用数据时候错误:{}", e.getMessage()); + return BaseResult.getFailureMessageEntity("保存失败"); + } + } + } return BaseResult.getFailureMessageEntity("查询失败","请检查传递参数"); } From 422f5f4469ce6b93ec9e2ad686ee167ece0a1ff8 Mon Sep 17 00:00:00 2001 From: hecan <1718492867@qq.com> Date: Mon, 24 Jun 2024 17:33:14 +0800 Subject: [PATCH 07/22] =?UTF-8?q?=E8=B0=83=E6=95=B4=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=92=8C=E6=96=B0=E5=A2=9E=E5=BE=97=E5=8F=82=E6=95=B0=EF=BC=8C?= =?UTF-8?q?=E4=B8=BA=E8=A1=A8=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/ComparisonServiceImpl.java | 163 ++++++++++++------ 1 file changed, 108 insertions(+), 55 deletions(-) diff --git a/service/src/main/java/com/hzya/frame/sysnew/comparison/service/impl/ComparisonServiceImpl.java b/service/src/main/java/com/hzya/frame/sysnew/comparison/service/impl/ComparisonServiceImpl.java index 31873512..16ed916e 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/comparison/service/impl/ComparisonServiceImpl.java +++ b/service/src/main/java/com/hzya/frame/sysnew/comparison/service/impl/ComparisonServiceImpl.java @@ -149,26 +149,37 @@ public class ComparisonServiceImpl extends BaseService } JSONObject jsonObjectMain=new JSONObject(); JSONArray jsonArray=new JSONArray(); + List arrayList=new ArrayList<>(); //根据dbtype和dbname分组,拿到表名称和表类型 Map>> collect = comparisonEntities.stream().collect(Collectors.groupingBy(ComparisonEntity::getDbName, Collectors.groupingBy(ComparisonEntity::getDbType))); List> keyPairs = collect.entrySet().stream() .flatMap(e1 -> e1.getValue().keySet().stream() .map(dbname -> new AbstractMap.SimpleEntry<>(e1.getKey(), dbname))) .collect(Collectors.toList()); + // keyPairs 得值为键值对,键是表名称,值是类型,避免多个子表得键一样,比如:mdm_customer:1,mdm_customer_bank:2,mdm_customer_option_log:2 for (Map.Entry keyPair : keyPairs) { + //如果是1,就是主表,根据查询出来得主表是否是传输传递得主表 if(keyPair.getValue().equals("1")){ String main = jsonObject.getString(keyPair.getKey()); if(main!=null){ jsonObjectMain = JSONObject.parseObject(main); } } + //如果是2,就是明细表,根据查询出来得子表是否是传输传递得子表 if(keyPair.getValue().equals("2")){ jsonArray= jsonObject.getJSONArray(keyPair.getKey()); + if(jsonArray!= null) { + for (int i = 0; i < jsonArray.size(); i++) { + JSONObject jsonObjectDetails = jsonArray.getJSONObject(i); + jsonObjectDetails.put("table_name", keyPair.getKey()); + } + arrayList.add(jsonArray); + } } } if(jsonObjectMain!=null && jsonObjectMain.size()>0) { Map map = new HashMap<>();//将主表数据存到map中 - List> mapDetails = new ArrayList<>();//将子表数据存到map中 + List>> mapDetails = new ArrayList<>();//将子表数据存到map中 if (comparisonEntities != null && comparisonEntities.size() > 0) { map = spliceMainMap(comparisonEntities, jsonObjectMain, map, comparisonEntity, comparisonDetailsEntity); String uuid = null; @@ -227,28 +238,32 @@ public class ComparisonServiceImpl extends BaseService List list = new ArrayList<>(); JSONObject jsonObjectList = new JSONObject(); //保存主表数据 - //ComparisonEntity comparisonEntityOne = comparisonDao.saveComparison(comparisonEntityRule); - // jsonObjectList.put(comparisonEntityOne.getDbName(),map); + ComparisonEntity comparisonEntityOne = comparisonDao.saveComparison(comparisonEntityRule); + jsonObjectList.put(comparisonEntityOne.getDbName(),map); //保存子表数据 - if (jsonArray != null && jsonArray.size() > 0) { - mapDetails = spliceDetailMap(comparisonEntities, mapDetails, jsonArray); - if (mapDetails.size() > 0 && mapDetails != null) { - for (Map mapDetail : mapDetails) { - String uuidDetail = UUIDUtils.getUUID(); - mapDetail.put("id", uuidDetail); - mapDetail.put("formmain_id", uuid); - mapDetail.put("create_user_id", "c796fd9ba4c9f5ff3cc2fa41a040e443"); - mapDetail.put("modify_user_id", "c796fd9ba4c9f5ff3cc2fa41a040e443"); - mapDetail.put("org_id", "0"); - mapDetail.put("create_time", new Date()); - mapDetail.put("modify_time", new Date()); - mapDetail.put("sts", "Y"); - mapDetail.put("data_status", "Y");//新增状态 - comparisonDetailsEntity.setMapDetails(mapDetail); - //ComparisonDetailsEntity comparisonDetailsEntityOne = comparisonDetailsDao.saveComparisonDetails(comparisonDetailsEntity); - //comparisonEntityOne.setComparisonDetailsEntity(comparisonDetailsEntityOne); - //保存操作日志 - //controlsLogDaoimpl.saveControlsLog(uuidDetail,jsonObject.getString("appName"),jsonObject.getString("appCode"),jsonObject.toJSONString(),"接口新增",jsonObject.getString("optionName"),comparisonDetailsEntity.getDbName()+"_option_log"); + if (arrayList != null && arrayList.size() > 0) { + mapDetails = spliceDetailMap(comparisonEntities, mapDetails, arrayList); + if(mapDetails.size()>0 && mapDetails!=null ){ + for (List> mapDetail : mapDetails) { + for (Map stringObjectMap : mapDetail) { + String uuidDetail = UUIDUtils.getUUID(); + stringObjectMap.put("id", uuidDetail); + stringObjectMap.put("formmain_id", uuid); + stringObjectMap.put("create_user_id", "c796fd9ba4c9f5ff3cc2fa41a040e443"); + stringObjectMap.put("modify_user_id", "c796fd9ba4c9f5ff3cc2fa41a040e443"); + stringObjectMap.put("org_id", "0"); + stringObjectMap.put("create_time", new Date()); + stringObjectMap.put("modify_time", new Date()); + stringObjectMap.put("sts", "Y"); + stringObjectMap.put("data_status", "Y");//新增状态 + comparisonDetailsEntity.setMapDetails(stringObjectMap); + comparisonDetailsEntity.setDbName(String.valueOf(stringObjectMap.get("table_name"))); + stringObjectMap.remove("table_name"); + ComparisonDetailsEntity comparisonDetailsEntityOne = comparisonDetailsDao.saveComparisonDetails(comparisonDetailsEntity); + comparisonEntityOne.setComparisonDetailsEntity(comparisonDetailsEntityOne); + //保存操作日志 + //controlsLogDaoimpl.saveControlsLog(uuidDetail,jsonObject.getString("appName"),jsonObject.getString("appCode"),jsonObject.toJSONString(),"接口新增",jsonObject.getString("optionName"),comparisonDetailsEntity.getDbName()+"_option_log"); + } } jsonObjectList.put(comparisonDetailsEntity.getDbName(), mapDetails); } @@ -283,11 +298,6 @@ public class ComparisonServiceImpl extends BaseService } ComparisonEntity comparisonEntity = jsonObject.toJavaObject(ComparisonEntity.class); ComparisonDetailsEntity comparisonDetailsEntity=new ComparisonDetailsEntity(); - JSONObject jsonObjectMain=jsonObject.getJSONObject("main");//获取主表数据 - JSONArray jsonArray = jsonObject.getJSONArray("details");//获取子表数据 - if(!checkStr(jsonObjectMain.getString("id"))){ - return BaseResult.getFailureMessageEntity("更新时候主表id不能为空"); - } List comparisonEntities=new ArrayList<>(); //根据主数据编码查询表名称,字段名称等信息 10001 try { @@ -299,8 +309,41 @@ public class ComparisonServiceImpl extends BaseService logger.info("根据主数据编码查询信息错误:{}",e.getMessage()); return BaseResult.getFailureMessageEntity("更新失败"); } + JSONObject jsonObjectMain=new JSONObject(); + JSONArray jsonArray=new JSONArray(); + List arrayList=new ArrayList<>(); + //根据dbtype和dbname分组,拿到表名称和表类型 + Map>> collect = comparisonEntities.stream().collect(Collectors.groupingBy(ComparisonEntity::getDbName, Collectors.groupingBy(ComparisonEntity::getDbType))); + List> keyPairs = collect.entrySet().stream() + .flatMap(e1 -> e1.getValue().keySet().stream() + .map(dbname -> new AbstractMap.SimpleEntry<>(e1.getKey(), dbname))) + .collect(Collectors.toList()); + for (Map.Entry keyPair : keyPairs) { + if(keyPair.getValue().equals("1")){ + String main = jsonObject.getString(keyPair.getKey()); + if(main!=null){ + jsonObjectMain = JSONObject.parseObject(main); + if(!checkStr(jsonObjectMain.getString("id"))){ + return BaseResult.getFailureMessageEntity("更新时候主表id不能为空"); + } + } + } + if(keyPair.getValue().equals("2")){ + jsonArray= jsonObject.getJSONArray(keyPair.getKey()); + if(jsonArray!= null) { + for (int i = 0; i < jsonArray.size(); i++) { + JSONObject jsonObjectDetails = jsonArray.getJSONObject(i); + if(!checkStr(jsonObjectDetails.getString("id"))){ + return BaseResult.getFailureMessageEntity("更新明细表时候明细表id不能为空"); + } + jsonObjectDetails.put("table_name", keyPair.getKey()); + } + arrayList.add(jsonArray); + } + } + } Map map=new HashMap<>();//将主表数据存到map中 - List> mapDetails=new ArrayList<>();//将子表数据存到map中 + List>> mapDetails=new ArrayList<>();//将子表数据存到map中 if(comparisonEntities !=null && comparisonEntities.size()>0) { map=spliceMainMap(comparisonEntities,jsonObjectMain,map,comparisonEntity,comparisonDetailsEntity); map.put("create_user_id", "c796fd9ba4c9f5ff3cc2fa41a040e443"); @@ -330,21 +373,24 @@ public class ComparisonServiceImpl extends BaseService jsonObjectList.put(comparisonEntity.getDbName(),map); if (integer>0) { //保存子表数据 - if (jsonArray != null && jsonArray.size() > 0) { - mapDetails=spliceDetailMap(comparisonEntities,mapDetails,jsonArray); - for (Map mapDetail : mapDetails) { - mapDetail.put("create_user_id", "c796fd9ba4c9f5ff3cc2fa41a040e443"); - mapDetail.put("modify_user_id", "c796fd9ba4c9f5ff3cc2fa41a040e443"); - mapDetail.put("org_id", "0"); - mapDetail.put("modify_time", new Date()); - mapDetail.put("sts", "Y"); - mapDetail.put("data_status","F");//数据状态 - //comparisonDetailsEntity.setFormmainId(jsonObjectMain.getString("id")); - comparisonDetailsEntity.setId(String.valueOf(mapDetail.get("id"))); - comparisonDetailsEntity.setMapDetails(mapDetail); - comparisonDetailsDao.updateComparisonDetailsByType(comparisonDetailsEntity); - //保存操作日志 - // controlsLogDaoimpl.saveControlsLog(comparisonDetailsEntity.getId(),jsonObject.getString("appName"),jsonObject.getString("appCode"),jsonObject.toJSONString(),"接口更新",jsonObject.getString("optionName"),comparisonDetailsEntity.getDbName()+"_option_log"); + if (arrayList != null && arrayList.size() > 0) { + mapDetails=spliceDetailMap(comparisonEntities,mapDetails,arrayList); + for (List> mapDetail : mapDetails) { + for (Map stringObjectMap : mapDetail) { + stringObjectMap.put("create_user_id", "c796fd9ba4c9f5ff3cc2fa41a040e443"); + stringObjectMap.put("modify_user_id", "c796fd9ba4c9f5ff3cc2fa41a040e443"); + stringObjectMap.put("org_id", "0"); + stringObjectMap.put("modify_time", new Date()); + stringObjectMap.put("sts", "Y"); + stringObjectMap.put("data_status","F");//数据状态 + comparisonDetailsEntity.setId(String.valueOf(stringObjectMap.get("id"))); + comparisonDetailsEntity.setMapDetails(stringObjectMap); + comparisonDetailsEntity.setDbName(String.valueOf(stringObjectMap.get("table_name"))); + stringObjectMap.remove("table_name"); + comparisonDetailsDao.updateComparisonDetailsByType(comparisonDetailsEntity); + //保存操作日志 + // controlsLogDaoimpl.saveControlsLog(comparisonDetailsEntity.getId(),jsonObject.getString("appName"),jsonObject.getString("appCode"),jsonObject.toJSONString(),"接口更新",jsonObject.getString("optionName"),comparisonDetailsEntity.getDbName()+"_option_log"); + } } jsonObjectList.put(comparisonDetailsEntity.getDbName(),mapDetails); }else{ @@ -352,7 +398,7 @@ public class ComparisonServiceImpl extends BaseService } jsonObjects.add(jsonObjectList); //保存操作日志 - controlsLogDaoimpl.saveControlsLog(comparisonEntity.getId(),jsonObject.getString("appName"),jsonObject.getString("appCode"),jsonObject.toJSONString(),"接口更新",jsonObject.getString("optionName"),comparisonEntity.getDbName()+"_option_log"); + // controlsLogDaoimpl.saveControlsLog(comparisonEntity.getId(),jsonObject.getString("appName"),jsonObject.getString("appCode"),jsonObject.toJSONString(),"接口更新",jsonObject.getString("optionName"),comparisonEntity.getDbName()+"_option_log"); return BaseResult.getSuccessMessageEntity("更新成功", jsonObjects); }else{ return BaseResult.getFailureMessageEntity("更新失败"); @@ -487,20 +533,27 @@ public class ComparisonServiceImpl extends BaseService } //得到明细表数据 - private List> spliceDetailMap(List comparisonEntities,List> mapDetails,JSONArray jsonArray){ - if (jsonArray != null && jsonArray.size() > 0) { - for (Object object : jsonArray) { - JSONObject jsonObjectDetails = (JSONObject) JSON.toJSON(object); - JSONObject jsonObject=new JSONObject(); - //遍历主表下面的所有key,字段名 - for (String key : jsonObjectDetails.keySet()) { - for (ComparisonEntity entity : comparisonEntities) { - if (entity.getDbType().equals("2") && entity.getEnName().equals(key)) { - jsonObject.put(key,jsonObjectDetails.getString(key)); + private List>> spliceDetailMap(List comparisonEntities,List>> mapDetails,List arrayList){ + if (arrayList != null && arrayList.size() > 0) { + for (JSONArray jsonArray : arrayList) { + List> list=new ArrayList<>(); + for (Object object : jsonArray) { + JSONObject jsonObject = new JSONObject(); + JSONObject jsonObjectDetails = (JSONObject) JSON.toJSON(object); + //遍历主表下面的所有key,字段名 + for (String key : jsonObjectDetails.keySet()) { + for (ComparisonEntity entity : comparisonEntities) { + if (entity.getDbType().equals("2") && entity.getEnName().equals(key)) { + jsonObject.put(key, jsonObjectDetails.getString(key)); + } + if(key.equals("table_name")){ + jsonObject.put(key,jsonObjectDetails.getString(key)); + } } } + list.add(jsonObject); } - mapDetails.add(jsonObject); + mapDetails.add(list); } } return mapDetails; From 2ae7391e650538bf59002d9bf5439caf25f903bf Mon Sep 17 00:00:00 2001 From: hecan <1718492867@qq.com> Date: Mon, 24 Jun 2024 17:44:13 +0800 Subject: [PATCH 08/22] =?UTF-8?q?=E6=94=BE=E5=BC=80=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E6=97=B6=E5=80=99=E6=B3=A8=E9=87=8A=E6=8E=89=E7=9A=84=E6=93=8D?= =?UTF-8?q?=E4=BD=9C=E6=97=A5=E5=BF=97=E4=BF=9D=E5=AD=98=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sysnew/comparison/service/impl/ComparisonServiceImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/service/src/main/java/com/hzya/frame/sysnew/comparison/service/impl/ComparisonServiceImpl.java b/service/src/main/java/com/hzya/frame/sysnew/comparison/service/impl/ComparisonServiceImpl.java index 16ed916e..c36dac38 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/comparison/service/impl/ComparisonServiceImpl.java +++ b/service/src/main/java/com/hzya/frame/sysnew/comparison/service/impl/ComparisonServiceImpl.java @@ -272,7 +272,7 @@ public class ComparisonServiceImpl extends BaseService } list.add(jsonObjectList); //保存操作日志 - // controlsLogDaoimpl.saveControlsLog(uuid,jsonObject.getString("appName"),jsonObject.getString("appCode"),jsonObject.toJSONString(),"接口新增",jsonObject.getString("optionName"),comparisonEntityRule.getDbName()+"_option_log"); + controlsLogDaoimpl.saveControlsLog(uuid,jsonObject.getString("appName"),jsonObject.getString("appCode"),jsonObject.toJSONString(),"接口新增",jsonObject.getString("optionName"),comparisonEntityRule.getDbName()+"_option_log"); return BaseResult.getSuccessMessageEntity("保存成功", list); } catch (Exception e) { logger.info("保存通用数据时候错误:{}", e.getMessage()); @@ -398,7 +398,7 @@ public class ComparisonServiceImpl extends BaseService } jsonObjects.add(jsonObjectList); //保存操作日志 - // controlsLogDaoimpl.saveControlsLog(comparisonEntity.getId(),jsonObject.getString("appName"),jsonObject.getString("appCode"),jsonObject.toJSONString(),"接口更新",jsonObject.getString("optionName"),comparisonEntity.getDbName()+"_option_log"); + controlsLogDaoimpl.saveControlsLog(comparisonEntity.getId(),jsonObject.getString("appName"),jsonObject.getString("appCode"),jsonObject.toJSONString(),"接口更新",jsonObject.getString("optionName"),comparisonEntity.getDbName()+"_option_log"); return BaseResult.getSuccessMessageEntity("更新成功", jsonObjects); }else{ return BaseResult.getFailureMessageEntity("更新失败"); From 08e0a5609942a787f2eb7305d35a62e73734f95f Mon Sep 17 00:00:00 2001 From: lvleigang <957075182@qq.com> Date: Mon, 24 Jun 2024 17:48:12 +0800 Subject: [PATCH 09/22] =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E8=AE=A1=E5=88=92?= =?UTF-8?q?=EF=BC=8C=E6=B7=BB=E5=8A=A0=E6=9F=A5=E8=AF=A2=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E6=BA=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/SysApplicationServiceImpl.java | 27 ++++++++++++++++--- .../frame/web/quartz/QuartzJobFactory.java | 16 +++++++++++ 2 files changed, 40 insertions(+), 3 deletions(-) diff --git a/service/src/main/java/com/hzya/frame/sysnew/application/service/impl/SysApplicationServiceImpl.java b/service/src/main/java/com/hzya/frame/sysnew/application/service/impl/SysApplicationServiceImpl.java index fe49d95d..d6f85b69 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/application/service/impl/SysApplicationServiceImpl.java +++ b/service/src/main/java/com/hzya/frame/sysnew/application/service/impl/SysApplicationServiceImpl.java @@ -225,8 +225,8 @@ public class SysApplicationServiceImpl extends BaseService sysApplicationDatabaseEntities = sysApplicationDatabaseDao.queryBase(checkData); + if(detailEntity.getId() != null && !"".equals(detailEntity.getId())){ + if(sysApplicationDatabaseEntities != null && sysApplicationDatabaseEntities.size() > 0){ + for (int i = 0; i < sysApplicationDatabaseEntities.size(); i++) { + if(!detailEntity.getId().equals(sysApplicationDatabaseEntities.get(i).getId())){ + return BaseResult.getFailureMessageEntity("数据源编码已经存在,请修改"); + } + } + } + }else { + if(sysApplicationDatabaseEntities != null && sysApplicationDatabaseEntities.size() > 0){ + return BaseResult.getFailureMessageEntity("数据源编码已经存在,请修改"); + } + } + } //修改应用基本信息 SysApplicationEntity sysApplicationEntity = doUpdateApp(entity); if ("2".equals(entity.getUpdateType())) {//开发管理界面,需要保存 接口参数,和数据源 @@ -1691,7 +1712,7 @@ public class SysApplicationServiceImpl extends BaseService sysApplicationDatabaseEntities = sysApplicationDatabaseDao.queryBase(sysApplicationDatabaseEntity); + if(sysApplicationDatabaseEntities != null && sysApplicationDatabaseEntities.size() == 1){ + sourceCode = sysApplicationDatabaseEntities.get(0).getSourceCode(); + } + //查找插件 PluginBaseEntity pluginBaseEntity = PluginUtils.getPluginsById(sysApplicationPluginEntity.getPluginCode()); if(pluginBaseEntity == null ){ @@ -114,6 +129,7 @@ public class QuartzJobFactory implements Job { JSONObject req = new JSONObject(); req.put("startTime",oldStartTime); req.put("endTime",startTime); + req.put("sourceCode",sourceCode); try { JsonResultEntity jsonResultEntity = pluginBaseEntity.executeBusiness(req); if(jsonResultEntity.isFlag()){ From 4b27586193a62d07c38449d27f5db1915220dee3 Mon Sep 17 00:00:00 2001 From: hecan <1718492867@qq.com> Date: Mon, 24 Jun 2024 18:03:02 +0800 Subject: [PATCH 10/22] =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=88=A4=E6=96=AD=EF=BC=8C=E6=98=8E=E7=BB=86?= =?UTF-8?q?=E8=A1=A8=E6=98=AF=E5=90=A6=E4=B8=BA=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/ComparisonServiceImpl.java | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/service/src/main/java/com/hzya/frame/sysnew/comparison/service/impl/ComparisonServiceImpl.java b/service/src/main/java/com/hzya/frame/sysnew/comparison/service/impl/ComparisonServiceImpl.java index c36dac38..1bfd9f09 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/comparison/service/impl/ComparisonServiceImpl.java +++ b/service/src/main/java/com/hzya/frame/sysnew/comparison/service/impl/ComparisonServiceImpl.java @@ -100,13 +100,15 @@ public class ComparisonServiceImpl extends BaseService for (Map comparisonEntitiePage : comparisonEntitiePages) { JSONObject jsonObjects=new JSONObject(); jsonObjects.put(comparisonEntity.getDbName(),comparisonEntitiePage); - comparisonDetailsEntity.setFormmainId(String.valueOf(comparisonEntitiePage.get("id"))); - //查询明细表数据 - List> maps = comparisonDetailsDao.queryComparisonDetailsPage(comparisonDetailsEntity); - if(CollectionUtils.isNotEmpty(maps)){ - jsonObjects.put(comparisonDetailsEntity.getDbName(),maps); - }else { - jsonObjects.put(comparisonDetailsEntity.getDbName(),new JSONArray()); + if(comparisonDetailsEntity.getDbName()!=null){ + comparisonDetailsEntity.setFormmainId(String.valueOf(comparisonEntitiePage.get("id"))); + //查询明细表数据 + List> maps = comparisonDetailsDao.queryComparisonDetailsPage(comparisonDetailsEntity); + if(CollectionUtils.isNotEmpty(maps)){ + jsonObjects.put(comparisonDetailsEntity.getDbName(),maps); + }else { + jsonObjects.put(comparisonDetailsEntity.getDbName(),new JSONArray()); + } } list.add(jsonObjects); } From cc866f471d80e6179fdc4a3efb11ab39222c580b Mon Sep 17 00:00:00 2001 From: hecan <1718492867@qq.com> Date: Mon, 24 Jun 2024 19:00:54 +0800 Subject: [PATCH 11/22] =?UTF-8?q?=E4=BD=BF=E7=94=A8=E4=BC=A0=E5=85=A5?= =?UTF-8?q?=E7=9A=84id?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/ComparisonServiceImpl.java | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/service/src/main/java/com/hzya/frame/sysnew/comparison/service/impl/ComparisonServiceImpl.java b/service/src/main/java/com/hzya/frame/sysnew/comparison/service/impl/ComparisonServiceImpl.java index 1bfd9f09..974d5470 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/comparison/service/impl/ComparisonServiceImpl.java +++ b/service/src/main/java/com/hzya/frame/sysnew/comparison/service/impl/ComparisonServiceImpl.java @@ -165,6 +165,9 @@ public class ComparisonServiceImpl extends BaseService String main = jsonObject.getString(keyPair.getKey()); if(main!=null){ jsonObjectMain = JSONObject.parseObject(main); + if(!checkStr(jsonObjectMain.getString("id"))){ + return BaseResult.getFailureMessageEntity("新增时候主表id不能为空"); + } } } //如果是2,就是明细表,根据查询出来得子表是否是传输传递得子表 @@ -174,6 +177,9 @@ public class ComparisonServiceImpl extends BaseService for (int i = 0; i < jsonArray.size(); i++) { JSONObject jsonObjectDetails = jsonArray.getJSONObject(i); jsonObjectDetails.put("table_name", keyPair.getKey()); + if(!checkStr(jsonObjectDetails.getString("id"))){ + return BaseResult.getFailureMessageEntity("新增时候明细id不能为空"); + } } arrayList.add(jsonArray); } @@ -184,14 +190,6 @@ public class ComparisonServiceImpl extends BaseService List>> mapDetails = new ArrayList<>();//将子表数据存到map中 if (comparisonEntities != null && comparisonEntities.size() > 0) { map = spliceMainMap(comparisonEntities, jsonObjectMain, map, comparisonEntity, comparisonDetailsEntity); - String uuid = null; - if (jsonObjectMain.getString("id") == null) { - uuid = UUIDUtils.getUUID(); - map.put("id", uuid); - } else { - uuid = jsonObjectMain.getString("id"); - map.put("id", jsonObjectMain.getString("id")); - } map.put("create_user_id", "c796fd9ba4c9f5ff3cc2fa41a040e443"); map.put("modify_user_id", "c796fd9ba4c9f5ff3cc2fa41a040e443"); map.put("org_id", "0"); @@ -250,7 +248,7 @@ public class ComparisonServiceImpl extends BaseService for (Map stringObjectMap : mapDetail) { String uuidDetail = UUIDUtils.getUUID(); stringObjectMap.put("id", uuidDetail); - stringObjectMap.put("formmain_id", uuid); + stringObjectMap.put("formmain_id", jsonObjectMain.getString("id")); stringObjectMap.put("create_user_id", "c796fd9ba4c9f5ff3cc2fa41a040e443"); stringObjectMap.put("modify_user_id", "c796fd9ba4c9f5ff3cc2fa41a040e443"); stringObjectMap.put("org_id", "0"); @@ -274,7 +272,7 @@ public class ComparisonServiceImpl extends BaseService } list.add(jsonObjectList); //保存操作日志 - controlsLogDaoimpl.saveControlsLog(uuid,jsonObject.getString("appName"),jsonObject.getString("appCode"),jsonObject.toJSONString(),"接口新增",jsonObject.getString("optionName"),comparisonEntityRule.getDbName()+"_option_log"); + controlsLogDaoimpl.saveControlsLog(jsonObjectMain.getString("id"),jsonObject.getString("appName"),jsonObject.getString("appCode"),jsonObject.toJSONString(),"接口新增",jsonObject.getString("optionName"),comparisonEntityRule.getDbName()+"_option_log"); return BaseResult.getSuccessMessageEntity("保存成功", list); } catch (Exception e) { logger.info("保存通用数据时候错误:{}", e.getMessage()); From f9a03750630179bfc9547befa0cc5c821c9e24cf Mon Sep 17 00:00:00 2001 From: hecan <1718492867@qq.com> Date: Mon, 24 Jun 2024 19:03:00 +0800 Subject: [PATCH 12/22] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=98=8E=E7=BB=86?= =?UTF-8?q?=E8=A1=A8=E7=9A=84id?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sysnew/comparison/service/impl/ComparisonServiceImpl.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/service/src/main/java/com/hzya/frame/sysnew/comparison/service/impl/ComparisonServiceImpl.java b/service/src/main/java/com/hzya/frame/sysnew/comparison/service/impl/ComparisonServiceImpl.java index 974d5470..8445dc71 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/comparison/service/impl/ComparisonServiceImpl.java +++ b/service/src/main/java/com/hzya/frame/sysnew/comparison/service/impl/ComparisonServiceImpl.java @@ -246,8 +246,7 @@ public class ComparisonServiceImpl extends BaseService if(mapDetails.size()>0 && mapDetails!=null ){ for (List> mapDetail : mapDetails) { for (Map stringObjectMap : mapDetail) { - String uuidDetail = UUIDUtils.getUUID(); - stringObjectMap.put("id", uuidDetail); + stringObjectMap.put("id", stringObjectMap.get("id")); stringObjectMap.put("formmain_id", jsonObjectMain.getString("id")); stringObjectMap.put("create_user_id", "c796fd9ba4c9f5ff3cc2fa41a040e443"); stringObjectMap.put("modify_user_id", "c796fd9ba4c9f5ff3cc2fa41a040e443"); From aea0ee873b9320e5a66ecd35c63ac60187f8fd76 Mon Sep 17 00:00:00 2001 From: lvleigang <957075182@qq.com> Date: Tue, 25 Jun 2024 08:59:00 +0800 Subject: [PATCH 13/22] =?UTF-8?q?=E4=B8=BB=E6=95=B0=E6=8D=AE=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mdm/service/impl/MdmServiceImpl.java | 87 ++++++++++++++----- 1 file changed, 67 insertions(+), 20 deletions(-) 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 45d2599a..3c1aef25 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 @@ -2511,35 +2511,84 @@ public class MdmServiceImpl implements IMdmService { mdmDataDto.setTableName(mdmModuleDbEntityList.get(i).getDbName()); List mdmDataFiledDtos = new ArrayList<>(); for (int i1 = 0; i1 < fileds.size(); i1++) { - MdmDataFiledDto mdmDataFiledDto = new MdmDataFiledDto(); - mdmDataFiledDto.setFiledsName(fileds.get(i1).getEnName()); - mdmDataFiledDto.setFiledsValue(jsonObject.getString(fileds.get(i1).getEnName())); - mdmDataFiledDtos.add(mdmDataFiledDto); + if("id".equals(fileds.get(i1).getEnName())){ + if (jsonObject.getString("id") != null) { + MdmDataFiledDto ids = new MdmDataFiledDto(); + ids.setFiledsName("id"); + ids.setFiledsValue(jsonObject.getString("id")); + mdmDataFiledDtos.add(ids); + } else { + MdmDataFiledDto ids = new MdmDataFiledDto(); + ids.setFiledsName("id"); + ids.setFiledsValue(UUIDUtils.getUUID()); + mdmDataFiledDtos.add(ids); + } + }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())){ + if (jsonObject.getString("id") != null) { + MdmDataFiledDto ids = new MdmDataFiledDto(); + ids.setFiledsName("data_status"); + ids.setFiledsValue("F"); + mdmDataFiledDtos.add(ids); + } else { + MdmDataFiledDto ids = new MdmDataFiledDto(); + ids.setFiledsName("data_status"); + ids.setFiledsValue("Y"); + mdmDataFiledDtos.add(ids); + } + }else if("sorts".equals(fileds.get(i1).getEnName())){ + + }else if("create_user_id".equals(fileds.get(i1).getEnName())){ + //if (jsonObject.getString("id") != null) { + // + //} else { + // MdmDataFiledDto ids = new MdmDataFiledDto(); + // ids.setFiledsName("create_user_id"); + // ids.setFiledsValue(UUIDUtils.getUUID()); + // mdmDataFiledDtos.add(ids); + //} + }else if("create_time".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())){ + MdmDataFiledDto ids = new MdmDataFiledDto(); + ids.setFiledsName("company_id"); + ids.setFiledsValue("0"); + mdmDataFiledDtos.add(ids); + }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("sts".equals(fileds.get(i1).getEnName())){ + + }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(); mdmDataFiledDto.setFiledsName("logid"); mdmDataFiledDto.setFiledsValue(StpUtil.getLoginIdAsString()); mdmDataFiledDtos.add(mdmDataFiledDto); - MdmDataFiledDto formain_id = new MdmDataFiledDto(); - formain_id.setFiledsName("formmain_id"); - formain_id.setFiledsValue(id); - mdmDataFiledDtos.add(formain_id); - mdmDataDto.setMdmDataFiledDtos(mdmDataFiledDtos); if (jsonObject.getString("id") != null) { - MdmDataFiledDto sts = new MdmDataFiledDto(); - sts.setFiledsName("sts"); - sts.setFiledsValue("Y"); - mdmDataFiledDtos.add(sts); mdmDataDto.setId(jsonObject.getString("id")); int a = mdmModuleDao.updateForm(mdmDataDto); } else { - MdmDataFiledDto ids = new MdmDataFiledDto(); - ids.setFiledsName("id"); - ids.setFiledsValue(UUIDUtils.getUUID()); - mdmDataFiledDtos.add(ids); - mdmDataDto.setMdmDataFiledDtos(mdmDataFiledDtos); mdmDataDto.setDbType(mdmModuleDbEntityList.get(i).getDbType()); int a = mdmModuleDao.saveForm(mdmDataDto); } @@ -2547,9 +2596,7 @@ public class MdmServiceImpl implements IMdmService { } } } - saveOption(dbname,mdmCode,saveData,id,msg); - } return str.toString(); } From 0e7b05e788d6960783e0304eecefde849a93f00b Mon Sep 17 00:00:00 2001 From: lvleigang <957075182@qq.com> Date: Tue, 25 Jun 2024 09:22:24 +0800 Subject: [PATCH 14/22] =?UTF-8?q?=E4=B8=BB=E6=95=B0=E6=8D=AE=E5=88=9B?= =?UTF-8?q?=E5=BB=BA=E8=A1=A8=E6=B7=BB=E5=8A=A0=E7=AC=AC=E4=B8=89=E6=96=B9?= =?UTF-8?q?=E4=B8=BB=E9=94=AEid?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/MdmModuleServiceImpl.java | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModule/service/impl/MdmModuleServiceImpl.java b/service/src/main/java/com/hzya/frame/mdm/mdmModule/service/impl/MdmModuleServiceImpl.java index 8a9c3ac6..6ffdef17 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModule/service/impl/MdmModuleServiceImpl.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModule/service/impl/MdmModuleServiceImpl.java @@ -582,6 +582,24 @@ public class MdmModuleServiceImpl extends BaseService i document_rule_num.setCreate(); document_rule_num.setDataType("1"); mdmModuleDbFiledsEntities.add(document_rule_num); + + MdmModuleDbFiledsEntity data_id = new MdmModuleDbFiledsEntity(); + data_id.setMdmId(entity.getMdmId()); + data_id.setDbId(entity.getId()); + data_id.setEnName("data_id"); + data_id.setChName("第三方主键ID"); + data_id.setFiledType("1"); + data_id.setAddType("2"); + data_id.setUpdateType("2"); + data_id.setShowType("2"); + data_id.setQueryType("2"); + data_id.setListType("2"); + data_id.setViewType("2"); + data_id.setFiledLength("255"); + data_id.setCreate(); + data_id.setDataType("1"); + mdmModuleDbFiledsEntities.add(data_id); + } if ("2".equals(entity.getDbType()) || "3".equals(entity.getDbType()) || "4".equals(entity.getDbType())) { MdmModuleDbFiledsEntity formmain_id = new MdmModuleDbFiledsEntity(); @@ -600,6 +618,24 @@ public class MdmModuleServiceImpl extends BaseService i formmain_id.setCreate(); formmain_id.setDataType("1"); mdmModuleDbFiledsEntities.add(formmain_id); + + MdmModuleDbFiledsEntity data_id = new MdmModuleDbFiledsEntity(); + data_id.setMdmId(entity.getMdmId()); + data_id.setDbId(entity.getId()); + data_id.setEnName("data_id"); + data_id.setChName("第三方主键ID"); + data_id.setFiledType("1"); + data_id.setAddType("2"); + data_id.setUpdateType("2"); + data_id.setShowType("2"); + data_id.setQueryType("2"); + data_id.setListType("2"); + data_id.setViewType("2"); + data_id.setFiledLength("255"); + data_id.setCreate(); + data_id.setDataType("1"); + mdmModuleDbFiledsEntities.add(data_id); + } //写入日志字段:操作人 if ("3".equals(entity.getDbType())) { From 5c77244d247a4330a3f7ba562a31af9f937f13ce Mon Sep 17 00:00:00 2001 From: yuqh <123456> Date: Tue, 25 Jun 2024 09:25:06 +0800 Subject: [PATCH 15/22] =?UTF-8?q?MDM=E5=85=AC=E7=94=A8=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../IMasterDataCustoMermanageService.java | 18 -- .../service/IMasterDataMemberService.java | 19 -- .../service/IMasterDataOrgsService.java | 19 -- .../service/IMasterDataProjectService.java | 19 -- .../MasterDataCustoMermanageServiceImpl.java | 149 ------------- .../impl/MasterDataMemberServiceImpl.java | 144 ------------- .../impl/MasterDataOrgsServiceImpl.java | 138 ------------ .../impl/MasterDataProjectServiceImpl.java | 132 ------------ .../service/impl/MasterDataServiceImpl.java | 197 ++++++++++++------ 9 files changed, 130 insertions(+), 705 deletions(-) delete mode 100644 service/src/main/java/com/hzya/frame/sysnew/comparison/masterData/service/IMasterDataCustoMermanageService.java delete mode 100644 service/src/main/java/com/hzya/frame/sysnew/comparison/masterData/service/IMasterDataMemberService.java delete mode 100644 service/src/main/java/com/hzya/frame/sysnew/comparison/masterData/service/IMasterDataOrgsService.java delete mode 100644 service/src/main/java/com/hzya/frame/sysnew/comparison/masterData/service/IMasterDataProjectService.java delete mode 100644 service/src/main/java/com/hzya/frame/sysnew/comparison/masterData/service/impl/MasterDataCustoMermanageServiceImpl.java delete mode 100644 service/src/main/java/com/hzya/frame/sysnew/comparison/masterData/service/impl/MasterDataMemberServiceImpl.java delete mode 100644 service/src/main/java/com/hzya/frame/sysnew/comparison/masterData/service/impl/MasterDataOrgsServiceImpl.java delete mode 100644 service/src/main/java/com/hzya/frame/sysnew/comparison/masterData/service/impl/MasterDataProjectServiceImpl.java diff --git a/service/src/main/java/com/hzya/frame/sysnew/comparison/masterData/service/IMasterDataCustoMermanageService.java b/service/src/main/java/com/hzya/frame/sysnew/comparison/masterData/service/IMasterDataCustoMermanageService.java deleted file mode 100644 index b7b2301a..00000000 --- a/service/src/main/java/com/hzya/frame/sysnew/comparison/masterData/service/IMasterDataCustoMermanageService.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.hzya.frame.sysnew.comparison.masterData.service; - -import com.alibaba.fastjson.JSONObject; -import com.hzya.frame.basedao.service.IBaseService; -import com.hzya.frame.sysnew.comparison.entity.ComparisonEntity; -import com.hzya.frame.web.entity.JsonResultEntity; - -public interface IMasterDataCustoMermanageService extends IBaseService { -/** - * - * @content 查询客户档案同步中台主数据中心 - * @author laborer - * @date 2024/6/20 0020 9:54 - * - */ - -JsonResultEntity queryCustoMermanageArchives(JSONObject jsonObject); -} diff --git a/service/src/main/java/com/hzya/frame/sysnew/comparison/masterData/service/IMasterDataMemberService.java b/service/src/main/java/com/hzya/frame/sysnew/comparison/masterData/service/IMasterDataMemberService.java deleted file mode 100644 index 73926f3e..00000000 --- a/service/src/main/java/com/hzya/frame/sysnew/comparison/masterData/service/IMasterDataMemberService.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.hzya.frame.sysnew.comparison.masterData.service; - -import com.alibaba.fastjson.JSONObject; -import com.hzya.frame.basedao.service.IBaseService; -import com.hzya.frame.sysnew.comparison.entity.ComparisonEntity; -import com.hzya.frame.web.entity.JsonResultEntity; - -public interface IMasterDataMemberService extends IBaseService { - - /** - * - * @content 查询项目档案 - * @Param - * @Return - * @Author hecan - * @Date 2024/6/6 16:10 - * **/ - JsonResultEntity queryMemberArchives(JSONObject jsonObject); -} diff --git a/service/src/main/java/com/hzya/frame/sysnew/comparison/masterData/service/IMasterDataOrgsService.java b/service/src/main/java/com/hzya/frame/sysnew/comparison/masterData/service/IMasterDataOrgsService.java deleted file mode 100644 index 1e08f408..00000000 --- a/service/src/main/java/com/hzya/frame/sysnew/comparison/masterData/service/IMasterDataOrgsService.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.hzya.frame.sysnew.comparison.masterData.service; - -import com.alibaba.fastjson.JSONObject; -import com.hzya.frame.basedao.service.IBaseService; -import com.hzya.frame.sysnew.comparison.entity.ComparisonEntity; -import com.hzya.frame.web.entity.JsonResultEntity; - -public interface IMasterDataOrgsService extends IBaseService { - /** - * - * @content 查询组织档案 - * @Param - * @Return - * @Author hecan - * @Date 2024/6/4 16:57 - * **/ - JsonResultEntity queryOrgsArchives(JSONObject jsonObject); - -} diff --git a/service/src/main/java/com/hzya/frame/sysnew/comparison/masterData/service/IMasterDataProjectService.java b/service/src/main/java/com/hzya/frame/sysnew/comparison/masterData/service/IMasterDataProjectService.java deleted file mode 100644 index 6b6799c1..00000000 --- a/service/src/main/java/com/hzya/frame/sysnew/comparison/masterData/service/IMasterDataProjectService.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.hzya.frame.sysnew.comparison.masterData.service; - -import com.alibaba.fastjson.JSONObject; -import com.hzya.frame.basedao.service.IBaseService; -import com.hzya.frame.sysnew.comparison.entity.ComparisonEntity; -import com.hzya.frame.web.entity.JsonResultEntity; - -public interface IMasterDataProjectService extends IBaseService { - - /** - * - * @content 查询项目档案 - * @Param - * @Return - * @Author hecan - * @Date 2024/6/6 16:10 - * **/ - JsonResultEntity queryProjectArchives(JSONObject jsonObject); -} diff --git a/service/src/main/java/com/hzya/frame/sysnew/comparison/masterData/service/impl/MasterDataCustoMermanageServiceImpl.java b/service/src/main/java/com/hzya/frame/sysnew/comparison/masterData/service/impl/MasterDataCustoMermanageServiceImpl.java deleted file mode 100644 index c9bfd60f..00000000 --- a/service/src/main/java/com/hzya/frame/sysnew/comparison/masterData/service/impl/MasterDataCustoMermanageServiceImpl.java +++ /dev/null @@ -1,149 +0,0 @@ -package com.hzya.frame.sysnew.comparison.masterData.service.impl; - -import cn.hutool.core.util.StrUtil; -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; -import com.hzya.frame.basedao.service.impl.BaseService; -import com.hzya.frame.dateutil.DateUtil; -import com.hzya.frame.mdm.mdmModuleSource.dao.impl.MdmModuleSourceDaoImpl; -import com.hzya.frame.mdm.mdmModuleSource.entity.MdmModuleSourceEntity; -import com.hzya.frame.sysnew.comparison.entity.ComparisonEntity; -import com.hzya.frame.sysnew.comparison.masterData.dao.impl.MasterDataDaoImpl; -import com.hzya.frame.sysnew.comparison.masterData.service.IMasterDataCustoMermanageService; -import com.hzya.frame.sysnew.comparison.masterData.service.IMasterDataProjectService; -import com.hzya.frame.sysnew.comparison.service.impl.ComparisonServiceImpl; -import com.hzya.frame.web.entity.BaseResult; -import com.hzya.frame.web.entity.JsonResultEntity; -import org.apache.commons.collections.CollectionUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import java.util.Date; -import java.util.HashMap; -import java.util.List; - -@Service("MasterDataCustoMermanageServiceImpl") -public class MasterDataCustoMermanageServiceImpl extends BaseService implements IMasterDataCustoMermanageService { - - @Autowired - private MasterDataDaoImpl masterDataDaoImpl; - @Autowired - private ComparisonServiceImpl comparisonServiceimpl; - @Autowired - private MdmModuleSourceDaoImpl mdmModuleSourceDaoImpl; - - private String ts = ""; - - //同步客户档案到主数据 - public JsonResultEntity queryCustoMermanageArchives(JSONObject json){ - JSONObject jsonObject = json.getJSONObject("jsonStr"); - //查询主数据来源表,根据来源类型为插件得进行分类,获取来源名称和编码 - List list = mdmModuleSourceDaoImpl.MdmModuleSourceentityGroupByType(); - if (CollectionUtils.isEmpty(list)) { - logger.info("数据来源表中没有类型为插件得数据,无法获取来源名称和来源编码"); - return BaseResult.getFailureMessageEntity("数据来源表无插件类型"); - } - for (MdmModuleSourceEntity mdmModuleSourceEntity : list) { - //通过不同的应用类型用于拼接sql - String appTyp = mdmModuleSourceEntity.getAppType(); - String dbCode = mdmModuleSourceEntity.getDbCode(); - switch (appTyp) { - case "1": - StringBuffer sb = new StringBuffer(); - if(null != jsonObject && StrUtil.isNotEmpty(jsonObject.getString("code"))){ - String code = jsonObject.getString("code"); - sb.append(" and a.code = '"+code+"'"); - }else{ - ts = DateUtil.dateToString(new Date(), "yyyy-MM-dd HH:mm:ss"); - sb.append(" and a.update_time >= '"+ts+"'"); - } - - StringBuffer stringBuffer = new StringBuffer(); - stringBuffer.append("SELECT id as id,field0013 AS code,field0014 AS name,field0016 AS pk_custclass,field0015 AS shortname,field0012 AS pk_org FROM formmain_0226 WHERE 1=1 AND id = '1706533959075383844' " ); - - mdmModuleSourceEntity.setDataSourceCode(dbCode); - try { - List> hashMaps = masterDataDaoImpl.queryArchivesByDataSource(stringBuffer.toString(),mdmModuleSourceEntity); - logger.info("查询出来的值为:{}",hashMaps); - if (null != hashMaps && hashMaps.size() > 0) { - ParametricAssembly(mdmModuleSourceEntity,hashMaps,"10004"); - } else { - logger.info("U8C主数据档案客商档案没有需要同步中台的数据"); - return null; - } - } catch (Exception e) { - logger.info("查询主数据档案客商档案错误:{}", e.getMessage()); - } - break; - default: - break; - } - } - return BaseResult.getSuccessMessageEntity("客商档案同步成功"); - } - - - //查询档案参数组装 - public JsonResultEntity ParametricAssembly(MdmModuleSourceEntity mdmModuleSourceEntity,List> hashMaps,String mdmCode){ - for (HashMap hashMap : hashMaps) { - JSONObject jsonObjectUser = new JSONObject(); - JSONObject jsonStr = new JSONObject(); - jsonObjectUser.put("id", hashMap.get("id")); - jsonObjectUser.put("mdmCode", mdmCode); - jsonStr.put("jsonStr", jsonObjectUser); - //查询明细信息 - Long formmainId = (Long) hashMap.get("id"); - StringBuffer stringBufferDetails = new StringBuffer(); - stringBufferDetails.append("SELECT field0023 AS pk_bankdoc,field0024 AS accnum,field0025 AS combinenum FROM formson_0229 WHERE formmain_id = '"+formmainId+"' " ); - List> hashMapsDetails = masterDataDaoImpl.queryArchivesByDataSource(stringBufferDetails.toString(),mdmModuleSourceEntity); - //先查询编码和名称查询是否存在 - JsonResultEntity jsonResultEntity = comparisonServiceimpl.queryEntityPage(jsonStr); - Object attribute = jsonResultEntity.getAttribute(); - logger.info("得到的attribute值为:{}", attribute); - JSONObject jsonObjectAttribute = (JSONObject) JSON.toJSON(attribute); - JSONArray jsonArrayList = jsonObjectAttribute.getJSONArray("list"); - //如果jsonArrayList为null,说明没有值,在表中不存在 - if (jsonArrayList == null || jsonArrayList.size() == 0) { - //将查询出来得数据调用通用接口新增,保存到表中 - JSONObject main = new JSONObject(); - for(String key:hashMap.keySet()) { - main.put(key, hashMap.get(key)); - } - jsonObjectUser.put("main", main); - jsonObjectUser.put("details", hashMapsDetails); - jsonObjectUser.put("appName","数智中台"); - jsonObjectUser.put("appCode","800004"); - jsonObjectUser.put("optionName", "数智中台"); - jsonStr.put("jsonStr", jsonObjectUser); - try { - comparisonServiceimpl.saveEntity(jsonStr); - } catch (Exception e) { - logger.info("U8C主数据档案新增用户档案失败,失败原因:{}",e.getMessage()); - } - } else { - for (Object o : jsonArrayList) { - JSONObject jsonObjectUpdate = JSON.parseObject(String.valueOf(o)); - String id = jsonObjectUpdate.getString("id"); - JSONObject main = new JSONObject(); - for(String key:hashMap.keySet()) { - main.put(key, hashMap.get(key)); - main.put("id",id); - } - jsonObjectUser.put("main", main); - jsonObjectUser.put("appName","数智中台"); - jsonObjectUser.put("appCode","800004"); - jsonObjectUser.put("optionName", "数智中台"); - jsonStr.put("jsonStr", jsonObjectUser); - try { - comparisonServiceimpl.updateEntity(jsonStr); - } catch (Exception e) { - logger.info("U8C主数据档案更新用户档案失败,失败原因:{}", e.getMessage()); - } - } - } - } - return null; - } - -} diff --git a/service/src/main/java/com/hzya/frame/sysnew/comparison/masterData/service/impl/MasterDataMemberServiceImpl.java b/service/src/main/java/com/hzya/frame/sysnew/comparison/masterData/service/impl/MasterDataMemberServiceImpl.java deleted file mode 100644 index c889c24b..00000000 --- a/service/src/main/java/com/hzya/frame/sysnew/comparison/masterData/service/impl/MasterDataMemberServiceImpl.java +++ /dev/null @@ -1,144 +0,0 @@ -package com.hzya.frame.sysnew.comparison.masterData.service.impl; - -import cn.hutool.core.util.StrUtil; -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; -import com.hzya.frame.basedao.service.impl.BaseService; -import com.hzya.frame.dateutil.DateUtil; -import com.hzya.frame.mdm.mdmModuleSource.dao.impl.MdmModuleSourceDaoImpl; -import com.hzya.frame.mdm.mdmModuleSource.entity.MdmModuleSourceEntity; -import com.hzya.frame.sysnew.comparison.entity.ComparisonEntity; -import com.hzya.frame.sysnew.comparison.masterData.dao.impl.MasterDataDaoImpl; -import com.hzya.frame.sysnew.comparison.masterData.service.IMasterDataMemberService; -import com.hzya.frame.sysnew.comparison.masterData.service.IMasterDataProjectService; -import com.hzya.frame.sysnew.comparison.service.impl.ComparisonServiceImpl; -import com.hzya.frame.web.entity.BaseResult; -import com.hzya.frame.web.entity.JsonResultEntity; -import org.apache.commons.collections.CollectionUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import java.util.Date; -import java.util.HashMap; -import java.util.List; - -@Service("MasterDataMemberServiceImpl") -public class MasterDataMemberServiceImpl extends BaseService implements IMasterDataMemberService { - - @Autowired - private MasterDataDaoImpl masterDataDaoImpl; - @Autowired - private ComparisonServiceImpl comparisonServiceimpl; - @Autowired - private MdmModuleSourceDaoImpl mdmModuleSourceDaoImpl; - - private String ts = ""; - - //同步用户信息到主数据 - public JsonResultEntity queryMemberArchives(JSONObject json){ - JSONObject jsonObject = json.getJSONObject("jsonStr"); - //查询主数据来源表,根据来源类型为插件得进行分类,获取来源名称和编码 - List list = mdmModuleSourceDaoImpl.MdmModuleSourceentityGroupByType(); - if (CollectionUtils.isEmpty(list)) { - logger.info("数据来源表中没有类型为插件得数据,无法获取来源名称和来源编码"); - return BaseResult.getFailureMessageEntity("数据来源表无插件类型"); - } - - for (MdmModuleSourceEntity mdmModuleSourceEntity : list) { - //通过不同的应用类型用于拼接sql - String appTyp = mdmModuleSourceEntity.getAppType(); - String dbCode = mdmModuleSourceEntity.getDbCode(); - switch (appTyp) { - case "1": - StringBuffer sb = new StringBuffer(); - if(null != jsonObject && StrUtil.isNotEmpty(jsonObject.getString("code"))){ - String code = jsonObject.getString("code"); - sb.append(" and a.code = '"+code+"'"); - }else{ - ts = DateUtil.dateToString(new Date(), "yyyy-MM-dd HH:mm:ss"); - sb.append(" and a.update_time >= '"+ts+"'"); - } - - StringBuffer stringBuffer = new StringBuffer(); - stringBuffer.append("select a.id as id, a.name as user_name, e.LOGIN_NAME as user_code FROM org_member a left join org_principal e on a.id = e.MEMBER_ID" + - " WHERE 1=1 " + sb.toString()); - mdmModuleSourceEntity.setDataSourceCode(dbCode); - try { - List> hashMaps = masterDataDaoImpl.queryArchivesByDataSource(stringBuffer.toString(),mdmModuleSourceEntity); - logger.info("查询出来的值为:{}",hashMaps); - if (null != hashMaps && hashMaps.size() > 0) { - ParametricAssembly(mdmModuleSourceEntity,hashMaps,"10003"); - } else { - logger.info("U8C主数据用户档案没有需要同步中台的数据"); - return null; - } - } catch (Exception e) { - logger.info("查询主数据档案用户档案错误:{}", e.getMessage()); - } - break; - default: - break; - } - } - return BaseResult.getSuccessMessageEntity("用户档案同步成功"); - } - - - //查询档案参数组装 - public JsonResultEntity ParametricAssembly(MdmModuleSourceEntity mdmModuleSourceEntity,List> hashMaps,String mdmCode){ - for (HashMap hashMap : hashMaps) { - JSONObject jsonObjectUser = new JSONObject(); - JSONObject jsonStr = new JSONObject(); - jsonObjectUser.put("id", hashMap.get("id")); - jsonObjectUser.put("mdmCode", mdmCode); - jsonStr.put("jsonStr", jsonObjectUser); - //先查询编码和名称查询是否存在 - JsonResultEntity jsonResultEntity = comparisonServiceimpl.queryEntityPage(jsonStr); - Object attribute = jsonResultEntity.getAttribute(); - logger.info("得到的attribute值为:{}", attribute); - JSONObject jsonObjectAttribute = (JSONObject) JSON.toJSON(attribute); - JSONArray jsonArrayList = jsonObjectAttribute.getJSONArray("list"); - //如果jsonArrayList为null,说明没有值,在表中不存在 - if (jsonArrayList == null || jsonArrayList.size() == 0) { - //将查询出来得数据调用通用接口新增,保存到表中 - JSONObject main = new JSONObject(); - for(String key:hashMap.keySet()) { - main.put(key, hashMap.get(key)); - } - jsonObjectUser.put("main", main); - jsonObjectUser.put("appName","数智中台"); - jsonObjectUser.put("appCode","800004"); - jsonObjectUser.put("optionName", "数智中台"); - jsonStr.put("jsonStr", jsonObjectUser); - try { - comparisonServiceimpl.saveEntity(jsonStr); - } catch (Exception e) { - logger.info("U8C主数据档案新增用户档案失败,失败原因:{}",e.getMessage()); - } - } else { - for (Object o : jsonArrayList) { - JSONObject jsonObjectUpdate = JSON.parseObject(String.valueOf(o)); - String id = jsonObjectUpdate.getString("id"); - JSONObject main = new JSONObject(); - for(String key:hashMap.keySet()) { - main.put(key, hashMap.get(key)); - main.put("id",id); - } - jsonObjectUser.put("main", main); - jsonObjectUser.put("appName","数智中台"); - jsonObjectUser.put("appCode","800004"); - jsonObjectUser.put("optionName", "数智中台"); - jsonStr.put("jsonStr", jsonObjectUser); - try { - comparisonServiceimpl.updateEntity(jsonStr); - } catch (Exception e) { - logger.info("U8C主数据档案更新用户档案失败,失败原因:{}", e.getMessage()); - } - } - } - } - return null; - } - -} diff --git a/service/src/main/java/com/hzya/frame/sysnew/comparison/masterData/service/impl/MasterDataOrgsServiceImpl.java b/service/src/main/java/com/hzya/frame/sysnew/comparison/masterData/service/impl/MasterDataOrgsServiceImpl.java deleted file mode 100644 index e382aabf..00000000 --- a/service/src/main/java/com/hzya/frame/sysnew/comparison/masterData/service/impl/MasterDataOrgsServiceImpl.java +++ /dev/null @@ -1,138 +0,0 @@ -package com.hzya.frame.sysnew.comparison.masterData.service.impl; - -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; -import com.hzya.frame.basedao.service.impl.BaseService; -import com.hzya.frame.dateutil.DateUtil; -import com.hzya.frame.mdm.mdmModuleSource.dao.impl.MdmModuleSourceDaoImpl; -import com.hzya.frame.mdm.mdmModuleSource.entity.MdmModuleSourceEntity; -import com.hzya.frame.sysnew.comparison.entity.ComparisonEntity; -import com.hzya.frame.sysnew.comparison.masterData.dao.impl.MasterDataDaoImpl; -import com.hzya.frame.sysnew.comparison.masterData.service.IMasterDataOrgsService; -import com.hzya.frame.sysnew.comparison.masterData.service.IMasterDataProjectService; -import com.hzya.frame.sysnew.comparison.service.impl.ComparisonServiceImpl; -import com.hzya.frame.web.entity.BaseResult; -import com.hzya.frame.web.entity.JsonResultEntity; -import org.apache.commons.collections.CollectionUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import java.util.Date; -import java.util.HashMap; -import java.util.List; - -@Service("masterDataOrgsServiceImpl") -public class MasterDataOrgsServiceImpl extends BaseService implements IMasterDataOrgsService { - - @Autowired - private MasterDataDaoImpl masterDataDaoImpl; - @Autowired - private ComparisonServiceImpl comparisonServiceimpl; - @Autowired - private MdmModuleSourceDaoImpl mdmModuleSourceDaoImpl; - - private String ts = ""; - //查询用户档案并同步中台 - @Override - public JsonResultEntity queryOrgsArchives(JSONObject json) { - JSONObject jsonObject = json.getJSONObject("jsonStr"); - //查询主数据来源表,根据来源类型为插件得进行分类,获取来源名称和编码 - List list = mdmModuleSourceDaoImpl.MdmModuleSourceentityGroupByType(); - if (CollectionUtils.isEmpty(list)) { - logger.info("数据来源表中没有类型为插件得数据,无法获取来源名称和来源编码"); - return BaseResult.getFailureMessageEntity("数据来源表无插件类型"); - } - for (MdmModuleSourceEntity mdmModuleSourceEntity : list) { - //此处应该根据来源编码进行case ,暂时测试使用U8C - switch (mdmModuleSourceEntity.getPluginCode()) { - case "MdmOrgPlugin": - if (null == ts || "".equals(ts)) { - ts = DateUtil.dateToString(new Date(), "yyyy-MM-dd HH:mm:ss"); - } - ts = "'" + ts + "'"; - StringBuffer stringBuffer = new StringBuffer(); - stringBuffer.append("select pk_corp as id,unitcode as org_code,unitname as org_name,"); - stringBuffer.append("saleaddr as org_address,countryarea as org_countryzone,memo as org_memo,"); - stringBuffer.append("industry as org_ncindustry,fathercorp as org_fatherorg,legalbodycode as org_principal,"); - stringBuffer.append("phone1 as org_tel from bd_corp where dr='0' and ts>"+ts); - try { - List> hashMaps = masterDataDaoImpl.queryArchives(stringBuffer.toString()); - logger.info("查询出来的值为:{}",hashMaps); - if (null != hashMaps && hashMaps.size() > 0) { - ParametricAssembly(mdmModuleSourceEntity,hashMaps,"10001"); - } else { - logger.info("U8C主数据档案组织档案没有需要同步中台的数据"); - return null; - } - } catch (Exception e) { - logger.info("查询主数据档案组织档案错误:{}", e.getMessage()); - } - break; - default: - break; - } - } - return BaseResult.getSuccessMessageEntity("组织档案同步成功"); - } - - - - - - //查询档案参数组装 - private void ParametricAssembly(MdmModuleSourceEntity mdmModuleSourceEntity,List> hashMaps,String mdmCode){ - for (HashMap hashMap : hashMaps) { - JSONObject jsonObjectUser = new JSONObject(); - JSONObject jsonStr = new JSONObject(); - jsonObjectUser.put("id", hashMap.get("id")); - jsonObjectUser.put("mdmCode", mdmCode); - jsonStr.put("jsonStr", jsonObjectUser); - //先查询编码和名称查询是否存在 - JsonResultEntity jsonResultEntity = comparisonServiceimpl.queryEntityPage(jsonStr); - Object attribute = jsonResultEntity.getAttribute(); - logger.info("得到的attribute值为:{}", attribute); - JSONObject jsonObjectAttribute = (JSONObject) JSON.toJSON(attribute); - JSONArray jsonArrayList = jsonObjectAttribute.getJSONArray("list"); - //如果jsonArrayList为null,说明没有值,在表中不存在 - if (jsonArrayList == null || jsonArrayList.size() == 0) { - //将查询出来得数据调用通用接口新增,保存到表中 - JSONObject main = new JSONObject(); - for(String key:hashMap.keySet()) { - main.put(key, hashMap.get(key)); - } - jsonObjectUser.put("main", main); - jsonObjectUser.put("appName","数智中台"); - jsonObjectUser.put("appCode","800004"); - jsonObjectUser.put("optionName", "数智中台"); - jsonStr.put("jsonStr", jsonObjectUser); - try { - comparisonServiceimpl.saveEntity(jsonStr); - } catch (Exception e) { - logger.info("U8C主数据档案新增档案失败,失败原因:{}",e.getMessage()); - } - } else { - for (Object o : jsonArrayList) { - JSONObject jsonObjectUpdate = JSON.parseObject(String.valueOf(o)); - String id = jsonObjectUpdate.getString("id"); - JSONObject main = new JSONObject(); - for(String key:hashMap.keySet()) { - main.put(key, hashMap.get(key)); - main.put("id",id); - } - jsonObjectUser.put("main", main); - jsonObjectUser.put("appName","数智中台"); - jsonObjectUser.put("appCode","800004"); - jsonObjectUser.put("optionName", "数智中台"); - jsonStr.put("jsonStr", jsonObjectUser); - try { - comparisonServiceimpl.updateEntity(jsonStr); - } catch (Exception e) { - logger.info("U8C主数据档案更新档案失败,失败原因:{}", e.getMessage()); - } - } - } - } - } - -} diff --git a/service/src/main/java/com/hzya/frame/sysnew/comparison/masterData/service/impl/MasterDataProjectServiceImpl.java b/service/src/main/java/com/hzya/frame/sysnew/comparison/masterData/service/impl/MasterDataProjectServiceImpl.java deleted file mode 100644 index ca6639a2..00000000 --- a/service/src/main/java/com/hzya/frame/sysnew/comparison/masterData/service/impl/MasterDataProjectServiceImpl.java +++ /dev/null @@ -1,132 +0,0 @@ -package com.hzya.frame.sysnew.comparison.masterData.service.impl; - -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; -import com.hzya.frame.basedao.service.impl.BaseService; -import com.hzya.frame.dateutil.DateUtil; -import com.hzya.frame.mdm.mdmModuleSource.dao.impl.MdmModuleSourceDaoImpl; -import com.hzya.frame.mdm.mdmModuleSource.entity.MdmModuleSourceEntity; -import com.hzya.frame.sysnew.comparison.entity.ComparisonEntity; -import com.hzya.frame.sysnew.comparison.masterData.dao.impl.MasterDataDaoImpl; -import com.hzya.frame.sysnew.comparison.masterData.service.IMasterDataProjectService; -import com.hzya.frame.sysnew.comparison.service.impl.ComparisonServiceImpl; -import com.hzya.frame.web.entity.BaseResult; -import com.hzya.frame.web.entity.JsonResultEntity; -import org.apache.commons.collections.CollectionUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import java.util.Date; -import java.util.HashMap; -import java.util.List; - -@Service("masterDataProjectServiceImpl") -public class MasterDataProjectServiceImpl extends BaseService implements IMasterDataProjectService { - - @Autowired - private MasterDataDaoImpl masterDataDaoImpl; - @Autowired - private ComparisonServiceImpl comparisonServiceimpl; - @Autowired - private MdmModuleSourceDaoImpl mdmModuleSourceDaoImpl; - - private String ts = ""; - - //同步项目档案 - public JsonResultEntity queryProjectArchives(JSONObject json){ - JSONObject jsonObject = json.getJSONObject("jsonStr"); - //查询主数据来源表,根据来源类型为插件得进行分类,获取来源名称和编码 - List list = mdmModuleSourceDaoImpl.MdmModuleSourceentityGroupByType(); - if (CollectionUtils.isEmpty(list)) { - logger.info("数据来源表中没有类型为插件得数据,无法获取来源名称和来源编码"); - return BaseResult.getFailureMessageEntity("数据来源表无插件类型"); - } - for (MdmModuleSourceEntity mdmModuleSourceEntity : list) { - //此处应该根据来源编码进行case ,暂时测试使用U8C - switch (mdmModuleSourceEntity.getPluginCode()) { - case "MdmProjectPlugin": - if (null == ts || "".equals(ts)) { - ts = DateUtil.dateToString(new Date(), "yyyy-MM-dd HH:mm:ss"); - } - ts = "'" + ts + "'"; - StringBuffer stringBuffer = new StringBuffer(); - stringBuffer.append("select pk_jobbasfil as id,jobcode as project_code, jobname as project_name from bd_jobbasfil where dr='0' and ts>" + ts); - try { - List> hashMaps = masterDataDaoImpl.queryArchives(stringBuffer.toString()); - logger.info("查询出来的值为:{}",hashMaps); - if (null != hashMaps && hashMaps.size() > 0) { - ParametricAssembly(mdmModuleSourceEntity,hashMaps,"10002"); - } else { - logger.info("U8C主数据档案项目档案没有需要同步中台的数据"); - return null; - } - } catch (Exception e) { - logger.info("查询主数据档案项目档案错误:{}", e.getMessage()); - } - break; - default: - break; - } - } - return BaseResult.getSuccessMessageEntity("项目档案同步成功"); - } - - - //查询档案参数组装 - public JsonResultEntity ParametricAssembly(MdmModuleSourceEntity mdmModuleSourceEntity,List> hashMaps,String mdmCode){ - for (HashMap hashMap : hashMaps) { - JSONObject jsonObjectUser = new JSONObject(); - JSONObject jsonStr = new JSONObject(); - jsonObjectUser.put("id", hashMap.get("id")); - jsonObjectUser.put("mdmCode", mdmCode); - jsonStr.put("jsonStr", jsonObjectUser); - //先查询编码和名称查询是否存在 - JsonResultEntity jsonResultEntity = comparisonServiceimpl.queryEntityPage(jsonStr); - Object attribute = jsonResultEntity.getAttribute(); - logger.info("得到的attribute值为:{}", attribute); - JSONObject jsonObjectAttribute = (JSONObject) JSON.toJSON(attribute); - JSONArray jsonArrayList = jsonObjectAttribute.getJSONArray("list"); - //如果jsonArrayList为null,说明没有值,在表中不存在 - if (jsonArrayList == null || jsonArrayList.size() == 0) { - //将查询出来得数据调用通用接口新增,保存到表中 - JSONObject main = new JSONObject(); - for(String key:hashMap.keySet()) { - main.put(key, hashMap.get(key)); - } - jsonObjectUser.put("main", main); - jsonObjectUser.put("appName","数智中台"); - jsonObjectUser.put("appCode","800004"); - jsonObjectUser.put("optionName", "数智中台"); - jsonStr.put("jsonStr", jsonObjectUser); - try { - comparisonServiceimpl.saveEntity(jsonStr); - } catch (Exception e) { - logger.info("U8C主数据档案新增用户档案失败,失败原因:{}",e.getMessage()); - } - } else { - for (Object o : jsonArrayList) { - JSONObject jsonObjectUpdate = JSON.parseObject(String.valueOf(o)); - String id = jsonObjectUpdate.getString("id"); - JSONObject main = new JSONObject(); - for(String key:hashMap.keySet()) { - main.put(key, hashMap.get(key)); - main.put("id",id); - } - jsonObjectUser.put("main", main); - jsonObjectUser.put("appName","数智中台"); - jsonObjectUser.put("appCode","800004"); - jsonObjectUser.put("optionName", "数智中台"); - jsonStr.put("jsonStr", jsonObjectUser); - try { - comparisonServiceimpl.updateEntity(jsonStr); - } catch (Exception e) { - logger.info("U8C主数据档案更新用户档案失败,失败原因:{}", e.getMessage()); - } - } - } - } - return null; - } - -} 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 05927f1b..6777b603 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 @@ -10,7 +10,6 @@ import com.hzya.frame.mdm.mdmModuleSource.dao.impl.MdmModuleSourceDaoImpl; import com.hzya.frame.mdm.mdmModuleSource.entity.MdmModuleSourceEntity; import com.hzya.frame.sysnew.comparison.entity.ComparisonEntity; import com.hzya.frame.sysnew.comparison.masterData.dao.impl.MasterDataDaoImpl; -import com.hzya.frame.sysnew.comparison.masterData.service.IMasterDataProjectService; import com.hzya.frame.sysnew.comparison.masterData.service.IMasterDataService; import com.hzya.frame.sysnew.comparison.service.impl.ComparisonServiceImpl; import com.hzya.frame.web.entity.BaseResult; @@ -54,30 +53,31 @@ public class MasterDataServiceImpl extends BaseService return BaseResult.getFailureMessageEntity("数据来源表无插件类型"); } for (MdmModuleSourceEntity mdmModuleSourceEntity : list) { + String tableName = ""; try { //通过不同的应用类型用于拼接sql String appTyp = mdmModuleSourceEntity.getAppType(); String dbCode = mdmModuleSourceEntity.getDbCode(); String mdmCode = mdmModuleSourceEntity.getMdmCode(); - List>hashMaps = new ArrayList<>(); - List> hashMapsDetails = new ArrayList<>(); + List listAll = new ArrayList<>(); + if(!"10007".equals(mdmCode)){ + continue; + } switch (appTyp) {//1、致远OA 2、用友U8C 3、用友BIP case "1": //通过主数据编码判断,不同的接口走不通的查询逻辑 switch (mdmCode){ case "10003"://致远用户信息 - bindingUser(jsonObject, mdmModuleSourceEntity, dbCode); + tableName = "mdm_user"; + listAll = bindingUser(jsonObject, mdmModuleSourceEntity, dbCode); break; case "10004"://致远客商信息 - hashMaps = binDingCust(jsonObject, mdmModuleSourceEntity, dbCode); - //查询明细数据 - for (HashMap hashMap : hashMaps) { - //查询明细信息 - Long formmainId = (Long) hashMap.get("id"); - StringBuffer stringBufferDetails = new StringBuffer(); - stringBufferDetails.append("SELECT field0023 AS pk_bankdoc,field0024 AS accnum,field0025 AS combinenum FROM formson_0229 WHERE formmain_id = '"+formmainId+"' " ); - hashMapsDetails = masterDataDaoImpl.queryArchivesByDataSource(stringBufferDetails.toString(),mdmModuleSourceEntity); - } + tableName = "mdm_customer"; + listAll = binDingCust(jsonObject, mdmModuleSourceEntity, dbCode); + break; + case "10007"://致远客商信息 + tableName = "mdm_bank"; + listAll = binDingBank(jsonObject, mdmModuleSourceEntity, dbCode); break; default: logger.info("未匹配到主数据的编码,请检查"); @@ -85,8 +85,8 @@ public class MasterDataServiceImpl extends BaseService } } //调用主数据接口进行数据推送或更新 - if (null != hashMaps && hashMaps.size() > 0) { - ParametricAssembly(mdmModuleSourceEntity,hashMaps,mdmCode,hashMapsDetails); + if (null != listAll && listAll.size() > 0) { + ParametricAssembly(mdmModuleSourceEntity,listAll,mdmCode,tableName); } else { logger.info("U8C主数据档案没有需要同步中台的数据"); } @@ -95,52 +95,123 @@ public class MasterDataServiceImpl extends BaseService e.printStackTrace(); } } - return BaseResult.getSuccessMessageEntity("项目档案同步成功"); + return BaseResult.getSuccessMessageEntity("主数据同步成功"); } - //绑定客户档案 - private List> binDingCust(JSONObject jsonObject, MdmModuleSourceEntity mdmModuleSourceEntity, String dbCode) { - List> hashMap; - StringBuffer sbCust = new StringBuffer(); + //绑定银行 + private List binDingBank(JSONObject jsonObject, MdmModuleSourceEntity mdmModuleSourceEntity, String dbCode) { + List list = new ArrayList<>(); + StringBuffer sb = new StringBuffer(); if(null != jsonObject && StrUtil.isNotEmpty(jsonObject.getString("code"))){ String code = jsonObject.getString("code"); - sbCust.append(" and a.code = '"+code+"'"); + sb.append(" and a.code = '"+code+"'"); }else{ ts = DateUtil.dateToString(new Date(), "yyyy-MM-dd HH:mm:ss"); - sbCust.append(" and a.update_time >= '"+ts+"'"); + sb.append(" and a.update_time >= '"+ts+"'"); } - StringBuffer stringBufferCust = new StringBuffer(); - stringBufferCust.append("SELECT id as id,field0013 AS code,field0014 AS name,field0016 AS pk_custclass,field0015 AS shortname,field0012 AS pk_org FROM formmain_0226 WHERE 1=1 "+ sbCust.toString()); + StringBuffer stringBuffer = new StringBuffer(); + stringBuffer.append("select *from bank"); mdmModuleSourceEntity.setDataSourceCode(dbCode); - return masterDataDaoImpl.queryArchivesByDataSource(stringBufferCust.toString(),mdmModuleSourceEntity); + List> hashMaps = masterDataDaoImpl.queryArchivesByDataSource(stringBuffer.toString(),mdmModuleSourceEntity); + int i = 0; + if(CollectionUtils.isNotEmpty(hashMaps)){ + for (HashMap hashMap : hashMaps) { + JSONObject main = new JSONObject(); + JSONObject mdm = new JSONObject(); + for(String key:hashMap.keySet()) { + mdm.put(key, hashMap.get(key)); + } + main.put("mdm_bank",mdm); + list.add(main); + } + } + return list; + } + + //绑定客户档案 + private List binDingCust(JSONObject jsonObject, MdmModuleSourceEntity mdmModuleSourceEntity, String dbCode) { + List list = new ArrayList<>(); + StringBuffer sb = new StringBuffer(); + if(null != jsonObject && StrUtil.isNotEmpty(jsonObject.getString("code"))){ + String code = jsonObject.getString("code"); + sb.append(" and a.code = '"+code+"'"); + }else{ + ts = DateUtil.dateToString(new Date(), "yyyy-MM-dd HH:mm:ss"); + sb.append(" and a.update_time >= '"+ts+"'"); + } + StringBuffer stringBuffer = new StringBuffer(); + stringBuffer.append("SELECT id as id,field0013 AS code,field0014 AS name,field0016 AS pk_custclass,field0015 AS shortname,field0012 AS pk_org FROM formmain_0226 a WHERE 1=1 "); + mdmModuleSourceEntity.setDataSourceCode(dbCode); + List> hashMaps = masterDataDaoImpl.queryArchivesByDataSource(stringBuffer.toString(),mdmModuleSourceEntity); + if(CollectionUtils.isNotEmpty(hashMaps)){ + for (HashMap hashMap : hashMaps) { + JSONObject main = new JSONObject(); + JSONObject mdm_cust = new JSONObject(); + for(String key:hashMap.keySet()) { + mdm_cust.put(key, hashMap.get(key)); + } + //获取明细信息 + Long formmainId = (Long) hashMap.get("id"); + StringBuffer stringBufferDetails = new StringBuffer(); + stringBufferDetails.append("SELECT id as id ,field0023 AS pk_bankdoc,field0024 AS accnum,field0025 AS combinenum FROM formson_0229 WHERE formmain_id = '"+formmainId+"' " ); + List> hashMapsDetails = masterDataDaoImpl.queryArchivesByDataSource(stringBufferDetails.toString(),mdmModuleSourceEntity); + JSONArray mdm_customer_bank = new JSONArray(); + if(CollectionUtils.isNotEmpty(hashMapsDetails)){ + for (HashMap detailsMap : hashMapsDetails) { + JSONObject details = new JSONObject(); + for (String key : detailsMap.keySet()) { + details.put(key, detailsMap.get(key)); + } + mdm_customer_bank.add(details); + } + } + main.put("mdm_customer_bank",mdm_customer_bank); + main.put("mdm_customer",mdm_cust); + list.add(main); + } + } + return list; } //绑定OA用户参数 - private JSONArray bindingUser(JSONObject jsonObject, MdmModuleSourceEntity mdmModuleSourceEntity, String dbCode) { - StringBuffer sbUser = new StringBuffer(); + private List bindingUser(JSONObject jsonObject, MdmModuleSourceEntity mdmModuleSourceEntity, String dbCode) { + List list = new ArrayList<>(); + StringBuffer sb = new StringBuffer(); if(null != jsonObject && StrUtil.isNotEmpty(jsonObject.getString("code"))){ String code = jsonObject.getString("code"); - sbUser.append(" and a.code = '"+code+"'"); + sb.append(" and a.code = '"+code+"'"); }else{ ts = DateUtil.dateToString(new Date(), "yyyy-MM-dd HH:mm:ss"); - sbUser.append(" and a.update_time >= '"+ts+"'"); + sb.append(" and a.update_time >= '"+ts+"'"); } - StringBuffer stringBufferUser = new StringBuffer(); - stringBufferUser.append("SELECT id as id,field0013 AS code,field0014 AS name,field0016 AS pk_custclass,field0015 AS shortname,field0012 AS pk_org FROM formmain_0226 WHERE 1=1 "+ sbUser.toString()); + StringBuffer stringBuffer = new StringBuffer(); + stringBuffer.append("select a.id as id, a.name as user_name, e.LOGIN_NAME as user_code FROM org_member a left join org_principal e on a.id = e.MEMBER_ID" + + " WHERE 1=1 " + sb.toString()); mdmModuleSourceEntity.setDataSourceCode(dbCode); - List> hashMaps = masterDataDaoImpl.queryArchivesByDataSource(stringBufferUser.toString(),mdmModuleSourceEntity); - for (HashMap hashMap : hashMaps) { - + List> hashMaps = masterDataDaoImpl.queryArchivesByDataSource(stringBuffer.toString(),mdmModuleSourceEntity); + int i = 0; + if(CollectionUtils.isNotEmpty(hashMaps)){ + for (HashMap hashMap : hashMaps) { + JSONObject main = new JSONObject(); + JSONObject mdm_user = new JSONObject(); + for(String key:hashMap.keySet()) { + mdm_user.put(key, hashMap.get(key)); + } + main.put("mdm_user",mdm_user); + list.add(main); + } } - return null; + return list; } //查询档案参数组装 - public JsonResultEntity ParametricAssembly(MdmModuleSourceEntity mdmModuleSourceEntity,List> hashMaps,String mdmCode,List> hashMapsDetails){ - for (HashMap hashMap : hashMaps) { + public JsonResultEntity ParametricAssembly(MdmModuleSourceEntity mdmModuleSourceEntity,List hashMaps,String mdmCode,String tableName){ + for (JSONObject hashMap : hashMaps) { + JSONObject main = hashMap.getJSONObject(tableName); + JSONObject jsonObjectUser = new JSONObject(); JSONObject jsonStr = new JSONObject(); - jsonObjectUser.put("id", hashMap.get("id")); + jsonObjectUser.put("id", main.get("id")); jsonObjectUser.put("mdmCode", mdmCode); jsonStr.put("jsonStr", jsonObjectUser); //先查询编码和名称查询是否存在 @@ -151,40 +222,32 @@ public class MasterDataServiceImpl extends BaseService JSONArray jsonArrayList = jsonObjectAttribute.getJSONArray("list"); //如果jsonArrayList为null,说明没有值,在表中不存在 if (jsonArrayList == null || jsonArrayList.size() == 0) { - //将查询出来得数据调用通用接口新增,保存到表中 - JSONObject main = new JSONObject(); - for(String key:hashMap.keySet()) { - main.put(key, hashMap.get(key)); - } - jsonObjectUser.put("main", main); - jsonObjectUser.put("appName","数智中台"); - jsonObjectUser.put("appCode","800004"); - jsonObjectUser.put("optionName", "数智中台"); - jsonStr.put("jsonStr", jsonObjectUser); +// //将查询出来得数据调用通用接口新增,保存到表中 +// JSONObject main = new JSONObject(); +// for(String key:hashMap.keySet()) { +// main.put(key, hashMap.get(key)); +// } +// jsonObjectUser.put("main", main); + hashMap.put("appName","数智中台"); + hashMap.put("appCode","800004"); + hashMap.put("mdmCode", mdmCode); + hashMap.put("optionName", "数智中台"); + jsonStr.put("jsonStr", hashMap); try { - comparisonServiceimpl.saveEntity(jsonStr); + JsonResultEntity result = comparisonServiceimpl.saveEntity(jsonStr); } catch (Exception e) { logger.info("U8C主数据档案新增用户档案失败,失败原因:{}",e.getMessage()); } } else { - for (Object o : jsonArrayList) { - JSONObject jsonObjectUpdate = JSON.parseObject(String.valueOf(o)); - String id = jsonObjectUpdate.getString("id"); - JSONObject main = new JSONObject(); - for(String key:hashMap.keySet()) { - main.put(key, hashMap.get(key)); - main.put("id",id); - } - jsonObjectUser.put("main", main); - jsonObjectUser.put("appName","数智中台"); - jsonObjectUser.put("appCode","800004"); - jsonObjectUser.put("optionName", "数智中台"); - jsonStr.put("jsonStr", jsonObjectUser); - try { - comparisonServiceimpl.updateEntity(jsonStr); - } catch (Exception e) { - logger.info("U8C主数据档案更新用户档案失败,失败原因:{}", e.getMessage()); - } + hashMap.put("appName","数智中台"); + hashMap.put("appCode","800004"); + hashMap.put("mdmCode", mdmCode); + hashMap.put("optionName", "数智中台"); + jsonStr.put("jsonStr", hashMap); + try { + comparisonServiceimpl.updateEntity(jsonStr); + } catch (Exception e) { + logger.info("U8C主数据档案更新用户档案失败,失败原因:{}", e.getMessage()); } } } From 15b031bd364b83c50a8b081e014e5eb8b0dc509f Mon Sep 17 00:00:00 2001 From: hecan <1718492867@qq.com> Date: Tue, 25 Jun 2024 09:52:29 +0800 Subject: [PATCH 16/22] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=AD=97=E6=AE=B5data?= =?UTF-8?q?=5Fid=E4=B8=BA=E7=AC=AC=E4=B8=89=E6=96=B9=E4=B8=BB=E9=94=AEid?= =?UTF-8?q?=EF=BC=8C=E7=94=A8=E7=AC=AC=E4=B8=89=E6=96=B9=E4=B8=BB=E9=94=AE?= =?UTF-8?q?=E6=9D=A5=E6=93=8D=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../entity/ComparisonDetailsEntity.java | 10 +++ .../entity/ComparisonDetailsEntity.xml | 4 +- .../comparison/entity/ComparisonEntity.java | 10 +++ .../comparison/entity/ComparisonEntity.xml | 4 +- .../service/impl/ComparisonServiceImpl.java | 61 ++++++++++++------- 5 files changed, 63 insertions(+), 26 deletions(-) diff --git a/service/src/main/java/com/hzya/frame/sysnew/comparison/entity/ComparisonDetailsEntity.java b/service/src/main/java/com/hzya/frame/sysnew/comparison/entity/ComparisonDetailsEntity.java index 5766ec65..112c0d4a 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/comparison/entity/ComparisonDetailsEntity.java +++ b/service/src/main/java/com/hzya/frame/sysnew/comparison/entity/ComparisonDetailsEntity.java @@ -31,6 +31,16 @@ public class ComparisonDetailsEntity extends BaseEntity { private String filedType;//字段类型 1、BIGINT 2、DECIMAL 3、VARCHAR 4、DATETIME private String formmainId;//上级id + private String dataId;//第三方主键id + + public String getDataId() { + return dataId; + } + + public void setDataId(String dataId) { + this.dataId = dataId; + } + public String getFormmainId() { return formmainId; } diff --git a/service/src/main/java/com/hzya/frame/sysnew/comparison/entity/ComparisonDetailsEntity.xml b/service/src/main/java/com/hzya/frame/sysnew/comparison/entity/ComparisonDetailsEntity.xml index 754cca03..8b35da0b 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/comparison/entity/ComparisonDetailsEntity.xml +++ b/service/src/main/java/com/hzya/frame/sysnew/comparison/entity/ComparisonDetailsEntity.xml @@ -48,14 +48,14 @@ ${key} =#{value} - where id=#{id} and sts='Y' + where data_id=#{dataId} and sts='Y' update ${dbName} - set sts= 'N' ,modify_time = now(),modify_user_id = #{modify_user_id}, data_status= 'N',delete_status='0' + set modify_time = now(),modify_user_id = #{modify_user_id}, data_status= 'N' @@ -60,7 +60,7 @@ - and formmain_id=#{formmainId} and sts='Y' + and formmain_id=#{formmainId} and sts='Y' and (data_status='Y' or data_status='F') diff --git a/service/src/main/java/com/hzya/frame/sysnew/comparison/entity/ComparisonEntity.xml b/service/src/main/java/com/hzya/frame/sysnew/comparison/entity/ComparisonEntity.xml index 47e8825a..341e28cd 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/comparison/entity/ComparisonEntity.xml +++ b/service/src/main/java/com/hzya/frame/sysnew/comparison/entity/ComparisonEntity.xml @@ -106,7 +106,7 @@ ${key} =#{value} - where data_id=#{dataId} and sts='Y' + where id=#{id} and sts='Y' and (data_status='Y' or data_status='F') @@ -119,7 +119,7 @@ and ${key} =#{value} - and data_id=#{dataId} and sts='Y' + and id=#{id} and sts='Y' and (data_status='Y' or data_status='F') diff --git a/service/src/main/java/com/hzya/frame/sysnew/comparison/service/impl/ComparisonServiceImpl.java b/service/src/main/java/com/hzya/frame/sysnew/comparison/service/impl/ComparisonServiceImpl.java index 3104b67f..251be257 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/comparison/service/impl/ComparisonServiceImpl.java +++ b/service/src/main/java/com/hzya/frame/sysnew/comparison/service/impl/ComparisonServiceImpl.java @@ -102,7 +102,7 @@ public class ComparisonServiceImpl extends BaseService JSONObject jsonObjects=new JSONObject(); jsonObjects.put(comparisonEntity.getDbName(),comparisonEntitiePage); if(comparisonDetailsEntity.getDbName()!=null){ - comparisonDetailsEntity.setFormmainId(String.valueOf(comparisonEntitiePage.get("data_id"))); + comparisonDetailsEntity.setFormmainId(String.valueOf(comparisonEntitiePage.get("id"))); //查询明细表数据 List> maps = comparisonDetailsDao.queryComparisonDetailsPage(comparisonDetailsEntity); if(CollectionUtils.isNotEmpty(maps)){ @@ -191,7 +191,8 @@ public class ComparisonServiceImpl extends BaseService List>> mapDetails = new ArrayList<>();//将子表数据存到map中 if (comparisonEntities != null && comparisonEntities.size() > 0) { map = spliceMainMap(comparisonEntities, jsonObjectMain, map, comparisonEntity, comparisonDetailsEntity); - map.put("id", UUIDLong.longUUID()); + String uuid= String.valueOf(UUIDLong.longUUID()); + map.put("id", uuid); map.put("create_user_id", "c796fd9ba4c9f5ff3cc2fa41a040e443"); map.put("modify_user_id", "c796fd9ba4c9f5ff3cc2fa41a040e443"); map.put("org_id", "0"); @@ -249,7 +250,7 @@ public class ComparisonServiceImpl extends BaseService for (List> mapDetail : mapDetails) { for (Map stringObjectMap : mapDetail) { stringObjectMap.put("id", UUIDLong.longUUID()); - stringObjectMap.put("formmain_id", jsonObjectMain.getString("data_id")); + stringObjectMap.put("formmain_id", uuid); stringObjectMap.put("create_user_id", "c796fd9ba4c9f5ff3cc2fa41a040e443"); stringObjectMap.put("modify_user_id", "c796fd9ba4c9f5ff3cc2fa41a040e443"); stringObjectMap.put("org_id", "0"); @@ -273,7 +274,7 @@ public class ComparisonServiceImpl extends BaseService } list.add(jsonObjectList); //保存操作日志 - controlsLogDaoimpl.saveControlsLog(jsonObjectMain.getString("data_id"),jsonObject.getString("appName"),jsonObject.getString("appCode"),jsonObject.toJSONString(),"接口新增",jsonObject.getString("optionName"),comparisonEntityRule.getDbName()+"_option_log"); + controlsLogDaoimpl.saveControlsLog(uuid,jsonObject.getString("appName"),jsonObject.getString("appCode"),jsonObject.toJSONString(),"接口新增",jsonObject.getString("optionName"),comparisonEntityRule.getDbName()+"_option_log"); return BaseResult.getSuccessMessageEntity("保存成功", list); } catch (Exception e) { logger.info("保存通用数据时候错误:{}", e.getMessage()); @@ -347,7 +348,20 @@ public class ComparisonServiceImpl extends BaseService List>> mapDetails=new ArrayList<>();//将子表数据存到map中 if(comparisonEntities !=null && comparisonEntities.size()>0) { map=spliceMainMap(comparisonEntities,jsonObjectMain,map,comparisonEntity,comparisonDetailsEntity); - map.put("create_user_id", "c796fd9ba4c9f5ff3cc2fa41a040e443"); + + //根据data_id查询id.根据id更新主表数据,然后再根据主表id和明细表的data_id,删除明细表数据 + Map mapId=new HashMap<>(); + mapId.put("data_id",jsonObjectMain.getString("data_id")); + ComparisonEntity comparison=new ComparisonEntity(); + comparison.setDbName(comparisonEntity.getDbName()); + comparison.setMap(mapId); + List> comparisonEntitiePages = comparisonDao.queryComparisonPage(comparison); + if(CollectionUtils.isEmpty(comparisonEntitiePages)){ + return BaseResult.getFailureMessageEntity("根据data_id查询id数据为空,请检查data_id"); + } + String id = String.valueOf(comparisonEntitiePages.get(0).get("id")); + + map.put("create_user_id", "c796fd9ba4c9f5ff3cc2fa41a040e443"); map.put("modify_user_id", "c796fd9ba4c9f5ff3cc2fa41a040e443"); map.put("org_id", "0"); map.put("modify_time", new Date()); @@ -355,7 +369,7 @@ public class ComparisonServiceImpl extends BaseService map.put("data_status","F");//数据状态 map.put("update_status","0");//修改状态 comparisonEntity.setMap(map); - comparisonEntity.setDataId(jsonObjectMain.getString("data_id")); + comparisonEntity.setId(id); /*//生成单据规则 comparisonEntity.setRulePrefix(jsonObject.getString("rulePrefix")); try { @@ -385,6 +399,7 @@ public class ComparisonServiceImpl extends BaseService stringObjectMap.put("sts", "Y"); stringObjectMap.put("data_status","F");//数据状态 comparisonDetailsEntity.setDataId(String.valueOf(stringObjectMap.get("data_id"))); + comparisonDetailsEntity.setFormmainId(id); comparisonDetailsEntity.setMapDetails(stringObjectMap); comparisonDetailsEntity.setDbName(String.valueOf(stringObjectMap.get("table_name"))); stringObjectMap.remove("table_name"); @@ -473,14 +488,27 @@ public class ComparisonServiceImpl extends BaseService } } } - comparisonEntity.setDataId(jsonObjectMain.getString("data_id")); + + //根据data_id查询主表id.根据id删除主表数据,然后再根据主表id和明细表data_id删除明细表数据 + Map mapId=new HashMap<>(); + mapId.put("data_id",jsonObjectMain.getString("data_id")); + ComparisonEntity comparison=new ComparisonEntity(); + comparison.setDbName(comparisonEntity.getDbName()); + comparison.setMap(mapId); + List> comparisonEntitiePages = comparisonDao.queryComparisonPage(comparison); + if(CollectionUtils.isEmpty(comparisonEntitiePages)){ + return BaseResult.getFailureMessageEntity("根据data_id查询id数据为空,请检查data_id"); + } + String id = String.valueOf(comparisonEntitiePages.get(0).get("id")); + + comparisonEntity.setId(id); comparisonEntity.setModify_user_id("c796fd9ba4c9f5ff3cc2fa41a040e443"); comparisonEntity.setMap(map); try { Integer integer = comparisonDao.deleteComparison(comparisonEntity); if(integer>0){ if(comparisonDetailsEntity.getDbName()!=null){ - comparisonDetailsEntity.setFormmainId(jsonObjectMain.getString("data_id")); + comparisonDetailsEntity.setFormmainId(id); comparisonDetailsEntity.setModify_user_id("c796fd9ba4c9f5ff3cc2fa41a040e443"); comparisonDetailsDao.deleteComparisonDetails(comparisonDetailsEntity); // controlsLogDaoimpl.saveControlsLog(comparisonDetailsEntity.getId(),jsonObject.getString("appName"),jsonObject.getString("appCode"),jsonObject.toJSONString(),"接口删除",jsonObject.getString("optionName"),comparisonEntity.getDbName()+"_option_log"); From ef065c3f8c8f83b5d1206b3fba2e4f9ab3e841d4 Mon Sep 17 00:00:00 2001 From: yuqh <123456> Date: Tue, 25 Jun 2024 14:08:07 +0800 Subject: [PATCH 18/22] =?UTF-8?q?MDM=E5=85=AC=E7=94=A8=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../plugin/PayBillPluginInitializer.java | 3 +- .../plugin/RecBillPluginInitializer.java | 63 +++++++++++++++++++ .../plugin/MdmPluginInitializer.java | 1 - .../spring/spring-buildpackage-plugin.xml | 1 + 4 files changed, 65 insertions(+), 3 deletions(-) create mode 100644 buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/plugin/RecBillPluginInitializer.java diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/plugin/PayBillPluginInitializer.java b/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/plugin/PayBillPluginInitializer.java index 43ab218a..e57f8e6c 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/plugin/PayBillPluginInitializer.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/plugin/PayBillPluginInitializer.java @@ -4,14 +4,13 @@ import com.alibaba.fastjson.JSONObject; import com.hzya.frame.base.PluginBaseEntity; import com.hzya.frame.seeyon.paybill.service.IPayBillService; -import com.hzya.frame.sysnew.comparison.masterData.service.impl.MasterDataOrgsServiceImpl; import com.hzya.frame.web.entity.JsonResultEntity; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; /** - * 组织档案(PayBill)表服务接口 + * 付款单(PayBill)表服务接口 * * @author makejava * @since 2024-06-07 18:30:05 diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/plugin/RecBillPluginInitializer.java b/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/plugin/RecBillPluginInitializer.java new file mode 100644 index 00000000..f4689b83 --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/plugin/RecBillPluginInitializer.java @@ -0,0 +1,63 @@ +package com.hzya.frame.plugin.a8bill.plugin; + +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.base.PluginBaseEntity; +import com.hzya.frame.seeyon.paybill.service.IPayBillService; +import com.hzya.frame.seeyon.recbill.service.IRecBillService; +import com.hzya.frame.web.entity.JsonResultEntity; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; + +/** + * 收款单(RecBill)表服务接口 + * + * @author makejava + * @since 2024-06-07 18:30:05 + */ +public class RecBillPluginInitializer extends PluginBaseEntity{ + Logger logger = LoggerFactory.getLogger(RecBillPluginInitializer.class); + @Autowired + private IRecBillService recBillService; + + @Override + public void initialize() { + logger.info(getPluginLabel() + "執行初始化方法initialize()"); + } + + @Override + public void destroy() { + logger.info(getPluginLabel() + "執行銷毀方法destroy()"); + } + + @Override + public String getPluginId() { + return "RecBillPluginInitializer"; + } + + @Override + public String getPluginName() { + return "RecBillPluginInitializer插件"; + } + + @Override + public String getPluginLabel() { + return "RecBillPluginInitializer"; + } + + @Override + public String getPluginType() { + return "1"; + } + @Override + public JsonResultEntity executeBusiness(JSONObject requestJson) { + try { + logger.info("======开始执行收款单据信息同步========"); + return recBillService.sendRecBillToBip(requestJson); + }catch (Exception e){ + logger.info("======执行收款单据同步失败:{}========",e.getMessage()); + e.printStackTrace(); + } + return null; + } +} diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/plugin/MdmPluginInitializer.java b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/plugin/MdmPluginInitializer.java index 298019eb..02577f11 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/plugin/MdmPluginInitializer.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/plugin/MdmPluginInitializer.java @@ -1,7 +1,6 @@ package com.hzya.frame.plugin.masterData.plugin; import com.alibaba.fastjson.JSONObject; import com.hzya.frame.base.PluginBaseEntity; -import com.hzya.frame.sysnew.comparison.masterData.service.IMasterDataCustoMermanageService; import com.hzya.frame.sysnew.comparison.masterData.service.IMasterDataService; import com.hzya.frame.web.entity.JsonResultEntity; import org.slf4j.Logger; diff --git a/buildpackage/src/main/resources/cfgHome/plugin/payBill/spring/spring-buildpackage-plugin.xml b/buildpackage/src/main/resources/cfgHome/plugin/payBill/spring/spring-buildpackage-plugin.xml index dc955eca..03e1cd8a 100644 --- a/buildpackage/src/main/resources/cfgHome/plugin/payBill/spring/spring-buildpackage-plugin.xml +++ b/buildpackage/src/main/resources/cfgHome/plugin/payBill/spring/spring-buildpackage-plugin.xml @@ -2,4 +2,5 @@ + From 3e726e8b3c3f98d7f4dcc3c945f2e0eded126cca Mon Sep 17 00:00:00 2001 From: yuqh <123456> Date: Tue, 25 Jun 2024 14:10:22 +0800 Subject: [PATCH 19/22] =?UTF-8?q?=E6=95=B0=E6=99=BA=E5=8A=9E=E5=85=AC?= =?UTF-8?q?=E5=AF=B9=E6=8E=A5=E6=95=B0=E6=99=BA=E8=B4=A2=E5=8A=A1=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../entity/MdmModuleSourceEntity.xml | 66 ++++------- .../seeyon/paybill/entity/PayBillEntity.java | 27 +++++ .../seeyon/paybill/entity/PayBillEntity.xml | 1 + .../service/impl/PayBillServiceImpl.java | 4 +- .../frame/seeyon/recbill/dao/IRecBillDao.java | 31 ++++++ .../recbill/dao/impl/RecBillDaoImpl.java | 30 +++++ .../seeyon/recbill/entity/RecBillEntity.java | 104 ++++++++++++++++++ .../seeyon/recbill/entity/RecBillEntity.xml | 40 +++++++ .../recbill/service/IRecBillService.java | 26 +++++ .../service/impl/RecBillServiceImpl.java | 104 ++++++++++++++++++ .../service/impl/MasterDataServiceImpl.java | 39 ++++--- 11 files changed, 407 insertions(+), 65 deletions(-) create mode 100644 service/src/main/java/com/hzya/frame/seeyon/recbill/dao/IRecBillDao.java create mode 100644 service/src/main/java/com/hzya/frame/seeyon/recbill/dao/impl/RecBillDaoImpl.java create mode 100644 service/src/main/java/com/hzya/frame/seeyon/recbill/entity/RecBillEntity.java create mode 100644 service/src/main/java/com/hzya/frame/seeyon/recbill/entity/RecBillEntity.xml create mode 100644 service/src/main/java/com/hzya/frame/seeyon/recbill/service/IRecBillService.java create mode 100644 service/src/main/java/com/hzya/frame/seeyon/recbill/service/impl/RecBillServiceImpl.java diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleSource/entity/MdmModuleSourceEntity.xml b/service/src/main/java/com/hzya/frame/mdm/mdmModuleSource/entity/MdmModuleSourceEntity.xml index e30101f1..5808f79b 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleSource/entity/MdmModuleSourceEntity.xml +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleSource/entity/MdmModuleSourceEntity.xml @@ -173,25 +173,28 @@ @@ -329,32 +332,7 @@ update mdm_module_source set sts= 'N' ,modify_time = #{modify_time},modify_user delete from mdm_module_source where id = #{id} - - diff --git a/service/src/main/java/com/hzya/frame/seeyon/paybill/entity/PayBillEntity.java b/service/src/main/java/com/hzya/frame/seeyon/paybill/entity/PayBillEntity.java index 9fa7a24b..1a9308de 100644 --- a/service/src/main/java/com/hzya/frame/seeyon/paybill/entity/PayBillEntity.java +++ b/service/src/main/java/com/hzya/frame/seeyon/paybill/entity/PayBillEntity.java @@ -21,6 +21,33 @@ public class PayBillEntity extends BaseEntity { private String tableName;//表名称 private String fieldName;//字段名称 private String state;//推送状态 + private String pkOrg;//组织 + private String pkCustomer;//客户 + private String pk_oppaccount;//付款账户 + + public String getPkCustomer() { + return pkCustomer; + } + + public void setPkCustomer(String pkCustomer) { + this.pkCustomer = pkCustomer; + } + + public String getPk_oppaccount() { + return pk_oppaccount; + } + + public void setPk_oppaccount(String pk_oppaccount) { + this.pk_oppaccount = pk_oppaccount; + } + + public String getPkOrg() { + return pkOrg; + } + + public void setPkOrg(String pkOrg) { + this.pkOrg = pkOrg; + } public String getState() { return state; diff --git a/service/src/main/java/com/hzya/frame/seeyon/paybill/entity/PayBillEntity.xml b/service/src/main/java/com/hzya/frame/seeyon/paybill/entity/PayBillEntity.xml index 8514cc4c..736d5914 100644 --- a/service/src/main/java/com/hzya/frame/seeyon/paybill/entity/PayBillEntity.xml +++ b/service/src/main/java/com/hzya/frame/seeyon/paybill/entity/PayBillEntity.xml @@ -3,6 +3,7 @@ + diff --git a/service/src/main/java/com/hzya/frame/seeyon/paybill/service/impl/PayBillServiceImpl.java b/service/src/main/java/com/hzya/frame/seeyon/paybill/service/impl/PayBillServiceImpl.java index 9adbab1d..8eac7caa 100644 --- a/service/src/main/java/com/hzya/frame/seeyon/paybill/service/impl/PayBillServiceImpl.java +++ b/service/src/main/java/com/hzya/frame/seeyon/paybill/service/impl/PayBillServiceImpl.java @@ -93,7 +93,9 @@ public class PayBillServiceImpl extends BaseService implem body.put("pay_primal",pay.getPrimalMoney());//付款原币金额 body.put("creationtime",pay.getBillDate());//创建时间 body.put("direction","-1");//方向 :1=收;-1=付; - body.put("objecttype","");//交易对象 + body.put("objecttype","0");//交易对象 + body.put("pk_customer",pay.getPkCustomer());//客户 + body.put("pk_account",pay.getPkOppaccount());//付款银行账号 detailsArr.add(body); JSONObject main = new JSONObject(); main.put("head",head);//表头 diff --git a/service/src/main/java/com/hzya/frame/seeyon/recbill/dao/IRecBillDao.java b/service/src/main/java/com/hzya/frame/seeyon/recbill/dao/IRecBillDao.java new file mode 100644 index 00000000..7668f65e --- /dev/null +++ b/service/src/main/java/com/hzya/frame/seeyon/recbill/dao/IRecBillDao.java @@ -0,0 +1,31 @@ +package com.hzya.frame.seeyon.recbill.dao; + +import com.hzya.frame.seeyon.recbill.entity.RecBillEntity; + +import java.util.List; + +/** + * @author 👻👻👻👻👻👻👻👻👻👻 gjh + * @version 1.0 + * @content + * @date 2023-08-30 10:27 + */ +public interface IRecBillDao { +/** + * + * @content 获取OA工程付款单数据 + * @author laborer + * @date 2024/6/20 0020 11:30 + * + */ + List getOaRecBill(RecBillEntity rec); +/** + * + * @content 修改推送状态 + * @author laborer + * @date 2024/6/21 0021 11:15 + * + */ + + int updateState(RecBillEntity rec); +} diff --git a/service/src/main/java/com/hzya/frame/seeyon/recbill/dao/impl/RecBillDaoImpl.java b/service/src/main/java/com/hzya/frame/seeyon/recbill/dao/impl/RecBillDaoImpl.java new file mode 100644 index 00000000..f5494c65 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/seeyon/recbill/dao/impl/RecBillDaoImpl.java @@ -0,0 +1,30 @@ +package com.hzya.frame.seeyon.recbill.dao.impl; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.hzya.frame.basedao.dao.MybatisGenericDao; +import com.hzya.frame.seeyon.recbill.dao.IRecBillDao; +import com.hzya.frame.seeyon.recbill.entity.RecBillEntity; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * @author 👻👻👻👻👻👻👻👻👻👻 gjh + * @version 1.0 + * @content + * @date 2023-08-30 10:27 + */ +@Repository(value = "PayBillDaoImpl") +public class RecBillDaoImpl extends MybatisGenericDao implements IRecBillDao { + + @DS("#rec.dataSourceCode") + @Override + public List getOaRecBill(RecBillEntity rec) { + return super.selectList("com.hzya.frame.seeyon.recbill.dao.impl.RecBillDaoImpl.PayBillEntity_list_base",rec); + } + @DS("#rec.dataSourceCode") + @Override + public int updateState(RecBillEntity rec) { + return super.update("com.hzya.frame.seeyon.recbill.dao.impl.RecBillDaoImpl.PayBillEntity_update",rec); + } +} diff --git a/service/src/main/java/com/hzya/frame/seeyon/recbill/entity/RecBillEntity.java b/service/src/main/java/com/hzya/frame/seeyon/recbill/entity/RecBillEntity.java new file mode 100644 index 00000000..5a271b5d --- /dev/null +++ b/service/src/main/java/com/hzya/frame/seeyon/recbill/entity/RecBillEntity.java @@ -0,0 +1,104 @@ +package com.hzya.frame.seeyon.recbill.entity; + +import com.hzya.frame.web.entity.BaseEntity; + +/** + * + * @content 付款結算單 + * @author laborer + * @date 2024/6/20 0020 11:07 + * + */ + +public class RecBillEntity extends BaseEntity { + private String billDate;//付款日期 + private String primalMoney;//付款金额信息 + private String pkOppaccount;//付款银行信息 + private String pkSupplier;//供应商信息 + private String tableName;//表名称 + private String fieldName;//字段名称 + private String state;//推送状态 + private String pkCustomer;//客户 + private String pkAccount;//收款账户 + private String pkOrg;//组织 + + public String getPkCustomer() { + return pkCustomer; + } + + public void setPkCustomer(String pkCustomer) { + this.pkCustomer = pkCustomer; + } + + public String getPkAccount() { + return pkAccount; + } + + public void setPkAccount(String pkAccount) { + this.pkAccount = pkAccount; + } + + public String getPkOrg() { + return pkOrg; + } + + public void setPkOrg(String pkOrg) { + this.pkOrg = pkOrg; + } + + public String getState() { + return state; + } + + public void setState(String state) { + this.state = state; + } + + public String getTableName() { + return tableName; + } + + public void setTableName(String tableName) { + this.tableName = tableName; + } + + public String getFieldName() { + return fieldName; + } + + public void setFieldName(String fieldName) { + this.fieldName = fieldName; + } + + public String getBillDate() { + return billDate; + } + + public void setBillDate(String billDate) { + this.billDate = billDate; + } + + public String getPrimalMoney() { + return primalMoney; + } + + public void setPrimalMoney(String primalMoney) { + this.primalMoney = primalMoney; + } + + public String getPkOppaccount() { + return pkOppaccount; + } + + public void setPkOppaccount(String pkOppaccount) { + this.pkOppaccount = pkOppaccount; + } + + public String getPkSupplier() { + return pkSupplier; + } + + public void setPkSupplier(String pkSupplier) { + this.pkSupplier = pkSupplier; + } +} diff --git a/service/src/main/java/com/hzya/frame/seeyon/recbill/entity/RecBillEntity.xml b/service/src/main/java/com/hzya/frame/seeyon/recbill/entity/RecBillEntity.xml new file mode 100644 index 00000000..21f3fc7e --- /dev/null +++ b/service/src/main/java/com/hzya/frame/seeyon/recbill/entity/RecBillEntity.xml @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + update ${tableName} set ${fieldName} = #{state} where id = #{id} + + + + + diff --git a/service/src/main/java/com/hzya/frame/seeyon/recbill/service/IRecBillService.java b/service/src/main/java/com/hzya/frame/seeyon/recbill/service/IRecBillService.java new file mode 100644 index 00000000..96930a43 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/seeyon/recbill/service/IRecBillService.java @@ -0,0 +1,26 @@ +package com.hzya.frame.seeyon.recbill.service; + +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.basedao.service.IBaseService; +import com.hzya.frame.seeyon.cbs8.entity.PaymentEntity; +import com.hzya.frame.web.entity.JsonResultEntity; + +/** + * + * @content huoqu + * @author laborer获取OA付款单数据并推送BIP生成付款结算单 + * @date 2024/6/20 0020 11:19 + * + */ + +public interface IRecBillService extends IBaseService { +/** + * + * @content 工程付款单数据同步BIP + * @author laborer + * @date 2024/6/20 0020 11:24 + * + */ +JsonResultEntity sendRecBillToBip(JSONObject requestJson); + +} diff --git a/service/src/main/java/com/hzya/frame/seeyon/recbill/service/impl/RecBillServiceImpl.java b/service/src/main/java/com/hzya/frame/seeyon/recbill/service/impl/RecBillServiceImpl.java new file mode 100644 index 00000000..42c4466b --- /dev/null +++ b/service/src/main/java/com/hzya/frame/seeyon/recbill/service/impl/RecBillServiceImpl.java @@ -0,0 +1,104 @@ +package com.hzya.frame.seeyon.recbill.service.impl; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.basedao.service.impl.BaseService; +import com.hzya.frame.bip.v3.v2207.util.BipUtil; +import com.hzya.frame.seeyon.cbs8.entity.PaymentEntity; +import com.hzya.frame.seeyon.recbill.dao.IRecBillDao; +import com.hzya.frame.seeyon.recbill.entity.RecBillEntity; +import com.hzya.frame.seeyon.recbill.service.IRecBillService; +import com.hzya.frame.web.entity.JsonResultEntity; +import org.apache.commons.collections.CollectionUtils; +import org.jetbrains.annotations.NotNull; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * + * @content 付款单同步BIP + * @author laborer + * @date 2024/6/20 0020 15:20 + * + */ + +@Service("PayBillServiceImpl") +public class RecBillServiceImpl extends BaseService implements IRecBillService { + private static final Logger logger = LoggerFactory.getLogger(RecBillServiceImpl.class); + + @Autowired + private IRecBillDao payBillDao; + /** + * + * @content 工程付款单数据同步BIP + * @author laborer + * @date 2024/6/20 0020 11:24 + * + */ + @Override + public JsonResultEntity sendRecBillToBip(JSONObject requestJson) { + RecBillEntity entity = new RecBillEntity(); + requestJson.put("db_code","OA"); + entity.setDataSourceCode(requestJson.getString("db_code")); + ListpayBillEntityList = payBillDao.getOaRecBill(entity); + if(CollectionUtils.isNotEmpty(payBillEntityList)){ + for(RecBillEntity pay : payBillEntityList){ + String token = BipUtil.getBipToken("yonyou","8000230000"); + JSONObject main = bindingAdd(pay); + logger.info("银行流水收款信息数据{}",main.toString()); + String result = BipUtil.sendU9cTOBipEsb(main.toString(),"8000230016",token); + logger.info("银行流水收款信息数据{}",result); + JSONObject resultObj = JSON.parseObject(result); + boolean flag = resultObj.getBoolean("success"); + if(flag){ + pay.setState("Y"); + }else{ + pay.setState("N"); + } + pay.setDataSourceCode(requestJson.getString("db_code")); + payBillDao.updateState(pay); + // todo 后续在写吧(没字段等OA开了外网在创建),修改推送状态,避免再次查询 + } + } + return null; + } + + @NotNull + private JSONObject bindingAdd(RecBillEntity pay) { + JSONObject head = new JSONObject(); + head.put("pk_org","");//所属组织 + head.put("pk_group","");//集团 + head.put("bill_type","F4");//单据类型 默认F5 + head.put("trade_type","D4");//付款结算类型 默认D5 + head.put("source_flag","2");//付款结算类型 默认2 + head.put("bill_date",pay.getBillDate());//单据日期 + head.put("primal_money",pay.getPrimalMoney());//付款原币金额 + head.put("pk_currtype","CNY");//币种 + head.put("billmaker","");//制单人 + //处理明细数据,按照明细付款 多个明细生成多个付款结算单 + JSONArray detailsArr = new JSONArray(); + JSONObject body = new JSONObject(); + body.put("pk_org","");//所属组织 + body.put("pk_group","");//集团 + body.put("bill_type","F4");//单据类型 默认F5 + body.put("trade_type","D4");//付款结算类型 默认D5 + body.put("pk_currtype","CNY");//币种 + body.put("bill_date",pay.getBillDate());//单据日期 + body.put("pay_primal",pay.getPrimalMoney());//付款原币金额 + body.put("creationtime",pay.getBillDate());//创建时间 + body.put("direction","-1");//方向 :1=收;-1=付; + body.put("objecttype","0");//交易对象 + body.put("pk_customer",pay.getPkCustomer());//客户 + body.put("pk_account",pay.getPkAccount());//收款银行账号 + detailsArr.add(body); + JSONObject main = new JSONObject(); + main.put("head",head);//表头 + main.put("body",detailsArr);//明细数据 + return main; + } +} 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 6777b603..2f0cab38 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 @@ -14,6 +14,7 @@ import com.hzya.frame.sysnew.comparison.masterData.service.IMasterDataService; import com.hzya.frame.sysnew.comparison.service.impl.ComparisonServiceImpl; import com.hzya.frame.web.entity.BaseResult; import com.hzya.frame.web.entity.JsonResultEntity; +import com.hzya.frame.web.exception.BaseSystemException; import org.apache.commons.collections.CollectionUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -60,7 +61,7 @@ public class MasterDataServiceImpl extends BaseService String dbCode = mdmModuleSourceEntity.getDbCode(); String mdmCode = mdmModuleSourceEntity.getMdmCode(); List listAll = new ArrayList<>(); - if(!"10007".equals(mdmCode)){ + if(!"10004".equals(mdmCode)){ continue; } switch (appTyp) {//1、致远OA 2、用友U8C 3、用友BIP @@ -86,7 +87,7 @@ public class MasterDataServiceImpl extends BaseService } //调用主数据接口进行数据推送或更新 if (null != listAll && listAll.size() > 0) { - ParametricAssembly(mdmModuleSourceEntity,listAll,mdmCode,tableName); + ParametricAssembly(mdmModuleSourceEntity, listAll, mdmCode, tableName); } else { logger.info("U8C主数据档案没有需要同步中台的数据"); } @@ -98,7 +99,7 @@ public class MasterDataServiceImpl extends BaseService return BaseResult.getSuccessMessageEntity("主数据同步成功"); } //绑定银行 - private List binDingBank(JSONObject jsonObject, MdmModuleSourceEntity mdmModuleSourceEntity, String dbCode) { + private List binDingBank(JSONObject jsonObject, MdmModuleSourceEntity mdmModuleSourceEntity, String dbCode)throws Exception { List list = new ArrayList<>(); StringBuffer sb = new StringBuffer(); if(null != jsonObject && StrUtil.isNotEmpty(jsonObject.getString("code"))){ @@ -109,7 +110,7 @@ public class MasterDataServiceImpl extends BaseService sb.append(" and a.update_time >= '"+ts+"'"); } StringBuffer stringBuffer = new StringBuffer(); - stringBuffer.append("select *from bank"); + stringBuffer.append("select id as data_id,a.* from bank a"); mdmModuleSourceEntity.setDataSourceCode(dbCode); List> hashMaps = masterDataDaoImpl.queryArchivesByDataSource(stringBuffer.toString(),mdmModuleSourceEntity); int i = 0; @@ -128,7 +129,7 @@ public class MasterDataServiceImpl extends BaseService } //绑定客户档案 - private List binDingCust(JSONObject jsonObject, MdmModuleSourceEntity mdmModuleSourceEntity, String dbCode) { + private List binDingCust(JSONObject jsonObject, MdmModuleSourceEntity mdmModuleSourceEntity, String dbCode)throws Exception { List list = new ArrayList<>(); StringBuffer sb = new StringBuffer(); if(null != jsonObject && StrUtil.isNotEmpty(jsonObject.getString("code"))){ @@ -139,7 +140,7 @@ public class MasterDataServiceImpl extends BaseService sb.append(" and a.update_time >= '"+ts+"'"); } StringBuffer stringBuffer = new StringBuffer(); - stringBuffer.append("SELECT id as id,field0013 AS code,field0014 AS name,field0016 AS pk_custclass,field0015 AS shortname,field0012 AS pk_org FROM formmain_0226 a WHERE 1=1 "); + stringBuffer.append("SELECT id as data_id,field0013 AS code,field0014 AS name,field0016 AS pk_custclass,field0015 AS shortname,field0012 AS pk_org FROM formmain_0226 a WHERE 1=1 "); mdmModuleSourceEntity.setDataSourceCode(dbCode); List> hashMaps = masterDataDaoImpl.queryArchivesByDataSource(stringBuffer.toString(),mdmModuleSourceEntity); if(CollectionUtils.isNotEmpty(hashMaps)){ @@ -150,9 +151,9 @@ public class MasterDataServiceImpl extends BaseService mdm_cust.put(key, hashMap.get(key)); } //获取明细信息 - Long formmainId = (Long) hashMap.get("id"); + Long formmainId = (Long) hashMap.get("data_id"); StringBuffer stringBufferDetails = new StringBuffer(); - stringBufferDetails.append("SELECT id as id ,field0023 AS pk_bankdoc,field0024 AS accnum,field0025 AS combinenum FROM formson_0229 WHERE formmain_id = '"+formmainId+"' " ); + stringBufferDetails.append("SELECT id as data_id ,field0023 AS pk_bankdoc,field0024 AS accnum,field0025 AS combinenum FROM formson_0229 WHERE formmain_id = '"+formmainId+"' " ); List> hashMapsDetails = masterDataDaoImpl.queryArchivesByDataSource(stringBufferDetails.toString(),mdmModuleSourceEntity); JSONArray mdm_customer_bank = new JSONArray(); if(CollectionUtils.isNotEmpty(hashMapsDetails)){ @@ -173,7 +174,7 @@ public class MasterDataServiceImpl extends BaseService } //绑定OA用户参数 - private List bindingUser(JSONObject jsonObject, MdmModuleSourceEntity mdmModuleSourceEntity, String dbCode) { + private List bindingUser(JSONObject jsonObject, MdmModuleSourceEntity mdmModuleSourceEntity, String dbCode)throws Exception { List list = new ArrayList<>(); StringBuffer sb = new StringBuffer(); if(null != jsonObject && StrUtil.isNotEmpty(jsonObject.getString("code"))){ @@ -184,7 +185,7 @@ public class MasterDataServiceImpl extends BaseService sb.append(" and a.update_time >= '"+ts+"'"); } StringBuffer stringBuffer = new StringBuffer(); - stringBuffer.append("select a.id as id, a.name as user_name, e.LOGIN_NAME as user_code FROM org_member a left join org_principal e on a.id = e.MEMBER_ID" + + stringBuffer.append("select a.id as data_id, a.name as user_name, e.LOGIN_NAME as user_code FROM org_member a left join org_principal e on a.id = e.MEMBER_ID" + " WHERE 1=1 " + sb.toString()); mdmModuleSourceEntity.setDataSourceCode(dbCode); List> hashMaps = masterDataDaoImpl.queryArchivesByDataSource(stringBuffer.toString(),mdmModuleSourceEntity); @@ -205,13 +206,13 @@ public class MasterDataServiceImpl extends BaseService //查询档案参数组装 - public JsonResultEntity ParametricAssembly(MdmModuleSourceEntity mdmModuleSourceEntity,List hashMaps,String mdmCode,String tableName){ + public JsonResultEntity ParametricAssembly(MdmModuleSourceEntity mdmModuleSourceEntity,List hashMaps,String mdmCode,String tableName)throws Exception{ for (JSONObject hashMap : hashMaps) { JSONObject main = hashMap.getJSONObject(tableName); JSONObject jsonObjectUser = new JSONObject(); JSONObject jsonStr = new JSONObject(); - jsonObjectUser.put("id", main.get("id")); + jsonObjectUser.put("data_id", main.get("data_id")); jsonObjectUser.put("mdmCode", mdmCode); jsonStr.put("jsonStr", jsonObjectUser); //先查询编码和名称查询是否存在 @@ -233,10 +234,9 @@ public class MasterDataServiceImpl extends BaseService hashMap.put("mdmCode", mdmCode); hashMap.put("optionName", "数智中台"); jsonStr.put("jsonStr", hashMap); - try { - JsonResultEntity result = comparisonServiceimpl.saveEntity(jsonStr); - } catch (Exception e) { - logger.info("U8C主数据档案新增用户档案失败,失败原因:{}",e.getMessage()); + JsonResultEntity result = comparisonServiceimpl.saveEntity(jsonStr); + if(!result.isFlag()){ + throw new BaseSystemException("主数据保存失败"+ result.getMsg()); } } else { hashMap.put("appName","数智中台"); @@ -244,10 +244,9 @@ public class MasterDataServiceImpl extends BaseService hashMap.put("mdmCode", mdmCode); hashMap.put("optionName", "数智中台"); jsonStr.put("jsonStr", hashMap); - try { - comparisonServiceimpl.updateEntity(jsonStr); - } catch (Exception e) { - logger.info("U8C主数据档案更新用户档案失败,失败原因:{}", e.getMessage()); + JsonResultEntity result = comparisonServiceimpl.updateEntity(jsonStr); + if(!result.isFlag()){ + throw new BaseSystemException("主数据更新失败"+ result.getMsg()); } } } From 4b39c006f5d8af31a7a0c2f305ce5df90c2ccf07 Mon Sep 17 00:00:00 2001 From: lvleigang <957075182@qq.com> Date: Tue, 25 Jun 2024 14:12:15 +0800 Subject: [PATCH 20/22] =?UTF-8?q?=E4=B8=BB=E6=95=B0=E6=8D=AE=E5=8F=91?= =?UTF-8?q?=E9=80=81=E5=88=A4=E6=96=AD=E6=98=AF=E5=90=A6=E5=8F=AF=E4=BB=A5?= =?UTF-8?q?=E5=8F=91=E9=80=81=EF=BC=8C=E8=BF=94=E5=9B=9Enull?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mdm/mdmModule/entity/MdmModuleEntity.xml | 8 ++- .../mdm/service/impl/MdmServiceImpl.java | 2 +- .../impl/GroovyIntegrationServiceImpl.java | 68 +++---------------- 3 files changed, 16 insertions(+), 62 deletions(-) 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 5882dd6c..4e66bbe3 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 @@ -342,6 +342,7 @@ where id = #{id} `sts` varchar(1) DEFAULT NULL COMMENT '状态(Y正常N删除)', `org_id` varchar(50) DEFAULT NULL COMMENT '组织机构ID', `company_id` varchar(50) DEFAULT NULL COMMENT '公司id', + `data_id` varchar(100) DEFAULT NULL COMMENT 'data_id', `id` varchar(50) NOT NULL COMMENT '唯一标识码', @@ -355,6 +356,7 @@ where id = #{id} `sts` varchar(1) DEFAULT NULL COMMENT '状态(Y正常N删除)', `org_id` varchar(50) DEFAULT NULL COMMENT '组织机构ID', `company_id` varchar(50) DEFAULT NULL COMMENT '公司id', + `data_id` varchar(100) DEFAULT NULL COMMENT 'data_id', `id` varchar(50) NOT NULL COMMENT '唯一标识码', @@ -372,6 +374,8 @@ where id = #{id} `sts` varchar(1) DEFAULT NULL COMMENT '状态(Y正常N删除)', `org_id` varchar(50) DEFAULT NULL COMMENT '组织机构ID', `company_id` varchar(50) DEFAULT NULL COMMENT '公司id', + `data_type` varchar(255) DEFAULT NULL COMMENT '状态 1、成功2、失败', + `remark` varchar(255) DEFAULT NULL COMMENT '备注', `id` varchar(50) NOT NULL COMMENT '唯一标识码', @@ -388,6 +392,8 @@ where id = #{id} `sts` varchar(1) DEFAULT NULL COMMENT '状态(Y正常N删除)', `org_id` varchar(50) DEFAULT NULL COMMENT '组织机构ID', `company_id` varchar(50) DEFAULT NULL COMMENT '公司id', + `data_type` varchar(50) DEFAULT NULL COMMENT '状态 1、成功2、失败', + `remark` varchar(255) DEFAULT NULL COMMENT '备注', PRIMARY KEY (`sorts`,`id`) USING BTREE @@ -812,7 +818,7 @@ where id = #{id} AND - ${item.leftBracket} ${item.filedName} + ${item.leftBracket} ${item.filedId} = 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 3c1aef25..8ea83185 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 @@ -1688,7 +1688,7 @@ public class MdmServiceImpl implements IMdmService { checkData.put("id", id); checkData.put("mdmModuleDistributeDetailEntities", mdmModuleDistributeDetailEntities); JSONObject object1 = mdmModuleDao.queryMdmST(checkData); - if (object1.getString("id") == null || "".equals(object1.getString("id"))) { + if (object1 == null || object1.getString("id") == null || "".equals(object1.getString("id"))) { return BaseResult.getFailureMessageEntity("当前数据不符合规则不发送"); } } diff --git a/service/src/main/java/com/hzya/frame/sysnew/grovy/service/impl/GroovyIntegrationServiceImpl.java b/service/src/main/java/com/hzya/frame/sysnew/grovy/service/impl/GroovyIntegrationServiceImpl.java index 3e3b85e7..6ec18dfb 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/grovy/service/impl/GroovyIntegrationServiceImpl.java +++ b/service/src/main/java/com/hzya/frame/sysnew/grovy/service/impl/GroovyIntegrationServiceImpl.java @@ -31,74 +31,22 @@ public class GroovyIntegrationServiceImpl implements IGroovyIntegrationService { } public static void main(String[] args) { - java.lang.String str = "{\"data\":{\"pk_group\":\"00\",\"enablestate\":\"2\",\"code\":\"20240621001\",\"modify_time\":1718935555000,\"document_rule_num\":2,\"mdm_customer_bank\":[],\"add_status\":\"0\",\"custprop\":\"0\",\"delete_status\":\"1\",\"custstate\":\"1\",\"id\":\"d3d20ea680dc4bffaa7e5bf84764d62a\",\"data_status\":\"Y\",\"modify_user_id\":\"1\",\"sorts\":24,\"document_rule\":\"KH-2024-06-21-00002\",\"create_user_id\":\"1\",\"create_time\":1718935555000,\"company_id\":\"Y\",\"pk_country\":\"CN\",\"update_status\":\"1\",\"sts\":\"Y\",\"pk_custclass\":\"K01\",\"org_id\":\"Y\",\"name\":\"测试下发客户\",\"taxpayerid\":\"087982419238904359\"},\"query\":\"[]\",\"header\":\"[{\\\"parameterType\\\":\\\"fundamental\\\",\\\"length\\\":\\\"500\\\",\\\"index\\\":0,\\\"concreteType\\\":\\\"String\\\",\\\"description\\\":\\\"MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA87rrNR\\\",\\\"id\\\":\\\"421b73f0-5562-4bfe-b770-c8aca8878bfd\\\",\\\"parameterName\\\":\\\"pubKey\\\",\\\"required\\\":true,\\\"example\\\":\\\"MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA87rrNREgMNeOEOwlvM2iqqEfshDadRHziDSB2PbRnoMqSv1nGr3XBlZuseNj5HmxDEkLhOdfyw0yjzoz3wK7XhFpeN4Iyf7NT7hps5jAQMEpnul9Qwmj5qUr/eK5SaO9H8n7sh9BvCdrX9oRUh+U2/ceA3O+y/MUHk5DRvSadc8FhpqbOaNBbAzPnyYAwpVUPvaJ90jcGN1ZG99HR1GEzC+Cn9s6vgt7dYL6ysMs36bSP47xraDSxpfr0CLwa6JV/9KjLIeqL1ZaMtK0CJ1zJGCBA6O6kgxeE9Ul7q2lSS6mPAEJ78izaTYsrjhLpKT+eTtFBOLFbiCrbLp8tVE5kwIDAQAB\\\"},{\\\"parameterType\\\":\\\"fundamental\\\",\\\"length\\\":\\\"100\\\",\\\"index\\\":1,\\\"concreteType\\\":\\\"String\\\",\\\"description\\\":\\\"OA\\\",\\\"id\\\":\\\"5659424d-261d-43ed-9fff-657bd15c7a64\\\",\\\"parameterName\\\":\\\"client_id\\\",\\\"required\\\":true,\\\"example\\\":\\\"OA\\\"},{\\\"parameterType\\\":\\\"authport\\\",\\\"length\\\":\\\"100\\\",\\\"index\\\":2,\\\"concreteType\\\":\\\"String\\\",\\\"id\\\":\\\"d2c4477e-a0bb-4daa-97b4-3cf0b8445001\\\",\\\"parameterName\\\":\\\"access_token\\\",\\\"required\\\":true,\\\"example\\\":[\\\"attribute\\\",\\\"data\\\",\\\"access_token\\\"]}]\",\"body\":\"[{\\\"index\\\":0,\\\"id\\\":\\\"5ac44a3b-c0d5-4ae9-aec6-af6c4c8f59cc\\\",\\\"parameterName\\\":\\\"body\\\",\\\"first\\\":true}]\"}"; - java.lang.String str1 = "com.alibaba.fastjson.JSONObject returnObject = new com.alibaba.fastjson.JSONObject();\n" + - " com.alibaba.fastjson.JSONObject bodys = new com.alibaba.fastjson.JSONObject();\n" + - "\n" + - " com.alibaba.fastjson.JSONObject reqData = com.alibaba.fastjson.JSON.parseObject(jsonStr);\n" + - " com.alibaba.fastjson.JSONObject data = reqData.getJSONObject(\"data\");\n" + - " com.alibaba.fastjson.JSONObject ufinterfaceObject = new com.alibaba.fastjson.JSONObject();\n" + - " ufinterfaceObject.put(\"billtype\", \"customer\");\n" + - " ufinterfaceObject.put(\"isexchange\", \"Y\");\n" + - " ufinterfaceObject.put(\"replace\", \"Y\");\n" + - " ufinterfaceObject.put(\"sender\", \"OA\");\n" + - " ufinterfaceObject.put(\"account\", \"01\");\n" + - " ufinterfaceObject.put(\"groupcode\", \"00\");\n" + - " com.alibaba.fastjson.JSONObject billObject = new com.alibaba.fastjson.JSONObject();\n" + - " com.alibaba.fastjson.JSONObject billheadObject = new com.alibaba.fastjson.JSONObject();\n" + - " billheadObject.put(\"code\", data.get(\"code\"));\n" + - " billheadObject.put(\"custprop\", data.get(\"custprop\"));\n" + - " billheadObject.put(\"custstate\", data.get(\"custstate\"));\n" + - " billheadObject.put(\"pk_custclass\", data.get(\"pk_custclass\"));\n" + - " billheadObject.put(\"pk_country\", data.get(\"pk_country\"));\n" + - " billheadObject.put(\"pk_timezone\", \"P0800\");\n" + - " billheadObject.put(\"pk_format\", \"ZH-CN\");\n" + - " billheadObject.put(\"enablestate\", data.get(\"enablestate\"));\n" + - " billheadObject.put(\"name\", data.get(\"name\"));\n" + - " billheadObject.put(\"pk_group\", data.get(\"pk_group\"));\n" + - " billheadObject.put(\"pk_org\", data.get(\"pk_org\"));\n" + - " billheadObject.put(\"taxpayerid\", data.get(\"taxpayerid\"));\n" + - " billObject.put(\"billhead\", billheadObject);\n" + - " ufinterfaceObject.put(\"bill\", billObject);\n" + - " bodys.put(\"ufinterface\", ufinterfaceObject);\n" + - " returnObject.put(\"bodys\",bodys.toJSONString());\n" + - " return returnObject.toJSONString();".trim(); - String newString =str1.replaceAll("\\s+", ""); + java.lang.String str = "{\"data\":{\"document_rule\":\"RY-2024-06-25-00001\",\"create_user_id\":\"1\",\"mdm_psnjobs\":[],\"create_time\":1719287779000,\"company_id\":\"Y\",\"modify_time\":1719287779000,\"sex\":\"男\",\"mobile\":\"13758050335\",\"document_rule_num\":1,\"add_status\":\"0\",\"update_status\":\"1\",\"sts\":\"Y\",\"delete_status\":\"1\",\"org_id\":\"Y\",\"name\":\"张三1\",\"id\":\"ba0ed50f82e94f8e8a0d000d09795961\",\"data_status\":\"Y\",\"modify_user_id\":\"1\",\"sorts\":5},\"query\":\"[]\",\"header\":\"[]\",\"body\":\"[{\\\"parameterType\\\":\\\"complex\\\",\\\"children\\\":[{\\\"parameterType\\\":\\\"fundamental\\\",\\\"concreteType\\\":\\\"String\\\",\\\"index\\\":1,\\\"description\\\":\\\"用户名\\\",\\\"parameterName\\\":\\\"userName\\\",\\\"id\\\":\\\"3e5627fd-97a8-40ec-bb54-a973de695ad7\\\",\\\"example\\\":\\\"137000000\\\"},{\\\"parameterType\\\":\\\"fundamental\\\",\\\"concreteType\\\":\\\"String\\\",\\\"index\\\":2,\\\"description\\\":\\\"性别 男 女\\\",\\\"parameterName\\\":\\\"gender\\\",\\\"id\\\":\\\"e7ec2721-8fa0-4301-9d71-64c93558efdf\\\",\\\"example\\\":\\\"男\\\"},{\\\"parameterType\\\":\\\"fundamental\\\",\\\"concreteType\\\":\\\"String\\\",\\\"index\\\":3,\\\"description\\\":\\\"用户真实姓名\\\",\\\"parameterName\\\":\\\"userTrueName\\\",\\\"id\\\":\\\"fb760309-f24c-4638-ba19-f15a0fdba653\\\",\\\"example\\\":\\\"张三\\\"},{\\\"parameterType\\\":\\\"fundamental\\\",\\\"concreteType\\\":\\\"String\\\",\\\"index\\\":4,\\\"description\\\":\\\"密码\\\",\\\"parameterName\\\":\\\"userPwd\\\",\\\"id\\\":\\\"a651ce81-f7ee-4aa2-ad48-4afa35fb584c\\\",\\\"example\\\":\\\"123456\\\"},{\\\"parameterType\\\":\\\"fundamental\\\",\\\"concreteType\\\":\\\"String\\\",\\\"index\\\":5,\\\"description\\\":\\\"电话\\\",\\\"parameterName\\\":\\\"mobile\\\",\\\"id\\\":\\\"dad12b91-0c9f-45f2-9dc2-294bb50d5a29\\\",\\\"example\\\":\\\"137000000\\\"}],\\\"concreteType\\\":\\\"Object\\\",\\\"index\\\":0,\\\"id\\\":\\\"d643e859-fd5b-4b40-ab68-7092739dc2b9\\\",\\\"parameterName\\\":\\\"body\\\",\\\"first\\\":true}]\"}"; A88772 s = new A88772(); s.execute(str); } static class A88772 { String execute(String jsonStr) { - com.alibaba.fastjson.JSONObject returnObject = new com.alibaba.fastjson.JSONObject(); - com.alibaba.fastjson.JSONObject bodys = new com.alibaba.fastjson.JSONObject(); - com.alibaba.fastjson.JSONObject reqData = com.alibaba.fastjson.JSON.parseObject(jsonStr); com.alibaba.fastjson.JSONObject data = reqData.getJSONObject("data"); - com.alibaba.fastjson.JSONObject ufinterfaceObject = new com.alibaba.fastjson.JSONObject(); - ufinterfaceObject.put("billtype", "customer"); - ufinterfaceObject.put("isexchange", "Y"); - ufinterfaceObject.put("replace", "Y"); - ufinterfaceObject.put("sender", "OA"); - ufinterfaceObject.put("account", "01"); - ufinterfaceObject.put("groupcode", "00"); - com.alibaba.fastjson.JSONObject billObject = new com.alibaba.fastjson.JSONObject(); - com.alibaba.fastjson.JSONObject billheadObject = new com.alibaba.fastjson.JSONObject(); - billheadObject.put("code", data.get("code")); - billheadObject.put("custprop", data.get("custprop")); - billheadObject.put("custstate", data.get("custstate")); - billheadObject.put("pk_custclass", data.get("pk_custclass")); - billheadObject.put("pk_country", data.get("pk_country")); - billheadObject.put("pk_timezone", "P0800"); - billheadObject.put("pk_format", "ZH-CN"); - billheadObject.put("enablestate", data.get("enablestate")); - billheadObject.put("name", data.get("name")); - billheadObject.put("pk_group", data.get("pk_group")); - billheadObject.put("pk_org", data.get("pk_org")); - billheadObject.put("taxpayerid", data.get("taxpayerid")); - billObject.put("billhead", billheadObject); - ufinterfaceObject.put("bill", billObject); - bodys.put("ufinterface", ufinterfaceObject); + com.alibaba.fastjson.JSONObject returnObject = new com.alibaba.fastjson.JSONObject(); + com.alibaba.fastjson.JSONObject bodys = new com.alibaba.fastjson.JSONObject(); + bodys.put("userName", data.get("mobile")); + bodys.put("gender", data.get("sex")); + bodys.put("userTrueName", data.get("name")); + bodys.put("userPwd", "123456"); + bodys.put("mobile", data.get("mobile")); returnObject.put("bodys",bodys.toJSONString()); return returnObject.toJSONString(); } From dfd77dc8428675cdf589370fb65a1f324bbe2fcc Mon Sep 17 00:00:00 2001 From: lvleigang <957075182@qq.com> Date: Tue, 25 Jun 2024 15:40:34 +0800 Subject: [PATCH 21/22] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=BA=E5=91=98?= =?UTF-8?q?=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/GroovyIntegrationServiceImpl.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/service/src/main/java/com/hzya/frame/sysnew/grovy/service/impl/GroovyIntegrationServiceImpl.java b/service/src/main/java/com/hzya/frame/sysnew/grovy/service/impl/GroovyIntegrationServiceImpl.java index 6ec18dfb..30b5e19a 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/grovy/service/impl/GroovyIntegrationServiceImpl.java +++ b/service/src/main/java/com/hzya/frame/sysnew/grovy/service/impl/GroovyIntegrationServiceImpl.java @@ -42,10 +42,12 @@ public class GroovyIntegrationServiceImpl implements IGroovyIntegrationService { com.alibaba.fastjson.JSONObject data = reqData.getJSONObject("data"); com.alibaba.fastjson.JSONObject returnObject = new com.alibaba.fastjson.JSONObject(); com.alibaba.fastjson.JSONObject bodys = new com.alibaba.fastjson.JSONObject(); - bodys.put("userName", data.get("mobile")); - bodys.put("gender", data.get("sex")); - bodys.put("userTrueName", data.get("name")); - bodys.put("userPwd", "123456"); + bodys.put("userName", data.get("login_name")); + if(data.get("gender") != null){ + bodys.put("gender", data.get("gender")); + } + bodys.put("userTrueName", data.get("user_name")); + bodys.put("userPwd", "Hzya@1314"); bodys.put("mobile", data.get("mobile")); returnObject.put("bodys",bodys.toJSONString()); return returnObject.toJSONString(); From f601167183201a60ff9d337a19a899b1e8780f6b Mon Sep 17 00:00:00 2001 From: yuqh <123456> Date: Tue, 25 Jun 2024 15:57:15 +0800 Subject: [PATCH 22/22] =?UTF-8?q?=E6=94=B6=E6=AC=BE=E5=8D=95dao?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/hzya/frame/seeyon/recbill/dao/impl/RecBillDaoImpl.java | 2 +- .../frame/seeyon/recbill/service/impl/RecBillServiceImpl.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/service/src/main/java/com/hzya/frame/seeyon/recbill/dao/impl/RecBillDaoImpl.java b/service/src/main/java/com/hzya/frame/seeyon/recbill/dao/impl/RecBillDaoImpl.java index f5494c65..3682e8a2 100644 --- a/service/src/main/java/com/hzya/frame/seeyon/recbill/dao/impl/RecBillDaoImpl.java +++ b/service/src/main/java/com/hzya/frame/seeyon/recbill/dao/impl/RecBillDaoImpl.java @@ -14,7 +14,7 @@ import java.util.List; * @content * @date 2023-08-30 10:27 */ -@Repository(value = "PayBillDaoImpl") +@Repository(value = "RecBillDaoImpl") public class RecBillDaoImpl extends MybatisGenericDao implements IRecBillDao { @DS("#rec.dataSourceCode") diff --git a/service/src/main/java/com/hzya/frame/seeyon/recbill/service/impl/RecBillServiceImpl.java b/service/src/main/java/com/hzya/frame/seeyon/recbill/service/impl/RecBillServiceImpl.java index 42c4466b..78497edf 100644 --- a/service/src/main/java/com/hzya/frame/seeyon/recbill/service/impl/RecBillServiceImpl.java +++ b/service/src/main/java/com/hzya/frame/seeyon/recbill/service/impl/RecBillServiceImpl.java @@ -27,7 +27,7 @@ import java.util.List; * */ -@Service("PayBillServiceImpl") +@Service("RecBillServiceImpl") public class RecBillServiceImpl extends BaseService implements IRecBillService { private static final Logger logger = LoggerFactory.getLogger(RecBillServiceImpl.class);