From 0889fe0d30b41e78359b5731a371d26be46067a2 Mon Sep 17 00:00:00 2001 From: hecan <1718492867@qq.com> Date: Tue, 7 May 2024 09:04:40 +0800 Subject: [PATCH 01/80] =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E8=BE=93=E5=87=BA=E8=B7=AF=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- buildpackage/src/main/resources/application-hclocal.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/buildpackage/src/main/resources/application-hclocal.yml b/buildpackage/src/main/resources/application-hclocal.yml index 5d960999..0e91791f 100644 --- a/buildpackage/src/main/resources/application-hclocal.yml +++ b/buildpackage/src/main/resources/application-hclocal.yml @@ -6,7 +6,7 @@ logging: encodings: UTF-8 file: # 日志保存路径 - path: /Users/apple/Desktop/log/local + path: D:\yongansystem\kangarooDataCenter\v3\logs spring: datasource: dynamic: @@ -18,6 +18,6 @@ spring: driver-class-name: com.mysql.jdbc.Driver # 3.2.0开始支持SPI可省略此配置 savefile: # 文件保存路径 - path: /Users/apple/Desktop/log/local + path: D:\yongansystem\kangarooDataCenter\v3\logs ax: url: http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface \ No newline at end of file From 36284043bf71d94415d2fe1bac482b6860e27271 Mon Sep 17 00:00:00 2001 From: hecan <1718492867@qq.com> Date: Mon, 27 May 2024 10:46:36 +0800 Subject: [PATCH 02/80] =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=BA=93=E5=9C=B0=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/application-hclocal.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/buildpackage/src/main/resources/application-hclocal.yml b/buildpackage/src/main/resources/application-hclocal.yml index 0e91791f..995c4368 100644 --- a/buildpackage/src/main/resources/application-hclocal.yml +++ b/buildpackage/src/main/resources/application-hclocal.yml @@ -12,10 +12,14 @@ spring: dynamic: datasource: master: - url: jdbc:mysql://hzya.ufyct.com:9096/businesscenternew?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF8&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowLoadLocalInfile=false&autoReconnect=true&failOverReadOnly=false&connectTimeout=30000&socketTimeout=30000&autoReconnectForPools=true - username: root - password: bd993088e8a7c3dc5f44441617f9b4bf - driver-class-name: com.mysql.jdbc.Driver # 3.2.0开始支持SPI可省略此配置 +# url: jdbc:mysql://hzya.ufyct.com:9096/businesscenternew?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF8&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowLoadLocalInfile=false&autoReconnect=true&failOverReadOnly=false&connectTimeout=30000&socketTimeout=30000&autoReconnectForPools=true +# username: root +# password: bd993088e8a7c3dc5f44441617f9b4bf +# driver-class-name: com.mysql.jdbc.Driver # 3.2.0开始支持SPI可省略此配置 + url: jdbc:mysql://hzya.ufyct.com:9014/businesscenter?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF8&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowLoadLocalInfile=false&autoReconnect=true&failOverReadOnly=false&connectTimeout=30000&socketTimeout=30000&autoReconnectForPools=true + username: root + password: hzya@1314 + driver-class-name: com.mysql.jdbc.Driver # 3.2.0开始支持SPI可省略此配置 savefile: # 文件保存路径 path: D:\yongansystem\kangarooDataCenter\v3\logs From 96dc367b374dbec111b50b6e250ec84152092909 Mon Sep 17 00:00:00 2001 From: hecan <1718492867@qq.com> Date: Mon, 27 May 2024 11:21:21 +0800 Subject: [PATCH 03/80] =?UTF-8?q?=E6=A1=A3=E6=A1=88=E5=AF=B9=E7=85=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sysnew/comparison/dao/IComparisonDao.java | 71 ++ .../comparison/dao/IComparisonDetailsDao.java | 50 ++ .../dao/impl/ComparisonDaoImpl.java | 54 ++ .../dao/impl/ComparisonDetailsDaoImpl.java | 45 ++ .../entity/ComparisonDetailsEntity.java | 323 ++++++++++ .../entity/ComparisonDetailsEntity.xml | 89 +++ .../comparison/entity/ComparisonEntity.java | 607 ++++++++++++++++++ .../comparison/entity/ComparisonEntity.xml | 158 +++++ .../service/IComparisonDetailsService.java | 7 + .../service/IComparisonService.java | 49 ++ .../impl/ComparisonDetailsServiceImpl.java | 10 + .../service/impl/ComparisonServiceImpl.java | 334 ++++++++++ 12 files changed, 1797 insertions(+) create mode 100644 service/src/main/java/com/hzya/frame/sysnew/comparison/dao/IComparisonDao.java create mode 100644 service/src/main/java/com/hzya/frame/sysnew/comparison/dao/IComparisonDetailsDao.java create mode 100644 service/src/main/java/com/hzya/frame/sysnew/comparison/dao/impl/ComparisonDaoImpl.java create mode 100644 service/src/main/java/com/hzya/frame/sysnew/comparison/dao/impl/ComparisonDetailsDaoImpl.java create mode 100644 service/src/main/java/com/hzya/frame/sysnew/comparison/entity/ComparisonDetailsEntity.java create mode 100644 service/src/main/java/com/hzya/frame/sysnew/comparison/entity/ComparisonDetailsEntity.xml create mode 100644 service/src/main/java/com/hzya/frame/sysnew/comparison/entity/ComparisonEntity.java create mode 100644 service/src/main/java/com/hzya/frame/sysnew/comparison/entity/ComparisonEntity.xml create mode 100644 service/src/main/java/com/hzya/frame/sysnew/comparison/service/IComparisonDetailsService.java create mode 100644 service/src/main/java/com/hzya/frame/sysnew/comparison/service/IComparisonService.java create mode 100644 service/src/main/java/com/hzya/frame/sysnew/comparison/service/impl/ComparisonDetailsServiceImpl.java create mode 100644 service/src/main/java/com/hzya/frame/sysnew/comparison/service/impl/ComparisonServiceImpl.java diff --git a/service/src/main/java/com/hzya/frame/sysnew/comparison/dao/IComparisonDao.java b/service/src/main/java/com/hzya/frame/sysnew/comparison/dao/IComparisonDao.java new file mode 100644 index 00000000..b11a112a --- /dev/null +++ b/service/src/main/java/com/hzya/frame/sysnew/comparison/dao/IComparisonDao.java @@ -0,0 +1,71 @@ +package com.hzya.frame.sysnew.comparison.dao; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.hzya.frame.basedao.dao.IBaseDao; +import com.hzya.frame.sysnew.comparison.entity.ComparisonDetailsEntity; +import com.hzya.frame.sysnew.comparison.entity.ComparisonEntity; + +import java.util.List; + +public interface IComparisonDao extends IBaseDao { + + /** + * + * @content 根据主数据编码查询表名,字段名等信息 + * @Param + * @Return + * @Author hecan + * @Date 2024/5/7 16:05 + * **/ + List queryComparison(ComparisonEntity comparison); + + /** + * + * @content 分页查询数据 + * @Param + * @Return + * @Author hecan + * @Date 2024/5/9 15:11 + * **/ + List queryComparisonPage(ComparisonEntity comparison); + + /** + * + * @content 保存档案对照数据 + * @Param + * @Return + * @Author hecan + * @Date 2024/5/7 16:56 + * **/ + ComparisonEntity saveComparison(ComparisonEntity comparison); + + /** + * + * @content 生成单据规则 如:CK-yyyyMMdd-0001 + * @Param + * @Return + * @Author hecan + * @Date 2024/5/9 9:42 + * **/ + ComparisonEntity queryComparisonRule(ComparisonEntity comparison); + + /** + * + * @content 更新档案对照数据 + * @Param + * @Return + * @Author hecan + * @Date 2024/5/9 10:32 + * **/ + Integer updateComparisonByType(ComparisonEntity comparison); + + /** + * + * @content 删除档案对照数据 + * @Param + * @Return + * @Author hecan + * @Date 2024/5/9 14:09 + * **/ + Integer deleteComparison(ComparisonEntity comparison); +} diff --git a/service/src/main/java/com/hzya/frame/sysnew/comparison/dao/IComparisonDetailsDao.java b/service/src/main/java/com/hzya/frame/sysnew/comparison/dao/IComparisonDetailsDao.java new file mode 100644 index 00000000..731109c9 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/sysnew/comparison/dao/IComparisonDetailsDao.java @@ -0,0 +1,50 @@ +package com.hzya.frame.sysnew.comparison.dao; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.hzya.frame.basedao.dao.IBaseDao; +import com.hzya.frame.sysnew.comparison.entity.ComparisonDetailsEntity; + +import java.util.List; + +public interface IComparisonDetailsDao extends IBaseDao { + + /** + * + * @content 保存档案对照子表数据 + * @Param + * @Return + * @Author hecan + * @Date 2024/5/9 10:41 + * **/ + ComparisonDetailsEntity saveComparisonDetails(ComparisonDetailsEntity comparisonDetailsEntity); + + /** + * + * @content 更新档案对照子表数据 + * @Param + * @Return + * @Author hecan + * @Date 2024/5/9 10:41 + * **/ + Integer updateComparisonDetailsByType(ComparisonDetailsEntity comparisonDetailsEntity); + + /** + * + * @content 删除档案对照子表数据 + * @Param + * @Return + * @Author hecan + * @Date 2024/5/9 14:11 + * **/ + Integer deleteComparisonDetails(ComparisonDetailsEntity comparisonDetailsEntity); + + /** + * + * @content 分页查询子表数据 + * @Param + * @Return + * @Author hecan + * @Date 2024/5/9 15:34 + * **/ + List queryComparisonDetailsPage(ComparisonDetailsEntity comparisonDetailsEntity); +} diff --git a/service/src/main/java/com/hzya/frame/sysnew/comparison/dao/impl/ComparisonDaoImpl.java b/service/src/main/java/com/hzya/frame/sysnew/comparison/dao/impl/ComparisonDaoImpl.java new file mode 100644 index 00000000..695c3683 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/sysnew/comparison/dao/impl/ComparisonDaoImpl.java @@ -0,0 +1,54 @@ +package com.hzya.frame.sysnew.comparison.dao.impl; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.hzya.frame.basedao.dao.MybatisGenericDao; +import com.hzya.frame.sysnew.comparison.dao.IComparisonDao; +import com.hzya.frame.sysnew.comparison.entity.ComparisonEntity; +import org.springframework.stereotype.Repository; + +import java.util.List; + +@Repository(value = "comparisonDaoImpl") +public class ComparisonDaoImpl extends MybatisGenericDao implements IComparisonDao { + //根据主数据编码查询表名,字段名等信息 + @Override + public List queryComparison(ComparisonEntity comparison) { + List query = super.query(getSqlIdPrifx() + "queryComparison", comparison); + return query; + } + + //分页查询 + @Override + public List queryComparisonPage(ComparisonEntity comparison) { + List query = super.query(getSqlIdPrifx() + "queryComparisonPage", comparison); + return query; + } + + //保存数据 + @Override + public ComparisonEntity saveComparison(ComparisonEntity comparison) { + ComparisonEntity comparisonEntity = super.save(getSqlIdPrifx() + "saveComparison", comparison); + return comparisonEntity; + } + + //生成单据规则 + @Override + public ComparisonEntity queryComparisonRule(ComparisonEntity comparison) { + List comparisonEntities = super.query(getSqlIdPrifx() + "queryComparisonRule", comparison); + return comparisonEntities.get(0); + } + + //更新档案对照数据 + @Override + public Integer updateComparisonByType(ComparisonEntity comparison) { + int update = super.update(getSqlIdPrifx() + "updateComparisonByType", comparison); + return update; + } + + //删除档案对照数据 + @Override + public Integer deleteComparison(ComparisonEntity comparison) { + int delete = super.delete(getSqlIdPrifx() + "deleteComparison", comparison); + return delete; + } +} diff --git a/service/src/main/java/com/hzya/frame/sysnew/comparison/dao/impl/ComparisonDetailsDaoImpl.java b/service/src/main/java/com/hzya/frame/sysnew/comparison/dao/impl/ComparisonDetailsDaoImpl.java new file mode 100644 index 00000000..bafc78fe --- /dev/null +++ b/service/src/main/java/com/hzya/frame/sysnew/comparison/dao/impl/ComparisonDetailsDaoImpl.java @@ -0,0 +1,45 @@ +package com.hzya.frame.sysnew.comparison.dao.impl; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.hzya.frame.basedao.dao.MybatisGenericDao; +import com.hzya.frame.sysnew.comparison.dao.IComparisonDao; +import com.hzya.frame.sysnew.comparison.dao.IComparisonDetailsDao; +import com.hzya.frame.sysnew.comparison.entity.ComparisonDetailsEntity; +import com.hzya.frame.sysnew.comparison.entity.ComparisonEntity; +import org.springframework.stereotype.Repository; + +import java.util.List; + +@Repository(value = "comparisonDetailsDaoImpl") +public class ComparisonDetailsDaoImpl extends MybatisGenericDao implements IComparisonDetailsDao { + + //保存档案对照子表数据 + @Override + public ComparisonDetailsEntity saveComparisonDetails(ComparisonDetailsEntity comparisonDetailsEntity) { + ComparisonDetailsEntity detailsEntity = super.save(getSqlIdPrifx() + "saveComparisonDetails", comparisonDetailsEntity); + return detailsEntity; + } + + //更新档案对照子表数据 + @Override + public Integer updateComparisonDetailsByType(ComparisonDetailsEntity comparisonDetailsEntity) { + int update = super.update(getSqlIdPrifx()+"updateComparisonDetailsByType", comparisonDetailsEntity); + return update; + } + + //删除档案对照子表的数据 + @Override + public Integer deleteComparisonDetails(ComparisonDetailsEntity comparisonDetailsEntity) { + int delete = super.delete(getSqlIdPrifx() + "deleteComparisonDetails", comparisonDetailsEntity); + return delete; + } + + //分页查询子表数据 + @Override + public List queryComparisonDetailsPage(ComparisonDetailsEntity comparisonDetailsEntity) { + List query = super.query(getSqlIdPrifx() + "queryComparisonDetailsPage", comparisonDetailsEntity); + return query; + } + + +} 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 new file mode 100644 index 00000000..11ce420d --- /dev/null +++ b/service/src/main/java/com/hzya/frame/sysnew/comparison/entity/ComparisonDetailsEntity.java @@ -0,0 +1,323 @@ +package com.hzya.frame.sysnew.comparison.entity; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.hzya.frame.web.entity.BaseEntity; +import org.springframework.format.annotation.DateTimeFormat; + +import java.util.Date; +import java.util.Map; + +/** + * + * @content 档案对照明细实体类 + * @Param + * @Return + * @Author hecan + * @Date 2024/5/7 15:50 + * **/ +public class ComparisonDetailsEntity extends BaseEntity { + + private String contrastType;//对照类型 + private String documentRule;//单据规则 + private Long documentRuleNum;//单据规则流水号 + private String sszz;//所属组织 + private String bz;//备注 + private String formmainId;//上级id + private String taskLinvingId;//集成任务-实例_id + private String result;//返回结果 + private String queryCondition;//原始查询条件 + private String rootAppPk;//源系统主键 + private String rootAppBill;//原系统单据 + private String rootAppNewData;//最新源系统数据详情 + private String newTransmitInfo;//最新传输信息 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date newPushDate;//最新推送时间 + private String repairPust;//是否补推(Y是N不是) + private String senceId;//场景id + private String newState;//最新推送状态 + private String businessDate;//单据业务日期 + private String pluginId;//插件id + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date processingTime;//处理时间 + private String processingRemarks;//处理备注 + private String processorName;//处理⼈名称 + private String processor;//处理⼈ + private String newSystemNumber;//下游系统单号 + private String newSystemPrimary;//下游系统主键 + + private String mdmName;//主数据名称 + private String mdmCode;//主数据编码 + private String dbName;//表名 + private String dbType;//类型 1、主表 2、明细 + private String enName;//字段名 英文 + private String chName;// 字段名 中文 + private String filedType;//字段类型 1、BIGINT 2、DECIMAL 3、VARCHAR 4、DATETIME + + private Map mapDetails; + + public String getMdmName() { + return mdmName; + } + + public void setMdmName(String mdmName) { + this.mdmName = mdmName; + } + + public String getMdmCode() { + return mdmCode; + } + + public void setMdmCode(String mdmCode) { + this.mdmCode = mdmCode; + } + + public String getDbName() { + return dbName; + } + + public void setDbName(String dbName) { + this.dbName = dbName; + } + + public String getDbType() { + return dbType; + } + + public void setDbType(String dbType) { + this.dbType = dbType; + } + + public String getEnName() { + return enName; + } + + public void setEnName(String enName) { + this.enName = enName; + } + + public String getChName() { + return chName; + } + + public void setChName(String chName) { + this.chName = chName; + } + + public String getFiledType() { + return filedType; + } + + public void setFiledType(String filedType) { + this.filedType = filedType; + } + + public Map getMapDetails() { + return mapDetails; + } + + public void setMapDetails(Map mapDetails) { + this.mapDetails = mapDetails; + } + + public String getContrastType() { + return contrastType; + } + + public void setContrastType(String contrastType) { + this.contrastType = contrastType; + } + + public String getDocumentRule() { + return documentRule; + } + + public void setDocumentRule(String documentRule) { + this.documentRule = documentRule; + } + + public Long getDocumentRuleNum() { + return documentRuleNum; + } + + public void setDocumentRuleNum(Long documentRuleNum) { + this.documentRuleNum = documentRuleNum; + } + + public String getSszz() { + return sszz; + } + + public void setSszz(String sszz) { + this.sszz = sszz; + } + + public String getBz() { + return bz; + } + + public void setBz(String bz) { + this.bz = bz; + } + + public String getFormmainId() { + return formmainId; + } + + public void setFormmainId(String formmainId) { + this.formmainId = formmainId; + } + + public String getTaskLinvingId() { + return taskLinvingId; + } + + public void setTaskLinvingId(String taskLinvingId) { + this.taskLinvingId = taskLinvingId; + } + + public String getResult() { + return result; + } + + public void setResult(String result) { + this.result = result; + } + + public String getQueryCondition() { + return queryCondition; + } + + public void setQueryCondition(String queryCondition) { + this.queryCondition = queryCondition; + } + + public String getRootAppPk() { + return rootAppPk; + } + + public void setRootAppPk(String rootAppPk) { + this.rootAppPk = rootAppPk; + } + + public String getRootAppBill() { + return rootAppBill; + } + + public void setRootAppBill(String rootAppBill) { + this.rootAppBill = rootAppBill; + } + + public String getRootAppNewData() { + return rootAppNewData; + } + + public void setRootAppNewData(String rootAppNewData) { + this.rootAppNewData = rootAppNewData; + } + + public String getNewTransmitInfo() { + return newTransmitInfo; + } + + public void setNewTransmitInfo(String newTransmitInfo) { + this.newTransmitInfo = newTransmitInfo; + } + + public Date getNewPushDate() { + return newPushDate; + } + + public void setNewPushDate(Date newPushDate) { + this.newPushDate = newPushDate; + } + + public String getRepairPust() { + return repairPust; + } + + public void setRepairPust(String repairPust) { + this.repairPust = repairPust; + } + + public String getSenceId() { + return senceId; + } + + public void setSenceId(String senceId) { + this.senceId = senceId; + } + + public String getNewState() { + return newState; + } + + public void setNewState(String newState) { + this.newState = newState; + } + + public String getBusinessDate() { + return businessDate; + } + + public void setBusinessDate(String businessDate) { + this.businessDate = businessDate; + } + + public String getPluginId() { + return pluginId; + } + + public void setPluginId(String pluginId) { + this.pluginId = pluginId; + } + + public Date getProcessingTime() { + return processingTime; + } + + public void setProcessingTime(Date processingTime) { + this.processingTime = processingTime; + } + + public String getProcessingRemarks() { + return processingRemarks; + } + + public void setProcessingRemarks(String processingRemarks) { + this.processingRemarks = processingRemarks; + } + + public String getProcessorName() { + return processorName; + } + + public void setProcessorName(String processorName) { + this.processorName = processorName; + } + + public String getProcessor() { + return processor; + } + + public void setProcessor(String processor) { + this.processor = processor; + } + + public String getNewSystemNumber() { + return newSystemNumber; + } + + public void setNewSystemNumber(String newSystemNumber) { + this.newSystemNumber = newSystemNumber; + } + + public String getNewSystemPrimary() { + return newSystemPrimary; + } + + public void setNewSystemPrimary(String newSystemPrimary) { + this.newSystemPrimary = newSystemPrimary; + } +} 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 new file mode 100644 index 00000000..dfd07457 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/sysnew/comparison/entity/ComparisonDetailsEntity.xml @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + insert into ${dbName} + + + ${column}, + + + values + + + #{value}, + + + + + + + update ${dbName} + + + ${key} =#{value} + + + where formmain_id=#{formmainId} and sts='Y' + + + + + update + ${dbName} + set sts= 'N' ,modify_time = now(),modify_user_id = #{modify_user_id} + + + and formmain_id=#{formmainId} and sts='Y' + + + + + diff --git a/service/src/main/java/com/hzya/frame/sysnew/comparison/entity/ComparisonEntity.java b/service/src/main/java/com/hzya/frame/sysnew/comparison/entity/ComparisonEntity.java new file mode 100644 index 00000000..6f96d23f --- /dev/null +++ b/service/src/main/java/com/hzya/frame/sysnew/comparison/entity/ComparisonEntity.java @@ -0,0 +1,607 @@ +package com.hzya.frame.sysnew.comparison.entity; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.hzya.frame.web.entity.BaseEntity; +import org.springframework.format.annotation.DateTimeFormat; + +import java.util.Date; +import java.util.List; +import java.util.Map; + +/** + * + * @content 档案对照实体类 + * @Param + * @Return + * @Author hecan + * @Date 2024/5/7 15:50 + * **/ +public class ComparisonEntity extends BaseEntity { + private String contrastType;//对照类型 + private String documentRule;//单据规则 + private Long documentRuleNum;//单据规则流水号 + private String ckbm;//仓库编码 + private String ckmc;//仓库名称 + private String cklx;//仓库类型 + private String ckdz;//仓库地址 + private String fzr;//负责人 + private String dh;//电话 + private String ssdd;//所属地点 + private String bz;//备注 + private String ssck;//所属仓库 + private String hwbm;//货位编码 + + private String hwmc;//货位名称 + private String hwrj;//货位容积 + private String dd;//地点 + private String sjzz;//上级组织 + private String zzbm;//组织编码 + private String zzmc;//组织名称 + private String fr;//法人 + private String dz;//地址 + private String taskCode;//任务编码 + private String taskName;//任务名称 + private String taskClasses;//任务分类 + private String taskCron;//任务策略 + private String taskTag;//任务标识 + private String funInfo;//功能介绍/任务描述' + private String senceId;//场景id + private String remark;//备注 + private String taskStatus;//任务状态 + private String serverName;//服务名称 + private String plug;//插件 + private String plugId;//插件id + + private String taskLinvingId;//集成任务-实例_id + private String result;//返回结果 + private String queryCondition;//原始查询条件 + private String rootAppPk;//源系统主键 + private String rootAppBill;//原系统单据 + private String rootAppNewData;//最新源系统数据详情 + private String newTransmitInfo;//最新传输信息 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date newPushDate;//最新推送时间 + private String repairPust;//是否补推(Y是N不是) + private String newState;//最新推送状态 + private String businessDate;//单据业务日期 + private String pluginId;//插件id + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date processingTime;//处理时间 + private String processingRemarks;//处理备注 + private String processorName;//处理⼈名称 + private String processor;//处理⼈ + private String newSystemNumber;//下游系统单号 + private String newSystemPrimary;//下游系统主键 + + private String mdmName;//主数据名称 + private String mdmCode;//主数据编码 + private String dbName;//表名 + private String dbType;//类型 1、主表 2、明细 + private String enName;//字段名 英文 + private String chName;// 字段名 中文 + private String filedType;//字段类型 1、BIGINT 2、DECIMAL 3、VARCHAR 4、DATETIME + + private Map map; + private ComparisonDetailsEntity comparisonDetailsEntity; + private String sszz;//所属组织 + private String formmainId;//上级id + + private String rulePrefix;//规则前缀 CK-yyyyMMdd-0001中的CK + + private List comparisonDetailsEntityList; + + public List getComparisonDetailsEntityList() { + return comparisonDetailsEntityList; + } + + public void setComparisonDetailsEntityList(List comparisonDetailsEntityList) { + this.comparisonDetailsEntityList = comparisonDetailsEntityList; + } + + public String getRulePrefix() { + return rulePrefix; + } + + public void setRulePrefix(String rulePrefix) { + this.rulePrefix = rulePrefix; + } + + public String getSszz() { + return sszz; + } + + public void setSszz(String sszz) { + this.sszz = sszz; + } + + public String getFormmainId() { + return formmainId; + } + + public void setFormmainId(String formmainId) { + this.formmainId = formmainId; + } + + public ComparisonDetailsEntity getComparisonDetailsEntity() { + return comparisonDetailsEntity; + } + + public void setComparisonDetailsEntity(ComparisonDetailsEntity comparisonDetailsEntity) { + this.comparisonDetailsEntity = comparisonDetailsEntity; + } + + public Map getMap() { + return map; + } + + public void setMap(Map map) { + this.map = map; + } + + + public String getMdmName() { + return mdmName; + } + + public void setMdmName(String mdmName) { + this.mdmName = mdmName; + } + + public String getMdmCode() { + return mdmCode; + } + + public void setMdmCode(String mdmCode) { + this.mdmCode = mdmCode; + } + + public String getDbName() { + return dbName; + } + + public void setDbName(String dbName) { + this.dbName = dbName; + } + + public String getDbType() { + return dbType; + } + + public void setDbType(String dbType) { + this.dbType = dbType; + } + + public String getEnName() { + return enName; + } + + public void setEnName(String enName) { + this.enName = enName; + } + + public String getChName() { + return chName; + } + + public void setChName(String chName) { + this.chName = chName; + } + + public String getFiledType() { + return filedType; + } + + public void setFiledType(String filedType) { + this.filedType = filedType; + } + + public String getTaskLinvingId() { + return taskLinvingId; + } + + public void setTaskLinvingId(String taskLinvingId) { + this.taskLinvingId = taskLinvingId; + } + + public String getResult() { + return result; + } + + public void setResult(String result) { + this.result = result; + } + + public String getQueryCondition() { + return queryCondition; + } + + public void setQueryCondition(String queryCondition) { + this.queryCondition = queryCondition; + } + + public String getRootAppPk() { + return rootAppPk; + } + + public void setRootAppPk(String rootAppPk) { + this.rootAppPk = rootAppPk; + } + + public String getRootAppBill() { + return rootAppBill; + } + + public void setRootAppBill(String rootAppBill) { + this.rootAppBill = rootAppBill; + } + + public String getRootAppNewData() { + return rootAppNewData; + } + + public void setRootAppNewData(String rootAppNewData) { + this.rootAppNewData = rootAppNewData; + } + + public String getNewTransmitInfo() { + return newTransmitInfo; + } + + public void setNewTransmitInfo(String newTransmitInfo) { + this.newTransmitInfo = newTransmitInfo; + } + + public Date getNewPushDate() { + return newPushDate; + } + + public void setNewPushDate(Date newPushDate) { + this.newPushDate = newPushDate; + } + + public String getRepairPust() { + return repairPust; + } + + public void setRepairPust(String repairPust) { + this.repairPust = repairPust; + } + + public String getNewState() { + return newState; + } + + public void setNewState(String newState) { + this.newState = newState; + } + + public String getBusinessDate() { + return businessDate; + } + + public void setBusinessDate(String businessDate) { + this.businessDate = businessDate; + } + + public String getPluginId() { + return pluginId; + } + + public void setPluginId(String pluginId) { + this.pluginId = pluginId; + } + + public Date getProcessingTime() { + return processingTime; + } + + public void setProcessingTime(Date processingTime) { + this.processingTime = processingTime; + } + + public String getProcessingRemarks() { + return processingRemarks; + } + + public void setProcessingRemarks(String processingRemarks) { + this.processingRemarks = processingRemarks; + } + + public String getProcessorName() { + return processorName; + } + + public void setProcessorName(String processorName) { + this.processorName = processorName; + } + + public String getProcessor() { + return processor; + } + + public void setProcessor(String processor) { + this.processor = processor; + } + + public String getNewSystemNumber() { + return newSystemNumber; + } + + public void setNewSystemNumber(String newSystemNumber) { + this.newSystemNumber = newSystemNumber; + } + + public String getNewSystemPrimary() { + return newSystemPrimary; + } + + public void setNewSystemPrimary(String newSystemPrimary) { + this.newSystemPrimary = newSystemPrimary; + } + + public String getContrastType() { + return contrastType; + } + + public void setContrastType(String contrastType) { + this.contrastType = contrastType; + } + + public String getDocumentRule() { + return documentRule; + } + + public void setDocumentRule(String documentRule) { + this.documentRule = documentRule; + } + + public Long getDocumentRuleNum() { + return documentRuleNum; + } + + public void setDocumentRuleNum(Long documentRuleNum) { + this.documentRuleNum = documentRuleNum; + } + + public String getCkbm() { + return ckbm; + } + + public void setCkbm(String ckbm) { + this.ckbm = ckbm; + } + + public String getCkmc() { + return ckmc; + } + + public void setCkmc(String ckmc) { + this.ckmc = ckmc; + } + + public String getCklx() { + return cklx; + } + + public void setCklx(String cklx) { + this.cklx = cklx; + } + + public String getCkdz() { + return ckdz; + } + + public void setCkdz(String ckdz) { + this.ckdz = ckdz; + } + + public String getFzr() { + return fzr; + } + + public void setFzr(String fzr) { + this.fzr = fzr; + } + + public String getDh() { + return dh; + } + + public void setDh(String dh) { + this.dh = dh; + } + + public String getSsdd() { + return ssdd; + } + + public void setSsdd(String ssdd) { + this.ssdd = ssdd; + } + + public String getBz() { + return bz; + } + + public void setBz(String bz) { + this.bz = bz; + } + + public String getSsck() { + return ssck; + } + + public void setSsck(String ssck) { + this.ssck = ssck; + } + + public String getHwbm() { + return hwbm; + } + + public void setHwbm(String hwbm) { + this.hwbm = hwbm; + } + + public String getHwmc() { + return hwmc; + } + + public void setHwmc(String hwmc) { + this.hwmc = hwmc; + } + + public String getHwrj() { + return hwrj; + } + + public void setHwrj(String hwrj) { + this.hwrj = hwrj; + } + + public String getDd() { + return dd; + } + + public void setDd(String dd) { + this.dd = dd; + } + + public String getSjzz() { + return sjzz; + } + + public void setSjzz(String sjzz) { + this.sjzz = sjzz; + } + + public String getZzbm() { + return zzbm; + } + + public void setZzbm(String zzbm) { + this.zzbm = zzbm; + } + + public String getZzmc() { + return zzmc; + } + + public void setZzmc(String zzmc) { + this.zzmc = zzmc; + } + + public String getFr() { + return fr; + } + + public void setFr(String fr) { + this.fr = fr; + } + + public String getDz() { + return dz; + } + + public void setDz(String dz) { + this.dz = dz; + } + + public String getTaskCode() { + return taskCode; + } + + public void setTaskCode(String taskCode) { + this.taskCode = taskCode; + } + + public String getTaskName() { + return taskName; + } + + public void setTaskName(String taskName) { + this.taskName = taskName; + } + + public String getTaskClasses() { + return taskClasses; + } + + public void setTaskClasses(String taskClasses) { + this.taskClasses = taskClasses; + } + + public String getTaskCron() { + return taskCron; + } + + public void setTaskCron(String taskCron) { + this.taskCron = taskCron; + } + + public String getTaskTag() { + return taskTag; + } + + public void setTaskTag(String taskTag) { + this.taskTag = taskTag; + } + + public String getFunInfo() { + return funInfo; + } + + public void setFunInfo(String funInfo) { + this.funInfo = funInfo; + } + + public String getSenceId() { + return senceId; + } + + public void setSenceId(String senceId) { + this.senceId = senceId; + } + + public String getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark; + } + + public String getTaskStatus() { + return taskStatus; + } + + public void setTaskStatus(String taskStatus) { + this.taskStatus = taskStatus; + } + + public String getServerName() { + return serverName; + } + + public void setServerName(String serverName) { + this.serverName = serverName; + } + + public String getPlug() { + return plug; + } + + public void setPlug(String plug) { + this.plug = plug; + } + + public String getPlugId() { + return plugId; + } + + public void setPlugId(String plugId) { + this.plugId = plugId; + } +} 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 new file mode 100644 index 00000000..ff5c6469 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/sysnew/comparison/entity/ComparisonEntity.xml @@ -0,0 +1,158 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + insert into ${dbName} + + + ${column}, + + + values + + + #{value}, + + + + + + + update ${dbName} + + + ${key} =#{value} + + + where id=#{id} and sts='Y' + + + + + + update + ${dbName} + set sts= 'N' ,modify_time = now(),modify_user_id = #{modify_user_id} + + + and ${key} =#{value} + + and id=#{id} and sts='Y' + + + + + diff --git a/service/src/main/java/com/hzya/frame/sysnew/comparison/service/IComparisonDetailsService.java b/service/src/main/java/com/hzya/frame/sysnew/comparison/service/IComparisonDetailsService.java new file mode 100644 index 00000000..ac5db9c0 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/sysnew/comparison/service/IComparisonDetailsService.java @@ -0,0 +1,7 @@ +package com.hzya.frame.sysnew.comparison.service; + +import com.hzya.frame.basedao.service.IBaseService; +import com.hzya.frame.sysnew.comparison.entity.ComparisonDetailsEntity; + +public interface IComparisonDetailsService extends IBaseService { +} diff --git a/service/src/main/java/com/hzya/frame/sysnew/comparison/service/IComparisonService.java b/service/src/main/java/com/hzya/frame/sysnew/comparison/service/IComparisonService.java new file mode 100644 index 00000000..60375cfb --- /dev/null +++ b/service/src/main/java/com/hzya/frame/sysnew/comparison/service/IComparisonService.java @@ -0,0 +1,49 @@ +package com.hzya.frame.sysnew.comparison.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 IComparisonService extends IBaseService { + + /** + * + * @content 分页查询档案对照数据 + * @Param + * @Return + * @Author hecan + * @Date 2024/5/7 15:55 + * **/ + JsonResultEntity queryEntityPage(JSONObject jsonObject); + + /** + * + * @content 新增档案对照数据 + * @Param + * @Return + * @Author hecan + * @Date 2024/5/7 16:52 + * **/ + JsonResultEntity saveEntity(JSONObject jsonObject); + + /** + * + * @content 编辑档案对照数据 + * @Param + * @Return + * @Author hecan + * @Date 2024/5/9 10:19 + * **/ + JsonResultEntity updateEntity(JSONObject jsonObject); + + /** + * + * @content 删除档案对照数据 + * @Param + * @Return + * @Author hecan + * @Date 2024/5/9 13:59 + * **/ + JsonResultEntity deleteEntity(JSONObject jsonObject); +} diff --git a/service/src/main/java/com/hzya/frame/sysnew/comparison/service/impl/ComparisonDetailsServiceImpl.java b/service/src/main/java/com/hzya/frame/sysnew/comparison/service/impl/ComparisonDetailsServiceImpl.java new file mode 100644 index 00000000..64b6bfd9 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/sysnew/comparison/service/impl/ComparisonDetailsServiceImpl.java @@ -0,0 +1,10 @@ +package com.hzya.frame.sysnew.comparison.service.impl; + +import com.hzya.frame.basedao.service.impl.BaseService; +import com.hzya.frame.sysnew.comparison.entity.ComparisonDetailsEntity; +import com.hzya.frame.sysnew.comparison.service.IComparisonDetailsService; +import org.springframework.stereotype.Service; + +@Service(value = "comparisonDetailsServiceImpl") +public class ComparisonDetailsServiceImpl extends BaseService implements IComparisonDetailsService { +} 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 new file mode 100644 index 00000000..e449e22d --- /dev/null +++ b/service/src/main/java/com/hzya/frame/sysnew/comparison/service/impl/ComparisonServiceImpl.java @@ -0,0 +1,334 @@ +package com.hzya.frame.sysnew.comparison.service.impl; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.github.pagehelper.PageInfo; +import com.hzya.frame.basedao.service.impl.BaseService; +import com.hzya.frame.sysnew.comparison.dao.IComparisonDao; +import com.hzya.frame.sysnew.comparison.dao.IComparisonDetailsDao; +import com.hzya.frame.sysnew.comparison.entity.ComparisonDetailsEntity; +import com.hzya.frame.sysnew.comparison.entity.ComparisonEntity; +import com.hzya.frame.sysnew.comparison.service.IComparisonService; +import com.hzya.frame.sysnew.generalData.dao.IGeneralDataDao; +import com.hzya.frame.uuid.UUIDUtils; +import com.hzya.frame.web.entity.BaseResult; +import com.hzya.frame.web.entity.JsonResultEntity; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import sun.java2d.pipe.AAShapePipe; + +import java.util.*; + +@Service(value = "comparisonServiceImpl") +public class ComparisonServiceImpl extends BaseService implements IComparisonService { + + private IComparisonDao comparisonDao; + + @Autowired + private IComparisonDetailsDao comparisonDetailsDao; + + @Autowired + public void setGeneralDataDao(IComparisonDao dao) { + this.comparisonDao = dao; + this.dao = dao; + } + + //分页查询档案对照数据 + @Override + public JsonResultEntity queryEntityPage(JSONObject json) { + JSONObject jsonObject = json.getJSONObject("jsonStr"); + if (jsonObject == null) { + return BaseResult.getFailureMessageEntity("数据为空,请先传递数据"); + } + if (!checkStr(jsonObject.getString("mdmCode"))) { + return BaseResult.getFailureMessageEntity("主数据编码为空"); + } + ComparisonEntity comparisonEntity = jsonObject.toJavaObject(ComparisonEntity.class); + List comparisonEntities=new ArrayList<>(); + try { + //根据主数据编码查询表名称,字段名称等信息 10001 + comparisonEntities = comparisonDao.queryComparison(comparisonEntity); + }catch (Exception e){ + logger.info("根据主数据编码查询信息错误:{}",e.getMessage()); + return BaseResult.getFailureMessageEntity("查询失败",e.getMessage()); + } + Map map = new HashMap<>();//将主表数据存到map中 + if (comparisonEntities != null && comparisonEntities.size() > 0) { + for (ComparisonEntity entity : comparisonEntities) { + //遍历主表下面的所有key,字段名 + for (String key : jsonObject.keySet()) { + if (entity.getDbType().equals("1")) { + comparisonEntity.setDbName(entity.getDbName()); + if(!"mdmCode".equals(key)){ + map.put(key, jsonObject.getString(key)); + } + } + } + } + comparisonEntity.setMap(map); + try { + List comparisonEntitiePages = comparisonDao.queryComparisonPage(comparisonEntity); + PageInfo pageInfo = new PageInfo(comparisonEntitiePages); + return BaseResult.getSuccessMessageEntity("查询成功", pageInfo); + } catch (Exception e) { + logger.info("查询档案对照错误:{}", e.getMessage()); + return BaseResult.getFailureMessageEntity("查询失败", e.getMessage()); + } + } + return BaseResult.getFailureMessageEntity("查询失败","请检查传递参数"); + } + + //新增档案对照数据 + @Override + public JsonResultEntity saveEntity(JSONObject json) { + JSONObject jsonObject = json.getJSONObject("jsonStr"); + if (jsonObject == null) { + return BaseResult.getFailureMessageEntity("数据为空,请先传递数据"); + } + if (!checkStr(jsonObject.getString("mdmCode"))) { + 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<>(); + try { + //根据主数据编码查询表名称,字段名称等信息 10001 + comparisonEntities = comparisonDao.queryComparison(comparisonEntity); + }catch (Exception e){ + logger.info("根据主数据编码查询信息错误:{}",e.getMessage()); + return BaseResult.getFailureMessageEntity("保存失败",e.getMessage()); + } + String main = jsonObject.getString("main");//获取主表数据 + JSONArray jsonArray = jsonObject.getJSONArray("details");//获取子表数据 + JSONObject jsonObjectMain = JSONObject.parseObject(main); + if(jsonObjectMain != null ) { + Map map = new HashMap<>();//将主表数据存到map中 + Map mapDetails = new HashMap<>();//将子表数据存到map中 + if (comparisonEntities != null && comparisonEntities.size() > 0) { + for (ComparisonEntity entity : comparisonEntities) { + //遍历主表下面的所有key,字段名 + for (String key : jsonObjectMain.keySet()) { + if (entity.getDbType().equals("1")) { + comparisonEntity.setDbName(entity.getDbName()); + map.put(key, jsonObjectMain.getString(key)); + } + } + } + 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()); + mapDetails.put(key, jsonObjectDetails.getString(key)); + } + } + } + } + } + String uuid = UUIDUtils.getUUID(); + map.put("id", uuid); + 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"); + comparisonEntity.setMap(map); + //生成单据规则 + comparisonEntity.setRulePrefix(jsonObject.getString("rulePrefix")); + try { + ComparisonEntity comparisonEntityRule = comparisonDao.queryComparisonRule(comparisonEntity); + map.put("document_rule", comparisonEntityRule.getDocumentRule());//单据规则 + map.put("document_rule_num", comparisonEntityRule.getDocumentRuleNum());//单据规则流水号 + } catch (Exception e) { + logger.info("保存档案对照时候生成单据规则错误:{}", e.getMessage()); + return BaseResult.getFailureMessageEntity("保存失败", e.getMessage()); + } + try { + //保存主表数据 + ComparisonEntity comparisonEntityOne = comparisonDao.saveComparison(comparisonEntity); + //保存子表数据 + if (mapDetails != null && mapDetails.size() > 0) { + mapDetails.put("id", UUIDUtils.getUUID()); + 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"); + comparisonDetailsEntity.setMapDetails(mapDetails); + ComparisonDetailsEntity comparisonDetailsEntityOne = comparisonDetailsDao.saveComparisonDetails(comparisonDetailsEntity); + comparisonEntityOne.setComparisonDetailsEntity(comparisonDetailsEntityOne); + } + return BaseResult.getSuccessMessageEntity("保存成功", comparisonEntityOne); + } catch (Exception e) { + logger.info("保存档案对照时候错误:{}", e.getMessage()); + return BaseResult.getFailureMessageEntity("保存失败", e.getMessage()); + } + } + } + return BaseResult.getFailureMessageEntity("查询失败","请检查传递参数"); + } + + //更新档案对照数据 + @Override + public JsonResultEntity updateEntity(JSONObject json) { + JSONObject jsonObject = json.getJSONObject("jsonStr"); + if (jsonObject == null) { + return BaseResult.getFailureMessageEntity("数据为空,请先传递数据"); + } + if (!checkStr(jsonObject.getString("mdmCode"))) { + return BaseResult.getFailureMessageEntity("主数据编码为空"); + } + 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 { + comparisonEntities = comparisonDao.queryComparison(comparisonEntity); + }catch (Exception e){ + logger.info("根据主数据编码查询信息错误:{}",e.getMessage()); + return BaseResult.getFailureMessageEntity("更新失败",e.getMessage()); + } + Map map=new HashMap<>();//将主表数据存到map中 + Map mapDetails=new HashMap<>();//将子表数据存到map中 + if(comparisonEntities !=null && comparisonEntities.size()>0) { + for (ComparisonEntity entity : comparisonEntities) { + //遍历主表下面的所有key,字段名 + for (String key : jsonObjectMain.keySet()) { + if (entity.getDbType().equals("1")) { + comparisonEntity.setDbName(entity.getDbName()); + map.put(key, jsonObjectMain.getString(key)); + } + } + } + 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()); + mapDetails.put(key, jsonObjectDetails.getString(key)); + } + } + } + } + } + map.put("create_user_id", "c796fd9ba4c9f5ff3cc2fa41a040e443"); + map.put("modify_user_id", "c796fd9ba4c9f5ff3cc2fa41a040e443"); + map.put("org_id", "0"); + map.put("modify_time", new Date()); + map.put("sts", "Y"); + comparisonEntity.setMap(map); + comparisonEntity.setId(jsonObjectMain.getString("id")); + /*//生成单据规则 + comparisonEntity.setRulePrefix(jsonObject.getString("rulePrefix")); + try { + ComparisonEntity comparisonEntityRule = comparisonDao.queryComparisonRule(comparisonEntity); + map.put("document_rule",comparisonEntityRule.getDocumentRule());//单据规则 + map.put("document_rule_num",comparisonEntityRule.getDocumentRuleNum());//单据规则流水号 + }catch (Exception e){ + logger.info("更新档案对照时候生成单据规则错误:{}",e.getMessage()); + return BaseResult.getFailureMessageEntity("更新失败",e.getMessage()); + }*/ + try { + //保存主表数据 + Integer integer = comparisonDao.updateComparisonByType(comparisonEntity); + 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"); + comparisonDetailsEntity.setFormmainId(jsonObjectMain.getString("id")); + comparisonDetailsEntity.setMapDetails(mapDetails); + comparisonDetailsDao.updateComparisonDetailsByType(comparisonDetailsEntity); + return BaseResult.getSuccessMessageEntity("更新成功", integer); + } + }else{ + return BaseResult.getFailureMessageEntity("更新失败", "请查看id是否在表中存在"); + } + } catch (Exception e) { + logger.info("更新档案对照时候错误:{}", e.getMessage()); + return BaseResult.getFailureMessageEntity("更新失败", e.getMessage()); + } + } + return BaseResult.getFailureMessageEntity("查询失败","请检查传递参数"); + } + + //删除当初对照数据 + @Override + public JsonResultEntity deleteEntity(JSONObject json) { + JSONObject jsonObject = json.getJSONObject("jsonStr"); + if (jsonObject == null) { + return BaseResult.getFailureMessageEntity("数据为空,请先传递数据"); + } + if (!checkStr(jsonObject.getString("mdmCode"))) { + return BaseResult.getFailureMessageEntity("主数据编码为空"); + } + ComparisonEntity comparisonEntity = jsonObject.toJavaObject(ComparisonEntity.class); + ComparisonDetailsEntity comparisonDetailsEntity=new ComparisonDetailsEntity(); + JSONObject jsonObjectMain=jsonObject.getJSONObject("main");//获取主表数据 + if(!checkStr(jsonObjectMain.getString("id"))){ + return BaseResult.getFailureMessageEntity("删除时候主表id不能为空"); + } + List comparisonEntities=new ArrayList<>(); + //根据主数据编码查询表名称,字段名称等信息 10001 + try { + comparisonEntities = comparisonDao.queryComparison(comparisonEntity); + }catch (Exception e){ + logger.info("根据主数据编码查询信息错误:{}",e.getMessage()); + return BaseResult.getFailureMessageEntity("删除失败",e.getMessage()); + } + Map map=new HashMap<>(); + if(comparisonEntities !=null && comparisonEntities.size()>0) { + for (ComparisonEntity entity : comparisonEntities) { + //遍历主表下面的所有key,字段名 + for (String key : jsonObjectMain.keySet()) { + if (entity.getDbType().equals("1")) { + comparisonEntity.setDbName(entity.getDbName()); + map.put(key, jsonObjectMain.getString(key)); + } + if(entity.getDbType().equals("2")){ + comparisonDetailsEntity.setDbName(entity.getDbName()); + } + } + } + comparisonEntity.setId(jsonObjectMain.getString("id")); + comparisonEntity.setModify_user_id("c796fd9ba4c9f5ff3cc2fa41a040e443"); + comparisonEntity.setMap(map); + try { + Integer integer = comparisonDao.deleteComparison(comparisonEntity); + if(integer>0){ + comparisonDetailsEntity.setFormmainId(jsonObjectMain.getString("id")); + comparisonDetailsEntity.setModify_user_id("c796fd9ba4c9f5ff3cc2fa41a040e443"); + comparisonDetailsDao.deleteComparisonDetails(comparisonDetailsEntity); + return BaseResult.getSuccessMessageEntity("删除成功",integer); + }else{ + return BaseResult.getFailureMessageEntity("删除失败","请查看id是否在表中存在"); + } + }catch (Exception e){ + logger.info("删除档案对照数据错误:{}",e.getMessage()); + return BaseResult.getFailureMessageEntity("删除失败",e.getMessage()); + } + } + return BaseResult.getFailureMessageEntity("查询失败","请检查传递参数"); + } +} From 587c969243cd3abacd3b0fc21c3e76a641f088c0 Mon Sep 17 00:00:00 2001 From: hecan <1718492867@qq.com> Date: Mon, 27 May 2024 11:22:38 +0800 Subject: [PATCH 04/80] =?UTF-8?q?=E9=80=9A=E7=94=A8=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../generalData/dao/IGeneralDataDao.java | 49 ++++ .../dao/impl/GeneralDataDaoImpl.java | 40 +++ .../generalData/entity/GeneralDataEntity.java | 169 ++++++++++++ .../generalData/entity/GeneralDataEntity.xml | 258 ++++++++++++++++++ .../service/IGeneralDataService.java | 59 ++++ .../service/impl/GeneralDataServiceImpl.java | 241 ++++++++++++++++ 6 files changed, 816 insertions(+) create mode 100644 service/src/main/java/com/hzya/frame/sysnew/generalData/dao/IGeneralDataDao.java create mode 100644 service/src/main/java/com/hzya/frame/sysnew/generalData/dao/impl/GeneralDataDaoImpl.java create mode 100644 service/src/main/java/com/hzya/frame/sysnew/generalData/entity/GeneralDataEntity.java create mode 100644 service/src/main/java/com/hzya/frame/sysnew/generalData/entity/GeneralDataEntity.xml create mode 100644 service/src/main/java/com/hzya/frame/sysnew/generalData/service/IGeneralDataService.java create mode 100644 service/src/main/java/com/hzya/frame/sysnew/generalData/service/impl/GeneralDataServiceImpl.java diff --git a/service/src/main/java/com/hzya/frame/sysnew/generalData/dao/IGeneralDataDao.java b/service/src/main/java/com/hzya/frame/sysnew/generalData/dao/IGeneralDataDao.java new file mode 100644 index 00000000..ec391b3a --- /dev/null +++ b/service/src/main/java/com/hzya/frame/sysnew/generalData/dao/IGeneralDataDao.java @@ -0,0 +1,49 @@ +package com.hzya.frame.sysnew.generalData.dao; + +import com.hzya.frame.basedao.dao.IBaseDao; +import com.hzya.frame.sysnew.generalData.entity.GeneralDataEntity; + +import java.util.List; + +public interface IGeneralDataDao extends IBaseDao { + + /** + * + * @content 新增通用数据 + * @Param + * @Return + * @Author hecan + * @Date 2024/5/6 16:49 + * **/ + GeneralDataEntity saveGeneralDataByType(GeneralDataEntity generalDataEntity); + + /** + * + * @content 查询通用数据 + * @Param + * @Return + * @Author hecan + * @Date 2024/5/6 16:51 + * **/ + List queryGeneralData(GeneralDataEntity generalDataEntity); + + /** + * + * @content 编辑通用数据 + * @Param + * @Return + * @Author hecan + * @Date 2024/5/6 17:17 + * **/ + Integer updateGeneralDataByType(GeneralDataEntity generalDataEntity); + + /** + * + * @content 删除通用数据 + * @Param + * @Return + * @Author hecan + * @Date 2024/5/6 17:20 + * **/ + Integer deleteGeneralDataByType(GeneralDataEntity generalDataEntity); +} diff --git a/service/src/main/java/com/hzya/frame/sysnew/generalData/dao/impl/GeneralDataDaoImpl.java b/service/src/main/java/com/hzya/frame/sysnew/generalData/dao/impl/GeneralDataDaoImpl.java new file mode 100644 index 00000000..b94f80c0 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/sysnew/generalData/dao/impl/GeneralDataDaoImpl.java @@ -0,0 +1,40 @@ +package com.hzya.frame.sysnew.generalData.dao.impl; + +import com.hzya.frame.basedao.dao.MybatisGenericDao; +import com.hzya.frame.sysnew.generalData.dao.IGeneralDataDao; +import com.hzya.frame.sysnew.generalData.entity.GeneralDataEntity; +import org.springframework.stereotype.Repository; + +import java.util.List; + + +@Repository(value = "generalDataDaoImpl") +public class GeneralDataDaoImpl extends MybatisGenericDao implements IGeneralDataDao { + //新增通用数据 + @Override + public GeneralDataEntity saveGeneralDataByType(GeneralDataEntity generalDataEntity) { + generalDataEntity = super.save(getSqlIdPrifx() + "saveGeneralDataByType", generalDataEntity); + return generalDataEntity; + } + + //查询通用数据 + @Override + public List queryGeneralData(GeneralDataEntity generalDataEntity) { + List query = super.query(getSqlIdPrifx() + "queryGeneralData", generalDataEntity); + return query; + } + + //编辑通用数据 + @Override + public Integer updateGeneralDataByType(GeneralDataEntity generalDataEntity) { + int update = super.update(getSqlIdPrifx() + "updateGeneralDataByType", generalDataEntity); + return update; + } + + //删除通用数据 + @Override + public Integer deleteGeneralDataByType(GeneralDataEntity generalDataEntity) { + int update = super.update(getSqlIdPrifx() + "deleteGeneralDataByType", generalDataEntity); + return update; + } +} diff --git a/service/src/main/java/com/hzya/frame/sysnew/generalData/entity/GeneralDataEntity.java b/service/src/main/java/com/hzya/frame/sysnew/generalData/entity/GeneralDataEntity.java new file mode 100644 index 00000000..5aef2e9f --- /dev/null +++ b/service/src/main/java/com/hzya/frame/sysnew/generalData/entity/GeneralDataEntity.java @@ -0,0 +1,169 @@ +package com.hzya.frame.sysnew.generalData.entity; + +import com.hzya.frame.web.entity.BaseEntity; + +/** + * + * @content 通用数据接口实体类 + * @Param + * @Return + * @Author hecan + * @Date 2024/5/6 16:21 + * **/ +public class GeneralDataEntity extends BaseEntity { + private String archivesType;//类型 + private String leftCode;//左编码 + private String rightCode;//右编码 + + private String leftAppId;//左应用id + private String leftAppCode;//左应用编码 + private String leftAppName;//左应用名称 + private String leftApiId;//左接口ID + private String leftId;//左id + private String leftName;//左名称 + private String rightAppId;//右应用id + private String rightAppCode;//右应用编码 + private String rightAppName;//右应用名称 + private String rightApiId;//右接口ID + private String rightId;//右id + private String rightName;//右名称 + + private String leftOrg;//左公司 + private String rightOrg;//右公司 + + public String getLeftOrg() { + return leftOrg; + } + + public void setLeftOrg(String leftOrg) { + this.leftOrg = leftOrg; + } + + public String getRightOrg() { + return rightOrg; + } + + public void setRightOrg(String rightOrg) { + this.rightOrg = rightOrg; + } + + public String getArchivesType() { + return archivesType; + } + + public void setArchivesType(String archivesType) { + this.archivesType = archivesType; + } + + public String getLeftCode() { + return leftCode; + } + + public void setLeftCode(String leftCode) { + this.leftCode = leftCode; + } + + public String getRightCode() { + return rightCode; + } + + public void setRightCode(String rightCode) { + this.rightCode = rightCode; + } + + public String getLeftAppId() { + return leftAppId; + } + + public void setLeftAppId(String leftAppId) { + this.leftAppId = leftAppId; + } + + public String getLeftAppCode() { + return leftAppCode; + } + + public void setLeftAppCode(String leftAppCode) { + this.leftAppCode = leftAppCode; + } + + public String getLeftAppName() { + return leftAppName; + } + + public void setLeftAppName(String leftAppName) { + this.leftAppName = leftAppName; + } + + public String getLeftApiId() { + return leftApiId; + } + + public void setLeftApiId(String leftApiId) { + this.leftApiId = leftApiId; + } + + public String getLeftId() { + return leftId; + } + + public void setLeftId(String leftId) { + this.leftId = leftId; + } + + public String getLeftName() { + return leftName; + } + + public void setLeftName(String leftName) { + this.leftName = leftName; + } + + public String getRightAppId() { + return rightAppId; + } + + public void setRightAppId(String rightAppId) { + this.rightAppId = rightAppId; + } + + public String getRightAppCode() { + return rightAppCode; + } + + public void setRightAppCode(String rightAppCode) { + this.rightAppCode = rightAppCode; + } + + public String getRightAppName() { + return rightAppName; + } + + public void setRightAppName(String rightAppName) { + this.rightAppName = rightAppName; + } + + public String getRightApiId() { + return rightApiId; + } + + public void setRightApiId(String rightApiId) { + this.rightApiId = rightApiId; + } + + public String getRightId() { + return rightId; + } + + public void setRightId(String rightId) { + this.rightId = rightId; + } + + public String getRightName() { + return rightName; + } + + public void setRightName(String rightName) { + this.rightName = rightName; + } +} diff --git a/service/src/main/java/com/hzya/frame/sysnew/generalData/entity/GeneralDataEntity.xml b/service/src/main/java/com/hzya/frame/sysnew/generalData/entity/GeneralDataEntity.xml new file mode 100644 index 00000000..50065a16 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/sysnew/generalData/entity/GeneralDataEntity.xml @@ -0,0 +1,258 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + insert into + + sys_personnel_control + sys_org_control + sys_stock_control + sys_merchant_control + sys_taxrate_control + sys_project_control + sys_bank_control + sys_bankaccount_control + sys_assets_control + + ( + + id , + left_app_id , + left_app_code , + left_app_name , + left_api_id , + left_id , + left_code , + left_name , + right_app_id , + right_app_code , + right_app_name , + right_api_id , + right_id , + right_code , + right_name , + left_org , + right_org , + sorts , + create_user_id , + modify_user_id , + org_id , + company_id , + create_time, + modify_time, + sts + + )values( + + #{id} , + #{leftAppId} , + #{leftAppCode} , + #{leftAppName} , + #{leftApiId} , + #{leftId} , + #{leftCode} , + #{leftName} , + #{rightAppId} , + #{rightAppCode} , + #{rightAppName} , + #{rightApiId} , + #{rightId} , + #{rightCode} , + #{rightName} , + #{leftOrg} , + #{rightOrg} , + #{sorts} , + (select (max(IFNULL( a.sorts, 0 )) + 1) as sort from + + sys_personnel_control + sys_org_control + sys_stock_control + sys_merchant_control + sys_taxrate_control + sys_project_control + sys_bank_control + sys_bankaccount_control + sys_assets_control + + a WHERE a.sts = 'Y' ), + #{create_user_id} , + #{modify_user_id} , + #{org_id} , + #{companyId} , + #{create_time} , + now() , + #{modify_time} , + now() , + #{sts} , + 'Y' + + ) + + + + + update + + sys_personnel_control + sys_org_control + sys_stock_control + sys_merchant_control + sys_taxrate_control + sys_project_control + sys_bank_control + sys_bankaccount_control + sys_assets_control + + set + + left_app_id = #{leftAppId}, + left_app_code = #{leftAppCode}, + left_app_name = #{leftAppName}, + left_api_id = #{leftApiId}, + left_id = #{leftId}, + left_code = #{leftCode}, + left_name = #{leftName}, + right_app_id = #{rightAppId}, + right_app_code = #{rightAppCode}, + right_app_name = #{rightAppName}, + right_api_id = #{rightApiId}, + right_id = #{rightId}, + right_code = #{rightCode}, + right_name = #{rightName}, + left_org = #{leftOrg} , + right_org = #{rightOrg} , + sorts = #{sorts}, + create_user_id = #{create_user_id}, + create_time = #{create_time}, + modify_user_id = #{modify_user_id}, + modify_time = #{modify_time}, + modify_time = now(), + sts = #{sts}, + org_id = #{org_id}, + company_id = #{companyId} + + where id = #{id} + + + + + update + + sys_personnel_control + sys_org_control + sys_stock_control + sys_merchant_control + sys_taxrate_control + sys_project_control + sys_bank_control + sys_bankaccount_control + sys_assets_control + + set sts= 'N' ,modify_time = now(),modify_user_id = #{modify_user_id} + + and left_app_id = #{leftAppId} + and left_app_code = #{leftAppCode} + and left_app_name = #{leftAppName} + and left_api_id = #{leftApiId} + and left_id = #{leftId} + and left_code = #{leftCode} + and left_name = #{leftName} + and right_app_id = #{rightAppId} + and right_app_code = #{rightAppCode} + and right_app_name = #{rightAppName} + and right_api_id = #{rightApiId} + and right_id = #{rightId} + and right_code = #{rightCode} + and right_name = #{rightName} + left_org = #{leftOrg} , + right_org = #{rightOrg} , + and sorts = #{sorts} + and sts = #{sts} + and company_id = #{companyId} + and id=#{id} and sts='Y' + + + + + diff --git a/service/src/main/java/com/hzya/frame/sysnew/generalData/service/IGeneralDataService.java b/service/src/main/java/com/hzya/frame/sysnew/generalData/service/IGeneralDataService.java new file mode 100644 index 00000000..df8dbd47 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/sysnew/generalData/service/IGeneralDataService.java @@ -0,0 +1,59 @@ +package com.hzya.frame.sysnew.generalData.service; + +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.basedao.service.IBaseService; +import com.hzya.frame.sysnew.generalData.entity.GeneralDataEntity; +import com.hzya.frame.web.entity.JsonResultEntity; + +public interface IGeneralDataService extends IBaseService { + + /** + * + * @content 新增通用数据 + * @Param + * @Return + * @Author hecan + * @Date 2024/5/6 16:23 + * **/ + JsonResultEntity saveEntity(JSONObject jsonObject); + + /** + * + * @content 查询通用数据 + * @Param + * @Return + * @Author hecan + * @Date 2024/5/6 17:00 + * **/ + JsonResultEntity queryEntityPage(JSONObject jsonObject); + + /** + * + * @content 编辑通用数据 + * @Param + * @Return + * @Author hecan + * @Date 2024/5/6 17:16 + * **/ + JsonResultEntity updateEntity(JSONObject jsonObject); + + /** + * + * @content 删除通用数据 + * @Param + * @Return + * @Author hecan + * @Date 2024/5/6 17:23 + * **/ + JsonResultEntity deleteEntity(JSONObject jsonObject); + + /** + * + * @content 查询单个通用数据 + * @Param + * @Return + * @Author hecan + * @Date 2024/5/6 17:26 + * **/ + JsonResultEntity getEntity(JSONObject jsonObject); +} diff --git a/service/src/main/java/com/hzya/frame/sysnew/generalData/service/impl/GeneralDataServiceImpl.java b/service/src/main/java/com/hzya/frame/sysnew/generalData/service/impl/GeneralDataServiceImpl.java new file mode 100644 index 00000000..72a1778a --- /dev/null +++ b/service/src/main/java/com/hzya/frame/sysnew/generalData/service/impl/GeneralDataServiceImpl.java @@ -0,0 +1,241 @@ +package com.hzya.frame.sysnew.generalData.service.impl; + +import com.alibaba.fastjson.JSONObject; +import com.github.pagehelper.PageInfo; +import com.hzya.frame.basedao.service.impl.BaseService; +import com.hzya.frame.sysnew.generalData.dao.IGeneralDataDao; +import com.hzya.frame.sysnew.generalData.entity.GeneralDataEntity; +import com.hzya.frame.sysnew.generalData.service.IGeneralDataService; +import com.hzya.frame.sysnew.homeComponent.dao.ISysHomeComponentDao; +import com.hzya.frame.uuid.UUIDLong; +import com.hzya.frame.uuid.UUIDUtils; +import com.hzya.frame.web.entity.BaseResult; +import com.hzya.frame.web.entity.JsonResultEntity; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.Arrays; +import java.util.List; + +@Service(value = "generalDataServiceImpl") +public class GeneralDataServiceImpl extends BaseService implements IGeneralDataService { + private IGeneralDataDao generalDataDao; + + @Autowired + public void setGeneralDataDao(IGeneralDataDao dao) { + this.generalDataDao = dao; + this.dao = dao; + } + + //新增通用数据 + @Override + public JsonResultEntity saveEntity(JSONObject json) { + JSONObject jsonObject = json.getJSONObject("jsonStr"); + if(jsonObject == null ){ + return BaseResult.getFailureMessageEntity("数据为空,请先传递数据"); + } + if(!checkStr(jsonObject.getString("archivesType"))){ + return BaseResult.getFailureMessageEntity("通用数据类型为空"); + } + if(!checkStr(jsonObject.getString("leftCode"))){ + return BaseResult.getFailureMessageEntity("左编码为空"); + } + if(!checkStr(jsonObject.getString("rightCode"))){ + return BaseResult.getFailureMessageEntity("右编码为空"); + } + if(!checkStr(jsonObject.getString("leftAppCode"))){ + return BaseResult.getFailureMessageEntity("左应用编码为空"); + } + if(!checkStr(jsonObject.getString("rightAppCode"))){ + return BaseResult.getFailureMessageEntity("右应用编码为空"); + } + List fzhs = Arrays.asList(new String[]{"1", "2", "6", "73", "D01" , "jobass" , "93" , "96", "22"}); + if(!fzhs.contains(jsonObject.getString("archivesType"))){ + return BaseResult.getFailureMessageEntity("档案类型错误,请联系管理员"); + } + /* switch (jsonObject.getString("archivesType")){ + case "1"://人员对照 + GeneralDataEntity generalDataEntityPersonnel = jsonObject.toJavaObject(GeneralDataEntity.class); + generalDataDao.saveGeneralDataByType(generalDataEntityPersonnel); + break; + case "2"://部门档案 + GeneralDataEntity generalDataEntityOrg = jsonObject.toJavaObject(GeneralDataEntity.class); + generalDataDao.saveGeneralDataByType(generalDataEntityOrg); + break; + case "6"://存货对照 + GeneralDataEntity generalDataEntityStock = jsonObject.toJavaObject(GeneralDataEntity.class); + generalDataDao.saveGeneralDataByType(generalDataEntityStock); + break; + case "73"://客商辅助核算 + GeneralDataEntity generalDataEntityMerchant = jsonObject.toJavaObject(GeneralDataEntity.class); + generalDataDao.saveGeneralDataByType(generalDataEntityMerchant); + break; + case "D01"://税率 + GeneralDataEntity generalDataEntityTaxrate = jsonObject.toJavaObject(GeneralDataEntity.class); + generalDataDao.saveGeneralDataByType(generalDataEntityTaxrate); + break; + case "jobass"://项目辅助核算 + GeneralDataEntity generalDataEntityProject = jsonObject.toJavaObject(GeneralDataEntity.class); + generalDataDao.saveGeneralDataByType(generalDataEntityProject); + break; + case "93"://银行类别 + GeneralDataEntity generalDataEntityBank = jsonObject.toJavaObject(GeneralDataEntity.class); + generalDataDao.saveGeneralDataByType(generalDataEntityBank); + break; + case "96"://银行账户 + GeneralDataEntity generalDataEntityBankaccount = jsonObject.toJavaObject(GeneralDataEntity.class); + generalDataDao.saveGeneralDataByType(generalDataEntityBankaccount); + break; + case "22"://资产类别 + GeneralDataEntity generalDataEntityAssets = jsonObject.toJavaObject(GeneralDataEntity.class); + generalDataDao.saveGeneralDataByType(generalDataEntityAssets); + break; + default: + break; + }*/ + GeneralDataEntity generalDataEntity = jsonObject.toJavaObject(GeneralDataEntity.class); + generalDataEntity.setId(UUIDUtils.getUUID()); + generalDataEntity.setCreate_user_id("1"); + generalDataEntity.setModify_user_id("1"); + generalDataEntity.setOrg_id("0"); + generalDataEntity.setCompanyId("0"); + try { + GeneralDataEntity generalDataEntitySave = generalDataDao.saveGeneralDataByType(generalDataEntity); + return BaseResult.getSuccessMessageEntity("新增成功",generalDataEntitySave); + }catch (Exception e){ + logger.info("通用数据新增错误:{}",e.getMessage()); + return BaseResult.getFailureMessageEntity("新增失败",e.getMessage()); + } + } + + //查询通用数据 + @Override + public JsonResultEntity queryEntityPage(JSONObject json) { + JSONObject jsonObject = json.getJSONObject("jsonStr"); + if(jsonObject == null ){ + return BaseResult.getFailureMessageEntity("数据为空,请先传递数据"); + } + if(!checkStr(jsonObject.getString("archivesType"))){ + return BaseResult.getFailureMessageEntity("通用数据类型为空"); + } + /*if(!checkStr(jsonObject.getString("leftCode"))){ + return BaseResult.getFailureMessageEntity("左编码为空"); + } + if(!checkStr(jsonObject.getString("rightCode"))){ + return BaseResult.getFailureMessageEntity("右编码为空"); + }*/ + List fzhs = Arrays.asList(new String[]{"1", "2", "6", "73", "D01" , "jobass" , "93" , "96", "22"}); + if(!fzhs.contains(jsonObject.getString("archivesType"))){ + return BaseResult.getFailureMessageEntity("档案类型错误,请联系管理员"); + } + GeneralDataEntity generalDataEntity = jsonObject.toJavaObject(GeneralDataEntity.class); + try { + List generalDataEntities = generalDataDao.queryGeneralData(generalDataEntity); + PageInfo pageInfo=new PageInfo(generalDataEntities); + return BaseResult.getSuccessMessageEntity("查询成功",pageInfo); + }catch (Exception e){ + logger.info("通用数据查询错误:{}",e.getMessage()); + return BaseResult.getFailureMessageEntity("查询失败",e.getMessage()); + } + } + + //编辑通用数据 + @Override + public JsonResultEntity updateEntity(JSONObject json) { + JSONObject jsonObject = json.getJSONObject("jsonStr"); + if(jsonObject == null ){ + return BaseResult.getFailureMessageEntity("数据为空,请先传递数据"); + } + if(!checkStr(jsonObject.getString("id"))){ + return BaseResult.getFailureMessageEntity("id为空"); + } + if(!checkStr(jsonObject.getString("archivesType"))){ + return BaseResult.getFailureMessageEntity("通用数据类型为空"); + } + /*if(!checkStr(jsonObject.getString("leftCode"))){ + return BaseResult.getFailureMessageEntity("左编码为空"); + } + if(!checkStr(jsonObject.getString("rightCode"))){ + return BaseResult.getFailureMessageEntity("右编码为空"); + } + if(!checkStr(jsonObject.getString("leftAppCode"))){ + return BaseResult.getFailureMessageEntity("左应用编码为空"); + } + if(!checkStr(jsonObject.getString("rightAppCode"))){ + return BaseResult.getFailureMessageEntity("右应用编码为空"); + }*/ + List fzhs = Arrays.asList(new String[]{"1", "2", "6", "73", "D01" , "jobass" , "93" , "96", "22"}); + if(!fzhs.contains(jsonObject.getString("archivesType"))){ + return BaseResult.getFailureMessageEntity("档案类型错误,请联系管理员"); + } + GeneralDataEntity generalDataEntity = jsonObject.toJavaObject(GeneralDataEntity.class); + try { + generalDataDao.updateGeneralDataByType(generalDataEntity); + return BaseResult.getSuccessMessageEntity("编辑成功"); + }catch (Exception e){ + logger.info("通用数据编辑失败:{}",e.getMessage()); + return BaseResult.getFailureMessageEntity("编辑失败",e.getMessage()); + } + } + + //删除通用数据 + @Override + public JsonResultEntity deleteEntity(JSONObject json) { + JSONObject jsonObject = json.getJSONObject("jsonStr"); + if(jsonObject == null ){ + return BaseResult.getFailureMessageEntity("数据为空,请先传递数据"); + } + if(!checkStr(jsonObject.getString("id"))){ + return BaseResult.getFailureMessageEntity("id为空"); + } + if(!checkStr(jsonObject.getString("archivesType"))){ + return BaseResult.getFailureMessageEntity("通用数据类型为空"); + } + /*if(!checkStr(jsonObject.getString("leftCode"))){ + return BaseResult.getFailureMessageEntity("左编码为空"); + } + if(!checkStr(jsonObject.getString("rightCode"))){ + return BaseResult.getFailureMessageEntity("右编码为空"); + } + if(!checkStr(jsonObject.getString("leftAppCode"))){ + return BaseResult.getFailureMessageEntity("左应用编码为空"); + } + if(!checkStr(jsonObject.getString("rightAppCode"))){ + return BaseResult.getFailureMessageEntity("右应用编码为空"); + }*/ + List fzhs = Arrays.asList(new String[]{"1", "2", "6", "73", "D01" , "jobass" , "93" , "96", "22"}); + if(!fzhs.contains(jsonObject.getString("archivesType"))){ + return BaseResult.getFailureMessageEntity("档案类型错误,请联系管理员"); + } + GeneralDataEntity generalDataEntity = jsonObject.toJavaObject(GeneralDataEntity.class); + try { + generalDataEntity.setCreate_user_id("1"); + generalDataEntity.setModify_user_id("1"); + generalDataDao.deleteGeneralDataByType(generalDataEntity); + return BaseResult.getSuccessMessageEntity("删除成功"); + }catch (Exception e){ + logger.info("通用数据删除失败:{}",e.getMessage()); + return BaseResult.getFailureMessageEntity("删除失败",e.getMessage()); + } + } + + //查询单个通用数据对象 + @Override + public JsonResultEntity getEntity(JSONObject json) { + JSONObject jsonObject = json.getJSONObject("jsonStr"); + if(jsonObject == null ){ + return BaseResult.getFailureMessageEntity("数据为空,请先传递数据"); + } + if(!checkStr(jsonObject.getString("id"))){ + return BaseResult.getFailureMessageEntity("id为空"); + } + GeneralDataEntity generalDataEntity = jsonObject.toJavaObject(GeneralDataEntity.class); + try { + GeneralDataEntity generalDataEntityOne = generalDataDao.queryOne(generalDataEntity); + return BaseResult.getSuccessMessageEntity("查询单个成功",generalDataEntityOne); + }catch (Exception e){ + logger.info("查询单个通用数据错误:{}",e.getMessage()); + return BaseResult.getSuccessMessageEntity("查询单个失败",e.getMessage()); + } + } +} From d6f4e5febb135abcbae2690f63fb5ee9db0a02eb Mon Sep 17 00:00:00 2001 From: hecan <1718492867@qq.com> Date: Wed, 29 May 2024 17:20:12 +0800 Subject: [PATCH 05/80] =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=BA=93=E8=BF=9E=E6=8E=A5=E5=9C=B0=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- buildpackage/src/main/resources/application-hclocal.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildpackage/src/main/resources/application-hclocal.yml b/buildpackage/src/main/resources/application-hclocal.yml index 995c4368..b88db817 100644 --- a/buildpackage/src/main/resources/application-hclocal.yml +++ b/buildpackage/src/main/resources/application-hclocal.yml @@ -18,7 +18,7 @@ spring: # driver-class-name: com.mysql.jdbc.Driver # 3.2.0开始支持SPI可省略此配置 url: jdbc:mysql://hzya.ufyct.com:9014/businesscenter?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF8&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowLoadLocalInfile=false&autoReconnect=true&failOverReadOnly=false&connectTimeout=30000&socketTimeout=30000&autoReconnectForPools=true username: root - password: hzya@1314 + password: 62e4295b615a30dbf3b8ee96f41c820b driver-class-name: com.mysql.jdbc.Driver # 3.2.0开始支持SPI可省略此配置 savefile: # 文件保存路径 From 38b8be27094535fd6b564e43340db60a247912c4 Mon Sep 17 00:00:00 2001 From: hecan <1718492867@qq.com> Date: Wed, 29 May 2024 17:21:14 +0800 Subject: [PATCH 06/80] =?UTF-8?q?=E9=80=9A=E7=94=A8=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sysnew/comparison/dao/IComparisonDao.java | 19 +- .../comparison/dao/IComparisonDetailsDao.java | 9 +- .../dao/impl/ComparisonDaoImpl.java | 16 +- .../dao/impl/ComparisonDetailsDaoImpl.java | 11 +- .../entity/ComparisonDetailsEntity.java | 262 ++------- .../entity/ComparisonDetailsEntity.xml | 23 +- .../comparison/entity/ComparisonEntity.java | 546 +++--------------- .../comparison/entity/ComparisonEntity.xml | 125 ++-- .../service/IComparisonService.java | 8 +- .../service/impl/ComparisonServiceImpl.java | 131 +++-- 10 files changed, 286 insertions(+), 864 deletions(-) diff --git a/service/src/main/java/com/hzya/frame/sysnew/comparison/dao/IComparisonDao.java b/service/src/main/java/com/hzya/frame/sysnew/comparison/dao/IComparisonDao.java index b11a112a..d33044c7 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/comparison/dao/IComparisonDao.java +++ b/service/src/main/java/com/hzya/frame/sysnew/comparison/dao/IComparisonDao.java @@ -6,6 +6,7 @@ import com.hzya.frame.sysnew.comparison.entity.ComparisonDetailsEntity; import com.hzya.frame.sysnew.comparison.entity.ComparisonEntity; import java.util.List; +import java.util.Map; public interface IComparisonDao extends IBaseDao { @@ -27,11 +28,11 @@ public interface IComparisonDao extends IBaseDao { * @Author hecan * @Date 2024/5/9 15:11 * **/ - List queryComparisonPage(ComparisonEntity comparison); + List> queryComparisonPage(ComparisonEntity comparison); /** * - * @content 保存档案对照数据 + * @content 保存通用数据数据 * @Param * @Return * @Author hecan @@ -51,7 +52,7 @@ public interface IComparisonDao extends IBaseDao { /** * - * @content 更新档案对照数据 + * @content 更新通用数据数据 * @Param * @Return * @Author hecan @@ -61,11 +62,21 @@ public interface IComparisonDao extends IBaseDao { /** * - * @content 删除档案对照数据 + * @content 删除通用数据 * @Param * @Return * @Author hecan * @Date 2024/5/9 14:09 * **/ Integer deleteComparison(ComparisonEntity comparison); + + /** + * + * @content 查询单据规则 + * @Param + * @Return + * @Author hecan + * @Date 2024/5/28 14:39 + * **/ + ComparisonEntity queryComparisonById(ComparisonEntity comparison); } diff --git a/service/src/main/java/com/hzya/frame/sysnew/comparison/dao/IComparisonDetailsDao.java b/service/src/main/java/com/hzya/frame/sysnew/comparison/dao/IComparisonDetailsDao.java index 731109c9..36c66021 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/comparison/dao/IComparisonDetailsDao.java +++ b/service/src/main/java/com/hzya/frame/sysnew/comparison/dao/IComparisonDetailsDao.java @@ -5,12 +5,13 @@ import com.hzya.frame.basedao.dao.IBaseDao; import com.hzya.frame.sysnew.comparison.entity.ComparisonDetailsEntity; import java.util.List; +import java.util.Map; public interface IComparisonDetailsDao extends IBaseDao { /** * - * @content 保存档案对照子表数据 + * @content 保存通用数据子表数据 * @Param * @Return * @Author hecan @@ -20,7 +21,7 @@ public interface IComparisonDetailsDao extends IBaseDao queryComparisonDetailsPage(ComparisonDetailsEntity comparisonDetailsEntity); + List> queryComparisonDetailsPage(ComparisonDetailsEntity comparisonDetailsEntity); } diff --git a/service/src/main/java/com/hzya/frame/sysnew/comparison/dao/impl/ComparisonDaoImpl.java b/service/src/main/java/com/hzya/frame/sysnew/comparison/dao/impl/ComparisonDaoImpl.java index 695c3683..63281c12 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/comparison/dao/impl/ComparisonDaoImpl.java +++ b/service/src/main/java/com/hzya/frame/sysnew/comparison/dao/impl/ComparisonDaoImpl.java @@ -7,6 +7,7 @@ import com.hzya.frame.sysnew.comparison.entity.ComparisonEntity; import org.springframework.stereotype.Repository; import java.util.List; +import java.util.Map; @Repository(value = "comparisonDaoImpl") public class ComparisonDaoImpl extends MybatisGenericDao implements IComparisonDao { @@ -19,8 +20,8 @@ public class ComparisonDaoImpl extends MybatisGenericDao queryComparisonPage(ComparisonEntity comparison) { - List query = super.query(getSqlIdPrifx() + "queryComparisonPage", comparison); + public List> queryComparisonPage(ComparisonEntity comparison) { + List> query =(List>) super.selectList(getSqlIdPrifx() + "queryComparisonPage", comparison); return query; } @@ -38,17 +39,24 @@ public class ComparisonDaoImpl extends MybatisGenericDao comparisonEntities = super.query(getSqlIdPrifx() + "queryComparisonById", comparison); + return comparisonEntities.get(0); + } } diff --git a/service/src/main/java/com/hzya/frame/sysnew/comparison/dao/impl/ComparisonDetailsDaoImpl.java b/service/src/main/java/com/hzya/frame/sysnew/comparison/dao/impl/ComparisonDetailsDaoImpl.java index bafc78fe..cab43d0d 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/comparison/dao/impl/ComparisonDetailsDaoImpl.java +++ b/service/src/main/java/com/hzya/frame/sysnew/comparison/dao/impl/ComparisonDetailsDaoImpl.java @@ -9,25 +9,26 @@ import com.hzya.frame.sysnew.comparison.entity.ComparisonEntity; import org.springframework.stereotype.Repository; import java.util.List; +import java.util.Map; @Repository(value = "comparisonDetailsDaoImpl") public class ComparisonDetailsDaoImpl extends MybatisGenericDao implements IComparisonDetailsDao { - //保存档案对照子表数据 + //保存通用数据子表数据 @Override public ComparisonDetailsEntity saveComparisonDetails(ComparisonDetailsEntity comparisonDetailsEntity) { ComparisonDetailsEntity detailsEntity = super.save(getSqlIdPrifx() + "saveComparisonDetails", comparisonDetailsEntity); return detailsEntity; } - //更新档案对照子表数据 + //更新通用数据子表数据 @Override public Integer updateComparisonDetailsByType(ComparisonDetailsEntity comparisonDetailsEntity) { int update = super.update(getSqlIdPrifx()+"updateComparisonDetailsByType", comparisonDetailsEntity); return update; } - //删除档案对照子表的数据 + //删除通用数据子表的数据 @Override public Integer deleteComparisonDetails(ComparisonDetailsEntity comparisonDetailsEntity) { int delete = super.delete(getSqlIdPrifx() + "deleteComparisonDetails", comparisonDetailsEntity); @@ -36,8 +37,8 @@ public class ComparisonDetailsDaoImpl extends MybatisGenericDao queryComparisonDetailsPage(ComparisonDetailsEntity comparisonDetailsEntity) { - List query = super.query(getSqlIdPrifx() + "queryComparisonDetailsPage", comparisonDetailsEntity); + public List> queryComparisonDetailsPage(ComparisonDetailsEntity comparisonDetailsEntity) { + List> query =(List>) super.selectList(getSqlIdPrifx() + "queryComparisonDetailsPage", comparisonDetailsEntity); return query; } 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 11ce420d..5766ec65 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 @@ -9,7 +9,7 @@ import java.util.Map; /** * - * @content 档案对照明细实体类 + * @content 通用数据明细实体类 * @Param * @Return * @Author hecan @@ -20,32 +20,7 @@ public class ComparisonDetailsEntity extends BaseEntity { private String contrastType;//对照类型 private String documentRule;//单据规则 private Long documentRuleNum;//单据规则流水号 - private String sszz;//所属组织 - private String bz;//备注 - private String formmainId;//上级id - private String taskLinvingId;//集成任务-实例_id - private String result;//返回结果 - private String queryCondition;//原始查询条件 - private String rootAppPk;//源系统主键 - private String rootAppBill;//原系统单据 - private String rootAppNewData;//最新源系统数据详情 - private String newTransmitInfo;//最新传输信息 - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") - @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private Date newPushDate;//最新推送时间 - private String repairPust;//是否补推(Y是N不是) - private String senceId;//场景id - private String newState;//最新推送状态 - private String businessDate;//单据业务日期 - private String pluginId;//插件id - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") - @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private Date processingTime;//处理时间 - private String processingRemarks;//处理备注 - private String processorName;//处理⼈名称 - private String processor;//处理⼈ - private String newSystemNumber;//下游系统单号 - private String newSystemPrimary;//下游系统主键 + private String mdmName;//主数据名称 private String mdmCode;//主数据编码 @@ -54,9 +29,42 @@ public class ComparisonDetailsEntity extends BaseEntity { private String enName;//字段名 英文 private String chName;// 字段名 中文 private String filedType;//字段类型 1、BIGINT 2、DECIMAL 3、VARCHAR 4、DATETIME + private String formmainId;//上级id + + public String getFormmainId() { + return formmainId; + } + + public void setFormmainId(String formmainId) { + this.formmainId = formmainId; + } private Map mapDetails; + public String getContrastType() { + return contrastType; + } + + public void setContrastType(String contrastType) { + this.contrastType = contrastType; + } + + public String getDocumentRule() { + return documentRule; + } + + public void setDocumentRule(String documentRule) { + this.documentRule = documentRule; + } + + public Long getDocumentRuleNum() { + return documentRuleNum; + } + + public void setDocumentRuleNum(Long documentRuleNum) { + this.documentRuleNum = documentRuleNum; + } + public String getMdmName() { return mdmName; } @@ -120,204 +128,4 @@ public class ComparisonDetailsEntity extends BaseEntity { public void setMapDetails(Map mapDetails) { this.mapDetails = mapDetails; } - - public String getContrastType() { - return contrastType; - } - - public void setContrastType(String contrastType) { - this.contrastType = contrastType; - } - - public String getDocumentRule() { - return documentRule; - } - - public void setDocumentRule(String documentRule) { - this.documentRule = documentRule; - } - - public Long getDocumentRuleNum() { - return documentRuleNum; - } - - public void setDocumentRuleNum(Long documentRuleNum) { - this.documentRuleNum = documentRuleNum; - } - - public String getSszz() { - return sszz; - } - - public void setSszz(String sszz) { - this.sszz = sszz; - } - - public String getBz() { - return bz; - } - - public void setBz(String bz) { - this.bz = bz; - } - - public String getFormmainId() { - return formmainId; - } - - public void setFormmainId(String formmainId) { - this.formmainId = formmainId; - } - - public String getTaskLinvingId() { - return taskLinvingId; - } - - public void setTaskLinvingId(String taskLinvingId) { - this.taskLinvingId = taskLinvingId; - } - - public String getResult() { - return result; - } - - public void setResult(String result) { - this.result = result; - } - - public String getQueryCondition() { - return queryCondition; - } - - public void setQueryCondition(String queryCondition) { - this.queryCondition = queryCondition; - } - - public String getRootAppPk() { - return rootAppPk; - } - - public void setRootAppPk(String rootAppPk) { - this.rootAppPk = rootAppPk; - } - - public String getRootAppBill() { - return rootAppBill; - } - - public void setRootAppBill(String rootAppBill) { - this.rootAppBill = rootAppBill; - } - - public String getRootAppNewData() { - return rootAppNewData; - } - - public void setRootAppNewData(String rootAppNewData) { - this.rootAppNewData = rootAppNewData; - } - - public String getNewTransmitInfo() { - return newTransmitInfo; - } - - public void setNewTransmitInfo(String newTransmitInfo) { - this.newTransmitInfo = newTransmitInfo; - } - - public Date getNewPushDate() { - return newPushDate; - } - - public void setNewPushDate(Date newPushDate) { - this.newPushDate = newPushDate; - } - - public String getRepairPust() { - return repairPust; - } - - public void setRepairPust(String repairPust) { - this.repairPust = repairPust; - } - - public String getSenceId() { - return senceId; - } - - public void setSenceId(String senceId) { - this.senceId = senceId; - } - - public String getNewState() { - return newState; - } - - public void setNewState(String newState) { - this.newState = newState; - } - - public String getBusinessDate() { - return businessDate; - } - - public void setBusinessDate(String businessDate) { - this.businessDate = businessDate; - } - - public String getPluginId() { - return pluginId; - } - - public void setPluginId(String pluginId) { - this.pluginId = pluginId; - } - - public Date getProcessingTime() { - return processingTime; - } - - public void setProcessingTime(Date processingTime) { - this.processingTime = processingTime; - } - - public String getProcessingRemarks() { - return processingRemarks; - } - - public void setProcessingRemarks(String processingRemarks) { - this.processingRemarks = processingRemarks; - } - - public String getProcessorName() { - return processorName; - } - - public void setProcessorName(String processorName) { - this.processorName = processorName; - } - - public String getProcessor() { - return processor; - } - - public void setProcessor(String processor) { - this.processor = processor; - } - - public String getNewSystemNumber() { - return newSystemNumber; - } - - public void setNewSystemNumber(String newSystemNumber) { - this.newSystemNumber = newSystemNumber; - } - - public String getNewSystemPrimary() { - return newSystemPrimary; - } - - public void setNewSystemPrimary(String newSystemPrimary) { - this.newSystemPrimary = newSystemPrimary; - } } 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 dfd07457..8ca17330 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 @@ -5,28 +5,7 @@ - - - - - - - - - - - - - - - - - - - - - @@ -38,7 +17,7 @@ - select * from ${dbName} @@ -80,7 +29,8 @@ + + + + + select + case when length(ifnull(max(right(document_rule,length(#{ruleSuffix}))),'0')+1)=1 + then concat(#{rulePrefix},'-',date_format(NOW(),#{ruleMiddle}),'-','000',ifnull(max(right(document_rule,length(#{ruleSuffix}))),'0')+1) + when length(ifnull(max(right(document_rule,length(#{ruleSuffix}))),'0')+1)=2 + then concat(#{rulePrefix},'-',date_format(NOW(),#{ruleMiddle}),'-','00',ifnull(max(right(document_rule,length(#{ruleSuffix}))),'0')+1) + when length(ifnull(max(right(document_rule,length(#{ruleSuffix}))),'0')+1)=3 + then concat(#{rulePrefix},'-',date_format(NOW(),#{ruleMiddle}),'-','0',ifnull(max(right(document_rule,length(#{ruleSuffix}))),'0')+1) + else concat(#{rulePrefix},'-',date_format(NOW(),#{ruleMiddle}),'-',ifnull(max(right(document_rule,length(#{ruleSuffix}))),'0')+1) + end as document_rule, + right( + case when length(ifnull(max(right(document_rule,length(#{ruleSuffix}))),'0')+1)=1 + then concat(#{rulePrefix},'-',date_format(NOW(),#{ruleMiddle}),'-','000',ifnull(max(right(document_rule,length(#{ruleSuffix}))),'0')+1) + when length(ifnull(max(right(document_rule,length(#{ruleSuffix}))),'0')+1)=2 + then concat(#{rulePrefix},'-',date_format(NOW(),#{ruleMiddle}),'-','00',ifnull(max(right(document_rule,length(#{ruleSuffix}))),'0')+1) + when length(ifnull(max(right(document_rule,length(#{ruleSuffix}))),'0')+1)=3 + then concat(#{rulePrefix},'-',date_format(NOW(),#{ruleMiddle}),'-','0',ifnull(max(right(document_rule,length(#{ruleSuffix}))),'0')+1) + else concat(#{rulePrefix},'-',date_format(NOW(),#{ruleMiddle}),'-',ifnull(max(right(document_rule,length(#{ruleSuffix}))),'0')+1) + end ,4) as documentRuleNum + from ${dbName} where document_rule like concat(#{rulePrefix},'-',date_format(NOW(),#{ruleMiddle}),'-','%'); + - + insert into ${dbName} @@ -145,7 +120,7 @@ update ${dbName} - set sts= 'N' ,modify_time = now(),modify_user_id = #{modify_user_id} + set dataStatus= 'N' ,modify_time = now(),modify_user_id = #{modify_user_id} and ${key} =#{value} diff --git a/service/src/main/java/com/hzya/frame/sysnew/comparison/service/IComparisonService.java b/service/src/main/java/com/hzya/frame/sysnew/comparison/service/IComparisonService.java index 60375cfb..31f9e6b5 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/comparison/service/IComparisonService.java +++ b/service/src/main/java/com/hzya/frame/sysnew/comparison/service/IComparisonService.java @@ -9,7 +9,7 @@ public interface IComparisonService extends IBaseService this.dao = dao; } - //分页查询档案对照数据 + //分页查询通用数据数据 @Override public JsonResultEntity queryEntityPage(JSONObject json) { JSONObject jsonObject = json.getJSONObject("jsonStr"); @@ -51,7 +51,7 @@ public class ComparisonServiceImpl extends BaseService comparisonEntities = comparisonDao.queryComparison(comparisonEntity); }catch (Exception e){ logger.info("根据主数据编码查询信息错误:{}",e.getMessage()); - return BaseResult.getFailureMessageEntity("查询失败",e.getMessage()); + return BaseResult.getFailureMessageEntity("查询失败"); } Map map = new HashMap<>();//将主表数据存到map中 if (comparisonEntities != null && comparisonEntities.size() > 0) { @@ -68,18 +68,18 @@ public class ComparisonServiceImpl extends BaseService } comparisonEntity.setMap(map); try { - List comparisonEntitiePages = comparisonDao.queryComparisonPage(comparisonEntity); + List> comparisonEntitiePages = comparisonDao.queryComparisonPage(comparisonEntity); PageInfo pageInfo = new PageInfo(comparisonEntitiePages); return BaseResult.getSuccessMessageEntity("查询成功", pageInfo); } catch (Exception e) { - logger.info("查询档案对照错误:{}", e.getMessage()); - return BaseResult.getFailureMessageEntity("查询失败", e.getMessage()); + logger.info("查询通用数据错误:{}", e.getMessage()); + return BaseResult.getFailureMessageEntity("查询失败"); } } return BaseResult.getFailureMessageEntity("查询失败","请检查传递参数"); } - //新增档案对照数据 + //新增通用数据数据 @Override public JsonResultEntity saveEntity(JSONObject json) { JSONObject jsonObject = json.getJSONObject("jsonStr"); @@ -89,9 +89,9 @@ public class ComparisonServiceImpl extends BaseService if (!checkStr(jsonObject.getString("mdmCode"))) { return BaseResult.getFailureMessageEntity("主数据编码为空"); } - if (!checkStr(jsonObject.getString("rulePrefix"))) { + /*if (!checkStr(jsonObject.getString("rulePrefix"))) { return BaseResult.getFailureMessageEntity("规则为空"); - } + }*/ ComparisonEntity comparisonEntity = jsonObject.toJavaObject(ComparisonEntity.class); ComparisonDetailsEntity comparisonDetailsEntity=new ComparisonDetailsEntity(); List comparisonEntities=new ArrayList<>(); @@ -100,7 +100,7 @@ public class ComparisonServiceImpl extends BaseService comparisonEntities = comparisonDao.queryComparison(comparisonEntity); }catch (Exception e){ logger.info("根据主数据编码查询信息错误:{}",e.getMessage()); - return BaseResult.getFailureMessageEntity("保存失败",e.getMessage()); + return BaseResult.getFailureMessageEntity("保存失败"); } String main = jsonObject.getString("main");//获取主表数据 JSONArray jsonArray = jsonObject.getJSONArray("details");//获取子表数据 @@ -114,7 +114,10 @@ public class ComparisonServiceImpl extends BaseService for (String key : jsonObjectMain.keySet()) { if (entity.getDbType().equals("1")) { comparisonEntity.setDbName(entity.getDbName()); - map.put(key, jsonObjectMain.getString(key)); + //如果表中得字段与输入得字段相等,则存起来 + if(entity.getEnName().equals(key)){ + map.put(key, jsonObjectMain.getString(key)); + } } } } @@ -126,7 +129,9 @@ public class ComparisonServiceImpl extends BaseService for (String key : jsonObjectDetails.keySet()) { if (entity.getDbType().equals("2")) { comparisonDetailsEntity.setDbName(entity.getDbName()); - mapDetails.put(key, jsonObjectDetails.getString(key)); + if(entity.getEnName().equals(key)){ + mapDetails.put(key, jsonObjectDetails.getString(key)); + } } } } @@ -140,16 +145,38 @@ public class ComparisonServiceImpl extends BaseService map.put("create_time", new Date()); map.put("modify_time", new Date()); map.put("sts", "Y"); - comparisonEntity.setMap(map); - //生成单据规则 - comparisonEntity.setRulePrefix(jsonObject.getString("rulePrefix")); + //查询单据规则 try { - ComparisonEntity comparisonEntityRule = comparisonDao.queryComparisonRule(comparisonEntity); - map.put("document_rule", comparisonEntityRule.getDocumentRule());//单据规则 - map.put("document_rule_num", comparisonEntityRule.getDocumentRuleNum());//单据规则流水号 - } catch (Exception e) { - logger.info("保存档案对照时候生成单据规则错误:{}", e.getMessage()); - return BaseResult.getFailureMessageEntity("保存失败", e.getMessage()); + ComparisonEntity comparisonEntityRule = comparisonEntities.get(0); + comparisonEntityRule= comparisonDao.queryComparisonById(comparisonEntityRule); + String documentRule = comparisonEntityRule.getDocumentRule(); + 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 ruleSuffix= documentRule.substring(documentRule.lastIndexOf("-")+1); + //生成单据规则 + comparisonEntity.setRulePrefix(rulePrefix); + comparisonEntity.setRuleMiddle(ruleMiddle); + comparisonEntity.setRuleSuffix(ruleSuffix); + try { + //新生成单据规则保存到数据库 + comparisonEntityRule = comparisonDao.queryComparisonRule(comparisonEntity); + map.put("document_rule", comparisonEntityRule.getDocumentRule());//单据规则 + map.put("document_rule_num", comparisonEntityRule.getDocumentRuleNum());//单据规则流水号 + comparisonEntity.setMap(map); + } catch (Exception e) { + logger.info("保存通用数据时候生成单据规则错误:{}", e.getMessage()); + return BaseResult.getFailureMessageEntity("保存失败"); + } + } + }catch (Exception e){ + logger.info("通用数据保存接口中查询单据规则错误:{}",e.getMessage()); + return BaseResult.getFailureMessageEntity("保存失败"); } try { //保存主表数据 @@ -170,15 +197,15 @@ public class ComparisonServiceImpl extends BaseService } return BaseResult.getSuccessMessageEntity("保存成功", comparisonEntityOne); } catch (Exception e) { - logger.info("保存档案对照时候错误:{}", e.getMessage()); - return BaseResult.getFailureMessageEntity("保存失败", e.getMessage()); + logger.info("保存通用数据时候错误:{}", e.getMessage()); + return BaseResult.getFailureMessageEntity("保存失败"); } } } return BaseResult.getFailureMessageEntity("查询失败","请检查传递参数"); } - //更新档案对照数据 + //更新通用数据数据 @Override public JsonResultEntity updateEntity(JSONObject json) { JSONObject jsonObject = json.getJSONObject("jsonStr"); @@ -201,7 +228,7 @@ public class ComparisonServiceImpl extends BaseService comparisonEntities = comparisonDao.queryComparison(comparisonEntity); }catch (Exception e){ logger.info("根据主数据编码查询信息错误:{}",e.getMessage()); - return BaseResult.getFailureMessageEntity("更新失败",e.getMessage()); + return BaseResult.getFailureMessageEntity("更新失败"); } Map map=new HashMap<>();//将主表数据存到map中 Map mapDetails=new HashMap<>();//将子表数据存到map中 @@ -211,7 +238,9 @@ public class ComparisonServiceImpl extends BaseService for (String key : jsonObjectMain.keySet()) { if (entity.getDbType().equals("1")) { comparisonEntity.setDbName(entity.getDbName()); - map.put(key, jsonObjectMain.getString(key)); + if(entity.getEnName().equals(key)){ + map.put(key, jsonObjectMain.getString(key)); + } } } } @@ -223,7 +252,9 @@ public class ComparisonServiceImpl extends BaseService for (String key : jsonObjectDetails.keySet()) { if (entity.getDbType().equals("2")) { comparisonDetailsEntity.setDbName(entity.getDbName()); - mapDetails.put(key, jsonObjectDetails.getString(key)); + if(entity.getEnName().equals(key)){ + mapDetails.put(key, jsonObjectDetails.getString(key)); + } } } } @@ -243,7 +274,7 @@ public class ComparisonServiceImpl extends BaseService map.put("document_rule",comparisonEntityRule.getDocumentRule());//单据规则 map.put("document_rule_num",comparisonEntityRule.getDocumentRuleNum());//单据规则流水号 }catch (Exception e){ - logger.info("更新档案对照时候生成单据规则错误:{}",e.getMessage()); + logger.info("更新通用数据时候生成单据规则错误:{}",e.getMessage()); return BaseResult.getFailureMessageEntity("更新失败",e.getMessage()); }*/ try { @@ -260,20 +291,20 @@ public class ComparisonServiceImpl extends BaseService comparisonDetailsEntity.setFormmainId(jsonObjectMain.getString("id")); comparisonDetailsEntity.setMapDetails(mapDetails); comparisonDetailsDao.updateComparisonDetailsByType(comparisonDetailsEntity); - return BaseResult.getSuccessMessageEntity("更新成功", integer); } + return BaseResult.getSuccessMessageEntity("更新成功", integer); }else{ - return BaseResult.getFailureMessageEntity("更新失败", "请查看id是否在表中存在"); + return BaseResult.getFailureMessageEntity("更新失败"); } } catch (Exception e) { - logger.info("更新档案对照时候错误:{}", e.getMessage()); - return BaseResult.getFailureMessageEntity("更新失败", e.getMessage()); + logger.info("更新通用数据时候错误:{}", e.getMessage()); + return BaseResult.getFailureMessageEntity("更新失败"); } } return BaseResult.getFailureMessageEntity("查询失败","请检查传递参数"); } - //删除当初对照数据 + //删除通用数据 @Override public JsonResultEntity deleteEntity(JSONObject json) { JSONObject jsonObject = json.getJSONObject("jsonStr"); @@ -295,7 +326,7 @@ public class ComparisonServiceImpl extends BaseService comparisonEntities = comparisonDao.queryComparison(comparisonEntity); }catch (Exception e){ logger.info("根据主数据编码查询信息错误:{}",e.getMessage()); - return BaseResult.getFailureMessageEntity("删除失败",e.getMessage()); + return BaseResult.getFailureMessageEntity("删除失败"); } Map map=new HashMap<>(); if(comparisonEntities !=null && comparisonEntities.size()>0) { @@ -304,7 +335,9 @@ public class ComparisonServiceImpl extends BaseService for (String key : jsonObjectMain.keySet()) { if (entity.getDbType().equals("1")) { comparisonEntity.setDbName(entity.getDbName()); - map.put(key, jsonObjectMain.getString(key)); + if(entity.getEnName().equals(key)){ + map.put(key, jsonObjectMain.getString(key)); + } } if(entity.getDbType().equals("2")){ comparisonDetailsEntity.setDbName(entity.getDbName()); @@ -317,18 +350,38 @@ public class ComparisonServiceImpl extends BaseService try { Integer integer = comparisonDao.deleteComparison(comparisonEntity); if(integer>0){ - comparisonDetailsEntity.setFormmainId(jsonObjectMain.getString("id")); - comparisonDetailsEntity.setModify_user_id("c796fd9ba4c9f5ff3cc2fa41a040e443"); - comparisonDetailsDao.deleteComparisonDetails(comparisonDetailsEntity); + if(comparisonDetailsEntity.getDbName()!=null){ + comparisonDetailsEntity.setFormmainId(jsonObjectMain.getString("id")); + comparisonDetailsEntity.setModify_user_id("c796fd9ba4c9f5ff3cc2fa41a040e443"); + comparisonDetailsDao.deleteComparisonDetails(comparisonDetailsEntity); + } return BaseResult.getSuccessMessageEntity("删除成功",integer); }else{ return BaseResult.getFailureMessageEntity("删除失败","请查看id是否在表中存在"); } }catch (Exception e){ - logger.info("删除档案对照数据错误:{}",e.getMessage()); - return BaseResult.getFailureMessageEntity("删除失败",e.getMessage()); + logger.info("删除通用数据数据错误:{}",e.getMessage()); + return BaseResult.getFailureMessageEntity("删除失败"); } } return BaseResult.getFailureMessageEntity("查询失败","请检查传递参数"); } + + //根据不同的日期格式,返回不同的值 + private String getRuleDate(String str){ + switch (str){ + case "yyyy-MM-dd": + return "%Y-%m-%d"; + case "yyyyMMdd": + return "%Y%m%d"; + case "yyyy-MM-dd HH:mm:ss": + return "Y-%m-%d %H:%i:%s"; + case "yyyyMMddHHmmss": + return "%Y%m%d%H%i%s"; + case "yyyyMMddHHmmssSSS": + return "%Y%m%d%H%i%s%f"; + default: + return null; + } + } } From ed73b0fbf05a479bb8c44d6f93245c57211dbdc3 Mon Sep 17 00:00:00 2001 From: hecan <1718492867@qq.com> Date: Wed, 29 May 2024 17:21:42 +0800 Subject: [PATCH 07/80] =?UTF-8?q?=E6=A1=A3=E6=A1=88=E5=AF=B9=E7=85=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../generalData/dao/IGeneralDataDao.java | 8 ++-- .../dao/impl/GeneralDataDaoImpl.java | 8 ++-- .../generalData/entity/GeneralDataEntity.java | 2 +- .../service/IGeneralDataService.java | 10 ++--- .../service/impl/GeneralDataServiceImpl.java | 38 +++++++++---------- 5 files changed, 33 insertions(+), 33 deletions(-) diff --git a/service/src/main/java/com/hzya/frame/sysnew/generalData/dao/IGeneralDataDao.java b/service/src/main/java/com/hzya/frame/sysnew/generalData/dao/IGeneralDataDao.java index ec391b3a..e7f315c1 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/generalData/dao/IGeneralDataDao.java +++ b/service/src/main/java/com/hzya/frame/sysnew/generalData/dao/IGeneralDataDao.java @@ -9,7 +9,7 @@ public interface IGeneralDataDao extends IBaseDao { /** * - * @content 新增通用数据 + * @content 新增档案对照 * @Param * @Return * @Author hecan @@ -19,7 +19,7 @@ public interface IGeneralDataDao extends IBaseDao { /** * - * @content 查询通用数据 + * @content 查询档案对照 * @Param * @Return * @Author hecan @@ -29,7 +29,7 @@ public interface IGeneralDataDao extends IBaseDao { /** * - * @content 编辑通用数据 + * @content 编辑档案对照 * @Param * @Return * @Author hecan @@ -39,7 +39,7 @@ public interface IGeneralDataDao extends IBaseDao { /** * - * @content 删除通用数据 + * @content 删除档案对照 * @Param * @Return * @Author hecan diff --git a/service/src/main/java/com/hzya/frame/sysnew/generalData/dao/impl/GeneralDataDaoImpl.java b/service/src/main/java/com/hzya/frame/sysnew/generalData/dao/impl/GeneralDataDaoImpl.java index b94f80c0..914dacca 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/generalData/dao/impl/GeneralDataDaoImpl.java +++ b/service/src/main/java/com/hzya/frame/sysnew/generalData/dao/impl/GeneralDataDaoImpl.java @@ -10,28 +10,28 @@ import java.util.List; @Repository(value = "generalDataDaoImpl") public class GeneralDataDaoImpl extends MybatisGenericDao implements IGeneralDataDao { - //新增通用数据 + //新增档案对照 @Override public GeneralDataEntity saveGeneralDataByType(GeneralDataEntity generalDataEntity) { generalDataEntity = super.save(getSqlIdPrifx() + "saveGeneralDataByType", generalDataEntity); return generalDataEntity; } - //查询通用数据 + //查询档案对照 @Override public List queryGeneralData(GeneralDataEntity generalDataEntity) { List query = super.query(getSqlIdPrifx() + "queryGeneralData", generalDataEntity); return query; } - //编辑通用数据 + //编辑档案对照 @Override public Integer updateGeneralDataByType(GeneralDataEntity generalDataEntity) { int update = super.update(getSqlIdPrifx() + "updateGeneralDataByType", generalDataEntity); return update; } - //删除通用数据 + //删除档案对照 @Override public Integer deleteGeneralDataByType(GeneralDataEntity generalDataEntity) { int update = super.update(getSqlIdPrifx() + "deleteGeneralDataByType", generalDataEntity); diff --git a/service/src/main/java/com/hzya/frame/sysnew/generalData/entity/GeneralDataEntity.java b/service/src/main/java/com/hzya/frame/sysnew/generalData/entity/GeneralDataEntity.java index 5aef2e9f..ac9bc603 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/generalData/entity/GeneralDataEntity.java +++ b/service/src/main/java/com/hzya/frame/sysnew/generalData/entity/GeneralDataEntity.java @@ -4,7 +4,7 @@ import com.hzya.frame.web.entity.BaseEntity; /** * - * @content 通用数据接口实体类 + * @content 档案对照实体类 * @Param * @Return * @Author hecan diff --git a/service/src/main/java/com/hzya/frame/sysnew/generalData/service/IGeneralDataService.java b/service/src/main/java/com/hzya/frame/sysnew/generalData/service/IGeneralDataService.java index df8dbd47..105511f6 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/generalData/service/IGeneralDataService.java +++ b/service/src/main/java/com/hzya/frame/sysnew/generalData/service/IGeneralDataService.java @@ -9,7 +9,7 @@ public interface IGeneralDataService extends IBaseService Date: Tue, 4 Jun 2024 09:08:43 +0800 Subject: [PATCH 08/80] =?UTF-8?q?=E4=B8=BB=E6=95=B0=E6=8D=AE=E6=96=B0?= =?UTF-8?q?=E5=BB=BA=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hzya/frame/mdm/entity/DbFiledsDto.java | 83 + .../hzya/frame/mdm/entity/MdmDbFiledVo.java | 32 + .../frame/mdm/entity/MdmModuleViewDto.java | 91 + .../frame/mdm/entity/MdmModuleViewVo.java | 136 ++ .../mdm/mdmModule/dao/IMdmModuleDao.java | 4 +- .../mdmModule/dao/impl/MdmModuleDaoImpl.java | 19 + .../mdm/mdmModule/entity/MdmModuleEntity.xml | 99 ++ .../entity/MdmModuleViewEntity.java | 9 + .../entity/MdmModuleViewButtonEntity.java | 10 +- .../entity/MdmModuleViewDetailEntity.java | 10 +- .../hzya/frame/mdm/service/IMdmService.java | 38 +- .../frame/mdm/service/IMdmServiceCache.java | 23 + .../mdm/service/impl/MdmServiceCache.java | 130 ++ .../mdm/service/impl/MdmServiceImpl.java | 1477 ++++++++++++----- 14 files changed, 1683 insertions(+), 478 deletions(-) create mode 100644 service/src/main/java/com/hzya/frame/mdm/entity/DbFiledsDto.java create mode 100644 service/src/main/java/com/hzya/frame/mdm/entity/MdmDbFiledVo.java create mode 100644 service/src/main/java/com/hzya/frame/mdm/entity/MdmModuleViewDto.java create mode 100644 service/src/main/java/com/hzya/frame/mdm/entity/MdmModuleViewVo.java diff --git a/service/src/main/java/com/hzya/frame/mdm/entity/DbFiledsDto.java b/service/src/main/java/com/hzya/frame/mdm/entity/DbFiledsDto.java new file mode 100644 index 00000000..e0f5e05b --- /dev/null +++ b/service/src/main/java/com/hzya/frame/mdm/entity/DbFiledsDto.java @@ -0,0 +1,83 @@ +package com.hzya.frame.mdm.entity; + +import com.hzya.frame.mdm.mdmModuleDbFiledsRule.entity.MdmModuleDbFiledsRuleEntity; +import com.hzya.frame.web.entity.BaseEntity; + +import java.util.List; + +public class DbFiledsDto { + + /** + * 1新增 2、修改 + */ + private String dataType; + + /** + * 中文名 + */ + private String chName; + /** + * 英文名 + */ + private String enName; + /** + * 字段类型 1、BIGINT 2、DECIMAL 3、VARCHAR 4、DATETIME + */ + private String filedType; + /** + * 长度 + */ + private String filedLength; + + public DbFiledsDto() { + } + + public DbFiledsDto(String dataType,String chName, String enName, String filedType, String filedLength) { + this.dataType = dataType; + this.chName = chName; + this.enName = enName; + this.filedType = filedType; + this.filedLength = filedLength; + } + + public String getChName() { + return chName; + } + + public void setChName(String chName) { + this.chName = chName; + } + + public String getEnName() { + return enName; + } + + public void setEnName(String enName) { + this.enName = enName; + } + + public String getFiledType() { + return filedType; + } + + public void setFiledType(String filedType) { + this.filedType = filedType; + } + + public String getFiledLength() { + return filedLength; + } + + public void setFiledLength(String filedLength) { + this.filedLength = filedLength; + } + + public String getDataType() { + return dataType; + } + + public void setDataType(String dataType) { + this.dataType = dataType; + } +} + diff --git a/service/src/main/java/com/hzya/frame/mdm/entity/MdmDbFiledVo.java b/service/src/main/java/com/hzya/frame/mdm/entity/MdmDbFiledVo.java new file mode 100644 index 00000000..921f2e8b --- /dev/null +++ b/service/src/main/java/com/hzya/frame/mdm/entity/MdmDbFiledVo.java @@ -0,0 +1,32 @@ +package com.hzya.frame.mdm.entity; + + +public class MdmDbFiledVo { + private String id; + private String name; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public MdmDbFiledVo() { + } + + public MdmDbFiledVo(String id, String name) { + this.id = id; + this.name = name; + } +} + diff --git a/service/src/main/java/com/hzya/frame/mdm/entity/MdmModuleViewDto.java b/service/src/main/java/com/hzya/frame/mdm/entity/MdmModuleViewDto.java new file mode 100644 index 00000000..047809ee --- /dev/null +++ b/service/src/main/java/com/hzya/frame/mdm/entity/MdmModuleViewDto.java @@ -0,0 +1,91 @@ +package com.hzya.frame.mdm.entity; + +import com.hzya.frame.mdm.mdmModuleView.entity.MdmModuleViewEntity; +import com.hzya.frame.mdm.mdmModuleViewButton.entity.MdmModuleViewButtonEntity; +import com.hzya.frame.mdm.mdmModuleViewDetail.entity.MdmModuleViewDetailEntity; + +import java.util.List; + +public class MdmModuleViewDto { + + private Long mdmCode; + //模版 + private MdmModuleViewEntity mdmModuleViewEntity; + //新增 + private List addFiled; + //修改 + private List editFiled; + //查看 + private List showFiled; + //查询 + private List queryFiled; + //列表 + private List listFiled; + //按钮 + private List dbButtonFiled; + + public MdmModuleViewEntity getMdmModuleViewEntity() { + return mdmModuleViewEntity; + } + + public void setMdmModuleViewEntity(MdmModuleViewEntity mdmModuleViewEntity) { + this.mdmModuleViewEntity = mdmModuleViewEntity; + } + + public List getAddFiled() { + return addFiled; + } + + public void setAddFiled(List addFiled) { + this.addFiled = addFiled; + } + + public List getEditFiled() { + return editFiled; + } + + public void setEditFiled(List editFiled) { + this.editFiled = editFiled; + } + + public List getShowFiled() { + return showFiled; + } + + public void setShowFiled(List showFiled) { + this.showFiled = showFiled; + } + + public List getQueryFiled() { + return queryFiled; + } + + public void setQueryFiled(List queryFiled) { + this.queryFiled = queryFiled; + } + + public List getListFiled() { + return listFiled; + } + + public void setListFiled(List listFiled) { + this.listFiled = listFiled; + } + + public Long getMdmCode() { + return mdmCode; + } + + public void setMdmCode(Long mdmCode) { + this.mdmCode = mdmCode; + } + + public List getDbButtonFiled() { + return dbButtonFiled; + } + + public void setDbButtonFiled(List dbButtonFiled) { + this.dbButtonFiled = dbButtonFiled; + } +} + diff --git a/service/src/main/java/com/hzya/frame/mdm/entity/MdmModuleViewVo.java b/service/src/main/java/com/hzya/frame/mdm/entity/MdmModuleViewVo.java new file mode 100644 index 00000000..67429ac6 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/mdm/entity/MdmModuleViewVo.java @@ -0,0 +1,136 @@ +package com.hzya.frame.mdm.entity; + +import com.hzya.frame.mdm.mdmModuleView.entity.MdmModuleViewEntity; +import com.hzya.frame.mdm.mdmModuleViewButton.entity.MdmModuleViewButtonEntity; +import com.hzya.frame.mdm.mdmModuleViewDetail.entity.MdmModuleViewDetailEntity; + +import java.util.List; + +public class MdmModuleViewVo { + + + //模版 + private MdmModuleViewEntity mdmModuleViewEntity; + //新增 + private List addFiled; + //修改 + private List editFiled; + //查看 + private List showFiled; + //查询 + private List queryFiled; + //列表 + private List listFiled; + + //新增 + private List dbAddFiled; + //修改 + private List dbEditFiled; + //查看 + private List dbShowFiled; + //查询 + private List dbQueryFiled; + //列表 + private List dbListFiled; + //按钮 + private List dbButtonFiled; + + public List getAddFiled() { + return addFiled; + } + + public void setAddFiled(List addFiled) { + this.addFiled = addFiled; + } + + public List getEditFiled() { + return editFiled; + } + + public void setEditFiled(List editFiled) { + this.editFiled = editFiled; + } + + public List getShowFiled() { + return showFiled; + } + + public void setShowFiled(List showFiled) { + this.showFiled = showFiled; + } + + public List getQueryFiled() { + return queryFiled; + } + + public void setQueryFiled(List queryFiled) { + this.queryFiled = queryFiled; + } + + public List getListFiled() { + return listFiled; + } + + public void setListFiled(List listFiled) { + this.listFiled = listFiled; + } + + public MdmModuleViewEntity getMdmModuleViewEntity() { + return mdmModuleViewEntity; + } + + public void setMdmModuleViewEntity(MdmModuleViewEntity mdmModuleViewEntity) { + this.mdmModuleViewEntity = mdmModuleViewEntity; + } + + public List getDbAddFiled() { + return dbAddFiled; + } + + public void setDbAddFiled(List dbAddFiled) { + this.dbAddFiled = dbAddFiled; + } + + public List getDbEditFiled() { + return dbEditFiled; + } + + public void setDbEditFiled(List dbEditFiled) { + this.dbEditFiled = dbEditFiled; + } + + public List getDbShowFiled() { + return dbShowFiled; + } + + public void setDbShowFiled(List dbShowFiled) { + this.dbShowFiled = dbShowFiled; + } + + public List getDbQueryFiled() { + return dbQueryFiled; + } + + public void setDbQueryFiled(List dbQueryFiled) { + this.dbQueryFiled = dbQueryFiled; + } + + public List getDbListFiled() { + return dbListFiled; + } + + public void setDbListFiled(List dbListFiled) { + this.dbListFiled = dbListFiled; + } + + public List getDbButtonFiled() { + return dbButtonFiled; + } + + public void setDbButtonFiled(List dbButtonFiled) { + this.dbButtonFiled = dbButtonFiled; + } + + +} + diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModule/dao/IMdmModuleDao.java b/service/src/main/java/com/hzya/frame/mdm/mdmModule/dao/IMdmModuleDao.java index 8dcabbcb..e4a499ea 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModule/dao/IMdmModuleDao.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModule/dao/IMdmModuleDao.java @@ -19,6 +19,8 @@ public interface IMdmModuleDao extends IBaseDao { MdmModuleEntity getByMdmCode(Long mdmCode); Integer checkTable(Map maps); - + Integer createTable(Map maps); + Integer alterTable(Map maps); + Integer alterTableName(Map maps); } diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModule/dao/impl/MdmModuleDaoImpl.java b/service/src/main/java/com/hzya/frame/mdm/mdmModule/dao/impl/MdmModuleDaoImpl.java index fda4b148..f6742f3d 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModule/dao/impl/MdmModuleDaoImpl.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModule/dao/impl/MdmModuleDaoImpl.java @@ -35,5 +35,24 @@ public class MdmModuleDaoImpl extends MybatisGenericDao return o; } + + + @Override + public Integer createTable(Map maps) { + Integer o = (Integer) super.selectOne(getSqlIdPrifx() + "createTable", maps); + return o; + } + @Override + public Integer alterTable(Map maps) { + Integer o = (Integer) super.selectOne(getSqlIdPrifx() + "alterTable", maps); + return o; + } + + @Override + public Integer alterTableName(Map maps) { + Integer o = (Integer) super.selectOne(getSqlIdPrifx() + "alterTableName", maps); + return o; + + } } diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModule/entity/MdmModuleEntity.xml b/service/src/main/java/com/hzya/frame/mdm/mdmModule/entity/MdmModuleEntity.xml index f323ccab..4acbf893 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 @@ -305,5 +305,104 @@ update mdm_module set sts= 'N' ,modify_time = #{modify_time},modify_user_id = # TABLE_SCHEMA = 'businesscenter' and TABLE_NAME = #{tableName} + + + + + + + + + + + + + diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleView/entity/MdmModuleViewEntity.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleView/entity/MdmModuleViewEntity.java index 9c1344ba..83103ab3 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleView/entity/MdmModuleViewEntity.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleView/entity/MdmModuleViewEntity.java @@ -21,6 +21,8 @@ public class MdmModuleViewEntity extends BaseEntity { /** 公司id */ private String companyId; + /** 数据类型 1、新增 2、修改 */ + private String dataType; public String getMdmId() { return mdmId; @@ -62,5 +64,12 @@ public class MdmModuleViewEntity extends BaseEntity { this.companyId = companyId; } + public String getDataType() { + return dataType; + } + + public void setDataType(String dataType) { + this.dataType = dataType; + } } diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleViewButton/entity/MdmModuleViewButtonEntity.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleViewButton/entity/MdmModuleViewButtonEntity.java index 261b8bdf..6ac2b94f 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleViewButton/entity/MdmModuleViewButtonEntity.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleViewButton/entity/MdmModuleViewButtonEntity.java @@ -21,7 +21,8 @@ public class MdmModuleViewButtonEntity extends BaseEntity { /** 公司id */ private String companyId; - + /** 数据类型 1、新增 2、修改 */ + private String dataType; public String getMdmId() { return mdmId; } @@ -62,5 +63,12 @@ public class MdmModuleViewButtonEntity extends BaseEntity { this.companyId = companyId; } + public String getDataType() { + return dataType; + } + + public void setDataType(String dataType) { + this.dataType = dataType; + } } diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleViewDetail/entity/MdmModuleViewDetailEntity.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleViewDetail/entity/MdmModuleViewDetailEntity.java index e49e3044..8d10318a 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleViewDetail/entity/MdmModuleViewDetailEntity.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleViewDetail/entity/MdmModuleViewDetailEntity.java @@ -20,7 +20,8 @@ public class MdmModuleViewDetailEntity extends BaseEntity { private String viewType; /** 公司id */ private String companyId; - + /** 数据类型 1、新增 2、修改 */ + private String dataType; public String getMdmId() { return mdmId; @@ -62,5 +63,12 @@ public class MdmModuleViewDetailEntity extends BaseEntity { this.companyId = companyId; } + public String getDataType() { + return dataType; + } + + public void setDataType(String dataType) { + this.dataType = dataType; + } } diff --git a/service/src/main/java/com/hzya/frame/mdm/service/IMdmService.java b/service/src/main/java/com/hzya/frame/mdm/service/IMdmService.java index 40968767..1369a2a9 100644 --- a/service/src/main/java/com/hzya/frame/mdm/service/IMdmService.java +++ b/service/src/main/java/com/hzya/frame/mdm/service/IMdmService.java @@ -96,25 +96,25 @@ public interface IMdmService { * @Date 9:40 上午 2023/10/18 **/ JsonResultEntity saveMdmModuleDb(JSONObject jsonObject); - // - // - ///** - // * @param jsonObject - // * @return com.hzya.frame.web.entity.JsonResultEntity - // * @Author lvleigang - // * @Description 主数据设置查询显示信息 - // * @Date 9:40 上午 2023/10/18 - // **/ - //JsonResultEntity queryMdmModuleView(JSONObject jsonObject); - // - ///** - // * @param jsonObject - // * @return com.hzya.frame.web.entity.JsonResultEntity - // * @Author lvleigang - // * @Description 主数据设置修改显示信息 - // * @Date 9:40 上午 2023/10/18 - // **/ - //JsonResultEntity doSaveMdmModuleView(JSONObject jsonObject); + + + /** + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 主数据设置查询显示信息 + * @Date 9:40 上午 2023/10/18 + **/ + JsonResultEntity queryMdmModuleView(JSONObject jsonObject); + + /** + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 主数据设置修改显示信息 + * @Date 9:40 上午 2023/10/18 + **/ + JsonResultEntity doSaveMdmModuleView(JSONObject jsonObject); // ///** // * @param jsonObject diff --git a/service/src/main/java/com/hzya/frame/mdm/service/IMdmServiceCache.java b/service/src/main/java/com/hzya/frame/mdm/service/IMdmServiceCache.java index 56dc07d0..bc3a5ad2 100644 --- a/service/src/main/java/com/hzya/frame/mdm/service/IMdmServiceCache.java +++ b/service/src/main/java/com/hzya/frame/mdm/service/IMdmServiceCache.java @@ -5,6 +5,9 @@ import com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity; import com.hzya.frame.mdm.mdmModuleDb.entity.MdmModuleDbEntity; import com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity; import com.hzya.frame.mdm.mdmModuleDbFiledsRule.entity.MdmModuleDbFiledsRuleEntity; +import com.hzya.frame.mdm.mdmModuleView.entity.MdmModuleViewEntity; +import com.hzya.frame.mdm.mdmModuleViewButton.entity.MdmModuleViewButtonEntity; +import com.hzya.frame.mdm.mdmModuleViewDetail.entity.MdmModuleViewDetailEntity; import com.hzya.frame.mdm.mdmTableCodeRule.entity.MdmTableCodeRuleEntity; import com.hzya.frame.web.entity.JsonResultEntity; @@ -34,4 +37,24 @@ public interface IMdmServiceCache { List queryMdmModuleDbFileds(MdmModuleDbFiledsEntity queryDbFiled); List queryMdmModuleDbFiledsRule(MdmModuleDbFiledsRuleEntity queryDbFiledRule); + + void saveMdmTableCodeRule(String mdmid, List mdmTableCodeRuleEntities); + + void saveMdmModuleDb(String id, List mdmModuleDbEntities); + + void saveMdmModuleDbFileds(String id, List mdmModuleDbFiledsEntities); + + void saveMdmModuleDbFiledsRule(String id, List mdmModuleDbFiledsRuleEntities); + + List queryMdmModuleViewDetail(MdmModuleViewDetailEntity mdmModuleViewDetailEntity); + + List queryMdmModuleView(MdmModuleViewEntity mdmModuleViewEntity); + + List queryMdmModuleViewButton(MdmModuleViewButtonEntity mdmModuleViewButtonEntity); + + void saveMdmModuleView(String id, MdmModuleViewEntity mdmModuleViewEntity); + + void saveMdmModuleViewDetail(String id, List mdmModuleViewDetailEntities); + + void saveMdmModuleViewButton(String id, List mdmModuleViewButtonEntities); } diff --git a/service/src/main/java/com/hzya/frame/mdm/service/impl/MdmServiceCache.java b/service/src/main/java/com/hzya/frame/mdm/service/impl/MdmServiceCache.java index dcafef9a..1e5c7e0f 100644 --- a/service/src/main/java/com/hzya/frame/mdm/service/impl/MdmServiceCache.java +++ b/service/src/main/java/com/hzya/frame/mdm/service/impl/MdmServiceCache.java @@ -1,5 +1,6 @@ package com.hzya.frame.mdm.service.impl; +import cn.dev33.satoken.stp.StpUtil; import com.alibaba.fastjson.JSONObject; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; @@ -14,8 +15,11 @@ import com.hzya.frame.mdm.mdmModuleDbFiledsRule.entity.MdmModuleDbFiledsRuleEnti import com.hzya.frame.mdm.mdmModuleDistribute.dao.IMdmModuleDistributeDao; import com.hzya.frame.mdm.mdmModuleDistributeDetail.dao.IMdmModuleDistributeDetailDao; import com.hzya.frame.mdm.mdmModuleView.dao.IMdmModuleViewDao; +import com.hzya.frame.mdm.mdmModuleView.entity.MdmModuleViewEntity; import com.hzya.frame.mdm.mdmModuleViewButton.dao.IMdmModuleViewButtonDao; +import com.hzya.frame.mdm.mdmModuleViewButton.entity.MdmModuleViewButtonEntity; import com.hzya.frame.mdm.mdmModuleViewDetail.dao.IMdmModuleViewDetailDao; +import com.hzya.frame.mdm.mdmModuleViewDetail.entity.MdmModuleViewDetailEntity; import com.hzya.frame.mdm.mdmTableCodeRule.dao.IMdmTableCodeRuleDao; import com.hzya.frame.mdm.mdmTableCodeRule.entity.MdmTableCodeRuleEntity; import com.hzya.frame.mdm.service.IMdmService; @@ -30,6 +34,7 @@ import org.springframework.cache.annotation.Cacheable; import org.springframework.stereotype.Service; import javax.annotation.Resource; +import java.util.Date; import java.util.List; @@ -80,6 +85,7 @@ public class MdmServiceCache implements IMdmServiceCache { return mdmTableCodeRuleEntityList; } + @Override @Cacheable(cacheNames="mdmModuleDb",key = "#mdmId") public List queryMdmModuleDb(MdmModuleDbEntity entity) { @@ -100,4 +106,128 @@ public class MdmServiceCache implements IMdmServiceCache { List mdmModuleDbFiledsRuleEntities = mdmModuleDbFiledsRuleDao.queryBase(entity); return mdmModuleDbFiledsRuleEntities; } + + @Override + @CacheEvict(cacheNames="mdmTableCodeRule",key = "#mdmId") + public void saveMdmTableCodeRule(String mdmId, List mdmTableCodeRuleEntities) { + MdmTableCodeRuleEntity mdmTableCodeRuleEntity = new MdmTableCodeRuleEntity(); + mdmTableCodeRuleEntity.setMdmId(mdmId); + mdmTableCodeRuleEntity.setSts("Y"); + mdmTableCodeRuleEntity.setUpdate(); + mdmTableCodeRuleDao.logicRemoveMultiCondition(mdmTableCodeRuleEntity); + if(mdmTableCodeRuleEntities != null && mdmTableCodeRuleEntities.size() > 0){ + for (int i = 0; i < mdmTableCodeRuleEntities.size(); i++) { + mdmTableCodeRuleDao.save(mdmTableCodeRuleEntities.get(i)); + } + } + } + + @Override + @CacheEvict(cacheNames="mdmModuleDb",key = "#mdmId") + public void saveMdmModuleDb(String mdmId, List mdmModuleDbEntities) { + if(mdmModuleDbEntities != null && mdmModuleDbEntities.size() > 0){ + for (int i = 0; i < mdmModuleDbEntities.size(); i++) { + if("1".equals(mdmModuleDbEntities.get(i).getDataType())){ + mdmModuleDbDao.save(mdmModuleDbEntities.get(i)); + }else { + mdmModuleDbDao.update(mdmModuleDbEntities.get(i)); + } + } + } + } + @Override + @CacheEvict(cacheNames="mdmModuleDbFileds",key = "#mdmId") + public void saveMdmModuleDbFileds(String mdmId, List mdmModuleDbFiledsEntities) { + if(mdmModuleDbFiledsEntities != null && mdmModuleDbFiledsEntities.size() > 0){ + for (int i = 0; i < mdmModuleDbFiledsEntities.size(); i++) { + if("1".equals(mdmModuleDbFiledsEntities.get(i).getDataType())){ + mdmModuleDbFiledsDao.save(mdmModuleDbFiledsEntities.get(i)); + }else { + mdmModuleDbFiledsDao.update(mdmModuleDbFiledsEntities.get(i)); + } + } + } + } + @Override + @CacheEvict(cacheNames="mdmModuleDbFiledsRule",key = "#mdmId") + public void saveMdmModuleDbFiledsRule(String mdmId, List mdmModuleDbFiledsRuleEntities) { + MdmModuleDbFiledsRuleEntity mdmModuleDbFiledsRuleEntity = new MdmModuleDbFiledsRuleEntity(); + mdmModuleDbFiledsRuleEntity.setMdmId(mdmId); + mdmModuleDbFiledsRuleEntity.setSts("Y"); + mdmModuleDbFiledsRuleEntity.setUpdate(); + mdmModuleDbFiledsRuleDao.logicRemoveMultiCondition(mdmModuleDbFiledsRuleEntity); + if(mdmModuleDbFiledsRuleEntities != null && mdmModuleDbFiledsRuleEntities.size() > 0){ + for (int i = 0; i < mdmModuleDbFiledsRuleEntities.size(); i++) { + if("1".equals(mdmModuleDbFiledsRuleEntities.get(i).getDataType())){ + mdmModuleDbFiledsRuleDao.save(mdmModuleDbFiledsRuleEntities.get(i)); + }else { + mdmModuleDbFiledsRuleDao.update(mdmModuleDbFiledsRuleEntities.get(i)); + } + } + } + } + + @Override + @Cacheable(cacheNames="mdmModuleViewDetail",key = "#mdmId") + public List queryMdmModuleViewDetail(MdmModuleViewDetailEntity mdmModuleViewDetailEntity) { + List mdmModuleViewDetailEntities = mdmModuleViewDetailDao.queryBase(mdmModuleViewDetailEntity); + return mdmModuleViewDetailEntities; + } + + @Override + @Cacheable(cacheNames="mdmModuleView",key = "#mdmId") + public List queryMdmModuleView(MdmModuleViewEntity mdmModuleViewEntity) { + List moduleViewEntities = mdmModuleViewDao.queryBase(mdmModuleViewEntity); + return moduleViewEntities; + } + + @Override + @Cacheable(cacheNames="mdmModuleViewButton",key = "#mdmId") + public List queryMdmModuleViewButton(MdmModuleViewButtonEntity mdmModuleViewButtonEntity) { + List mdmModuleViewButtonEntities = mdmModuleViewButtonDao.queryBase(mdmModuleViewButtonEntity); + return mdmModuleViewButtonEntities; + } + + @Override + @CacheEvict(cacheNames="mdmModuleView",key = "#mdmId") + public void saveMdmModuleView(String mdmId, MdmModuleViewEntity mdmModuleViewEntity) { + mdmModuleViewDao.update(mdmModuleViewEntity); + } + + @Override + @CacheEvict(cacheNames="mdmModuleViewDetail",key = "#mdmId") + public void saveMdmModuleViewDetail(String mdmId, List mdmModuleViewDetailEntities) { + MdmModuleViewDetailEntity mdmModuleViewDetailEntity = new MdmModuleViewDetailEntity(); + mdmModuleViewDetailEntity.setMdmId(mdmId); + mdmModuleViewDetailEntity.setUpdate(); + mdmModuleViewDetailDao.logicRemoveMultiCondition(mdmModuleViewDetailEntity); + if(mdmModuleViewDetailEntities != null && mdmModuleViewDetailEntities.size() > 0){ + for (int i = 0; i < mdmModuleViewDetailEntities.size(); i++) { + if("1".equals(mdmModuleViewDetailEntities.get(i).getDataType())){ + mdmModuleViewDetailDao.save(mdmModuleViewDetailEntities.get(i)); + }else { + mdmModuleViewDetailDao.update(mdmModuleViewDetailEntities.get(i)); + } + } + } + } + + @Override + @CacheEvict(cacheNames="mdmModuleViewButton",key = "#mdmId") + public void saveMdmModuleViewButton(String mdmId, List mdmModuleViewButtonEntities) { + MdmModuleViewButtonEntity mdmModuleViewButtonEntity = new MdmModuleViewButtonEntity(); + mdmModuleViewButtonEntity.setMdmId(mdmId); + mdmModuleViewButtonEntity.setUpdate(); + mdmModuleViewButtonDao.logicRemoveMultiCondition(mdmModuleViewButtonEntity); + if(mdmModuleViewButtonEntities != null && mdmModuleViewButtonEntities.size() > 0){ + for (int i = 0; i < mdmModuleViewButtonEntities.size(); i++) { + if("1".equals(mdmModuleViewButtonEntities.get(i).getDataType())){ + mdmModuleViewButtonDao.save(mdmModuleViewButtonEntities.get(i)); + }else { + mdmModuleViewButtonDao.update(mdmModuleViewButtonEntities.get(i)); + } + } + } + } + } 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 99506fb6..33f29207 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 @@ -6,8 +6,12 @@ import com.alibaba.fastjson.JSONObject; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import com.hzya.frame.base.PluginBaseEntity; +import com.hzya.frame.mdm.entity.DbFiledsDto; +import com.hzya.frame.mdm.entity.MdmDbFiledVo; import com.hzya.frame.mdm.entity.MdmDbVo; import com.hzya.frame.mdm.entity.MdmDto; +import com.hzya.frame.mdm.entity.MdmModuleViewDto; +import com.hzya.frame.mdm.entity.MdmModuleViewVo; import com.hzya.frame.mdm.mdmModule.dao.IMdmModuleDao; import com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity; import com.hzya.frame.mdm.mdmModuleDb.dao.IMdmModuleDbDao; @@ -23,6 +27,7 @@ import com.hzya.frame.mdm.mdmModuleDistributeDetail.entity.MdmModuleDistributeDe import com.hzya.frame.mdm.mdmModuleView.dao.IMdmModuleViewDao; import com.hzya.frame.mdm.mdmModuleView.entity.MdmModuleViewEntity; import com.hzya.frame.mdm.mdmModuleViewButton.dao.IMdmModuleViewButtonDao; +import com.hzya.frame.mdm.mdmModuleViewButton.entity.MdmModuleViewButtonEntity; import com.hzya.frame.mdm.mdmModuleViewDetail.dao.IMdmModuleViewDetailDao; import com.hzya.frame.mdm.mdmModuleViewDetail.entity.MdmModuleViewDetailEntity; import com.hzya.frame.mdm.mdmTableCodeRule.entity.MdmTableCodeRuleEntity; @@ -34,7 +39,9 @@ import com.hzya.frame.sys.entity.ModuleDto; import com.hzya.frame.sys.module.entity.Module; import com.hzya.frame.sys.roleModule.entity.RoleModule; import com.hzya.frame.sysnew.application.plugin.entity.SysApplicationPluginEntity; +import com.hzya.frame.sysnew.buttonConfig.dao.ISysButtonConfigDao; import com.hzya.frame.sysnew.buttonConfig.entity.SysButtonConfigEntity; +import com.hzya.frame.sysnew.menuConfig.dao.ISysMenuConfigDao; import com.hzya.frame.sysnew.menuConfig.entity.SysMenuConfigEntity; import com.hzya.frame.util.PluginUtils; import com.hzya.frame.uuid.UUIDUtils; @@ -67,6 +74,10 @@ public class MdmServiceImpl implements IMdmService { @Resource private IMdmServiceCache mdmServiceCache; @Resource + private ISysMenuConfigDao sysMenuConfigDao; + @Resource + private ISysButtonConfigDao sysButtonConfigDao; + @Resource private IMdmModuleDbDao mdmModuleDbDao; @Resource private IMdmModuleDbFiledsDao mdmModuleDbFiledsDao; @@ -368,48 +379,1000 @@ public class MdmServiceImpl implements IMdmService { List mdmModuleDbFiledsEntities = new ArrayList<>(); List mdmModuleDbFiledsRuleEntities = new ArrayList<>(); - - //保存主数据单据编号规则 - if (mdmTableCodeRuleEntities != null && mdmTableCodeRuleEntities.size() > 0) { - for (int i = 0; i < mdmTableCodeRuleEntities.size(); i++) { - MdmTableCodeRuleEntity mdmTableCodeRuleEntity = mdmTableCodeRuleEntities.get(i); - mdmTableCodeRuleEntity.setMdmId(mdmModuleEntity.getId()); - mdmTableCodeRuleEntity.setDbId(mainMdmModuleDb.getId()); - mdmTableCodeRuleEntity.setId(UUIDUtils.getUUID()); - mdmTableCodeRuleEntity.setSts("Y"); - mdmTableCodeRuleEntity.setCreate_user_id(StpUtil.getLoginIdAsString()); - mdmTableCodeRuleEntity.setModify_user_id(StpUtil.getLoginIdAsString()); - mdmTableCodeRuleEntity.setCreate_time(new Date()); - mdmTableCodeRuleEntity.setModify_time(new Date()); - //mdmTableCodeRuleDao.save(mdmTableCodeRuleEntity); - } - } //主表 if(mainMdmModuleDb.getId() != null && !"".equals(mainMdmModuleDb.getId())){ - + //修改 + mainMdmModuleDb.setDataType("2"); + mainMdmModuleDb.setUpdate(); + }else { + //新增 + mainMdmModuleDb.setDataType("1"); + mainMdmModuleDb.setMdmId(mdmModuleEntity.getId()); + mainMdmModuleDb.setCreate(); + } + mainMdmModuleDb.setDbType("1"); + mdmModuleDbEntities.add(mainMdmModuleDb); + for (int i = 0; i < mdmTableCodeRuleEntities.size(); i++) { + mdmTableCodeRuleEntities.get(i).setMdmId(mdmModuleEntity.getId()); + mdmTableCodeRuleEntities.get(i).setDbId(mainMdmModuleDb.getId()); + mdmTableCodeRuleEntities.get(i).setCreate(); + } + for (int i = 0; i < mainMdmModuleDbFileds.size(); i++) { + if(mainMdmModuleDbFileds.get(i).getId() != null && !"".equals(mainMdmModuleDbFileds.get(i).getId())){ + //修改 + mainMdmModuleDbFileds.get(i).setDataType("2"); + mainMdmModuleDbFileds.get(i).setUpdate(); + }else { + //新增 + mainMdmModuleDbFileds.get(i).setDataType("1"); + mainMdmModuleDbFileds.get(i).setCreate(); + } + mainMdmModuleDbFileds.get(i).setMdmId(mdmModuleEntity.getId()); + mainMdmModuleDbFileds.get(i).setDbId(mainMdmModuleDb.getId()); + mainMdmModuleDbFileds.get(i).setAddType("1"); + mainMdmModuleDbFileds.get(i).setUpdateType("1"); + mainMdmModuleDbFileds.get(i).setShowType("1"); + mainMdmModuleDbFileds.get(i).setQueryType("1"); + mainMdmModuleDbFileds.get(i).setListType("1"); + mainMdmModuleDbFileds.get(i).setViewType("1"); + if(mainMdmModuleDbFileds.get(i).getMdmModuleDbFiledsRules() != null && mainMdmModuleDbFileds.get(i).getMdmModuleDbFiledsRules().size() > 0){ + for (int i1 = 0; i1 < mainMdmModuleDbFileds.get(i).getMdmModuleDbFiledsRules().size(); i1++) { + MdmModuleDbFiledsRuleEntity mdmModuleDbFiledsRuleEntity = mainMdmModuleDbFileds.get(i).getMdmModuleDbFiledsRules().get(i1); + if(mdmModuleDbFiledsRuleEntity.getId() != null && !"".equals(mdmModuleDbFiledsRuleEntity.getId())){ + //修改 + mdmModuleDbFiledsRuleEntity.setDataType("2"); + mdmModuleDbFiledsRuleEntity.setUpdate(); + }else { + //新增 + mdmModuleDbFiledsRuleEntity.setDataType("1"); + mdmModuleDbFiledsRuleEntity.setCreate(); + } + mdmModuleDbFiledsRuleEntities.add(mdmModuleDbFiledsRuleEntity); + } + } + mdmModuleDbFiledsEntities.add(mainMdmModuleDbFileds.get(i)); + } + if("1".equals(mainMdmModuleDb.getDataType())){ + //新增 设置默认字段 + List moduleDbFiledsEntities = getCreateMdm(mdmModuleEntity.getId(),mainMdmModuleDb.getId(),"1"); + mdmModuleDbFiledsEntities.addAll(moduleDbFiledsEntities); + } + //明细表 + if(sublistMdmModuleDb != null && sublistMdmModuleDb.size() > 0){ + for (int i = 0; i < sublistMdmModuleDb.size(); i++) { + MdmModuleDbEntity mdmModuleDbEntity = sublistMdmModuleDb.get(i); + if(mdmModuleDbEntity.getId() != null && !"".equals(mdmModuleDbEntity.getId())){ + //修改 + mdmModuleDbEntity.setDataType("2"); + mdmModuleDbEntity.setUpdate(); + }else { + //新增 + mdmModuleDbEntity.setDataType("1"); + mdmModuleDbEntity.setMdmId(mdmModuleEntity.getId()); + mdmModuleDbEntity.setCreate(); + } + mainMdmModuleDb.setDbType("2"); + mdmModuleDbEntities.add(mdmModuleDbEntity); + for (int a = 0; a < mdmModuleDbEntity.getSublistMdmModuleDbFileds().size(); a++) { + if(mdmModuleDbEntity.getSublistMdmModuleDbFileds().get(a).getId() != null && !"".equals(mdmModuleDbEntity.getSublistMdmModuleDbFileds().get(a).getId())){ + //修改 + mdmModuleDbEntity.getSublistMdmModuleDbFileds().get(a).setDataType("2"); + mdmModuleDbEntity.getSublistMdmModuleDbFileds().get(a).setUpdate(); + }else { + //新增 + mdmModuleDbEntity.getSublistMdmModuleDbFileds().get(a).setDataType("1"); + mdmModuleDbEntity.getSublistMdmModuleDbFileds().get(a).setCreate(); + } + mdmModuleDbEntity.getSublistMdmModuleDbFileds().get(a).setMdmId(mdmModuleEntity.getId()); + mdmModuleDbEntity.getSublistMdmModuleDbFileds().get(a).setDbId(mainMdmModuleDb.getId()); + mdmModuleDbEntity.getSublistMdmModuleDbFileds().get(a).setAddType("1"); + mdmModuleDbEntity.getSublistMdmModuleDbFileds().get(a).setUpdateType("1"); + mdmModuleDbEntity.getSublistMdmModuleDbFileds().get(a).setShowType("1"); + mdmModuleDbEntity.getSublistMdmModuleDbFileds().get(a).setQueryType("1"); + mdmModuleDbEntity.getSublistMdmModuleDbFileds().get(a).setListType("1"); + mdmModuleDbEntity.getSublistMdmModuleDbFileds().get(a).setViewType("1"); + if(mdmModuleDbEntity.getSublistMdmModuleDbFileds().get(a).getMdmModuleDbFiledsRules() != null && mdmModuleDbEntity.getSublistMdmModuleDbFileds().get(a).getMdmModuleDbFiledsRules().size() > 0){ + for (int i1 = 0; i1 < mainMdmModuleDbFileds.get(a).getMdmModuleDbFiledsRules().size(); i1++) { + MdmModuleDbFiledsRuleEntity mdmModuleDbFiledsRuleEntity = mainMdmModuleDbFileds.get(a).getMdmModuleDbFiledsRules().get(i1); + if(mdmModuleDbFiledsRuleEntity.getId() != null && !"".equals(mdmModuleDbFiledsRuleEntity.getId())){ + //修改 + mdmModuleDbFiledsRuleEntity.setDataType("2"); + mdmModuleDbFiledsRuleEntity.setUpdate(); + }else { + //新增 + mdmModuleDbFiledsRuleEntity.setDataType("1"); + mdmModuleDbFiledsRuleEntity.setCreate(); + } + mdmModuleDbFiledsRuleEntities.add(mdmModuleDbFiledsRuleEntity); + } + } + mdmModuleDbFiledsEntities.add(mdmModuleDbEntity.getSublistMdmModuleDbFileds().get(a)); + } + if("1".equals(mainMdmModuleDb.getDataType())){ + //新增 设置默认字段 + List moduleDbFiledsEntities = getCreateMdm(mdmModuleEntity.getId(),mainMdmModuleDb.getId(),"2"); + mdmModuleDbFiledsEntities.addAll(moduleDbFiledsEntities); + } + } } - //明细表 + //新增日志表 + if("1".equals(mainMdmModuleDb.getDataType())){ + MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); + mdmModuleDbEntity.setMdmId(mdmModuleEntity.getId()); + mdmModuleDbEntity.setDbName(mainMdmModuleDb.getDbName()+"_option_log"); + mdmModuleDbEntity.setDbType("3"); + mdmModuleDbEntity.setDataType("1"); + mdmModuleDbEntity.setCreate(); + mdmModuleDbEntities.add(mdmModuleDbEntity); + //新增 设置日志表 + List moduleDbFiledsEntities = getCreateMdm(mdmModuleEntity.getId(),mdmModuleDbEntity.getId(),"3"); + mdmModuleDbFiledsEntities.addAll(moduleDbFiledsEntities); + MdmModuleDbEntity mdmModuleDbEntity1 = new MdmModuleDbEntity(); + mdmModuleDbEntity1.setMdmId(mdmModuleEntity.getId()); + mdmModuleDbEntity1.setDbName(mainMdmModuleDb.getDbName()+"_option_log"); + mdmModuleDbEntity1.setDbType("4"); + mdmModuleDbEntity1.setDataType("1"); + mdmModuleDbEntity1.setCreate(); + mdmModuleDbEntities.add(mdmModuleDbEntity1); + //新增 设置日志表 + List moduleDbFiledsEntities1 = getCreateMdm(mdmModuleEntity.getId(),mdmModuleDbEntity1.getId(),"4"); + mdmModuleDbFiledsEntities.addAll(moduleDbFiledsEntities1); + } + //保存单据规则 + mdmServiceCache.saveMdmTableCodeRule(mdmModuleEntity.getId(),mdmTableCodeRuleEntities); + //保存db + mdmServiceCache.saveMdmModuleDb(mdmModuleEntity.getId(),mdmModuleDbEntities); + //保存字段 + mdmServiceCache.saveMdmModuleDbFileds(mdmModuleEntity.getId(),mdmModuleDbFiledsEntities); + //保存规则 + mdmServiceCache.saveMdmModuleDbFiledsRule(mdmModuleEntity.getId(),mdmModuleDbFiledsRuleEntities); + //创建或者修改表 - - ////设置保存主表和字段以及字段的属性 - //setMainTable(entity, mainMdmModuleDb, mainMdmModuleDbFileds); - ////设置保存子表数据 - //setsublistTable(entity, mainMdmModuleDb, sublistMdmModuleDb); - ////保存规则 - //List mdmTableCodeRuleEntityList = entity.getMdmTableCodeRuleEntityList(); - //MdmTableCodeRuleEntity deleteOldData = new MdmTableCodeRuleEntity(); - //deleteOldData.setDbId(mainMdmModuleDb.getId()); - //deleteOldData.setMdmId(entity.getId()); - //deleteOldData.setSts("Y"); - //deleteOldData.setModify_user_id(StpUtil.getLoginIdAsString()); - //deleteOldData.setModify_time(new Date()); - //mdmTableCodeRuleDao.logicRemoveMultiCondition(deleteOldData); - + for (int i = 0; i < mdmModuleDbEntities.size(); i++) { + Map maps = new HashMap<>(); + maps.put("tableName", mdmModuleDbEntities.get(i).getDbName());//表名 + maps.put("tableRemark", mdmModuleDbEntities.get(i).getRemark());//表备注 + List dbFiledsDtos = new ArrayList<>(); + for (int i1 = 0; i1 < mdmModuleDbFiledsEntities.size(); i1++) { + if(mdmModuleDbEntities.get(i).getId().equals(mdmModuleDbFiledsEntities.get(i1).getDbId())){ + dbFiledsDtos.add(new DbFiledsDto(mdmModuleDbFiledsEntities.get(i1).getDataType(), mdmModuleDbFiledsEntities.get(i1).getChName(), mdmModuleDbFiledsEntities.get(i1).getEnName(), mdmModuleDbFiledsEntities.get(i1).getFiledType(), mdmModuleDbFiledsEntities.get(i1).getFiledLength())); + } + } + maps.put("databaseFields", dbFiledsDtos);//字段 + if("1".equals(mdmModuleDbEntities.get(i).getDataType())){ + mdmModuleDao.createTable(maps); + }else { + Map tablename = new HashMap<>(); + tablename.put("tableName", mdmModuleDbEntities.get(i).getDbName());//表名 + tablename.put("tableRemark", mdmModuleDbEntities.get(i).getRemark());//表备注 + mdmModuleDao.alterTableName(tablename); + mdmModuleDao.alterTable(maps); + } + } return BaseResult.getSuccessMessageEntity("保存数据源成功"); } + + /** + * @Author lvleigang + * @Description 新建设置默认字段 + * @Date 2:06 下午 2024/6/3 + * @param mdmId + * @param dbId + * @param type + * @return java.util.List + **/ + private List getCreateMdm(String mdmId, String dbId, String type) { + List mdmModuleDbFiledsEntities = new ArrayList<>(); + MdmModuleDbFiledsEntity id = new MdmModuleDbFiledsEntity(); + id.setMdmId(mdmId); + id.setDbId(dbId); + id.setChName("id"); + id.setEnName("id"); + id.setFiledType("3"); + id.setAddType("2"); + id.setUpdateType("2"); + id.setShowType("2"); + id.setQueryType("2"); + id.setListType("2"); + id.setViewType("2"); + id.setFiledLength("50"); + id.setDataType("1"); + mdmModuleDbFiledsEntities.add(id); + + if("1".equals(type)){ + MdmModuleDbFiledsEntity documentRule = new MdmModuleDbFiledsEntity(); + documentRule.setMdmId(mdmId); + documentRule.setDbId(dbId); + documentRule.setChName("document_rule"); + documentRule.setEnName("单据规则"); + documentRule.setFiledType("3"); + documentRule.setAddType("2"); + documentRule.setUpdateType("2"); + documentRule.setShowType("2"); + documentRule.setQueryType("2"); + documentRule.setListType("2"); + documentRule.setViewType("2"); + documentRule.setFiledLength("50"); + documentRule.setDataType("1"); + mdmModuleDbFiledsEntities.add(documentRule); + } + + if("1".equals(type)){ + MdmModuleDbFiledsEntity document_rule_num = new MdmModuleDbFiledsEntity(); + document_rule_num.setMdmId(mdmId); + document_rule_num.setDbId(dbId); + document_rule_num.setChName("document_rule_num"); + document_rule_num.setEnName("单据规则流水号"); + document_rule_num.setFiledType("1"); + document_rule_num.setAddType("2"); + document_rule_num.setUpdateType("2"); + document_rule_num.setShowType("2"); + document_rule_num.setQueryType("2"); + document_rule_num.setListType("2"); + document_rule_num.setViewType("2"); + document_rule_num.setFiledLength("50"); + document_rule_num.setDataType("1"); + mdmModuleDbFiledsEntities.add(document_rule_num); + } + if("2".equals(type) || "3".equals(type) || "4".equals(type) ){ + MdmModuleDbFiledsEntity formmain_id = new MdmModuleDbFiledsEntity(); + formmain_id.setMdmId(mdmId); + formmain_id.setDbId(dbId); + formmain_id.setChName("formmain_id"); + formmain_id.setEnName("主表id"); + formmain_id.setFiledType("3"); + formmain_id.setAddType("2"); + formmain_id.setUpdateType("2"); + formmain_id.setShowType("2"); + formmain_id.setQueryType("2"); + formmain_id.setListType("2"); + formmain_id.setViewType("2"); + formmain_id.setFiledLength("50"); + formmain_id.setDataType("1"); + mdmModuleDbFiledsEntities.add(formmain_id); + } + //写入日志字段:操作人 + if("3".equals(type)){ + MdmModuleDbFiledsEntity source_name = new MdmModuleDbFiledsEntity(); + source_name.setMdmId(mdmId); + source_name.setDbId(dbId); + source_name.setChName("source_name"); + source_name.setEnName("来源名称"); + source_name.setFiledType("3"); + source_name.setAddType("2"); + source_name.setUpdateType("2"); + source_name.setShowType("2"); + source_name.setQueryType("2"); + source_name.setListType("2"); + source_name.setViewType("2"); + source_name.setFiledLength("50"); + source_name.setDataType("1"); + mdmModuleDbFiledsEntities.add(source_name); + + MdmModuleDbFiledsEntity code = new MdmModuleDbFiledsEntity(); + code.setMdmId(mdmId); + code.setDbId(dbId); + code.setChName("code"); + code.setEnName("编码"); + code.setFiledType("3"); + code.setAddType("2"); + code.setUpdateType("2"); + code.setShowType("2"); + code.setQueryType("2"); + code.setListType("2"); + code.setViewType("2"); + code.setFiledLength("50"); + code.setDataType("1"); + mdmModuleDbFiledsEntities.add(code); + + MdmModuleDbFiledsEntity source_data = new MdmModuleDbFiledsEntity(); + source_data.setMdmId(mdmId); + source_data.setDbId(dbId); + source_data.setChName("source_data"); + source_data.setEnName("源数据"); + source_data.setFiledType("3"); + source_data.setAddType("2"); + source_data.setUpdateType("2"); + source_data.setShowType("2"); + source_data.setQueryType("2"); + source_data.setListType("2"); + source_data.setViewType("2"); + source_data.setFiledLength("255"); + source_data.setDataType("1"); + mdmModuleDbFiledsEntities.add(source_data); + + MdmModuleDbFiledsEntity option_type = new MdmModuleDbFiledsEntity(); + option_type.setMdmId(mdmId); + option_type.setDbId(dbId); + option_type.setChName("option_type"); + option_type.setEnName("操作类型"); + option_type.setFiledType("3"); + option_type.setAddType("2"); + option_type.setUpdateType("2"); + option_type.setShowType("2"); + option_type.setQueryType("2"); + option_type.setListType("2"); + option_type.setViewType("2"); + option_type.setFiledLength("255"); + option_type.setDataType("1"); + mdmModuleDbFiledsEntities.add(option_type); + + MdmModuleDbFiledsEntity option_Name = new MdmModuleDbFiledsEntity(); + option_Name.setMdmId(mdmId); + option_Name.setDbId(dbId); + option_Name.setChName("option_Name"); + option_Name.setEnName("操作人"); + option_Name.setFiledType("3"); + option_Name.setAddType("2"); + option_Name.setUpdateType("2"); + option_Name.setShowType("2"); + option_Name.setQueryType("2"); + option_Name.setListType("2"); + option_Name.setViewType("2"); + option_Name.setFiledLength("255"); + option_Name.setDataType("1"); + mdmModuleDbFiledsEntities.add(option_Name); + } + + //目标应用、目标api、 + if("4".equals(type)){ + MdmModuleDbFiledsEntity target_app = new MdmModuleDbFiledsEntity(); + target_app.setMdmId(mdmId); + target_app.setDbId(dbId); + target_app.setChName("target_app"); + target_app.setEnName("目标应用"); + target_app.setFiledType("1"); + target_app.setAddType("2"); + target_app.setUpdateType("2"); + target_app.setShowType("2"); + target_app.setQueryType("2"); + target_app.setListType("2"); + target_app.setViewType("2"); + target_app.setFiledLength("50"); + target_app.setDataType("1"); + mdmModuleDbFiledsEntities.add(target_app); + + MdmModuleDbFiledsEntity target_api = new MdmModuleDbFiledsEntity(); + target_api.setMdmId(mdmId); + target_api.setDbId(dbId); + target_api.setChName("target_api"); + target_api.setEnName("目标api"); + target_api.setFiledType("1"); + target_api.setAddType("2"); + target_api.setUpdateType("2"); + target_api.setShowType("2"); + target_api.setQueryType("2"); + target_api.setListType("2"); + target_api.setViewType("2"); + target_api.setFiledLength("50"); + target_api.setDataType("1"); + mdmModuleDbFiledsEntities.add(target_api); + + MdmModuleDbFiledsEntity source_data = new MdmModuleDbFiledsEntity(); + source_data.setMdmId(mdmId); + source_data.setDbId(dbId); + source_data.setChName("source_data"); + source_data.setEnName("源数据"); + source_data.setFiledType("3"); + source_data.setAddType("2"); + source_data.setUpdateType("2"); + source_data.setShowType("2"); + source_data.setQueryType("2"); + source_data.setListType("2"); + source_data.setViewType("2"); + source_data.setFiledLength("255"); + source_data.setDataType("1"); + mdmModuleDbFiledsEntities.add(source_data); + + MdmModuleDbFiledsEntity option_type = new MdmModuleDbFiledsEntity(); + option_type.setMdmId(mdmId); + option_type.setDbId(dbId); + option_type.setChName("option_type"); + option_type.setEnName("操作类型"); + option_type.setFiledType("3"); + option_type.setAddType("2"); + option_type.setUpdateType("2"); + option_type.setShowType("2"); + option_type.setQueryType("2"); + option_type.setListType("2"); + option_type.setViewType("2"); + option_type.setFiledLength("255"); + option_type.setDataType("1"); + mdmModuleDbFiledsEntities.add(option_type); + } + + MdmModuleDbFiledsEntity data_status = new MdmModuleDbFiledsEntity(); + data_status.setMdmId(mdmId); + data_status.setDbId(dbId); + data_status.setChName("data_status"); + data_status.setEnName("数据状态 Y正常 N删除 F修改"); + data_status.setFiledType("3"); + data_status.setAddType("2"); + data_status.setUpdateType("2"); + data_status.setShowType("2"); + data_status.setQueryType("2"); + data_status.setListType("2"); + data_status.setViewType("2"); + data_status.setFiledLength("1"); + data_status.setDataType("1"); + mdmModuleDbFiledsEntities.add(data_status); + if("2".equals(type)){ + MdmModuleDbFiledsEntity add_status = new MdmModuleDbFiledsEntity(); + add_status.setMdmId(mdmId); + add_status.setDbId(dbId); + add_status.setChName("add_status"); + add_status.setEnName("新增数据状态 0待下发 1已下发"); + add_status.setFiledType("3"); + add_status.setAddType("2"); + add_status.setUpdateType("2"); + add_status.setShowType("2"); + add_status.setQueryType("2"); + add_status.setListType("2"); + add_status.setViewType("2"); + add_status.setFiledLength("1"); + add_status.setDataType("1"); + mdmModuleDbFiledsEntities.add(add_status); + } + if("2".equals(type)){ + MdmModuleDbFiledsEntity update_status = new MdmModuleDbFiledsEntity(); + update_status.setMdmId(mdmId); + update_status.setDbId(dbId); + update_status.setChName("update_status"); + update_status.setEnName("修改数据状态 0待下发 1已下发"); + update_status.setFiledType("3"); + update_status.setAddType("2"); + update_status.setUpdateType("2"); + update_status.setShowType("2"); + update_status.setQueryType("2"); + update_status.setListType("2"); + update_status.setViewType("2"); + update_status.setFiledLength("1"); + update_status.setDataType("1"); + mdmModuleDbFiledsEntities.add(update_status); + } + + if("2".equals(type)){ + MdmModuleDbFiledsEntity delete_status = new MdmModuleDbFiledsEntity(); + delete_status.setMdmId(mdmId); + delete_status.setDbId(dbId); + delete_status.setChName("delete_status"); + delete_status.setEnName("修删除数据状态 0待下发 1已下发"); + delete_status.setFiledType("3"); + delete_status.setAddType("2"); + delete_status.setUpdateType("2"); + delete_status.setShowType("2"); + delete_status.setQueryType("2"); + delete_status.setListType("2"); + delete_status.setViewType("2"); + delete_status.setFiledLength("1"); + delete_status.setDataType("1"); + mdmModuleDbFiledsEntities.add(delete_status); + } + + MdmModuleDbFiledsEntity sorts = new MdmModuleDbFiledsEntity(); + sorts.setMdmId(mdmId); + sorts.setDbId(dbId); + sorts.setChName("sorts"); + sorts.setEnName("排序"); + sorts.setFiledType("1"); + sorts.setAddType("2"); + sorts.setUpdateType("2"); + sorts.setShowType("2"); + sorts.setQueryType("2"); + sorts.setListType("2"); + sorts.setViewType("2"); + sorts.setFiledLength("20"); + sorts.setDataType("1"); + mdmModuleDbFiledsEntities.add(sorts); + MdmModuleDbFiledsEntity create_user_id = new MdmModuleDbFiledsEntity(); + create_user_id.setMdmId(mdmId); + create_user_id.setDbId(dbId); + create_user_id.setChName("create_user_id"); + create_user_id.setEnName("创建人id"); + create_user_id.setFiledType("3"); + create_user_id.setAddType("2"); + create_user_id.setUpdateType("2"); + create_user_id.setShowType("2"); + create_user_id.setQueryType("2"); + create_user_id.setListType("2"); + create_user_id.setViewType("2"); + create_user_id.setFiledLength("50"); + create_user_id.setDataType("1"); + mdmModuleDbFiledsEntities.add(create_user_id); + MdmModuleDbFiledsEntity create_time = new MdmModuleDbFiledsEntity(); + create_time.setMdmId(mdmId); + create_time.setDbId(dbId); + create_time.setChName("create_time"); + create_time.setEnName("创建时间"); + create_time.setFiledType("4"); + create_time.setAddType("2"); + create_time.setUpdateType("2"); + create_time.setShowType("2"); + create_time.setQueryType("2"); + create_time.setListType("2"); + create_time.setViewType("2"); + create_time.setFiledLength("50"); + create_time.setDataType("1"); + mdmModuleDbFiledsEntities.add(create_time); + MdmModuleDbFiledsEntity modify_user_id = new MdmModuleDbFiledsEntity(); + modify_user_id.setMdmId(mdmId); + modify_user_id.setDbId(dbId); + modify_user_id.setChName("modify_user_id"); + modify_user_id.setEnName("修改人id"); + modify_user_id.setFiledType("3"); + modify_user_id.setAddType("2"); + modify_user_id.setUpdateType("2"); + modify_user_id.setShowType("2"); + modify_user_id.setQueryType("2"); + modify_user_id.setListType("2"); + modify_user_id.setViewType("2"); + modify_user_id.setFiledLength("50"); + modify_user_id.setDataType("1"); + mdmModuleDbFiledsEntities.add(modify_user_id); + MdmModuleDbFiledsEntity modify_time = new MdmModuleDbFiledsEntity(); + modify_time.setMdmId(mdmId); + modify_time.setDbId(dbId); + modify_time.setChName("modify_time"); + modify_time.setEnName("修改时间"); + modify_time.setFiledType("4"); + modify_time.setAddType("2"); + modify_time.setUpdateType("2"); + modify_time.setShowType("2"); + modify_time.setQueryType("2"); + modify_time.setListType("2"); + modify_time.setViewType("2"); + modify_time.setFiledLength("50"); + modify_time.setDataType("1"); + mdmModuleDbFiledsEntities.add(modify_time); + MdmModuleDbFiledsEntity sts = new MdmModuleDbFiledsEntity(); + sts.setMdmId(mdmId); + sts.setDbId(dbId); + sts.setChName("sts"); + sts.setEnName("状态(Y正常N删除)"); + sts.setFiledType("3"); + sts.setAddType("2"); + sts.setUpdateType("2"); + sts.setShowType("2"); + sts.setQueryType("2"); + sts.setListType("2"); + sts.setViewType("2"); + sts.setFiledLength("1"); + sts.setDataType("1"); + mdmModuleDbFiledsEntities.add(sts); + MdmModuleDbFiledsEntity org_id = new MdmModuleDbFiledsEntity(); + org_id.setMdmId(mdmId); + org_id.setDbId(dbId); + org_id.setChName("org_id"); + org_id.setEnName("组织机构ID"); + org_id.setFiledType("3"); + org_id.setAddType("2"); + org_id.setUpdateType("2"); + org_id.setShowType("2"); + org_id.setQueryType("2"); + org_id.setListType("2"); + org_id.setViewType("2"); + org_id.setFiledLength("50"); + org_id.setDataType("1"); + mdmModuleDbFiledsEntities.add(org_id); + MdmModuleDbFiledsEntity company_id = new MdmModuleDbFiledsEntity(); + company_id.setMdmId(mdmId); + company_id.setDbId(dbId); + company_id.setChName("company_id"); + company_id.setEnName("公司id"); + company_id.setFiledType("3"); + company_id.setAddType("2"); + company_id.setUpdateType("2"); + company_id.setShowType("2"); + company_id.setQueryType("2"); + company_id.setListType("2"); + company_id.setViewType("2"); + company_id.setFiledLength("50"); + company_id.setDataType("1"); + mdmModuleDbFiledsEntities.add(company_id); + return mdmModuleDbFiledsEntities; + } + + + /** + * @param object + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 主数据设置查询显示信息 + * @Date 9:40 上午 2023/10/18 + **/ + @Override + public JsonResultEntity queryMdmModuleView(JSONObject object) { + MdmModuleEntity entity = getData("jsonStr", object, MdmModuleEntity.class); + //判断分页 + if (entity == null) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + if (entity.getMdmCode() == null || "".equals(entity.getMdmCode())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + MdmModuleViewVo mdmModuleViewVo = new MdmModuleViewVo(); + + MdmModuleEntity mdmModuleEntity = mdmServiceCache.getMdmModuleEntity(entity.getMdmCode()); + //查询数据库字段 + MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); + mdmModuleDbEntity.setMdmId(mdmModuleEntity.getId()); + mdmModuleDbEntity.setSts("Y"); + List mdmModuleDbEntities = mdmServiceCache.queryMdmModuleDb(mdmModuleDbEntity); + MdmModuleDbFiledsEntity mdmModuleDbFiledsEntity = new MdmModuleDbFiledsEntity(); + mdmModuleDbFiledsEntity.setMdmId(mdmModuleEntity.getId()); + mdmModuleDbFiledsEntity.setSts("Y"); + List mdmModuleDbFiledsEntities = mdmServiceCache.queryMdmModuleDbFileds(mdmModuleDbFiledsEntity); + + //设置数据库字段 + setFiledType(mdmModuleViewVo,mdmModuleDbEntities,mdmModuleDbFiledsEntities); + + MdmModuleViewDetailEntity mdmModuleViewDetailEntity = new MdmModuleViewDetailEntity(); + mdmModuleViewDetailEntity.setMdmId(mdmModuleEntity.getId()); + mdmModuleViewDetailEntity.setSts("Y"); + List mdmModuleViewDetailEntities = mdmServiceCache.queryMdmModuleViewDetail(mdmModuleViewDetailEntity); + setDbFiledType(mdmModuleViewVo,mdmModuleViewDetailEntities); + MdmModuleViewEntity mdmModuleViewEntity = new MdmModuleViewEntity(); + mdmModuleViewEntity.setMdmId(mdmModuleEntity.getId()); + mdmModuleViewEntity.setSts("Y"); + List moduleViewEntities = mdmServiceCache.queryMdmModuleView(mdmModuleViewEntity); + if(moduleViewEntities != null && moduleViewEntities.size() == 1){ + mdmModuleViewVo.setMdmModuleViewEntity(moduleViewEntities.get(0)); + } + MdmModuleViewButtonEntity mdmModuleViewButtonEntity = new MdmModuleViewButtonEntity(); + mdmModuleViewButtonEntity.setMdmId(mdmModuleEntity.getId()); + mdmModuleViewButtonEntity.setSts("Y"); + List mdmModuleViewButtonEntities = mdmServiceCache.queryMdmModuleViewButton(mdmModuleViewButtonEntity); + mdmModuleViewVo.setDbButtonFiled(mdmModuleViewButtonEntities); + return BaseResult.getSuccessMessageEntity("查询视图成功", mdmModuleViewVo); + } + + private void setDbFiledType(MdmModuleViewVo mdmModuleViewVo, List mdmModuleViewDetailEntityList) { + //新增 + List addFiled = new ArrayList<>(); + //修改 + List editFiled = new ArrayList<>(); + //查看 + List showFiled = new ArrayList<>(); + //查询 + List queryFiled = new ArrayList<>(); + //列表 + List listFiled = new ArrayList<>(); + if (mdmModuleViewDetailEntityList != null && mdmModuleViewDetailEntityList.size() > 0) { + for (int i = 0; i < mdmModuleViewDetailEntityList.size(); i++) { + switch (mdmModuleViewDetailEntityList.get(i).getViewType()) { + //1、查询2、列表3、新增4、修改 5、查看 + case "1": + queryFiled.add(mdmModuleViewDetailEntityList.get(i)); + break; + case "2": + listFiled.add(mdmModuleViewDetailEntityList.get(i)); + break; + case "3": + addFiled.add(mdmModuleViewDetailEntityList.get(i)); + break; + case "4": + editFiled.add(mdmModuleViewDetailEntityList.get(i)); + break; + case "5": + showFiled.add(mdmModuleViewDetailEntityList.get(i)); + break; + default: + } + } + } + mdmModuleViewVo.setDbAddFiled(addFiled); + mdmModuleViewVo.setDbEditFiled(editFiled); + mdmModuleViewVo.setDbShowFiled(showFiled); + mdmModuleViewVo.setDbQueryFiled(queryFiled); + mdmModuleViewVo.setDbListFiled(listFiled); + } + + /** + * @param mdmModuleViewVo + * @param mdmModuleDbEntityList + * @param mdmModuleDbFiledsEntityList + * @return void + * @Author lvleigang + * @Description 设置对应的字段类型 + * @Date 2023/10/25 + **/ + private void setFiledType(MdmModuleViewVo mdmModuleViewVo, List mdmModuleDbEntityList, List mdmModuleDbFiledsEntityList) { + //新增 + List addFiled = new ArrayList<>(); + //修改 + List editFiled = new ArrayList<>(); + //查看 + List showFiled = new ArrayList<>(); + //查询 + List queryFiled = new ArrayList<>(); + //列表 + List listFiled = new ArrayList<>(); + if (mdmModuleDbEntityList != null && mdmModuleDbEntityList.size() > 0) { + for (int i = 0; i < mdmModuleDbEntityList.size(); i++) { + + if (mdmModuleDbFiledsEntityList != null && mdmModuleDbFiledsEntityList.size() > 0) { + for (int i1 = 0; i1 < mdmModuleDbFiledsEntityList.size(); i1++) { + if (mdmModuleDbEntityList.get(i).getId().equals(mdmModuleDbFiledsEntityList.get(i1).getDbId())) { + if("1".equals(mdmModuleDbFiledsEntityList.get(i1).getViewType())){ + if ("1".equals(mdmModuleDbEntityList.get(i).getDbType())) { + //1、主表 + if ("1".equals(mdmModuleDbFiledsEntityList.get(i1).getAddType())) { + addFiled.add(new MdmDbFiledVo(mdmModuleDbFiledsEntityList.get(i1).getId(), "【主表:" + mdmModuleDbEntityList.get(i).getDbName() + "】" + mdmModuleDbFiledsEntityList.get(i1).getChName())); + } + if ("1".equals(mdmModuleDbFiledsEntityList.get(i1).getUpdateType())) { + editFiled.add(new MdmDbFiledVo(mdmModuleDbFiledsEntityList.get(i1).getId(), "【主表:" + mdmModuleDbEntityList.get(i).getDbName() + "】" + mdmModuleDbFiledsEntityList.get(i1).getChName())); + } + if ("1".equals(mdmModuleDbFiledsEntityList.get(i1).getShowType())) { + showFiled.add(new MdmDbFiledVo(mdmModuleDbFiledsEntityList.get(i1).getId(), "【主表:" + mdmModuleDbEntityList.get(i).getDbName() + "】" + mdmModuleDbFiledsEntityList.get(i1).getChName())); + } + if ("1".equals(mdmModuleDbFiledsEntityList.get(i1).getQueryType())) { + queryFiled.add(new MdmDbFiledVo(mdmModuleDbFiledsEntityList.get(i1).getId(), "【主表:" + mdmModuleDbEntityList.get(i).getDbName() + "】" + mdmModuleDbFiledsEntityList.get(i1).getChName())); + } + if ("1".equals(mdmModuleDbFiledsEntityList.get(i1).getListType())) { + listFiled.add(new MdmDbFiledVo(mdmModuleDbFiledsEntityList.get(i1).getId(), "【主表:" + mdmModuleDbEntityList.get(i).getDbName() + "】" + mdmModuleDbFiledsEntityList.get(i1).getChName())); + } + } else if ("2".equals(mdmModuleDbEntityList.get(i).getDbType())){ + //2、明细 + if ("1".equals(mdmModuleDbFiledsEntityList.get(i1).getAddType())) { + addFiled.add(new MdmDbFiledVo(mdmModuleDbFiledsEntityList.get(i1).getId(), "【子表:" + mdmModuleDbEntityList.get(i).getDbName() + "】" + mdmModuleDbFiledsEntityList.get(i1).getChName())); + } + if ("1".equals(mdmModuleDbFiledsEntityList.get(i1).getUpdateType())) { + editFiled.add(new MdmDbFiledVo(mdmModuleDbFiledsEntityList.get(i1).getId(), "【子表:" + mdmModuleDbEntityList.get(i).getDbName() + "】" + mdmModuleDbFiledsEntityList.get(i1).getChName())); + } + if ("1".equals(mdmModuleDbFiledsEntityList.get(i1).getShowType())) { + showFiled.add(new MdmDbFiledVo(mdmModuleDbFiledsEntityList.get(i1).getId(), "【子表:" + mdmModuleDbEntityList.get(i).getDbName() + "】" + mdmModuleDbFiledsEntityList.get(i1).getChName())); + } + if ("1".equals(mdmModuleDbFiledsEntityList.get(i1).getQueryType())) { + queryFiled.add(new MdmDbFiledVo(mdmModuleDbFiledsEntityList.get(i1).getId(), "【子表:" + mdmModuleDbEntityList.get(i).getDbName() + "】" + mdmModuleDbFiledsEntityList.get(i1).getChName())); + } + if ("1".equals(mdmModuleDbFiledsEntityList.get(i1).getListType())) { + listFiled.add(new MdmDbFiledVo(mdmModuleDbFiledsEntityList.get(i1).getId(), "【子表:" + mdmModuleDbEntityList.get(i).getDbName() + "】" + mdmModuleDbFiledsEntityList.get(i1).getChName())); + } + } + } + } + } + } + } + } + mdmModuleViewVo.setAddFiled(addFiled); + mdmModuleViewVo.setEditFiled(editFiled); + mdmModuleViewVo.setShowFiled(showFiled); + mdmModuleViewVo.setQueryFiled(queryFiled); + mdmModuleViewVo.setListFiled(listFiled); + } + /** + * @param object + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 主数据设置修改显示信息 + * @Date 9:40 上午 2023/10/18 + **/ + @Override + public JsonResultEntity doSaveMdmModuleView(JSONObject object) { + MdmModuleViewDto entity = getData("jsonStr", object, MdmModuleViewDto.class); + //判断是否有数据 + if (entity == null) { + return BaseResult.getFailureMessageEntity("参数不允许为空"); + } + if (entity.getMdmCode() == null || "".equals(entity.getMdmCode())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + if (entity.getMdmModuleViewEntity() == null) { + return BaseResult.getFailureMessageEntity("参数不允许为空"); + } + MdmModuleEntity mdmModuleEntity = mdmServiceCache.getMdmModuleEntity(entity.getMdmCode()); + + //保存视图 + MdmModuleViewEntity mdmModuleViewEntity = entity.getMdmModuleViewEntity(); + mdmModuleViewEntity.setMdmId(mdmModuleEntity.getId()); + if(mdmModuleViewEntity.getId() != null && !"".equals(mdmModuleViewEntity.getId())){ + mdmModuleViewEntity.setDataType("2"); + mdmModuleViewEntity.setUpdate(); + mdmServiceCache.saveMdmModuleView(mdmModuleEntity.getId(),mdmModuleViewEntity); + }else { + mdmModuleViewEntity.setDataType("1"); + mdmModuleViewEntity.setCreate(); + mdmModuleViewDao.save(mdmModuleViewEntity); + } + //保存字段 + List mdmModuleViewDetailEntities = new ArrayList<>(); + //1、查询2、列表3、新增4、修改 5、查看 + saveDbViewFiled(mdmModuleEntity.getId(),mdmModuleViewEntity.getId(),entity.getQueryFiled(),"1",mdmModuleViewDetailEntities); + saveDbViewFiled(mdmModuleEntity.getId(),mdmModuleViewEntity.getId(),entity.getListFiled(),"2",mdmModuleViewDetailEntities); + saveDbViewFiled(mdmModuleEntity.getId(),mdmModuleViewEntity.getId(),entity.getAddFiled(),"3",mdmModuleViewDetailEntities); + saveDbViewFiled(mdmModuleEntity.getId(),mdmModuleViewEntity.getId(),entity.getEditFiled(),"4",mdmModuleViewDetailEntities); + saveDbViewFiled(mdmModuleEntity.getId(),mdmModuleViewEntity.getId(),entity.getShowFiled(),"5",mdmModuleViewDetailEntities); + mdmServiceCache.saveMdmModuleViewDetail(mdmModuleEntity.getId(),mdmModuleViewDetailEntities); + //保存按钮 + List mdmModuleViewButtonEntities = entity.getDbButtonFiled(); + if(mdmModuleViewButtonEntities != null && mdmModuleViewButtonEntities.size() > 0){ + for (int i = 0; i < mdmModuleViewButtonEntities.size(); i++) { + mdmModuleViewButtonEntities.get(i).setMdmId(mdmModuleEntity.getId()); + mdmModuleViewButtonEntities.get(i).setViewId(mdmModuleViewEntity.getId()); + if(mdmModuleViewButtonEntities.get(i).getId() != null && !"".equals(mdmModuleViewButtonEntities.get(i).getId())){ + mdmModuleViewButtonEntities.get(i).setDataType("2"); + mdmModuleViewButtonEntities.get(i).setUpdate(); + }else { + mdmModuleViewButtonEntities.get(i).setDataType("1"); + mdmModuleViewButtonEntities.get(i).setCreate(); + } + } + mdmServiceCache.saveMdmModuleViewButton(mdmModuleEntity.getId(),mdmModuleViewButtonEntities); + } + + //保存菜单 + //保存按钮 + + if("1".equals(mdmModuleViewEntity.getDataType())){ + //新增 + SysMenuConfigEntity module = new SysMenuConfigEntity(); + module.setCreate(); + module.setFormId(mdmModuleEntity.getId()); + if("1".equals(mdmModuleEntity.getMdmType())){ + //1、档案 + module.setParentMenuId("ea22757e99c144fb9ef381dd322e233c"); + }else { + //2、单据 + module.setParentMenuId("58714ddb7ec94f5da91df74efada042f"); + } + module.setMenuName(mdmModuleEntity.getMdmName()); + module.setMenuEnglishName("integrationOptionAdmin" + mdmModuleEntity.getMdmCode()); + module.setMenuIcon(null);//模块图标 + module.setRoute("integrationOptionAdmin/" + mdmModuleEntity.getMdmCode());//路由地址 + module.setMenuPage("integrationOptionV2/index");//一级Layout 二级 ParntView 三级component + module.setRemark("主数据生成菜单"); + module.setVisibles("0"); + module.setShowType("1"); + JSONObject object1 = new JSONObject(); + object1.put("mdmId", mdmModuleEntity.getId());//主数据id + object1.put("mdmCode", mdmModuleEntity.getMdmCode());//主数据编码 + object1.put("viewType", mdmModuleViewEntity.getViewName());//1、树 2、列表 + module.setOptions(object1.toString());//菜单mate参数 + sysMenuConfigDao.save(module); + if(mdmModuleViewButtonEntities != null && mdmModuleViewButtonEntities.size() > 0){ + for (int i = 0; i < mdmModuleViewButtonEntities.size(); i++) { + if("new".equals(mdmModuleViewButtonEntities.get(i).getButtonValue())){ + SysButtonConfigEntity xz = new SysButtonConfigEntity(); + xz.setCode("new"); + xz.setNameCh("新建"); + xz.setNameEn("new"); + xz.setMenuId(module.getId()); + xz.setIconName(""); + xz.setStyles(""); + xz.setBtnFunction("new"); + xz.setRemark("主数据新建按钮"); + xz.setCreate(); + sysButtonConfigDao.save(xz); + } + if("resize".equals(mdmModuleViewButtonEntities.get(i).getButtonValue())){ + + SysButtonConfigEntity cz = new SysButtonConfigEntity(); + cz.setCode("resize"); + cz.setNameCh("重置"); + cz.setNameEn("resize"); + cz.setMenuId(module.getId()); + cz.setIconName(""); + cz.setStyles(""); + cz.setBtnFunction("resize"); + cz.setRemark("主数据重置按钮"); + cz.setCreate(); + sysButtonConfigDao.save(cz); + } + if("search".equals(mdmModuleViewButtonEntities.get(i).getButtonValue())) { + + SysButtonConfigEntity cx = new SysButtonConfigEntity(); + cx.setCode("search"); + cx.setNameCh("查询"); + cx.setNameEn("search"); + cx.setMenuId(module.getId()); + cx.setIconName(""); + cx.setStyles(""); + cx.setBtnFunction("search"); + cx.setRemark("主数据查询按钮"); + cx.setCreate(); + sysButtonConfigDao.save(cx); + } + if("edit".equals(mdmModuleViewButtonEntities.get(i).getButtonValue())) { + + SysButtonConfigEntity xg = new SysButtonConfigEntity(); + xg.setCode("edit"); + xg.setNameCh("修改"); + xg.setNameEn("edit"); + xg.setMenuId(module.getId()); + xg.setIconName(""); + xg.setStyles(""); + xg.setBtnFunction("edit"); + xg.setRemark("主数据修改按钮"); + xg.setCreate(); + sysButtonConfigDao.save(xg); + } + if("dele".equals(mdmModuleViewButtonEntities.get(i).getButtonValue())) { + + SysButtonConfigEntity sc = new SysButtonConfigEntity(); + sc.setCode("dele"); + sc.setNameCh("删除"); + sc.setNameEn("dele"); + sc.setMenuId(module.getId()); + sc.setIconName(""); + sc.setStyles(""); + sc.setBtnFunction("dele"); + sc.setRemark("主数据删除按钮"); + sc.setCreate(); + sysButtonConfigDao.save(sc); + } + if("view".equals(mdmModuleViewButtonEntities.get(i).getButtonValue())) { + + SysButtonConfigEntity ck = new SysButtonConfigEntity(); + ck.setCode("view"); + ck.setNameCh("查看"); + ck.setNameEn("view"); + ck.setMenuId(module.getId()); + ck.setIconName(""); + ck.setStyles(""); + ck.setBtnFunction("view"); + ck.setRemark("主数据查看按钮"); + ck.setCreate(); + sysButtonConfigDao.save(ck); + } + if("send".equals(mdmModuleViewButtonEntities.get(i).getButtonValue())) { + SysButtonConfigEntity xf = new SysButtonConfigEntity(); + xf.setCode("send"); + xf.setNameCh("下发"); + xf.setNameEn("send"); + xf.setMenuId(module.getId()); + xf.setIconName(""); + xf.setStyles(""); + xf.setBtnFunction("send"); + xf.setRemark("主数据下发按钮"); + xf.setCreate(); + sysButtonConfigDao.save(xf); + } + } + } + }else { + //修改 + //修改菜单 注意因为可能修改显示类型,所以需要修改菜单的属性 + SysMenuConfigEntity module = new SysMenuConfigEntity(); + module.setFormId(mdmModuleEntity.getId()); + module.setSts("Y"); + List moduleList = sysMenuConfigDao.queryBase(module); + if (moduleList != null && moduleList.size() == 1) { + module = moduleList.get(0); + module.setUpdate(); + module.setMenuName(mdmModuleEntity.getMdmName()); + JSONObject object1 = new JSONObject(); + object1.put("mdmId", mdmModuleEntity.getId());//主数据id + object1.put("mdmCode", mdmModuleEntity.getMdmCode());//主数据id + object1.put("viewType", mdmModuleViewEntity.getViewName());//1、树 2、列表 + module.setOptions(object1.toString());//菜单mate参数 + sysMenuConfigDao.update(module); + //修改按钮 + //1、查询所有按钮 + SysButtonConfigEntity buttonConfigEntity = new SysButtonConfigEntity(); + buttonConfigEntity.setMenuId(module.getId()); + buttonConfigEntity.setSts("Y"); + List sysButtonConfigEntities = sysButtonConfigDao.queryBase(buttonConfigEntity); + //2、删除按钮权限 + //3、删除按钮 + if (mdmModuleViewButtonEntities != null && mdmModuleViewButtonEntities.size() > 0) { + for (int i = 0; i < mdmModuleViewButtonEntities.size(); i++) { + //1、按钮不存在 2、按钮需要删除 + String type = "1"; + if (sysButtonConfigEntities != null && sysButtonConfigEntities.size() > 0) { + for (int i1 = 0; i1 < sysButtonConfigEntities.size(); i1++) { + + } + } + } + } + } + } + return BaseResult.getSuccessMessageEntity("保存显示信息成功"); + } ///** // * @param object // * @return com.hzya.frame.web.entity.JsonResultEntity @@ -500,197 +1463,8 @@ public class MdmServiceImpl implements IMdmService { // } //} - // - ///** - // * @param object - // * @return com.hzya.frame.web.entity.JsonResultEntity - // * @Author lvleigang - // * @Description 主数据设置保存数据源 - // * @Date 9:40 上午 2023/10/18 - // **/ - //@Override - //public JsonResultEntity saveMdmModuleDb(JSONObject object) { - // //判断新增还是修改,保存数据生成表结构 - // MdmDto entity = getData("jsonStr", object, MdmDto.class); - // if (entity == null) { - // return BaseResult.getFailureMessageEntity("参数不允许为空"); - // } - // if (entity.getId() == null || "".equals(entity.getId())) { - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // if (entity.getMainMdmModuleDb() == null || entity.getMainMdmModuleDb().getDbName() == null || "".equals(entity.getMainMdmModuleDb().getDbName())) { - // return BaseResult.getFailureMessageEntity("请先输入主表名称"); - // } - // //主数据主表 - // MdmModuleDbEntity mainMdmModuleDb = entity.getMainMdmModuleDb(); - // //主数据主表字段 - // List mainMdmModuleDbFileds = mainMdmModuleDb.getSublistMdmModuleDbFileds(); - // //主数据子表 - // List sublistMdmModuleDb = entity.getSublistMdmModuleDb(); - // //判断主表新增还是修改 - // if (mainMdmModuleDb.getId() == null || "".equals(mainMdmModuleDb.getId())) { - // //新增 需要校验表是否存在 - // if (checkTable(mainMdmModuleDb.getDbName())) { - // return BaseResult.getFailureMessageEntity("主表表名已经存在"); - // } - // } - // //判断明细表 - // if (sublistMdmModuleDb != null && sublistMdmModuleDb.size() > 0) { - // for (int i = 0; i < sublistMdmModuleDb.size(); i++) { - // if (sublistMdmModuleDb.get(i).getId() == null || "".equals(sublistMdmModuleDb.get(i).getId())) { - // if (sublistMdmModuleDb.get(i).getSublistMdmModuleDbFileds() == null && sublistMdmModuleDb.get(i).getSublistMdmModuleDbFileds().size() == 0) { - // return BaseResult.getFailureMessageEntity("请先设置子表" + sublistMdmModuleDb.get(i).getDbName() + "的字段"); - // } - // //新增 需要校验表是否存在 - // if (checkTable(sublistMdmModuleDb.get(i).getDbName())) { - // return BaseResult.getFailureMessageEntity("子表" + sublistMdmModuleDb.get(i).getDbName() + "已经存在"); - // } - // } - // } - // } - // //设置保存主表和字段以及字段的属性 - // setMainTable(entity, mainMdmModuleDb, mainMdmModuleDbFileds); - // //设置保存子表数据 - // setsublistTable(entity, mainMdmModuleDb, sublistMdmModuleDb); - // //保存规则 - // List mdmTableCodeRuleEntityList = entity.getMdmTableCodeRuleEntityList(); - // MdmTableCodeRuleEntity deleteOldData = new MdmTableCodeRuleEntity(); - // deleteOldData.setDbId(mainMdmModuleDb.getId()); - // deleteOldData.setMdmId(entity.getId()); - // deleteOldData.setSts("Y"); - // deleteOldData.setModify_user_id(StpUtil.getLoginIdAsString()); - // deleteOldData.setModify_time(new Date()); - // mdmTableCodeRuleDao.logicRemoveMultiCondition(deleteOldData); - // if (mdmTableCodeRuleEntityList != null && mdmTableCodeRuleEntityList.size() > 0) { - // for (int i = 0; i < mdmTableCodeRuleEntityList.size(); i++) { - // MdmTableCodeRuleEntity mdmTableCodeRuleEntity = mdmTableCodeRuleEntityList.get(i); - // mdmTableCodeRuleEntity.setMdmId(entity.getId()); - // mdmTableCodeRuleEntity.setDbId(mainMdmModuleDb.getId()); - // mdmTableCodeRuleEntity.setId(UUIDUtils.getUUID()); - // mdmTableCodeRuleEntity.setSts("Y"); - // mdmTableCodeRuleEntity.setCreate_user_id(StpUtil.getLoginIdAsString()); - // mdmTableCodeRuleEntity.setModify_user_id(StpUtil.getLoginIdAsString()); - // mdmTableCodeRuleEntity.setCreate_time(new Date()); - // mdmTableCodeRuleEntity.setModify_time(new Date()); - // mdmTableCodeRuleDao.save(mdmTableCodeRuleEntity); - // } - // } - // return BaseResult.getSuccessMessageEntity("保存数据源成功"); - //} - // - ///** - // * @param entity - // * @param mainMdmModuleDb - // * @param sublistMdmModuleDb - // * @return void - // * @Author lvleigang - // * @Description 设置保存子表数据 - // * @Date 11:08 上午 2023/10/19 - // **/ - //private void setsublistTable(MdmDto entity, MdmModuleDbEntity mainMdmModuleDb, List sublistMdmModuleDb) { - // //存在明细表 - // if (sublistMdmModuleDb != null && sublistMdmModuleDb.size() > 0) { - // for (int i = 0; i < sublistMdmModuleDb.size(); i++) { - // MdmModuleDbEntity mdmModuleDbEntity = sublistMdmModuleDb.get(i); - // mdmModuleDbEntity.setMdmId(entity.getId()); - // mdmModuleDbEntity.setDbType("2"); - // boolean flag = false; - // - // //新增还是修改 - // if (mdmModuleDbEntity.getId() != null && !"".equals(mdmModuleDbEntity.getId())) { - // mdmModuleDbEntity.setSts("Y"); - // mdmModuleDbEntity.setModify_user_id(StpUtil.getLoginIdAsString()); - // mdmModuleDbEntity.setModify_time(new Date()); - // mdmModuleDbDao.update(mdmModuleDbEntity); - // } else { - // flag = true; - // mdmModuleDbEntity.setId(UUIDUtils.getUUID()); - // mdmModuleDbEntity.setSts("Y"); - // mdmModuleDbEntity.setCreate_user_id(StpUtil.getLoginIdAsString()); - // mdmModuleDbEntity.setModify_user_id(StpUtil.getLoginIdAsString()); - // mdmModuleDbEntity.setCreate_time(new Date()); - // mdmModuleDbEntity.setModify_time(new Date()); - // mdmModuleDbDao.save(mdmModuleDbEntity); - // } - // List dbFiledsDtos = new ArrayList<>(); - // - // //字段 - // List sublistMdmModuleDbFileds = mdmModuleDbEntity.getSublistMdmModuleDbFileds(); - // if (sublistMdmModuleDbFileds != null && sublistMdmModuleDbFileds.size() > 0) { - // for (int i1 = 0; i1 < sublistMdmModuleDbFileds.size(); i1++) { - // MdmModuleDbFiledsEntity mdmModuleDbFiledsEntity = sublistMdmModuleDbFileds.get(i1); - // mdmModuleDbFiledsEntity.setMdmId(entity.getId()); - // mdmModuleDbFiledsEntity.setDbId(mdmModuleDbEntity.getId()); - // if (mdmModuleDbFiledsEntity.getId() != null && !"".equals(mdmModuleDbFiledsEntity.getId())) { - // DbFiledsDto dbFiledsDto = new DbFiledsDto("1", mdmModuleDbFiledsEntity.getChName(), mdmModuleDbFiledsEntity.getEnName(), mdmModuleDbFiledsEntity.getFiledType(), mdmModuleDbFiledsEntity.getFiledLength()); - // dbFiledsDtos.add(dbFiledsDto); - // mdmModuleDbFiledsEntity.setSts("Y"); - // mdmModuleDbFiledsEntity.setModify_user_id(StpUtil.getLoginIdAsString()); - // mdmModuleDbFiledsEntity.setModify_time(new Date()); - // mdmModuleDbFiledsDao.update(mdmModuleDbFiledsEntity); - // } else { - // DbFiledsDto dbFiledsDto = new DbFiledsDto("2", mdmModuleDbFiledsEntity.getChName(), mdmModuleDbFiledsEntity.getEnName(), mdmModuleDbFiledsEntity.getFiledType(), mdmModuleDbFiledsEntity.getFiledLength()); - // dbFiledsDtos.add(dbFiledsDto); - // mdmModuleDbFiledsEntity.setId(UUIDUtils.getUUID()); - // mdmModuleDbFiledsEntity.setSts("Y"); - // mdmModuleDbFiledsEntity.setCreate_user_id(StpUtil.getLoginIdAsString()); - // mdmModuleDbFiledsEntity.setModify_user_id(StpUtil.getLoginIdAsString()); - // mdmModuleDbFiledsEntity.setCreate_time(new Date()); - // mdmModuleDbFiledsEntity.setModify_time(new Date()); - // mdmModuleDbFiledsDao.save(mdmModuleDbFiledsEntity); - // } - // //修改或保存属性 - // List mdmModuleDbFiledsRules = mdmModuleDbFiledsEntity.getMdmModuleDbFiledsRules(); - // if (mdmModuleDbFiledsRules != null && mdmModuleDbFiledsRules.size() > 0) { - // for (int a = 0; a < mdmModuleDbFiledsRules.size(); a++) { - // MdmModuleDbFiledsRuleEntity mdmModuleDbFiledsRuleEntity = mdmModuleDbFiledsRules.get(a); - // mdmModuleDbFiledsRuleEntity.setMdmId(entity.getId()); - // mdmModuleDbFiledsRuleEntity.setDbId(mdmModuleDbEntity.getId()); - // mdmModuleDbFiledsRuleEntity.setFiledId(mdmModuleDbFiledsEntity.getId()); - // if (mdmModuleDbFiledsRuleEntity.getId() != null && !"".equals(mdmModuleDbFiledsRuleEntity.getId())) { - // mdmModuleDbFiledsRuleEntity.setSts("Y"); - // mdmModuleDbFiledsRuleEntity.setModify_user_id(StpUtil.getLoginIdAsString()); - // mdmModuleDbFiledsRuleEntity.setModify_time(new Date()); - // mdmModuleDbFiledsRuleDao.update(mdmModuleDbFiledsRuleEntity); - // } else { - // mdmModuleDbFiledsRuleEntity.setId(UUIDUtils.getUUID()); - // mdmModuleDbFiledsRuleEntity.setSts("Y"); - // mdmModuleDbFiledsRuleEntity.setCreate_user_id(StpUtil.getLoginIdAsString()); - // mdmModuleDbFiledsRuleEntity.setModify_user_id(StpUtil.getLoginIdAsString()); - // mdmModuleDbFiledsRuleEntity.setCreate_time(new Date()); - // mdmModuleDbFiledsRuleEntity.setModify_time(new Date()); - // mdmModuleDbFiledsRuleDao.save(mdmModuleDbFiledsRuleEntity); - // } - // } - // } - // } - // } - // - // if (flag) { - // //新增 - // Map maps = new HashMap<>(); - // maps.put("dbType", "2");//表类型 - // maps.put("tableName", mdmModuleDbEntity.getDbName());//表名 - // maps.put("tableRemark", mdmModuleDbEntity.getRemark());//表备注 - // maps.put("databaseFields", dbFiledsDtos);//字段 - // DbFiledsDto dbFiledsDto = new DbFiledsDto("1", "上级id", "formmain_id", "3", "50"); - // dbFiledsDtos.add(dbFiledsDto); - // mdmModuleDao.createTable(maps); - // } else { - // //修改 - // Map tablename = new HashMap<>(); - // tablename.put("tableName", mdmModuleDbEntity.getDbName());//表名 - // tablename.put("tableRemark", mdmModuleDbEntity.getRemark());//表备注 - // mdmModuleDao.alterTableName(tablename); - // Map maps = new HashMap<>(); - // maps.put("tableName", mdmModuleDbEntity.getDbName());//表名 - // maps.put("tableRemark", mdmModuleDbEntity.getRemark());//表备注 - // maps.put("databaseFields", dbFiledsDtos);//字段 - // mdmModuleDao.alterTable(maps); - // } - // } - // } - //} + + // ///** // * @param entity @@ -990,239 +1764,30 @@ public class MdmServiceImpl implements IMdmService { //} // // - ///** - // * @param object - // * @return com.hzya.frame.web.entity.JsonResultEntity - // * @Author lvleigang - // * @Description 主数据设置修改显示信息 - // * @Date 9:40 上午 2023/10/18 - // **/ - //@Override - //public JsonResultEntity doSaveMdmModuleView(JSONObject object) { - // MdmModuleViewDto entity = getData("jsonStr", object, MdmModuleViewDto.class); - // //判断是否有数据 - // if (entity == null) { - // return BaseResult.getFailureMessageEntity("参数不允许为空"); - // } - // if (entity.getId() == null || "".equals(entity.getId())) { - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // if (entity.getMdmModuleViewEntity() == null) { - // return BaseResult.getFailureMessageEntity("参数不允许为空"); - // } - // boolean flag = false; - // //保存主数据视图表 - // MdmModuleViewEntity mdmModuleViewEntity = entity.getMdmModuleViewEntity(); - // mdmModuleViewEntity.setMdmId(entity.getId()); - // mdmModuleViewEntity.setSts("Y"); - // mdmModuleViewEntity.setModify_user_id(StpUtil.getLoginIdAsString()); - // mdmModuleViewEntity.setModify_time(new Date()); - // if (mdmModuleViewEntity.getId() != null && !"".equals(mdmModuleViewEntity.getId())) { - // flag = false; - // //修改 - // mdmModuleViewDao.update(mdmModuleViewEntity); - // } else { - // flag = true; - // //新增 - // mdmModuleViewEntity.setId(UUIDUtils.getUUID()); - // mdmModuleViewEntity.setCreate_user_id(StpUtil.getLoginIdAsString()); - // mdmModuleViewEntity.setCreate_time(new Date()); - // mdmModuleViewDao.save(mdmModuleViewEntity); - // } - // //保存视图字段表 - // //先删除明细表 - // MdmModuleViewDetailEntity mdmModuleViewDetailEntity = new MdmModuleViewDetailEntity(); - // mdmModuleViewDetailEntity.setMdmId(entity.getId()); - // mdmModuleViewDetailEntity.setSts("Y"); - // mdmModuleViewDetailEntity.setModify_user_id(StpUtil.getLoginIdAsString()); - // mdmModuleViewDetailEntity.setModify_time(new Date()); - // mdmModuleViewDetailDao.logicRemoveMultiCondition(mdmModuleViewDetailEntity); - // //1、查询2、列表3、新增4、修改 5、查看 - // saveDbViewFiled(entity, mdmModuleViewEntity, entity.getQueryFiled(), "1"); - // saveDbViewFiled(entity, mdmModuleViewEntity, entity.getListFiled(), "2"); - // saveDbViewFiled(entity, mdmModuleViewEntity, entity.getAddFiled(), "3"); - // saveDbViewFiled(entity, mdmModuleViewEntity, entity.getEditFiled(), "4"); - // saveDbViewFiled(entity, mdmModuleViewEntity, entity.getShowFiled(), "5"); - // MdmModuleEntity moduleEntity = new MdmModuleEntity(); - // moduleEntity.setId(entity.getId()); - // moduleEntity.setSts("Y"); + // - // moduleEntity = mdmModuleDao.queryOne(moduleEntity); - // if (flag) { - // //新增菜单 - // SysMenuConfigEntity module = new SysMenuConfigEntity(); - // module.setCreate(); - // module.setFormId(entity.getId()); - // module.setParentMenuId("ea22757e99c144fb9ef381dd322e233c"); - // module.setMenuName(moduleEntity.getMdmName()); - // module.setMenuEnglishName("integrationOptionAdmin" + moduleEntity.getMdmCode()); - // module.setMenuIcon(null);//模块图标 - // module.setRoute("integrationOptionAdmin/" + moduleEntity.getMdmCode());//路由地址 - // module.setMenuPage("integrationOptionV2/index");//一级Layout 二级 ParntView 三级component - // module.setRemark("主数据生成菜单"); - // module.setVisibles("0"); - // module.setShowType("1"); - // JSONObject object1 = new JSONObject(); - // object1.put("mdmId", moduleEntity.getId());//主数据id - // object1.put("mdmCode", moduleEntity.getMdmCode());//主数据编码 - // object1.put("viewType", mdmModuleViewEntity.getViewName());//1、树 2、列表 - // module.setOptions(object1.toString());//菜单mate参数 - // sysMenuConfigDao.save(module); - // //todo 新增按钮 - // SysButtonConfigEntity xz = new SysButtonConfigEntity(); - // xz.setCode("new"); - // xz.setNameCh("新建"); - // xz.setNameEn("new"); - // xz.setMenuId(module.getId()); - // xz.setIconName(""); - // xz.setStyles(""); - // xz.setBtnFunction("new"); - // xz.setRemark("主数据新建按钮"); - // xz.setCreate(); - // sysButtonConfigDao.save(xz); - // SysButtonConfigEntity cz = new SysButtonConfigEntity(); - // cz.setCode("resize"); - // cz.setNameCh("重置"); - // cz.setNameEn("resize"); - // cz.setMenuId(module.getId()); - // cz.setIconName(""); - // cz.setStyles(""); - // cz.setBtnFunction("resize"); - // cz.setRemark("主数据重置按钮"); - // cz.setCreate(); - // sysButtonConfigDao.save(cz); - // SysButtonConfigEntity cx = new SysButtonConfigEntity(); - // cx.setCode("search"); - // cx.setNameCh("查询"); - // cx.setNameEn("search"); - // cx.setMenuId(module.getId()); - // cx.setIconName(""); - // cx.setStyles(""); - // cx.setBtnFunction("search"); - // cx.setRemark("主数据查询按钮"); - // cx.setCreate(); - // sysButtonConfigDao.save(cx); - // SysButtonConfigEntity xg = new SysButtonConfigEntity(); - // xg.setCode("edit"); - // xg.setNameCh("修改"); - // xg.setNameEn("edit"); - // xg.setMenuId(module.getId()); - // xg.setIconName(""); - // xg.setStyles(""); - // xg.setBtnFunction("edit"); - // xg.setRemark("主数据修改按钮"); - // xg.setCreate(); - // sysButtonConfigDao.save(xg); - // SysButtonConfigEntity sc = new SysButtonConfigEntity(); - // sc.setCode("dele"); - // sc.setNameCh("删除"); - // sc.setNameEn("dele"); - // sc.setMenuId(module.getId()); - // sc.setIconName(""); - // sc.setStyles(""); - // sc.setBtnFunction("dele"); - // sc.setRemark("主数据删除按钮"); - // sc.setCreate(); - // sysButtonConfigDao.save(sc); - // SysButtonConfigEntity ck = new SysButtonConfigEntity(); - // ck.setCode("view"); - // ck.setNameCh("查看"); - // ck.setNameEn("view"); - // ck.setMenuId(module.getId()); - // ck.setIconName(""); - // ck.setStyles(""); - // ck.setBtnFunction("view"); - // ck.setRemark("主数据查看按钮"); - // ck.setCreate(); - // sysButtonConfigDao.save(ck); - // SysButtonConfigEntity xf = new SysButtonConfigEntity(); - // xf.setCode("send"); - // xf.setNameCh("下发"); - // xf.setNameEn("send"); - // xf.setMenuId(module.getId()); - // xf.setIconName(""); - // xf.setStyles(""); - // xf.setBtnFunction("send"); - // xf.setRemark("主数据下发按钮"); - // xf.setCreate(); - // sysButtonConfigDao.save(xf); - // //module.setServiceName("mdmService");//Spring bean名称 - // //module.setLvl("2");//等级 - // //module.setName("integrationOptionAdmin"+moduleEntity.getMdmCode());//名称 - // //module.setCode(moduleEntity.getMdmCode().toString());//编码 - // //module.setFormType("0");//类型 0、menu 1、tree 2、list 3、view - // //module.setLevel("2");//模块操作级别Superadministrator - // //module.setIcon(null);//模块图标 - // //module.setUpIds("c3dda399207843eeac91770ac18e91e3");//上级id - // //module.setTableName(null);//bean表名称映射key - // //module.setKeyModular(null);//是否关键模块(Y是N否) - // //module.setTarget(null);//跳转目标 - // //module.setRemark("主数据" + moduleEntity.getMdmName());//备注 - // //module.setOpenType("1");//菜单打开方式 - // //module.setFormId(entity.getId());//表单ID - // //module.setAppId(null);//应用id - // ////module.setPath("integrationOptionAdmin");//路由地址 - // //module.setHidden("false");//隐藏 - // //module.setRedirect(null);//redirevt - // //module.setAlwaysShow(null);//alwaysShow - // //module.setTitle(moduleEntity.getMdmName());//标题 - // //module.setNoCache(null);//nocache缓存 - // //module.setLabel(moduleEntity.getMdmName());//label - // - // //moduleMapper.entity_insert(module); - // } else { - // //修改菜单 注意因为可能修改显示类型,所以需要修改菜单的属性 - // SysMenuConfigEntity module = new SysMenuConfigEntity(); - // module.setFormId(entity.getId()); - // module.setSts("Y"); - // List moduleList = sysMenuConfigDao.queryBase(module); - // if (moduleList != null && moduleList.size() == 1) { - // module = moduleList.get(0); - // module.setUpdate(); - // module.setMenuName(moduleEntity.getMdmName()); - // //module.setLabel(moduleEntity.getMdmName());//label - // JSONObject object1 = new JSONObject(); - // object1.put("mdmId", moduleEntity.getId());//主数据id - // object1.put("mdmCode", moduleEntity.getMdmCode());//主数据id - // object1.put("viewType", mdmModuleViewEntity.getViewName());//1、树 2、列表 - // module.setOptions(object1.toString());//菜单mate参数 - // sysMenuConfigDao.update(module); - // } else { - // return BaseResult.getFailureMessageEntity("显示信息保存成功,菜单配置失败请检查"); - // } - // } - // return BaseResult.getSuccessMessageEntity("保存显示信息成功"); - //} - // - ///** - // * @param entity - // * @param mdmModuleViewEntity - // * @param mdmDbFiledVoList - // * @param type - // * @return void - // * @Author lvleigang - // * @Description 保存数据 - // * @Date 1:37 下午 2023/10/25 - // **/ - //private void saveDbViewFiled(MdmModuleViewDto entity, MdmModuleViewEntity mdmModuleViewEntity, List mdmDbFiledVoList, String type) { - // if (mdmDbFiledVoList != null && mdmDbFiledVoList.size() > 0) { - // for (int i = 0; i < mdmDbFiledVoList.size(); i++) { - // MdmModuleViewDetailEntity mdmModuleViewDetailEntity = new MdmModuleViewDetailEntity(); - // mdmModuleViewDetailEntity.setId(UUIDUtils.getUUID()); - // mdmModuleViewDetailEntity.setSts("Y"); - // mdmModuleViewDetailEntity.setCreate_user_id(StpUtil.getLoginIdAsString()); - // mdmModuleViewDetailEntity.setModify_user_id(StpUtil.getLoginIdAsString()); - // mdmModuleViewDetailEntity.setCreate_time(new Date()); - // mdmModuleViewDetailEntity.setModify_time(new Date()); - // mdmModuleViewDetailEntity.setMdmId(entity.getId()); - // mdmModuleViewDetailEntity.setViewId(mdmModuleViewEntity.getId()); - // mdmModuleViewDetailEntity.setViewFiled(mdmDbFiledVoList.get(i).getId()); - // mdmModuleViewDetailEntity.setViewType(type); - // mdmModuleViewDetailEntity.setSort(String.valueOf(i + 1)); - // mdmModuleViewDetailDao.save(mdmModuleViewDetailEntity); - // } - // } - //} + /** + * @param mdmDbFiledVoList + * @param type + * @return void + * @Author lvleigang + * @Description 保存数据 + * @Date 1:37 下午 2023/10/25 + **/ + private void saveDbViewFiled(String mdmID, String viewid, List mdmDbFiledVoList, String type,List mdmModuleViewDetailEntities) { + if (mdmDbFiledVoList != null && mdmDbFiledVoList.size() > 0) { + for (int i = 0; i < mdmDbFiledVoList.size(); i++) { + MdmModuleViewDetailEntity mdmModuleViewDetailEntity = new MdmModuleViewDetailEntity(); + mdmModuleViewDetailEntity.setCreate(); + mdmModuleViewDetailEntity.setMdmId(mdmID); + mdmModuleViewDetailEntity.setViewId(viewid); + mdmModuleViewDetailEntity.setViewFiled(mdmDbFiledVoList.get(i).getId()); + mdmModuleViewDetailEntity.setViewType(type); + mdmModuleViewDetailEntity.setDataType("1"); + mdmModuleViewDetailEntities.add(mdmModuleViewDetailEntity); + } + } + } // ///** // * @param object From 25a5c388ceb81ddbf311ed1f0c246ed08878dad7 Mon Sep 17 00:00:00 2001 From: lvleigang <957075182@qq.com> Date: Tue, 4 Jun 2024 12:12:46 +0800 Subject: [PATCH 09/80] =?UTF-8?q?=E4=B8=BB=E6=95=B0=E6=8D=AE=E6=96=B0?= =?UTF-8?q?=E5=BB=BA=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mdm/service/impl/MdmServiceImpl.java | 39 ++++++++++--------- 1 file changed, 20 insertions(+), 19 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 33f29207..a0d24b8d 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 @@ -783,23 +783,24 @@ public class MdmServiceImpl implements IMdmService { option_type.setDataType("1"); mdmModuleDbFiledsEntities.add(option_type); } - - MdmModuleDbFiledsEntity data_status = new MdmModuleDbFiledsEntity(); - data_status.setMdmId(mdmId); - data_status.setDbId(dbId); - data_status.setChName("data_status"); - data_status.setEnName("数据状态 Y正常 N删除 F修改"); - data_status.setFiledType("3"); - data_status.setAddType("2"); - data_status.setUpdateType("2"); - data_status.setShowType("2"); - data_status.setQueryType("2"); - data_status.setListType("2"); - data_status.setViewType("2"); - data_status.setFiledLength("1"); - data_status.setDataType("1"); - mdmModuleDbFiledsEntities.add(data_status); - if("2".equals(type)){ + if("2".equals(type) || "1".equals(type) ) { + MdmModuleDbFiledsEntity data_status = new MdmModuleDbFiledsEntity(); + data_status.setMdmId(mdmId); + data_status.setDbId(dbId); + data_status.setChName("data_status"); + data_status.setEnName("数据状态 Y正常 N删除 F修改"); + data_status.setFiledType("3"); + data_status.setAddType("2"); + data_status.setUpdateType("2"); + data_status.setShowType("2"); + data_status.setQueryType("2"); + data_status.setListType("2"); + data_status.setViewType("2"); + data_status.setFiledLength("1"); + data_status.setDataType("1"); + mdmModuleDbFiledsEntities.add(data_status); + } + if("1".equals(type)){ MdmModuleDbFiledsEntity add_status = new MdmModuleDbFiledsEntity(); add_status.setMdmId(mdmId); add_status.setDbId(dbId); @@ -816,7 +817,7 @@ public class MdmServiceImpl implements IMdmService { add_status.setDataType("1"); mdmModuleDbFiledsEntities.add(add_status); } - if("2".equals(type)){ + if("1".equals(type)){ MdmModuleDbFiledsEntity update_status = new MdmModuleDbFiledsEntity(); update_status.setMdmId(mdmId); update_status.setDbId(dbId); @@ -834,7 +835,7 @@ public class MdmServiceImpl implements IMdmService { mdmModuleDbFiledsEntities.add(update_status); } - if("2".equals(type)){ + if("1".equals(type)){ MdmModuleDbFiledsEntity delete_status = new MdmModuleDbFiledsEntity(); delete_status.setMdmId(mdmId); delete_status.setDbId(dbId); From 64d53eecf942206bfb34f92aa04b8698a0b8b9ff Mon Sep 17 00:00:00 2001 From: lvleigang <957075182@qq.com> Date: Wed, 5 Jun 2024 08:47:46 +0800 Subject: [PATCH 10/80] =?UTF-8?q?=E4=B8=BB=E6=95=B0=E6=8D=AE=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mdm/service/impl/MdmServiceImpl.java | 46 +++++++++++++------ 1 file changed, 33 insertions(+), 13 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 a0d24b8d..0994442a 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 @@ -43,6 +43,8 @@ import com.hzya.frame.sysnew.buttonConfig.dao.ISysButtonConfigDao; import com.hzya.frame.sysnew.buttonConfig.entity.SysButtonConfigEntity; import com.hzya.frame.sysnew.menuConfig.dao.ISysMenuConfigDao; import com.hzya.frame.sysnew.menuConfig.entity.SysMenuConfigEntity; +import com.hzya.frame.sysnew.popedomOperate.dao.ISysPopedomOperateDao; +import com.hzya.frame.sysnew.popedomOperate.entity.SysPopedomOperateEntity; import com.hzya.frame.util.PluginUtils; import com.hzya.frame.uuid.UUIDUtils; import com.hzya.frame.web.entity.BaseResult; @@ -78,6 +80,8 @@ public class MdmServiceImpl implements IMdmService { @Resource private ISysButtonConfigDao sysButtonConfigDao; @Resource + private ISysPopedomOperateDao sysPopedomOperateDao; + @Resource private IMdmModuleDbDao mdmModuleDbDao; @Resource private IMdmModuleDbFiledsDao mdmModuleDbFiledsDao; @@ -1357,22 +1361,38 @@ public class MdmServiceImpl implements IMdmService { buttonConfigEntity.setMenuId(module.getId()); buttonConfigEntity.setSts("Y"); List sysButtonConfigEntities = sysButtonConfigDao.queryBase(buttonConfigEntity); - //2、删除按钮权限 - //3、删除按钮 - if (mdmModuleViewButtonEntities != null && mdmModuleViewButtonEntities.size() > 0) { - for (int i = 0; i < mdmModuleViewButtonEntities.size(); i++) { - //1、按钮不存在 2、按钮需要删除 - String type = "1"; - if (sysButtonConfigEntities != null && sysButtonConfigEntities.size() > 0) { - for (int i1 = 0; i1 < sysButtonConfigEntities.size(); i1++) { - - } - } - } - } + //1、查询按钮权限 + SysPopedomOperateEntity sysPopedomOperateEntity = new SysPopedomOperateEntity(); + sysPopedomOperateEntity.setMenuId(module.getId()); + sysPopedomOperateEntity.setSts("Y"); + List sysPopedomOperateEntities = sysPopedomOperateDao.queryBase(sysPopedomOperateEntity); + //删除按钮和删除按钮权限 + sysButtonConfigDao.logicRemoveMultiCondition(buttonConfigEntity); + sysPopedomOperateDao.logicRemoveMultiCondition(sysPopedomOperateEntity); + //删除处理权限 + doMdmModuleButton(module,mdmModuleViewButtonEntities,sysButtonConfigEntities,sysPopedomOperateEntities); } } return BaseResult.getSuccessMessageEntity("保存显示信息成功"); + } + + /** + * @Author lvleigang + * @Description + * @Date 3:29 下午 2024/6/4 + * @param module 菜单 + * @param mdmModuleViewButtonEntities 主数据按钮 + * @param sysButtonConfigEntities 菜单按钮 + * @param sysPopedomOperateEntities 按钮权限 + * @return void + **/ + private void doMdmModuleButton(SysMenuConfigEntity module,List mdmModuleViewButtonEntities, List sysButtonConfigEntities, List sysPopedomOperateEntities) { + + //循环查看按钮 + + + + } ///** // * @param object From 57afb4fdbfa7a64d80c7bfa33be9054e2c89f4ec Mon Sep 17 00:00:00 2001 From: lvleigang <957075182@qq.com> Date: Wed, 5 Jun 2024 09:47:47 +0800 Subject: [PATCH 11/80] =?UTF-8?q?=E7=94=A8=E6=88=B7=E5=AF=86=E7=A0=81?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sysnew/user/entity/SysUserEntity.java | 13 +++++++ .../sysnew/user/service/ISysUserService.java | 8 ++++ .../user/service/impl/SysUserServiceImpl.java | 38 ++++++++++++++++++- 3 files changed, 58 insertions(+), 1 deletion(-) diff --git a/service/src/main/java/com/hzya/frame/sysnew/user/entity/SysUserEntity.java b/service/src/main/java/com/hzya/frame/sysnew/user/entity/SysUserEntity.java index 7d9a333f..c552e1d2 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/user/entity/SysUserEntity.java +++ b/service/src/main/java/com/hzya/frame/sysnew/user/entity/SysUserEntity.java @@ -27,6 +27,11 @@ public class SysUserEntity extends BaseEntity { * 登录密码 */ private String password; + + /** + * 老登录密码 + */ + private String OldPassword; /** * 盐 */ @@ -204,5 +209,13 @@ public class SysUserEntity extends BaseEntity { public void setOrganId(String organId) { this.organId = organId; } + + public String getOldPassword() { + return OldPassword; + } + + public void setOldPassword(String oldPassword) { + OldPassword = oldPassword; + } } diff --git a/service/src/main/java/com/hzya/frame/sysnew/user/service/ISysUserService.java b/service/src/main/java/com/hzya/frame/sysnew/user/service/ISysUserService.java index fba89aba..559a5424 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/user/service/ISysUserService.java +++ b/service/src/main/java/com/hzya/frame/sysnew/user/service/ISysUserService.java @@ -84,6 +84,14 @@ public interface ISysUserService extends IBaseService { * @Date 2:37 下午 2024/3/27 **/ JsonResultEntity resetPassword(JSONObject jsonObject); + /** + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 用户重置密码 + * @Date 2:37 下午 2024/3/27 + **/ + JsonResultEntity userResetPassword(JSONObject jsonObject); /** diff --git a/service/src/main/java/com/hzya/frame/sysnew/user/service/impl/SysUserServiceImpl.java b/service/src/main/java/com/hzya/frame/sysnew/user/service/impl/SysUserServiceImpl.java index 80655731..b755b957 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/user/service/impl/SysUserServiceImpl.java +++ b/service/src/main/java/com/hzya/frame/sysnew/user/service/impl/SysUserServiceImpl.java @@ -1,5 +1,6 @@ package com.hzya.frame.sysnew.user.service.impl; +import cn.dev33.satoken.stp.StpUtil; import com.alibaba.fastjson.JSONObject; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; @@ -380,7 +381,42 @@ public class SysUserServiceImpl extends BaseService imple interfaceCache.reloadData("1"); return BaseResult.getSuccessMessageEntity("重置密码成功"); } - + /** + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 重置密码 + * @Date 2:37 下午 2024/3/27 + **/ + @Override + public JsonResultEntity userResetPassword(JSONObject jsonObject) { + SysUserEntity entity = getData("jsonStr", jsonObject, SysUserEntity.class); + if (entity == null) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + if (entity.getOldPassword() == null || "".equals(entity.getOldPassword())) { + return BaseResult.getFailureMessageEntity("请先输入原密码"); + } + if (entity.getPassword() == null || "".equals(entity.getPassword())) { + return BaseResult.getFailureMessageEntity("请先输入新密码"); + } + if(entity.getPassword().equals(entity.getOldPassword())){ + return BaseResult.getFailureMessageEntity("新密码和原密码不能一样"); + } + SysUserEntity oldEntity = sysUserDao.get(StpUtil.getLoginIdAsString()); + if (oldEntity == null) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + if(!oldEntity.getPassword().equals(AESUtil.encrypt(oldEntity.getLoginCode()+"-"+entity.getOldPassword()))){ + return BaseResult.getFailureMessageEntity("原密码错误,请重新输入"); + } + oldEntity.setPassword(AESUtil.encrypt(oldEntity.getLoginCode()+"-"+entity.getPassword())); + oldEntity.setUpdate(); + //保存密码 + sysUserDao.update(oldEntity); + interfaceCache.reloadData("1"); + return BaseResult.getSuccessMessageEntity("重置密码成功"); + } /** * @param jsonObject From 860a8336b5f81a363db1e5e87c3404dac74c691e Mon Sep 17 00:00:00 2001 From: lvleigang <957075182@qq.com> Date: Wed, 5 Jun 2024 10:13:47 +0800 Subject: [PATCH 12/80] =?UTF-8?q?=E7=94=A8=E6=88=B7=E5=AF=86=E7=A0=81?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hzya/frame/sysnew/user/service/impl/SysUserServiceImpl.java | 1 + 1 file changed, 1 insertion(+) diff --git a/service/src/main/java/com/hzya/frame/sysnew/user/service/impl/SysUserServiceImpl.java b/service/src/main/java/com/hzya/frame/sysnew/user/service/impl/SysUserServiceImpl.java index b755b957..e7648cce 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/user/service/impl/SysUserServiceImpl.java +++ b/service/src/main/java/com/hzya/frame/sysnew/user/service/impl/SysUserServiceImpl.java @@ -415,6 +415,7 @@ public class SysUserServiceImpl extends BaseService imple //保存密码 sysUserDao.update(oldEntity); interfaceCache.reloadData("1"); + StpUtil.logoutByTokenValue(StpUtil.getTokenValue()); return BaseResult.getSuccessMessageEntity("重置密码成功"); } From 0cc7c4bafbfa030133f60118b153e0dd7cbd7c71 Mon Sep 17 00:00:00 2001 From: "476474485@qq.com" Date: Wed, 5 Jun 2024 11:41:59 +0800 Subject: [PATCH 13/80] =?UTF-8?q?=E5=88=A0=E9=99=A4=E8=BE=BE=E6=A2=A6?= =?UTF-8?q?=E5=BC=95=E7=94=A8=E5=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/ReportManageServiceImpl.java | 507 +++++++++--------- 1 file changed, 249 insertions(+), 258 deletions(-) diff --git a/service/src/main/java/com/hzya/frame/report/reportManage/service/impl/ReportManageServiceImpl.java b/service/src/main/java/com/hzya/frame/report/reportManage/service/impl/ReportManageServiceImpl.java index 044dcd40..eccc4f7a 100644 --- a/service/src/main/java/com/hzya/frame/report/reportManage/service/impl/ReportManageServiceImpl.java +++ b/service/src/main/java/com/hzya/frame/report/reportManage/service/impl/ReportManageServiceImpl.java @@ -3,21 +3,15 @@ package com.hzya.frame.report.reportManage.service.impl; import com.alibaba.fastjson.JSONObject; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; +import com.hzya.frame.basedao.service.impl.BaseService; +import com.hzya.frame.report.reportManage.dao.IReportManageDao; import com.hzya.frame.report.reportManage.entity.JimuReportEntity; import com.hzya.frame.report.reportManage.entity.ReportManageEntity; -import com.hzya.frame.report.reportManage.dao.IReportManageDao; import com.hzya.frame.report.reportManage.service.IReportManageService; -import com.hzya.frame.sysnew.user.entity.SysUserEntity; -import com.hzya.frame.sysnew.userCompany.entity.SysUserCompanyEntity; -import com.hzya.frame.sysnew.userRoles.entity.SysUserRolesEntity; -import com.hzya.frame.util.AESUtil; import com.hzya.frame.web.entity.BaseResult; import com.hzya.frame.web.entity.JsonResultEntity; -import dm.jdbc.d.U; -import org.springframework.stereotype.Service; import org.springframework.beans.factory.annotation.Autowired; -import javax.annotation.Resource; -import com.hzya.frame.basedao.service.impl.BaseService; +import org.springframework.stereotype.Service; import java.util.List; @@ -29,272 +23,269 @@ import java.util.List; */ @Service(value = "reportManageService") public class ReportManageServiceImpl extends BaseService implements IReportManageService { - + private IReportManageDao reportManageDao; - + @Autowired - public void setReportManageDao(IReportManageDao dao) { - this.reportManageDao = dao; - this.dao = dao; - } + public void setReportManageDao(IReportManageDao dao) { + this.reportManageDao = dao; + this.dao = dao; + } - /** - * @param jsonObject - * @return com.hzya.frame.web.entity.JsonResultEntity - * @Author lvleigang - * @Description 查询报表列表分页 - * @Date 11:52 上午 2024/3/27 - **/ - @Override - public JsonResultEntity queryEntityPage(JSONObject jsonObject) { - ReportManageEntity entity = getData("jsonStr", jsonObject, ReportManageEntity.class); - //判断分页 - if (entity == null || entity.getPageNum() == null || entity.getPageSize() == null) { - return BaseResult.getFailureMessageEntity("分页查询参数不存在"); - } - PageHelper.startPage(entity.getPageNum(), entity.getPageSize()); - List list = reportManageDao.queryByLikeClassify(entity); - PageInfo pageInfo = new PageInfo(list); - return BaseResult.getSuccessMessageEntity("查询数据成功", pageInfo); - } + /** + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 查询报表列表分页 + * @Date 11:52 上午 2024/3/27 + **/ + @Override + public JsonResultEntity queryEntityPage(JSONObject jsonObject) { + ReportManageEntity entity = getData("jsonStr", jsonObject, ReportManageEntity.class); + //判断分页 + if (entity == null || entity.getPageNum() == null || entity.getPageSize() == null) { + return BaseResult.getFailureMessageEntity("分页查询参数不存在"); + } + PageHelper.startPage(entity.getPageNum(), entity.getPageSize()); + List list = reportManageDao.queryByLikeClassify(entity); + PageInfo pageInfo = new PageInfo(list); + return BaseResult.getSuccessMessageEntity("查询数据成功", pageInfo); + } - /** - * @param jsonObject - * @return com.hzya.frame.web.entity.JsonResultEntity - * @Author lvleigang - * @Description 查询报表列表 - * @Date 11:52 上午 2024/3/27 - **/ - @Override - public JsonResultEntity queryEntity(JSONObject jsonObject) { - ReportManageEntity entity = getData("jsonStr", jsonObject, ReportManageEntity.class); - if (entity == null) { - entity = new ReportManageEntity(); - } - List list = reportManageDao.queryByLike(entity); - return BaseResult.getSuccessMessageEntity("查询数据成功", list); - } + /** + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 查询报表列表 + * @Date 11:52 上午 2024/3/27 + **/ + @Override + public JsonResultEntity queryEntity(JSONObject jsonObject) { + ReportManageEntity entity = getData("jsonStr", jsonObject, ReportManageEntity.class); + if (entity == null) { + entity = new ReportManageEntity(); + } + List list = reportManageDao.queryByLike(entity); + return BaseResult.getSuccessMessageEntity("查询数据成功", list); + } - /** - * @param jsonObject - * @return com.hzya.frame.web.entity.JsonResultEntity - * @Author lvleigang - * @Description 保存报表 - * @Date 2:36 下午 2024/3/27 - **/ - @Override - public JsonResultEntity saveEntity(JSONObject jsonObject) { - ReportManageEntity entity = getData("jsonStr", jsonObject, ReportManageEntity.class); - if (entity == null) { - return BaseResult.getFailureMessageEntity("参数不允许为空"); - } - if (entity.getReportId() == null || "".equals(entity.getReportId())) { - return BaseResult.getFailureMessageEntity("请先选择报表"); - } - if (entity.getReportName() == null || "".equals(entity.getReportName())) { - return BaseResult.getFailureMessageEntity("请先输入报表名称"); - } - if (entity.getClassifyId() == null || "".equals(entity.getClassifyId())) { - return BaseResult.getFailureMessageEntity("请先选择分类"); - } - if (entity.getPreviewAddress() == null || "".equals(entity.getPreviewAddress())) { - return BaseResult.getFailureMessageEntity("系统错误"); - } - entity.setState("0"); - if (!checkIsUse(entity)) { - return BaseResult.getFailureMessageEntity("当前报表已经配置,请勿重复配置"); - } - entity.setCreate(); - //保存 - reportManageDao.save(entity); - return BaseResult.getSuccessMessageEntity("保存报表成功", entity); - } + /** + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 保存报表 + * @Date 2:36 下午 2024/3/27 + **/ + @Override + public JsonResultEntity saveEntity(JSONObject jsonObject) { + ReportManageEntity entity = getData("jsonStr", jsonObject, ReportManageEntity.class); + if (entity == null) { + return BaseResult.getFailureMessageEntity("参数不允许为空"); + } + if (entity.getReportId() == null || "".equals(entity.getReportId())) { + return BaseResult.getFailureMessageEntity("请先选择报表"); + } + if (entity.getReportName() == null || "".equals(entity.getReportName())) { + return BaseResult.getFailureMessageEntity("请先输入报表名称"); + } + if (entity.getClassifyId() == null || "".equals(entity.getClassifyId())) { + return BaseResult.getFailureMessageEntity("请先选择分类"); + } + if (entity.getPreviewAddress() == null || "".equals(entity.getPreviewAddress())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + entity.setState("0"); + if (!checkIsUse(entity)) { + return BaseResult.getFailureMessageEntity("当前报表已经配置,请勿重复配置"); + } + entity.setCreate(); + //保存 + reportManageDao.save(entity); + return BaseResult.getSuccessMessageEntity("保存报表成功", entity); + } + private boolean checkIsUse(ReportManageEntity entity) { + ReportManageEntity checkUse = new ReportManageEntity(); + checkUse.setReportId(entity.getReportId()); + return reportManageDao.getCount(checkUse) <= 0; + } - private boolean checkIsUse(ReportManageEntity entity) { - ReportManageEntity checkUse = new ReportManageEntity(); - checkUse.setReportId(entity.getReportId()); - if (reportManageDao.getCount(checkUse) > 0) { - return false; - } - return true; - } + /** + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 获取报表 + * @Date 2:36 下午 2024/3/27 + **/ + @Override + public JsonResultEntity getEntity(JSONObject jsonObject) { + ReportManageEntity entity = getData("jsonStr", jsonObject, ReportManageEntity.class); + if (entity == null) { + return BaseResult.getFailureMessageEntity("参数不允许为空"); + } + if (entity.getId() == null || "".equals(entity.getId())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + entity = reportManageDao.get(entity.getId()); + if (entity == null) { + return BaseResult.getFailureMessageEntity("获取报表失败"); + } + return BaseResult.getSuccessMessageEntity("获取报表成功", entity); + } - /** - * @param jsonObject - * @return com.hzya.frame.web.entity.JsonResultEntity - * @Author lvleigang - * @Description 获取报表 - * @Date 2:36 下午 2024/3/27 - **/ - @Override - public JsonResultEntity getEntity(JSONObject jsonObject) { - ReportManageEntity entity = getData("jsonStr", jsonObject, ReportManageEntity.class); - if (entity == null) { - return BaseResult.getFailureMessageEntity("参数不允许为空"); - } - if (entity.getId() == null || "".equals(entity.getId())) { - return BaseResult.getFailureMessageEntity("系统错误"); - } - entity = reportManageDao.get(entity.getId()); - if (entity == null) { - return BaseResult.getFailureMessageEntity("获取报表失败"); - } - return BaseResult.getSuccessMessageEntity("获取报表成功", entity); - } + /** + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 修改报表 + * @Date 2:37 下午 2024/3/27 + **/ + @Override + public JsonResultEntity updateEntity(JSONObject jsonObject) { + ReportManageEntity entity = getData("jsonStr", jsonObject, ReportManageEntity.class); + if (entity == null) { + return BaseResult.getFailureMessageEntity("参数不允许为空"); + } + if (entity.getId() == null || "".equals(entity.getId())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + if (entity.getReportId() == null || "".equals(entity.getReportId())) { + return BaseResult.getFailureMessageEntity("请先选择报表"); + } + if (entity.getReportName() == null || "".equals(entity.getReportName())) { + return BaseResult.getFailureMessageEntity("请先输入报表名称"); + } + if (entity.getClassifyId() == null || "".equals(entity.getClassifyId())) { + return BaseResult.getFailureMessageEntity("请先选择分类"); + } + if (entity.getPreviewAddress() == null || "".equals(entity.getPreviewAddress())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + entity.setUpdate(); + //保存 + reportManageDao.update(entity); + return BaseResult.getSuccessMessageEntity("修改报表成功"); + } - /** - * @param jsonObject - * @return com.hzya.frame.web.entity.JsonResultEntity - * @Author lvleigang - * @Description 修改报表 - * @Date 2:37 下午 2024/3/27 - **/ - @Override - public JsonResultEntity updateEntity(JSONObject jsonObject) { - ReportManageEntity entity = getData("jsonStr", jsonObject, ReportManageEntity.class); - if (entity == null) { - return BaseResult.getFailureMessageEntity("参数不允许为空"); - } - if (entity.getId() == null || "".equals(entity.getId())) { - return BaseResult.getFailureMessageEntity("系统错误"); - } - if (entity.getReportId() == null || "".equals(entity.getReportId())) { - return BaseResult.getFailureMessageEntity("请先选择报表"); - } - if (entity.getReportName() == null || "".equals(entity.getReportName())) { - return BaseResult.getFailureMessageEntity("请先输入报表名称"); - } - if (entity.getClassifyId() == null || "".equals(entity.getClassifyId())) { - return BaseResult.getFailureMessageEntity("请先选择分类"); - } - if (entity.getPreviewAddress() == null || "".equals(entity.getPreviewAddress())) { - return BaseResult.getFailureMessageEntity("系统错误"); - } - entity.setUpdate(); - //保存 - reportManageDao.update(entity); - return BaseResult.getSuccessMessageEntity("修改报表成功"); - } + /** + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 删除报表 + * @Date 2:37 下午 2024/3/27 + **/ + @Override + public JsonResultEntity deleteEntity(JSONObject jsonObject) { + ReportManageEntity entity = getData("jsonStr", jsonObject, ReportManageEntity.class); + if (entity == null) { + return BaseResult.getFailureMessageEntity("参数不允许为空"); + } + if (entity.getId() == null || "".equals(entity.getId())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + entity.setUpdate(); + reportManageDao.logicRemove(entity); + return BaseResult.getSuccessMessageEntity("删除报表成功"); + } - /** - * @param jsonObject - * @return com.hzya.frame.web.entity.JsonResultEntity - * @Author lvleigang - * @Description 删除报表 - * @Date 2:37 下午 2024/3/27 - **/ - @Override - public JsonResultEntity deleteEntity(JSONObject jsonObject) { - ReportManageEntity entity = getData("jsonStr", jsonObject, ReportManageEntity.class); - if (entity == null) { - return BaseResult.getFailureMessageEntity("参数不允许为空"); - } - if (entity.getId() == null || "".equals(entity.getId())) { - return BaseResult.getFailureMessageEntity("系统错误"); - } - entity.setUpdate(); - reportManageDao.logicRemove(entity); - return BaseResult.getSuccessMessageEntity("删除报表成功"); - } + /** + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 启用停用报表 + * @Date 2:37 下午 2024/3/27 + **/ + @Override + public JsonResultEntity enableDisableEntity(JSONObject jsonObject) { + ReportManageEntity entity = getData("jsonStr", jsonObject, ReportManageEntity.class); + if (entity == null) { + return BaseResult.getFailureMessageEntity("参数不允许为空"); + } + if (entity.getId() == null || "".equals(entity.getId())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + if (entity.getState() == null || "".equals(entity.getState())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + entity.setUpdate(); + reportManageDao.update(entity); + //0启用 1 停用 + if ("0".equals(entity.getState())) { + return BaseResult.getSuccessMessageEntity("启用用户成功"); + } else { + return BaseResult.getSuccessMessageEntity("停用用户成功"); + } + } - /** - * @param jsonObject - * @return com.hzya.frame.web.entity.JsonResultEntity - * @Author lvleigang - * @Description 启用停用报表 - * @Date 2:37 下午 2024/3/27 - **/ - @Override - public JsonResultEntity enableDisableEntity(JSONObject jsonObject) { - ReportManageEntity entity = getData("jsonStr", jsonObject, ReportManageEntity.class); - if (entity == null) { - return BaseResult.getFailureMessageEntity("参数不允许为空"); - } - if (entity.getId() == null || "".equals(entity.getId())) { - return BaseResult.getFailureMessageEntity("系统错误"); - } - if (entity.getState() == null || "".equals(entity.getState())) { - return BaseResult.getFailureMessageEntity("系统错误"); - } - entity.setUpdate(); - reportManageDao.update(entity); - //0启用 1 停用 - if ("0".equals(entity.getState())) { - return BaseResult.getSuccessMessageEntity("启用用户成功"); - } else { - return BaseResult.getSuccessMessageEntity("停用用户成功"); - } - } + /** + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 查询报表 + * @Date 2:36 下午 2024/3/27 + **/ + @Override + public JsonResultEntity queryReport(JSONObject jsonObject) { + JimuReportEntity entity = getData("jsonStr", jsonObject, JimuReportEntity.class); + //判断分页 + if (entity == null || entity.getPageNum() == null || entity.getPageSize() == null) { + return BaseResult.getFailureMessageEntity("分页查询参数不存在"); + } + PageHelper.startPage(entity.getPageNum(), entity.getPageSize()); + List list = reportManageDao.queryReportNotUse(entity); + PageInfo pageInfo = new PageInfo(list); + return BaseResult.getSuccessMessageEntity("查询数据成功", pageInfo); + } - /** - * @param jsonObject - * @return com.hzya.frame.web.entity.JsonResultEntity - * @Author lvleigang - * @Description 查询报表 - * @Date 2:36 下午 2024/3/27 - **/ - @Override - public JsonResultEntity queryReport(JSONObject jsonObject) { - JimuReportEntity entity = getData("jsonStr", jsonObject, JimuReportEntity.class); - //判断分页 - if (entity == null || entity.getPageNum() == null || entity.getPageSize() == null) { - return BaseResult.getFailureMessageEntity("分页查询参数不存在"); - } - PageHelper.startPage(entity.getPageNum(), entity.getPageSize()); - List list = reportManageDao.queryReportNotUse(entity); - PageInfo pageInfo = new PageInfo(list); - return BaseResult.getSuccessMessageEntity("查询数据成功", pageInfo); - } + /** + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 查询报表 + * @Date 2:36 下午 2024/3/27 + **/ + @Override + public JsonResultEntity queryReportEntity(JSONObject jsonObject) { + JimuReportEntity entity = getData("jsonStr", jsonObject, JimuReportEntity.class); + if (entity == null) { + return BaseResult.getFailureMessageEntity("参数不允许为空"); + } + if (entity.getId() == null || "".equals(entity.getId())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + entity = reportManageDao.queryReportEntity(entity); + if (entity == null) { + return BaseResult.getFailureMessageEntity("获取报表失败"); + } + return BaseResult.getSuccessMessageEntity("获取报表成功", entity); - /** - * @param jsonObject - * @return com.hzya.frame.web.entity.JsonResultEntity - * @Author lvleigang - * @Description 查询报表 - * @Date 2:36 下午 2024/3/27 - **/ - @Override - public JsonResultEntity queryReportEntity(JSONObject jsonObject) { - JimuReportEntity entity = getData("jsonStr", jsonObject, JimuReportEntity.class); - if (entity == null) { - return BaseResult.getFailureMessageEntity("参数不允许为空"); - } - if (entity.getId() == null || "".equals(entity.getId())) { - return BaseResult.getFailureMessageEntity("系统错误"); - } - entity = reportManageDao.queryReportEntity(entity); - if (entity == null) { - return BaseResult.getFailureMessageEntity("获取报表失败"); - } - return BaseResult.getSuccessMessageEntity("获取报表成功", entity); + } - } - /** - * @param jsonObject - * @return com.hzya.frame.web.entity.JsonResultEntity - * @Author lvleigang - * @Description 权限查询 - * @Date 2:37 下午 2024/3/27 - **/ - @Override - public JsonResultEntity jurisdiction(JSONObject jsonObject) { + /** + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 权限查询 + * @Date 2:37 下午 2024/3/27 + **/ + @Override + public JsonResultEntity jurisdiction(JSONObject jsonObject) { - return null; - } + return null; + } - /** - * @param jsonObject - * @return com.hzya.frame.web.entity.JsonResultEntity - * @Author lvleigang - * @Description 保存权限查询 - * @Date 2:37 下午 2024/3/27 - **/ - @Override - public JsonResultEntity saveJurisdiction(JSONObject jsonObject) { + /** + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 保存权限查询 + * @Date 2:37 下午 2024/3/27 + **/ + @Override + public JsonResultEntity saveJurisdiction(JSONObject jsonObject) { - return null; - } + return null; + } } From ce8f2063b2e94787a16ee4630ac123e9eca10675 Mon Sep 17 00:00:00 2001 From: lvleigang <957075182@qq.com> Date: Wed, 5 Jun 2024 11:43:40 +0800 Subject: [PATCH 14/80] =?UTF-8?q?=E4=B8=BB=E6=95=B0=E6=8D=AE=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dao/IMdmModuleSourceDao.java | 15 ++ .../dao/impl/MdmModuleSourceDaoImpl.java | 17 ++ .../entity/MdmModuleSourceEntity.java | 66 +++++ .../entity/MdmModuleSourceEntity.xml | 245 ++++++++++++++++++ .../service/IMdmModuleSourceService.java | 12 + .../impl/MdmModuleSourceServiceImpl.java | 26 ++ .../mdm/service/impl/MdmServiceImpl.java | 127 ++++++++- 7 files changed, 505 insertions(+), 3 deletions(-) create mode 100644 service/src/main/java/com/hzya/frame/mdm/mdmModuleSource/dao/IMdmModuleSourceDao.java create mode 100644 service/src/main/java/com/hzya/frame/mdm/mdmModuleSource/dao/impl/MdmModuleSourceDaoImpl.java create mode 100644 service/src/main/java/com/hzya/frame/mdm/mdmModuleSource/entity/MdmModuleSourceEntity.java create mode 100644 service/src/main/java/com/hzya/frame/mdm/mdmModuleSource/entity/MdmModuleSourceEntity.xml create mode 100644 service/src/main/java/com/hzya/frame/mdm/mdmModuleSource/service/IMdmModuleSourceService.java create mode 100644 service/src/main/java/com/hzya/frame/mdm/mdmModuleSource/service/impl/MdmModuleSourceServiceImpl.java diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleSource/dao/IMdmModuleSourceDao.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleSource/dao/IMdmModuleSourceDao.java new file mode 100644 index 00000000..bde093e6 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleSource/dao/IMdmModuleSourceDao.java @@ -0,0 +1,15 @@ +package com.hzya.frame.mdm.mdmModuleSource.dao; + +import com.hzya.frame.mdm.mdmModuleSource.entity.MdmModuleSourceEntity; +import com.hzya.frame.basedao.dao.IBaseDao; + +/** + * 主数据数据来源(mdm_module_source: table)表数据库访问层 + * + * @author makejava + * @since 2024-06-05 11:42:56 + */ +public interface IMdmModuleSourceDao extends IBaseDao { + +} + diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleSource/dao/impl/MdmModuleSourceDaoImpl.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleSource/dao/impl/MdmModuleSourceDaoImpl.java new file mode 100644 index 00000000..5be355b3 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleSource/dao/impl/MdmModuleSourceDaoImpl.java @@ -0,0 +1,17 @@ +package com.hzya.frame.mdm.mdmModuleSource.dao.impl; + +import com.hzya.frame.mdm.mdmModuleSource.entity.MdmModuleSourceEntity; +import com.hzya.frame.mdm.mdmModuleSource.dao.IMdmModuleSourceDao; +import org.springframework.stereotype.Repository; +import com.hzya.frame.basedao.dao.MybatisGenericDao; +/** + * 主数据数据来源(MdmModuleSource)表数据库访问层 + * + * @author makejava + * @since 2024-06-05 11:42:56 + */ +@Repository(value = "MdmModuleSourceDaoImpl") +public class MdmModuleSourceDaoImpl extends MybatisGenericDao implements IMdmModuleSourceDao{ + +} + diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleSource/entity/MdmModuleSourceEntity.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleSource/entity/MdmModuleSourceEntity.java new file mode 100644 index 00000000..2cc45fb4 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleSource/entity/MdmModuleSourceEntity.java @@ -0,0 +1,66 @@ +package com.hzya.frame.mdm.mdmModuleSource.entity; + +import java.util.Date; +import com.hzya.frame.web.entity.BaseEntity; +/** + * 主数据数据来源(MdmModuleSource)实体类 + * + * @author makejava + * @since 2024-06-05 11:42:57 + */ +public class MdmModuleSourceEntity extends BaseEntity { + + /** 主数据模版ID */ + private String mdmId; + /** 来源类型 */ + private String sourceType; + /** 来源名称 */ + private String sourceName; + /** 来源编码 */ + private String sourceCode; + /** 公司id */ + private String companyId; + + + public String getMdmId() { + return mdmId; + } + + public void setMdmId(String mdmId) { + this.mdmId = mdmId; + } + + public String getSourceType() { + return sourceType; + } + + public void setSourceType(String sourceType) { + this.sourceType = sourceType; + } + + public String getSourceName() { + return sourceName; + } + + public void setSourceName(String sourceName) { + this.sourceName = sourceName; + } + + public String getSourceCode() { + return sourceCode; + } + + public void setSourceCode(String sourceCode) { + this.sourceCode = sourceCode; + } + + public String getCompanyId() { + return companyId; + } + + public void setCompanyId(String companyId) { + this.companyId = companyId; + } + +} + 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 new file mode 100644 index 00000000..cc3bd233 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleSource/entity/MdmModuleSourceEntity.xml @@ -0,0 +1,245 @@ + + + + + + + + + + + + + + + + + + + + + + id + ,mdm_id + ,source_type + ,source_name + ,source_code + ,sorts + ,create_user_id + ,create_time + ,modify_user_id + ,modify_time + ,sts + ,org_id + ,company_id + + + + + + + + + + + + + + + + insert into mdm_module_source( + + id , + mdm_id , + source_type , + source_name , + source_code , + sorts , + create_user_id , + create_time , + modify_user_id , + modify_time , + sts , + org_id , + company_id , + sorts, + sts, + + )values( + + #{id} , + #{mdmId} , + #{sourceType} , + #{sourceName} , + #{sourceCode} , + #{sorts} , + #{create_user_id} , + #{create_time} , + #{modify_user_id} , + #{modify_time} , + #{sts} , + #{org_id} , + #{companyId} , + (select (max(IFNULL( a.sorts, 0 )) + 1) as sort from mdm_module_source a WHERE a.sts = 'Y' ), + 'Y', + + ) + + + + insert into mdm_module_source(mdm_id, source_type, source_name, source_code, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, sts) + values + + (#{entity.mdmId},#{entity.sourceType},#{entity.sourceName},#{entity.sourceCode},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId}, 'Y') + + + + + insert into mdm_module_source(mdm_id, source_type, source_name, source_code, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id) + values + + (#{entity.mdmId},#{entity.sourceType},#{entity.sourceName},#{entity.sourceCode},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId}) + + on duplicate key update + mdm_id = values(mdm_id), + source_type = values(source_type), + source_name = values(source_name), + source_code = values(source_code), + create_user_id = values(create_user_id), + create_time = values(create_time), + modify_user_id = values(modify_user_id), + modify_time = values(modify_time), + sts = values(sts), + org_id = values(org_id), + company_id = values(company_id) + + +update mdm_module_source set + + mdm_id = #{mdmId}, + source_type = #{sourceType}, + source_name = #{sourceName}, + source_code = #{sourceCode}, + create_user_id = #{create_user_id}, + create_time = #{create_time}, + modify_user_id = #{modify_user_id}, + modify_time = #{modify_time}, + sts = #{sts}, + org_id = #{org_id}, + company_id = #{companyId}, + +where id = #{id} + + + +update mdm_module_source set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} +where id = #{id} + + + +update mdm_module_source set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} + + and id = #{id} + and mdm_id = #{mdmId} + and source_type = #{sourceType} + and source_name = #{sourceName} + and source_code = #{sourceCode} + and sorts = #{sorts} + and sts = #{sts} + and company_id = #{companyId} + and sts='Y' + + + + + delete from mdm_module_source where id = #{id} + + + + diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleSource/service/IMdmModuleSourceService.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleSource/service/IMdmModuleSourceService.java new file mode 100644 index 00000000..f622682c --- /dev/null +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleSource/service/IMdmModuleSourceService.java @@ -0,0 +1,12 @@ +package com.hzya.frame.mdm.mdmModuleSource.service; + +import com.hzya.frame.mdm.mdmModuleSource.entity.MdmModuleSourceEntity; +import com.hzya.frame.basedao.service.IBaseService; +/** + * 主数据数据来源(MdmModuleSource)表服务接口 + * + * @author makejava + * @since 2024-06-05 11:42:57 + */ +public interface IMdmModuleSourceService extends IBaseService{ +} diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleSource/service/impl/MdmModuleSourceServiceImpl.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleSource/service/impl/MdmModuleSourceServiceImpl.java new file mode 100644 index 00000000..f9afb989 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleSource/service/impl/MdmModuleSourceServiceImpl.java @@ -0,0 +1,26 @@ +package com.hzya.frame.mdm.mdmModuleSource.service.impl; + +import com.hzya.frame.mdm.mdmModuleSource.entity.MdmModuleSourceEntity; +import com.hzya.frame.mdm.mdmModuleSource.dao.IMdmModuleSourceDao; +import com.hzya.frame.mdm.mdmModuleSource.service.IMdmModuleSourceService; +import org.springframework.stereotype.Service; +import org.springframework.beans.factory.annotation.Autowired; +import javax.annotation.Resource; +import com.hzya.frame.basedao.service.impl.BaseService; +/** + * 主数据数据来源(MdmModuleSource)表服务实现类 + * + * @author makejava + * @since 2024-06-05 11:42:57 + */ +@Service(value = "mdmModuleSourceService") +public class MdmModuleSourceServiceImpl extends BaseService implements IMdmModuleSourceService { + + private IMdmModuleSourceDao mdmModuleSourceDao; + + @Autowired + public void setMdmModuleSourceDao(IMdmModuleSourceDao dao) { + this.mdmModuleSourceDao = dao; + this.dao = dao; + } +} 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 0994442a..6756c7dc 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 @@ -1387,12 +1387,133 @@ public class MdmServiceImpl implements IMdmService { * @return void **/ private void doMdmModuleButton(SysMenuConfigEntity module,List mdmModuleViewButtonEntities, List sysButtonConfigEntities, List sysPopedomOperateEntities) { + //循环设置的按钮,再循环菜单的按钮,如果有把原先的修改状态,如果没有新增 + if(mdmModuleViewButtonEntities != null && mdmModuleViewButtonEntities.size() > 0){ + for (int i = 0; i < mdmModuleViewButtonEntities.size(); i++) { + boolean flag = false; + if(sysButtonConfigEntities != null && sysButtonConfigEntities.size() > 0){ + for (int i1 = 0; i1 < sysButtonConfigEntities.size(); i1++) { + if(mdmModuleViewButtonEntities.get(i).getButtonValue().equals(sysButtonConfigEntities.get(i1).getCode())){ + flag = true; + sysButtonConfigEntities.get(i1).setSts("Y"); + sysButtonConfigEntities.get(i1).setUpdate(); + sysButtonConfigDao.update(sysButtonConfigEntities.get(i1)); + if(sysPopedomOperateEntities != null && sysPopedomOperateEntities.size() > 0){ + for (int i2 = 0; i2 < sysPopedomOperateEntities.size(); i2++) { + if(sysPopedomOperateEntities.get(i2).getOperate().equals(sysButtonConfigEntities.get(i1).getId())){ + sysPopedomOperateEntities.get(i2).setSts("Y"); + sysPopedomOperateEntities.get(i2).setUpdate(); + sysPopedomOperateDao.update(sysPopedomOperateEntities.get(i2)); + } + } + } + break; + } + } + } + //原先没有需要新增 + if(!flag){ + if("new".equals(mdmModuleViewButtonEntities.get(i).getButtonValue())){ + SysButtonConfigEntity xz = new SysButtonConfigEntity(); + xz.setCode("new"); + xz.setNameCh("新建"); + xz.setNameEn("new"); + xz.setMenuId(module.getId()); + xz.setIconName(""); + xz.setStyles(""); + xz.setBtnFunction("new"); + xz.setRemark("主数据新建按钮"); + xz.setCreate(); + sysButtonConfigDao.save(xz); + } + if("resize".equals(mdmModuleViewButtonEntities.get(i).getButtonValue())){ - //循环查看按钮 - - + SysButtonConfigEntity cz = new SysButtonConfigEntity(); + cz.setCode("resize"); + cz.setNameCh("重置"); + cz.setNameEn("resize"); + cz.setMenuId(module.getId()); + cz.setIconName(""); + cz.setStyles(""); + cz.setBtnFunction("resize"); + cz.setRemark("主数据重置按钮"); + cz.setCreate(); + sysButtonConfigDao.save(cz); + } + if("search".equals(mdmModuleViewButtonEntities.get(i).getButtonValue())) { + + SysButtonConfigEntity cx = new SysButtonConfigEntity(); + cx.setCode("search"); + cx.setNameCh("查询"); + cx.setNameEn("search"); + cx.setMenuId(module.getId()); + cx.setIconName(""); + cx.setStyles(""); + cx.setBtnFunction("search"); + cx.setRemark("主数据查询按钮"); + cx.setCreate(); + sysButtonConfigDao.save(cx); + } + if("edit".equals(mdmModuleViewButtonEntities.get(i).getButtonValue())) { + + SysButtonConfigEntity xg = new SysButtonConfigEntity(); + xg.setCode("edit"); + xg.setNameCh("修改"); + xg.setNameEn("edit"); + xg.setMenuId(module.getId()); + xg.setIconName(""); + xg.setStyles(""); + xg.setBtnFunction("edit"); + xg.setRemark("主数据修改按钮"); + xg.setCreate(); + sysButtonConfigDao.save(xg); + } + if("dele".equals(mdmModuleViewButtonEntities.get(i).getButtonValue())) { + + SysButtonConfigEntity sc = new SysButtonConfigEntity(); + sc.setCode("dele"); + sc.setNameCh("删除"); + sc.setNameEn("dele"); + sc.setMenuId(module.getId()); + sc.setIconName(""); + sc.setStyles(""); + sc.setBtnFunction("dele"); + sc.setRemark("主数据删除按钮"); + sc.setCreate(); + sysButtonConfigDao.save(sc); + } + if("view".equals(mdmModuleViewButtonEntities.get(i).getButtonValue())) { + + SysButtonConfigEntity ck = new SysButtonConfigEntity(); + ck.setCode("view"); + ck.setNameCh("查看"); + ck.setNameEn("view"); + ck.setMenuId(module.getId()); + ck.setIconName(""); + ck.setStyles(""); + ck.setBtnFunction("view"); + ck.setRemark("主数据查看按钮"); + ck.setCreate(); + sysButtonConfigDao.save(ck); + } + if("send".equals(mdmModuleViewButtonEntities.get(i).getButtonValue())) { + SysButtonConfigEntity xf = new SysButtonConfigEntity(); + xf.setCode("send"); + xf.setNameCh("下发"); + xf.setNameEn("send"); + xf.setMenuId(module.getId()); + xf.setIconName(""); + xf.setStyles(""); + xf.setBtnFunction("send"); + xf.setRemark("主数据下发按钮"); + xf.setCreate(); + sysButtonConfigDao.save(xf); + } + } + } + } } ///** // * @param object From 42a6ed3086db64d3978e6cb108af20967062d185 Mon Sep 17 00:00:00 2001 From: hecan <1718492867@qq.com> Date: Wed, 5 Jun 2024 11:46:51 +0800 Subject: [PATCH 15/80] =?UTF-8?q?=E8=B0=83=E6=95=B4=E9=80=9A=E7=94=A8?= =?UTF-8?q?=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../execsql/service/ExecSqlServiceImpl.java | 4 +- .../impl/SysApplicationServiceImpl.java | 13 ++ .../sysnew/comparison/dao/IComparisonDao.java | 40 ++++ .../dao/impl/ComparisonDaoImpl.java | 28 +++ .../entity/ComparisonDetailsEntity.xml | 2 +- .../comparison/entity/ComparisonEntity.java | 55 ++++++ .../comparison/entity/ComparisonEntity.xml | 83 ++++---- .../service/IComparisonService.java | 5 + .../service/impl/ComparisonServiceImpl.java | 182 ++++++++++++------ 9 files changed, 305 insertions(+), 107 deletions(-) diff --git a/common/src/main/java/com/hzya/frame/execsql/service/ExecSqlServiceImpl.java b/common/src/main/java/com/hzya/frame/execsql/service/ExecSqlServiceImpl.java index 468e0c3c..ff02bcc4 100644 --- a/common/src/main/java/com/hzya/frame/execsql/service/ExecSqlServiceImpl.java +++ b/common/src/main/java/com/hzya/frame/execsql/service/ExecSqlServiceImpl.java @@ -53,7 +53,7 @@ public class ExecSqlServiceImpl implements IExecSqlService { public List> execSelectSql(ExecSqlEntity entity) throws RuntimeException { List> list = new ArrayList<>(); logger.info("=============进入execSelectSql方法============"); - if (null != entity && ObjectUtils.isEmpty(entity.getSql())) { + if (null != entity && null!=entity.getSql()) { //sqlsession // SqlSession sqlSession = getSqlSession(entity.getDatasource_code()); // SqlSession sqlSession = new DataSourceUtil().getDefaultSqlSession(); @@ -61,7 +61,7 @@ public class ExecSqlServiceImpl implements IExecSqlService { logger.info("=============execSelectSql方法要执行的sql:============" + select_sql); if (!select_sql.contains("update") && !select_sql.contains("delete") && !select_sql.contains("insert") && !select_sql.contains("create")) { - list = sqlSession.selectList("com.hzya.frame.sysnew.execsql.entity.ExecSqlEntity.ExecSqlEntity_execsql", entity); + list = sqlSession.selectList("com.hzya.frame.execsql.entity.ExecSqlEntity.ExecSqlEntity_execsql", entity); logger.info("===========execSelectSql方法返回的结果条数=============" + list.size()); } //sqlSession.close(); 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 9728afdf..83a2953d 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 @@ -6,6 +6,7 @@ import cn.hutool.core.date.DateTime; import cn.hutool.core.date.DateUtil; import cn.hutool.extra.servlet.ServletUtil; import cn.hutool.json.JSONUtil; +import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.baomidou.dynamic.datasource.annotation.DSTransactional; import com.github.pagehelper.PageHelper; @@ -1747,6 +1748,18 @@ public class SysApplicationServiceImpl extends BaseService a = Arrays.asList(new String[]{"apicode", "appid", "secretkey", "publickey", "x-forwarded-for", "cookie", "x-forwarded-proto", "x-real-ip", "content-length", "accept-language", "host", "content-type", "connection", "cache-control", "accept-encoding", "pragma", "accept", "user-agent"}); Map headers = new HashMap<>(); + + if(receiveApi.getHeaderIn() != null && !"".equals(receiveApi.getHeaderIn())){ + JSONArray jsonArray = JSONArray.parseArray(receiveApi.getHeaderIn()); + if(jsonArray != null && jsonArray.size() > 0){ + for (int i = 0; i < jsonArray.size(); i++) { + JSONObject object = jsonArray.getJSONObject(i); + headers.put(object.getString("parameterName"), object.getString("example")); + } + } + } + + if (headerMap != null && headerMap.size() > 0) { for (Map.Entry entry : headerMap.entrySet()) { if (!a.contains(entry.getKey())) { diff --git a/service/src/main/java/com/hzya/frame/sysnew/comparison/dao/IComparisonDao.java b/service/src/main/java/com/hzya/frame/sysnew/comparison/dao/IComparisonDao.java index d33044c7..42b171db 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/comparison/dao/IComparisonDao.java +++ b/service/src/main/java/com/hzya/frame/sysnew/comparison/dao/IComparisonDao.java @@ -79,4 +79,44 @@ public interface IComparisonDao extends IBaseDao { * @Date 2024/5/28 14:39 * **/ ComparisonEntity queryComparisonById(ComparisonEntity comparison); + + /** + * + * @content 根据主数据编码查询mdm_module数据 + * @Param + * @Return + * @Author hecan + * @Date 2024/6/4 11:37 + * **/ + ComparisonEntity queryComparisonBymdmCode(ComparisonEntity comparison); + + /** + * + * @content 根据mdm_module得id查询mdm_module_db得数据 + * @Param + * @Return + * @Author hecan + * @Date 2024/6/4 11:40 + * **/ + List queryComparisonBymdmId(ComparisonEntity comparison); + + /** + * + * @content 根据mdm_module得id查询mdm_module_db_fileds得数据 + * @Param + * @Return + * @Author hecan + * @Date 2024/6/4 11:45 + * **/ + List queryComparisonBymdmIdFileds(ComparisonEntity comparison); + + /** + * + * @content 根据数据来源内类型是插件的应用类型做分组 + * @Param + * @Return + * @Author hecan + * @Date 2024/6/4 17:41 + * **/ + List queryModuleSource(); } diff --git a/service/src/main/java/com/hzya/frame/sysnew/comparison/dao/impl/ComparisonDaoImpl.java b/service/src/main/java/com/hzya/frame/sysnew/comparison/dao/impl/ComparisonDaoImpl.java index 63281c12..4c8a0298 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/comparison/dao/impl/ComparisonDaoImpl.java +++ b/service/src/main/java/com/hzya/frame/sysnew/comparison/dao/impl/ComparisonDaoImpl.java @@ -59,4 +59,32 @@ public class ComparisonDaoImpl extends MybatisGenericDao comparisonEntities = super.query(getSqlIdPrifx() + "queryComparisonById", comparison); return comparisonEntities.get(0); } + + //根据主数据编码查询mdm_module数据 + @Override + public ComparisonEntity queryComparisonBymdmCode(ComparisonEntity comparison) { + ComparisonEntity comparisonEntity =(ComparisonEntity) super.selectOne(getSqlIdPrifx() + "queryComparisonBymdmCode", comparison); + return comparisonEntity; + } + + //根据mdm_module得id查询mdm_module_db得数据 + @Override + public List queryComparisonBymdmId(ComparisonEntity comparison) { + List list =(List) super.selectList(getSqlIdPrifx() + "queryComparisonBymdmId", comparison); + return list; + } + + //根据mdm_module得id查询mdm_module_db_fileds得数据 + @Override + public List queryComparisonBymdmIdFileds(ComparisonEntity comparison) { + List list =(List) super.selectList(getSqlIdPrifx() + "queryComparisonBymdmIdFileds", comparison); + return list; + } + + //根据数据来源内类型是插件的应用类型做分组 + @Override + public List queryModuleSource() { + List list =(List) super.selectList(getSqlIdPrifx() + "queryModuleSource",""); + return list; + } } 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 8ca17330..0d1ca13f 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 @@ -55,7 +55,7 @@ update ${dbName} - set sts= 'N' ,modify_time = now(),modify_user_id = #{modify_user_id} + set sts= 'N' ,modify_time = now(),modify_user_id = #{modify_user_id}, data_status= 'N',delete_status='0' + + + + + + + + - - select - case when length(ifnull(max(right(document_rule,length(#{ruleSuffix}))),'0')+1)=1 - then concat(#{rulePrefix},'-',date_format(NOW(),#{ruleMiddle}),'-','000',ifnull(max(right(document_rule,length(#{ruleSuffix}))),'0')+1) - when length(ifnull(max(right(document_rule,length(#{ruleSuffix}))),'0')+1)=2 - then concat(#{rulePrefix},'-',date_format(NOW(),#{ruleMiddle}),'-','00',ifnull(max(right(document_rule,length(#{ruleSuffix}))),'0')+1) - when length(ifnull(max(right(document_rule,length(#{ruleSuffix}))),'0')+1)=3 - then concat(#{rulePrefix},'-',date_format(NOW(),#{ruleMiddle}),'-','0',ifnull(max(right(document_rule,length(#{ruleSuffix}))),'0')+1) - else concat(#{rulePrefix},'-',date_format(NOW(),#{ruleMiddle}),'-',ifnull(max(right(document_rule,length(#{ruleSuffix}))),'0')+1) - end as document_rule, - right( - case when length(ifnull(max(right(document_rule,length(#{ruleSuffix}))),'0')+1)=1 - then concat(#{rulePrefix},'-',date_format(NOW(),#{ruleMiddle}),'-','000',ifnull(max(right(document_rule,length(#{ruleSuffix}))),'0')+1) - when length(ifnull(max(right(document_rule,length(#{ruleSuffix}))),'0')+1)=2 - then concat(#{rulePrefix},'-',date_format(NOW(),#{ruleMiddle}),'-','00',ifnull(max(right(document_rule,length(#{ruleSuffix}))),'0')+1) - when length(ifnull(max(right(document_rule,length(#{ruleSuffix}))),'0')+1)=3 - then concat(#{rulePrefix},'-',date_format(NOW(),#{ruleMiddle}),'-','0',ifnull(max(right(document_rule,length(#{ruleSuffix}))),'0')+1) - else concat(#{rulePrefix},'-',date_format(NOW(),#{ruleMiddle}),'-',ifnull(max(right(document_rule,length(#{ruleSuffix}))),'0')+1) - end ,4) as documentRuleNum - from ${dbName} where document_rule like concat(#{rulePrefix},'-',date_format(NOW(),#{ruleMiddle}),'-','%'); - + select + concat(#{rulePrefix},'-',date_format(NOW(),#{ruleMiddle}),'-',ifnull(max(substring_index(document_rule,'-',-1)),'0')+1) as documentRule, + substring_index( + (concat(#{rulePrefix},'-',date_format(NOW(),#{ruleMiddle}),'-',ifnull(max(substring_index(document_rule,'-',-1)),'0')+1)),'-',-1 + ) + as documentRuleNum + from ${dbName} where document_rule like concat(#{rulePrefix},'-',date_format(NOW(),#{ruleMiddle}),'-','%'); + + + + @@ -120,7 +121,7 @@ update ${dbName} - set dataStatus= 'N' ,modify_time = now(),modify_user_id = #{modify_user_id} + set data_status= 'N' ,modify_time = now(),modify_user_id = #{modify_user_id},delete_status='0' and ${key} =#{value} diff --git a/service/src/main/java/com/hzya/frame/sysnew/comparison/service/IComparisonService.java b/service/src/main/java/com/hzya/frame/sysnew/comparison/service/IComparisonService.java index 31f9e6b5..d03fe903 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/comparison/service/IComparisonService.java +++ b/service/src/main/java/com/hzya/frame/sysnew/comparison/service/IComparisonService.java @@ -1,6 +1,7 @@ package com.hzya.frame.sysnew.comparison.service; import com.alibaba.fastjson.JSONObject; +import com.baomidou.dynamic.datasource.annotation.DS; import com.hzya.frame.basedao.service.IBaseService; import com.hzya.frame.sysnew.comparison.entity.ComparisonEntity; import com.hzya.frame.web.entity.JsonResultEntity; @@ -15,6 +16,7 @@ public interface IComparisonService extends IBaseService } //分页查询通用数据数据 + @DS("master") @Override public JsonResultEntity queryEntityPage(JSONObject json) { JSONObject jsonObject = json.getJSONObject("jsonStr"); @@ -48,7 +51,9 @@ public class ComparisonServiceImpl extends BaseService List comparisonEntities=new ArrayList<>(); try { //根据主数据编码查询表名称,字段名称等信息 10001 - comparisonEntities = comparisonDao.queryComparison(comparisonEntity); + //comparisonEntities = comparisonDao.queryComparison(comparisonEntity); + + comparisonEntities=getComparisonEntity(comparisonEntity); }catch (Exception e){ logger.info("根据主数据编码查询信息错误:{}",e.getMessage()); return BaseResult.getFailureMessageEntity("查询失败"); @@ -80,6 +85,7 @@ public class ComparisonServiceImpl extends BaseService } //新增通用数据数据 + @DS("master") @Override public JsonResultEntity saveEntity(JSONObject json) { JSONObject jsonObject = json.getJSONObject("jsonStr"); @@ -97,7 +103,9 @@ public class ComparisonServiceImpl extends BaseService List comparisonEntities=new ArrayList<>(); try { //根据主数据编码查询表名称,字段名称等信息 10001 - comparisonEntities = comparisonDao.queryComparison(comparisonEntity); + // comparisonEntities = comparisonDao.queryComparison(comparisonEntity); + + comparisonEntities=getComparisonEntity(comparisonEntity); }catch (Exception e){ logger.info("根据主数据编码查询信息错误:{}",e.getMessage()); return BaseResult.getFailureMessageEntity("保存失败"); @@ -109,34 +117,8 @@ public class ComparisonServiceImpl extends BaseService Map map = new HashMap<>();//将主表数据存到map中 Map mapDetails = new HashMap<>();//将子表数据存到map中 if (comparisonEntities != null && comparisonEntities.size() > 0) { - for (ComparisonEntity entity : comparisonEntities) { - //遍历主表下面的所有key,字段名 - for (String key : jsonObjectMain.keySet()) { - if (entity.getDbType().equals("1")) { - comparisonEntity.setDbName(entity.getDbName()); - //如果表中得字段与输入得字段相等,则存起来 - if(entity.getEnName().equals(key)){ - map.put(key, jsonObjectMain.getString(key)); - } - } - } - } - 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)); - } - } - } - } - } - } + map=spliceMainMap(comparisonEntities,jsonObjectMain,map,comparisonEntity); + mapDetails=spliceDetailMap(comparisonEntities,mapDetails,comparisonDetailsEntity,jsonArray); String uuid = UUIDUtils.getUUID(); map.put("id", uuid); map.put("create_user_id", "c796fd9ba4c9f5ff3cc2fa41a040e443"); @@ -145,20 +127,23 @@ public class ComparisonServiceImpl extends BaseService map.put("create_time", new Date()); map.put("modify_time", new Date()); map.put("sts", "Y"); + map.put("add_status","0");//新增状态 + map.put("update_status","1");//修改状态 + map.put("delete_status","1");//删除状态 //查询单据规则 try { ComparisonEntity comparisonEntityRule = comparisonEntities.get(0); - comparisonEntityRule= comparisonDao.queryComparisonById(comparisonEntityRule); - String documentRule = comparisonEntityRule.getDocumentRule(); + comparisonEntityRule= comparisonDao.queryComparisonById(comparisonEntityRule); + String documentRule =comparisonEntityRule.getDocumentRule();; //"KH-2024-05-30-1"; logger.info("通用数据保存接口中根据mId查询出来的单据规则为:{}",documentRule); if(documentRule !=null){ - //获取规则前缀 CK + //获取规则前缀 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 ruleSuffix= documentRule.substring(documentRule.lastIndexOf("-")+1); + String ruleSuffix= documentRule.substring(documentRule.lastIndexOf("-")+1); //生成单据规则 comparisonEntity.setRulePrefix(rulePrefix); comparisonEntity.setRuleMiddle(ruleMiddle); @@ -225,7 +210,9 @@ public class ComparisonServiceImpl extends BaseService List comparisonEntities=new ArrayList<>(); //根据主数据编码查询表名称,字段名称等信息 10001 try { - comparisonEntities = comparisonDao.queryComparison(comparisonEntity); + // comparisonEntities = comparisonDao.queryComparison(comparisonEntity); + + comparisonEntities=getComparisonEntity(comparisonEntity); }catch (Exception e){ logger.info("根据主数据编码查询信息错误:{}",e.getMessage()); return BaseResult.getFailureMessageEntity("更新失败"); @@ -233,38 +220,15 @@ public class ComparisonServiceImpl extends BaseService Map map=new HashMap<>();//将主表数据存到map中 Map mapDetails=new HashMap<>();//将子表数据存到map中 if(comparisonEntities !=null && comparisonEntities.size()>0) { - for (ComparisonEntity entity : comparisonEntities) { - //遍历主表下面的所有key,字段名 - for (String key : jsonObjectMain.keySet()) { - if (entity.getDbType().equals("1")) { - comparisonEntity.setDbName(entity.getDbName()); - if(entity.getEnName().equals(key)){ - map.put(key, jsonObjectMain.getString(key)); - } - } - } - } - 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)); - } - } - } - } - } - } + map=spliceMainMap(comparisonEntities,jsonObjectMain,map,comparisonEntity); + mapDetails=spliceDetailMap(comparisonEntities,map,comparisonDetailsEntity,jsonArray); map.put("create_user_id", "c796fd9ba4c9f5ff3cc2fa41a040e443"); map.put("modify_user_id", "c796fd9ba4c9f5ff3cc2fa41a040e443"); map.put("org_id", "0"); map.put("modify_time", new Date()); map.put("sts", "Y"); + map.put("data_status","F");//数据状态 + map.put("update_status","0");//修改状态 comparisonEntity.setMap(map); comparisonEntity.setId(jsonObjectMain.getString("id")); /*//生成单据规则 @@ -288,6 +252,7 @@ public class ComparisonServiceImpl extends BaseService 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); @@ -323,7 +288,9 @@ public class ComparisonServiceImpl extends BaseService List comparisonEntities=new ArrayList<>(); //根据主数据编码查询表名称,字段名称等信息 10001 try { - comparisonEntities = comparisonDao.queryComparison(comparisonEntity); + // comparisonEntities = comparisonDao.queryComparison(comparisonEntity); + + comparisonEntities=getComparisonEntity(comparisonEntity); }catch (Exception e){ logger.info("根据主数据编码查询信息错误:{}",e.getMessage()); return BaseResult.getFailureMessageEntity("删除失败"); @@ -384,4 +351,93 @@ public class ComparisonServiceImpl extends BaseService return null; } } + + //得到主表数据 + private Map spliceMainMap(List comparisonEntities,JSONObject jsonObjectMain,Map map,ComparisonEntity comparisonEntity){ + for (ComparisonEntity entity : comparisonEntities) { + //遍历主表下面的所有key,字段名 + for (String key : jsonObjectMain.keySet()) { + if (entity.getDbType().equals("1")) { + comparisonEntity.setDbName(entity.getDbName()); + //如果表中得字段与输入得字段相等,则存起来 + if(entity.getEnName().equals(key)){ + map.put(key, jsonObjectMain.getString(key)); + } + } + } + } + return map; + } + + //得到明细表数据 + private Map spliceDetailMap(List comparisonEntities,Map mapDetails,ComparisonDetailsEntity comparisonDetailsEntity,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)); + } + } + } + } + } + } + return mapDetails; + } + + //根据主数据编码获取数据,表名称,字段名称等 + public List getComparisonEntity(ComparisonEntity comparisonEntity) { + List comparisonEntities = new ArrayList<>(); + //根据主数据编码查询mdm_module数据 + ComparisonEntity comparisonEntityModule = comparisonDao.queryComparisonBymdmCode(comparisonEntity); + if (comparisonEntityModule != null) { + //根据mdm_module得id查询mdm_module_db得数据 + List comparisonEntitiesModuleDb = comparisonDao.queryComparisonBymdmId(comparisonEntityModule); + //根据mdm_module得id查询mdm_module_db_fileds得数据 + List comparisonEntitiesFiles = comparisonDao.queryComparisonBymdmIdFileds(comparisonEntityModule); + for (ComparisonEntity comparison : comparisonEntitiesModuleDb) { + for (ComparisonEntity comparisonEntitiesFile : comparisonEntitiesFiles) { + if(comparison.getDbId().equals(comparisonEntitiesFile.getDbId())){ + ComparisonEntity comparisonEntityFile=new ComparisonEntity(); + comparisonEntityFile.setChName(comparisonEntitiesFile.getChName()); + comparisonEntityFile.setEnName(comparisonEntitiesFile.getEnName()); + comparisonEntityFile.setFiledType(comparisonEntitiesFile.getFiledType()); + comparisonEntityFile.setAddType(comparisonEntitiesFile.getAddType()); + comparisonEntityFile.setUpdateType(comparisonEntitiesFile.getUpdateType()); + comparisonEntityFile.setShowType(comparisonEntitiesFile.getShowType()); + comparisonEntityFile.setQueryType(comparisonEntitiesFile.getQueryType()); + comparisonEntityFile.setListType(comparisonEntitiesFile.getListType()); + comparisonEntityFile.setViewType(comparisonEntitiesFile.getViewType()); + comparisonEntityFile.setDbName(comparison.getDbName()); + comparisonEntityFile.setDbType(comparison.getDbType()); + comparisonEntityFile.setDbId(comparison.getDbId()); + comparisonEntityFile.setmId(comparisonEntitiesFile.getmId()); + comparisonEntityFile.setMdmName(comparisonEntityModule.getMdmName()); + comparisonEntityFile.setMdmCode(comparisonEntityModule.getMdmCode()); + comparisonEntities.add(comparisonEntityFile); + } + } + } + return comparisonEntities; + } + return null; + } + + //查询数据来源 根据数据来源内类型是插件的应用类型做分组 + public List getComparisonEntityFiles(){ + List comparisonEntities = comparisonDao.queryModuleSource(); + if(CollectionUtils.isNotEmpty(comparisonEntities)){ + for (ComparisonEntity comparisonEntity : comparisonEntities) { + //根据来源类型获取档案数据 比如U8C + + } + } + return null; + } + } From df988e6a1234441084e4cd96bb0a953b3c05f826 Mon Sep 17 00:00:00 2001 From: lvleigang <957075182@qq.com> Date: Thu, 6 Jun 2024 08:31:59 +0800 Subject: [PATCH 16/80] =?UTF-8?q?=E4=B8=BB=E6=95=B0=E6=8D=AE=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../frame/mdm/entity/MdmDistributeDto.java | 31 + .../hzya/frame/mdm/entity/MdmSourceDto.java | 34 + .../hzya/frame/mdm/entity/MdmViewFiledVo.java | 114 +++ .../com/hzya/frame/mdm/entity/MdmViewVo.java | 64 ++ .../entity/MdmModuleDistributeEntity.java | 12 +- .../dao/IMdmModuleOptionLogDao.java | 15 + .../dao/impl/MdmModuleOptionLogDaoImpl.java | 17 + .../entity/MdmModuleOptionLogEntity.java | 104 +++ .../entity/MdmModuleOptionLogEntity.xml | 272 +++++++ .../dao/IMdmModuleSendLogDao.java | 15 + .../dao/impl/MdmModuleSendLogDaoImpl.java | 17 + .../entity/MdmModuleSendLogEntity.java | 94 +++ .../entity/MdmModuleSendLogEntity.xml | 262 +++++++ .../entity/MdmModuleSourceEntity.xml | 6 +- .../hzya/frame/mdm/service/IMdmService.java | 121 ++- .../frame/mdm/service/IMdmServiceCache.java | 13 + .../mdm/service/impl/MdmServiceCache.java | 113 +++ .../mdm/service/impl/MdmServiceImpl.java | 723 +++++++++++------- 18 files changed, 1726 insertions(+), 301 deletions(-) create mode 100644 service/src/main/java/com/hzya/frame/mdm/entity/MdmDistributeDto.java create mode 100644 service/src/main/java/com/hzya/frame/mdm/entity/MdmSourceDto.java create mode 100644 service/src/main/java/com/hzya/frame/mdm/entity/MdmViewFiledVo.java create mode 100644 service/src/main/java/com/hzya/frame/mdm/entity/MdmViewVo.java create mode 100644 service/src/main/java/com/hzya/frame/mdm/mdmModuleOptionLog/dao/IMdmModuleOptionLogDao.java create mode 100644 service/src/main/java/com/hzya/frame/mdm/mdmModuleOptionLog/dao/impl/MdmModuleOptionLogDaoImpl.java create mode 100644 service/src/main/java/com/hzya/frame/mdm/mdmModuleOptionLog/entity/MdmModuleOptionLogEntity.java create mode 100644 service/src/main/java/com/hzya/frame/mdm/mdmModuleOptionLog/entity/MdmModuleOptionLogEntity.xml create mode 100644 service/src/main/java/com/hzya/frame/mdm/mdmModuleSendLog/dao/IMdmModuleSendLogDao.java create mode 100644 service/src/main/java/com/hzya/frame/mdm/mdmModuleSendLog/dao/impl/MdmModuleSendLogDaoImpl.java create mode 100644 service/src/main/java/com/hzya/frame/mdm/mdmModuleSendLog/entity/MdmModuleSendLogEntity.java create mode 100644 service/src/main/java/com/hzya/frame/mdm/mdmModuleSendLog/entity/MdmModuleSendLogEntity.xml diff --git a/service/src/main/java/com/hzya/frame/mdm/entity/MdmDistributeDto.java b/service/src/main/java/com/hzya/frame/mdm/entity/MdmDistributeDto.java new file mode 100644 index 00000000..57b97fdc --- /dev/null +++ b/service/src/main/java/com/hzya/frame/mdm/entity/MdmDistributeDto.java @@ -0,0 +1,31 @@ +package com.hzya.frame.mdm.entity; + + +import com.hzya.frame.mdm.mdmModuleDistribute.entity.MdmModuleDistributeEntity; +import java.util.List; + +public class MdmDistributeDto { + + + //主数据编码 + private Long mdmCode; + + private List mdmModuleDistributeEntities; + + public List getMdmModuleDistributeEntities() { + return mdmModuleDistributeEntities; + } + + public void setMdmModuleDistributeEntities(List mdmModuleDistributeEntities) { + this.mdmModuleDistributeEntities = mdmModuleDistributeEntities; + } + + public Long getMdmCode() { + return mdmCode; + } + + public void setMdmCode(Long mdmCode) { + this.mdmCode = mdmCode; + } +} + diff --git a/service/src/main/java/com/hzya/frame/mdm/entity/MdmSourceDto.java b/service/src/main/java/com/hzya/frame/mdm/entity/MdmSourceDto.java new file mode 100644 index 00000000..e00af986 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/mdm/entity/MdmSourceDto.java @@ -0,0 +1,34 @@ +package com.hzya.frame.mdm.entity; + + +import com.hzya.frame.mdm.mdmModuleDistribute.entity.MdmModuleDistributeEntity; +import com.hzya.frame.mdm.mdmModuleSource.entity.MdmModuleSourceEntity; + +import java.util.List; + +public class MdmSourceDto { + + + //主数据编码 + private Long mdmCode; + + private List mdmModuleSourceEntities; + + + public List getMdmModuleSourceEntities() { + return mdmModuleSourceEntities; + } + + public void setMdmModuleSourceEntities(List mdmModuleSourceEntities) { + this.mdmModuleSourceEntities = mdmModuleSourceEntities; + } + + public Long getMdmCode() { + return mdmCode; + } + + public void setMdmCode(Long mdmCode) { + this.mdmCode = mdmCode; + } +} + diff --git a/service/src/main/java/com/hzya/frame/mdm/entity/MdmViewFiledVo.java b/service/src/main/java/com/hzya/frame/mdm/entity/MdmViewFiledVo.java new file mode 100644 index 00000000..f1e25c5a --- /dev/null +++ b/service/src/main/java/com/hzya/frame/mdm/entity/MdmViewFiledVo.java @@ -0,0 +1,114 @@ +package com.hzya.frame.mdm.entity; + +import com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity; +import com.hzya.frame.mdm.mdmModuleDbFiledsRule.entity.MdmModuleDbFiledsRuleEntity; +import com.hzya.frame.mdm.mdmModuleView.entity.MdmModuleViewEntity; + +import java.util.List; + +public class MdmViewFiledVo { + + //字段id + private String id; + //表名 + private String dbName; + //类型 1、主表 2、明细 + private String dbType; + //主数据模版ID + private String mdmId; + //模版数据库id + private String dbId; + //中文名 + private String chName; + //英文名 + private String enName; + //排序 + private Integer sorts; + /** + * 字段类型 1、BIGINT 2、DECIMAL 3、VARCHAR 4、DATETIME + */ + private String filedType; + //字段规则 + private List ruleList; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getDbName() { + return dbName; + } + + public void setDbName(String dbName) { + this.dbName = dbName; + } + + public String getDbType() { + return dbType; + } + + public void setDbType(String dbType) { + this.dbType = dbType; + } + + public String getMdmId() { + return mdmId; + } + + public void setMdmId(String mdmId) { + this.mdmId = mdmId; + } + + public String getDbId() { + return dbId; + } + + public void setDbId(String dbId) { + this.dbId = dbId; + } + + public String getChName() { + return chName; + } + + public void setChName(String chName) { + this.chName = chName; + } + + public String getEnName() { + return enName; + } + + public void setEnName(String enName) { + this.enName = enName; + } + + public List getRuleList() { + return ruleList; + } + + public void setRuleList(List ruleList) { + this.ruleList = ruleList; + } + + public Integer getSorts() { + return sorts; + } + + public void setSorts(Integer sorts) { + this.sorts = sorts; + } + + public String getFiledType() { + return filedType; + } + + public void setFiledType(String filedType) { + this.filedType = filedType; + } +} + diff --git a/service/src/main/java/com/hzya/frame/mdm/entity/MdmViewVo.java b/service/src/main/java/com/hzya/frame/mdm/entity/MdmViewVo.java new file mode 100644 index 00000000..8630811e --- /dev/null +++ b/service/src/main/java/com/hzya/frame/mdm/entity/MdmViewVo.java @@ -0,0 +1,64 @@ +package com.hzya.frame.mdm.entity; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity; +import com.hzya.frame.mdm.mdmModuleView.entity.MdmModuleViewEntity; +import org.springframework.format.annotation.DateTimeFormat; + +import java.util.Date; +import java.util.List; + +public class MdmViewVo { + + private String id; + //模版信息 + private MdmModuleEntity mdmModuleEntity; + //模版展示信息 + private MdmModuleViewEntity mdmModuleViewEntity; + //查询条件 + private List queryList; + //列表 + private List listList; + + public List getQueryList() { + return queryList; + } + + public void setQueryList(List queryList) { + this.queryList = queryList; + } + + public List getListList() { + return listList; + } + + public void setListList(List listList) { + this.listList = listList; + } + + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public MdmModuleEntity getMdmModuleEntity() { + return mdmModuleEntity; + } + + public void setMdmModuleEntity(MdmModuleEntity mdmModuleEntity) { + this.mdmModuleEntity = mdmModuleEntity; + } + + public MdmModuleViewEntity getMdmModuleViewEntity() { + return mdmModuleViewEntity; + } + + public void setMdmModuleViewEntity(MdmModuleViewEntity mdmModuleViewEntity) { + this.mdmModuleViewEntity = mdmModuleViewEntity; + } +} + diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistribute/entity/MdmModuleDistributeEntity.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistribute/entity/MdmModuleDistributeEntity.java index 23df5360..0ce7e336 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistribute/entity/MdmModuleDistributeEntity.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistribute/entity/MdmModuleDistributeEntity.java @@ -1,6 +1,9 @@ package com.hzya.frame.mdm.mdmModuleDistribute.entity; import java.util.Date; +import java.util.List; + +import com.hzya.frame.mdm.mdmModuleDistributeDetail.entity.MdmModuleDistributeDetailEntity; import com.hzya.frame.web.entity.BaseEntity; /** * 主数据功能应用分发表(MdmModuleDistribute)实体类 @@ -24,7 +27,7 @@ public class MdmModuleDistributeEntity extends BaseEntity { private String enabledState; /** 公司id */ private String companyId; - + private List mdmModuleDistributeDetailEntities; public String getMdmId() { return mdmId; @@ -82,5 +85,12 @@ public class MdmModuleDistributeEntity extends BaseEntity { this.companyId = companyId; } + public List getMdmModuleDistributeDetailEntities() { + return mdmModuleDistributeDetailEntities; + } + + public void setMdmModuleDistributeDetailEntities(List mdmModuleDistributeDetailEntities) { + this.mdmModuleDistributeDetailEntities = mdmModuleDistributeDetailEntities; + } } diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleOptionLog/dao/IMdmModuleOptionLogDao.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleOptionLog/dao/IMdmModuleOptionLogDao.java new file mode 100644 index 00000000..a65bb1bc --- /dev/null +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleOptionLog/dao/IMdmModuleOptionLogDao.java @@ -0,0 +1,15 @@ +package com.hzya.frame.mdm.mdmModuleOptionLog.dao; + +import com.hzya.frame.mdm.mdmModuleOptionLog.entity.MdmModuleOptionLogEntity; +import com.hzya.frame.basedao.dao.IBaseDao; + +/** + * 主数据模版(mdm_module_option_log: table)表数据库访问层 + * + * @author makejava + * @since 2024-06-05 16:10:31 + */ +public interface IMdmModuleOptionLogDao extends IBaseDao { + +} + diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleOptionLog/dao/impl/MdmModuleOptionLogDaoImpl.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleOptionLog/dao/impl/MdmModuleOptionLogDaoImpl.java new file mode 100644 index 00000000..b0fc4626 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleOptionLog/dao/impl/MdmModuleOptionLogDaoImpl.java @@ -0,0 +1,17 @@ +package com.hzya.frame.mdm.mdmModuleOptionLog.dao.impl; + +import com.hzya.frame.mdm.mdmModuleOptionLog.entity.MdmModuleOptionLogEntity; +import com.hzya.frame.mdm.mdmModuleOptionLog.dao.IMdmModuleOptionLogDao; +import org.springframework.stereotype.Repository; +import com.hzya.frame.basedao.dao.MybatisGenericDao; +/** + * 主数据模版(MdmModuleOptionLog)表数据库访问层 + * + * @author makejava + * @since 2024-06-05 16:10:31 + */ +@Repository(value = "MdmModuleOptionLogDaoImpl") +public class MdmModuleOptionLogDaoImpl extends MybatisGenericDao implements IMdmModuleOptionLogDao{ + +} + diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleOptionLog/entity/MdmModuleOptionLogEntity.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleOptionLog/entity/MdmModuleOptionLogEntity.java new file mode 100644 index 00000000..d4af3ede --- /dev/null +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleOptionLog/entity/MdmModuleOptionLogEntity.java @@ -0,0 +1,104 @@ +package com.hzya.frame.mdm.mdmModuleOptionLog.entity; + +import java.util.Date; +import com.hzya.frame.web.entity.BaseEntity; +/** + * 主数据模版(MdmModuleOptionLog)实体类 + * + * @author makejava + * @since 2024-06-05 16:10:32 + */ +public class MdmModuleOptionLogEntity extends BaseEntity { + //主数据表名 + private String tableName; + //主数据编码 + private Long mdmCode; + /** 主表id */ + private String formmainId; + /** 来源名称 */ + private String sourceName; + /** 编码 */ + private String code; + /** source_data */ + private String sourceData; + /** 操作类型 */ + private String optionType; + /** 操作人 */ + private String optionName; + /** 公司id */ + private String companyId; + + + public String getFormmainId() { + return formmainId; + } + + public void setFormmainId(String formmainId) { + this.formmainId = formmainId; + } + + public String getSourceName() { + return sourceName; + } + + public void setSourceName(String sourceName) { + this.sourceName = sourceName; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getSourceData() { + return sourceData; + } + + public void setSourceData(String sourceData) { + this.sourceData = sourceData; + } + + public String getOptionType() { + return optionType; + } + + public void setOptionType(String optionType) { + this.optionType = optionType; + } + + public String getOptionName() { + return optionName; + } + + public void setOptionName(String optionName) { + this.optionName = optionName; + } + + public String getCompanyId() { + return companyId; + } + + public void setCompanyId(String companyId) { + this.companyId = companyId; + } + + public String getTableName() { + return tableName; + } + + public void setTableName(String tableName) { + this.tableName = tableName; + } + + public Long getMdmCode() { + return mdmCode; + } + + public void setMdmCode(Long mdmCode) { + this.mdmCode = mdmCode; + } +} + diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleOptionLog/entity/MdmModuleOptionLogEntity.xml b/service/src/main/java/com/hzya/frame/mdm/mdmModuleOptionLog/entity/MdmModuleOptionLogEntity.xml new file mode 100644 index 00000000..af218694 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleOptionLog/entity/MdmModuleOptionLogEntity.xml @@ -0,0 +1,272 @@ + + + + + + + + + + + + + + + + + + + + + + + + id + ,formmain_id + ,source_name + ,code + ,source_data + ,option_type + ,option_name + ,sorts + ,create_user_id + ,create_time + ,modify_user_id + ,modify_time + ,sts + ,org_id + ,company_id + + + + + + + + + + + + + + + + + insert into ${tableName}( + + id , + formmain_id , + source_name , + code , + source_data , + option_type , + option_name , + sorts , + create_user_id , + create_time , + modify_user_id , + modify_time , + sts , + org_id , + company_id , + sorts, + sts, + + )values( + + #{id} , + #{formmainId} , + #{sourceName} , + #{code} , + #{sourceData} , + #{optionType} , + #{optionName} , + #{sorts} , + #{create_user_id} , + #{create_time} , + #{modify_user_id} , + #{modify_time} , + #{sts} , + #{org_id} , + #{companyId} , + (select (max(IFNULL( a.sorts, 0 )) + 1) as sort from ${tableName} a WHERE a.sts = 'Y' ), + 'Y', + + ) + + + + insert into ${tableName}(formmain_id, source_name, code, source_data, option_type, option_name, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, sts) + values + + (#{entity.formmainId},#{entity.sourceName},#{entity.code},#{entity.sourceData},#{entity.optionType},#{entity.optionName},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId}, 'Y') + + + + + insert into ${tableName}(formmain_id, source_name, code, source_data, option_type, option_name, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id) + values + + (#{entity.formmainId},#{entity.sourceName},#{entity.code},#{entity.sourceData},#{entity.optionType},#{entity.optionName},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId}) + + on duplicate key update + formmain_id = values(formmain_id), + source_name = values(source_name), + code = values(code), + source_data = values(source_data), + option_type = values(option_type), + option_name = values(option_name), + create_user_id = values(create_user_id), + create_time = values(create_time), + modify_user_id = values(modify_user_id), + modify_time = values(modify_time), + sts = values(sts), + org_id = values(org_id), + company_id = values(company_id) + + +update ${tableName} set + + formmain_id = #{formmainId}, + source_name = #{sourceName}, + code = #{code}, + source_data = #{sourceData}, + option_type = #{optionType}, + option_name = #{optionName}, + create_user_id = #{create_user_id}, + create_time = #{create_time}, + modify_user_id = #{modify_user_id}, + modify_time = #{modify_time}, + sts = #{sts}, + org_id = #{org_id}, + company_id = #{companyId}, + +where id = #{id} + + + +update ${tableName} set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} +where id = #{id} + + + +update ${tableName} set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} + + and id = #{id} + and formmain_id = #{formmainId} + and source_name = #{sourceName} + and code = #{code} + and source_data = #{sourceData} + and option_type = #{optionType} + and option_name = #{optionName} + and sorts = #{sorts} + and sts = #{sts} + and company_id = #{companyId} + and sts='Y' + + + + + delete from ${tableName} where id = #{id} + + + + diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleSendLog/dao/IMdmModuleSendLogDao.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleSendLog/dao/IMdmModuleSendLogDao.java new file mode 100644 index 00000000..156977bb --- /dev/null +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleSendLog/dao/IMdmModuleSendLogDao.java @@ -0,0 +1,15 @@ +package com.hzya.frame.mdm.mdmModuleSendLog.dao; + +import com.hzya.frame.mdm.mdmModuleSendLog.entity.MdmModuleSendLogEntity; +import com.hzya.frame.basedao.dao.IBaseDao; + +/** + * 主数据模版(mdm_module_send_log: table)表数据库访问层 + * + * @author makejava + * @since 2024-06-05 16:11:09 + */ +public interface IMdmModuleSendLogDao extends IBaseDao { + +} + diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleSendLog/dao/impl/MdmModuleSendLogDaoImpl.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleSendLog/dao/impl/MdmModuleSendLogDaoImpl.java new file mode 100644 index 00000000..9e59822d --- /dev/null +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleSendLog/dao/impl/MdmModuleSendLogDaoImpl.java @@ -0,0 +1,17 @@ +package com.hzya.frame.mdm.mdmModuleSendLog.dao.impl; + +import com.hzya.frame.mdm.mdmModuleSendLog.entity.MdmModuleSendLogEntity; +import com.hzya.frame.mdm.mdmModuleSendLog.dao.IMdmModuleSendLogDao; +import org.springframework.stereotype.Repository; +import com.hzya.frame.basedao.dao.MybatisGenericDao; +/** + * 主数据模版(MdmModuleSendLog)表数据库访问层 + * + * @author makejava + * @since 2024-06-05 16:11:09 + */ +@Repository(value = "MdmModuleSendLogDaoImpl") +public class MdmModuleSendLogDaoImpl extends MybatisGenericDao implements IMdmModuleSendLogDao{ + +} + diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleSendLog/entity/MdmModuleSendLogEntity.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleSendLog/entity/MdmModuleSendLogEntity.java new file mode 100644 index 00000000..20995957 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleSendLog/entity/MdmModuleSendLogEntity.java @@ -0,0 +1,94 @@ +package com.hzya.frame.mdm.mdmModuleSendLog.entity; + +import java.util.Date; +import com.hzya.frame.web.entity.BaseEntity; +/** + * 主数据模版(MdmModuleSendLog)实体类 + * + * @author makejava + * @since 2024-06-05 16:11:10 + */ +public class MdmModuleSendLogEntity extends BaseEntity { + //主数据表名 + private String tableName; + //主数据编码 + private Long mdmCode; + /** 主表id */ + private String formmainId; + /** 目标应用 */ + private String targetApp; + /** 目标api */ + private String targetApi; + /** 源数据 */ + private String sourceData; + /** 操作类型 */ + private String optionType; + /** 公司id */ + private String companyId; + + + public String getFormmainId() { + return formmainId; + } + + public void setFormmainId(String formmainId) { + this.formmainId = formmainId; + } + + public String getTargetApp() { + return targetApp; + } + + public void setTargetApp(String targetApp) { + this.targetApp = targetApp; + } + + public String getTargetApi() { + return targetApi; + } + + public void setTargetApi(String targetApi) { + this.targetApi = targetApi; + } + + public String getSourceData() { + return sourceData; + } + + public void setSourceData(String sourceData) { + this.sourceData = sourceData; + } + + public String getOptionType() { + return optionType; + } + + public void setOptionType(String optionType) { + this.optionType = optionType; + } + + public String getCompanyId() { + return companyId; + } + + public void setCompanyId(String companyId) { + this.companyId = companyId; + } + + public String getTableName() { + return tableName; + } + + public void setTableName(String tableName) { + this.tableName = tableName; + } + + public Long getMdmCode() { + return mdmCode; + } + + public void setMdmCode(Long mdmCode) { + this.mdmCode = mdmCode; + } +} + diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleSendLog/entity/MdmModuleSendLogEntity.xml b/service/src/main/java/com/hzya/frame/mdm/mdmModuleSendLog/entity/MdmModuleSendLogEntity.xml new file mode 100644 index 00000000..0cea9a23 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleSendLog/entity/MdmModuleSendLogEntity.xml @@ -0,0 +1,262 @@ + + + + + + + + + + + + + + + + + + + + + + + id + ,formmain_id + ,target_app + ,target_api + ,source_data + ,option_type + ,sorts + ,create_user_id + ,create_time + ,modify_user_id + ,modify_time + ,sts + ,org_id + ,company_id + + + + + + + + + + + + + + + + + + insert into ${tableName}( + + id , + formmain_id , + target_app , + target_api , + source_data , + option_type , + sorts , + create_user_id , + create_time , + modify_user_id , + modify_time , + sts , + org_id , + company_id , + sorts, + sts, + + )values( + + #{id} , + #{formmainId} , + #{targetApp} , + #{targetApi} , + #{sourceData} , + #{optionType} , + #{sorts} , + #{create_user_id} , + #{create_time} , + #{modify_user_id} , + #{modify_time} , + #{sts} , + #{org_id} , + #{companyId} , + (select (max(IFNULL( a.sorts, 0 )) + 1) as sort from ${tableName} a WHERE a.sts = 'Y' ), + 'Y', + + ) + + + + insert into ${tableName}(formmain_id, target_app, target_api, source_data, option_type, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, sts) + values + + (#{entity.formmainId},#{entity.targetApp},#{entity.targetApi},#{entity.sourceData},#{entity.optionType},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId}, 'Y') + + + + + insert into ${tableName}(formmain_id, target_app, target_api, source_data, option_type, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id) + values + + (#{entity.formmainId},#{entity.targetApp},#{entity.targetApi},#{entity.sourceData},#{entity.optionType},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId}) + + on duplicate key update + formmain_id = values(formmain_id), + target_app = values(target_app), + target_api = values(target_api), + source_data = values(source_data), + option_type = values(option_type), + create_user_id = values(create_user_id), + create_time = values(create_time), + modify_user_id = values(modify_user_id), + modify_time = values(modify_time), + sts = values(sts), + org_id = values(org_id), + company_id = values(company_id) + + +update ${tableName} set + + formmain_id = #{formmainId}, + target_app = #{targetApp}, + target_api = #{targetApi}, + source_data = #{sourceData}, + option_type = #{optionType}, + create_user_id = #{create_user_id}, + create_time = #{create_time}, + modify_user_id = #{modify_user_id}, + modify_time = #{modify_time}, + sts = #{sts}, + org_id = #{org_id}, + company_id = #{companyId}, + +where id = #{id} + + + +update ${tableName} set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} +where id = #{id} + + + +update ${tableName} set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} + + and id = #{id} + and formmain_id = #{formmainId} + and target_app = #{targetApp} + and target_api = #{targetApi} + and source_data = #{sourceData} + and option_type = #{optionType} + and sorts = #{sorts} + and sts = #{sts} + and company_id = #{companyId} + and sts='Y' + + + + + delete from ${tableName} where id = #{id} + + + + 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 cc3bd233..df21034b 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 @@ -132,7 +132,7 @@ - + insert into mdm_module_source( id , @@ -172,7 +172,7 @@ ) - + insert into mdm_module_source(mdm_id, source_type, source_name, source_code, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, sts) values @@ -180,7 +180,7 @@ - + insert into mdm_module_source(mdm_id, source_type, source_name, source_code, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id) values diff --git a/service/src/main/java/com/hzya/frame/mdm/service/IMdmService.java b/service/src/main/java/com/hzya/frame/mdm/service/IMdmService.java index 1369a2a9..b815b318 100644 --- a/service/src/main/java/com/hzya/frame/mdm/service/IMdmService.java +++ b/service/src/main/java/com/hzya/frame/mdm/service/IMdmService.java @@ -135,32 +135,103 @@ public interface IMdmService { //JsonResultEntity doSaveMdmModuleRule(JSONObject jsonObject); // // - ///** - // * @param jsonObject - // * @return com.hzya.frame.web.entity.JsonResultEntity - // * @Author lvleigang - // * @Description 主数据设置查询分发设置 - // * @Date 9:40 上午 2023/10/18 - // **/ - //JsonResultEntity queryMdmModuleDistribute(JSONObject jsonObject); + /** + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 主数据设置查询分发设置 + * @Date 9:40 上午 2023/10/18 + **/ + JsonResultEntity queryMdmModuleDistribute(JSONObject jsonObject); + /** + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 主数据设置保存分发设置 + * @Date 9:40 上午 2023/10/18 + **/ + JsonResultEntity doSaveMdmModuleDistribute(JSONObject jsonObject); + + /** + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 主数据设置查询数据来源 + * @Date 9:40 上午 2023/10/18 + **/ + JsonResultEntity queryMdmModuleSource(JSONObject jsonObject); + /** + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 主数据设置保存数据来源 + * @Date 9:40 上午 2023/10/18 + **/ + JsonResultEntity doSaveMdmModuleSource(JSONObject jsonObject); + + + /** + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 查询下发日志 + * @Date 11:52 上午 2024/3/27 + **/ + JsonResultEntity querySendEntityPage(JSONObject jsonObject); + + /** + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 获取下发日志 + * @Date 2:36 下午 2024/3/27 + **/ + JsonResultEntity getSendEntity(JSONObject jsonObject); + + /** + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 删除下发日志 + * @Date 2:37 下午 2024/3/27 + **/ + JsonResultEntity deleteSendEntity(JSONObject jsonObject); + + /** + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 查询操作日志 + * @Date 11:52 上午 2024/3/27 + **/ + JsonResultEntity queryOptionEntityPage(JSONObject jsonObject); + + /** + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 获取操作日志 + * @Date 2:36 下午 2024/3/27 + **/ + JsonResultEntity getOptionEntity(JSONObject jsonObject); + + /** + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 删除操作日志 + * @Date 2:37 下午 2024/3/27 + **/ + JsonResultEntity deleteOptionEntity(JSONObject jsonObject); // - ///** - // * @param jsonObject - // * @return com.hzya.frame.web.entity.JsonResultEntity - // * @Author lvleigang - // * @Description 主数据设置保存分发设置 - // * @Date 9:40 上午 2023/10/18 - // **/ - //JsonResultEntity doSaveMdmModuleDistribute(JSONObject jsonObject); - // - ///** - // * @param jsonObject - // * @return com.hzya.frame.web.entity.JsonResultEntity - // * @Author lvleigang - // * @Description 主数据列表显示 树、查询条件、列表字段、按钮 - // * @Date 9:40 上午 2023/10/18 - // **/ - //JsonResultEntity queryMdmShow(JSONObject jsonObject); + /** + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 主数据列表显示 树、查询条件、列表字段、按钮 + * @Date 9:40 上午 2023/10/18 + **/ + JsonResultEntity queryMdmShow(JSONObject jsonObject); // ///** // * @param jsonObject diff --git a/service/src/main/java/com/hzya/frame/mdm/service/IMdmServiceCache.java b/service/src/main/java/com/hzya/frame/mdm/service/IMdmServiceCache.java index bc3a5ad2..36750991 100644 --- a/service/src/main/java/com/hzya/frame/mdm/service/IMdmServiceCache.java +++ b/service/src/main/java/com/hzya/frame/mdm/service/IMdmServiceCache.java @@ -5,6 +5,9 @@ import com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity; import com.hzya.frame.mdm.mdmModuleDb.entity.MdmModuleDbEntity; import com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity; import com.hzya.frame.mdm.mdmModuleDbFiledsRule.entity.MdmModuleDbFiledsRuleEntity; +import com.hzya.frame.mdm.mdmModuleDistribute.entity.MdmModuleDistributeEntity; +import com.hzya.frame.mdm.mdmModuleDistributeDetail.entity.MdmModuleDistributeDetailEntity; +import com.hzya.frame.mdm.mdmModuleSource.entity.MdmModuleSourceEntity; import com.hzya.frame.mdm.mdmModuleView.entity.MdmModuleViewEntity; import com.hzya.frame.mdm.mdmModuleViewButton.entity.MdmModuleViewButtonEntity; import com.hzya.frame.mdm.mdmModuleViewDetail.entity.MdmModuleViewDetailEntity; @@ -57,4 +60,14 @@ public interface IMdmServiceCache { void saveMdmModuleViewDetail(String id, List mdmModuleViewDetailEntities); void saveMdmModuleViewButton(String id, List mdmModuleViewButtonEntities); + + List queryMdmModuleDistribute(String id,MdmModuleDistributeEntity mdmModuleDistributeEntity); + + void saveMdmModuleDistribute(String id, List mdmModuleDistributeEntities); + + List queryMdmModuleSource(MdmModuleSourceEntity mdmModuleSourceEntity); + + void saveMdmModuleSource(String id, List mdmModuleSourceEntities); + + List queryMdmModuleDistributeDetail(MdmModuleDistributeDetailEntity mdmModuleDistributeDetailEntity); } diff --git a/service/src/main/java/com/hzya/frame/mdm/service/impl/MdmServiceCache.java b/service/src/main/java/com/hzya/frame/mdm/service/impl/MdmServiceCache.java index 1e5c7e0f..bf531ea9 100644 --- a/service/src/main/java/com/hzya/frame/mdm/service/impl/MdmServiceCache.java +++ b/service/src/main/java/com/hzya/frame/mdm/service/impl/MdmServiceCache.java @@ -13,7 +13,11 @@ import com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity; import com.hzya.frame.mdm.mdmModuleDbFiledsRule.dao.IMdmModuleDbFiledsRuleDao; import com.hzya.frame.mdm.mdmModuleDbFiledsRule.entity.MdmModuleDbFiledsRuleEntity; import com.hzya.frame.mdm.mdmModuleDistribute.dao.IMdmModuleDistributeDao; +import com.hzya.frame.mdm.mdmModuleDistribute.entity.MdmModuleDistributeEntity; import com.hzya.frame.mdm.mdmModuleDistributeDetail.dao.IMdmModuleDistributeDetailDao; +import com.hzya.frame.mdm.mdmModuleDistributeDetail.entity.MdmModuleDistributeDetailEntity; +import com.hzya.frame.mdm.mdmModuleSource.dao.IMdmModuleSourceDao; +import com.hzya.frame.mdm.mdmModuleSource.entity.MdmModuleSourceEntity; import com.hzya.frame.mdm.mdmModuleView.dao.IMdmModuleViewDao; import com.hzya.frame.mdm.mdmModuleView.entity.MdmModuleViewEntity; import com.hzya.frame.mdm.mdmModuleViewButton.dao.IMdmModuleViewButtonDao; @@ -25,6 +29,7 @@ import com.hzya.frame.mdm.mdmTableCodeRule.entity.MdmTableCodeRuleEntity; import com.hzya.frame.mdm.service.IMdmService; import com.hzya.frame.mdm.service.IMdmServiceCache; import com.hzya.frame.sysnew.integtationTask.entity.IntegrationTaskEntity; +import com.hzya.frame.uuid.UUIDUtils; import com.hzya.frame.web.entity.BaseResult; import com.hzya.frame.web.entity.JsonResultEntity; import org.slf4j.Logger; @@ -34,6 +39,7 @@ import org.springframework.cache.annotation.Cacheable; import org.springframework.stereotype.Service; import javax.annotation.Resource; +import java.util.ArrayList; import java.util.Date; import java.util.List; @@ -57,6 +63,8 @@ public class MdmServiceCache implements IMdmServiceCache { @Resource private IMdmModuleDistributeDetailDao mdmModuleDistributeDetailDao; @Resource + private IMdmModuleSourceDao mdmModuleSourceDao; + @Resource private IMdmModuleViewDao mdmModuleViewDao; @Resource private IMdmModuleViewButtonDao mdmModuleViewButtonDao; @@ -229,5 +237,110 @@ public class MdmServiceCache implements IMdmServiceCache { } } } + @Override + @Cacheable(cacheNames="mdmModuleDistribute",key = "#mdmId") + public List queryMdmModuleDistribute(String mdmId,MdmModuleDistributeEntity mdmModuleDistributeEntity) { + List mdmModuleDistributeEntities = mdmModuleDistributeDao.queryBase(mdmModuleDistributeEntity); + //查询模块下的应用列表 + MdmModuleDistributeDetailEntity mdmModuleDistributeDetailEntity = new MdmModuleDistributeDetailEntity(); + mdmModuleDistributeDetailEntity.setSts("Y"); + mdmModuleDistributeDetailEntity.setMdmId(mdmId); + List mdmModuleDistributeDetailEntities = mdmModuleDistributeDetailDao.queryBase(mdmModuleDistributeDetailEntity); + if(mdmModuleDistributeEntities != null && mdmModuleDistributeEntities.size() > 0){ + for (int i = 0; i < mdmModuleDistributeEntities.size(); i++) { + List moduleDistributeDetailEntities = new ArrayList<>(); + if(mdmModuleDistributeDetailEntities != null && mdmModuleDistributeDetailEntities.size() > 0){ + for (int i1 = 0; i1 < mdmModuleDistributeDetailEntities.size(); i1++) { + if(mdmModuleDistributeEntities.get(i).getId().equals(mdmModuleDistributeDetailEntities.get(i1).getDistributeId())){ + moduleDistributeDetailEntities.add(mdmModuleDistributeDetailEntities.get(i1)); + } + } + } + mdmModuleDistributeEntities.get(i).setMdmModuleDistributeDetailEntities(moduleDistributeDetailEntities); + } + } + return mdmModuleDistributeEntities; + } + @Override + @Cacheable(cacheNames="mdmModuleDistributeDetail",key = "#mdmId") + public List queryMdmModuleDistributeDetail(MdmModuleDistributeDetailEntity mdmModuleDistributeDetailEntity){ + List mdmModuleDistributeDetailEntities = mdmModuleDistributeDetailDao.queryBase(mdmModuleDistributeDetailEntity); + return mdmModuleDistributeDetailEntities; + } + + @Override + @CacheEvict(cacheNames="mdmModuleDistribute",key = "#mdmId") + public void saveMdmModuleDistribute(String mdmId, List mdmModuleDistributeEntities) { + //先删除 + MdmModuleDistributeEntity mdmModuleDistributeEntity = new MdmModuleDistributeEntity(); + mdmModuleDistributeEntity.setMdmId(mdmId); + mdmModuleDistributeEntity.setUpdate(); + mdmModuleDistributeDao.logicRemoveMultiCondition(mdmModuleDistributeEntity); + //保存主数据 + if (mdmModuleDistributeEntities != null && mdmModuleDistributeEntities.size() > 0) { + for (int i = 0; i < mdmModuleDistributeEntities.size(); i++) { + MdmModuleDistributeEntity moduleDistributeEntity = mdmModuleDistributeEntities.get(i); + moduleDistributeEntity.setMdmId(mdmId); + if (moduleDistributeEntity.getId() != null && !"".equals(moduleDistributeEntity.getId())) { + moduleDistributeEntity.setUpdate(); + //修改 + mdmModuleDistributeDao.update(moduleDistributeEntity); + } else { + //新增 + moduleDistributeEntity.setCreate(); + mdmModuleDistributeDao.save(moduleDistributeEntity); + } + if(moduleDistributeEntity.getMdmModuleDistributeDetailEntities() != null && moduleDistributeEntity.getMdmModuleDistributeDetailEntities().size() > 0){ + for (int i1 = 0; i1 < moduleDistributeEntity.getMdmModuleDistributeDetailEntities().size(); i1++) { + MdmModuleDistributeDetailEntity mdmModuleDistributeDetailEntity = moduleDistributeEntity.getMdmModuleDistributeDetailEntities().get(i1); + mdmModuleDistributeDetailEntity.setMdmId(mdmId); + mdmModuleDistributeDetailEntity.setDistributeId(moduleDistributeEntity.getId()); + if (mdmModuleDistributeDetailEntity.getId() != null && !"".equals(mdmModuleDistributeDetailEntity.getId())) { + mdmModuleDistributeDetailEntity.setUpdate(); + //修改 + mdmModuleDistributeDetailDao.update(mdmModuleDistributeDetailEntity); + } else { + //新增 + mdmModuleDistributeDetailEntity.setCreate(); + mdmModuleDistributeDetailDao.save(mdmModuleDistributeDetailEntity); + } + } + } + } + } + } + + @Override + @Cacheable(cacheNames="mdmModuleSource",key = "#mdmId") + public List queryMdmModuleSource(MdmModuleSourceEntity mdmModuleSourceEntity) { + List mdmModuleSourceEntities = mdmModuleSourceDao.queryBase(mdmModuleSourceEntity); + return mdmModuleSourceEntities; + } + + @Override + @CacheEvict(cacheNames="mdmModuleSource",key = "#mdmId") + public void saveMdmModuleSource(String mdmId, List mdmModuleSourceEntities) { + //先删除 + MdmModuleSourceEntity mdmModuleSourceEntity = new MdmModuleSourceEntity(); + mdmModuleSourceEntity.setMdmId(mdmId); + mdmModuleSourceEntity.setUpdate(); + mdmModuleSourceDao.logicRemoveMultiCondition(mdmModuleSourceEntity); + //保存主数据 + if (mdmModuleSourceEntities != null && mdmModuleSourceEntities.size() > 0) { + for (int i = 0; i < mdmModuleSourceEntities.size(); i++) { + MdmModuleSourceEntity mdmModuleSourceEntity1 = mdmModuleSourceEntities.get(i); + mdmModuleSourceEntity1.setMdmId(mdmId); + if (mdmModuleSourceEntity1.getId() != null && !"".equals(mdmModuleSourceEntity1.getId())) { + mdmModuleSourceEntity1.setUpdate(); + //修改 + mdmModuleSourceDao.update(mdmModuleSourceEntity1); + } else { + //新增 + mdmModuleSourceEntity1.setCreate(); + mdmModuleSourceDao.save(mdmModuleSourceEntity1); + } + } + } + } } 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 6756c7dc..bf517a33 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 @@ -1,17 +1,19 @@ package com.hzya.frame.mdm.service.impl; import cn.dev33.satoken.stp.StpUtil; -import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; -import com.hzya.frame.base.PluginBaseEntity; import com.hzya.frame.mdm.entity.DbFiledsDto; import com.hzya.frame.mdm.entity.MdmDbFiledVo; import com.hzya.frame.mdm.entity.MdmDbVo; +import com.hzya.frame.mdm.entity.MdmDistributeDto; import com.hzya.frame.mdm.entity.MdmDto; import com.hzya.frame.mdm.entity.MdmModuleViewDto; import com.hzya.frame.mdm.entity.MdmModuleViewVo; +import com.hzya.frame.mdm.entity.MdmSourceDto; +import com.hzya.frame.mdm.entity.MdmViewFiledVo; +import com.hzya.frame.mdm.entity.MdmViewVo; import com.hzya.frame.mdm.mdmModule.dao.IMdmModuleDao; import com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity; import com.hzya.frame.mdm.mdmModuleDb.dao.IMdmModuleDbDao; @@ -23,7 +25,11 @@ import com.hzya.frame.mdm.mdmModuleDbFiledsRule.entity.MdmModuleDbFiledsRuleEnti import com.hzya.frame.mdm.mdmModuleDistribute.dao.IMdmModuleDistributeDao; import com.hzya.frame.mdm.mdmModuleDistribute.entity.MdmModuleDistributeEntity; import com.hzya.frame.mdm.mdmModuleDistributeDetail.dao.IMdmModuleDistributeDetailDao; -import com.hzya.frame.mdm.mdmModuleDistributeDetail.entity.MdmModuleDistributeDetailEntity; +import com.hzya.frame.mdm.mdmModuleOptionLog.dao.IMdmModuleOptionLogDao; +import com.hzya.frame.mdm.mdmModuleOptionLog.entity.MdmModuleOptionLogEntity; +import com.hzya.frame.mdm.mdmModuleSendLog.dao.IMdmModuleSendLogDao; +import com.hzya.frame.mdm.mdmModuleSendLog.entity.MdmModuleSendLogEntity; +import com.hzya.frame.mdm.mdmModuleSource.entity.MdmModuleSourceEntity; import com.hzya.frame.mdm.mdmModuleView.dao.IMdmModuleViewDao; import com.hzya.frame.mdm.mdmModuleView.entity.MdmModuleViewEntity; import com.hzya.frame.mdm.mdmModuleViewButton.dao.IMdmModuleViewButtonDao; @@ -34,19 +40,15 @@ import com.hzya.frame.mdm.mdmTableCodeRule.entity.MdmTableCodeRuleEntity; import com.hzya.frame.mdm.service.IMdmService; import com.hzya.frame.mdm.service.IMdmServiceCache; -import com.hzya.frame.sys.entity.FormmainDeleteDto; -import com.hzya.frame.sys.entity.ModuleDto; -import com.hzya.frame.sys.module.entity.Module; -import com.hzya.frame.sys.roleModule.entity.RoleModule; -import com.hzya.frame.sysnew.application.plugin.entity.SysApplicationPluginEntity; import com.hzya.frame.sysnew.buttonConfig.dao.ISysButtonConfigDao; import com.hzya.frame.sysnew.buttonConfig.entity.SysButtonConfigEntity; import com.hzya.frame.sysnew.menuConfig.dao.ISysMenuConfigDao; import com.hzya.frame.sysnew.menuConfig.entity.SysMenuConfigEntity; import com.hzya.frame.sysnew.popedomOperate.dao.ISysPopedomOperateDao; import com.hzya.frame.sysnew.popedomOperate.entity.SysPopedomOperateEntity; -import com.hzya.frame.util.PluginUtils; -import com.hzya.frame.uuid.UUIDUtils; +import com.hzya.frame.sysnew.user.entity.SysUserEntity; +import com.hzya.frame.sysnew.userCompany.entity.SysUserCompanyEntity; +import com.hzya.frame.sysnew.userRoles.entity.SysUserRolesEntity; import com.hzya.frame.web.entity.BaseResult; import com.hzya.frame.web.entity.JsonResultEntity; import org.slf4j.Logger; @@ -54,14 +56,10 @@ import org.slf4j.LoggerFactory; import org.springframework.stereotype.Service; import javax.annotation.Resource; -import java.text.SimpleDateFormat; import java.util.ArrayList; -import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.Objects; -import java.util.stream.Collectors; /** @@ -74,6 +72,10 @@ public class MdmServiceImpl implements IMdmService { @Resource private IMdmModuleDao mdmModuleDao; @Resource + private IMdmModuleSendLogDao mdmModuleSendLogDao; + @Resource + private IMdmModuleOptionLogDao mdmModuleOptionLogDao; + @Resource private IMdmServiceCache mdmServiceCache; @Resource private ISysMenuConfigDao sysMenuConfigDao; @@ -1515,6 +1517,366 @@ public class MdmServiceImpl implements IMdmService { } } } + + /** + * @param object + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 主数据设置查询分发设置 + * @Date 9:40 上午 2023/10/18 + **/ + @Override + public JsonResultEntity queryMdmModuleDistribute(JSONObject object) { + MdmDto entity = getData("jsonStr", object, MdmDto.class); + if (entity == null) { + return BaseResult.getFailureMessageEntity("参数不允许为空"); + } + if (entity.getMdmCode() == null || "".equals(entity.getMdmCode())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + MdmModuleEntity mdmModuleEntity = mdmServiceCache.getMdmModuleEntity(entity.getMdmCode()); + if(mdmModuleEntity == null || mdmModuleEntity.getId() == null){ + return BaseResult.getFailureMessageEntity("系统错误"); + } + //查询模块下的应用列表 + MdmModuleDistributeEntity mdmModuleDistributeEntity = new MdmModuleDistributeEntity(); + mdmModuleDistributeEntity.setSts("Y"); + mdmModuleDistributeEntity.setMdmId(mdmModuleEntity.getId()); + List mdmModuleDistributeEntities = mdmServiceCache.queryMdmModuleDistribute(mdmModuleEntity.getId(),mdmModuleDistributeEntity); + return BaseResult.getSuccessMessageEntity("查询成功", mdmModuleDistributeEntities); + } + /** + * @param object + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 主数据设置保存分发设置 + * @Date 9:40 上午 2023/10/18 + **/ + @Override + public JsonResultEntity doSaveMdmModuleDistribute(JSONObject object) { + MdmDistributeDto entity = getData("jsonStr", object, MdmDistributeDto.class); + //判断是否有数据 + if (entity == null) { + return BaseResult.getFailureMessageEntity("参数不允许为空"); + } + if (entity.getMdmCode() == null || "".equals(entity.getMdmCode())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + MdmModuleEntity mdmModuleEntity = mdmServiceCache.getMdmModuleEntity(entity.getMdmCode()); + if(mdmModuleEntity == null || mdmModuleEntity.getId() == null){ + return BaseResult.getFailureMessageEntity("系统错误"); + } + mdmServiceCache.saveMdmModuleDistribute(mdmModuleEntity.getId(),entity.getMdmModuleDistributeEntities()); + return BaseResult.getSuccessMessageEntity("保存发布设置成功"); + } + + /** + * @param object + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 主数据设置查询数据来源 + * @Date 9:40 上午 2023/10/18 + **/ + @Override + public JsonResultEntity queryMdmModuleSource(JSONObject object) { + MdmDto entity = getData("jsonStr", object, MdmDto.class); + if (entity == null) { + return BaseResult.getFailureMessageEntity("参数不允许为空"); + } + if (entity.getMdmCode() == null || "".equals(entity.getMdmCode())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + MdmModuleEntity mdmModuleEntity = mdmServiceCache.getMdmModuleEntity(entity.getMdmCode()); + if(mdmModuleEntity == null || mdmModuleEntity.getId() == null){ + return BaseResult.getFailureMessageEntity("系统错误"); + } + //查询模块下的应用列表 + MdmModuleSourceEntity mdmModuleSourceEntity = new MdmModuleSourceEntity(); + mdmModuleSourceEntity.setSts("Y"); + mdmModuleSourceEntity.setMdmId(mdmModuleEntity.getId()); + List mdmModuleSourceEntities = mdmServiceCache.queryMdmModuleSource(mdmModuleSourceEntity); + return BaseResult.getSuccessMessageEntity("查询成功", mdmModuleSourceEntities); + } + /** + * @param object + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 主数据设置保存数据来源 + * @Date 9:40 上午 2023/10/18 + **/ + @Override + public JsonResultEntity doSaveMdmModuleSource(JSONObject object) { + MdmSourceDto entity = getData("jsonStr", object, MdmSourceDto.class); + //判断是否有数据 + if (entity == null) { + return BaseResult.getFailureMessageEntity("参数不允许为空"); + } + if (entity.getMdmCode() == null || "".equals(entity.getMdmCode())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + MdmModuleEntity mdmModuleEntity = mdmServiceCache.getMdmModuleEntity(entity.getMdmCode()); + if(mdmModuleEntity == null || mdmModuleEntity.getId() == null){ + return BaseResult.getFailureMessageEntity("系统错误"); + } + mdmServiceCache.saveMdmModuleSource(mdmModuleEntity.getId(),entity.getMdmModuleSourceEntities()); + return BaseResult.getSuccessMessageEntity("保存发布设置成功"); + } + + /** + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 查询下发日志 + * @Date 11:52 上午 2024/3/27 + **/ + @Override + public JsonResultEntity querySendEntityPage(JSONObject jsonObject) { + MdmModuleSendLogEntity entity = getData("jsonStr", jsonObject, MdmModuleSendLogEntity.class); + //判断分页 + if (entity == null || entity.getPageNum() == null || entity.getPageSize() == null) { + return BaseResult.getFailureMessageEntity("分页查询参数不存在"); + } + if (entity.getMdmCode() == null || "".equals(entity.getMdmCode())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + MdmModuleEntity mdmModuleEntity = mdmServiceCache.getMdmModuleEntity(entity.getMdmCode()); + if(mdmModuleEntity == null || mdmModuleEntity.getId() == null){ + return BaseResult.getFailureMessageEntity("系统错误"); + } + MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); + mdmModuleDbEntity.setMdmId(mdmModuleEntity.getId()); + mdmModuleDbEntity.setSts("Y"); + List mdmModuleDbEntities = mdmServiceCache.queryMdmModuleDb(mdmModuleDbEntity); + if(mdmModuleDbEntities != null && mdmModuleDbEntities.size() > 0 ){ + for (int i = 0; i < mdmModuleDbEntities.size(); i++) { + if("1".equals(mdmModuleDbEntities.get(i).getDbType())){ + entity.setTableName(mdmModuleDbEntities.get(i).getDbName()+"_send_log"); + break; + } + } + }else { + return BaseResult.getFailureMessageEntity("请先设置数据源"); + } + PageHelper.startPage(entity.getPageNum(), entity.getPageSize()); + List list = mdmModuleSendLogDao.queryByLike(entity); + PageInfo pageInfo = new PageInfo(list); + return BaseResult.getSuccessMessageEntity("查询数据成功", pageInfo); + } + + /** + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 获取下发日志 + * @Date 2:36 下午 2024/3/27 + **/ + @Override + public JsonResultEntity getSendEntity(JSONObject jsonObject) { + MdmModuleSendLogEntity entity = getData("jsonStr", jsonObject, MdmModuleSendLogEntity.class); + if (entity == null) { + return BaseResult.getFailureMessageEntity("参数不允许为空"); + } + if (entity.getId() == null || "".equals(entity.getId())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + if (entity.getMdmCode() == null || "".equals(entity.getMdmCode())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + MdmModuleEntity mdmModuleEntity = mdmServiceCache.getMdmModuleEntity(entity.getMdmCode()); + if(mdmModuleEntity == null || mdmModuleEntity.getId() == null){ + return BaseResult.getFailureMessageEntity("系统错误"); + } + MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); + mdmModuleDbEntity.setMdmId(mdmModuleEntity.getId()); + mdmModuleDbEntity.setSts("Y"); + List mdmModuleDbEntities = mdmServiceCache.queryMdmModuleDb(mdmModuleDbEntity); + if(mdmModuleDbEntities != null && mdmModuleDbEntities.size() > 0 ){ + for (int i = 0; i < mdmModuleDbEntities.size(); i++) { + if("1".equals(mdmModuleDbEntities.get(i).getDbType())){ + entity.setTableName(mdmModuleDbEntities.get(i).getDbName()+"_send_log"); + break; + } + } + }else { + return BaseResult.getFailureMessageEntity("请先设置数据源"); + } + entity = mdmModuleSendLogDao.get(entity.getId()); + if (entity == null) { + return BaseResult.getFailureMessageEntity("获取日志失败"); + } + return BaseResult.getSuccessMessageEntity("获取日志成功", entity); + } + + /** + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 删除下发日志 + * @Date 2:37 下午 2024/3/27 + **/ + @Override + public JsonResultEntity deleteSendEntity(JSONObject jsonObject) { + MdmModuleSendLogEntity entity = getData("jsonStr", jsonObject, MdmModuleSendLogEntity.class); + if (entity == null) { + return BaseResult.getFailureMessageEntity("参数不允许为空"); + } + if (entity.getId() == null || "".equals(entity.getId())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + if (entity.getMdmCode() == null || "".equals(entity.getMdmCode())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + MdmModuleEntity mdmModuleEntity = mdmServiceCache.getMdmModuleEntity(entity.getMdmCode()); + if(mdmModuleEntity == null || mdmModuleEntity.getId() == null){ + return BaseResult.getFailureMessageEntity("系统错误"); + } + MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); + mdmModuleDbEntity.setMdmId(mdmModuleEntity.getId()); + mdmModuleDbEntity.setSts("Y"); + List mdmModuleDbEntities = mdmServiceCache.queryMdmModuleDb(mdmModuleDbEntity); + if(mdmModuleDbEntities != null && mdmModuleDbEntities.size() > 0 ){ + for (int i = 0; i < mdmModuleDbEntities.size(); i++) { + if("1".equals(mdmModuleDbEntities.get(i).getDbType())){ + entity.setTableName(mdmModuleDbEntities.get(i).getDbName()+"_send_log"); + break; + } + } + }else { + return BaseResult.getFailureMessageEntity("请先设置数据源"); + } + entity.setUpdate(); + mdmModuleSendLogDao.logicRemove(entity); + return BaseResult.getSuccessMessageEntity("删除日志成功"); + } + + + + /** + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 查询操作日志 + * @Date 11:52 上午 2024/3/27 + **/ + @Override + public JsonResultEntity queryOptionEntityPage(JSONObject jsonObject) { + MdmModuleOptionLogEntity entity = getData("jsonStr", jsonObject, MdmModuleOptionLogEntity.class); + //判断分页 + if (entity == null || entity.getPageNum() == null || entity.getPageSize() == null) { + return BaseResult.getFailureMessageEntity("分页查询参数不存在"); + } + if (entity.getMdmCode() == null || "".equals(entity.getMdmCode())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + MdmModuleEntity mdmModuleEntity = mdmServiceCache.getMdmModuleEntity(entity.getMdmCode()); + if(mdmModuleEntity == null || mdmModuleEntity.getId() == null){ + return BaseResult.getFailureMessageEntity("系统错误"); + } + MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); + mdmModuleDbEntity.setMdmId(mdmModuleEntity.getId()); + mdmModuleDbEntity.setSts("Y"); + List mdmModuleDbEntities = mdmServiceCache.queryMdmModuleDb(mdmModuleDbEntity); + if(mdmModuleDbEntities != null && mdmModuleDbEntities.size() > 0 ){ + for (int i = 0; i < mdmModuleDbEntities.size(); i++) { + if("1".equals(mdmModuleDbEntities.get(i).getDbType())){ + entity.setTableName(mdmModuleDbEntities.get(i).getDbName()+"_send_log"); + break; + } + } + }else { + return BaseResult.getFailureMessageEntity("请先设置数据源"); + } + PageHelper.startPage(entity.getPageNum(), entity.getPageSize()); + List list = mdmModuleOptionLogDao.queryByLike(entity); + PageInfo pageInfo = new PageInfo(list); + return BaseResult.getSuccessMessageEntity("查询数据成功", pageInfo); + } + + /** + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 获取操作日志 + * @Date 2:36 下午 2024/3/27 + **/ + @Override + public JsonResultEntity getOptionEntity(JSONObject jsonObject) { + MdmModuleOptionLogEntity entity = getData("jsonStr", jsonObject, MdmModuleOptionLogEntity.class); + if (entity == null) { + return BaseResult.getFailureMessageEntity("参数不允许为空"); + } + if (entity.getId() == null || "".equals(entity.getId())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + if (entity.getMdmCode() == null || "".equals(entity.getMdmCode())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + MdmModuleEntity mdmModuleEntity = mdmServiceCache.getMdmModuleEntity(entity.getMdmCode()); + if(mdmModuleEntity == null || mdmModuleEntity.getId() == null){ + return BaseResult.getFailureMessageEntity("系统错误"); + } + MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); + mdmModuleDbEntity.setMdmId(mdmModuleEntity.getId()); + mdmModuleDbEntity.setSts("Y"); + List mdmModuleDbEntities = mdmServiceCache.queryMdmModuleDb(mdmModuleDbEntity); + if(mdmModuleDbEntities != null && mdmModuleDbEntities.size() > 0 ){ + for (int i = 0; i < mdmModuleDbEntities.size(); i++) { + if("1".equals(mdmModuleDbEntities.get(i).getDbType())){ + entity.setTableName(mdmModuleDbEntities.get(i).getDbName()+"_send_log"); + break; + } + } + }else { + return BaseResult.getFailureMessageEntity("请先设置数据源"); + } + entity = mdmModuleOptionLogDao.get(entity.getId()); + if (entity == null) { + return BaseResult.getFailureMessageEntity("获取日志失败"); + } + return BaseResult.getSuccessMessageEntity("获取日志成功", entity); + } + + /** + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 删除操作日志 + * @Date 2:37 下午 2024/3/27 + **/ + @Override + public JsonResultEntity deleteOptionEntity(JSONObject jsonObject) { + MdmModuleOptionLogEntity entity = getData("jsonStr", jsonObject, MdmModuleOptionLogEntity.class); + if (entity == null) { + return BaseResult.getFailureMessageEntity("参数不允许为空"); + } + if (entity.getId() == null || "".equals(entity.getId())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + if (entity.getMdmCode() == null || "".equals(entity.getMdmCode())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + MdmModuleEntity mdmModuleEntity = mdmServiceCache.getMdmModuleEntity(entity.getMdmCode()); + if(mdmModuleEntity == null || mdmModuleEntity.getId() == null){ + return BaseResult.getFailureMessageEntity("系统错误"); + } + MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); + mdmModuleDbEntity.setMdmId(mdmModuleEntity.getId()); + mdmModuleDbEntity.setSts("Y"); + List mdmModuleDbEntities = mdmServiceCache.queryMdmModuleDb(mdmModuleDbEntity); + if(mdmModuleDbEntities != null && mdmModuleDbEntities.size() > 0 ){ + for (int i = 0; i < mdmModuleDbEntities.size(); i++) { + if("1".equals(mdmModuleDbEntities.get(i).getDbType())){ + entity.setTableName(mdmModuleDbEntities.get(i).getDbName()+"_send_log"); + break; + } + } + }else { + return BaseResult.getFailureMessageEntity("请先设置数据源"); + } + entity.setUpdate(); + mdmModuleOptionLogDao.logicRemove(entity); + return BaseResult.getSuccessMessageEntity("删除日志成功"); + } ///** // * @param object // * @return com.hzya.frame.web.entity.JsonResultEntity @@ -2066,266 +2428,83 @@ public class MdmServiceImpl implements IMdmService { // return BaseResult.getSuccessMessageEntity("保存成功"); //} // - ///** - // * @param object - // * @return com.hzya.frame.web.entity.JsonResultEntity - // * @Author lvleigang - // * @Description 主数据设置查询分发设置 - // * @Date 9:40 上午 2023/10/18 - // **/ - //@Override - //public JsonResultEntity queryMdmModuleDistribute(JSONObject object) { - // MdmDto entity = getData("jsonStr", object, MdmDto.class); - // if (entity == null) { - // return BaseResult.getFailureMessageEntity("参数不允许为空"); - // } - // if (entity.getId() == null || "".equals(entity.getId())) { - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // //查询模块下的应用列表 - // MdmModuleDistributeEntity mdmModuleDistributeEntity = new MdmModuleDistributeEntity(); - // mdmModuleDistributeEntity.setSts("Y"); - // mdmModuleDistributeEntity.setMdmId(entity.getId()); - // List mdmModuleDistributeEntities = mdmModuleDistributeDao.queryBase(mdmModuleDistributeEntity); - // if (mdmModuleDistributeEntities != null && mdmModuleDistributeEntities.size() > 0) { - // MdmModuleDistributeDetailEntity mdmModuleDistributeDetailEntity = new MdmModuleDistributeDetailEntity(); - // mdmModuleDistributeDetailEntity.setSts("Y"); - // mdmModuleDistributeDetailEntity.setMdmId(entity.getId()); - // List mdmModuleDistributeDetailEntities = mdmModuleDistributeDetailDao.queryBase(mdmModuleDistributeDetailEntity); - // if (mdmModuleDistributeDetailEntities != null && mdmModuleDistributeDetailEntities.size() > 0) { - // for (int i = 0; i < mdmModuleDistributeEntities.size(); i++) { - // List addlist = new ArrayList<>(); - // List deletelist = new ArrayList<>(); - // for (int i1 = 0; i1 < mdmModuleDistributeDetailEntities.size(); i1++) { - // if (mdmModuleDistributeEntities.get(i).getAddApi().equals(mdmModuleDistributeDetailEntities.get(i1).getApiId()) - // && mdmModuleDistributeEntities.get(i).getId().equals(mdmModuleDistributeDetailEntities.get(i1).getDistributeId())) { - // addlist.add(mdmModuleDistributeDetailEntities.get(i1)); - // } - // if (mdmModuleDistributeEntities.get(i).getDeleteApi().equals(mdmModuleDistributeDetailEntities.get(i1).getApiId()) - // && mdmModuleDistributeEntities.get(i).getId().equals(mdmModuleDistributeDetailEntities.get(i1).getDistributeId())) { - // deletelist.add(mdmModuleDistributeDetailEntities.get(i1)); - // } - // } - // mdmModuleDistributeEntities.get(i).setAddList(addlist); - // mdmModuleDistributeEntities.get(i).setDeleteList(deletelist); - // } - // } - // } - // return BaseResult.getSuccessMessageEntity("查询成功", mdmModuleDistributeEntities); - //} + // - ///** - // * @param object - // * @return com.hzya.frame.web.entity.JsonResultEntity - // * @Author lvleigang - // * @Description 主数据设置保存分发设置 - // * @Date 9:40 上午 2023/10/18 - // **/ - //@Override - //public JsonResultEntity doSaveMdmModuleDistribute(JSONObject object) { - // MdmDistributeDto entity = getData("jsonStr", object, MdmDistributeDto.class); - // //判断是否有数据 - // if (entity == null) { - // return BaseResult.getFailureMessageEntity("参数不允许为空"); - // } - // if (entity.getId() == null || "".equals(entity.getId())) { - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // //if(entity.getMdmModuleDistributeEntities() == null ){ - // // return BaseResult.getFailureMessageEntity("参数不允许为空"); - // //} - // //先删除 - // MdmModuleDistributeEntity mdmModuleDistributeEntity = new MdmModuleDistributeEntity(); - // mdmModuleDistributeEntity.setMdmId(entity.getId()); - // mdmModuleDistributeEntity.setSts("Y"); - // mdmModuleDistributeEntity.setModify_user_id(StpUtil.getLoginIdAsString()); - // mdmModuleDistributeEntity.setModify_time(new Date()); - // mdmModuleDistributeDao.logicRemoveMultiCondition(mdmModuleDistributeEntity); + // - // MdmModuleDistributeDetailEntity mdmModuleDistributeDetailEntity = new MdmModuleDistributeDetailEntity(); - // mdmModuleDistributeDetailEntity.setMdmId(entity.getId()); - // mdmModuleDistributeDetailEntity.setSts("Y"); - // mdmModuleDistributeDetailEntity.setModify_user_id(StpUtil.getLoginIdAsString()); - // mdmModuleDistributeDetailEntity.setModify_time(new Date()); - // mdmModuleDistributeDetailDao.logicRemoveMultiCondition(mdmModuleDistributeDetailEntity); - // - // //保存主数据 - // List mdmModuleDistributeEntities = entity.getMdmModuleDistributeEntities(); - // - // if (mdmModuleDistributeEntities != null && mdmModuleDistributeEntities.size() > 0) { - // for (int i = 0; i < mdmModuleDistributeEntities.size(); i++) { - // MdmModuleDistributeEntity moduleDistributeEntity = mdmModuleDistributeEntities.get(i); - // moduleDistributeEntity.setMdmId(entity.getId()); - // moduleDistributeEntity.setSts("Y"); - // moduleDistributeEntity.setModify_user_id(StpUtil.getLoginIdAsString()); - // moduleDistributeEntity.setModify_time(new Date()); - // if (moduleDistributeEntity.getId() != null && !"".equals(moduleDistributeEntity.getId())) { - // //修改 - // mdmModuleDistributeDao.update(moduleDistributeEntity); - // } else { - // //新增 - // moduleDistributeEntity.setId(UUIDUtils.getUUID()); - // moduleDistributeEntity.setCreate_user_id(StpUtil.getLoginIdAsString()); - // moduleDistributeEntity.setCreate_time(new Date()); - // mdmModuleDistributeDao.save(moduleDistributeEntity); - // } - // if (moduleDistributeEntity.getAddList() != null && moduleDistributeEntity.getAddList().size() > 0) { - // for (int i1 = 0; i1 < moduleDistributeEntity.getAddList().size(); i1++) { - // MdmModuleDistributeDetailEntity moduleDistributeDetailEntity = moduleDistributeEntity.getAddList().get(i1); - // moduleDistributeDetailEntity.setMdmId(entity.getId()); - // moduleDistributeDetailEntity.setSts("Y"); - // moduleDistributeDetailEntity.setApiId(moduleDistributeEntity.getAddApi()); - // moduleDistributeDetailEntity.setDistributeId(moduleDistributeEntity.getId()); - // moduleDistributeDetailEntity.setModify_user_id(StpUtil.getLoginIdAsString()); - // moduleDistributeDetailEntity.setModify_time(new Date()); - // if (moduleDistributeDetailEntity.getId() != null && !"".equals(moduleDistributeDetailEntity.getId())) { - // //修改 - // mdmModuleDistributeDetailDao.update(moduleDistributeDetailEntity); - // } else { - // //新增 - // moduleDistributeDetailEntity.setId(UUIDUtils.getUUID()); - // moduleDistributeDetailEntity.setCreate_user_id(StpUtil.getLoginIdAsString()); - // moduleDistributeDetailEntity.setCreate_time(new Date()); - // mdmModuleDistributeDetailDao.save(moduleDistributeDetailEntity); - // } - // } - // } - // if (moduleDistributeEntity.getDeleteList() != null && moduleDistributeEntity.getDeleteList().size() > 0) { - // for (int i1 = 0; i1 < moduleDistributeEntity.getDeleteList().size(); i1++) { - // MdmModuleDistributeDetailEntity moduleDistributeDetailEntity = moduleDistributeEntity.getDeleteList().get(i1); - // moduleDistributeDetailEntity.setMdmId(entity.getId()); - // moduleDistributeDetailEntity.setSts("Y"); - // moduleDistributeDetailEntity.setApiId(moduleDistributeEntity.getDeleteApi()); - // moduleDistributeDetailEntity.setDistributeId(moduleDistributeEntity.getId()); - // moduleDistributeDetailEntity.setModify_user_id(StpUtil.getLoginIdAsString()); - // moduleDistributeDetailEntity.setModify_time(new Date()); - // if (moduleDistributeDetailEntity.getId() != null && !"".equals(moduleDistributeDetailEntity.getId())) { - // //修改 - // mdmModuleDistributeDetailDao.update(moduleDistributeDetailEntity); - // } else { - // //新增 - // moduleDistributeDetailEntity.setId(UUIDUtils.getUUID()); - // moduleDistributeDetailEntity.setCreate_user_id(StpUtil.getLoginIdAsString()); - // moduleDistributeDetailEntity.setCreate_time(new Date()); - // mdmModuleDistributeDetailDao.save(moduleDistributeDetailEntity); - // } - // } - // } - // } - // } - // return BaseResult.getSuccessMessageEntity("保存发布设置成功"); - //} - // - ///** - // * @param object - // * @return com.hzya.frame.web.entity.JsonResultEntity - // * @Author lvleigang - // * @Description 主数据列表显示 树、查询条件、列表字段、按钮 - // * @Date 9:40 上午 2023/10/18 - // **/ - //@Override - //public JsonResultEntity queryMdmShow(JSONObject object) { - // MdmDto entity = getData("jsonStr", object, MdmDto.class); - // if (entity == null) { - // return BaseResult.getFailureMessageEntity("参数不允许为空"); - // } - // if (entity.getMdmCode() == null || "".equals(entity.getMdmCode())) { - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // //查询模版 - // MdmModuleEntity mdmModuleEntity = new MdmModuleEntity(); - // mdmModuleEntity.setMdmCode(entity.getMdmCode()); - // mdmModuleEntity.setSts("Y"); - // List mdmModuleEntities = mdmModuleDao.queryBase(mdmModuleEntity); - // if (mdmModuleEntities == null || mdmModuleEntities.size() != 1) { - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // - // MdmViewVo mdmViewVo = new MdmViewVo(); - // mdmModuleEntity = mdmModuleEntities.get(0); - // mdmViewVo.setMdmModuleEntity(mdmModuleEntity); - // //查询展示类型 - // MdmModuleViewEntity mdmModuleViewEntity = new MdmModuleViewEntity(); - // mdmModuleViewEntity.setMdmId(mdmModuleEntity.getId()); - // mdmModuleViewEntity.setSts("Y"); - // List moduleViewEntityList = mdmModuleViewDao.queryBase(mdmModuleViewEntity); - // if (moduleViewEntityList == null || moduleViewEntityList.size() != 1) { - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // mdmModuleViewEntity = moduleViewEntityList.get(0); - // mdmViewVo.setMdmModuleViewEntity(mdmModuleViewEntity); - // - // //查询数据源主表 - // MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); - // mdmModuleDbEntity.setMdmId(mdmModuleEntity.getId()); - // mdmModuleDbEntity.setSts("Y"); - // List mdmModuleDbEntityList = mdmModuleDbDao.queryBase(mdmModuleDbEntity); - // if (mdmModuleDbEntityList == null || mdmModuleDbEntityList.size() == 0) { - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // //查询数据源表下面的字段 - // MdmModuleDbFiledsEntity mdmModuleDbFiledsEntity = new MdmModuleDbFiledsEntity(); - // mdmModuleDbFiledsEntity.setMdmId(mdmModuleEntity.getId()); - // mdmModuleDbFiledsEntity.setSts("Y"); - // List mdmModuleDbFiledsEntityList = mdmModuleDbFiledsDao.queryBase(mdmModuleDbFiledsEntity); - // if (mdmModuleDbFiledsEntityList == null || mdmModuleDbFiledsEntityList.size() == 0) { - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // //查询字段下的规则 - // MdmModuleDbFiledsRuleEntity mdmModuleDbFiledsRuleEntity = new MdmModuleDbFiledsRuleEntity(); - // mdmModuleDbFiledsRuleEntity.setMdmId(mdmModuleEntity.getId()); - // mdmModuleDbFiledsRuleEntity.setSts("Y"); - // List mdmModuleDbFiledsRuleEntityList = mdmModuleDbFiledsRuleDao.queryBase(mdmModuleDbFiledsRuleEntity); - // if (mdmModuleDbFiledsRuleEntityList == null || mdmModuleDbFiledsRuleEntityList.size() == 0) { - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // //查询设置的查询字段 - // MdmModuleViewDetailEntity mdmModuleViewDetailEntity = new MdmModuleViewDetailEntity(); - // mdmModuleViewDetailEntity.setMdmId(mdmModuleEntity.getId()); - // mdmModuleViewDetailEntity.setSts("Y"); - // mdmModuleViewDetailEntity.setViewType("1"); - // List queryList = mdmModuleViewDetailDao.queryBase(mdmModuleViewDetailEntity); - // //设置字段 - // List queryListVo = setQueryList(mdmModuleDbEntityList, mdmModuleDbFiledsEntityList, mdmModuleDbFiledsRuleEntityList, queryList, false); - // mdmViewVo.setQueryList(queryListVo); - // - // //查询用户设置字段 - // MdmModuleUserViewEntity mdmModuleUserViewEntity = new MdmModuleUserViewEntity(); - // mdmModuleUserViewEntity.setMdmId(mdmModuleEntity.getId()); - // mdmModuleUserViewEntity.setSts("Y"); - // mdmModuleUserViewEntity.setUserId(StpUtil.getLoginIdAsString()); - // List mdmModuleUserViewEntities = mdmModuleUserViewDao.queryBase(mdmModuleUserViewEntity); - // - // //查询设置的查询字段 - // MdmModuleViewDetailEntity mdmModuleViewDetailEntity1 = new MdmModuleViewDetailEntity(); - // mdmModuleViewDetailEntity1.setMdmId(mdmModuleEntity.getId()); - // mdmModuleViewDetailEntity1.setSts("Y"); - // mdmModuleViewDetailEntity1.setViewType("2"); - // List listList = mdmModuleViewDetailDao.queryBase(mdmModuleViewDetailEntity1); - // List dolistList = new ArrayList<>(); - // - // if (mdmModuleUserViewEntities != null && mdmModuleUserViewEntities.size() > 0) { - // dolistList = getDolist(listList, mdmModuleUserViewEntities); - // if (dolistList == null || dolistList.size() == 0) { - // dolistList = listList; - // } - // } else { - // dolistList = listList; - // } - // List listListVo = setQueryList(mdmModuleDbEntityList, mdmModuleDbFiledsEntityList, mdmModuleDbFiledsRuleEntityList, dolistList, true); - // mdmViewVo.setListList(listListVo); - // - // List buttonList = new ArrayList<>(); - // buttonList.add(new MdmViewButtonVo("new", "新建")); - // buttonList.add(new MdmViewButtonVo("resize", "重置")); - // buttonList.add(new MdmViewButtonVo("search", "查询")); - // buttonList.add(new MdmViewButtonVo("edit", "修改")); - // buttonList.add(new MdmViewButtonVo("dele", "删除")); - // buttonList.add(new MdmViewButtonVo("view", "查看")); - // buttonList.add(new MdmViewButtonVo("send", "下发")); - // mdmViewVo.setButtonList(buttonList); - // return BaseResult.getSuccessMessageEntity("获取字段成功", mdmViewVo); - //} + /** + * @param object + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 主数据列表显示 树、查询条件、列表字段、按钮 + * @Date 9:40 上午 2023/10/18 + **/ + @Override + public JsonResultEntity queryMdmShow(JSONObject object) { + MdmDto entity = getData("jsonStr", object, MdmDto.class); + if (entity == null) { + return BaseResult.getFailureMessageEntity("参数不允许为空"); + } + if (entity.getMdmCode() == null || "".equals(entity.getMdmCode())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + //查询模版 + MdmModuleEntity mdmModuleEntity = mdmServiceCache.getMdmModuleEntity(entity.getMdmCode()); + if(mdmModuleEntity == null || mdmModuleEntity.getId() == null){ + return BaseResult.getFailureMessageEntity("系统错误"); + } + + //设置模版 + MdmViewVo mdmViewVo = new MdmViewVo(); + mdmViewVo.setMdmModuleEntity(mdmModuleEntity); + //查询展示类型 + MdmModuleViewEntity mdmModuleViewEntity = new MdmModuleViewEntity(); + mdmModuleViewEntity.setMdmId(mdmModuleEntity.getId()); + mdmModuleViewEntity.setSts("Y"); + List moduleViewEntityList = mdmServiceCache.queryMdmModuleView(mdmModuleViewEntity); + if (moduleViewEntityList == null || moduleViewEntityList.size() != 1) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + mdmModuleViewEntity = moduleViewEntityList.get(0); + mdmViewVo.setMdmModuleViewEntity(mdmModuleViewEntity); + + //查询数据源主表 + MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); + mdmModuleDbEntity.setMdmId(mdmModuleEntity.getId()); + mdmModuleDbEntity.setSts("Y"); + List mdmModuleDbEntityList = mdmServiceCache.queryMdmModuleDb(mdmModuleDbEntity); + if (mdmModuleDbEntityList == null || mdmModuleDbEntityList.size() == 0) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + //查询数据源表下面的字段 + MdmModuleDbFiledsEntity mdmModuleDbFiledsEntity = new MdmModuleDbFiledsEntity(); + mdmModuleDbFiledsEntity.setMdmId(mdmModuleEntity.getId()); + mdmModuleDbFiledsEntity.setSts("Y"); + List mdmModuleDbFiledsEntityList = mdmServiceCache.queryMdmModuleDbFileds(mdmModuleDbFiledsEntity); + if (mdmModuleDbFiledsEntityList == null || mdmModuleDbFiledsEntityList.size() == 0) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + //查询字段下的规则 + MdmModuleDbFiledsRuleEntity mdmModuleDbFiledsRuleEntity = new MdmModuleDbFiledsRuleEntity(); + mdmModuleDbFiledsRuleEntity.setMdmId(mdmModuleEntity.getId()); + mdmModuleDbFiledsRuleEntity.setSts("Y"); + List mdmModuleDbFiledsRuleEntityList = mdmServiceCache.queryMdmModuleDbFiledsRule(mdmModuleDbFiledsRuleEntity); + if (mdmModuleDbFiledsRuleEntityList == null || mdmModuleDbFiledsRuleEntityList.size() == 0) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + + + //查询设置的查询字段 + MdmModuleViewDetailEntity mdmModuleViewDetailEntity = new MdmModuleViewDetailEntity(); + mdmModuleViewDetailEntity.setMdmId(mdmModuleEntity.getId()); + mdmModuleViewDetailEntity.setSts("Y"); + List mdmModuleViewDetailEntities = mdmServiceCache.queryMdmModuleViewDetail(mdmModuleViewDetailEntity); + + + + + return BaseResult.getSuccessMessageEntity("获取字段成功", mdmViewVo); + } // ///** // * @param object From 3ddfc211e3373f98878c3fade34d68c4a8ae0f77 Mon Sep 17 00:00:00 2001 From: lvleigang <957075182@qq.com> Date: Thu, 6 Jun 2024 08:43:01 +0800 Subject: [PATCH 17/80] =?UTF-8?q?=E7=BB=9F=E4=B8=80=E8=BD=AC=E5=8F=91?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=EF=BC=8C=E5=A6=82=E6=9E=9Capi=E5=9C=B0?= =?UTF-8?q?=E5=9D=80=E5=86=85=E5=8C=85=E5=90=AB=20http=20=E6=88=96?= =?UTF-8?q?=E8=80=85=20https=20=E7=9B=B4=E6=8E=A5=E4=BD=BF=E7=94=A8api?= =?UTF-8?q?=E5=AE=8C=E6=95=B4=E5=9C=B0=E5=9D=80=EF=BC=8C=E5=90=A6=E5=88=99?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=20=E5=BA=94=E7=94=A8=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E5=9C=B0=E5=9D=80=20+api=E5=9C=B0=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../application/service/impl/SysApplicationServiceImpl.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 225781f0..bd3c7594 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 @@ -1771,7 +1771,9 @@ public class SysApplicationServiceImpl extends BaseService Date: Thu, 6 Jun 2024 14:13:44 +0800 Subject: [PATCH 18/80] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=B8=80=E4=B8=AAu8c?= =?UTF-8?q?=E5=A0=86=E6=A0=88=E4=BF=A1=E6=81=AF=E6=89=93=E5=8D=B0=E5=8F=82?= =?UTF-8?q?=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../frame/u8c/ax/service/impl/AxServiceImpl.java | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/service/src/main/java/com/hzya/frame/u8c/ax/service/impl/AxServiceImpl.java b/service/src/main/java/com/hzya/frame/u8c/ax/service/impl/AxServiceImpl.java index f126e010..e9ef121d 100644 --- a/service/src/main/java/com/hzya/frame/u8c/ax/service/impl/AxServiceImpl.java +++ b/service/src/main/java/com/hzya/frame/u8c/ax/service/impl/AxServiceImpl.java @@ -1,16 +1,10 @@ package com.hzya.frame.u8c.ax.service.impl; -import cn.hutool.http.HttpRequest; -import cn.hutool.json.JSONUtil; 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.u8c.ax.dao.IAxDao; -import com.hzya.frame.u8c.ax.entity.ArchivesEntity; -import com.hzya.frame.u8c.ax.entity.Ass; -import com.hzya.frame.u8c.ax.entity.Voucher; -import com.hzya.frame.u8c.ax.entity.VoucherDetails; -import com.hzya.frame.u8c.ax.entity.VoucherRoot; +import com.hzya.frame.u8c.ax.entity.*; import com.hzya.frame.u8c.ax.service.IAxService; import com.hzya.frame.web.entity.BaseResult; import com.hzya.frame.web.entity.JsonResultEntity; @@ -22,14 +16,11 @@ import org.apache.http.entity.ByteArrayEntity; import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.HttpClientBuilder; import org.apache.http.util.EntityUtils; -import org.checkerframework.checker.units.qual.A; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; -import org.springframework.beans.factory.annotation.Autowired; -import com.hzya.frame.basedao.service.impl.BaseService; import java.io.IOException; -import java.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -218,6 +209,7 @@ public class AxServiceImpl extends BaseService implement post.setHeader("publicKey", publicKey); post.setHeader("secretKey", secretKey); post.setHeader("appId", appId); + post.setHeader("needStackTrace", jsonObject.getString("needStackTrace")); switch (jsonObject.getString("voucherType")){ case "add"://新增 post.setHeader("apiCode", pzApiCodexz); From ffd75fa8938614545843894d11d285ef60293247 Mon Sep 17 00:00:00 2001 From: lvleigang <957075182@qq.com> Date: Fri, 7 Jun 2024 11:19:57 +0800 Subject: [PATCH 19/80] =?UTF-8?q?=E4=B8=BB=E6=95=B0=E6=8D=AE=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/hzya/frame/mdm/entity/MdmDataDto.java | 69 + .../frame/mdm/entity/MdmDataFiledDto.java | 29 + .../frame/mdm/entity/MdmDetailViewVo.java | 41 + .../com/hzya/frame/mdm/entity/MdmDto.java | 153 ++ .../com/hzya/frame/mdm/entity/MdmQuery.java | 69 + .../mdm/mdmModule/dao/IMdmModuleDao.java | 17 + .../mdmModule/dao/impl/MdmModuleDaoImpl.java | 65 +- .../mdm/mdmModule/entity/MdmModuleEntity.xml | 253 ++ .../mdm/mdmModuleDb/dao/IMdmModuleDbDao.java | 10 +- .../dao/impl/MdmModuleDbDaoImpl.java | 26 +- .../mdmModuleDb/entity/MdmModuleDbEntity.xml | 60 + .../entity/MdmModuleDbFiledsEntity.java | 24 + .../hzya/frame/mdm/service/IMdmService.java | 198 +- .../frame/mdm/service/IMdmServiceCache.java | 29 +- .../mdm/service/impl/MdmServiceCache.java | 38 +- .../mdm/service/impl/MdmServiceImpl.java | 2100 +++++++++-------- 16 files changed, 2055 insertions(+), 1126 deletions(-) create mode 100644 service/src/main/java/com/hzya/frame/mdm/entity/MdmDataDto.java create mode 100644 service/src/main/java/com/hzya/frame/mdm/entity/MdmDataFiledDto.java create mode 100644 service/src/main/java/com/hzya/frame/mdm/entity/MdmDetailViewVo.java create mode 100644 service/src/main/java/com/hzya/frame/mdm/entity/MdmQuery.java diff --git a/service/src/main/java/com/hzya/frame/mdm/entity/MdmDataDto.java b/service/src/main/java/com/hzya/frame/mdm/entity/MdmDataDto.java new file mode 100644 index 00000000..0370431c --- /dev/null +++ b/service/src/main/java/com/hzya/frame/mdm/entity/MdmDataDto.java @@ -0,0 +1,69 @@ +package com.hzya.frame.mdm.entity; + + +import com.hzya.frame.mdm.mdmModuleDb.entity.MdmModuleDbEntity; + +import java.util.List; + +public class MdmDataDto { + + private String id; + private String tableName; + private String documentRule; + private Integer documentRuleNum; + /** + * 类型 1、主表 2、明细 + */ + private String dbType; + + private List mdmDataFiledDtos; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getTableName() { + return tableName; + } + + public void setTableName(String tableName) { + this.tableName = tableName; + } + + public List getMdmDataFiledDtos() { + return mdmDataFiledDtos; + } + + public void setMdmDataFiledDtos(List mdmDataFiledDtos) { + this.mdmDataFiledDtos = mdmDataFiledDtos; + } + + public String getDocumentRule() { + return documentRule; + } + + public void setDocumentRule(String documentRule) { + this.documentRule = documentRule; + } + + public Integer getDocumentRuleNum() { + return documentRuleNum; + } + + public void setDocumentRuleNum(Integer documentRuleNum) { + this.documentRuleNum = documentRuleNum; + } + + public String getDbType() { + return dbType; + } + + public void setDbType(String dbType) { + this.dbType = dbType; + } +} + diff --git a/service/src/main/java/com/hzya/frame/mdm/entity/MdmDataFiledDto.java b/service/src/main/java/com/hzya/frame/mdm/entity/MdmDataFiledDto.java new file mode 100644 index 00000000..d9e40e8d --- /dev/null +++ b/service/src/main/java/com/hzya/frame/mdm/entity/MdmDataFiledDto.java @@ -0,0 +1,29 @@ +package com.hzya.frame.mdm.entity; + + +import com.hzya.frame.mdm.mdmModuleDb.entity.MdmModuleDbEntity; + +import java.util.List; + +public class MdmDataFiledDto { + + private String filedsName; + private String filedsValue; + + public String getFiledsName() { + return filedsName; + } + + public void setFiledsName(String filedsName) { + this.filedsName = filedsName; + } + + public String getFiledsValue() { + return filedsValue; + } + + public void setFiledsValue(String filedsValue) { + this.filedsValue = filedsValue; + } +} + diff --git a/service/src/main/java/com/hzya/frame/mdm/entity/MdmDetailViewVo.java b/service/src/main/java/com/hzya/frame/mdm/entity/MdmDetailViewVo.java new file mode 100644 index 00000000..586e4d7d --- /dev/null +++ b/service/src/main/java/com/hzya/frame/mdm/entity/MdmDetailViewVo.java @@ -0,0 +1,41 @@ +package com.hzya.frame.mdm.entity; + +import com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity; +import com.hzya.frame.mdm.mdmModuleDb.entity.MdmModuleDbEntity; +import com.hzya.frame.mdm.mdmModuleView.entity.MdmModuleViewEntity; + +import java.util.List; + +public class MdmDetailViewVo { + //模版信息 + private MdmModuleEntity mdmModuleEntity; + //主数据主表 + private MdmModuleDbEntity mainMdmModuleDb; + //主数据子表 + private List sublistMdmModuleDb; + + public MdmModuleEntity getMdmModuleEntity() { + return mdmModuleEntity; + } + + public void setMdmModuleEntity(MdmModuleEntity mdmModuleEntity) { + this.mdmModuleEntity = mdmModuleEntity; + } + + public MdmModuleDbEntity getMainMdmModuleDb() { + return mainMdmModuleDb; + } + + public void setMainMdmModuleDb(MdmModuleDbEntity mainMdmModuleDb) { + this.mainMdmModuleDb = mainMdmModuleDb; + } + + public List getSublistMdmModuleDb() { + return sublistMdmModuleDb; + } + + public void setSublistMdmModuleDb(List sublistMdmModuleDb) { + this.sublistMdmModuleDb = sublistMdmModuleDb; + } +} + diff --git a/service/src/main/java/com/hzya/frame/mdm/entity/MdmDto.java b/service/src/main/java/com/hzya/frame/mdm/entity/MdmDto.java index b5e8332d..ae393466 100644 --- a/service/src/main/java/com/hzya/frame/mdm/entity/MdmDto.java +++ b/service/src/main/java/com/hzya/frame/mdm/entity/MdmDto.java @@ -17,6 +17,39 @@ public class MdmDto { //主数据子表 private List sublistMdmModuleDb; + + //id + private String id; + //3、新增4、修改 5、查看 + private String showType; + //分页 + private Integer pageNum; + private Integer pageSize; + /** + * 显示字段 + */ + private String viewFiled; + /** + * 上级id字段 + */ + private String upIdFiled; + //主数据名称 + private String mdmName; + //主数据类型 + private String mdmType; + //描述 + private String remark; + //描述 + private String[] ids; + + private String tableName; + private String value; + + private String label; + private String lableValue; + + private String upId; + public Long getMdmCode() { return mdmCode; } @@ -48,5 +81,125 @@ public class MdmDto { public void setSublistMdmModuleDb(List sublistMdmModuleDb) { this.sublistMdmModuleDb = sublistMdmModuleDb; } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getShowType() { + return showType; + } + + public void setShowType(String showType) { + this.showType = showType; + } + + public Integer getPageNum() { + return pageNum; + } + + public void setPageNum(Integer pageNum) { + this.pageNum = pageNum; + } + + public Integer getPageSize() { + return pageSize; + } + + public void setPageSize(Integer pageSize) { + this.pageSize = pageSize; + } + + public String getViewFiled() { + return viewFiled; + } + + public void setViewFiled(String viewFiled) { + this.viewFiled = viewFiled; + } + + public String getUpIdFiled() { + return upIdFiled; + } + + public void setUpIdFiled(String upIdFiled) { + this.upIdFiled = upIdFiled; + } + + public String getMdmName() { + return mdmName; + } + + public void setMdmName(String mdmName) { + this.mdmName = mdmName; + } + + public String getMdmType() { + return mdmType; + } + + public void setMdmType(String mdmType) { + this.mdmType = mdmType; + } + + public String getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark; + } + + public String[] getIds() { + return ids; + } + + public void setIds(String[] ids) { + this.ids = ids; + } + + public String getTableName() { + return tableName; + } + + public void setTableName(String tableName) { + this.tableName = tableName; + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + public String getLabel() { + return label; + } + + public void setLabel(String label) { + this.label = label; + } + + public String getLableValue() { + return lableValue; + } + + public void setLableValue(String lableValue) { + this.lableValue = lableValue; + } + + public String getUpId() { + return upId; + } + + public void setUpId(String upId) { + this.upId = upId; + } } diff --git a/service/src/main/java/com/hzya/frame/mdm/entity/MdmQuery.java b/service/src/main/java/com/hzya/frame/mdm/entity/MdmQuery.java new file mode 100644 index 00000000..bda7c895 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/mdm/entity/MdmQuery.java @@ -0,0 +1,69 @@ +package com.hzya.frame.mdm.entity; + + +import com.hzya.frame.sys.entity.TemplateKeyValue; + +import java.util.List; + +public class MdmQuery { + + //分页 + private Integer pageNum; + private Integer pageSize; + //表名 + private String tableName; + //查询条件 + private List queryCondition; + //返回字段 + private List returnField; + //明细表查询条件 + private List detailQueryCondition; + + public Integer getPageNum() { + return pageNum; + } + + public void setPageNum(Integer pageNum) { + this.pageNum = pageNum; + } + + public Integer getPageSize() { + return pageSize; + } + + public void setPageSize(Integer pageSize) { + this.pageSize = pageSize; + } + + public String getTableName() { + return tableName; + } + + public void setTableName(String tableName) { + this.tableName = tableName; + } + + public List getQueryCondition() { + return queryCondition; + } + + public void setQueryCondition(List queryCondition) { + this.queryCondition = queryCondition; + } + + public List getReturnField() { + return returnField; + } + + public void setReturnField(List returnField) { + this.returnField = returnField; + } + + public List getDetailQueryCondition() { + return detailQueryCondition; + } + + public void setDetailQueryCondition(List detailQueryCondition) { + this.detailQueryCondition = detailQueryCondition; + } +} diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModule/dao/IMdmModuleDao.java b/service/src/main/java/com/hzya/frame/mdm/mdmModule/dao/IMdmModuleDao.java index e4a499ea..8854d3e8 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModule/dao/IMdmModuleDao.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModule/dao/IMdmModuleDao.java @@ -1,8 +1,13 @@ package com.hzya.frame.mdm.mdmModule.dao; +import com.hzya.frame.mdm.entity.MdmDataDto; +import com.hzya.frame.mdm.entity.MdmDto; +import com.hzya.frame.mdm.entity.MdmQuery; import com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity; import com.hzya.frame.basedao.dao.IBaseDao; +import com.hzya.frame.sys.entity.FormmainDeleteDto; +import java.util.HashMap; import java.util.List; import java.util.Map; @@ -22,5 +27,17 @@ public interface IMdmModuleDao extends IBaseDao { Integer createTable(Map maps); Integer alterTable(Map maps); Integer alterTableName(Map maps); + List> queryMdmShowData(MdmQuery entity); + List> queryTemplateDataMore(MdmDto entity); + HashMap queryTemplateDataOne(MdmDto entity); + Integer checkData(Map map); + Integer updateForm(MdmDataDto mdmDataDto); + Integer saveForm(MdmDataDto mdmDataDto); + Integer deleteTemplateById(FormmainDeleteDto formmainDeleteDto); + Integer deleteChilder(FormmainDeleteDto formmainDeleteDto); + List> querySelectData(MdmDto entity); + + List> queryDataAll(MdmDto entity); + } diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModule/dao/impl/MdmModuleDaoImpl.java b/service/src/main/java/com/hzya/frame/mdm/mdmModule/dao/impl/MdmModuleDaoImpl.java index f6742f3d..40cd1bab 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModule/dao/impl/MdmModuleDaoImpl.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModule/dao/impl/MdmModuleDaoImpl.java @@ -1,10 +1,15 @@ package com.hzya.frame.mdm.mdmModule.dao.impl; +import com.hzya.frame.mdm.entity.MdmDataDto; +import com.hzya.frame.mdm.entity.MdmDto; +import com.hzya.frame.mdm.entity.MdmQuery; import com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity; import com.hzya.frame.mdm.mdmModule.dao.IMdmModuleDao; +import com.hzya.frame.sys.entity.FormmainDeleteDto; import org.springframework.stereotype.Repository; import com.hzya.frame.basedao.dao.MybatisGenericDao; +import java.util.HashMap; import java.util.List; import java.util.Map; @@ -25,7 +30,7 @@ public class MdmModuleDaoImpl extends MybatisGenericDao @Override public MdmModuleEntity getByMdmCode(Long mdmCode) { - MdmModuleEntity mdmModuleEntity = (MdmModuleEntity) super.query(getSqlIdPrifx() + "getByMdmCode",mdmCode); + MdmModuleEntity mdmModuleEntity = (MdmModuleEntity) super.selectOne(getSqlIdPrifx() + "getByMdmCode",mdmCode); return mdmModuleEntity; } @@ -35,8 +40,66 @@ public class MdmModuleDaoImpl extends MybatisGenericDao return o; } + @Override + public List> queryDataAll(MdmDto entity) { + List> o = (List>) super.selectList(getSqlIdPrifx() + "queryDataAll", entity); + return o; + } + @Override + public Integer checkData(Map maps) { + Integer o = (Integer) super.selectOne(getSqlIdPrifx() + "checkData", maps); + return o; + } + @Override + public Integer updateForm(MdmDataDto mdmDataDto) { + Integer o = super.update(getSqlIdPrifx() + "updateForm", mdmDataDto); + return o; + } + @Override + public List> querySelectData(MdmDto entity) { + List> o = (List>) super.selectList(getSqlIdPrifx() + "querySelectData", entity); + return o; + + } + @Override + public Integer deleteChilder(FormmainDeleteDto entity) { + Integer o = super.delete(getSqlIdPrifx() + "deleteChilder", entity); + return o; + + } + @Override + public Integer deleteTemplateById(FormmainDeleteDto entity) { + Integer o = super.delete(getSqlIdPrifx() + "deleteTemplateById", entity); + return o; + + } + @Override + public Integer saveForm(MdmDataDto mdmDataDto) { + Integer o = super.update(getSqlIdPrifx() + "saveForm", mdmDataDto); + return o; + + } + @Override + public List> queryTemplateDataMore(MdmDto entity) { + List> o = (List>) super.selectList(getSqlIdPrifx() + "queryTemplateDataMore", entity); + return o; + + } + + @Override + public HashMap queryTemplateDataOne(MdmDto entity) { + HashMap o = (HashMap) super.selectOne(getSqlIdPrifx() + "queryTemplateDataOne", entity); + return o; + + } + + @Override + public List> queryMdmShowData(MdmQuery entity) { + List> o = (List>) super.selectList(getSqlIdPrifx() + "queryMdmShowData", entity); + return o; + } @Override public Integer createTable(Map maps) { Integer o = (Integer) super.selectOne(getSqlIdPrifx() + "createTable", maps); 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 4acbf893..4e94d665 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 @@ -404,5 +404,258 @@ update mdm_module set sts= 'N' ,modify_time = #{modify_time},modify_user_id = # + + + + + + + + + + + + + update ${tableName} set + + + + + ${item.filedsName} = #{item.filedsValue}, + + + modify_user_id = #{item.filedsValue}, + + + + modify_time = now(), + + where id = #{id} + + + + insert into ${tableName}( + + + + + ${item.filedsName}, + + + create_user_id, + modify_user_id, + + + + create_time, + modify_time, + sts, + + document_rule, + document_rule_num, + + + )values + ( + + + + + #{item.filedsValue}, + + + #{item.filedsValue}, + #{item.filedsValue}, + + + + + now(), + now(), + 'Y', + + ( concat(#{documentRule}, + (SELECT + IF + ( + LENGTH( (SELECT + IFNULL(MAX(b.document_rule_num),0)+1 + FROM + ${tableName} b + WHERE + DATE_FORMAT( b.create_time, '%Y-%m' ) = DATE_FORMAT( now(), '%Y-%m' )) ) <= ${documentRuleNum}, + LPAD( (SELECT + IFNULL(MAX(c.document_rule_num),0)+1 + FROM + ${tableName} c + WHERE + DATE_FORMAT( c.create_time, '%Y-%m' ) = DATE_FORMAT( now(), '%Y-%m' )), ${documentRuleNum}, '0' ), + (SELECT + IFNULL(MAX(d.document_rule_num),0)+1 + FROM + ${tableName} d + WHERE + DATE_FORMAT( d.create_time, '%Y-%m' ) = DATE_FORMAT( now(), '%Y-%m' )) + ) + ) + )), + (SELECT + IF + ( + LENGTH( (SELECT + IFNULL(MAX(e.document_rule_num),0)+1 + FROM + ${tableName} e + WHERE + DATE_FORMAT( e.create_time, '%Y-%m' ) = DATE_FORMAT( now(), '%Y-%m' )) ) <= ${documentRuleNum}, + LPAD( (SELECT + IFNULL(MAX(f.document_rule_num),0)+1 + FROM + ${tableName} f + WHERE + DATE_FORMAT( f.create_time, '%Y-%m' ) = DATE_FORMAT( now(), '%Y-%m' )), ${documentRuleNum}, '0' ), + (SELECT + IFNULL(MAX(g.document_rule_num),0)+1 + FROM + ${tableName} g + WHERE + DATE_FORMAT( g.create_time, '%Y-%m' ) = DATE_FORMAT( now(), '%Y-%m' )) + ) + ) + + + ) + + + update ${tableName} set + sts='N',modify_time = now(),modify_user_id = #{loginId} + + and id = #{id} + and formmain_id = #{formmain_id} + and sts='Y' + + + + + update ${tableName} set + sts='N',modify_time = now(),modify_user_id = #{loginId} + + + and ${upIdFiled} like concat(#{upIdFiledValue},'%') + + and sts='Y' + + + + + + diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDb/dao/IMdmModuleDbDao.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDb/dao/IMdmModuleDbDao.java index 92b955dd..89849461 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDb/dao/IMdmModuleDbDao.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDb/dao/IMdmModuleDbDao.java @@ -1,7 +1,11 @@ package com.hzya.frame.mdm.mdmModuleDb.dao; import com.hzya.frame.mdm.mdmModuleDb.entity.MdmModuleDbEntity; -import com.hzya.frame.basedao.dao.IBaseDao; +import com.hzya.frame.basedao.dao.IBaseDao; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; /** * 模版数据库表(mdm_module_db: table)表数据库访问层 @@ -10,6 +14,8 @@ import com.hzya.frame.basedao.dao.IBaseDao; * @since 2024-06-03 08:46:48 */ public interface IMdmModuleDbDao extends IBaseDao { - + HashMap getServiceDataById(Map queryData); + List> getServiceByFormmainId(Map queryData); + List> getServiceByDistributeId(Map queryData); } diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDb/dao/impl/MdmModuleDbDaoImpl.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDb/dao/impl/MdmModuleDbDaoImpl.java index 77d8c8bb..8bf06ee1 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDb/dao/impl/MdmModuleDbDaoImpl.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDb/dao/impl/MdmModuleDbDaoImpl.java @@ -4,6 +4,11 @@ import com.hzya.frame.mdm.mdmModuleDb.entity.MdmModuleDbEntity; import com.hzya.frame.mdm.mdmModuleDb.dao.IMdmModuleDbDao; import org.springframework.stereotype.Repository; import com.hzya.frame.basedao.dao.MybatisGenericDao; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + /** * 模版数据库表(MdmModuleDb)表数据库访问层 * @@ -12,6 +17,25 @@ import com.hzya.frame.basedao.dao.MybatisGenericDao; */ @Repository(value = "MdmModuleDbDaoImpl") public class MdmModuleDbDaoImpl extends MybatisGenericDao implements IMdmModuleDbDao{ - + @Override + public HashMap getServiceDataById(Map maps) { + HashMap o = (HashMap) super.selectOne(getSqlIdPrifx() + "getServiceDataById", maps); + return o; + + } + + @Override + public List> getServiceByFormmainId(Map maps) { + List> o = (List>) super.selectList(getSqlIdPrifx() + "getServiceByFormmainId", maps); + return o; + + } + @Override + public List> getServiceByDistributeId(Map maps) { + List> o = (List>) super.selectList(getSqlIdPrifx() + "getServiceByDistributeId", maps); + return o; + + } + } diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDb/entity/MdmModuleDbEntity.xml b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDb/entity/MdmModuleDbEntity.xml index 383d4ca7..2340cbcd 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDb/entity/MdmModuleDbEntity.xml +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDb/entity/MdmModuleDbEntity.xml @@ -238,6 +238,66 @@ update mdm_module_db set sts= 'N' ,modify_time = #{modify_time},modify_user_id delete from mdm_module_db where id = #{id} + + + + + + + diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDbFileds/entity/MdmModuleDbFiledsEntity.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDbFileds/entity/MdmModuleDbFiledsEntity.java index 194a0ace..abb89344 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDbFileds/entity/MdmModuleDbFiledsEntity.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDbFileds/entity/MdmModuleDbFiledsEntity.java @@ -41,6 +41,14 @@ public class MdmModuleDbFiledsEntity extends BaseEntity { private String companyId; /** 数据类型 1、新增 2、修改 */ private String dataType; + /** + * roletype + */ + private String roletype; + /** + * roletype + */ + private String roleValue; private List mdmModuleDbFiledsRules; public String getMdmId() { @@ -162,5 +170,21 @@ public class MdmModuleDbFiledsEntity extends BaseEntity { public void setDataType(String dataType) { this.dataType = dataType; } + + public String getRoletype() { + return roletype; + } + + public void setRoletype(String roletype) { + this.roletype = roletype; + } + + public String getRoleValue() { + return roleValue; + } + + public void setRoleValue(String roleValue) { + this.roleValue = roleValue; + } } diff --git a/service/src/main/java/com/hzya/frame/mdm/service/IMdmService.java b/service/src/main/java/com/hzya/frame/mdm/service/IMdmService.java index b815b318..d588e694 100644 --- a/service/src/main/java/com/hzya/frame/mdm/service/IMdmService.java +++ b/service/src/main/java/com/hzya/frame/mdm/service/IMdmService.java @@ -50,7 +50,7 @@ public interface IMdmService { * @param jsonObject * @return com.hzya.frame.web.entity.JsonResultEntity * @Author lvleigang - * @Description 主数据基本信息保存 + * @Description 主数据基本信息修改 * @Date 9:40 上午 2023/10/18 **/ JsonResultEntity doSaveMdmModule(JSONObject jsonObject); @@ -63,31 +63,31 @@ public interface IMdmService { **/ JsonResultEntity queryMdmModuleDb(JSONObject jsonObject); // - ///** - // * @param jsonObject - // * @return com.hzya.frame.web.entity.JsonResultEntity - // * @Author lvleigang - // * @Description 主数据设置查询数据源的服务 - // * @Date 9:40 上午 2023/10/18 - // **/ - //JsonResultEntity queryMdmModuleServer(JSONObject jsonObject); - ///** - // * @param jsonObject - // * @return com.hzya.frame.web.entity.JsonResultEntity - // * @Author lvleigang - // * @Description 主数据设置查询数据源字段的服务 - // * @Date 9:40 上午 2023/10/18 - // **/ - //JsonResultEntity queryMdmModuleServerFiled(JSONObject jsonObject); - // - ///** - // * @param jsonObject - // * @return com.hzya.frame.web.entity.JsonResultEntity - // * @Author lvleigang - // * @Description 主数据设置查询主表字段 - // * @Date 9:40 上午 2023/10/18 - // **/ - //JsonResultEntity queryMdmModuleServerMainFiled(JSONObject jsonObject); + /** + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 主数据设置查询数据源的服务 + * @Date 9:40 上午 2023/10/18 + **/ + JsonResultEntity queryMdmModuleServer(JSONObject jsonObject); + /** + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 主数据设置查询数据源字段的服务 + * @Date 9:40 上午 2023/10/18 + **/ + JsonResultEntity queryMdmModuleServerFiled(JSONObject jsonObject); + + /** + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 主数据设置查询主表字段 + * @Date 9:40 上午 2023/10/18 + **/ + JsonResultEntity queryMdmModuleServerMainFiled(JSONObject jsonObject); /** * @param jsonObject * @return com.hzya.frame.web.entity.JsonResultEntity @@ -233,30 +233,30 @@ public interface IMdmService { **/ JsonResultEntity queryMdmShow(JSONObject jsonObject); // - ///** - // * @param jsonObject - // * @return com.hzya.frame.web.entity.JsonResultEntity - // * @Author lvleigang - // * @Description 主数据查询所有字段 - // * @Date 9:40 上午 2023/10/18 - // **/ - //JsonResultEntity queryMdmShowAll(JSONObject jsonObject); - ///** - // * @Author lvleigang - // * @Description 查询模版数据(list 或者 分页) - // * @Date 1:33 下午 2023/7/12 - // * @param jsonObject - // * @return com.hzya.frame.web.entity.JsonResultEntity - // **/ - //JsonResultEntity queryTemplateData(JSONObject jsonObject); - ///** - // * @param jsonObject - // * @return com.hzya.frame.web.entity.JsonResultEntity - // * @Author lvleigang - // * @Description 主数据列表显示 业务数据 - // * @Date 9:40 上午 2023/10/18 - // **/ - //JsonResultEntity queryMdmShowData(JSONObject jsonObject); + /** + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 主数据查询所有字段 + * @Date 9:40 上午 2023/10/18 + **/ + JsonResultEntity queryMdmShowAll(JSONObject jsonObject); + /** + * @Author lvleigang + * @Description 查询模版数据(list 或者 分页) + * @Date 1:33 下午 2023/7/12 + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + **/ + JsonResultEntity queryTemplateData(JSONObject jsonObject); + /** + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 主数据列表显示 业务数据 + * @Date 9:40 上午 2023/10/18 + **/ + JsonResultEntity queryMdmShowData(JSONObject jsonObject); // ///** // * @param jsonObject @@ -266,14 +266,14 @@ public interface IMdmService { // * @Date 9:40 上午 2023/10/18 // **/ //JsonResultEntity queryMdmShowDistribute(JSONObject jsonObject); - ///** - // * @param jsonObject - // * @return com.hzya.frame.web.entity.JsonResultEntity - // * @Author lvleigang - // * @Description 主数据业务数据树结构 - // * @Date 9:40 上午 2023/10/18 - // **/ - //JsonResultEntity queryMdmShowTreeData(JSONObject jsonObject); + /** + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 主数据业务数据树结构 + * @Date 9:40 上午 2023/10/18 + **/ + JsonResultEntity queryMdmShowTreeData(JSONObject jsonObject); ///** // * @param jsonObject // * @return com.hzya.frame.web.entity.JsonResultEntity @@ -283,49 +283,49 @@ public interface IMdmService { // **/ //JsonResultEntity queryMdmOptionData(JSONObject jsonObject); // - ///** - // * @param jsonObject - // * @return com.hzya.frame.web.entity.JsonResultEntity - // * @Author lvleigang - // * @Description 主数据详情 区分类型 新增、修改、查看 - // * @Date 9:40 上午 2023/10/18 - // **/ - //JsonResultEntity queryMdmShowDetails(JSONObject jsonObject); + /** + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 主数据详情 区分类型 新增、修改、查看 + * @Date 9:40 上午 2023/10/18 + **/ + JsonResultEntity queryMdmShowDetails(JSONObject jsonObject); // - ///** - // * @param jsonObject - // * @return com.hzya.frame.web.entity.JsonResultEntity - // * @Author lvleigang - // * @Description 主数据详情数据 区分类型 新增、修改、查看 - // * @Date 9:40 上午 2023/10/18 - // **/ - //JsonResultEntity queryMdmShowDetailsData(JSONObject jsonObject); + /** + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 主数据详情数据 区分类型 新增、修改、查看 + * @Date 9:40 上午 2023/10/18 + **/ + JsonResultEntity queryMdmShowDetailsData(JSONObject jsonObject); // - ///** - // * @param jsonObject - // * @return com.hzya.frame.web.entity.JsonResultEntity - // * @Author lvleigang - // * @Description 主数据详情数据修改 - // * @Date 9:40 上午 2023/10/18 - // **/ - //JsonResultEntity updateMdmShowDetailsData(JSONObject jsonObject); - ///** - // * @param jsonObject - // * @return com.hzya.frame.web.entity.JsonResultEntity - // * @Author lvleigang - // * @Description 主数据详情数据新增 - // * @Date 9:40 上午 2023/10/18 - // **/ - //JsonResultEntity saveMdmShowDetailsData(JSONObject jsonObject); - // - ///** - // * @param jsonObject - // * @return com.hzya.frame.web.entity.JsonResultEntity - // * @Author lvleigang - // * @Description 主数据删除业务数据 - // * @Date 9:40 上午 2023/10/18 - // **/ - //JsonResultEntity deleteMdmShowDetailsData(JSONObject jsonObject); + /** + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 主数据详情数据修改 + * @Date 9:40 上午 2023/10/18 + **/ + JsonResultEntity updateMdmShowDetailsData(JSONObject jsonObject); + /** + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 主数据详情数据新增 + * @Date 9:40 上午 2023/10/18 + **/ + JsonResultEntity saveMdmShowDetailsData(JSONObject jsonObject); + + /** + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 主数据删除业务数据 + * @Date 9:40 上午 2023/10/18 + **/ + JsonResultEntity deleteMdmShowDetailsData(JSONObject jsonObject); // ///** // * @param jsonObject diff --git a/service/src/main/java/com/hzya/frame/mdm/service/IMdmServiceCache.java b/service/src/main/java/com/hzya/frame/mdm/service/IMdmServiceCache.java index 36750991..4174d5fa 100644 --- a/service/src/main/java/com/hzya/frame/mdm/service/IMdmServiceCache.java +++ b/service/src/main/java/com/hzya/frame/mdm/service/IMdmServiceCache.java @@ -30,14 +30,33 @@ public interface IMdmServiceCache { * @return com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity **/ MdmModuleEntity getMdmModuleEntity(Long mdmCode); + /** + * @Author lvleigang + * @Description 获取模版单据编码规则 + * @Date 10:13 上午 2024/6/3 + * @param mdmTableCodeRuleEntity + * @return com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity + **/ + List queryMdmTableCodeRuleEntity(MdmTableCodeRuleEntity mdmTableCodeRuleEntity); + /** + * @Author lvleigang + * @Description 获取模版表数据 + * @Date 10:13 上午 2024/6/3 + * @param queryDb + * @return com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity + **/ + List queryMdmModuleDb(MdmModuleDbEntity queryDb); + /** + * @Author lvleigang + * @Description 获取模版字段表数据 + * @Date 10:13 上午 2024/6/3 + * @param queryDbFiled + * @return com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity + **/ + List queryMdmModuleDbFileds(MdmModuleDbFiledsEntity queryDbFiled); void updateMdmModuleEntity(MdmModuleEntity entity); - List queryMdmTableCodeRuleEntity(MdmTableCodeRuleEntity mdmTableCodeRuleEntity); - - List queryMdmModuleDb(MdmModuleDbEntity queryDb); - - List queryMdmModuleDbFileds(MdmModuleDbFiledsEntity queryDbFiled); List queryMdmModuleDbFiledsRule(MdmModuleDbFiledsRuleEntity queryDbFiledRule); diff --git a/service/src/main/java/com/hzya/frame/mdm/service/impl/MdmServiceCache.java b/service/src/main/java/com/hzya/frame/mdm/service/impl/MdmServiceCache.java index bf531ea9..b847f145 100644 --- a/service/src/main/java/com/hzya/frame/mdm/service/impl/MdmServiceCache.java +++ b/service/src/main/java/com/hzya/frame/mdm/service/impl/MdmServiceCache.java @@ -87,7 +87,7 @@ public class MdmServiceCache implements IMdmServiceCache { } @Override - @Cacheable(cacheNames="mdmTableCodeRule",key = "#mdmId") + @Cacheable(cacheNames="mdmTableCodeRule",key = "#entity.mdmId") public List queryMdmTableCodeRuleEntity(MdmTableCodeRuleEntity entity) { List mdmTableCodeRuleEntityList = mdmTableCodeRuleDao.queryBase(entity); return mdmTableCodeRuleEntityList; @@ -95,21 +95,21 @@ public class MdmServiceCache implements IMdmServiceCache { @Override - @Cacheable(cacheNames="mdmModuleDb",key = "#mdmId") + @Cacheable(cacheNames="mdmModuleDb",key = "#entity.mdmId") public List queryMdmModuleDb(MdmModuleDbEntity entity) { List mdmModuleDbEntities = mdmModuleDbDao.queryBase(entity); return mdmModuleDbEntities; } @Override - @Cacheable(cacheNames="mdmModuleDbFileds",key = "#mdmId") + @Cacheable(cacheNames="mdmModuleDbFileds",key = "#entity.mdmId") public List queryMdmModuleDbFileds(MdmModuleDbFiledsEntity entity) { List mdmModuleDbFiledsEntities = mdmModuleDbFiledsDao.queryBase(entity); return mdmModuleDbFiledsEntities; } @Override - @Cacheable(cacheNames="mdmModuleDbFiledsRule",key = "#mdmId") + @Cacheable(cacheNames="mdmModuleDbFiledsRule",key = "#entity.mdmId") public List queryMdmModuleDbFiledsRule(MdmModuleDbFiledsRuleEntity entity) { List mdmModuleDbFiledsRuleEntities = mdmModuleDbFiledsRuleDao.queryBase(entity); return mdmModuleDbFiledsRuleEntities; @@ -176,23 +176,23 @@ public class MdmServiceCache implements IMdmServiceCache { } @Override - @Cacheable(cacheNames="mdmModuleViewDetail",key = "#mdmId") - public List queryMdmModuleViewDetail(MdmModuleViewDetailEntity mdmModuleViewDetailEntity) { - List mdmModuleViewDetailEntities = mdmModuleViewDetailDao.queryBase(mdmModuleViewDetailEntity); + @Cacheable(cacheNames="mdmModuleViewDetail",key = "#entity.mdmId") + public List queryMdmModuleViewDetail(MdmModuleViewDetailEntity entity) { + List mdmModuleViewDetailEntities = mdmModuleViewDetailDao.queryBase(entity); return mdmModuleViewDetailEntities; } @Override - @Cacheable(cacheNames="mdmModuleView",key = "#mdmId") - public List queryMdmModuleView(MdmModuleViewEntity mdmModuleViewEntity) { - List moduleViewEntities = mdmModuleViewDao.queryBase(mdmModuleViewEntity); + @Cacheable(cacheNames="mdmModuleView",key = "#entity.mdmId") + public List queryMdmModuleView(MdmModuleViewEntity entity) { + List moduleViewEntities = mdmModuleViewDao.queryBase(entity); return moduleViewEntities; } @Override - @Cacheable(cacheNames="mdmModuleViewButton",key = "#mdmId") - public List queryMdmModuleViewButton(MdmModuleViewButtonEntity mdmModuleViewButtonEntity) { - List mdmModuleViewButtonEntities = mdmModuleViewButtonDao.queryBase(mdmModuleViewButtonEntity); + @Cacheable(cacheNames="mdmModuleViewButton",key = "#entity.mdmId") + public List queryMdmModuleViewButton(MdmModuleViewButtonEntity entity) { + List mdmModuleViewButtonEntities = mdmModuleViewButtonDao.queryBase(entity); return mdmModuleViewButtonEntities; } @@ -263,9 +263,9 @@ public class MdmServiceCache implements IMdmServiceCache { return mdmModuleDistributeEntities; } @Override - @Cacheable(cacheNames="mdmModuleDistributeDetail",key = "#mdmId") - public List queryMdmModuleDistributeDetail(MdmModuleDistributeDetailEntity mdmModuleDistributeDetailEntity){ - List mdmModuleDistributeDetailEntities = mdmModuleDistributeDetailDao.queryBase(mdmModuleDistributeDetailEntity); + @Cacheable(cacheNames="mdmModuleDistributeDetail",key = "#entity.mdmId") + public List queryMdmModuleDistributeDetail(MdmModuleDistributeDetailEntity entity){ + List mdmModuleDistributeDetailEntities = mdmModuleDistributeDetailDao.queryBase(entity); return mdmModuleDistributeDetailEntities; } @@ -312,9 +312,9 @@ public class MdmServiceCache implements IMdmServiceCache { } @Override - @Cacheable(cacheNames="mdmModuleSource",key = "#mdmId") - public List queryMdmModuleSource(MdmModuleSourceEntity mdmModuleSourceEntity) { - List mdmModuleSourceEntities = mdmModuleSourceDao.queryBase(mdmModuleSourceEntity); + @Cacheable(cacheNames="mdmModuleSource",key = "#entity.mdmId") + public List queryMdmModuleSource(MdmModuleSourceEntity entity) { + List mdmModuleSourceEntities = mdmModuleSourceDao.queryBase(entity); return mdmModuleSourceEntities; } 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 bf517a33..145b9b67 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 @@ -1,16 +1,21 @@ package com.hzya.frame.mdm.service.impl; import cn.dev33.satoken.stp.StpUtil; +import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import com.hzya.frame.mdm.entity.DbFiledsDto; +import com.hzya.frame.mdm.entity.MdmDataDto; +import com.hzya.frame.mdm.entity.MdmDataFiledDto; import com.hzya.frame.mdm.entity.MdmDbFiledVo; import com.hzya.frame.mdm.entity.MdmDbVo; +import com.hzya.frame.mdm.entity.MdmDetailViewVo; import com.hzya.frame.mdm.entity.MdmDistributeDto; import com.hzya.frame.mdm.entity.MdmDto; import com.hzya.frame.mdm.entity.MdmModuleViewDto; import com.hzya.frame.mdm.entity.MdmModuleViewVo; +import com.hzya.frame.mdm.entity.MdmQuery; import com.hzya.frame.mdm.entity.MdmSourceDto; import com.hzya.frame.mdm.entity.MdmViewFiledVo; import com.hzya.frame.mdm.entity.MdmViewVo; @@ -40,6 +45,7 @@ import com.hzya.frame.mdm.mdmTableCodeRule.entity.MdmTableCodeRuleEntity; import com.hzya.frame.mdm.service.IMdmService; import com.hzya.frame.mdm.service.IMdmServiceCache; +import com.hzya.frame.sys.entity.FormmainDeleteDto; import com.hzya.frame.sysnew.buttonConfig.dao.ISysButtonConfigDao; import com.hzya.frame.sysnew.buttonConfig.entity.SysButtonConfigEntity; import com.hzya.frame.sysnew.menuConfig.dao.ISysMenuConfigDao; @@ -49,14 +55,18 @@ import com.hzya.frame.sysnew.popedomOperate.entity.SysPopedomOperateEntity; import com.hzya.frame.sysnew.user.entity.SysUserEntity; import com.hzya.frame.sysnew.userCompany.entity.SysUserCompanyEntity; import com.hzya.frame.sysnew.userRoles.entity.SysUserRolesEntity; +import com.hzya.frame.uuid.UUIDUtils; import com.hzya.frame.web.entity.BaseResult; import com.hzya.frame.web.entity.JsonResultEntity; +import org.checkerframework.checker.units.qual.A; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Service; import javax.annotation.Resource; +import java.text.SimpleDateFormat; import java.util.ArrayList; +import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -199,6 +209,11 @@ public class MdmServiceImpl implements IMdmService { if (entity.getMdmCode() == null || "".equals(entity.getMdmCode())) { return BaseResult.getFailureMessageEntity("系统错误"); } + MdmModuleEntity mdmModuleEntity = mdmServiceCache.getMdmModuleEntity(entity.getMdmCode()); + if(mdmModuleEntity == null ){ + return BaseResult.getFailureMessageEntity("系统错误"); + } + entity.setId(mdmModuleEntity.getId()); //修改 entity.setUpdate(); mdmServiceCache.updateMdmModuleEntity(entity); @@ -596,11 +611,11 @@ public class MdmServiceImpl implements IMdmService { documentRule.setEnName("单据规则"); documentRule.setFiledType("3"); documentRule.setAddType("2"); - documentRule.setUpdateType("2"); - documentRule.setShowType("2"); - documentRule.setQueryType("2"); - documentRule.setListType("2"); - documentRule.setViewType("2"); + documentRule.setUpdateType("1"); + documentRule.setShowType("1"); + documentRule.setQueryType("1"); + documentRule.setListType("1"); + documentRule.setViewType("1"); documentRule.setFiledLength("50"); documentRule.setDataType("1"); mdmModuleDbFiledsEntities.add(documentRule); @@ -709,7 +724,7 @@ public class MdmServiceImpl implements IMdmService { MdmModuleDbFiledsEntity option_Name = new MdmModuleDbFiledsEntity(); option_Name.setMdmId(mdmId); option_Name.setDbId(dbId); - option_Name.setChName("option_Name"); + option_Name.setChName("option_name"); option_Name.setEnName("操作人"); option_Name.setFiledType("3"); option_Name.setAddType("2"); @@ -846,7 +861,7 @@ public class MdmServiceImpl implements IMdmService { delete_status.setMdmId(mdmId); delete_status.setDbId(dbId); delete_status.setChName("delete_status"); - delete_status.setEnName("修删除数据状态 0待下发 1已下发"); + delete_status.setEnName("删除数据状态 0待下发 1已下发"); delete_status.setFiledType("3"); delete_status.setAddType("2"); delete_status.setUpdateType("2"); @@ -1779,7 +1794,7 @@ public class MdmServiceImpl implements IMdmService { if(mdmModuleDbEntities != null && mdmModuleDbEntities.size() > 0 ){ for (int i = 0; i < mdmModuleDbEntities.size(); i++) { if("1".equals(mdmModuleDbEntities.get(i).getDbType())){ - entity.setTableName(mdmModuleDbEntities.get(i).getDbName()+"_send_log"); + entity.setTableName(mdmModuleDbEntities.get(i).getDbName()+"_option_log"); break; } } @@ -1822,7 +1837,7 @@ public class MdmServiceImpl implements IMdmService { if(mdmModuleDbEntities != null && mdmModuleDbEntities.size() > 0 ){ for (int i = 0; i < mdmModuleDbEntities.size(); i++) { if("1".equals(mdmModuleDbEntities.get(i).getDbType())){ - entity.setTableName(mdmModuleDbEntities.get(i).getDbName()+"_send_log"); + entity.setTableName(mdmModuleDbEntities.get(i).getDbName()+"_option_log"); break; } } @@ -1866,7 +1881,7 @@ public class MdmServiceImpl implements IMdmService { if(mdmModuleDbEntities != null && mdmModuleDbEntities.size() > 0 ){ for (int i = 0; i < mdmModuleDbEntities.size(); i++) { if("1".equals(mdmModuleDbEntities.get(i).getDbType())){ - entity.setTableName(mdmModuleDbEntities.get(i).getDbName()+"_send_log"); + entity.setTableName(mdmModuleDbEntities.get(i).getDbName()+"_option_log"); break; } } @@ -1877,95 +1892,105 @@ public class MdmServiceImpl implements IMdmService { mdmModuleOptionLogDao.logicRemove(entity); return BaseResult.getSuccessMessageEntity("删除日志成功"); } - ///** - // * @param object - // * @return com.hzya.frame.web.entity.JsonResultEntity - // * @Author lvleigang - // * @Description 主数据设置查询数据源的服务 - // * @Date 9:40 上午 2023/10/18 - // **/ - //@Override - //public JsonResultEntity queryMdmModuleServer(JSONObject object) { - // MdmModuleDbEntity entity = getData("jsonStr", object, MdmModuleDbEntity.class); - // //判断分页 - // if (entity == null) { - // entity = new MdmModuleDbEntity(); - // } - // //查询数据源表 - // entity.setSts("Y"); - // List mdmModuleDbEntityList = mdmModuleDbDao.queryByLike(entity); - // return BaseResult.getSuccessMessageEntity("查询数据成功", mdmModuleDbEntityList); - //} + /** + * @param object + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 主数据设置查询数据源的服务 + * @Date 9:40 上午 2023/10/18 + **/ + @Override + public JsonResultEntity queryMdmModuleServer(JSONObject object) { + MdmModuleDbEntity entity = getData("jsonStr", object, MdmModuleDbEntity.class); + //判断分页 + if (entity == null) { + entity = new MdmModuleDbEntity(); + } + //查询数据源表 + entity.setSts("Y"); + List allDb = mdmModuleDbDao.queryByLike(entity); + List mdmModuleDbEntityList = new ArrayList<>(); + if(allDb != null && allDb.size() > 0){ + for (int i = 0; i < allDb.size(); i++) { + if("1".equals(allDb.get(i).getDbType()) || "2".equals(allDb.get(i).getDbType() )){ + mdmModuleDbEntityList.add(allDb.get(i)); + } + } + } + return BaseResult.getSuccessMessageEntity("查询数据成功", mdmModuleDbEntityList); + } - ///** - // * @param object - // * @return com.hzya.frame.web.entity.JsonResultEntity - // * @Author lvleigang - // * @Description 主数据设置查询数据源的服务的字段 - // * @Date 9:40 上午 2023/10/18 - // **/ - //@Override - //public JsonResultEntity queryMdmModuleServerFiled(JSONObject object) { - // MdmModuleDbEntity entity = getData("jsonStr", object, MdmModuleDbEntity.class); - // //判断分页 - // if (entity == null) { - // return BaseResult.getFailureMessageEntity("参数不允许为空"); - // } - // if (entity.getDbName() == null || "".equals(entity.getDbName())) { - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // //查询数据源表 - // entity.setSts("Y"); - // List dblist = mdmModuleDbDao.queryBase(entity); - // if (dblist != null && dblist.size() == 1) { - // MdmModuleDbFiledsEntity queryDbFiled = new MdmModuleDbFiledsEntity(); - // queryDbFiled.setSts("Y"); - // queryDbFiled.setDbId(dblist.get(0).getId()); - // List list = mdmModuleDbFiledsDao.queryBase(queryDbFiled); - // MdmModuleDbFiledsEntity mdmModuleDbFiledsEntity = new MdmModuleDbFiledsEntity(); - // mdmModuleDbFiledsEntity.setChName("id"); - // mdmModuleDbFiledsEntity.setEnName("id"); - // list.add(0, mdmModuleDbFiledsEntity); - // return BaseResult.getSuccessMessageEntity("查询数据成功", list); - // } else { - // return BaseResult.getFailureMessageEntity("服务不存在"); - // } - //} + /** + * @param object + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 主数据设置查询数据源的服务的字段 + * @Date 9:40 上午 2023/10/18 + **/ + @Override + public JsonResultEntity queryMdmModuleServerFiled(JSONObject object) { + MdmModuleDbEntity entity = getData("jsonStr", object, MdmModuleDbEntity.class); + //判断分页 + if (entity == null) { + return BaseResult.getFailureMessageEntity("参数不允许为空"); + } + if (entity.getDbName() == null || "".equals(entity.getDbName())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + //查询数据源表 + entity.setSts("Y"); + List dblist = mdmModuleDbDao.queryBase(entity); + if (dblist != null && dblist.size() == 1) { + MdmModuleDbFiledsEntity queryDbFiled = new MdmModuleDbFiledsEntity(); + queryDbFiled.setSts("Y"); + queryDbFiled.setDbId(dblist.get(0).getId()); + queryDbFiled.setViewType("1"); + List list = mdmModuleDbFiledsDao.queryBase(queryDbFiled); + MdmModuleDbFiledsEntity mdmModuleDbFiledsEntity = new MdmModuleDbFiledsEntity(); + mdmModuleDbFiledsEntity.setChName("id"); + mdmModuleDbFiledsEntity.setEnName("id"); + list.add(0, mdmModuleDbFiledsEntity); + return BaseResult.getSuccessMessageEntity("查询数据成功", list); + } else { + return BaseResult.getFailureMessageEntity("服务不存在"); + } + } // // - ///** - // * @param object - // * @return com.hzya.frame.web.entity.JsonResultEntity - // * @Author lvleigang - // * @Description 主数据设置查询主表字段 - // * @Date 9:40 上午 2023/10/18 - // **/ - //@Override - //public JsonResultEntity queryMdmModuleServerMainFiled(JSONObject object) { - // MdmModuleDbEntity entity = getData("jsonStr", object, MdmModuleDbEntity.class); - // //判断分页 - // if (entity == null) { - // return BaseResult.getFailureMessageEntity("参数不允许为空"); - // } - // if (entity.getMdmId() == null || "".equals(entity.getMdmId())) { - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // //查询数据源表 - // entity.setSts("Y"); - // entity.setDbType("1"); - // List mdmModuleDbEntityList = mdmModuleDbDao.queryBase(entity); - // if (mdmModuleDbEntityList != null && mdmModuleDbEntityList.size() == 1) { - // MdmModuleDbFiledsEntity mdmModuleDbFiledsEntity = new MdmModuleDbFiledsEntity(); - // mdmModuleDbFiledsEntity.setSts("Y"); - // mdmModuleDbFiledsEntity.setDbId(mdmModuleDbEntityList.get(0).getId()); - // List list = mdmModuleDbFiledsDao.queryBase(mdmModuleDbFiledsEntity); - // return BaseResult.getSuccessMessageEntity("查询数据成功", list); - // } else if (mdmModuleDbEntityList != null && mdmModuleDbEntityList.size() == 0) { - // return BaseResult.getFailureMessageEntity("请先配置数据源"); - // } else { - // return BaseResult.getFailureMessageEntity("查询数据失败"); - // } - //} + /** + * @param object + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 主数据设置查询主表字段 + * @Date 9:40 上午 2023/10/18 + **/ + @Override + public JsonResultEntity queryMdmModuleServerMainFiled(JSONObject object) { + MdmModuleDbEntity entity = getData("jsonStr", object, MdmModuleDbEntity.class); + //判断分页 + if (entity == null) { + return BaseResult.getFailureMessageEntity("参数不允许为空"); + } + if (entity.getMdmId() == null || "".equals(entity.getMdmId())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + //查询数据源表 + entity.setSts("Y"); + entity.setDbType("1"); + List mdmModuleDbEntityList = mdmModuleDbDao.queryBase(entity); + if (mdmModuleDbEntityList != null && mdmModuleDbEntityList.size() == 1) { + MdmModuleDbFiledsEntity mdmModuleDbFiledsEntity = new MdmModuleDbFiledsEntity(); + mdmModuleDbFiledsEntity.setSts("Y"); + mdmModuleDbFiledsEntity.setViewType("1"); + mdmModuleDbFiledsEntity.setDbId(mdmModuleDbEntityList.get(0).getId()); + List list = mdmModuleDbFiledsDao.queryBase(mdmModuleDbFiledsEntity); + return BaseResult.getSuccessMessageEntity("查询数据成功", list); + } else if (mdmModuleDbEntityList != null && mdmModuleDbEntityList.size() == 0) { + return BaseResult.getFailureMessageEntity("请先配置数据源"); + } else { + return BaseResult.getFailureMessageEntity("查询数据失败"); + } + } @@ -2493,68 +2518,131 @@ public class MdmServiceImpl implements IMdmService { return BaseResult.getFailureMessageEntity("系统错误"); } - //查询设置的查询字段 MdmModuleViewDetailEntity mdmModuleViewDetailEntity = new MdmModuleViewDetailEntity(); mdmModuleViewDetailEntity.setMdmId(mdmModuleEntity.getId()); mdmModuleViewDetailEntity.setSts("Y"); List mdmModuleViewDetailEntities = mdmServiceCache.queryMdmModuleViewDetail(mdmModuleViewDetailEntity); - - - - + if (mdmModuleViewDetailEntities == null || mdmModuleViewDetailEntities.size() == 0) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + List queryList = getFiledByType("1",mdmModuleViewDetailEntities,mdmModuleDbEntityList,mdmModuleDbFiledsEntityList,mdmModuleDbFiledsRuleEntityList); + mdmViewVo.setQueryList(queryList); + List listList = getFiledByType("2",mdmModuleViewDetailEntities,mdmModuleDbEntityList,mdmModuleDbFiledsEntityList,mdmModuleDbFiledsRuleEntityList); + mdmViewVo.setListList(listList); return BaseResult.getSuccessMessageEntity("获取字段成功", mdmViewVo); } + + /** + * @Author lvleigang + * @Description 根据类型获取字段 + * @Date 9:18 上午 2024/6/6 + * @param viewType 类型 + * @param mdmModuleViewDetailEntities 显示设置的字段 + * @param mdmModuleDbEntityList 表 + * @param mdmModuleDbFiledsEntityList 表字段 + * @param mdmModuleDbFiledsRuleEntityList 字段规则 + * @return java.util.List + **/ + private List getFiledByType(String viewType, List mdmModuleViewDetailEntities, List mdmModuleDbEntityList, List mdmModuleDbFiledsEntityList, List mdmModuleDbFiledsRuleEntityList) { + List mdmViewFiledVos = new ArrayList<>(); + if(mdmModuleViewDetailEntities != null && mdmModuleViewDetailEntities.size() > 0){ + for (int i = 0; i < mdmModuleViewDetailEntities.size(); i++) { + if(viewType.equals(mdmModuleViewDetailEntities.get(i).getViewType())){ + //类型一致 + MdmViewFiledVo mdmViewFiledVo = new MdmViewFiledVo(); + mdmViewFiledVo.setId(mdmModuleViewDetailEntities.get(i).getViewFiled()); + for (int i1 = 0; i1 < mdmModuleDbFiledsEntityList.size(); i1++) { + if(mdmModuleDbFiledsEntityList.get(i1).getId().equals(mdmModuleViewDetailEntities.get(i).getViewFiled())){ + for (int i2 = 0; i2 < mdmModuleDbEntityList.size(); i2++) { + if(mdmModuleDbEntityList.get(i2).getId().equals(mdmModuleDbFiledsEntityList.get(i1).getDbId())){ + mdmViewFiledVo.setDbName(mdmModuleDbEntityList.get(i2).getDbName()); + mdmViewFiledVo.setDbType(mdmModuleDbEntityList.get(i2).getDbType()); + mdmViewFiledVo.setMdmId(mdmModuleDbEntityList.get(i2).getMdmId()); + mdmViewFiledVo.setDbId(mdmModuleDbEntityList.get(i2).getId()); + + break; + } + } + mdmViewFiledVo.setChName(mdmModuleDbFiledsEntityList.get(i1).getChName()); + mdmViewFiledVo.setEnName(mdmModuleDbFiledsEntityList.get(i1).getEnName()); + mdmViewFiledVo.setFiledType(mdmModuleDbFiledsEntityList.get(i1).getFiledType()); + //字段规则 + if(mdmModuleDbFiledsRuleEntityList != null && mdmModuleDbFiledsRuleEntityList.size() > 0){ + List ruleList = new ArrayList<>(); + for (int i2 = 0; i2 < mdmModuleDbFiledsRuleEntityList.size(); i2++) { + if(mdmModuleDbFiledsEntityList.get(i1).getId().equals(mdmModuleDbFiledsRuleEntityList.get(i2).getFiledId())){ + ruleList.add(mdmModuleDbFiledsRuleEntityList.get(i2)); + } + } + mdmViewFiledVo.setRuleList(ruleList); + } + break; + } + } + } + } + } + if(mdmViewFiledVos != null && mdmViewFiledVos.size() > 0){ + for (int i = 0; i < mdmViewFiledVos.size(); i++) { + mdmViewFiledVos.get(i).setSorts(i); + } + } + return mdmViewFiledVos; + } // - ///** - // * @param object - // * @return com.hzya.frame.web.entity.JsonResultEntity - // * @Author lvleigang - // * @Description 主数据查询所有字段 - // * @Date 9:40 上午 2023/10/18 - // **/ - //@Override - //public JsonResultEntity queryMdmShowAll(JSONObject object) { - // MdmDto entity = getData("jsonStr", object, MdmDto.class); - // if (entity == null) { - // return BaseResult.getFailureMessageEntity("参数不允许为空"); - // } - // if (entity.getId() == null || "".equals(entity.getId())) { - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // //查询设置各种类型字段 - // //查询模版数据源 - // MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); - // mdmModuleDbEntity.setMdmId(entity.getId()); - // mdmModuleDbEntity.setSts("Y"); - // List mdmModuleDbEntityList = mdmModuleDbDao.queryBase(mdmModuleDbEntity); - // List listFiled = new ArrayList<>(); - // if (mdmModuleDbEntityList != null && mdmModuleDbEntityList.size() > 0) { - // MdmModuleDbFiledsEntity mdmModuleDbFiledsEntity = new MdmModuleDbFiledsEntity(); - // mdmModuleDbFiledsEntity.setMdmId(entity.getId()); - // mdmModuleDbFiledsEntity.setSts("Y"); - // List mdmModuleDbFiledsEntityList = mdmModuleDbFiledsDao.queryBase(mdmModuleDbFiledsEntity); - // // - // if (mdmModuleDbEntityList != null && mdmModuleDbEntityList.size() > 0) { - // for (int i = 0; i < mdmModuleDbEntityList.size(); i++) { - // if (mdmModuleDbFiledsEntityList != null && mdmModuleDbFiledsEntityList.size() > 0) { - // for (int i1 = 0; i1 < mdmModuleDbFiledsEntityList.size(); i1++) { - // if (mdmModuleDbEntityList.get(i).getId().equals(mdmModuleDbFiledsEntityList.get(i1).getDbId())) { - // if ("1".equals(mdmModuleDbEntityList.get(i).getDbType())) { - // //1、主表 - // listFiled.add(new MdmDbFiledVo(mdmModuleDbFiledsEntityList.get(i1).getId(), "【主表:" + mdmModuleDbEntityList.get(i).getDbName() + "】" + mdmModuleDbFiledsEntityList.get(i1).getChName())); - // } else { - // //2、明细 - // listFiled.add(new MdmDbFiledVo(mdmModuleDbFiledsEntityList.get(i1).getId(), "【子表:" + mdmModuleDbEntityList.get(i).getDbName() + "】" + mdmModuleDbFiledsEntityList.get(i1).getChName())); - // } - // } - // } - // } - // } - // } - // } - // return BaseResult.getSuccessMessageEntity("查询视图成功", listFiled); - //} + /** + * @param object + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 主数据查询所有字段 + * @Date 9:40 上午 2023/10/18 + **/ + @Override + public JsonResultEntity queryMdmShowAll(JSONObject object) { + MdmDto entity = getData("jsonStr", object, MdmDto.class); + if (entity == null) { + return BaseResult.getFailureMessageEntity("参数不允许为空"); + } + if (entity.getMdmCode() == null || "".equals(entity.getMdmCode())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + //查询设置各种类型字段 + MdmModuleEntity mdmModuleEntity = mdmServiceCache.getMdmModuleEntity(entity.getMdmCode()); + //查询模版数据源 + MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); + mdmModuleDbEntity.setMdmId(mdmModuleEntity.getId()); + mdmModuleDbEntity.setSts("Y"); + List mdmModuleDbEntityList = mdmServiceCache.queryMdmModuleDb(mdmModuleDbEntity); + List listFiled = new ArrayList<>(); + if (mdmModuleDbEntityList != null && mdmModuleDbEntityList.size() > 0) { + MdmModuleDbFiledsEntity mdmModuleDbFiledsEntity = new MdmModuleDbFiledsEntity(); + mdmModuleDbFiledsEntity.setMdmId(mdmModuleEntity.getId()); + mdmModuleDbFiledsEntity.setSts("Y"); + List mdmModuleDbFiledsEntityList = mdmServiceCache.queryMdmModuleDbFileds(mdmModuleDbFiledsEntity); + // + if (mdmModuleDbEntityList != null && mdmModuleDbEntityList.size() > 0) { + for (int i = 0; i < mdmModuleDbEntityList.size(); i++) { + if("1".equals(mdmModuleDbEntityList.get(i).getDbType()) || "2".equals(mdmModuleDbEntityList.get(i).getDbType())){ + if (mdmModuleDbFiledsEntityList != null && mdmModuleDbFiledsEntityList.size() > 0) { + for (int i1 = 0; i1 < mdmModuleDbFiledsEntityList.size(); i1++) { + if (mdmModuleDbEntityList.get(i).getId().equals(mdmModuleDbFiledsEntityList.get(i1).getDbId())) { + if ("1".equals(mdmModuleDbEntityList.get(i).getDbType())) { + //1、主表 + listFiled.add(new MdmDbFiledVo(mdmModuleDbFiledsEntityList.get(i1).getId(), "【主表:" + mdmModuleDbEntityList.get(i).getDbName() + "】" + mdmModuleDbFiledsEntityList.get(i1).getChName())); + } else { + //2、明细 + listFiled.add(new MdmDbFiledVo(mdmModuleDbFiledsEntityList.get(i1).getId(), "【子表:" + mdmModuleDbEntityList.get(i).getDbName() + "】" + mdmModuleDbFiledsEntityList.get(i1).getChName())); + } + } + } + } + } + } + } + } + return BaseResult.getSuccessMessageEntity("查询视图成功", listFiled); + } // ///** // * @param mdmModuleRoleButtonEntities @@ -2751,28 +2839,28 @@ public class MdmServiceImpl implements IMdmService { // mdmViewFiledVos.add(mdmViewFiledVo); //} // - ///** - // * @param object - // * @return com.hzya.frame.web.entity.JsonResultEntity - // * @Author lvleigang - // * @Description 主数据列表显示 业务数据 - // * @Date 9:40 上午 2023/10/18 - // **/ - //@Override - //public JsonResultEntity queryMdmShowData(JSONObject object) { - // MdmQuery entity = getData("jsonStr", object, MdmQuery.class); - // if (entity == null) { - // return BaseResult.getFailureMessageEntity("参数不允许为空"); - // } - // //判断分页 - // if (entity == null || entity.getPageNum() == null || entity.getPageSize() == null) { - // return BaseResult.getFailureMessageEntity("分页查询参数不存在"); - // } - // PageHelper.startPage(entity.getPageNum(), entity.getPageSize()); - // List> businessResult = mdmModuleDao.queryMdmShowData(entity); - // PageInfo pageInfo = new PageInfo(businessResult); - // return BaseResult.getSuccessMessageEntity("查询数据成功", pageInfo); - //} + /** + * @param object + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 主数据列表显示 业务数据 + * @Date 9:40 上午 2023/10/18 + **/ + @Override + public JsonResultEntity queryMdmShowData(JSONObject object) { + MdmQuery entity = getData("jsonStr", object, MdmQuery.class); + if (entity == null) { + return BaseResult.getFailureMessageEntity("参数不允许为空"); + } + //判断分页 + if (entity == null || entity.getPageNum() == null || entity.getPageSize() == null) { + return BaseResult.getFailureMessageEntity("分页查询参数不存在"); + } + PageHelper.startPage(entity.getPageNum(), entity.getPageSize()); + List> businessResult = mdmModuleDao.queryMdmShowData(entity); + PageInfo pageInfo = new PageInfo(businessResult); + return BaseResult.getSuccessMessageEntity("查询数据成功", pageInfo); + } // ///** // * @param object @@ -2857,143 +2945,147 @@ public class MdmServiceImpl implements IMdmService { // return BaseResult.getSuccessMessageEntity("查询数据成功", returnData); //} // - ///** - // * @param object - // * @return com.hzya.frame.web.entity.JsonResultEntity - // * @Author lvleigang - // * @Description 查询数据(list 或者 分页) - // * @Date 1:33 下午 2023/7/12 - // **/ - //@Override - //public JsonResultEntity queryTemplateData(JSONObject object) { - // MdmDto entity = getData("jsonStr", object, MdmDto.class); - // //校验是否有servecr传参 - // if (!checkStr(entity.getTableName())) { - // return BaseResult.getFailureMessageEntity("请先传递服务名"); - // } - // if (!checkStr(entity.getValue())) { - // return BaseResult.getFailureMessageEntity("请先传递存储字段"); - // } - // if (!checkStr(entity.getLabel())) { - // return BaseResult.getFailureMessageEntity("请先传递显示字段"); - // } - // if (entity.getPageNum() != null && entity.getPageSize() != null) { - // PageHelper.startPage(entity.getPageNum(), entity.getPageSize()); - // List> mapList = mdmModuleDao.querySelectData(entity); - // PageInfo pageInfo = new PageInfo(mapList); - // return BaseResult.getSuccessMessageEntity("查询数据成功", pageInfo); - // } else { - // List> mapList = mdmModuleDao.querySelectData(entity); - // return BaseResult.getSuccessMessageEntity("查询数据成功", mapList); - // } - //} + /** + * @param object + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 查询数据(list 或者 分页) + * @Date 1:33 下午 2023/7/12 + **/ + @Override + public JsonResultEntity queryTemplateData(JSONObject object) { + MdmDto entity = getData("jsonStr", object, MdmDto.class); + //校验是否有servecr传参 + if (!checkStr(entity.getTableName())) { + return BaseResult.getFailureMessageEntity("请先传递服务名"); + } + if (!checkStr(entity.getValue())) { + return BaseResult.getFailureMessageEntity("请先传递存储字段"); + } + if (!checkStr(entity.getLabel())) { + return BaseResult.getFailureMessageEntity("请先传递显示字段"); + } + if (entity.getPageNum() != null && entity.getPageSize() != null) { + PageHelper.startPage(entity.getPageNum(), entity.getPageSize()); + List> mapList = mdmModuleDao.querySelectData(entity); + PageInfo pageInfo = new PageInfo(mapList); + return BaseResult.getSuccessMessageEntity("查询数据成功", pageInfo); + } else { + List> mapList = mdmModuleDao.querySelectData(entity); + return BaseResult.getSuccessMessageEntity("查询数据成功", mapList); + } + } // - ///** - // * @param object - // * @return com.hzya.frame.web.entity.JsonResultEntity - // * @Author lvleigang - // * @Description 业务数据树形结构,数据查询 - // * @Date 9:40 上午 2023/10/18 - // **/ - //@Override - //public JsonResultEntity queryMdmShowTreeData(JSONObject object) { - // MdmDto entity = getData("jsonStr", object, MdmDto.class); - // if (entity == null) { - // return BaseResult.getFailureMessageEntity("参数不允许为空"); - // } - // //if (entity.getTableName() == null || "".equals(entity.getTableName())) { - // // return BaseResult.getFailureMessageEntity("系统错误"); - // //} - // if (entity.getLabel() == null || "".equals(entity.getLabel())) { - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // if (entity.getUpId() == null || "".equals(entity.getUpId())) { - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // if (entity.getMdmCode() != null && !"".equals(entity.getMdmCode())) { - // //查询模版 - // MdmModuleEntity mdmModuleEntity = new MdmModuleEntity(); - // mdmModuleEntity.setMdmCode(entity.getMdmCode()); - // mdmModuleEntity.setSts("Y"); - // List mdmModuleEntities = mdmModuleDao.queryBase(mdmModuleEntity); - // if (mdmModuleEntities == null || mdmModuleEntities.size() != 1) { - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // //查询数据源主表 - // MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); - // mdmModuleDbEntity.setMdmId(mdmModuleEntities.get(0).getId()); - // mdmModuleDbEntity.setDbType("1"); - // mdmModuleDbEntity.setSts("Y"); - // List mdmModuleDbEntityList = mdmModuleDbDao.queryBase(mdmModuleDbEntity); - // if (mdmModuleDbEntityList == null || mdmModuleDbEntityList.size() == 0) { - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // mdmModuleDbEntity = mdmModuleDbEntityList.get(0); - // entity.setTableName(mdmModuleDbEntity.getDbName()); - // } + /** + * @param object + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 业务数据树形结构,数据查询 + * @Date 9:40 上午 2023/10/18 + **/ + @Override + public JsonResultEntity queryMdmShowTreeData(JSONObject object) { + MdmDto entity = getData("jsonStr", object, MdmDto.class); + if (entity == null) { + return BaseResult.getFailureMessageEntity("参数不允许为空"); + } + //if (entity.getTableName() == null || "".equals(entity.getTableName())) { + // return BaseResult.getFailureMessageEntity("系统错误"); + //} + if (entity.getLabel() == null || "".equals(entity.getLabel())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + if (entity.getUpId() == null || "".equals(entity.getUpId())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + if (entity.getMdmCode() == null || "".equals(entity.getMdmCode())) { + return BaseResult.getFailureMessageEntity("系统错误"); + + } + //查询模版 + MdmModuleEntity mdmModuleEntities = mdmServiceCache.getMdmModuleEntity(entity.getMdmCode()); + if (mdmModuleEntities == null ) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + //查询数据源主表 + MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); + mdmModuleDbEntity.setMdmId(mdmModuleEntities.getId()); + mdmModuleDbEntity.setSts("Y"); + List mdmModuleDbEntityList = mdmServiceCache.queryMdmModuleDb(mdmModuleDbEntity); + if (mdmModuleDbEntityList == null || mdmModuleDbEntityList.size() == 0) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + for (int i = 0; i < mdmModuleDbEntityList.size(); i++) { + if("1".equals(mdmModuleDbEntityList.get(i).getDbType())){ + mdmModuleDbEntity = mdmModuleDbEntityList.get(i); + break; + } + } + entity.setTableName(mdmModuleDbEntity.getDbName()); + + + + if (checkStr(entity.getId())) { + if (!checkStr(entity.getValue())) { + return BaseResult.getFailureMessageEntity("请先传递存储字段"); + } + if (entity.getId().contains(",")) { + String[] strArray = entity.getId().split(","); // 使用逗号和空格作为分隔符 + entity.setIds(strArray); + List> mapList = mdmModuleDao.queryTemplateDataMore(entity); + if (mapList == null || mapList.size() == 0) { + List> returnList = new ArrayList<>(); + return BaseResult.getSuccessMessageEntity("查询数据成功", returnList); + } + List> returnList = gettochilder(strArray, 0, mapList); + return BaseResult.getSuccessMessageEntity("查询数据成功", returnList); + } else { + HashMap mapList = mdmModuleDao.queryTemplateDataOne(entity); + if (mapList == null || mapList.size() == 0) { + List> returnList = new ArrayList<>(); + return BaseResult.getSuccessMessageEntity("查询数据成功", returnList); + } + List> returnList = new ArrayList<>(); + returnList.add(mapList); + return BaseResult.getSuccessMessageEntity("查询数据成功", returnList); + } + } else { + List> mapList = mdmModuleDao.queryDataAll(entity); + List> returnList = new ArrayList<>(); + + if (mapList != null && mapList.size() > 0) { + for (int i = 0; i < mapList.size(); i++) { + //默认为根 + if (mapList.get(i).get(entity.getUpId()) == null || "".equals(mapList.get(i).get(entity.getUpId()))) { + List> children = getchilder(mapList.get(i).get("qsdfg").toString(), mapList, entity); + HashMap re = new HashMap<>(); + re.put("id", mapList.get(i).get("qsdfg")); + re.put("label", mapList.get(i).get(entity.getLabel())); + re.put("upID", mapList.get(i).get(entity.getUpId())); + if (children != null && children.size() > 0) { + re.put("children", children); + } + returnList.add(re); + } + } + } + return BaseResult.getSuccessMessageEntity("查询数据成功", returnList); + } + } // - // - // if (checkStr(entity.getId())) { - // if (!checkStr(entity.getValue())) { - // return BaseResult.getFailureMessageEntity("请先传递存储字段"); - // } - // if (entity.getId().contains(",")) { - // String[] strArray = entity.getId().split(","); // 使用逗号和空格作为分隔符 - // entity.setIds(strArray); - // List> mapList = mdmModuleDao.queryTemplateDataMore(entity); - // if (mapList == null || mapList.size() == 0) { - // List> returnList = new ArrayList<>(); - // return BaseResult.getSuccessMessageEntity("查询数据成功", returnList); - // } - // List> returnList = gettochilder(strArray, 0, mapList); - // return BaseResult.getSuccessMessageEntity("查询数据成功", returnList); - // } else { - // HashMap mapList = mdmModuleDao.queryTemplateDataOne(entity); - // if (mapList == null || mapList.size() == 0) { - // List> returnList = new ArrayList<>(); - // return BaseResult.getSuccessMessageEntity("查询数据成功", returnList); - // } - // List> returnList = new ArrayList<>(); - // returnList.add(mapList); - // return BaseResult.getSuccessMessageEntity("查询数据成功", returnList); - // } - // } else { - // List> mapList = mdmModuleDao.queryDataAll(entity); - // List> returnList = new ArrayList<>(); - // - // if (mapList != null && mapList.size() > 0) { - // for (int i = 0; i < mapList.size(); i++) { - // //默认为根 - // if (mapList.get(i).get(entity.getUpId()) == null || "".equals(mapList.get(i).get(entity.getUpId()))) { - // List> children = getchilder(mapList.get(i).get("qsdfg").toString(), mapList, entity); - // HashMap re = new HashMap<>(); - // re.put("id", mapList.get(i).get("qsdfg")); - // re.put("label", mapList.get(i).get(entity.getLabel())); - // re.put("upID", mapList.get(i).get(entity.getUpId())); - // if (children != null && children.size() > 0) { - // re.put("children", children); - // } - // returnList.add(re); - // } - // } - // } - // return BaseResult.getSuccessMessageEntity("查询数据成功", returnList); - // } - //} - // - //private List> gettochilder(String[] strArray, int i, List> mapList) { - // List> maps = new ArrayList<>(); - // for (int i1 = 0; i1 < mapList.size(); i1++) { - // if (strArray[i].equals(mapList.get(i1).get("id").toString())) { - // if (strArray.length >= (i + 2)) { - // mapList.get(i1).put("children", gettochilder(strArray, i + 1, mapList)); - // } - // maps.add(mapList.get(i1)); - // break; - // } - // } - // return maps; - //} + private List> gettochilder(String[] strArray, int i, List> mapList) { + List> maps = new ArrayList<>(); + for (int i1 = 0; i1 < mapList.size(); i1++) { + if (strArray[i].equals(mapList.get(i1).get("id").toString())) { + if (strArray.length >= (i + 2)) { + mapList.get(i1).put("children", gettochilder(strArray, i + 1, mapList)); + } + maps.add(mapList.get(i1)); + break; + } + } + return maps; + } // //private HashMap getFathers(List> mapListAll, HashMap mapList, MdmDto entity) { // if (mapList.get("upID") == null) { @@ -3018,198 +3110,202 @@ public class MdmServiceImpl implements IMdmService { // return a; //} // - //private List> getchilder(String stringObjectHashMap, List> mapList, MdmDto entity) { - // List> returnList = new ArrayList<>(); - // if (mapList != null && mapList.size() > 0) { - // for (int i = 0; i < mapList.size(); i++) { - // //等于上级id的时候 - // if (stringObjectHashMap.equals(mapList.get(i).get(entity.getUpId()))) { - // List> children = getchilder(mapList.get(i).get(entity.getUpId()) + "," + mapList.get(i).get("qsdfg"), mapList, entity); - // HashMap re = new HashMap<>(); - // re.put("id", mapList.get(i).get("qsdfg")); - // re.put("label", mapList.get(i).get(entity.getLabel())); - // re.put("upID", mapList.get(i).get(entity.getUpId())); - // if (children != null && children.size() > 0) { - // re.put("children", children); - // } - // returnList.add(re); - // } - // } - // } - // return returnList; - //} + private List> getchilder(String stringObjectHashMap, List> mapList, MdmDto entity) { + List> returnList = new ArrayList<>(); + if (mapList != null && mapList.size() > 0) { + for (int i = 0; i < mapList.size(); i++) { + //等于上级id的时候 + if (stringObjectHashMap.equals(mapList.get(i).get(entity.getUpId()))) { + List> children = getchilder(mapList.get(i).get(entity.getUpId()) + "," + mapList.get(i).get("qsdfg"), mapList, entity); + HashMap re = new HashMap<>(); + re.put("id", mapList.get(i).get("qsdfg")); + re.put("label", mapList.get(i).get(entity.getLabel())); + re.put("upID", mapList.get(i).get(entity.getUpId())); + if (children != null && children.size() > 0) { + re.put("children", children); + } + returnList.add(re); + } + } + } + return returnList; + } // - ///** - // * @param object - // * @return com.hzya.frame.web.entity.JsonResultEntity - // * @Author lvleigang - // * @Description 主数据详情 区分类型 新增、修改、查看 - // * @Date 9:40 上午 2023/10/18 - // **/ - //@Override - //public JsonResultEntity queryMdmShowDetails(JSONObject object) { - // MdmDto entity = getData("jsonStr", object, MdmDto.class); - // if (entity == null) { - // return BaseResult.getFailureMessageEntity("参数不允许为空"); - // } - // if (entity.getMdmCode() == null || "".equals(entity.getMdmCode())) { - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // if (entity.getShowType() == null || "".equals(entity.getShowType())) { - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // //查询模版 - // MdmModuleEntity mdmModuleEntity = new MdmModuleEntity(); - // mdmModuleEntity.setMdmCode(entity.getMdmCode()); - // mdmModuleEntity.setSts("Y"); - // List mdmModuleEntities = mdmModuleDao.queryBase(mdmModuleEntity); - // if (mdmModuleEntities == null || mdmModuleEntities.size() != 1) { - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // MdmDetailViewVo mdmViewVo = new MdmDetailViewVo(); - // mdmModuleEntity = mdmModuleEntities.get(0); - // mdmViewVo.setMdmModuleEntity(mdmModuleEntity); - // - // //查询数据源主表 - // MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); - // mdmModuleDbEntity.setMdmId(mdmModuleEntity.getId()); - // mdmModuleDbEntity.setSts("Y"); - // List mdmModuleDbEntityList = mdmModuleDbDao.queryBase(mdmModuleDbEntity); - // if (mdmModuleDbEntityList == null || mdmModuleDbEntityList.size() == 0) { - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // //查询数据源表下面的字段 - // MdmModuleDbFiledsEntity mdmModuleDbFiledsEntity = new MdmModuleDbFiledsEntity(); - // mdmModuleDbFiledsEntity.setMdmId(mdmModuleEntity.getId()); - // mdmModuleDbFiledsEntity.setSts("Y"); - // List mdmModuleDbFiledsEntityList = mdmModuleDbFiledsDao.queryBase(mdmModuleDbFiledsEntity); - // if (mdmModuleDbFiledsEntityList == null || mdmModuleDbFiledsEntityList.size() == 0) { - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // //查询字段下的规则 - // MdmModuleDbFiledsRuleEntity mdmModuleDbFiledsRuleEntity = new MdmModuleDbFiledsRuleEntity(); - // mdmModuleDbFiledsRuleEntity.setMdmId(mdmModuleEntity.getId()); - // mdmModuleDbFiledsRuleEntity.setSts("Y"); - // List mdmModuleDbFiledsRuleEntityList = mdmModuleDbFiledsRuleDao.queryBase(mdmModuleDbFiledsRuleEntity); - // if (mdmModuleDbFiledsRuleEntityList == null || mdmModuleDbFiledsRuleEntityList.size() == 0) { - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // MdmModuleViewDetailEntity mdmModuleViewDetailEntity = new MdmModuleViewDetailEntity(); - // mdmModuleViewDetailEntity.setMdmId(mdmModuleEntity.getId()); - // mdmModuleViewDetailEntity.setSts("Y"); - // mdmModuleViewDetailEntity.setViewType(entity.getShowType());//设置显示字段类型 - // List mdmModuleViewDetailEntityList = mdmModuleViewDetailDao.queryBase(mdmModuleViewDetailEntity); - // //组装数据 - // assembleMdmShowDetails(mdmViewVo, mdmModuleDbEntityList, mdmModuleDbFiledsEntityList, mdmModuleDbFiledsRuleEntityList, mdmModuleViewDetailEntityList, entity.getShowType()); - // return BaseResult.getSuccessMessageEntity("获取字段成功", mdmViewVo); - //} - // - ///** - // * @param mdmViewVo 返回对象 - // * @param mdmModuleDbEntityList 数据源表 - // * @param mdmModuleDbFiledsEntityList 数据源字段 - // * @param mdmModuleDbFiledsRuleEntityList 数据源字段规则 - // * @param mdmModuleViewDetailEntityList 数据源显示字段 - // * @return void - // * @Author lvleigang - // * @Description 组装显示字段 - // * @Date 9:10 上午 2023/11/6 - // **/ - //private void assembleMdmShowDetails(MdmDetailViewVo mdmViewVo, List mdmModuleDbEntityList, List mdmModuleDbFiledsEntityList, List mdmModuleDbFiledsRuleEntityList, List mdmModuleViewDetailEntityList, String showType) { - // //主数据主表 - // MdmModuleDbEntity mainMdmModuleDb = new MdmModuleDbEntity(); - // List mainMdmModuleDbFileds = new ArrayList<>(); - // //主数据子表 - // List sublistMdmModuleDb = new ArrayList<>(); - // - // if (mdmModuleViewDetailEntityList != null && mdmModuleViewDetailEntityList.size() > 0) { - // //先循环数据源表,设置出数据字段 - // for (int i = 0; i < mdmModuleDbEntityList.size(); i++) { - // if ("1".equals(mdmModuleDbEntityList.get(i).getDbType())) { - // //1、主表 2、明细 - // mainMdmModuleDb = mdmModuleDbEntityList.get(i); - // //循环字段表 - // if (mdmModuleDbFiledsEntityList != null && mdmModuleDbFiledsEntityList.size() > 0) { - // for (int i1 = 0; i1 < mdmModuleDbFiledsEntityList.size(); i1++) { - // if (mdmModuleDbEntityList.get(i).getId().equals(mdmModuleDbFiledsEntityList.get(i1).getDbId())) { - // for (int b = 0; b < mdmModuleViewDetailEntityList.size(); b++) { - // if (mdmModuleViewDetailEntityList.get(b).getViewFiled().equals(mdmModuleDbFiledsEntityList.get(i1).getId())) { - // mainMdmModuleDbFileds.add(mdmModuleDbFiledsEntityList.get(i1)); - // List mdmModuleDbFiledsRules = new ArrayList<>(); - // //循环字段属性 - // if (mdmModuleDbFiledsRuleEntityList != null && mdmModuleDbFiledsRuleEntityList.size() > 0) { - // for (int i2 = 0; i2 < mdmModuleDbFiledsRuleEntityList.size(); i2++) { - // if (mdmModuleDbFiledsEntityList.get(i1).getDbId().equals(mdmModuleDbFiledsRuleEntityList.get(i2).getDbId()) - // && mdmModuleDbFiledsEntityList.get(i1).getId().equals(mdmModuleDbFiledsRuleEntityList.get(i2).getFiledId())) { - // mdmModuleDbFiledsRules.add(mdmModuleDbFiledsRuleEntityList.get(i2)); - // } - // } - // } - // mdmModuleDbFiledsEntityList.get(i1).setMdmModuleDbFiledsRules(mdmModuleDbFiledsRules); - // } - // } - // } - // } - // } - // } else if ("2".equals(mdmModuleDbEntityList.get(i).getDbType())) { - // //2、明细 - // sublistMdmModuleDb.add(mdmModuleDbEntityList.get(i)); - // //循环字段表 - // if (mdmModuleDbFiledsEntityList != null && mdmModuleDbFiledsEntityList.size() > 0) { - // List sublistMdmModuleDbFileds = new ArrayList<>(); - // for (int i1 = 0; i1 < mdmModuleDbFiledsEntityList.size(); i1++) { - // if (mdmModuleDbEntityList.get(i).getId().equals(mdmModuleDbFiledsEntityList.get(i1).getDbId())) { - // for (int b = 0; b < mdmModuleViewDetailEntityList.size(); b++) { - // if (mdmModuleViewDetailEntityList.get(b).getViewFiled().equals(mdmModuleDbFiledsEntityList.get(i1).getId())) { - // sublistMdmModuleDbFileds.add(mdmModuleDbFiledsEntityList.get(i1)); - // List mdmModuleDbFiledsRules = new ArrayList<>(); - // //循环字段属性 - // if (mdmModuleDbFiledsRuleEntityList != null && mdmModuleDbFiledsRuleEntityList.size() > 0) { - // for (int i2 = 0; i2 < mdmModuleDbFiledsRuleEntityList.size(); i2++) { - // if (mdmModuleDbFiledsEntityList.get(i1).getDbId().equals(mdmModuleDbFiledsRuleEntityList.get(i2).getDbId()) - // && mdmModuleDbFiledsEntityList.get(i1).getId().equals(mdmModuleDbFiledsRuleEntityList.get(i2).getFiledId())) { - // mdmModuleDbFiledsRules.add(mdmModuleDbFiledsRuleEntityList.get(i2)); - // } - // } - // } - // mdmModuleDbFiledsEntityList.get(i1).setMdmModuleDbFiledsRules(mdmModuleDbFiledsRules); - // } - // } - // - // } - // } - // mdmModuleDbEntityList.get(i).setSublistMdmModuleDbFileds(sublistMdmModuleDbFileds); - // } - // } - // } - // mainMdmModuleDb.setSublistMdmModuleDbFileds(mainMdmModuleDbFileds); - // mdmViewVo.setMainMdmModuleDb(mainMdmModuleDb); - // //主数据子表 - // List mdmModuleDb = new ArrayList<>(); - // if (sublistMdmModuleDb != null && sublistMdmModuleDb.size() > 0) { - // for (int i = 0; i < sublistMdmModuleDb.size(); i++) { - // if (sublistMdmModuleDb.get(i).getSublistMdmModuleDbFileds() != null && sublistMdmModuleDb.get(i).getSublistMdmModuleDbFileds().size() > 0) { - // mdmModuleDb.add(sublistMdmModuleDb.get(i)); - // } - // } - // } - // if ("5".equals(showType)) { - // MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); - // mdmModuleDbEntity.setDbName(mainMdmModuleDb.getDbName() + "_distribute"); - // mdmModuleDbEntity.setRemark(mainMdmModuleDb.getRemark() + "分发表"); - // mdmModuleDbEntity.setDbType("2"); - // List mdmModuleDbFiledsEntityList1 = getDistributeRole(); - // mdmModuleDbEntity.setSublistMdmModuleDbFileds(mdmModuleDbFiledsEntityList1); - // mdmModuleDb.add(mdmModuleDbEntity); - // } - // mdmViewVo.setSublistMdmModuleDb(mdmModuleDb); - // - // - // } else { - // mdmViewVo.setMainMdmModuleDb(mainMdmModuleDb); - // mdmViewVo.setSublistMdmModuleDb(sublistMdmModuleDb); - // } - //} + /** + * @param object + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 主数据详情 区分类型 新增、修改、查看 + * @Date 9:40 上午 2023/10/18 + **/ + @Override + public JsonResultEntity queryMdmShowDetails(JSONObject object) { + MdmDto entity = getData("jsonStr", object, MdmDto.class); + if (entity == null) { + return BaseResult.getFailureMessageEntity("参数不允许为空"); + } + if (entity.getMdmCode() == null || "".equals(entity.getMdmCode())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + if (entity.getShowType() == null || "".equals(entity.getShowType())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + //查询模版 + //List mdmModuleEntities = mdmModuleDao.queryBase(mdmModuleEntity); + MdmModuleEntity mdmModuleEntities = mdmServiceCache.getMdmModuleEntity(entity.getMdmCode()); + if (mdmModuleEntities == null) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + MdmDetailViewVo mdmViewVo = new MdmDetailViewVo(); + mdmViewVo.setMdmModuleEntity(mdmModuleEntities); + + //查询数据源主表 + MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); + mdmModuleDbEntity.setMdmId(mdmModuleEntities.getId()); + mdmModuleDbEntity.setSts("Y"); + List mdmModuleDbEntityList = mdmServiceCache.queryMdmModuleDb(mdmModuleDbEntity); + if (mdmModuleDbEntityList == null || mdmModuleDbEntityList.size() == 0) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + //查询数据源表下面的字段 + MdmModuleDbFiledsEntity mdmModuleDbFiledsEntity = new MdmModuleDbFiledsEntity(); + mdmModuleDbFiledsEntity.setMdmId(mdmModuleEntities.getId()); + mdmModuleDbFiledsEntity.setSts("Y"); + List mdmModuleDbFiledsEntityList = mdmServiceCache.queryMdmModuleDbFileds(mdmModuleDbFiledsEntity); + if (mdmModuleDbFiledsEntityList == null || mdmModuleDbFiledsEntityList.size() == 0) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + //查询字段下的规则 + MdmModuleDbFiledsRuleEntity mdmModuleDbFiledsRuleEntity = new MdmModuleDbFiledsRuleEntity(); + mdmModuleDbFiledsRuleEntity.setMdmId(mdmModuleEntities.getId()); + mdmModuleDbFiledsRuleEntity.setSts("Y"); + List mdmModuleDbFiledsRuleEntityList = mdmServiceCache.queryMdmModuleDbFiledsRule(mdmModuleDbFiledsRuleEntity); + if (mdmModuleDbFiledsRuleEntityList == null || mdmModuleDbFiledsRuleEntityList.size() == 0) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + MdmModuleViewDetailEntity mdmModuleViewDetailEntity = new MdmModuleViewDetailEntity(); + mdmModuleViewDetailEntity.setMdmId(mdmModuleEntities.getId()); + mdmModuleViewDetailEntity.setSts("Y"); + mdmModuleViewDetailEntity.setViewType(entity.getShowType());//设置显示字段类型 + List queryAll = mdmModuleViewDetailDao.queryBase(mdmModuleViewDetailEntity); + List mdmModuleViewDetailEntityList = new ArrayList<>(); + if(queryAll != null && queryAll.size() > 0){ + for (int i = 0; i < queryAll.size(); i++) { + if(entity.getShowType().equals(queryAll.get(i).getViewType())){ + mdmModuleViewDetailEntityList.add(queryAll.get(i)); + } + } + } + //组装数据 + assembleMdmShowDetails(mdmViewVo, mdmModuleDbEntityList, mdmModuleDbFiledsEntityList, mdmModuleDbFiledsRuleEntityList, mdmModuleViewDetailEntityList, entity.getShowType()); + return BaseResult.getSuccessMessageEntity("获取字段成功", mdmViewVo); + } + + /** + * @param mdmViewVo 返回对象 + * @param mdmModuleDbEntityList 数据源表 + * @param mdmModuleDbFiledsEntityList 数据源字段 + * @param mdmModuleDbFiledsRuleEntityList 数据源字段规则 + * @param mdmModuleViewDetailEntityList 数据源显示字段 + * @return void + * @Author lvleigang + * @Description 组装显示字段 + * @Date 9:10 上午 2023/11/6 + **/ + private void assembleMdmShowDetails(MdmDetailViewVo mdmViewVo, List mdmModuleDbEntityList, List mdmModuleDbFiledsEntityList, List mdmModuleDbFiledsRuleEntityList, List mdmModuleViewDetailEntityList, String showType) { + //主数据主表 + MdmModuleDbEntity mainMdmModuleDb = new MdmModuleDbEntity(); + List mainMdmModuleDbFileds = new ArrayList<>(); + //主数据子表 + List sublistMdmModuleDb = new ArrayList<>(); + + if (mdmModuleViewDetailEntityList != null && mdmModuleViewDetailEntityList.size() > 0) { + //先循环数据源表,设置出数据字段 + for (int i = 0; i < mdmModuleDbEntityList.size(); i++) { + if ("1".equals(mdmModuleDbEntityList.get(i).getDbType())) { + //1、主表 2、明细 + mainMdmModuleDb = mdmModuleDbEntityList.get(i); + //循环字段表 + if (mdmModuleDbFiledsEntityList != null && mdmModuleDbFiledsEntityList.size() > 0) { + for (int i1 = 0; i1 < mdmModuleDbFiledsEntityList.size(); i1++) { + if (mdmModuleDbEntityList.get(i).getId().equals(mdmModuleDbFiledsEntityList.get(i1).getDbId())) { + for (int b = 0; b < mdmModuleViewDetailEntityList.size(); b++) { + if (mdmModuleViewDetailEntityList.get(b).getViewFiled().equals(mdmModuleDbFiledsEntityList.get(i1).getId())) { + mainMdmModuleDbFileds.add(mdmModuleDbFiledsEntityList.get(i1)); + List mdmModuleDbFiledsRules = new ArrayList<>(); + //循环字段属性 + if (mdmModuleDbFiledsRuleEntityList != null && mdmModuleDbFiledsRuleEntityList.size() > 0) { + for (int i2 = 0; i2 < mdmModuleDbFiledsRuleEntityList.size(); i2++) { + if (mdmModuleDbFiledsEntityList.get(i1).getDbId().equals(mdmModuleDbFiledsRuleEntityList.get(i2).getDbId()) + && mdmModuleDbFiledsEntityList.get(i1).getId().equals(mdmModuleDbFiledsRuleEntityList.get(i2).getFiledId())) { + mdmModuleDbFiledsRules.add(mdmModuleDbFiledsRuleEntityList.get(i2)); + } + } + } + mdmModuleDbFiledsEntityList.get(i1).setMdmModuleDbFiledsRules(mdmModuleDbFiledsRules); + } + } + } + } + } + } else if ("2".equals(mdmModuleDbEntityList.get(i).getDbType())) { + //2、明细 + sublistMdmModuleDb.add(mdmModuleDbEntityList.get(i)); + //循环字段表 + if (mdmModuleDbFiledsEntityList != null && mdmModuleDbFiledsEntityList.size() > 0) { + List sublistMdmModuleDbFileds = new ArrayList<>(); + for (int i1 = 0; i1 < mdmModuleDbFiledsEntityList.size(); i1++) { + if (mdmModuleDbEntityList.get(i).getId().equals(mdmModuleDbFiledsEntityList.get(i1).getDbId())) { + for (int b = 0; b < mdmModuleViewDetailEntityList.size(); b++) { + if (mdmModuleViewDetailEntityList.get(b).getViewFiled().equals(mdmModuleDbFiledsEntityList.get(i1).getId())) { + sublistMdmModuleDbFileds.add(mdmModuleDbFiledsEntityList.get(i1)); + List mdmModuleDbFiledsRules = new ArrayList<>(); + //循环字段属性 + if (mdmModuleDbFiledsRuleEntityList != null && mdmModuleDbFiledsRuleEntityList.size() > 0) { + for (int i2 = 0; i2 < mdmModuleDbFiledsRuleEntityList.size(); i2++) { + if (mdmModuleDbFiledsEntityList.get(i1).getDbId().equals(mdmModuleDbFiledsRuleEntityList.get(i2).getDbId()) + && mdmModuleDbFiledsEntityList.get(i1).getId().equals(mdmModuleDbFiledsRuleEntityList.get(i2).getFiledId())) { + mdmModuleDbFiledsRules.add(mdmModuleDbFiledsRuleEntityList.get(i2)); + } + } + } + mdmModuleDbFiledsEntityList.get(i1).setMdmModuleDbFiledsRules(mdmModuleDbFiledsRules); + } + } + + } + } + mdmModuleDbEntityList.get(i).setSublistMdmModuleDbFileds(sublistMdmModuleDbFileds); + } + } + } + mainMdmModuleDb.setSublistMdmModuleDbFileds(mainMdmModuleDbFileds); + mdmViewVo.setMainMdmModuleDb(mainMdmModuleDb); + //主数据子表 + List mdmModuleDb = new ArrayList<>(); + if (sublistMdmModuleDb != null && sublistMdmModuleDb.size() > 0) { + for (int i = 0; i < sublistMdmModuleDb.size(); i++) { + if (sublistMdmModuleDb.get(i).getSublistMdmModuleDbFileds() != null && sublistMdmModuleDb.get(i).getSublistMdmModuleDbFileds().size() > 0) { + mdmModuleDb.add(sublistMdmModuleDb.get(i)); + } + } + } + //if ("5".equals(showType)) { + // MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); + // mdmModuleDbEntity.setDbName(mainMdmModuleDb.getDbName() + "_distribute"); + // mdmModuleDbEntity.setRemark(mainMdmModuleDb.getRemark() + "分发表"); + // mdmModuleDbEntity.setDbType("2"); + // List mdmModuleDbFiledsEntityList1 = getDistributeRole(); + // mdmModuleDbEntity.setSublistMdmModuleDbFileds(mdmModuleDbFiledsEntityList1); + // mdmModuleDb.add(mdmModuleDbEntity); + //} + mdmViewVo.setSublistMdmModuleDb(mdmModuleDb); + + } else { + mdmViewVo.setMainMdmModuleDb(mainMdmModuleDb); + mdmViewVo.setSublistMdmModuleDb(sublistMdmModuleDb); + } + } // //private List getDistributeRole() { // List mdmModuleDbFiledsEntityList = new ArrayList<>(); @@ -3389,248 +3485,239 @@ public class MdmServiceImpl implements IMdmService { // } //} // - ///** - // * @param object - // * @return com.hzya.frame.web.entity.JsonResultEntity - // * @Author lvleigang - // * @Description 主数据详情数据 区分类型 新增、修改、查看 - // * @Date 9:40 上午 2023/10/18 - // **/ - //@Override - //public JsonResultEntity queryMdmShowDetailsData(JSONObject object) { - // MdmDto entity = getData("jsonStr", object, MdmDto.class); - // if (entity == null) { - // return BaseResult.getFailureMessageEntity("参数不允许为空"); - // } - // if (entity.getMdmCode() == null || "".equals(entity.getMdmCode())) { - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // if (entity.getId() == null || "".equals(entity.getId())) { - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // //查询模版 - // MdmModuleEntity mdmModuleEntity = new MdmModuleEntity(); - // mdmModuleEntity.setMdmCode(entity.getMdmCode()); - // mdmModuleEntity.setSts("Y"); - // List mdmModuleEntities = mdmModuleDao.queryBase(mdmModuleEntity); - // if (mdmModuleEntities == null || mdmModuleEntities.size() != 1) { - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // mdmModuleEntity = mdmModuleEntities.get(0); - // //查询数据源主表 - // MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); - // mdmModuleDbEntity.setMdmId(mdmModuleEntity.getId()); - // mdmModuleDbEntity.setSts("Y"); - // List mdmModuleDbEntityList = mdmModuleDbDao.queryBase(mdmModuleDbEntity); - // if (mdmModuleDbEntityList == null || mdmModuleDbEntityList.size() == 0) { - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // String tablename = null; - // JSONObject jsonObject = new JSONObject(); - // for (int i = 0; i < mdmModuleDbEntityList.size(); i++) { - // //查询数据 - // Map queryData = new HashMap<>(); - // queryData.put("tableName", mdmModuleDbEntityList.get(i).getDbName());//表名 - // if ("1".equals(mdmModuleDbEntityList.get(i).getDbType())) { - // queryData.put("detailFlag", false);//是否明细 - // queryData.put("id", entity.getId());//字段 - // HashMap datas = mdmModuleDbDao.getServiceDataById(queryData); - // jsonObject.put(mdmModuleDbEntityList.get(i).getDbName(), datas); - // tablename = mdmModuleDbEntityList.get(i).getDbName() + "_distribute"; - // } else { - // queryData.put("detailFlag", true);//是否明细 - // queryData.put("id", entity.getId());//字段 - // List> datas = mdmModuleDbDao.getServiceByFormmainId(queryData); - // jsonObject.put(mdmModuleDbEntityList.get(i).getDbName(), datas); - // } - // } - // if (tablename != null && !"".equals(tablename)) { - // Map queryData = new HashMap<>(); - // queryData.put("tableName", tablename);//表名 - // queryData.put("id", entity.getId());//字段 - // List> datas = mdmModuleDbDao.getServiceByDistributeId(queryData); - // jsonObject.put(tablename, datas); - // } + /** + * @param object + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 主数据详情数据 区分类型 新增、修改、查看 + * @Date 9:40 上午 2023/10/18 + **/ + @Override + public JsonResultEntity queryMdmShowDetailsData(JSONObject object) { + MdmDto entity = getData("jsonStr", object, MdmDto.class); + if (entity == null) { + return BaseResult.getFailureMessageEntity("参数不允许为空"); + } + if (entity.getMdmCode() == null || "".equals(entity.getMdmCode())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + if (entity.getId() == null || "".equals(entity.getId())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + //查询模版 + + MdmModuleEntity mdmModuleEntity = mdmServiceCache.getMdmModuleEntity(entity.getMdmCode()); + if (mdmModuleEntity == null ) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + //查询数据源主表 + MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); + mdmModuleDbEntity.setMdmId(mdmModuleEntity.getId()); + mdmModuleDbEntity.setSts("Y"); + List mdmModuleDbEntityList = mdmServiceCache.queryMdmModuleDb(mdmModuleDbEntity); + if (mdmModuleDbEntityList == null || mdmModuleDbEntityList.size() == 0) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + String tablename = null; + JSONObject jsonObject = new JSONObject(); + for (int i = 0; i < mdmModuleDbEntityList.size(); i++) { + //查询数据 + Map queryData = new HashMap<>(); + queryData.put("tableName", mdmModuleDbEntityList.get(i).getDbName());//表名 + if ("1".equals(mdmModuleDbEntityList.get(i).getDbType())) { + queryData.put("detailFlag", false);//是否明细 + queryData.put("id", entity.getId());//字段 + HashMap datas = mdmModuleDbDao.getServiceDataById(queryData); + jsonObject.put(mdmModuleDbEntityList.get(i).getDbName(), datas); + tablename = mdmModuleDbEntityList.get(i).getDbName() + "_distribute"; + } else { + queryData.put("detailFlag", true);//是否明细 + queryData.put("id", entity.getId());//字段 + List> datas = mdmModuleDbDao.getServiceByFormmainId(queryData); + jsonObject.put(mdmModuleDbEntityList.get(i).getDbName(), datas); + } + } + if (tablename != null && !"".equals(tablename)) { + Map queryData = new HashMap<>(); + queryData.put("tableName", tablename);//表名 + queryData.put("id", entity.getId());//字段 + List> datas = mdmModuleDbDao.getServiceByDistributeId(queryData); + jsonObject.put(tablename, datas); + } + + + return BaseResult.getSuccessMessageEntity("获取数据成功", jsonObject); + } + /** + * @param object + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 主数据详情数据修改 + * @Date 9:40 上午 2023/10/18 + **/ + @Override + public JsonResultEntity updateMdmShowDetailsData(JSONObject object) { + JSONObject jsonObject = getstrObj("jsonStr", object); + //校验是否有servecr传参 + if (!checkData(jsonObject, "mdmCode")) { + return BaseResult.getFailureMessageEntity("请先传递服务名"); + } + if (!checkData(jsonObject, "data")) { + return BaseResult.getFailureMessageEntity("请先传递要修改的数据"); + } + JSONObject saveData = jsonObject.getJSONObject("data"); + //校验唯一 + MdmModuleEntity mdmModuleEntity = new MdmModuleEntity(); + mdmModuleEntity.setMdmCode(jsonObject.getLong("mdmCode")); + mdmModuleEntity.setSts("Y"); + List mdmModuleEntities = mdmModuleDao.queryBase(mdmModuleEntity); + if (mdmModuleEntities == null || mdmModuleEntities.size() != 1) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + mdmModuleEntity = mdmModuleEntities.get(0); + MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); + mdmModuleDbEntity.setMdmId(mdmModuleEntity.getId()); + mdmModuleDbEntity.setSts("Y"); + List mdmModuleDbEntityList = mdmModuleDbDao.queryBase(mdmModuleDbEntity); + if (mdmModuleDbEntityList == null || mdmModuleDbEntityList.size() == 0) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + String res = checkDataOnly(jsonObject.getInteger("mdmCode"), saveData, true, mdmModuleEntity, mdmModuleDbEntityList); + + if (res == null || "".equals(res)) { + return BaseResult.getSuccessMessageEntity("修改数据成功"); + } else { + return BaseResult.getFailureMessageEntity(res); + } + } + + + /** + * @param object + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 主数据详情数据新增 + * @Date 9:40 上午 2023/10/18 + **/ + @Override + public JsonResultEntity saveMdmShowDetailsData(JSONObject object) { + JSONObject jsonObject = getstrObj("jsonStr", object); + //校验是否有servecr传参 + if (!checkData(jsonObject, "mdmCode")) { + return BaseResult.getFailureMessageEntity("请先传递服务名"); + } + if (!checkData(jsonObject, "data")) { + return BaseResult.getFailureMessageEntity("请先传递要修改的数据"); + } + JSONObject saveData = jsonObject.getJSONObject("data"); + //校验唯一 + MdmModuleEntity mdmModuleEntity = new MdmModuleEntity(); + mdmModuleEntity.setMdmCode(jsonObject.getLong("mdmCode")); + mdmModuleEntity.setSts("Y"); + List mdmModuleEntities = mdmModuleDao.queryBase(mdmModuleEntity); + if (mdmModuleEntities == null || mdmModuleEntities.size() != 1) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + mdmModuleEntity = mdmModuleEntities.get(0); + MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); + mdmModuleDbEntity.setMdmId(mdmModuleEntity.getId()); + mdmModuleDbEntity.setSts("Y"); + List mdmModuleDbEntityList = mdmModuleDbDao.queryBase(mdmModuleDbEntity); + if (mdmModuleDbEntityList == null || mdmModuleDbEntityList.size() == 0) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + String res = checkDataOnly(jsonObject.getInteger("mdmCode"), saveData, false, mdmModuleEntity, mdmModuleDbEntityList); + + if (res == null || "".equals(res)) { + return BaseResult.getSuccessMessageEntity("保存数据成功"); + } else { + return BaseResult.getFailureMessageEntity(res); + } + } // // - // return BaseResult.getSuccessMessageEntity("获取数据成功", jsonObject); - //} - // - // - ///** - // * @param object - // * @return com.hzya.frame.web.entity.JsonResultEntity - // * @Author lvleigang - // * @Description 主数据详情数据修改 - // * @Date 9:40 上午 2023/10/18 - // **/ - //@Override - //public JsonResultEntity updateMdmShowDetailsData(JSONObject object) { - // JSONObject jsonObject = getstrObj("jsonStr", object); - // //校验是否有servecr传参 - // if (!checkData(jsonObject, "mdmCode")) { - // return BaseResult.getFailureMessageEntity("请先传递服务名"); - // } - // if (!checkData(jsonObject, "data")) { - // return BaseResult.getFailureMessageEntity("请先传递要修改的数据"); - // } - // JSONObject saveData = jsonObject.getJSONObject("data"); - // //校验唯一 - // MdmModuleEntity mdmModuleEntity = new MdmModuleEntity(); - // mdmModuleEntity.setMdmCode(jsonObject.getInteger("mdmCode")); - // mdmModuleEntity.setSts("Y"); - // List mdmModuleEntities = mdmModuleDao.queryBase(mdmModuleEntity); - // if (mdmModuleEntities == null || mdmModuleEntities.size() != 1) { - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // mdmModuleEntity = mdmModuleEntities.get(0); - // MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); - // mdmModuleDbEntity.setMdmId(mdmModuleEntity.getId()); - // mdmModuleDbEntity.setSts("Y"); - // List mdmModuleDbEntityList = mdmModuleDbDao.queryBase(mdmModuleDbEntity); - // if (mdmModuleDbEntityList == null || mdmModuleDbEntityList.size() == 0) { - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // String res = checkDataOnly(jsonObject.getInteger("mdmCode"), saveData, true, mdmModuleEntity, mdmModuleDbEntityList); - // - // if (res == null || "".equals(res)) { - // return BaseResult.getSuccessMessageEntity("修改数据成功"); - // } else { - // return BaseResult.getFailureMessageEntity(res); - // } - //} - // - // - ///** - // * @param object - // * @return com.hzya.frame.web.entity.JsonResultEntity - // * @Author lvleigang - // * @Description 主数据详情数据新增 - // * @Date 9:40 上午 2023/10/18 - // **/ - //@Override - //public JsonResultEntity saveMdmShowDetailsData(JSONObject object) { - // JSONObject jsonObject = getstrObj("jsonStr", object); - // //校验是否有servecr传参 - // if (!checkData(jsonObject, "mdmCode")) { - // return BaseResult.getFailureMessageEntity("请先传递服务名"); - // } - // if (!checkData(jsonObject, "data")) { - // return BaseResult.getFailureMessageEntity("请先传递要修改的数据"); - // } - // JSONObject saveData = jsonObject.getJSONObject("data"); - // //校验唯一 - // MdmModuleEntity mdmModuleEntity = new MdmModuleEntity(); - // mdmModuleEntity.setMdmCode(jsonObject.getInteger("mdmCode")); - // mdmModuleEntity.setSts("Y"); - // List mdmModuleEntities = mdmModuleDao.queryBase(mdmModuleEntity); - // if (mdmModuleEntities == null || mdmModuleEntities.size() != 1) { - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // mdmModuleEntity = mdmModuleEntities.get(0); - // MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); - // mdmModuleDbEntity.setMdmId(mdmModuleEntity.getId()); - // mdmModuleDbEntity.setSts("Y"); - // List mdmModuleDbEntityList = mdmModuleDbDao.queryBase(mdmModuleDbEntity); - // if (mdmModuleDbEntityList == null || mdmModuleDbEntityList.size() == 0) { - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // String res = checkDataOnly(jsonObject.getInteger("mdmCode"), saveData, false, mdmModuleEntity, mdmModuleDbEntityList); - // - // if (res == null || "".equals(res)) { - // return BaseResult.getSuccessMessageEntity("保存数据成功"); - // } else { - // return BaseResult.getFailureMessageEntity(res); - // } - //} - // - // - ///** - // * @param object - // * @return com.hzya.frame.web.entity.JsonResultEntity - // * @Author lvleigang - // * @Description 主数据详情数据修改 - // * @Date 9:40 上午 2023/10/18 - // **/ - //@Override - //public JsonResultEntity deleteMdmShowDetailsData(JSONObject object) { - // JSONObject jsonObject = getstrObj("jsonStr", object); - // //校验是否有servecr传参 - // if (!checkData(jsonObject, "mdmCode")) { - // return BaseResult.getFailureMessageEntity("请先传递服务名"); - // } - // if (!checkData(jsonObject, "id")) { - // return BaseResult.getFailureMessageEntity("请先传递要删除的数据"); - // } - // //校验唯一 - // MdmModuleEntity mdmModuleEntity = new MdmModuleEntity(); - // mdmModuleEntity.setMdmCode(jsonObject.getInteger("mdmCode")); - // mdmModuleEntity.setSts("Y"); - // List mdmModuleEntities = mdmModuleDao.queryBase(mdmModuleEntity); - // if (mdmModuleEntities == null || mdmModuleEntities.size() != 1) { - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // mdmModuleEntity = mdmModuleEntities.get(0); - // MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); - // mdmModuleDbEntity.setMdmId(mdmModuleEntity.getId()); - // mdmModuleDbEntity.setSts("Y"); - // List mdmModuleDbEntityList = mdmModuleDbDao.queryBase(mdmModuleDbEntity); - // if (mdmModuleDbEntityList == null || mdmModuleDbEntityList.size() == 0) { - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // for (int i = 0; i < mdmModuleDbEntityList.size(); i++) { - // if ("1".equals(mdmModuleDbEntityList.get(i).getDbType())) { - // - // //查询视图,如果树形,删除下级及子集 - // //查询展示类型 - // MdmModuleViewEntity mdmModuleViewEntity = new MdmModuleViewEntity(); - // mdmModuleViewEntity.setMdmId(mdmModuleEntity.getId()); - // mdmModuleViewEntity.setSts("Y"); - // List moduleViewEntityList = mdmModuleViewDao.queryBase(mdmModuleViewEntity); - // if (moduleViewEntityList == null || moduleViewEntityList.size() != 1) { - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // mdmModuleViewEntity = moduleViewEntityList.get(0); - // - // - // //删除自己 - // FormmainDeleteDto formmainDeleteDto = new FormmainDeleteDto(); - // formmainDeleteDto.setId(jsonObject.getString("id")); - // formmainDeleteDto.setLoginId(StpUtil.getLoginIdAsString()); - // formmainDeleteDto.setTableName(mdmModuleDbEntityList.get(i).getDbName()); - // if (mdmModuleViewEntity != null && mdmModuleViewEntity.getViewName() != null && "1".equals(mdmModuleViewEntity.getViewName()) && - // mdmModuleViewEntity.getUpIdFiled() != null && !"".equals(mdmModuleViewEntity.getUpIdFiled())) { - // formmainDeleteDto.setUpIdFiled(mdmModuleViewEntity.getUpIdFiled()); - // - // Map queryData = new HashMap<>(); - // queryData.put("tableName", mdmModuleDbEntityList.get(i).getDbName());//表名 - // queryData.put("detailFlag", false);//是否明细 - // queryData.put("id", jsonObject.getString("id"));//字段 - // HashMap datas = mdmModuleDbDao.getServiceDataById(queryData); - // String upValue = null; - // if (datas != null && datas.get(mdmModuleViewEntity.getUpIdFiled()) != null) { - // upValue = datas.get(mdmModuleViewEntity.getUpIdFiled()).toString(); - // } - // if (upValue != null) { - // formmainDeleteDto.setUpIdFiledValue(upValue + "," + jsonObject.getString("id")); - // } else { - // formmainDeleteDto.setUpIdFiledValue(jsonObject.getString("id")); - // } - // mdmModuleDao.deleteChilder(formmainDeleteDto); - // } - // mdmModuleDao.deleteTemplateById(formmainDeleteDto); - // - // } else { - // //删除明细 - // FormmainDeleteDto formmainDeleteDto = new FormmainDeleteDto(); - // formmainDeleteDto.setFormmain_id(jsonObject.getString("id")); - // formmainDeleteDto.setLoginId(StpUtil.getLoginIdAsString()); - // formmainDeleteDto.setTableName(mdmModuleDbEntityList.get(i).getDbName()); - // mdmModuleDao.deleteTemplateById(formmainDeleteDto); - // } - // } - // return BaseResult.getSuccessMessageEntity("删除数据成功"); - //} + /** + * @param object + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 主数据详情数据修改 + * @Date 9:40 上午 2023/10/18 + **/ + @Override + public JsonResultEntity deleteMdmShowDetailsData(JSONObject object) { + JSONObject jsonObject = getstrObj("jsonStr", object); + //校验是否有servecr传参 + if (!checkData(jsonObject, "mdmCode")) { + return BaseResult.getFailureMessageEntity("请先传递服务名"); + } + if (!checkData(jsonObject, "id")) { + return BaseResult.getFailureMessageEntity("请先传递要删除的数据"); + } + //校验唯一 + MdmModuleEntity mdmModuleEntity = mdmServiceCache.getMdmModuleEntity(jsonObject.getLong("mdmCode")); + if (mdmModuleEntity == null ) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); + mdmModuleDbEntity.setMdmId(mdmModuleEntity.getId()); + mdmModuleDbEntity.setSts("Y"); + List mdmModuleDbEntityList = mdmServiceCache.queryMdmModuleDb(mdmModuleDbEntity); + if (mdmModuleDbEntityList == null || mdmModuleDbEntityList.size() == 0) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + for (int i = 0; i < mdmModuleDbEntityList.size(); i++) { + if ("1".equals(mdmModuleDbEntityList.get(i).getDbType())) { + + //查询视图,如果树形,删除下级及子集 + //查询展示类型 + MdmModuleViewEntity mdmModuleViewEntity = new MdmModuleViewEntity(); + mdmModuleViewEntity.setMdmId(mdmModuleEntity.getId()); + mdmModuleViewEntity.setSts("Y"); + List moduleViewEntityList = mdmServiceCache.queryMdmModuleView(mdmModuleViewEntity); + if (moduleViewEntityList == null || moduleViewEntityList.size() != 1) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + mdmModuleViewEntity = moduleViewEntityList.get(0); + + + //删除自己 + FormmainDeleteDto formmainDeleteDto = new FormmainDeleteDto(); + formmainDeleteDto.setId(jsonObject.getString("id")); + formmainDeleteDto.setLoginId(StpUtil.getLoginIdAsString()); + formmainDeleteDto.setTableName(mdmModuleDbEntityList.get(i).getDbName()); + if (mdmModuleViewEntity != null && mdmModuleViewEntity.getViewName() != null && "1".equals(mdmModuleViewEntity.getViewName()) && + mdmModuleViewEntity.getUpIdFiled() != null && !"".equals(mdmModuleViewEntity.getUpIdFiled())) { + formmainDeleteDto.setUpIdFiled(mdmModuleViewEntity.getUpIdFiled()); + + Map queryData = new HashMap<>(); + queryData.put("tableName", mdmModuleDbEntityList.get(i).getDbName());//表名 + queryData.put("detailFlag", false);//是否明细 + queryData.put("id", jsonObject.getString("id"));//字段 + HashMap datas = mdmModuleDbDao.getServiceDataById(queryData); + String upValue = null; + if (datas != null && datas.get(mdmModuleViewEntity.getUpIdFiled()) != null) { + upValue = datas.get(mdmModuleViewEntity.getUpIdFiled()).toString(); + } + if (upValue != null) { + formmainDeleteDto.setUpIdFiledValue(upValue + "," + jsonObject.getString("id")); + } else { + formmainDeleteDto.setUpIdFiledValue(jsonObject.getString("id")); + } + mdmModuleDao.deleteChilder(formmainDeleteDto); + } + mdmModuleDao.deleteTemplateById(formmainDeleteDto); + + } else { + //删除明细 + FormmainDeleteDto formmainDeleteDto = new FormmainDeleteDto(); + formmainDeleteDto.setFormmain_id(jsonObject.getString("id")); + formmainDeleteDto.setLoginId(StpUtil.getLoginIdAsString()); + formmainDeleteDto.setTableName(mdmModuleDbEntityList.get(i).getDbName()); + mdmModuleDao.deleteTemplateById(formmainDeleteDto); + } + } + return BaseResult.getSuccessMessageEntity("删除数据成功"); + } // // ///** @@ -3790,267 +3877,282 @@ public class MdmServiceImpl implements IMdmService { // //} // - ///** - // * @param mdmCode - // * @param saveData - // * @param mdmModuleEntity - // * @param mdmModuleDbEntityList - // * @param flag 修改 新增 - // * @return java.lang.String - // * @Author lvleigang - // * @Description 校验数据 - // * @Date 11:20 上午 2023/11/6 - // **/ - //private String checkDataOnly(Integer mdmCode, JSONObject saveData, boolean flag, MdmModuleEntity mdmModuleEntity, List mdmModuleDbEntityList) { - // StringBuffer str = new StringBuffer(); - // - // //查询字段 - // //查询字段下的必填规则 - // MdmModuleDbFiledsEntity mdmModuleDbFiledsEntity = new MdmModuleDbFiledsEntity(); - // mdmModuleDbFiledsEntity.setMdmId(mdmModuleEntity.getId()); - // mdmModuleDbFiledsEntity.setSts("Y"); - // mdmModuleDbFiledsEntity.setRoletype("required"); - // mdmModuleDbFiledsEntity.setRoleValue("true"); - // List mdmModuleDbFiledsEntityList = mdmModuleDbFiledsDao.queryBase(mdmModuleDbFiledsEntity); - // - // if (mdmModuleDbFiledsEntityList != null && mdmModuleDbFiledsEntityList.size() > 0) { - // for (int i = 0; i < mdmModuleDbEntityList.size(); i++) { - // if ("1".equals(mdmModuleDbEntityList.get(i).getDbType())) { - // JSONObject jsonObject = saveData.getJSONObject(mdmModuleDbEntityList.get(i).getDbName()); - // for (int i1 = 0; i1 < mdmModuleDbFiledsEntityList.size(); i1++) { - // if (mdmModuleDbFiledsEntityList.get(i1).getDbId().equals(mdmModuleDbEntityList.get(i).getId())) { - // if (jsonObject.get(mdmModuleDbFiledsEntityList.get(i1).getEnName()) == null || "".equals(jsonObject.getString(mdmModuleDbFiledsEntityList.get(i1).getEnName()))) { - // if (str.toString() != null && !"".equals(str.toString())) { - // str.append(";"); - // } - // str.append(mdmModuleDbEntityList.get(i).getRemark() + "的" + mdmModuleDbFiledsEntityList.get(i1).getChName() + "不为空"); - // } - // } - // } - // } else { - // JSONArray jsonArray = saveData.getJSONArray(mdmModuleDbEntityList.get(i).getDbName()); - // if (jsonArray != null && jsonArray.size() > 0) { - // for (int i1 = 0; i1 < mdmModuleDbFiledsEntityList.size(); i1++) { - // if (mdmModuleDbFiledsEntityList.get(i1).getDbId().equals(mdmModuleDbEntityList.get(i).getId())) { - // for (int i2 = 0; i2 < jsonArray.size(); i2++) { - // JSONObject jsonObject = jsonArray.getJSONObject(i2); - // if (jsonObject.get(mdmModuleDbFiledsEntityList.get(i1).getEnName()) == null || "".equals(jsonObject.getString(mdmModuleDbFiledsEntityList.get(i1).getEnName()))) { - // if (str.toString() != null && !"".equals(str.toString())) { - // str.append(";"); - // } - // str.append(mdmModuleDbEntityList.get(i).getRemark() + "的" + mdmModuleDbFiledsEntityList.get(i1).getChName() + "不为空"); - // break; - // } - // } - // } - // } - // } - // } - // } - // } - // - // if (str == null || "".equals(str.toString())) { - // //校验数据 - // MdmModuleDbFiledsEntity onlyFiledsEntity = new MdmModuleDbFiledsEntity(); - // onlyFiledsEntity.setMdmId(mdmModuleEntity.getId()); - // onlyFiledsEntity.setSts("Y"); - // onlyFiledsEntity.setRoletype("fieldsSole"); - // onlyFiledsEntity.setRoleValue("true"); - // - // List onlyEntityList = mdmModuleDbFiledsDao.queryBase(onlyFiledsEntity); - // - // if (onlyEntityList != null && onlyEntityList.size() > 0) { - // for (int i = 0; i < mdmModuleDbEntityList.size(); i++) { - // if ("1".equals(mdmModuleDbEntityList.get(i).getDbType())) { - // JSONObject jsonObject = saveData.getJSONObject(mdmModuleDbEntityList.get(i).getDbName()); - // for (int i1 = 0; i1 < onlyEntityList.size(); i1++) { - // if (onlyEntityList.get(i1).getDbId().equals(mdmModuleDbEntityList.get(i).getId())) { - // //校验唯一 - // Map map = new HashMap<>(); - // map.put("tableName", mdmModuleDbEntityList.get(i).getDbName()); - // if (flag) { - // map.put("id", jsonObject.getString("id")); - // } - // map.put("filedName", onlyEntityList.get(i1).getEnName()); - // map.put("filedValue", jsonObject.getString(onlyEntityList.get(i1).getEnName())); - // Integer count = mdmModuleDao.checkData(map); - // if (count > 0) { - // if (str.toString() != null && !"".equals(str.toString())) { - // str.append(";"); - // } - // str.append(mdmModuleDbEntityList.get(i).getRemark() + "的" + mdmModuleDbFiledsEntityList.get(i1).getChName() + "已存在"); - // } - // } - // } - // } else { - // JSONArray jsonArray = saveData.getJSONArray(mdmModuleDbEntityList.get(i).getDbName()); - // if (jsonArray != null && jsonArray.size() > 0) { - // for (int i1 = 0; i1 < onlyEntityList.size(); i1++) { - // if (onlyEntityList.get(i1).getDbId().equals(mdmModuleDbEntityList.get(i).getId())) { - // for (int i2 = 0; i2 < jsonArray.size(); i2++) { - // JSONObject jsonObject = jsonArray.getJSONObject(i2); - // - // //校验唯一 - // Map map = new HashMap<>(); - // map.put("tableName", mdmModuleDbEntityList.get(i).getDbName()); - // if (flag) { - // map.put("id", jsonObject.getString("id")); - // } - // map.put("filedName", onlyEntityList.get(i1).getEnName()); - // map.put("filedValue", jsonObject.getString(onlyEntityList.get(i1).getEnName())); - // Integer count = mdmModuleDao.checkData(map); - // if (count > 0) { - // if (str.toString() != null && !"".equals(str.toString())) { - // str.append(";"); - // } - // str.append(mdmModuleDbEntityList.get(i).getRemark() + "的" + mdmModuleDbFiledsEntityList.get(i1).getChName() + "已存在"); - // break; - // } - // } - // } - // } - // } - // } - // } - // } - // } - // - // - // //保存数据 - // if (str == null || "".equals(str.toString())) { - // String id = UUIDUtils.getUUID(); - // for (int i = 0; i < mdmModuleDbEntityList.size(); i++) { - // if ("1".equals(mdmModuleDbEntityList.get(i).getDbType())) { - // JSONObject jsonObject = saveData.getJSONObject(mdmModuleDbEntityList.get(i).getDbName()); - // //保存数据 - // MdmDataDto mdmDataDto = new MdmDataDto(); - // mdmDataDto.setTableName(mdmModuleDbEntityList.get(i).getDbName()); - // MdmModuleDbFiledsEntity mdmModuleDbFiledsEntity1 = new MdmModuleDbFiledsEntity(); - // mdmModuleDbFiledsEntity1.setMdmId(mdmModuleEntity.getId()); - // mdmModuleDbFiledsEntity1.setDbId(mdmModuleDbEntityList.get(i).getId()); - // mdmModuleDbFiledsEntity1.setSts("Y"); - // List fileds = mdmModuleDbFiledsDao.queryBase(mdmModuleDbFiledsEntity1); - // //查询单据规则 - // MdmTableCodeRuleEntity mdmTableCodeRuleEntity = new MdmTableCodeRuleEntity(); - // mdmTableCodeRuleEntity.setMdmId(mdmModuleEntity.getId()); - // mdmTableCodeRuleEntity.setDbId(mdmModuleDbEntityList.get(i).getId()); - // mdmTableCodeRuleEntity.setSts("Y"); - // List mdmTableCodeRuleEntities = mdmTableCodeRuleDao.queryBase(mdmTableCodeRuleEntity); - // StringBuffer document_rule = new StringBuffer(); - // Integer document_rule_num = 0; - // if (mdmTableCodeRuleEntities != null && mdmTableCodeRuleEntities.size() > 0) { - // for (int i1 = 0; i1 < mdmTableCodeRuleEntities.size(); i1++) { - // //1、连接符号 2、字符串 3、日期 4、流水号 - // if ("1".equals(mdmTableCodeRuleEntities.get(i1).getDbType())) { - // document_rule.append("-"); - // } else if ("2".equals(mdmTableCodeRuleEntities.get(i1).getDbType())) { - // document_rule.append(mdmTableCodeRuleEntities.get(i1).getDbValue()); - // } else if ("3".equals(mdmTableCodeRuleEntities.get(i1).getDbType())) { - // SimpleDateFormat sdf = new SimpleDateFormat(mdmTableCodeRuleEntities.get(i1).getDbValue());//要转换的时间格式 - // String stra = sdf.format(new Date()); - // document_rule.append(stra); - // } else if ("4".equals(mdmTableCodeRuleEntities.get(i1).getDbType())) { - // document_rule_num = mdmTableCodeRuleEntities.get(i1).getDbValue().length(); - // } - // } - // } - // List mdmDataFiledDtos = new ArrayList<>(); - // for (int i1 = 0; i1 < fileds.size(); i1++) { - // if (jsonObject.get(fileds.get(i1).getEnName()) != null) { - // MdmDataFiledDto mdmDataFiledDto = new MdmDataFiledDto(); - // mdmDataFiledDto.setFiledsName(fileds.get(i1).getEnName()); - // mdmDataFiledDto.setFiledsValue(jsonObject.getString(fileds.get(i1).getEnName())); - // mdmDataFiledDtos.add(mdmDataFiledDto); - // } - // } - // MdmDataFiledDto mdmDataFiledDto = new MdmDataFiledDto(); - // mdmDataFiledDto.setFiledsName("logid"); - // mdmDataFiledDto.setFiledsValue(StpUtil.getLoginIdAsString()); - // mdmDataFiledDtos.add(mdmDataFiledDto); - // mdmDataDto.setMdmDataFiledDtos(mdmDataFiledDtos); - // if (flag) { - // mdmDataDto.setId(jsonObject.getString("id")); - // id = jsonObject.getString("id"); - // int a = mdmModuleDao.updateForm(mdmDataDto); - // } else { - // - // mdmDataDto.setDbType(mdmModuleDbEntityList.get(i).getDbType()); - // mdmDataDto.setDocumentRule(document_rule.toString()); - // mdmDataDto.setDocumentRuleNum(document_rule_num); - // MdmDataFiledDto ids = new MdmDataFiledDto(); - // ids.setFiledsName("id"); - // ids.setFiledsValue(id); - // mdmDataFiledDtos.add(ids); - // mdmDataDto.setMdmDataFiledDtos(mdmDataFiledDtos); - // int a = mdmModuleDao.saveForm(mdmDataDto); - // } - // } - // } - // - // for (int i = 0; i < mdmModuleDbEntityList.size(); i++) { - // if ("2".equals(mdmModuleDbEntityList.get(i).getDbType())) { - // //删除明细 - // FormmainDeleteDto formmainDeleteDto = new FormmainDeleteDto(); - // formmainDeleteDto.setFormmain_id(id); - // formmainDeleteDto.setLoginId(StpUtil.getLoginIdAsString()); - // formmainDeleteDto.setTableName(mdmModuleDbEntityList.get(i).getDbName()); - // mdmModuleDao.deleteTemplateById(formmainDeleteDto); - // - // JSONArray jsonArray = saveData.getJSONArray(mdmModuleDbEntityList.get(i).getDbName()); - // if (jsonArray != null && jsonArray.size() > 0) { - // MdmModuleDbFiledsEntity mdmModuleDbFiledsEntity1 = new MdmModuleDbFiledsEntity(); - // mdmModuleDbFiledsEntity1.setMdmId(mdmModuleEntity.getId()); - // mdmModuleDbFiledsEntity1.setDbId(mdmModuleDbEntityList.get(i).getId()); - // mdmModuleDbFiledsEntity1.setSts("Y"); - // List fileds = mdmModuleDbFiledsDao.queryBase(mdmModuleDbFiledsEntity1); - // - // for (int i2 = 0; i2 < jsonArray.size(); i2++) { - // JSONObject jsonObject = jsonArray.getJSONObject(i2); - // //保存数据 - // MdmDataDto mdmDataDto = new MdmDataDto(); - // 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); - // } - // 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); - // } - // } - // } - // } - // } - // } - // return str.toString(); - //} - // + /** + * @param mdmCode + * @param saveData + * @param mdmModuleEntity + * @param mdmModuleDbEntityList + * @param flag 修改 新增 + * @return java.lang.String + * @Author lvleigang + * @Description 校验数据 + * @Date 11:20 上午 2023/11/6 + **/ + private String checkDataOnly(Integer mdmCode, JSONObject saveData, boolean flag, MdmModuleEntity mdmModuleEntity, List mdmModuleDbEntityList) { + StringBuffer str = new StringBuffer(); + + //查询字段 + //查询字段下的必填规则 + MdmModuleDbFiledsEntity mdmModuleDbFiledsEntity = new MdmModuleDbFiledsEntity(); + mdmModuleDbFiledsEntity.setMdmId(mdmModuleEntity.getId()); + mdmModuleDbFiledsEntity.setSts("Y"); + mdmModuleDbFiledsEntity.setRoletype("required"); + mdmModuleDbFiledsEntity.setRoleValue("true"); + List mdmModuleDbFiledsEntityList = mdmModuleDbFiledsDao.queryBase(mdmModuleDbFiledsEntity); + + if (mdmModuleDbFiledsEntityList != null && mdmModuleDbFiledsEntityList.size() > 0) { + for (int i = 0; i < mdmModuleDbEntityList.size(); i++) { + if ("1".equals(mdmModuleDbEntityList.get(i).getDbType())) { + JSONObject jsonObject = saveData.getJSONObject(mdmModuleDbEntityList.get(i).getDbName()); + for (int i1 = 0; i1 < mdmModuleDbFiledsEntityList.size(); i1++) { + if (mdmModuleDbFiledsEntityList.get(i1).getDbId().equals(mdmModuleDbEntityList.get(i).getId())) { + if (jsonObject.get(mdmModuleDbFiledsEntityList.get(i1).getEnName()) == null || "".equals(jsonObject.getString(mdmModuleDbFiledsEntityList.get(i1).getEnName()))) { + if (str.toString() != null && !"".equals(str.toString())) { + str.append(";"); + } + str.append(mdmModuleDbEntityList.get(i).getRemark() + "的" + mdmModuleDbFiledsEntityList.get(i1).getChName() + "不为空"); + } + } + } + } else { + JSONArray jsonArray = saveData.getJSONArray(mdmModuleDbEntityList.get(i).getDbName()); + if (jsonArray != null && jsonArray.size() > 0) { + for (int i1 = 0; i1 < mdmModuleDbFiledsEntityList.size(); i1++) { + if (mdmModuleDbFiledsEntityList.get(i1).getDbId().equals(mdmModuleDbEntityList.get(i).getId())) { + for (int i2 = 0; i2 < jsonArray.size(); i2++) { + JSONObject jsonObject = jsonArray.getJSONObject(i2); + if (jsonObject.get(mdmModuleDbFiledsEntityList.get(i1).getEnName()) == null || "".equals(jsonObject.getString(mdmModuleDbFiledsEntityList.get(i1).getEnName()))) { + if (str.toString() != null && !"".equals(str.toString())) { + str.append(";"); + } + str.append(mdmModuleDbEntityList.get(i).getRemark() + "的" + mdmModuleDbFiledsEntityList.get(i1).getChName() + "不为空"); + break; + } + } + } + } + } + } + } + } + + if (str == null || "".equals(str.toString())) { + //校验数据 + MdmModuleDbFiledsEntity onlyFiledsEntity = new MdmModuleDbFiledsEntity(); + onlyFiledsEntity.setMdmId(mdmModuleEntity.getId()); + onlyFiledsEntity.setSts("Y"); + onlyFiledsEntity.setRoletype("fieldsSole"); + onlyFiledsEntity.setRoleValue("true"); + + List onlyEntityList = mdmModuleDbFiledsDao.queryBase(onlyFiledsEntity); + + if (onlyEntityList != null && onlyEntityList.size() > 0) { + for (int i = 0; i < mdmModuleDbEntityList.size(); i++) { + if ("1".equals(mdmModuleDbEntityList.get(i).getDbType())) { + JSONObject jsonObject = saveData.getJSONObject(mdmModuleDbEntityList.get(i).getDbName()); + for (int i1 = 0; i1 < onlyEntityList.size(); i1++) { + if (onlyEntityList.get(i1).getDbId().equals(mdmModuleDbEntityList.get(i).getId())) { + //校验唯一 + Map map = new HashMap<>(); + map.put("tableName", mdmModuleDbEntityList.get(i).getDbName()); + if (flag) { + map.put("id", jsonObject.getString("id")); + } + map.put("filedName", onlyEntityList.get(i1).getEnName()); + map.put("filedValue", jsonObject.getString(onlyEntityList.get(i1).getEnName())); + Integer count = mdmModuleDao.checkData(map); + if (count > 0) { + if (str.toString() != null && !"".equals(str.toString())) { + str.append(";"); + } + str.append(mdmModuleDbEntityList.get(i).getRemark() + "的" + mdmModuleDbFiledsEntityList.get(i1).getChName() + "已存在"); + } + } + } + } else { + JSONArray jsonArray = saveData.getJSONArray(mdmModuleDbEntityList.get(i).getDbName()); + if (jsonArray != null && jsonArray.size() > 0) { + for (int i1 = 0; i1 < onlyEntityList.size(); i1++) { + if (onlyEntityList.get(i1).getDbId().equals(mdmModuleDbEntityList.get(i).getId())) { + for (int i2 = 0; i2 < jsonArray.size(); i2++) { + JSONObject jsonObject = jsonArray.getJSONObject(i2); + + //校验唯一 + Map map = new HashMap<>(); + map.put("tableName", mdmModuleDbEntityList.get(i).getDbName()); + if (flag) { + map.put("id", jsonObject.getString("id")); + } + map.put("filedName", onlyEntityList.get(i1).getEnName()); + map.put("filedValue", jsonObject.getString(onlyEntityList.get(i1).getEnName())); + Integer count = mdmModuleDao.checkData(map); + if (count > 0) { + if (str.toString() != null && !"".equals(str.toString())) { + str.append(";"); + } + str.append(mdmModuleDbEntityList.get(i).getRemark() + "的" + mdmModuleDbFiledsEntityList.get(i1).getChName() + "已存在"); + break; + } + } + } + } + } + } + } + } + } + + + //保存数据 + if (str == null || "".equals(str.toString())) { + String id = UUIDUtils.getUUID(); + for (int i = 0; i < mdmModuleDbEntityList.size(); i++) { + if ("1".equals(mdmModuleDbEntityList.get(i).getDbType())) { + JSONObject jsonObject = saveData.getJSONObject(mdmModuleDbEntityList.get(i).getDbName()); + //保存数据 + MdmDataDto mdmDataDto = new MdmDataDto(); + mdmDataDto.setTableName(mdmModuleDbEntityList.get(i).getDbName()); + MdmModuleDbFiledsEntity mdmModuleDbFiledsEntity1 = new MdmModuleDbFiledsEntity(); + mdmModuleDbFiledsEntity1.setMdmId(mdmModuleEntity.getId()); + mdmModuleDbFiledsEntity1.setDbId(mdmModuleDbEntityList.get(i).getId()); + mdmModuleDbFiledsEntity1.setSts("Y"); + List fileds = mdmModuleDbFiledsDao.queryBase(mdmModuleDbFiledsEntity1); + //查询单据规则 + MdmTableCodeRuleEntity mdmTableCodeRuleEntity = new MdmTableCodeRuleEntity(); + mdmTableCodeRuleEntity.setMdmId(mdmModuleEntity.getId()); + mdmTableCodeRuleEntity.setDbId(mdmModuleDbEntityList.get(i).getId()); + mdmTableCodeRuleEntity.setSts("Y"); + List allMdmTableCodeRuleEntities = mdmServiceCache.queryMdmTableCodeRuleEntity(mdmTableCodeRuleEntity); + List mdmTableCodeRuleEntities = new ArrayList<>(); + if(allMdmTableCodeRuleEntities != null && allMdmTableCodeRuleEntities.size() > 0){ + for (int i1 = 0; i1 < allMdmTableCodeRuleEntities.size(); i1++) { + if(mdmModuleDbEntityList.get(i).getId().equals(allMdmTableCodeRuleEntities.get(i1).getDbId())){ + mdmTableCodeRuleEntities.add(allMdmTableCodeRuleEntities.get(i1)); + } + } + } + StringBuffer document_rule = new StringBuffer(); + Integer document_rule_num = 0; + if (mdmTableCodeRuleEntities != null && mdmTableCodeRuleEntities.size() > 0) { + for (int i1 = 0; i1 < mdmTableCodeRuleEntities.size(); i1++) { + //1、连接符号 2、字符串 3、日期 4、流水号 + if ("1".equals(mdmTableCodeRuleEntities.get(i1).getDbType())) { + document_rule.append("-"); + } else if ("2".equals(mdmTableCodeRuleEntities.get(i1).getDbType())) { + document_rule.append(mdmTableCodeRuleEntities.get(i1).getDbValue()); + } else if ("3".equals(mdmTableCodeRuleEntities.get(i1).getDbType())) { + SimpleDateFormat sdf = new SimpleDateFormat(mdmTableCodeRuleEntities.get(i1).getDbValue());//要转换的时间格式 + String stra = sdf.format(new Date()); + document_rule.append(stra); + } else if ("4".equals(mdmTableCodeRuleEntities.get(i1).getDbType())) { + document_rule_num = mdmTableCodeRuleEntities.get(i1).getDbValue().length(); + } + } + } + List mdmDataFiledDtos = new ArrayList<>(); + for (int i1 = 0; i1 < fileds.size(); i1++) { + if (jsonObject.get(fileds.get(i1).getEnName()) != null) { + MdmDataFiledDto mdmDataFiledDto = new MdmDataFiledDto(); + mdmDataFiledDto.setFiledsName(fileds.get(i1).getEnName()); + mdmDataFiledDto.setFiledsValue(jsonObject.getString(fileds.get(i1).getEnName())); + mdmDataFiledDtos.add(mdmDataFiledDto); + } + } + MdmDataFiledDto mdmDataFiledDto = new MdmDataFiledDto(); + mdmDataFiledDto.setFiledsName("logid"); + mdmDataFiledDto.setFiledsValue(StpUtil.getLoginIdAsString()); + mdmDataFiledDtos.add(mdmDataFiledDto); + mdmDataDto.setMdmDataFiledDtos(mdmDataFiledDtos); + if (flag) { + mdmDataDto.setId(jsonObject.getString("id")); + id = jsonObject.getString("id"); + int a = mdmModuleDao.updateForm(mdmDataDto); + } else { + + mdmDataDto.setDbType(mdmModuleDbEntityList.get(i).getDbType()); + mdmDataDto.setDocumentRule(document_rule.toString()); + mdmDataDto.setDocumentRuleNum(document_rule_num); + MdmDataFiledDto ids = new MdmDataFiledDto(); + ids.setFiledsName("id"); + ids.setFiledsValue(id); + mdmDataFiledDtos.add(ids); + mdmDataDto.setMdmDataFiledDtos(mdmDataFiledDtos); + int a = mdmModuleDao.saveForm(mdmDataDto); + } + } + } + + for (int i = 0; i < mdmModuleDbEntityList.size(); i++) { + if ("2".equals(mdmModuleDbEntityList.get(i).getDbType())) { + //删除明细 + FormmainDeleteDto formmainDeleteDto = new FormmainDeleteDto(); + formmainDeleteDto.setFormmain_id(id); + formmainDeleteDto.setLoginId(StpUtil.getLoginIdAsString()); + formmainDeleteDto.setTableName(mdmModuleDbEntityList.get(i).getDbName()); + mdmModuleDao.deleteTemplateById(formmainDeleteDto); + + JSONArray jsonArray = saveData.getJSONArray(mdmModuleDbEntityList.get(i).getDbName()); + if (jsonArray != null && jsonArray.size() > 0) { + MdmModuleDbFiledsEntity mdmModuleDbFiledsEntity1 = new MdmModuleDbFiledsEntity(); + mdmModuleDbFiledsEntity1.setMdmId(mdmModuleEntity.getId()); + mdmModuleDbFiledsEntity1.setSts("Y"); + List allfileds = mdmServiceCache.queryMdmModuleDbFileds(mdmModuleDbFiledsEntity1); + List fileds = new ArrayList<>(); + if(allfileds != null && allfileds.size() > 0){ + for (int i1 = 0; i1 < allfileds.size(); i1++) { + if(mdmModuleDbEntityList.get(i).getId().equals(allfileds.get(i1).getDbId())){ + fileds.add(allfileds.get(i1)); + } + } + } + + for (int i2 = 0; i2 < jsonArray.size(); i2++) { + JSONObject jsonObject = jsonArray.getJSONObject(i2); + //保存数据 + MdmDataDto mdmDataDto = new MdmDataDto(); + 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); + } + 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); + } + } + } + } + } + } + return str.toString(); + } + /** * @param jsonObject From 5fb8613936591d5b39c79c1ac050890d9ad43425 Mon Sep 17 00:00:00 2001 From: hecan <1718492867@qq.com> Date: Fri, 7 Jun 2024 11:26:18 +0800 Subject: [PATCH 20/80] =?UTF-8?q?=E5=88=86=E7=BB=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mdmModuleSource/dao/IMdmModuleSourceDao.java | 14 +++++++++++++- .../dao/impl/MdmModuleSourceDaoImpl.java | 13 ++++++++++++- .../entity/MdmModuleSourceEntity.xml | 9 +++++++++ 3 files changed, 34 insertions(+), 2 deletions(-) diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleSource/dao/IMdmModuleSourceDao.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleSource/dao/IMdmModuleSourceDao.java index bde093e6..cc3b08c8 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleSource/dao/IMdmModuleSourceDao.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleSource/dao/IMdmModuleSourceDao.java @@ -1,7 +1,9 @@ package com.hzya.frame.mdm.mdmModuleSource.dao; import com.hzya.frame.mdm.mdmModuleSource.entity.MdmModuleSourceEntity; -import com.hzya.frame.basedao.dao.IBaseDao; +import com.hzya.frame.basedao.dao.IBaseDao; + +import java.util.List; /** * 主数据数据来源(mdm_module_source: table)表数据库访问层 @@ -10,6 +12,16 @@ import com.hzya.frame.basedao.dao.IBaseDao; * @since 2024-06-05 11:42:56 */ public interface IMdmModuleSourceDao extends IBaseDao { + + /** + * + * @content 根据数据来源内类型是插件的应用类型做分组 + * @Param + * @Return + * @Author hecan + * @Date 2024/6/6 10:43 + * **/ + List MdmModuleSourceentityGroupByType(); } diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleSource/dao/impl/MdmModuleSourceDaoImpl.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleSource/dao/impl/MdmModuleSourceDaoImpl.java index 5be355b3..b7cc9034 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleSource/dao/impl/MdmModuleSourceDaoImpl.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleSource/dao/impl/MdmModuleSourceDaoImpl.java @@ -4,6 +4,9 @@ import com.hzya.frame.mdm.mdmModuleSource.entity.MdmModuleSourceEntity; import com.hzya.frame.mdm.mdmModuleSource.dao.IMdmModuleSourceDao; import org.springframework.stereotype.Repository; import com.hzya.frame.basedao.dao.MybatisGenericDao; + +import java.util.List; + /** * 主数据数据来源(MdmModuleSource)表数据库访问层 * @@ -12,6 +15,14 @@ import com.hzya.frame.basedao.dao.MybatisGenericDao; */ @Repository(value = "MdmModuleSourceDaoImpl") public class MdmModuleSourceDaoImpl extends MybatisGenericDao implements IMdmModuleSourceDao{ - + //根据数据来源内类型是插件的应用类型做分组 + @Override + public List MdmModuleSourceentityGroupByType() { + List list =(List) super.selectList(getSqlIdPrifx() + "MdmModuleSourceentityGroupByType", ""); + return list; + } + + + } 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 cc3bd233..d10dd02d 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 @@ -131,6 +131,15 @@ order by ${sort} ${order} + + + insert into mdm_module_source( From 011483dead28310692129f9ccdd2cb728746e66a Mon Sep 17 00:00:00 2001 From: lvleigang <957075182@qq.com> Date: Fri, 7 Jun 2024 16:57:42 +0800 Subject: [PATCH 21/80] =?UTF-8?q?=E5=B9=B3=E5=8F=B0=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=8E=B7=E5=8F=96=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../frame/webapp/entrance/service/impl/EntranceServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webapp/src/main/java/com/hzya/frame/webapp/entrance/service/impl/EntranceServiceImpl.java b/webapp/src/main/java/com/hzya/frame/webapp/entrance/service/impl/EntranceServiceImpl.java index 093550aa..86d047b0 100644 --- a/webapp/src/main/java/com/hzya/frame/webapp/entrance/service/impl/EntranceServiceImpl.java +++ b/webapp/src/main/java/com/hzya/frame/webapp/entrance/service/impl/EntranceServiceImpl.java @@ -235,7 +235,7 @@ public class EntranceServiceImpl implements IEntranceService { public Object platformInterface(ServletRequest servletRequest, ServletResponse servletResponse) throws InvocationTargetException, IllegalAccessException { HttpServletRequest request = (HttpServletRequest) servletRequest; //tailuo 要访问的Bean名称 - String service = request.getHeader("tl"); + String service = request.getHeader("yatl"); //bean方法 String serviceMethod = request.getHeader("yadj"); String body = ServletUtil.getBody(servletRequest); From 603d7331b8f4d4f70c469ad7376144aa9419548a Mon Sep 17 00:00:00 2001 From: hecan <1718492867@qq.com> Date: Tue, 11 Jun 2024 09:00:19 +0800 Subject: [PATCH 22/80] =?UTF-8?q?=E8=8E=B7=E5=8F=96=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E6=9D=A5=E6=BA=90=E6=8F=92=E4=BB=B6=E7=BC=96=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mdmModuleSource/entity/MdmModuleSourceEntity.xml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) 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 6476ebba..245446f4 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 @@ -132,12 +132,11 @@ - + select plugin_code,plugin_name,source_name,source_code + from mdm_module_source source + left join sys_application_plugin plug on plug.id=source.source_code + where source_type='1' and source.sts='Y' and plug.sts='Y' From fa81637f502d2b5ec775eeb49aabb610cb830fb1 Mon Sep 17 00:00:00 2001 From: hecan <1718492867@qq.com> Date: Tue, 11 Jun 2024 09:55:44 +0800 Subject: [PATCH 23/80] =?UTF-8?q?=E8=8E=B7=E5=8F=96=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E6=9D=A5=E6=BA=90=E6=8F=92=E4=BB=B6=E7=BC=96=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../masterData/dao/IMasterDataDao.java | 23 +++ .../dao/impl/MasterDataDaoImpl.java | 31 ++++ .../service/IMasterDataOrgsService.java | 19 +++ .../service/IMasterDataProjectService.java | 19 +++ .../impl/MasterDataOrgsServiceImpl.java | 138 ++++++++++++++++++ .../impl/MasterDataProjectServiceImpl.java | 132 +++++++++++++++++ 6 files changed, 362 insertions(+) create mode 100644 service/src/main/java/com/hzya/frame/sysnew/comparison/masterData/dao/IMasterDataDao.java create mode 100644 service/src/main/java/com/hzya/frame/sysnew/comparison/masterData/dao/impl/MasterDataDaoImpl.java create mode 100644 service/src/main/java/com/hzya/frame/sysnew/comparison/masterData/service/IMasterDataOrgsService.java create mode 100644 service/src/main/java/com/hzya/frame/sysnew/comparison/masterData/service/IMasterDataProjectService.java create mode 100644 service/src/main/java/com/hzya/frame/sysnew/comparison/masterData/service/impl/MasterDataOrgsServiceImpl.java create 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/dao/IMasterDataDao.java b/service/src/main/java/com/hzya/frame/sysnew/comparison/masterData/dao/IMasterDataDao.java new file mode 100644 index 00000000..8fb8ce73 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/sysnew/comparison/masterData/dao/IMasterDataDao.java @@ -0,0 +1,23 @@ +package com.hzya.frame.sysnew.comparison.masterData.dao; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.hzya.frame.basedao.service.IBaseService; +import com.hzya.frame.sysnew.comparison.entity.ComparisonEntity; + +import java.util.HashMap; +import java.util.List; + +public interface IMasterDataDao extends IBaseService { + + + /** + * + * @content 查询U8C档案 + * @Param + * @Return + * @Author hecan + * @Date 2024/6/6 11:56 + * **/ + @DS("swu8c") + List> queryArchives(String str); +} diff --git a/service/src/main/java/com/hzya/frame/sysnew/comparison/masterData/dao/impl/MasterDataDaoImpl.java b/service/src/main/java/com/hzya/frame/sysnew/comparison/masterData/dao/impl/MasterDataDaoImpl.java new file mode 100644 index 00000000..ad9f3588 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/sysnew/comparison/masterData/dao/impl/MasterDataDaoImpl.java @@ -0,0 +1,31 @@ +package com.hzya.frame.sysnew.comparison.masterData.dao.impl; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.hzya.frame.basedao.service.impl.BaseService; +import com.hzya.frame.execsql.service.IExecSqlService; +import com.hzya.frame.sysnew.comparison.entity.ComparisonEntity; +import com.hzya.frame.sysnew.comparison.masterData.dao.IMasterDataDao; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Repository; + +import java.util.HashMap; +import java.util.List; + +@Repository(value = "masterDataDaoImpl") +public class MasterDataDaoImpl extends BaseService implements IMasterDataDao { + + @Autowired + private IExecSqlService execSqlService; + + @DS("swu8c") + @Override + public List> queryArchives(String str) { + try { + List> hashMaps = execSqlService.execSelectSql(str, ""); + return hashMaps; + }catch (Exception e){ + logger.info("U8C主数据档案用户档案没有需要同步中台的数据"); + return null; + } + } +} 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 new file mode 100644 index 00000000..1e08f408 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/sysnew/comparison/masterData/service/IMasterDataOrgsService.java @@ -0,0 +1,19 @@ +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 new file mode 100644 index 00000000..6b6799c1 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/sysnew/comparison/masterData/service/IMasterDataProjectService.java @@ -0,0 +1,19 @@ +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/MasterDataOrgsServiceImpl.java b/service/src/main/java/com/hzya/frame/sysnew/comparison/masterData/service/impl/MasterDataOrgsServiceImpl.java new file mode 100644 index 00000000..c6fe35a5 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/sysnew/comparison/masterData/service/impl/MasterDataOrgsServiceImpl.java @@ -0,0 +1,138 @@ +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("sourceName",mdmModuleSourceEntity.getSourceName()); + jsonObjectUser.put("code",mdmModuleSourceEntity.getSourceCode()); + 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("sourceName",mdmModuleSourceEntity.getSourceName()); + jsonObjectUser.put("code",mdmModuleSourceEntity.getSourceCode()); + 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 new file mode 100644 index 00000000..a0f39bd0 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/sysnew/comparison/masterData/service/impl/MasterDataProjectServiceImpl.java @@ -0,0 +1,132 @@ +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("sourceName",mdmModuleSourceEntity.getSourceName()); + jsonObjectUser.put("code",mdmModuleSourceEntity.getSourceCode()); + 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("sourceName",mdmModuleSourceEntity.getSourceName()); + jsonObjectUser.put("code",mdmModuleSourceEntity.getSourceCode()); + jsonObjectUser.put("optionName", "数智中台"); + jsonStr.put("jsonStr", jsonObjectUser); + try { + comparisonServiceimpl.updateEntity(jsonStr); + } catch (Exception e) { + logger.info("U8C主数据档案更新用户档案失败,失败原因:{}", e.getMessage()); + } + } + } + } + return null; + } + +} From 64f8a58ff81c675b071bb5e98d10934168b16e6a Mon Sep 17 00:00:00 2001 From: hecan <1718492867@qq.com> Date: Tue, 11 Jun 2024 09:56:18 +0800 Subject: [PATCH 24/80] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E6=A1=A3=E6=A1=88?= =?UTF-8?q?=E5=92=8C=E7=BB=84=E7=BB=87=E6=A1=A3=E6=A1=88=E6=8F=92=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../plugin/masterData/org/dao/IMdmOrgDao.java | 15 + .../org/dao/impl/MdmOrgDaoImpl.java | 16 + .../masterData/org/entity/MdmOrgEntity.java | 196 +++++++++ .../masterData/org/entity/MdmOrgEntity.xml | 388 ++++++++++++++++++ .../org/plugin/MdmOrgPluginInitializer.java | 62 +++ .../org/service/IMdmOrgService.java | 12 + .../org/service/impl/MdmOrgServiceImpl.java | 25 ++ .../project/dao/IMdmProjectDao.java | 15 + .../project/dao/impl/MdmProjectDaoImpl.java | 16 + .../project/entity/MdmProjectEntity.java | 186 +++++++++ .../project/entity/MdmProjectEntity.xml | 377 +++++++++++++++++ .../plugin/MdmProjectPluginInitializer.java | 64 +++ .../project/service/IMdmProjectService.java | 12 + .../service/impl/MdmProjectServiceImpl.java | 25 ++ 14 files changed, 1409 insertions(+) create mode 100644 buildpackage/src/main/java/com/hzya/frame/plugin/masterData/org/dao/IMdmOrgDao.java create mode 100644 buildpackage/src/main/java/com/hzya/frame/plugin/masterData/org/dao/impl/MdmOrgDaoImpl.java create mode 100644 buildpackage/src/main/java/com/hzya/frame/plugin/masterData/org/entity/MdmOrgEntity.java create mode 100644 buildpackage/src/main/java/com/hzya/frame/plugin/masterData/org/entity/MdmOrgEntity.xml create mode 100644 buildpackage/src/main/java/com/hzya/frame/plugin/masterData/org/plugin/MdmOrgPluginInitializer.java create mode 100644 buildpackage/src/main/java/com/hzya/frame/plugin/masterData/org/service/IMdmOrgService.java create mode 100644 buildpackage/src/main/java/com/hzya/frame/plugin/masterData/org/service/impl/MdmOrgServiceImpl.java create mode 100644 buildpackage/src/main/java/com/hzya/frame/plugin/masterData/project/dao/IMdmProjectDao.java create mode 100644 buildpackage/src/main/java/com/hzya/frame/plugin/masterData/project/dao/impl/MdmProjectDaoImpl.java create mode 100644 buildpackage/src/main/java/com/hzya/frame/plugin/masterData/project/entity/MdmProjectEntity.java create mode 100644 buildpackage/src/main/java/com/hzya/frame/plugin/masterData/project/entity/MdmProjectEntity.xml create mode 100644 buildpackage/src/main/java/com/hzya/frame/plugin/masterData/project/plugin/MdmProjectPluginInitializer.java create mode 100644 buildpackage/src/main/java/com/hzya/frame/plugin/masterData/project/service/IMdmProjectService.java create mode 100644 buildpackage/src/main/java/com/hzya/frame/plugin/masterData/project/service/impl/MdmProjectServiceImpl.java diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/org/dao/IMdmOrgDao.java b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/org/dao/IMdmOrgDao.java new file mode 100644 index 00000000..7f9d06c5 --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/org/dao/IMdmOrgDao.java @@ -0,0 +1,15 @@ +package masterData.dao; + +import masterData.entity.MdmOrgEntity; +import com.hzya.frame.basedao.dao.IBaseDao; + +/** + * 组织档案(mdm_org: table)表数据库访问层 + * + * @author makejava + * @since 2024-06-07 18:30:04 + */ +public interface IMdmOrgDao extends IBaseDao { + +} + diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/org/dao/impl/MdmOrgDaoImpl.java b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/org/dao/impl/MdmOrgDaoImpl.java new file mode 100644 index 00000000..3648d6b9 --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/org/dao/impl/MdmOrgDaoImpl.java @@ -0,0 +1,16 @@ +package masterData.dao.impl; + +import masterData.entity.MdmOrgEntity; +import masterData.dao.IMdmOrgDao; +import org.springframework.stereotype.Repository; +import com.hzya.frame.basedao.dao.MybatisGenericDao; +/** + * 组织档案(MdmOrg)表数据库访问层 + * + * @author makejava + * @since 2024-06-07 18:30:04 + */ +public class MdmOrgDaoImpl extends MybatisGenericDao implements IMdmOrgDao{ + +} + diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/org/entity/MdmOrgEntity.java b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/org/entity/MdmOrgEntity.java new file mode 100644 index 00000000..8d502635 --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/org/entity/MdmOrgEntity.java @@ -0,0 +1,196 @@ +package masterData.entity; + +import java.util.Date; +import com.hzya.frame.web.entity.BaseEntity; +/** + * 组织档案(MdmOrg)实体类 + * + * @author makejava + * @since 2024-06-07 18:30:04 + */ +public class MdmOrgEntity extends BaseEntity { + + /** 单据规则 */ + private String documentRule; + /** 单据规则流水号 */ + private Long documentRuleNum; + /** 组织编码 */ + private String orgCode; + /** 组织名称 */ + private String orgName; + /** 地址 */ + private String orgAddress; + /** 国家地区 */ + private String orgCountryzone; + /** 内部编码 */ + private String orgInnercode; + /** 说明 */ + private String orgMemo; + /** 助记码 */ + private String orgMnecode; + /** 所属行业 */ + private String orgNcindustry; + /** 上级业务单元 */ + private String orgFatherorg; + /** 负责人 */ + private String orgPrincipal; + /** 电话 */ + private String orgTel; + /** 数据状态 Y正常 N删除 F修改 */ + private String dataStatus; + /** 新增数据状态 0待下发 1已下发 */ + private String addStatus; + /** 修改数据状态 0待下发 1已下发 */ + private String updateStatus; + /** 删除数据状态 0待下发 1已下发 */ + private String deleteStatus; + /** 公司id */ + private String companyId; + + + public String getDocumentRule() { + return documentRule; + } + + public void setDocumentRule(String documentRule) { + this.documentRule = documentRule; + } + + public Long getDocumentRuleNum() { + return documentRuleNum; + } + + public void setDocumentRuleNum(Long documentRuleNum) { + this.documentRuleNum = documentRuleNum; + } + + public String getOrgCode() { + return orgCode; + } + + public void setOrgCode(String orgCode) { + this.orgCode = orgCode; + } + + public String getOrgName() { + return orgName; + } + + public void setOrgName(String orgName) { + this.orgName = orgName; + } + + public String getOrgAddress() { + return orgAddress; + } + + public void setOrgAddress(String orgAddress) { + this.orgAddress = orgAddress; + } + + public String getOrgCountryzone() { + return orgCountryzone; + } + + public void setOrgCountryzone(String orgCountryzone) { + this.orgCountryzone = orgCountryzone; + } + + public String getOrgInnercode() { + return orgInnercode; + } + + public void setOrgInnercode(String orgInnercode) { + this.orgInnercode = orgInnercode; + } + + public String getOrgMemo() { + return orgMemo; + } + + public void setOrgMemo(String orgMemo) { + this.orgMemo = orgMemo; + } + + public String getOrgMnecode() { + return orgMnecode; + } + + public void setOrgMnecode(String orgMnecode) { + this.orgMnecode = orgMnecode; + } + + public String getOrgNcindustry() { + return orgNcindustry; + } + + public void setOrgNcindustry(String orgNcindustry) { + this.orgNcindustry = orgNcindustry; + } + + public String getOrgFatherorg() { + return orgFatherorg; + } + + public void setOrgFatherorg(String orgFatherorg) { + this.orgFatherorg = orgFatherorg; + } + + public String getOrgPrincipal() { + return orgPrincipal; + } + + public void setOrgPrincipal(String orgPrincipal) { + this.orgPrincipal = orgPrincipal; + } + + public String getOrgTel() { + return orgTel; + } + + public void setOrgTel(String orgTel) { + this.orgTel = orgTel; + } + + public String getDataStatus() { + return dataStatus; + } + + public void setDataStatus(String dataStatus) { + this.dataStatus = dataStatus; + } + + public String getAddStatus() { + return addStatus; + } + + public void setAddStatus(String addStatus) { + this.addStatus = addStatus; + } + + public String getUpdateStatus() { + return updateStatus; + } + + public void setUpdateStatus(String updateStatus) { + this.updateStatus = updateStatus; + } + + public String getDeleteStatus() { + return deleteStatus; + } + + public void setDeleteStatus(String deleteStatus) { + this.deleteStatus = deleteStatus; + } + + public String getCompanyId() { + return companyId; + } + + public void setCompanyId(String companyId) { + this.companyId = companyId; + } + +} + diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/org/entity/MdmOrgEntity.xml b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/org/entity/MdmOrgEntity.xml new file mode 100644 index 00000000..c14c6a01 --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/org/entity/MdmOrgEntity.xml @@ -0,0 +1,388 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + id + ,document_rule + ,document_rule_num + ,org_code + ,org_name + ,org_address + ,org_countryzone + ,org_innercode + ,org_memo + ,org_mnecode + ,org_ncindustry + ,org_fatherorg + ,org_principal + ,org_tel + ,data_status + ,add_status + ,update_status + ,delete_status + ,sorts + ,create_user_id + ,create_time + ,modify_user_id + ,modify_time + ,sts + ,org_id + ,company_id + + + + + + + + + + + + + + + + insert into mdm_org( + + id , + document_rule , + document_rule_num , + org_code , + org_name , + org_address , + org_countryzone , + org_innercode , + org_memo , + org_mnecode , + org_ncindustry , + org_fatherorg , + org_principal , + org_tel , + data_status , + add_status , + update_status , + delete_status , + sorts , + create_user_id , + create_time , + modify_user_id , + modify_time , + sts , + org_id , + company_id , + sorts, + sts, + + )values( + + #{id} , + #{documentRule} , + #{documentRuleNum} , + #{orgCode} , + #{orgName} , + #{orgAddress} , + #{orgCountryzone} , + #{orgInnercode} , + #{orgMemo} , + #{orgMnecode} , + #{orgNcindustry} , + #{orgFatherorg} , + #{orgPrincipal} , + #{orgTel} , + #{dataStatus} , + #{addStatus} , + #{updateStatus} , + #{deleteStatus} , + #{sorts} , + #{create_user_id} , + #{create_time} , + #{modify_user_id} , + #{modify_time} , + #{sts} , + #{org_id} , + #{companyId} , + (select (max(IFNULL( a.sorts, 0 )) + 1) as sort from mdm_org a WHERE a.sts = 'Y' ), + 'Y', + + ) + + + + insert into mdm_org(document_rule, document_rule_num, org_code, org_name, org_address, org_countryzone, org_innercode, org_memo, org_mnecode, org_ncindustry, org_fatherorg, org_principal, org_tel, data_status, add_status, update_status, delete_status, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, sts) + values + + (#{entity.documentRule},#{entity.documentRuleNum},#{entity.orgCode},#{entity.orgName},#{entity.orgAddress},#{entity.orgCountryzone},#{entity.orgInnercode},#{entity.orgMemo},#{entity.orgMnecode},#{entity.orgNcindustry},#{entity.orgFatherorg},#{entity.orgPrincipal},#{entity.orgTel},#{entity.dataStatus},#{entity.addStatus},#{entity.updateStatus},#{entity.deleteStatus},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId}, 'Y') + + + + + insert into mdm_org(document_rule, document_rule_num, org_code, org_name, org_address, org_countryzone, org_innercode, org_memo, org_mnecode, org_ncindustry, org_fatherorg, org_principal, org_tel, data_status, add_status, update_status, delete_status, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id) + values + + (#{entity.documentRule},#{entity.documentRuleNum},#{entity.orgCode},#{entity.orgName},#{entity.orgAddress},#{entity.orgCountryzone},#{entity.orgInnercode},#{entity.orgMemo},#{entity.orgMnecode},#{entity.orgNcindustry},#{entity.orgFatherorg},#{entity.orgPrincipal},#{entity.orgTel},#{entity.dataStatus},#{entity.addStatus},#{entity.updateStatus},#{entity.deleteStatus},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId}) + + on duplicate key update + document_rule = values(document_rule), + document_rule_num = values(document_rule_num), + org_code = values(org_code), + org_name = values(org_name), + org_address = values(org_address), + org_countryzone = values(org_countryzone), + org_innercode = values(org_innercode), + org_memo = values(org_memo), + org_mnecode = values(org_mnecode), + org_ncindustry = values(org_ncindustry), + org_fatherorg = values(org_fatherorg), + org_principal = values(org_principal), + org_tel = values(org_tel), + data_status = values(data_status), + add_status = values(add_status), + update_status = values(update_status), + delete_status = values(delete_status), + create_user_id = values(create_user_id), + create_time = values(create_time), + modify_user_id = values(modify_user_id), + modify_time = values(modify_time), + sts = values(sts), + org_id = values(org_id), + company_id = values(company_id) + + +update mdm_org set + + document_rule = #{documentRule}, + document_rule_num = #{documentRuleNum}, + org_code = #{orgCode}, + org_name = #{orgName}, + org_address = #{orgAddress}, + org_countryzone = #{orgCountryzone}, + org_innercode = #{orgInnercode}, + org_memo = #{orgMemo}, + org_mnecode = #{orgMnecode}, + org_ncindustry = #{orgNcindustry}, + org_fatherorg = #{orgFatherorg}, + org_principal = #{orgPrincipal}, + org_tel = #{orgTel}, + data_status = #{dataStatus}, + add_status = #{addStatus}, + update_status = #{updateStatus}, + delete_status = #{deleteStatus}, + create_user_id = #{create_user_id}, + create_time = #{create_time}, + modify_user_id = #{modify_user_id}, + modify_time = #{modify_time}, + sts = #{sts}, + org_id = #{org_id}, + company_id = #{companyId}, + +where id = #{id} + + + +update mdm_org set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} +where id = #{id} + + + +update mdm_org set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} + + and id = #{id} + and document_rule = #{documentRule} + and document_rule_num = #{documentRuleNum} + and org_code = #{orgCode} + and org_name = #{orgName} + and org_address = #{orgAddress} + and org_countryzone = #{orgCountryzone} + and org_innercode = #{orgInnercode} + and org_memo = #{orgMemo} + and org_mnecode = #{orgMnecode} + and org_ncindustry = #{orgNcindustry} + and org_fatherorg = #{orgFatherorg} + and org_principal = #{orgPrincipal} + and org_tel = #{orgTel} + and data_status = #{dataStatus} + and add_status = #{addStatus} + and update_status = #{updateStatus} + and delete_status = #{deleteStatus} + and sorts = #{sorts} + and sts = #{sts} + and company_id = #{companyId} + and sts='Y' + + + + + delete from mdm_org where id = #{id} + + + + diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/org/plugin/MdmOrgPluginInitializer.java b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/org/plugin/MdmOrgPluginInitializer.java new file mode 100644 index 00000000..f4e7c8f6 --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/org/plugin/MdmOrgPluginInitializer.java @@ -0,0 +1,62 @@ +package com.hzya.frame.plugin.masterData.org.plugin; + +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.base.PluginBaseEntity; +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; + +/** + * 组织档案(MdmOrg)表服务接口 + * + * @author makejava + * @since 2024-06-07 18:30:05 + */ +public class MdmOrgPluginInitializer extends PluginBaseEntity{ + Logger logger = LoggerFactory.getLogger(MdmOrgPluginInitializer.class); + @Autowired + private MasterDataOrgsServiceImpl masterDataOrgsService; + + @Override + public void initialize() { + logger.info(getPluginLabel() + "執行初始化方法initialize()"); + } + + @Override + public void destroy() { + logger.info(getPluginLabel() + "執行銷毀方法destroy()"); + } + + @Override + public String getPluginId() { + return "MdmOrgPlugin"; + } + + @Override + public String getPluginName() { + return "MdmOrgPlugin插件"; + } + + @Override + public String getPluginLabel() { + return "MdmOrgPlugin"; + } + + @Override + public String getPluginType() { + return "1"; + } + @Override + public JsonResultEntity executeBusiness(JSONObject requestJson) { + try { + logger.info("======开始执行主数据档案组织档案同步========"); + return masterDataOrgsService.queryOrgsArchives(requestJson); + }catch (Exception e){ + logger.info("======执行主数据档案组织档案同步失败:{}========",e.getMessage()); + e.printStackTrace(); + } + return null; + } +} diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/org/service/IMdmOrgService.java b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/org/service/IMdmOrgService.java new file mode 100644 index 00000000..fe82b199 --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/org/service/IMdmOrgService.java @@ -0,0 +1,12 @@ +package masterData.service; + +import masterData.entity.MdmOrgEntity; +import com.hzya.frame.basedao.service.IBaseService; +/** + * 组织档案(MdmOrg)表服务接口 + * + * @author makejava + * @since 2024-06-07 18:30:05 + */ +public interface IMdmOrgService extends IBaseService{ +} diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/org/service/impl/MdmOrgServiceImpl.java b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/org/service/impl/MdmOrgServiceImpl.java new file mode 100644 index 00000000..700a73ce --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/org/service/impl/MdmOrgServiceImpl.java @@ -0,0 +1,25 @@ +package masterData.service.impl; + +import masterData.entity.MdmOrgEntity; +import masterData.dao.IMdmOrgDao; +import masterData.service.IMdmOrgService; +import org.springframework.stereotype.Service; +import org.springframework.beans.factory.annotation.Autowired; +import javax.annotation.Resource; +import com.hzya.frame.basedao.service.impl.BaseService; +/** + * 组织档案(MdmOrg)表服务实现类 + * + * @author makejava + * @since 2024-06-07 18:30:05 + */ +public class MdmOrgServiceImpl extends BaseService implements IMdmOrgService { + + private IMdmOrgDao mdmOrgDao; + + @Autowired + public void setMdmOrgDao(IMdmOrgDao dao) { + this.mdmOrgDao = dao; + this.dao = dao; + } +} diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/project/dao/IMdmProjectDao.java b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/project/dao/IMdmProjectDao.java new file mode 100644 index 00000000..7389b3cc --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/project/dao/IMdmProjectDao.java @@ -0,0 +1,15 @@ +package masterData.dao; + +import masterData.entity.MdmProjectEntity; +import com.hzya.frame.basedao.dao.IBaseDao; + +/** + * 项目档案(mdm_project: table)表数据库访问层 + * + * @author makejava + * @since 2024-06-07 18:29:23 + */ +public interface IMdmProjectDao extends IBaseDao { + +} + diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/project/dao/impl/MdmProjectDaoImpl.java b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/project/dao/impl/MdmProjectDaoImpl.java new file mode 100644 index 00000000..3da10ccc --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/project/dao/impl/MdmProjectDaoImpl.java @@ -0,0 +1,16 @@ +package masterData.dao.impl; + +import masterData.entity.MdmProjectEntity; +import masterData.dao.IMdmProjectDao; +import org.springframework.stereotype.Repository; +import com.hzya.frame.basedao.dao.MybatisGenericDao; +/** + * 项目档案(MdmProject)表数据库访问层 + * + * @author makejava + * @since 2024-06-07 18:29:23 + */ +public class MdmProjectDaoImpl extends MybatisGenericDao implements IMdmProjectDao{ + +} + diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/project/entity/MdmProjectEntity.java b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/project/entity/MdmProjectEntity.java new file mode 100644 index 00000000..958d6fc5 --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/project/entity/MdmProjectEntity.java @@ -0,0 +1,186 @@ +package masterData.entity; + +import java.util.Date; +import com.hzya.frame.web.entity.BaseEntity; +/** + * 项目档案(MdmProject)实体类 + * + * @author makejava + * @since 2024-06-07 18:29:23 + */ +public class MdmProjectEntity extends BaseEntity { + + /** 单据规则 */ + private String documentRule; + /** 单据规则流水号 */ + private Long documentRuleNum; + /** 项目编码 */ + private String projectCode; + /** 项目名称 */ + private String projectName; + /** 单据类型 */ + private String projectBillType; + /** 备注 */ + private String projectMemo; + /** 币种 */ + private String projectCurrtype; + /** 责任人 */ + private String projectDutier; + /** 责任部门 */ + private String projectDutyDept; + /** 管理组织 */ + private String projectOrg; + /** 父项目 */ + private String projectParentpro; + /** 项目简称 */ + private String projectShName; + /** 数据状态 Y正常 N删除 F修改 */ + private String dataStatus; + /** 新增数据状态 0待下发 1已下发 */ + private String addStatus; + /** 修改数据状态 0待下发 1已下发 */ + private String updateStatus; + /** 删除数据状态 0待下发 1已下发 */ + private String deleteStatus; + /** 公司id */ + private String companyId; + + + public String getDocumentRule() { + return documentRule; + } + + public void setDocumentRule(String documentRule) { + this.documentRule = documentRule; + } + + public Long getDocumentRuleNum() { + return documentRuleNum; + } + + public void setDocumentRuleNum(Long documentRuleNum) { + this.documentRuleNum = documentRuleNum; + } + + public String getProjectCode() { + return projectCode; + } + + public void setProjectCode(String projectCode) { + this.projectCode = projectCode; + } + + public String getProjectName() { + return projectName; + } + + public void setProjectName(String projectName) { + this.projectName = projectName; + } + + public String getProjectBillType() { + return projectBillType; + } + + public void setProjectBillType(String projectBillType) { + this.projectBillType = projectBillType; + } + + public String getProjectMemo() { + return projectMemo; + } + + public void setProjectMemo(String projectMemo) { + this.projectMemo = projectMemo; + } + + public String getProjectCurrtype() { + return projectCurrtype; + } + + public void setProjectCurrtype(String projectCurrtype) { + this.projectCurrtype = projectCurrtype; + } + + public String getProjectDutier() { + return projectDutier; + } + + public void setProjectDutier(String projectDutier) { + this.projectDutier = projectDutier; + } + + public String getProjectDutyDept() { + return projectDutyDept; + } + + public void setProjectDutyDept(String projectDutyDept) { + this.projectDutyDept = projectDutyDept; + } + + public String getProjectOrg() { + return projectOrg; + } + + public void setProjectOrg(String projectOrg) { + this.projectOrg = projectOrg; + } + + public String getProjectParentpro() { + return projectParentpro; + } + + public void setProjectParentpro(String projectParentpro) { + this.projectParentpro = projectParentpro; + } + + public String getProjectShName() { + return projectShName; + } + + public void setProjectShName(String projectShName) { + this.projectShName = projectShName; + } + + public String getDataStatus() { + return dataStatus; + } + + public void setDataStatus(String dataStatus) { + this.dataStatus = dataStatus; + } + + public String getAddStatus() { + return addStatus; + } + + public void setAddStatus(String addStatus) { + this.addStatus = addStatus; + } + + public String getUpdateStatus() { + return updateStatus; + } + + public void setUpdateStatus(String updateStatus) { + this.updateStatus = updateStatus; + } + + public String getDeleteStatus() { + return deleteStatus; + } + + public void setDeleteStatus(String deleteStatus) { + this.deleteStatus = deleteStatus; + } + + public String getCompanyId() { + return companyId; + } + + public void setCompanyId(String companyId) { + this.companyId = companyId; + } + +} + diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/project/entity/MdmProjectEntity.xml b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/project/entity/MdmProjectEntity.xml new file mode 100644 index 00000000..6003878f --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/project/entity/MdmProjectEntity.xml @@ -0,0 +1,377 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + id + ,document_rule + ,document_rule_num + ,project_code + ,project_name + ,project_bill_type + ,project_memo + ,project_currtype + ,project_dutier + ,project_duty_dept + ,project_org + ,project_parentpro + ,project_sh_name + ,data_status + ,add_status + ,update_status + ,delete_status + ,sorts + ,create_user_id + ,create_time + ,modify_user_id + ,modify_time + ,sts + ,org_id + ,company_id + + + + + + + + + + + + + + + + insert into mdm_project( + + id , + document_rule , + document_rule_num , + project_code , + project_name , + project_bill_type , + project_memo , + project_currtype , + project_dutier , + project_duty_dept , + project_org , + project_parentpro , + project_sh_name , + data_status , + add_status , + update_status , + delete_status , + sorts , + create_user_id , + create_time , + modify_user_id , + modify_time , + sts , + org_id , + company_id , + sorts, + sts, + + )values( + + #{id} , + #{documentRule} , + #{documentRuleNum} , + #{projectCode} , + #{projectName} , + #{projectBillType} , + #{projectMemo} , + #{projectCurrtype} , + #{projectDutier} , + #{projectDutyDept} , + #{projectOrg} , + #{projectParentpro} , + #{projectShName} , + #{dataStatus} , + #{addStatus} , + #{updateStatus} , + #{deleteStatus} , + #{sorts} , + #{create_user_id} , + #{create_time} , + #{modify_user_id} , + #{modify_time} , + #{sts} , + #{org_id} , + #{companyId} , + (select (max(IFNULL( a.sorts, 0 )) + 1) as sort from mdm_project a WHERE a.sts = 'Y' ), + 'Y', + + ) + + + + insert into mdm_project(document_rule, document_rule_num, project_code, project_name, project_bill_type, project_memo, project_currtype, project_dutier, project_duty_dept, project_org, project_parentpro, project_sh_name, data_status, add_status, update_status, delete_status, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, sts) + values + + (#{entity.documentRule},#{entity.documentRuleNum},#{entity.projectCode},#{entity.projectName},#{entity.projectBillType},#{entity.projectMemo},#{entity.projectCurrtype},#{entity.projectDutier},#{entity.projectDutyDept},#{entity.projectOrg},#{entity.projectParentpro},#{entity.projectShName},#{entity.dataStatus},#{entity.addStatus},#{entity.updateStatus},#{entity.deleteStatus},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId}, 'Y') + + + + + insert into mdm_project(document_rule, document_rule_num, project_code, project_name, project_bill_type, project_memo, project_currtype, project_dutier, project_duty_dept, project_org, project_parentpro, project_sh_name, data_status, add_status, update_status, delete_status, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id) + values + + (#{entity.documentRule},#{entity.documentRuleNum},#{entity.projectCode},#{entity.projectName},#{entity.projectBillType},#{entity.projectMemo},#{entity.projectCurrtype},#{entity.projectDutier},#{entity.projectDutyDept},#{entity.projectOrg},#{entity.projectParentpro},#{entity.projectShName},#{entity.dataStatus},#{entity.addStatus},#{entity.updateStatus},#{entity.deleteStatus},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId}) + + on duplicate key update + document_rule = values(document_rule), + document_rule_num = values(document_rule_num), + project_code = values(project_code), + project_name = values(project_name), + project_bill_type = values(project_bill_type), + project_memo = values(project_memo), + project_currtype = values(project_currtype), + project_dutier = values(project_dutier), + project_duty_dept = values(project_duty_dept), + project_org = values(project_org), + project_parentpro = values(project_parentpro), + project_sh_name = values(project_sh_name), + data_status = values(data_status), + add_status = values(add_status), + update_status = values(update_status), + delete_status = values(delete_status), + create_user_id = values(create_user_id), + create_time = values(create_time), + modify_user_id = values(modify_user_id), + modify_time = values(modify_time), + sts = values(sts), + org_id = values(org_id), + company_id = values(company_id) + + +update mdm_project set + + document_rule = #{documentRule}, + document_rule_num = #{documentRuleNum}, + project_code = #{projectCode}, + project_name = #{projectName}, + project_bill_type = #{projectBillType}, + project_memo = #{projectMemo}, + project_currtype = #{projectCurrtype}, + project_dutier = #{projectDutier}, + project_duty_dept = #{projectDutyDept}, + project_org = #{projectOrg}, + project_parentpro = #{projectParentpro}, + project_sh_name = #{projectShName}, + data_status = #{dataStatus}, + add_status = #{addStatus}, + update_status = #{updateStatus}, + delete_status = #{deleteStatus}, + create_user_id = #{create_user_id}, + create_time = #{create_time}, + modify_user_id = #{modify_user_id}, + modify_time = #{modify_time}, + sts = #{sts}, + org_id = #{org_id}, + company_id = #{companyId}, + +where id = #{id} + + + +update mdm_project set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} +where id = #{id} + + + +update mdm_project set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} + + and id = #{id} + and document_rule = #{documentRule} + and document_rule_num = #{documentRuleNum} + and project_code = #{projectCode} + and project_name = #{projectName} + and project_bill_type = #{projectBillType} + and project_memo = #{projectMemo} + and project_currtype = #{projectCurrtype} + and project_dutier = #{projectDutier} + and project_duty_dept = #{projectDutyDept} + and project_org = #{projectOrg} + and project_parentpro = #{projectParentpro} + and project_sh_name = #{projectShName} + and data_status = #{dataStatus} + and add_status = #{addStatus} + and update_status = #{updateStatus} + and delete_status = #{deleteStatus} + and sorts = #{sorts} + and sts = #{sts} + and company_id = #{companyId} + and sts='Y' + + + + + delete from mdm_project where id = #{id} + + + + diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/project/plugin/MdmProjectPluginInitializer.java b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/project/plugin/MdmProjectPluginInitializer.java new file mode 100644 index 00000000..0a554a69 --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/project/plugin/MdmProjectPluginInitializer.java @@ -0,0 +1,64 @@ +package com.hzya.frame.plugin.masterData.project.plugin; + +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.base.PluginBaseEntity; +import com.hzya.frame.sysnew.comparison.masterData.service.impl.MasterDataProjectServiceImpl; +import com.hzya.frame.web.entity.JsonResultEntity; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; + +/** + * 项目档案(MdmProject)表服务接口 + * + * @author makejava + * @since 2024-06-07 18:29:23 + */ +public class MdmProjectPluginInitializer extends PluginBaseEntity{ + Logger logger = LoggerFactory.getLogger(MdmProjectPluginInitializer.class); + + @Autowired + private MasterDataProjectServiceImpl masterDataProjectService; + + @Override + public void initialize() { + logger.info(getPluginLabel() + "執行初始化方法initialize()"); + } + + @Override + public void destroy() { + logger.info(getPluginLabel() + "執行銷毀方法destroy()"); + } + + @Override + public String getPluginId() { + return "MdmProjectPlugin"; + } + + @Override + public String getPluginName() { + return "MdmProjectPlugin插件"; + } + + @Override + public String getPluginLabel() { + return "MdmProjectPlugin"; + } + + @Override + public String getPluginType() { + return "1"; + } + @Override + public JsonResultEntity executeBusiness(JSONObject requestJson) { + try { + logger.info("=====开始执行主数据档案项目档案同步======="); + JsonResultEntity jsonResultEntity = masterDataProjectService.queryProjectArchives(requestJson); + return jsonResultEntity; + }catch (Exception e){ + logger.info("======执行主数据档案项目档案同步失败:{}",e.getMessage()); + e.printStackTrace(); + } + return null; + } +} diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/project/service/IMdmProjectService.java b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/project/service/IMdmProjectService.java new file mode 100644 index 00000000..58e801b2 --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/project/service/IMdmProjectService.java @@ -0,0 +1,12 @@ +package masterData.service; + +import masterData.entity.MdmProjectEntity; +import com.hzya.frame.basedao.service.IBaseService; +/** + * 项目档案(MdmProject)表服务接口 + * + * @author makejava + * @since 2024-06-07 18:29:23 + */ +public interface IMdmProjectService extends IBaseService{ +} diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/project/service/impl/MdmProjectServiceImpl.java b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/project/service/impl/MdmProjectServiceImpl.java new file mode 100644 index 00000000..4dc5e249 --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/project/service/impl/MdmProjectServiceImpl.java @@ -0,0 +1,25 @@ +package masterData.service.impl; + +import masterData.entity.MdmProjectEntity; +import masterData.dao.IMdmProjectDao; +import masterData.service.IMdmProjectService; +import org.springframework.stereotype.Service; +import org.springframework.beans.factory.annotation.Autowired; +import javax.annotation.Resource; +import com.hzya.frame.basedao.service.impl.BaseService; +/** + * 项目档案(MdmProject)表服务实现类 + * + * @author makejava + * @since 2024-06-07 18:29:23 + */ +public class MdmProjectServiceImpl extends BaseService implements IMdmProjectService { + + private IMdmProjectDao mdmProjectDao; + + @Autowired + public void setMdmProjectDao(IMdmProjectDao dao) { + this.mdmProjectDao = dao; + this.dao = dao; + } +} From 7998823e69821479c796231bbf53918ce25cb2b8 Mon Sep 17 00:00:00 2001 From: hecan <1718492867@qq.com> Date: Tue, 11 Jun 2024 09:56:39 +0800 Subject: [PATCH 25/80] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=8F=92=E4=BB=B6?= =?UTF-8?q?=E7=BC=96=E7=A0=81=E5=B1=9E=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mdm/mdmModuleSource/entity/MdmModuleSourceEntity.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleSource/entity/MdmModuleSourceEntity.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleSource/entity/MdmModuleSourceEntity.java index 2cc45fb4..84e0358b 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleSource/entity/MdmModuleSourceEntity.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleSource/entity/MdmModuleSourceEntity.java @@ -20,7 +20,15 @@ public class MdmModuleSourceEntity extends BaseEntity { private String sourceCode; /** 公司id */ private String companyId; + private String pluginCode;//插件编码 + public String getPluginCode() { + return pluginCode; + } + + public void setPluginCode(String pluginCode) { + this.pluginCode = pluginCode; + } public String getMdmId() { return mdmId; From e928c8de00261fb281a222af449bcefe2d55fe34 Mon Sep 17 00:00:00 2001 From: hecan <1718492867@qq.com> Date: Tue, 11 Jun 2024 09:57:29 +0800 Subject: [PATCH 26/80] =?UTF-8?q?=E9=80=9A=E7=94=A8=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sysnew/comparison/dao/IComparisonDao.java | 9 - .../dao/impl/ComparisonDaoImpl.java | 6 - .../comparison/entity/ComparisonEntity.java | 6 +- .../comparison/entity/ComparisonEntity.xml | 15 +- .../service/impl/ComparisonServiceImpl.java | 201 +++++++++++++++--- 5 files changed, 181 insertions(+), 56 deletions(-) diff --git a/service/src/main/java/com/hzya/frame/sysnew/comparison/dao/IComparisonDao.java b/service/src/main/java/com/hzya/frame/sysnew/comparison/dao/IComparisonDao.java index 42b171db..97653c9a 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/comparison/dao/IComparisonDao.java +++ b/service/src/main/java/com/hzya/frame/sysnew/comparison/dao/IComparisonDao.java @@ -110,13 +110,4 @@ public interface IComparisonDao extends IBaseDao { * **/ List queryComparisonBymdmIdFileds(ComparisonEntity comparison); - /** - * - * @content 根据数据来源内类型是插件的应用类型做分组 - * @Param - * @Return - * @Author hecan - * @Date 2024/6/4 17:41 - * **/ - List queryModuleSource(); } diff --git a/service/src/main/java/com/hzya/frame/sysnew/comparison/dao/impl/ComparisonDaoImpl.java b/service/src/main/java/com/hzya/frame/sysnew/comparison/dao/impl/ComparisonDaoImpl.java index 4c8a0298..d50098cb 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/comparison/dao/impl/ComparisonDaoImpl.java +++ b/service/src/main/java/com/hzya/frame/sysnew/comparison/dao/impl/ComparisonDaoImpl.java @@ -81,10 +81,4 @@ public class ComparisonDaoImpl extends MybatisGenericDao queryModuleSource() { - List list =(List) super.selectList(getSqlIdPrifx() + "queryModuleSource",""); - return list; - } } diff --git a/service/src/main/java/com/hzya/frame/sysnew/comparison/entity/ComparisonEntity.java b/service/src/main/java/com/hzya/frame/sysnew/comparison/entity/ComparisonEntity.java index a47e7a3f..6a97f2b4 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/comparison/entity/ComparisonEntity.java +++ b/service/src/main/java/com/hzya/frame/sysnew/comparison/entity/ComparisonEntity.java @@ -32,7 +32,7 @@ public class ComparisonEntity extends BaseEntity { private String rulePrefix;//规则前缀 CK-yyyyMMdd-0001中的CK private String ruleMiddle;//规则中间 CK-yyyyMMdd-0001中的yyyyMMdd - private String ruleSuffix;//规则后缀 CK-yyyyMMdd-0001中的0001 + private int ruleSuffix;//规则后缀 CK-yyyyMMdd-0001中的0001 private String mId;//mdm_module的id private String dbId;//mdm_module_db的id @@ -100,11 +100,11 @@ public class ComparisonEntity extends BaseEntity { this.ruleMiddle = ruleMiddle; } - public String getRuleSuffix() { + public int getRuleSuffix() { return ruleSuffix; } - public void setRuleSuffix(String ruleSuffix) { + public void setRuleSuffix(int ruleSuffix) { this.ruleSuffix = ruleSuffix; } 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 906661bd..d24c345d 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 @@ -35,7 +35,7 @@ left join mdm_module_db moddb on m.id=moddb.mdm_id left join mdm_module_db_fileds filed on filed.mdm_id=m.id and filed.db_id=moddb.id - where m.mdm_code= #{mdmCode} + where m.mdm_code= #{mdmCode} and (moddb.db_type='1' or moddb.db_type='2') @@ -61,7 +61,7 @@ update_type as updateType,show_type as showType, query_type as queryType, list_type as listType, view_type as viewType,mdm_id as mId,db_id as dbId from mdm_module_db_fileds - where mdm_id= #{mId} and sts='Y' + where db_id= #{dbId} and sts='Y' @@ -74,21 +74,14 @@ - - - - insert into ${dbName} 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 931ed6e6..76ba706d 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 @@ -6,16 +6,21 @@ import com.alibaba.fastjson.JSONObject; import com.baomidou.dynamic.datasource.annotation.DS; import com.github.pagehelper.PageInfo; import com.hzya.frame.basedao.service.impl.BaseService; +import com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity; +import com.hzya.frame.mdm.mdmModuleDb.entity.MdmModuleDbEntity; +import com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity; +import com.hzya.frame.mdm.service.impl.MdmServiceCache; +import com.hzya.frame.sysnew.comparison.controlsLog.dao.impl.ControlsLogDaoImpl; import com.hzya.frame.sysnew.comparison.dao.IComparisonDao; import com.hzya.frame.sysnew.comparison.dao.IComparisonDetailsDao; import com.hzya.frame.sysnew.comparison.entity.ComparisonDetailsEntity; import com.hzya.frame.sysnew.comparison.entity.ComparisonEntity; import com.hzya.frame.sysnew.comparison.service.IComparisonService; -import com.hzya.frame.sysnew.generalData.dao.IGeneralDataDao; import com.hzya.frame.uuid.UUIDUtils; import com.hzya.frame.web.entity.BaseResult; import com.hzya.frame.web.entity.JsonResultEntity; import org.apache.commons.collections.CollectionUtils; +import org.apache.ivy.Main; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import sun.java2d.pipe.AAShapePipe; @@ -30,6 +35,12 @@ public class ComparisonServiceImpl extends BaseService @Autowired private IComparisonDetailsDao comparisonDetailsDao; + @Autowired + private ControlsLogDaoImpl controlsLogDaoimpl; + + @Autowired + private MdmServiceCache mdmServiceCache; + @Autowired public void setGeneralDataDao(IComparisonDao dao) { this.comparisonDao = dao; @@ -53,7 +64,8 @@ public class ComparisonServiceImpl extends BaseService //根据主数据编码查询表名称,字段名称等信息 10001 //comparisonEntities = comparisonDao.queryComparison(comparisonEntity); - comparisonEntities=getComparisonEntity(comparisonEntity); + //comparisonEntities=getComparisonEntity(comparisonEntity); + comparisonEntities=getComparisonEntityCache(comparisonEntity,"main"); }catch (Exception e){ logger.info("根据主数据编码查询信息错误:{}",e.getMessage()); return BaseResult.getFailureMessageEntity("查询失败"); @@ -95,6 +107,9 @@ public class ComparisonServiceImpl extends BaseService if (!checkStr(jsonObject.getString("mdmCode"))) { return BaseResult.getFailureMessageEntity("主数据编码为空"); } + if (!checkStr(jsonObject.getString("optionName"))) { + return BaseResult.getFailureMessageEntity("操作人为空"); + } /*if (!checkStr(jsonObject.getString("rulePrefix"))) { return BaseResult.getFailureMessageEntity("规则为空"); }*/ @@ -105,7 +120,8 @@ public class ComparisonServiceImpl extends BaseService //根据主数据编码查询表名称,字段名称等信息 10001 // comparisonEntities = comparisonDao.queryComparison(comparisonEntity); - comparisonEntities=getComparisonEntity(comparisonEntity); + //comparisonEntities=getComparisonEntity(comparisonEntity); + comparisonEntities=getComparisonEntityCache(comparisonEntity,"main"); }catch (Exception e){ logger.info("根据主数据编码查询信息错误:{}",e.getMessage()); return BaseResult.getFailureMessageEntity("保存失败"); @@ -119,20 +135,27 @@ public class ComparisonServiceImpl extends BaseService if (comparisonEntities != null && comparisonEntities.size() > 0) { map=spliceMainMap(comparisonEntities,jsonObjectMain,map,comparisonEntity); mapDetails=spliceDetailMap(comparisonEntities,mapDetails,comparisonDetailsEntity,jsonArray); - String uuid = UUIDUtils.getUUID(); - map.put("id", uuid); + 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 comparisonEntityRule = comparisonEntities.get(0); comparisonEntityRule= comparisonDao.queryComparisonById(comparisonEntityRule); String documentRule =comparisonEntityRule.getDocumentRule();; //"KH-2024-05-30-1"; logger.info("通用数据保存接口中根据mId查询出来的单据规则为:{}",documentRule); @@ -143,7 +166,8 @@ public class ComparisonServiceImpl extends BaseService String ruleDate = documentRule.substring(documentRule.indexOf("-") + 1, documentRule.lastIndexOf("-")); String ruleMiddle = getRuleDate(ruleDate); //获取规则后缀 - String ruleSuffix= documentRule.substring(documentRule.lastIndexOf("-")+1); + String ruleSuffixLength= documentRule.substring(documentRule.lastIndexOf("-")+1); + int ruleSuffix = ruleSuffixLength.length(); //生成单据规则 comparisonEntity.setRulePrefix(rulePrefix); comparisonEntity.setRuleMiddle(ruleMiddle); @@ -168,7 +192,8 @@ public class ComparisonServiceImpl extends BaseService ComparisonEntity comparisonEntityOne = comparisonDao.saveComparison(comparisonEntity); //保存子表数据 if (mapDetails != null && mapDetails.size() > 0) { - mapDetails.put("id", UUIDUtils.getUUID()); + 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"); @@ -176,11 +201,17 @@ public class ComparisonServiceImpl extends BaseService 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); + //comparisonEntityOne.setComparisonDetailsEntity(comparisonDetailsEntityOne); + map.put("details",mapDetails); + //保存操作日志 + controlsLogDaoimpl.saveControlsLog(uuidDetail,jsonObject.getString("sourceName"),jsonObject.getString("code"),jsonObject.toJSONString(),"接口新增",jsonObject.getString("optionName"),comparisonDetailsEntity.getDbName()+"_option_log"); } - return BaseResult.getSuccessMessageEntity("保存成功", comparisonEntityOne); + //保存操作日志 + controlsLogDaoimpl.saveControlsLog(uuid,jsonObject.getString("sourceName"),jsonObject.getString("code"),jsonObject.toJSONString(),"接口新增",jsonObject.getString("optionName"),comparisonEntity.getDbName()+"_option_log"); + return BaseResult.getSuccessMessageEntity("保存成功", map); } catch (Exception e) { logger.info("保存通用数据时候错误:{}", e.getMessage()); return BaseResult.getFailureMessageEntity("保存失败"); @@ -200,6 +231,9 @@ public class ComparisonServiceImpl extends BaseService if (!checkStr(jsonObject.getString("mdmCode"))) { return BaseResult.getFailureMessageEntity("主数据编码为空"); } + if (!checkStr(jsonObject.getString("optionName"))) { + return BaseResult.getFailureMessageEntity("操作人为空"); + } ComparisonEntity comparisonEntity = jsonObject.toJavaObject(ComparisonEntity.class); ComparisonDetailsEntity comparisonDetailsEntity=new ComparisonDetailsEntity(); JSONObject jsonObjectMain=jsonObject.getJSONObject("main");//获取主表数据 @@ -212,7 +246,8 @@ public class ComparisonServiceImpl extends BaseService try { // comparisonEntities = comparisonDao.queryComparison(comparisonEntity); - comparisonEntities=getComparisonEntity(comparisonEntity); + //comparisonEntities=getComparisonEntity(comparisonEntity); + comparisonEntities=getComparisonEntityCache(comparisonEntity,"main"); }catch (Exception e){ logger.info("根据主数据编码查询信息错误:{}",e.getMessage()); return BaseResult.getFailureMessageEntity("更新失败"); @@ -221,7 +256,7 @@ public class ComparisonServiceImpl extends BaseService Map mapDetails=new HashMap<>();//将子表数据存到map中 if(comparisonEntities !=null && comparisonEntities.size()>0) { map=spliceMainMap(comparisonEntities,jsonObjectMain,map,comparisonEntity); - mapDetails=spliceDetailMap(comparisonEntities,map,comparisonDetailsEntity,jsonArray); + mapDetails=spliceDetailMap(comparisonEntities,mapDetails,comparisonDetailsEntity,jsonArray); map.put("create_user_id", "c796fd9ba4c9f5ff3cc2fa41a040e443"); map.put("modify_user_id", "c796fd9ba4c9f5ff3cc2fa41a040e443"); map.put("org_id", "0"); @@ -256,7 +291,11 @@ public class ComparisonServiceImpl extends BaseService comparisonDetailsEntity.setFormmainId(jsonObjectMain.getString("id")); comparisonDetailsEntity.setMapDetails(mapDetails); comparisonDetailsDao.updateComparisonDetailsByType(comparisonDetailsEntity); + //保存操作日志 + controlsLogDaoimpl.saveControlsLog(comparisonDetailsEntity.getId(),jsonObject.getString("sourceName"),jsonObject.getString("code"),jsonObject.toJSONString(),"接口更新",jsonObject.getString("optionName"),comparisonDetailsEntity.getDbName()+"_option_log"); } + //保存操作日志 + controlsLogDaoimpl.saveControlsLog(comparisonEntity.getId(),jsonObject.getString("sourceName"),jsonObject.getString("code"),jsonObject.toJSONString(),"接口更新",jsonObject.getString("optionName"),comparisonEntity.getDbName()+"_option_log"); return BaseResult.getSuccessMessageEntity("更新成功", integer); }else{ return BaseResult.getFailureMessageEntity("更新失败"); @@ -290,7 +329,8 @@ public class ComparisonServiceImpl extends BaseService try { // comparisonEntities = comparisonDao.queryComparison(comparisonEntity); - comparisonEntities=getComparisonEntity(comparisonEntity); + //comparisonEntities=getComparisonEntity(comparisonEntity); + comparisonEntities=getComparisonEntityCache(comparisonEntity,"main"); }catch (Exception e){ logger.info("根据主数据编码查询信息错误:{}",e.getMessage()); return BaseResult.getFailureMessageEntity("删除失败"); @@ -321,7 +361,9 @@ public class ComparisonServiceImpl extends BaseService comparisonDetailsEntity.setFormmainId(jsonObjectMain.getString("id")); comparisonDetailsEntity.setModify_user_id("c796fd9ba4c9f5ff3cc2fa41a040e443"); comparisonDetailsDao.deleteComparisonDetails(comparisonDetailsEntity); + controlsLogDaoimpl.saveControlsLog(comparisonDetailsEntity.getId(),jsonObject.getString("sourceName"),jsonObject.getString("code"),jsonObject.toJSONString(),"接口删除",jsonObject.getString("optionName"),comparisonEntity.getDbName()+"_option_log"); } + controlsLogDaoimpl.saveControlsLog(comparisonEntity.getId(),jsonObject.getString("sourceName"),jsonObject.getString("code"),jsonObject.toJSONString(),"接口删除",jsonObject.getString("optionName"),comparisonEntity.getDbName()+"_option_log"); return BaseResult.getSuccessMessageEntity("删除成功",integer); }else{ return BaseResult.getFailureMessageEntity("删除失败","请查看id是否在表中存在"); @@ -390,6 +432,92 @@ public class ComparisonServiceImpl extends BaseService return mapDetails; } + //根据主数据编码获取主表和明细表表名称,表字段信息 + public List getComparisonEntityCache(ComparisonEntity comparison,String type){ + List comparisonEntities = new ArrayList<>(); + //根据主数据编号获取模板主表 + MdmModuleEntity mdmModuleEntity = mdmServiceCache.getMdmModuleEntity(Long.valueOf(comparison.getMdmCode())); + //根据模板主表id获取模版表数据 + if(mdmModuleEntity!=null){ + MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); + mdmModuleDbEntity.setMdmId(mdmModuleEntity.getId()); + List mdmModuleDbEntities = mdmServiceCache.queryMdmModuleDb(mdmModuleDbEntity); + if(CollectionUtils.isNotEmpty(mdmModuleDbEntities)){ + for (MdmModuleDbEntity moduleDbEntity : mdmModuleDbEntities) { + switch (type){ + case "main": + //获取主表和明细表的字段信息 + if(moduleDbEntity.getDbType().equals("1") || moduleDbEntity.getDbType().equals("2")){ + MdmModuleDbFiledsEntity mdmModuleDbFiledsEntity=new MdmModuleDbFiledsEntity(); + mdmModuleDbFiledsEntity.setMdmId(mdmModuleEntity.getId()); + List mdmModuleDbFiledsEntities = mdmServiceCache.queryMdmModuleDbFileds(mdmModuleDbFiledsEntity); + if(CollectionUtils.isNotEmpty(mdmModuleDbFiledsEntities)){ + for (MdmModuleDbFiledsEntity moduleDbFiledsEntity : mdmModuleDbFiledsEntities) { + if (moduleDbFiledsEntity.getDbId().equals(moduleDbEntity.getId())) { + ComparisonEntity comparisonEntityFile = new ComparisonEntity(); + comparisonEntityFile.setChName(moduleDbFiledsEntity.getChName()); + comparisonEntityFile.setEnName(moduleDbFiledsEntity.getEnName()); + comparisonEntityFile.setFiledType(moduleDbFiledsEntity.getFiledType()); + comparisonEntityFile.setAddType(moduleDbFiledsEntity.getAddType()); + comparisonEntityFile.setUpdateType(moduleDbFiledsEntity.getUpdateType()); + comparisonEntityFile.setShowType(moduleDbFiledsEntity.getShowType()); + comparisonEntityFile.setQueryType(moduleDbFiledsEntity.getQueryType()); + comparisonEntityFile.setListType(moduleDbFiledsEntity.getListType()); + comparisonEntityFile.setViewType(moduleDbFiledsEntity.getViewType()); + comparisonEntityFile.setDbName(moduleDbEntity.getDbName()); + comparisonEntityFile.setDbType(moduleDbEntity.getDbType()); + comparisonEntityFile.setDbId(moduleDbEntity.getId()); + comparisonEntityFile.setmId(mdmModuleEntity.getId()); + comparisonEntityFile.setMdmName(mdmModuleEntity.getMdmName()); + comparisonEntityFile.setMdmCode(String.valueOf(mdmModuleEntity.getMdmCode())); + comparisonEntities.add(comparisonEntityFile); + } + } + } + } + break; + case "option": + //获取主表和明细表的字段信息 + if(moduleDbEntity.getDbType().equals("3")){ + MdmModuleDbFiledsEntity mdmModuleDbFiledsEntity=new MdmModuleDbFiledsEntity(); + mdmModuleDbFiledsEntity.setDbId(moduleDbEntity.getId()); + List mdmModuleDbFiledsEntities = mdmServiceCache.queryMdmModuleDbFileds(mdmModuleDbFiledsEntity); + if(CollectionUtils.isNotEmpty(mdmModuleDbFiledsEntities)){ + for (MdmModuleDbFiledsEntity moduleDbFiledsEntity : mdmModuleDbFiledsEntities) { + if (moduleDbFiledsEntity.getDbId().equals(moduleDbEntity.getId())) { + ComparisonEntity comparisonEntityFile = new ComparisonEntity(); + comparisonEntityFile.setChName(moduleDbFiledsEntity.getChName()); + comparisonEntityFile.setEnName(moduleDbFiledsEntity.getEnName()); + comparisonEntityFile.setFiledType(moduleDbFiledsEntity.getFiledType()); + comparisonEntityFile.setAddType(moduleDbFiledsEntity.getAddType()); + comparisonEntityFile.setUpdateType(moduleDbFiledsEntity.getUpdateType()); + comparisonEntityFile.setShowType(moduleDbFiledsEntity.getShowType()); + comparisonEntityFile.setQueryType(moduleDbFiledsEntity.getQueryType()); + comparisonEntityFile.setListType(moduleDbFiledsEntity.getListType()); + comparisonEntityFile.setViewType(moduleDbFiledsEntity.getViewType()); + comparisonEntityFile.setDbName(moduleDbEntity.getDbName()); + comparisonEntityFile.setDbType(moduleDbEntity.getDbType()); + comparisonEntityFile.setDbId(moduleDbEntity.getId()); + comparisonEntityFile.setmId(mdmModuleEntity.getId()); + comparisonEntityFile.setMdmName(mdmModuleEntity.getMdmName()); + comparisonEntityFile.setMdmCode(String.valueOf(mdmModuleEntity.getMdmCode())); + comparisonEntities.add(comparisonEntityFile); + } + } + } + } + break; + default: + break; + } + + } + } + return comparisonEntities; + } + return null; + } + //根据主数据编码获取数据,表名称,字段名称等 public List getComparisonEntity(ComparisonEntity comparisonEntity) { List comparisonEntities = new ArrayList<>(); @@ -398,7 +526,38 @@ public class ComparisonServiceImpl extends BaseService if (comparisonEntityModule != null) { //根据mdm_module得id查询mdm_module_db得数据 List comparisonEntitiesModuleDb = comparisonDao.queryComparisonBymdmId(comparisonEntityModule); - //根据mdm_module得id查询mdm_module_db_fileds得数据 + if(CollectionUtils.isNotEmpty(comparisonEntitiesModuleDb)) { + for (ComparisonEntity comparison : comparisonEntitiesModuleDb) { + //查询出主表和明细表信息 + if(comparison.getDbType().equals("1")||comparison.getDbType().equals("2")) { + //根据mdm_module_db的id查询对应表的字段 + List comparisonEntitiesFiles = comparisonDao.queryComparisonBymdmIdFileds(comparison); + if (CollectionUtils.isNotEmpty(comparisonEntitiesFiles)) { + for (ComparisonEntity comparisonEntitiesFile : comparisonEntitiesFiles) { + ComparisonEntity comparisonEntityFile = new ComparisonEntity(); + comparisonEntityFile.setChName(comparisonEntitiesFile.getChName()); + comparisonEntityFile.setEnName(comparisonEntitiesFile.getEnName()); + comparisonEntityFile.setFiledType(comparisonEntitiesFile.getFiledType()); + comparisonEntityFile.setAddType(comparisonEntitiesFile.getAddType()); + comparisonEntityFile.setUpdateType(comparisonEntitiesFile.getUpdateType()); + comparisonEntityFile.setShowType(comparisonEntitiesFile.getShowType()); + comparisonEntityFile.setQueryType(comparisonEntitiesFile.getQueryType()); + comparisonEntityFile.setListType(comparisonEntitiesFile.getListType()); + comparisonEntityFile.setViewType(comparisonEntitiesFile.getViewType()); + comparisonEntityFile.setDbName(comparison.getDbName()); + comparisonEntityFile.setDbType(comparison.getDbType()); + comparisonEntityFile.setDbId(comparison.getDbId()); + comparisonEntityFile.setmId(comparisonEntitiesFile.getmId()); + comparisonEntityFile.setMdmName(comparisonEntityModule.getMdmName()); + comparisonEntityFile.setMdmCode(comparisonEntityModule.getMdmCode()); + comparisonEntities.add(comparisonEntityFile); + } + } + } + } + } + + /* //根据mdm_module得id查询mdm_module_db_fileds得数据 List comparisonEntitiesFiles = comparisonDao.queryComparisonBymdmIdFileds(comparisonEntityModule); for (ComparisonEntity comparison : comparisonEntitiesModuleDb) { for (ComparisonEntity comparisonEntitiesFile : comparisonEntitiesFiles) { @@ -422,22 +581,10 @@ public class ComparisonServiceImpl extends BaseService comparisonEntities.add(comparisonEntityFile); } } - } + }*/ return comparisonEntities; } return null; } - //查询数据来源 根据数据来源内类型是插件的应用类型做分组 - public List getComparisonEntityFiles(){ - List comparisonEntities = comparisonDao.queryModuleSource(); - if(CollectionUtils.isNotEmpty(comparisonEntities)){ - for (ComparisonEntity comparisonEntity : comparisonEntities) { - //根据来源类型获取档案数据 比如U8C - - } - } - return null; - } - } From 54332d5fc25e04011e3b751309d6425f6741cb5a Mon Sep 17 00:00:00 2001 From: "476474485@qq.com" Date: Tue, 11 Jun 2024 10:00:36 +0800 Subject: [PATCH 27/80] =?UTF-8?q?=E5=88=A0=E9=99=A4=E7=A7=AF=E6=9C=A8?= =?UTF-8?q?=E6=8A=A5=E8=A1=A8=E4=BE=9D=E8=B5=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 28 +++++++--------------------- 1 file changed, 7 insertions(+), 21 deletions(-) diff --git a/pom.xml b/pom.xml index fa54a84e..383d109f 100644 --- a/pom.xml +++ b/pom.xml @@ -244,12 +244,12 @@ - - - com.dameng - Dm8JdbcDriver18 - 8.1.1.49 - + + + + + + @@ -338,21 +338,7 @@ org.springframework.boot spring-boot-starter-cache - - - - org.jeecgframework.jimureport - jimureport-spring-boot-starter - ${jimureport.version} - - - - io.minio - minio - ${minio.version} - true - - + org.postgresql postgresql From aa6da4bf77422fa3bffe144e8f448ef1067a1a9c Mon Sep 17 00:00:00 2001 From: hecan <1718492867@qq.com> Date: Tue, 11 Jun 2024 10:14:38 +0800 Subject: [PATCH 28/80] =?UTF-8?q?=E6=93=8D=E4=BD=9C=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controlsLog/dao/IControlsLogDao.java | 20 +++ .../dao/impl/ControlsLogDaoImpl.java | 32 +++++ .../controlsLog/entity/ControlsLogEntity.java | 78 ++++++++++ .../controlsLog/entity/ControlsLogEntity.xml | 136 ++++++++++++++++++ 4 files changed, 266 insertions(+) create mode 100644 service/src/main/java/com/hzya/frame/sysnew/comparison/controlsLog/dao/IControlsLogDao.java create mode 100644 service/src/main/java/com/hzya/frame/sysnew/comparison/controlsLog/dao/impl/ControlsLogDaoImpl.java create mode 100644 service/src/main/java/com/hzya/frame/sysnew/comparison/controlsLog/entity/ControlsLogEntity.java create mode 100644 service/src/main/java/com/hzya/frame/sysnew/comparison/controlsLog/entity/ControlsLogEntity.xml diff --git a/service/src/main/java/com/hzya/frame/sysnew/comparison/controlsLog/dao/IControlsLogDao.java b/service/src/main/java/com/hzya/frame/sysnew/comparison/controlsLog/dao/IControlsLogDao.java new file mode 100644 index 00000000..1ef9f35c --- /dev/null +++ b/service/src/main/java/com/hzya/frame/sysnew/comparison/controlsLog/dao/IControlsLogDao.java @@ -0,0 +1,20 @@ +package com.hzya.frame.sysnew.comparison.controlsLog.dao; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.hzya.frame.basedao.dao.IBaseDao; +import com.hzya.frame.sysnew.comparison.controlsLog.entity.ControlsLogEntity; + +public interface IControlsLogDao extends IBaseDao { + + /** + * + * @content 操作日志保存 + * @Param formmainId:主表id,sourceName:来源名称,code:来源编码,sourceData:源数据,optionType:操作类型,optionName:操作人,dbName:数据库名称 + * @Return + * @Author hecan + * @Date 2024/6/5 15:29 + * **/ + @DS("master") + ControlsLogEntity saveControlsLog(String formmainId,String sourceName,String code,String sourceData,String optionType,String optionName,String dbName); + +} diff --git a/service/src/main/java/com/hzya/frame/sysnew/comparison/controlsLog/dao/impl/ControlsLogDaoImpl.java b/service/src/main/java/com/hzya/frame/sysnew/comparison/controlsLog/dao/impl/ControlsLogDaoImpl.java new file mode 100644 index 00000000..7db1b35b --- /dev/null +++ b/service/src/main/java/com/hzya/frame/sysnew/comparison/controlsLog/dao/impl/ControlsLogDaoImpl.java @@ -0,0 +1,32 @@ +package com.hzya.frame.sysnew.comparison.controlsLog.dao.impl; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.hzya.frame.basedao.dao.MybatisGenericDao; +import com.hzya.frame.sysnew.comparison.controlsLog.dao.IControlsLogDao; +import com.hzya.frame.sysnew.comparison.controlsLog.entity.ControlsLogEntity; +import com.hzya.frame.uuid.UUIDUtils; +import org.springframework.stereotype.Repository; + +@Repository(value = "controlsLogDaoImpl") +public class ControlsLogDaoImpl extends MybatisGenericDao implements IControlsLogDao { + + //操作日志新增 + @Override + @DS("master") + public ControlsLogEntity saveControlsLog(String formmainId,String sourceName,String code,String sourceData,String optionType,String optionName,String dbName) { + ControlsLogEntity controlsLogEntity=new ControlsLogEntity(); + controlsLogEntity.setId(UUIDUtils.getUUID()); + controlsLogEntity.setFormmainId(formmainId); + controlsLogEntity.setSourceName(sourceName); + controlsLogEntity.setCode(code); + controlsLogEntity.setSourceData(sourceData); + controlsLogEntity.setOptionType(optionType); + controlsLogEntity.setOptionName(optionName); + controlsLogEntity.setDbName(dbName); + controlsLogEntity.setCreate_user_id("c796fd9ba4c9f5ff3cc2fa41a040e443"); + controlsLogEntity.setModify_user_id("c796fd9ba4c9f5ff3cc2fa41a040e443"); + controlsLogEntity.setOrg_id("0"); + ControlsLogEntity save = super.save(getSqlIdPrifx() + "saveControlsLog", controlsLogEntity); + return save; + } +} diff --git a/service/src/main/java/com/hzya/frame/sysnew/comparison/controlsLog/entity/ControlsLogEntity.java b/service/src/main/java/com/hzya/frame/sysnew/comparison/controlsLog/entity/ControlsLogEntity.java new file mode 100644 index 00000000..68f0d3ae --- /dev/null +++ b/service/src/main/java/com/hzya/frame/sysnew/comparison/controlsLog/entity/ControlsLogEntity.java @@ -0,0 +1,78 @@ +package com.hzya.frame.sysnew.comparison.controlsLog.entity; + +import com.hzya.frame.web.entity.BaseEntity; + +/** + * + * @content 操作日志实体类 + * @Param + * @Return + * @Author hecan + * @Date 2024/6/5 11:58 + * **/ +public class ControlsLogEntity extends BaseEntity { + private String formmainId;//主表id + private String sourceName;//来源名称 + private String code;//编码 + private String sourceData;//源数据 + private String optionType;//操作类型 + private String optionName;//操作人 + + private String dbName;//表名称 + + public String getDbName() { + return dbName; + } + + public void setDbName(String dbName) { + this.dbName = dbName; + } + + public String getFormmainId() { + return formmainId; + } + + public void setFormmainId(String formmainId) { + this.formmainId = formmainId; + } + + public String getSourceName() { + return sourceName; + } + + public void setSourceName(String sourceName) { + this.sourceName = sourceName; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getSourceData() { + return sourceData; + } + + public void setSourceData(String sourceData) { + this.sourceData = sourceData; + } + + public String getOptionType() { + return optionType; + } + + public void setOptionType(String optionType) { + this.optionType = optionType; + } + + public String getOptionName() { + return optionName; + } + + public void setOptionName(String optionName) { + this.optionName = optionName; + } +} diff --git a/service/src/main/java/com/hzya/frame/sysnew/comparison/controlsLog/entity/ControlsLogEntity.xml b/service/src/main/java/com/hzya/frame/sysnew/comparison/controlsLog/entity/ControlsLogEntity.xml new file mode 100644 index 00000000..7670ef99 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/sysnew/comparison/controlsLog/entity/ControlsLogEntity.xml @@ -0,0 +1,136 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + insert into ${dbName} + + id, + formmain_id, + code , + source_name , + source_data , + option_type , + option_name , + sorts , + create_user_id , + modify_user_id , + org_id , + company_id , + create_time, + modify_time, + sts + + values + + #{id}, + #{formmainId}, + #{code} , + #{sourceName} , + #{sourceData} , + #{optionType} , + #{optionName} , + #{sorts} , + (select (max(IFNULL( a.sorts, 0 )) + 1) as sort from ${dbName} a WHERE a.sts = 'Y' ), + #{create_user_id} , + #{modify_user_id} , + #{org_id} , + #{companyId} , + #{create_time} , + now() , + #{modify_time} , + now() , + #{sts} , + 'Y' + + + + + + update ${dbName} set + + formmain_id = #{formmainId}, + source_name = #{sourceName}, + code = #{code}, + source_data = #{sourceData}, + option_type = #{optionType}, + option_name = #{optionName}, + sorts = #{sorts}, + create_user_id = #{create_user_id}, + create_time = #{create_time}, + modify_user_id = #{modify_user_id}, + modify_time = #{modify_time}, + modify_time = now(), + sts = #{sts}, + org_id = #{org_id}, + company_id = #{companyId} + + where id=#{id} and sts='Y' + + + + + + update + ${dbName} + set sts= 'N' ,modify_time = now(),modify_user_id = #{modify_user_id} + + formmain_id = #{formmainId}, + source_name = #{sourceName}, + code = #{code}, + source_data = #{sourceData}, + option_type = #{optionType}, + option_name = #{optionName}, + and sorts = #{sorts} + and sts = #{sts} + and company_id = #{companyId} + and id=#{id} and sts='Y' + + + + + From f6c4497d68fab164bfe39bf245079ff331ef019b Mon Sep 17 00:00:00 2001 From: lvleigang <957075182@qq.com> Date: Tue, 11 Jun 2024 11:19:51 +0800 Subject: [PATCH 29/80] =?UTF-8?q?=E5=B9=B3=E5=8F=B0=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=8E=B7=E5=8F=96=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../entity/SysExtensionApiEntity.java | 32 +++++++++++++++++++ .../impl/SysApplicationServiceImpl.java | 3 ++ 2 files changed, 35 insertions(+) diff --git a/service/src/main/java/com/hzya/frame/sysnew/application/entity/SysExtensionApiEntity.java b/service/src/main/java/com/hzya/frame/sysnew/application/entity/SysExtensionApiEntity.java index 90c7ed64..7668e887 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/application/entity/SysExtensionApiEntity.java +++ b/service/src/main/java/com/hzya/frame/sysnew/application/entity/SysExtensionApiEntity.java @@ -1,6 +1,8 @@ package com.hzya.frame.sysnew.application.entity; +import com.hzya.frame.sysnew.application.api.entity.SysApplicationApiEntity; + import java.util.Map; public class SysExtensionApiEntity { @@ -11,6 +13,12 @@ public class SysExtensionApiEntity { private String querys; /** body */ private String bodys; + /** 发送方应用 */ + private SysApplicationEntity sendApp; + /** 接收方应用 */ + private SysApplicationEntity receiveApp; + /** 接收方api */ + private SysApplicationApiEntity receiveApi; public Map getHeaders() { return headers; @@ -35,5 +43,29 @@ public class SysExtensionApiEntity { public void setBodys(String bodys) { this.bodys = bodys; } + + public SysApplicationEntity getSendApp() { + return sendApp; + } + + public void setSendApp(SysApplicationEntity sendApp) { + this.sendApp = sendApp; + } + + public SysApplicationEntity getReceiveApp() { + return receiveApp; + } + + public void setReceiveApp(SysApplicationEntity receiveApp) { + this.receiveApp = receiveApp; + } + + public SysApplicationApiEntity getReceiveApi() { + return receiveApi; + } + + public void setReceiveApi(SysApplicationApiEntity receiveApi) { + this.receiveApi = receiveApi; + } } 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 bd3c7594..5775b7fc 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 @@ -1725,6 +1725,9 @@ public class SysApplicationServiceImpl extends BaseService Date: Tue, 11 Jun 2024 14:27:42 +0800 Subject: [PATCH 30/80] =?UTF-8?q?=E5=A2=9E=E5=8A=A0api=E6=89=A9=E5=B1=95?= =?UTF-8?q?=E6=96=B9=E6=B3=95=EF=BC=8C=E8=8E=B7=E5=8F=96=E5=BA=94=E7=94=A8?= =?UTF-8?q?=E5=90=8D=E7=A7=B0=E5=92=8C=E5=BA=94=E7=94=A8=E7=BC=96=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/MasterDataOrgsServiceImpl.java | 8 ++--- .../impl/MasterDataProjectServiceImpl.java | 8 ++--- .../service/IComparisonService.java | 16 +++++++--- .../service/impl/ComparisonServiceImpl.java | 31 +++++++++++++++---- 4 files changed, 45 insertions(+), 18 deletions(-) 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 index c6fe35a5..e382aabf 100644 --- 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 @@ -102,8 +102,8 @@ public class MasterDataOrgsServiceImpl extends BaseService comparisonEntity.setDbName(entity.getDbName()); if(!"mdmCode".equals(key)){ map.put(key, jsonObject.getString(key)); + map.remove("appName"); + map.remove("appCode"); } } } @@ -207,10 +211,10 @@ public class ComparisonServiceImpl extends BaseService //comparisonEntityOne.setComparisonDetailsEntity(comparisonDetailsEntityOne); map.put("details",mapDetails); //保存操作日志 - controlsLogDaoimpl.saveControlsLog(uuidDetail,jsonObject.getString("sourceName"),jsonObject.getString("code"),jsonObject.toJSONString(),"接口新增",jsonObject.getString("optionName"),comparisonDetailsEntity.getDbName()+"_option_log"); + controlsLogDaoimpl.saveControlsLog(uuidDetail,jsonObject.getString("appName"),jsonObject.getString("appCode"),jsonObject.toJSONString(),"接口新增",jsonObject.getString("optionName"),comparisonDetailsEntity.getDbName()+"_option_log"); } //保存操作日志 - controlsLogDaoimpl.saveControlsLog(uuid,jsonObject.getString("sourceName"),jsonObject.getString("code"),jsonObject.toJSONString(),"接口新增",jsonObject.getString("optionName"),comparisonEntity.getDbName()+"_option_log"); + controlsLogDaoimpl.saveControlsLog(uuid,jsonObject.getString("appName"),jsonObject.getString("appCode"),jsonObject.toJSONString(),"接口新增",jsonObject.getString("optionName"),comparisonEntity.getDbName()+"_option_log"); return BaseResult.getSuccessMessageEntity("保存成功", map); } catch (Exception e) { logger.info("保存通用数据时候错误:{}", e.getMessage()); @@ -292,10 +296,10 @@ public class ComparisonServiceImpl extends BaseService comparisonDetailsEntity.setMapDetails(mapDetails); comparisonDetailsDao.updateComparisonDetailsByType(comparisonDetailsEntity); //保存操作日志 - controlsLogDaoimpl.saveControlsLog(comparisonDetailsEntity.getId(),jsonObject.getString("sourceName"),jsonObject.getString("code"),jsonObject.toJSONString(),"接口更新",jsonObject.getString("optionName"),comparisonDetailsEntity.getDbName()+"_option_log"); + controlsLogDaoimpl.saveControlsLog(comparisonDetailsEntity.getId(),jsonObject.getString("appName"),jsonObject.getString("appCode"),jsonObject.toJSONString(),"接口更新",jsonObject.getString("optionName"),comparisonDetailsEntity.getDbName()+"_option_log"); } //保存操作日志 - controlsLogDaoimpl.saveControlsLog(comparisonEntity.getId(),jsonObject.getString("sourceName"),jsonObject.getString("code"),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("更新成功", integer); }else{ return BaseResult.getFailureMessageEntity("更新失败"); @@ -318,6 +322,9 @@ public class ComparisonServiceImpl extends BaseService if (!checkStr(jsonObject.getString("mdmCode"))) { return BaseResult.getFailureMessageEntity("主数据编码为空"); } + if (!checkStr(jsonObject.getString("optionName"))) { + return BaseResult.getFailureMessageEntity("操作人为空"); + } ComparisonEntity comparisonEntity = jsonObject.toJavaObject(ComparisonEntity.class); ComparisonDetailsEntity comparisonDetailsEntity=new ComparisonDetailsEntity(); JSONObject jsonObjectMain=jsonObject.getJSONObject("main");//获取主表数据 @@ -361,9 +368,9 @@ public class ComparisonServiceImpl extends BaseService comparisonDetailsEntity.setFormmainId(jsonObjectMain.getString("id")); comparisonDetailsEntity.setModify_user_id("c796fd9ba4c9f5ff3cc2fa41a040e443"); comparisonDetailsDao.deleteComparisonDetails(comparisonDetailsEntity); - controlsLogDaoimpl.saveControlsLog(comparisonDetailsEntity.getId(),jsonObject.getString("sourceName"),jsonObject.getString("code"),jsonObject.toJSONString(),"接口删除",jsonObject.getString("optionName"),comparisonEntity.getDbName()+"_option_log"); + controlsLogDaoimpl.saveControlsLog(comparisonDetailsEntity.getId(),jsonObject.getString("appName"),jsonObject.getString("appCode"),jsonObject.toJSONString(),"接口删除",jsonObject.getString("optionName"),comparisonEntity.getDbName()+"_option_log"); } - controlsLogDaoimpl.saveControlsLog(comparisonEntity.getId(),jsonObject.getString("sourceName"),jsonObject.getString("code"),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("删除成功",integer); }else{ return BaseResult.getFailureMessageEntity("删除失败","请查看id是否在表中存在"); @@ -376,6 +383,18 @@ public class ComparisonServiceImpl extends BaseService return BaseResult.getFailureMessageEntity("查询失败","请检查传递参数"); } + //根据应用key和应用密钥获取应用编码和应用名称 + @Override + public SysExtensionApiEntity getAppNameAndCode(SysExtensionApiEntity sysExtensionApiEntity) { + String bodys = sysExtensionApiEntity.getBodys(); + SysApplicationEntity sendApp = sysExtensionApiEntity.getSendApp(); + JSONObject jsonObject = JSON.parseObject(bodys); + jsonObject.put("appName",sendApp.getName()); + jsonObject.put("appCode",sendApp.getAppId()); + sysExtensionApiEntity.setBodys(jsonObject.toJSONString()); + return sysExtensionApiEntity; + } + //根据不同的日期格式,返回不同的值 private String getRuleDate(String str){ switch (str){ From cfbda9907ce15f689291f2192edaf0ba597d4a7f Mon Sep 17 00:00:00 2001 From: hecan <1718492867@qq.com> Date: Thu, 13 Jun 2024 10:08:56 +0800 Subject: [PATCH 31/80] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=8C=85=E8=B7=AF?= =?UTF-8?q?=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../plugin/masterData/org/dao/IMdmOrgDao.java | 6 +++--- .../org/dao/impl/MdmOrgDaoImpl.java | 8 ++++---- .../masterData/org/entity/MdmOrgEntity.java | 2 +- .../masterData/org/entity/MdmOrgEntity.xml | 20 +++++++++---------- .../org/service/IMdmOrgService.java | 5 +++-- .../org/service/impl/MdmOrgServiceImpl.java | 11 +++++----- .../project/dao/IMdmProjectDao.java | 7 ++++--- .../project/dao/impl/MdmProjectDaoImpl.java | 9 +++++---- .../project/entity/MdmProjectEntity.java | 2 +- .../project/entity/MdmProjectEntity.xml | 20 +++++++++---------- .../project/service/IMdmProjectService.java | 5 +++-- .../service/impl/MdmProjectServiceImpl.java | 11 +++++----- .../dao/impl/MdmModuleSourceDaoImpl.java | 2 +- 13 files changed, 57 insertions(+), 51 deletions(-) diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/org/dao/IMdmOrgDao.java b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/org/dao/IMdmOrgDao.java index 7f9d06c5..bfe0e1cd 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/org/dao/IMdmOrgDao.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/org/dao/IMdmOrgDao.java @@ -1,7 +1,7 @@ -package masterData.dao; +package com.hzya.frame.plugin.masterData.org.dao; -import masterData.entity.MdmOrgEntity; -import com.hzya.frame.basedao.dao.IBaseDao; +import com.hzya.frame.basedao.dao.IBaseDao; +import com.hzya.frame.plugin.masterData.org.entity.MdmOrgEntity; /** * 组织档案(mdm_org: table)表数据库访问层 diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/org/dao/impl/MdmOrgDaoImpl.java b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/org/dao/impl/MdmOrgDaoImpl.java index 3648d6b9..dc0271b5 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/org/dao/impl/MdmOrgDaoImpl.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/org/dao/impl/MdmOrgDaoImpl.java @@ -1,7 +1,7 @@ -package masterData.dao.impl; +package com.hzya.frame.plugin.masterData.org.dao.impl; -import masterData.entity.MdmOrgEntity; -import masterData.dao.IMdmOrgDao; +import com.hzya.frame.plugin.masterData.org.dao.IMdmOrgDao; +import com.hzya.frame.plugin.masterData.org.entity.MdmOrgEntity; import org.springframework.stereotype.Repository; import com.hzya.frame.basedao.dao.MybatisGenericDao; /** @@ -10,7 +10,7 @@ import com.hzya.frame.basedao.dao.MybatisGenericDao; * @author makejava * @since 2024-06-07 18:30:04 */ -public class MdmOrgDaoImpl extends MybatisGenericDao implements IMdmOrgDao{ +public class MdmOrgDaoImpl extends MybatisGenericDao implements IMdmOrgDao { } diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/org/entity/MdmOrgEntity.java b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/org/entity/MdmOrgEntity.java index 8d502635..55aa6f31 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/org/entity/MdmOrgEntity.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/org/entity/MdmOrgEntity.java @@ -1,4 +1,4 @@ -package masterData.entity; +package com.hzya.frame.plugin.masterData.org.entity; import java.util.Date; import com.hzya.frame.web.entity.BaseEntity; diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/org/entity/MdmOrgEntity.xml b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/org/entity/MdmOrgEntity.xml index c14c6a01..9c5e813e 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/org/entity/MdmOrgEntity.xml +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/org/entity/MdmOrgEntity.xml @@ -1,8 +1,8 @@ - + - + @@ -60,7 +60,7 @@ ,company_id - select from mdm_org @@ -98,7 +98,7 @@ - select count(1) from mdm_org and id = #{id} @@ -134,7 +134,7 @@ - select from mdm_org @@ -172,7 +172,7 @@ - select from mdm_org @@ -210,7 +210,7 @@ - + insert into mdm_org( id , @@ -316,7 +316,7 @@ org_id = values(org_id), company_id = values(company_id) - + update mdm_org set document_rule = #{documentRule}, @@ -347,12 +347,12 @@ update mdm_org set where id = #{id} - + update mdm_org set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} where id = #{id} - + update mdm_org set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} and id = #{id} diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/org/service/IMdmOrgService.java b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/org/service/IMdmOrgService.java index fe82b199..fa37d8cd 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/org/service/IMdmOrgService.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/org/service/IMdmOrgService.java @@ -1,7 +1,8 @@ -package masterData.service; +package com.hzya.frame.plugin.masterData.org.service; -import masterData.entity.MdmOrgEntity; import com.hzya.frame.basedao.service.IBaseService; +import com.hzya.frame.plugin.masterData.org.entity.MdmOrgEntity; + /** * 组织档案(MdmOrg)表服务接口 * diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/org/service/impl/MdmOrgServiceImpl.java b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/org/service/impl/MdmOrgServiceImpl.java index 700a73ce..f4f543ee 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/org/service/impl/MdmOrgServiceImpl.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/org/service/impl/MdmOrgServiceImpl.java @@ -1,9 +1,10 @@ -package masterData.service.impl; +package com.hzya.frame.plugin.masterData.org.service.impl; -import masterData.entity.MdmOrgEntity; -import masterData.dao.IMdmOrgDao; -import masterData.service.IMdmOrgService; -import org.springframework.stereotype.Service; + +import com.hzya.frame.plugin.masterData.org.dao.IMdmOrgDao; +import com.hzya.frame.plugin.masterData.org.entity.MdmOrgEntity; +import com.hzya.frame.plugin.masterData.org.service.IMdmOrgService; +import org.springframework.stereotype.Service; import org.springframework.beans.factory.annotation.Autowired; import javax.annotation.Resource; import com.hzya.frame.basedao.service.impl.BaseService; diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/project/dao/IMdmProjectDao.java b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/project/dao/IMdmProjectDao.java index 7389b3cc..8b130a7f 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/project/dao/IMdmProjectDao.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/project/dao/IMdmProjectDao.java @@ -1,7 +1,8 @@ -package masterData.dao; +package com.hzya.frame.plugin.masterData.project.dao; -import masterData.entity.MdmProjectEntity; -import com.hzya.frame.basedao.dao.IBaseDao; + +import com.hzya.frame.basedao.dao.IBaseDao; +import com.hzya.frame.plugin.masterData.project.entity.MdmProjectEntity; /** * 项目档案(mdm_project: table)表数据库访问层 diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/project/dao/impl/MdmProjectDaoImpl.java b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/project/dao/impl/MdmProjectDaoImpl.java index 3da10ccc..ae270f7d 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/project/dao/impl/MdmProjectDaoImpl.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/project/dao/impl/MdmProjectDaoImpl.java @@ -1,7 +1,8 @@ -package masterData.dao.impl; +package com.hzya.frame.plugin.masterData.project.dao.impl; -import masterData.entity.MdmProjectEntity; -import masterData.dao.IMdmProjectDao; + +import com.hzya.frame.plugin.masterData.project.dao.IMdmProjectDao; +import com.hzya.frame.plugin.masterData.project.entity.MdmProjectEntity; import org.springframework.stereotype.Repository; import com.hzya.frame.basedao.dao.MybatisGenericDao; /** @@ -10,7 +11,7 @@ import com.hzya.frame.basedao.dao.MybatisGenericDao; * @author makejava * @since 2024-06-07 18:29:23 */ -public class MdmProjectDaoImpl extends MybatisGenericDao implements IMdmProjectDao{ +public class MdmProjectDaoImpl extends MybatisGenericDao implements IMdmProjectDao { } diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/project/entity/MdmProjectEntity.java b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/project/entity/MdmProjectEntity.java index 958d6fc5..fba1cf1c 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/project/entity/MdmProjectEntity.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/project/entity/MdmProjectEntity.java @@ -1,4 +1,4 @@ -package masterData.entity; +package com.hzya.frame.plugin.masterData.project.entity; import java.util.Date; import com.hzya.frame.web.entity.BaseEntity; diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/project/entity/MdmProjectEntity.xml b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/project/entity/MdmProjectEntity.xml index 6003878f..93ec1958 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/project/entity/MdmProjectEntity.xml +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/project/entity/MdmProjectEntity.xml @@ -1,8 +1,8 @@ - + - + @@ -58,7 +58,7 @@ ,company_id - select from mdm_project @@ -95,7 +95,7 @@ - select count(1) from mdm_project and id = #{id} @@ -130,7 +130,7 @@ - select from mdm_project @@ -167,7 +167,7 @@ - select from mdm_project @@ -204,7 +204,7 @@ - + insert into mdm_project( id , @@ -307,7 +307,7 @@ org_id = values(org_id), company_id = values(company_id) - + update mdm_project set document_rule = #{documentRule}, @@ -337,12 +337,12 @@ update mdm_project set where id = #{id} - + update mdm_project set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} where id = #{id} - + update mdm_project set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} and id = #{id} diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/project/service/IMdmProjectService.java b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/project/service/IMdmProjectService.java index 58e801b2..f35a9209 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/project/service/IMdmProjectService.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/project/service/IMdmProjectService.java @@ -1,7 +1,8 @@ -package masterData.service; +package com.hzya.frame.plugin.masterData.project.service; -import masterData.entity.MdmProjectEntity; import com.hzya.frame.basedao.service.IBaseService; +import com.hzya.frame.plugin.masterData.project.entity.MdmProjectEntity; + /** * 项目档案(MdmProject)表服务接口 * diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/project/service/impl/MdmProjectServiceImpl.java b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/project/service/impl/MdmProjectServiceImpl.java index 4dc5e249..0284f229 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/project/service/impl/MdmProjectServiceImpl.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/project/service/impl/MdmProjectServiceImpl.java @@ -1,9 +1,10 @@ -package masterData.service.impl; +package com.hzya.frame.plugin.masterData.project.service.impl; -import masterData.entity.MdmProjectEntity; -import masterData.dao.IMdmProjectDao; -import masterData.service.IMdmProjectService; -import org.springframework.stereotype.Service; + +import com.hzya.frame.plugin.masterData.project.dao.IMdmProjectDao; +import com.hzya.frame.plugin.masterData.project.entity.MdmProjectEntity; +import com.hzya.frame.plugin.masterData.project.service.IMdmProjectService; +import org.springframework.stereotype.Service; import org.springframework.beans.factory.annotation.Autowired; import javax.annotation.Resource; import com.hzya.frame.basedao.service.impl.BaseService; diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleSource/dao/impl/MdmModuleSourceDaoImpl.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleSource/dao/impl/MdmModuleSourceDaoImpl.java index b7cc9034..4e025854 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleSource/dao/impl/MdmModuleSourceDaoImpl.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleSource/dao/impl/MdmModuleSourceDaoImpl.java @@ -18,7 +18,7 @@ public class MdmModuleSourceDaoImpl extends MybatisGenericDao MdmModuleSourceentityGroupByType() { - List list =(List) super.selectList(getSqlIdPrifx() + "MdmModuleSourceentityGroupByType", ""); + List list =(List) super.selectList(getSqlIdPrifx() + "queryMdmModuleSourceentityGroupByType", ""); return list; } From 1b98e96aa5c8b7f1a5f1a82ad3d25505837cc692 Mon Sep 17 00:00:00 2001 From: hecan <1718492867@qq.com> Date: Tue, 7 May 2024 09:04:40 +0800 Subject: [PATCH 32/80] =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E8=BE=93=E5=87=BA=E8=B7=AF=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- buildpackage/src/main/resources/application-hclocal.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/buildpackage/src/main/resources/application-hclocal.yml b/buildpackage/src/main/resources/application-hclocal.yml index 5d960999..0e91791f 100644 --- a/buildpackage/src/main/resources/application-hclocal.yml +++ b/buildpackage/src/main/resources/application-hclocal.yml @@ -6,7 +6,7 @@ logging: encodings: UTF-8 file: # 日志保存路径 - path: /Users/apple/Desktop/log/local + path: D:\yongansystem\kangarooDataCenter\v3\logs spring: datasource: dynamic: @@ -18,6 +18,6 @@ spring: driver-class-name: com.mysql.jdbc.Driver # 3.2.0开始支持SPI可省略此配置 savefile: # 文件保存路径 - path: /Users/apple/Desktop/log/local + path: D:\yongansystem\kangarooDataCenter\v3\logs ax: url: http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface \ No newline at end of file From 5aea5a5fd636d2c0f8073eca1f873838ab69c189 Mon Sep 17 00:00:00 2001 From: hecan <1718492867@qq.com> Date: Mon, 27 May 2024 10:46:36 +0800 Subject: [PATCH 33/80] =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=BA=93=E5=9C=B0=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/application-hclocal.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/buildpackage/src/main/resources/application-hclocal.yml b/buildpackage/src/main/resources/application-hclocal.yml index 0e91791f..995c4368 100644 --- a/buildpackage/src/main/resources/application-hclocal.yml +++ b/buildpackage/src/main/resources/application-hclocal.yml @@ -12,10 +12,14 @@ spring: dynamic: datasource: master: - url: jdbc:mysql://hzya.ufyct.com:9096/businesscenternew?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF8&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowLoadLocalInfile=false&autoReconnect=true&failOverReadOnly=false&connectTimeout=30000&socketTimeout=30000&autoReconnectForPools=true - username: root - password: bd993088e8a7c3dc5f44441617f9b4bf - driver-class-name: com.mysql.jdbc.Driver # 3.2.0开始支持SPI可省略此配置 +# url: jdbc:mysql://hzya.ufyct.com:9096/businesscenternew?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF8&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowLoadLocalInfile=false&autoReconnect=true&failOverReadOnly=false&connectTimeout=30000&socketTimeout=30000&autoReconnectForPools=true +# username: root +# password: bd993088e8a7c3dc5f44441617f9b4bf +# driver-class-name: com.mysql.jdbc.Driver # 3.2.0开始支持SPI可省略此配置 + url: jdbc:mysql://hzya.ufyct.com:9014/businesscenter?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF8&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowLoadLocalInfile=false&autoReconnect=true&failOverReadOnly=false&connectTimeout=30000&socketTimeout=30000&autoReconnectForPools=true + username: root + password: hzya@1314 + driver-class-name: com.mysql.jdbc.Driver # 3.2.0开始支持SPI可省略此配置 savefile: # 文件保存路径 path: D:\yongansystem\kangarooDataCenter\v3\logs From fcc4b15b2a1d8fb808f6432ed03c86ac4cc116aa Mon Sep 17 00:00:00 2001 From: hecan <1718492867@qq.com> Date: Mon, 27 May 2024 11:21:21 +0800 Subject: [PATCH 34/80] =?UTF-8?q?=E6=A1=A3=E6=A1=88=E5=AF=B9=E7=85=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sysnew/comparison/dao/IComparisonDao.java | 71 ++ .../comparison/dao/IComparisonDetailsDao.java | 50 ++ .../dao/impl/ComparisonDaoImpl.java | 54 ++ .../dao/impl/ComparisonDetailsDaoImpl.java | 45 ++ .../entity/ComparisonDetailsEntity.java | 323 ++++++++++ .../entity/ComparisonDetailsEntity.xml | 89 +++ .../comparison/entity/ComparisonEntity.java | 607 ++++++++++++++++++ .../comparison/entity/ComparisonEntity.xml | 158 +++++ .../service/IComparisonDetailsService.java | 7 + .../service/IComparisonService.java | 49 ++ .../impl/ComparisonDetailsServiceImpl.java | 10 + .../service/impl/ComparisonServiceImpl.java | 334 ++++++++++ 12 files changed, 1797 insertions(+) create mode 100644 service/src/main/java/com/hzya/frame/sysnew/comparison/dao/IComparisonDao.java create mode 100644 service/src/main/java/com/hzya/frame/sysnew/comparison/dao/IComparisonDetailsDao.java create mode 100644 service/src/main/java/com/hzya/frame/sysnew/comparison/dao/impl/ComparisonDaoImpl.java create mode 100644 service/src/main/java/com/hzya/frame/sysnew/comparison/dao/impl/ComparisonDetailsDaoImpl.java create mode 100644 service/src/main/java/com/hzya/frame/sysnew/comparison/entity/ComparisonDetailsEntity.java create mode 100644 service/src/main/java/com/hzya/frame/sysnew/comparison/entity/ComparisonDetailsEntity.xml create mode 100644 service/src/main/java/com/hzya/frame/sysnew/comparison/entity/ComparisonEntity.java create mode 100644 service/src/main/java/com/hzya/frame/sysnew/comparison/entity/ComparisonEntity.xml create mode 100644 service/src/main/java/com/hzya/frame/sysnew/comparison/service/IComparisonDetailsService.java create mode 100644 service/src/main/java/com/hzya/frame/sysnew/comparison/service/IComparisonService.java create mode 100644 service/src/main/java/com/hzya/frame/sysnew/comparison/service/impl/ComparisonDetailsServiceImpl.java create mode 100644 service/src/main/java/com/hzya/frame/sysnew/comparison/service/impl/ComparisonServiceImpl.java diff --git a/service/src/main/java/com/hzya/frame/sysnew/comparison/dao/IComparisonDao.java b/service/src/main/java/com/hzya/frame/sysnew/comparison/dao/IComparisonDao.java new file mode 100644 index 00000000..b11a112a --- /dev/null +++ b/service/src/main/java/com/hzya/frame/sysnew/comparison/dao/IComparisonDao.java @@ -0,0 +1,71 @@ +package com.hzya.frame.sysnew.comparison.dao; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.hzya.frame.basedao.dao.IBaseDao; +import com.hzya.frame.sysnew.comparison.entity.ComparisonDetailsEntity; +import com.hzya.frame.sysnew.comparison.entity.ComparisonEntity; + +import java.util.List; + +public interface IComparisonDao extends IBaseDao { + + /** + * + * @content 根据主数据编码查询表名,字段名等信息 + * @Param + * @Return + * @Author hecan + * @Date 2024/5/7 16:05 + * **/ + List queryComparison(ComparisonEntity comparison); + + /** + * + * @content 分页查询数据 + * @Param + * @Return + * @Author hecan + * @Date 2024/5/9 15:11 + * **/ + List queryComparisonPage(ComparisonEntity comparison); + + /** + * + * @content 保存档案对照数据 + * @Param + * @Return + * @Author hecan + * @Date 2024/5/7 16:56 + * **/ + ComparisonEntity saveComparison(ComparisonEntity comparison); + + /** + * + * @content 生成单据规则 如:CK-yyyyMMdd-0001 + * @Param + * @Return + * @Author hecan + * @Date 2024/5/9 9:42 + * **/ + ComparisonEntity queryComparisonRule(ComparisonEntity comparison); + + /** + * + * @content 更新档案对照数据 + * @Param + * @Return + * @Author hecan + * @Date 2024/5/9 10:32 + * **/ + Integer updateComparisonByType(ComparisonEntity comparison); + + /** + * + * @content 删除档案对照数据 + * @Param + * @Return + * @Author hecan + * @Date 2024/5/9 14:09 + * **/ + Integer deleteComparison(ComparisonEntity comparison); +} diff --git a/service/src/main/java/com/hzya/frame/sysnew/comparison/dao/IComparisonDetailsDao.java b/service/src/main/java/com/hzya/frame/sysnew/comparison/dao/IComparisonDetailsDao.java new file mode 100644 index 00000000..731109c9 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/sysnew/comparison/dao/IComparisonDetailsDao.java @@ -0,0 +1,50 @@ +package com.hzya.frame.sysnew.comparison.dao; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.hzya.frame.basedao.dao.IBaseDao; +import com.hzya.frame.sysnew.comparison.entity.ComparisonDetailsEntity; + +import java.util.List; + +public interface IComparisonDetailsDao extends IBaseDao { + + /** + * + * @content 保存档案对照子表数据 + * @Param + * @Return + * @Author hecan + * @Date 2024/5/9 10:41 + * **/ + ComparisonDetailsEntity saveComparisonDetails(ComparisonDetailsEntity comparisonDetailsEntity); + + /** + * + * @content 更新档案对照子表数据 + * @Param + * @Return + * @Author hecan + * @Date 2024/5/9 10:41 + * **/ + Integer updateComparisonDetailsByType(ComparisonDetailsEntity comparisonDetailsEntity); + + /** + * + * @content 删除档案对照子表数据 + * @Param + * @Return + * @Author hecan + * @Date 2024/5/9 14:11 + * **/ + Integer deleteComparisonDetails(ComparisonDetailsEntity comparisonDetailsEntity); + + /** + * + * @content 分页查询子表数据 + * @Param + * @Return + * @Author hecan + * @Date 2024/5/9 15:34 + * **/ + List queryComparisonDetailsPage(ComparisonDetailsEntity comparisonDetailsEntity); +} diff --git a/service/src/main/java/com/hzya/frame/sysnew/comparison/dao/impl/ComparisonDaoImpl.java b/service/src/main/java/com/hzya/frame/sysnew/comparison/dao/impl/ComparisonDaoImpl.java new file mode 100644 index 00000000..695c3683 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/sysnew/comparison/dao/impl/ComparisonDaoImpl.java @@ -0,0 +1,54 @@ +package com.hzya.frame.sysnew.comparison.dao.impl; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.hzya.frame.basedao.dao.MybatisGenericDao; +import com.hzya.frame.sysnew.comparison.dao.IComparisonDao; +import com.hzya.frame.sysnew.comparison.entity.ComparisonEntity; +import org.springframework.stereotype.Repository; + +import java.util.List; + +@Repository(value = "comparisonDaoImpl") +public class ComparisonDaoImpl extends MybatisGenericDao implements IComparisonDao { + //根据主数据编码查询表名,字段名等信息 + @Override + public List queryComparison(ComparisonEntity comparison) { + List query = super.query(getSqlIdPrifx() + "queryComparison", comparison); + return query; + } + + //分页查询 + @Override + public List queryComparisonPage(ComparisonEntity comparison) { + List query = super.query(getSqlIdPrifx() + "queryComparisonPage", comparison); + return query; + } + + //保存数据 + @Override + public ComparisonEntity saveComparison(ComparisonEntity comparison) { + ComparisonEntity comparisonEntity = super.save(getSqlIdPrifx() + "saveComparison", comparison); + return comparisonEntity; + } + + //生成单据规则 + @Override + public ComparisonEntity queryComparisonRule(ComparisonEntity comparison) { + List comparisonEntities = super.query(getSqlIdPrifx() + "queryComparisonRule", comparison); + return comparisonEntities.get(0); + } + + //更新档案对照数据 + @Override + public Integer updateComparisonByType(ComparisonEntity comparison) { + int update = super.update(getSqlIdPrifx() + "updateComparisonByType", comparison); + return update; + } + + //删除档案对照数据 + @Override + public Integer deleteComparison(ComparisonEntity comparison) { + int delete = super.delete(getSqlIdPrifx() + "deleteComparison", comparison); + return delete; + } +} diff --git a/service/src/main/java/com/hzya/frame/sysnew/comparison/dao/impl/ComparisonDetailsDaoImpl.java b/service/src/main/java/com/hzya/frame/sysnew/comparison/dao/impl/ComparisonDetailsDaoImpl.java new file mode 100644 index 00000000..bafc78fe --- /dev/null +++ b/service/src/main/java/com/hzya/frame/sysnew/comparison/dao/impl/ComparisonDetailsDaoImpl.java @@ -0,0 +1,45 @@ +package com.hzya.frame.sysnew.comparison.dao.impl; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.hzya.frame.basedao.dao.MybatisGenericDao; +import com.hzya.frame.sysnew.comparison.dao.IComparisonDao; +import com.hzya.frame.sysnew.comparison.dao.IComparisonDetailsDao; +import com.hzya.frame.sysnew.comparison.entity.ComparisonDetailsEntity; +import com.hzya.frame.sysnew.comparison.entity.ComparisonEntity; +import org.springframework.stereotype.Repository; + +import java.util.List; + +@Repository(value = "comparisonDetailsDaoImpl") +public class ComparisonDetailsDaoImpl extends MybatisGenericDao implements IComparisonDetailsDao { + + //保存档案对照子表数据 + @Override + public ComparisonDetailsEntity saveComparisonDetails(ComparisonDetailsEntity comparisonDetailsEntity) { + ComparisonDetailsEntity detailsEntity = super.save(getSqlIdPrifx() + "saveComparisonDetails", comparisonDetailsEntity); + return detailsEntity; + } + + //更新档案对照子表数据 + @Override + public Integer updateComparisonDetailsByType(ComparisonDetailsEntity comparisonDetailsEntity) { + int update = super.update(getSqlIdPrifx()+"updateComparisonDetailsByType", comparisonDetailsEntity); + return update; + } + + //删除档案对照子表的数据 + @Override + public Integer deleteComparisonDetails(ComparisonDetailsEntity comparisonDetailsEntity) { + int delete = super.delete(getSqlIdPrifx() + "deleteComparisonDetails", comparisonDetailsEntity); + return delete; + } + + //分页查询子表数据 + @Override + public List queryComparisonDetailsPage(ComparisonDetailsEntity comparisonDetailsEntity) { + List query = super.query(getSqlIdPrifx() + "queryComparisonDetailsPage", comparisonDetailsEntity); + return query; + } + + +} 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 new file mode 100644 index 00000000..11ce420d --- /dev/null +++ b/service/src/main/java/com/hzya/frame/sysnew/comparison/entity/ComparisonDetailsEntity.java @@ -0,0 +1,323 @@ +package com.hzya.frame.sysnew.comparison.entity; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.hzya.frame.web.entity.BaseEntity; +import org.springframework.format.annotation.DateTimeFormat; + +import java.util.Date; +import java.util.Map; + +/** + * + * @content 档案对照明细实体类 + * @Param + * @Return + * @Author hecan + * @Date 2024/5/7 15:50 + * **/ +public class ComparisonDetailsEntity extends BaseEntity { + + private String contrastType;//对照类型 + private String documentRule;//单据规则 + private Long documentRuleNum;//单据规则流水号 + private String sszz;//所属组织 + private String bz;//备注 + private String formmainId;//上级id + private String taskLinvingId;//集成任务-实例_id + private String result;//返回结果 + private String queryCondition;//原始查询条件 + private String rootAppPk;//源系统主键 + private String rootAppBill;//原系统单据 + private String rootAppNewData;//最新源系统数据详情 + private String newTransmitInfo;//最新传输信息 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date newPushDate;//最新推送时间 + private String repairPust;//是否补推(Y是N不是) + private String senceId;//场景id + private String newState;//最新推送状态 + private String businessDate;//单据业务日期 + private String pluginId;//插件id + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date processingTime;//处理时间 + private String processingRemarks;//处理备注 + private String processorName;//处理⼈名称 + private String processor;//处理⼈ + private String newSystemNumber;//下游系统单号 + private String newSystemPrimary;//下游系统主键 + + private String mdmName;//主数据名称 + private String mdmCode;//主数据编码 + private String dbName;//表名 + private String dbType;//类型 1、主表 2、明细 + private String enName;//字段名 英文 + private String chName;// 字段名 中文 + private String filedType;//字段类型 1、BIGINT 2、DECIMAL 3、VARCHAR 4、DATETIME + + private Map mapDetails; + + public String getMdmName() { + return mdmName; + } + + public void setMdmName(String mdmName) { + this.mdmName = mdmName; + } + + public String getMdmCode() { + return mdmCode; + } + + public void setMdmCode(String mdmCode) { + this.mdmCode = mdmCode; + } + + public String getDbName() { + return dbName; + } + + public void setDbName(String dbName) { + this.dbName = dbName; + } + + public String getDbType() { + return dbType; + } + + public void setDbType(String dbType) { + this.dbType = dbType; + } + + public String getEnName() { + return enName; + } + + public void setEnName(String enName) { + this.enName = enName; + } + + public String getChName() { + return chName; + } + + public void setChName(String chName) { + this.chName = chName; + } + + public String getFiledType() { + return filedType; + } + + public void setFiledType(String filedType) { + this.filedType = filedType; + } + + public Map getMapDetails() { + return mapDetails; + } + + public void setMapDetails(Map mapDetails) { + this.mapDetails = mapDetails; + } + + public String getContrastType() { + return contrastType; + } + + public void setContrastType(String contrastType) { + this.contrastType = contrastType; + } + + public String getDocumentRule() { + return documentRule; + } + + public void setDocumentRule(String documentRule) { + this.documentRule = documentRule; + } + + public Long getDocumentRuleNum() { + return documentRuleNum; + } + + public void setDocumentRuleNum(Long documentRuleNum) { + this.documentRuleNum = documentRuleNum; + } + + public String getSszz() { + return sszz; + } + + public void setSszz(String sszz) { + this.sszz = sszz; + } + + public String getBz() { + return bz; + } + + public void setBz(String bz) { + this.bz = bz; + } + + public String getFormmainId() { + return formmainId; + } + + public void setFormmainId(String formmainId) { + this.formmainId = formmainId; + } + + public String getTaskLinvingId() { + return taskLinvingId; + } + + public void setTaskLinvingId(String taskLinvingId) { + this.taskLinvingId = taskLinvingId; + } + + public String getResult() { + return result; + } + + public void setResult(String result) { + this.result = result; + } + + public String getQueryCondition() { + return queryCondition; + } + + public void setQueryCondition(String queryCondition) { + this.queryCondition = queryCondition; + } + + public String getRootAppPk() { + return rootAppPk; + } + + public void setRootAppPk(String rootAppPk) { + this.rootAppPk = rootAppPk; + } + + public String getRootAppBill() { + return rootAppBill; + } + + public void setRootAppBill(String rootAppBill) { + this.rootAppBill = rootAppBill; + } + + public String getRootAppNewData() { + return rootAppNewData; + } + + public void setRootAppNewData(String rootAppNewData) { + this.rootAppNewData = rootAppNewData; + } + + public String getNewTransmitInfo() { + return newTransmitInfo; + } + + public void setNewTransmitInfo(String newTransmitInfo) { + this.newTransmitInfo = newTransmitInfo; + } + + public Date getNewPushDate() { + return newPushDate; + } + + public void setNewPushDate(Date newPushDate) { + this.newPushDate = newPushDate; + } + + public String getRepairPust() { + return repairPust; + } + + public void setRepairPust(String repairPust) { + this.repairPust = repairPust; + } + + public String getSenceId() { + return senceId; + } + + public void setSenceId(String senceId) { + this.senceId = senceId; + } + + public String getNewState() { + return newState; + } + + public void setNewState(String newState) { + this.newState = newState; + } + + public String getBusinessDate() { + return businessDate; + } + + public void setBusinessDate(String businessDate) { + this.businessDate = businessDate; + } + + public String getPluginId() { + return pluginId; + } + + public void setPluginId(String pluginId) { + this.pluginId = pluginId; + } + + public Date getProcessingTime() { + return processingTime; + } + + public void setProcessingTime(Date processingTime) { + this.processingTime = processingTime; + } + + public String getProcessingRemarks() { + return processingRemarks; + } + + public void setProcessingRemarks(String processingRemarks) { + this.processingRemarks = processingRemarks; + } + + public String getProcessorName() { + return processorName; + } + + public void setProcessorName(String processorName) { + this.processorName = processorName; + } + + public String getProcessor() { + return processor; + } + + public void setProcessor(String processor) { + this.processor = processor; + } + + public String getNewSystemNumber() { + return newSystemNumber; + } + + public void setNewSystemNumber(String newSystemNumber) { + this.newSystemNumber = newSystemNumber; + } + + public String getNewSystemPrimary() { + return newSystemPrimary; + } + + public void setNewSystemPrimary(String newSystemPrimary) { + this.newSystemPrimary = newSystemPrimary; + } +} 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 new file mode 100644 index 00000000..dfd07457 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/sysnew/comparison/entity/ComparisonDetailsEntity.xml @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + insert into ${dbName} + + + ${column}, + + + values + + + #{value}, + + + + + + + update ${dbName} + + + ${key} =#{value} + + + where formmain_id=#{formmainId} and sts='Y' + + + + + update + ${dbName} + set sts= 'N' ,modify_time = now(),modify_user_id = #{modify_user_id} + + + and formmain_id=#{formmainId} and sts='Y' + + + + + diff --git a/service/src/main/java/com/hzya/frame/sysnew/comparison/entity/ComparisonEntity.java b/service/src/main/java/com/hzya/frame/sysnew/comparison/entity/ComparisonEntity.java new file mode 100644 index 00000000..6f96d23f --- /dev/null +++ b/service/src/main/java/com/hzya/frame/sysnew/comparison/entity/ComparisonEntity.java @@ -0,0 +1,607 @@ +package com.hzya.frame.sysnew.comparison.entity; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.hzya.frame.web.entity.BaseEntity; +import org.springframework.format.annotation.DateTimeFormat; + +import java.util.Date; +import java.util.List; +import java.util.Map; + +/** + * + * @content 档案对照实体类 + * @Param + * @Return + * @Author hecan + * @Date 2024/5/7 15:50 + * **/ +public class ComparisonEntity extends BaseEntity { + private String contrastType;//对照类型 + private String documentRule;//单据规则 + private Long documentRuleNum;//单据规则流水号 + private String ckbm;//仓库编码 + private String ckmc;//仓库名称 + private String cklx;//仓库类型 + private String ckdz;//仓库地址 + private String fzr;//负责人 + private String dh;//电话 + private String ssdd;//所属地点 + private String bz;//备注 + private String ssck;//所属仓库 + private String hwbm;//货位编码 + + private String hwmc;//货位名称 + private String hwrj;//货位容积 + private String dd;//地点 + private String sjzz;//上级组织 + private String zzbm;//组织编码 + private String zzmc;//组织名称 + private String fr;//法人 + private String dz;//地址 + private String taskCode;//任务编码 + private String taskName;//任务名称 + private String taskClasses;//任务分类 + private String taskCron;//任务策略 + private String taskTag;//任务标识 + private String funInfo;//功能介绍/任务描述' + private String senceId;//场景id + private String remark;//备注 + private String taskStatus;//任务状态 + private String serverName;//服务名称 + private String plug;//插件 + private String plugId;//插件id + + private String taskLinvingId;//集成任务-实例_id + private String result;//返回结果 + private String queryCondition;//原始查询条件 + private String rootAppPk;//源系统主键 + private String rootAppBill;//原系统单据 + private String rootAppNewData;//最新源系统数据详情 + private String newTransmitInfo;//最新传输信息 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date newPushDate;//最新推送时间 + private String repairPust;//是否补推(Y是N不是) + private String newState;//最新推送状态 + private String businessDate;//单据业务日期 + private String pluginId;//插件id + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date processingTime;//处理时间 + private String processingRemarks;//处理备注 + private String processorName;//处理⼈名称 + private String processor;//处理⼈ + private String newSystemNumber;//下游系统单号 + private String newSystemPrimary;//下游系统主键 + + private String mdmName;//主数据名称 + private String mdmCode;//主数据编码 + private String dbName;//表名 + private String dbType;//类型 1、主表 2、明细 + private String enName;//字段名 英文 + private String chName;// 字段名 中文 + private String filedType;//字段类型 1、BIGINT 2、DECIMAL 3、VARCHAR 4、DATETIME + + private Map map; + private ComparisonDetailsEntity comparisonDetailsEntity; + private String sszz;//所属组织 + private String formmainId;//上级id + + private String rulePrefix;//规则前缀 CK-yyyyMMdd-0001中的CK + + private List comparisonDetailsEntityList; + + public List getComparisonDetailsEntityList() { + return comparisonDetailsEntityList; + } + + public void setComparisonDetailsEntityList(List comparisonDetailsEntityList) { + this.comparisonDetailsEntityList = comparisonDetailsEntityList; + } + + public String getRulePrefix() { + return rulePrefix; + } + + public void setRulePrefix(String rulePrefix) { + this.rulePrefix = rulePrefix; + } + + public String getSszz() { + return sszz; + } + + public void setSszz(String sszz) { + this.sszz = sszz; + } + + public String getFormmainId() { + return formmainId; + } + + public void setFormmainId(String formmainId) { + this.formmainId = formmainId; + } + + public ComparisonDetailsEntity getComparisonDetailsEntity() { + return comparisonDetailsEntity; + } + + public void setComparisonDetailsEntity(ComparisonDetailsEntity comparisonDetailsEntity) { + this.comparisonDetailsEntity = comparisonDetailsEntity; + } + + public Map getMap() { + return map; + } + + public void setMap(Map map) { + this.map = map; + } + + + public String getMdmName() { + return mdmName; + } + + public void setMdmName(String mdmName) { + this.mdmName = mdmName; + } + + public String getMdmCode() { + return mdmCode; + } + + public void setMdmCode(String mdmCode) { + this.mdmCode = mdmCode; + } + + public String getDbName() { + return dbName; + } + + public void setDbName(String dbName) { + this.dbName = dbName; + } + + public String getDbType() { + return dbType; + } + + public void setDbType(String dbType) { + this.dbType = dbType; + } + + public String getEnName() { + return enName; + } + + public void setEnName(String enName) { + this.enName = enName; + } + + public String getChName() { + return chName; + } + + public void setChName(String chName) { + this.chName = chName; + } + + public String getFiledType() { + return filedType; + } + + public void setFiledType(String filedType) { + this.filedType = filedType; + } + + public String getTaskLinvingId() { + return taskLinvingId; + } + + public void setTaskLinvingId(String taskLinvingId) { + this.taskLinvingId = taskLinvingId; + } + + public String getResult() { + return result; + } + + public void setResult(String result) { + this.result = result; + } + + public String getQueryCondition() { + return queryCondition; + } + + public void setQueryCondition(String queryCondition) { + this.queryCondition = queryCondition; + } + + public String getRootAppPk() { + return rootAppPk; + } + + public void setRootAppPk(String rootAppPk) { + this.rootAppPk = rootAppPk; + } + + public String getRootAppBill() { + return rootAppBill; + } + + public void setRootAppBill(String rootAppBill) { + this.rootAppBill = rootAppBill; + } + + public String getRootAppNewData() { + return rootAppNewData; + } + + public void setRootAppNewData(String rootAppNewData) { + this.rootAppNewData = rootAppNewData; + } + + public String getNewTransmitInfo() { + return newTransmitInfo; + } + + public void setNewTransmitInfo(String newTransmitInfo) { + this.newTransmitInfo = newTransmitInfo; + } + + public Date getNewPushDate() { + return newPushDate; + } + + public void setNewPushDate(Date newPushDate) { + this.newPushDate = newPushDate; + } + + public String getRepairPust() { + return repairPust; + } + + public void setRepairPust(String repairPust) { + this.repairPust = repairPust; + } + + public String getNewState() { + return newState; + } + + public void setNewState(String newState) { + this.newState = newState; + } + + public String getBusinessDate() { + return businessDate; + } + + public void setBusinessDate(String businessDate) { + this.businessDate = businessDate; + } + + public String getPluginId() { + return pluginId; + } + + public void setPluginId(String pluginId) { + this.pluginId = pluginId; + } + + public Date getProcessingTime() { + return processingTime; + } + + public void setProcessingTime(Date processingTime) { + this.processingTime = processingTime; + } + + public String getProcessingRemarks() { + return processingRemarks; + } + + public void setProcessingRemarks(String processingRemarks) { + this.processingRemarks = processingRemarks; + } + + public String getProcessorName() { + return processorName; + } + + public void setProcessorName(String processorName) { + this.processorName = processorName; + } + + public String getProcessor() { + return processor; + } + + public void setProcessor(String processor) { + this.processor = processor; + } + + public String getNewSystemNumber() { + return newSystemNumber; + } + + public void setNewSystemNumber(String newSystemNumber) { + this.newSystemNumber = newSystemNumber; + } + + public String getNewSystemPrimary() { + return newSystemPrimary; + } + + public void setNewSystemPrimary(String newSystemPrimary) { + this.newSystemPrimary = newSystemPrimary; + } + + public String getContrastType() { + return contrastType; + } + + public void setContrastType(String contrastType) { + this.contrastType = contrastType; + } + + public String getDocumentRule() { + return documentRule; + } + + public void setDocumentRule(String documentRule) { + this.documentRule = documentRule; + } + + public Long getDocumentRuleNum() { + return documentRuleNum; + } + + public void setDocumentRuleNum(Long documentRuleNum) { + this.documentRuleNum = documentRuleNum; + } + + public String getCkbm() { + return ckbm; + } + + public void setCkbm(String ckbm) { + this.ckbm = ckbm; + } + + public String getCkmc() { + return ckmc; + } + + public void setCkmc(String ckmc) { + this.ckmc = ckmc; + } + + public String getCklx() { + return cklx; + } + + public void setCklx(String cklx) { + this.cklx = cklx; + } + + public String getCkdz() { + return ckdz; + } + + public void setCkdz(String ckdz) { + this.ckdz = ckdz; + } + + public String getFzr() { + return fzr; + } + + public void setFzr(String fzr) { + this.fzr = fzr; + } + + public String getDh() { + return dh; + } + + public void setDh(String dh) { + this.dh = dh; + } + + public String getSsdd() { + return ssdd; + } + + public void setSsdd(String ssdd) { + this.ssdd = ssdd; + } + + public String getBz() { + return bz; + } + + public void setBz(String bz) { + this.bz = bz; + } + + public String getSsck() { + return ssck; + } + + public void setSsck(String ssck) { + this.ssck = ssck; + } + + public String getHwbm() { + return hwbm; + } + + public void setHwbm(String hwbm) { + this.hwbm = hwbm; + } + + public String getHwmc() { + return hwmc; + } + + public void setHwmc(String hwmc) { + this.hwmc = hwmc; + } + + public String getHwrj() { + return hwrj; + } + + public void setHwrj(String hwrj) { + this.hwrj = hwrj; + } + + public String getDd() { + return dd; + } + + public void setDd(String dd) { + this.dd = dd; + } + + public String getSjzz() { + return sjzz; + } + + public void setSjzz(String sjzz) { + this.sjzz = sjzz; + } + + public String getZzbm() { + return zzbm; + } + + public void setZzbm(String zzbm) { + this.zzbm = zzbm; + } + + public String getZzmc() { + return zzmc; + } + + public void setZzmc(String zzmc) { + this.zzmc = zzmc; + } + + public String getFr() { + return fr; + } + + public void setFr(String fr) { + this.fr = fr; + } + + public String getDz() { + return dz; + } + + public void setDz(String dz) { + this.dz = dz; + } + + public String getTaskCode() { + return taskCode; + } + + public void setTaskCode(String taskCode) { + this.taskCode = taskCode; + } + + public String getTaskName() { + return taskName; + } + + public void setTaskName(String taskName) { + this.taskName = taskName; + } + + public String getTaskClasses() { + return taskClasses; + } + + public void setTaskClasses(String taskClasses) { + this.taskClasses = taskClasses; + } + + public String getTaskCron() { + return taskCron; + } + + public void setTaskCron(String taskCron) { + this.taskCron = taskCron; + } + + public String getTaskTag() { + return taskTag; + } + + public void setTaskTag(String taskTag) { + this.taskTag = taskTag; + } + + public String getFunInfo() { + return funInfo; + } + + public void setFunInfo(String funInfo) { + this.funInfo = funInfo; + } + + public String getSenceId() { + return senceId; + } + + public void setSenceId(String senceId) { + this.senceId = senceId; + } + + public String getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark; + } + + public String getTaskStatus() { + return taskStatus; + } + + public void setTaskStatus(String taskStatus) { + this.taskStatus = taskStatus; + } + + public String getServerName() { + return serverName; + } + + public void setServerName(String serverName) { + this.serverName = serverName; + } + + public String getPlug() { + return plug; + } + + public void setPlug(String plug) { + this.plug = plug; + } + + public String getPlugId() { + return plugId; + } + + public void setPlugId(String plugId) { + this.plugId = plugId; + } +} 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 new file mode 100644 index 00000000..ff5c6469 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/sysnew/comparison/entity/ComparisonEntity.xml @@ -0,0 +1,158 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + insert into ${dbName} + + + ${column}, + + + values + + + #{value}, + + + + + + + update ${dbName} + + + ${key} =#{value} + + + where id=#{id} and sts='Y' + + + + + + update + ${dbName} + set sts= 'N' ,modify_time = now(),modify_user_id = #{modify_user_id} + + + and ${key} =#{value} + + and id=#{id} and sts='Y' + + + + + diff --git a/service/src/main/java/com/hzya/frame/sysnew/comparison/service/IComparisonDetailsService.java b/service/src/main/java/com/hzya/frame/sysnew/comparison/service/IComparisonDetailsService.java new file mode 100644 index 00000000..ac5db9c0 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/sysnew/comparison/service/IComparisonDetailsService.java @@ -0,0 +1,7 @@ +package com.hzya.frame.sysnew.comparison.service; + +import com.hzya.frame.basedao.service.IBaseService; +import com.hzya.frame.sysnew.comparison.entity.ComparisonDetailsEntity; + +public interface IComparisonDetailsService extends IBaseService { +} diff --git a/service/src/main/java/com/hzya/frame/sysnew/comparison/service/IComparisonService.java b/service/src/main/java/com/hzya/frame/sysnew/comparison/service/IComparisonService.java new file mode 100644 index 00000000..60375cfb --- /dev/null +++ b/service/src/main/java/com/hzya/frame/sysnew/comparison/service/IComparisonService.java @@ -0,0 +1,49 @@ +package com.hzya.frame.sysnew.comparison.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 IComparisonService extends IBaseService { + + /** + * + * @content 分页查询档案对照数据 + * @Param + * @Return + * @Author hecan + * @Date 2024/5/7 15:55 + * **/ + JsonResultEntity queryEntityPage(JSONObject jsonObject); + + /** + * + * @content 新增档案对照数据 + * @Param + * @Return + * @Author hecan + * @Date 2024/5/7 16:52 + * **/ + JsonResultEntity saveEntity(JSONObject jsonObject); + + /** + * + * @content 编辑档案对照数据 + * @Param + * @Return + * @Author hecan + * @Date 2024/5/9 10:19 + * **/ + JsonResultEntity updateEntity(JSONObject jsonObject); + + /** + * + * @content 删除档案对照数据 + * @Param + * @Return + * @Author hecan + * @Date 2024/5/9 13:59 + * **/ + JsonResultEntity deleteEntity(JSONObject jsonObject); +} diff --git a/service/src/main/java/com/hzya/frame/sysnew/comparison/service/impl/ComparisonDetailsServiceImpl.java b/service/src/main/java/com/hzya/frame/sysnew/comparison/service/impl/ComparisonDetailsServiceImpl.java new file mode 100644 index 00000000..64b6bfd9 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/sysnew/comparison/service/impl/ComparisonDetailsServiceImpl.java @@ -0,0 +1,10 @@ +package com.hzya.frame.sysnew.comparison.service.impl; + +import com.hzya.frame.basedao.service.impl.BaseService; +import com.hzya.frame.sysnew.comparison.entity.ComparisonDetailsEntity; +import com.hzya.frame.sysnew.comparison.service.IComparisonDetailsService; +import org.springframework.stereotype.Service; + +@Service(value = "comparisonDetailsServiceImpl") +public class ComparisonDetailsServiceImpl extends BaseService implements IComparisonDetailsService { +} 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 new file mode 100644 index 00000000..e449e22d --- /dev/null +++ b/service/src/main/java/com/hzya/frame/sysnew/comparison/service/impl/ComparisonServiceImpl.java @@ -0,0 +1,334 @@ +package com.hzya.frame.sysnew.comparison.service.impl; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.github.pagehelper.PageInfo; +import com.hzya.frame.basedao.service.impl.BaseService; +import com.hzya.frame.sysnew.comparison.dao.IComparisonDao; +import com.hzya.frame.sysnew.comparison.dao.IComparisonDetailsDao; +import com.hzya.frame.sysnew.comparison.entity.ComparisonDetailsEntity; +import com.hzya.frame.sysnew.comparison.entity.ComparisonEntity; +import com.hzya.frame.sysnew.comparison.service.IComparisonService; +import com.hzya.frame.sysnew.generalData.dao.IGeneralDataDao; +import com.hzya.frame.uuid.UUIDUtils; +import com.hzya.frame.web.entity.BaseResult; +import com.hzya.frame.web.entity.JsonResultEntity; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import sun.java2d.pipe.AAShapePipe; + +import java.util.*; + +@Service(value = "comparisonServiceImpl") +public class ComparisonServiceImpl extends BaseService implements IComparisonService { + + private IComparisonDao comparisonDao; + + @Autowired + private IComparisonDetailsDao comparisonDetailsDao; + + @Autowired + public void setGeneralDataDao(IComparisonDao dao) { + this.comparisonDao = dao; + this.dao = dao; + } + + //分页查询档案对照数据 + @Override + public JsonResultEntity queryEntityPage(JSONObject json) { + JSONObject jsonObject = json.getJSONObject("jsonStr"); + if (jsonObject == null) { + return BaseResult.getFailureMessageEntity("数据为空,请先传递数据"); + } + if (!checkStr(jsonObject.getString("mdmCode"))) { + return BaseResult.getFailureMessageEntity("主数据编码为空"); + } + ComparisonEntity comparisonEntity = jsonObject.toJavaObject(ComparisonEntity.class); + List comparisonEntities=new ArrayList<>(); + try { + //根据主数据编码查询表名称,字段名称等信息 10001 + comparisonEntities = comparisonDao.queryComparison(comparisonEntity); + }catch (Exception e){ + logger.info("根据主数据编码查询信息错误:{}",e.getMessage()); + return BaseResult.getFailureMessageEntity("查询失败",e.getMessage()); + } + Map map = new HashMap<>();//将主表数据存到map中 + if (comparisonEntities != null && comparisonEntities.size() > 0) { + for (ComparisonEntity entity : comparisonEntities) { + //遍历主表下面的所有key,字段名 + for (String key : jsonObject.keySet()) { + if (entity.getDbType().equals("1")) { + comparisonEntity.setDbName(entity.getDbName()); + if(!"mdmCode".equals(key)){ + map.put(key, jsonObject.getString(key)); + } + } + } + } + comparisonEntity.setMap(map); + try { + List comparisonEntitiePages = comparisonDao.queryComparisonPage(comparisonEntity); + PageInfo pageInfo = new PageInfo(comparisonEntitiePages); + return BaseResult.getSuccessMessageEntity("查询成功", pageInfo); + } catch (Exception e) { + logger.info("查询档案对照错误:{}", e.getMessage()); + return BaseResult.getFailureMessageEntity("查询失败", e.getMessage()); + } + } + return BaseResult.getFailureMessageEntity("查询失败","请检查传递参数"); + } + + //新增档案对照数据 + @Override + public JsonResultEntity saveEntity(JSONObject json) { + JSONObject jsonObject = json.getJSONObject("jsonStr"); + if (jsonObject == null) { + return BaseResult.getFailureMessageEntity("数据为空,请先传递数据"); + } + if (!checkStr(jsonObject.getString("mdmCode"))) { + 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<>(); + try { + //根据主数据编码查询表名称,字段名称等信息 10001 + comparisonEntities = comparisonDao.queryComparison(comparisonEntity); + }catch (Exception e){ + logger.info("根据主数据编码查询信息错误:{}",e.getMessage()); + return BaseResult.getFailureMessageEntity("保存失败",e.getMessage()); + } + String main = jsonObject.getString("main");//获取主表数据 + JSONArray jsonArray = jsonObject.getJSONArray("details");//获取子表数据 + JSONObject jsonObjectMain = JSONObject.parseObject(main); + if(jsonObjectMain != null ) { + Map map = new HashMap<>();//将主表数据存到map中 + Map mapDetails = new HashMap<>();//将子表数据存到map中 + if (comparisonEntities != null && comparisonEntities.size() > 0) { + for (ComparisonEntity entity : comparisonEntities) { + //遍历主表下面的所有key,字段名 + for (String key : jsonObjectMain.keySet()) { + if (entity.getDbType().equals("1")) { + comparisonEntity.setDbName(entity.getDbName()); + map.put(key, jsonObjectMain.getString(key)); + } + } + } + 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()); + mapDetails.put(key, jsonObjectDetails.getString(key)); + } + } + } + } + } + String uuid = UUIDUtils.getUUID(); + map.put("id", uuid); + 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"); + comparisonEntity.setMap(map); + //生成单据规则 + comparisonEntity.setRulePrefix(jsonObject.getString("rulePrefix")); + try { + ComparisonEntity comparisonEntityRule = comparisonDao.queryComparisonRule(comparisonEntity); + map.put("document_rule", comparisonEntityRule.getDocumentRule());//单据规则 + map.put("document_rule_num", comparisonEntityRule.getDocumentRuleNum());//单据规则流水号 + } catch (Exception e) { + logger.info("保存档案对照时候生成单据规则错误:{}", e.getMessage()); + return BaseResult.getFailureMessageEntity("保存失败", e.getMessage()); + } + try { + //保存主表数据 + ComparisonEntity comparisonEntityOne = comparisonDao.saveComparison(comparisonEntity); + //保存子表数据 + if (mapDetails != null && mapDetails.size() > 0) { + mapDetails.put("id", UUIDUtils.getUUID()); + 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"); + comparisonDetailsEntity.setMapDetails(mapDetails); + ComparisonDetailsEntity comparisonDetailsEntityOne = comparisonDetailsDao.saveComparisonDetails(comparisonDetailsEntity); + comparisonEntityOne.setComparisonDetailsEntity(comparisonDetailsEntityOne); + } + return BaseResult.getSuccessMessageEntity("保存成功", comparisonEntityOne); + } catch (Exception e) { + logger.info("保存档案对照时候错误:{}", e.getMessage()); + return BaseResult.getFailureMessageEntity("保存失败", e.getMessage()); + } + } + } + return BaseResult.getFailureMessageEntity("查询失败","请检查传递参数"); + } + + //更新档案对照数据 + @Override + public JsonResultEntity updateEntity(JSONObject json) { + JSONObject jsonObject = json.getJSONObject("jsonStr"); + if (jsonObject == null) { + return BaseResult.getFailureMessageEntity("数据为空,请先传递数据"); + } + if (!checkStr(jsonObject.getString("mdmCode"))) { + return BaseResult.getFailureMessageEntity("主数据编码为空"); + } + 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 { + comparisonEntities = comparisonDao.queryComparison(comparisonEntity); + }catch (Exception e){ + logger.info("根据主数据编码查询信息错误:{}",e.getMessage()); + return BaseResult.getFailureMessageEntity("更新失败",e.getMessage()); + } + Map map=new HashMap<>();//将主表数据存到map中 + Map mapDetails=new HashMap<>();//将子表数据存到map中 + if(comparisonEntities !=null && comparisonEntities.size()>0) { + for (ComparisonEntity entity : comparisonEntities) { + //遍历主表下面的所有key,字段名 + for (String key : jsonObjectMain.keySet()) { + if (entity.getDbType().equals("1")) { + comparisonEntity.setDbName(entity.getDbName()); + map.put(key, jsonObjectMain.getString(key)); + } + } + } + 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()); + mapDetails.put(key, jsonObjectDetails.getString(key)); + } + } + } + } + } + map.put("create_user_id", "c796fd9ba4c9f5ff3cc2fa41a040e443"); + map.put("modify_user_id", "c796fd9ba4c9f5ff3cc2fa41a040e443"); + map.put("org_id", "0"); + map.put("modify_time", new Date()); + map.put("sts", "Y"); + comparisonEntity.setMap(map); + comparisonEntity.setId(jsonObjectMain.getString("id")); + /*//生成单据规则 + comparisonEntity.setRulePrefix(jsonObject.getString("rulePrefix")); + try { + ComparisonEntity comparisonEntityRule = comparisonDao.queryComparisonRule(comparisonEntity); + map.put("document_rule",comparisonEntityRule.getDocumentRule());//单据规则 + map.put("document_rule_num",comparisonEntityRule.getDocumentRuleNum());//单据规则流水号 + }catch (Exception e){ + logger.info("更新档案对照时候生成单据规则错误:{}",e.getMessage()); + return BaseResult.getFailureMessageEntity("更新失败",e.getMessage()); + }*/ + try { + //保存主表数据 + Integer integer = comparisonDao.updateComparisonByType(comparisonEntity); + 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"); + comparisonDetailsEntity.setFormmainId(jsonObjectMain.getString("id")); + comparisonDetailsEntity.setMapDetails(mapDetails); + comparisonDetailsDao.updateComparisonDetailsByType(comparisonDetailsEntity); + return BaseResult.getSuccessMessageEntity("更新成功", integer); + } + }else{ + return BaseResult.getFailureMessageEntity("更新失败", "请查看id是否在表中存在"); + } + } catch (Exception e) { + logger.info("更新档案对照时候错误:{}", e.getMessage()); + return BaseResult.getFailureMessageEntity("更新失败", e.getMessage()); + } + } + return BaseResult.getFailureMessageEntity("查询失败","请检查传递参数"); + } + + //删除当初对照数据 + @Override + public JsonResultEntity deleteEntity(JSONObject json) { + JSONObject jsonObject = json.getJSONObject("jsonStr"); + if (jsonObject == null) { + return BaseResult.getFailureMessageEntity("数据为空,请先传递数据"); + } + if (!checkStr(jsonObject.getString("mdmCode"))) { + return BaseResult.getFailureMessageEntity("主数据编码为空"); + } + ComparisonEntity comparisonEntity = jsonObject.toJavaObject(ComparisonEntity.class); + ComparisonDetailsEntity comparisonDetailsEntity=new ComparisonDetailsEntity(); + JSONObject jsonObjectMain=jsonObject.getJSONObject("main");//获取主表数据 + if(!checkStr(jsonObjectMain.getString("id"))){ + return BaseResult.getFailureMessageEntity("删除时候主表id不能为空"); + } + List comparisonEntities=new ArrayList<>(); + //根据主数据编码查询表名称,字段名称等信息 10001 + try { + comparisonEntities = comparisonDao.queryComparison(comparisonEntity); + }catch (Exception e){ + logger.info("根据主数据编码查询信息错误:{}",e.getMessage()); + return BaseResult.getFailureMessageEntity("删除失败",e.getMessage()); + } + Map map=new HashMap<>(); + if(comparisonEntities !=null && comparisonEntities.size()>0) { + for (ComparisonEntity entity : comparisonEntities) { + //遍历主表下面的所有key,字段名 + for (String key : jsonObjectMain.keySet()) { + if (entity.getDbType().equals("1")) { + comparisonEntity.setDbName(entity.getDbName()); + map.put(key, jsonObjectMain.getString(key)); + } + if(entity.getDbType().equals("2")){ + comparisonDetailsEntity.setDbName(entity.getDbName()); + } + } + } + comparisonEntity.setId(jsonObjectMain.getString("id")); + comparisonEntity.setModify_user_id("c796fd9ba4c9f5ff3cc2fa41a040e443"); + comparisonEntity.setMap(map); + try { + Integer integer = comparisonDao.deleteComparison(comparisonEntity); + if(integer>0){ + comparisonDetailsEntity.setFormmainId(jsonObjectMain.getString("id")); + comparisonDetailsEntity.setModify_user_id("c796fd9ba4c9f5ff3cc2fa41a040e443"); + comparisonDetailsDao.deleteComparisonDetails(comparisonDetailsEntity); + return BaseResult.getSuccessMessageEntity("删除成功",integer); + }else{ + return BaseResult.getFailureMessageEntity("删除失败","请查看id是否在表中存在"); + } + }catch (Exception e){ + logger.info("删除档案对照数据错误:{}",e.getMessage()); + return BaseResult.getFailureMessageEntity("删除失败",e.getMessage()); + } + } + return BaseResult.getFailureMessageEntity("查询失败","请检查传递参数"); + } +} From 53db9d524b90b2558a4c8ac16e420e65dabd739f Mon Sep 17 00:00:00 2001 From: hecan <1718492867@qq.com> Date: Mon, 27 May 2024 11:22:38 +0800 Subject: [PATCH 35/80] =?UTF-8?q?=E9=80=9A=E7=94=A8=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../generalData/dao/IGeneralDataDao.java | 49 ++++ .../dao/impl/GeneralDataDaoImpl.java | 40 +++ .../generalData/entity/GeneralDataEntity.java | 169 ++++++++++++ .../generalData/entity/GeneralDataEntity.xml | 258 ++++++++++++++++++ .../service/IGeneralDataService.java | 59 ++++ .../service/impl/GeneralDataServiceImpl.java | 241 ++++++++++++++++ 6 files changed, 816 insertions(+) create mode 100644 service/src/main/java/com/hzya/frame/sysnew/generalData/dao/IGeneralDataDao.java create mode 100644 service/src/main/java/com/hzya/frame/sysnew/generalData/dao/impl/GeneralDataDaoImpl.java create mode 100644 service/src/main/java/com/hzya/frame/sysnew/generalData/entity/GeneralDataEntity.java create mode 100644 service/src/main/java/com/hzya/frame/sysnew/generalData/entity/GeneralDataEntity.xml create mode 100644 service/src/main/java/com/hzya/frame/sysnew/generalData/service/IGeneralDataService.java create mode 100644 service/src/main/java/com/hzya/frame/sysnew/generalData/service/impl/GeneralDataServiceImpl.java diff --git a/service/src/main/java/com/hzya/frame/sysnew/generalData/dao/IGeneralDataDao.java b/service/src/main/java/com/hzya/frame/sysnew/generalData/dao/IGeneralDataDao.java new file mode 100644 index 00000000..ec391b3a --- /dev/null +++ b/service/src/main/java/com/hzya/frame/sysnew/generalData/dao/IGeneralDataDao.java @@ -0,0 +1,49 @@ +package com.hzya.frame.sysnew.generalData.dao; + +import com.hzya.frame.basedao.dao.IBaseDao; +import com.hzya.frame.sysnew.generalData.entity.GeneralDataEntity; + +import java.util.List; + +public interface IGeneralDataDao extends IBaseDao { + + /** + * + * @content 新增通用数据 + * @Param + * @Return + * @Author hecan + * @Date 2024/5/6 16:49 + * **/ + GeneralDataEntity saveGeneralDataByType(GeneralDataEntity generalDataEntity); + + /** + * + * @content 查询通用数据 + * @Param + * @Return + * @Author hecan + * @Date 2024/5/6 16:51 + * **/ + List queryGeneralData(GeneralDataEntity generalDataEntity); + + /** + * + * @content 编辑通用数据 + * @Param + * @Return + * @Author hecan + * @Date 2024/5/6 17:17 + * **/ + Integer updateGeneralDataByType(GeneralDataEntity generalDataEntity); + + /** + * + * @content 删除通用数据 + * @Param + * @Return + * @Author hecan + * @Date 2024/5/6 17:20 + * **/ + Integer deleteGeneralDataByType(GeneralDataEntity generalDataEntity); +} diff --git a/service/src/main/java/com/hzya/frame/sysnew/generalData/dao/impl/GeneralDataDaoImpl.java b/service/src/main/java/com/hzya/frame/sysnew/generalData/dao/impl/GeneralDataDaoImpl.java new file mode 100644 index 00000000..b94f80c0 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/sysnew/generalData/dao/impl/GeneralDataDaoImpl.java @@ -0,0 +1,40 @@ +package com.hzya.frame.sysnew.generalData.dao.impl; + +import com.hzya.frame.basedao.dao.MybatisGenericDao; +import com.hzya.frame.sysnew.generalData.dao.IGeneralDataDao; +import com.hzya.frame.sysnew.generalData.entity.GeneralDataEntity; +import org.springframework.stereotype.Repository; + +import java.util.List; + + +@Repository(value = "generalDataDaoImpl") +public class GeneralDataDaoImpl extends MybatisGenericDao implements IGeneralDataDao { + //新增通用数据 + @Override + public GeneralDataEntity saveGeneralDataByType(GeneralDataEntity generalDataEntity) { + generalDataEntity = super.save(getSqlIdPrifx() + "saveGeneralDataByType", generalDataEntity); + return generalDataEntity; + } + + //查询通用数据 + @Override + public List queryGeneralData(GeneralDataEntity generalDataEntity) { + List query = super.query(getSqlIdPrifx() + "queryGeneralData", generalDataEntity); + return query; + } + + //编辑通用数据 + @Override + public Integer updateGeneralDataByType(GeneralDataEntity generalDataEntity) { + int update = super.update(getSqlIdPrifx() + "updateGeneralDataByType", generalDataEntity); + return update; + } + + //删除通用数据 + @Override + public Integer deleteGeneralDataByType(GeneralDataEntity generalDataEntity) { + int update = super.update(getSqlIdPrifx() + "deleteGeneralDataByType", generalDataEntity); + return update; + } +} diff --git a/service/src/main/java/com/hzya/frame/sysnew/generalData/entity/GeneralDataEntity.java b/service/src/main/java/com/hzya/frame/sysnew/generalData/entity/GeneralDataEntity.java new file mode 100644 index 00000000..5aef2e9f --- /dev/null +++ b/service/src/main/java/com/hzya/frame/sysnew/generalData/entity/GeneralDataEntity.java @@ -0,0 +1,169 @@ +package com.hzya.frame.sysnew.generalData.entity; + +import com.hzya.frame.web.entity.BaseEntity; + +/** + * + * @content 通用数据接口实体类 + * @Param + * @Return + * @Author hecan + * @Date 2024/5/6 16:21 + * **/ +public class GeneralDataEntity extends BaseEntity { + private String archivesType;//类型 + private String leftCode;//左编码 + private String rightCode;//右编码 + + private String leftAppId;//左应用id + private String leftAppCode;//左应用编码 + private String leftAppName;//左应用名称 + private String leftApiId;//左接口ID + private String leftId;//左id + private String leftName;//左名称 + private String rightAppId;//右应用id + private String rightAppCode;//右应用编码 + private String rightAppName;//右应用名称 + private String rightApiId;//右接口ID + private String rightId;//右id + private String rightName;//右名称 + + private String leftOrg;//左公司 + private String rightOrg;//右公司 + + public String getLeftOrg() { + return leftOrg; + } + + public void setLeftOrg(String leftOrg) { + this.leftOrg = leftOrg; + } + + public String getRightOrg() { + return rightOrg; + } + + public void setRightOrg(String rightOrg) { + this.rightOrg = rightOrg; + } + + public String getArchivesType() { + return archivesType; + } + + public void setArchivesType(String archivesType) { + this.archivesType = archivesType; + } + + public String getLeftCode() { + return leftCode; + } + + public void setLeftCode(String leftCode) { + this.leftCode = leftCode; + } + + public String getRightCode() { + return rightCode; + } + + public void setRightCode(String rightCode) { + this.rightCode = rightCode; + } + + public String getLeftAppId() { + return leftAppId; + } + + public void setLeftAppId(String leftAppId) { + this.leftAppId = leftAppId; + } + + public String getLeftAppCode() { + return leftAppCode; + } + + public void setLeftAppCode(String leftAppCode) { + this.leftAppCode = leftAppCode; + } + + public String getLeftAppName() { + return leftAppName; + } + + public void setLeftAppName(String leftAppName) { + this.leftAppName = leftAppName; + } + + public String getLeftApiId() { + return leftApiId; + } + + public void setLeftApiId(String leftApiId) { + this.leftApiId = leftApiId; + } + + public String getLeftId() { + return leftId; + } + + public void setLeftId(String leftId) { + this.leftId = leftId; + } + + public String getLeftName() { + return leftName; + } + + public void setLeftName(String leftName) { + this.leftName = leftName; + } + + public String getRightAppId() { + return rightAppId; + } + + public void setRightAppId(String rightAppId) { + this.rightAppId = rightAppId; + } + + public String getRightAppCode() { + return rightAppCode; + } + + public void setRightAppCode(String rightAppCode) { + this.rightAppCode = rightAppCode; + } + + public String getRightAppName() { + return rightAppName; + } + + public void setRightAppName(String rightAppName) { + this.rightAppName = rightAppName; + } + + public String getRightApiId() { + return rightApiId; + } + + public void setRightApiId(String rightApiId) { + this.rightApiId = rightApiId; + } + + public String getRightId() { + return rightId; + } + + public void setRightId(String rightId) { + this.rightId = rightId; + } + + public String getRightName() { + return rightName; + } + + public void setRightName(String rightName) { + this.rightName = rightName; + } +} diff --git a/service/src/main/java/com/hzya/frame/sysnew/generalData/entity/GeneralDataEntity.xml b/service/src/main/java/com/hzya/frame/sysnew/generalData/entity/GeneralDataEntity.xml new file mode 100644 index 00000000..50065a16 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/sysnew/generalData/entity/GeneralDataEntity.xml @@ -0,0 +1,258 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + insert into + + sys_personnel_control + sys_org_control + sys_stock_control + sys_merchant_control + sys_taxrate_control + sys_project_control + sys_bank_control + sys_bankaccount_control + sys_assets_control + + ( + + id , + left_app_id , + left_app_code , + left_app_name , + left_api_id , + left_id , + left_code , + left_name , + right_app_id , + right_app_code , + right_app_name , + right_api_id , + right_id , + right_code , + right_name , + left_org , + right_org , + sorts , + create_user_id , + modify_user_id , + org_id , + company_id , + create_time, + modify_time, + sts + + )values( + + #{id} , + #{leftAppId} , + #{leftAppCode} , + #{leftAppName} , + #{leftApiId} , + #{leftId} , + #{leftCode} , + #{leftName} , + #{rightAppId} , + #{rightAppCode} , + #{rightAppName} , + #{rightApiId} , + #{rightId} , + #{rightCode} , + #{rightName} , + #{leftOrg} , + #{rightOrg} , + #{sorts} , + (select (max(IFNULL( a.sorts, 0 )) + 1) as sort from + + sys_personnel_control + sys_org_control + sys_stock_control + sys_merchant_control + sys_taxrate_control + sys_project_control + sys_bank_control + sys_bankaccount_control + sys_assets_control + + a WHERE a.sts = 'Y' ), + #{create_user_id} , + #{modify_user_id} , + #{org_id} , + #{companyId} , + #{create_time} , + now() , + #{modify_time} , + now() , + #{sts} , + 'Y' + + ) + + + + + update + + sys_personnel_control + sys_org_control + sys_stock_control + sys_merchant_control + sys_taxrate_control + sys_project_control + sys_bank_control + sys_bankaccount_control + sys_assets_control + + set + + left_app_id = #{leftAppId}, + left_app_code = #{leftAppCode}, + left_app_name = #{leftAppName}, + left_api_id = #{leftApiId}, + left_id = #{leftId}, + left_code = #{leftCode}, + left_name = #{leftName}, + right_app_id = #{rightAppId}, + right_app_code = #{rightAppCode}, + right_app_name = #{rightAppName}, + right_api_id = #{rightApiId}, + right_id = #{rightId}, + right_code = #{rightCode}, + right_name = #{rightName}, + left_org = #{leftOrg} , + right_org = #{rightOrg} , + sorts = #{sorts}, + create_user_id = #{create_user_id}, + create_time = #{create_time}, + modify_user_id = #{modify_user_id}, + modify_time = #{modify_time}, + modify_time = now(), + sts = #{sts}, + org_id = #{org_id}, + company_id = #{companyId} + + where id = #{id} + + + + + update + + sys_personnel_control + sys_org_control + sys_stock_control + sys_merchant_control + sys_taxrate_control + sys_project_control + sys_bank_control + sys_bankaccount_control + sys_assets_control + + set sts= 'N' ,modify_time = now(),modify_user_id = #{modify_user_id} + + and left_app_id = #{leftAppId} + and left_app_code = #{leftAppCode} + and left_app_name = #{leftAppName} + and left_api_id = #{leftApiId} + and left_id = #{leftId} + and left_code = #{leftCode} + and left_name = #{leftName} + and right_app_id = #{rightAppId} + and right_app_code = #{rightAppCode} + and right_app_name = #{rightAppName} + and right_api_id = #{rightApiId} + and right_id = #{rightId} + and right_code = #{rightCode} + and right_name = #{rightName} + left_org = #{leftOrg} , + right_org = #{rightOrg} , + and sorts = #{sorts} + and sts = #{sts} + and company_id = #{companyId} + and id=#{id} and sts='Y' + + + + + diff --git a/service/src/main/java/com/hzya/frame/sysnew/generalData/service/IGeneralDataService.java b/service/src/main/java/com/hzya/frame/sysnew/generalData/service/IGeneralDataService.java new file mode 100644 index 00000000..df8dbd47 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/sysnew/generalData/service/IGeneralDataService.java @@ -0,0 +1,59 @@ +package com.hzya.frame.sysnew.generalData.service; + +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.basedao.service.IBaseService; +import com.hzya.frame.sysnew.generalData.entity.GeneralDataEntity; +import com.hzya.frame.web.entity.JsonResultEntity; + +public interface IGeneralDataService extends IBaseService { + + /** + * + * @content 新增通用数据 + * @Param + * @Return + * @Author hecan + * @Date 2024/5/6 16:23 + * **/ + JsonResultEntity saveEntity(JSONObject jsonObject); + + /** + * + * @content 查询通用数据 + * @Param + * @Return + * @Author hecan + * @Date 2024/5/6 17:00 + * **/ + JsonResultEntity queryEntityPage(JSONObject jsonObject); + + /** + * + * @content 编辑通用数据 + * @Param + * @Return + * @Author hecan + * @Date 2024/5/6 17:16 + * **/ + JsonResultEntity updateEntity(JSONObject jsonObject); + + /** + * + * @content 删除通用数据 + * @Param + * @Return + * @Author hecan + * @Date 2024/5/6 17:23 + * **/ + JsonResultEntity deleteEntity(JSONObject jsonObject); + + /** + * + * @content 查询单个通用数据 + * @Param + * @Return + * @Author hecan + * @Date 2024/5/6 17:26 + * **/ + JsonResultEntity getEntity(JSONObject jsonObject); +} diff --git a/service/src/main/java/com/hzya/frame/sysnew/generalData/service/impl/GeneralDataServiceImpl.java b/service/src/main/java/com/hzya/frame/sysnew/generalData/service/impl/GeneralDataServiceImpl.java new file mode 100644 index 00000000..72a1778a --- /dev/null +++ b/service/src/main/java/com/hzya/frame/sysnew/generalData/service/impl/GeneralDataServiceImpl.java @@ -0,0 +1,241 @@ +package com.hzya.frame.sysnew.generalData.service.impl; + +import com.alibaba.fastjson.JSONObject; +import com.github.pagehelper.PageInfo; +import com.hzya.frame.basedao.service.impl.BaseService; +import com.hzya.frame.sysnew.generalData.dao.IGeneralDataDao; +import com.hzya.frame.sysnew.generalData.entity.GeneralDataEntity; +import com.hzya.frame.sysnew.generalData.service.IGeneralDataService; +import com.hzya.frame.sysnew.homeComponent.dao.ISysHomeComponentDao; +import com.hzya.frame.uuid.UUIDLong; +import com.hzya.frame.uuid.UUIDUtils; +import com.hzya.frame.web.entity.BaseResult; +import com.hzya.frame.web.entity.JsonResultEntity; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.Arrays; +import java.util.List; + +@Service(value = "generalDataServiceImpl") +public class GeneralDataServiceImpl extends BaseService implements IGeneralDataService { + private IGeneralDataDao generalDataDao; + + @Autowired + public void setGeneralDataDao(IGeneralDataDao dao) { + this.generalDataDao = dao; + this.dao = dao; + } + + //新增通用数据 + @Override + public JsonResultEntity saveEntity(JSONObject json) { + JSONObject jsonObject = json.getJSONObject("jsonStr"); + if(jsonObject == null ){ + return BaseResult.getFailureMessageEntity("数据为空,请先传递数据"); + } + if(!checkStr(jsonObject.getString("archivesType"))){ + return BaseResult.getFailureMessageEntity("通用数据类型为空"); + } + if(!checkStr(jsonObject.getString("leftCode"))){ + return BaseResult.getFailureMessageEntity("左编码为空"); + } + if(!checkStr(jsonObject.getString("rightCode"))){ + return BaseResult.getFailureMessageEntity("右编码为空"); + } + if(!checkStr(jsonObject.getString("leftAppCode"))){ + return BaseResult.getFailureMessageEntity("左应用编码为空"); + } + if(!checkStr(jsonObject.getString("rightAppCode"))){ + return BaseResult.getFailureMessageEntity("右应用编码为空"); + } + List fzhs = Arrays.asList(new String[]{"1", "2", "6", "73", "D01" , "jobass" , "93" , "96", "22"}); + if(!fzhs.contains(jsonObject.getString("archivesType"))){ + return BaseResult.getFailureMessageEntity("档案类型错误,请联系管理员"); + } + /* switch (jsonObject.getString("archivesType")){ + case "1"://人员对照 + GeneralDataEntity generalDataEntityPersonnel = jsonObject.toJavaObject(GeneralDataEntity.class); + generalDataDao.saveGeneralDataByType(generalDataEntityPersonnel); + break; + case "2"://部门档案 + GeneralDataEntity generalDataEntityOrg = jsonObject.toJavaObject(GeneralDataEntity.class); + generalDataDao.saveGeneralDataByType(generalDataEntityOrg); + break; + case "6"://存货对照 + GeneralDataEntity generalDataEntityStock = jsonObject.toJavaObject(GeneralDataEntity.class); + generalDataDao.saveGeneralDataByType(generalDataEntityStock); + break; + case "73"://客商辅助核算 + GeneralDataEntity generalDataEntityMerchant = jsonObject.toJavaObject(GeneralDataEntity.class); + generalDataDao.saveGeneralDataByType(generalDataEntityMerchant); + break; + case "D01"://税率 + GeneralDataEntity generalDataEntityTaxrate = jsonObject.toJavaObject(GeneralDataEntity.class); + generalDataDao.saveGeneralDataByType(generalDataEntityTaxrate); + break; + case "jobass"://项目辅助核算 + GeneralDataEntity generalDataEntityProject = jsonObject.toJavaObject(GeneralDataEntity.class); + generalDataDao.saveGeneralDataByType(generalDataEntityProject); + break; + case "93"://银行类别 + GeneralDataEntity generalDataEntityBank = jsonObject.toJavaObject(GeneralDataEntity.class); + generalDataDao.saveGeneralDataByType(generalDataEntityBank); + break; + case "96"://银行账户 + GeneralDataEntity generalDataEntityBankaccount = jsonObject.toJavaObject(GeneralDataEntity.class); + generalDataDao.saveGeneralDataByType(generalDataEntityBankaccount); + break; + case "22"://资产类别 + GeneralDataEntity generalDataEntityAssets = jsonObject.toJavaObject(GeneralDataEntity.class); + generalDataDao.saveGeneralDataByType(generalDataEntityAssets); + break; + default: + break; + }*/ + GeneralDataEntity generalDataEntity = jsonObject.toJavaObject(GeneralDataEntity.class); + generalDataEntity.setId(UUIDUtils.getUUID()); + generalDataEntity.setCreate_user_id("1"); + generalDataEntity.setModify_user_id("1"); + generalDataEntity.setOrg_id("0"); + generalDataEntity.setCompanyId("0"); + try { + GeneralDataEntity generalDataEntitySave = generalDataDao.saveGeneralDataByType(generalDataEntity); + return BaseResult.getSuccessMessageEntity("新增成功",generalDataEntitySave); + }catch (Exception e){ + logger.info("通用数据新增错误:{}",e.getMessage()); + return BaseResult.getFailureMessageEntity("新增失败",e.getMessage()); + } + } + + //查询通用数据 + @Override + public JsonResultEntity queryEntityPage(JSONObject json) { + JSONObject jsonObject = json.getJSONObject("jsonStr"); + if(jsonObject == null ){ + return BaseResult.getFailureMessageEntity("数据为空,请先传递数据"); + } + if(!checkStr(jsonObject.getString("archivesType"))){ + return BaseResult.getFailureMessageEntity("通用数据类型为空"); + } + /*if(!checkStr(jsonObject.getString("leftCode"))){ + return BaseResult.getFailureMessageEntity("左编码为空"); + } + if(!checkStr(jsonObject.getString("rightCode"))){ + return BaseResult.getFailureMessageEntity("右编码为空"); + }*/ + List fzhs = Arrays.asList(new String[]{"1", "2", "6", "73", "D01" , "jobass" , "93" , "96", "22"}); + if(!fzhs.contains(jsonObject.getString("archivesType"))){ + return BaseResult.getFailureMessageEntity("档案类型错误,请联系管理员"); + } + GeneralDataEntity generalDataEntity = jsonObject.toJavaObject(GeneralDataEntity.class); + try { + List generalDataEntities = generalDataDao.queryGeneralData(generalDataEntity); + PageInfo pageInfo=new PageInfo(generalDataEntities); + return BaseResult.getSuccessMessageEntity("查询成功",pageInfo); + }catch (Exception e){ + logger.info("通用数据查询错误:{}",e.getMessage()); + return BaseResult.getFailureMessageEntity("查询失败",e.getMessage()); + } + } + + //编辑通用数据 + @Override + public JsonResultEntity updateEntity(JSONObject json) { + JSONObject jsonObject = json.getJSONObject("jsonStr"); + if(jsonObject == null ){ + return BaseResult.getFailureMessageEntity("数据为空,请先传递数据"); + } + if(!checkStr(jsonObject.getString("id"))){ + return BaseResult.getFailureMessageEntity("id为空"); + } + if(!checkStr(jsonObject.getString("archivesType"))){ + return BaseResult.getFailureMessageEntity("通用数据类型为空"); + } + /*if(!checkStr(jsonObject.getString("leftCode"))){ + return BaseResult.getFailureMessageEntity("左编码为空"); + } + if(!checkStr(jsonObject.getString("rightCode"))){ + return BaseResult.getFailureMessageEntity("右编码为空"); + } + if(!checkStr(jsonObject.getString("leftAppCode"))){ + return BaseResult.getFailureMessageEntity("左应用编码为空"); + } + if(!checkStr(jsonObject.getString("rightAppCode"))){ + return BaseResult.getFailureMessageEntity("右应用编码为空"); + }*/ + List fzhs = Arrays.asList(new String[]{"1", "2", "6", "73", "D01" , "jobass" , "93" , "96", "22"}); + if(!fzhs.contains(jsonObject.getString("archivesType"))){ + return BaseResult.getFailureMessageEntity("档案类型错误,请联系管理员"); + } + GeneralDataEntity generalDataEntity = jsonObject.toJavaObject(GeneralDataEntity.class); + try { + generalDataDao.updateGeneralDataByType(generalDataEntity); + return BaseResult.getSuccessMessageEntity("编辑成功"); + }catch (Exception e){ + logger.info("通用数据编辑失败:{}",e.getMessage()); + return BaseResult.getFailureMessageEntity("编辑失败",e.getMessage()); + } + } + + //删除通用数据 + @Override + public JsonResultEntity deleteEntity(JSONObject json) { + JSONObject jsonObject = json.getJSONObject("jsonStr"); + if(jsonObject == null ){ + return BaseResult.getFailureMessageEntity("数据为空,请先传递数据"); + } + if(!checkStr(jsonObject.getString("id"))){ + return BaseResult.getFailureMessageEntity("id为空"); + } + if(!checkStr(jsonObject.getString("archivesType"))){ + return BaseResult.getFailureMessageEntity("通用数据类型为空"); + } + /*if(!checkStr(jsonObject.getString("leftCode"))){ + return BaseResult.getFailureMessageEntity("左编码为空"); + } + if(!checkStr(jsonObject.getString("rightCode"))){ + return BaseResult.getFailureMessageEntity("右编码为空"); + } + if(!checkStr(jsonObject.getString("leftAppCode"))){ + return BaseResult.getFailureMessageEntity("左应用编码为空"); + } + if(!checkStr(jsonObject.getString("rightAppCode"))){ + return BaseResult.getFailureMessageEntity("右应用编码为空"); + }*/ + List fzhs = Arrays.asList(new String[]{"1", "2", "6", "73", "D01" , "jobass" , "93" , "96", "22"}); + if(!fzhs.contains(jsonObject.getString("archivesType"))){ + return BaseResult.getFailureMessageEntity("档案类型错误,请联系管理员"); + } + GeneralDataEntity generalDataEntity = jsonObject.toJavaObject(GeneralDataEntity.class); + try { + generalDataEntity.setCreate_user_id("1"); + generalDataEntity.setModify_user_id("1"); + generalDataDao.deleteGeneralDataByType(generalDataEntity); + return BaseResult.getSuccessMessageEntity("删除成功"); + }catch (Exception e){ + logger.info("通用数据删除失败:{}",e.getMessage()); + return BaseResult.getFailureMessageEntity("删除失败",e.getMessage()); + } + } + + //查询单个通用数据对象 + @Override + public JsonResultEntity getEntity(JSONObject json) { + JSONObject jsonObject = json.getJSONObject("jsonStr"); + if(jsonObject == null ){ + return BaseResult.getFailureMessageEntity("数据为空,请先传递数据"); + } + if(!checkStr(jsonObject.getString("id"))){ + return BaseResult.getFailureMessageEntity("id为空"); + } + GeneralDataEntity generalDataEntity = jsonObject.toJavaObject(GeneralDataEntity.class); + try { + GeneralDataEntity generalDataEntityOne = generalDataDao.queryOne(generalDataEntity); + return BaseResult.getSuccessMessageEntity("查询单个成功",generalDataEntityOne); + }catch (Exception e){ + logger.info("查询单个通用数据错误:{}",e.getMessage()); + return BaseResult.getSuccessMessageEntity("查询单个失败",e.getMessage()); + } + } +} From 2aa03eda606ae1b82ccfffebfe7794bf7f46c24e Mon Sep 17 00:00:00 2001 From: hecan <1718492867@qq.com> Date: Wed, 29 May 2024 17:20:12 +0800 Subject: [PATCH 36/80] =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=BA=93=E8=BF=9E=E6=8E=A5=E5=9C=B0=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- buildpackage/src/main/resources/application-hclocal.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildpackage/src/main/resources/application-hclocal.yml b/buildpackage/src/main/resources/application-hclocal.yml index 995c4368..b88db817 100644 --- a/buildpackage/src/main/resources/application-hclocal.yml +++ b/buildpackage/src/main/resources/application-hclocal.yml @@ -18,7 +18,7 @@ spring: # driver-class-name: com.mysql.jdbc.Driver # 3.2.0开始支持SPI可省略此配置 url: jdbc:mysql://hzya.ufyct.com:9014/businesscenter?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF8&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowLoadLocalInfile=false&autoReconnect=true&failOverReadOnly=false&connectTimeout=30000&socketTimeout=30000&autoReconnectForPools=true username: root - password: hzya@1314 + password: 62e4295b615a30dbf3b8ee96f41c820b driver-class-name: com.mysql.jdbc.Driver # 3.2.0开始支持SPI可省略此配置 savefile: # 文件保存路径 From 7a6c3dab90b172729c8081205a51bb4f4bb3b796 Mon Sep 17 00:00:00 2001 From: hecan <1718492867@qq.com> Date: Wed, 29 May 2024 17:21:14 +0800 Subject: [PATCH 37/80] =?UTF-8?q?=E9=80=9A=E7=94=A8=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sysnew/comparison/dao/IComparisonDao.java | 19 +- .../comparison/dao/IComparisonDetailsDao.java | 9 +- .../dao/impl/ComparisonDaoImpl.java | 16 +- .../dao/impl/ComparisonDetailsDaoImpl.java | 11 +- .../entity/ComparisonDetailsEntity.java | 262 ++------- .../entity/ComparisonDetailsEntity.xml | 23 +- .../comparison/entity/ComparisonEntity.java | 546 +++--------------- .../comparison/entity/ComparisonEntity.xml | 125 ++-- .../service/IComparisonService.java | 8 +- .../service/impl/ComparisonServiceImpl.java | 131 +++-- 10 files changed, 286 insertions(+), 864 deletions(-) diff --git a/service/src/main/java/com/hzya/frame/sysnew/comparison/dao/IComparisonDao.java b/service/src/main/java/com/hzya/frame/sysnew/comparison/dao/IComparisonDao.java index b11a112a..d33044c7 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/comparison/dao/IComparisonDao.java +++ b/service/src/main/java/com/hzya/frame/sysnew/comparison/dao/IComparisonDao.java @@ -6,6 +6,7 @@ import com.hzya.frame.sysnew.comparison.entity.ComparisonDetailsEntity; import com.hzya.frame.sysnew.comparison.entity.ComparisonEntity; import java.util.List; +import java.util.Map; public interface IComparisonDao extends IBaseDao { @@ -27,11 +28,11 @@ public interface IComparisonDao extends IBaseDao { * @Author hecan * @Date 2024/5/9 15:11 * **/ - List queryComparisonPage(ComparisonEntity comparison); + List> queryComparisonPage(ComparisonEntity comparison); /** * - * @content 保存档案对照数据 + * @content 保存通用数据数据 * @Param * @Return * @Author hecan @@ -51,7 +52,7 @@ public interface IComparisonDao extends IBaseDao { /** * - * @content 更新档案对照数据 + * @content 更新通用数据数据 * @Param * @Return * @Author hecan @@ -61,11 +62,21 @@ public interface IComparisonDao extends IBaseDao { /** * - * @content 删除档案对照数据 + * @content 删除通用数据 * @Param * @Return * @Author hecan * @Date 2024/5/9 14:09 * **/ Integer deleteComparison(ComparisonEntity comparison); + + /** + * + * @content 查询单据规则 + * @Param + * @Return + * @Author hecan + * @Date 2024/5/28 14:39 + * **/ + ComparisonEntity queryComparisonById(ComparisonEntity comparison); } diff --git a/service/src/main/java/com/hzya/frame/sysnew/comparison/dao/IComparisonDetailsDao.java b/service/src/main/java/com/hzya/frame/sysnew/comparison/dao/IComparisonDetailsDao.java index 731109c9..36c66021 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/comparison/dao/IComparisonDetailsDao.java +++ b/service/src/main/java/com/hzya/frame/sysnew/comparison/dao/IComparisonDetailsDao.java @@ -5,12 +5,13 @@ import com.hzya.frame.basedao.dao.IBaseDao; import com.hzya.frame.sysnew.comparison.entity.ComparisonDetailsEntity; import java.util.List; +import java.util.Map; public interface IComparisonDetailsDao extends IBaseDao { /** * - * @content 保存档案对照子表数据 + * @content 保存通用数据子表数据 * @Param * @Return * @Author hecan @@ -20,7 +21,7 @@ public interface IComparisonDetailsDao extends IBaseDao queryComparisonDetailsPage(ComparisonDetailsEntity comparisonDetailsEntity); + List> queryComparisonDetailsPage(ComparisonDetailsEntity comparisonDetailsEntity); } diff --git a/service/src/main/java/com/hzya/frame/sysnew/comparison/dao/impl/ComparisonDaoImpl.java b/service/src/main/java/com/hzya/frame/sysnew/comparison/dao/impl/ComparisonDaoImpl.java index 695c3683..63281c12 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/comparison/dao/impl/ComparisonDaoImpl.java +++ b/service/src/main/java/com/hzya/frame/sysnew/comparison/dao/impl/ComparisonDaoImpl.java @@ -7,6 +7,7 @@ import com.hzya.frame.sysnew.comparison.entity.ComparisonEntity; import org.springframework.stereotype.Repository; import java.util.List; +import java.util.Map; @Repository(value = "comparisonDaoImpl") public class ComparisonDaoImpl extends MybatisGenericDao implements IComparisonDao { @@ -19,8 +20,8 @@ public class ComparisonDaoImpl extends MybatisGenericDao queryComparisonPage(ComparisonEntity comparison) { - List query = super.query(getSqlIdPrifx() + "queryComparisonPage", comparison); + public List> queryComparisonPage(ComparisonEntity comparison) { + List> query =(List>) super.selectList(getSqlIdPrifx() + "queryComparisonPage", comparison); return query; } @@ -38,17 +39,24 @@ public class ComparisonDaoImpl extends MybatisGenericDao comparisonEntities = super.query(getSqlIdPrifx() + "queryComparisonById", comparison); + return comparisonEntities.get(0); + } } diff --git a/service/src/main/java/com/hzya/frame/sysnew/comparison/dao/impl/ComparisonDetailsDaoImpl.java b/service/src/main/java/com/hzya/frame/sysnew/comparison/dao/impl/ComparisonDetailsDaoImpl.java index bafc78fe..cab43d0d 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/comparison/dao/impl/ComparisonDetailsDaoImpl.java +++ b/service/src/main/java/com/hzya/frame/sysnew/comparison/dao/impl/ComparisonDetailsDaoImpl.java @@ -9,25 +9,26 @@ import com.hzya.frame.sysnew.comparison.entity.ComparisonEntity; import org.springframework.stereotype.Repository; import java.util.List; +import java.util.Map; @Repository(value = "comparisonDetailsDaoImpl") public class ComparisonDetailsDaoImpl extends MybatisGenericDao implements IComparisonDetailsDao { - //保存档案对照子表数据 + //保存通用数据子表数据 @Override public ComparisonDetailsEntity saveComparisonDetails(ComparisonDetailsEntity comparisonDetailsEntity) { ComparisonDetailsEntity detailsEntity = super.save(getSqlIdPrifx() + "saveComparisonDetails", comparisonDetailsEntity); return detailsEntity; } - //更新档案对照子表数据 + //更新通用数据子表数据 @Override public Integer updateComparisonDetailsByType(ComparisonDetailsEntity comparisonDetailsEntity) { int update = super.update(getSqlIdPrifx()+"updateComparisonDetailsByType", comparisonDetailsEntity); return update; } - //删除档案对照子表的数据 + //删除通用数据子表的数据 @Override public Integer deleteComparisonDetails(ComparisonDetailsEntity comparisonDetailsEntity) { int delete = super.delete(getSqlIdPrifx() + "deleteComparisonDetails", comparisonDetailsEntity); @@ -36,8 +37,8 @@ public class ComparisonDetailsDaoImpl extends MybatisGenericDao queryComparisonDetailsPage(ComparisonDetailsEntity comparisonDetailsEntity) { - List query = super.query(getSqlIdPrifx() + "queryComparisonDetailsPage", comparisonDetailsEntity); + public List> queryComparisonDetailsPage(ComparisonDetailsEntity comparisonDetailsEntity) { + List> query =(List>) super.selectList(getSqlIdPrifx() + "queryComparisonDetailsPage", comparisonDetailsEntity); return query; } 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 11ce420d..5766ec65 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 @@ -9,7 +9,7 @@ import java.util.Map; /** * - * @content 档案对照明细实体类 + * @content 通用数据明细实体类 * @Param * @Return * @Author hecan @@ -20,32 +20,7 @@ public class ComparisonDetailsEntity extends BaseEntity { private String contrastType;//对照类型 private String documentRule;//单据规则 private Long documentRuleNum;//单据规则流水号 - private String sszz;//所属组织 - private String bz;//备注 - private String formmainId;//上级id - private String taskLinvingId;//集成任务-实例_id - private String result;//返回结果 - private String queryCondition;//原始查询条件 - private String rootAppPk;//源系统主键 - private String rootAppBill;//原系统单据 - private String rootAppNewData;//最新源系统数据详情 - private String newTransmitInfo;//最新传输信息 - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") - @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private Date newPushDate;//最新推送时间 - private String repairPust;//是否补推(Y是N不是) - private String senceId;//场景id - private String newState;//最新推送状态 - private String businessDate;//单据业务日期 - private String pluginId;//插件id - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") - @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private Date processingTime;//处理时间 - private String processingRemarks;//处理备注 - private String processorName;//处理⼈名称 - private String processor;//处理⼈ - private String newSystemNumber;//下游系统单号 - private String newSystemPrimary;//下游系统主键 + private String mdmName;//主数据名称 private String mdmCode;//主数据编码 @@ -54,9 +29,42 @@ public class ComparisonDetailsEntity extends BaseEntity { private String enName;//字段名 英文 private String chName;// 字段名 中文 private String filedType;//字段类型 1、BIGINT 2、DECIMAL 3、VARCHAR 4、DATETIME + private String formmainId;//上级id + + public String getFormmainId() { + return formmainId; + } + + public void setFormmainId(String formmainId) { + this.formmainId = formmainId; + } private Map mapDetails; + public String getContrastType() { + return contrastType; + } + + public void setContrastType(String contrastType) { + this.contrastType = contrastType; + } + + public String getDocumentRule() { + return documentRule; + } + + public void setDocumentRule(String documentRule) { + this.documentRule = documentRule; + } + + public Long getDocumentRuleNum() { + return documentRuleNum; + } + + public void setDocumentRuleNum(Long documentRuleNum) { + this.documentRuleNum = documentRuleNum; + } + public String getMdmName() { return mdmName; } @@ -120,204 +128,4 @@ public class ComparisonDetailsEntity extends BaseEntity { public void setMapDetails(Map mapDetails) { this.mapDetails = mapDetails; } - - public String getContrastType() { - return contrastType; - } - - public void setContrastType(String contrastType) { - this.contrastType = contrastType; - } - - public String getDocumentRule() { - return documentRule; - } - - public void setDocumentRule(String documentRule) { - this.documentRule = documentRule; - } - - public Long getDocumentRuleNum() { - return documentRuleNum; - } - - public void setDocumentRuleNum(Long documentRuleNum) { - this.documentRuleNum = documentRuleNum; - } - - public String getSszz() { - return sszz; - } - - public void setSszz(String sszz) { - this.sszz = sszz; - } - - public String getBz() { - return bz; - } - - public void setBz(String bz) { - this.bz = bz; - } - - public String getFormmainId() { - return formmainId; - } - - public void setFormmainId(String formmainId) { - this.formmainId = formmainId; - } - - public String getTaskLinvingId() { - return taskLinvingId; - } - - public void setTaskLinvingId(String taskLinvingId) { - this.taskLinvingId = taskLinvingId; - } - - public String getResult() { - return result; - } - - public void setResult(String result) { - this.result = result; - } - - public String getQueryCondition() { - return queryCondition; - } - - public void setQueryCondition(String queryCondition) { - this.queryCondition = queryCondition; - } - - public String getRootAppPk() { - return rootAppPk; - } - - public void setRootAppPk(String rootAppPk) { - this.rootAppPk = rootAppPk; - } - - public String getRootAppBill() { - return rootAppBill; - } - - public void setRootAppBill(String rootAppBill) { - this.rootAppBill = rootAppBill; - } - - public String getRootAppNewData() { - return rootAppNewData; - } - - public void setRootAppNewData(String rootAppNewData) { - this.rootAppNewData = rootAppNewData; - } - - public String getNewTransmitInfo() { - return newTransmitInfo; - } - - public void setNewTransmitInfo(String newTransmitInfo) { - this.newTransmitInfo = newTransmitInfo; - } - - public Date getNewPushDate() { - return newPushDate; - } - - public void setNewPushDate(Date newPushDate) { - this.newPushDate = newPushDate; - } - - public String getRepairPust() { - return repairPust; - } - - public void setRepairPust(String repairPust) { - this.repairPust = repairPust; - } - - public String getSenceId() { - return senceId; - } - - public void setSenceId(String senceId) { - this.senceId = senceId; - } - - public String getNewState() { - return newState; - } - - public void setNewState(String newState) { - this.newState = newState; - } - - public String getBusinessDate() { - return businessDate; - } - - public void setBusinessDate(String businessDate) { - this.businessDate = businessDate; - } - - public String getPluginId() { - return pluginId; - } - - public void setPluginId(String pluginId) { - this.pluginId = pluginId; - } - - public Date getProcessingTime() { - return processingTime; - } - - public void setProcessingTime(Date processingTime) { - this.processingTime = processingTime; - } - - public String getProcessingRemarks() { - return processingRemarks; - } - - public void setProcessingRemarks(String processingRemarks) { - this.processingRemarks = processingRemarks; - } - - public String getProcessorName() { - return processorName; - } - - public void setProcessorName(String processorName) { - this.processorName = processorName; - } - - public String getProcessor() { - return processor; - } - - public void setProcessor(String processor) { - this.processor = processor; - } - - public String getNewSystemNumber() { - return newSystemNumber; - } - - public void setNewSystemNumber(String newSystemNumber) { - this.newSystemNumber = newSystemNumber; - } - - public String getNewSystemPrimary() { - return newSystemPrimary; - } - - public void setNewSystemPrimary(String newSystemPrimary) { - this.newSystemPrimary = newSystemPrimary; - } } 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 dfd07457..8ca17330 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 @@ -5,28 +5,7 @@ - - - - - - - - - - - - - - - - - - - - - @@ -38,7 +17,7 @@ - select * from ${dbName} @@ -80,7 +29,8 @@ + + + + + select + case when length(ifnull(max(right(document_rule,length(#{ruleSuffix}))),'0')+1)=1 + then concat(#{rulePrefix},'-',date_format(NOW(),#{ruleMiddle}),'-','000',ifnull(max(right(document_rule,length(#{ruleSuffix}))),'0')+1) + when length(ifnull(max(right(document_rule,length(#{ruleSuffix}))),'0')+1)=2 + then concat(#{rulePrefix},'-',date_format(NOW(),#{ruleMiddle}),'-','00',ifnull(max(right(document_rule,length(#{ruleSuffix}))),'0')+1) + when length(ifnull(max(right(document_rule,length(#{ruleSuffix}))),'0')+1)=3 + then concat(#{rulePrefix},'-',date_format(NOW(),#{ruleMiddle}),'-','0',ifnull(max(right(document_rule,length(#{ruleSuffix}))),'0')+1) + else concat(#{rulePrefix},'-',date_format(NOW(),#{ruleMiddle}),'-',ifnull(max(right(document_rule,length(#{ruleSuffix}))),'0')+1) + end as document_rule, + right( + case when length(ifnull(max(right(document_rule,length(#{ruleSuffix}))),'0')+1)=1 + then concat(#{rulePrefix},'-',date_format(NOW(),#{ruleMiddle}),'-','000',ifnull(max(right(document_rule,length(#{ruleSuffix}))),'0')+1) + when length(ifnull(max(right(document_rule,length(#{ruleSuffix}))),'0')+1)=2 + then concat(#{rulePrefix},'-',date_format(NOW(),#{ruleMiddle}),'-','00',ifnull(max(right(document_rule,length(#{ruleSuffix}))),'0')+1) + when length(ifnull(max(right(document_rule,length(#{ruleSuffix}))),'0')+1)=3 + then concat(#{rulePrefix},'-',date_format(NOW(),#{ruleMiddle}),'-','0',ifnull(max(right(document_rule,length(#{ruleSuffix}))),'0')+1) + else concat(#{rulePrefix},'-',date_format(NOW(),#{ruleMiddle}),'-',ifnull(max(right(document_rule,length(#{ruleSuffix}))),'0')+1) + end ,4) as documentRuleNum + from ${dbName} where document_rule like concat(#{rulePrefix},'-',date_format(NOW(),#{ruleMiddle}),'-','%'); + - + insert into ${dbName} @@ -145,7 +120,7 @@ update ${dbName} - set sts= 'N' ,modify_time = now(),modify_user_id = #{modify_user_id} + set dataStatus= 'N' ,modify_time = now(),modify_user_id = #{modify_user_id} and ${key} =#{value} diff --git a/service/src/main/java/com/hzya/frame/sysnew/comparison/service/IComparisonService.java b/service/src/main/java/com/hzya/frame/sysnew/comparison/service/IComparisonService.java index 60375cfb..31f9e6b5 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/comparison/service/IComparisonService.java +++ b/service/src/main/java/com/hzya/frame/sysnew/comparison/service/IComparisonService.java @@ -9,7 +9,7 @@ public interface IComparisonService extends IBaseService this.dao = dao; } - //分页查询档案对照数据 + //分页查询通用数据数据 @Override public JsonResultEntity queryEntityPage(JSONObject json) { JSONObject jsonObject = json.getJSONObject("jsonStr"); @@ -51,7 +51,7 @@ public class ComparisonServiceImpl extends BaseService comparisonEntities = comparisonDao.queryComparison(comparisonEntity); }catch (Exception e){ logger.info("根据主数据编码查询信息错误:{}",e.getMessage()); - return BaseResult.getFailureMessageEntity("查询失败",e.getMessage()); + return BaseResult.getFailureMessageEntity("查询失败"); } Map map = new HashMap<>();//将主表数据存到map中 if (comparisonEntities != null && comparisonEntities.size() > 0) { @@ -68,18 +68,18 @@ public class ComparisonServiceImpl extends BaseService } comparisonEntity.setMap(map); try { - List comparisonEntitiePages = comparisonDao.queryComparisonPage(comparisonEntity); + List> comparisonEntitiePages = comparisonDao.queryComparisonPage(comparisonEntity); PageInfo pageInfo = new PageInfo(comparisonEntitiePages); return BaseResult.getSuccessMessageEntity("查询成功", pageInfo); } catch (Exception e) { - logger.info("查询档案对照错误:{}", e.getMessage()); - return BaseResult.getFailureMessageEntity("查询失败", e.getMessage()); + logger.info("查询通用数据错误:{}", e.getMessage()); + return BaseResult.getFailureMessageEntity("查询失败"); } } return BaseResult.getFailureMessageEntity("查询失败","请检查传递参数"); } - //新增档案对照数据 + //新增通用数据数据 @Override public JsonResultEntity saveEntity(JSONObject json) { JSONObject jsonObject = json.getJSONObject("jsonStr"); @@ -89,9 +89,9 @@ public class ComparisonServiceImpl extends BaseService if (!checkStr(jsonObject.getString("mdmCode"))) { return BaseResult.getFailureMessageEntity("主数据编码为空"); } - if (!checkStr(jsonObject.getString("rulePrefix"))) { + /*if (!checkStr(jsonObject.getString("rulePrefix"))) { return BaseResult.getFailureMessageEntity("规则为空"); - } + }*/ ComparisonEntity comparisonEntity = jsonObject.toJavaObject(ComparisonEntity.class); ComparisonDetailsEntity comparisonDetailsEntity=new ComparisonDetailsEntity(); List comparisonEntities=new ArrayList<>(); @@ -100,7 +100,7 @@ public class ComparisonServiceImpl extends BaseService comparisonEntities = comparisonDao.queryComparison(comparisonEntity); }catch (Exception e){ logger.info("根据主数据编码查询信息错误:{}",e.getMessage()); - return BaseResult.getFailureMessageEntity("保存失败",e.getMessage()); + return BaseResult.getFailureMessageEntity("保存失败"); } String main = jsonObject.getString("main");//获取主表数据 JSONArray jsonArray = jsonObject.getJSONArray("details");//获取子表数据 @@ -114,7 +114,10 @@ public class ComparisonServiceImpl extends BaseService for (String key : jsonObjectMain.keySet()) { if (entity.getDbType().equals("1")) { comparisonEntity.setDbName(entity.getDbName()); - map.put(key, jsonObjectMain.getString(key)); + //如果表中得字段与输入得字段相等,则存起来 + if(entity.getEnName().equals(key)){ + map.put(key, jsonObjectMain.getString(key)); + } } } } @@ -126,7 +129,9 @@ public class ComparisonServiceImpl extends BaseService for (String key : jsonObjectDetails.keySet()) { if (entity.getDbType().equals("2")) { comparisonDetailsEntity.setDbName(entity.getDbName()); - mapDetails.put(key, jsonObjectDetails.getString(key)); + if(entity.getEnName().equals(key)){ + mapDetails.put(key, jsonObjectDetails.getString(key)); + } } } } @@ -140,16 +145,38 @@ public class ComparisonServiceImpl extends BaseService map.put("create_time", new Date()); map.put("modify_time", new Date()); map.put("sts", "Y"); - comparisonEntity.setMap(map); - //生成单据规则 - comparisonEntity.setRulePrefix(jsonObject.getString("rulePrefix")); + //查询单据规则 try { - ComparisonEntity comparisonEntityRule = comparisonDao.queryComparisonRule(comparisonEntity); - map.put("document_rule", comparisonEntityRule.getDocumentRule());//单据规则 - map.put("document_rule_num", comparisonEntityRule.getDocumentRuleNum());//单据规则流水号 - } catch (Exception e) { - logger.info("保存档案对照时候生成单据规则错误:{}", e.getMessage()); - return BaseResult.getFailureMessageEntity("保存失败", e.getMessage()); + ComparisonEntity comparisonEntityRule = comparisonEntities.get(0); + comparisonEntityRule= comparisonDao.queryComparisonById(comparisonEntityRule); + String documentRule = comparisonEntityRule.getDocumentRule(); + 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 ruleSuffix= documentRule.substring(documentRule.lastIndexOf("-")+1); + //生成单据规则 + comparisonEntity.setRulePrefix(rulePrefix); + comparisonEntity.setRuleMiddle(ruleMiddle); + comparisonEntity.setRuleSuffix(ruleSuffix); + try { + //新生成单据规则保存到数据库 + comparisonEntityRule = comparisonDao.queryComparisonRule(comparisonEntity); + map.put("document_rule", comparisonEntityRule.getDocumentRule());//单据规则 + map.put("document_rule_num", comparisonEntityRule.getDocumentRuleNum());//单据规则流水号 + comparisonEntity.setMap(map); + } catch (Exception e) { + logger.info("保存通用数据时候生成单据规则错误:{}", e.getMessage()); + return BaseResult.getFailureMessageEntity("保存失败"); + } + } + }catch (Exception e){ + logger.info("通用数据保存接口中查询单据规则错误:{}",e.getMessage()); + return BaseResult.getFailureMessageEntity("保存失败"); } try { //保存主表数据 @@ -170,15 +197,15 @@ public class ComparisonServiceImpl extends BaseService } return BaseResult.getSuccessMessageEntity("保存成功", comparisonEntityOne); } catch (Exception e) { - logger.info("保存档案对照时候错误:{}", e.getMessage()); - return BaseResult.getFailureMessageEntity("保存失败", e.getMessage()); + logger.info("保存通用数据时候错误:{}", e.getMessage()); + return BaseResult.getFailureMessageEntity("保存失败"); } } } return BaseResult.getFailureMessageEntity("查询失败","请检查传递参数"); } - //更新档案对照数据 + //更新通用数据数据 @Override public JsonResultEntity updateEntity(JSONObject json) { JSONObject jsonObject = json.getJSONObject("jsonStr"); @@ -201,7 +228,7 @@ public class ComparisonServiceImpl extends BaseService comparisonEntities = comparisonDao.queryComparison(comparisonEntity); }catch (Exception e){ logger.info("根据主数据编码查询信息错误:{}",e.getMessage()); - return BaseResult.getFailureMessageEntity("更新失败",e.getMessage()); + return BaseResult.getFailureMessageEntity("更新失败"); } Map map=new HashMap<>();//将主表数据存到map中 Map mapDetails=new HashMap<>();//将子表数据存到map中 @@ -211,7 +238,9 @@ public class ComparisonServiceImpl extends BaseService for (String key : jsonObjectMain.keySet()) { if (entity.getDbType().equals("1")) { comparisonEntity.setDbName(entity.getDbName()); - map.put(key, jsonObjectMain.getString(key)); + if(entity.getEnName().equals(key)){ + map.put(key, jsonObjectMain.getString(key)); + } } } } @@ -223,7 +252,9 @@ public class ComparisonServiceImpl extends BaseService for (String key : jsonObjectDetails.keySet()) { if (entity.getDbType().equals("2")) { comparisonDetailsEntity.setDbName(entity.getDbName()); - mapDetails.put(key, jsonObjectDetails.getString(key)); + if(entity.getEnName().equals(key)){ + mapDetails.put(key, jsonObjectDetails.getString(key)); + } } } } @@ -243,7 +274,7 @@ public class ComparisonServiceImpl extends BaseService map.put("document_rule",comparisonEntityRule.getDocumentRule());//单据规则 map.put("document_rule_num",comparisonEntityRule.getDocumentRuleNum());//单据规则流水号 }catch (Exception e){ - logger.info("更新档案对照时候生成单据规则错误:{}",e.getMessage()); + logger.info("更新通用数据时候生成单据规则错误:{}",e.getMessage()); return BaseResult.getFailureMessageEntity("更新失败",e.getMessage()); }*/ try { @@ -260,20 +291,20 @@ public class ComparisonServiceImpl extends BaseService comparisonDetailsEntity.setFormmainId(jsonObjectMain.getString("id")); comparisonDetailsEntity.setMapDetails(mapDetails); comparisonDetailsDao.updateComparisonDetailsByType(comparisonDetailsEntity); - return BaseResult.getSuccessMessageEntity("更新成功", integer); } + return BaseResult.getSuccessMessageEntity("更新成功", integer); }else{ - return BaseResult.getFailureMessageEntity("更新失败", "请查看id是否在表中存在"); + return BaseResult.getFailureMessageEntity("更新失败"); } } catch (Exception e) { - logger.info("更新档案对照时候错误:{}", e.getMessage()); - return BaseResult.getFailureMessageEntity("更新失败", e.getMessage()); + logger.info("更新通用数据时候错误:{}", e.getMessage()); + return BaseResult.getFailureMessageEntity("更新失败"); } } return BaseResult.getFailureMessageEntity("查询失败","请检查传递参数"); } - //删除当初对照数据 + //删除通用数据 @Override public JsonResultEntity deleteEntity(JSONObject json) { JSONObject jsonObject = json.getJSONObject("jsonStr"); @@ -295,7 +326,7 @@ public class ComparisonServiceImpl extends BaseService comparisonEntities = comparisonDao.queryComparison(comparisonEntity); }catch (Exception e){ logger.info("根据主数据编码查询信息错误:{}",e.getMessage()); - return BaseResult.getFailureMessageEntity("删除失败",e.getMessage()); + return BaseResult.getFailureMessageEntity("删除失败"); } Map map=new HashMap<>(); if(comparisonEntities !=null && comparisonEntities.size()>0) { @@ -304,7 +335,9 @@ public class ComparisonServiceImpl extends BaseService for (String key : jsonObjectMain.keySet()) { if (entity.getDbType().equals("1")) { comparisonEntity.setDbName(entity.getDbName()); - map.put(key, jsonObjectMain.getString(key)); + if(entity.getEnName().equals(key)){ + map.put(key, jsonObjectMain.getString(key)); + } } if(entity.getDbType().equals("2")){ comparisonDetailsEntity.setDbName(entity.getDbName()); @@ -317,18 +350,38 @@ public class ComparisonServiceImpl extends BaseService try { Integer integer = comparisonDao.deleteComparison(comparisonEntity); if(integer>0){ - comparisonDetailsEntity.setFormmainId(jsonObjectMain.getString("id")); - comparisonDetailsEntity.setModify_user_id("c796fd9ba4c9f5ff3cc2fa41a040e443"); - comparisonDetailsDao.deleteComparisonDetails(comparisonDetailsEntity); + if(comparisonDetailsEntity.getDbName()!=null){ + comparisonDetailsEntity.setFormmainId(jsonObjectMain.getString("id")); + comparisonDetailsEntity.setModify_user_id("c796fd9ba4c9f5ff3cc2fa41a040e443"); + comparisonDetailsDao.deleteComparisonDetails(comparisonDetailsEntity); + } return BaseResult.getSuccessMessageEntity("删除成功",integer); }else{ return BaseResult.getFailureMessageEntity("删除失败","请查看id是否在表中存在"); } }catch (Exception e){ - logger.info("删除档案对照数据错误:{}",e.getMessage()); - return BaseResult.getFailureMessageEntity("删除失败",e.getMessage()); + logger.info("删除通用数据数据错误:{}",e.getMessage()); + return BaseResult.getFailureMessageEntity("删除失败"); } } return BaseResult.getFailureMessageEntity("查询失败","请检查传递参数"); } + + //根据不同的日期格式,返回不同的值 + private String getRuleDate(String str){ + switch (str){ + case "yyyy-MM-dd": + return "%Y-%m-%d"; + case "yyyyMMdd": + return "%Y%m%d"; + case "yyyy-MM-dd HH:mm:ss": + return "Y-%m-%d %H:%i:%s"; + case "yyyyMMddHHmmss": + return "%Y%m%d%H%i%s"; + case "yyyyMMddHHmmssSSS": + return "%Y%m%d%H%i%s%f"; + default: + return null; + } + } } From eb9b024b90a51ecfb24107bede1605e460e720a3 Mon Sep 17 00:00:00 2001 From: hecan <1718492867@qq.com> Date: Wed, 29 May 2024 17:21:42 +0800 Subject: [PATCH 38/80] =?UTF-8?q?=E6=A1=A3=E6=A1=88=E5=AF=B9=E7=85=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../generalData/dao/IGeneralDataDao.java | 8 ++-- .../dao/impl/GeneralDataDaoImpl.java | 8 ++-- .../generalData/entity/GeneralDataEntity.java | 2 +- .../service/IGeneralDataService.java | 10 ++--- .../service/impl/GeneralDataServiceImpl.java | 38 +++++++++---------- 5 files changed, 33 insertions(+), 33 deletions(-) diff --git a/service/src/main/java/com/hzya/frame/sysnew/generalData/dao/IGeneralDataDao.java b/service/src/main/java/com/hzya/frame/sysnew/generalData/dao/IGeneralDataDao.java index ec391b3a..e7f315c1 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/generalData/dao/IGeneralDataDao.java +++ b/service/src/main/java/com/hzya/frame/sysnew/generalData/dao/IGeneralDataDao.java @@ -9,7 +9,7 @@ public interface IGeneralDataDao extends IBaseDao { /** * - * @content 新增通用数据 + * @content 新增档案对照 * @Param * @Return * @Author hecan @@ -19,7 +19,7 @@ public interface IGeneralDataDao extends IBaseDao { /** * - * @content 查询通用数据 + * @content 查询档案对照 * @Param * @Return * @Author hecan @@ -29,7 +29,7 @@ public interface IGeneralDataDao extends IBaseDao { /** * - * @content 编辑通用数据 + * @content 编辑档案对照 * @Param * @Return * @Author hecan @@ -39,7 +39,7 @@ public interface IGeneralDataDao extends IBaseDao { /** * - * @content 删除通用数据 + * @content 删除档案对照 * @Param * @Return * @Author hecan diff --git a/service/src/main/java/com/hzya/frame/sysnew/generalData/dao/impl/GeneralDataDaoImpl.java b/service/src/main/java/com/hzya/frame/sysnew/generalData/dao/impl/GeneralDataDaoImpl.java index b94f80c0..914dacca 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/generalData/dao/impl/GeneralDataDaoImpl.java +++ b/service/src/main/java/com/hzya/frame/sysnew/generalData/dao/impl/GeneralDataDaoImpl.java @@ -10,28 +10,28 @@ import java.util.List; @Repository(value = "generalDataDaoImpl") public class GeneralDataDaoImpl extends MybatisGenericDao implements IGeneralDataDao { - //新增通用数据 + //新增档案对照 @Override public GeneralDataEntity saveGeneralDataByType(GeneralDataEntity generalDataEntity) { generalDataEntity = super.save(getSqlIdPrifx() + "saveGeneralDataByType", generalDataEntity); return generalDataEntity; } - //查询通用数据 + //查询档案对照 @Override public List queryGeneralData(GeneralDataEntity generalDataEntity) { List query = super.query(getSqlIdPrifx() + "queryGeneralData", generalDataEntity); return query; } - //编辑通用数据 + //编辑档案对照 @Override public Integer updateGeneralDataByType(GeneralDataEntity generalDataEntity) { int update = super.update(getSqlIdPrifx() + "updateGeneralDataByType", generalDataEntity); return update; } - //删除通用数据 + //删除档案对照 @Override public Integer deleteGeneralDataByType(GeneralDataEntity generalDataEntity) { int update = super.update(getSqlIdPrifx() + "deleteGeneralDataByType", generalDataEntity); diff --git a/service/src/main/java/com/hzya/frame/sysnew/generalData/entity/GeneralDataEntity.java b/service/src/main/java/com/hzya/frame/sysnew/generalData/entity/GeneralDataEntity.java index 5aef2e9f..ac9bc603 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/generalData/entity/GeneralDataEntity.java +++ b/service/src/main/java/com/hzya/frame/sysnew/generalData/entity/GeneralDataEntity.java @@ -4,7 +4,7 @@ import com.hzya.frame.web.entity.BaseEntity; /** * - * @content 通用数据接口实体类 + * @content 档案对照实体类 * @Param * @Return * @Author hecan diff --git a/service/src/main/java/com/hzya/frame/sysnew/generalData/service/IGeneralDataService.java b/service/src/main/java/com/hzya/frame/sysnew/generalData/service/IGeneralDataService.java index df8dbd47..105511f6 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/generalData/service/IGeneralDataService.java +++ b/service/src/main/java/com/hzya/frame/sysnew/generalData/service/IGeneralDataService.java @@ -9,7 +9,7 @@ public interface IGeneralDataService extends IBaseService Date: Wed, 5 Jun 2024 11:43:40 +0800 Subject: [PATCH 39/80] =?UTF-8?q?=E4=B8=BB=E6=95=B0=E6=8D=AE=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dao/IMdmModuleSourceDao.java | 15 ++ .../dao/impl/MdmModuleSourceDaoImpl.java | 17 ++ .../entity/MdmModuleSourceEntity.java | 66 +++++ .../entity/MdmModuleSourceEntity.xml | 245 ++++++++++++++++++ .../service/IMdmModuleSourceService.java | 12 + .../impl/MdmModuleSourceServiceImpl.java | 26 ++ .../mdm/service/impl/MdmServiceImpl.java | 127 ++++++++- 7 files changed, 505 insertions(+), 3 deletions(-) create mode 100644 service/src/main/java/com/hzya/frame/mdm/mdmModuleSource/dao/IMdmModuleSourceDao.java create mode 100644 service/src/main/java/com/hzya/frame/mdm/mdmModuleSource/dao/impl/MdmModuleSourceDaoImpl.java create mode 100644 service/src/main/java/com/hzya/frame/mdm/mdmModuleSource/entity/MdmModuleSourceEntity.java create mode 100644 service/src/main/java/com/hzya/frame/mdm/mdmModuleSource/entity/MdmModuleSourceEntity.xml create mode 100644 service/src/main/java/com/hzya/frame/mdm/mdmModuleSource/service/IMdmModuleSourceService.java create mode 100644 service/src/main/java/com/hzya/frame/mdm/mdmModuleSource/service/impl/MdmModuleSourceServiceImpl.java diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleSource/dao/IMdmModuleSourceDao.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleSource/dao/IMdmModuleSourceDao.java new file mode 100644 index 00000000..bde093e6 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleSource/dao/IMdmModuleSourceDao.java @@ -0,0 +1,15 @@ +package com.hzya.frame.mdm.mdmModuleSource.dao; + +import com.hzya.frame.mdm.mdmModuleSource.entity.MdmModuleSourceEntity; +import com.hzya.frame.basedao.dao.IBaseDao; + +/** + * 主数据数据来源(mdm_module_source: table)表数据库访问层 + * + * @author makejava + * @since 2024-06-05 11:42:56 + */ +public interface IMdmModuleSourceDao extends IBaseDao { + +} + diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleSource/dao/impl/MdmModuleSourceDaoImpl.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleSource/dao/impl/MdmModuleSourceDaoImpl.java new file mode 100644 index 00000000..5be355b3 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleSource/dao/impl/MdmModuleSourceDaoImpl.java @@ -0,0 +1,17 @@ +package com.hzya.frame.mdm.mdmModuleSource.dao.impl; + +import com.hzya.frame.mdm.mdmModuleSource.entity.MdmModuleSourceEntity; +import com.hzya.frame.mdm.mdmModuleSource.dao.IMdmModuleSourceDao; +import org.springframework.stereotype.Repository; +import com.hzya.frame.basedao.dao.MybatisGenericDao; +/** + * 主数据数据来源(MdmModuleSource)表数据库访问层 + * + * @author makejava + * @since 2024-06-05 11:42:56 + */ +@Repository(value = "MdmModuleSourceDaoImpl") +public class MdmModuleSourceDaoImpl extends MybatisGenericDao implements IMdmModuleSourceDao{ + +} + diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleSource/entity/MdmModuleSourceEntity.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleSource/entity/MdmModuleSourceEntity.java new file mode 100644 index 00000000..2cc45fb4 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleSource/entity/MdmModuleSourceEntity.java @@ -0,0 +1,66 @@ +package com.hzya.frame.mdm.mdmModuleSource.entity; + +import java.util.Date; +import com.hzya.frame.web.entity.BaseEntity; +/** + * 主数据数据来源(MdmModuleSource)实体类 + * + * @author makejava + * @since 2024-06-05 11:42:57 + */ +public class MdmModuleSourceEntity extends BaseEntity { + + /** 主数据模版ID */ + private String mdmId; + /** 来源类型 */ + private String sourceType; + /** 来源名称 */ + private String sourceName; + /** 来源编码 */ + private String sourceCode; + /** 公司id */ + private String companyId; + + + public String getMdmId() { + return mdmId; + } + + public void setMdmId(String mdmId) { + this.mdmId = mdmId; + } + + public String getSourceType() { + return sourceType; + } + + public void setSourceType(String sourceType) { + this.sourceType = sourceType; + } + + public String getSourceName() { + return sourceName; + } + + public void setSourceName(String sourceName) { + this.sourceName = sourceName; + } + + public String getSourceCode() { + return sourceCode; + } + + public void setSourceCode(String sourceCode) { + this.sourceCode = sourceCode; + } + + public String getCompanyId() { + return companyId; + } + + public void setCompanyId(String companyId) { + this.companyId = companyId; + } + +} + 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 new file mode 100644 index 00000000..cc3bd233 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleSource/entity/MdmModuleSourceEntity.xml @@ -0,0 +1,245 @@ + + + + + + + + + + + + + + + + + + + + + + id + ,mdm_id + ,source_type + ,source_name + ,source_code + ,sorts + ,create_user_id + ,create_time + ,modify_user_id + ,modify_time + ,sts + ,org_id + ,company_id + + + + + + + + + + + + + + + + insert into mdm_module_source( + + id , + mdm_id , + source_type , + source_name , + source_code , + sorts , + create_user_id , + create_time , + modify_user_id , + modify_time , + sts , + org_id , + company_id , + sorts, + sts, + + )values( + + #{id} , + #{mdmId} , + #{sourceType} , + #{sourceName} , + #{sourceCode} , + #{sorts} , + #{create_user_id} , + #{create_time} , + #{modify_user_id} , + #{modify_time} , + #{sts} , + #{org_id} , + #{companyId} , + (select (max(IFNULL( a.sorts, 0 )) + 1) as sort from mdm_module_source a WHERE a.sts = 'Y' ), + 'Y', + + ) + + + + insert into mdm_module_source(mdm_id, source_type, source_name, source_code, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, sts) + values + + (#{entity.mdmId},#{entity.sourceType},#{entity.sourceName},#{entity.sourceCode},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId}, 'Y') + + + + + insert into mdm_module_source(mdm_id, source_type, source_name, source_code, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id) + values + + (#{entity.mdmId},#{entity.sourceType},#{entity.sourceName},#{entity.sourceCode},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId}) + + on duplicate key update + mdm_id = values(mdm_id), + source_type = values(source_type), + source_name = values(source_name), + source_code = values(source_code), + create_user_id = values(create_user_id), + create_time = values(create_time), + modify_user_id = values(modify_user_id), + modify_time = values(modify_time), + sts = values(sts), + org_id = values(org_id), + company_id = values(company_id) + + +update mdm_module_source set + + mdm_id = #{mdmId}, + source_type = #{sourceType}, + source_name = #{sourceName}, + source_code = #{sourceCode}, + create_user_id = #{create_user_id}, + create_time = #{create_time}, + modify_user_id = #{modify_user_id}, + modify_time = #{modify_time}, + sts = #{sts}, + org_id = #{org_id}, + company_id = #{companyId}, + +where id = #{id} + + + +update mdm_module_source set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} +where id = #{id} + + + +update mdm_module_source set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} + + and id = #{id} + and mdm_id = #{mdmId} + and source_type = #{sourceType} + and source_name = #{sourceName} + and source_code = #{sourceCode} + and sorts = #{sorts} + and sts = #{sts} + and company_id = #{companyId} + and sts='Y' + + + + + delete from mdm_module_source where id = #{id} + + + + diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleSource/service/IMdmModuleSourceService.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleSource/service/IMdmModuleSourceService.java new file mode 100644 index 00000000..f622682c --- /dev/null +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleSource/service/IMdmModuleSourceService.java @@ -0,0 +1,12 @@ +package com.hzya.frame.mdm.mdmModuleSource.service; + +import com.hzya.frame.mdm.mdmModuleSource.entity.MdmModuleSourceEntity; +import com.hzya.frame.basedao.service.IBaseService; +/** + * 主数据数据来源(MdmModuleSource)表服务接口 + * + * @author makejava + * @since 2024-06-05 11:42:57 + */ +public interface IMdmModuleSourceService extends IBaseService{ +} diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleSource/service/impl/MdmModuleSourceServiceImpl.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleSource/service/impl/MdmModuleSourceServiceImpl.java new file mode 100644 index 00000000..f9afb989 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleSource/service/impl/MdmModuleSourceServiceImpl.java @@ -0,0 +1,26 @@ +package com.hzya.frame.mdm.mdmModuleSource.service.impl; + +import com.hzya.frame.mdm.mdmModuleSource.entity.MdmModuleSourceEntity; +import com.hzya.frame.mdm.mdmModuleSource.dao.IMdmModuleSourceDao; +import com.hzya.frame.mdm.mdmModuleSource.service.IMdmModuleSourceService; +import org.springframework.stereotype.Service; +import org.springframework.beans.factory.annotation.Autowired; +import javax.annotation.Resource; +import com.hzya.frame.basedao.service.impl.BaseService; +/** + * 主数据数据来源(MdmModuleSource)表服务实现类 + * + * @author makejava + * @since 2024-06-05 11:42:57 + */ +@Service(value = "mdmModuleSourceService") +public class MdmModuleSourceServiceImpl extends BaseService implements IMdmModuleSourceService { + + private IMdmModuleSourceDao mdmModuleSourceDao; + + @Autowired + public void setMdmModuleSourceDao(IMdmModuleSourceDao dao) { + this.mdmModuleSourceDao = dao; + this.dao = dao; + } +} 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 0994442a..6756c7dc 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 @@ -1387,12 +1387,133 @@ public class MdmServiceImpl implements IMdmService { * @return void **/ private void doMdmModuleButton(SysMenuConfigEntity module,List mdmModuleViewButtonEntities, List sysButtonConfigEntities, List sysPopedomOperateEntities) { + //循环设置的按钮,再循环菜单的按钮,如果有把原先的修改状态,如果没有新增 + if(mdmModuleViewButtonEntities != null && mdmModuleViewButtonEntities.size() > 0){ + for (int i = 0; i < mdmModuleViewButtonEntities.size(); i++) { + boolean flag = false; + if(sysButtonConfigEntities != null && sysButtonConfigEntities.size() > 0){ + for (int i1 = 0; i1 < sysButtonConfigEntities.size(); i1++) { + if(mdmModuleViewButtonEntities.get(i).getButtonValue().equals(sysButtonConfigEntities.get(i1).getCode())){ + flag = true; + sysButtonConfigEntities.get(i1).setSts("Y"); + sysButtonConfigEntities.get(i1).setUpdate(); + sysButtonConfigDao.update(sysButtonConfigEntities.get(i1)); + if(sysPopedomOperateEntities != null && sysPopedomOperateEntities.size() > 0){ + for (int i2 = 0; i2 < sysPopedomOperateEntities.size(); i2++) { + if(sysPopedomOperateEntities.get(i2).getOperate().equals(sysButtonConfigEntities.get(i1).getId())){ + sysPopedomOperateEntities.get(i2).setSts("Y"); + sysPopedomOperateEntities.get(i2).setUpdate(); + sysPopedomOperateDao.update(sysPopedomOperateEntities.get(i2)); + } + } + } + break; + } + } + } + //原先没有需要新增 + if(!flag){ + if("new".equals(mdmModuleViewButtonEntities.get(i).getButtonValue())){ + SysButtonConfigEntity xz = new SysButtonConfigEntity(); + xz.setCode("new"); + xz.setNameCh("新建"); + xz.setNameEn("new"); + xz.setMenuId(module.getId()); + xz.setIconName(""); + xz.setStyles(""); + xz.setBtnFunction("new"); + xz.setRemark("主数据新建按钮"); + xz.setCreate(); + sysButtonConfigDao.save(xz); + } + if("resize".equals(mdmModuleViewButtonEntities.get(i).getButtonValue())){ - //循环查看按钮 - - + SysButtonConfigEntity cz = new SysButtonConfigEntity(); + cz.setCode("resize"); + cz.setNameCh("重置"); + cz.setNameEn("resize"); + cz.setMenuId(module.getId()); + cz.setIconName(""); + cz.setStyles(""); + cz.setBtnFunction("resize"); + cz.setRemark("主数据重置按钮"); + cz.setCreate(); + sysButtonConfigDao.save(cz); + } + if("search".equals(mdmModuleViewButtonEntities.get(i).getButtonValue())) { + + SysButtonConfigEntity cx = new SysButtonConfigEntity(); + cx.setCode("search"); + cx.setNameCh("查询"); + cx.setNameEn("search"); + cx.setMenuId(module.getId()); + cx.setIconName(""); + cx.setStyles(""); + cx.setBtnFunction("search"); + cx.setRemark("主数据查询按钮"); + cx.setCreate(); + sysButtonConfigDao.save(cx); + } + if("edit".equals(mdmModuleViewButtonEntities.get(i).getButtonValue())) { + + SysButtonConfigEntity xg = new SysButtonConfigEntity(); + xg.setCode("edit"); + xg.setNameCh("修改"); + xg.setNameEn("edit"); + xg.setMenuId(module.getId()); + xg.setIconName(""); + xg.setStyles(""); + xg.setBtnFunction("edit"); + xg.setRemark("主数据修改按钮"); + xg.setCreate(); + sysButtonConfigDao.save(xg); + } + if("dele".equals(mdmModuleViewButtonEntities.get(i).getButtonValue())) { + + SysButtonConfigEntity sc = new SysButtonConfigEntity(); + sc.setCode("dele"); + sc.setNameCh("删除"); + sc.setNameEn("dele"); + sc.setMenuId(module.getId()); + sc.setIconName(""); + sc.setStyles(""); + sc.setBtnFunction("dele"); + sc.setRemark("主数据删除按钮"); + sc.setCreate(); + sysButtonConfigDao.save(sc); + } + if("view".equals(mdmModuleViewButtonEntities.get(i).getButtonValue())) { + + SysButtonConfigEntity ck = new SysButtonConfigEntity(); + ck.setCode("view"); + ck.setNameCh("查看"); + ck.setNameEn("view"); + ck.setMenuId(module.getId()); + ck.setIconName(""); + ck.setStyles(""); + ck.setBtnFunction("view"); + ck.setRemark("主数据查看按钮"); + ck.setCreate(); + sysButtonConfigDao.save(ck); + } + if("send".equals(mdmModuleViewButtonEntities.get(i).getButtonValue())) { + SysButtonConfigEntity xf = new SysButtonConfigEntity(); + xf.setCode("send"); + xf.setNameCh("下发"); + xf.setNameEn("send"); + xf.setMenuId(module.getId()); + xf.setIconName(""); + xf.setStyles(""); + xf.setBtnFunction("send"); + xf.setRemark("主数据下发按钮"); + xf.setCreate(); + sysButtonConfigDao.save(xf); + } + } + } + } } ///** // * @param object From b429c40153e5b067fd8aac78bc44b1a7448ea088 Mon Sep 17 00:00:00 2001 From: hecan <1718492867@qq.com> Date: Wed, 5 Jun 2024 11:46:51 +0800 Subject: [PATCH 40/80] =?UTF-8?q?=E8=B0=83=E6=95=B4=E9=80=9A=E7=94=A8?= =?UTF-8?q?=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../execsql/service/ExecSqlServiceImpl.java | 4 +- .../sysnew/comparison/dao/IComparisonDao.java | 40 ++++ .../dao/impl/ComparisonDaoImpl.java | 28 +++ .../entity/ComparisonDetailsEntity.xml | 2 +- .../comparison/entity/ComparisonEntity.java | 55 ++++++ .../comparison/entity/ComparisonEntity.xml | 83 ++++---- .../service/IComparisonService.java | 5 + .../service/impl/ComparisonServiceImpl.java | 182 ++++++++++++------ 8 files changed, 292 insertions(+), 107 deletions(-) diff --git a/common/src/main/java/com/hzya/frame/execsql/service/ExecSqlServiceImpl.java b/common/src/main/java/com/hzya/frame/execsql/service/ExecSqlServiceImpl.java index 468e0c3c..ff02bcc4 100644 --- a/common/src/main/java/com/hzya/frame/execsql/service/ExecSqlServiceImpl.java +++ b/common/src/main/java/com/hzya/frame/execsql/service/ExecSqlServiceImpl.java @@ -53,7 +53,7 @@ public class ExecSqlServiceImpl implements IExecSqlService { public List> execSelectSql(ExecSqlEntity entity) throws RuntimeException { List> list = new ArrayList<>(); logger.info("=============进入execSelectSql方法============"); - if (null != entity && ObjectUtils.isEmpty(entity.getSql())) { + if (null != entity && null!=entity.getSql()) { //sqlsession // SqlSession sqlSession = getSqlSession(entity.getDatasource_code()); // SqlSession sqlSession = new DataSourceUtil().getDefaultSqlSession(); @@ -61,7 +61,7 @@ public class ExecSqlServiceImpl implements IExecSqlService { logger.info("=============execSelectSql方法要执行的sql:============" + select_sql); if (!select_sql.contains("update") && !select_sql.contains("delete") && !select_sql.contains("insert") && !select_sql.contains("create")) { - list = sqlSession.selectList("com.hzya.frame.sysnew.execsql.entity.ExecSqlEntity.ExecSqlEntity_execsql", entity); + list = sqlSession.selectList("com.hzya.frame.execsql.entity.ExecSqlEntity.ExecSqlEntity_execsql", entity); logger.info("===========execSelectSql方法返回的结果条数=============" + list.size()); } //sqlSession.close(); diff --git a/service/src/main/java/com/hzya/frame/sysnew/comparison/dao/IComparisonDao.java b/service/src/main/java/com/hzya/frame/sysnew/comparison/dao/IComparisonDao.java index d33044c7..42b171db 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/comparison/dao/IComparisonDao.java +++ b/service/src/main/java/com/hzya/frame/sysnew/comparison/dao/IComparisonDao.java @@ -79,4 +79,44 @@ public interface IComparisonDao extends IBaseDao { * @Date 2024/5/28 14:39 * **/ ComparisonEntity queryComparisonById(ComparisonEntity comparison); + + /** + * + * @content 根据主数据编码查询mdm_module数据 + * @Param + * @Return + * @Author hecan + * @Date 2024/6/4 11:37 + * **/ + ComparisonEntity queryComparisonBymdmCode(ComparisonEntity comparison); + + /** + * + * @content 根据mdm_module得id查询mdm_module_db得数据 + * @Param + * @Return + * @Author hecan + * @Date 2024/6/4 11:40 + * **/ + List queryComparisonBymdmId(ComparisonEntity comparison); + + /** + * + * @content 根据mdm_module得id查询mdm_module_db_fileds得数据 + * @Param + * @Return + * @Author hecan + * @Date 2024/6/4 11:45 + * **/ + List queryComparisonBymdmIdFileds(ComparisonEntity comparison); + + /** + * + * @content 根据数据来源内类型是插件的应用类型做分组 + * @Param + * @Return + * @Author hecan + * @Date 2024/6/4 17:41 + * **/ + List queryModuleSource(); } diff --git a/service/src/main/java/com/hzya/frame/sysnew/comparison/dao/impl/ComparisonDaoImpl.java b/service/src/main/java/com/hzya/frame/sysnew/comparison/dao/impl/ComparisonDaoImpl.java index 63281c12..4c8a0298 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/comparison/dao/impl/ComparisonDaoImpl.java +++ b/service/src/main/java/com/hzya/frame/sysnew/comparison/dao/impl/ComparisonDaoImpl.java @@ -59,4 +59,32 @@ public class ComparisonDaoImpl extends MybatisGenericDao comparisonEntities = super.query(getSqlIdPrifx() + "queryComparisonById", comparison); return comparisonEntities.get(0); } + + //根据主数据编码查询mdm_module数据 + @Override + public ComparisonEntity queryComparisonBymdmCode(ComparisonEntity comparison) { + ComparisonEntity comparisonEntity =(ComparisonEntity) super.selectOne(getSqlIdPrifx() + "queryComparisonBymdmCode", comparison); + return comparisonEntity; + } + + //根据mdm_module得id查询mdm_module_db得数据 + @Override + public List queryComparisonBymdmId(ComparisonEntity comparison) { + List list =(List) super.selectList(getSqlIdPrifx() + "queryComparisonBymdmId", comparison); + return list; + } + + //根据mdm_module得id查询mdm_module_db_fileds得数据 + @Override + public List queryComparisonBymdmIdFileds(ComparisonEntity comparison) { + List list =(List) super.selectList(getSqlIdPrifx() + "queryComparisonBymdmIdFileds", comparison); + return list; + } + + //根据数据来源内类型是插件的应用类型做分组 + @Override + public List queryModuleSource() { + List list =(List) super.selectList(getSqlIdPrifx() + "queryModuleSource",""); + return list; + } } 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 8ca17330..0d1ca13f 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 @@ -55,7 +55,7 @@ update ${dbName} - set sts= 'N' ,modify_time = now(),modify_user_id = #{modify_user_id} + set sts= 'N' ,modify_time = now(),modify_user_id = #{modify_user_id}, data_status= 'N',delete_status='0' + + + + + + + + - - select - case when length(ifnull(max(right(document_rule,length(#{ruleSuffix}))),'0')+1)=1 - then concat(#{rulePrefix},'-',date_format(NOW(),#{ruleMiddle}),'-','000',ifnull(max(right(document_rule,length(#{ruleSuffix}))),'0')+1) - when length(ifnull(max(right(document_rule,length(#{ruleSuffix}))),'0')+1)=2 - then concat(#{rulePrefix},'-',date_format(NOW(),#{ruleMiddle}),'-','00',ifnull(max(right(document_rule,length(#{ruleSuffix}))),'0')+1) - when length(ifnull(max(right(document_rule,length(#{ruleSuffix}))),'0')+1)=3 - then concat(#{rulePrefix},'-',date_format(NOW(),#{ruleMiddle}),'-','0',ifnull(max(right(document_rule,length(#{ruleSuffix}))),'0')+1) - else concat(#{rulePrefix},'-',date_format(NOW(),#{ruleMiddle}),'-',ifnull(max(right(document_rule,length(#{ruleSuffix}))),'0')+1) - end as document_rule, - right( - case when length(ifnull(max(right(document_rule,length(#{ruleSuffix}))),'0')+1)=1 - then concat(#{rulePrefix},'-',date_format(NOW(),#{ruleMiddle}),'-','000',ifnull(max(right(document_rule,length(#{ruleSuffix}))),'0')+1) - when length(ifnull(max(right(document_rule,length(#{ruleSuffix}))),'0')+1)=2 - then concat(#{rulePrefix},'-',date_format(NOW(),#{ruleMiddle}),'-','00',ifnull(max(right(document_rule,length(#{ruleSuffix}))),'0')+1) - when length(ifnull(max(right(document_rule,length(#{ruleSuffix}))),'0')+1)=3 - then concat(#{rulePrefix},'-',date_format(NOW(),#{ruleMiddle}),'-','0',ifnull(max(right(document_rule,length(#{ruleSuffix}))),'0')+1) - else concat(#{rulePrefix},'-',date_format(NOW(),#{ruleMiddle}),'-',ifnull(max(right(document_rule,length(#{ruleSuffix}))),'0')+1) - end ,4) as documentRuleNum - from ${dbName} where document_rule like concat(#{rulePrefix},'-',date_format(NOW(),#{ruleMiddle}),'-','%'); - + select + concat(#{rulePrefix},'-',date_format(NOW(),#{ruleMiddle}),'-',ifnull(max(substring_index(document_rule,'-',-1)),'0')+1) as documentRule, + substring_index( + (concat(#{rulePrefix},'-',date_format(NOW(),#{ruleMiddle}),'-',ifnull(max(substring_index(document_rule,'-',-1)),'0')+1)),'-',-1 + ) + as documentRuleNum + from ${dbName} where document_rule like concat(#{rulePrefix},'-',date_format(NOW(),#{ruleMiddle}),'-','%'); + + + + @@ -120,7 +121,7 @@ update ${dbName} - set dataStatus= 'N' ,modify_time = now(),modify_user_id = #{modify_user_id} + set data_status= 'N' ,modify_time = now(),modify_user_id = #{modify_user_id},delete_status='0' and ${key} =#{value} diff --git a/service/src/main/java/com/hzya/frame/sysnew/comparison/service/IComparisonService.java b/service/src/main/java/com/hzya/frame/sysnew/comparison/service/IComparisonService.java index 31f9e6b5..d03fe903 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/comparison/service/IComparisonService.java +++ b/service/src/main/java/com/hzya/frame/sysnew/comparison/service/IComparisonService.java @@ -1,6 +1,7 @@ package com.hzya.frame.sysnew.comparison.service; import com.alibaba.fastjson.JSONObject; +import com.baomidou.dynamic.datasource.annotation.DS; import com.hzya.frame.basedao.service.IBaseService; import com.hzya.frame.sysnew.comparison.entity.ComparisonEntity; import com.hzya.frame.web.entity.JsonResultEntity; @@ -15,6 +16,7 @@ public interface IComparisonService extends IBaseService } //分页查询通用数据数据 + @DS("master") @Override public JsonResultEntity queryEntityPage(JSONObject json) { JSONObject jsonObject = json.getJSONObject("jsonStr"); @@ -48,7 +51,9 @@ public class ComparisonServiceImpl extends BaseService List comparisonEntities=new ArrayList<>(); try { //根据主数据编码查询表名称,字段名称等信息 10001 - comparisonEntities = comparisonDao.queryComparison(comparisonEntity); + //comparisonEntities = comparisonDao.queryComparison(comparisonEntity); + + comparisonEntities=getComparisonEntity(comparisonEntity); }catch (Exception e){ logger.info("根据主数据编码查询信息错误:{}",e.getMessage()); return BaseResult.getFailureMessageEntity("查询失败"); @@ -80,6 +85,7 @@ public class ComparisonServiceImpl extends BaseService } //新增通用数据数据 + @DS("master") @Override public JsonResultEntity saveEntity(JSONObject json) { JSONObject jsonObject = json.getJSONObject("jsonStr"); @@ -97,7 +103,9 @@ public class ComparisonServiceImpl extends BaseService List comparisonEntities=new ArrayList<>(); try { //根据主数据编码查询表名称,字段名称等信息 10001 - comparisonEntities = comparisonDao.queryComparison(comparisonEntity); + // comparisonEntities = comparisonDao.queryComparison(comparisonEntity); + + comparisonEntities=getComparisonEntity(comparisonEntity); }catch (Exception e){ logger.info("根据主数据编码查询信息错误:{}",e.getMessage()); return BaseResult.getFailureMessageEntity("保存失败"); @@ -109,34 +117,8 @@ public class ComparisonServiceImpl extends BaseService Map map = new HashMap<>();//将主表数据存到map中 Map mapDetails = new HashMap<>();//将子表数据存到map中 if (comparisonEntities != null && comparisonEntities.size() > 0) { - for (ComparisonEntity entity : comparisonEntities) { - //遍历主表下面的所有key,字段名 - for (String key : jsonObjectMain.keySet()) { - if (entity.getDbType().equals("1")) { - comparisonEntity.setDbName(entity.getDbName()); - //如果表中得字段与输入得字段相等,则存起来 - if(entity.getEnName().equals(key)){ - map.put(key, jsonObjectMain.getString(key)); - } - } - } - } - 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)); - } - } - } - } - } - } + map=spliceMainMap(comparisonEntities,jsonObjectMain,map,comparisonEntity); + mapDetails=spliceDetailMap(comparisonEntities,mapDetails,comparisonDetailsEntity,jsonArray); String uuid = UUIDUtils.getUUID(); map.put("id", uuid); map.put("create_user_id", "c796fd9ba4c9f5ff3cc2fa41a040e443"); @@ -145,20 +127,23 @@ public class ComparisonServiceImpl extends BaseService map.put("create_time", new Date()); map.put("modify_time", new Date()); map.put("sts", "Y"); + map.put("add_status","0");//新增状态 + map.put("update_status","1");//修改状态 + map.put("delete_status","1");//删除状态 //查询单据规则 try { ComparisonEntity comparisonEntityRule = comparisonEntities.get(0); - comparisonEntityRule= comparisonDao.queryComparisonById(comparisonEntityRule); - String documentRule = comparisonEntityRule.getDocumentRule(); + comparisonEntityRule= comparisonDao.queryComparisonById(comparisonEntityRule); + String documentRule =comparisonEntityRule.getDocumentRule();; //"KH-2024-05-30-1"; logger.info("通用数据保存接口中根据mId查询出来的单据规则为:{}",documentRule); if(documentRule !=null){ - //获取规则前缀 CK + //获取规则前缀 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 ruleSuffix= documentRule.substring(documentRule.lastIndexOf("-")+1); + String ruleSuffix= documentRule.substring(documentRule.lastIndexOf("-")+1); //生成单据规则 comparisonEntity.setRulePrefix(rulePrefix); comparisonEntity.setRuleMiddle(ruleMiddle); @@ -225,7 +210,9 @@ public class ComparisonServiceImpl extends BaseService List comparisonEntities=new ArrayList<>(); //根据主数据编码查询表名称,字段名称等信息 10001 try { - comparisonEntities = comparisonDao.queryComparison(comparisonEntity); + // comparisonEntities = comparisonDao.queryComparison(comparisonEntity); + + comparisonEntities=getComparisonEntity(comparisonEntity); }catch (Exception e){ logger.info("根据主数据编码查询信息错误:{}",e.getMessage()); return BaseResult.getFailureMessageEntity("更新失败"); @@ -233,38 +220,15 @@ public class ComparisonServiceImpl extends BaseService Map map=new HashMap<>();//将主表数据存到map中 Map mapDetails=new HashMap<>();//将子表数据存到map中 if(comparisonEntities !=null && comparisonEntities.size()>0) { - for (ComparisonEntity entity : comparisonEntities) { - //遍历主表下面的所有key,字段名 - for (String key : jsonObjectMain.keySet()) { - if (entity.getDbType().equals("1")) { - comparisonEntity.setDbName(entity.getDbName()); - if(entity.getEnName().equals(key)){ - map.put(key, jsonObjectMain.getString(key)); - } - } - } - } - 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)); - } - } - } - } - } - } + map=spliceMainMap(comparisonEntities,jsonObjectMain,map,comparisonEntity); + mapDetails=spliceDetailMap(comparisonEntities,map,comparisonDetailsEntity,jsonArray); map.put("create_user_id", "c796fd9ba4c9f5ff3cc2fa41a040e443"); map.put("modify_user_id", "c796fd9ba4c9f5ff3cc2fa41a040e443"); map.put("org_id", "0"); map.put("modify_time", new Date()); map.put("sts", "Y"); + map.put("data_status","F");//数据状态 + map.put("update_status","0");//修改状态 comparisonEntity.setMap(map); comparisonEntity.setId(jsonObjectMain.getString("id")); /*//生成单据规则 @@ -288,6 +252,7 @@ public class ComparisonServiceImpl extends BaseService 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); @@ -323,7 +288,9 @@ public class ComparisonServiceImpl extends BaseService List comparisonEntities=new ArrayList<>(); //根据主数据编码查询表名称,字段名称等信息 10001 try { - comparisonEntities = comparisonDao.queryComparison(comparisonEntity); + // comparisonEntities = comparisonDao.queryComparison(comparisonEntity); + + comparisonEntities=getComparisonEntity(comparisonEntity); }catch (Exception e){ logger.info("根据主数据编码查询信息错误:{}",e.getMessage()); return BaseResult.getFailureMessageEntity("删除失败"); @@ -384,4 +351,93 @@ public class ComparisonServiceImpl extends BaseService return null; } } + + //得到主表数据 + private Map spliceMainMap(List comparisonEntities,JSONObject jsonObjectMain,Map map,ComparisonEntity comparisonEntity){ + for (ComparisonEntity entity : comparisonEntities) { + //遍历主表下面的所有key,字段名 + for (String key : jsonObjectMain.keySet()) { + if (entity.getDbType().equals("1")) { + comparisonEntity.setDbName(entity.getDbName()); + //如果表中得字段与输入得字段相等,则存起来 + if(entity.getEnName().equals(key)){ + map.put(key, jsonObjectMain.getString(key)); + } + } + } + } + return map; + } + + //得到明细表数据 + private Map spliceDetailMap(List comparisonEntities,Map mapDetails,ComparisonDetailsEntity comparisonDetailsEntity,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)); + } + } + } + } + } + } + return mapDetails; + } + + //根据主数据编码获取数据,表名称,字段名称等 + public List getComparisonEntity(ComparisonEntity comparisonEntity) { + List comparisonEntities = new ArrayList<>(); + //根据主数据编码查询mdm_module数据 + ComparisonEntity comparisonEntityModule = comparisonDao.queryComparisonBymdmCode(comparisonEntity); + if (comparisonEntityModule != null) { + //根据mdm_module得id查询mdm_module_db得数据 + List comparisonEntitiesModuleDb = comparisonDao.queryComparisonBymdmId(comparisonEntityModule); + //根据mdm_module得id查询mdm_module_db_fileds得数据 + List comparisonEntitiesFiles = comparisonDao.queryComparisonBymdmIdFileds(comparisonEntityModule); + for (ComparisonEntity comparison : comparisonEntitiesModuleDb) { + for (ComparisonEntity comparisonEntitiesFile : comparisonEntitiesFiles) { + if(comparison.getDbId().equals(comparisonEntitiesFile.getDbId())){ + ComparisonEntity comparisonEntityFile=new ComparisonEntity(); + comparisonEntityFile.setChName(comparisonEntitiesFile.getChName()); + comparisonEntityFile.setEnName(comparisonEntitiesFile.getEnName()); + comparisonEntityFile.setFiledType(comparisonEntitiesFile.getFiledType()); + comparisonEntityFile.setAddType(comparisonEntitiesFile.getAddType()); + comparisonEntityFile.setUpdateType(comparisonEntitiesFile.getUpdateType()); + comparisonEntityFile.setShowType(comparisonEntitiesFile.getShowType()); + comparisonEntityFile.setQueryType(comparisonEntitiesFile.getQueryType()); + comparisonEntityFile.setListType(comparisonEntitiesFile.getListType()); + comparisonEntityFile.setViewType(comparisonEntitiesFile.getViewType()); + comparisonEntityFile.setDbName(comparison.getDbName()); + comparisonEntityFile.setDbType(comparison.getDbType()); + comparisonEntityFile.setDbId(comparison.getDbId()); + comparisonEntityFile.setmId(comparisonEntitiesFile.getmId()); + comparisonEntityFile.setMdmName(comparisonEntityModule.getMdmName()); + comparisonEntityFile.setMdmCode(comparisonEntityModule.getMdmCode()); + comparisonEntities.add(comparisonEntityFile); + } + } + } + return comparisonEntities; + } + return null; + } + + //查询数据来源 根据数据来源内类型是插件的应用类型做分组 + public List getComparisonEntityFiles(){ + List comparisonEntities = comparisonDao.queryModuleSource(); + if(CollectionUtils.isNotEmpty(comparisonEntities)){ + for (ComparisonEntity comparisonEntity : comparisonEntities) { + //根据来源类型获取档案数据 比如U8C + + } + } + return null; + } + } From 8b78ebd55537744cb8836b3449f2e92de5d4ce10 Mon Sep 17 00:00:00 2001 From: lvleigang <957075182@qq.com> Date: Thu, 6 Jun 2024 08:31:59 +0800 Subject: [PATCH 41/80] =?UTF-8?q?=E4=B8=BB=E6=95=B0=E6=8D=AE=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../frame/mdm/entity/MdmDistributeDto.java | 31 + .../hzya/frame/mdm/entity/MdmSourceDto.java | 34 + .../hzya/frame/mdm/entity/MdmViewFiledVo.java | 114 +++ .../com/hzya/frame/mdm/entity/MdmViewVo.java | 64 ++ .../entity/MdmModuleDistributeEntity.java | 12 +- .../dao/IMdmModuleOptionLogDao.java | 15 + .../dao/impl/MdmModuleOptionLogDaoImpl.java | 17 + .../entity/MdmModuleOptionLogEntity.java | 104 +++ .../entity/MdmModuleOptionLogEntity.xml | 272 +++++++ .../dao/IMdmModuleSendLogDao.java | 15 + .../dao/impl/MdmModuleSendLogDaoImpl.java | 17 + .../entity/MdmModuleSendLogEntity.java | 94 +++ .../entity/MdmModuleSendLogEntity.xml | 262 +++++++ .../entity/MdmModuleSourceEntity.xml | 6 +- .../hzya/frame/mdm/service/IMdmService.java | 121 ++- .../frame/mdm/service/IMdmServiceCache.java | 13 + .../mdm/service/impl/MdmServiceCache.java | 113 +++ .../mdm/service/impl/MdmServiceImpl.java | 723 +++++++++++------- 18 files changed, 1726 insertions(+), 301 deletions(-) create mode 100644 service/src/main/java/com/hzya/frame/mdm/entity/MdmDistributeDto.java create mode 100644 service/src/main/java/com/hzya/frame/mdm/entity/MdmSourceDto.java create mode 100644 service/src/main/java/com/hzya/frame/mdm/entity/MdmViewFiledVo.java create mode 100644 service/src/main/java/com/hzya/frame/mdm/entity/MdmViewVo.java create mode 100644 service/src/main/java/com/hzya/frame/mdm/mdmModuleOptionLog/dao/IMdmModuleOptionLogDao.java create mode 100644 service/src/main/java/com/hzya/frame/mdm/mdmModuleOptionLog/dao/impl/MdmModuleOptionLogDaoImpl.java create mode 100644 service/src/main/java/com/hzya/frame/mdm/mdmModuleOptionLog/entity/MdmModuleOptionLogEntity.java create mode 100644 service/src/main/java/com/hzya/frame/mdm/mdmModuleOptionLog/entity/MdmModuleOptionLogEntity.xml create mode 100644 service/src/main/java/com/hzya/frame/mdm/mdmModuleSendLog/dao/IMdmModuleSendLogDao.java create mode 100644 service/src/main/java/com/hzya/frame/mdm/mdmModuleSendLog/dao/impl/MdmModuleSendLogDaoImpl.java create mode 100644 service/src/main/java/com/hzya/frame/mdm/mdmModuleSendLog/entity/MdmModuleSendLogEntity.java create mode 100644 service/src/main/java/com/hzya/frame/mdm/mdmModuleSendLog/entity/MdmModuleSendLogEntity.xml diff --git a/service/src/main/java/com/hzya/frame/mdm/entity/MdmDistributeDto.java b/service/src/main/java/com/hzya/frame/mdm/entity/MdmDistributeDto.java new file mode 100644 index 00000000..57b97fdc --- /dev/null +++ b/service/src/main/java/com/hzya/frame/mdm/entity/MdmDistributeDto.java @@ -0,0 +1,31 @@ +package com.hzya.frame.mdm.entity; + + +import com.hzya.frame.mdm.mdmModuleDistribute.entity.MdmModuleDistributeEntity; +import java.util.List; + +public class MdmDistributeDto { + + + //主数据编码 + private Long mdmCode; + + private List mdmModuleDistributeEntities; + + public List getMdmModuleDistributeEntities() { + return mdmModuleDistributeEntities; + } + + public void setMdmModuleDistributeEntities(List mdmModuleDistributeEntities) { + this.mdmModuleDistributeEntities = mdmModuleDistributeEntities; + } + + public Long getMdmCode() { + return mdmCode; + } + + public void setMdmCode(Long mdmCode) { + this.mdmCode = mdmCode; + } +} + diff --git a/service/src/main/java/com/hzya/frame/mdm/entity/MdmSourceDto.java b/service/src/main/java/com/hzya/frame/mdm/entity/MdmSourceDto.java new file mode 100644 index 00000000..e00af986 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/mdm/entity/MdmSourceDto.java @@ -0,0 +1,34 @@ +package com.hzya.frame.mdm.entity; + + +import com.hzya.frame.mdm.mdmModuleDistribute.entity.MdmModuleDistributeEntity; +import com.hzya.frame.mdm.mdmModuleSource.entity.MdmModuleSourceEntity; + +import java.util.List; + +public class MdmSourceDto { + + + //主数据编码 + private Long mdmCode; + + private List mdmModuleSourceEntities; + + + public List getMdmModuleSourceEntities() { + return mdmModuleSourceEntities; + } + + public void setMdmModuleSourceEntities(List mdmModuleSourceEntities) { + this.mdmModuleSourceEntities = mdmModuleSourceEntities; + } + + public Long getMdmCode() { + return mdmCode; + } + + public void setMdmCode(Long mdmCode) { + this.mdmCode = mdmCode; + } +} + diff --git a/service/src/main/java/com/hzya/frame/mdm/entity/MdmViewFiledVo.java b/service/src/main/java/com/hzya/frame/mdm/entity/MdmViewFiledVo.java new file mode 100644 index 00000000..f1e25c5a --- /dev/null +++ b/service/src/main/java/com/hzya/frame/mdm/entity/MdmViewFiledVo.java @@ -0,0 +1,114 @@ +package com.hzya.frame.mdm.entity; + +import com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity; +import com.hzya.frame.mdm.mdmModuleDbFiledsRule.entity.MdmModuleDbFiledsRuleEntity; +import com.hzya.frame.mdm.mdmModuleView.entity.MdmModuleViewEntity; + +import java.util.List; + +public class MdmViewFiledVo { + + //字段id + private String id; + //表名 + private String dbName; + //类型 1、主表 2、明细 + private String dbType; + //主数据模版ID + private String mdmId; + //模版数据库id + private String dbId; + //中文名 + private String chName; + //英文名 + private String enName; + //排序 + private Integer sorts; + /** + * 字段类型 1、BIGINT 2、DECIMAL 3、VARCHAR 4、DATETIME + */ + private String filedType; + //字段规则 + private List ruleList; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getDbName() { + return dbName; + } + + public void setDbName(String dbName) { + this.dbName = dbName; + } + + public String getDbType() { + return dbType; + } + + public void setDbType(String dbType) { + this.dbType = dbType; + } + + public String getMdmId() { + return mdmId; + } + + public void setMdmId(String mdmId) { + this.mdmId = mdmId; + } + + public String getDbId() { + return dbId; + } + + public void setDbId(String dbId) { + this.dbId = dbId; + } + + public String getChName() { + return chName; + } + + public void setChName(String chName) { + this.chName = chName; + } + + public String getEnName() { + return enName; + } + + public void setEnName(String enName) { + this.enName = enName; + } + + public List getRuleList() { + return ruleList; + } + + public void setRuleList(List ruleList) { + this.ruleList = ruleList; + } + + public Integer getSorts() { + return sorts; + } + + public void setSorts(Integer sorts) { + this.sorts = sorts; + } + + public String getFiledType() { + return filedType; + } + + public void setFiledType(String filedType) { + this.filedType = filedType; + } +} + diff --git a/service/src/main/java/com/hzya/frame/mdm/entity/MdmViewVo.java b/service/src/main/java/com/hzya/frame/mdm/entity/MdmViewVo.java new file mode 100644 index 00000000..8630811e --- /dev/null +++ b/service/src/main/java/com/hzya/frame/mdm/entity/MdmViewVo.java @@ -0,0 +1,64 @@ +package com.hzya.frame.mdm.entity; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity; +import com.hzya.frame.mdm.mdmModuleView.entity.MdmModuleViewEntity; +import org.springframework.format.annotation.DateTimeFormat; + +import java.util.Date; +import java.util.List; + +public class MdmViewVo { + + private String id; + //模版信息 + private MdmModuleEntity mdmModuleEntity; + //模版展示信息 + private MdmModuleViewEntity mdmModuleViewEntity; + //查询条件 + private List queryList; + //列表 + private List listList; + + public List getQueryList() { + return queryList; + } + + public void setQueryList(List queryList) { + this.queryList = queryList; + } + + public List getListList() { + return listList; + } + + public void setListList(List listList) { + this.listList = listList; + } + + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public MdmModuleEntity getMdmModuleEntity() { + return mdmModuleEntity; + } + + public void setMdmModuleEntity(MdmModuleEntity mdmModuleEntity) { + this.mdmModuleEntity = mdmModuleEntity; + } + + public MdmModuleViewEntity getMdmModuleViewEntity() { + return mdmModuleViewEntity; + } + + public void setMdmModuleViewEntity(MdmModuleViewEntity mdmModuleViewEntity) { + this.mdmModuleViewEntity = mdmModuleViewEntity; + } +} + diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistribute/entity/MdmModuleDistributeEntity.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistribute/entity/MdmModuleDistributeEntity.java index 23df5360..0ce7e336 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistribute/entity/MdmModuleDistributeEntity.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistribute/entity/MdmModuleDistributeEntity.java @@ -1,6 +1,9 @@ package com.hzya.frame.mdm.mdmModuleDistribute.entity; import java.util.Date; +import java.util.List; + +import com.hzya.frame.mdm.mdmModuleDistributeDetail.entity.MdmModuleDistributeDetailEntity; import com.hzya.frame.web.entity.BaseEntity; /** * 主数据功能应用分发表(MdmModuleDistribute)实体类 @@ -24,7 +27,7 @@ public class MdmModuleDistributeEntity extends BaseEntity { private String enabledState; /** 公司id */ private String companyId; - + private List mdmModuleDistributeDetailEntities; public String getMdmId() { return mdmId; @@ -82,5 +85,12 @@ public class MdmModuleDistributeEntity extends BaseEntity { this.companyId = companyId; } + public List getMdmModuleDistributeDetailEntities() { + return mdmModuleDistributeDetailEntities; + } + + public void setMdmModuleDistributeDetailEntities(List mdmModuleDistributeDetailEntities) { + this.mdmModuleDistributeDetailEntities = mdmModuleDistributeDetailEntities; + } } diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleOptionLog/dao/IMdmModuleOptionLogDao.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleOptionLog/dao/IMdmModuleOptionLogDao.java new file mode 100644 index 00000000..a65bb1bc --- /dev/null +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleOptionLog/dao/IMdmModuleOptionLogDao.java @@ -0,0 +1,15 @@ +package com.hzya.frame.mdm.mdmModuleOptionLog.dao; + +import com.hzya.frame.mdm.mdmModuleOptionLog.entity.MdmModuleOptionLogEntity; +import com.hzya.frame.basedao.dao.IBaseDao; + +/** + * 主数据模版(mdm_module_option_log: table)表数据库访问层 + * + * @author makejava + * @since 2024-06-05 16:10:31 + */ +public interface IMdmModuleOptionLogDao extends IBaseDao { + +} + diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleOptionLog/dao/impl/MdmModuleOptionLogDaoImpl.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleOptionLog/dao/impl/MdmModuleOptionLogDaoImpl.java new file mode 100644 index 00000000..b0fc4626 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleOptionLog/dao/impl/MdmModuleOptionLogDaoImpl.java @@ -0,0 +1,17 @@ +package com.hzya.frame.mdm.mdmModuleOptionLog.dao.impl; + +import com.hzya.frame.mdm.mdmModuleOptionLog.entity.MdmModuleOptionLogEntity; +import com.hzya.frame.mdm.mdmModuleOptionLog.dao.IMdmModuleOptionLogDao; +import org.springframework.stereotype.Repository; +import com.hzya.frame.basedao.dao.MybatisGenericDao; +/** + * 主数据模版(MdmModuleOptionLog)表数据库访问层 + * + * @author makejava + * @since 2024-06-05 16:10:31 + */ +@Repository(value = "MdmModuleOptionLogDaoImpl") +public class MdmModuleOptionLogDaoImpl extends MybatisGenericDao implements IMdmModuleOptionLogDao{ + +} + diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleOptionLog/entity/MdmModuleOptionLogEntity.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleOptionLog/entity/MdmModuleOptionLogEntity.java new file mode 100644 index 00000000..d4af3ede --- /dev/null +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleOptionLog/entity/MdmModuleOptionLogEntity.java @@ -0,0 +1,104 @@ +package com.hzya.frame.mdm.mdmModuleOptionLog.entity; + +import java.util.Date; +import com.hzya.frame.web.entity.BaseEntity; +/** + * 主数据模版(MdmModuleOptionLog)实体类 + * + * @author makejava + * @since 2024-06-05 16:10:32 + */ +public class MdmModuleOptionLogEntity extends BaseEntity { + //主数据表名 + private String tableName; + //主数据编码 + private Long mdmCode; + /** 主表id */ + private String formmainId; + /** 来源名称 */ + private String sourceName; + /** 编码 */ + private String code; + /** source_data */ + private String sourceData; + /** 操作类型 */ + private String optionType; + /** 操作人 */ + private String optionName; + /** 公司id */ + private String companyId; + + + public String getFormmainId() { + return formmainId; + } + + public void setFormmainId(String formmainId) { + this.formmainId = formmainId; + } + + public String getSourceName() { + return sourceName; + } + + public void setSourceName(String sourceName) { + this.sourceName = sourceName; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getSourceData() { + return sourceData; + } + + public void setSourceData(String sourceData) { + this.sourceData = sourceData; + } + + public String getOptionType() { + return optionType; + } + + public void setOptionType(String optionType) { + this.optionType = optionType; + } + + public String getOptionName() { + return optionName; + } + + public void setOptionName(String optionName) { + this.optionName = optionName; + } + + public String getCompanyId() { + return companyId; + } + + public void setCompanyId(String companyId) { + this.companyId = companyId; + } + + public String getTableName() { + return tableName; + } + + public void setTableName(String tableName) { + this.tableName = tableName; + } + + public Long getMdmCode() { + return mdmCode; + } + + public void setMdmCode(Long mdmCode) { + this.mdmCode = mdmCode; + } +} + diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleOptionLog/entity/MdmModuleOptionLogEntity.xml b/service/src/main/java/com/hzya/frame/mdm/mdmModuleOptionLog/entity/MdmModuleOptionLogEntity.xml new file mode 100644 index 00000000..af218694 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleOptionLog/entity/MdmModuleOptionLogEntity.xml @@ -0,0 +1,272 @@ + + + + + + + + + + + + + + + + + + + + + + + + id + ,formmain_id + ,source_name + ,code + ,source_data + ,option_type + ,option_name + ,sorts + ,create_user_id + ,create_time + ,modify_user_id + ,modify_time + ,sts + ,org_id + ,company_id + + + + + + + + + + + + + + + + + insert into ${tableName}( + + id , + formmain_id , + source_name , + code , + source_data , + option_type , + option_name , + sorts , + create_user_id , + create_time , + modify_user_id , + modify_time , + sts , + org_id , + company_id , + sorts, + sts, + + )values( + + #{id} , + #{formmainId} , + #{sourceName} , + #{code} , + #{sourceData} , + #{optionType} , + #{optionName} , + #{sorts} , + #{create_user_id} , + #{create_time} , + #{modify_user_id} , + #{modify_time} , + #{sts} , + #{org_id} , + #{companyId} , + (select (max(IFNULL( a.sorts, 0 )) + 1) as sort from ${tableName} a WHERE a.sts = 'Y' ), + 'Y', + + ) + + + + insert into ${tableName}(formmain_id, source_name, code, source_data, option_type, option_name, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, sts) + values + + (#{entity.formmainId},#{entity.sourceName},#{entity.code},#{entity.sourceData},#{entity.optionType},#{entity.optionName},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId}, 'Y') + + + + + insert into ${tableName}(formmain_id, source_name, code, source_data, option_type, option_name, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id) + values + + (#{entity.formmainId},#{entity.sourceName},#{entity.code},#{entity.sourceData},#{entity.optionType},#{entity.optionName},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId}) + + on duplicate key update + formmain_id = values(formmain_id), + source_name = values(source_name), + code = values(code), + source_data = values(source_data), + option_type = values(option_type), + option_name = values(option_name), + create_user_id = values(create_user_id), + create_time = values(create_time), + modify_user_id = values(modify_user_id), + modify_time = values(modify_time), + sts = values(sts), + org_id = values(org_id), + company_id = values(company_id) + + +update ${tableName} set + + formmain_id = #{formmainId}, + source_name = #{sourceName}, + code = #{code}, + source_data = #{sourceData}, + option_type = #{optionType}, + option_name = #{optionName}, + create_user_id = #{create_user_id}, + create_time = #{create_time}, + modify_user_id = #{modify_user_id}, + modify_time = #{modify_time}, + sts = #{sts}, + org_id = #{org_id}, + company_id = #{companyId}, + +where id = #{id} + + + +update ${tableName} set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} +where id = #{id} + + + +update ${tableName} set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} + + and id = #{id} + and formmain_id = #{formmainId} + and source_name = #{sourceName} + and code = #{code} + and source_data = #{sourceData} + and option_type = #{optionType} + and option_name = #{optionName} + and sorts = #{sorts} + and sts = #{sts} + and company_id = #{companyId} + and sts='Y' + + + + + delete from ${tableName} where id = #{id} + + + + diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleSendLog/dao/IMdmModuleSendLogDao.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleSendLog/dao/IMdmModuleSendLogDao.java new file mode 100644 index 00000000..156977bb --- /dev/null +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleSendLog/dao/IMdmModuleSendLogDao.java @@ -0,0 +1,15 @@ +package com.hzya.frame.mdm.mdmModuleSendLog.dao; + +import com.hzya.frame.mdm.mdmModuleSendLog.entity.MdmModuleSendLogEntity; +import com.hzya.frame.basedao.dao.IBaseDao; + +/** + * 主数据模版(mdm_module_send_log: table)表数据库访问层 + * + * @author makejava + * @since 2024-06-05 16:11:09 + */ +public interface IMdmModuleSendLogDao extends IBaseDao { + +} + diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleSendLog/dao/impl/MdmModuleSendLogDaoImpl.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleSendLog/dao/impl/MdmModuleSendLogDaoImpl.java new file mode 100644 index 00000000..9e59822d --- /dev/null +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleSendLog/dao/impl/MdmModuleSendLogDaoImpl.java @@ -0,0 +1,17 @@ +package com.hzya.frame.mdm.mdmModuleSendLog.dao.impl; + +import com.hzya.frame.mdm.mdmModuleSendLog.entity.MdmModuleSendLogEntity; +import com.hzya.frame.mdm.mdmModuleSendLog.dao.IMdmModuleSendLogDao; +import org.springframework.stereotype.Repository; +import com.hzya.frame.basedao.dao.MybatisGenericDao; +/** + * 主数据模版(MdmModuleSendLog)表数据库访问层 + * + * @author makejava + * @since 2024-06-05 16:11:09 + */ +@Repository(value = "MdmModuleSendLogDaoImpl") +public class MdmModuleSendLogDaoImpl extends MybatisGenericDao implements IMdmModuleSendLogDao{ + +} + diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleSendLog/entity/MdmModuleSendLogEntity.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleSendLog/entity/MdmModuleSendLogEntity.java new file mode 100644 index 00000000..20995957 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleSendLog/entity/MdmModuleSendLogEntity.java @@ -0,0 +1,94 @@ +package com.hzya.frame.mdm.mdmModuleSendLog.entity; + +import java.util.Date; +import com.hzya.frame.web.entity.BaseEntity; +/** + * 主数据模版(MdmModuleSendLog)实体类 + * + * @author makejava + * @since 2024-06-05 16:11:10 + */ +public class MdmModuleSendLogEntity extends BaseEntity { + //主数据表名 + private String tableName; + //主数据编码 + private Long mdmCode; + /** 主表id */ + private String formmainId; + /** 目标应用 */ + private String targetApp; + /** 目标api */ + private String targetApi; + /** 源数据 */ + private String sourceData; + /** 操作类型 */ + private String optionType; + /** 公司id */ + private String companyId; + + + public String getFormmainId() { + return formmainId; + } + + public void setFormmainId(String formmainId) { + this.formmainId = formmainId; + } + + public String getTargetApp() { + return targetApp; + } + + public void setTargetApp(String targetApp) { + this.targetApp = targetApp; + } + + public String getTargetApi() { + return targetApi; + } + + public void setTargetApi(String targetApi) { + this.targetApi = targetApi; + } + + public String getSourceData() { + return sourceData; + } + + public void setSourceData(String sourceData) { + this.sourceData = sourceData; + } + + public String getOptionType() { + return optionType; + } + + public void setOptionType(String optionType) { + this.optionType = optionType; + } + + public String getCompanyId() { + return companyId; + } + + public void setCompanyId(String companyId) { + this.companyId = companyId; + } + + public String getTableName() { + return tableName; + } + + public void setTableName(String tableName) { + this.tableName = tableName; + } + + public Long getMdmCode() { + return mdmCode; + } + + public void setMdmCode(Long mdmCode) { + this.mdmCode = mdmCode; + } +} + diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleSendLog/entity/MdmModuleSendLogEntity.xml b/service/src/main/java/com/hzya/frame/mdm/mdmModuleSendLog/entity/MdmModuleSendLogEntity.xml new file mode 100644 index 00000000..0cea9a23 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleSendLog/entity/MdmModuleSendLogEntity.xml @@ -0,0 +1,262 @@ + + + + + + + + + + + + + + + + + + + + + + + id + ,formmain_id + ,target_app + ,target_api + ,source_data + ,option_type + ,sorts + ,create_user_id + ,create_time + ,modify_user_id + ,modify_time + ,sts + ,org_id + ,company_id + + + + + + + + + + + + + + + + + + insert into ${tableName}( + + id , + formmain_id , + target_app , + target_api , + source_data , + option_type , + sorts , + create_user_id , + create_time , + modify_user_id , + modify_time , + sts , + org_id , + company_id , + sorts, + sts, + + )values( + + #{id} , + #{formmainId} , + #{targetApp} , + #{targetApi} , + #{sourceData} , + #{optionType} , + #{sorts} , + #{create_user_id} , + #{create_time} , + #{modify_user_id} , + #{modify_time} , + #{sts} , + #{org_id} , + #{companyId} , + (select (max(IFNULL( a.sorts, 0 )) + 1) as sort from ${tableName} a WHERE a.sts = 'Y' ), + 'Y', + + ) + + + + insert into ${tableName}(formmain_id, target_app, target_api, source_data, option_type, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, sts) + values + + (#{entity.formmainId},#{entity.targetApp},#{entity.targetApi},#{entity.sourceData},#{entity.optionType},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId}, 'Y') + + + + + insert into ${tableName}(formmain_id, target_app, target_api, source_data, option_type, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id) + values + + (#{entity.formmainId},#{entity.targetApp},#{entity.targetApi},#{entity.sourceData},#{entity.optionType},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId}) + + on duplicate key update + formmain_id = values(formmain_id), + target_app = values(target_app), + target_api = values(target_api), + source_data = values(source_data), + option_type = values(option_type), + create_user_id = values(create_user_id), + create_time = values(create_time), + modify_user_id = values(modify_user_id), + modify_time = values(modify_time), + sts = values(sts), + org_id = values(org_id), + company_id = values(company_id) + + +update ${tableName} set + + formmain_id = #{formmainId}, + target_app = #{targetApp}, + target_api = #{targetApi}, + source_data = #{sourceData}, + option_type = #{optionType}, + create_user_id = #{create_user_id}, + create_time = #{create_time}, + modify_user_id = #{modify_user_id}, + modify_time = #{modify_time}, + sts = #{sts}, + org_id = #{org_id}, + company_id = #{companyId}, + +where id = #{id} + + + +update ${tableName} set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} +where id = #{id} + + + +update ${tableName} set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} + + and id = #{id} + and formmain_id = #{formmainId} + and target_app = #{targetApp} + and target_api = #{targetApi} + and source_data = #{sourceData} + and option_type = #{optionType} + and sorts = #{sorts} + and sts = #{sts} + and company_id = #{companyId} + and sts='Y' + + + + + delete from ${tableName} where id = #{id} + + + + 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 cc3bd233..df21034b 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 @@ -132,7 +132,7 @@ - + insert into mdm_module_source( id , @@ -172,7 +172,7 @@ ) - + insert into mdm_module_source(mdm_id, source_type, source_name, source_code, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, sts) values @@ -180,7 +180,7 @@ - + insert into mdm_module_source(mdm_id, source_type, source_name, source_code, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id) values diff --git a/service/src/main/java/com/hzya/frame/mdm/service/IMdmService.java b/service/src/main/java/com/hzya/frame/mdm/service/IMdmService.java index 1369a2a9..b815b318 100644 --- a/service/src/main/java/com/hzya/frame/mdm/service/IMdmService.java +++ b/service/src/main/java/com/hzya/frame/mdm/service/IMdmService.java @@ -135,32 +135,103 @@ public interface IMdmService { //JsonResultEntity doSaveMdmModuleRule(JSONObject jsonObject); // // - ///** - // * @param jsonObject - // * @return com.hzya.frame.web.entity.JsonResultEntity - // * @Author lvleigang - // * @Description 主数据设置查询分发设置 - // * @Date 9:40 上午 2023/10/18 - // **/ - //JsonResultEntity queryMdmModuleDistribute(JSONObject jsonObject); + /** + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 主数据设置查询分发设置 + * @Date 9:40 上午 2023/10/18 + **/ + JsonResultEntity queryMdmModuleDistribute(JSONObject jsonObject); + /** + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 主数据设置保存分发设置 + * @Date 9:40 上午 2023/10/18 + **/ + JsonResultEntity doSaveMdmModuleDistribute(JSONObject jsonObject); + + /** + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 主数据设置查询数据来源 + * @Date 9:40 上午 2023/10/18 + **/ + JsonResultEntity queryMdmModuleSource(JSONObject jsonObject); + /** + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 主数据设置保存数据来源 + * @Date 9:40 上午 2023/10/18 + **/ + JsonResultEntity doSaveMdmModuleSource(JSONObject jsonObject); + + + /** + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 查询下发日志 + * @Date 11:52 上午 2024/3/27 + **/ + JsonResultEntity querySendEntityPage(JSONObject jsonObject); + + /** + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 获取下发日志 + * @Date 2:36 下午 2024/3/27 + **/ + JsonResultEntity getSendEntity(JSONObject jsonObject); + + /** + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 删除下发日志 + * @Date 2:37 下午 2024/3/27 + **/ + JsonResultEntity deleteSendEntity(JSONObject jsonObject); + + /** + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 查询操作日志 + * @Date 11:52 上午 2024/3/27 + **/ + JsonResultEntity queryOptionEntityPage(JSONObject jsonObject); + + /** + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 获取操作日志 + * @Date 2:36 下午 2024/3/27 + **/ + JsonResultEntity getOptionEntity(JSONObject jsonObject); + + /** + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 删除操作日志 + * @Date 2:37 下午 2024/3/27 + **/ + JsonResultEntity deleteOptionEntity(JSONObject jsonObject); // - ///** - // * @param jsonObject - // * @return com.hzya.frame.web.entity.JsonResultEntity - // * @Author lvleigang - // * @Description 主数据设置保存分发设置 - // * @Date 9:40 上午 2023/10/18 - // **/ - //JsonResultEntity doSaveMdmModuleDistribute(JSONObject jsonObject); - // - ///** - // * @param jsonObject - // * @return com.hzya.frame.web.entity.JsonResultEntity - // * @Author lvleigang - // * @Description 主数据列表显示 树、查询条件、列表字段、按钮 - // * @Date 9:40 上午 2023/10/18 - // **/ - //JsonResultEntity queryMdmShow(JSONObject jsonObject); + /** + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 主数据列表显示 树、查询条件、列表字段、按钮 + * @Date 9:40 上午 2023/10/18 + **/ + JsonResultEntity queryMdmShow(JSONObject jsonObject); // ///** // * @param jsonObject diff --git a/service/src/main/java/com/hzya/frame/mdm/service/IMdmServiceCache.java b/service/src/main/java/com/hzya/frame/mdm/service/IMdmServiceCache.java index bc3a5ad2..36750991 100644 --- a/service/src/main/java/com/hzya/frame/mdm/service/IMdmServiceCache.java +++ b/service/src/main/java/com/hzya/frame/mdm/service/IMdmServiceCache.java @@ -5,6 +5,9 @@ import com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity; import com.hzya.frame.mdm.mdmModuleDb.entity.MdmModuleDbEntity; import com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity; import com.hzya.frame.mdm.mdmModuleDbFiledsRule.entity.MdmModuleDbFiledsRuleEntity; +import com.hzya.frame.mdm.mdmModuleDistribute.entity.MdmModuleDistributeEntity; +import com.hzya.frame.mdm.mdmModuleDistributeDetail.entity.MdmModuleDistributeDetailEntity; +import com.hzya.frame.mdm.mdmModuleSource.entity.MdmModuleSourceEntity; import com.hzya.frame.mdm.mdmModuleView.entity.MdmModuleViewEntity; import com.hzya.frame.mdm.mdmModuleViewButton.entity.MdmModuleViewButtonEntity; import com.hzya.frame.mdm.mdmModuleViewDetail.entity.MdmModuleViewDetailEntity; @@ -57,4 +60,14 @@ public interface IMdmServiceCache { void saveMdmModuleViewDetail(String id, List mdmModuleViewDetailEntities); void saveMdmModuleViewButton(String id, List mdmModuleViewButtonEntities); + + List queryMdmModuleDistribute(String id,MdmModuleDistributeEntity mdmModuleDistributeEntity); + + void saveMdmModuleDistribute(String id, List mdmModuleDistributeEntities); + + List queryMdmModuleSource(MdmModuleSourceEntity mdmModuleSourceEntity); + + void saveMdmModuleSource(String id, List mdmModuleSourceEntities); + + List queryMdmModuleDistributeDetail(MdmModuleDistributeDetailEntity mdmModuleDistributeDetailEntity); } diff --git a/service/src/main/java/com/hzya/frame/mdm/service/impl/MdmServiceCache.java b/service/src/main/java/com/hzya/frame/mdm/service/impl/MdmServiceCache.java index 1e5c7e0f..bf531ea9 100644 --- a/service/src/main/java/com/hzya/frame/mdm/service/impl/MdmServiceCache.java +++ b/service/src/main/java/com/hzya/frame/mdm/service/impl/MdmServiceCache.java @@ -13,7 +13,11 @@ import com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity; import com.hzya.frame.mdm.mdmModuleDbFiledsRule.dao.IMdmModuleDbFiledsRuleDao; import com.hzya.frame.mdm.mdmModuleDbFiledsRule.entity.MdmModuleDbFiledsRuleEntity; import com.hzya.frame.mdm.mdmModuleDistribute.dao.IMdmModuleDistributeDao; +import com.hzya.frame.mdm.mdmModuleDistribute.entity.MdmModuleDistributeEntity; import com.hzya.frame.mdm.mdmModuleDistributeDetail.dao.IMdmModuleDistributeDetailDao; +import com.hzya.frame.mdm.mdmModuleDistributeDetail.entity.MdmModuleDistributeDetailEntity; +import com.hzya.frame.mdm.mdmModuleSource.dao.IMdmModuleSourceDao; +import com.hzya.frame.mdm.mdmModuleSource.entity.MdmModuleSourceEntity; import com.hzya.frame.mdm.mdmModuleView.dao.IMdmModuleViewDao; import com.hzya.frame.mdm.mdmModuleView.entity.MdmModuleViewEntity; import com.hzya.frame.mdm.mdmModuleViewButton.dao.IMdmModuleViewButtonDao; @@ -25,6 +29,7 @@ import com.hzya.frame.mdm.mdmTableCodeRule.entity.MdmTableCodeRuleEntity; import com.hzya.frame.mdm.service.IMdmService; import com.hzya.frame.mdm.service.IMdmServiceCache; import com.hzya.frame.sysnew.integtationTask.entity.IntegrationTaskEntity; +import com.hzya.frame.uuid.UUIDUtils; import com.hzya.frame.web.entity.BaseResult; import com.hzya.frame.web.entity.JsonResultEntity; import org.slf4j.Logger; @@ -34,6 +39,7 @@ import org.springframework.cache.annotation.Cacheable; import org.springframework.stereotype.Service; import javax.annotation.Resource; +import java.util.ArrayList; import java.util.Date; import java.util.List; @@ -57,6 +63,8 @@ public class MdmServiceCache implements IMdmServiceCache { @Resource private IMdmModuleDistributeDetailDao mdmModuleDistributeDetailDao; @Resource + private IMdmModuleSourceDao mdmModuleSourceDao; + @Resource private IMdmModuleViewDao mdmModuleViewDao; @Resource private IMdmModuleViewButtonDao mdmModuleViewButtonDao; @@ -229,5 +237,110 @@ public class MdmServiceCache implements IMdmServiceCache { } } } + @Override + @Cacheable(cacheNames="mdmModuleDistribute",key = "#mdmId") + public List queryMdmModuleDistribute(String mdmId,MdmModuleDistributeEntity mdmModuleDistributeEntity) { + List mdmModuleDistributeEntities = mdmModuleDistributeDao.queryBase(mdmModuleDistributeEntity); + //查询模块下的应用列表 + MdmModuleDistributeDetailEntity mdmModuleDistributeDetailEntity = new MdmModuleDistributeDetailEntity(); + mdmModuleDistributeDetailEntity.setSts("Y"); + mdmModuleDistributeDetailEntity.setMdmId(mdmId); + List mdmModuleDistributeDetailEntities = mdmModuleDistributeDetailDao.queryBase(mdmModuleDistributeDetailEntity); + if(mdmModuleDistributeEntities != null && mdmModuleDistributeEntities.size() > 0){ + for (int i = 0; i < mdmModuleDistributeEntities.size(); i++) { + List moduleDistributeDetailEntities = new ArrayList<>(); + if(mdmModuleDistributeDetailEntities != null && mdmModuleDistributeDetailEntities.size() > 0){ + for (int i1 = 0; i1 < mdmModuleDistributeDetailEntities.size(); i1++) { + if(mdmModuleDistributeEntities.get(i).getId().equals(mdmModuleDistributeDetailEntities.get(i1).getDistributeId())){ + moduleDistributeDetailEntities.add(mdmModuleDistributeDetailEntities.get(i1)); + } + } + } + mdmModuleDistributeEntities.get(i).setMdmModuleDistributeDetailEntities(moduleDistributeDetailEntities); + } + } + return mdmModuleDistributeEntities; + } + @Override + @Cacheable(cacheNames="mdmModuleDistributeDetail",key = "#mdmId") + public List queryMdmModuleDistributeDetail(MdmModuleDistributeDetailEntity mdmModuleDistributeDetailEntity){ + List mdmModuleDistributeDetailEntities = mdmModuleDistributeDetailDao.queryBase(mdmModuleDistributeDetailEntity); + return mdmModuleDistributeDetailEntities; + } + + @Override + @CacheEvict(cacheNames="mdmModuleDistribute",key = "#mdmId") + public void saveMdmModuleDistribute(String mdmId, List mdmModuleDistributeEntities) { + //先删除 + MdmModuleDistributeEntity mdmModuleDistributeEntity = new MdmModuleDistributeEntity(); + mdmModuleDistributeEntity.setMdmId(mdmId); + mdmModuleDistributeEntity.setUpdate(); + mdmModuleDistributeDao.logicRemoveMultiCondition(mdmModuleDistributeEntity); + //保存主数据 + if (mdmModuleDistributeEntities != null && mdmModuleDistributeEntities.size() > 0) { + for (int i = 0; i < mdmModuleDistributeEntities.size(); i++) { + MdmModuleDistributeEntity moduleDistributeEntity = mdmModuleDistributeEntities.get(i); + moduleDistributeEntity.setMdmId(mdmId); + if (moduleDistributeEntity.getId() != null && !"".equals(moduleDistributeEntity.getId())) { + moduleDistributeEntity.setUpdate(); + //修改 + mdmModuleDistributeDao.update(moduleDistributeEntity); + } else { + //新增 + moduleDistributeEntity.setCreate(); + mdmModuleDistributeDao.save(moduleDistributeEntity); + } + if(moduleDistributeEntity.getMdmModuleDistributeDetailEntities() != null && moduleDistributeEntity.getMdmModuleDistributeDetailEntities().size() > 0){ + for (int i1 = 0; i1 < moduleDistributeEntity.getMdmModuleDistributeDetailEntities().size(); i1++) { + MdmModuleDistributeDetailEntity mdmModuleDistributeDetailEntity = moduleDistributeEntity.getMdmModuleDistributeDetailEntities().get(i1); + mdmModuleDistributeDetailEntity.setMdmId(mdmId); + mdmModuleDistributeDetailEntity.setDistributeId(moduleDistributeEntity.getId()); + if (mdmModuleDistributeDetailEntity.getId() != null && !"".equals(mdmModuleDistributeDetailEntity.getId())) { + mdmModuleDistributeDetailEntity.setUpdate(); + //修改 + mdmModuleDistributeDetailDao.update(mdmModuleDistributeDetailEntity); + } else { + //新增 + mdmModuleDistributeDetailEntity.setCreate(); + mdmModuleDistributeDetailDao.save(mdmModuleDistributeDetailEntity); + } + } + } + } + } + } + + @Override + @Cacheable(cacheNames="mdmModuleSource",key = "#mdmId") + public List queryMdmModuleSource(MdmModuleSourceEntity mdmModuleSourceEntity) { + List mdmModuleSourceEntities = mdmModuleSourceDao.queryBase(mdmModuleSourceEntity); + return mdmModuleSourceEntities; + } + + @Override + @CacheEvict(cacheNames="mdmModuleSource",key = "#mdmId") + public void saveMdmModuleSource(String mdmId, List mdmModuleSourceEntities) { + //先删除 + MdmModuleSourceEntity mdmModuleSourceEntity = new MdmModuleSourceEntity(); + mdmModuleSourceEntity.setMdmId(mdmId); + mdmModuleSourceEntity.setUpdate(); + mdmModuleSourceDao.logicRemoveMultiCondition(mdmModuleSourceEntity); + //保存主数据 + if (mdmModuleSourceEntities != null && mdmModuleSourceEntities.size() > 0) { + for (int i = 0; i < mdmModuleSourceEntities.size(); i++) { + MdmModuleSourceEntity mdmModuleSourceEntity1 = mdmModuleSourceEntities.get(i); + mdmModuleSourceEntity1.setMdmId(mdmId); + if (mdmModuleSourceEntity1.getId() != null && !"".equals(mdmModuleSourceEntity1.getId())) { + mdmModuleSourceEntity1.setUpdate(); + //修改 + mdmModuleSourceDao.update(mdmModuleSourceEntity1); + } else { + //新增 + mdmModuleSourceEntity1.setCreate(); + mdmModuleSourceDao.save(mdmModuleSourceEntity1); + } + } + } + } } 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 6756c7dc..bf517a33 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 @@ -1,17 +1,19 @@ package com.hzya.frame.mdm.service.impl; import cn.dev33.satoken.stp.StpUtil; -import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; -import com.hzya.frame.base.PluginBaseEntity; import com.hzya.frame.mdm.entity.DbFiledsDto; import com.hzya.frame.mdm.entity.MdmDbFiledVo; import com.hzya.frame.mdm.entity.MdmDbVo; +import com.hzya.frame.mdm.entity.MdmDistributeDto; import com.hzya.frame.mdm.entity.MdmDto; import com.hzya.frame.mdm.entity.MdmModuleViewDto; import com.hzya.frame.mdm.entity.MdmModuleViewVo; +import com.hzya.frame.mdm.entity.MdmSourceDto; +import com.hzya.frame.mdm.entity.MdmViewFiledVo; +import com.hzya.frame.mdm.entity.MdmViewVo; import com.hzya.frame.mdm.mdmModule.dao.IMdmModuleDao; import com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity; import com.hzya.frame.mdm.mdmModuleDb.dao.IMdmModuleDbDao; @@ -23,7 +25,11 @@ import com.hzya.frame.mdm.mdmModuleDbFiledsRule.entity.MdmModuleDbFiledsRuleEnti import com.hzya.frame.mdm.mdmModuleDistribute.dao.IMdmModuleDistributeDao; import com.hzya.frame.mdm.mdmModuleDistribute.entity.MdmModuleDistributeEntity; import com.hzya.frame.mdm.mdmModuleDistributeDetail.dao.IMdmModuleDistributeDetailDao; -import com.hzya.frame.mdm.mdmModuleDistributeDetail.entity.MdmModuleDistributeDetailEntity; +import com.hzya.frame.mdm.mdmModuleOptionLog.dao.IMdmModuleOptionLogDao; +import com.hzya.frame.mdm.mdmModuleOptionLog.entity.MdmModuleOptionLogEntity; +import com.hzya.frame.mdm.mdmModuleSendLog.dao.IMdmModuleSendLogDao; +import com.hzya.frame.mdm.mdmModuleSendLog.entity.MdmModuleSendLogEntity; +import com.hzya.frame.mdm.mdmModuleSource.entity.MdmModuleSourceEntity; import com.hzya.frame.mdm.mdmModuleView.dao.IMdmModuleViewDao; import com.hzya.frame.mdm.mdmModuleView.entity.MdmModuleViewEntity; import com.hzya.frame.mdm.mdmModuleViewButton.dao.IMdmModuleViewButtonDao; @@ -34,19 +40,15 @@ import com.hzya.frame.mdm.mdmTableCodeRule.entity.MdmTableCodeRuleEntity; import com.hzya.frame.mdm.service.IMdmService; import com.hzya.frame.mdm.service.IMdmServiceCache; -import com.hzya.frame.sys.entity.FormmainDeleteDto; -import com.hzya.frame.sys.entity.ModuleDto; -import com.hzya.frame.sys.module.entity.Module; -import com.hzya.frame.sys.roleModule.entity.RoleModule; -import com.hzya.frame.sysnew.application.plugin.entity.SysApplicationPluginEntity; import com.hzya.frame.sysnew.buttonConfig.dao.ISysButtonConfigDao; import com.hzya.frame.sysnew.buttonConfig.entity.SysButtonConfigEntity; import com.hzya.frame.sysnew.menuConfig.dao.ISysMenuConfigDao; import com.hzya.frame.sysnew.menuConfig.entity.SysMenuConfigEntity; import com.hzya.frame.sysnew.popedomOperate.dao.ISysPopedomOperateDao; import com.hzya.frame.sysnew.popedomOperate.entity.SysPopedomOperateEntity; -import com.hzya.frame.util.PluginUtils; -import com.hzya.frame.uuid.UUIDUtils; +import com.hzya.frame.sysnew.user.entity.SysUserEntity; +import com.hzya.frame.sysnew.userCompany.entity.SysUserCompanyEntity; +import com.hzya.frame.sysnew.userRoles.entity.SysUserRolesEntity; import com.hzya.frame.web.entity.BaseResult; import com.hzya.frame.web.entity.JsonResultEntity; import org.slf4j.Logger; @@ -54,14 +56,10 @@ import org.slf4j.LoggerFactory; import org.springframework.stereotype.Service; import javax.annotation.Resource; -import java.text.SimpleDateFormat; import java.util.ArrayList; -import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.Objects; -import java.util.stream.Collectors; /** @@ -74,6 +72,10 @@ public class MdmServiceImpl implements IMdmService { @Resource private IMdmModuleDao mdmModuleDao; @Resource + private IMdmModuleSendLogDao mdmModuleSendLogDao; + @Resource + private IMdmModuleOptionLogDao mdmModuleOptionLogDao; + @Resource private IMdmServiceCache mdmServiceCache; @Resource private ISysMenuConfigDao sysMenuConfigDao; @@ -1515,6 +1517,366 @@ public class MdmServiceImpl implements IMdmService { } } } + + /** + * @param object + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 主数据设置查询分发设置 + * @Date 9:40 上午 2023/10/18 + **/ + @Override + public JsonResultEntity queryMdmModuleDistribute(JSONObject object) { + MdmDto entity = getData("jsonStr", object, MdmDto.class); + if (entity == null) { + return BaseResult.getFailureMessageEntity("参数不允许为空"); + } + if (entity.getMdmCode() == null || "".equals(entity.getMdmCode())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + MdmModuleEntity mdmModuleEntity = mdmServiceCache.getMdmModuleEntity(entity.getMdmCode()); + if(mdmModuleEntity == null || mdmModuleEntity.getId() == null){ + return BaseResult.getFailureMessageEntity("系统错误"); + } + //查询模块下的应用列表 + MdmModuleDistributeEntity mdmModuleDistributeEntity = new MdmModuleDistributeEntity(); + mdmModuleDistributeEntity.setSts("Y"); + mdmModuleDistributeEntity.setMdmId(mdmModuleEntity.getId()); + List mdmModuleDistributeEntities = mdmServiceCache.queryMdmModuleDistribute(mdmModuleEntity.getId(),mdmModuleDistributeEntity); + return BaseResult.getSuccessMessageEntity("查询成功", mdmModuleDistributeEntities); + } + /** + * @param object + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 主数据设置保存分发设置 + * @Date 9:40 上午 2023/10/18 + **/ + @Override + public JsonResultEntity doSaveMdmModuleDistribute(JSONObject object) { + MdmDistributeDto entity = getData("jsonStr", object, MdmDistributeDto.class); + //判断是否有数据 + if (entity == null) { + return BaseResult.getFailureMessageEntity("参数不允许为空"); + } + if (entity.getMdmCode() == null || "".equals(entity.getMdmCode())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + MdmModuleEntity mdmModuleEntity = mdmServiceCache.getMdmModuleEntity(entity.getMdmCode()); + if(mdmModuleEntity == null || mdmModuleEntity.getId() == null){ + return BaseResult.getFailureMessageEntity("系统错误"); + } + mdmServiceCache.saveMdmModuleDistribute(mdmModuleEntity.getId(),entity.getMdmModuleDistributeEntities()); + return BaseResult.getSuccessMessageEntity("保存发布设置成功"); + } + + /** + * @param object + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 主数据设置查询数据来源 + * @Date 9:40 上午 2023/10/18 + **/ + @Override + public JsonResultEntity queryMdmModuleSource(JSONObject object) { + MdmDto entity = getData("jsonStr", object, MdmDto.class); + if (entity == null) { + return BaseResult.getFailureMessageEntity("参数不允许为空"); + } + if (entity.getMdmCode() == null || "".equals(entity.getMdmCode())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + MdmModuleEntity mdmModuleEntity = mdmServiceCache.getMdmModuleEntity(entity.getMdmCode()); + if(mdmModuleEntity == null || mdmModuleEntity.getId() == null){ + return BaseResult.getFailureMessageEntity("系统错误"); + } + //查询模块下的应用列表 + MdmModuleSourceEntity mdmModuleSourceEntity = new MdmModuleSourceEntity(); + mdmModuleSourceEntity.setSts("Y"); + mdmModuleSourceEntity.setMdmId(mdmModuleEntity.getId()); + List mdmModuleSourceEntities = mdmServiceCache.queryMdmModuleSource(mdmModuleSourceEntity); + return BaseResult.getSuccessMessageEntity("查询成功", mdmModuleSourceEntities); + } + /** + * @param object + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 主数据设置保存数据来源 + * @Date 9:40 上午 2023/10/18 + **/ + @Override + public JsonResultEntity doSaveMdmModuleSource(JSONObject object) { + MdmSourceDto entity = getData("jsonStr", object, MdmSourceDto.class); + //判断是否有数据 + if (entity == null) { + return BaseResult.getFailureMessageEntity("参数不允许为空"); + } + if (entity.getMdmCode() == null || "".equals(entity.getMdmCode())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + MdmModuleEntity mdmModuleEntity = mdmServiceCache.getMdmModuleEntity(entity.getMdmCode()); + if(mdmModuleEntity == null || mdmModuleEntity.getId() == null){ + return BaseResult.getFailureMessageEntity("系统错误"); + } + mdmServiceCache.saveMdmModuleSource(mdmModuleEntity.getId(),entity.getMdmModuleSourceEntities()); + return BaseResult.getSuccessMessageEntity("保存发布设置成功"); + } + + /** + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 查询下发日志 + * @Date 11:52 上午 2024/3/27 + **/ + @Override + public JsonResultEntity querySendEntityPage(JSONObject jsonObject) { + MdmModuleSendLogEntity entity = getData("jsonStr", jsonObject, MdmModuleSendLogEntity.class); + //判断分页 + if (entity == null || entity.getPageNum() == null || entity.getPageSize() == null) { + return BaseResult.getFailureMessageEntity("分页查询参数不存在"); + } + if (entity.getMdmCode() == null || "".equals(entity.getMdmCode())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + MdmModuleEntity mdmModuleEntity = mdmServiceCache.getMdmModuleEntity(entity.getMdmCode()); + if(mdmModuleEntity == null || mdmModuleEntity.getId() == null){ + return BaseResult.getFailureMessageEntity("系统错误"); + } + MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); + mdmModuleDbEntity.setMdmId(mdmModuleEntity.getId()); + mdmModuleDbEntity.setSts("Y"); + List mdmModuleDbEntities = mdmServiceCache.queryMdmModuleDb(mdmModuleDbEntity); + if(mdmModuleDbEntities != null && mdmModuleDbEntities.size() > 0 ){ + for (int i = 0; i < mdmModuleDbEntities.size(); i++) { + if("1".equals(mdmModuleDbEntities.get(i).getDbType())){ + entity.setTableName(mdmModuleDbEntities.get(i).getDbName()+"_send_log"); + break; + } + } + }else { + return BaseResult.getFailureMessageEntity("请先设置数据源"); + } + PageHelper.startPage(entity.getPageNum(), entity.getPageSize()); + List list = mdmModuleSendLogDao.queryByLike(entity); + PageInfo pageInfo = new PageInfo(list); + return BaseResult.getSuccessMessageEntity("查询数据成功", pageInfo); + } + + /** + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 获取下发日志 + * @Date 2:36 下午 2024/3/27 + **/ + @Override + public JsonResultEntity getSendEntity(JSONObject jsonObject) { + MdmModuleSendLogEntity entity = getData("jsonStr", jsonObject, MdmModuleSendLogEntity.class); + if (entity == null) { + return BaseResult.getFailureMessageEntity("参数不允许为空"); + } + if (entity.getId() == null || "".equals(entity.getId())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + if (entity.getMdmCode() == null || "".equals(entity.getMdmCode())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + MdmModuleEntity mdmModuleEntity = mdmServiceCache.getMdmModuleEntity(entity.getMdmCode()); + if(mdmModuleEntity == null || mdmModuleEntity.getId() == null){ + return BaseResult.getFailureMessageEntity("系统错误"); + } + MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); + mdmModuleDbEntity.setMdmId(mdmModuleEntity.getId()); + mdmModuleDbEntity.setSts("Y"); + List mdmModuleDbEntities = mdmServiceCache.queryMdmModuleDb(mdmModuleDbEntity); + if(mdmModuleDbEntities != null && mdmModuleDbEntities.size() > 0 ){ + for (int i = 0; i < mdmModuleDbEntities.size(); i++) { + if("1".equals(mdmModuleDbEntities.get(i).getDbType())){ + entity.setTableName(mdmModuleDbEntities.get(i).getDbName()+"_send_log"); + break; + } + } + }else { + return BaseResult.getFailureMessageEntity("请先设置数据源"); + } + entity = mdmModuleSendLogDao.get(entity.getId()); + if (entity == null) { + return BaseResult.getFailureMessageEntity("获取日志失败"); + } + return BaseResult.getSuccessMessageEntity("获取日志成功", entity); + } + + /** + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 删除下发日志 + * @Date 2:37 下午 2024/3/27 + **/ + @Override + public JsonResultEntity deleteSendEntity(JSONObject jsonObject) { + MdmModuleSendLogEntity entity = getData("jsonStr", jsonObject, MdmModuleSendLogEntity.class); + if (entity == null) { + return BaseResult.getFailureMessageEntity("参数不允许为空"); + } + if (entity.getId() == null || "".equals(entity.getId())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + if (entity.getMdmCode() == null || "".equals(entity.getMdmCode())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + MdmModuleEntity mdmModuleEntity = mdmServiceCache.getMdmModuleEntity(entity.getMdmCode()); + if(mdmModuleEntity == null || mdmModuleEntity.getId() == null){ + return BaseResult.getFailureMessageEntity("系统错误"); + } + MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); + mdmModuleDbEntity.setMdmId(mdmModuleEntity.getId()); + mdmModuleDbEntity.setSts("Y"); + List mdmModuleDbEntities = mdmServiceCache.queryMdmModuleDb(mdmModuleDbEntity); + if(mdmModuleDbEntities != null && mdmModuleDbEntities.size() > 0 ){ + for (int i = 0; i < mdmModuleDbEntities.size(); i++) { + if("1".equals(mdmModuleDbEntities.get(i).getDbType())){ + entity.setTableName(mdmModuleDbEntities.get(i).getDbName()+"_send_log"); + break; + } + } + }else { + return BaseResult.getFailureMessageEntity("请先设置数据源"); + } + entity.setUpdate(); + mdmModuleSendLogDao.logicRemove(entity); + return BaseResult.getSuccessMessageEntity("删除日志成功"); + } + + + + /** + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 查询操作日志 + * @Date 11:52 上午 2024/3/27 + **/ + @Override + public JsonResultEntity queryOptionEntityPage(JSONObject jsonObject) { + MdmModuleOptionLogEntity entity = getData("jsonStr", jsonObject, MdmModuleOptionLogEntity.class); + //判断分页 + if (entity == null || entity.getPageNum() == null || entity.getPageSize() == null) { + return BaseResult.getFailureMessageEntity("分页查询参数不存在"); + } + if (entity.getMdmCode() == null || "".equals(entity.getMdmCode())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + MdmModuleEntity mdmModuleEntity = mdmServiceCache.getMdmModuleEntity(entity.getMdmCode()); + if(mdmModuleEntity == null || mdmModuleEntity.getId() == null){ + return BaseResult.getFailureMessageEntity("系统错误"); + } + MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); + mdmModuleDbEntity.setMdmId(mdmModuleEntity.getId()); + mdmModuleDbEntity.setSts("Y"); + List mdmModuleDbEntities = mdmServiceCache.queryMdmModuleDb(mdmModuleDbEntity); + if(mdmModuleDbEntities != null && mdmModuleDbEntities.size() > 0 ){ + for (int i = 0; i < mdmModuleDbEntities.size(); i++) { + if("1".equals(mdmModuleDbEntities.get(i).getDbType())){ + entity.setTableName(mdmModuleDbEntities.get(i).getDbName()+"_send_log"); + break; + } + } + }else { + return BaseResult.getFailureMessageEntity("请先设置数据源"); + } + PageHelper.startPage(entity.getPageNum(), entity.getPageSize()); + List list = mdmModuleOptionLogDao.queryByLike(entity); + PageInfo pageInfo = new PageInfo(list); + return BaseResult.getSuccessMessageEntity("查询数据成功", pageInfo); + } + + /** + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 获取操作日志 + * @Date 2:36 下午 2024/3/27 + **/ + @Override + public JsonResultEntity getOptionEntity(JSONObject jsonObject) { + MdmModuleOptionLogEntity entity = getData("jsonStr", jsonObject, MdmModuleOptionLogEntity.class); + if (entity == null) { + return BaseResult.getFailureMessageEntity("参数不允许为空"); + } + if (entity.getId() == null || "".equals(entity.getId())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + if (entity.getMdmCode() == null || "".equals(entity.getMdmCode())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + MdmModuleEntity mdmModuleEntity = mdmServiceCache.getMdmModuleEntity(entity.getMdmCode()); + if(mdmModuleEntity == null || mdmModuleEntity.getId() == null){ + return BaseResult.getFailureMessageEntity("系统错误"); + } + MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); + mdmModuleDbEntity.setMdmId(mdmModuleEntity.getId()); + mdmModuleDbEntity.setSts("Y"); + List mdmModuleDbEntities = mdmServiceCache.queryMdmModuleDb(mdmModuleDbEntity); + if(mdmModuleDbEntities != null && mdmModuleDbEntities.size() > 0 ){ + for (int i = 0; i < mdmModuleDbEntities.size(); i++) { + if("1".equals(mdmModuleDbEntities.get(i).getDbType())){ + entity.setTableName(mdmModuleDbEntities.get(i).getDbName()+"_send_log"); + break; + } + } + }else { + return BaseResult.getFailureMessageEntity("请先设置数据源"); + } + entity = mdmModuleOptionLogDao.get(entity.getId()); + if (entity == null) { + return BaseResult.getFailureMessageEntity("获取日志失败"); + } + return BaseResult.getSuccessMessageEntity("获取日志成功", entity); + } + + /** + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 删除操作日志 + * @Date 2:37 下午 2024/3/27 + **/ + @Override + public JsonResultEntity deleteOptionEntity(JSONObject jsonObject) { + MdmModuleOptionLogEntity entity = getData("jsonStr", jsonObject, MdmModuleOptionLogEntity.class); + if (entity == null) { + return BaseResult.getFailureMessageEntity("参数不允许为空"); + } + if (entity.getId() == null || "".equals(entity.getId())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + if (entity.getMdmCode() == null || "".equals(entity.getMdmCode())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + MdmModuleEntity mdmModuleEntity = mdmServiceCache.getMdmModuleEntity(entity.getMdmCode()); + if(mdmModuleEntity == null || mdmModuleEntity.getId() == null){ + return BaseResult.getFailureMessageEntity("系统错误"); + } + MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); + mdmModuleDbEntity.setMdmId(mdmModuleEntity.getId()); + mdmModuleDbEntity.setSts("Y"); + List mdmModuleDbEntities = mdmServiceCache.queryMdmModuleDb(mdmModuleDbEntity); + if(mdmModuleDbEntities != null && mdmModuleDbEntities.size() > 0 ){ + for (int i = 0; i < mdmModuleDbEntities.size(); i++) { + if("1".equals(mdmModuleDbEntities.get(i).getDbType())){ + entity.setTableName(mdmModuleDbEntities.get(i).getDbName()+"_send_log"); + break; + } + } + }else { + return BaseResult.getFailureMessageEntity("请先设置数据源"); + } + entity.setUpdate(); + mdmModuleOptionLogDao.logicRemove(entity); + return BaseResult.getSuccessMessageEntity("删除日志成功"); + } ///** // * @param object // * @return com.hzya.frame.web.entity.JsonResultEntity @@ -2066,266 +2428,83 @@ public class MdmServiceImpl implements IMdmService { // return BaseResult.getSuccessMessageEntity("保存成功"); //} // - ///** - // * @param object - // * @return com.hzya.frame.web.entity.JsonResultEntity - // * @Author lvleigang - // * @Description 主数据设置查询分发设置 - // * @Date 9:40 上午 2023/10/18 - // **/ - //@Override - //public JsonResultEntity queryMdmModuleDistribute(JSONObject object) { - // MdmDto entity = getData("jsonStr", object, MdmDto.class); - // if (entity == null) { - // return BaseResult.getFailureMessageEntity("参数不允许为空"); - // } - // if (entity.getId() == null || "".equals(entity.getId())) { - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // //查询模块下的应用列表 - // MdmModuleDistributeEntity mdmModuleDistributeEntity = new MdmModuleDistributeEntity(); - // mdmModuleDistributeEntity.setSts("Y"); - // mdmModuleDistributeEntity.setMdmId(entity.getId()); - // List mdmModuleDistributeEntities = mdmModuleDistributeDao.queryBase(mdmModuleDistributeEntity); - // if (mdmModuleDistributeEntities != null && mdmModuleDistributeEntities.size() > 0) { - // MdmModuleDistributeDetailEntity mdmModuleDistributeDetailEntity = new MdmModuleDistributeDetailEntity(); - // mdmModuleDistributeDetailEntity.setSts("Y"); - // mdmModuleDistributeDetailEntity.setMdmId(entity.getId()); - // List mdmModuleDistributeDetailEntities = mdmModuleDistributeDetailDao.queryBase(mdmModuleDistributeDetailEntity); - // if (mdmModuleDistributeDetailEntities != null && mdmModuleDistributeDetailEntities.size() > 0) { - // for (int i = 0; i < mdmModuleDistributeEntities.size(); i++) { - // List addlist = new ArrayList<>(); - // List deletelist = new ArrayList<>(); - // for (int i1 = 0; i1 < mdmModuleDistributeDetailEntities.size(); i1++) { - // if (mdmModuleDistributeEntities.get(i).getAddApi().equals(mdmModuleDistributeDetailEntities.get(i1).getApiId()) - // && mdmModuleDistributeEntities.get(i).getId().equals(mdmModuleDistributeDetailEntities.get(i1).getDistributeId())) { - // addlist.add(mdmModuleDistributeDetailEntities.get(i1)); - // } - // if (mdmModuleDistributeEntities.get(i).getDeleteApi().equals(mdmModuleDistributeDetailEntities.get(i1).getApiId()) - // && mdmModuleDistributeEntities.get(i).getId().equals(mdmModuleDistributeDetailEntities.get(i1).getDistributeId())) { - // deletelist.add(mdmModuleDistributeDetailEntities.get(i1)); - // } - // } - // mdmModuleDistributeEntities.get(i).setAddList(addlist); - // mdmModuleDistributeEntities.get(i).setDeleteList(deletelist); - // } - // } - // } - // return BaseResult.getSuccessMessageEntity("查询成功", mdmModuleDistributeEntities); - //} + // - ///** - // * @param object - // * @return com.hzya.frame.web.entity.JsonResultEntity - // * @Author lvleigang - // * @Description 主数据设置保存分发设置 - // * @Date 9:40 上午 2023/10/18 - // **/ - //@Override - //public JsonResultEntity doSaveMdmModuleDistribute(JSONObject object) { - // MdmDistributeDto entity = getData("jsonStr", object, MdmDistributeDto.class); - // //判断是否有数据 - // if (entity == null) { - // return BaseResult.getFailureMessageEntity("参数不允许为空"); - // } - // if (entity.getId() == null || "".equals(entity.getId())) { - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // //if(entity.getMdmModuleDistributeEntities() == null ){ - // // return BaseResult.getFailureMessageEntity("参数不允许为空"); - // //} - // //先删除 - // MdmModuleDistributeEntity mdmModuleDistributeEntity = new MdmModuleDistributeEntity(); - // mdmModuleDistributeEntity.setMdmId(entity.getId()); - // mdmModuleDistributeEntity.setSts("Y"); - // mdmModuleDistributeEntity.setModify_user_id(StpUtil.getLoginIdAsString()); - // mdmModuleDistributeEntity.setModify_time(new Date()); - // mdmModuleDistributeDao.logicRemoveMultiCondition(mdmModuleDistributeEntity); + // - // MdmModuleDistributeDetailEntity mdmModuleDistributeDetailEntity = new MdmModuleDistributeDetailEntity(); - // mdmModuleDistributeDetailEntity.setMdmId(entity.getId()); - // mdmModuleDistributeDetailEntity.setSts("Y"); - // mdmModuleDistributeDetailEntity.setModify_user_id(StpUtil.getLoginIdAsString()); - // mdmModuleDistributeDetailEntity.setModify_time(new Date()); - // mdmModuleDistributeDetailDao.logicRemoveMultiCondition(mdmModuleDistributeDetailEntity); - // - // //保存主数据 - // List mdmModuleDistributeEntities = entity.getMdmModuleDistributeEntities(); - // - // if (mdmModuleDistributeEntities != null && mdmModuleDistributeEntities.size() > 0) { - // for (int i = 0; i < mdmModuleDistributeEntities.size(); i++) { - // MdmModuleDistributeEntity moduleDistributeEntity = mdmModuleDistributeEntities.get(i); - // moduleDistributeEntity.setMdmId(entity.getId()); - // moduleDistributeEntity.setSts("Y"); - // moduleDistributeEntity.setModify_user_id(StpUtil.getLoginIdAsString()); - // moduleDistributeEntity.setModify_time(new Date()); - // if (moduleDistributeEntity.getId() != null && !"".equals(moduleDistributeEntity.getId())) { - // //修改 - // mdmModuleDistributeDao.update(moduleDistributeEntity); - // } else { - // //新增 - // moduleDistributeEntity.setId(UUIDUtils.getUUID()); - // moduleDistributeEntity.setCreate_user_id(StpUtil.getLoginIdAsString()); - // moduleDistributeEntity.setCreate_time(new Date()); - // mdmModuleDistributeDao.save(moduleDistributeEntity); - // } - // if (moduleDistributeEntity.getAddList() != null && moduleDistributeEntity.getAddList().size() > 0) { - // for (int i1 = 0; i1 < moduleDistributeEntity.getAddList().size(); i1++) { - // MdmModuleDistributeDetailEntity moduleDistributeDetailEntity = moduleDistributeEntity.getAddList().get(i1); - // moduleDistributeDetailEntity.setMdmId(entity.getId()); - // moduleDistributeDetailEntity.setSts("Y"); - // moduleDistributeDetailEntity.setApiId(moduleDistributeEntity.getAddApi()); - // moduleDistributeDetailEntity.setDistributeId(moduleDistributeEntity.getId()); - // moduleDistributeDetailEntity.setModify_user_id(StpUtil.getLoginIdAsString()); - // moduleDistributeDetailEntity.setModify_time(new Date()); - // if (moduleDistributeDetailEntity.getId() != null && !"".equals(moduleDistributeDetailEntity.getId())) { - // //修改 - // mdmModuleDistributeDetailDao.update(moduleDistributeDetailEntity); - // } else { - // //新增 - // moduleDistributeDetailEntity.setId(UUIDUtils.getUUID()); - // moduleDistributeDetailEntity.setCreate_user_id(StpUtil.getLoginIdAsString()); - // moduleDistributeDetailEntity.setCreate_time(new Date()); - // mdmModuleDistributeDetailDao.save(moduleDistributeDetailEntity); - // } - // } - // } - // if (moduleDistributeEntity.getDeleteList() != null && moduleDistributeEntity.getDeleteList().size() > 0) { - // for (int i1 = 0; i1 < moduleDistributeEntity.getDeleteList().size(); i1++) { - // MdmModuleDistributeDetailEntity moduleDistributeDetailEntity = moduleDistributeEntity.getDeleteList().get(i1); - // moduleDistributeDetailEntity.setMdmId(entity.getId()); - // moduleDistributeDetailEntity.setSts("Y"); - // moduleDistributeDetailEntity.setApiId(moduleDistributeEntity.getDeleteApi()); - // moduleDistributeDetailEntity.setDistributeId(moduleDistributeEntity.getId()); - // moduleDistributeDetailEntity.setModify_user_id(StpUtil.getLoginIdAsString()); - // moduleDistributeDetailEntity.setModify_time(new Date()); - // if (moduleDistributeDetailEntity.getId() != null && !"".equals(moduleDistributeDetailEntity.getId())) { - // //修改 - // mdmModuleDistributeDetailDao.update(moduleDistributeDetailEntity); - // } else { - // //新增 - // moduleDistributeDetailEntity.setId(UUIDUtils.getUUID()); - // moduleDistributeDetailEntity.setCreate_user_id(StpUtil.getLoginIdAsString()); - // moduleDistributeDetailEntity.setCreate_time(new Date()); - // mdmModuleDistributeDetailDao.save(moduleDistributeDetailEntity); - // } - // } - // } - // } - // } - // return BaseResult.getSuccessMessageEntity("保存发布设置成功"); - //} - // - ///** - // * @param object - // * @return com.hzya.frame.web.entity.JsonResultEntity - // * @Author lvleigang - // * @Description 主数据列表显示 树、查询条件、列表字段、按钮 - // * @Date 9:40 上午 2023/10/18 - // **/ - //@Override - //public JsonResultEntity queryMdmShow(JSONObject object) { - // MdmDto entity = getData("jsonStr", object, MdmDto.class); - // if (entity == null) { - // return BaseResult.getFailureMessageEntity("参数不允许为空"); - // } - // if (entity.getMdmCode() == null || "".equals(entity.getMdmCode())) { - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // //查询模版 - // MdmModuleEntity mdmModuleEntity = new MdmModuleEntity(); - // mdmModuleEntity.setMdmCode(entity.getMdmCode()); - // mdmModuleEntity.setSts("Y"); - // List mdmModuleEntities = mdmModuleDao.queryBase(mdmModuleEntity); - // if (mdmModuleEntities == null || mdmModuleEntities.size() != 1) { - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // - // MdmViewVo mdmViewVo = new MdmViewVo(); - // mdmModuleEntity = mdmModuleEntities.get(0); - // mdmViewVo.setMdmModuleEntity(mdmModuleEntity); - // //查询展示类型 - // MdmModuleViewEntity mdmModuleViewEntity = new MdmModuleViewEntity(); - // mdmModuleViewEntity.setMdmId(mdmModuleEntity.getId()); - // mdmModuleViewEntity.setSts("Y"); - // List moduleViewEntityList = mdmModuleViewDao.queryBase(mdmModuleViewEntity); - // if (moduleViewEntityList == null || moduleViewEntityList.size() != 1) { - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // mdmModuleViewEntity = moduleViewEntityList.get(0); - // mdmViewVo.setMdmModuleViewEntity(mdmModuleViewEntity); - // - // //查询数据源主表 - // MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); - // mdmModuleDbEntity.setMdmId(mdmModuleEntity.getId()); - // mdmModuleDbEntity.setSts("Y"); - // List mdmModuleDbEntityList = mdmModuleDbDao.queryBase(mdmModuleDbEntity); - // if (mdmModuleDbEntityList == null || mdmModuleDbEntityList.size() == 0) { - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // //查询数据源表下面的字段 - // MdmModuleDbFiledsEntity mdmModuleDbFiledsEntity = new MdmModuleDbFiledsEntity(); - // mdmModuleDbFiledsEntity.setMdmId(mdmModuleEntity.getId()); - // mdmModuleDbFiledsEntity.setSts("Y"); - // List mdmModuleDbFiledsEntityList = mdmModuleDbFiledsDao.queryBase(mdmModuleDbFiledsEntity); - // if (mdmModuleDbFiledsEntityList == null || mdmModuleDbFiledsEntityList.size() == 0) { - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // //查询字段下的规则 - // MdmModuleDbFiledsRuleEntity mdmModuleDbFiledsRuleEntity = new MdmModuleDbFiledsRuleEntity(); - // mdmModuleDbFiledsRuleEntity.setMdmId(mdmModuleEntity.getId()); - // mdmModuleDbFiledsRuleEntity.setSts("Y"); - // List mdmModuleDbFiledsRuleEntityList = mdmModuleDbFiledsRuleDao.queryBase(mdmModuleDbFiledsRuleEntity); - // if (mdmModuleDbFiledsRuleEntityList == null || mdmModuleDbFiledsRuleEntityList.size() == 0) { - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // //查询设置的查询字段 - // MdmModuleViewDetailEntity mdmModuleViewDetailEntity = new MdmModuleViewDetailEntity(); - // mdmModuleViewDetailEntity.setMdmId(mdmModuleEntity.getId()); - // mdmModuleViewDetailEntity.setSts("Y"); - // mdmModuleViewDetailEntity.setViewType("1"); - // List queryList = mdmModuleViewDetailDao.queryBase(mdmModuleViewDetailEntity); - // //设置字段 - // List queryListVo = setQueryList(mdmModuleDbEntityList, mdmModuleDbFiledsEntityList, mdmModuleDbFiledsRuleEntityList, queryList, false); - // mdmViewVo.setQueryList(queryListVo); - // - // //查询用户设置字段 - // MdmModuleUserViewEntity mdmModuleUserViewEntity = new MdmModuleUserViewEntity(); - // mdmModuleUserViewEntity.setMdmId(mdmModuleEntity.getId()); - // mdmModuleUserViewEntity.setSts("Y"); - // mdmModuleUserViewEntity.setUserId(StpUtil.getLoginIdAsString()); - // List mdmModuleUserViewEntities = mdmModuleUserViewDao.queryBase(mdmModuleUserViewEntity); - // - // //查询设置的查询字段 - // MdmModuleViewDetailEntity mdmModuleViewDetailEntity1 = new MdmModuleViewDetailEntity(); - // mdmModuleViewDetailEntity1.setMdmId(mdmModuleEntity.getId()); - // mdmModuleViewDetailEntity1.setSts("Y"); - // mdmModuleViewDetailEntity1.setViewType("2"); - // List listList = mdmModuleViewDetailDao.queryBase(mdmModuleViewDetailEntity1); - // List dolistList = new ArrayList<>(); - // - // if (mdmModuleUserViewEntities != null && mdmModuleUserViewEntities.size() > 0) { - // dolistList = getDolist(listList, mdmModuleUserViewEntities); - // if (dolistList == null || dolistList.size() == 0) { - // dolistList = listList; - // } - // } else { - // dolistList = listList; - // } - // List listListVo = setQueryList(mdmModuleDbEntityList, mdmModuleDbFiledsEntityList, mdmModuleDbFiledsRuleEntityList, dolistList, true); - // mdmViewVo.setListList(listListVo); - // - // List buttonList = new ArrayList<>(); - // buttonList.add(new MdmViewButtonVo("new", "新建")); - // buttonList.add(new MdmViewButtonVo("resize", "重置")); - // buttonList.add(new MdmViewButtonVo("search", "查询")); - // buttonList.add(new MdmViewButtonVo("edit", "修改")); - // buttonList.add(new MdmViewButtonVo("dele", "删除")); - // buttonList.add(new MdmViewButtonVo("view", "查看")); - // buttonList.add(new MdmViewButtonVo("send", "下发")); - // mdmViewVo.setButtonList(buttonList); - // return BaseResult.getSuccessMessageEntity("获取字段成功", mdmViewVo); - //} + /** + * @param object + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 主数据列表显示 树、查询条件、列表字段、按钮 + * @Date 9:40 上午 2023/10/18 + **/ + @Override + public JsonResultEntity queryMdmShow(JSONObject object) { + MdmDto entity = getData("jsonStr", object, MdmDto.class); + if (entity == null) { + return BaseResult.getFailureMessageEntity("参数不允许为空"); + } + if (entity.getMdmCode() == null || "".equals(entity.getMdmCode())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + //查询模版 + MdmModuleEntity mdmModuleEntity = mdmServiceCache.getMdmModuleEntity(entity.getMdmCode()); + if(mdmModuleEntity == null || mdmModuleEntity.getId() == null){ + return BaseResult.getFailureMessageEntity("系统错误"); + } + + //设置模版 + MdmViewVo mdmViewVo = new MdmViewVo(); + mdmViewVo.setMdmModuleEntity(mdmModuleEntity); + //查询展示类型 + MdmModuleViewEntity mdmModuleViewEntity = new MdmModuleViewEntity(); + mdmModuleViewEntity.setMdmId(mdmModuleEntity.getId()); + mdmModuleViewEntity.setSts("Y"); + List moduleViewEntityList = mdmServiceCache.queryMdmModuleView(mdmModuleViewEntity); + if (moduleViewEntityList == null || moduleViewEntityList.size() != 1) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + mdmModuleViewEntity = moduleViewEntityList.get(0); + mdmViewVo.setMdmModuleViewEntity(mdmModuleViewEntity); + + //查询数据源主表 + MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); + mdmModuleDbEntity.setMdmId(mdmModuleEntity.getId()); + mdmModuleDbEntity.setSts("Y"); + List mdmModuleDbEntityList = mdmServiceCache.queryMdmModuleDb(mdmModuleDbEntity); + if (mdmModuleDbEntityList == null || mdmModuleDbEntityList.size() == 0) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + //查询数据源表下面的字段 + MdmModuleDbFiledsEntity mdmModuleDbFiledsEntity = new MdmModuleDbFiledsEntity(); + mdmModuleDbFiledsEntity.setMdmId(mdmModuleEntity.getId()); + mdmModuleDbFiledsEntity.setSts("Y"); + List mdmModuleDbFiledsEntityList = mdmServiceCache.queryMdmModuleDbFileds(mdmModuleDbFiledsEntity); + if (mdmModuleDbFiledsEntityList == null || mdmModuleDbFiledsEntityList.size() == 0) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + //查询字段下的规则 + MdmModuleDbFiledsRuleEntity mdmModuleDbFiledsRuleEntity = new MdmModuleDbFiledsRuleEntity(); + mdmModuleDbFiledsRuleEntity.setMdmId(mdmModuleEntity.getId()); + mdmModuleDbFiledsRuleEntity.setSts("Y"); + List mdmModuleDbFiledsRuleEntityList = mdmServiceCache.queryMdmModuleDbFiledsRule(mdmModuleDbFiledsRuleEntity); + if (mdmModuleDbFiledsRuleEntityList == null || mdmModuleDbFiledsRuleEntityList.size() == 0) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + + + //查询设置的查询字段 + MdmModuleViewDetailEntity mdmModuleViewDetailEntity = new MdmModuleViewDetailEntity(); + mdmModuleViewDetailEntity.setMdmId(mdmModuleEntity.getId()); + mdmModuleViewDetailEntity.setSts("Y"); + List mdmModuleViewDetailEntities = mdmServiceCache.queryMdmModuleViewDetail(mdmModuleViewDetailEntity); + + + + + return BaseResult.getSuccessMessageEntity("获取字段成功", mdmViewVo); + } // ///** // * @param object From 7b1a18747c3ca211a3e433cef645f27c4d880ae4 Mon Sep 17 00:00:00 2001 From: lvleigang <957075182@qq.com> Date: Thu, 6 Jun 2024 08:43:01 +0800 Subject: [PATCH 42/80] =?UTF-8?q?=E7=BB=9F=E4=B8=80=E8=BD=AC=E5=8F=91?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=EF=BC=8C=E5=A6=82=E6=9E=9Capi=E5=9C=B0?= =?UTF-8?q?=E5=9D=80=E5=86=85=E5=8C=85=E5=90=AB=20http=20=E6=88=96?= =?UTF-8?q?=E8=80=85=20https=20=E7=9B=B4=E6=8E=A5=E4=BD=BF=E7=94=A8api?= =?UTF-8?q?=E5=AE=8C=E6=95=B4=E5=9C=B0=E5=9D=80=EF=BC=8C=E5=90=A6=E5=88=99?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=20=E5=BA=94=E7=94=A8=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E5=9C=B0=E5=9D=80=20+api=E5=9C=B0=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../application/service/impl/SysApplicationServiceImpl.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 225781f0..bd3c7594 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 @@ -1771,7 +1771,9 @@ public class SysApplicationServiceImpl extends BaseService Date: Fri, 7 Jun 2024 11:19:57 +0800 Subject: [PATCH 43/80] =?UTF-8?q?=E4=B8=BB=E6=95=B0=E6=8D=AE=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/hzya/frame/mdm/entity/MdmDataDto.java | 69 + .../frame/mdm/entity/MdmDataFiledDto.java | 29 + .../frame/mdm/entity/MdmDetailViewVo.java | 41 + .../com/hzya/frame/mdm/entity/MdmDto.java | 153 ++ .../com/hzya/frame/mdm/entity/MdmQuery.java | 69 + .../mdm/mdmModule/dao/IMdmModuleDao.java | 17 + .../mdmModule/dao/impl/MdmModuleDaoImpl.java | 65 +- .../mdm/mdmModule/entity/MdmModuleEntity.xml | 253 ++ .../mdm/mdmModuleDb/dao/IMdmModuleDbDao.java | 10 +- .../dao/impl/MdmModuleDbDaoImpl.java | 26 +- .../mdmModuleDb/entity/MdmModuleDbEntity.xml | 60 + .../entity/MdmModuleDbFiledsEntity.java | 24 + .../hzya/frame/mdm/service/IMdmService.java | 198 +- .../frame/mdm/service/IMdmServiceCache.java | 29 +- .../mdm/service/impl/MdmServiceCache.java | 38 +- .../mdm/service/impl/MdmServiceImpl.java | 2100 +++++++++-------- 16 files changed, 2055 insertions(+), 1126 deletions(-) create mode 100644 service/src/main/java/com/hzya/frame/mdm/entity/MdmDataDto.java create mode 100644 service/src/main/java/com/hzya/frame/mdm/entity/MdmDataFiledDto.java create mode 100644 service/src/main/java/com/hzya/frame/mdm/entity/MdmDetailViewVo.java create mode 100644 service/src/main/java/com/hzya/frame/mdm/entity/MdmQuery.java diff --git a/service/src/main/java/com/hzya/frame/mdm/entity/MdmDataDto.java b/service/src/main/java/com/hzya/frame/mdm/entity/MdmDataDto.java new file mode 100644 index 00000000..0370431c --- /dev/null +++ b/service/src/main/java/com/hzya/frame/mdm/entity/MdmDataDto.java @@ -0,0 +1,69 @@ +package com.hzya.frame.mdm.entity; + + +import com.hzya.frame.mdm.mdmModuleDb.entity.MdmModuleDbEntity; + +import java.util.List; + +public class MdmDataDto { + + private String id; + private String tableName; + private String documentRule; + private Integer documentRuleNum; + /** + * 类型 1、主表 2、明细 + */ + private String dbType; + + private List mdmDataFiledDtos; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getTableName() { + return tableName; + } + + public void setTableName(String tableName) { + this.tableName = tableName; + } + + public List getMdmDataFiledDtos() { + return mdmDataFiledDtos; + } + + public void setMdmDataFiledDtos(List mdmDataFiledDtos) { + this.mdmDataFiledDtos = mdmDataFiledDtos; + } + + public String getDocumentRule() { + return documentRule; + } + + public void setDocumentRule(String documentRule) { + this.documentRule = documentRule; + } + + public Integer getDocumentRuleNum() { + return documentRuleNum; + } + + public void setDocumentRuleNum(Integer documentRuleNum) { + this.documentRuleNum = documentRuleNum; + } + + public String getDbType() { + return dbType; + } + + public void setDbType(String dbType) { + this.dbType = dbType; + } +} + diff --git a/service/src/main/java/com/hzya/frame/mdm/entity/MdmDataFiledDto.java b/service/src/main/java/com/hzya/frame/mdm/entity/MdmDataFiledDto.java new file mode 100644 index 00000000..d9e40e8d --- /dev/null +++ b/service/src/main/java/com/hzya/frame/mdm/entity/MdmDataFiledDto.java @@ -0,0 +1,29 @@ +package com.hzya.frame.mdm.entity; + + +import com.hzya.frame.mdm.mdmModuleDb.entity.MdmModuleDbEntity; + +import java.util.List; + +public class MdmDataFiledDto { + + private String filedsName; + private String filedsValue; + + public String getFiledsName() { + return filedsName; + } + + public void setFiledsName(String filedsName) { + this.filedsName = filedsName; + } + + public String getFiledsValue() { + return filedsValue; + } + + public void setFiledsValue(String filedsValue) { + this.filedsValue = filedsValue; + } +} + diff --git a/service/src/main/java/com/hzya/frame/mdm/entity/MdmDetailViewVo.java b/service/src/main/java/com/hzya/frame/mdm/entity/MdmDetailViewVo.java new file mode 100644 index 00000000..586e4d7d --- /dev/null +++ b/service/src/main/java/com/hzya/frame/mdm/entity/MdmDetailViewVo.java @@ -0,0 +1,41 @@ +package com.hzya.frame.mdm.entity; + +import com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity; +import com.hzya.frame.mdm.mdmModuleDb.entity.MdmModuleDbEntity; +import com.hzya.frame.mdm.mdmModuleView.entity.MdmModuleViewEntity; + +import java.util.List; + +public class MdmDetailViewVo { + //模版信息 + private MdmModuleEntity mdmModuleEntity; + //主数据主表 + private MdmModuleDbEntity mainMdmModuleDb; + //主数据子表 + private List sublistMdmModuleDb; + + public MdmModuleEntity getMdmModuleEntity() { + return mdmModuleEntity; + } + + public void setMdmModuleEntity(MdmModuleEntity mdmModuleEntity) { + this.mdmModuleEntity = mdmModuleEntity; + } + + public MdmModuleDbEntity getMainMdmModuleDb() { + return mainMdmModuleDb; + } + + public void setMainMdmModuleDb(MdmModuleDbEntity mainMdmModuleDb) { + this.mainMdmModuleDb = mainMdmModuleDb; + } + + public List getSublistMdmModuleDb() { + return sublistMdmModuleDb; + } + + public void setSublistMdmModuleDb(List sublistMdmModuleDb) { + this.sublistMdmModuleDb = sublistMdmModuleDb; + } +} + diff --git a/service/src/main/java/com/hzya/frame/mdm/entity/MdmDto.java b/service/src/main/java/com/hzya/frame/mdm/entity/MdmDto.java index b5e8332d..ae393466 100644 --- a/service/src/main/java/com/hzya/frame/mdm/entity/MdmDto.java +++ b/service/src/main/java/com/hzya/frame/mdm/entity/MdmDto.java @@ -17,6 +17,39 @@ public class MdmDto { //主数据子表 private List sublistMdmModuleDb; + + //id + private String id; + //3、新增4、修改 5、查看 + private String showType; + //分页 + private Integer pageNum; + private Integer pageSize; + /** + * 显示字段 + */ + private String viewFiled; + /** + * 上级id字段 + */ + private String upIdFiled; + //主数据名称 + private String mdmName; + //主数据类型 + private String mdmType; + //描述 + private String remark; + //描述 + private String[] ids; + + private String tableName; + private String value; + + private String label; + private String lableValue; + + private String upId; + public Long getMdmCode() { return mdmCode; } @@ -48,5 +81,125 @@ public class MdmDto { public void setSublistMdmModuleDb(List sublistMdmModuleDb) { this.sublistMdmModuleDb = sublistMdmModuleDb; } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getShowType() { + return showType; + } + + public void setShowType(String showType) { + this.showType = showType; + } + + public Integer getPageNum() { + return pageNum; + } + + public void setPageNum(Integer pageNum) { + this.pageNum = pageNum; + } + + public Integer getPageSize() { + return pageSize; + } + + public void setPageSize(Integer pageSize) { + this.pageSize = pageSize; + } + + public String getViewFiled() { + return viewFiled; + } + + public void setViewFiled(String viewFiled) { + this.viewFiled = viewFiled; + } + + public String getUpIdFiled() { + return upIdFiled; + } + + public void setUpIdFiled(String upIdFiled) { + this.upIdFiled = upIdFiled; + } + + public String getMdmName() { + return mdmName; + } + + public void setMdmName(String mdmName) { + this.mdmName = mdmName; + } + + public String getMdmType() { + return mdmType; + } + + public void setMdmType(String mdmType) { + this.mdmType = mdmType; + } + + public String getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark; + } + + public String[] getIds() { + return ids; + } + + public void setIds(String[] ids) { + this.ids = ids; + } + + public String getTableName() { + return tableName; + } + + public void setTableName(String tableName) { + this.tableName = tableName; + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + public String getLabel() { + return label; + } + + public void setLabel(String label) { + this.label = label; + } + + public String getLableValue() { + return lableValue; + } + + public void setLableValue(String lableValue) { + this.lableValue = lableValue; + } + + public String getUpId() { + return upId; + } + + public void setUpId(String upId) { + this.upId = upId; + } } diff --git a/service/src/main/java/com/hzya/frame/mdm/entity/MdmQuery.java b/service/src/main/java/com/hzya/frame/mdm/entity/MdmQuery.java new file mode 100644 index 00000000..bda7c895 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/mdm/entity/MdmQuery.java @@ -0,0 +1,69 @@ +package com.hzya.frame.mdm.entity; + + +import com.hzya.frame.sys.entity.TemplateKeyValue; + +import java.util.List; + +public class MdmQuery { + + //分页 + private Integer pageNum; + private Integer pageSize; + //表名 + private String tableName; + //查询条件 + private List queryCondition; + //返回字段 + private List returnField; + //明细表查询条件 + private List detailQueryCondition; + + public Integer getPageNum() { + return pageNum; + } + + public void setPageNum(Integer pageNum) { + this.pageNum = pageNum; + } + + public Integer getPageSize() { + return pageSize; + } + + public void setPageSize(Integer pageSize) { + this.pageSize = pageSize; + } + + public String getTableName() { + return tableName; + } + + public void setTableName(String tableName) { + this.tableName = tableName; + } + + public List getQueryCondition() { + return queryCondition; + } + + public void setQueryCondition(List queryCondition) { + this.queryCondition = queryCondition; + } + + public List getReturnField() { + return returnField; + } + + public void setReturnField(List returnField) { + this.returnField = returnField; + } + + public List getDetailQueryCondition() { + return detailQueryCondition; + } + + public void setDetailQueryCondition(List detailQueryCondition) { + this.detailQueryCondition = detailQueryCondition; + } +} diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModule/dao/IMdmModuleDao.java b/service/src/main/java/com/hzya/frame/mdm/mdmModule/dao/IMdmModuleDao.java index e4a499ea..8854d3e8 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModule/dao/IMdmModuleDao.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModule/dao/IMdmModuleDao.java @@ -1,8 +1,13 @@ package com.hzya.frame.mdm.mdmModule.dao; +import com.hzya.frame.mdm.entity.MdmDataDto; +import com.hzya.frame.mdm.entity.MdmDto; +import com.hzya.frame.mdm.entity.MdmQuery; import com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity; import com.hzya.frame.basedao.dao.IBaseDao; +import com.hzya.frame.sys.entity.FormmainDeleteDto; +import java.util.HashMap; import java.util.List; import java.util.Map; @@ -22,5 +27,17 @@ public interface IMdmModuleDao extends IBaseDao { Integer createTable(Map maps); Integer alterTable(Map maps); Integer alterTableName(Map maps); + List> queryMdmShowData(MdmQuery entity); + List> queryTemplateDataMore(MdmDto entity); + HashMap queryTemplateDataOne(MdmDto entity); + Integer checkData(Map map); + Integer updateForm(MdmDataDto mdmDataDto); + Integer saveForm(MdmDataDto mdmDataDto); + Integer deleteTemplateById(FormmainDeleteDto formmainDeleteDto); + Integer deleteChilder(FormmainDeleteDto formmainDeleteDto); + List> querySelectData(MdmDto entity); + + List> queryDataAll(MdmDto entity); + } diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModule/dao/impl/MdmModuleDaoImpl.java b/service/src/main/java/com/hzya/frame/mdm/mdmModule/dao/impl/MdmModuleDaoImpl.java index f6742f3d..40cd1bab 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModule/dao/impl/MdmModuleDaoImpl.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModule/dao/impl/MdmModuleDaoImpl.java @@ -1,10 +1,15 @@ package com.hzya.frame.mdm.mdmModule.dao.impl; +import com.hzya.frame.mdm.entity.MdmDataDto; +import com.hzya.frame.mdm.entity.MdmDto; +import com.hzya.frame.mdm.entity.MdmQuery; import com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity; import com.hzya.frame.mdm.mdmModule.dao.IMdmModuleDao; +import com.hzya.frame.sys.entity.FormmainDeleteDto; import org.springframework.stereotype.Repository; import com.hzya.frame.basedao.dao.MybatisGenericDao; +import java.util.HashMap; import java.util.List; import java.util.Map; @@ -25,7 +30,7 @@ public class MdmModuleDaoImpl extends MybatisGenericDao @Override public MdmModuleEntity getByMdmCode(Long mdmCode) { - MdmModuleEntity mdmModuleEntity = (MdmModuleEntity) super.query(getSqlIdPrifx() + "getByMdmCode",mdmCode); + MdmModuleEntity mdmModuleEntity = (MdmModuleEntity) super.selectOne(getSqlIdPrifx() + "getByMdmCode",mdmCode); return mdmModuleEntity; } @@ -35,8 +40,66 @@ public class MdmModuleDaoImpl extends MybatisGenericDao return o; } + @Override + public List> queryDataAll(MdmDto entity) { + List> o = (List>) super.selectList(getSqlIdPrifx() + "queryDataAll", entity); + return o; + } + @Override + public Integer checkData(Map maps) { + Integer o = (Integer) super.selectOne(getSqlIdPrifx() + "checkData", maps); + return o; + } + @Override + public Integer updateForm(MdmDataDto mdmDataDto) { + Integer o = super.update(getSqlIdPrifx() + "updateForm", mdmDataDto); + return o; + } + @Override + public List> querySelectData(MdmDto entity) { + List> o = (List>) super.selectList(getSqlIdPrifx() + "querySelectData", entity); + return o; + + } + @Override + public Integer deleteChilder(FormmainDeleteDto entity) { + Integer o = super.delete(getSqlIdPrifx() + "deleteChilder", entity); + return o; + + } + @Override + public Integer deleteTemplateById(FormmainDeleteDto entity) { + Integer o = super.delete(getSqlIdPrifx() + "deleteTemplateById", entity); + return o; + + } + @Override + public Integer saveForm(MdmDataDto mdmDataDto) { + Integer o = super.update(getSqlIdPrifx() + "saveForm", mdmDataDto); + return o; + + } + @Override + public List> queryTemplateDataMore(MdmDto entity) { + List> o = (List>) super.selectList(getSqlIdPrifx() + "queryTemplateDataMore", entity); + return o; + + } + + @Override + public HashMap queryTemplateDataOne(MdmDto entity) { + HashMap o = (HashMap) super.selectOne(getSqlIdPrifx() + "queryTemplateDataOne", entity); + return o; + + } + + @Override + public List> queryMdmShowData(MdmQuery entity) { + List> o = (List>) super.selectList(getSqlIdPrifx() + "queryMdmShowData", entity); + return o; + } @Override public Integer createTable(Map maps) { Integer o = (Integer) super.selectOne(getSqlIdPrifx() + "createTable", maps); 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 4acbf893..4e94d665 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 @@ -404,5 +404,258 @@ update mdm_module set sts= 'N' ,modify_time = #{modify_time},modify_user_id = # + + + + + + + + + + + + + update ${tableName} set + + + + + ${item.filedsName} = #{item.filedsValue}, + + + modify_user_id = #{item.filedsValue}, + + + + modify_time = now(), + + where id = #{id} + + + + insert into ${tableName}( + + + + + ${item.filedsName}, + + + create_user_id, + modify_user_id, + + + + create_time, + modify_time, + sts, + + document_rule, + document_rule_num, + + + )values + ( + + + + + #{item.filedsValue}, + + + #{item.filedsValue}, + #{item.filedsValue}, + + + + + now(), + now(), + 'Y', + + ( concat(#{documentRule}, + (SELECT + IF + ( + LENGTH( (SELECT + IFNULL(MAX(b.document_rule_num),0)+1 + FROM + ${tableName} b + WHERE + DATE_FORMAT( b.create_time, '%Y-%m' ) = DATE_FORMAT( now(), '%Y-%m' )) ) <= ${documentRuleNum}, + LPAD( (SELECT + IFNULL(MAX(c.document_rule_num),0)+1 + FROM + ${tableName} c + WHERE + DATE_FORMAT( c.create_time, '%Y-%m' ) = DATE_FORMAT( now(), '%Y-%m' )), ${documentRuleNum}, '0' ), + (SELECT + IFNULL(MAX(d.document_rule_num),0)+1 + FROM + ${tableName} d + WHERE + DATE_FORMAT( d.create_time, '%Y-%m' ) = DATE_FORMAT( now(), '%Y-%m' )) + ) + ) + )), + (SELECT + IF + ( + LENGTH( (SELECT + IFNULL(MAX(e.document_rule_num),0)+1 + FROM + ${tableName} e + WHERE + DATE_FORMAT( e.create_time, '%Y-%m' ) = DATE_FORMAT( now(), '%Y-%m' )) ) <= ${documentRuleNum}, + LPAD( (SELECT + IFNULL(MAX(f.document_rule_num),0)+1 + FROM + ${tableName} f + WHERE + DATE_FORMAT( f.create_time, '%Y-%m' ) = DATE_FORMAT( now(), '%Y-%m' )), ${documentRuleNum}, '0' ), + (SELECT + IFNULL(MAX(g.document_rule_num),0)+1 + FROM + ${tableName} g + WHERE + DATE_FORMAT( g.create_time, '%Y-%m' ) = DATE_FORMAT( now(), '%Y-%m' )) + ) + ) + + + ) + + + update ${tableName} set + sts='N',modify_time = now(),modify_user_id = #{loginId} + + and id = #{id} + and formmain_id = #{formmain_id} + and sts='Y' + + + + + update ${tableName} set + sts='N',modify_time = now(),modify_user_id = #{loginId} + + + and ${upIdFiled} like concat(#{upIdFiledValue},'%') + + and sts='Y' + + + + + + diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDb/dao/IMdmModuleDbDao.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDb/dao/IMdmModuleDbDao.java index 92b955dd..89849461 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDb/dao/IMdmModuleDbDao.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDb/dao/IMdmModuleDbDao.java @@ -1,7 +1,11 @@ package com.hzya.frame.mdm.mdmModuleDb.dao; import com.hzya.frame.mdm.mdmModuleDb.entity.MdmModuleDbEntity; -import com.hzya.frame.basedao.dao.IBaseDao; +import com.hzya.frame.basedao.dao.IBaseDao; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; /** * 模版数据库表(mdm_module_db: table)表数据库访问层 @@ -10,6 +14,8 @@ import com.hzya.frame.basedao.dao.IBaseDao; * @since 2024-06-03 08:46:48 */ public interface IMdmModuleDbDao extends IBaseDao { - + HashMap getServiceDataById(Map queryData); + List> getServiceByFormmainId(Map queryData); + List> getServiceByDistributeId(Map queryData); } diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDb/dao/impl/MdmModuleDbDaoImpl.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDb/dao/impl/MdmModuleDbDaoImpl.java index 77d8c8bb..8bf06ee1 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDb/dao/impl/MdmModuleDbDaoImpl.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDb/dao/impl/MdmModuleDbDaoImpl.java @@ -4,6 +4,11 @@ import com.hzya.frame.mdm.mdmModuleDb.entity.MdmModuleDbEntity; import com.hzya.frame.mdm.mdmModuleDb.dao.IMdmModuleDbDao; import org.springframework.stereotype.Repository; import com.hzya.frame.basedao.dao.MybatisGenericDao; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + /** * 模版数据库表(MdmModuleDb)表数据库访问层 * @@ -12,6 +17,25 @@ import com.hzya.frame.basedao.dao.MybatisGenericDao; */ @Repository(value = "MdmModuleDbDaoImpl") public class MdmModuleDbDaoImpl extends MybatisGenericDao implements IMdmModuleDbDao{ - + @Override + public HashMap getServiceDataById(Map maps) { + HashMap o = (HashMap) super.selectOne(getSqlIdPrifx() + "getServiceDataById", maps); + return o; + + } + + @Override + public List> getServiceByFormmainId(Map maps) { + List> o = (List>) super.selectList(getSqlIdPrifx() + "getServiceByFormmainId", maps); + return o; + + } + @Override + public List> getServiceByDistributeId(Map maps) { + List> o = (List>) super.selectList(getSqlIdPrifx() + "getServiceByDistributeId", maps); + return o; + + } + } diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDb/entity/MdmModuleDbEntity.xml b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDb/entity/MdmModuleDbEntity.xml index 383d4ca7..2340cbcd 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDb/entity/MdmModuleDbEntity.xml +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDb/entity/MdmModuleDbEntity.xml @@ -238,6 +238,66 @@ update mdm_module_db set sts= 'N' ,modify_time = #{modify_time},modify_user_id delete from mdm_module_db where id = #{id} + + + + + + + diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDbFileds/entity/MdmModuleDbFiledsEntity.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDbFileds/entity/MdmModuleDbFiledsEntity.java index 194a0ace..abb89344 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDbFileds/entity/MdmModuleDbFiledsEntity.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDbFileds/entity/MdmModuleDbFiledsEntity.java @@ -41,6 +41,14 @@ public class MdmModuleDbFiledsEntity extends BaseEntity { private String companyId; /** 数据类型 1、新增 2、修改 */ private String dataType; + /** + * roletype + */ + private String roletype; + /** + * roletype + */ + private String roleValue; private List mdmModuleDbFiledsRules; public String getMdmId() { @@ -162,5 +170,21 @@ public class MdmModuleDbFiledsEntity extends BaseEntity { public void setDataType(String dataType) { this.dataType = dataType; } + + public String getRoletype() { + return roletype; + } + + public void setRoletype(String roletype) { + this.roletype = roletype; + } + + public String getRoleValue() { + return roleValue; + } + + public void setRoleValue(String roleValue) { + this.roleValue = roleValue; + } } diff --git a/service/src/main/java/com/hzya/frame/mdm/service/IMdmService.java b/service/src/main/java/com/hzya/frame/mdm/service/IMdmService.java index b815b318..d588e694 100644 --- a/service/src/main/java/com/hzya/frame/mdm/service/IMdmService.java +++ b/service/src/main/java/com/hzya/frame/mdm/service/IMdmService.java @@ -50,7 +50,7 @@ public interface IMdmService { * @param jsonObject * @return com.hzya.frame.web.entity.JsonResultEntity * @Author lvleigang - * @Description 主数据基本信息保存 + * @Description 主数据基本信息修改 * @Date 9:40 上午 2023/10/18 **/ JsonResultEntity doSaveMdmModule(JSONObject jsonObject); @@ -63,31 +63,31 @@ public interface IMdmService { **/ JsonResultEntity queryMdmModuleDb(JSONObject jsonObject); // - ///** - // * @param jsonObject - // * @return com.hzya.frame.web.entity.JsonResultEntity - // * @Author lvleigang - // * @Description 主数据设置查询数据源的服务 - // * @Date 9:40 上午 2023/10/18 - // **/ - //JsonResultEntity queryMdmModuleServer(JSONObject jsonObject); - ///** - // * @param jsonObject - // * @return com.hzya.frame.web.entity.JsonResultEntity - // * @Author lvleigang - // * @Description 主数据设置查询数据源字段的服务 - // * @Date 9:40 上午 2023/10/18 - // **/ - //JsonResultEntity queryMdmModuleServerFiled(JSONObject jsonObject); - // - ///** - // * @param jsonObject - // * @return com.hzya.frame.web.entity.JsonResultEntity - // * @Author lvleigang - // * @Description 主数据设置查询主表字段 - // * @Date 9:40 上午 2023/10/18 - // **/ - //JsonResultEntity queryMdmModuleServerMainFiled(JSONObject jsonObject); + /** + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 主数据设置查询数据源的服务 + * @Date 9:40 上午 2023/10/18 + **/ + JsonResultEntity queryMdmModuleServer(JSONObject jsonObject); + /** + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 主数据设置查询数据源字段的服务 + * @Date 9:40 上午 2023/10/18 + **/ + JsonResultEntity queryMdmModuleServerFiled(JSONObject jsonObject); + + /** + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 主数据设置查询主表字段 + * @Date 9:40 上午 2023/10/18 + **/ + JsonResultEntity queryMdmModuleServerMainFiled(JSONObject jsonObject); /** * @param jsonObject * @return com.hzya.frame.web.entity.JsonResultEntity @@ -233,30 +233,30 @@ public interface IMdmService { **/ JsonResultEntity queryMdmShow(JSONObject jsonObject); // - ///** - // * @param jsonObject - // * @return com.hzya.frame.web.entity.JsonResultEntity - // * @Author lvleigang - // * @Description 主数据查询所有字段 - // * @Date 9:40 上午 2023/10/18 - // **/ - //JsonResultEntity queryMdmShowAll(JSONObject jsonObject); - ///** - // * @Author lvleigang - // * @Description 查询模版数据(list 或者 分页) - // * @Date 1:33 下午 2023/7/12 - // * @param jsonObject - // * @return com.hzya.frame.web.entity.JsonResultEntity - // **/ - //JsonResultEntity queryTemplateData(JSONObject jsonObject); - ///** - // * @param jsonObject - // * @return com.hzya.frame.web.entity.JsonResultEntity - // * @Author lvleigang - // * @Description 主数据列表显示 业务数据 - // * @Date 9:40 上午 2023/10/18 - // **/ - //JsonResultEntity queryMdmShowData(JSONObject jsonObject); + /** + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 主数据查询所有字段 + * @Date 9:40 上午 2023/10/18 + **/ + JsonResultEntity queryMdmShowAll(JSONObject jsonObject); + /** + * @Author lvleigang + * @Description 查询模版数据(list 或者 分页) + * @Date 1:33 下午 2023/7/12 + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + **/ + JsonResultEntity queryTemplateData(JSONObject jsonObject); + /** + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 主数据列表显示 业务数据 + * @Date 9:40 上午 2023/10/18 + **/ + JsonResultEntity queryMdmShowData(JSONObject jsonObject); // ///** // * @param jsonObject @@ -266,14 +266,14 @@ public interface IMdmService { // * @Date 9:40 上午 2023/10/18 // **/ //JsonResultEntity queryMdmShowDistribute(JSONObject jsonObject); - ///** - // * @param jsonObject - // * @return com.hzya.frame.web.entity.JsonResultEntity - // * @Author lvleigang - // * @Description 主数据业务数据树结构 - // * @Date 9:40 上午 2023/10/18 - // **/ - //JsonResultEntity queryMdmShowTreeData(JSONObject jsonObject); + /** + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 主数据业务数据树结构 + * @Date 9:40 上午 2023/10/18 + **/ + JsonResultEntity queryMdmShowTreeData(JSONObject jsonObject); ///** // * @param jsonObject // * @return com.hzya.frame.web.entity.JsonResultEntity @@ -283,49 +283,49 @@ public interface IMdmService { // **/ //JsonResultEntity queryMdmOptionData(JSONObject jsonObject); // - ///** - // * @param jsonObject - // * @return com.hzya.frame.web.entity.JsonResultEntity - // * @Author lvleigang - // * @Description 主数据详情 区分类型 新增、修改、查看 - // * @Date 9:40 上午 2023/10/18 - // **/ - //JsonResultEntity queryMdmShowDetails(JSONObject jsonObject); + /** + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 主数据详情 区分类型 新增、修改、查看 + * @Date 9:40 上午 2023/10/18 + **/ + JsonResultEntity queryMdmShowDetails(JSONObject jsonObject); // - ///** - // * @param jsonObject - // * @return com.hzya.frame.web.entity.JsonResultEntity - // * @Author lvleigang - // * @Description 主数据详情数据 区分类型 新增、修改、查看 - // * @Date 9:40 上午 2023/10/18 - // **/ - //JsonResultEntity queryMdmShowDetailsData(JSONObject jsonObject); + /** + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 主数据详情数据 区分类型 新增、修改、查看 + * @Date 9:40 上午 2023/10/18 + **/ + JsonResultEntity queryMdmShowDetailsData(JSONObject jsonObject); // - ///** - // * @param jsonObject - // * @return com.hzya.frame.web.entity.JsonResultEntity - // * @Author lvleigang - // * @Description 主数据详情数据修改 - // * @Date 9:40 上午 2023/10/18 - // **/ - //JsonResultEntity updateMdmShowDetailsData(JSONObject jsonObject); - ///** - // * @param jsonObject - // * @return com.hzya.frame.web.entity.JsonResultEntity - // * @Author lvleigang - // * @Description 主数据详情数据新增 - // * @Date 9:40 上午 2023/10/18 - // **/ - //JsonResultEntity saveMdmShowDetailsData(JSONObject jsonObject); - // - ///** - // * @param jsonObject - // * @return com.hzya.frame.web.entity.JsonResultEntity - // * @Author lvleigang - // * @Description 主数据删除业务数据 - // * @Date 9:40 上午 2023/10/18 - // **/ - //JsonResultEntity deleteMdmShowDetailsData(JSONObject jsonObject); + /** + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 主数据详情数据修改 + * @Date 9:40 上午 2023/10/18 + **/ + JsonResultEntity updateMdmShowDetailsData(JSONObject jsonObject); + /** + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 主数据详情数据新增 + * @Date 9:40 上午 2023/10/18 + **/ + JsonResultEntity saveMdmShowDetailsData(JSONObject jsonObject); + + /** + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 主数据删除业务数据 + * @Date 9:40 上午 2023/10/18 + **/ + JsonResultEntity deleteMdmShowDetailsData(JSONObject jsonObject); // ///** // * @param jsonObject diff --git a/service/src/main/java/com/hzya/frame/mdm/service/IMdmServiceCache.java b/service/src/main/java/com/hzya/frame/mdm/service/IMdmServiceCache.java index 36750991..4174d5fa 100644 --- a/service/src/main/java/com/hzya/frame/mdm/service/IMdmServiceCache.java +++ b/service/src/main/java/com/hzya/frame/mdm/service/IMdmServiceCache.java @@ -30,14 +30,33 @@ public interface IMdmServiceCache { * @return com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity **/ MdmModuleEntity getMdmModuleEntity(Long mdmCode); + /** + * @Author lvleigang + * @Description 获取模版单据编码规则 + * @Date 10:13 上午 2024/6/3 + * @param mdmTableCodeRuleEntity + * @return com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity + **/ + List queryMdmTableCodeRuleEntity(MdmTableCodeRuleEntity mdmTableCodeRuleEntity); + /** + * @Author lvleigang + * @Description 获取模版表数据 + * @Date 10:13 上午 2024/6/3 + * @param queryDb + * @return com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity + **/ + List queryMdmModuleDb(MdmModuleDbEntity queryDb); + /** + * @Author lvleigang + * @Description 获取模版字段表数据 + * @Date 10:13 上午 2024/6/3 + * @param queryDbFiled + * @return com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity + **/ + List queryMdmModuleDbFileds(MdmModuleDbFiledsEntity queryDbFiled); void updateMdmModuleEntity(MdmModuleEntity entity); - List queryMdmTableCodeRuleEntity(MdmTableCodeRuleEntity mdmTableCodeRuleEntity); - - List queryMdmModuleDb(MdmModuleDbEntity queryDb); - - List queryMdmModuleDbFileds(MdmModuleDbFiledsEntity queryDbFiled); List queryMdmModuleDbFiledsRule(MdmModuleDbFiledsRuleEntity queryDbFiledRule); diff --git a/service/src/main/java/com/hzya/frame/mdm/service/impl/MdmServiceCache.java b/service/src/main/java/com/hzya/frame/mdm/service/impl/MdmServiceCache.java index bf531ea9..b847f145 100644 --- a/service/src/main/java/com/hzya/frame/mdm/service/impl/MdmServiceCache.java +++ b/service/src/main/java/com/hzya/frame/mdm/service/impl/MdmServiceCache.java @@ -87,7 +87,7 @@ public class MdmServiceCache implements IMdmServiceCache { } @Override - @Cacheable(cacheNames="mdmTableCodeRule",key = "#mdmId") + @Cacheable(cacheNames="mdmTableCodeRule",key = "#entity.mdmId") public List queryMdmTableCodeRuleEntity(MdmTableCodeRuleEntity entity) { List mdmTableCodeRuleEntityList = mdmTableCodeRuleDao.queryBase(entity); return mdmTableCodeRuleEntityList; @@ -95,21 +95,21 @@ public class MdmServiceCache implements IMdmServiceCache { @Override - @Cacheable(cacheNames="mdmModuleDb",key = "#mdmId") + @Cacheable(cacheNames="mdmModuleDb",key = "#entity.mdmId") public List queryMdmModuleDb(MdmModuleDbEntity entity) { List mdmModuleDbEntities = mdmModuleDbDao.queryBase(entity); return mdmModuleDbEntities; } @Override - @Cacheable(cacheNames="mdmModuleDbFileds",key = "#mdmId") + @Cacheable(cacheNames="mdmModuleDbFileds",key = "#entity.mdmId") public List queryMdmModuleDbFileds(MdmModuleDbFiledsEntity entity) { List mdmModuleDbFiledsEntities = mdmModuleDbFiledsDao.queryBase(entity); return mdmModuleDbFiledsEntities; } @Override - @Cacheable(cacheNames="mdmModuleDbFiledsRule",key = "#mdmId") + @Cacheable(cacheNames="mdmModuleDbFiledsRule",key = "#entity.mdmId") public List queryMdmModuleDbFiledsRule(MdmModuleDbFiledsRuleEntity entity) { List mdmModuleDbFiledsRuleEntities = mdmModuleDbFiledsRuleDao.queryBase(entity); return mdmModuleDbFiledsRuleEntities; @@ -176,23 +176,23 @@ public class MdmServiceCache implements IMdmServiceCache { } @Override - @Cacheable(cacheNames="mdmModuleViewDetail",key = "#mdmId") - public List queryMdmModuleViewDetail(MdmModuleViewDetailEntity mdmModuleViewDetailEntity) { - List mdmModuleViewDetailEntities = mdmModuleViewDetailDao.queryBase(mdmModuleViewDetailEntity); + @Cacheable(cacheNames="mdmModuleViewDetail",key = "#entity.mdmId") + public List queryMdmModuleViewDetail(MdmModuleViewDetailEntity entity) { + List mdmModuleViewDetailEntities = mdmModuleViewDetailDao.queryBase(entity); return mdmModuleViewDetailEntities; } @Override - @Cacheable(cacheNames="mdmModuleView",key = "#mdmId") - public List queryMdmModuleView(MdmModuleViewEntity mdmModuleViewEntity) { - List moduleViewEntities = mdmModuleViewDao.queryBase(mdmModuleViewEntity); + @Cacheable(cacheNames="mdmModuleView",key = "#entity.mdmId") + public List queryMdmModuleView(MdmModuleViewEntity entity) { + List moduleViewEntities = mdmModuleViewDao.queryBase(entity); return moduleViewEntities; } @Override - @Cacheable(cacheNames="mdmModuleViewButton",key = "#mdmId") - public List queryMdmModuleViewButton(MdmModuleViewButtonEntity mdmModuleViewButtonEntity) { - List mdmModuleViewButtonEntities = mdmModuleViewButtonDao.queryBase(mdmModuleViewButtonEntity); + @Cacheable(cacheNames="mdmModuleViewButton",key = "#entity.mdmId") + public List queryMdmModuleViewButton(MdmModuleViewButtonEntity entity) { + List mdmModuleViewButtonEntities = mdmModuleViewButtonDao.queryBase(entity); return mdmModuleViewButtonEntities; } @@ -263,9 +263,9 @@ public class MdmServiceCache implements IMdmServiceCache { return mdmModuleDistributeEntities; } @Override - @Cacheable(cacheNames="mdmModuleDistributeDetail",key = "#mdmId") - public List queryMdmModuleDistributeDetail(MdmModuleDistributeDetailEntity mdmModuleDistributeDetailEntity){ - List mdmModuleDistributeDetailEntities = mdmModuleDistributeDetailDao.queryBase(mdmModuleDistributeDetailEntity); + @Cacheable(cacheNames="mdmModuleDistributeDetail",key = "#entity.mdmId") + public List queryMdmModuleDistributeDetail(MdmModuleDistributeDetailEntity entity){ + List mdmModuleDistributeDetailEntities = mdmModuleDistributeDetailDao.queryBase(entity); return mdmModuleDistributeDetailEntities; } @@ -312,9 +312,9 @@ public class MdmServiceCache implements IMdmServiceCache { } @Override - @Cacheable(cacheNames="mdmModuleSource",key = "#mdmId") - public List queryMdmModuleSource(MdmModuleSourceEntity mdmModuleSourceEntity) { - List mdmModuleSourceEntities = mdmModuleSourceDao.queryBase(mdmModuleSourceEntity); + @Cacheable(cacheNames="mdmModuleSource",key = "#entity.mdmId") + public List queryMdmModuleSource(MdmModuleSourceEntity entity) { + List mdmModuleSourceEntities = mdmModuleSourceDao.queryBase(entity); return mdmModuleSourceEntities; } 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 bf517a33..145b9b67 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 @@ -1,16 +1,21 @@ package com.hzya.frame.mdm.service.impl; import cn.dev33.satoken.stp.StpUtil; +import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import com.hzya.frame.mdm.entity.DbFiledsDto; +import com.hzya.frame.mdm.entity.MdmDataDto; +import com.hzya.frame.mdm.entity.MdmDataFiledDto; import com.hzya.frame.mdm.entity.MdmDbFiledVo; import com.hzya.frame.mdm.entity.MdmDbVo; +import com.hzya.frame.mdm.entity.MdmDetailViewVo; import com.hzya.frame.mdm.entity.MdmDistributeDto; import com.hzya.frame.mdm.entity.MdmDto; import com.hzya.frame.mdm.entity.MdmModuleViewDto; import com.hzya.frame.mdm.entity.MdmModuleViewVo; +import com.hzya.frame.mdm.entity.MdmQuery; import com.hzya.frame.mdm.entity.MdmSourceDto; import com.hzya.frame.mdm.entity.MdmViewFiledVo; import com.hzya.frame.mdm.entity.MdmViewVo; @@ -40,6 +45,7 @@ import com.hzya.frame.mdm.mdmTableCodeRule.entity.MdmTableCodeRuleEntity; import com.hzya.frame.mdm.service.IMdmService; import com.hzya.frame.mdm.service.IMdmServiceCache; +import com.hzya.frame.sys.entity.FormmainDeleteDto; import com.hzya.frame.sysnew.buttonConfig.dao.ISysButtonConfigDao; import com.hzya.frame.sysnew.buttonConfig.entity.SysButtonConfigEntity; import com.hzya.frame.sysnew.menuConfig.dao.ISysMenuConfigDao; @@ -49,14 +55,18 @@ import com.hzya.frame.sysnew.popedomOperate.entity.SysPopedomOperateEntity; import com.hzya.frame.sysnew.user.entity.SysUserEntity; import com.hzya.frame.sysnew.userCompany.entity.SysUserCompanyEntity; import com.hzya.frame.sysnew.userRoles.entity.SysUserRolesEntity; +import com.hzya.frame.uuid.UUIDUtils; import com.hzya.frame.web.entity.BaseResult; import com.hzya.frame.web.entity.JsonResultEntity; +import org.checkerframework.checker.units.qual.A; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Service; import javax.annotation.Resource; +import java.text.SimpleDateFormat; import java.util.ArrayList; +import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -199,6 +209,11 @@ public class MdmServiceImpl implements IMdmService { if (entity.getMdmCode() == null || "".equals(entity.getMdmCode())) { return BaseResult.getFailureMessageEntity("系统错误"); } + MdmModuleEntity mdmModuleEntity = mdmServiceCache.getMdmModuleEntity(entity.getMdmCode()); + if(mdmModuleEntity == null ){ + return BaseResult.getFailureMessageEntity("系统错误"); + } + entity.setId(mdmModuleEntity.getId()); //修改 entity.setUpdate(); mdmServiceCache.updateMdmModuleEntity(entity); @@ -596,11 +611,11 @@ public class MdmServiceImpl implements IMdmService { documentRule.setEnName("单据规则"); documentRule.setFiledType("3"); documentRule.setAddType("2"); - documentRule.setUpdateType("2"); - documentRule.setShowType("2"); - documentRule.setQueryType("2"); - documentRule.setListType("2"); - documentRule.setViewType("2"); + documentRule.setUpdateType("1"); + documentRule.setShowType("1"); + documentRule.setQueryType("1"); + documentRule.setListType("1"); + documentRule.setViewType("1"); documentRule.setFiledLength("50"); documentRule.setDataType("1"); mdmModuleDbFiledsEntities.add(documentRule); @@ -709,7 +724,7 @@ public class MdmServiceImpl implements IMdmService { MdmModuleDbFiledsEntity option_Name = new MdmModuleDbFiledsEntity(); option_Name.setMdmId(mdmId); option_Name.setDbId(dbId); - option_Name.setChName("option_Name"); + option_Name.setChName("option_name"); option_Name.setEnName("操作人"); option_Name.setFiledType("3"); option_Name.setAddType("2"); @@ -846,7 +861,7 @@ public class MdmServiceImpl implements IMdmService { delete_status.setMdmId(mdmId); delete_status.setDbId(dbId); delete_status.setChName("delete_status"); - delete_status.setEnName("修删除数据状态 0待下发 1已下发"); + delete_status.setEnName("删除数据状态 0待下发 1已下发"); delete_status.setFiledType("3"); delete_status.setAddType("2"); delete_status.setUpdateType("2"); @@ -1779,7 +1794,7 @@ public class MdmServiceImpl implements IMdmService { if(mdmModuleDbEntities != null && mdmModuleDbEntities.size() > 0 ){ for (int i = 0; i < mdmModuleDbEntities.size(); i++) { if("1".equals(mdmModuleDbEntities.get(i).getDbType())){ - entity.setTableName(mdmModuleDbEntities.get(i).getDbName()+"_send_log"); + entity.setTableName(mdmModuleDbEntities.get(i).getDbName()+"_option_log"); break; } } @@ -1822,7 +1837,7 @@ public class MdmServiceImpl implements IMdmService { if(mdmModuleDbEntities != null && mdmModuleDbEntities.size() > 0 ){ for (int i = 0; i < mdmModuleDbEntities.size(); i++) { if("1".equals(mdmModuleDbEntities.get(i).getDbType())){ - entity.setTableName(mdmModuleDbEntities.get(i).getDbName()+"_send_log"); + entity.setTableName(mdmModuleDbEntities.get(i).getDbName()+"_option_log"); break; } } @@ -1866,7 +1881,7 @@ public class MdmServiceImpl implements IMdmService { if(mdmModuleDbEntities != null && mdmModuleDbEntities.size() > 0 ){ for (int i = 0; i < mdmModuleDbEntities.size(); i++) { if("1".equals(mdmModuleDbEntities.get(i).getDbType())){ - entity.setTableName(mdmModuleDbEntities.get(i).getDbName()+"_send_log"); + entity.setTableName(mdmModuleDbEntities.get(i).getDbName()+"_option_log"); break; } } @@ -1877,95 +1892,105 @@ public class MdmServiceImpl implements IMdmService { mdmModuleOptionLogDao.logicRemove(entity); return BaseResult.getSuccessMessageEntity("删除日志成功"); } - ///** - // * @param object - // * @return com.hzya.frame.web.entity.JsonResultEntity - // * @Author lvleigang - // * @Description 主数据设置查询数据源的服务 - // * @Date 9:40 上午 2023/10/18 - // **/ - //@Override - //public JsonResultEntity queryMdmModuleServer(JSONObject object) { - // MdmModuleDbEntity entity = getData("jsonStr", object, MdmModuleDbEntity.class); - // //判断分页 - // if (entity == null) { - // entity = new MdmModuleDbEntity(); - // } - // //查询数据源表 - // entity.setSts("Y"); - // List mdmModuleDbEntityList = mdmModuleDbDao.queryByLike(entity); - // return BaseResult.getSuccessMessageEntity("查询数据成功", mdmModuleDbEntityList); - //} + /** + * @param object + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 主数据设置查询数据源的服务 + * @Date 9:40 上午 2023/10/18 + **/ + @Override + public JsonResultEntity queryMdmModuleServer(JSONObject object) { + MdmModuleDbEntity entity = getData("jsonStr", object, MdmModuleDbEntity.class); + //判断分页 + if (entity == null) { + entity = new MdmModuleDbEntity(); + } + //查询数据源表 + entity.setSts("Y"); + List allDb = mdmModuleDbDao.queryByLike(entity); + List mdmModuleDbEntityList = new ArrayList<>(); + if(allDb != null && allDb.size() > 0){ + for (int i = 0; i < allDb.size(); i++) { + if("1".equals(allDb.get(i).getDbType()) || "2".equals(allDb.get(i).getDbType() )){ + mdmModuleDbEntityList.add(allDb.get(i)); + } + } + } + return BaseResult.getSuccessMessageEntity("查询数据成功", mdmModuleDbEntityList); + } - ///** - // * @param object - // * @return com.hzya.frame.web.entity.JsonResultEntity - // * @Author lvleigang - // * @Description 主数据设置查询数据源的服务的字段 - // * @Date 9:40 上午 2023/10/18 - // **/ - //@Override - //public JsonResultEntity queryMdmModuleServerFiled(JSONObject object) { - // MdmModuleDbEntity entity = getData("jsonStr", object, MdmModuleDbEntity.class); - // //判断分页 - // if (entity == null) { - // return BaseResult.getFailureMessageEntity("参数不允许为空"); - // } - // if (entity.getDbName() == null || "".equals(entity.getDbName())) { - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // //查询数据源表 - // entity.setSts("Y"); - // List dblist = mdmModuleDbDao.queryBase(entity); - // if (dblist != null && dblist.size() == 1) { - // MdmModuleDbFiledsEntity queryDbFiled = new MdmModuleDbFiledsEntity(); - // queryDbFiled.setSts("Y"); - // queryDbFiled.setDbId(dblist.get(0).getId()); - // List list = mdmModuleDbFiledsDao.queryBase(queryDbFiled); - // MdmModuleDbFiledsEntity mdmModuleDbFiledsEntity = new MdmModuleDbFiledsEntity(); - // mdmModuleDbFiledsEntity.setChName("id"); - // mdmModuleDbFiledsEntity.setEnName("id"); - // list.add(0, mdmModuleDbFiledsEntity); - // return BaseResult.getSuccessMessageEntity("查询数据成功", list); - // } else { - // return BaseResult.getFailureMessageEntity("服务不存在"); - // } - //} + /** + * @param object + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 主数据设置查询数据源的服务的字段 + * @Date 9:40 上午 2023/10/18 + **/ + @Override + public JsonResultEntity queryMdmModuleServerFiled(JSONObject object) { + MdmModuleDbEntity entity = getData("jsonStr", object, MdmModuleDbEntity.class); + //判断分页 + if (entity == null) { + return BaseResult.getFailureMessageEntity("参数不允许为空"); + } + if (entity.getDbName() == null || "".equals(entity.getDbName())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + //查询数据源表 + entity.setSts("Y"); + List dblist = mdmModuleDbDao.queryBase(entity); + if (dblist != null && dblist.size() == 1) { + MdmModuleDbFiledsEntity queryDbFiled = new MdmModuleDbFiledsEntity(); + queryDbFiled.setSts("Y"); + queryDbFiled.setDbId(dblist.get(0).getId()); + queryDbFiled.setViewType("1"); + List list = mdmModuleDbFiledsDao.queryBase(queryDbFiled); + MdmModuleDbFiledsEntity mdmModuleDbFiledsEntity = new MdmModuleDbFiledsEntity(); + mdmModuleDbFiledsEntity.setChName("id"); + mdmModuleDbFiledsEntity.setEnName("id"); + list.add(0, mdmModuleDbFiledsEntity); + return BaseResult.getSuccessMessageEntity("查询数据成功", list); + } else { + return BaseResult.getFailureMessageEntity("服务不存在"); + } + } // // - ///** - // * @param object - // * @return com.hzya.frame.web.entity.JsonResultEntity - // * @Author lvleigang - // * @Description 主数据设置查询主表字段 - // * @Date 9:40 上午 2023/10/18 - // **/ - //@Override - //public JsonResultEntity queryMdmModuleServerMainFiled(JSONObject object) { - // MdmModuleDbEntity entity = getData("jsonStr", object, MdmModuleDbEntity.class); - // //判断分页 - // if (entity == null) { - // return BaseResult.getFailureMessageEntity("参数不允许为空"); - // } - // if (entity.getMdmId() == null || "".equals(entity.getMdmId())) { - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // //查询数据源表 - // entity.setSts("Y"); - // entity.setDbType("1"); - // List mdmModuleDbEntityList = mdmModuleDbDao.queryBase(entity); - // if (mdmModuleDbEntityList != null && mdmModuleDbEntityList.size() == 1) { - // MdmModuleDbFiledsEntity mdmModuleDbFiledsEntity = new MdmModuleDbFiledsEntity(); - // mdmModuleDbFiledsEntity.setSts("Y"); - // mdmModuleDbFiledsEntity.setDbId(mdmModuleDbEntityList.get(0).getId()); - // List list = mdmModuleDbFiledsDao.queryBase(mdmModuleDbFiledsEntity); - // return BaseResult.getSuccessMessageEntity("查询数据成功", list); - // } else if (mdmModuleDbEntityList != null && mdmModuleDbEntityList.size() == 0) { - // return BaseResult.getFailureMessageEntity("请先配置数据源"); - // } else { - // return BaseResult.getFailureMessageEntity("查询数据失败"); - // } - //} + /** + * @param object + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 主数据设置查询主表字段 + * @Date 9:40 上午 2023/10/18 + **/ + @Override + public JsonResultEntity queryMdmModuleServerMainFiled(JSONObject object) { + MdmModuleDbEntity entity = getData("jsonStr", object, MdmModuleDbEntity.class); + //判断分页 + if (entity == null) { + return BaseResult.getFailureMessageEntity("参数不允许为空"); + } + if (entity.getMdmId() == null || "".equals(entity.getMdmId())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + //查询数据源表 + entity.setSts("Y"); + entity.setDbType("1"); + List mdmModuleDbEntityList = mdmModuleDbDao.queryBase(entity); + if (mdmModuleDbEntityList != null && mdmModuleDbEntityList.size() == 1) { + MdmModuleDbFiledsEntity mdmModuleDbFiledsEntity = new MdmModuleDbFiledsEntity(); + mdmModuleDbFiledsEntity.setSts("Y"); + mdmModuleDbFiledsEntity.setViewType("1"); + mdmModuleDbFiledsEntity.setDbId(mdmModuleDbEntityList.get(0).getId()); + List list = mdmModuleDbFiledsDao.queryBase(mdmModuleDbFiledsEntity); + return BaseResult.getSuccessMessageEntity("查询数据成功", list); + } else if (mdmModuleDbEntityList != null && mdmModuleDbEntityList.size() == 0) { + return BaseResult.getFailureMessageEntity("请先配置数据源"); + } else { + return BaseResult.getFailureMessageEntity("查询数据失败"); + } + } @@ -2493,68 +2518,131 @@ public class MdmServiceImpl implements IMdmService { return BaseResult.getFailureMessageEntity("系统错误"); } - //查询设置的查询字段 MdmModuleViewDetailEntity mdmModuleViewDetailEntity = new MdmModuleViewDetailEntity(); mdmModuleViewDetailEntity.setMdmId(mdmModuleEntity.getId()); mdmModuleViewDetailEntity.setSts("Y"); List mdmModuleViewDetailEntities = mdmServiceCache.queryMdmModuleViewDetail(mdmModuleViewDetailEntity); - - - - + if (mdmModuleViewDetailEntities == null || mdmModuleViewDetailEntities.size() == 0) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + List queryList = getFiledByType("1",mdmModuleViewDetailEntities,mdmModuleDbEntityList,mdmModuleDbFiledsEntityList,mdmModuleDbFiledsRuleEntityList); + mdmViewVo.setQueryList(queryList); + List listList = getFiledByType("2",mdmModuleViewDetailEntities,mdmModuleDbEntityList,mdmModuleDbFiledsEntityList,mdmModuleDbFiledsRuleEntityList); + mdmViewVo.setListList(listList); return BaseResult.getSuccessMessageEntity("获取字段成功", mdmViewVo); } + + /** + * @Author lvleigang + * @Description 根据类型获取字段 + * @Date 9:18 上午 2024/6/6 + * @param viewType 类型 + * @param mdmModuleViewDetailEntities 显示设置的字段 + * @param mdmModuleDbEntityList 表 + * @param mdmModuleDbFiledsEntityList 表字段 + * @param mdmModuleDbFiledsRuleEntityList 字段规则 + * @return java.util.List + **/ + private List getFiledByType(String viewType, List mdmModuleViewDetailEntities, List mdmModuleDbEntityList, List mdmModuleDbFiledsEntityList, List mdmModuleDbFiledsRuleEntityList) { + List mdmViewFiledVos = new ArrayList<>(); + if(mdmModuleViewDetailEntities != null && mdmModuleViewDetailEntities.size() > 0){ + for (int i = 0; i < mdmModuleViewDetailEntities.size(); i++) { + if(viewType.equals(mdmModuleViewDetailEntities.get(i).getViewType())){ + //类型一致 + MdmViewFiledVo mdmViewFiledVo = new MdmViewFiledVo(); + mdmViewFiledVo.setId(mdmModuleViewDetailEntities.get(i).getViewFiled()); + for (int i1 = 0; i1 < mdmModuleDbFiledsEntityList.size(); i1++) { + if(mdmModuleDbFiledsEntityList.get(i1).getId().equals(mdmModuleViewDetailEntities.get(i).getViewFiled())){ + for (int i2 = 0; i2 < mdmModuleDbEntityList.size(); i2++) { + if(mdmModuleDbEntityList.get(i2).getId().equals(mdmModuleDbFiledsEntityList.get(i1).getDbId())){ + mdmViewFiledVo.setDbName(mdmModuleDbEntityList.get(i2).getDbName()); + mdmViewFiledVo.setDbType(mdmModuleDbEntityList.get(i2).getDbType()); + mdmViewFiledVo.setMdmId(mdmModuleDbEntityList.get(i2).getMdmId()); + mdmViewFiledVo.setDbId(mdmModuleDbEntityList.get(i2).getId()); + + break; + } + } + mdmViewFiledVo.setChName(mdmModuleDbFiledsEntityList.get(i1).getChName()); + mdmViewFiledVo.setEnName(mdmModuleDbFiledsEntityList.get(i1).getEnName()); + mdmViewFiledVo.setFiledType(mdmModuleDbFiledsEntityList.get(i1).getFiledType()); + //字段规则 + if(mdmModuleDbFiledsRuleEntityList != null && mdmModuleDbFiledsRuleEntityList.size() > 0){ + List ruleList = new ArrayList<>(); + for (int i2 = 0; i2 < mdmModuleDbFiledsRuleEntityList.size(); i2++) { + if(mdmModuleDbFiledsEntityList.get(i1).getId().equals(mdmModuleDbFiledsRuleEntityList.get(i2).getFiledId())){ + ruleList.add(mdmModuleDbFiledsRuleEntityList.get(i2)); + } + } + mdmViewFiledVo.setRuleList(ruleList); + } + break; + } + } + } + } + } + if(mdmViewFiledVos != null && mdmViewFiledVos.size() > 0){ + for (int i = 0; i < mdmViewFiledVos.size(); i++) { + mdmViewFiledVos.get(i).setSorts(i); + } + } + return mdmViewFiledVos; + } // - ///** - // * @param object - // * @return com.hzya.frame.web.entity.JsonResultEntity - // * @Author lvleigang - // * @Description 主数据查询所有字段 - // * @Date 9:40 上午 2023/10/18 - // **/ - //@Override - //public JsonResultEntity queryMdmShowAll(JSONObject object) { - // MdmDto entity = getData("jsonStr", object, MdmDto.class); - // if (entity == null) { - // return BaseResult.getFailureMessageEntity("参数不允许为空"); - // } - // if (entity.getId() == null || "".equals(entity.getId())) { - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // //查询设置各种类型字段 - // //查询模版数据源 - // MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); - // mdmModuleDbEntity.setMdmId(entity.getId()); - // mdmModuleDbEntity.setSts("Y"); - // List mdmModuleDbEntityList = mdmModuleDbDao.queryBase(mdmModuleDbEntity); - // List listFiled = new ArrayList<>(); - // if (mdmModuleDbEntityList != null && mdmModuleDbEntityList.size() > 0) { - // MdmModuleDbFiledsEntity mdmModuleDbFiledsEntity = new MdmModuleDbFiledsEntity(); - // mdmModuleDbFiledsEntity.setMdmId(entity.getId()); - // mdmModuleDbFiledsEntity.setSts("Y"); - // List mdmModuleDbFiledsEntityList = mdmModuleDbFiledsDao.queryBase(mdmModuleDbFiledsEntity); - // // - // if (mdmModuleDbEntityList != null && mdmModuleDbEntityList.size() > 0) { - // for (int i = 0; i < mdmModuleDbEntityList.size(); i++) { - // if (mdmModuleDbFiledsEntityList != null && mdmModuleDbFiledsEntityList.size() > 0) { - // for (int i1 = 0; i1 < mdmModuleDbFiledsEntityList.size(); i1++) { - // if (mdmModuleDbEntityList.get(i).getId().equals(mdmModuleDbFiledsEntityList.get(i1).getDbId())) { - // if ("1".equals(mdmModuleDbEntityList.get(i).getDbType())) { - // //1、主表 - // listFiled.add(new MdmDbFiledVo(mdmModuleDbFiledsEntityList.get(i1).getId(), "【主表:" + mdmModuleDbEntityList.get(i).getDbName() + "】" + mdmModuleDbFiledsEntityList.get(i1).getChName())); - // } else { - // //2、明细 - // listFiled.add(new MdmDbFiledVo(mdmModuleDbFiledsEntityList.get(i1).getId(), "【子表:" + mdmModuleDbEntityList.get(i).getDbName() + "】" + mdmModuleDbFiledsEntityList.get(i1).getChName())); - // } - // } - // } - // } - // } - // } - // } - // return BaseResult.getSuccessMessageEntity("查询视图成功", listFiled); - //} + /** + * @param object + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 主数据查询所有字段 + * @Date 9:40 上午 2023/10/18 + **/ + @Override + public JsonResultEntity queryMdmShowAll(JSONObject object) { + MdmDto entity = getData("jsonStr", object, MdmDto.class); + if (entity == null) { + return BaseResult.getFailureMessageEntity("参数不允许为空"); + } + if (entity.getMdmCode() == null || "".equals(entity.getMdmCode())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + //查询设置各种类型字段 + MdmModuleEntity mdmModuleEntity = mdmServiceCache.getMdmModuleEntity(entity.getMdmCode()); + //查询模版数据源 + MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); + mdmModuleDbEntity.setMdmId(mdmModuleEntity.getId()); + mdmModuleDbEntity.setSts("Y"); + List mdmModuleDbEntityList = mdmServiceCache.queryMdmModuleDb(mdmModuleDbEntity); + List listFiled = new ArrayList<>(); + if (mdmModuleDbEntityList != null && mdmModuleDbEntityList.size() > 0) { + MdmModuleDbFiledsEntity mdmModuleDbFiledsEntity = new MdmModuleDbFiledsEntity(); + mdmModuleDbFiledsEntity.setMdmId(mdmModuleEntity.getId()); + mdmModuleDbFiledsEntity.setSts("Y"); + List mdmModuleDbFiledsEntityList = mdmServiceCache.queryMdmModuleDbFileds(mdmModuleDbFiledsEntity); + // + if (mdmModuleDbEntityList != null && mdmModuleDbEntityList.size() > 0) { + for (int i = 0; i < mdmModuleDbEntityList.size(); i++) { + if("1".equals(mdmModuleDbEntityList.get(i).getDbType()) || "2".equals(mdmModuleDbEntityList.get(i).getDbType())){ + if (mdmModuleDbFiledsEntityList != null && mdmModuleDbFiledsEntityList.size() > 0) { + for (int i1 = 0; i1 < mdmModuleDbFiledsEntityList.size(); i1++) { + if (mdmModuleDbEntityList.get(i).getId().equals(mdmModuleDbFiledsEntityList.get(i1).getDbId())) { + if ("1".equals(mdmModuleDbEntityList.get(i).getDbType())) { + //1、主表 + listFiled.add(new MdmDbFiledVo(mdmModuleDbFiledsEntityList.get(i1).getId(), "【主表:" + mdmModuleDbEntityList.get(i).getDbName() + "】" + mdmModuleDbFiledsEntityList.get(i1).getChName())); + } else { + //2、明细 + listFiled.add(new MdmDbFiledVo(mdmModuleDbFiledsEntityList.get(i1).getId(), "【子表:" + mdmModuleDbEntityList.get(i).getDbName() + "】" + mdmModuleDbFiledsEntityList.get(i1).getChName())); + } + } + } + } + } + } + } + } + return BaseResult.getSuccessMessageEntity("查询视图成功", listFiled); + } // ///** // * @param mdmModuleRoleButtonEntities @@ -2751,28 +2839,28 @@ public class MdmServiceImpl implements IMdmService { // mdmViewFiledVos.add(mdmViewFiledVo); //} // - ///** - // * @param object - // * @return com.hzya.frame.web.entity.JsonResultEntity - // * @Author lvleigang - // * @Description 主数据列表显示 业务数据 - // * @Date 9:40 上午 2023/10/18 - // **/ - //@Override - //public JsonResultEntity queryMdmShowData(JSONObject object) { - // MdmQuery entity = getData("jsonStr", object, MdmQuery.class); - // if (entity == null) { - // return BaseResult.getFailureMessageEntity("参数不允许为空"); - // } - // //判断分页 - // if (entity == null || entity.getPageNum() == null || entity.getPageSize() == null) { - // return BaseResult.getFailureMessageEntity("分页查询参数不存在"); - // } - // PageHelper.startPage(entity.getPageNum(), entity.getPageSize()); - // List> businessResult = mdmModuleDao.queryMdmShowData(entity); - // PageInfo pageInfo = new PageInfo(businessResult); - // return BaseResult.getSuccessMessageEntity("查询数据成功", pageInfo); - //} + /** + * @param object + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 主数据列表显示 业务数据 + * @Date 9:40 上午 2023/10/18 + **/ + @Override + public JsonResultEntity queryMdmShowData(JSONObject object) { + MdmQuery entity = getData("jsonStr", object, MdmQuery.class); + if (entity == null) { + return BaseResult.getFailureMessageEntity("参数不允许为空"); + } + //判断分页 + if (entity == null || entity.getPageNum() == null || entity.getPageSize() == null) { + return BaseResult.getFailureMessageEntity("分页查询参数不存在"); + } + PageHelper.startPage(entity.getPageNum(), entity.getPageSize()); + List> businessResult = mdmModuleDao.queryMdmShowData(entity); + PageInfo pageInfo = new PageInfo(businessResult); + return BaseResult.getSuccessMessageEntity("查询数据成功", pageInfo); + } // ///** // * @param object @@ -2857,143 +2945,147 @@ public class MdmServiceImpl implements IMdmService { // return BaseResult.getSuccessMessageEntity("查询数据成功", returnData); //} // - ///** - // * @param object - // * @return com.hzya.frame.web.entity.JsonResultEntity - // * @Author lvleigang - // * @Description 查询数据(list 或者 分页) - // * @Date 1:33 下午 2023/7/12 - // **/ - //@Override - //public JsonResultEntity queryTemplateData(JSONObject object) { - // MdmDto entity = getData("jsonStr", object, MdmDto.class); - // //校验是否有servecr传参 - // if (!checkStr(entity.getTableName())) { - // return BaseResult.getFailureMessageEntity("请先传递服务名"); - // } - // if (!checkStr(entity.getValue())) { - // return BaseResult.getFailureMessageEntity("请先传递存储字段"); - // } - // if (!checkStr(entity.getLabel())) { - // return BaseResult.getFailureMessageEntity("请先传递显示字段"); - // } - // if (entity.getPageNum() != null && entity.getPageSize() != null) { - // PageHelper.startPage(entity.getPageNum(), entity.getPageSize()); - // List> mapList = mdmModuleDao.querySelectData(entity); - // PageInfo pageInfo = new PageInfo(mapList); - // return BaseResult.getSuccessMessageEntity("查询数据成功", pageInfo); - // } else { - // List> mapList = mdmModuleDao.querySelectData(entity); - // return BaseResult.getSuccessMessageEntity("查询数据成功", mapList); - // } - //} + /** + * @param object + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 查询数据(list 或者 分页) + * @Date 1:33 下午 2023/7/12 + **/ + @Override + public JsonResultEntity queryTemplateData(JSONObject object) { + MdmDto entity = getData("jsonStr", object, MdmDto.class); + //校验是否有servecr传参 + if (!checkStr(entity.getTableName())) { + return BaseResult.getFailureMessageEntity("请先传递服务名"); + } + if (!checkStr(entity.getValue())) { + return BaseResult.getFailureMessageEntity("请先传递存储字段"); + } + if (!checkStr(entity.getLabel())) { + return BaseResult.getFailureMessageEntity("请先传递显示字段"); + } + if (entity.getPageNum() != null && entity.getPageSize() != null) { + PageHelper.startPage(entity.getPageNum(), entity.getPageSize()); + List> mapList = mdmModuleDao.querySelectData(entity); + PageInfo pageInfo = new PageInfo(mapList); + return BaseResult.getSuccessMessageEntity("查询数据成功", pageInfo); + } else { + List> mapList = mdmModuleDao.querySelectData(entity); + return BaseResult.getSuccessMessageEntity("查询数据成功", mapList); + } + } // - ///** - // * @param object - // * @return com.hzya.frame.web.entity.JsonResultEntity - // * @Author lvleigang - // * @Description 业务数据树形结构,数据查询 - // * @Date 9:40 上午 2023/10/18 - // **/ - //@Override - //public JsonResultEntity queryMdmShowTreeData(JSONObject object) { - // MdmDto entity = getData("jsonStr", object, MdmDto.class); - // if (entity == null) { - // return BaseResult.getFailureMessageEntity("参数不允许为空"); - // } - // //if (entity.getTableName() == null || "".equals(entity.getTableName())) { - // // return BaseResult.getFailureMessageEntity("系统错误"); - // //} - // if (entity.getLabel() == null || "".equals(entity.getLabel())) { - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // if (entity.getUpId() == null || "".equals(entity.getUpId())) { - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // if (entity.getMdmCode() != null && !"".equals(entity.getMdmCode())) { - // //查询模版 - // MdmModuleEntity mdmModuleEntity = new MdmModuleEntity(); - // mdmModuleEntity.setMdmCode(entity.getMdmCode()); - // mdmModuleEntity.setSts("Y"); - // List mdmModuleEntities = mdmModuleDao.queryBase(mdmModuleEntity); - // if (mdmModuleEntities == null || mdmModuleEntities.size() != 1) { - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // //查询数据源主表 - // MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); - // mdmModuleDbEntity.setMdmId(mdmModuleEntities.get(0).getId()); - // mdmModuleDbEntity.setDbType("1"); - // mdmModuleDbEntity.setSts("Y"); - // List mdmModuleDbEntityList = mdmModuleDbDao.queryBase(mdmModuleDbEntity); - // if (mdmModuleDbEntityList == null || mdmModuleDbEntityList.size() == 0) { - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // mdmModuleDbEntity = mdmModuleDbEntityList.get(0); - // entity.setTableName(mdmModuleDbEntity.getDbName()); - // } + /** + * @param object + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 业务数据树形结构,数据查询 + * @Date 9:40 上午 2023/10/18 + **/ + @Override + public JsonResultEntity queryMdmShowTreeData(JSONObject object) { + MdmDto entity = getData("jsonStr", object, MdmDto.class); + if (entity == null) { + return BaseResult.getFailureMessageEntity("参数不允许为空"); + } + //if (entity.getTableName() == null || "".equals(entity.getTableName())) { + // return BaseResult.getFailureMessageEntity("系统错误"); + //} + if (entity.getLabel() == null || "".equals(entity.getLabel())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + if (entity.getUpId() == null || "".equals(entity.getUpId())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + if (entity.getMdmCode() == null || "".equals(entity.getMdmCode())) { + return BaseResult.getFailureMessageEntity("系统错误"); + + } + //查询模版 + MdmModuleEntity mdmModuleEntities = mdmServiceCache.getMdmModuleEntity(entity.getMdmCode()); + if (mdmModuleEntities == null ) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + //查询数据源主表 + MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); + mdmModuleDbEntity.setMdmId(mdmModuleEntities.getId()); + mdmModuleDbEntity.setSts("Y"); + List mdmModuleDbEntityList = mdmServiceCache.queryMdmModuleDb(mdmModuleDbEntity); + if (mdmModuleDbEntityList == null || mdmModuleDbEntityList.size() == 0) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + for (int i = 0; i < mdmModuleDbEntityList.size(); i++) { + if("1".equals(mdmModuleDbEntityList.get(i).getDbType())){ + mdmModuleDbEntity = mdmModuleDbEntityList.get(i); + break; + } + } + entity.setTableName(mdmModuleDbEntity.getDbName()); + + + + if (checkStr(entity.getId())) { + if (!checkStr(entity.getValue())) { + return BaseResult.getFailureMessageEntity("请先传递存储字段"); + } + if (entity.getId().contains(",")) { + String[] strArray = entity.getId().split(","); // 使用逗号和空格作为分隔符 + entity.setIds(strArray); + List> mapList = mdmModuleDao.queryTemplateDataMore(entity); + if (mapList == null || mapList.size() == 0) { + List> returnList = new ArrayList<>(); + return BaseResult.getSuccessMessageEntity("查询数据成功", returnList); + } + List> returnList = gettochilder(strArray, 0, mapList); + return BaseResult.getSuccessMessageEntity("查询数据成功", returnList); + } else { + HashMap mapList = mdmModuleDao.queryTemplateDataOne(entity); + if (mapList == null || mapList.size() == 0) { + List> returnList = new ArrayList<>(); + return BaseResult.getSuccessMessageEntity("查询数据成功", returnList); + } + List> returnList = new ArrayList<>(); + returnList.add(mapList); + return BaseResult.getSuccessMessageEntity("查询数据成功", returnList); + } + } else { + List> mapList = mdmModuleDao.queryDataAll(entity); + List> returnList = new ArrayList<>(); + + if (mapList != null && mapList.size() > 0) { + for (int i = 0; i < mapList.size(); i++) { + //默认为根 + if (mapList.get(i).get(entity.getUpId()) == null || "".equals(mapList.get(i).get(entity.getUpId()))) { + List> children = getchilder(mapList.get(i).get("qsdfg").toString(), mapList, entity); + HashMap re = new HashMap<>(); + re.put("id", mapList.get(i).get("qsdfg")); + re.put("label", mapList.get(i).get(entity.getLabel())); + re.put("upID", mapList.get(i).get(entity.getUpId())); + if (children != null && children.size() > 0) { + re.put("children", children); + } + returnList.add(re); + } + } + } + return BaseResult.getSuccessMessageEntity("查询数据成功", returnList); + } + } // - // - // if (checkStr(entity.getId())) { - // if (!checkStr(entity.getValue())) { - // return BaseResult.getFailureMessageEntity("请先传递存储字段"); - // } - // if (entity.getId().contains(",")) { - // String[] strArray = entity.getId().split(","); // 使用逗号和空格作为分隔符 - // entity.setIds(strArray); - // List> mapList = mdmModuleDao.queryTemplateDataMore(entity); - // if (mapList == null || mapList.size() == 0) { - // List> returnList = new ArrayList<>(); - // return BaseResult.getSuccessMessageEntity("查询数据成功", returnList); - // } - // List> returnList = gettochilder(strArray, 0, mapList); - // return BaseResult.getSuccessMessageEntity("查询数据成功", returnList); - // } else { - // HashMap mapList = mdmModuleDao.queryTemplateDataOne(entity); - // if (mapList == null || mapList.size() == 0) { - // List> returnList = new ArrayList<>(); - // return BaseResult.getSuccessMessageEntity("查询数据成功", returnList); - // } - // List> returnList = new ArrayList<>(); - // returnList.add(mapList); - // return BaseResult.getSuccessMessageEntity("查询数据成功", returnList); - // } - // } else { - // List> mapList = mdmModuleDao.queryDataAll(entity); - // List> returnList = new ArrayList<>(); - // - // if (mapList != null && mapList.size() > 0) { - // for (int i = 0; i < mapList.size(); i++) { - // //默认为根 - // if (mapList.get(i).get(entity.getUpId()) == null || "".equals(mapList.get(i).get(entity.getUpId()))) { - // List> children = getchilder(mapList.get(i).get("qsdfg").toString(), mapList, entity); - // HashMap re = new HashMap<>(); - // re.put("id", mapList.get(i).get("qsdfg")); - // re.put("label", mapList.get(i).get(entity.getLabel())); - // re.put("upID", mapList.get(i).get(entity.getUpId())); - // if (children != null && children.size() > 0) { - // re.put("children", children); - // } - // returnList.add(re); - // } - // } - // } - // return BaseResult.getSuccessMessageEntity("查询数据成功", returnList); - // } - //} - // - //private List> gettochilder(String[] strArray, int i, List> mapList) { - // List> maps = new ArrayList<>(); - // for (int i1 = 0; i1 < mapList.size(); i1++) { - // if (strArray[i].equals(mapList.get(i1).get("id").toString())) { - // if (strArray.length >= (i + 2)) { - // mapList.get(i1).put("children", gettochilder(strArray, i + 1, mapList)); - // } - // maps.add(mapList.get(i1)); - // break; - // } - // } - // return maps; - //} + private List> gettochilder(String[] strArray, int i, List> mapList) { + List> maps = new ArrayList<>(); + for (int i1 = 0; i1 < mapList.size(); i1++) { + if (strArray[i].equals(mapList.get(i1).get("id").toString())) { + if (strArray.length >= (i + 2)) { + mapList.get(i1).put("children", gettochilder(strArray, i + 1, mapList)); + } + maps.add(mapList.get(i1)); + break; + } + } + return maps; + } // //private HashMap getFathers(List> mapListAll, HashMap mapList, MdmDto entity) { // if (mapList.get("upID") == null) { @@ -3018,198 +3110,202 @@ public class MdmServiceImpl implements IMdmService { // return a; //} // - //private List> getchilder(String stringObjectHashMap, List> mapList, MdmDto entity) { - // List> returnList = new ArrayList<>(); - // if (mapList != null && mapList.size() > 0) { - // for (int i = 0; i < mapList.size(); i++) { - // //等于上级id的时候 - // if (stringObjectHashMap.equals(mapList.get(i).get(entity.getUpId()))) { - // List> children = getchilder(mapList.get(i).get(entity.getUpId()) + "," + mapList.get(i).get("qsdfg"), mapList, entity); - // HashMap re = new HashMap<>(); - // re.put("id", mapList.get(i).get("qsdfg")); - // re.put("label", mapList.get(i).get(entity.getLabel())); - // re.put("upID", mapList.get(i).get(entity.getUpId())); - // if (children != null && children.size() > 0) { - // re.put("children", children); - // } - // returnList.add(re); - // } - // } - // } - // return returnList; - //} + private List> getchilder(String stringObjectHashMap, List> mapList, MdmDto entity) { + List> returnList = new ArrayList<>(); + if (mapList != null && mapList.size() > 0) { + for (int i = 0; i < mapList.size(); i++) { + //等于上级id的时候 + if (stringObjectHashMap.equals(mapList.get(i).get(entity.getUpId()))) { + List> children = getchilder(mapList.get(i).get(entity.getUpId()) + "," + mapList.get(i).get("qsdfg"), mapList, entity); + HashMap re = new HashMap<>(); + re.put("id", mapList.get(i).get("qsdfg")); + re.put("label", mapList.get(i).get(entity.getLabel())); + re.put("upID", mapList.get(i).get(entity.getUpId())); + if (children != null && children.size() > 0) { + re.put("children", children); + } + returnList.add(re); + } + } + } + return returnList; + } // - ///** - // * @param object - // * @return com.hzya.frame.web.entity.JsonResultEntity - // * @Author lvleigang - // * @Description 主数据详情 区分类型 新增、修改、查看 - // * @Date 9:40 上午 2023/10/18 - // **/ - //@Override - //public JsonResultEntity queryMdmShowDetails(JSONObject object) { - // MdmDto entity = getData("jsonStr", object, MdmDto.class); - // if (entity == null) { - // return BaseResult.getFailureMessageEntity("参数不允许为空"); - // } - // if (entity.getMdmCode() == null || "".equals(entity.getMdmCode())) { - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // if (entity.getShowType() == null || "".equals(entity.getShowType())) { - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // //查询模版 - // MdmModuleEntity mdmModuleEntity = new MdmModuleEntity(); - // mdmModuleEntity.setMdmCode(entity.getMdmCode()); - // mdmModuleEntity.setSts("Y"); - // List mdmModuleEntities = mdmModuleDao.queryBase(mdmModuleEntity); - // if (mdmModuleEntities == null || mdmModuleEntities.size() != 1) { - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // MdmDetailViewVo mdmViewVo = new MdmDetailViewVo(); - // mdmModuleEntity = mdmModuleEntities.get(0); - // mdmViewVo.setMdmModuleEntity(mdmModuleEntity); - // - // //查询数据源主表 - // MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); - // mdmModuleDbEntity.setMdmId(mdmModuleEntity.getId()); - // mdmModuleDbEntity.setSts("Y"); - // List mdmModuleDbEntityList = mdmModuleDbDao.queryBase(mdmModuleDbEntity); - // if (mdmModuleDbEntityList == null || mdmModuleDbEntityList.size() == 0) { - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // //查询数据源表下面的字段 - // MdmModuleDbFiledsEntity mdmModuleDbFiledsEntity = new MdmModuleDbFiledsEntity(); - // mdmModuleDbFiledsEntity.setMdmId(mdmModuleEntity.getId()); - // mdmModuleDbFiledsEntity.setSts("Y"); - // List mdmModuleDbFiledsEntityList = mdmModuleDbFiledsDao.queryBase(mdmModuleDbFiledsEntity); - // if (mdmModuleDbFiledsEntityList == null || mdmModuleDbFiledsEntityList.size() == 0) { - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // //查询字段下的规则 - // MdmModuleDbFiledsRuleEntity mdmModuleDbFiledsRuleEntity = new MdmModuleDbFiledsRuleEntity(); - // mdmModuleDbFiledsRuleEntity.setMdmId(mdmModuleEntity.getId()); - // mdmModuleDbFiledsRuleEntity.setSts("Y"); - // List mdmModuleDbFiledsRuleEntityList = mdmModuleDbFiledsRuleDao.queryBase(mdmModuleDbFiledsRuleEntity); - // if (mdmModuleDbFiledsRuleEntityList == null || mdmModuleDbFiledsRuleEntityList.size() == 0) { - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // MdmModuleViewDetailEntity mdmModuleViewDetailEntity = new MdmModuleViewDetailEntity(); - // mdmModuleViewDetailEntity.setMdmId(mdmModuleEntity.getId()); - // mdmModuleViewDetailEntity.setSts("Y"); - // mdmModuleViewDetailEntity.setViewType(entity.getShowType());//设置显示字段类型 - // List mdmModuleViewDetailEntityList = mdmModuleViewDetailDao.queryBase(mdmModuleViewDetailEntity); - // //组装数据 - // assembleMdmShowDetails(mdmViewVo, mdmModuleDbEntityList, mdmModuleDbFiledsEntityList, mdmModuleDbFiledsRuleEntityList, mdmModuleViewDetailEntityList, entity.getShowType()); - // return BaseResult.getSuccessMessageEntity("获取字段成功", mdmViewVo); - //} - // - ///** - // * @param mdmViewVo 返回对象 - // * @param mdmModuleDbEntityList 数据源表 - // * @param mdmModuleDbFiledsEntityList 数据源字段 - // * @param mdmModuleDbFiledsRuleEntityList 数据源字段规则 - // * @param mdmModuleViewDetailEntityList 数据源显示字段 - // * @return void - // * @Author lvleigang - // * @Description 组装显示字段 - // * @Date 9:10 上午 2023/11/6 - // **/ - //private void assembleMdmShowDetails(MdmDetailViewVo mdmViewVo, List mdmModuleDbEntityList, List mdmModuleDbFiledsEntityList, List mdmModuleDbFiledsRuleEntityList, List mdmModuleViewDetailEntityList, String showType) { - // //主数据主表 - // MdmModuleDbEntity mainMdmModuleDb = new MdmModuleDbEntity(); - // List mainMdmModuleDbFileds = new ArrayList<>(); - // //主数据子表 - // List sublistMdmModuleDb = new ArrayList<>(); - // - // if (mdmModuleViewDetailEntityList != null && mdmModuleViewDetailEntityList.size() > 0) { - // //先循环数据源表,设置出数据字段 - // for (int i = 0; i < mdmModuleDbEntityList.size(); i++) { - // if ("1".equals(mdmModuleDbEntityList.get(i).getDbType())) { - // //1、主表 2、明细 - // mainMdmModuleDb = mdmModuleDbEntityList.get(i); - // //循环字段表 - // if (mdmModuleDbFiledsEntityList != null && mdmModuleDbFiledsEntityList.size() > 0) { - // for (int i1 = 0; i1 < mdmModuleDbFiledsEntityList.size(); i1++) { - // if (mdmModuleDbEntityList.get(i).getId().equals(mdmModuleDbFiledsEntityList.get(i1).getDbId())) { - // for (int b = 0; b < mdmModuleViewDetailEntityList.size(); b++) { - // if (mdmModuleViewDetailEntityList.get(b).getViewFiled().equals(mdmModuleDbFiledsEntityList.get(i1).getId())) { - // mainMdmModuleDbFileds.add(mdmModuleDbFiledsEntityList.get(i1)); - // List mdmModuleDbFiledsRules = new ArrayList<>(); - // //循环字段属性 - // if (mdmModuleDbFiledsRuleEntityList != null && mdmModuleDbFiledsRuleEntityList.size() > 0) { - // for (int i2 = 0; i2 < mdmModuleDbFiledsRuleEntityList.size(); i2++) { - // if (mdmModuleDbFiledsEntityList.get(i1).getDbId().equals(mdmModuleDbFiledsRuleEntityList.get(i2).getDbId()) - // && mdmModuleDbFiledsEntityList.get(i1).getId().equals(mdmModuleDbFiledsRuleEntityList.get(i2).getFiledId())) { - // mdmModuleDbFiledsRules.add(mdmModuleDbFiledsRuleEntityList.get(i2)); - // } - // } - // } - // mdmModuleDbFiledsEntityList.get(i1).setMdmModuleDbFiledsRules(mdmModuleDbFiledsRules); - // } - // } - // } - // } - // } - // } else if ("2".equals(mdmModuleDbEntityList.get(i).getDbType())) { - // //2、明细 - // sublistMdmModuleDb.add(mdmModuleDbEntityList.get(i)); - // //循环字段表 - // if (mdmModuleDbFiledsEntityList != null && mdmModuleDbFiledsEntityList.size() > 0) { - // List sublistMdmModuleDbFileds = new ArrayList<>(); - // for (int i1 = 0; i1 < mdmModuleDbFiledsEntityList.size(); i1++) { - // if (mdmModuleDbEntityList.get(i).getId().equals(mdmModuleDbFiledsEntityList.get(i1).getDbId())) { - // for (int b = 0; b < mdmModuleViewDetailEntityList.size(); b++) { - // if (mdmModuleViewDetailEntityList.get(b).getViewFiled().equals(mdmModuleDbFiledsEntityList.get(i1).getId())) { - // sublistMdmModuleDbFileds.add(mdmModuleDbFiledsEntityList.get(i1)); - // List mdmModuleDbFiledsRules = new ArrayList<>(); - // //循环字段属性 - // if (mdmModuleDbFiledsRuleEntityList != null && mdmModuleDbFiledsRuleEntityList.size() > 0) { - // for (int i2 = 0; i2 < mdmModuleDbFiledsRuleEntityList.size(); i2++) { - // if (mdmModuleDbFiledsEntityList.get(i1).getDbId().equals(mdmModuleDbFiledsRuleEntityList.get(i2).getDbId()) - // && mdmModuleDbFiledsEntityList.get(i1).getId().equals(mdmModuleDbFiledsRuleEntityList.get(i2).getFiledId())) { - // mdmModuleDbFiledsRules.add(mdmModuleDbFiledsRuleEntityList.get(i2)); - // } - // } - // } - // mdmModuleDbFiledsEntityList.get(i1).setMdmModuleDbFiledsRules(mdmModuleDbFiledsRules); - // } - // } - // - // } - // } - // mdmModuleDbEntityList.get(i).setSublistMdmModuleDbFileds(sublistMdmModuleDbFileds); - // } - // } - // } - // mainMdmModuleDb.setSublistMdmModuleDbFileds(mainMdmModuleDbFileds); - // mdmViewVo.setMainMdmModuleDb(mainMdmModuleDb); - // //主数据子表 - // List mdmModuleDb = new ArrayList<>(); - // if (sublistMdmModuleDb != null && sublistMdmModuleDb.size() > 0) { - // for (int i = 0; i < sublistMdmModuleDb.size(); i++) { - // if (sublistMdmModuleDb.get(i).getSublistMdmModuleDbFileds() != null && sublistMdmModuleDb.get(i).getSublistMdmModuleDbFileds().size() > 0) { - // mdmModuleDb.add(sublistMdmModuleDb.get(i)); - // } - // } - // } - // if ("5".equals(showType)) { - // MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); - // mdmModuleDbEntity.setDbName(mainMdmModuleDb.getDbName() + "_distribute"); - // mdmModuleDbEntity.setRemark(mainMdmModuleDb.getRemark() + "分发表"); - // mdmModuleDbEntity.setDbType("2"); - // List mdmModuleDbFiledsEntityList1 = getDistributeRole(); - // mdmModuleDbEntity.setSublistMdmModuleDbFileds(mdmModuleDbFiledsEntityList1); - // mdmModuleDb.add(mdmModuleDbEntity); - // } - // mdmViewVo.setSublistMdmModuleDb(mdmModuleDb); - // - // - // } else { - // mdmViewVo.setMainMdmModuleDb(mainMdmModuleDb); - // mdmViewVo.setSublistMdmModuleDb(sublistMdmModuleDb); - // } - //} + /** + * @param object + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 主数据详情 区分类型 新增、修改、查看 + * @Date 9:40 上午 2023/10/18 + **/ + @Override + public JsonResultEntity queryMdmShowDetails(JSONObject object) { + MdmDto entity = getData("jsonStr", object, MdmDto.class); + if (entity == null) { + return BaseResult.getFailureMessageEntity("参数不允许为空"); + } + if (entity.getMdmCode() == null || "".equals(entity.getMdmCode())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + if (entity.getShowType() == null || "".equals(entity.getShowType())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + //查询模版 + //List mdmModuleEntities = mdmModuleDao.queryBase(mdmModuleEntity); + MdmModuleEntity mdmModuleEntities = mdmServiceCache.getMdmModuleEntity(entity.getMdmCode()); + if (mdmModuleEntities == null) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + MdmDetailViewVo mdmViewVo = new MdmDetailViewVo(); + mdmViewVo.setMdmModuleEntity(mdmModuleEntities); + + //查询数据源主表 + MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); + mdmModuleDbEntity.setMdmId(mdmModuleEntities.getId()); + mdmModuleDbEntity.setSts("Y"); + List mdmModuleDbEntityList = mdmServiceCache.queryMdmModuleDb(mdmModuleDbEntity); + if (mdmModuleDbEntityList == null || mdmModuleDbEntityList.size() == 0) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + //查询数据源表下面的字段 + MdmModuleDbFiledsEntity mdmModuleDbFiledsEntity = new MdmModuleDbFiledsEntity(); + mdmModuleDbFiledsEntity.setMdmId(mdmModuleEntities.getId()); + mdmModuleDbFiledsEntity.setSts("Y"); + List mdmModuleDbFiledsEntityList = mdmServiceCache.queryMdmModuleDbFileds(mdmModuleDbFiledsEntity); + if (mdmModuleDbFiledsEntityList == null || mdmModuleDbFiledsEntityList.size() == 0) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + //查询字段下的规则 + MdmModuleDbFiledsRuleEntity mdmModuleDbFiledsRuleEntity = new MdmModuleDbFiledsRuleEntity(); + mdmModuleDbFiledsRuleEntity.setMdmId(mdmModuleEntities.getId()); + mdmModuleDbFiledsRuleEntity.setSts("Y"); + List mdmModuleDbFiledsRuleEntityList = mdmServiceCache.queryMdmModuleDbFiledsRule(mdmModuleDbFiledsRuleEntity); + if (mdmModuleDbFiledsRuleEntityList == null || mdmModuleDbFiledsRuleEntityList.size() == 0) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + MdmModuleViewDetailEntity mdmModuleViewDetailEntity = new MdmModuleViewDetailEntity(); + mdmModuleViewDetailEntity.setMdmId(mdmModuleEntities.getId()); + mdmModuleViewDetailEntity.setSts("Y"); + mdmModuleViewDetailEntity.setViewType(entity.getShowType());//设置显示字段类型 + List queryAll = mdmModuleViewDetailDao.queryBase(mdmModuleViewDetailEntity); + List mdmModuleViewDetailEntityList = new ArrayList<>(); + if(queryAll != null && queryAll.size() > 0){ + for (int i = 0; i < queryAll.size(); i++) { + if(entity.getShowType().equals(queryAll.get(i).getViewType())){ + mdmModuleViewDetailEntityList.add(queryAll.get(i)); + } + } + } + //组装数据 + assembleMdmShowDetails(mdmViewVo, mdmModuleDbEntityList, mdmModuleDbFiledsEntityList, mdmModuleDbFiledsRuleEntityList, mdmModuleViewDetailEntityList, entity.getShowType()); + return BaseResult.getSuccessMessageEntity("获取字段成功", mdmViewVo); + } + + /** + * @param mdmViewVo 返回对象 + * @param mdmModuleDbEntityList 数据源表 + * @param mdmModuleDbFiledsEntityList 数据源字段 + * @param mdmModuleDbFiledsRuleEntityList 数据源字段规则 + * @param mdmModuleViewDetailEntityList 数据源显示字段 + * @return void + * @Author lvleigang + * @Description 组装显示字段 + * @Date 9:10 上午 2023/11/6 + **/ + private void assembleMdmShowDetails(MdmDetailViewVo mdmViewVo, List mdmModuleDbEntityList, List mdmModuleDbFiledsEntityList, List mdmModuleDbFiledsRuleEntityList, List mdmModuleViewDetailEntityList, String showType) { + //主数据主表 + MdmModuleDbEntity mainMdmModuleDb = new MdmModuleDbEntity(); + List mainMdmModuleDbFileds = new ArrayList<>(); + //主数据子表 + List sublistMdmModuleDb = new ArrayList<>(); + + if (mdmModuleViewDetailEntityList != null && mdmModuleViewDetailEntityList.size() > 0) { + //先循环数据源表,设置出数据字段 + for (int i = 0; i < mdmModuleDbEntityList.size(); i++) { + if ("1".equals(mdmModuleDbEntityList.get(i).getDbType())) { + //1、主表 2、明细 + mainMdmModuleDb = mdmModuleDbEntityList.get(i); + //循环字段表 + if (mdmModuleDbFiledsEntityList != null && mdmModuleDbFiledsEntityList.size() > 0) { + for (int i1 = 0; i1 < mdmModuleDbFiledsEntityList.size(); i1++) { + if (mdmModuleDbEntityList.get(i).getId().equals(mdmModuleDbFiledsEntityList.get(i1).getDbId())) { + for (int b = 0; b < mdmModuleViewDetailEntityList.size(); b++) { + if (mdmModuleViewDetailEntityList.get(b).getViewFiled().equals(mdmModuleDbFiledsEntityList.get(i1).getId())) { + mainMdmModuleDbFileds.add(mdmModuleDbFiledsEntityList.get(i1)); + List mdmModuleDbFiledsRules = new ArrayList<>(); + //循环字段属性 + if (mdmModuleDbFiledsRuleEntityList != null && mdmModuleDbFiledsRuleEntityList.size() > 0) { + for (int i2 = 0; i2 < mdmModuleDbFiledsRuleEntityList.size(); i2++) { + if (mdmModuleDbFiledsEntityList.get(i1).getDbId().equals(mdmModuleDbFiledsRuleEntityList.get(i2).getDbId()) + && mdmModuleDbFiledsEntityList.get(i1).getId().equals(mdmModuleDbFiledsRuleEntityList.get(i2).getFiledId())) { + mdmModuleDbFiledsRules.add(mdmModuleDbFiledsRuleEntityList.get(i2)); + } + } + } + mdmModuleDbFiledsEntityList.get(i1).setMdmModuleDbFiledsRules(mdmModuleDbFiledsRules); + } + } + } + } + } + } else if ("2".equals(mdmModuleDbEntityList.get(i).getDbType())) { + //2、明细 + sublistMdmModuleDb.add(mdmModuleDbEntityList.get(i)); + //循环字段表 + if (mdmModuleDbFiledsEntityList != null && mdmModuleDbFiledsEntityList.size() > 0) { + List sublistMdmModuleDbFileds = new ArrayList<>(); + for (int i1 = 0; i1 < mdmModuleDbFiledsEntityList.size(); i1++) { + if (mdmModuleDbEntityList.get(i).getId().equals(mdmModuleDbFiledsEntityList.get(i1).getDbId())) { + for (int b = 0; b < mdmModuleViewDetailEntityList.size(); b++) { + if (mdmModuleViewDetailEntityList.get(b).getViewFiled().equals(mdmModuleDbFiledsEntityList.get(i1).getId())) { + sublistMdmModuleDbFileds.add(mdmModuleDbFiledsEntityList.get(i1)); + List mdmModuleDbFiledsRules = new ArrayList<>(); + //循环字段属性 + if (mdmModuleDbFiledsRuleEntityList != null && mdmModuleDbFiledsRuleEntityList.size() > 0) { + for (int i2 = 0; i2 < mdmModuleDbFiledsRuleEntityList.size(); i2++) { + if (mdmModuleDbFiledsEntityList.get(i1).getDbId().equals(mdmModuleDbFiledsRuleEntityList.get(i2).getDbId()) + && mdmModuleDbFiledsEntityList.get(i1).getId().equals(mdmModuleDbFiledsRuleEntityList.get(i2).getFiledId())) { + mdmModuleDbFiledsRules.add(mdmModuleDbFiledsRuleEntityList.get(i2)); + } + } + } + mdmModuleDbFiledsEntityList.get(i1).setMdmModuleDbFiledsRules(mdmModuleDbFiledsRules); + } + } + + } + } + mdmModuleDbEntityList.get(i).setSublistMdmModuleDbFileds(sublistMdmModuleDbFileds); + } + } + } + mainMdmModuleDb.setSublistMdmModuleDbFileds(mainMdmModuleDbFileds); + mdmViewVo.setMainMdmModuleDb(mainMdmModuleDb); + //主数据子表 + List mdmModuleDb = new ArrayList<>(); + if (sublistMdmModuleDb != null && sublistMdmModuleDb.size() > 0) { + for (int i = 0; i < sublistMdmModuleDb.size(); i++) { + if (sublistMdmModuleDb.get(i).getSublistMdmModuleDbFileds() != null && sublistMdmModuleDb.get(i).getSublistMdmModuleDbFileds().size() > 0) { + mdmModuleDb.add(sublistMdmModuleDb.get(i)); + } + } + } + //if ("5".equals(showType)) { + // MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); + // mdmModuleDbEntity.setDbName(mainMdmModuleDb.getDbName() + "_distribute"); + // mdmModuleDbEntity.setRemark(mainMdmModuleDb.getRemark() + "分发表"); + // mdmModuleDbEntity.setDbType("2"); + // List mdmModuleDbFiledsEntityList1 = getDistributeRole(); + // mdmModuleDbEntity.setSublistMdmModuleDbFileds(mdmModuleDbFiledsEntityList1); + // mdmModuleDb.add(mdmModuleDbEntity); + //} + mdmViewVo.setSublistMdmModuleDb(mdmModuleDb); + + } else { + mdmViewVo.setMainMdmModuleDb(mainMdmModuleDb); + mdmViewVo.setSublistMdmModuleDb(sublistMdmModuleDb); + } + } // //private List getDistributeRole() { // List mdmModuleDbFiledsEntityList = new ArrayList<>(); @@ -3389,248 +3485,239 @@ public class MdmServiceImpl implements IMdmService { // } //} // - ///** - // * @param object - // * @return com.hzya.frame.web.entity.JsonResultEntity - // * @Author lvleigang - // * @Description 主数据详情数据 区分类型 新增、修改、查看 - // * @Date 9:40 上午 2023/10/18 - // **/ - //@Override - //public JsonResultEntity queryMdmShowDetailsData(JSONObject object) { - // MdmDto entity = getData("jsonStr", object, MdmDto.class); - // if (entity == null) { - // return BaseResult.getFailureMessageEntity("参数不允许为空"); - // } - // if (entity.getMdmCode() == null || "".equals(entity.getMdmCode())) { - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // if (entity.getId() == null || "".equals(entity.getId())) { - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // //查询模版 - // MdmModuleEntity mdmModuleEntity = new MdmModuleEntity(); - // mdmModuleEntity.setMdmCode(entity.getMdmCode()); - // mdmModuleEntity.setSts("Y"); - // List mdmModuleEntities = mdmModuleDao.queryBase(mdmModuleEntity); - // if (mdmModuleEntities == null || mdmModuleEntities.size() != 1) { - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // mdmModuleEntity = mdmModuleEntities.get(0); - // //查询数据源主表 - // MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); - // mdmModuleDbEntity.setMdmId(mdmModuleEntity.getId()); - // mdmModuleDbEntity.setSts("Y"); - // List mdmModuleDbEntityList = mdmModuleDbDao.queryBase(mdmModuleDbEntity); - // if (mdmModuleDbEntityList == null || mdmModuleDbEntityList.size() == 0) { - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // String tablename = null; - // JSONObject jsonObject = new JSONObject(); - // for (int i = 0; i < mdmModuleDbEntityList.size(); i++) { - // //查询数据 - // Map queryData = new HashMap<>(); - // queryData.put("tableName", mdmModuleDbEntityList.get(i).getDbName());//表名 - // if ("1".equals(mdmModuleDbEntityList.get(i).getDbType())) { - // queryData.put("detailFlag", false);//是否明细 - // queryData.put("id", entity.getId());//字段 - // HashMap datas = mdmModuleDbDao.getServiceDataById(queryData); - // jsonObject.put(mdmModuleDbEntityList.get(i).getDbName(), datas); - // tablename = mdmModuleDbEntityList.get(i).getDbName() + "_distribute"; - // } else { - // queryData.put("detailFlag", true);//是否明细 - // queryData.put("id", entity.getId());//字段 - // List> datas = mdmModuleDbDao.getServiceByFormmainId(queryData); - // jsonObject.put(mdmModuleDbEntityList.get(i).getDbName(), datas); - // } - // } - // if (tablename != null && !"".equals(tablename)) { - // Map queryData = new HashMap<>(); - // queryData.put("tableName", tablename);//表名 - // queryData.put("id", entity.getId());//字段 - // List> datas = mdmModuleDbDao.getServiceByDistributeId(queryData); - // jsonObject.put(tablename, datas); - // } + /** + * @param object + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 主数据详情数据 区分类型 新增、修改、查看 + * @Date 9:40 上午 2023/10/18 + **/ + @Override + public JsonResultEntity queryMdmShowDetailsData(JSONObject object) { + MdmDto entity = getData("jsonStr", object, MdmDto.class); + if (entity == null) { + return BaseResult.getFailureMessageEntity("参数不允许为空"); + } + if (entity.getMdmCode() == null || "".equals(entity.getMdmCode())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + if (entity.getId() == null || "".equals(entity.getId())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + //查询模版 + + MdmModuleEntity mdmModuleEntity = mdmServiceCache.getMdmModuleEntity(entity.getMdmCode()); + if (mdmModuleEntity == null ) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + //查询数据源主表 + MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); + mdmModuleDbEntity.setMdmId(mdmModuleEntity.getId()); + mdmModuleDbEntity.setSts("Y"); + List mdmModuleDbEntityList = mdmServiceCache.queryMdmModuleDb(mdmModuleDbEntity); + if (mdmModuleDbEntityList == null || mdmModuleDbEntityList.size() == 0) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + String tablename = null; + JSONObject jsonObject = new JSONObject(); + for (int i = 0; i < mdmModuleDbEntityList.size(); i++) { + //查询数据 + Map queryData = new HashMap<>(); + queryData.put("tableName", mdmModuleDbEntityList.get(i).getDbName());//表名 + if ("1".equals(mdmModuleDbEntityList.get(i).getDbType())) { + queryData.put("detailFlag", false);//是否明细 + queryData.put("id", entity.getId());//字段 + HashMap datas = mdmModuleDbDao.getServiceDataById(queryData); + jsonObject.put(mdmModuleDbEntityList.get(i).getDbName(), datas); + tablename = mdmModuleDbEntityList.get(i).getDbName() + "_distribute"; + } else { + queryData.put("detailFlag", true);//是否明细 + queryData.put("id", entity.getId());//字段 + List> datas = mdmModuleDbDao.getServiceByFormmainId(queryData); + jsonObject.put(mdmModuleDbEntityList.get(i).getDbName(), datas); + } + } + if (tablename != null && !"".equals(tablename)) { + Map queryData = new HashMap<>(); + queryData.put("tableName", tablename);//表名 + queryData.put("id", entity.getId());//字段 + List> datas = mdmModuleDbDao.getServiceByDistributeId(queryData); + jsonObject.put(tablename, datas); + } + + + return BaseResult.getSuccessMessageEntity("获取数据成功", jsonObject); + } + /** + * @param object + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 主数据详情数据修改 + * @Date 9:40 上午 2023/10/18 + **/ + @Override + public JsonResultEntity updateMdmShowDetailsData(JSONObject object) { + JSONObject jsonObject = getstrObj("jsonStr", object); + //校验是否有servecr传参 + if (!checkData(jsonObject, "mdmCode")) { + return BaseResult.getFailureMessageEntity("请先传递服务名"); + } + if (!checkData(jsonObject, "data")) { + return BaseResult.getFailureMessageEntity("请先传递要修改的数据"); + } + JSONObject saveData = jsonObject.getJSONObject("data"); + //校验唯一 + MdmModuleEntity mdmModuleEntity = new MdmModuleEntity(); + mdmModuleEntity.setMdmCode(jsonObject.getLong("mdmCode")); + mdmModuleEntity.setSts("Y"); + List mdmModuleEntities = mdmModuleDao.queryBase(mdmModuleEntity); + if (mdmModuleEntities == null || mdmModuleEntities.size() != 1) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + mdmModuleEntity = mdmModuleEntities.get(0); + MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); + mdmModuleDbEntity.setMdmId(mdmModuleEntity.getId()); + mdmModuleDbEntity.setSts("Y"); + List mdmModuleDbEntityList = mdmModuleDbDao.queryBase(mdmModuleDbEntity); + if (mdmModuleDbEntityList == null || mdmModuleDbEntityList.size() == 0) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + String res = checkDataOnly(jsonObject.getInteger("mdmCode"), saveData, true, mdmModuleEntity, mdmModuleDbEntityList); + + if (res == null || "".equals(res)) { + return BaseResult.getSuccessMessageEntity("修改数据成功"); + } else { + return BaseResult.getFailureMessageEntity(res); + } + } + + + /** + * @param object + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 主数据详情数据新增 + * @Date 9:40 上午 2023/10/18 + **/ + @Override + public JsonResultEntity saveMdmShowDetailsData(JSONObject object) { + JSONObject jsonObject = getstrObj("jsonStr", object); + //校验是否有servecr传参 + if (!checkData(jsonObject, "mdmCode")) { + return BaseResult.getFailureMessageEntity("请先传递服务名"); + } + if (!checkData(jsonObject, "data")) { + return BaseResult.getFailureMessageEntity("请先传递要修改的数据"); + } + JSONObject saveData = jsonObject.getJSONObject("data"); + //校验唯一 + MdmModuleEntity mdmModuleEntity = new MdmModuleEntity(); + mdmModuleEntity.setMdmCode(jsonObject.getLong("mdmCode")); + mdmModuleEntity.setSts("Y"); + List mdmModuleEntities = mdmModuleDao.queryBase(mdmModuleEntity); + if (mdmModuleEntities == null || mdmModuleEntities.size() != 1) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + mdmModuleEntity = mdmModuleEntities.get(0); + MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); + mdmModuleDbEntity.setMdmId(mdmModuleEntity.getId()); + mdmModuleDbEntity.setSts("Y"); + List mdmModuleDbEntityList = mdmModuleDbDao.queryBase(mdmModuleDbEntity); + if (mdmModuleDbEntityList == null || mdmModuleDbEntityList.size() == 0) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + String res = checkDataOnly(jsonObject.getInteger("mdmCode"), saveData, false, mdmModuleEntity, mdmModuleDbEntityList); + + if (res == null || "".equals(res)) { + return BaseResult.getSuccessMessageEntity("保存数据成功"); + } else { + return BaseResult.getFailureMessageEntity(res); + } + } // // - // return BaseResult.getSuccessMessageEntity("获取数据成功", jsonObject); - //} - // - // - ///** - // * @param object - // * @return com.hzya.frame.web.entity.JsonResultEntity - // * @Author lvleigang - // * @Description 主数据详情数据修改 - // * @Date 9:40 上午 2023/10/18 - // **/ - //@Override - //public JsonResultEntity updateMdmShowDetailsData(JSONObject object) { - // JSONObject jsonObject = getstrObj("jsonStr", object); - // //校验是否有servecr传参 - // if (!checkData(jsonObject, "mdmCode")) { - // return BaseResult.getFailureMessageEntity("请先传递服务名"); - // } - // if (!checkData(jsonObject, "data")) { - // return BaseResult.getFailureMessageEntity("请先传递要修改的数据"); - // } - // JSONObject saveData = jsonObject.getJSONObject("data"); - // //校验唯一 - // MdmModuleEntity mdmModuleEntity = new MdmModuleEntity(); - // mdmModuleEntity.setMdmCode(jsonObject.getInteger("mdmCode")); - // mdmModuleEntity.setSts("Y"); - // List mdmModuleEntities = mdmModuleDao.queryBase(mdmModuleEntity); - // if (mdmModuleEntities == null || mdmModuleEntities.size() != 1) { - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // mdmModuleEntity = mdmModuleEntities.get(0); - // MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); - // mdmModuleDbEntity.setMdmId(mdmModuleEntity.getId()); - // mdmModuleDbEntity.setSts("Y"); - // List mdmModuleDbEntityList = mdmModuleDbDao.queryBase(mdmModuleDbEntity); - // if (mdmModuleDbEntityList == null || mdmModuleDbEntityList.size() == 0) { - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // String res = checkDataOnly(jsonObject.getInteger("mdmCode"), saveData, true, mdmModuleEntity, mdmModuleDbEntityList); - // - // if (res == null || "".equals(res)) { - // return BaseResult.getSuccessMessageEntity("修改数据成功"); - // } else { - // return BaseResult.getFailureMessageEntity(res); - // } - //} - // - // - ///** - // * @param object - // * @return com.hzya.frame.web.entity.JsonResultEntity - // * @Author lvleigang - // * @Description 主数据详情数据新增 - // * @Date 9:40 上午 2023/10/18 - // **/ - //@Override - //public JsonResultEntity saveMdmShowDetailsData(JSONObject object) { - // JSONObject jsonObject = getstrObj("jsonStr", object); - // //校验是否有servecr传参 - // if (!checkData(jsonObject, "mdmCode")) { - // return BaseResult.getFailureMessageEntity("请先传递服务名"); - // } - // if (!checkData(jsonObject, "data")) { - // return BaseResult.getFailureMessageEntity("请先传递要修改的数据"); - // } - // JSONObject saveData = jsonObject.getJSONObject("data"); - // //校验唯一 - // MdmModuleEntity mdmModuleEntity = new MdmModuleEntity(); - // mdmModuleEntity.setMdmCode(jsonObject.getInteger("mdmCode")); - // mdmModuleEntity.setSts("Y"); - // List mdmModuleEntities = mdmModuleDao.queryBase(mdmModuleEntity); - // if (mdmModuleEntities == null || mdmModuleEntities.size() != 1) { - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // mdmModuleEntity = mdmModuleEntities.get(0); - // MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); - // mdmModuleDbEntity.setMdmId(mdmModuleEntity.getId()); - // mdmModuleDbEntity.setSts("Y"); - // List mdmModuleDbEntityList = mdmModuleDbDao.queryBase(mdmModuleDbEntity); - // if (mdmModuleDbEntityList == null || mdmModuleDbEntityList.size() == 0) { - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // String res = checkDataOnly(jsonObject.getInteger("mdmCode"), saveData, false, mdmModuleEntity, mdmModuleDbEntityList); - // - // if (res == null || "".equals(res)) { - // return BaseResult.getSuccessMessageEntity("保存数据成功"); - // } else { - // return BaseResult.getFailureMessageEntity(res); - // } - //} - // - // - ///** - // * @param object - // * @return com.hzya.frame.web.entity.JsonResultEntity - // * @Author lvleigang - // * @Description 主数据详情数据修改 - // * @Date 9:40 上午 2023/10/18 - // **/ - //@Override - //public JsonResultEntity deleteMdmShowDetailsData(JSONObject object) { - // JSONObject jsonObject = getstrObj("jsonStr", object); - // //校验是否有servecr传参 - // if (!checkData(jsonObject, "mdmCode")) { - // return BaseResult.getFailureMessageEntity("请先传递服务名"); - // } - // if (!checkData(jsonObject, "id")) { - // return BaseResult.getFailureMessageEntity("请先传递要删除的数据"); - // } - // //校验唯一 - // MdmModuleEntity mdmModuleEntity = new MdmModuleEntity(); - // mdmModuleEntity.setMdmCode(jsonObject.getInteger("mdmCode")); - // mdmModuleEntity.setSts("Y"); - // List mdmModuleEntities = mdmModuleDao.queryBase(mdmModuleEntity); - // if (mdmModuleEntities == null || mdmModuleEntities.size() != 1) { - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // mdmModuleEntity = mdmModuleEntities.get(0); - // MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); - // mdmModuleDbEntity.setMdmId(mdmModuleEntity.getId()); - // mdmModuleDbEntity.setSts("Y"); - // List mdmModuleDbEntityList = mdmModuleDbDao.queryBase(mdmModuleDbEntity); - // if (mdmModuleDbEntityList == null || mdmModuleDbEntityList.size() == 0) { - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // for (int i = 0; i < mdmModuleDbEntityList.size(); i++) { - // if ("1".equals(mdmModuleDbEntityList.get(i).getDbType())) { - // - // //查询视图,如果树形,删除下级及子集 - // //查询展示类型 - // MdmModuleViewEntity mdmModuleViewEntity = new MdmModuleViewEntity(); - // mdmModuleViewEntity.setMdmId(mdmModuleEntity.getId()); - // mdmModuleViewEntity.setSts("Y"); - // List moduleViewEntityList = mdmModuleViewDao.queryBase(mdmModuleViewEntity); - // if (moduleViewEntityList == null || moduleViewEntityList.size() != 1) { - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // mdmModuleViewEntity = moduleViewEntityList.get(0); - // - // - // //删除自己 - // FormmainDeleteDto formmainDeleteDto = new FormmainDeleteDto(); - // formmainDeleteDto.setId(jsonObject.getString("id")); - // formmainDeleteDto.setLoginId(StpUtil.getLoginIdAsString()); - // formmainDeleteDto.setTableName(mdmModuleDbEntityList.get(i).getDbName()); - // if (mdmModuleViewEntity != null && mdmModuleViewEntity.getViewName() != null && "1".equals(mdmModuleViewEntity.getViewName()) && - // mdmModuleViewEntity.getUpIdFiled() != null && !"".equals(mdmModuleViewEntity.getUpIdFiled())) { - // formmainDeleteDto.setUpIdFiled(mdmModuleViewEntity.getUpIdFiled()); - // - // Map queryData = new HashMap<>(); - // queryData.put("tableName", mdmModuleDbEntityList.get(i).getDbName());//表名 - // queryData.put("detailFlag", false);//是否明细 - // queryData.put("id", jsonObject.getString("id"));//字段 - // HashMap datas = mdmModuleDbDao.getServiceDataById(queryData); - // String upValue = null; - // if (datas != null && datas.get(mdmModuleViewEntity.getUpIdFiled()) != null) { - // upValue = datas.get(mdmModuleViewEntity.getUpIdFiled()).toString(); - // } - // if (upValue != null) { - // formmainDeleteDto.setUpIdFiledValue(upValue + "," + jsonObject.getString("id")); - // } else { - // formmainDeleteDto.setUpIdFiledValue(jsonObject.getString("id")); - // } - // mdmModuleDao.deleteChilder(formmainDeleteDto); - // } - // mdmModuleDao.deleteTemplateById(formmainDeleteDto); - // - // } else { - // //删除明细 - // FormmainDeleteDto formmainDeleteDto = new FormmainDeleteDto(); - // formmainDeleteDto.setFormmain_id(jsonObject.getString("id")); - // formmainDeleteDto.setLoginId(StpUtil.getLoginIdAsString()); - // formmainDeleteDto.setTableName(mdmModuleDbEntityList.get(i).getDbName()); - // mdmModuleDao.deleteTemplateById(formmainDeleteDto); - // } - // } - // return BaseResult.getSuccessMessageEntity("删除数据成功"); - //} + /** + * @param object + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 主数据详情数据修改 + * @Date 9:40 上午 2023/10/18 + **/ + @Override + public JsonResultEntity deleteMdmShowDetailsData(JSONObject object) { + JSONObject jsonObject = getstrObj("jsonStr", object); + //校验是否有servecr传参 + if (!checkData(jsonObject, "mdmCode")) { + return BaseResult.getFailureMessageEntity("请先传递服务名"); + } + if (!checkData(jsonObject, "id")) { + return BaseResult.getFailureMessageEntity("请先传递要删除的数据"); + } + //校验唯一 + MdmModuleEntity mdmModuleEntity = mdmServiceCache.getMdmModuleEntity(jsonObject.getLong("mdmCode")); + if (mdmModuleEntity == null ) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); + mdmModuleDbEntity.setMdmId(mdmModuleEntity.getId()); + mdmModuleDbEntity.setSts("Y"); + List mdmModuleDbEntityList = mdmServiceCache.queryMdmModuleDb(mdmModuleDbEntity); + if (mdmModuleDbEntityList == null || mdmModuleDbEntityList.size() == 0) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + for (int i = 0; i < mdmModuleDbEntityList.size(); i++) { + if ("1".equals(mdmModuleDbEntityList.get(i).getDbType())) { + + //查询视图,如果树形,删除下级及子集 + //查询展示类型 + MdmModuleViewEntity mdmModuleViewEntity = new MdmModuleViewEntity(); + mdmModuleViewEntity.setMdmId(mdmModuleEntity.getId()); + mdmModuleViewEntity.setSts("Y"); + List moduleViewEntityList = mdmServiceCache.queryMdmModuleView(mdmModuleViewEntity); + if (moduleViewEntityList == null || moduleViewEntityList.size() != 1) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + mdmModuleViewEntity = moduleViewEntityList.get(0); + + + //删除自己 + FormmainDeleteDto formmainDeleteDto = new FormmainDeleteDto(); + formmainDeleteDto.setId(jsonObject.getString("id")); + formmainDeleteDto.setLoginId(StpUtil.getLoginIdAsString()); + formmainDeleteDto.setTableName(mdmModuleDbEntityList.get(i).getDbName()); + if (mdmModuleViewEntity != null && mdmModuleViewEntity.getViewName() != null && "1".equals(mdmModuleViewEntity.getViewName()) && + mdmModuleViewEntity.getUpIdFiled() != null && !"".equals(mdmModuleViewEntity.getUpIdFiled())) { + formmainDeleteDto.setUpIdFiled(mdmModuleViewEntity.getUpIdFiled()); + + Map queryData = new HashMap<>(); + queryData.put("tableName", mdmModuleDbEntityList.get(i).getDbName());//表名 + queryData.put("detailFlag", false);//是否明细 + queryData.put("id", jsonObject.getString("id"));//字段 + HashMap datas = mdmModuleDbDao.getServiceDataById(queryData); + String upValue = null; + if (datas != null && datas.get(mdmModuleViewEntity.getUpIdFiled()) != null) { + upValue = datas.get(mdmModuleViewEntity.getUpIdFiled()).toString(); + } + if (upValue != null) { + formmainDeleteDto.setUpIdFiledValue(upValue + "," + jsonObject.getString("id")); + } else { + formmainDeleteDto.setUpIdFiledValue(jsonObject.getString("id")); + } + mdmModuleDao.deleteChilder(formmainDeleteDto); + } + mdmModuleDao.deleteTemplateById(formmainDeleteDto); + + } else { + //删除明细 + FormmainDeleteDto formmainDeleteDto = new FormmainDeleteDto(); + formmainDeleteDto.setFormmain_id(jsonObject.getString("id")); + formmainDeleteDto.setLoginId(StpUtil.getLoginIdAsString()); + formmainDeleteDto.setTableName(mdmModuleDbEntityList.get(i).getDbName()); + mdmModuleDao.deleteTemplateById(formmainDeleteDto); + } + } + return BaseResult.getSuccessMessageEntity("删除数据成功"); + } // // ///** @@ -3790,267 +3877,282 @@ public class MdmServiceImpl implements IMdmService { // //} // - ///** - // * @param mdmCode - // * @param saveData - // * @param mdmModuleEntity - // * @param mdmModuleDbEntityList - // * @param flag 修改 新增 - // * @return java.lang.String - // * @Author lvleigang - // * @Description 校验数据 - // * @Date 11:20 上午 2023/11/6 - // **/ - //private String checkDataOnly(Integer mdmCode, JSONObject saveData, boolean flag, MdmModuleEntity mdmModuleEntity, List mdmModuleDbEntityList) { - // StringBuffer str = new StringBuffer(); - // - // //查询字段 - // //查询字段下的必填规则 - // MdmModuleDbFiledsEntity mdmModuleDbFiledsEntity = new MdmModuleDbFiledsEntity(); - // mdmModuleDbFiledsEntity.setMdmId(mdmModuleEntity.getId()); - // mdmModuleDbFiledsEntity.setSts("Y"); - // mdmModuleDbFiledsEntity.setRoletype("required"); - // mdmModuleDbFiledsEntity.setRoleValue("true"); - // List mdmModuleDbFiledsEntityList = mdmModuleDbFiledsDao.queryBase(mdmModuleDbFiledsEntity); - // - // if (mdmModuleDbFiledsEntityList != null && mdmModuleDbFiledsEntityList.size() > 0) { - // for (int i = 0; i < mdmModuleDbEntityList.size(); i++) { - // if ("1".equals(mdmModuleDbEntityList.get(i).getDbType())) { - // JSONObject jsonObject = saveData.getJSONObject(mdmModuleDbEntityList.get(i).getDbName()); - // for (int i1 = 0; i1 < mdmModuleDbFiledsEntityList.size(); i1++) { - // if (mdmModuleDbFiledsEntityList.get(i1).getDbId().equals(mdmModuleDbEntityList.get(i).getId())) { - // if (jsonObject.get(mdmModuleDbFiledsEntityList.get(i1).getEnName()) == null || "".equals(jsonObject.getString(mdmModuleDbFiledsEntityList.get(i1).getEnName()))) { - // if (str.toString() != null && !"".equals(str.toString())) { - // str.append(";"); - // } - // str.append(mdmModuleDbEntityList.get(i).getRemark() + "的" + mdmModuleDbFiledsEntityList.get(i1).getChName() + "不为空"); - // } - // } - // } - // } else { - // JSONArray jsonArray = saveData.getJSONArray(mdmModuleDbEntityList.get(i).getDbName()); - // if (jsonArray != null && jsonArray.size() > 0) { - // for (int i1 = 0; i1 < mdmModuleDbFiledsEntityList.size(); i1++) { - // if (mdmModuleDbFiledsEntityList.get(i1).getDbId().equals(mdmModuleDbEntityList.get(i).getId())) { - // for (int i2 = 0; i2 < jsonArray.size(); i2++) { - // JSONObject jsonObject = jsonArray.getJSONObject(i2); - // if (jsonObject.get(mdmModuleDbFiledsEntityList.get(i1).getEnName()) == null || "".equals(jsonObject.getString(mdmModuleDbFiledsEntityList.get(i1).getEnName()))) { - // if (str.toString() != null && !"".equals(str.toString())) { - // str.append(";"); - // } - // str.append(mdmModuleDbEntityList.get(i).getRemark() + "的" + mdmModuleDbFiledsEntityList.get(i1).getChName() + "不为空"); - // break; - // } - // } - // } - // } - // } - // } - // } - // } - // - // if (str == null || "".equals(str.toString())) { - // //校验数据 - // MdmModuleDbFiledsEntity onlyFiledsEntity = new MdmModuleDbFiledsEntity(); - // onlyFiledsEntity.setMdmId(mdmModuleEntity.getId()); - // onlyFiledsEntity.setSts("Y"); - // onlyFiledsEntity.setRoletype("fieldsSole"); - // onlyFiledsEntity.setRoleValue("true"); - // - // List onlyEntityList = mdmModuleDbFiledsDao.queryBase(onlyFiledsEntity); - // - // if (onlyEntityList != null && onlyEntityList.size() > 0) { - // for (int i = 0; i < mdmModuleDbEntityList.size(); i++) { - // if ("1".equals(mdmModuleDbEntityList.get(i).getDbType())) { - // JSONObject jsonObject = saveData.getJSONObject(mdmModuleDbEntityList.get(i).getDbName()); - // for (int i1 = 0; i1 < onlyEntityList.size(); i1++) { - // if (onlyEntityList.get(i1).getDbId().equals(mdmModuleDbEntityList.get(i).getId())) { - // //校验唯一 - // Map map = new HashMap<>(); - // map.put("tableName", mdmModuleDbEntityList.get(i).getDbName()); - // if (flag) { - // map.put("id", jsonObject.getString("id")); - // } - // map.put("filedName", onlyEntityList.get(i1).getEnName()); - // map.put("filedValue", jsonObject.getString(onlyEntityList.get(i1).getEnName())); - // Integer count = mdmModuleDao.checkData(map); - // if (count > 0) { - // if (str.toString() != null && !"".equals(str.toString())) { - // str.append(";"); - // } - // str.append(mdmModuleDbEntityList.get(i).getRemark() + "的" + mdmModuleDbFiledsEntityList.get(i1).getChName() + "已存在"); - // } - // } - // } - // } else { - // JSONArray jsonArray = saveData.getJSONArray(mdmModuleDbEntityList.get(i).getDbName()); - // if (jsonArray != null && jsonArray.size() > 0) { - // for (int i1 = 0; i1 < onlyEntityList.size(); i1++) { - // if (onlyEntityList.get(i1).getDbId().equals(mdmModuleDbEntityList.get(i).getId())) { - // for (int i2 = 0; i2 < jsonArray.size(); i2++) { - // JSONObject jsonObject = jsonArray.getJSONObject(i2); - // - // //校验唯一 - // Map map = new HashMap<>(); - // map.put("tableName", mdmModuleDbEntityList.get(i).getDbName()); - // if (flag) { - // map.put("id", jsonObject.getString("id")); - // } - // map.put("filedName", onlyEntityList.get(i1).getEnName()); - // map.put("filedValue", jsonObject.getString(onlyEntityList.get(i1).getEnName())); - // Integer count = mdmModuleDao.checkData(map); - // if (count > 0) { - // if (str.toString() != null && !"".equals(str.toString())) { - // str.append(";"); - // } - // str.append(mdmModuleDbEntityList.get(i).getRemark() + "的" + mdmModuleDbFiledsEntityList.get(i1).getChName() + "已存在"); - // break; - // } - // } - // } - // } - // } - // } - // } - // } - // } - // - // - // //保存数据 - // if (str == null || "".equals(str.toString())) { - // String id = UUIDUtils.getUUID(); - // for (int i = 0; i < mdmModuleDbEntityList.size(); i++) { - // if ("1".equals(mdmModuleDbEntityList.get(i).getDbType())) { - // JSONObject jsonObject = saveData.getJSONObject(mdmModuleDbEntityList.get(i).getDbName()); - // //保存数据 - // MdmDataDto mdmDataDto = new MdmDataDto(); - // mdmDataDto.setTableName(mdmModuleDbEntityList.get(i).getDbName()); - // MdmModuleDbFiledsEntity mdmModuleDbFiledsEntity1 = new MdmModuleDbFiledsEntity(); - // mdmModuleDbFiledsEntity1.setMdmId(mdmModuleEntity.getId()); - // mdmModuleDbFiledsEntity1.setDbId(mdmModuleDbEntityList.get(i).getId()); - // mdmModuleDbFiledsEntity1.setSts("Y"); - // List fileds = mdmModuleDbFiledsDao.queryBase(mdmModuleDbFiledsEntity1); - // //查询单据规则 - // MdmTableCodeRuleEntity mdmTableCodeRuleEntity = new MdmTableCodeRuleEntity(); - // mdmTableCodeRuleEntity.setMdmId(mdmModuleEntity.getId()); - // mdmTableCodeRuleEntity.setDbId(mdmModuleDbEntityList.get(i).getId()); - // mdmTableCodeRuleEntity.setSts("Y"); - // List mdmTableCodeRuleEntities = mdmTableCodeRuleDao.queryBase(mdmTableCodeRuleEntity); - // StringBuffer document_rule = new StringBuffer(); - // Integer document_rule_num = 0; - // if (mdmTableCodeRuleEntities != null && mdmTableCodeRuleEntities.size() > 0) { - // for (int i1 = 0; i1 < mdmTableCodeRuleEntities.size(); i1++) { - // //1、连接符号 2、字符串 3、日期 4、流水号 - // if ("1".equals(mdmTableCodeRuleEntities.get(i1).getDbType())) { - // document_rule.append("-"); - // } else if ("2".equals(mdmTableCodeRuleEntities.get(i1).getDbType())) { - // document_rule.append(mdmTableCodeRuleEntities.get(i1).getDbValue()); - // } else if ("3".equals(mdmTableCodeRuleEntities.get(i1).getDbType())) { - // SimpleDateFormat sdf = new SimpleDateFormat(mdmTableCodeRuleEntities.get(i1).getDbValue());//要转换的时间格式 - // String stra = sdf.format(new Date()); - // document_rule.append(stra); - // } else if ("4".equals(mdmTableCodeRuleEntities.get(i1).getDbType())) { - // document_rule_num = mdmTableCodeRuleEntities.get(i1).getDbValue().length(); - // } - // } - // } - // List mdmDataFiledDtos = new ArrayList<>(); - // for (int i1 = 0; i1 < fileds.size(); i1++) { - // if (jsonObject.get(fileds.get(i1).getEnName()) != null) { - // MdmDataFiledDto mdmDataFiledDto = new MdmDataFiledDto(); - // mdmDataFiledDto.setFiledsName(fileds.get(i1).getEnName()); - // mdmDataFiledDto.setFiledsValue(jsonObject.getString(fileds.get(i1).getEnName())); - // mdmDataFiledDtos.add(mdmDataFiledDto); - // } - // } - // MdmDataFiledDto mdmDataFiledDto = new MdmDataFiledDto(); - // mdmDataFiledDto.setFiledsName("logid"); - // mdmDataFiledDto.setFiledsValue(StpUtil.getLoginIdAsString()); - // mdmDataFiledDtos.add(mdmDataFiledDto); - // mdmDataDto.setMdmDataFiledDtos(mdmDataFiledDtos); - // if (flag) { - // mdmDataDto.setId(jsonObject.getString("id")); - // id = jsonObject.getString("id"); - // int a = mdmModuleDao.updateForm(mdmDataDto); - // } else { - // - // mdmDataDto.setDbType(mdmModuleDbEntityList.get(i).getDbType()); - // mdmDataDto.setDocumentRule(document_rule.toString()); - // mdmDataDto.setDocumentRuleNum(document_rule_num); - // MdmDataFiledDto ids = new MdmDataFiledDto(); - // ids.setFiledsName("id"); - // ids.setFiledsValue(id); - // mdmDataFiledDtos.add(ids); - // mdmDataDto.setMdmDataFiledDtos(mdmDataFiledDtos); - // int a = mdmModuleDao.saveForm(mdmDataDto); - // } - // } - // } - // - // for (int i = 0; i < mdmModuleDbEntityList.size(); i++) { - // if ("2".equals(mdmModuleDbEntityList.get(i).getDbType())) { - // //删除明细 - // FormmainDeleteDto formmainDeleteDto = new FormmainDeleteDto(); - // formmainDeleteDto.setFormmain_id(id); - // formmainDeleteDto.setLoginId(StpUtil.getLoginIdAsString()); - // formmainDeleteDto.setTableName(mdmModuleDbEntityList.get(i).getDbName()); - // mdmModuleDao.deleteTemplateById(formmainDeleteDto); - // - // JSONArray jsonArray = saveData.getJSONArray(mdmModuleDbEntityList.get(i).getDbName()); - // if (jsonArray != null && jsonArray.size() > 0) { - // MdmModuleDbFiledsEntity mdmModuleDbFiledsEntity1 = new MdmModuleDbFiledsEntity(); - // mdmModuleDbFiledsEntity1.setMdmId(mdmModuleEntity.getId()); - // mdmModuleDbFiledsEntity1.setDbId(mdmModuleDbEntityList.get(i).getId()); - // mdmModuleDbFiledsEntity1.setSts("Y"); - // List fileds = mdmModuleDbFiledsDao.queryBase(mdmModuleDbFiledsEntity1); - // - // for (int i2 = 0; i2 < jsonArray.size(); i2++) { - // JSONObject jsonObject = jsonArray.getJSONObject(i2); - // //保存数据 - // MdmDataDto mdmDataDto = new MdmDataDto(); - // 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); - // } - // 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); - // } - // } - // } - // } - // } - // } - // return str.toString(); - //} - // + /** + * @param mdmCode + * @param saveData + * @param mdmModuleEntity + * @param mdmModuleDbEntityList + * @param flag 修改 新增 + * @return java.lang.String + * @Author lvleigang + * @Description 校验数据 + * @Date 11:20 上午 2023/11/6 + **/ + private String checkDataOnly(Integer mdmCode, JSONObject saveData, boolean flag, MdmModuleEntity mdmModuleEntity, List mdmModuleDbEntityList) { + StringBuffer str = new StringBuffer(); + + //查询字段 + //查询字段下的必填规则 + MdmModuleDbFiledsEntity mdmModuleDbFiledsEntity = new MdmModuleDbFiledsEntity(); + mdmModuleDbFiledsEntity.setMdmId(mdmModuleEntity.getId()); + mdmModuleDbFiledsEntity.setSts("Y"); + mdmModuleDbFiledsEntity.setRoletype("required"); + mdmModuleDbFiledsEntity.setRoleValue("true"); + List mdmModuleDbFiledsEntityList = mdmModuleDbFiledsDao.queryBase(mdmModuleDbFiledsEntity); + + if (mdmModuleDbFiledsEntityList != null && mdmModuleDbFiledsEntityList.size() > 0) { + for (int i = 0; i < mdmModuleDbEntityList.size(); i++) { + if ("1".equals(mdmModuleDbEntityList.get(i).getDbType())) { + JSONObject jsonObject = saveData.getJSONObject(mdmModuleDbEntityList.get(i).getDbName()); + for (int i1 = 0; i1 < mdmModuleDbFiledsEntityList.size(); i1++) { + if (mdmModuleDbFiledsEntityList.get(i1).getDbId().equals(mdmModuleDbEntityList.get(i).getId())) { + if (jsonObject.get(mdmModuleDbFiledsEntityList.get(i1).getEnName()) == null || "".equals(jsonObject.getString(mdmModuleDbFiledsEntityList.get(i1).getEnName()))) { + if (str.toString() != null && !"".equals(str.toString())) { + str.append(";"); + } + str.append(mdmModuleDbEntityList.get(i).getRemark() + "的" + mdmModuleDbFiledsEntityList.get(i1).getChName() + "不为空"); + } + } + } + } else { + JSONArray jsonArray = saveData.getJSONArray(mdmModuleDbEntityList.get(i).getDbName()); + if (jsonArray != null && jsonArray.size() > 0) { + for (int i1 = 0; i1 < mdmModuleDbFiledsEntityList.size(); i1++) { + if (mdmModuleDbFiledsEntityList.get(i1).getDbId().equals(mdmModuleDbEntityList.get(i).getId())) { + for (int i2 = 0; i2 < jsonArray.size(); i2++) { + JSONObject jsonObject = jsonArray.getJSONObject(i2); + if (jsonObject.get(mdmModuleDbFiledsEntityList.get(i1).getEnName()) == null || "".equals(jsonObject.getString(mdmModuleDbFiledsEntityList.get(i1).getEnName()))) { + if (str.toString() != null && !"".equals(str.toString())) { + str.append(";"); + } + str.append(mdmModuleDbEntityList.get(i).getRemark() + "的" + mdmModuleDbFiledsEntityList.get(i1).getChName() + "不为空"); + break; + } + } + } + } + } + } + } + } + + if (str == null || "".equals(str.toString())) { + //校验数据 + MdmModuleDbFiledsEntity onlyFiledsEntity = new MdmModuleDbFiledsEntity(); + onlyFiledsEntity.setMdmId(mdmModuleEntity.getId()); + onlyFiledsEntity.setSts("Y"); + onlyFiledsEntity.setRoletype("fieldsSole"); + onlyFiledsEntity.setRoleValue("true"); + + List onlyEntityList = mdmModuleDbFiledsDao.queryBase(onlyFiledsEntity); + + if (onlyEntityList != null && onlyEntityList.size() > 0) { + for (int i = 0; i < mdmModuleDbEntityList.size(); i++) { + if ("1".equals(mdmModuleDbEntityList.get(i).getDbType())) { + JSONObject jsonObject = saveData.getJSONObject(mdmModuleDbEntityList.get(i).getDbName()); + for (int i1 = 0; i1 < onlyEntityList.size(); i1++) { + if (onlyEntityList.get(i1).getDbId().equals(mdmModuleDbEntityList.get(i).getId())) { + //校验唯一 + Map map = new HashMap<>(); + map.put("tableName", mdmModuleDbEntityList.get(i).getDbName()); + if (flag) { + map.put("id", jsonObject.getString("id")); + } + map.put("filedName", onlyEntityList.get(i1).getEnName()); + map.put("filedValue", jsonObject.getString(onlyEntityList.get(i1).getEnName())); + Integer count = mdmModuleDao.checkData(map); + if (count > 0) { + if (str.toString() != null && !"".equals(str.toString())) { + str.append(";"); + } + str.append(mdmModuleDbEntityList.get(i).getRemark() + "的" + mdmModuleDbFiledsEntityList.get(i1).getChName() + "已存在"); + } + } + } + } else { + JSONArray jsonArray = saveData.getJSONArray(mdmModuleDbEntityList.get(i).getDbName()); + if (jsonArray != null && jsonArray.size() > 0) { + for (int i1 = 0; i1 < onlyEntityList.size(); i1++) { + if (onlyEntityList.get(i1).getDbId().equals(mdmModuleDbEntityList.get(i).getId())) { + for (int i2 = 0; i2 < jsonArray.size(); i2++) { + JSONObject jsonObject = jsonArray.getJSONObject(i2); + + //校验唯一 + Map map = new HashMap<>(); + map.put("tableName", mdmModuleDbEntityList.get(i).getDbName()); + if (flag) { + map.put("id", jsonObject.getString("id")); + } + map.put("filedName", onlyEntityList.get(i1).getEnName()); + map.put("filedValue", jsonObject.getString(onlyEntityList.get(i1).getEnName())); + Integer count = mdmModuleDao.checkData(map); + if (count > 0) { + if (str.toString() != null && !"".equals(str.toString())) { + str.append(";"); + } + str.append(mdmModuleDbEntityList.get(i).getRemark() + "的" + mdmModuleDbFiledsEntityList.get(i1).getChName() + "已存在"); + break; + } + } + } + } + } + } + } + } + } + + + //保存数据 + if (str == null || "".equals(str.toString())) { + String id = UUIDUtils.getUUID(); + for (int i = 0; i < mdmModuleDbEntityList.size(); i++) { + if ("1".equals(mdmModuleDbEntityList.get(i).getDbType())) { + JSONObject jsonObject = saveData.getJSONObject(mdmModuleDbEntityList.get(i).getDbName()); + //保存数据 + MdmDataDto mdmDataDto = new MdmDataDto(); + mdmDataDto.setTableName(mdmModuleDbEntityList.get(i).getDbName()); + MdmModuleDbFiledsEntity mdmModuleDbFiledsEntity1 = new MdmModuleDbFiledsEntity(); + mdmModuleDbFiledsEntity1.setMdmId(mdmModuleEntity.getId()); + mdmModuleDbFiledsEntity1.setDbId(mdmModuleDbEntityList.get(i).getId()); + mdmModuleDbFiledsEntity1.setSts("Y"); + List fileds = mdmModuleDbFiledsDao.queryBase(mdmModuleDbFiledsEntity1); + //查询单据规则 + MdmTableCodeRuleEntity mdmTableCodeRuleEntity = new MdmTableCodeRuleEntity(); + mdmTableCodeRuleEntity.setMdmId(mdmModuleEntity.getId()); + mdmTableCodeRuleEntity.setDbId(mdmModuleDbEntityList.get(i).getId()); + mdmTableCodeRuleEntity.setSts("Y"); + List allMdmTableCodeRuleEntities = mdmServiceCache.queryMdmTableCodeRuleEntity(mdmTableCodeRuleEntity); + List mdmTableCodeRuleEntities = new ArrayList<>(); + if(allMdmTableCodeRuleEntities != null && allMdmTableCodeRuleEntities.size() > 0){ + for (int i1 = 0; i1 < allMdmTableCodeRuleEntities.size(); i1++) { + if(mdmModuleDbEntityList.get(i).getId().equals(allMdmTableCodeRuleEntities.get(i1).getDbId())){ + mdmTableCodeRuleEntities.add(allMdmTableCodeRuleEntities.get(i1)); + } + } + } + StringBuffer document_rule = new StringBuffer(); + Integer document_rule_num = 0; + if (mdmTableCodeRuleEntities != null && mdmTableCodeRuleEntities.size() > 0) { + for (int i1 = 0; i1 < mdmTableCodeRuleEntities.size(); i1++) { + //1、连接符号 2、字符串 3、日期 4、流水号 + if ("1".equals(mdmTableCodeRuleEntities.get(i1).getDbType())) { + document_rule.append("-"); + } else if ("2".equals(mdmTableCodeRuleEntities.get(i1).getDbType())) { + document_rule.append(mdmTableCodeRuleEntities.get(i1).getDbValue()); + } else if ("3".equals(mdmTableCodeRuleEntities.get(i1).getDbType())) { + SimpleDateFormat sdf = new SimpleDateFormat(mdmTableCodeRuleEntities.get(i1).getDbValue());//要转换的时间格式 + String stra = sdf.format(new Date()); + document_rule.append(stra); + } else if ("4".equals(mdmTableCodeRuleEntities.get(i1).getDbType())) { + document_rule_num = mdmTableCodeRuleEntities.get(i1).getDbValue().length(); + } + } + } + List mdmDataFiledDtos = new ArrayList<>(); + for (int i1 = 0; i1 < fileds.size(); i1++) { + if (jsonObject.get(fileds.get(i1).getEnName()) != null) { + MdmDataFiledDto mdmDataFiledDto = new MdmDataFiledDto(); + mdmDataFiledDto.setFiledsName(fileds.get(i1).getEnName()); + mdmDataFiledDto.setFiledsValue(jsonObject.getString(fileds.get(i1).getEnName())); + mdmDataFiledDtos.add(mdmDataFiledDto); + } + } + MdmDataFiledDto mdmDataFiledDto = new MdmDataFiledDto(); + mdmDataFiledDto.setFiledsName("logid"); + mdmDataFiledDto.setFiledsValue(StpUtil.getLoginIdAsString()); + mdmDataFiledDtos.add(mdmDataFiledDto); + mdmDataDto.setMdmDataFiledDtos(mdmDataFiledDtos); + if (flag) { + mdmDataDto.setId(jsonObject.getString("id")); + id = jsonObject.getString("id"); + int a = mdmModuleDao.updateForm(mdmDataDto); + } else { + + mdmDataDto.setDbType(mdmModuleDbEntityList.get(i).getDbType()); + mdmDataDto.setDocumentRule(document_rule.toString()); + mdmDataDto.setDocumentRuleNum(document_rule_num); + MdmDataFiledDto ids = new MdmDataFiledDto(); + ids.setFiledsName("id"); + ids.setFiledsValue(id); + mdmDataFiledDtos.add(ids); + mdmDataDto.setMdmDataFiledDtos(mdmDataFiledDtos); + int a = mdmModuleDao.saveForm(mdmDataDto); + } + } + } + + for (int i = 0; i < mdmModuleDbEntityList.size(); i++) { + if ("2".equals(mdmModuleDbEntityList.get(i).getDbType())) { + //删除明细 + FormmainDeleteDto formmainDeleteDto = new FormmainDeleteDto(); + formmainDeleteDto.setFormmain_id(id); + formmainDeleteDto.setLoginId(StpUtil.getLoginIdAsString()); + formmainDeleteDto.setTableName(mdmModuleDbEntityList.get(i).getDbName()); + mdmModuleDao.deleteTemplateById(formmainDeleteDto); + + JSONArray jsonArray = saveData.getJSONArray(mdmModuleDbEntityList.get(i).getDbName()); + if (jsonArray != null && jsonArray.size() > 0) { + MdmModuleDbFiledsEntity mdmModuleDbFiledsEntity1 = new MdmModuleDbFiledsEntity(); + mdmModuleDbFiledsEntity1.setMdmId(mdmModuleEntity.getId()); + mdmModuleDbFiledsEntity1.setSts("Y"); + List allfileds = mdmServiceCache.queryMdmModuleDbFileds(mdmModuleDbFiledsEntity1); + List fileds = new ArrayList<>(); + if(allfileds != null && allfileds.size() > 0){ + for (int i1 = 0; i1 < allfileds.size(); i1++) { + if(mdmModuleDbEntityList.get(i).getId().equals(allfileds.get(i1).getDbId())){ + fileds.add(allfileds.get(i1)); + } + } + } + + for (int i2 = 0; i2 < jsonArray.size(); i2++) { + JSONObject jsonObject = jsonArray.getJSONObject(i2); + //保存数据 + MdmDataDto mdmDataDto = new MdmDataDto(); + 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); + } + 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); + } + } + } + } + } + } + return str.toString(); + } + /** * @param jsonObject From 3a9fcceb61cae8b85e238a8c390c40e2dc7471d5 Mon Sep 17 00:00:00 2001 From: hecan <1718492867@qq.com> Date: Fri, 7 Jun 2024 11:26:18 +0800 Subject: [PATCH 44/80] =?UTF-8?q?=E5=88=86=E7=BB=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mdmModuleSource/dao/IMdmModuleSourceDao.java | 14 +++++++++++++- .../dao/impl/MdmModuleSourceDaoImpl.java | 13 ++++++++++++- .../entity/MdmModuleSourceEntity.xml | 9 +++++++++ 3 files changed, 34 insertions(+), 2 deletions(-) diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleSource/dao/IMdmModuleSourceDao.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleSource/dao/IMdmModuleSourceDao.java index bde093e6..cc3b08c8 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleSource/dao/IMdmModuleSourceDao.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleSource/dao/IMdmModuleSourceDao.java @@ -1,7 +1,9 @@ package com.hzya.frame.mdm.mdmModuleSource.dao; import com.hzya.frame.mdm.mdmModuleSource.entity.MdmModuleSourceEntity; -import com.hzya.frame.basedao.dao.IBaseDao; +import com.hzya.frame.basedao.dao.IBaseDao; + +import java.util.List; /** * 主数据数据来源(mdm_module_source: table)表数据库访问层 @@ -10,6 +12,16 @@ import com.hzya.frame.basedao.dao.IBaseDao; * @since 2024-06-05 11:42:56 */ public interface IMdmModuleSourceDao extends IBaseDao { + + /** + * + * @content 根据数据来源内类型是插件的应用类型做分组 + * @Param + * @Return + * @Author hecan + * @Date 2024/6/6 10:43 + * **/ + List MdmModuleSourceentityGroupByType(); } diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleSource/dao/impl/MdmModuleSourceDaoImpl.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleSource/dao/impl/MdmModuleSourceDaoImpl.java index 5be355b3..b7cc9034 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleSource/dao/impl/MdmModuleSourceDaoImpl.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleSource/dao/impl/MdmModuleSourceDaoImpl.java @@ -4,6 +4,9 @@ import com.hzya.frame.mdm.mdmModuleSource.entity.MdmModuleSourceEntity; import com.hzya.frame.mdm.mdmModuleSource.dao.IMdmModuleSourceDao; import org.springframework.stereotype.Repository; import com.hzya.frame.basedao.dao.MybatisGenericDao; + +import java.util.List; + /** * 主数据数据来源(MdmModuleSource)表数据库访问层 * @@ -12,6 +15,14 @@ import com.hzya.frame.basedao.dao.MybatisGenericDao; */ @Repository(value = "MdmModuleSourceDaoImpl") public class MdmModuleSourceDaoImpl extends MybatisGenericDao implements IMdmModuleSourceDao{ - + //根据数据来源内类型是插件的应用类型做分组 + @Override + public List MdmModuleSourceentityGroupByType() { + List list =(List) super.selectList(getSqlIdPrifx() + "MdmModuleSourceentityGroupByType", ""); + return list; + } + + + } 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 df21034b..6476ebba 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 @@ -131,6 +131,15 @@ order by ${sort} ${order} + + + insert into mdm_module_source( From 3489a1e274eb06624531fa50c72c838fce425906 Mon Sep 17 00:00:00 2001 From: lvleigang <957075182@qq.com> Date: Fri, 7 Jun 2024 16:57:42 +0800 Subject: [PATCH 45/80] =?UTF-8?q?=E5=B9=B3=E5=8F=B0=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=8E=B7=E5=8F=96=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../frame/webapp/entrance/service/impl/EntranceServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webapp/src/main/java/com/hzya/frame/webapp/entrance/service/impl/EntranceServiceImpl.java b/webapp/src/main/java/com/hzya/frame/webapp/entrance/service/impl/EntranceServiceImpl.java index 093550aa..86d047b0 100644 --- a/webapp/src/main/java/com/hzya/frame/webapp/entrance/service/impl/EntranceServiceImpl.java +++ b/webapp/src/main/java/com/hzya/frame/webapp/entrance/service/impl/EntranceServiceImpl.java @@ -235,7 +235,7 @@ public class EntranceServiceImpl implements IEntranceService { public Object platformInterface(ServletRequest servletRequest, ServletResponse servletResponse) throws InvocationTargetException, IllegalAccessException { HttpServletRequest request = (HttpServletRequest) servletRequest; //tailuo 要访问的Bean名称 - String service = request.getHeader("tl"); + String service = request.getHeader("yatl"); //bean方法 String serviceMethod = request.getHeader("yadj"); String body = ServletUtil.getBody(servletRequest); From 875470a326ac9f6082854024e35a8252dd78cc5a Mon Sep 17 00:00:00 2001 From: hecan <1718492867@qq.com> Date: Tue, 11 Jun 2024 09:00:19 +0800 Subject: [PATCH 46/80] =?UTF-8?q?=E8=8E=B7=E5=8F=96=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E6=9D=A5=E6=BA=90=E6=8F=92=E4=BB=B6=E7=BC=96=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mdmModuleSource/entity/MdmModuleSourceEntity.xml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) 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 6476ebba..245446f4 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 @@ -132,12 +132,11 @@ - + select plugin_code,plugin_name,source_name,source_code + from mdm_module_source source + left join sys_application_plugin plug on plug.id=source.source_code + where source_type='1' and source.sts='Y' and plug.sts='Y' From 239e037d8830c3d28fa232075759a9797c1d9652 Mon Sep 17 00:00:00 2001 From: hecan <1718492867@qq.com> Date: Tue, 11 Jun 2024 09:55:44 +0800 Subject: [PATCH 47/80] =?UTF-8?q?=E8=8E=B7=E5=8F=96=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E6=9D=A5=E6=BA=90=E6=8F=92=E4=BB=B6=E7=BC=96=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../masterData/dao/IMasterDataDao.java | 23 +++ .../dao/impl/MasterDataDaoImpl.java | 31 ++++ .../service/IMasterDataOrgsService.java | 19 +++ .../service/IMasterDataProjectService.java | 19 +++ .../impl/MasterDataOrgsServiceImpl.java | 138 ++++++++++++++++++ .../impl/MasterDataProjectServiceImpl.java | 132 +++++++++++++++++ 6 files changed, 362 insertions(+) create mode 100644 service/src/main/java/com/hzya/frame/sysnew/comparison/masterData/dao/IMasterDataDao.java create mode 100644 service/src/main/java/com/hzya/frame/sysnew/comparison/masterData/dao/impl/MasterDataDaoImpl.java create mode 100644 service/src/main/java/com/hzya/frame/sysnew/comparison/masterData/service/IMasterDataOrgsService.java create mode 100644 service/src/main/java/com/hzya/frame/sysnew/comparison/masterData/service/IMasterDataProjectService.java create mode 100644 service/src/main/java/com/hzya/frame/sysnew/comparison/masterData/service/impl/MasterDataOrgsServiceImpl.java create 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/dao/IMasterDataDao.java b/service/src/main/java/com/hzya/frame/sysnew/comparison/masterData/dao/IMasterDataDao.java new file mode 100644 index 00000000..8fb8ce73 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/sysnew/comparison/masterData/dao/IMasterDataDao.java @@ -0,0 +1,23 @@ +package com.hzya.frame.sysnew.comparison.masterData.dao; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.hzya.frame.basedao.service.IBaseService; +import com.hzya.frame.sysnew.comparison.entity.ComparisonEntity; + +import java.util.HashMap; +import java.util.List; + +public interface IMasterDataDao extends IBaseService { + + + /** + * + * @content 查询U8C档案 + * @Param + * @Return + * @Author hecan + * @Date 2024/6/6 11:56 + * **/ + @DS("swu8c") + List> queryArchives(String str); +} diff --git a/service/src/main/java/com/hzya/frame/sysnew/comparison/masterData/dao/impl/MasterDataDaoImpl.java b/service/src/main/java/com/hzya/frame/sysnew/comparison/masterData/dao/impl/MasterDataDaoImpl.java new file mode 100644 index 00000000..ad9f3588 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/sysnew/comparison/masterData/dao/impl/MasterDataDaoImpl.java @@ -0,0 +1,31 @@ +package com.hzya.frame.sysnew.comparison.masterData.dao.impl; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.hzya.frame.basedao.service.impl.BaseService; +import com.hzya.frame.execsql.service.IExecSqlService; +import com.hzya.frame.sysnew.comparison.entity.ComparisonEntity; +import com.hzya.frame.sysnew.comparison.masterData.dao.IMasterDataDao; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Repository; + +import java.util.HashMap; +import java.util.List; + +@Repository(value = "masterDataDaoImpl") +public class MasterDataDaoImpl extends BaseService implements IMasterDataDao { + + @Autowired + private IExecSqlService execSqlService; + + @DS("swu8c") + @Override + public List> queryArchives(String str) { + try { + List> hashMaps = execSqlService.execSelectSql(str, ""); + return hashMaps; + }catch (Exception e){ + logger.info("U8C主数据档案用户档案没有需要同步中台的数据"); + return null; + } + } +} 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 new file mode 100644 index 00000000..1e08f408 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/sysnew/comparison/masterData/service/IMasterDataOrgsService.java @@ -0,0 +1,19 @@ +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 new file mode 100644 index 00000000..6b6799c1 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/sysnew/comparison/masterData/service/IMasterDataProjectService.java @@ -0,0 +1,19 @@ +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/MasterDataOrgsServiceImpl.java b/service/src/main/java/com/hzya/frame/sysnew/comparison/masterData/service/impl/MasterDataOrgsServiceImpl.java new file mode 100644 index 00000000..c6fe35a5 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/sysnew/comparison/masterData/service/impl/MasterDataOrgsServiceImpl.java @@ -0,0 +1,138 @@ +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("sourceName",mdmModuleSourceEntity.getSourceName()); + jsonObjectUser.put("code",mdmModuleSourceEntity.getSourceCode()); + 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("sourceName",mdmModuleSourceEntity.getSourceName()); + jsonObjectUser.put("code",mdmModuleSourceEntity.getSourceCode()); + 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 new file mode 100644 index 00000000..a0f39bd0 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/sysnew/comparison/masterData/service/impl/MasterDataProjectServiceImpl.java @@ -0,0 +1,132 @@ +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("sourceName",mdmModuleSourceEntity.getSourceName()); + jsonObjectUser.put("code",mdmModuleSourceEntity.getSourceCode()); + 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("sourceName",mdmModuleSourceEntity.getSourceName()); + jsonObjectUser.put("code",mdmModuleSourceEntity.getSourceCode()); + jsonObjectUser.put("optionName", "数智中台"); + jsonStr.put("jsonStr", jsonObjectUser); + try { + comparisonServiceimpl.updateEntity(jsonStr); + } catch (Exception e) { + logger.info("U8C主数据档案更新用户档案失败,失败原因:{}", e.getMessage()); + } + } + } + } + return null; + } + +} From 506833e26299ff362beed0a7ef69e779172ce3cd Mon Sep 17 00:00:00 2001 From: hecan <1718492867@qq.com> Date: Tue, 11 Jun 2024 09:56:18 +0800 Subject: [PATCH 48/80] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E6=A1=A3=E6=A1=88?= =?UTF-8?q?=E5=92=8C=E7=BB=84=E7=BB=87=E6=A1=A3=E6=A1=88=E6=8F=92=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../plugin/masterData/org/dao/IMdmOrgDao.java | 15 + .../org/dao/impl/MdmOrgDaoImpl.java | 16 + .../masterData/org/entity/MdmOrgEntity.java | 196 +++++++++ .../masterData/org/entity/MdmOrgEntity.xml | 388 ++++++++++++++++++ .../org/plugin/MdmOrgPluginInitializer.java | 62 +++ .../org/service/IMdmOrgService.java | 12 + .../org/service/impl/MdmOrgServiceImpl.java | 25 ++ .../project/dao/IMdmProjectDao.java | 15 + .../project/dao/impl/MdmProjectDaoImpl.java | 16 + .../project/entity/MdmProjectEntity.java | 186 +++++++++ .../project/entity/MdmProjectEntity.xml | 377 +++++++++++++++++ .../plugin/MdmProjectPluginInitializer.java | 64 +++ .../project/service/IMdmProjectService.java | 12 + .../service/impl/MdmProjectServiceImpl.java | 25 ++ 14 files changed, 1409 insertions(+) create mode 100644 buildpackage/src/main/java/com/hzya/frame/plugin/masterData/org/dao/IMdmOrgDao.java create mode 100644 buildpackage/src/main/java/com/hzya/frame/plugin/masterData/org/dao/impl/MdmOrgDaoImpl.java create mode 100644 buildpackage/src/main/java/com/hzya/frame/plugin/masterData/org/entity/MdmOrgEntity.java create mode 100644 buildpackage/src/main/java/com/hzya/frame/plugin/masterData/org/entity/MdmOrgEntity.xml create mode 100644 buildpackage/src/main/java/com/hzya/frame/plugin/masterData/org/plugin/MdmOrgPluginInitializer.java create mode 100644 buildpackage/src/main/java/com/hzya/frame/plugin/masterData/org/service/IMdmOrgService.java create mode 100644 buildpackage/src/main/java/com/hzya/frame/plugin/masterData/org/service/impl/MdmOrgServiceImpl.java create mode 100644 buildpackage/src/main/java/com/hzya/frame/plugin/masterData/project/dao/IMdmProjectDao.java create mode 100644 buildpackage/src/main/java/com/hzya/frame/plugin/masterData/project/dao/impl/MdmProjectDaoImpl.java create mode 100644 buildpackage/src/main/java/com/hzya/frame/plugin/masterData/project/entity/MdmProjectEntity.java create mode 100644 buildpackage/src/main/java/com/hzya/frame/plugin/masterData/project/entity/MdmProjectEntity.xml create mode 100644 buildpackage/src/main/java/com/hzya/frame/plugin/masterData/project/plugin/MdmProjectPluginInitializer.java create mode 100644 buildpackage/src/main/java/com/hzya/frame/plugin/masterData/project/service/IMdmProjectService.java create mode 100644 buildpackage/src/main/java/com/hzya/frame/plugin/masterData/project/service/impl/MdmProjectServiceImpl.java diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/org/dao/IMdmOrgDao.java b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/org/dao/IMdmOrgDao.java new file mode 100644 index 00000000..7f9d06c5 --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/org/dao/IMdmOrgDao.java @@ -0,0 +1,15 @@ +package masterData.dao; + +import masterData.entity.MdmOrgEntity; +import com.hzya.frame.basedao.dao.IBaseDao; + +/** + * 组织档案(mdm_org: table)表数据库访问层 + * + * @author makejava + * @since 2024-06-07 18:30:04 + */ +public interface IMdmOrgDao extends IBaseDao { + +} + diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/org/dao/impl/MdmOrgDaoImpl.java b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/org/dao/impl/MdmOrgDaoImpl.java new file mode 100644 index 00000000..3648d6b9 --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/org/dao/impl/MdmOrgDaoImpl.java @@ -0,0 +1,16 @@ +package masterData.dao.impl; + +import masterData.entity.MdmOrgEntity; +import masterData.dao.IMdmOrgDao; +import org.springframework.stereotype.Repository; +import com.hzya.frame.basedao.dao.MybatisGenericDao; +/** + * 组织档案(MdmOrg)表数据库访问层 + * + * @author makejava + * @since 2024-06-07 18:30:04 + */ +public class MdmOrgDaoImpl extends MybatisGenericDao implements IMdmOrgDao{ + +} + diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/org/entity/MdmOrgEntity.java b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/org/entity/MdmOrgEntity.java new file mode 100644 index 00000000..8d502635 --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/org/entity/MdmOrgEntity.java @@ -0,0 +1,196 @@ +package masterData.entity; + +import java.util.Date; +import com.hzya.frame.web.entity.BaseEntity; +/** + * 组织档案(MdmOrg)实体类 + * + * @author makejava + * @since 2024-06-07 18:30:04 + */ +public class MdmOrgEntity extends BaseEntity { + + /** 单据规则 */ + private String documentRule; + /** 单据规则流水号 */ + private Long documentRuleNum; + /** 组织编码 */ + private String orgCode; + /** 组织名称 */ + private String orgName; + /** 地址 */ + private String orgAddress; + /** 国家地区 */ + private String orgCountryzone; + /** 内部编码 */ + private String orgInnercode; + /** 说明 */ + private String orgMemo; + /** 助记码 */ + private String orgMnecode; + /** 所属行业 */ + private String orgNcindustry; + /** 上级业务单元 */ + private String orgFatherorg; + /** 负责人 */ + private String orgPrincipal; + /** 电话 */ + private String orgTel; + /** 数据状态 Y正常 N删除 F修改 */ + private String dataStatus; + /** 新增数据状态 0待下发 1已下发 */ + private String addStatus; + /** 修改数据状态 0待下发 1已下发 */ + private String updateStatus; + /** 删除数据状态 0待下发 1已下发 */ + private String deleteStatus; + /** 公司id */ + private String companyId; + + + public String getDocumentRule() { + return documentRule; + } + + public void setDocumentRule(String documentRule) { + this.documentRule = documentRule; + } + + public Long getDocumentRuleNum() { + return documentRuleNum; + } + + public void setDocumentRuleNum(Long documentRuleNum) { + this.documentRuleNum = documentRuleNum; + } + + public String getOrgCode() { + return orgCode; + } + + public void setOrgCode(String orgCode) { + this.orgCode = orgCode; + } + + public String getOrgName() { + return orgName; + } + + public void setOrgName(String orgName) { + this.orgName = orgName; + } + + public String getOrgAddress() { + return orgAddress; + } + + public void setOrgAddress(String orgAddress) { + this.orgAddress = orgAddress; + } + + public String getOrgCountryzone() { + return orgCountryzone; + } + + public void setOrgCountryzone(String orgCountryzone) { + this.orgCountryzone = orgCountryzone; + } + + public String getOrgInnercode() { + return orgInnercode; + } + + public void setOrgInnercode(String orgInnercode) { + this.orgInnercode = orgInnercode; + } + + public String getOrgMemo() { + return orgMemo; + } + + public void setOrgMemo(String orgMemo) { + this.orgMemo = orgMemo; + } + + public String getOrgMnecode() { + return orgMnecode; + } + + public void setOrgMnecode(String orgMnecode) { + this.orgMnecode = orgMnecode; + } + + public String getOrgNcindustry() { + return orgNcindustry; + } + + public void setOrgNcindustry(String orgNcindustry) { + this.orgNcindustry = orgNcindustry; + } + + public String getOrgFatherorg() { + return orgFatherorg; + } + + public void setOrgFatherorg(String orgFatherorg) { + this.orgFatherorg = orgFatherorg; + } + + public String getOrgPrincipal() { + return orgPrincipal; + } + + public void setOrgPrincipal(String orgPrincipal) { + this.orgPrincipal = orgPrincipal; + } + + public String getOrgTel() { + return orgTel; + } + + public void setOrgTel(String orgTel) { + this.orgTel = orgTel; + } + + public String getDataStatus() { + return dataStatus; + } + + public void setDataStatus(String dataStatus) { + this.dataStatus = dataStatus; + } + + public String getAddStatus() { + return addStatus; + } + + public void setAddStatus(String addStatus) { + this.addStatus = addStatus; + } + + public String getUpdateStatus() { + return updateStatus; + } + + public void setUpdateStatus(String updateStatus) { + this.updateStatus = updateStatus; + } + + public String getDeleteStatus() { + return deleteStatus; + } + + public void setDeleteStatus(String deleteStatus) { + this.deleteStatus = deleteStatus; + } + + public String getCompanyId() { + return companyId; + } + + public void setCompanyId(String companyId) { + this.companyId = companyId; + } + +} + diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/org/entity/MdmOrgEntity.xml b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/org/entity/MdmOrgEntity.xml new file mode 100644 index 00000000..c14c6a01 --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/org/entity/MdmOrgEntity.xml @@ -0,0 +1,388 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + id + ,document_rule + ,document_rule_num + ,org_code + ,org_name + ,org_address + ,org_countryzone + ,org_innercode + ,org_memo + ,org_mnecode + ,org_ncindustry + ,org_fatherorg + ,org_principal + ,org_tel + ,data_status + ,add_status + ,update_status + ,delete_status + ,sorts + ,create_user_id + ,create_time + ,modify_user_id + ,modify_time + ,sts + ,org_id + ,company_id + + + + + + + + + + + + + + + + insert into mdm_org( + + id , + document_rule , + document_rule_num , + org_code , + org_name , + org_address , + org_countryzone , + org_innercode , + org_memo , + org_mnecode , + org_ncindustry , + org_fatherorg , + org_principal , + org_tel , + data_status , + add_status , + update_status , + delete_status , + sorts , + create_user_id , + create_time , + modify_user_id , + modify_time , + sts , + org_id , + company_id , + sorts, + sts, + + )values( + + #{id} , + #{documentRule} , + #{documentRuleNum} , + #{orgCode} , + #{orgName} , + #{orgAddress} , + #{orgCountryzone} , + #{orgInnercode} , + #{orgMemo} , + #{orgMnecode} , + #{orgNcindustry} , + #{orgFatherorg} , + #{orgPrincipal} , + #{orgTel} , + #{dataStatus} , + #{addStatus} , + #{updateStatus} , + #{deleteStatus} , + #{sorts} , + #{create_user_id} , + #{create_time} , + #{modify_user_id} , + #{modify_time} , + #{sts} , + #{org_id} , + #{companyId} , + (select (max(IFNULL( a.sorts, 0 )) + 1) as sort from mdm_org a WHERE a.sts = 'Y' ), + 'Y', + + ) + + + + insert into mdm_org(document_rule, document_rule_num, org_code, org_name, org_address, org_countryzone, org_innercode, org_memo, org_mnecode, org_ncindustry, org_fatherorg, org_principal, org_tel, data_status, add_status, update_status, delete_status, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, sts) + values + + (#{entity.documentRule},#{entity.documentRuleNum},#{entity.orgCode},#{entity.orgName},#{entity.orgAddress},#{entity.orgCountryzone},#{entity.orgInnercode},#{entity.orgMemo},#{entity.orgMnecode},#{entity.orgNcindustry},#{entity.orgFatherorg},#{entity.orgPrincipal},#{entity.orgTel},#{entity.dataStatus},#{entity.addStatus},#{entity.updateStatus},#{entity.deleteStatus},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId}, 'Y') + + + + + insert into mdm_org(document_rule, document_rule_num, org_code, org_name, org_address, org_countryzone, org_innercode, org_memo, org_mnecode, org_ncindustry, org_fatherorg, org_principal, org_tel, data_status, add_status, update_status, delete_status, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id) + values + + (#{entity.documentRule},#{entity.documentRuleNum},#{entity.orgCode},#{entity.orgName},#{entity.orgAddress},#{entity.orgCountryzone},#{entity.orgInnercode},#{entity.orgMemo},#{entity.orgMnecode},#{entity.orgNcindustry},#{entity.orgFatherorg},#{entity.orgPrincipal},#{entity.orgTel},#{entity.dataStatus},#{entity.addStatus},#{entity.updateStatus},#{entity.deleteStatus},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId}) + + on duplicate key update + document_rule = values(document_rule), + document_rule_num = values(document_rule_num), + org_code = values(org_code), + org_name = values(org_name), + org_address = values(org_address), + org_countryzone = values(org_countryzone), + org_innercode = values(org_innercode), + org_memo = values(org_memo), + org_mnecode = values(org_mnecode), + org_ncindustry = values(org_ncindustry), + org_fatherorg = values(org_fatherorg), + org_principal = values(org_principal), + org_tel = values(org_tel), + data_status = values(data_status), + add_status = values(add_status), + update_status = values(update_status), + delete_status = values(delete_status), + create_user_id = values(create_user_id), + create_time = values(create_time), + modify_user_id = values(modify_user_id), + modify_time = values(modify_time), + sts = values(sts), + org_id = values(org_id), + company_id = values(company_id) + + +update mdm_org set + + document_rule = #{documentRule}, + document_rule_num = #{documentRuleNum}, + org_code = #{orgCode}, + org_name = #{orgName}, + org_address = #{orgAddress}, + org_countryzone = #{orgCountryzone}, + org_innercode = #{orgInnercode}, + org_memo = #{orgMemo}, + org_mnecode = #{orgMnecode}, + org_ncindustry = #{orgNcindustry}, + org_fatherorg = #{orgFatherorg}, + org_principal = #{orgPrincipal}, + org_tel = #{orgTel}, + data_status = #{dataStatus}, + add_status = #{addStatus}, + update_status = #{updateStatus}, + delete_status = #{deleteStatus}, + create_user_id = #{create_user_id}, + create_time = #{create_time}, + modify_user_id = #{modify_user_id}, + modify_time = #{modify_time}, + sts = #{sts}, + org_id = #{org_id}, + company_id = #{companyId}, + +where id = #{id} + + + +update mdm_org set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} +where id = #{id} + + + +update mdm_org set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} + + and id = #{id} + and document_rule = #{documentRule} + and document_rule_num = #{documentRuleNum} + and org_code = #{orgCode} + and org_name = #{orgName} + and org_address = #{orgAddress} + and org_countryzone = #{orgCountryzone} + and org_innercode = #{orgInnercode} + and org_memo = #{orgMemo} + and org_mnecode = #{orgMnecode} + and org_ncindustry = #{orgNcindustry} + and org_fatherorg = #{orgFatherorg} + and org_principal = #{orgPrincipal} + and org_tel = #{orgTel} + and data_status = #{dataStatus} + and add_status = #{addStatus} + and update_status = #{updateStatus} + and delete_status = #{deleteStatus} + and sorts = #{sorts} + and sts = #{sts} + and company_id = #{companyId} + and sts='Y' + + + + + delete from mdm_org where id = #{id} + + + + diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/org/plugin/MdmOrgPluginInitializer.java b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/org/plugin/MdmOrgPluginInitializer.java new file mode 100644 index 00000000..f4e7c8f6 --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/org/plugin/MdmOrgPluginInitializer.java @@ -0,0 +1,62 @@ +package com.hzya.frame.plugin.masterData.org.plugin; + +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.base.PluginBaseEntity; +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; + +/** + * 组织档案(MdmOrg)表服务接口 + * + * @author makejava + * @since 2024-06-07 18:30:05 + */ +public class MdmOrgPluginInitializer extends PluginBaseEntity{ + Logger logger = LoggerFactory.getLogger(MdmOrgPluginInitializer.class); + @Autowired + private MasterDataOrgsServiceImpl masterDataOrgsService; + + @Override + public void initialize() { + logger.info(getPluginLabel() + "執行初始化方法initialize()"); + } + + @Override + public void destroy() { + logger.info(getPluginLabel() + "執行銷毀方法destroy()"); + } + + @Override + public String getPluginId() { + return "MdmOrgPlugin"; + } + + @Override + public String getPluginName() { + return "MdmOrgPlugin插件"; + } + + @Override + public String getPluginLabel() { + return "MdmOrgPlugin"; + } + + @Override + public String getPluginType() { + return "1"; + } + @Override + public JsonResultEntity executeBusiness(JSONObject requestJson) { + try { + logger.info("======开始执行主数据档案组织档案同步========"); + return masterDataOrgsService.queryOrgsArchives(requestJson); + }catch (Exception e){ + logger.info("======执行主数据档案组织档案同步失败:{}========",e.getMessage()); + e.printStackTrace(); + } + return null; + } +} diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/org/service/IMdmOrgService.java b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/org/service/IMdmOrgService.java new file mode 100644 index 00000000..fe82b199 --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/org/service/IMdmOrgService.java @@ -0,0 +1,12 @@ +package masterData.service; + +import masterData.entity.MdmOrgEntity; +import com.hzya.frame.basedao.service.IBaseService; +/** + * 组织档案(MdmOrg)表服务接口 + * + * @author makejava + * @since 2024-06-07 18:30:05 + */ +public interface IMdmOrgService extends IBaseService{ +} diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/org/service/impl/MdmOrgServiceImpl.java b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/org/service/impl/MdmOrgServiceImpl.java new file mode 100644 index 00000000..700a73ce --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/org/service/impl/MdmOrgServiceImpl.java @@ -0,0 +1,25 @@ +package masterData.service.impl; + +import masterData.entity.MdmOrgEntity; +import masterData.dao.IMdmOrgDao; +import masterData.service.IMdmOrgService; +import org.springframework.stereotype.Service; +import org.springframework.beans.factory.annotation.Autowired; +import javax.annotation.Resource; +import com.hzya.frame.basedao.service.impl.BaseService; +/** + * 组织档案(MdmOrg)表服务实现类 + * + * @author makejava + * @since 2024-06-07 18:30:05 + */ +public class MdmOrgServiceImpl extends BaseService implements IMdmOrgService { + + private IMdmOrgDao mdmOrgDao; + + @Autowired + public void setMdmOrgDao(IMdmOrgDao dao) { + this.mdmOrgDao = dao; + this.dao = dao; + } +} diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/project/dao/IMdmProjectDao.java b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/project/dao/IMdmProjectDao.java new file mode 100644 index 00000000..7389b3cc --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/project/dao/IMdmProjectDao.java @@ -0,0 +1,15 @@ +package masterData.dao; + +import masterData.entity.MdmProjectEntity; +import com.hzya.frame.basedao.dao.IBaseDao; + +/** + * 项目档案(mdm_project: table)表数据库访问层 + * + * @author makejava + * @since 2024-06-07 18:29:23 + */ +public interface IMdmProjectDao extends IBaseDao { + +} + diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/project/dao/impl/MdmProjectDaoImpl.java b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/project/dao/impl/MdmProjectDaoImpl.java new file mode 100644 index 00000000..3da10ccc --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/project/dao/impl/MdmProjectDaoImpl.java @@ -0,0 +1,16 @@ +package masterData.dao.impl; + +import masterData.entity.MdmProjectEntity; +import masterData.dao.IMdmProjectDao; +import org.springframework.stereotype.Repository; +import com.hzya.frame.basedao.dao.MybatisGenericDao; +/** + * 项目档案(MdmProject)表数据库访问层 + * + * @author makejava + * @since 2024-06-07 18:29:23 + */ +public class MdmProjectDaoImpl extends MybatisGenericDao implements IMdmProjectDao{ + +} + diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/project/entity/MdmProjectEntity.java b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/project/entity/MdmProjectEntity.java new file mode 100644 index 00000000..958d6fc5 --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/project/entity/MdmProjectEntity.java @@ -0,0 +1,186 @@ +package masterData.entity; + +import java.util.Date; +import com.hzya.frame.web.entity.BaseEntity; +/** + * 项目档案(MdmProject)实体类 + * + * @author makejava + * @since 2024-06-07 18:29:23 + */ +public class MdmProjectEntity extends BaseEntity { + + /** 单据规则 */ + private String documentRule; + /** 单据规则流水号 */ + private Long documentRuleNum; + /** 项目编码 */ + private String projectCode; + /** 项目名称 */ + private String projectName; + /** 单据类型 */ + private String projectBillType; + /** 备注 */ + private String projectMemo; + /** 币种 */ + private String projectCurrtype; + /** 责任人 */ + private String projectDutier; + /** 责任部门 */ + private String projectDutyDept; + /** 管理组织 */ + private String projectOrg; + /** 父项目 */ + private String projectParentpro; + /** 项目简称 */ + private String projectShName; + /** 数据状态 Y正常 N删除 F修改 */ + private String dataStatus; + /** 新增数据状态 0待下发 1已下发 */ + private String addStatus; + /** 修改数据状态 0待下发 1已下发 */ + private String updateStatus; + /** 删除数据状态 0待下发 1已下发 */ + private String deleteStatus; + /** 公司id */ + private String companyId; + + + public String getDocumentRule() { + return documentRule; + } + + public void setDocumentRule(String documentRule) { + this.documentRule = documentRule; + } + + public Long getDocumentRuleNum() { + return documentRuleNum; + } + + public void setDocumentRuleNum(Long documentRuleNum) { + this.documentRuleNum = documentRuleNum; + } + + public String getProjectCode() { + return projectCode; + } + + public void setProjectCode(String projectCode) { + this.projectCode = projectCode; + } + + public String getProjectName() { + return projectName; + } + + public void setProjectName(String projectName) { + this.projectName = projectName; + } + + public String getProjectBillType() { + return projectBillType; + } + + public void setProjectBillType(String projectBillType) { + this.projectBillType = projectBillType; + } + + public String getProjectMemo() { + return projectMemo; + } + + public void setProjectMemo(String projectMemo) { + this.projectMemo = projectMemo; + } + + public String getProjectCurrtype() { + return projectCurrtype; + } + + public void setProjectCurrtype(String projectCurrtype) { + this.projectCurrtype = projectCurrtype; + } + + public String getProjectDutier() { + return projectDutier; + } + + public void setProjectDutier(String projectDutier) { + this.projectDutier = projectDutier; + } + + public String getProjectDutyDept() { + return projectDutyDept; + } + + public void setProjectDutyDept(String projectDutyDept) { + this.projectDutyDept = projectDutyDept; + } + + public String getProjectOrg() { + return projectOrg; + } + + public void setProjectOrg(String projectOrg) { + this.projectOrg = projectOrg; + } + + public String getProjectParentpro() { + return projectParentpro; + } + + public void setProjectParentpro(String projectParentpro) { + this.projectParentpro = projectParentpro; + } + + public String getProjectShName() { + return projectShName; + } + + public void setProjectShName(String projectShName) { + this.projectShName = projectShName; + } + + public String getDataStatus() { + return dataStatus; + } + + public void setDataStatus(String dataStatus) { + this.dataStatus = dataStatus; + } + + public String getAddStatus() { + return addStatus; + } + + public void setAddStatus(String addStatus) { + this.addStatus = addStatus; + } + + public String getUpdateStatus() { + return updateStatus; + } + + public void setUpdateStatus(String updateStatus) { + this.updateStatus = updateStatus; + } + + public String getDeleteStatus() { + return deleteStatus; + } + + public void setDeleteStatus(String deleteStatus) { + this.deleteStatus = deleteStatus; + } + + public String getCompanyId() { + return companyId; + } + + public void setCompanyId(String companyId) { + this.companyId = companyId; + } + +} + diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/project/entity/MdmProjectEntity.xml b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/project/entity/MdmProjectEntity.xml new file mode 100644 index 00000000..6003878f --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/project/entity/MdmProjectEntity.xml @@ -0,0 +1,377 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + id + ,document_rule + ,document_rule_num + ,project_code + ,project_name + ,project_bill_type + ,project_memo + ,project_currtype + ,project_dutier + ,project_duty_dept + ,project_org + ,project_parentpro + ,project_sh_name + ,data_status + ,add_status + ,update_status + ,delete_status + ,sorts + ,create_user_id + ,create_time + ,modify_user_id + ,modify_time + ,sts + ,org_id + ,company_id + + + + + + + + + + + + + + + + insert into mdm_project( + + id , + document_rule , + document_rule_num , + project_code , + project_name , + project_bill_type , + project_memo , + project_currtype , + project_dutier , + project_duty_dept , + project_org , + project_parentpro , + project_sh_name , + data_status , + add_status , + update_status , + delete_status , + sorts , + create_user_id , + create_time , + modify_user_id , + modify_time , + sts , + org_id , + company_id , + sorts, + sts, + + )values( + + #{id} , + #{documentRule} , + #{documentRuleNum} , + #{projectCode} , + #{projectName} , + #{projectBillType} , + #{projectMemo} , + #{projectCurrtype} , + #{projectDutier} , + #{projectDutyDept} , + #{projectOrg} , + #{projectParentpro} , + #{projectShName} , + #{dataStatus} , + #{addStatus} , + #{updateStatus} , + #{deleteStatus} , + #{sorts} , + #{create_user_id} , + #{create_time} , + #{modify_user_id} , + #{modify_time} , + #{sts} , + #{org_id} , + #{companyId} , + (select (max(IFNULL( a.sorts, 0 )) + 1) as sort from mdm_project a WHERE a.sts = 'Y' ), + 'Y', + + ) + + + + insert into mdm_project(document_rule, document_rule_num, project_code, project_name, project_bill_type, project_memo, project_currtype, project_dutier, project_duty_dept, project_org, project_parentpro, project_sh_name, data_status, add_status, update_status, delete_status, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, sts) + values + + (#{entity.documentRule},#{entity.documentRuleNum},#{entity.projectCode},#{entity.projectName},#{entity.projectBillType},#{entity.projectMemo},#{entity.projectCurrtype},#{entity.projectDutier},#{entity.projectDutyDept},#{entity.projectOrg},#{entity.projectParentpro},#{entity.projectShName},#{entity.dataStatus},#{entity.addStatus},#{entity.updateStatus},#{entity.deleteStatus},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId}, 'Y') + + + + + insert into mdm_project(document_rule, document_rule_num, project_code, project_name, project_bill_type, project_memo, project_currtype, project_dutier, project_duty_dept, project_org, project_parentpro, project_sh_name, data_status, add_status, update_status, delete_status, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id) + values + + (#{entity.documentRule},#{entity.documentRuleNum},#{entity.projectCode},#{entity.projectName},#{entity.projectBillType},#{entity.projectMemo},#{entity.projectCurrtype},#{entity.projectDutier},#{entity.projectDutyDept},#{entity.projectOrg},#{entity.projectParentpro},#{entity.projectShName},#{entity.dataStatus},#{entity.addStatus},#{entity.updateStatus},#{entity.deleteStatus},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId}) + + on duplicate key update + document_rule = values(document_rule), + document_rule_num = values(document_rule_num), + project_code = values(project_code), + project_name = values(project_name), + project_bill_type = values(project_bill_type), + project_memo = values(project_memo), + project_currtype = values(project_currtype), + project_dutier = values(project_dutier), + project_duty_dept = values(project_duty_dept), + project_org = values(project_org), + project_parentpro = values(project_parentpro), + project_sh_name = values(project_sh_name), + data_status = values(data_status), + add_status = values(add_status), + update_status = values(update_status), + delete_status = values(delete_status), + create_user_id = values(create_user_id), + create_time = values(create_time), + modify_user_id = values(modify_user_id), + modify_time = values(modify_time), + sts = values(sts), + org_id = values(org_id), + company_id = values(company_id) + + +update mdm_project set + + document_rule = #{documentRule}, + document_rule_num = #{documentRuleNum}, + project_code = #{projectCode}, + project_name = #{projectName}, + project_bill_type = #{projectBillType}, + project_memo = #{projectMemo}, + project_currtype = #{projectCurrtype}, + project_dutier = #{projectDutier}, + project_duty_dept = #{projectDutyDept}, + project_org = #{projectOrg}, + project_parentpro = #{projectParentpro}, + project_sh_name = #{projectShName}, + data_status = #{dataStatus}, + add_status = #{addStatus}, + update_status = #{updateStatus}, + delete_status = #{deleteStatus}, + create_user_id = #{create_user_id}, + create_time = #{create_time}, + modify_user_id = #{modify_user_id}, + modify_time = #{modify_time}, + sts = #{sts}, + org_id = #{org_id}, + company_id = #{companyId}, + +where id = #{id} + + + +update mdm_project set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} +where id = #{id} + + + +update mdm_project set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} + + and id = #{id} + and document_rule = #{documentRule} + and document_rule_num = #{documentRuleNum} + and project_code = #{projectCode} + and project_name = #{projectName} + and project_bill_type = #{projectBillType} + and project_memo = #{projectMemo} + and project_currtype = #{projectCurrtype} + and project_dutier = #{projectDutier} + and project_duty_dept = #{projectDutyDept} + and project_org = #{projectOrg} + and project_parentpro = #{projectParentpro} + and project_sh_name = #{projectShName} + and data_status = #{dataStatus} + and add_status = #{addStatus} + and update_status = #{updateStatus} + and delete_status = #{deleteStatus} + and sorts = #{sorts} + and sts = #{sts} + and company_id = #{companyId} + and sts='Y' + + + + + delete from mdm_project where id = #{id} + + + + diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/project/plugin/MdmProjectPluginInitializer.java b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/project/plugin/MdmProjectPluginInitializer.java new file mode 100644 index 00000000..0a554a69 --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/project/plugin/MdmProjectPluginInitializer.java @@ -0,0 +1,64 @@ +package com.hzya.frame.plugin.masterData.project.plugin; + +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.base.PluginBaseEntity; +import com.hzya.frame.sysnew.comparison.masterData.service.impl.MasterDataProjectServiceImpl; +import com.hzya.frame.web.entity.JsonResultEntity; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; + +/** + * 项目档案(MdmProject)表服务接口 + * + * @author makejava + * @since 2024-06-07 18:29:23 + */ +public class MdmProjectPluginInitializer extends PluginBaseEntity{ + Logger logger = LoggerFactory.getLogger(MdmProjectPluginInitializer.class); + + @Autowired + private MasterDataProjectServiceImpl masterDataProjectService; + + @Override + public void initialize() { + logger.info(getPluginLabel() + "執行初始化方法initialize()"); + } + + @Override + public void destroy() { + logger.info(getPluginLabel() + "執行銷毀方法destroy()"); + } + + @Override + public String getPluginId() { + return "MdmProjectPlugin"; + } + + @Override + public String getPluginName() { + return "MdmProjectPlugin插件"; + } + + @Override + public String getPluginLabel() { + return "MdmProjectPlugin"; + } + + @Override + public String getPluginType() { + return "1"; + } + @Override + public JsonResultEntity executeBusiness(JSONObject requestJson) { + try { + logger.info("=====开始执行主数据档案项目档案同步======="); + JsonResultEntity jsonResultEntity = masterDataProjectService.queryProjectArchives(requestJson); + return jsonResultEntity; + }catch (Exception e){ + logger.info("======执行主数据档案项目档案同步失败:{}",e.getMessage()); + e.printStackTrace(); + } + return null; + } +} diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/project/service/IMdmProjectService.java b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/project/service/IMdmProjectService.java new file mode 100644 index 00000000..58e801b2 --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/project/service/IMdmProjectService.java @@ -0,0 +1,12 @@ +package masterData.service; + +import masterData.entity.MdmProjectEntity; +import com.hzya.frame.basedao.service.IBaseService; +/** + * 项目档案(MdmProject)表服务接口 + * + * @author makejava + * @since 2024-06-07 18:29:23 + */ +public interface IMdmProjectService extends IBaseService{ +} diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/project/service/impl/MdmProjectServiceImpl.java b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/project/service/impl/MdmProjectServiceImpl.java new file mode 100644 index 00000000..4dc5e249 --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/project/service/impl/MdmProjectServiceImpl.java @@ -0,0 +1,25 @@ +package masterData.service.impl; + +import masterData.entity.MdmProjectEntity; +import masterData.dao.IMdmProjectDao; +import masterData.service.IMdmProjectService; +import org.springframework.stereotype.Service; +import org.springframework.beans.factory.annotation.Autowired; +import javax.annotation.Resource; +import com.hzya.frame.basedao.service.impl.BaseService; +/** + * 项目档案(MdmProject)表服务实现类 + * + * @author makejava + * @since 2024-06-07 18:29:23 + */ +public class MdmProjectServiceImpl extends BaseService implements IMdmProjectService { + + private IMdmProjectDao mdmProjectDao; + + @Autowired + public void setMdmProjectDao(IMdmProjectDao dao) { + this.mdmProjectDao = dao; + this.dao = dao; + } +} From f379c3d821ddab92e24bf10611557b33764743d1 Mon Sep 17 00:00:00 2001 From: hecan <1718492867@qq.com> Date: Tue, 11 Jun 2024 09:56:39 +0800 Subject: [PATCH 49/80] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=8F=92=E4=BB=B6?= =?UTF-8?q?=E7=BC=96=E7=A0=81=E5=B1=9E=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mdm/mdmModuleSource/entity/MdmModuleSourceEntity.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleSource/entity/MdmModuleSourceEntity.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleSource/entity/MdmModuleSourceEntity.java index 2cc45fb4..84e0358b 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleSource/entity/MdmModuleSourceEntity.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleSource/entity/MdmModuleSourceEntity.java @@ -20,7 +20,15 @@ public class MdmModuleSourceEntity extends BaseEntity { private String sourceCode; /** 公司id */ private String companyId; + private String pluginCode;//插件编码 + public String getPluginCode() { + return pluginCode; + } + + public void setPluginCode(String pluginCode) { + this.pluginCode = pluginCode; + } public String getMdmId() { return mdmId; From 65aaa0878baa226830e374a2f32d10e6506dd6b2 Mon Sep 17 00:00:00 2001 From: hecan <1718492867@qq.com> Date: Tue, 11 Jun 2024 09:57:29 +0800 Subject: [PATCH 50/80] =?UTF-8?q?=E9=80=9A=E7=94=A8=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sysnew/comparison/dao/IComparisonDao.java | 9 - .../dao/impl/ComparisonDaoImpl.java | 6 - .../comparison/entity/ComparisonEntity.java | 6 +- .../comparison/entity/ComparisonEntity.xml | 15 +- .../service/impl/ComparisonServiceImpl.java | 201 +++++++++++++++--- 5 files changed, 181 insertions(+), 56 deletions(-) diff --git a/service/src/main/java/com/hzya/frame/sysnew/comparison/dao/IComparisonDao.java b/service/src/main/java/com/hzya/frame/sysnew/comparison/dao/IComparisonDao.java index 42b171db..97653c9a 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/comparison/dao/IComparisonDao.java +++ b/service/src/main/java/com/hzya/frame/sysnew/comparison/dao/IComparisonDao.java @@ -110,13 +110,4 @@ public interface IComparisonDao extends IBaseDao { * **/ List queryComparisonBymdmIdFileds(ComparisonEntity comparison); - /** - * - * @content 根据数据来源内类型是插件的应用类型做分组 - * @Param - * @Return - * @Author hecan - * @Date 2024/6/4 17:41 - * **/ - List queryModuleSource(); } diff --git a/service/src/main/java/com/hzya/frame/sysnew/comparison/dao/impl/ComparisonDaoImpl.java b/service/src/main/java/com/hzya/frame/sysnew/comparison/dao/impl/ComparisonDaoImpl.java index 4c8a0298..d50098cb 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/comparison/dao/impl/ComparisonDaoImpl.java +++ b/service/src/main/java/com/hzya/frame/sysnew/comparison/dao/impl/ComparisonDaoImpl.java @@ -81,10 +81,4 @@ public class ComparisonDaoImpl extends MybatisGenericDao queryModuleSource() { - List list =(List) super.selectList(getSqlIdPrifx() + "queryModuleSource",""); - return list; - } } diff --git a/service/src/main/java/com/hzya/frame/sysnew/comparison/entity/ComparisonEntity.java b/service/src/main/java/com/hzya/frame/sysnew/comparison/entity/ComparisonEntity.java index a47e7a3f..6a97f2b4 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/comparison/entity/ComparisonEntity.java +++ b/service/src/main/java/com/hzya/frame/sysnew/comparison/entity/ComparisonEntity.java @@ -32,7 +32,7 @@ public class ComparisonEntity extends BaseEntity { private String rulePrefix;//规则前缀 CK-yyyyMMdd-0001中的CK private String ruleMiddle;//规则中间 CK-yyyyMMdd-0001中的yyyyMMdd - private String ruleSuffix;//规则后缀 CK-yyyyMMdd-0001中的0001 + private int ruleSuffix;//规则后缀 CK-yyyyMMdd-0001中的0001 private String mId;//mdm_module的id private String dbId;//mdm_module_db的id @@ -100,11 +100,11 @@ public class ComparisonEntity extends BaseEntity { this.ruleMiddle = ruleMiddle; } - public String getRuleSuffix() { + public int getRuleSuffix() { return ruleSuffix; } - public void setRuleSuffix(String ruleSuffix) { + public void setRuleSuffix(int ruleSuffix) { this.ruleSuffix = ruleSuffix; } 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 906661bd..d24c345d 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 @@ -35,7 +35,7 @@ left join mdm_module_db moddb on m.id=moddb.mdm_id left join mdm_module_db_fileds filed on filed.mdm_id=m.id and filed.db_id=moddb.id - where m.mdm_code= #{mdmCode} + where m.mdm_code= #{mdmCode} and (moddb.db_type='1' or moddb.db_type='2') @@ -61,7 +61,7 @@ update_type as updateType,show_type as showType, query_type as queryType, list_type as listType, view_type as viewType,mdm_id as mId,db_id as dbId from mdm_module_db_fileds - where mdm_id= #{mId} and sts='Y' + where db_id= #{dbId} and sts='Y' @@ -74,21 +74,14 @@ - - - - insert into ${dbName} 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 931ed6e6..76ba706d 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 @@ -6,16 +6,21 @@ import com.alibaba.fastjson.JSONObject; import com.baomidou.dynamic.datasource.annotation.DS; import com.github.pagehelper.PageInfo; import com.hzya.frame.basedao.service.impl.BaseService; +import com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity; +import com.hzya.frame.mdm.mdmModuleDb.entity.MdmModuleDbEntity; +import com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity; +import com.hzya.frame.mdm.service.impl.MdmServiceCache; +import com.hzya.frame.sysnew.comparison.controlsLog.dao.impl.ControlsLogDaoImpl; import com.hzya.frame.sysnew.comparison.dao.IComparisonDao; import com.hzya.frame.sysnew.comparison.dao.IComparisonDetailsDao; import com.hzya.frame.sysnew.comparison.entity.ComparisonDetailsEntity; import com.hzya.frame.sysnew.comparison.entity.ComparisonEntity; import com.hzya.frame.sysnew.comparison.service.IComparisonService; -import com.hzya.frame.sysnew.generalData.dao.IGeneralDataDao; import com.hzya.frame.uuid.UUIDUtils; import com.hzya.frame.web.entity.BaseResult; import com.hzya.frame.web.entity.JsonResultEntity; import org.apache.commons.collections.CollectionUtils; +import org.apache.ivy.Main; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import sun.java2d.pipe.AAShapePipe; @@ -30,6 +35,12 @@ public class ComparisonServiceImpl extends BaseService @Autowired private IComparisonDetailsDao comparisonDetailsDao; + @Autowired + private ControlsLogDaoImpl controlsLogDaoimpl; + + @Autowired + private MdmServiceCache mdmServiceCache; + @Autowired public void setGeneralDataDao(IComparisonDao dao) { this.comparisonDao = dao; @@ -53,7 +64,8 @@ public class ComparisonServiceImpl extends BaseService //根据主数据编码查询表名称,字段名称等信息 10001 //comparisonEntities = comparisonDao.queryComparison(comparisonEntity); - comparisonEntities=getComparisonEntity(comparisonEntity); + //comparisonEntities=getComparisonEntity(comparisonEntity); + comparisonEntities=getComparisonEntityCache(comparisonEntity,"main"); }catch (Exception e){ logger.info("根据主数据编码查询信息错误:{}",e.getMessage()); return BaseResult.getFailureMessageEntity("查询失败"); @@ -95,6 +107,9 @@ public class ComparisonServiceImpl extends BaseService if (!checkStr(jsonObject.getString("mdmCode"))) { return BaseResult.getFailureMessageEntity("主数据编码为空"); } + if (!checkStr(jsonObject.getString("optionName"))) { + return BaseResult.getFailureMessageEntity("操作人为空"); + } /*if (!checkStr(jsonObject.getString("rulePrefix"))) { return BaseResult.getFailureMessageEntity("规则为空"); }*/ @@ -105,7 +120,8 @@ public class ComparisonServiceImpl extends BaseService //根据主数据编码查询表名称,字段名称等信息 10001 // comparisonEntities = comparisonDao.queryComparison(comparisonEntity); - comparisonEntities=getComparisonEntity(comparisonEntity); + //comparisonEntities=getComparisonEntity(comparisonEntity); + comparisonEntities=getComparisonEntityCache(comparisonEntity,"main"); }catch (Exception e){ logger.info("根据主数据编码查询信息错误:{}",e.getMessage()); return BaseResult.getFailureMessageEntity("保存失败"); @@ -119,20 +135,27 @@ public class ComparisonServiceImpl extends BaseService if (comparisonEntities != null && comparisonEntities.size() > 0) { map=spliceMainMap(comparisonEntities,jsonObjectMain,map,comparisonEntity); mapDetails=spliceDetailMap(comparisonEntities,mapDetails,comparisonDetailsEntity,jsonArray); - String uuid = UUIDUtils.getUUID(); - map.put("id", uuid); + 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 comparisonEntityRule = comparisonEntities.get(0); comparisonEntityRule= comparisonDao.queryComparisonById(comparisonEntityRule); String documentRule =comparisonEntityRule.getDocumentRule();; //"KH-2024-05-30-1"; logger.info("通用数据保存接口中根据mId查询出来的单据规则为:{}",documentRule); @@ -143,7 +166,8 @@ public class ComparisonServiceImpl extends BaseService String ruleDate = documentRule.substring(documentRule.indexOf("-") + 1, documentRule.lastIndexOf("-")); String ruleMiddle = getRuleDate(ruleDate); //获取规则后缀 - String ruleSuffix= documentRule.substring(documentRule.lastIndexOf("-")+1); + String ruleSuffixLength= documentRule.substring(documentRule.lastIndexOf("-")+1); + int ruleSuffix = ruleSuffixLength.length(); //生成单据规则 comparisonEntity.setRulePrefix(rulePrefix); comparisonEntity.setRuleMiddle(ruleMiddle); @@ -168,7 +192,8 @@ public class ComparisonServiceImpl extends BaseService ComparisonEntity comparisonEntityOne = comparisonDao.saveComparison(comparisonEntity); //保存子表数据 if (mapDetails != null && mapDetails.size() > 0) { - mapDetails.put("id", UUIDUtils.getUUID()); + 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"); @@ -176,11 +201,17 @@ public class ComparisonServiceImpl extends BaseService 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); + //comparisonEntityOne.setComparisonDetailsEntity(comparisonDetailsEntityOne); + map.put("details",mapDetails); + //保存操作日志 + controlsLogDaoimpl.saveControlsLog(uuidDetail,jsonObject.getString("sourceName"),jsonObject.getString("code"),jsonObject.toJSONString(),"接口新增",jsonObject.getString("optionName"),comparisonDetailsEntity.getDbName()+"_option_log"); } - return BaseResult.getSuccessMessageEntity("保存成功", comparisonEntityOne); + //保存操作日志 + controlsLogDaoimpl.saveControlsLog(uuid,jsonObject.getString("sourceName"),jsonObject.getString("code"),jsonObject.toJSONString(),"接口新增",jsonObject.getString("optionName"),comparisonEntity.getDbName()+"_option_log"); + return BaseResult.getSuccessMessageEntity("保存成功", map); } catch (Exception e) { logger.info("保存通用数据时候错误:{}", e.getMessage()); return BaseResult.getFailureMessageEntity("保存失败"); @@ -200,6 +231,9 @@ public class ComparisonServiceImpl extends BaseService if (!checkStr(jsonObject.getString("mdmCode"))) { return BaseResult.getFailureMessageEntity("主数据编码为空"); } + if (!checkStr(jsonObject.getString("optionName"))) { + return BaseResult.getFailureMessageEntity("操作人为空"); + } ComparisonEntity comparisonEntity = jsonObject.toJavaObject(ComparisonEntity.class); ComparisonDetailsEntity comparisonDetailsEntity=new ComparisonDetailsEntity(); JSONObject jsonObjectMain=jsonObject.getJSONObject("main");//获取主表数据 @@ -212,7 +246,8 @@ public class ComparisonServiceImpl extends BaseService try { // comparisonEntities = comparisonDao.queryComparison(comparisonEntity); - comparisonEntities=getComparisonEntity(comparisonEntity); + //comparisonEntities=getComparisonEntity(comparisonEntity); + comparisonEntities=getComparisonEntityCache(comparisonEntity,"main"); }catch (Exception e){ logger.info("根据主数据编码查询信息错误:{}",e.getMessage()); return BaseResult.getFailureMessageEntity("更新失败"); @@ -221,7 +256,7 @@ public class ComparisonServiceImpl extends BaseService Map mapDetails=new HashMap<>();//将子表数据存到map中 if(comparisonEntities !=null && comparisonEntities.size()>0) { map=spliceMainMap(comparisonEntities,jsonObjectMain,map,comparisonEntity); - mapDetails=spliceDetailMap(comparisonEntities,map,comparisonDetailsEntity,jsonArray); + mapDetails=spliceDetailMap(comparisonEntities,mapDetails,comparisonDetailsEntity,jsonArray); map.put("create_user_id", "c796fd9ba4c9f5ff3cc2fa41a040e443"); map.put("modify_user_id", "c796fd9ba4c9f5ff3cc2fa41a040e443"); map.put("org_id", "0"); @@ -256,7 +291,11 @@ public class ComparisonServiceImpl extends BaseService comparisonDetailsEntity.setFormmainId(jsonObjectMain.getString("id")); comparisonDetailsEntity.setMapDetails(mapDetails); comparisonDetailsDao.updateComparisonDetailsByType(comparisonDetailsEntity); + //保存操作日志 + controlsLogDaoimpl.saveControlsLog(comparisonDetailsEntity.getId(),jsonObject.getString("sourceName"),jsonObject.getString("code"),jsonObject.toJSONString(),"接口更新",jsonObject.getString("optionName"),comparisonDetailsEntity.getDbName()+"_option_log"); } + //保存操作日志 + controlsLogDaoimpl.saveControlsLog(comparisonEntity.getId(),jsonObject.getString("sourceName"),jsonObject.getString("code"),jsonObject.toJSONString(),"接口更新",jsonObject.getString("optionName"),comparisonEntity.getDbName()+"_option_log"); return BaseResult.getSuccessMessageEntity("更新成功", integer); }else{ return BaseResult.getFailureMessageEntity("更新失败"); @@ -290,7 +329,8 @@ public class ComparisonServiceImpl extends BaseService try { // comparisonEntities = comparisonDao.queryComparison(comparisonEntity); - comparisonEntities=getComparisonEntity(comparisonEntity); + //comparisonEntities=getComparisonEntity(comparisonEntity); + comparisonEntities=getComparisonEntityCache(comparisonEntity,"main"); }catch (Exception e){ logger.info("根据主数据编码查询信息错误:{}",e.getMessage()); return BaseResult.getFailureMessageEntity("删除失败"); @@ -321,7 +361,9 @@ public class ComparisonServiceImpl extends BaseService comparisonDetailsEntity.setFormmainId(jsonObjectMain.getString("id")); comparisonDetailsEntity.setModify_user_id("c796fd9ba4c9f5ff3cc2fa41a040e443"); comparisonDetailsDao.deleteComparisonDetails(comparisonDetailsEntity); + controlsLogDaoimpl.saveControlsLog(comparisonDetailsEntity.getId(),jsonObject.getString("sourceName"),jsonObject.getString("code"),jsonObject.toJSONString(),"接口删除",jsonObject.getString("optionName"),comparisonEntity.getDbName()+"_option_log"); } + controlsLogDaoimpl.saveControlsLog(comparisonEntity.getId(),jsonObject.getString("sourceName"),jsonObject.getString("code"),jsonObject.toJSONString(),"接口删除",jsonObject.getString("optionName"),comparisonEntity.getDbName()+"_option_log"); return BaseResult.getSuccessMessageEntity("删除成功",integer); }else{ return BaseResult.getFailureMessageEntity("删除失败","请查看id是否在表中存在"); @@ -390,6 +432,92 @@ public class ComparisonServiceImpl extends BaseService return mapDetails; } + //根据主数据编码获取主表和明细表表名称,表字段信息 + public List getComparisonEntityCache(ComparisonEntity comparison,String type){ + List comparisonEntities = new ArrayList<>(); + //根据主数据编号获取模板主表 + MdmModuleEntity mdmModuleEntity = mdmServiceCache.getMdmModuleEntity(Long.valueOf(comparison.getMdmCode())); + //根据模板主表id获取模版表数据 + if(mdmModuleEntity!=null){ + MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); + mdmModuleDbEntity.setMdmId(mdmModuleEntity.getId()); + List mdmModuleDbEntities = mdmServiceCache.queryMdmModuleDb(mdmModuleDbEntity); + if(CollectionUtils.isNotEmpty(mdmModuleDbEntities)){ + for (MdmModuleDbEntity moduleDbEntity : mdmModuleDbEntities) { + switch (type){ + case "main": + //获取主表和明细表的字段信息 + if(moduleDbEntity.getDbType().equals("1") || moduleDbEntity.getDbType().equals("2")){ + MdmModuleDbFiledsEntity mdmModuleDbFiledsEntity=new MdmModuleDbFiledsEntity(); + mdmModuleDbFiledsEntity.setMdmId(mdmModuleEntity.getId()); + List mdmModuleDbFiledsEntities = mdmServiceCache.queryMdmModuleDbFileds(mdmModuleDbFiledsEntity); + if(CollectionUtils.isNotEmpty(mdmModuleDbFiledsEntities)){ + for (MdmModuleDbFiledsEntity moduleDbFiledsEntity : mdmModuleDbFiledsEntities) { + if (moduleDbFiledsEntity.getDbId().equals(moduleDbEntity.getId())) { + ComparisonEntity comparisonEntityFile = new ComparisonEntity(); + comparisonEntityFile.setChName(moduleDbFiledsEntity.getChName()); + comparisonEntityFile.setEnName(moduleDbFiledsEntity.getEnName()); + comparisonEntityFile.setFiledType(moduleDbFiledsEntity.getFiledType()); + comparisonEntityFile.setAddType(moduleDbFiledsEntity.getAddType()); + comparisonEntityFile.setUpdateType(moduleDbFiledsEntity.getUpdateType()); + comparisonEntityFile.setShowType(moduleDbFiledsEntity.getShowType()); + comparisonEntityFile.setQueryType(moduleDbFiledsEntity.getQueryType()); + comparisonEntityFile.setListType(moduleDbFiledsEntity.getListType()); + comparisonEntityFile.setViewType(moduleDbFiledsEntity.getViewType()); + comparisonEntityFile.setDbName(moduleDbEntity.getDbName()); + comparisonEntityFile.setDbType(moduleDbEntity.getDbType()); + comparisonEntityFile.setDbId(moduleDbEntity.getId()); + comparisonEntityFile.setmId(mdmModuleEntity.getId()); + comparisonEntityFile.setMdmName(mdmModuleEntity.getMdmName()); + comparisonEntityFile.setMdmCode(String.valueOf(mdmModuleEntity.getMdmCode())); + comparisonEntities.add(comparisonEntityFile); + } + } + } + } + break; + case "option": + //获取主表和明细表的字段信息 + if(moduleDbEntity.getDbType().equals("3")){ + MdmModuleDbFiledsEntity mdmModuleDbFiledsEntity=new MdmModuleDbFiledsEntity(); + mdmModuleDbFiledsEntity.setDbId(moduleDbEntity.getId()); + List mdmModuleDbFiledsEntities = mdmServiceCache.queryMdmModuleDbFileds(mdmModuleDbFiledsEntity); + if(CollectionUtils.isNotEmpty(mdmModuleDbFiledsEntities)){ + for (MdmModuleDbFiledsEntity moduleDbFiledsEntity : mdmModuleDbFiledsEntities) { + if (moduleDbFiledsEntity.getDbId().equals(moduleDbEntity.getId())) { + ComparisonEntity comparisonEntityFile = new ComparisonEntity(); + comparisonEntityFile.setChName(moduleDbFiledsEntity.getChName()); + comparisonEntityFile.setEnName(moduleDbFiledsEntity.getEnName()); + comparisonEntityFile.setFiledType(moduleDbFiledsEntity.getFiledType()); + comparisonEntityFile.setAddType(moduleDbFiledsEntity.getAddType()); + comparisonEntityFile.setUpdateType(moduleDbFiledsEntity.getUpdateType()); + comparisonEntityFile.setShowType(moduleDbFiledsEntity.getShowType()); + comparisonEntityFile.setQueryType(moduleDbFiledsEntity.getQueryType()); + comparisonEntityFile.setListType(moduleDbFiledsEntity.getListType()); + comparisonEntityFile.setViewType(moduleDbFiledsEntity.getViewType()); + comparisonEntityFile.setDbName(moduleDbEntity.getDbName()); + comparisonEntityFile.setDbType(moduleDbEntity.getDbType()); + comparisonEntityFile.setDbId(moduleDbEntity.getId()); + comparisonEntityFile.setmId(mdmModuleEntity.getId()); + comparisonEntityFile.setMdmName(mdmModuleEntity.getMdmName()); + comparisonEntityFile.setMdmCode(String.valueOf(mdmModuleEntity.getMdmCode())); + comparisonEntities.add(comparisonEntityFile); + } + } + } + } + break; + default: + break; + } + + } + } + return comparisonEntities; + } + return null; + } + //根据主数据编码获取数据,表名称,字段名称等 public List getComparisonEntity(ComparisonEntity comparisonEntity) { List comparisonEntities = new ArrayList<>(); @@ -398,7 +526,38 @@ public class ComparisonServiceImpl extends BaseService if (comparisonEntityModule != null) { //根据mdm_module得id查询mdm_module_db得数据 List comparisonEntitiesModuleDb = comparisonDao.queryComparisonBymdmId(comparisonEntityModule); - //根据mdm_module得id查询mdm_module_db_fileds得数据 + if(CollectionUtils.isNotEmpty(comparisonEntitiesModuleDb)) { + for (ComparisonEntity comparison : comparisonEntitiesModuleDb) { + //查询出主表和明细表信息 + if(comparison.getDbType().equals("1")||comparison.getDbType().equals("2")) { + //根据mdm_module_db的id查询对应表的字段 + List comparisonEntitiesFiles = comparisonDao.queryComparisonBymdmIdFileds(comparison); + if (CollectionUtils.isNotEmpty(comparisonEntitiesFiles)) { + for (ComparisonEntity comparisonEntitiesFile : comparisonEntitiesFiles) { + ComparisonEntity comparisonEntityFile = new ComparisonEntity(); + comparisonEntityFile.setChName(comparisonEntitiesFile.getChName()); + comparisonEntityFile.setEnName(comparisonEntitiesFile.getEnName()); + comparisonEntityFile.setFiledType(comparisonEntitiesFile.getFiledType()); + comparisonEntityFile.setAddType(comparisonEntitiesFile.getAddType()); + comparisonEntityFile.setUpdateType(comparisonEntitiesFile.getUpdateType()); + comparisonEntityFile.setShowType(comparisonEntitiesFile.getShowType()); + comparisonEntityFile.setQueryType(comparisonEntitiesFile.getQueryType()); + comparisonEntityFile.setListType(comparisonEntitiesFile.getListType()); + comparisonEntityFile.setViewType(comparisonEntitiesFile.getViewType()); + comparisonEntityFile.setDbName(comparison.getDbName()); + comparisonEntityFile.setDbType(comparison.getDbType()); + comparisonEntityFile.setDbId(comparison.getDbId()); + comparisonEntityFile.setmId(comparisonEntitiesFile.getmId()); + comparisonEntityFile.setMdmName(comparisonEntityModule.getMdmName()); + comparisonEntityFile.setMdmCode(comparisonEntityModule.getMdmCode()); + comparisonEntities.add(comparisonEntityFile); + } + } + } + } + } + + /* //根据mdm_module得id查询mdm_module_db_fileds得数据 List comparisonEntitiesFiles = comparisonDao.queryComparisonBymdmIdFileds(comparisonEntityModule); for (ComparisonEntity comparison : comparisonEntitiesModuleDb) { for (ComparisonEntity comparisonEntitiesFile : comparisonEntitiesFiles) { @@ -422,22 +581,10 @@ public class ComparisonServiceImpl extends BaseService comparisonEntities.add(comparisonEntityFile); } } - } + }*/ return comparisonEntities; } return null; } - //查询数据来源 根据数据来源内类型是插件的应用类型做分组 - public List getComparisonEntityFiles(){ - List comparisonEntities = comparisonDao.queryModuleSource(); - if(CollectionUtils.isNotEmpty(comparisonEntities)){ - for (ComparisonEntity comparisonEntity : comparisonEntities) { - //根据来源类型获取档案数据 比如U8C - - } - } - return null; - } - } From e4d2e03fcfba6dd76e699ed0ac508c07f5669e22 Mon Sep 17 00:00:00 2001 From: hecan <1718492867@qq.com> Date: Tue, 11 Jun 2024 10:14:38 +0800 Subject: [PATCH 51/80] =?UTF-8?q?=E6=93=8D=E4=BD=9C=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controlsLog/dao/IControlsLogDao.java | 20 +++ .../dao/impl/ControlsLogDaoImpl.java | 32 +++++ .../controlsLog/entity/ControlsLogEntity.java | 78 ++++++++++ .../controlsLog/entity/ControlsLogEntity.xml | 136 ++++++++++++++++++ 4 files changed, 266 insertions(+) create mode 100644 service/src/main/java/com/hzya/frame/sysnew/comparison/controlsLog/dao/IControlsLogDao.java create mode 100644 service/src/main/java/com/hzya/frame/sysnew/comparison/controlsLog/dao/impl/ControlsLogDaoImpl.java create mode 100644 service/src/main/java/com/hzya/frame/sysnew/comparison/controlsLog/entity/ControlsLogEntity.java create mode 100644 service/src/main/java/com/hzya/frame/sysnew/comparison/controlsLog/entity/ControlsLogEntity.xml diff --git a/service/src/main/java/com/hzya/frame/sysnew/comparison/controlsLog/dao/IControlsLogDao.java b/service/src/main/java/com/hzya/frame/sysnew/comparison/controlsLog/dao/IControlsLogDao.java new file mode 100644 index 00000000..1ef9f35c --- /dev/null +++ b/service/src/main/java/com/hzya/frame/sysnew/comparison/controlsLog/dao/IControlsLogDao.java @@ -0,0 +1,20 @@ +package com.hzya.frame.sysnew.comparison.controlsLog.dao; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.hzya.frame.basedao.dao.IBaseDao; +import com.hzya.frame.sysnew.comparison.controlsLog.entity.ControlsLogEntity; + +public interface IControlsLogDao extends IBaseDao { + + /** + * + * @content 操作日志保存 + * @Param formmainId:主表id,sourceName:来源名称,code:来源编码,sourceData:源数据,optionType:操作类型,optionName:操作人,dbName:数据库名称 + * @Return + * @Author hecan + * @Date 2024/6/5 15:29 + * **/ + @DS("master") + ControlsLogEntity saveControlsLog(String formmainId,String sourceName,String code,String sourceData,String optionType,String optionName,String dbName); + +} diff --git a/service/src/main/java/com/hzya/frame/sysnew/comparison/controlsLog/dao/impl/ControlsLogDaoImpl.java b/service/src/main/java/com/hzya/frame/sysnew/comparison/controlsLog/dao/impl/ControlsLogDaoImpl.java new file mode 100644 index 00000000..7db1b35b --- /dev/null +++ b/service/src/main/java/com/hzya/frame/sysnew/comparison/controlsLog/dao/impl/ControlsLogDaoImpl.java @@ -0,0 +1,32 @@ +package com.hzya.frame.sysnew.comparison.controlsLog.dao.impl; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.hzya.frame.basedao.dao.MybatisGenericDao; +import com.hzya.frame.sysnew.comparison.controlsLog.dao.IControlsLogDao; +import com.hzya.frame.sysnew.comparison.controlsLog.entity.ControlsLogEntity; +import com.hzya.frame.uuid.UUIDUtils; +import org.springframework.stereotype.Repository; + +@Repository(value = "controlsLogDaoImpl") +public class ControlsLogDaoImpl extends MybatisGenericDao implements IControlsLogDao { + + //操作日志新增 + @Override + @DS("master") + public ControlsLogEntity saveControlsLog(String formmainId,String sourceName,String code,String sourceData,String optionType,String optionName,String dbName) { + ControlsLogEntity controlsLogEntity=new ControlsLogEntity(); + controlsLogEntity.setId(UUIDUtils.getUUID()); + controlsLogEntity.setFormmainId(formmainId); + controlsLogEntity.setSourceName(sourceName); + controlsLogEntity.setCode(code); + controlsLogEntity.setSourceData(sourceData); + controlsLogEntity.setOptionType(optionType); + controlsLogEntity.setOptionName(optionName); + controlsLogEntity.setDbName(dbName); + controlsLogEntity.setCreate_user_id("c796fd9ba4c9f5ff3cc2fa41a040e443"); + controlsLogEntity.setModify_user_id("c796fd9ba4c9f5ff3cc2fa41a040e443"); + controlsLogEntity.setOrg_id("0"); + ControlsLogEntity save = super.save(getSqlIdPrifx() + "saveControlsLog", controlsLogEntity); + return save; + } +} diff --git a/service/src/main/java/com/hzya/frame/sysnew/comparison/controlsLog/entity/ControlsLogEntity.java b/service/src/main/java/com/hzya/frame/sysnew/comparison/controlsLog/entity/ControlsLogEntity.java new file mode 100644 index 00000000..68f0d3ae --- /dev/null +++ b/service/src/main/java/com/hzya/frame/sysnew/comparison/controlsLog/entity/ControlsLogEntity.java @@ -0,0 +1,78 @@ +package com.hzya.frame.sysnew.comparison.controlsLog.entity; + +import com.hzya.frame.web.entity.BaseEntity; + +/** + * + * @content 操作日志实体类 + * @Param + * @Return + * @Author hecan + * @Date 2024/6/5 11:58 + * **/ +public class ControlsLogEntity extends BaseEntity { + private String formmainId;//主表id + private String sourceName;//来源名称 + private String code;//编码 + private String sourceData;//源数据 + private String optionType;//操作类型 + private String optionName;//操作人 + + private String dbName;//表名称 + + public String getDbName() { + return dbName; + } + + public void setDbName(String dbName) { + this.dbName = dbName; + } + + public String getFormmainId() { + return formmainId; + } + + public void setFormmainId(String formmainId) { + this.formmainId = formmainId; + } + + public String getSourceName() { + return sourceName; + } + + public void setSourceName(String sourceName) { + this.sourceName = sourceName; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getSourceData() { + return sourceData; + } + + public void setSourceData(String sourceData) { + this.sourceData = sourceData; + } + + public String getOptionType() { + return optionType; + } + + public void setOptionType(String optionType) { + this.optionType = optionType; + } + + public String getOptionName() { + return optionName; + } + + public void setOptionName(String optionName) { + this.optionName = optionName; + } +} diff --git a/service/src/main/java/com/hzya/frame/sysnew/comparison/controlsLog/entity/ControlsLogEntity.xml b/service/src/main/java/com/hzya/frame/sysnew/comparison/controlsLog/entity/ControlsLogEntity.xml new file mode 100644 index 00000000..7670ef99 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/sysnew/comparison/controlsLog/entity/ControlsLogEntity.xml @@ -0,0 +1,136 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + insert into ${dbName} + + id, + formmain_id, + code , + source_name , + source_data , + option_type , + option_name , + sorts , + create_user_id , + modify_user_id , + org_id , + company_id , + create_time, + modify_time, + sts + + values + + #{id}, + #{formmainId}, + #{code} , + #{sourceName} , + #{sourceData} , + #{optionType} , + #{optionName} , + #{sorts} , + (select (max(IFNULL( a.sorts, 0 )) + 1) as sort from ${dbName} a WHERE a.sts = 'Y' ), + #{create_user_id} , + #{modify_user_id} , + #{org_id} , + #{companyId} , + #{create_time} , + now() , + #{modify_time} , + now() , + #{sts} , + 'Y' + + + + + + update ${dbName} set + + formmain_id = #{formmainId}, + source_name = #{sourceName}, + code = #{code}, + source_data = #{sourceData}, + option_type = #{optionType}, + option_name = #{optionName}, + sorts = #{sorts}, + create_user_id = #{create_user_id}, + create_time = #{create_time}, + modify_user_id = #{modify_user_id}, + modify_time = #{modify_time}, + modify_time = now(), + sts = #{sts}, + org_id = #{org_id}, + company_id = #{companyId} + + where id=#{id} and sts='Y' + + + + + + update + ${dbName} + set sts= 'N' ,modify_time = now(),modify_user_id = #{modify_user_id} + + formmain_id = #{formmainId}, + source_name = #{sourceName}, + code = #{code}, + source_data = #{sourceData}, + option_type = #{optionType}, + option_name = #{optionName}, + and sorts = #{sorts} + and sts = #{sts} + and company_id = #{companyId} + and id=#{id} and sts='Y' + + + + + From 5f27f7d6310262a0cca1ff9364ed6b29e73709d3 Mon Sep 17 00:00:00 2001 From: lvleigang <957075182@qq.com> Date: Tue, 11 Jun 2024 11:19:51 +0800 Subject: [PATCH 52/80] =?UTF-8?q?=E5=B9=B3=E5=8F=B0=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=8E=B7=E5=8F=96=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../entity/SysExtensionApiEntity.java | 32 +++++++++++++++++++ .../impl/SysApplicationServiceImpl.java | 3 ++ 2 files changed, 35 insertions(+) diff --git a/service/src/main/java/com/hzya/frame/sysnew/application/entity/SysExtensionApiEntity.java b/service/src/main/java/com/hzya/frame/sysnew/application/entity/SysExtensionApiEntity.java index 90c7ed64..7668e887 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/application/entity/SysExtensionApiEntity.java +++ b/service/src/main/java/com/hzya/frame/sysnew/application/entity/SysExtensionApiEntity.java @@ -1,6 +1,8 @@ package com.hzya.frame.sysnew.application.entity; +import com.hzya.frame.sysnew.application.api.entity.SysApplicationApiEntity; + import java.util.Map; public class SysExtensionApiEntity { @@ -11,6 +13,12 @@ public class SysExtensionApiEntity { private String querys; /** body */ private String bodys; + /** 发送方应用 */ + private SysApplicationEntity sendApp; + /** 接收方应用 */ + private SysApplicationEntity receiveApp; + /** 接收方api */ + private SysApplicationApiEntity receiveApi; public Map getHeaders() { return headers; @@ -35,5 +43,29 @@ public class SysExtensionApiEntity { public void setBodys(String bodys) { this.bodys = bodys; } + + public SysApplicationEntity getSendApp() { + return sendApp; + } + + public void setSendApp(SysApplicationEntity sendApp) { + this.sendApp = sendApp; + } + + public SysApplicationEntity getReceiveApp() { + return receiveApp; + } + + public void setReceiveApp(SysApplicationEntity receiveApp) { + this.receiveApp = receiveApp; + } + + public SysApplicationApiEntity getReceiveApi() { + return receiveApi; + } + + public void setReceiveApi(SysApplicationApiEntity receiveApi) { + this.receiveApi = receiveApi; + } } 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 bd3c7594..5775b7fc 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 @@ -1725,6 +1725,9 @@ public class SysApplicationServiceImpl extends BaseService Date: Tue, 11 Jun 2024 14:27:42 +0800 Subject: [PATCH 53/80] =?UTF-8?q?=E5=A2=9E=E5=8A=A0api=E6=89=A9=E5=B1=95?= =?UTF-8?q?=E6=96=B9=E6=B3=95=EF=BC=8C=E8=8E=B7=E5=8F=96=E5=BA=94=E7=94=A8?= =?UTF-8?q?=E5=90=8D=E7=A7=B0=E5=92=8C=E5=BA=94=E7=94=A8=E7=BC=96=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/MasterDataOrgsServiceImpl.java | 8 ++--- .../impl/MasterDataProjectServiceImpl.java | 8 ++--- .../service/IComparisonService.java | 16 +++++++--- .../service/impl/ComparisonServiceImpl.java | 31 +++++++++++++++---- 4 files changed, 45 insertions(+), 18 deletions(-) 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 index c6fe35a5..e382aabf 100644 --- 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 @@ -102,8 +102,8 @@ public class MasterDataOrgsServiceImpl extends BaseService comparisonEntity.setDbName(entity.getDbName()); if(!"mdmCode".equals(key)){ map.put(key, jsonObject.getString(key)); + map.remove("appName"); + map.remove("appCode"); } } } @@ -207,10 +211,10 @@ public class ComparisonServiceImpl extends BaseService //comparisonEntityOne.setComparisonDetailsEntity(comparisonDetailsEntityOne); map.put("details",mapDetails); //保存操作日志 - controlsLogDaoimpl.saveControlsLog(uuidDetail,jsonObject.getString("sourceName"),jsonObject.getString("code"),jsonObject.toJSONString(),"接口新增",jsonObject.getString("optionName"),comparisonDetailsEntity.getDbName()+"_option_log"); + controlsLogDaoimpl.saveControlsLog(uuidDetail,jsonObject.getString("appName"),jsonObject.getString("appCode"),jsonObject.toJSONString(),"接口新增",jsonObject.getString("optionName"),comparisonDetailsEntity.getDbName()+"_option_log"); } //保存操作日志 - controlsLogDaoimpl.saveControlsLog(uuid,jsonObject.getString("sourceName"),jsonObject.getString("code"),jsonObject.toJSONString(),"接口新增",jsonObject.getString("optionName"),comparisonEntity.getDbName()+"_option_log"); + controlsLogDaoimpl.saveControlsLog(uuid,jsonObject.getString("appName"),jsonObject.getString("appCode"),jsonObject.toJSONString(),"接口新增",jsonObject.getString("optionName"),comparisonEntity.getDbName()+"_option_log"); return BaseResult.getSuccessMessageEntity("保存成功", map); } catch (Exception e) { logger.info("保存通用数据时候错误:{}", e.getMessage()); @@ -292,10 +296,10 @@ public class ComparisonServiceImpl extends BaseService comparisonDetailsEntity.setMapDetails(mapDetails); comparisonDetailsDao.updateComparisonDetailsByType(comparisonDetailsEntity); //保存操作日志 - controlsLogDaoimpl.saveControlsLog(comparisonDetailsEntity.getId(),jsonObject.getString("sourceName"),jsonObject.getString("code"),jsonObject.toJSONString(),"接口更新",jsonObject.getString("optionName"),comparisonDetailsEntity.getDbName()+"_option_log"); + controlsLogDaoimpl.saveControlsLog(comparisonDetailsEntity.getId(),jsonObject.getString("appName"),jsonObject.getString("appCode"),jsonObject.toJSONString(),"接口更新",jsonObject.getString("optionName"),comparisonDetailsEntity.getDbName()+"_option_log"); } //保存操作日志 - controlsLogDaoimpl.saveControlsLog(comparisonEntity.getId(),jsonObject.getString("sourceName"),jsonObject.getString("code"),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("更新成功", integer); }else{ return BaseResult.getFailureMessageEntity("更新失败"); @@ -318,6 +322,9 @@ public class ComparisonServiceImpl extends BaseService if (!checkStr(jsonObject.getString("mdmCode"))) { return BaseResult.getFailureMessageEntity("主数据编码为空"); } + if (!checkStr(jsonObject.getString("optionName"))) { + return BaseResult.getFailureMessageEntity("操作人为空"); + } ComparisonEntity comparisonEntity = jsonObject.toJavaObject(ComparisonEntity.class); ComparisonDetailsEntity comparisonDetailsEntity=new ComparisonDetailsEntity(); JSONObject jsonObjectMain=jsonObject.getJSONObject("main");//获取主表数据 @@ -361,9 +368,9 @@ public class ComparisonServiceImpl extends BaseService comparisonDetailsEntity.setFormmainId(jsonObjectMain.getString("id")); comparisonDetailsEntity.setModify_user_id("c796fd9ba4c9f5ff3cc2fa41a040e443"); comparisonDetailsDao.deleteComparisonDetails(comparisonDetailsEntity); - controlsLogDaoimpl.saveControlsLog(comparisonDetailsEntity.getId(),jsonObject.getString("sourceName"),jsonObject.getString("code"),jsonObject.toJSONString(),"接口删除",jsonObject.getString("optionName"),comparisonEntity.getDbName()+"_option_log"); + controlsLogDaoimpl.saveControlsLog(comparisonDetailsEntity.getId(),jsonObject.getString("appName"),jsonObject.getString("appCode"),jsonObject.toJSONString(),"接口删除",jsonObject.getString("optionName"),comparisonEntity.getDbName()+"_option_log"); } - controlsLogDaoimpl.saveControlsLog(comparisonEntity.getId(),jsonObject.getString("sourceName"),jsonObject.getString("code"),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("删除成功",integer); }else{ return BaseResult.getFailureMessageEntity("删除失败","请查看id是否在表中存在"); @@ -376,6 +383,18 @@ public class ComparisonServiceImpl extends BaseService return BaseResult.getFailureMessageEntity("查询失败","请检查传递参数"); } + //根据应用key和应用密钥获取应用编码和应用名称 + @Override + public SysExtensionApiEntity getAppNameAndCode(SysExtensionApiEntity sysExtensionApiEntity) { + String bodys = sysExtensionApiEntity.getBodys(); + SysApplicationEntity sendApp = sysExtensionApiEntity.getSendApp(); + JSONObject jsonObject = JSON.parseObject(bodys); + jsonObject.put("appName",sendApp.getName()); + jsonObject.put("appCode",sendApp.getAppId()); + sysExtensionApiEntity.setBodys(jsonObject.toJSONString()); + return sysExtensionApiEntity; + } + //根据不同的日期格式,返回不同的值 private String getRuleDate(String str){ switch (str){ From 2f3480d256baa5827a3c45332576421c2cd6727b Mon Sep 17 00:00:00 2001 From: hecan <1718492867@qq.com> Date: Thu, 13 Jun 2024 10:08:56 +0800 Subject: [PATCH 54/80] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=8C=85=E8=B7=AF?= =?UTF-8?q?=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../plugin/masterData/org/dao/IMdmOrgDao.java | 6 +++--- .../org/dao/impl/MdmOrgDaoImpl.java | 8 ++++---- .../masterData/org/entity/MdmOrgEntity.java | 2 +- .../masterData/org/entity/MdmOrgEntity.xml | 20 +++++++++---------- .../org/service/IMdmOrgService.java | 5 +++-- .../org/service/impl/MdmOrgServiceImpl.java | 11 +++++----- .../project/dao/IMdmProjectDao.java | 7 ++++--- .../project/dao/impl/MdmProjectDaoImpl.java | 9 +++++---- .../project/entity/MdmProjectEntity.java | 2 +- .../project/entity/MdmProjectEntity.xml | 20 +++++++++---------- .../project/service/IMdmProjectService.java | 5 +++-- .../service/impl/MdmProjectServiceImpl.java | 11 +++++----- .../dao/impl/MdmModuleSourceDaoImpl.java | 2 +- 13 files changed, 57 insertions(+), 51 deletions(-) diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/org/dao/IMdmOrgDao.java b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/org/dao/IMdmOrgDao.java index 7f9d06c5..bfe0e1cd 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/org/dao/IMdmOrgDao.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/org/dao/IMdmOrgDao.java @@ -1,7 +1,7 @@ -package masterData.dao; +package com.hzya.frame.plugin.masterData.org.dao; -import masterData.entity.MdmOrgEntity; -import com.hzya.frame.basedao.dao.IBaseDao; +import com.hzya.frame.basedao.dao.IBaseDao; +import com.hzya.frame.plugin.masterData.org.entity.MdmOrgEntity; /** * 组织档案(mdm_org: table)表数据库访问层 diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/org/dao/impl/MdmOrgDaoImpl.java b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/org/dao/impl/MdmOrgDaoImpl.java index 3648d6b9..dc0271b5 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/org/dao/impl/MdmOrgDaoImpl.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/org/dao/impl/MdmOrgDaoImpl.java @@ -1,7 +1,7 @@ -package masterData.dao.impl; +package com.hzya.frame.plugin.masterData.org.dao.impl; -import masterData.entity.MdmOrgEntity; -import masterData.dao.IMdmOrgDao; +import com.hzya.frame.plugin.masterData.org.dao.IMdmOrgDao; +import com.hzya.frame.plugin.masterData.org.entity.MdmOrgEntity; import org.springframework.stereotype.Repository; import com.hzya.frame.basedao.dao.MybatisGenericDao; /** @@ -10,7 +10,7 @@ import com.hzya.frame.basedao.dao.MybatisGenericDao; * @author makejava * @since 2024-06-07 18:30:04 */ -public class MdmOrgDaoImpl extends MybatisGenericDao implements IMdmOrgDao{ +public class MdmOrgDaoImpl extends MybatisGenericDao implements IMdmOrgDao { } diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/org/entity/MdmOrgEntity.java b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/org/entity/MdmOrgEntity.java index 8d502635..55aa6f31 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/org/entity/MdmOrgEntity.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/org/entity/MdmOrgEntity.java @@ -1,4 +1,4 @@ -package masterData.entity; +package com.hzya.frame.plugin.masterData.org.entity; import java.util.Date; import com.hzya.frame.web.entity.BaseEntity; diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/org/entity/MdmOrgEntity.xml b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/org/entity/MdmOrgEntity.xml index c14c6a01..9c5e813e 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/org/entity/MdmOrgEntity.xml +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/org/entity/MdmOrgEntity.xml @@ -1,8 +1,8 @@ - + - + @@ -60,7 +60,7 @@ ,company_id - select from mdm_org @@ -98,7 +98,7 @@ - select count(1) from mdm_org and id = #{id} @@ -134,7 +134,7 @@ - select from mdm_org @@ -172,7 +172,7 @@ - select from mdm_org @@ -210,7 +210,7 @@ - + insert into mdm_org( id , @@ -316,7 +316,7 @@ org_id = values(org_id), company_id = values(company_id) - + update mdm_org set document_rule = #{documentRule}, @@ -347,12 +347,12 @@ update mdm_org set where id = #{id} - + update mdm_org set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} where id = #{id} - + update mdm_org set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} and id = #{id} diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/org/service/IMdmOrgService.java b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/org/service/IMdmOrgService.java index fe82b199..fa37d8cd 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/org/service/IMdmOrgService.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/org/service/IMdmOrgService.java @@ -1,7 +1,8 @@ -package masterData.service; +package com.hzya.frame.plugin.masterData.org.service; -import masterData.entity.MdmOrgEntity; import com.hzya.frame.basedao.service.IBaseService; +import com.hzya.frame.plugin.masterData.org.entity.MdmOrgEntity; + /** * 组织档案(MdmOrg)表服务接口 * diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/org/service/impl/MdmOrgServiceImpl.java b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/org/service/impl/MdmOrgServiceImpl.java index 700a73ce..f4f543ee 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/org/service/impl/MdmOrgServiceImpl.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/org/service/impl/MdmOrgServiceImpl.java @@ -1,9 +1,10 @@ -package masterData.service.impl; +package com.hzya.frame.plugin.masterData.org.service.impl; -import masterData.entity.MdmOrgEntity; -import masterData.dao.IMdmOrgDao; -import masterData.service.IMdmOrgService; -import org.springframework.stereotype.Service; + +import com.hzya.frame.plugin.masterData.org.dao.IMdmOrgDao; +import com.hzya.frame.plugin.masterData.org.entity.MdmOrgEntity; +import com.hzya.frame.plugin.masterData.org.service.IMdmOrgService; +import org.springframework.stereotype.Service; import org.springframework.beans.factory.annotation.Autowired; import javax.annotation.Resource; import com.hzya.frame.basedao.service.impl.BaseService; diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/project/dao/IMdmProjectDao.java b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/project/dao/IMdmProjectDao.java index 7389b3cc..8b130a7f 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/project/dao/IMdmProjectDao.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/project/dao/IMdmProjectDao.java @@ -1,7 +1,8 @@ -package masterData.dao; +package com.hzya.frame.plugin.masterData.project.dao; -import masterData.entity.MdmProjectEntity; -import com.hzya.frame.basedao.dao.IBaseDao; + +import com.hzya.frame.basedao.dao.IBaseDao; +import com.hzya.frame.plugin.masterData.project.entity.MdmProjectEntity; /** * 项目档案(mdm_project: table)表数据库访问层 diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/project/dao/impl/MdmProjectDaoImpl.java b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/project/dao/impl/MdmProjectDaoImpl.java index 3da10ccc..ae270f7d 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/project/dao/impl/MdmProjectDaoImpl.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/project/dao/impl/MdmProjectDaoImpl.java @@ -1,7 +1,8 @@ -package masterData.dao.impl; +package com.hzya.frame.plugin.masterData.project.dao.impl; -import masterData.entity.MdmProjectEntity; -import masterData.dao.IMdmProjectDao; + +import com.hzya.frame.plugin.masterData.project.dao.IMdmProjectDao; +import com.hzya.frame.plugin.masterData.project.entity.MdmProjectEntity; import org.springframework.stereotype.Repository; import com.hzya.frame.basedao.dao.MybatisGenericDao; /** @@ -10,7 +11,7 @@ import com.hzya.frame.basedao.dao.MybatisGenericDao; * @author makejava * @since 2024-06-07 18:29:23 */ -public class MdmProjectDaoImpl extends MybatisGenericDao implements IMdmProjectDao{ +public class MdmProjectDaoImpl extends MybatisGenericDao implements IMdmProjectDao { } diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/project/entity/MdmProjectEntity.java b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/project/entity/MdmProjectEntity.java index 958d6fc5..fba1cf1c 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/project/entity/MdmProjectEntity.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/project/entity/MdmProjectEntity.java @@ -1,4 +1,4 @@ -package masterData.entity; +package com.hzya.frame.plugin.masterData.project.entity; import java.util.Date; import com.hzya.frame.web.entity.BaseEntity; diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/project/entity/MdmProjectEntity.xml b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/project/entity/MdmProjectEntity.xml index 6003878f..93ec1958 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/project/entity/MdmProjectEntity.xml +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/project/entity/MdmProjectEntity.xml @@ -1,8 +1,8 @@ - + - + @@ -58,7 +58,7 @@ ,company_id - select from mdm_project @@ -95,7 +95,7 @@ - select count(1) from mdm_project and id = #{id} @@ -130,7 +130,7 @@ - select from mdm_project @@ -167,7 +167,7 @@ - select from mdm_project @@ -204,7 +204,7 @@ - + insert into mdm_project( id , @@ -307,7 +307,7 @@ org_id = values(org_id), company_id = values(company_id) - + update mdm_project set document_rule = #{documentRule}, @@ -337,12 +337,12 @@ update mdm_project set where id = #{id} - + update mdm_project set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} where id = #{id} - + update mdm_project set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} and id = #{id} diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/project/service/IMdmProjectService.java b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/project/service/IMdmProjectService.java index 58e801b2..f35a9209 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/project/service/IMdmProjectService.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/project/service/IMdmProjectService.java @@ -1,7 +1,8 @@ -package masterData.service; +package com.hzya.frame.plugin.masterData.project.service; -import masterData.entity.MdmProjectEntity; import com.hzya.frame.basedao.service.IBaseService; +import com.hzya.frame.plugin.masterData.project.entity.MdmProjectEntity; + /** * 项目档案(MdmProject)表服务接口 * diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/project/service/impl/MdmProjectServiceImpl.java b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/project/service/impl/MdmProjectServiceImpl.java index 4dc5e249..0284f229 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/project/service/impl/MdmProjectServiceImpl.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/project/service/impl/MdmProjectServiceImpl.java @@ -1,9 +1,10 @@ -package masterData.service.impl; +package com.hzya.frame.plugin.masterData.project.service.impl; -import masterData.entity.MdmProjectEntity; -import masterData.dao.IMdmProjectDao; -import masterData.service.IMdmProjectService; -import org.springframework.stereotype.Service; + +import com.hzya.frame.plugin.masterData.project.dao.IMdmProjectDao; +import com.hzya.frame.plugin.masterData.project.entity.MdmProjectEntity; +import com.hzya.frame.plugin.masterData.project.service.IMdmProjectService; +import org.springframework.stereotype.Service; import org.springframework.beans.factory.annotation.Autowired; import javax.annotation.Resource; import com.hzya.frame.basedao.service.impl.BaseService; diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleSource/dao/impl/MdmModuleSourceDaoImpl.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleSource/dao/impl/MdmModuleSourceDaoImpl.java index b7cc9034..4e025854 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleSource/dao/impl/MdmModuleSourceDaoImpl.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleSource/dao/impl/MdmModuleSourceDaoImpl.java @@ -18,7 +18,7 @@ public class MdmModuleSourceDaoImpl extends MybatisGenericDao MdmModuleSourceentityGroupByType() { - List list =(List) super.selectList(getSqlIdPrifx() + "MdmModuleSourceentityGroupByType", ""); + List list =(List) super.selectList(getSqlIdPrifx() + "queryMdmModuleSourceentityGroupByType", ""); return list; } From e223dbd22df1613b3df20ac387e75fe2074ecfb0 Mon Sep 17 00:00:00 2001 From: lvleigang <957075182@qq.com> Date: Thu, 13 Jun 2024 11:01:35 +0800 Subject: [PATCH 55/80] =?UTF-8?q?=E4=B8=BB=E6=95=B0=E6=8D=AE=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/hzya/frame/basedao/dao/IBaseDao.java | 3 +- .../frame/basedao/dao/MybatisGenericDao.java | 5 + .../com/hzya/frame/mdm/entity/MdmDto.java | 21 + .../frame/mdm/entity/MdmModuleViewVo.java | 18 + .../mdm/mdmModule/dao/IMdmModuleDao.java | 8 + .../mdmModule/dao/impl/MdmModuleDaoImpl.java | 25 + .../mdm/mdmModule/entity/MdmModuleEntity.xml | 637 +- .../mdmModule/service/IMdmModuleService.java | 333 + .../service/impl/MdmModuleServiceImpl.java | 2200 ++++- .../mdm/mdmModuleDb/dao/IMdmModuleDbDao.java | 2 + .../dao/impl/MdmModuleDbDaoImpl.java | 6 + .../mdmModuleDb/entity/MdmModuleDbEntity.xml | 429 +- .../dao/IMdmModuleDbFiledsDao.java | 1 + .../dao/impl/MdmModuleDbFiledsDaoImpl.java | 7 +- .../entity/MdmModuleDbFiledsEntity.java | 22 + .../entity/MdmModuleDbFiledsEntity.xml | 5 +- .../dao/IMdmModuleDbFiledsRuleDao.java | 1 + .../impl/MdmModuleDbFiledsRuleDaoImpl.java | 7 +- .../entity/MdmModuleDbFiledsRuleEntity.xml | 10 + .../hzya/frame/mdm/service/IMdmService.java | 580 +- .../frame/mdm/service/IMdmServiceCache.java | 90 +- .../mdm/service/impl/MdmServiceCache.java | 545 +- .../mdm/service/impl/MdmServiceImpl.java | 7768 ++++++++--------- 23 files changed, 7831 insertions(+), 4892 deletions(-) diff --git a/common/src/main/java/com/hzya/frame/basedao/dao/IBaseDao.java b/common/src/main/java/com/hzya/frame/basedao/dao/IBaseDao.java index a999a9fa..1b9d09b3 100644 --- a/common/src/main/java/com/hzya/frame/basedao/dao/IBaseDao.java +++ b/common/src/main/java/com/hzya/frame/basedao/dao/IBaseDao.java @@ -73,7 +73,6 @@ public interface IBaseDao { * @return */ int delete(String paramString, Object paramObject); - /** * 修改 * @param paramString sqlMapperID @@ -178,6 +177,8 @@ public interface IBaseDao { */ Integer getCount(E paramE); + Integer getCount(String statement,Object baseEntity); + /** * 分页查询 * @param paramString mapperID diff --git a/common/src/main/java/com/hzya/frame/basedao/dao/MybatisGenericDao.java b/common/src/main/java/com/hzya/frame/basedao/dao/MybatisGenericDao.java index c578b60e..95e43393 100644 --- a/common/src/main/java/com/hzya/frame/basedao/dao/MybatisGenericDao.java +++ b/common/src/main/java/com/hzya/frame/basedao/dao/MybatisGenericDao.java @@ -276,6 +276,11 @@ public abstract class MybatisGenericDao query(Object baseEntity) { Assert.notNull(baseEntity, "query baseEntity :不能为NULL"); diff --git a/service/src/main/java/com/hzya/frame/mdm/entity/MdmDto.java b/service/src/main/java/com/hzya/frame/mdm/entity/MdmDto.java index ae393466..01dd7150 100644 --- a/service/src/main/java/com/hzya/frame/mdm/entity/MdmDto.java +++ b/service/src/main/java/com/hzya/frame/mdm/entity/MdmDto.java @@ -2,6 +2,7 @@ package com.hzya.frame.mdm.entity; import com.hzya.frame.mdm.mdmModuleDb.entity.MdmModuleDbEntity; +import com.hzya.frame.mdm.mdmModuleDbFiledsRule.entity.MdmModuleDbFiledsRuleEntity; import com.hzya.frame.mdm.mdmTableCodeRule.entity.MdmTableCodeRuleEntity; import java.util.List; @@ -12,6 +13,8 @@ public class MdmDto { private Long mdmCode; //单据编码规则 private List mdmTableCodeRuleEntityList; + //字段规则 + private List mdmModuleDbFiledsRuleEntities; //主数据主表 private MdmModuleDbEntity mainMdmModuleDb; //主数据子表 @@ -20,6 +23,8 @@ public class MdmDto { //id private String id; + //id + private String fieldId; //3、新增4、修改 5、查看 private String showType; //分页 @@ -201,5 +206,21 @@ public class MdmDto { public void setUpId(String upId) { this.upId = upId; } + + public List getMdmModuleDbFiledsRuleEntities() { + return mdmModuleDbFiledsRuleEntities; + } + + public void setMdmModuleDbFiledsRuleEntities(List mdmModuleDbFiledsRuleEntities) { + this.mdmModuleDbFiledsRuleEntities = mdmModuleDbFiledsRuleEntities; + } + + public String getFieldId() { + return fieldId; + } + + public void setFieldId(String fieldId) { + this.fieldId = fieldId; + } } diff --git a/service/src/main/java/com/hzya/frame/mdm/entity/MdmModuleViewVo.java b/service/src/main/java/com/hzya/frame/mdm/entity/MdmModuleViewVo.java index 67429ac6..44719c62 100644 --- a/service/src/main/java/com/hzya/frame/mdm/entity/MdmModuleViewVo.java +++ b/service/src/main/java/com/hzya/frame/mdm/entity/MdmModuleViewVo.java @@ -9,6 +9,10 @@ import java.util.List; public class MdmModuleViewVo { + /** 主数据模版ID */ + private String mdmId; + /** 类型1、查询2、列表3、新增4、修改 5、查看 */ + private String viewType; //模版 private MdmModuleViewEntity mdmModuleViewEntity; //新增 @@ -131,6 +135,20 @@ public class MdmModuleViewVo { this.dbButtonFiled = dbButtonFiled; } + public String getMdmId() { + return mdmId; + } + public void setMdmId(String mdmId) { + this.mdmId = mdmId; + } + + public String getViewType() { + return viewType; + } + + public void setViewType(String viewType) { + this.viewType = viewType; + } } diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModule/dao/IMdmModuleDao.java b/service/src/main/java/com/hzya/frame/mdm/mdmModule/dao/IMdmModuleDao.java index 8854d3e8..5a2b602f 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModule/dao/IMdmModuleDao.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModule/dao/IMdmModuleDao.java @@ -5,6 +5,7 @@ import com.hzya.frame.mdm.entity.MdmDto; import com.hzya.frame.mdm.entity.MdmQuery; import com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity; import com.hzya.frame.basedao.dao.IBaseDao; +import com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity; import com.hzya.frame.sys.entity.FormmainDeleteDto; import java.util.HashMap; @@ -26,6 +27,7 @@ public interface IMdmModuleDao extends IBaseDao { Integer checkTable(Map maps); Integer createTable(Map maps); Integer alterTable(Map maps); + Integer alterTableField(MdmModuleDbFiledsEntity entity); Integer alterTableName(Map maps); List> queryMdmShowData(MdmQuery entity); List> queryTemplateDataMore(MdmDto entity); @@ -39,5 +41,11 @@ public interface IMdmModuleDao extends IBaseDao { List> queryDataAll(MdmDto entity); + Integer deleteMdmModuleEntity(MdmModuleEntity entity); + + Integer queryMainCount(MdmQuery mdmQuery); + + Integer deleteTable(Map maps); + } diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModule/dao/impl/MdmModuleDaoImpl.java b/service/src/main/java/com/hzya/frame/mdm/mdmModule/dao/impl/MdmModuleDaoImpl.java index 40cd1bab..c7435918 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModule/dao/impl/MdmModuleDaoImpl.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModule/dao/impl/MdmModuleDaoImpl.java @@ -5,6 +5,7 @@ import com.hzya.frame.mdm.entity.MdmDto; import com.hzya.frame.mdm.entity.MdmQuery; import com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity; import com.hzya.frame.mdm.mdmModule.dao.IMdmModuleDao; +import com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity; import com.hzya.frame.sys.entity.FormmainDeleteDto; import org.springframework.stereotype.Repository; import com.hzya.frame.basedao.dao.MybatisGenericDao; @@ -45,6 +46,19 @@ public class MdmModuleDaoImpl extends MybatisGenericDao List> o = (List>) super.selectList(getSqlIdPrifx() + "queryDataAll", entity); return o; } + + @Override + public Integer deleteMdmModuleEntity(MdmModuleEntity entity) { + Integer o = (Integer) super.delete(getSqlIdPrifx() + "deleteMdmModuleEntity", entity); + return o; + } + + @Override + public Integer queryMainCount(MdmQuery entity) { + Integer o = (Integer) super.getCount(getSqlIdPrifx() + "queryMainCount", entity); + return o; + } + @Override public Integer checkData(Map maps) { Integer o = (Integer) super.selectOne(getSqlIdPrifx() + "checkData", maps); @@ -105,11 +119,22 @@ public class MdmModuleDaoImpl extends MybatisGenericDao Integer o = (Integer) super.selectOne(getSqlIdPrifx() + "createTable", maps); return o; } + + @Override + public Integer deleteTable(Map maps) { + Integer o = (Integer) super.delete(getSqlIdPrifx() + "deleteTable", maps); + return o; + } @Override public Integer alterTable(Map maps) { Integer o = (Integer) super.selectOne(getSqlIdPrifx() + "alterTable", maps); return o; } + @Override + public Integer alterTableField(MdmModuleDbFiledsEntity entity) { + Integer o = (Integer) super.selectOne(getSqlIdPrifx() + "alterTableField", entity); + return o; + } @Override public Integer alterTableName(Map maps) { 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 4e94d665..548f0526 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 @@ -2,26 +2,26 @@ - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + - + id ,mdm_name ,mdm_logo @@ -40,227 +40,243 @@ - - + select + + from mdm_module + + and id = #{id} + and mdm_name = #{mdmName} + and mdm_logo = #{mdmLogo} + and mdm_code = #{mdmCode} + and mdm_type = #{mdmType} + and remark = #{remark} + and sorts = #{sorts} + and create_user_id = #{create_user_id} + and create_time = #{create_time} + and modify_user_id = #{modify_user_id} + and modify_time = #{modify_time} + and sts = #{sts} + and org_id = #{org_id} + and company_id = #{companyId} and sts='Y' - - order by sorts asc - order by ${sort} ${order} - - - - + + + - + select + + from mdm_module + + and id like concat('%',#{id},'%') + and mdm_name like concat('%',#{mdmName},'%') + and mdm_logo like concat('%',#{mdmLogo},'%') + and mdm_code like concat('%',#{mdmCode},'%') + and mdm_type like concat('%',#{mdmType},'%') + and remark like concat('%',#{remark},'%') + and sorts like concat('%',#{sorts},'%') + and create_user_id like + concat('%',#{create_user_id},'%') + + and create_time like concat('%',#{create_time},'%') + and modify_user_id like + concat('%',#{modify_user_id},'%') + + and modify_time like concat('%',#{modify_time},'%') + and sts like concat('%',#{sts},'%') + and org_id like concat('%',#{org_id},'%') + and company_id like concat('%',#{companyId},'%') and sts='Y' - - order by sorts asc - order by ${sort} ${order} - + + order by sorts asc + order by ${sort} ${order} + - - + select + + from mdm_module + + or id = #{id} + or mdm_name = #{mdmName} + or mdm_logo = #{mdmLogo} + or mdm_code = #{mdmCode} + or mdm_type = #{mdmType} + or remark = #{remark} + or sorts = #{sorts} + or create_user_id = #{create_user_id} + or create_time = #{create_time} + or modify_user_id = #{modify_user_id} + or modify_time = #{modify_time} + or sts = #{sts} + or org_id = #{org_id} + or company_id = #{companyId} and sts='Y' - - order by sorts asc - order by ${sort} ${order} - + + order by sorts asc + order by ${sort} ${order} + - - - insert into mdm_module( - - id , - mdm_name , - mdm_logo , - mdm_code , - mdm_code , - mdm_type , - remark , - sorts , - create_user_id , - create_time , - modify_user_id , - modify_time , - sts , - org_id , - company_id , - sts, - - )values( - - #{id} , - #{mdmName} , - #{mdmLogo} , - #{mdmCode} , + + + insert into mdm_module( + + id , + mdm_name , + mdm_logo , + mdm_code , + mdm_code , + mdm_type , + remark , + sorts , + create_user_id , + create_time , + modify_user_id , + modify_time , + sts , + org_id , + company_id , + sts, + + )values( + + #{id} , + #{mdmName} , + #{mdmLogo} , + #{mdmCode} , (SELECT IFNULL(MAX(b.mdm_code)+1,10001) AS mdmCode FROM mdm_module b ), - #{mdmType} , - #{remark} , - #{sorts} , - #{create_user_id} , - #{create_time} , - #{modify_user_id} , - #{modify_time} , - #{sts} , - #{org_id} , - #{companyId} , - 'Y', - - ) - - - - insert into mdm_module(mdm_name, mdm_logo, mdm_code, mdm_type, remark, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, sts) - values - - (#{entity.mdmName},#{entity.mdmLogo},#{entity.mdmCode},#{entity.mdmType},#{entity.remark},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId}, 'Y') - - - - - insert into mdm_module(mdm_name, mdm_logo, mdm_code, mdm_type, remark, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id) - values - - (#{entity.mdmName},#{entity.mdmLogo},#{entity.mdmCode},#{entity.mdmType},#{entity.remark},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId}) - - on duplicate key update - mdm_name = values(mdm_name), - mdm_logo = values(mdm_logo), - mdm_code = values(mdm_code), - mdm_type = values(mdm_type), - remark = values(remark), - create_user_id = values(create_user_id), - create_time = values(create_time), - modify_user_id = values(modify_user_id), - modify_time = values(modify_time), - sts = values(sts), - org_id = values(org_id), - company_id = values(company_id) - - -update mdm_module set - - mdm_name = #{mdmName}, - mdm_logo = #{mdmLogo}, - mdm_code = #{mdmCode}, - mdm_type = #{mdmType}, - remark = #{remark}, - create_user_id = #{create_user_id}, - create_time = #{create_time}, - modify_user_id = #{modify_user_id}, - modify_time = #{modify_time}, - sts = #{sts}, - org_id = #{org_id}, - company_id = #{companyId}, - -where id = #{id} - - - + #{mdmType} , + #{remark} , + #{sorts} , + #{create_user_id} , + #{create_time} , + #{modify_user_id} , + #{modify_time} , + #{sts} , + #{org_id} , + #{companyId} , + 'Y', + + ) + + + + insert into mdm_module(mdm_name, mdm_logo, mdm_code, mdm_type, remark, create_user_id, create_time, + modify_user_id, modify_time, sts, org_id, company_id, sts) + values + + (#{entity.mdmName},#{entity.mdmLogo},#{entity.mdmCode},#{entity.mdmType},#{entity.remark},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId}, + 'Y') + + + + + insert into mdm_module(mdm_name, mdm_logo, mdm_code, mdm_type, remark, create_user_id, create_time, + modify_user_id, modify_time, sts, org_id, company_id) + values + + (#{entity.mdmName},#{entity.mdmLogo},#{entity.mdmCode},#{entity.mdmType},#{entity.remark},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId}) + + on duplicate key update + mdm_name = values(mdm_name), + mdm_logo = values(mdm_logo), + mdm_code = values(mdm_code), + mdm_type = values(mdm_type), + remark = values(remark), + create_user_id = values(create_user_id), + create_time = values(create_time), + modify_user_id = values(modify_user_id), + modify_time = values(modify_time), + sts = values(sts), + org_id = values(org_id), + company_id = values(company_id) + + + + update mdm_module set + + mdm_name = #{mdmName}, + mdm_logo = #{mdmLogo}, + mdm_code = #{mdmCode}, + mdm_type = #{mdmType}, + remark = #{remark}, + create_user_id = #{create_user_id}, + create_time = #{create_time}, + modify_user_id = #{modify_user_id}, + modify_time = #{modify_time}, + sts = #{sts}, + org_id = #{org_id}, + company_id = #{companyId}, + + where id = #{id} + + + update mdm_module set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} where id = #{id} - - -update mdm_module set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} - - and id = #{id} - and mdm_name = #{mdmName} - and mdm_logo = #{mdmLogo} - and mdm_code = #{mdmCode} - and mdm_type = #{mdmType} - and remark = #{remark} - and sorts = #{sorts} - and sts = #{sts} - and company_id = #{companyId} + + + update mdm_module set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} + + and id = #{id} + and mdm_name = #{mdmName} + and mdm_logo = #{mdmLogo} + and mdm_code = #{mdmCode} + and mdm_type = #{mdmType} + and remark = #{remark} + and sorts = #{sorts} + and sts = #{sts} + and company_id = #{companyId} and sts='Y' - - - - + + + + delete from mdm_module where id = #{id} + + + DROP TABLE ${tableName} + - select a.id as id, a.mdm_name as mdm_name, @@ -292,7 +308,7 @@ update mdm_module set sts= 'N' ,modify_time = #{modify_time},modify_user_id = # @@ -307,35 +323,73 @@ update mdm_module set sts= 'N' ,modify_time = #{modify_time},modify_user_id = # - @@ -343,6 +397,8 @@ update mdm_module set sts= 'N' ,modify_time = #{modify_time},modify_user_id = # + + + + + + + + + - SELECT count(*) from @@ -657,5 +784,15 @@ update mdm_module set sts= 'N' ,modify_time = #{modify_time},modify_user_id = # order by sorts asc + + + delete from mdm_module where mdm_code = #{mdmCode} + + + + + diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModule/service/IMdmModuleService.java b/service/src/main/java/com/hzya/frame/mdm/mdmModule/service/IMdmModuleService.java index 02372e74..bd028fd5 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModule/service/IMdmModuleService.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModule/service/IMdmModuleService.java @@ -1,7 +1,10 @@ package com.hzya.frame.mdm.mdmModule.service; +import com.alibaba.fastjson.JSONObject; import com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity; import com.hzya.frame.basedao.service.IBaseService; +import com.hzya.frame.web.entity.JsonResultEntity; + /** * 主数据模版(MdmModule)表服务接口 * @@ -9,4 +12,334 @@ import com.hzya.frame.basedao.service.IBaseService; * @since 2024-06-03 08:46:29 */ public interface IMdmModuleService extends IBaseService{ + + /** + * @Author lvleigang + * @Description 查询所有主数据 + * @Date 11:43 上午 2024/6/11 + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + **/ + JsonResultEntity queryMdm(JSONObject jsonObject); + + /** + * @Author lvleigang + * @Description 删除主数据 + * @Date 11:43 上午 2024/6/11 + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + **/ + JsonResultEntity deleteMdm(JSONObject jsonObject); + + /** + * @Author lvleigang + * @Description 主数据-基本信息获取 + * @Date 11:43 上午 2024/6/11 + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + **/ + JsonResultEntity getMdm(JSONObject jsonObject); + + /** + * @Author lvleigang + * @Description 主数据-基本信息新增 + * @Date 11:43 上午 2024/6/11 + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + **/ + JsonResultEntity saveMdm(JSONObject jsonObject); + + /** + * @Author lvleigang + * @Description 主数据-基本信息修改(同步修改菜单名称) + * @Date 11:43 上午 2024/6/11 + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + **/ + JsonResultEntity updateMdm(JSONObject jsonObject); + + + /** + * @Author lvleigang + * @Description 主数据-数据源-单据规则获取 + * @Date 11:43 上午 2024/6/11 + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + **/ + JsonResultEntity getMdmTableCodeRule(JSONObject jsonObject); + + /** + * @Author lvleigang + * @Description 主数据-数据源-单据规则新增或修改 + * @Date 11:43 上午 2024/6/11 + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + **/ + JsonResultEntity saveOrUpdateMdmTableCodeRule(JSONObject jsonObject); + + + /** + * @Author lvleigang + * @Description 主数据-数据源-数据表获取 + * @Date 11:43 上午 2024/6/11 + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + **/ + JsonResultEntity queryMdmDb(JSONObject jsonObject); + + /** + * @Author lvleigang + * @Description 主数据-数据源-数据表新增 + * @Date 11:43 上午 2024/6/11 + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + **/ + JsonResultEntity saveMdmDb(JSONObject jsonObject); + + /** + * @Author lvleigang + * @Description 主数据-数据源-数据表修改 + * @Date 11:43 上午 2024/6/11 + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + **/ + JsonResultEntity updateMdmDb(JSONObject jsonObject); + + /** + * @Author lvleigang + * @Description 主数据-数据源-数据表删除 + * @Date 11:43 上午 2024/6/11 + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + **/ + JsonResultEntity deleteMdmDb(JSONObject jsonObject); + + /** + * @Author lvleigang + * @Description 主数据-数据源-数据表字段获取 + * @Date 11:43 上午 2024/6/11 + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + **/ + JsonResultEntity queryMdmDbField(JSONObject jsonObject); + + + /** + * @Author lvleigang + * @Description 主数据-数据源-数据表字段新增 + * @Date 11:43 上午 2024/6/11 + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + **/ + JsonResultEntity saveMdmDbField(JSONObject jsonObject); + + /** + * @Author lvleigang + * @Description 主数据-数据源-数据表字段修改 + * @Date 11:43 上午 2024/6/11 + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + **/ + JsonResultEntity updateMdmDbField(JSONObject jsonObject); + + /** + * @Author lvleigang + * @Description 主数据-数据源-数据表字段删除 + * @Date 11:43 上午 2024/6/11 + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + **/ + JsonResultEntity deleteMdmDbField(JSONObject jsonObject); + + /** + * @Author lvleigang + * @Description 主数据-数据源-数据表字段规则获取 + * @Date 11:43 上午 2024/6/11 + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + **/ + JsonResultEntity queryMdmDbFieldRule(JSONObject jsonObject); + + /** + * @Author lvleigang + * @Description 主数据-数据源-数据表字段规则修改 + * @Date 11:43 上午 2024/6/11 + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + **/ + JsonResultEntity updateMdmDbFieldRule(JSONObject jsonObject); + + /** + * @Author lvleigang + * @Description 主数据-显示信息-显示类型获取 + * @Date 11:43 上午 2024/6/11 + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + **/ + JsonResultEntity queryMdmView(JSONObject jsonObject); + + /** + * @Author lvleigang + * @Description 主数据-显示信息-显示类型保存 + * @Date 11:43 上午 2024/6/11 + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + **/ + JsonResultEntity saveMdmView(JSONObject jsonObject); + + /** + * @Author lvleigang + * @Description 主数据-显示信息-显示类型修改 + * @Date 11:43 上午 2024/6/11 + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + **/ + JsonResultEntity updateMdmView(JSONObject jsonObject); + /** + * @Author lvleigang + * @Description 主数据-显示信息-显示字段获取 + * @Date 11:43 上午 2024/6/11 + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + **/ + JsonResultEntity queryMdmViewField(JSONObject jsonObject); + + + + /** + * @Author lvleigang + * @Description 主数据-显示信息-显示字段设置保存 + * @Date 11:43 上午 2024/6/11 + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + **/ + JsonResultEntity saveOrUpdateMdmViewField(JSONObject jsonObject); + + /** + * @Author lvleigang + * @Description 主数据-显示信息-显示按钮获取 + * @Date 11:43 上午 2024/6/11 + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + **/ + JsonResultEntity queryMdmViewButton(JSONObject jsonObject); + + + /** + * @Author lvleigang + * @Description 主数据-显示信息-显示按钮保存 + * @Date 11:43 上午 2024/6/11 + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + **/ + JsonResultEntity saveOrUpdateMdmViewButton(JSONObject jsonObject); + + + /** + * @Author lvleigang + * @Description 主数据-数据来源-列表获取 + * @Date 11:43 上午 2024/6/11 + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + **/ + JsonResultEntity queryMdmSource(JSONObject jsonObject); + + /** + * @Author lvleigang + * @Description 主数据-数据来源保存 + * @Date 11:43 上午 2024/6/11 + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + **/ + JsonResultEntity saveMdmSource(JSONObject jsonObject); + + /** + * @Author lvleigang + * @Description 主数据-数据来源获取 + * @Date 11:43 上午 2024/6/11 + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + **/ + JsonResultEntity getMdmSource(JSONObject jsonObject); + + /** + * @Author lvleigang + * @Description 主数据-数据来源修改 + * @Date 11:43 上午 2024/6/11 + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + **/ + JsonResultEntity updateMdmSource(JSONObject jsonObject); + /** + * @Author lvleigang + * @Description 主数据-数据来源删除 + * @Date 11:43 上午 2024/6/11 + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + **/ + JsonResultEntity deleteMdmSource(JSONObject jsonObject); + + /** + * @Author lvleigang + * @Description 主数据-分发设置-列表获取 + * @Date 11:43 上午 2024/6/11 + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + **/ + JsonResultEntity queryMdmDistribute(JSONObject jsonObject); + + /** + * @Author lvleigang + * @Description 主数据-分发设置保存 + * @Date 11:43 上午 2024/6/11 + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + **/ + JsonResultEntity saveMdmDistribute(JSONObject jsonObject); + + /** + * @Author lvleigang + * @Description 主数据-分发设置获取 + * @Date 11:43 上午 2024/6/11 + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + **/ + JsonResultEntity getMdmDistribute(JSONObject jsonObject); + + /** + * @Author lvleigang + * @Description 主数据-分发设置修改 + * @Date 11:43 上午 2024/6/11 + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + **/ + JsonResultEntity updateMdmDistribute(JSONObject jsonObject); + + /** + * @Author lvleigang + * @Description 主数据-分发设置删除 + * @Date 11:43 上午 2024/6/11 + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + **/ + JsonResultEntity deleteMdmDistribute(JSONObject jsonObject); + + + /** + * @Author lvleigang + * @Description 主数据-写入日志-列表获取 + * @Date 11:43 上午 2024/6/11 + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + **/ + JsonResultEntity queryMdmOptionLogPage(JSONObject jsonObject); + + /** + * @Author lvleigang + * @Description 主数据-下发日志-列表获取 + * @Date 11:43 上午 2024/6/11 + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + **/ + JsonResultEntity queryMdmDistributeLogPage(JSONObject jsonObject); } 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 a47b3505..9d41fb30 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 @@ -1,12 +1,66 @@ package com.hzya.frame.mdm.mdmModule.service.impl; +import com.alibaba.fastjson.JSONObject; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import com.hzya.frame.mdm.entity.MdmDbFiledVo; +import com.hzya.frame.mdm.entity.MdmDto; +import com.hzya.frame.mdm.entity.MdmModuleViewVo; +import com.hzya.frame.mdm.entity.MdmQuery; import com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity; import com.hzya.frame.mdm.mdmModule.dao.IMdmModuleDao; import com.hzya.frame.mdm.mdmModule.service.IMdmModuleService; -import org.springframework.stereotype.Service; +import com.hzya.frame.mdm.mdmModuleDb.dao.IMdmModuleDbDao; +import com.hzya.frame.mdm.mdmModuleDb.dao.impl.MdmModuleDbDaoImpl; +import com.hzya.frame.mdm.mdmModuleDb.entity.MdmModuleDbEntity; +import com.hzya.frame.mdm.mdmModuleDbFileds.dao.IMdmModuleDbFiledsDao; +import com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity; +import com.hzya.frame.mdm.mdmModuleDbFiledsRule.dao.IMdmModuleDbFiledsRuleDao; +import com.hzya.frame.mdm.mdmModuleDbFiledsRule.entity.MdmModuleDbFiledsRuleEntity; +import com.hzya.frame.mdm.mdmModuleDistribute.dao.IMdmModuleDistributeDao; +import com.hzya.frame.mdm.mdmModuleDistribute.entity.MdmModuleDistributeEntity; +import com.hzya.frame.mdm.mdmModuleDistributeDetail.dao.IMdmModuleDistributeDetailDao; +import com.hzya.frame.mdm.mdmModuleDistributeDetail.entity.MdmModuleDistributeDetailEntity; +import com.hzya.frame.mdm.mdmModuleOptionLog.dao.IMdmModuleOptionLogDao; +import com.hzya.frame.mdm.mdmModuleOptionLog.entity.MdmModuleOptionLogEntity; +import com.hzya.frame.mdm.mdmModuleSendLog.dao.IMdmModuleSendLogDao; +import com.hzya.frame.mdm.mdmModuleSendLog.entity.MdmModuleSendLogEntity; +import com.hzya.frame.mdm.mdmModuleSource.dao.IMdmModuleSourceDao; +import com.hzya.frame.mdm.mdmModuleSource.entity.MdmModuleSourceEntity; +import com.hzya.frame.mdm.mdmModuleView.dao.IMdmModuleViewDao; +import com.hzya.frame.mdm.mdmModuleView.entity.MdmModuleViewEntity; +import com.hzya.frame.mdm.mdmModuleViewButton.dao.IMdmModuleViewButtonDao; +import com.hzya.frame.mdm.mdmModuleViewButton.entity.MdmModuleViewButtonEntity; +import com.hzya.frame.mdm.mdmModuleViewDetail.dao.IMdmModuleViewDetailDao; +import com.hzya.frame.mdm.mdmModuleViewDetail.entity.MdmModuleViewDetailEntity; +import com.hzya.frame.mdm.mdmTableCodeRule.dao.IMdmTableCodeRuleDao; +import com.hzya.frame.mdm.mdmTableCodeRule.dao.impl.MdmTableCodeRuleDaoImpl; +import com.hzya.frame.mdm.mdmTableCodeRule.entity.MdmTableCodeRuleEntity; +import com.hzya.frame.mdm.service.IMdmServiceCache; +import com.hzya.frame.mdm.service.impl.MdmServiceCache; +import com.hzya.frame.sysnew.buttonConfig.dao.ISysButtonConfigDao; +import com.hzya.frame.sysnew.buttonConfig.entity.SysButtonConfigEntity; +import com.hzya.frame.sysnew.menuConfig.dao.ISysMenuConfigDao; +import com.hzya.frame.sysnew.menuConfig.entity.SysMenuConfigEntity; +import com.hzya.frame.sysnew.popedomMenu.dao.ISysPopedomMenuDao; +import com.hzya.frame.sysnew.popedomMenu.entity.SysPopedomMenuEntity; +import com.hzya.frame.sysnew.popedomOperate.dao.ISysPopedomOperateDao; +import com.hzya.frame.sysnew.popedomOperate.entity.SysPopedomOperateEntity; +import com.hzya.frame.web.entity.BaseResult; +import com.hzya.frame.web.entity.JsonResultEntity; +import org.checkerframework.checker.units.qual.A; +import org.springframework.stereotype.Service; import org.springframework.beans.factory.annotation.Autowired; + import javax.annotation.Resource; + import com.hzya.frame.basedao.service.impl.BaseService; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + /** * 主数据模版(MdmModule)表服务实现类 * @@ -15,12 +69,2144 @@ import com.hzya.frame.basedao.service.impl.BaseService; */ @Service(value = "mdmModuleService") public class MdmModuleServiceImpl extends BaseService implements IMdmModuleService { - + private IMdmModuleDao mdmModuleDao; - + @Resource + private ISysPopedomMenuDao sysPopedomMenuDao; + @Resource + private ISysPopedomOperateDao sysPopedomOperateDao; + @Resource + private ISysButtonConfigDao sysButtonConfigDao; + @Resource + private ISysMenuConfigDao sysMenuConfigDao; + + @Resource + private IMdmModuleSendLogDao mdmModuleSendLogDao; + @Resource + private IMdmModuleOptionLogDao mdmModuleOptionLogDao; + @Resource + private IMdmServiceCache mdmServiceCache; + @Resource + private IMdmModuleDbDao mdmModuleDbDao; + @Resource + private IMdmModuleDbFiledsDao mdmModuleDbFiledsDao; + @Resource + private IMdmModuleDbFiledsRuleDao mdmModuleDbFiledsRuleDao; + @Resource + private IMdmModuleDistributeDao mdmModuleDistributeDao; + @Resource + private IMdmModuleDistributeDetailDao mdmModuleDistributeDetailDao; + @Resource + private IMdmModuleViewDao mdmModuleViewDao; + + @Resource + private IMdmModuleSourceDao mdmModuleSourceDao; + @Resource + private IMdmModuleViewButtonDao mdmModuleViewButtonDao; + @Resource + private IMdmModuleViewDetailDao mdmModuleViewDetailDao; + @Resource + private IMdmTableCodeRuleDao mdmTableCodeRuleDao; + @Autowired - public void setMdmModuleDao(IMdmModuleDao dao) { - this.mdmModuleDao = dao; - this.dao = dao; - } + public void setMdmModuleDao(IMdmModuleDao dao) { + this.mdmModuleDao = dao; + this.dao = dao; + } + + /** + * @param object + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 查询所有主数据 + * @Date 11:43 上午 2024/6/11 + **/ + @Override + public JsonResultEntity queryMdm(JSONObject object) { + MdmModuleEntity entity = getData("jsonStr", object, MdmModuleEntity.class); + List mdmModuleEntities = mdmModuleDao.queryByLike(entity); + return BaseResult.getSuccessMessageEntity("查询所有主数据", mdmModuleEntities); + } + + /** + * @param object + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 删除主数据 校验主表是不是有数据,有数据不允许删除 + * @Date 11:43 上午 2024/6/11 + **/ + @Override + public JsonResultEntity deleteMdm(JSONObject object) { + MdmModuleEntity entity = getData("jsonStr", object, MdmModuleEntity.class); + if (entity == null) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + if (entity.getId() == null || "".equals(entity.getId())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + MdmModuleEntity mdmModuleEntity = mdmModuleDao.get(entity.getId()); + if (mdmModuleEntity == null) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + //查询数据源表 + MdmModuleDbEntity queryDb = new MdmModuleDbEntity(); + queryDb.setMdmId(mdmModuleEntity.getId()); + queryDb.setSts("Y"); + queryDb.setDbType("1");//主表 + List mdmModuleDbEntities = mdmModuleDbDao.queryBase(queryDb); + if (mdmModuleDbEntities != null && mdmModuleDbEntities.size() == 1) { + MdmQuery mdmQuery = new MdmQuery(); + mdmQuery.setTableName(mdmModuleDbEntities.get(0).getDbName()); + Integer count = mdmModuleDao.queryMainCount(mdmQuery); + if (count > 0) { + return BaseResult.getFailureMessageEntity(mdmModuleEntity.getMdmName() + "存在数据,不允许删除"); + } + MdmModuleDbFiledsRuleEntity queryCount = new MdmModuleDbFiledsRuleEntity(); + queryCount.setMdmId(entity.getId()); + queryCount.setRuleCode("service"); + queryCount.setRuleValue(mdmModuleDbEntities.get(0).getDbName()); + Integer counts = mdmModuleDbFiledsRuleDao.queryUserMdm(queryCount); + if (counts > 0) { + return BaseResult.getFailureMessageEntity(mdmModuleEntity.getMdmName() + "已被引用,不允许删除"); + } + } + + + + //删除单据规则 + MdmTableCodeRuleEntity mdmTableCodeRuleEntity = new MdmTableCodeRuleEntity(); + mdmTableCodeRuleEntity.setUpdate(); + mdmTableCodeRuleEntity.setMdmId(mdmModuleEntity.getId()); + mdmTableCodeRuleDao.logicRemoveMultiCondition(mdmTableCodeRuleEntity); + + //删除视图设置的字段 + MdmModuleViewDetailEntity mdmModuleViewDetailEntity = new MdmModuleViewDetailEntity(); + mdmModuleViewDetailEntity.setUpdate(); + mdmModuleViewDetailEntity.setMdmId(mdmModuleEntity.getId()); + mdmModuleViewDetailDao.logicRemoveMultiCondition(mdmModuleViewDetailEntity); + + //删除设置按钮 + MdmModuleViewButtonEntity mdmModuleViewButtonEntity = new MdmModuleViewButtonEntity(); + mdmModuleViewButtonEntity.setUpdate(); + mdmModuleViewButtonEntity.setMdmId(mdmModuleEntity.getId()); + mdmModuleViewButtonDao.logicRemoveMultiCondition(mdmModuleViewButtonEntity); + + //删除显示信息 + MdmModuleViewEntity mdmModuleViewEntity = new MdmModuleViewEntity(); + mdmModuleViewEntity.setUpdate(); + mdmModuleViewEntity.setMdmId(mdmModuleEntity.getId()); + mdmModuleViewDao.logicRemoveMultiCondition(mdmModuleViewEntity); + //删除数据来源配置 + MdmModuleSourceEntity mdmModuleSourceEntity = new MdmModuleSourceEntity(); + mdmModuleSourceEntity.setUpdate(); + mdmModuleSourceEntity.setMdmId(mdmModuleEntity.getId()); + mdmModuleSourceDao.logicRemoveMultiCondition(mdmModuleSourceEntity); + //删除下发配置,以及下发配置的数据权限 + MdmModuleDistributeDetailEntity mdmModuleDistributeDetailEntity = new MdmModuleDistributeDetailEntity(); + mdmModuleDistributeDetailEntity.setUpdate(); + mdmModuleDistributeDetailEntity.setMdmId(mdmModuleEntity.getId()); + mdmModuleDistributeDetailDao.logicRemoveMultiCondition(mdmModuleDistributeDetailEntity); + + MdmModuleDistributeEntity mdmModuleDistributeEntity = new MdmModuleDistributeEntity(); + mdmModuleDistributeEntity.setUpdate(); + mdmModuleDistributeEntity.setMdmId(mdmModuleEntity.getId()); + mdmModuleDistributeDao.logicRemoveMultiCondition(mdmModuleDistributeEntity); + //删除字段规则表 + MdmModuleDbFiledsRuleEntity mdmModuleDbFiledsRuleEntity = new MdmModuleDbFiledsRuleEntity(); + mdmModuleDbFiledsRuleEntity.setUpdate(); + mdmModuleDbFiledsRuleEntity.setMdmId(mdmModuleEntity.getId()); + mdmModuleDbFiledsRuleDao.logicRemoveMultiCondition(mdmModuleDbFiledsRuleEntity); + //删除字段表 + mdmServiceCache.deleteMdmModuleDbFileds(mdmModuleEntity.getId(), null); + //删除设置的db,以及实体表 + MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); + mdmModuleDbEntity.setMdmId(mdmModuleEntity.getId()); + List mdmModuleDbEntities1 = mdmServiceCache.queryMdmModuleDb(mdmModuleDbEntity); + if (mdmModuleDbEntities1 != null && mdmModuleDbEntities1.size() > 0) { + for (int i = 0; i < mdmModuleDbEntities1.size(); i++) { + Map maps = new HashMap<>(); + maps.put("tableName", mdmModuleDbEntities1.get(i).getDbName()); + mdmModuleDao.deleteTable(maps); + } + } + mdmServiceCache.deleteMdmModuleDb(mdmModuleEntity.getId(), null); + + //删除菜单和按钮,以及权限分配(用户权限和角色权限) + SysMenuConfigEntity sysMenuConfigEntity = new SysMenuConfigEntity(); + sysMenuConfigEntity.setFormId(mdmModuleEntity.getId()); + sysMenuConfigEntity.setSts("Y"); + List sysMenuConfigEntities = sysMenuConfigDao.queryBase(sysMenuConfigEntity); + if (sysMenuConfigEntities != null && sysMenuConfigEntities.size() > 0) { + for (int i = 0; i < sysMenuConfigEntities.size(); i++) { + SysButtonConfigEntity sysButtonConfigEntity = new SysButtonConfigEntity(); + sysButtonConfigEntity.setMenuId(sysMenuConfigEntities.get(i).getId()); + sysButtonConfigEntity.setSts("Y"); + sysButtonConfigEntity.setUpdate(); + sysButtonConfigDao.logicRemoveMultiCondition(sysButtonConfigEntity); + + SysPopedomOperateEntity sysPopedomOperateEntity = new SysPopedomOperateEntity(); + sysPopedomOperateEntity.setMenuId(sysMenuConfigEntities.get(i).getId()); + sysPopedomOperateEntity.setSts("Y"); + sysPopedomOperateEntity.setUpdate(); + sysPopedomOperateDao.logicRemoveMultiCondition(sysPopedomOperateEntity); + + SysPopedomMenuEntity sysPopedomMenuEntity = new SysPopedomMenuEntity(); + sysPopedomMenuEntity.setMenuId(sysMenuConfigEntities.get(i).getId()); + sysPopedomMenuEntity.setSts("Y"); + sysPopedomMenuEntity.setUpdate(); + sysPopedomMenuDao.logicRemoveMultiCondition(sysPopedomMenuEntity); + sysMenuConfigEntities.get(i).setUpdate(); + sysMenuConfigDao.logicRemoveMultiCondition(sysMenuConfigEntities.get(i)); + } + } + + + //删除主数据 + mdmServiceCache.deleteMdmModuleEntity(mdmModuleEntity); + + return BaseResult.getSuccessMessageEntity("删除成功"); + } + + /** + * @param object + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 主数据-基本信息获取 + * @Date 11:43 上午 2024/6/11 + **/ + @Override + public JsonResultEntity getMdm(JSONObject object) { + MdmModuleEntity entity = getData("jsonStr", object, MdmModuleEntity.class); + if (entity == null) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + if (entity.getId() == null || "".equals(entity.getId())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + MdmModuleEntity mdmModuleEntity = mdmModuleDao.get(entity.getId()); + if (mdmModuleEntity == null) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + return BaseResult.getSuccessMessageEntity("获取成功", mdmModuleEntity); + } + + /** + * @param object + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 主数据-基本信息新增 + * @Date 11:43 上午 2024/6/11 + **/ + @Override + public JsonResultEntity saveMdm(JSONObject object) { + MdmModuleEntity entity = getData("jsonStr", object, MdmModuleEntity.class); + if (entity == null) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + if (entity.getMdmName() == null || "".equals(entity.getMdmName())) { + return BaseResult.getFailureMessageEntity("请先输入主数据名称"); + } + if (entity.getMdmType() == null || "".equals(entity.getMdmType())) { + return BaseResult.getFailureMessageEntity("请先输入主数据类型"); + } + entity.setCreate(); + mdmModuleDao.save(entity); + return BaseResult.getSuccessMessageEntity("保存成功",entity); + } + + /** + * @param object + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 主数据-基本信息修改(同步修改菜单名称) + * @Date 11:43 上午 2024/6/11 + **/ + @Override + public JsonResultEntity updateMdm(JSONObject object) { + MdmModuleEntity entity = getData("jsonStr", object, MdmModuleEntity.class); + if (entity == null) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + if (entity.getId() == null || "".equals(entity.getId())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + if (entity.getMdmCode() == null || "".equals(entity.getMdmCode())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + entity.setUpdate(); + mdmServiceCache.updateMdmModuleEntity(entity); + + //修改菜单的显示信息 + SysMenuConfigEntity sysMenuConfigEntity = new SysMenuConfigEntity(); + sysMenuConfigEntity.setFormId(entity.getId()); + sysMenuConfigEntity.setSts("Y"); + List sysMenuConfigEntities = sysMenuConfigDao.queryBase(sysMenuConfigEntity); + if (sysMenuConfigEntities != null && sysMenuConfigEntities.size() > 0) { + for (int i = 0; i < sysMenuConfigEntities.size(); i++) { + + sysMenuConfigEntities.get(i).setUpdate(); + if ("1".equals(entity.getMdmType())) { + //1、档案 + sysMenuConfigEntities.get(i).setParentMenuId("ea22757e99c144fb9ef381dd322e233c"); + } else { + //2、单据 + sysMenuConfigEntities.get(i).setParentMenuId("58714ddb7ec94f5da91df74efada042f"); + } + sysMenuConfigEntities.get(i).setMenuName(entity.getMdmName()); + sysMenuConfigEntities.get(i).setMenuEnglishName("integrationOptionAdmin" + entity.getMdmCode()); + JSONObject object1 = JSONObject.parseObject(sysMenuConfigEntities.get(i).getOptions()); + object1.put("mdmId", entity.getId());//主数据id + object1.put("mdmCode", entity.getMdmCode());//主数据编码 + sysMenuConfigEntities.get(i).setOptions(object1.toString());//菜单mate参数 + sysMenuConfigDao.update(sysMenuConfigEntities.get(i)); + } + } + return BaseResult.getSuccessMessageEntity("修改成功"); + } + + /** + * @param object + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 主数据-数据源-单据规则获取 + * @Date 11:43 上午 2024/6/11 + **/ + @Override + public JsonResultEntity getMdmTableCodeRule(JSONObject object) { + MdmTableCodeRuleEntity entity = getData("jsonStr", object, MdmTableCodeRuleEntity.class); + if (entity == null) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + if (entity.getMdmId() == null || "".equals(entity.getMdmId())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + List mdmTableCodeRuleEntities = mdmTableCodeRuleDao.queryBase(entity); + return BaseResult.getSuccessMessageEntity("获取单据规则成功", mdmTableCodeRuleEntities); + } + + /** + * @param object + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 主数据-数据源-单据规则新增或修改 + * @Date 11:43 上午 2024/6/11 + **/ + @Override + public JsonResultEntity saveOrUpdateMdmTableCodeRule(JSONObject object) { + MdmDto entity = getData("jsonStr", object, MdmDto.class); + if (entity == null) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + if (entity.getId() == null || "".equals(entity.getId())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + if (entity.getMdmTableCodeRuleEntityList() == null || entity.getMdmTableCodeRuleEntityList().size() == 0) { + return BaseResult.getFailureMessageEntity("请先设置单据规则"); + } + + MdmTableCodeRuleEntity mdmTableCodeRuleEntity = new MdmTableCodeRuleEntity(); + mdmTableCodeRuleEntity.setMdmId(entity.getId()); + mdmTableCodeRuleEntity.setSts("Y"); + mdmTableCodeRuleEntity.setUpdate(); + mdmTableCodeRuleDao.logicRemoveMultiCondition(mdmTableCodeRuleEntity); + if (entity.getMdmTableCodeRuleEntityList() != null && entity.getMdmTableCodeRuleEntityList().size() > 0) { + for (int i = 0; i < entity.getMdmTableCodeRuleEntityList().size(); i++) { + entity.getMdmTableCodeRuleEntityList().get(i).setMdmId(entity.getId()); + entity.getMdmTableCodeRuleEntityList().get(i).setCreate(); + mdmTableCodeRuleDao.save(entity.getMdmTableCodeRuleEntityList().get(i)); + } + } + + return BaseResult.getSuccessMessageEntity("保存单据规则成功"); + } + + /** + * @param object + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 主数据-数据源-数据表获取 + * @Date 11:43 上午 2024/6/11 + **/ + @Override + public JsonResultEntity queryMdmDb(JSONObject object) { + MdmModuleDbEntity entity = getData("jsonStr", object, MdmModuleDbEntity.class); + if (entity == null) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + if (entity.getMdmId() == null || "".equals(entity.getMdmId())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + List mdmModuleDbEntities = mdmServiceCache.queryMdmModuleDb(entity); + List dbEntities = new ArrayList<>(); + if (mdmModuleDbEntities != null && mdmModuleDbEntities.size() > 0) { + for (int i = 0; i < mdmModuleDbEntities.size(); i++) { + if ("1".equals(mdmModuleDbEntities.get(i).getDbType()) || "2".equals(mdmModuleDbEntities.get(i).getDbType())) { + dbEntities.add(mdmModuleDbEntities.get(i)); + } + } + } + return BaseResult.getSuccessMessageEntity("获取数据源表成功", dbEntities); + } + + /** + * @param object + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 主数据-数据源-数据表新增 + * @Date 11:43 上午 2024/6/11 + **/ + @Override + public JsonResultEntity saveMdmDb(JSONObject object) { + MdmModuleDbEntity entity = getData("jsonStr", object, MdmModuleDbEntity.class); + if (entity == null) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + if (entity.getMdmId() == null || "".equals(entity.getMdmId())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + List mdmModuleDbEntities = new ArrayList<>(); + List mdmModuleDbFiledsEntities = new ArrayList<>(); + + //保存数据表,新建默认字段 + entity.setCreate(); + mdmModuleDbEntities.add(entity); + setMdmField(entity, mdmModuleDbFiledsEntities); + //如果是主表,同步新建 两张日志表,添加日志表字段 + if ("1".equals(entity.getDbType())) { + MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); + mdmModuleDbEntity.setMdmId(entity.getMdmId()); + mdmModuleDbEntity.setDbName(entity.getDbName() + "_option_log"); + mdmModuleDbEntity.setDbType("3"); + mdmModuleDbEntity.setCreate(); + mdmModuleDbEntities.add(mdmModuleDbEntity); + //新增 设置日志表 + setMdmField(mdmModuleDbEntity, mdmModuleDbFiledsEntities); + + MdmModuleDbEntity mdmModuleDbEntity1 = new MdmModuleDbEntity(); + mdmModuleDbEntity1.setMdmId(entity.getMdmId()); + mdmModuleDbEntity1.setDbName(entity.getDbName() + "_option_log"); + mdmModuleDbEntity1.setDbType("4"); + mdmModuleDbEntity1.setCreate(); + mdmModuleDbEntities.add(mdmModuleDbEntity1); + //新增 设置日志表 + setMdmField(mdmModuleDbEntity1, mdmModuleDbFiledsEntities); + } + mdmServiceCache.saveOrUpdateMdmModuleDb(entity.getMdmId(), mdmModuleDbEntities); + mdmServiceCache.saveOrUpdateMdmModuleDbFileds(entity.getMdmId(), mdmModuleDbFiledsEntities); + + //新建表 + for (int i = 0; i < mdmModuleDbEntities.size(); i++) { + Map maps = new HashMap<>(); + maps.put("tableName", mdmModuleDbEntities.get(i).getDbName());//表名 + maps.put("tableRemark", mdmModuleDbEntities.get(i).getRemark());//表备注 + maps.put("tableType", mdmModuleDbEntities.get(i).getDbType());//表备注 + mdmModuleDao.createTable(maps); + } + return BaseResult.getSuccessMessageEntity("保存表成功"); + } + + /** + * @param entity + * @param mdmModuleDbFiledsEntities + * @return void + * @Author lvleigang + * @Description 设置默认字段 + * @Date 10:47 上午 2024/6/12 + **/ + private void setMdmField(MdmModuleDbEntity entity, List mdmModuleDbFiledsEntities) { + + MdmModuleDbFiledsEntity id = new MdmModuleDbFiledsEntity(); + id.setMdmId(entity.getMdmId()); + id.setDbId(entity.getId()); + id.setChName("id"); + id.setEnName("id"); + id.setFiledType("3"); + id.setAddType("2"); + id.setUpdateType("2"); + id.setShowType("2"); + id.setQueryType("2"); + id.setListType("2"); + id.setViewType("2"); + id.setFiledLength("50"); + id.setCreate(); + mdmModuleDbFiledsEntities.add(id); + + if ("1".equals(entity.getDbType())) { + MdmModuleDbFiledsEntity documentRule = new MdmModuleDbFiledsEntity(); + documentRule.setMdmId(entity.getMdmId()); + documentRule.setDbId(entity.getId()); + documentRule.setChName("document_rule"); + documentRule.setEnName("单据规则"); + documentRule.setFiledType("3"); + documentRule.setAddType("2"); + documentRule.setUpdateType("1"); + documentRule.setShowType("1"); + documentRule.setQueryType("1"); + documentRule.setListType("1"); + documentRule.setViewType("1"); + documentRule.setFiledLength("50"); + documentRule.setCreate(); + mdmModuleDbFiledsEntities.add(documentRule); + + MdmModuleDbFiledsEntity document_rule_num = new MdmModuleDbFiledsEntity(); + document_rule_num.setMdmId(entity.getMdmId()); + document_rule_num.setDbId(entity.getId()); + document_rule_num.setChName("document_rule_num"); + document_rule_num.setEnName("单据规则流水号"); + document_rule_num.setFiledType("1"); + document_rule_num.setAddType("2"); + document_rule_num.setUpdateType("2"); + document_rule_num.setShowType("2"); + document_rule_num.setQueryType("2"); + document_rule_num.setListType("2"); + document_rule_num.setViewType("2"); + document_rule_num.setFiledLength("50"); + document_rule_num.setCreate(); + mdmModuleDbFiledsEntities.add(document_rule_num); + } + if ("2".equals(entity.getDbType()) || "3".equals(entity.getDbType()) || "4".equals(entity.getDbType())) { + MdmModuleDbFiledsEntity formmain_id = new MdmModuleDbFiledsEntity(); + formmain_id.setMdmId(entity.getMdmId()); + formmain_id.setDbId(entity.getId()); + formmain_id.setChName("formmain_id"); + formmain_id.setEnName("主表id"); + formmain_id.setFiledType("3"); + formmain_id.setAddType("2"); + formmain_id.setUpdateType("1"); + formmain_id.setShowType("1"); + formmain_id.setQueryType("1"); + formmain_id.setListType("1"); + formmain_id.setViewType("1"); + formmain_id.setFiledLength("50"); + formmain_id.setCreate(); + mdmModuleDbFiledsEntities.add(formmain_id); + } + //写入日志字段:操作人 + if ("3".equals(entity.getDbType())) { + MdmModuleDbFiledsEntity source_name = new MdmModuleDbFiledsEntity(); + source_name.setMdmId(entity.getMdmId()); + source_name.setDbId(entity.getId()); + source_name.setChName("source_name"); + source_name.setEnName("来源名称"); + source_name.setFiledType("3"); + source_name.setAddType("2"); + source_name.setUpdateType("2"); + source_name.setShowType("2"); + source_name.setQueryType("2"); + source_name.setListType("2"); + source_name.setViewType("2"); + source_name.setFiledLength("255"); + source_name.setCreate(); + mdmModuleDbFiledsEntities.add(source_name); + + MdmModuleDbFiledsEntity code = new MdmModuleDbFiledsEntity(); + code.setMdmId(entity.getMdmId()); + code.setDbId(entity.getId()); + code.setChName("code"); + code.setEnName("编码"); + code.setFiledType("3"); + code.setAddType("1"); + code.setUpdateType("1"); + code.setShowType("1"); + code.setQueryType("1"); + code.setListType("1"); + code.setViewType("1"); + code.setFiledLength("255"); + code.setCreate(); + mdmModuleDbFiledsEntities.add(code); + + MdmModuleDbFiledsEntity source_data = new MdmModuleDbFiledsEntity(); + source_data.setMdmId(entity.getMdmId()); + source_data.setDbId(entity.getId()); + source_data.setChName("source_data"); + source_data.setEnName("源数据"); + source_data.setFiledType("3"); + source_data.setAddType("1"); + source_data.setUpdateType("1"); + source_data.setShowType("1"); + source_data.setQueryType("1"); + source_data.setListType("1"); + source_data.setViewType("1"); + source_data.setFiledLength("255"); + source_data.setCreate(); + mdmModuleDbFiledsEntities.add(source_data); + + MdmModuleDbFiledsEntity option_type = new MdmModuleDbFiledsEntity(); + option_type.setMdmId(entity.getMdmId()); + option_type.setDbId(entity.getId()); + option_type.setChName("option_type"); + option_type.setEnName("操作类型"); + option_type.setFiledType("3"); + option_type.setAddType("1"); + option_type.setUpdateType("1"); + option_type.setShowType("1"); + option_type.setQueryType("1"); + option_type.setListType("1"); + option_type.setViewType("1"); + option_type.setFiledLength("255"); + option_type.setCreate(); + mdmModuleDbFiledsEntities.add(option_type); + + MdmModuleDbFiledsEntity option_Name = new MdmModuleDbFiledsEntity(); + option_Name.setMdmId(entity.getMdmId()); + option_Name.setDbId(entity.getId()); + option_Name.setChName("option_name"); + option_Name.setEnName("操作人"); + option_Name.setFiledType("3"); + option_Name.setAddType("1"); + option_Name.setUpdateType("1"); + option_Name.setShowType("1"); + option_Name.setQueryType("1"); + option_Name.setListType("1"); + option_Name.setViewType("1"); + option_Name.setFiledLength("255"); + option_Name.setCreate(); + mdmModuleDbFiledsEntities.add(option_Name); + } + + //目标应用、目标api、 + if ("4".equals(entity.getDbType())) { + MdmModuleDbFiledsEntity target_app = new MdmModuleDbFiledsEntity(); + target_app.setMdmId(entity.getMdmId()); + target_app.setDbId(entity.getId()); + target_app.setChName("target_app"); + target_app.setEnName("目标应用"); + target_app.setFiledType("3"); + target_app.setAddType("1"); + target_app.setUpdateType("1"); + target_app.setShowType("1"); + target_app.setQueryType("1"); + target_app.setListType("1"); + target_app.setViewType("1"); + target_app.setFiledLength("255"); + target_app.setCreate(); + mdmModuleDbFiledsEntities.add(target_app); + + MdmModuleDbFiledsEntity target_api = new MdmModuleDbFiledsEntity(); + target_api.setMdmId(entity.getMdmId()); + target_api.setDbId(entity.getId()); + target_api.setChName("target_api"); + target_api.setEnName("目标api"); + target_api.setFiledType("3"); + target_api.setAddType("1"); + target_api.setUpdateType("1"); + target_api.setShowType("1"); + target_api.setQueryType("1"); + target_api.setListType("1"); + target_api.setViewType("1"); + target_api.setFiledLength("255"); + target_api.setCreate(); + mdmModuleDbFiledsEntities.add(target_api); + + MdmModuleDbFiledsEntity source_data = new MdmModuleDbFiledsEntity(); + source_data.setMdmId(entity.getMdmId()); + source_data.setDbId(entity.getId()); + source_data.setChName("source_data"); + source_data.setEnName("源数据"); + source_data.setFiledType("3"); + source_data.setAddType("1"); + source_data.setUpdateType("1"); + source_data.setShowType("1"); + source_data.setQueryType("1"); + source_data.setListType("1"); + source_data.setViewType("1"); + source_data.setFiledLength("255"); + source_data.setCreate(); + mdmModuleDbFiledsEntities.add(source_data); + + MdmModuleDbFiledsEntity option_type = new MdmModuleDbFiledsEntity(); + option_type.setMdmId(entity.getMdmId()); + option_type.setDbId(entity.getId()); + option_type.setChName("option_type"); + option_type.setEnName("操作类型"); + option_type.setFiledType("3"); + option_type.setAddType("1"); + option_type.setUpdateType("1"); + option_type.setShowType("1"); + option_type.setQueryType("1"); + option_type.setListType("1"); + option_type.setViewType("1"); + option_type.setFiledLength("255"); + option_type.setCreate(); + mdmModuleDbFiledsEntities.add(option_type); + } + if ("2".equals(entity.getDbType()) || "1".equals(entity.getDbType())) { + MdmModuleDbFiledsEntity data_status = new MdmModuleDbFiledsEntity(); + data_status.setMdmId(entity.getMdmId()); + data_status.setDbId(entity.getId()); + data_status.setChName("data_status"); + data_status.setEnName("数据状态 Y正常 N删除 F修改"); + data_status.setFiledType("3"); + data_status.setAddType("2"); + data_status.setUpdateType("2"); + data_status.setShowType("2"); + data_status.setQueryType("2"); + data_status.setListType("2"); + data_status.setViewType("2"); + data_status.setFiledLength("1"); + data_status.setCreate(); + mdmModuleDbFiledsEntities.add(data_status); + } + if ("1".equals(entity.getDbType())) { + MdmModuleDbFiledsEntity add_status = new MdmModuleDbFiledsEntity(); + add_status.setMdmId(entity.getMdmId()); + add_status.setDbId(entity.getId()); + add_status.setChName("add_status"); + add_status.setEnName("新增数据状态 0待下发 1已下发"); + add_status.setFiledType("3"); + add_status.setAddType("2"); + add_status.setUpdateType("2"); + add_status.setShowType("2"); + add_status.setQueryType("2"); + add_status.setListType("2"); + add_status.setViewType("2"); + add_status.setFiledLength("1"); + add_status.setCreate(); + mdmModuleDbFiledsEntities.add(add_status); + } + if ("1".equals(entity.getDbType())) { + MdmModuleDbFiledsEntity update_status = new MdmModuleDbFiledsEntity(); + update_status.setMdmId(entity.getMdmId()); + update_status.setDbId(entity.getId()); + update_status.setChName("update_status"); + update_status.setEnName("修改数据状态 0待下发 1已下发"); + update_status.setFiledType("3"); + update_status.setAddType("2"); + update_status.setUpdateType("2"); + update_status.setShowType("2"); + update_status.setQueryType("2"); + update_status.setListType("2"); + update_status.setViewType("2"); + update_status.setFiledLength("1"); + update_status.setCreate(); + mdmModuleDbFiledsEntities.add(update_status); + } + + if ("1".equals(entity.getDbType())) { + MdmModuleDbFiledsEntity delete_status = new MdmModuleDbFiledsEntity(); + delete_status.setMdmId(entity.getMdmId()); + delete_status.setDbId(entity.getId()); + delete_status.setChName("delete_status"); + delete_status.setEnName("删除数据状态 0待下发 1已下发"); + delete_status.setFiledType("3"); + delete_status.setAddType("2"); + delete_status.setUpdateType("2"); + delete_status.setShowType("2"); + delete_status.setQueryType("2"); + delete_status.setListType("2"); + delete_status.setViewType("2"); + delete_status.setFiledLength("1"); + delete_status.setCreate(); + mdmModuleDbFiledsEntities.add(delete_status); + } + + MdmModuleDbFiledsEntity sorts = new MdmModuleDbFiledsEntity(); + sorts.setMdmId(entity.getMdmId()); + sorts.setDbId(entity.getId()); + sorts.setChName("sorts"); + sorts.setEnName("排序"); + sorts.setFiledType("1"); + sorts.setAddType("2"); + sorts.setUpdateType("2"); + sorts.setShowType("2"); + sorts.setQueryType("2"); + sorts.setListType("2"); + sorts.setViewType("2"); + sorts.setFiledLength("20"); + sorts.setCreate(); + mdmModuleDbFiledsEntities.add(sorts); + MdmModuleDbFiledsEntity create_user_id = new MdmModuleDbFiledsEntity(); + create_user_id.setMdmId(entity.getMdmId()); + create_user_id.setDbId(entity.getId()); + create_user_id.setChName("create_user_id"); + create_user_id.setEnName("创建人id"); + create_user_id.setFiledType("3"); + create_user_id.setAddType("2"); + create_user_id.setUpdateType("2"); + create_user_id.setShowType("2"); + create_user_id.setQueryType("2"); + create_user_id.setListType("2"); + create_user_id.setViewType("2"); + create_user_id.setFiledLength("50"); + create_user_id.setCreate(); + mdmModuleDbFiledsEntities.add(create_user_id); + MdmModuleDbFiledsEntity create_time = new MdmModuleDbFiledsEntity(); + create_time.setMdmId(entity.getMdmId()); + create_time.setDbId(entity.getId()); + create_time.setChName("create_time"); + create_time.setEnName("创建时间"); + create_time.setFiledType("4"); + create_time.setAddType("2"); + create_time.setUpdateType("2"); + create_time.setShowType("2"); + create_time.setQueryType("2"); + create_time.setListType("2"); + create_time.setViewType("2"); + create_time.setFiledLength(null); + create_time.setCreate(); + mdmModuleDbFiledsEntities.add(create_time); + MdmModuleDbFiledsEntity modify_user_id = new MdmModuleDbFiledsEntity(); + modify_user_id.setMdmId(entity.getMdmId()); + modify_user_id.setDbId(entity.getId()); + modify_user_id.setChName("modify_user_id"); + modify_user_id.setEnName("修改人id"); + modify_user_id.setFiledType("3"); + modify_user_id.setAddType("2"); + modify_user_id.setUpdateType("2"); + modify_user_id.setShowType("2"); + modify_user_id.setQueryType("2"); + modify_user_id.setListType("2"); + modify_user_id.setViewType("2"); + modify_user_id.setFiledLength("50"); + modify_user_id.setCreate(); + mdmModuleDbFiledsEntities.add(modify_user_id); + MdmModuleDbFiledsEntity modify_time = new MdmModuleDbFiledsEntity(); + modify_time.setMdmId(entity.getMdmId()); + modify_time.setDbId(entity.getId()); + modify_time.setChName("modify_time"); + modify_time.setEnName("修改时间"); + modify_time.setFiledType("4"); + modify_time.setAddType("2"); + modify_time.setUpdateType("2"); + modify_time.setShowType("2"); + modify_time.setQueryType("2"); + modify_time.setListType("2"); + modify_time.setViewType("2"); + modify_time.setFiledLength(null); + modify_time.setCreate(); + mdmModuleDbFiledsEntities.add(modify_time); + MdmModuleDbFiledsEntity sts = new MdmModuleDbFiledsEntity(); + sts.setMdmId(entity.getMdmId()); + sts.setDbId(entity.getId()); + sts.setChName("sts"); + sts.setEnName("状态(Y正常N删除)"); + sts.setFiledType("3"); + sts.setAddType("2"); + sts.setUpdateType("2"); + sts.setShowType("2"); + sts.setQueryType("2"); + sts.setListType("2"); + sts.setViewType("2"); + sts.setFiledLength("1"); + sts.setCreate(); + mdmModuleDbFiledsEntities.add(sts); + MdmModuleDbFiledsEntity org_id = new MdmModuleDbFiledsEntity(); + org_id.setMdmId(entity.getMdmId()); + org_id.setDbId(entity.getId()); + org_id.setChName("org_id"); + org_id.setEnName("组织机构ID"); + org_id.setFiledType("3"); + org_id.setAddType("2"); + org_id.setUpdateType("2"); + org_id.setShowType("2"); + org_id.setQueryType("2"); + org_id.setListType("2"); + org_id.setViewType("2"); + org_id.setFiledLength("50"); + org_id.setCreate(); + mdmModuleDbFiledsEntities.add(org_id); + MdmModuleDbFiledsEntity company_id = new MdmModuleDbFiledsEntity(); + company_id.setMdmId(entity.getMdmId()); + company_id.setDbId(entity.getId()); + company_id.setChName("company_id"); + company_id.setEnName("公司id"); + company_id.setFiledType("3"); + company_id.setAddType("2"); + company_id.setUpdateType("2"); + company_id.setShowType("2"); + company_id.setQueryType("2"); + company_id.setListType("2"); + company_id.setViewType("2"); + company_id.setFiledLength("50"); + company_id.setCreate(); + mdmModuleDbFiledsEntities.add(company_id); + } + + + /** + * @param object + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 主数据-数据源-数据表修改 + * @Date 11:43 上午 2024/6/11 + **/ + @Override + public JsonResultEntity updateMdmDb(JSONObject object) { + MdmModuleDbEntity entity = getData("jsonStr", object, MdmModuleDbEntity.class); + if (entity == null) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + if (entity.getMdmId() == null || "".equals(entity.getMdmId())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + if (entity.getDbName() == null || "".equals(entity.getDbName())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + List mdmModuleDbEntities = new ArrayList<>(); + mdmModuleDbEntities.add(entity); + mdmServiceCache.saveOrUpdateMdmModuleDb(entity.getMdmId(), mdmModuleDbEntities); + Map tablename = new HashMap<>(); + tablename.put("tableName", entity.getDbName());//表名 + tablename.put("tableRemark", entity.getRemark());//表备注 + mdmModuleDao.alterTableName(tablename); + return BaseResult.getSuccessMessageEntity("修改数据源成功"); + } + + /** + * @param object + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 主数据-数据源-数据表删除 + * @Date 11:43 上午 2024/6/11 + **/ + @Override + public JsonResultEntity deleteMdmDb(JSONObject object) { + MdmModuleDbEntity entity = getData("jsonStr", object, MdmModuleDbEntity.class); + if (entity == null) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + if (entity.getMdmId() == null || "".equals(entity.getMdmId())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + if (entity.getDbName() == null || "".equals(entity.getDbName())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + + MdmQuery mdmQuery = new MdmQuery(); + mdmQuery.setTableName(entity.getDbName()); + Integer count = mdmModuleDao.queryMainCount(mdmQuery); + if (count > 0) { + return BaseResult.getFailureMessageEntity(entity.getDbName() + "存在数据,不允许删除"); + } + MdmModuleDbFiledsRuleEntity queryCount = new MdmModuleDbFiledsRuleEntity(); + queryCount.setMdmId(entity.getMdmId()); + queryCount.setRuleCode("service"); + queryCount.setRuleValue(entity.getDbName()); + Integer counts = mdmModuleDbFiledsRuleDao.queryUserMdm(queryCount); + if (counts > 0) { + return BaseResult.getFailureMessageEntity(entity.getDbName() + "已被引用,不允许删除"); + } + + if ("1".equals(entity.getDbType())) { + //删除视图设置的字段 + MdmModuleViewDetailEntity mdmModuleViewDetailEntity = new MdmModuleViewDetailEntity(); + mdmModuleViewDetailEntity.setUpdate(); + mdmModuleViewDetailEntity.setMdmId(entity.getMdmId()); + mdmModuleViewDetailDao.logicRemoveMultiCondition(mdmModuleViewDetailEntity); + + //删除显示信息 + MdmModuleViewEntity mdmModuleViewEntity = new MdmModuleViewEntity(); + mdmModuleViewEntity.setUpdate(); + mdmModuleViewEntity.setMdmId(entity.getMdmId()); + mdmModuleViewDao.logicRemoveMultiCondition(mdmModuleViewEntity); + + //删除字段规则表 + MdmModuleDbFiledsRuleEntity mdmModuleDbFiledsRuleEntity = new MdmModuleDbFiledsRuleEntity(); + mdmModuleDbFiledsRuleEntity.setUpdate(); + mdmModuleDbFiledsRuleEntity.setMdmId(entity.getMdmId()); + mdmModuleDbFiledsRuleDao.logicRemoveMultiCondition(mdmModuleDbFiledsRuleEntity); + //删除字段表 + mdmServiceCache.deleteMdmModuleDbFileds(entity.getMdmId(), null); + //删除设置的db,以及实体表 + MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); + mdmModuleDbEntity.setMdmId(entity.getMdmId()); + List mdmModuleDbEntities1 = mdmServiceCache.queryMdmModuleDb(mdmModuleDbEntity); + if (mdmModuleDbEntities1 != null && mdmModuleDbEntities1.size() > 0) { + for (int i = 0; i < mdmModuleDbEntities1.size(); i++) { + Map maps = new HashMap<>(); + maps.put("tableName", mdmModuleDbEntities1.get(i).getDbName()); + mdmModuleDao.deleteTable(maps); + } + } + mdmServiceCache.deleteMdmModuleDb(entity.getMdmId(), null); + + //删除菜单和按钮,以及权限分配(用户权限和角色权限) + SysMenuConfigEntity sysMenuConfigEntity = new SysMenuConfigEntity(); + sysMenuConfigEntity.setFormId(entity.getMdmId()); + sysMenuConfigEntity.setSts("Y"); + List sysMenuConfigEntities = sysMenuConfigDao.queryBase(sysMenuConfigEntity); + if (sysMenuConfigEntities != null && sysMenuConfigEntities.size() > 0) { + for (int i = 0; i < sysMenuConfigEntities.size(); i++) { + SysButtonConfigEntity sysButtonConfigEntity = new SysButtonConfigEntity(); + sysButtonConfigEntity.setMenuId(sysMenuConfigEntities.get(i).getId()); + sysButtonConfigEntity.setSts("Y"); + sysButtonConfigEntity.setUpdate(); + sysButtonConfigDao.logicRemoveMultiCondition(sysButtonConfigEntity); + + SysPopedomOperateEntity sysPopedomOperateEntity = new SysPopedomOperateEntity(); + sysPopedomOperateEntity.setMenuId(sysMenuConfigEntities.get(i).getId()); + sysPopedomOperateEntity.setSts("Y"); + sysPopedomOperateEntity.setUpdate(); + sysPopedomOperateDao.logicRemoveMultiCondition(sysPopedomOperateEntity); + + SysPopedomMenuEntity sysPopedomMenuEntity = new SysPopedomMenuEntity(); + sysPopedomMenuEntity.setMenuId(sysMenuConfigEntities.get(i).getId()); + sysPopedomMenuEntity.setSts("Y"); + sysPopedomMenuEntity.setUpdate(); + sysPopedomMenuDao.logicRemoveMultiCondition(sysPopedomMenuEntity); + sysMenuConfigEntities.get(i).setUpdate(); + sysMenuConfigDao.logicRemoveMultiCondition(sysMenuConfigEntities.get(i)); + } + } + } + + if ("2".equals(entity.getDbType())) { + MdmModuleDbFiledsEntity mdmModuleDbFiledsEntity = new MdmModuleDbFiledsEntity(); + mdmModuleDbFiledsEntity.setDbId(entity.getId()); + List mdmModuleDbFiledsEntities = mdmModuleDbFiledsDao.queryBase(mdmModuleDbFiledsEntity); + if (mdmModuleDbFiledsEntities != null && mdmModuleDbFiledsEntities.size() > 0) { + for (int i = 0; i < mdmModuleDbFiledsEntities.size(); i++) { + //删除视图设置的字段 + MdmModuleViewDetailEntity mdmModuleViewDetailEntity = new MdmModuleViewDetailEntity(); + mdmModuleViewDetailEntity.setUpdate(); + mdmModuleViewDetailEntity.setMdmId(entity.getMdmId()); + mdmModuleViewDetailEntity.setViewFiled(mdmModuleDbFiledsEntities.get(i).getId()); + mdmModuleViewDetailDao.logicRemoveMultiCondition(mdmModuleViewDetailEntity); + } + } + //删除字段规则表 + MdmModuleDbFiledsRuleEntity mdmModuleDbFiledsRuleEntity = new MdmModuleDbFiledsRuleEntity(); + mdmModuleDbFiledsRuleEntity.setUpdate(); + mdmModuleDbFiledsRuleEntity.setMdmId(entity.getMdmId()); + mdmModuleDbFiledsRuleEntity.setDbId(entity.getId()); + mdmModuleDbFiledsRuleDao.logicRemoveMultiCondition(mdmModuleDbFiledsRuleEntity); + //删除字段表 + mdmServiceCache.deleteMdmModuleDbFileds(entity.getMdmId(), entity.getId()); + //删除设置的db,以及实体表 + + Map maps = new HashMap<>(); + maps.put("tableName", entity.getDbName()); + mdmModuleDao.deleteTable(maps); + mdmServiceCache.deleteMdmModuleDb(entity.getMdmId(), entity.getId()); + } + + return BaseResult.getSuccessMessageEntity("删除成功"); + } + + /** + * @param object + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 主数据-数据源-数据表字段获取 + * @Date 11:43 上午 2024/6/11 + **/ + @Override + public JsonResultEntity queryMdmDbField(JSONObject object) { + MdmModuleDbFiledsEntity entity = getData("jsonStr", object, MdmModuleDbFiledsEntity.class); + if (entity == null) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + if (entity.getMdmId() == null || "".equals(entity.getMdmId())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + if (entity.getDbId() == null || "".equals(entity.getDbId())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + MdmModuleDbFiledsEntity queryEntity = new MdmModuleDbFiledsEntity(); + queryEntity.setMdmId(entity.getMdmId()); + List mdmModuleDbFiledsEntities = mdmServiceCache.queryMdmModuleDbFileds(queryEntity); + List dbEntities = new ArrayList<>(); + if (mdmModuleDbFiledsEntities != null && mdmModuleDbFiledsEntities.size() > 0) { + for (int i = 0; i < mdmModuleDbFiledsEntities.size(); i++) { + if (entity.getDbId().equals(mdmModuleDbFiledsEntities.get(i).getDbId()) && "1".equals(mdmModuleDbFiledsEntities.get(i).getViewType())) { + dbEntities.add(mdmModuleDbFiledsEntities.get(i)); + } + } + } + return BaseResult.getSuccessMessageEntity("获取数据源表字段成功", dbEntities); + } + + /** + * @param object + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 主数据-数据源-数据表字段新增 + * @Date 11:43 上午 2024/6/11 + **/ + @Override + public JsonResultEntity saveMdmDbField(JSONObject object) { + MdmModuleDbFiledsEntity entity = getData("jsonStr", object, MdmModuleDbFiledsEntity.class); + if (entity == null) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + if (entity.getMdmId() == null || "".equals(entity.getMdmId())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + if (entity.getDbId() == null || "".equals(entity.getDbId())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + if (entity.getEnName() == null || "".equals(entity.getEnName())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + entity.setCreate(); + entity.setDataType("1"); + List mdmModuleDbFiledsEntities = new ArrayList<>(); + mdmModuleDbFiledsEntities.add(entity); + mdmServiceCache.saveOrUpdateMdmModuleDbFileds(entity.getMdmId(), mdmModuleDbFiledsEntities); + mdmModuleDao.alterTableField(entity); + return BaseResult.getSuccessMessageEntity("新增字段成功"); + } + + /** + * @param object + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 主数据-数据源-数据表字段修改 + * @Date 11:43 上午 2024/6/11 + **/ + @Override + public JsonResultEntity updateMdmDbField(JSONObject object) { + MdmModuleDbFiledsEntity entity = getData("jsonStr", object, MdmModuleDbFiledsEntity.class); + if (entity == null) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + if (entity.getId() == null || "".equals(entity.getId())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + if (entity.getMdmId() == null || "".equals(entity.getMdmId())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + if (entity.getDbId() == null || "".equals(entity.getDbId())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + if (entity.getEnName() == null || "".equals(entity.getEnName())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + entity.setUpdate(); + entity.setDataType("2"); + List mdmModuleDbFiledsEntities = new ArrayList<>(); + mdmModuleDbFiledsEntities.add(entity); + mdmServiceCache.saveOrUpdateMdmModuleDbFileds(entity.getMdmId(), mdmModuleDbFiledsEntities); + mdmModuleDao.alterTableField(entity); + return BaseResult.getSuccessMessageEntity("修改字段成功"); + } + + /** + * @param object + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 主数据-数据源-数据表字段删除 + * @Date 11:43 上午 2024/6/11 + **/ + @Override + public JsonResultEntity deleteMdmDbField(JSONObject object) { + MdmModuleDbFiledsEntity entity = getData("jsonStr", object, MdmModuleDbFiledsEntity.class); + if (entity == null) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + if (entity.getId() == null || "".equals(entity.getId())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + if (entity.getMdmId() == null || "".equals(entity.getMdmId())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + if (entity.getDbId() == null || "".equals(entity.getDbId())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + if (entity.getEnName() == null || "".equals(entity.getEnName())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + MdmModuleDbFiledsRuleEntity queryCount = new MdmModuleDbFiledsRuleEntity(); + queryCount.setDbId(entity.getDbId()); + queryCount.setRuleCode("label"); + queryCount.setRuleValue(entity.getEnName()); + Integer counts = mdmModuleDbFiledsRuleDao.queryUserMdm(queryCount); + if (counts > 0) { + return BaseResult.getFailureMessageEntity(entity.getEnName() + "已被引用,不允许删除"); + } + entity.setUpdate(); + entity.setSts("N"); + entity.setDataType("3"); + List mdmModuleDbFiledsEntities = new ArrayList<>(); + mdmModuleDbFiledsEntities.add(entity); + mdmServiceCache.saveOrUpdateMdmModuleDbFileds(entity.getMdmId(), mdmModuleDbFiledsEntities); + mdmModuleDao.alterTableField(entity); + return BaseResult.getSuccessMessageEntity("删除字段成功"); + } + + /** + * @param object + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 主数据-数据源-数据表字段规则获取 + * @Date 11:43 上午 2024/6/11 + **/ + @Override + public JsonResultEntity queryMdmDbFieldRule(JSONObject object) { + MdmModuleDbFiledsRuleEntity entity = getData("jsonStr", object, MdmModuleDbFiledsRuleEntity.class); + if (entity == null) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + if (entity.getMdmId() == null || "".equals(entity.getMdmId())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + if (entity.getDbId() == null || "".equals(entity.getDbId())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + if (entity.getFiledId() == null || "".equals(entity.getFiledId())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + List mdmModuleDbFiledsRuleEntities = mdmModuleDbFiledsRuleDao.queryBase(entity); + return BaseResult.getSuccessMessageEntity("获取数据源表字段规则成功", mdmModuleDbFiledsRuleEntities); + } + + /** + * @param object + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 主数据-数据源-数据表字段规则修改 + * @Date 11:43 上午 2024/6/11 + **/ + @Override + public JsonResultEntity updateMdmDbFieldRule(JSONObject object) { + + MdmDto entity = getData("jsonStr", object, MdmDto.class); + if (entity == null) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + if (entity.getId() == null || "".equals(entity.getId())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + if (entity.getFieldId() == null || "".equals(entity.getFieldId())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + if (entity.getMdmModuleDbFiledsRuleEntities() == null || entity.getMdmModuleDbFiledsRuleEntities().size() == 0) { + return BaseResult.getFailureMessageEntity("请先设置字段规则"); + } + + MdmModuleDbFiledsRuleEntity mdmModuleDbFiledsRuleEntity = new MdmModuleDbFiledsRuleEntity(); + mdmModuleDbFiledsRuleEntity.setFiledId(entity.getFieldId()); + mdmModuleDbFiledsRuleEntity.setSts("Y"); + mdmModuleDbFiledsRuleEntity.setUpdate(); + mdmModuleDbFiledsRuleDao.logicRemoveMultiCondition(mdmModuleDbFiledsRuleEntity); + if (entity.getMdmModuleDbFiledsRuleEntities() != null && entity.getMdmModuleDbFiledsRuleEntities().size() > 0) { + for (int i = 0; i < entity.getMdmModuleDbFiledsRuleEntities().size(); i++) { + entity.getMdmModuleDbFiledsRuleEntities().get(i).setMdmId(entity.getId()); + entity.getMdmModuleDbFiledsRuleEntities().get(i).setFiledId(entity.getFieldId()); + if (entity.getMdmModuleDbFiledsRuleEntities().get(i).getId() != null) { + entity.getMdmModuleDbFiledsRuleEntities().get(i).setUpdate(); + mdmModuleDbFiledsRuleDao.update(entity.getMdmModuleDbFiledsRuleEntities().get(i)); + } else { + entity.getMdmModuleDbFiledsRuleEntities().get(i).setCreate(); + mdmModuleDbFiledsRuleDao.save(entity.getMdmModuleDbFiledsRuleEntities().get(i)); + } + } + } + return BaseResult.getSuccessMessageEntity("保存字段规则成功"); + } + + /** + * @param object + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 主数据-显示信息-显示类型获取 + * @Date 11:43 上午 2024/6/11 + **/ + @Override + public JsonResultEntity queryMdmView(JSONObject object) { + MdmModuleViewEntity entity = getData("jsonStr", object, MdmModuleViewEntity.class); + if (entity == null) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + if (entity.getMdmId() == null || "".equals(entity.getMdmId())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + List moduleViewEntities = mdmModuleViewDao.queryBase(entity); + if (moduleViewEntities != null && moduleViewEntities.size() == 1) { + return BaseResult.getSuccessMessageEntity("获取显示类型成功", moduleViewEntities.get(0)); + } else { + return BaseResult.getFailureMessageEntity("获取显示类型失败"); + } + } + + /** + * @param object + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 主数据-显示信息-显示类型保存 + * @Date 11:43 上午 2024/6/11 + **/ + @Override + public JsonResultEntity saveMdmView(JSONObject object) { + MdmModuleViewEntity entity = getData("jsonStr", object, MdmModuleViewEntity.class); + if (entity == null) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + MdmModuleEntity mdmModuleEntity = mdmModuleDao.get(entity.getMdmId()); + + entity.setCreate(); + mdmModuleViewDao.save(entity); + SysMenuConfigEntity module = new SysMenuConfigEntity(); + module.setCreate(); + module.setFormId(mdmModuleEntity.getId()); + if("1".equals(mdmModuleEntity.getMdmType())){ + //1、档案 + module.setParentMenuId("ea22757e99c144fb9ef381dd322e233c"); + }else { + //2、单据 + module.setParentMenuId("58714ddb7ec94f5da91df74efada042f"); + } + module.setMenuName(mdmModuleEntity.getMdmName()); + module.setMenuEnglishName("integrationOptionAdmin" + mdmModuleEntity.getMdmCode()); + module.setMenuIcon(null);//模块图标 + module.setRoute("integrationOptionAdmin/" + mdmModuleEntity.getMdmCode());//路由地址 + module.setMenuPage("integrationOptionV2/index");//一级Layout 二级 ParntView 三级component + module.setRemark("主数据生成菜单"); + module.setVisibles("0"); + module.setShowType("1"); + JSONObject object1 = new JSONObject(); + object1.put("mdmId", mdmModuleEntity.getId());//主数据id + object1.put("mdmCode", mdmModuleEntity.getMdmCode());//主数据编码 + object1.put("viewType", entity.getViewName());//1、树 2、列表 + module.setOptions(object1.toString());//菜单mate参数 + sysMenuConfigDao.save(module); + return BaseResult.getSuccessMessageEntity("保存显示类型成功"); + + } + + /** + * @param object + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 主数据-显示信息-显示类型修改 + * @Date 11:43 上午 2024/6/11 + **/ + @Override + public JsonResultEntity updateMdmView(JSONObject object) { + MdmModuleViewEntity entity = getData("jsonStr", object, MdmModuleViewEntity.class); + if (entity == null) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + if (entity.getId() == null || "".equals(entity.getId())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + MdmModuleEntity mdmModuleEntity = mdmModuleDao.get(entity.getMdmId()); + + entity.setUpdate(); + mdmModuleViewDao.update(entity); + SysMenuConfigEntity module = new SysMenuConfigEntity(); + module.setFormId(mdmModuleEntity.getId()); + List sysMenuConfigEntities = sysMenuConfigDao.queryBase(module); + + if(sysMenuConfigEntities != null && sysMenuConfigEntities.size() == 1){ + module = sysMenuConfigEntities.get(0); + module.setUpdate(); + module.setFormId(mdmModuleEntity.getId()); + if("1".equals(mdmModuleEntity.getMdmType())){ + //1、档案 + module.setParentMenuId("ea22757e99c144fb9ef381dd322e233c"); + }else { + //2、单据 + module.setParentMenuId("58714ddb7ec94f5da91df74efada042f"); + } + module.setMenuName(mdmModuleEntity.getMdmName()); + module.setMenuEnglishName("integrationOptionAdmin" + mdmModuleEntity.getMdmCode()); + module.setMenuIcon(null);//模块图标 + module.setRoute("integrationOptionAdmin/" + mdmModuleEntity.getMdmCode());//路由地址 + module.setMenuPage("integrationOptionV2/index");//一级Layout 二级 ParntView 三级component + module.setRemark("主数据生成菜单"); + module.setVisibles("0"); + module.setShowType("1"); + JSONObject object1 = new JSONObject(); + object1.put("mdmId", mdmModuleEntity.getId());//主数据id + object1.put("mdmCode", mdmModuleEntity.getMdmCode());//主数据编码 + object1.put("viewType", entity.getViewName());//1、树 2、列表 + module.setOptions(object1.toString());//菜单mate参数 + sysMenuConfigDao.update(module); + } + return BaseResult.getSuccessMessageEntity("修改显示类型成功"); + } + + /** + * @param object + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 主数据-显示信息-显示字段获取 + * @Date 11:43 上午 2024/6/11 + **/ + @Override + public JsonResultEntity queryMdmViewField(JSONObject object) { + MdmDto entity = getData("jsonStr", object, MdmDto.class); + if (entity == null) { + return BaseResult.getFailureMessageEntity("参数不允许为空"); + } + if (entity.getId() == null || "".equals(entity.getId())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + MdmModuleViewVo mdmModuleViewVo = new MdmModuleViewVo(); + //查询设置各种类型字段 + //查询模版数据源 + MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); + mdmModuleDbEntity.setMdmId(entity.getId()); + mdmModuleDbEntity.setSts("Y"); + List mdmModuleDbEntityList = mdmServiceCache.queryMdmModuleDb(mdmModuleDbEntity); + if (mdmModuleDbEntityList != null && mdmModuleDbEntityList.size() > 0) { + MdmModuleDbFiledsEntity mdmModuleDbFiledsEntity = new MdmModuleDbFiledsEntity(); + mdmModuleDbFiledsEntity.setMdmId(entity.getId()); + mdmModuleDbFiledsEntity.setSts("Y"); + List mdmModuleDbFiledsEntityList = mdmServiceCache.queryMdmModuleDbFileds(mdmModuleDbFiledsEntity); + setFiledType(mdmModuleViewVo, mdmModuleDbEntityList, mdmModuleDbFiledsEntityList); + } + //查询数据库设置的字段 + MdmModuleViewEntity mdmModuleViewEntity = new MdmModuleViewEntity(); + mdmModuleViewEntity.setMdmId(entity.getId()); + mdmModuleViewEntity.setSts("Y"); + List moduleViewEntityList = mdmModuleViewDao.queryBase(mdmModuleViewEntity); + if (moduleViewEntityList != null && moduleViewEntityList.size() == 1) { + mdmModuleViewVo.setMdmModuleViewEntity(moduleViewEntityList.get(0)); + //查询明细 + MdmModuleViewDetailEntity mdmModuleViewDetailEntity = new MdmModuleViewDetailEntity(); + mdmModuleViewDetailEntity.setMdmId(entity.getId()); + mdmModuleViewDetailEntity.setViewId(moduleViewEntityList.get(0).getId()); + mdmModuleViewDetailEntity.setSts("Y"); + List mdmModuleViewDetailEntityList = mdmModuleViewDetailDao.queryBase(mdmModuleViewDetailEntity); + setDbFiledType(mdmModuleViewVo, mdmModuleViewDetailEntityList); + } else { + mdmModuleViewVo.setMdmModuleViewEntity(new MdmModuleViewEntity()); + mdmModuleViewVo.setDbAddFiled(new ArrayList<>()); + mdmModuleViewVo.setDbEditFiled(new ArrayList<>()); + mdmModuleViewVo.setDbShowFiled(new ArrayList<>()); + mdmModuleViewVo.setDbQueryFiled(new ArrayList<>()); + mdmModuleViewVo.setDbListFiled(new ArrayList<>()); + } + return BaseResult.getSuccessMessageEntity("查询视图成功", mdmModuleViewVo); + } + + private void setDbFiledType(MdmModuleViewVo mdmModuleViewVo, List mdmModuleViewDetailEntityList) { + //新增 + List addFiled = new ArrayList<>(); + //修改 + List editFiled = new ArrayList<>(); + //查看 + List showFiled = new ArrayList<>(); + //查询 + List queryFiled = new ArrayList<>(); + //列表 + List listFiled = new ArrayList<>(); + if (mdmModuleViewDetailEntityList != null && mdmModuleViewDetailEntityList.size() > 0) { + for (int i = 0; i < mdmModuleViewDetailEntityList.size(); i++) { + switch (mdmModuleViewDetailEntityList.get(i).getViewType()) { + //1、查询2、列表3、新增4、修改 5、查看 + case "1": + queryFiled.add(mdmModuleViewDetailEntityList.get(i)); + break; + case "2": + listFiled.add(mdmModuleViewDetailEntityList.get(i)); + break; + case "3": + addFiled.add(mdmModuleViewDetailEntityList.get(i)); + break; + case "4": + editFiled.add(mdmModuleViewDetailEntityList.get(i)); + break; + case "5": + showFiled.add(mdmModuleViewDetailEntityList.get(i)); + break; + default: + } + } + } + mdmModuleViewVo.setDbAddFiled(addFiled); + mdmModuleViewVo.setDbEditFiled(editFiled); + mdmModuleViewVo.setDbShowFiled(showFiled); + mdmModuleViewVo.setDbQueryFiled(queryFiled); + mdmModuleViewVo.setDbListFiled(listFiled); + } + + /** + * @param mdmModuleViewVo + * @param mdmModuleDbEntityList + * @param mdmModuleDbFiledsEntityList + * @return void + * @Author lvleigang + * @Description 设置对应的字段类型 + * @Date 2023/10/25 + **/ + private void setFiledType(MdmModuleViewVo mdmModuleViewVo, List mdmModuleDbEntityList, List mdmModuleDbFiledsEntityList) { + //新增 + List addFiled = new ArrayList<>(); + //修改 + List editFiled = new ArrayList<>(); + //查看 + List showFiled = new ArrayList<>(); + //查询 + List queryFiled = new ArrayList<>(); + //列表 + List listFiled = new ArrayList<>(); + if (mdmModuleDbEntityList != null && mdmModuleDbEntityList.size() > 0) { + for (int i = 0; i < mdmModuleDbEntityList.size(); i++) { + if (mdmModuleDbFiledsEntityList != null && mdmModuleDbFiledsEntityList.size() > 0) { + for (int i1 = 0; i1 < mdmModuleDbFiledsEntityList.size(); i1++) { + if (mdmModuleDbEntityList.get(i).getId().equals(mdmModuleDbFiledsEntityList.get(i1).getDbId())) { + if ("1".equals(mdmModuleDbEntityList.get(i).getDbType())) { + //1、主表 + addFiled.add(new MdmDbFiledVo(mdmModuleDbFiledsEntityList.get(i1).getId(), "【主表:" + mdmModuleDbEntityList.get(i).getDbName() + "】" + mdmModuleDbFiledsEntityList.get(i1).getChName())); + editFiled.add(new MdmDbFiledVo(mdmModuleDbFiledsEntityList.get(i1).getId(), "【主表:" + mdmModuleDbEntityList.get(i).getDbName() + "】" + mdmModuleDbFiledsEntityList.get(i1).getChName())); + showFiled.add(new MdmDbFiledVo(mdmModuleDbFiledsEntityList.get(i1).getId(), "【主表:" + mdmModuleDbEntityList.get(i).getDbName() + "】" + mdmModuleDbFiledsEntityList.get(i1).getChName())); + queryFiled.add(new MdmDbFiledVo(mdmModuleDbFiledsEntityList.get(i1).getId(), "【主表:" + mdmModuleDbEntityList.get(i).getDbName() + "】" + mdmModuleDbFiledsEntityList.get(i1).getChName())); + listFiled.add(new MdmDbFiledVo(mdmModuleDbFiledsEntityList.get(i1).getId(), "【主表:" + mdmModuleDbEntityList.get(i).getDbName() + "】" + mdmModuleDbFiledsEntityList.get(i1).getChName())); + } else { + //2、明细 + queryFiled.add(new MdmDbFiledVo(mdmModuleDbFiledsEntityList.get(i1).getId(), "【子表:" + mdmModuleDbEntityList.get(i).getDbName() + "】" + mdmModuleDbFiledsEntityList.get(i1).getChName())); + addFiled.add(new MdmDbFiledVo(mdmModuleDbFiledsEntityList.get(i1).getId(), "【子表:" + mdmModuleDbEntityList.get(i).getDbName() + "】" + mdmModuleDbFiledsEntityList.get(i1).getChName())); + editFiled.add(new MdmDbFiledVo(mdmModuleDbFiledsEntityList.get(i1).getId(), "【子表:" + mdmModuleDbEntityList.get(i).getDbName() + "】" + mdmModuleDbFiledsEntityList.get(i1).getChName())); + showFiled.add(new MdmDbFiledVo(mdmModuleDbFiledsEntityList.get(i1).getId(), "【子表:" + mdmModuleDbEntityList.get(i).getDbName() + "】" + mdmModuleDbFiledsEntityList.get(i1).getChName())); + } + } + } + } + } + } + mdmModuleViewVo.setAddFiled(addFiled); + mdmModuleViewVo.setEditFiled(editFiled); + mdmModuleViewVo.setShowFiled(showFiled); + mdmModuleViewVo.setQueryFiled(queryFiled); + mdmModuleViewVo.setListFiled(listFiled); + } + + /** + * @param object + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 主数据-显示信息-显示字段设置保存 + * @Date 11:43 上午 2024/6/11 + **/ + @Override + public JsonResultEntity saveOrUpdateMdmViewField(JSONObject object) { + MdmModuleViewVo entity = getData("jsonStr", object, MdmModuleViewVo.class); + if (entity == null) { + return BaseResult.getFailureMessageEntity("参数不允许为空"); + } + if (entity.getMdmId() == null || "".equals(entity.getMdmId())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + if (entity.getViewType() == null || "".equals(entity.getViewType())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + //1、查询2、列表3、新增4、修改 5、查看 + if ("1".equals(entity.getViewType())) { + MdmModuleViewDetailEntity mdmModuleViewDetailEntity = new MdmModuleViewDetailEntity(); + mdmModuleViewDetailEntity.setMdmId(entity.getMdmId()); + mdmModuleViewDetailEntity.setViewType(entity.getViewType()); + mdmModuleViewDetailEntity.setUpdate(); + mdmModuleViewDetailDao.logicRemoveMultiCondition(mdmModuleViewDetailEntity); + if (entity.getDbQueryFiled() != null && entity.getDbQueryFiled().size() > 0) { + for (int i = 0; i < entity.getDbQueryFiled().size(); i++) { + if (entity.getDbQueryFiled().get(i).getId() != null) { + entity.getDbQueryFiled().get(i).setUpdate(); + mdmModuleViewDetailDao.update(entity.getDbQueryFiled().get(i)); + } else { + entity.getDbQueryFiled().get(i).setCreate(); + mdmModuleViewDetailDao.save(entity.getDbQueryFiled().get(i)); + } + } + } + + } else if ("2".equals(entity.getViewType())) { + MdmModuleViewDetailEntity mdmModuleViewDetailEntity = new MdmModuleViewDetailEntity(); + mdmModuleViewDetailEntity.setMdmId(entity.getMdmId()); + mdmModuleViewDetailEntity.setViewType(entity.getViewType()); + mdmModuleViewDetailEntity.setUpdate(); + mdmModuleViewDetailDao.logicRemoveMultiCondition(mdmModuleViewDetailEntity); + if (entity.getDbListFiled() != null && entity.getDbListFiled().size() > 0) { + for (int i = 0; i < entity.getDbListFiled().size(); i++) { + if (entity.getDbListFiled().get(i).getId() != null) { + entity.getDbListFiled().get(i).setUpdate(); + mdmModuleViewDetailDao.update(entity.getDbListFiled().get(i)); + } else { + entity.getDbListFiled().get(i).setCreate(); + mdmModuleViewDetailDao.save(entity.getDbListFiled().get(i)); + } + } + } + + } else if ("3".equals(entity.getViewType())) { + MdmModuleViewDetailEntity mdmModuleViewDetailEntity = new MdmModuleViewDetailEntity(); + mdmModuleViewDetailEntity.setMdmId(entity.getMdmId()); + mdmModuleViewDetailEntity.setViewType(entity.getViewType()); + mdmModuleViewDetailEntity.setUpdate(); + mdmModuleViewDetailDao.logicRemoveMultiCondition(mdmModuleViewDetailEntity); + if (entity.getDbAddFiled() != null && entity.getDbAddFiled().size() > 0) { + for (int i = 0; i < entity.getDbAddFiled().size(); i++) { + if (entity.getDbAddFiled().get(i).getId() != null) { + entity.getDbAddFiled().get(i).setUpdate(); + mdmModuleViewDetailDao.update(entity.getDbAddFiled().get(i)); + } else { + entity.getDbAddFiled().get(i).setCreate(); + mdmModuleViewDetailDao.save(entity.getDbAddFiled().get(i)); + } + } + } + + } else if ("4".equals(entity.getViewType())) { + MdmModuleViewDetailEntity mdmModuleViewDetailEntity = new MdmModuleViewDetailEntity(); + mdmModuleViewDetailEntity.setMdmId(entity.getMdmId()); + mdmModuleViewDetailEntity.setViewType(entity.getViewType()); + mdmModuleViewDetailEntity.setUpdate(); + mdmModuleViewDetailDao.logicRemoveMultiCondition(mdmModuleViewDetailEntity); + if (entity.getDbEditFiled() != null && entity.getDbEditFiled().size() > 0) { + for (int i = 0; i < entity.getDbEditFiled().size(); i++) { + if (entity.getDbEditFiled().get(i).getId() != null) { + entity.getDbEditFiled().get(i).setUpdate(); + mdmModuleViewDetailDao.update(entity.getDbEditFiled().get(i)); + } else { + entity.getDbEditFiled().get(i).setCreate(); + mdmModuleViewDetailDao.save(entity.getDbEditFiled().get(i)); + } + } + } + + } else if ("5".equals(entity.getViewType())) { + MdmModuleViewDetailEntity mdmModuleViewDetailEntity = new MdmModuleViewDetailEntity(); + mdmModuleViewDetailEntity.setMdmId(entity.getMdmId()); + mdmModuleViewDetailEntity.setViewType(entity.getViewType()); + mdmModuleViewDetailEntity.setUpdate(); + mdmModuleViewDetailDao.logicRemoveMultiCondition(mdmModuleViewDetailEntity); + if (entity.getDbShowFiled() != null && entity.getDbShowFiled().size() > 0) { + for (int i = 0; i < entity.getDbShowFiled().size(); i++) { + if (entity.getDbShowFiled().get(i).getId() != null) { + entity.getDbShowFiled().get(i).setUpdate(); + mdmModuleViewDetailDao.update(entity.getDbEditFiled().get(i)); + } else { + entity.getDbShowFiled().get(i).setCreate(); + mdmModuleViewDetailDao.save(entity.getDbShowFiled().get(i)); + } + } + } + + } + return BaseResult.getSuccessMessageEntity("修改成功"); + } + + /** + * @param object + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 主数据-显示信息-显示按钮获取 + * @Date 11:43 上午 2024/6/11 + **/ + @Override + public JsonResultEntity queryMdmViewButton(JSONObject object) { + MdmModuleViewButtonEntity entity = getData("jsonStr", object, MdmModuleViewButtonEntity.class); + if (entity == null) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + if (entity.getMdmId() == null || "".equals(entity.getMdmId())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + List moduleViewButtonEntities = mdmModuleViewButtonDao.queryBase(entity); + return BaseResult.getSuccessMessageEntity("获取显示按钮成功", moduleViewButtonEntities); + } + + /** + * @param object + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 主数据-显示信息-显示按钮保存 + * @Date 11:43 上午 2024/6/11 + **/ + @Override + public JsonResultEntity saveOrUpdateMdmViewButton(JSONObject object) { + MdmModuleViewVo entity = getData("jsonStr", object, MdmModuleViewVo.class); + if (entity == null) { + return BaseResult.getFailureMessageEntity("参数不允许为空"); + } + if (entity.getMdmId() == null || "".equals(entity.getMdmId())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + + MdmModuleViewButtonEntity mdmModuleViewButtonEntity = new MdmModuleViewButtonEntity(); + mdmModuleViewButtonEntity.setMdmId(entity.getMdmId()); + mdmModuleViewButtonEntity.setUpdate(); + mdmModuleViewButtonDao.logicRemoveMultiCondition(mdmModuleViewButtonEntity); + if (entity.getDbButtonFiled() != null && entity.getDbButtonFiled().size() > 0) { + for (int i = 0; i < entity.getDbButtonFiled().size(); i++) { + if (entity.getDbButtonFiled().get(i).getId() != null) { + entity.getDbButtonFiled().get(i).setUpdate(); + mdmModuleViewButtonDao.update(entity.getDbButtonFiled().get(i)); + } else { + entity.getDbButtonFiled().get(i).setCreate(); + mdmModuleViewButtonDao.save(entity.getDbButtonFiled().get(i)); + } + } + } + MdmModuleEntity mdmModuleEntity = mdmModuleDao.get(entity.getMdmId()); + SysMenuConfigEntity module = new SysMenuConfigEntity(); + module.setFormId(mdmModuleEntity.getId()); + List sysMenuConfigEntities = sysMenuConfigDao.queryBase(module); + if(sysMenuConfigEntities != null && sysMenuConfigEntities.size() == 1){ + module = sysMenuConfigEntities.get(0); + SysButtonConfigEntity buttonConfigEntity = new SysButtonConfigEntity(); + buttonConfigEntity.setMenuId(module.getId()); + buttonConfigEntity.setSts("Y"); + List sysButtonConfigEntities = sysButtonConfigDao.queryBase(buttonConfigEntity); + //1、查询按钮权限 + SysPopedomOperateEntity sysPopedomOperateEntity = new SysPopedomOperateEntity(); + sysPopedomOperateEntity.setMenuId(module.getId()); + sysPopedomOperateEntity.setSts("Y"); + List sysPopedomOperateEntities = sysPopedomOperateDao.queryBase(sysPopedomOperateEntity); + //删除按钮和删除按钮权限 + sysButtonConfigDao.logicRemoveMultiCondition(buttonConfigEntity); + sysPopedomOperateDao.logicRemoveMultiCondition(sysPopedomOperateEntity); + //删除处理权限 + doMdmModuleButton(module,entity.getDbButtonFiled(),sysButtonConfigEntities,sysPopedomOperateEntities); + } + return BaseResult.getSuccessMessageEntity("修改显示按钮成功"); + } + /** + * @Author lvleigang + * @Description + * @Date 3:29 下午 2024/6/4 + * @param module 菜单 + * @param mdmModuleViewButtonEntities 主数据按钮 + * @param sysButtonConfigEntities 菜单按钮 + * @param sysPopedomOperateEntities 按钮权限 + * @return void + **/ + private void doMdmModuleButton(SysMenuConfigEntity module,List mdmModuleViewButtonEntities, List sysButtonConfigEntities, List sysPopedomOperateEntities) { + //循环设置的按钮,再循环菜单的按钮,如果有把原先的修改状态,如果没有新增 + if(mdmModuleViewButtonEntities != null && mdmModuleViewButtonEntities.size() > 0){ + for (int i = 0; i < mdmModuleViewButtonEntities.size(); i++) { + boolean flag = false; + if(sysButtonConfigEntities != null && sysButtonConfigEntities.size() > 0){ + for (int i1 = 0; i1 < sysButtonConfigEntities.size(); i1++) { + if(mdmModuleViewButtonEntities.get(i).getButtonValue().equals(sysButtonConfigEntities.get(i1).getCode())){ + flag = true; + sysButtonConfigEntities.get(i1).setSts("Y"); + sysButtonConfigEntities.get(i1).setUpdate(); + sysButtonConfigDao.update(sysButtonConfigEntities.get(i1)); + if(sysPopedomOperateEntities != null && sysPopedomOperateEntities.size() > 0){ + for (int i2 = 0; i2 < sysPopedomOperateEntities.size(); i2++) { + if(sysPopedomOperateEntities.get(i2).getOperate().equals(sysButtonConfigEntities.get(i1).getId())){ + sysPopedomOperateEntities.get(i2).setSts("Y"); + sysPopedomOperateEntities.get(i2).setUpdate(); + sysPopedomOperateDao.update(sysPopedomOperateEntities.get(i2)); + } + } + } + break; + } + } + } + //原先没有需要新增 + if(!flag){ + if("new".equals(mdmModuleViewButtonEntities.get(i).getButtonValue())){ + SysButtonConfigEntity xz = new SysButtonConfigEntity(); + xz.setCode("new"); + xz.setNameCh("新建"); + xz.setNameEn("new"); + xz.setMenuId(module.getId()); + xz.setIconName(""); + xz.setStyles(""); + xz.setBtnFunction("new"); + xz.setRemark("主数据新建按钮"); + xz.setCreate(); + sysButtonConfigDao.save(xz); + } + if("resize".equals(mdmModuleViewButtonEntities.get(i).getButtonValue())){ + + SysButtonConfigEntity cz = new SysButtonConfigEntity(); + cz.setCode("resize"); + cz.setNameCh("重置"); + cz.setNameEn("resize"); + cz.setMenuId(module.getId()); + cz.setIconName(""); + cz.setStyles(""); + cz.setBtnFunction("resize"); + cz.setRemark("主数据重置按钮"); + cz.setCreate(); + sysButtonConfigDao.save(cz); + } + if("search".equals(mdmModuleViewButtonEntities.get(i).getButtonValue())) { + + SysButtonConfigEntity cx = new SysButtonConfigEntity(); + cx.setCode("search"); + cx.setNameCh("查询"); + cx.setNameEn("search"); + cx.setMenuId(module.getId()); + cx.setIconName(""); + cx.setStyles(""); + cx.setBtnFunction("search"); + cx.setRemark("主数据查询按钮"); + cx.setCreate(); + sysButtonConfigDao.save(cx); + } + if("edit".equals(mdmModuleViewButtonEntities.get(i).getButtonValue())) { + + SysButtonConfigEntity xg = new SysButtonConfigEntity(); + xg.setCode("edit"); + xg.setNameCh("修改"); + xg.setNameEn("edit"); + xg.setMenuId(module.getId()); + xg.setIconName(""); + xg.setStyles(""); + xg.setBtnFunction("edit"); + xg.setRemark("主数据修改按钮"); + xg.setCreate(); + sysButtonConfigDao.save(xg); + } + if("dele".equals(mdmModuleViewButtonEntities.get(i).getButtonValue())) { + + SysButtonConfigEntity sc = new SysButtonConfigEntity(); + sc.setCode("dele"); + sc.setNameCh("删除"); + sc.setNameEn("dele"); + sc.setMenuId(module.getId()); + sc.setIconName(""); + sc.setStyles(""); + sc.setBtnFunction("dele"); + sc.setRemark("主数据删除按钮"); + sc.setCreate(); + sysButtonConfigDao.save(sc); + } + if("view".equals(mdmModuleViewButtonEntities.get(i).getButtonValue())) { + + SysButtonConfigEntity ck = new SysButtonConfigEntity(); + ck.setCode("view"); + ck.setNameCh("查看"); + ck.setNameEn("view"); + ck.setMenuId(module.getId()); + ck.setIconName(""); + ck.setStyles(""); + ck.setBtnFunction("view"); + ck.setRemark("主数据查看按钮"); + ck.setCreate(); + sysButtonConfigDao.save(ck); + } + if("send".equals(mdmModuleViewButtonEntities.get(i).getButtonValue())) { + SysButtonConfigEntity xf = new SysButtonConfigEntity(); + xf.setCode("send"); + xf.setNameCh("下发"); + xf.setNameEn("send"); + xf.setMenuId(module.getId()); + xf.setIconName(""); + xf.setStyles(""); + xf.setBtnFunction("send"); + xf.setRemark("主数据下发按钮"); + xf.setCreate(); + sysButtonConfigDao.save(xf); + } + + + } + } + } + } + /** + * @param object + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 主数据-数据来源-列表获取 + * @Date 11:43 上午 2024/6/11 + **/ + @Override + public JsonResultEntity queryMdmSource(JSONObject object) { + MdmModuleSourceEntity entity = getData("jsonStr", object, MdmModuleSourceEntity.class); + if (entity == null) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + if (entity.getMdmId() == null || "".equals(entity.getMdmId())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + List list = mdmModuleSourceDao.queryBase(entity); + return BaseResult.getSuccessMessageEntity("获取数据来源成功", list); + } + + /** + * @param object + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 主数据-数据来源保存 + * @Date 11:43 上午 2024/6/11 + **/ + @Override + public JsonResultEntity saveMdmSource(JSONObject object) { + MdmModuleSourceEntity entity = getData("jsonStr", object, MdmModuleSourceEntity.class); + if (entity == null) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + if (entity.getMdmId() == null || "".equals(entity.getMdmId())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + entity.setCreate(); + mdmModuleSourceDao.save(entity); + return BaseResult.getSuccessMessageEntity("保存数据来源成功"); + } + + /** + * @param object + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 主数据-数据来源获取 + * @Date 11:43 上午 2024/6/11 + **/ + @Override + public JsonResultEntity getMdmSource(JSONObject object) { + MdmModuleSourceEntity entity = getData("jsonStr", object, MdmModuleSourceEntity.class); + if (entity == null) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + if (entity.getId() == null || "".equals(entity.getId())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + entity = mdmModuleSourceDao.get(entity.getId()); + return BaseResult.getSuccessMessageEntity("获取数据来源成功", entity); + } + + /** + * @param object + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 主数据-数据来源修改 + * @Date 11:43 上午 2024/6/11 + **/ + @Override + public JsonResultEntity updateMdmSource(JSONObject object) { + MdmModuleSourceEntity entity = getData("jsonStr", object, MdmModuleSourceEntity.class); + if (entity == null) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + if (entity.getId() == null || "".equals(entity.getId())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + entity.setUpdate(); + mdmModuleSourceDao.update(entity); + return BaseResult.getSuccessMessageEntity("修改数据来源成功"); + } + + /** + * @param object + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 主数据-数据来源删除 + * @Date 11:43 上午 2024/6/11 + **/ + @Override + public JsonResultEntity deleteMdmSource(JSONObject object) { + MdmModuleSourceEntity entity = getData("jsonStr", object, MdmModuleSourceEntity.class); + if (entity == null) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + if (entity.getId() == null || "".equals(entity.getId())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + entity.setUpdate(); + mdmModuleSourceDao.logicRemoveMultiCondition(entity); + return BaseResult.getSuccessMessageEntity("删除数据来源成功"); + } + + /** + * @param object + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 主数据-分发设置-列表获取 + * @Date 11:43 上午 2024/6/11 + **/ + @Override + public JsonResultEntity queryMdmDistribute(JSONObject object) { + MdmModuleDistributeEntity entity = getData("jsonStr", object, MdmModuleDistributeEntity.class); + if (entity == null) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + if (entity.getMdmId() == null || "".equals(entity.getMdmId())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + List list = mdmModuleDistributeDao.queryBase(entity); + return BaseResult.getSuccessMessageEntity("获取分发设置成功", list); + } + + /** + * @param object + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 主数据-分发设置保存 + * @Date 11:43 上午 2024/6/11 + **/ + @Override + public JsonResultEntity saveMdmDistribute(JSONObject object) { + MdmModuleDistributeEntity entity = getData("jsonStr", object, MdmModuleDistributeEntity.class); + if (entity == null) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + if (entity.getMdmId() == null || "".equals(entity.getMdmId())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + entity.setCreate(); + mdmModuleDistributeDao.save(entity); + if (entity.getMdmModuleDistributeDetailEntities() != null && entity.getMdmModuleDistributeDetailEntities().size() > 0) { + for (int i = 0; i < entity.getMdmModuleDistributeDetailEntities().size(); i++) { + entity.getMdmModuleDistributeDetailEntities().get(i).setCreate(); + mdmModuleDistributeDetailDao.save(entity.getMdmModuleDistributeDetailEntities().get(i)); + } + } + return BaseResult.getSuccessMessageEntity("保存分发设置成功"); + } + + /** + * @param object + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 主数据-分发设置获取 + * @Date 11:43 上午 2024/6/11 + **/ + @Override + public JsonResultEntity getMdmDistribute(JSONObject object) { + MdmModuleDistributeEntity entity = getData("jsonStr", object, MdmModuleDistributeEntity.class); + if (entity == null) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + if (entity.getId() == null || "".equals(entity.getId())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + entity = mdmModuleDistributeDao.get(entity.getId()); + MdmModuleDistributeDetailEntity mdmModuleDistributeDetailEntity = new MdmModuleDistributeDetailEntity(); + mdmModuleDistributeDetailEntity.setDistributeId(entity.getId()); + List mdmModuleDistributeDetailEntities = mdmModuleDistributeDetailDao.queryBase(mdmModuleDistributeDetailEntity); + entity.setMdmModuleDistributeDetailEntities(mdmModuleDistributeDetailEntities); + return BaseResult.getSuccessMessageEntity("获取分发设置成功", entity); + } + + /** + * @param object + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 主数据-分发设置修改 + * @Date 11:43 上午 2024/6/11 + **/ + @Override + public JsonResultEntity updateMdmDistribute(JSONObject object) { + MdmModuleDistributeEntity entity = getData("jsonStr", object, MdmModuleDistributeEntity.class); + if (entity == null) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + if (entity.getId() == null || "".equals(entity.getId())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + entity.setUpdate(); + mdmModuleDistributeDao.update(entity); + MdmModuleDistributeDetailEntity mdmModuleDistributeDetailEntity = new MdmModuleDistributeDetailEntity(); + mdmModuleDistributeDetailEntity.setDistributeId(entity.getId()); + mdmModuleDistributeDetailEntity.setUpdate(); + mdmModuleDistributeDetailDao.logicRemoveMultiCondition(mdmModuleDistributeDetailEntity); + if (entity.getMdmModuleDistributeDetailEntities() != null && entity.getMdmModuleDistributeDetailEntities().size() > 0) { + for (int i = 0; i < entity.getMdmModuleDistributeDetailEntities().size(); i++) { + if (entity.getMdmModuleDistributeDetailEntities().get(i).getId() != null) { + entity.getMdmModuleDistributeDetailEntities().get(i).setUpdate(); + mdmModuleDistributeDetailDao.update(entity.getMdmModuleDistributeDetailEntities().get(i)); + } else { + entity.getMdmModuleDistributeDetailEntities().get(i).setCreate(); + mdmModuleDistributeDetailDao.save(entity.getMdmModuleDistributeDetailEntities().get(i)); + } + } + } + return BaseResult.getSuccessMessageEntity("修改数据来源成功"); + } + + /** + * @param object + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 主数据-分发设置删除 + * @Date 11:43 上午 2024/6/11 + **/ + @Override + public JsonResultEntity deleteMdmDistribute(JSONObject object) { + MdmModuleDistributeEntity entity = getData("jsonStr", object, MdmModuleDistributeEntity.class); + if (entity == null) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + if (entity.getId() == null || "".equals(entity.getId())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + entity.setUpdate(); + mdmModuleDistributeDao.update(entity); + MdmModuleDistributeDetailEntity mdmModuleDistributeDetailEntity = new MdmModuleDistributeDetailEntity(); + mdmModuleDistributeDetailEntity.setDistributeId(entity.getId()); + mdmModuleDistributeDetailEntity.setUpdate(); + mdmModuleDistributeDetailDao.logicRemoveMultiCondition(mdmModuleDistributeDetailEntity); + + return BaseResult.getSuccessMessageEntity("删除数据来源成功"); + } + + /** + * @param object + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 主数据-写入日志-列表获取 + * @Date 11:43 上午 2024/6/11 + **/ + @Override + public JsonResultEntity queryMdmOptionLogPage(JSONObject object) { + MdmModuleOptionLogEntity entity = getData("jsonStr", object, MdmModuleOptionLogEntity.class); + //判断分页 + if (entity == null || entity.getPageNum() == null || entity.getPageSize() == null) { + return BaseResult.getFailureMessageEntity("分页查询参数不存在"); + } + if (entity.getMdmCode() == null || "".equals(entity.getMdmCode())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + MdmModuleEntity mdmModuleEntity = mdmServiceCache.getMdmModuleEntity(entity.getMdmCode()); + if(mdmModuleEntity == null || mdmModuleEntity.getId() == null){ + return BaseResult.getFailureMessageEntity("系统错误"); + } + MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); + mdmModuleDbEntity.setMdmId(mdmModuleEntity.getId()); + mdmModuleDbEntity.setSts("Y"); + List mdmModuleDbEntities = mdmServiceCache.queryMdmModuleDb(mdmModuleDbEntity); + if(mdmModuleDbEntities != null && mdmModuleDbEntities.size() > 0 ){ + for (int i = 0; i < mdmModuleDbEntities.size(); i++) { + if("1".equals(mdmModuleDbEntities.get(i).getDbType())){ + entity.setTableName(mdmModuleDbEntities.get(i).getDbName()+"_option_log"); + break; + } + } + }else { + return BaseResult.getFailureMessageEntity("请先设置数据源"); + } + PageHelper.startPage(entity.getPageNum(), entity.getPageSize()); + List list = mdmModuleOptionLogDao.queryByLike(entity); + PageInfo pageInfo = new PageInfo(list); + return BaseResult.getSuccessMessageEntity("查询数据成功", pageInfo); + } + + /** + * @param object + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 主数据-下发日志-列表获取 + * @Date 11:43 上午 2024/6/11 + **/ + @Override + public JsonResultEntity queryMdmDistributeLogPage(JSONObject object) { + MdmModuleSendLogEntity entity = getData("jsonStr", object, MdmModuleSendLogEntity.class); + //判断分页 + if (entity == null || entity.getPageNum() == null || entity.getPageSize() == null) { + return BaseResult.getFailureMessageEntity("分页查询参数不存在"); + } + if (entity.getMdmCode() == null || "".equals(entity.getMdmCode())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + MdmModuleEntity mdmModuleEntity = mdmServiceCache.getMdmModuleEntity(entity.getMdmCode()); + if (mdmModuleEntity == null || mdmModuleEntity.getId() == null) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); + mdmModuleDbEntity.setMdmId(mdmModuleEntity.getId()); + mdmModuleDbEntity.setSts("Y"); + List mdmModuleDbEntities = mdmServiceCache.queryMdmModuleDb(mdmModuleDbEntity); + if (mdmModuleDbEntities != null && mdmModuleDbEntities.size() > 0) { + for (int i = 0; i < mdmModuleDbEntities.size(); i++) { + if ("1".equals(mdmModuleDbEntities.get(i).getDbType())) { + entity.setTableName(mdmModuleDbEntities.get(i).getDbName() + "_send_log"); + break; + } + } + } else { + return BaseResult.getFailureMessageEntity("请先设置数据源"); + } + PageHelper.startPage(entity.getPageNum(), entity.getPageSize()); + List list = mdmModuleSendLogDao.queryByLike(entity); + PageInfo pageInfo = new PageInfo(list); + return BaseResult.getSuccessMessageEntity("查询数据成功", pageInfo); + } } diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDb/dao/IMdmModuleDbDao.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDb/dao/IMdmModuleDbDao.java index 89849461..75785b1a 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDb/dao/IMdmModuleDbDao.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDb/dao/IMdmModuleDbDao.java @@ -17,5 +17,7 @@ public interface IMdmModuleDbDao extends IBaseDao { HashMap getServiceDataById(Map queryData); List> getServiceByFormmainId(Map queryData); List> getServiceByDistributeId(Map queryData); + + int deleteMdmModuleDb(MdmModuleDbEntity mdmModuleDbEntity); } diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDb/dao/impl/MdmModuleDbDaoImpl.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDb/dao/impl/MdmModuleDbDaoImpl.java index 8bf06ee1..85351316 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDb/dao/impl/MdmModuleDbDaoImpl.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDb/dao/impl/MdmModuleDbDaoImpl.java @@ -37,5 +37,11 @@ public class MdmModuleDbDaoImpl extends MybatisGenericDao - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - + id ,mdm_id ,db_name @@ -33,209 +33,222 @@ ,org_id ,company_id - - + select + + from mdm_module_db + + and id = #{id} + and mdm_id = #{mdmId} + and db_name = #{dbName} + and db_type = #{dbType} + and remark = #{remark} + and sorts = #{sorts} + and create_user_id = #{create_user_id} + and create_time = #{create_time} + and modify_user_id = #{modify_user_id} + and modify_time = #{modify_time} + and sts = #{sts} + and org_id = #{org_id} + and company_id = #{companyId} and sts='Y' - - order by sorts asc - order by ${sort} ${order} - - - - + + + - + select + + from mdm_module_db + + and id like concat('%',#{id},'%') + and mdm_id like concat('%',#{mdmId},'%') + and db_name like concat('%',#{dbName},'%') + and db_type like concat('%',#{dbType},'%') + and remark like concat('%',#{remark},'%') + and sorts like concat('%',#{sorts},'%') + and create_user_id like + concat('%',#{create_user_id},'%') + + and create_time like concat('%',#{create_time},'%') + and modify_user_id like + concat('%',#{modify_user_id},'%') + + and modify_time like concat('%',#{modify_time},'%') + and sts like concat('%',#{sts},'%') + and org_id like concat('%',#{org_id},'%') + and company_id like concat('%',#{companyId},'%') and sts='Y' - - order by sorts asc - order by ${sort} ${order} - + + order by sorts asc + order by ${sort} ${order} + - - + select + + from mdm_module_db + + or id = #{id} + or mdm_id = #{mdmId} + or db_name = #{dbName} + or db_type = #{dbType} + or remark = #{remark} + or sorts = #{sorts} + or create_user_id = #{create_user_id} + or create_time = #{create_time} + or modify_user_id = #{modify_user_id} + or modify_time = #{modify_time} + or sts = #{sts} + or org_id = #{org_id} + or company_id = #{companyId} and sts='Y' - - order by sorts asc - order by ${sort} ${order} - + + order by sorts asc + order by ${sort} ${order} + - - - insert into mdm_module_db( - - id , - mdm_id , - db_name , - db_type , - remark , - sorts , - create_user_id , - create_time , - modify_user_id , - modify_time , - sts , - org_id , - company_id , - sts, - - )values( - - #{id} , - #{mdmId} , - #{dbName} , - #{dbType} , - #{remark} , - #{sorts} , - #{create_user_id} , - #{create_time} , - #{modify_user_id} , - #{modify_time} , - #{sts} , - #{org_id} , - #{companyId} , - 'Y', - - ) - - - - insert into mdm_module_db(mdm_id, db_name, db_type, remark, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, sts) - values - - (#{entity.mdmId},#{entity.dbName},#{entity.dbType},#{entity.remark},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId}, 'Y') - - - - - insert into mdm_module_db(mdm_id, db_name, db_type, remark, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id) - values - - (#{entity.mdmId},#{entity.dbName},#{entity.dbType},#{entity.remark},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId}) - - on duplicate key update - mdm_id = values(mdm_id), - db_name = values(db_name), - db_type = values(db_type), - remark = values(remark), - create_user_id = values(create_user_id), - create_time = values(create_time), - modify_user_id = values(modify_user_id), - modify_time = values(modify_time), - sts = values(sts), - org_id = values(org_id), - company_id = values(company_id) - - -update mdm_module_db set - - mdm_id = #{mdmId}, - db_name = #{dbName}, - db_type = #{dbType}, - remark = #{remark}, - create_user_id = #{create_user_id}, - create_time = #{create_time}, - modify_user_id = #{modify_user_id}, - modify_time = #{modify_time}, - sts = #{sts}, - org_id = #{org_id}, - company_id = #{companyId}, - -where id = #{id} - - - + + + insert into mdm_module_db( + + id , + mdm_id , + db_name , + db_type , + remark , + sorts , + create_user_id , + create_time , + modify_user_id , + modify_time , + sts , + org_id , + company_id , + sts, + + )values( + + #{id} , + #{mdmId} , + #{dbName} , + #{dbType} , + #{remark} , + #{sorts} , + #{create_user_id} , + #{create_time} , + #{modify_user_id} , + #{modify_time} , + #{sts} , + #{org_id} , + #{companyId} , + 'Y', + + ) + + + + insert into mdm_module_db(mdm_id, db_name, db_type, remark, create_user_id, create_time, modify_user_id, + modify_time, sts, org_id, company_id, sts) + values + + (#{entity.mdmId},#{entity.dbName},#{entity.dbType},#{entity.remark},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId}, + 'Y') + + + + + insert into mdm_module_db(mdm_id, db_name, db_type, remark, create_user_id, create_time, modify_user_id, + modify_time, sts, org_id, company_id) + values + + (#{entity.mdmId},#{entity.dbName},#{entity.dbType},#{entity.remark},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId}) + + on duplicate key update + mdm_id = values(mdm_id), + db_name = values(db_name), + db_type = values(db_type), + remark = values(remark), + create_user_id = values(create_user_id), + create_time = values(create_time), + modify_user_id = values(modify_user_id), + modify_time = values(modify_time), + sts = values(sts), + org_id = values(org_id), + company_id = values(company_id) + + + + update mdm_module_db set + + mdm_id = #{mdmId}, + db_name = #{dbName}, + db_type = #{dbType}, + remark = #{remark}, + create_user_id = #{create_user_id}, + create_time = #{create_time}, + modify_user_id = #{modify_user_id}, + modify_time = #{modify_time}, + sts = #{sts}, + org_id = #{org_id}, + company_id = #{companyId}, + + where id = #{id} + + + update mdm_module_db set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} where id = #{id} - - -update mdm_module_db set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} - - and id = #{id} - and mdm_id = #{mdmId} - and db_name = #{dbName} - and db_type = #{dbType} - and remark = #{remark} - and sorts = #{sorts} - and sts = #{sts} - and company_id = #{companyId} + + + update mdm_module_db set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} + + and id = #{id} + and mdm_id = #{mdmId} + and db_name = #{dbName} + and db_type = #{dbType} + and remark = #{remark} + and sorts = #{sorts} + and sts = #{sts} + and company_id = #{companyId} and sts='Y' - - - - + + + + delete from mdm_module_db where id = #{id} + + + delete from mdm_module_db where mdm_id = #{mdmId} + diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDbFileds/dao/IMdmModuleDbFiledsDao.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDbFileds/dao/IMdmModuleDbFiledsDao.java index 9bbd8915..9cf1ab43 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDbFileds/dao/IMdmModuleDbFiledsDao.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDbFileds/dao/IMdmModuleDbFiledsDao.java @@ -11,5 +11,6 @@ import com.hzya.frame.basedao.dao.IBaseDao; */ public interface IMdmModuleDbFiledsDao extends IBaseDao { + int deleteMdmModuleDbFileds(MdmModuleDbFiledsEntity entity); } diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDbFileds/dao/impl/MdmModuleDbFiledsDaoImpl.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDbFileds/dao/impl/MdmModuleDbFiledsDaoImpl.java index 1e32d5a9..054270b4 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDbFileds/dao/impl/MdmModuleDbFiledsDaoImpl.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDbFileds/dao/impl/MdmModuleDbFiledsDaoImpl.java @@ -12,6 +12,11 @@ import com.hzya.frame.basedao.dao.MybatisGenericDao; */ @Repository(value = "MdmModuleDbFiledsDaoImpl") public class MdmModuleDbFiledsDaoImpl extends MybatisGenericDao implements IMdmModuleDbFiledsDao{ - + + @Override + public int deleteMdmModuleDbFileds(MdmModuleDbFiledsEntity entity) { + Integer o = (Integer) super.delete(getSqlIdPrifx() + "deleteMdmModuleDbFileds", entity); + return o; + } } diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDbFileds/entity/MdmModuleDbFiledsEntity.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDbFileds/entity/MdmModuleDbFiledsEntity.java index abb89344..c58963aa 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDbFileds/entity/MdmModuleDbFiledsEntity.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDbFileds/entity/MdmModuleDbFiledsEntity.java @@ -5,6 +5,8 @@ import java.util.List; import com.hzya.frame.mdm.mdmModuleDbFiledsRule.entity.MdmModuleDbFiledsRuleEntity; import com.hzya.frame.web.entity.BaseEntity; +import org.apache.poi.ss.formula.functions.T; + /** * 模版数据库字段表(MdmModuleDbFileds)实体类 * @@ -13,6 +15,8 @@ import com.hzya.frame.web.entity.BaseEntity; */ public class MdmModuleDbFiledsEntity extends BaseEntity { + /** 主数据模版ID */ + private String dbName; /** 主数据模版ID */ private String mdmId; /** 模版数据库id */ @@ -51,6 +55,8 @@ public class MdmModuleDbFiledsEntity extends BaseEntity { private String roleValue; private List mdmModuleDbFiledsRules; + //1、查询2、列表3、新增4、修改 5、查看 + private String fieldType; public String getMdmId() { return mdmId; } @@ -186,5 +192,21 @@ public class MdmModuleDbFiledsEntity extends BaseEntity { public void setRoleValue(String roleValue) { this.roleValue = roleValue; } + + public String getDbName() { + return dbName; + } + + public void setDbName(String dbName) { + this.dbName = dbName; + } + + public String getFieldType() { + return fieldType; + } + + public void setFieldType(String fieldType) { + this.fieldType = fieldType; + } } diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDbFileds/entity/MdmModuleDbFiledsEntity.xml b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDbFileds/entity/MdmModuleDbFiledsEntity.xml index 8e4d37a4..cdac2db1 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDbFileds/entity/MdmModuleDbFiledsEntity.xml +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDbFileds/entity/MdmModuleDbFiledsEntity.xml @@ -326,6 +326,9 @@ update mdm_module_db_fileds set sts= 'N' ,modify_time = #{modify_time},modify_u delete from mdm_module_db_fileds where id = #{id} - + + + delete from mdm_module_db_fileds where mdm_id = #{mdmId} + diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDbFiledsRule/dao/IMdmModuleDbFiledsRuleDao.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDbFiledsRule/dao/IMdmModuleDbFiledsRuleDao.java index 7e29594b..ab7def4b 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDbFiledsRule/dao/IMdmModuleDbFiledsRuleDao.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDbFiledsRule/dao/IMdmModuleDbFiledsRuleDao.java @@ -11,5 +11,6 @@ import com.hzya.frame.basedao.dao.IBaseDao; */ public interface IMdmModuleDbFiledsRuleDao extends IBaseDao { + Integer queryUserMdm(MdmModuleDbFiledsRuleEntity queryCount); } diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDbFiledsRule/dao/impl/MdmModuleDbFiledsRuleDaoImpl.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDbFiledsRule/dao/impl/MdmModuleDbFiledsRuleDaoImpl.java index d3c4f630..2f11bed8 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDbFiledsRule/dao/impl/MdmModuleDbFiledsRuleDaoImpl.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDbFiledsRule/dao/impl/MdmModuleDbFiledsRuleDaoImpl.java @@ -12,6 +12,11 @@ import com.hzya.frame.basedao.dao.MybatisGenericDao; */ @Repository(value = "MdmModuleDbFiledsRuleDaoImpl") public class MdmModuleDbFiledsRuleDaoImpl extends MybatisGenericDao implements IMdmModuleDbFiledsRuleDao{ - + + @Override + public Integer queryUserMdm(MdmModuleDbFiledsRuleEntity queryCount) { + Integer o = (Integer) super.selectOne(getSqlIdPrifx() + "queryUserMdm", queryCount); + return o; + } } diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDbFiledsRule/entity/MdmModuleDbFiledsRuleEntity.xml b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDbFiledsRule/entity/MdmModuleDbFiledsRuleEntity.xml index 2d1e1e9f..7ef687dc 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDbFiledsRule/entity/MdmModuleDbFiledsRuleEntity.xml +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDbFiledsRule/entity/MdmModuleDbFiledsRuleEntity.xml @@ -283,5 +283,15 @@ update mdm_module_db_fileds_rule set sts= 'N' ,modify_time = #{modify_time},mod delete from mdm_module_db_fileds_rule where id = #{id} + + diff --git a/service/src/main/java/com/hzya/frame/mdm/service/IMdmService.java b/service/src/main/java/com/hzya/frame/mdm/service/IMdmService.java index d588e694..920a3cd5 100644 --- a/service/src/main/java/com/hzya/frame/mdm/service/IMdmService.java +++ b/service/src/main/java/com/hzya/frame/mdm/service/IMdmService.java @@ -8,272 +8,264 @@ import com.hzya.frame.web.entity.JsonResultEntity; */ public interface IMdmService { - /** - * @param jsonObject - * @return com.hzya.frame.web.entity.JsonResultEntity - * @Author lvleigang - * @Description 主数据列表查询接口分页 - * @Date 9:40 上午 2023/10/18 - **/ - JsonResultEntity queryMdmPage(JSONObject jsonObject); - - /** - * @param jsonObject - * @return com.hzya.frame.web.entity.JsonResultEntity - * @Author lvleigang - * @Description 主数据列表查询接口列表 - * @Date 9:40 上午 2023/10/18 - **/ - JsonResultEntity queryMdmList(JSONObject jsonObject); - - - /** - * @param jsonObject - * @return com.hzya.frame.web.entity.JsonResultEntity - * @Author lvleigang - * @Description 主数据新增 - * @Date 9:40 上午 2023/10/18 - **/ - JsonResultEntity addMdm(JSONObject jsonObject); - - - - /** - * @param jsonObject - * @return com.hzya.frame.web.entity.JsonResultEntity - * @Author lvleigang - * @Description 主数据基本信息获取 - * @Date 9:40 上午 2023/10/18 - **/ - JsonResultEntity queryMdmModule(JSONObject jsonObject); - /** - * @param jsonObject - * @return com.hzya.frame.web.entity.JsonResultEntity - * @Author lvleigang - * @Description 主数据基本信息修改 - * @Date 9:40 上午 2023/10/18 - **/ - JsonResultEntity doSaveMdmModule(JSONObject jsonObject); - /** - * @param jsonObject - * @return com.hzya.frame.web.entity.JsonResultEntity - * @Author lvleigang - * @Description 主数据设置查询数据源 - * @Date 9:40 上午 2023/10/18 - **/ - JsonResultEntity queryMdmModuleDb(JSONObject jsonObject); - // - /** - * @param jsonObject - * @return com.hzya.frame.web.entity.JsonResultEntity - * @Author lvleigang - * @Description 主数据设置查询数据源的服务 - * @Date 9:40 上午 2023/10/18 - **/ - JsonResultEntity queryMdmModuleServer(JSONObject jsonObject); - /** - * @param jsonObject - * @return com.hzya.frame.web.entity.JsonResultEntity - * @Author lvleigang - * @Description 主数据设置查询数据源字段的服务 - * @Date 9:40 上午 2023/10/18 - **/ - JsonResultEntity queryMdmModuleServerFiled(JSONObject jsonObject); - - /** - * @param jsonObject - * @return com.hzya.frame.web.entity.JsonResultEntity - * @Author lvleigang - * @Description 主数据设置查询主表字段 - * @Date 9:40 上午 2023/10/18 - **/ - JsonResultEntity queryMdmModuleServerMainFiled(JSONObject jsonObject); - /** - * @param jsonObject - * @return com.hzya.frame.web.entity.JsonResultEntity - * @Author lvleigang - * @Description 主数据设置保存数据源 - * @Date 9:40 上午 2023/10/18 - **/ - JsonResultEntity saveMdmModuleDb(JSONObject jsonObject); - - - /** - * @param jsonObject - * @return com.hzya.frame.web.entity.JsonResultEntity - * @Author lvleigang - * @Description 主数据设置查询显示信息 - * @Date 9:40 上午 2023/10/18 - **/ - JsonResultEntity queryMdmModuleView(JSONObject jsonObject); - - /** - * @param jsonObject - * @return com.hzya.frame.web.entity.JsonResultEntity - * @Author lvleigang - * @Description 主数据设置修改显示信息 - * @Date 9:40 上午 2023/10/18 - **/ - JsonResultEntity doSaveMdmModuleView(JSONObject jsonObject); + ///** + // * @param jsonObject + // * @return com.hzya.frame.web.entity.JsonResultEntity + // * @Author lvleigang + // * @Description 主数据列表查询接口分页 + // * @Date 9:40 上午 2023/10/18 + // **/ + //JsonResultEntity queryMdmPage(JSONObject jsonObject); // ///** // * @param jsonObject // * @return com.hzya.frame.web.entity.JsonResultEntity // * @Author lvleigang - // * @Description 主数据设置查询权限配置 + // * @Description 主数据列表查询接口列表 // * @Date 9:40 上午 2023/10/18 // **/ - //JsonResultEntity queryMdmModuleRule(JSONObject jsonObject); + //JsonResultEntity queryMdmList(JSONObject jsonObject); + // // ///** // * @param jsonObject // * @return com.hzya.frame.web.entity.JsonResultEntity // * @Author lvleigang - // * @Description 主数据设置保存权限配置 + // * @Description 主数据新增 // * @Date 9:40 上午 2023/10/18 // **/ - //JsonResultEntity doSaveMdmModuleRule(JSONObject jsonObject); + //JsonResultEntity addMdm(JSONObject jsonObject); // // - /** - * @param jsonObject - * @return com.hzya.frame.web.entity.JsonResultEntity - * @Author lvleigang - * @Description 主数据设置查询分发设置 - * @Date 9:40 上午 2023/10/18 - **/ - JsonResultEntity queryMdmModuleDistribute(JSONObject jsonObject); - /** - * @param jsonObject - * @return com.hzya.frame.web.entity.JsonResultEntity - * @Author lvleigang - * @Description 主数据设置保存分发设置 - * @Date 9:40 上午 2023/10/18 - **/ - JsonResultEntity doSaveMdmModuleDistribute(JSONObject jsonObject); - - /** - * @param jsonObject - * @return com.hzya.frame.web.entity.JsonResultEntity - * @Author lvleigang - * @Description 主数据设置查询数据来源 - * @Date 9:40 上午 2023/10/18 - **/ - JsonResultEntity queryMdmModuleSource(JSONObject jsonObject); - /** - * @param jsonObject - * @return com.hzya.frame.web.entity.JsonResultEntity - * @Author lvleigang - * @Description 主数据设置保存数据来源 - * @Date 9:40 上午 2023/10/18 - **/ - JsonResultEntity doSaveMdmModuleSource(JSONObject jsonObject); - - - /** - * @param jsonObject - * @return com.hzya.frame.web.entity.JsonResultEntity - * @Author lvleigang - * @Description 查询下发日志 - * @Date 11:52 上午 2024/3/27 - **/ - JsonResultEntity querySendEntityPage(JSONObject jsonObject); - - /** - * @param jsonObject - * @return com.hzya.frame.web.entity.JsonResultEntity - * @Author lvleigang - * @Description 获取下发日志 - * @Date 2:36 下午 2024/3/27 - **/ - JsonResultEntity getSendEntity(JSONObject jsonObject); - - /** - * @param jsonObject - * @return com.hzya.frame.web.entity.JsonResultEntity - * @Author lvleigang - * @Description 删除下发日志 - * @Date 2:37 下午 2024/3/27 - **/ - JsonResultEntity deleteSendEntity(JSONObject jsonObject); - - /** - * @param jsonObject - * @return com.hzya.frame.web.entity.JsonResultEntity - * @Author lvleigang - * @Description 查询操作日志 - * @Date 11:52 上午 2024/3/27 - **/ - JsonResultEntity queryOptionEntityPage(JSONObject jsonObject); - - /** - * @param jsonObject - * @return com.hzya.frame.web.entity.JsonResultEntity - * @Author lvleigang - * @Description 获取操作日志 - * @Date 2:36 下午 2024/3/27 - **/ - JsonResultEntity getOptionEntity(JSONObject jsonObject); - - /** - * @param jsonObject - * @return com.hzya.frame.web.entity.JsonResultEntity - * @Author lvleigang - * @Description 删除操作日志 - * @Date 2:37 下午 2024/3/27 - **/ - JsonResultEntity deleteOptionEntity(JSONObject jsonObject); - // - /** - * @param jsonObject - * @return com.hzya.frame.web.entity.JsonResultEntity - * @Author lvleigang - * @Description 主数据列表显示 树、查询条件、列表字段、按钮 - * @Date 9:40 上午 2023/10/18 - **/ - JsonResultEntity queryMdmShow(JSONObject jsonObject); - // - /** - * @param jsonObject - * @return com.hzya.frame.web.entity.JsonResultEntity - * @Author lvleigang - * @Description 主数据查询所有字段 - * @Date 9:40 上午 2023/10/18 - **/ - JsonResultEntity queryMdmShowAll(JSONObject jsonObject); - /** - * @Author lvleigang - * @Description 查询模版数据(list 或者 分页) - * @Date 1:33 下午 2023/7/12 - * @param jsonObject - * @return com.hzya.frame.web.entity.JsonResultEntity - **/ - JsonResultEntity queryTemplateData(JSONObject jsonObject); - /** - * @param jsonObject - * @return com.hzya.frame.web.entity.JsonResultEntity - * @Author lvleigang - * @Description 主数据列表显示 业务数据 - * @Date 9:40 上午 2023/10/18 - **/ - JsonResultEntity queryMdmShowData(JSONObject jsonObject); // ///** // * @param jsonObject // * @return com.hzya.frame.web.entity.JsonResultEntity // * @Author lvleigang - // * @Description 主数据业务数据 + // * @Description 主数据基本信息获取 // * @Date 9:40 上午 2023/10/18 // **/ - //JsonResultEntity queryMdmShowDistribute(JSONObject jsonObject); - /** - * @param jsonObject - * @return com.hzya.frame.web.entity.JsonResultEntity - * @Author lvleigang - * @Description 主数据业务数据树结构 - * @Date 9:40 上午 2023/10/18 - **/ - JsonResultEntity queryMdmShowTreeData(JSONObject jsonObject); + //JsonResultEntity queryMdmModule(JSONObject jsonObject); + ///** + // * @param jsonObject + // * @return com.hzya.frame.web.entity.JsonResultEntity + // * @Author lvleigang + // * @Description 主数据基本信息修改 + // * @Date 9:40 上午 2023/10/18 + // **/ + //JsonResultEntity doSaveMdmModule(JSONObject jsonObject); + ///** + // * @param jsonObject + // * @return com.hzya.frame.web.entity.JsonResultEntity + // * @Author lvleigang + // * @Description 主数据设置查询数据源 + // * @Date 9:40 上午 2023/10/18 + // **/ + //JsonResultEntity queryMdmModuleDb(JSONObject jsonObject); + //// + ///** + // * @param jsonObject + // * @return com.hzya.frame.web.entity.JsonResultEntity + // * @Author lvleigang + // * @Description 主数据设置查询数据源的服务 + // * @Date 9:40 上午 2023/10/18 + // **/ + //JsonResultEntity queryMdmModuleServer(JSONObject jsonObject); + ///** + // * @param jsonObject + // * @return com.hzya.frame.web.entity.JsonResultEntity + // * @Author lvleigang + // * @Description 主数据设置查询数据源字段的服务 + // * @Date 9:40 上午 2023/10/18 + // **/ + //JsonResultEntity queryMdmModuleServerFiled(JSONObject jsonObject); + // + ///** + // * @param jsonObject + // * @return com.hzya.frame.web.entity.JsonResultEntity + // * @Author lvleigang + // * @Description 主数据设置查询主表字段 + // * @Date 9:40 上午 2023/10/18 + // **/ + //JsonResultEntity queryMdmModuleServerMainFiled(JSONObject jsonObject); + ///** + // * @param jsonObject + // * @return com.hzya.frame.web.entity.JsonResultEntity + // * @Author lvleigang + // * @Description 主数据设置保存数据源 + // * @Date 9:40 上午 2023/10/18 + // **/ + //JsonResultEntity saveMdmModuleDb(JSONObject jsonObject); + // + // + ///** + // * @param jsonObject + // * @return com.hzya.frame.web.entity.JsonResultEntity + // * @Author lvleigang + // * @Description 主数据设置查询显示信息 + // * @Date 9:40 上午 2023/10/18 + // **/ + //JsonResultEntity queryMdmModuleView(JSONObject jsonObject); + // + ///** + // * @param jsonObject + // * @return com.hzya.frame.web.entity.JsonResultEntity + // * @Author lvleigang + // * @Description 主数据设置修改显示信息 + // * @Date 9:40 上午 2023/10/18 + // **/ + //JsonResultEntity doSaveMdmModuleView(JSONObject jsonObject); + //// + /////** + //// * @param jsonObject + //// * @return com.hzya.frame.web.entity.JsonResultEntity + //// * @Author lvleigang + //// * @Description 主数据设置查询权限配置 + //// * @Date 9:40 上午 2023/10/18 + //// **/ + ////JsonResultEntity queryMdmModuleRule(JSONObject jsonObject); + //// + /////** + //// * @param jsonObject + //// * @return com.hzya.frame.web.entity.JsonResultEntity + //// * @Author lvleigang + //// * @Description 主数据设置保存权限配置 + //// * @Date 9:40 上午 2023/10/18 + //// **/ + ////JsonResultEntity doSaveMdmModuleRule(JSONObject jsonObject); + //// + //// + ///** + // * @param jsonObject + // * @return com.hzya.frame.web.entity.JsonResultEntity + // * @Author lvleigang + // * @Description 主数据设置查询分发设置 + // * @Date 9:40 上午 2023/10/18 + // **/ + //JsonResultEntity queryMdmModuleDistribute(JSONObject jsonObject); + ///** + // * @param jsonObject + // * @return com.hzya.frame.web.entity.JsonResultEntity + // * @Author lvleigang + // * @Description 主数据设置保存分发设置 + // * @Date 9:40 上午 2023/10/18 + // **/ + //JsonResultEntity doSaveMdmModuleDistribute(JSONObject jsonObject); + // + ///** + // * @param jsonObject + // * @return com.hzya.frame.web.entity.JsonResultEntity + // * @Author lvleigang + // * @Description 主数据设置查询数据来源 + // * @Date 9:40 上午 2023/10/18 + // **/ + //JsonResultEntity queryMdmModuleSource(JSONObject jsonObject); + ///** + // * @param jsonObject + // * @return com.hzya.frame.web.entity.JsonResultEntity + // * @Author lvleigang + // * @Description 主数据设置保存数据来源 + // * @Date 9:40 上午 2023/10/18 + // **/ + //JsonResultEntity doSaveMdmModuleSource(JSONObject jsonObject); + // + // + ///** + // * @param jsonObject + // * @return com.hzya.frame.web.entity.JsonResultEntity + // * @Author lvleigang + // * @Description 查询下发日志 + // * @Date 11:52 上午 2024/3/27 + // **/ + //JsonResultEntity querySendEntityPage(JSONObject jsonObject); + // + ///** + // * @param jsonObject + // * @return com.hzya.frame.web.entity.JsonResultEntity + // * @Author lvleigang + // * @Description 获取下发日志 + // * @Date 2:36 下午 2024/3/27 + // **/ + //JsonResultEntity getSendEntity(JSONObject jsonObject); + // + ///** + // * @param jsonObject + // * @return com.hzya.frame.web.entity.JsonResultEntity + // * @Author lvleigang + // * @Description 删除下发日志 + // * @Date 2:37 下午 2024/3/27 + // **/ + //JsonResultEntity deleteSendEntity(JSONObject jsonObject); + // + ///** + // * @param jsonObject + // * @return com.hzya.frame.web.entity.JsonResultEntity + // * @Author lvleigang + // * @Description 查询操作日志 + // * @Date 11:52 上午 2024/3/27 + // **/ + //JsonResultEntity queryOptionEntityPage(JSONObject jsonObject); + // + ///** + // * @param jsonObject + // * @return com.hzya.frame.web.entity.JsonResultEntity + // * @Author lvleigang + // * @Description 获取操作日志 + // * @Date 2:36 下午 2024/3/27 + // **/ + //JsonResultEntity getOptionEntity(JSONObject jsonObject); + // + ///** + // * @param jsonObject + // * @return com.hzya.frame.web.entity.JsonResultEntity + // * @Author lvleigang + // * @Description 删除操作日志 + // * @Date 2:37 下午 2024/3/27 + // **/ + //JsonResultEntity deleteOptionEntity(JSONObject jsonObject); + //// + ///** + // * @param jsonObject + // * @return com.hzya.frame.web.entity.JsonResultEntity + // * @Author lvleigang + // * @Description 主数据列表显示 树、查询条件、列表字段、按钮 + // * @Date 9:40 上午 2023/10/18 + // **/ + //JsonResultEntity queryMdmShow(JSONObject jsonObject); + //// + ///** + // * @param jsonObject + // * @return com.hzya.frame.web.entity.JsonResultEntity + // * @Author lvleigang + // * @Description 主数据查询所有字段 + // * @Date 9:40 上午 2023/10/18 + // **/ + //JsonResultEntity queryMdmShowAll(JSONObject jsonObject); + ///** + // * @Author lvleigang + // * @Description 查询模版数据(list 或者 分页) + // * @Date 1:33 下午 2023/7/12 + // * @param jsonObject + // * @return com.hzya.frame.web.entity.JsonResultEntity + // **/ + //JsonResultEntity queryTemplateData(JSONObject jsonObject); + ///** + // * @param jsonObject + // * @return com.hzya.frame.web.entity.JsonResultEntity + // * @Author lvleigang + // * @Description 主数据列表显示 业务数据 + // * @Date 9:40 上午 2023/10/18 + // **/ + //JsonResultEntity queryMdmShowData(JSONObject jsonObject); + //// + /////** + //// * @param jsonObject + //// * @return com.hzya.frame.web.entity.JsonResultEntity + //// * @Author lvleigang + //// * @Description 主数据业务数据 + //// * @Date 9:40 上午 2023/10/18 + //// **/ + ////JsonResultEntity queryMdmShowDistribute(JSONObject jsonObject); ///** // * @param jsonObject // * @return com.hzya.frame.web.entity.JsonResultEntity @@ -281,59 +273,67 @@ public interface IMdmService { // * @Description 主数据业务数据树结构 // * @Date 9:40 上午 2023/10/18 // **/ - //JsonResultEntity queryMdmOptionData(JSONObject jsonObject); - // - /** - * @param jsonObject - * @return com.hzya.frame.web.entity.JsonResultEntity - * @Author lvleigang - * @Description 主数据详情 区分类型 新增、修改、查看 - * @Date 9:40 上午 2023/10/18 - **/ - JsonResultEntity queryMdmShowDetails(JSONObject jsonObject); - // - /** - * @param jsonObject - * @return com.hzya.frame.web.entity.JsonResultEntity - * @Author lvleigang - * @Description 主数据详情数据 区分类型 新增、修改、查看 - * @Date 9:40 上午 2023/10/18 - **/ - JsonResultEntity queryMdmShowDetailsData(JSONObject jsonObject); - // - /** - * @param jsonObject - * @return com.hzya.frame.web.entity.JsonResultEntity - * @Author lvleigang - * @Description 主数据详情数据修改 - * @Date 9:40 上午 2023/10/18 - **/ - JsonResultEntity updateMdmShowDetailsData(JSONObject jsonObject); - /** - * @param jsonObject - * @return com.hzya.frame.web.entity.JsonResultEntity - * @Author lvleigang - * @Description 主数据详情数据新增 - * @Date 9:40 上午 2023/10/18 - **/ - JsonResultEntity saveMdmShowDetailsData(JSONObject jsonObject); - - /** - * @param jsonObject - * @return com.hzya.frame.web.entity.JsonResultEntity - * @Author lvleigang - * @Description 主数据删除业务数据 - * @Date 9:40 上午 2023/10/18 - **/ - JsonResultEntity deleteMdmShowDetailsData(JSONObject jsonObject); + //JsonResultEntity queryMdmShowTreeData(JSONObject jsonObject); + /////** + //// * @param jsonObject + //// * @return com.hzya.frame.web.entity.JsonResultEntity + //// * @Author lvleigang + //// * @Description 主数据业务数据树结构 + //// * @Date 9:40 上午 2023/10/18 + //// **/ + ////JsonResultEntity queryMdmOptionData(JSONObject jsonObject); + //// + ///** + // * @param jsonObject + // * @return com.hzya.frame.web.entity.JsonResultEntity + // * @Author lvleigang + // * @Description 主数据详情 区分类型 新增、修改、查看 + // * @Date 9:40 上午 2023/10/18 + // **/ + //JsonResultEntity queryMdmShowDetails(JSONObject jsonObject); + //// + ///** + // * @param jsonObject + // * @return com.hzya.frame.web.entity.JsonResultEntity + // * @Author lvleigang + // * @Description 主数据详情数据 区分类型 新增、修改、查看 + // * @Date 9:40 上午 2023/10/18 + // **/ + //JsonResultEntity queryMdmShowDetailsData(JSONObject jsonObject); + //// + ///** + // * @param jsonObject + // * @return com.hzya.frame.web.entity.JsonResultEntity + // * @Author lvleigang + // * @Description 主数据详情数据修改 + // * @Date 9:40 上午 2023/10/18 + // **/ + //JsonResultEntity updateMdmShowDetailsData(JSONObject jsonObject); + ///** + // * @param jsonObject + // * @return com.hzya.frame.web.entity.JsonResultEntity + // * @Author lvleigang + // * @Description 主数据详情数据新增 + // * @Date 9:40 上午 2023/10/18 + // **/ + //JsonResultEntity saveMdmShowDetailsData(JSONObject jsonObject); // ///** // * @param jsonObject // * @return com.hzya.frame.web.entity.JsonResultEntity // * @Author lvleigang - // * @Description 处理分发数据 + // * @Description 主数据删除业务数据 // * @Date 9:40 上午 2023/10/18 // **/ - //JsonResultEntity doMdmDistribute(JSONObject jsonObject); + //JsonResultEntity deleteMdmShowDetailsData(JSONObject jsonObject); + /////** + //// * @param jsonObject + //// * @return com.hzya.frame.web.entity.JsonResultEntity + //// * @Author lvleigang + //// * @Description 处理分发数据 + //// * @Date 9:40 上午 2023/10/18 + //// **/ + ////JsonResultEntity doMdmDistribute(JSONObject jsonObject); + // } diff --git a/service/src/main/java/com/hzya/frame/mdm/service/IMdmServiceCache.java b/service/src/main/java/com/hzya/frame/mdm/service/IMdmServiceCache.java index 4174d5fa..ef527337 100644 --- a/service/src/main/java/com/hzya/frame/mdm/service/IMdmServiceCache.java +++ b/service/src/main/java/com/hzya/frame/mdm/service/IMdmServiceCache.java @@ -13,6 +13,8 @@ import com.hzya.frame.mdm.mdmModuleViewButton.entity.MdmModuleViewButtonEntity; import com.hzya.frame.mdm.mdmModuleViewDetail.entity.MdmModuleViewDetailEntity; import com.hzya.frame.mdm.mdmTableCodeRule.entity.MdmTableCodeRuleEntity; import com.hzya.frame.web.entity.JsonResultEntity; +import org.springframework.cache.annotation.CacheEvict; +import org.springframework.cache.annotation.Cacheable; import java.util.List; @@ -21,7 +23,6 @@ import java.util.List; */ public interface IMdmServiceCache { - /** * @Author lvleigang * @Description 获取模版主表 @@ -30,14 +31,24 @@ public interface IMdmServiceCache { * @return com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity **/ MdmModuleEntity getMdmModuleEntity(Long mdmCode); + /** * @Author lvleigang - * @Description 获取模版单据编码规则 + * @Description 修改模版主表 * @Date 10:13 上午 2024/6/3 - * @param mdmTableCodeRuleEntity + * @param entity * @return com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity **/ - List queryMdmTableCodeRuleEntity(MdmTableCodeRuleEntity mdmTableCodeRuleEntity); + void updateMdmModuleEntity(MdmModuleEntity entity); + + /** + * @Author lvleigang + * @Description 删除模版主表 + * @Date 10:13 上午 2024/6/3 + * @param entity + * @return com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity + **/ + void deleteMdmModuleEntity(MdmModuleEntity entity); /** * @Author lvleigang * @Description 获取模版表数据 @@ -46,6 +57,26 @@ public interface IMdmServiceCache { * @return com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity **/ List queryMdmModuleDb(MdmModuleDbEntity queryDb); + + /** + * @Author lvleigang + * @Description 修改模版表数据 + * @Date 4:23 下午 2024/6/11 + * @param mdmId + * @param mdmModuleDbEntities + * @return void + **/ + void saveOrUpdateMdmModuleDb(String mdmId, List mdmModuleDbEntities); + + + /** + * @Author lvleigang + * @Description 删除模版表数据 + * @Date 4:23 下午 2024/6/11 + * @param mdmId + * @return void + **/ + void deleteMdmModuleDb(String mdmId,String dbID); /** * @Author lvleigang * @Description 获取模版字段表数据 @@ -55,38 +86,21 @@ public interface IMdmServiceCache { **/ List queryMdmModuleDbFileds(MdmModuleDbFiledsEntity queryDbFiled); - void updateMdmModuleEntity(MdmModuleEntity entity); - - - List queryMdmModuleDbFiledsRule(MdmModuleDbFiledsRuleEntity queryDbFiledRule); - - void saveMdmTableCodeRule(String mdmid, List mdmTableCodeRuleEntities); - - void saveMdmModuleDb(String id, List mdmModuleDbEntities); - - void saveMdmModuleDbFileds(String id, List mdmModuleDbFiledsEntities); - - void saveMdmModuleDbFiledsRule(String id, List mdmModuleDbFiledsRuleEntities); - - List queryMdmModuleViewDetail(MdmModuleViewDetailEntity mdmModuleViewDetailEntity); - - List queryMdmModuleView(MdmModuleViewEntity mdmModuleViewEntity); - - List queryMdmModuleViewButton(MdmModuleViewButtonEntity mdmModuleViewButtonEntity); - - void saveMdmModuleView(String id, MdmModuleViewEntity mdmModuleViewEntity); - - void saveMdmModuleViewDetail(String id, List mdmModuleViewDetailEntities); - - void saveMdmModuleViewButton(String id, List mdmModuleViewButtonEntities); - - List queryMdmModuleDistribute(String id,MdmModuleDistributeEntity mdmModuleDistributeEntity); - - void saveMdmModuleDistribute(String id, List mdmModuleDistributeEntities); - - List queryMdmModuleSource(MdmModuleSourceEntity mdmModuleSourceEntity); - - void saveMdmModuleSource(String id, List mdmModuleSourceEntities); - - List queryMdmModuleDistributeDetail(MdmModuleDistributeDetailEntity mdmModuleDistributeDetailEntity); + /** + * @Author lvleigang + * @Description 修改数据源db的字段 + * @Date 4:25 下午 2024/6/11 + * @param mdmId + * @param mdmModuleDbFiledsEntities + * @return void + **/ + void saveOrUpdateMdmModuleDbFileds(String mdmId, List mdmModuleDbFiledsEntities); + /** + * @Author lvleigang + * @Description 删除数据源db的字段 + * @Date 4:25 下午 2024/6/11 + * @param mdmId + * @return void + **/ + void deleteMdmModuleDbFileds(String mdmId,String dbID); } diff --git a/service/src/main/java/com/hzya/frame/mdm/service/impl/MdmServiceCache.java b/service/src/main/java/com/hzya/frame/mdm/service/impl/MdmServiceCache.java index b847f145..759aaa10 100644 --- a/service/src/main/java/com/hzya/frame/mdm/service/impl/MdmServiceCache.java +++ b/service/src/main/java/com/hzya/frame/mdm/service/impl/MdmServiceCache.java @@ -73,27 +73,53 @@ public class MdmServiceCache implements IMdmServiceCache { @Resource private IMdmTableCodeRuleDao mdmTableCodeRuleDao; + /** + * @Author lvleigang + * @Description 缓存主数据 + * @Date 4:03 下午 2024/6/11 + * @param mdmCode + * @return com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity + **/ @Override @Cacheable(cacheNames="mdmModule",key = "#mdmCode") public MdmModuleEntity getMdmModuleEntity(Long mdmCode) { MdmModuleEntity entity = mdmModuleDao.getByMdmCode(mdmCode); return entity; } - + /** + * @Author lvleigang + * @Description 缓存删除主数据 + * @Date 4:03 下午 2024/6/11 + * @param entity + * @return com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity + **/ @Override @CacheEvict(cacheNames="mdmModule",key = "#entity.mdmCode") public void updateMdmModuleEntity(MdmModuleEntity entity) { mdmModuleDao.update(entity); } + /** + * @param entity + * @return com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity + * @Author lvleigang + * @Description 删除模版主表 + * @Date 10:13 上午 2024/6/3 + **/ @Override - @Cacheable(cacheNames="mdmTableCodeRule",key = "#entity.mdmId") - public List queryMdmTableCodeRuleEntity(MdmTableCodeRuleEntity entity) { - List mdmTableCodeRuleEntityList = mdmTableCodeRuleDao.queryBase(entity); - return mdmTableCodeRuleEntityList; + @CacheEvict(cacheNames="mdmModule",key = "#entity.mdmCode") + public void deleteMdmModuleEntity(MdmModuleEntity entity) { + entity.setUpdate(); + mdmModuleDao.logicRemoveMultiCondition(entity); } - + /** + * @Author lvleigang + * @Description 缓存主数据DB + * @Date 4:03 下午 2024/6/11 + * @param entity + * @return com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity + **/ @Override @Cacheable(cacheNames="mdmModuleDb",key = "#entity.mdmId") public List queryMdmModuleDb(MdmModuleDbEntity entity) { @@ -101,38 +127,17 @@ public class MdmServiceCache implements IMdmServiceCache { return mdmModuleDbEntities; } - @Override - @Cacheable(cacheNames="mdmModuleDbFileds",key = "#entity.mdmId") - public List queryMdmModuleDbFileds(MdmModuleDbFiledsEntity entity) { - List mdmModuleDbFiledsEntities = mdmModuleDbFiledsDao.queryBase(entity); - return mdmModuleDbFiledsEntities; - } - - @Override - @Cacheable(cacheNames="mdmModuleDbFiledsRule",key = "#entity.mdmId") - public List queryMdmModuleDbFiledsRule(MdmModuleDbFiledsRuleEntity entity) { - List mdmModuleDbFiledsRuleEntities = mdmModuleDbFiledsRuleDao.queryBase(entity); - return mdmModuleDbFiledsRuleEntities; - } - - @Override - @CacheEvict(cacheNames="mdmTableCodeRule",key = "#mdmId") - public void saveMdmTableCodeRule(String mdmId, List mdmTableCodeRuleEntities) { - MdmTableCodeRuleEntity mdmTableCodeRuleEntity = new MdmTableCodeRuleEntity(); - mdmTableCodeRuleEntity.setMdmId(mdmId); - mdmTableCodeRuleEntity.setSts("Y"); - mdmTableCodeRuleEntity.setUpdate(); - mdmTableCodeRuleDao.logicRemoveMultiCondition(mdmTableCodeRuleEntity); - if(mdmTableCodeRuleEntities != null && mdmTableCodeRuleEntities.size() > 0){ - for (int i = 0; i < mdmTableCodeRuleEntities.size(); i++) { - mdmTableCodeRuleDao.save(mdmTableCodeRuleEntities.get(i)); - } - } - } - + /** + * @Author lvleigang + * @Description 修改模版表数据 + * @Date 4:23 下午 2024/6/11 + * @param mdmId + * @param mdmModuleDbEntities + * @return void + **/ @Override @CacheEvict(cacheNames="mdmModuleDb",key = "#mdmId") - public void saveMdmModuleDb(String mdmId, List mdmModuleDbEntities) { + public void saveOrUpdateMdmModuleDb(String mdmId, List mdmModuleDbEntities) { if(mdmModuleDbEntities != null && mdmModuleDbEntities.size() > 0){ for (int i = 0; i < mdmModuleDbEntities.size(); i++) { if("1".equals(mdmModuleDbEntities.get(i).getDataType())){ @@ -143,204 +148,318 @@ public class MdmServiceCache implements IMdmServiceCache { } } } + + /** + * @param mdmId + * @return void + * @Author lvleigang + * @Description 删除模版表数据 + * @Date 4:23 下午 2024/6/11 + **/ + @Override + @CacheEvict(cacheNames="mdmModuleDb",key = "#mdmId") + public void deleteMdmModuleDb(String mdmId,String dbID) { + MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); + mdmModuleDbEntity.setMdmId(mdmId); + mdmModuleDbEntity.setId(dbID); + mdmModuleDbEntity.setUpdate(); + mdmModuleDbDao.logicRemoveMultiCondition(mdmModuleDbEntity); + } + + /** + * @Author lvleigang + * @Description 缓存主数据DB的所有字段 + * @Date 4:11 下午 2024/6/11 + * @param entity + * @return java.util.List + **/ + @Override + @Cacheable(cacheNames="mdmModuleDbFileds",key = "#entity.mdmId") + public List queryMdmModuleDbFileds(MdmModuleDbFiledsEntity entity) { + List mdmModuleDbFiledsEntities = mdmModuleDbFiledsDao.queryBase(entity); + return mdmModuleDbFiledsEntities; + } + + /** + * @Author lvleigang + * @Description 修改数据源db的字段 + * @Date 4:25 下午 2024/6/11 + * @param mdmId + * @param mdmModuleDbFiledsEntities + * @return void + **/ @Override @CacheEvict(cacheNames="mdmModuleDbFileds",key = "#mdmId") - public void saveMdmModuleDbFileds(String mdmId, List mdmModuleDbFiledsEntities) { + public void saveOrUpdateMdmModuleDbFileds(String mdmId, List mdmModuleDbFiledsEntities) { if(mdmModuleDbFiledsEntities != null && mdmModuleDbFiledsEntities.size() > 0){ for (int i = 0; i < mdmModuleDbFiledsEntities.size(); i++) { if("1".equals(mdmModuleDbFiledsEntities.get(i).getDataType())){ mdmModuleDbFiledsDao.save(mdmModuleDbFiledsEntities.get(i)); - }else { + }else if ("2".equals(mdmModuleDbFiledsEntities.get(i).getDataType())) { mdmModuleDbFiledsDao.update(mdmModuleDbFiledsEntities.get(i)); - } - } - } - } - @Override - @CacheEvict(cacheNames="mdmModuleDbFiledsRule",key = "#mdmId") - public void saveMdmModuleDbFiledsRule(String mdmId, List mdmModuleDbFiledsRuleEntities) { - MdmModuleDbFiledsRuleEntity mdmModuleDbFiledsRuleEntity = new MdmModuleDbFiledsRuleEntity(); - mdmModuleDbFiledsRuleEntity.setMdmId(mdmId); - mdmModuleDbFiledsRuleEntity.setSts("Y"); - mdmModuleDbFiledsRuleEntity.setUpdate(); - mdmModuleDbFiledsRuleDao.logicRemoveMultiCondition(mdmModuleDbFiledsRuleEntity); - if(mdmModuleDbFiledsRuleEntities != null && mdmModuleDbFiledsRuleEntities.size() > 0){ - for (int i = 0; i < mdmModuleDbFiledsRuleEntities.size(); i++) { - if("1".equals(mdmModuleDbFiledsRuleEntities.get(i).getDataType())){ - mdmModuleDbFiledsRuleDao.save(mdmModuleDbFiledsRuleEntities.get(i)); - }else { - mdmModuleDbFiledsRuleDao.update(mdmModuleDbFiledsRuleEntities.get(i)); + }else if ("3".equals(mdmModuleDbFiledsEntities.get(i).getDataType())) { + mdmModuleDbFiledsDao.logicRemoveMultiCondition(mdmModuleDbFiledsEntities.get(i)); } } } } + /** + * @param mdmId + * @return void + * @Author lvleigang + * @Description 删除数据源db的字段 + * @Date 4:25 下午 2024/6/11 + **/ @Override - @Cacheable(cacheNames="mdmModuleViewDetail",key = "#entity.mdmId") - public List queryMdmModuleViewDetail(MdmModuleViewDetailEntity entity) { - List mdmModuleViewDetailEntities = mdmModuleViewDetailDao.queryBase(entity); - return mdmModuleViewDetailEntities; + @CacheEvict(cacheNames="mdmModuleDbFileds",key = "#mdmId") + public void deleteMdmModuleDbFileds(String mdmId,String dbID) { + MdmModuleDbFiledsEntity entity = new MdmModuleDbFiledsEntity(); + entity.setMdmId(mdmId); + entity.setDbId(dbID); + entity.setUpdate(); + mdmModuleDbFiledsDao.logicRemoveMultiCondition(entity); } - @Override - @Cacheable(cacheNames="mdmModuleView",key = "#entity.mdmId") - public List queryMdmModuleView(MdmModuleViewEntity entity) { - List moduleViewEntities = mdmModuleViewDao.queryBase(entity); - return moduleViewEntities; - } + // + ///** + // * @Author lvleigang + // * @Description 缓存主数据DB的所有字段的规则 + // * @Date 4:11 下午 2024/6/11 + // * @param entity + // * @return java.util.List + // **/ + //@Override + //@Cacheable(cacheNames="mdmModuleDbFiledsRule",key = "#entity.mdmId") + //public List queryMdmModuleDbFiledsRule(MdmModuleDbFiledsRuleEntity entity) { + // List mdmModuleDbFiledsRuleEntities = mdmModuleDbFiledsRuleDao.queryBase(entity); + // return mdmModuleDbFiledsRuleEntities; + //} + // + //@Override + //@Cacheable(cacheNames="mdmModuleDistribute",key = "#mdmId") + //public List queryMdmModuleDistribute(String mdmId,MdmModuleDistributeEntity mdmModuleDistributeEntity) { + // List mdmModuleDistributeEntities = mdmModuleDistributeDao.queryBase(mdmModuleDistributeEntity); + // //查询模块下的应用列表 + // MdmModuleDistributeDetailEntity mdmModuleDistributeDetailEntity = new MdmModuleDistributeDetailEntity(); + // mdmModuleDistributeDetailEntity.setSts("Y"); + // mdmModuleDistributeDetailEntity.setMdmId(mdmId); + // List mdmModuleDistributeDetailEntities = mdmModuleDistributeDetailDao.queryBase(mdmModuleDistributeDetailEntity); + // if(mdmModuleDistributeEntities != null && mdmModuleDistributeEntities.size() > 0){ + // for (int i = 0; i < mdmModuleDistributeEntities.size(); i++) { + // List moduleDistributeDetailEntities = new ArrayList<>(); + // if(mdmModuleDistributeDetailEntities != null && mdmModuleDistributeDetailEntities.size() > 0){ + // for (int i1 = 0; i1 < mdmModuleDistributeDetailEntities.size(); i1++) { + // if(mdmModuleDistributeEntities.get(i).getId().equals(mdmModuleDistributeDetailEntities.get(i1).getDistributeId())){ + // moduleDistributeDetailEntities.add(mdmModuleDistributeDetailEntities.get(i1)); + // } + // } + // } + // mdmModuleDistributeEntities.get(i).setMdmModuleDistributeDetailEntities(moduleDistributeDetailEntities); + // } + // } + // return mdmModuleDistributeEntities; + //} + // + // + + // + //@Override + //@Cacheable(cacheNames="mdmTableCodeRule",key = "#entity.mdmId") + //public List queryMdmTableCodeRuleEntity(MdmTableCodeRuleEntity entity) { + // List mdmTableCodeRuleEntityList = mdmTableCodeRuleDao.queryBase(entity); + // return mdmTableCodeRuleEntityList; + //} + // + // + // + //@Override + //@CacheEvict(cacheNames="mdmTableCodeRule",key = "#mdmId") + //public void saveMdmTableCodeRule(String mdmId, List mdmTableCodeRuleEntities) { + // MdmTableCodeRuleEntity mdmTableCodeRuleEntity = new MdmTableCodeRuleEntity(); + // mdmTableCodeRuleEntity.setMdmId(mdmId); + // mdmTableCodeRuleEntity.setSts("Y"); + // mdmTableCodeRuleEntity.setUpdate(); + // mdmTableCodeRuleDao.logicRemoveMultiCondition(mdmTableCodeRuleEntity); + // if(mdmTableCodeRuleEntities != null && mdmTableCodeRuleEntities.size() > 0){ + // for (int i = 0; i < mdmTableCodeRuleEntities.size(); i++) { + // mdmTableCodeRuleDao.save(mdmTableCodeRuleEntities.get(i)); + // } + // } + //} + // + + + //@Override + //@CacheEvict(cacheNames="mdmModuleDbFiledsRule",key = "#mdmId") + //public void saveMdmModuleDbFiledsRule(String mdmId, List mdmModuleDbFiledsRuleEntities) { + // MdmModuleDbFiledsRuleEntity mdmModuleDbFiledsRuleEntity = new MdmModuleDbFiledsRuleEntity(); + // mdmModuleDbFiledsRuleEntity.setMdmId(mdmId); + // mdmModuleDbFiledsRuleEntity.setSts("Y"); + // mdmModuleDbFiledsRuleEntity.setUpdate(); + // mdmModuleDbFiledsRuleDao.logicRemoveMultiCondition(mdmModuleDbFiledsRuleEntity); + // if(mdmModuleDbFiledsRuleEntities != null && mdmModuleDbFiledsRuleEntities.size() > 0){ + // for (int i = 0; i < mdmModuleDbFiledsRuleEntities.size(); i++) { + // if("1".equals(mdmModuleDbFiledsRuleEntities.get(i).getDataType())){ + // mdmModuleDbFiledsRuleDao.save(mdmModuleDbFiledsRuleEntities.get(i)); + // }else { + // mdmModuleDbFiledsRuleDao.update(mdmModuleDbFiledsRuleEntities.get(i)); + // } + // } + // } + //} + // + //@Override + //@Cacheable(cacheNames="mdmModuleViewDetail",key = "#entity.mdmId") + //public List queryMdmModuleViewDetail(MdmModuleViewDetailEntity entity) { + // List mdmModuleViewDetailEntities = mdmModuleViewDetailDao.queryBase(entity); + // return mdmModuleViewDetailEntities; + //} + // + //@Override + //@Cacheable(cacheNames="mdmModuleView",key = "#entity.mdmId") + //public List queryMdmModuleView(MdmModuleViewEntity entity) { + // List moduleViewEntities = mdmModuleViewDao.queryBase(entity); + // return moduleViewEntities; + //} + // + //@Override + //@Cacheable(cacheNames="mdmModuleViewButton",key = "#entity.mdmId") + //public List queryMdmModuleViewButton(MdmModuleViewButtonEntity entity) { + // List mdmModuleViewButtonEntities = mdmModuleViewButtonDao.queryBase(entity); + // return mdmModuleViewButtonEntities; + //} + // + //@Override + //@CacheEvict(cacheNames="mdmModuleView",key = "#mdmId") + //public void saveMdmModuleView(String mdmId, MdmModuleViewEntity mdmModuleViewEntity) { + // mdmModuleViewDao.update(mdmModuleViewEntity); + //} + // + //@Override + //@CacheEvict(cacheNames="mdmModuleViewDetail",key = "#mdmId") + //public void saveMdmModuleViewDetail(String mdmId, List mdmModuleViewDetailEntities) { + // MdmModuleViewDetailEntity mdmModuleViewDetailEntity = new MdmModuleViewDetailEntity(); + // mdmModuleViewDetailEntity.setMdmId(mdmId); + // mdmModuleViewDetailEntity.setUpdate(); + // mdmModuleViewDetailDao.logicRemoveMultiCondition(mdmModuleViewDetailEntity); + // if(mdmModuleViewDetailEntities != null && mdmModuleViewDetailEntities.size() > 0){ + // for (int i = 0; i < mdmModuleViewDetailEntities.size(); i++) { + // if("1".equals(mdmModuleViewDetailEntities.get(i).getDataType())){ + // mdmModuleViewDetailDao.save(mdmModuleViewDetailEntities.get(i)); + // }else { + // mdmModuleViewDetailDao.update(mdmModuleViewDetailEntities.get(i)); + // } + // } + // } + //} + // + //@Override + //@CacheEvict(cacheNames="mdmModuleViewButton",key = "#mdmId") + //public void saveMdmModuleViewButton(String mdmId, List mdmModuleViewButtonEntities) { + // MdmModuleViewButtonEntity mdmModuleViewButtonEntity = new MdmModuleViewButtonEntity(); + // mdmModuleViewButtonEntity.setMdmId(mdmId); + // mdmModuleViewButtonEntity.setUpdate(); + // mdmModuleViewButtonDao.logicRemoveMultiCondition(mdmModuleViewButtonEntity); + // if(mdmModuleViewButtonEntities != null && mdmModuleViewButtonEntities.size() > 0){ + // for (int i = 0; i < mdmModuleViewButtonEntities.size(); i++) { + // if("1".equals(mdmModuleViewButtonEntities.get(i).getDataType())){ + // mdmModuleViewButtonDao.save(mdmModuleViewButtonEntities.get(i)); + // }else { + // mdmModuleViewButtonDao.update(mdmModuleViewButtonEntities.get(i)); + // } + // } + // } + //} + // + //@Override + //@Cacheable(cacheNames="mdmModuleDistributeDetail",key = "#entity.mdmId") + //public List queryMdmModuleDistributeDetail(MdmModuleDistributeDetailEntity entity){ + // List mdmModuleDistributeDetailEntities = mdmModuleDistributeDetailDao.queryBase(entity); + // return mdmModuleDistributeDetailEntities; + //} + // + //@Override + //@CacheEvict(cacheNames="mdmModuleDistribute",key = "#mdmId") + //public void saveMdmModuleDistribute(String mdmId, List mdmModuleDistributeEntities) { + // //先删除 + // MdmModuleDistributeEntity mdmModuleDistributeEntity = new MdmModuleDistributeEntity(); + // mdmModuleDistributeEntity.setMdmId(mdmId); + // mdmModuleDistributeEntity.setUpdate(); + // mdmModuleDistributeDao.logicRemoveMultiCondition(mdmModuleDistributeEntity); + // //保存主数据 + // if (mdmModuleDistributeEntities != null && mdmModuleDistributeEntities.size() > 0) { + // for (int i = 0; i < mdmModuleDistributeEntities.size(); i++) { + // MdmModuleDistributeEntity moduleDistributeEntity = mdmModuleDistributeEntities.get(i); + // moduleDistributeEntity.setMdmId(mdmId); + // if (moduleDistributeEntity.getId() != null && !"".equals(moduleDistributeEntity.getId())) { + // moduleDistributeEntity.setUpdate(); + // //修改 + // mdmModuleDistributeDao.update(moduleDistributeEntity); + // } else { + // //新增 + // moduleDistributeEntity.setCreate(); + // mdmModuleDistributeDao.save(moduleDistributeEntity); + // } + // if(moduleDistributeEntity.getMdmModuleDistributeDetailEntities() != null && moduleDistributeEntity.getMdmModuleDistributeDetailEntities().size() > 0){ + // for (int i1 = 0; i1 < moduleDistributeEntity.getMdmModuleDistributeDetailEntities().size(); i1++) { + // MdmModuleDistributeDetailEntity mdmModuleDistributeDetailEntity = moduleDistributeEntity.getMdmModuleDistributeDetailEntities().get(i1); + // mdmModuleDistributeDetailEntity.setMdmId(mdmId); + // mdmModuleDistributeDetailEntity.setDistributeId(moduleDistributeEntity.getId()); + // if (mdmModuleDistributeDetailEntity.getId() != null && !"".equals(mdmModuleDistributeDetailEntity.getId())) { + // mdmModuleDistributeDetailEntity.setUpdate(); + // //修改 + // mdmModuleDistributeDetailDao.update(mdmModuleDistributeDetailEntity); + // } else { + // //新增 + // mdmModuleDistributeDetailEntity.setCreate(); + // mdmModuleDistributeDetailDao.save(mdmModuleDistributeDetailEntity); + // } + // } + // } + // } + // } + //} + // + //@Override + //@Cacheable(cacheNames="mdmModuleSource",key = "#entity.mdmId") + //public List queryMdmModuleSource(MdmModuleSourceEntity entity) { + // List mdmModuleSourceEntities = mdmModuleSourceDao.queryBase(entity); + // return mdmModuleSourceEntities; + //} + // + //@Override + //@CacheEvict(cacheNames="mdmModuleSource",key = "#mdmId") + //public void saveMdmModuleSource(String mdmId, List mdmModuleSourceEntities) { + // //先删除 + // MdmModuleSourceEntity mdmModuleSourceEntity = new MdmModuleSourceEntity(); + // mdmModuleSourceEntity.setMdmId(mdmId); + // mdmModuleSourceEntity.setUpdate(); + // mdmModuleSourceDao.logicRemoveMultiCondition(mdmModuleSourceEntity); + // //保存主数据 + // if (mdmModuleSourceEntities != null && mdmModuleSourceEntities.size() > 0) { + // for (int i = 0; i < mdmModuleSourceEntities.size(); i++) { + // MdmModuleSourceEntity mdmModuleSourceEntity1 = mdmModuleSourceEntities.get(i); + // mdmModuleSourceEntity1.setMdmId(mdmId); + // if (mdmModuleSourceEntity1.getId() != null && !"".equals(mdmModuleSourceEntity1.getId())) { + // mdmModuleSourceEntity1.setUpdate(); + // //修改 + // mdmModuleSourceDao.update(mdmModuleSourceEntity1); + // } else { + // //新增 + // mdmModuleSourceEntity1.setCreate(); + // mdmModuleSourceDao.save(mdmModuleSourceEntity1); + // } + // } + // } + //} + - @Override - @Cacheable(cacheNames="mdmModuleViewButton",key = "#entity.mdmId") - public List queryMdmModuleViewButton(MdmModuleViewButtonEntity entity) { - List mdmModuleViewButtonEntities = mdmModuleViewButtonDao.queryBase(entity); - return mdmModuleViewButtonEntities; - } - @Override - @CacheEvict(cacheNames="mdmModuleView",key = "#mdmId") - public void saveMdmModuleView(String mdmId, MdmModuleViewEntity mdmModuleViewEntity) { - mdmModuleViewDao.update(mdmModuleViewEntity); - } - @Override - @CacheEvict(cacheNames="mdmModuleViewDetail",key = "#mdmId") - public void saveMdmModuleViewDetail(String mdmId, List mdmModuleViewDetailEntities) { - MdmModuleViewDetailEntity mdmModuleViewDetailEntity = new MdmModuleViewDetailEntity(); - mdmModuleViewDetailEntity.setMdmId(mdmId); - mdmModuleViewDetailEntity.setUpdate(); - mdmModuleViewDetailDao.logicRemoveMultiCondition(mdmModuleViewDetailEntity); - if(mdmModuleViewDetailEntities != null && mdmModuleViewDetailEntities.size() > 0){ - for (int i = 0; i < mdmModuleViewDetailEntities.size(); i++) { - if("1".equals(mdmModuleViewDetailEntities.get(i).getDataType())){ - mdmModuleViewDetailDao.save(mdmModuleViewDetailEntities.get(i)); - }else { - mdmModuleViewDetailDao.update(mdmModuleViewDetailEntities.get(i)); - } - } - } - } - @Override - @CacheEvict(cacheNames="mdmModuleViewButton",key = "#mdmId") - public void saveMdmModuleViewButton(String mdmId, List mdmModuleViewButtonEntities) { - MdmModuleViewButtonEntity mdmModuleViewButtonEntity = new MdmModuleViewButtonEntity(); - mdmModuleViewButtonEntity.setMdmId(mdmId); - mdmModuleViewButtonEntity.setUpdate(); - mdmModuleViewButtonDao.logicRemoveMultiCondition(mdmModuleViewButtonEntity); - if(mdmModuleViewButtonEntities != null && mdmModuleViewButtonEntities.size() > 0){ - for (int i = 0; i < mdmModuleViewButtonEntities.size(); i++) { - if("1".equals(mdmModuleViewButtonEntities.get(i).getDataType())){ - mdmModuleViewButtonDao.save(mdmModuleViewButtonEntities.get(i)); - }else { - mdmModuleViewButtonDao.update(mdmModuleViewButtonEntities.get(i)); - } - } - } - } - @Override - @Cacheable(cacheNames="mdmModuleDistribute",key = "#mdmId") - public List queryMdmModuleDistribute(String mdmId,MdmModuleDistributeEntity mdmModuleDistributeEntity) { - List mdmModuleDistributeEntities = mdmModuleDistributeDao.queryBase(mdmModuleDistributeEntity); - //查询模块下的应用列表 - MdmModuleDistributeDetailEntity mdmModuleDistributeDetailEntity = new MdmModuleDistributeDetailEntity(); - mdmModuleDistributeDetailEntity.setSts("Y"); - mdmModuleDistributeDetailEntity.setMdmId(mdmId); - List mdmModuleDistributeDetailEntities = mdmModuleDistributeDetailDao.queryBase(mdmModuleDistributeDetailEntity); - if(mdmModuleDistributeEntities != null && mdmModuleDistributeEntities.size() > 0){ - for (int i = 0; i < mdmModuleDistributeEntities.size(); i++) { - List moduleDistributeDetailEntities = new ArrayList<>(); - if(mdmModuleDistributeDetailEntities != null && mdmModuleDistributeDetailEntities.size() > 0){ - for (int i1 = 0; i1 < mdmModuleDistributeDetailEntities.size(); i1++) { - if(mdmModuleDistributeEntities.get(i).getId().equals(mdmModuleDistributeDetailEntities.get(i1).getDistributeId())){ - moduleDistributeDetailEntities.add(mdmModuleDistributeDetailEntities.get(i1)); - } - } - } - mdmModuleDistributeEntities.get(i).setMdmModuleDistributeDetailEntities(moduleDistributeDetailEntities); - } - } - return mdmModuleDistributeEntities; - } - @Override - @Cacheable(cacheNames="mdmModuleDistributeDetail",key = "#entity.mdmId") - public List queryMdmModuleDistributeDetail(MdmModuleDistributeDetailEntity entity){ - List mdmModuleDistributeDetailEntities = mdmModuleDistributeDetailDao.queryBase(entity); - return mdmModuleDistributeDetailEntities; - } - @Override - @CacheEvict(cacheNames="mdmModuleDistribute",key = "#mdmId") - public void saveMdmModuleDistribute(String mdmId, List mdmModuleDistributeEntities) { - //先删除 - MdmModuleDistributeEntity mdmModuleDistributeEntity = new MdmModuleDistributeEntity(); - mdmModuleDistributeEntity.setMdmId(mdmId); - mdmModuleDistributeEntity.setUpdate(); - mdmModuleDistributeDao.logicRemoveMultiCondition(mdmModuleDistributeEntity); - //保存主数据 - if (mdmModuleDistributeEntities != null && mdmModuleDistributeEntities.size() > 0) { - for (int i = 0; i < mdmModuleDistributeEntities.size(); i++) { - MdmModuleDistributeEntity moduleDistributeEntity = mdmModuleDistributeEntities.get(i); - moduleDistributeEntity.setMdmId(mdmId); - if (moduleDistributeEntity.getId() != null && !"".equals(moduleDistributeEntity.getId())) { - moduleDistributeEntity.setUpdate(); - //修改 - mdmModuleDistributeDao.update(moduleDistributeEntity); - } else { - //新增 - moduleDistributeEntity.setCreate(); - mdmModuleDistributeDao.save(moduleDistributeEntity); - } - if(moduleDistributeEntity.getMdmModuleDistributeDetailEntities() != null && moduleDistributeEntity.getMdmModuleDistributeDetailEntities().size() > 0){ - for (int i1 = 0; i1 < moduleDistributeEntity.getMdmModuleDistributeDetailEntities().size(); i1++) { - MdmModuleDistributeDetailEntity mdmModuleDistributeDetailEntity = moduleDistributeEntity.getMdmModuleDistributeDetailEntities().get(i1); - mdmModuleDistributeDetailEntity.setMdmId(mdmId); - mdmModuleDistributeDetailEntity.setDistributeId(moduleDistributeEntity.getId()); - if (mdmModuleDistributeDetailEntity.getId() != null && !"".equals(mdmModuleDistributeDetailEntity.getId())) { - mdmModuleDistributeDetailEntity.setUpdate(); - //修改 - mdmModuleDistributeDetailDao.update(mdmModuleDistributeDetailEntity); - } else { - //新增 - mdmModuleDistributeDetailEntity.setCreate(); - mdmModuleDistributeDetailDao.save(mdmModuleDistributeDetailEntity); - } - } - } - } - } - } - @Override - @Cacheable(cacheNames="mdmModuleSource",key = "#entity.mdmId") - public List queryMdmModuleSource(MdmModuleSourceEntity entity) { - List mdmModuleSourceEntities = mdmModuleSourceDao.queryBase(entity); - return mdmModuleSourceEntities; - } - @Override - @CacheEvict(cacheNames="mdmModuleSource",key = "#mdmId") - public void saveMdmModuleSource(String mdmId, List mdmModuleSourceEntities) { - //先删除 - MdmModuleSourceEntity mdmModuleSourceEntity = new MdmModuleSourceEntity(); - mdmModuleSourceEntity.setMdmId(mdmId); - mdmModuleSourceEntity.setUpdate(); - mdmModuleSourceDao.logicRemoveMultiCondition(mdmModuleSourceEntity); - //保存主数据 - if (mdmModuleSourceEntities != null && mdmModuleSourceEntities.size() > 0) { - for (int i = 0; i < mdmModuleSourceEntities.size(); i++) { - MdmModuleSourceEntity mdmModuleSourceEntity1 = mdmModuleSourceEntities.get(i); - mdmModuleSourceEntity1.setMdmId(mdmId); - if (mdmModuleSourceEntity1.getId() != null && !"".equals(mdmModuleSourceEntity1.getId())) { - mdmModuleSourceEntity1.setUpdate(); - //修改 - mdmModuleSourceDao.update(mdmModuleSourceEntity1); - } else { - //新增 - mdmModuleSourceEntity1.setCreate(); - mdmModuleSourceDao.save(mdmModuleSourceEntity1); - } - } - } - } } 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 145b9b67..30556520 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 @@ -78,2072 +78,925 @@ import java.util.Map; @Service(value = "mdmService") public class MdmServiceImpl implements IMdmService { private final Logger logger = LoggerFactory.getLogger(this.getClass()); - - @Resource - private IMdmModuleDao mdmModuleDao; - @Resource - private IMdmModuleSendLogDao mdmModuleSendLogDao; - @Resource - private IMdmModuleOptionLogDao mdmModuleOptionLogDao; - @Resource - private IMdmServiceCache mdmServiceCache; - @Resource - private ISysMenuConfigDao sysMenuConfigDao; - @Resource - private ISysButtonConfigDao sysButtonConfigDao; - @Resource - private ISysPopedomOperateDao sysPopedomOperateDao; - @Resource - private IMdmModuleDbDao mdmModuleDbDao; - @Resource - private IMdmModuleDbFiledsDao mdmModuleDbFiledsDao; - @Resource - private IMdmModuleDbFiledsRuleDao mdmModuleDbFiledsRuleDao; - @Resource - private IMdmModuleDistributeDao mdmModuleDistributeDao; - @Resource - private IMdmModuleDistributeDetailDao mdmModuleDistributeDetailDao; - @Resource - private IMdmModuleViewDao mdmModuleViewDao; - @Resource - private IMdmModuleViewButtonDao mdmModuleViewButtonDao; - @Resource - private IMdmModuleViewDetailDao mdmModuleViewDetailDao; - - /** - * @param object - * @return com.hzya.frame.web.entity.JsonResultEntity - * @Author lvleigang - * @Description 主数据列表查询接口分页 - * @Date 9:40 上午 2023/10/18 - **/ - @Override - public JsonResultEntity queryMdmPage(JSONObject object) { - MdmModuleEntity entity = getData("jsonStr", object, MdmModuleEntity.class); - //判断分页 - if (entity == null || entity.getPageNum() == null || entity.getPageSize() == null) { - return BaseResult.getFailureMessageEntity("分页查询参数不存在"); - } - PageHelper.startPage(entity.getPageNum(), entity.getPageSize()); - List mdmVos = mdmModuleDao.queryMdm(entity); - PageInfo pageInfo = new PageInfo(mdmVos); - return BaseResult.getSuccessMessageEntity("查询数据成功", pageInfo); - } - - /** - * @param object - * @return com.hzya.frame.web.entity.JsonResultEntity - * @Author lvleigang - * @Description 主数据列表查询接口列表 - * @Date 9:40 上午 2023/10/18 - **/ - @Override - public JsonResultEntity queryMdmList(JSONObject object) { - MdmModuleEntity entity = getData("jsonStr", object, MdmModuleEntity.class); - List mdmVos = mdmModuleDao.queryMdm(entity); - return BaseResult.getSuccessMessageEntity("查询数据成功", mdmVos); - } - - /** - * @param object - * @return com.hzya.frame.web.entity.JsonResultEntity - * @Author lvleigang - * @Description 主数据新增 - * @Date 9:40 上午 2023/10/18 - **/ - @Override - public JsonResultEntity addMdm(JSONObject object) { - MdmModuleEntity entity = getData("jsonStr", object, MdmModuleEntity.class); - if (entity == null) { - return BaseResult.getFailureMessageEntity("参数不允许为空"); - } - if (entity.getMdmName() == null || "".equals(entity.getMdmName())) { - return BaseResult.getFailureMessageEntity("请先输入主数据名称"); - } - if (entity.getMdmType() == null || "".equals(entity.getMdmType())) { - return BaseResult.getFailureMessageEntity("请先选择主数据类型"); - } - //新增 - entity.setCreate(); - mdmModuleDao.save(entity); - return BaseResult.getSuccessMessageEntity("保存数据成功", entity); - } - - /** - * @param object - * @return com.hzya.frame.web.entity.JsonResultEntity - * @Author lvleigang - * @Description 主数据基本信息获取 - * @Date 9:40 上午 2023/10/18 - **/ - @Override - public JsonResultEntity queryMdmModule(JSONObject object) { - MdmModuleEntity entity = getData("jsonStr", object, MdmModuleEntity.class); - if (entity == null) { - return BaseResult.getFailureMessageEntity("系统错误"); - } - if (entity.getMdmCode() == null || "".equals(entity.getMdmCode())) { - return BaseResult.getFailureMessageEntity("系统错误"); - } - //使用缓存 - MdmModuleEntity mdmModuleEntity = mdmServiceCache.getMdmModuleEntity(entity.getMdmCode()); - return BaseResult.getSuccessMessageEntity("查询数据成功", mdmModuleEntity); - } - - /** - * @param object - * @return com.hzya.frame.web.entity.JsonResultEntity - * @Author lvleigang - * @Description 主数据基本信息保存 - * @Date 9:40 上午 2023/10/18 - **/ - @Override - public JsonResultEntity doSaveMdmModule(JSONObject object) { - MdmModuleEntity entity = getData("jsonStr", object, MdmModuleEntity.class); - if (entity == null) { - return BaseResult.getFailureMessageEntity("参数不允许为空"); - } - if (entity.getMdmName() == null || "".equals(entity.getMdmName())) { - return BaseResult.getFailureMessageEntity("请先输入主数据名称"); - } - if (entity.getMdmCode() == null || "".equals(entity.getMdmCode())) { - return BaseResult.getFailureMessageEntity("系统错误"); - } - MdmModuleEntity mdmModuleEntity = mdmServiceCache.getMdmModuleEntity(entity.getMdmCode()); - if(mdmModuleEntity == null ){ - return BaseResult.getFailureMessageEntity("系统错误"); - } - entity.setId(mdmModuleEntity.getId()); - //修改 - entity.setUpdate(); - mdmServiceCache.updateMdmModuleEntity(entity); - return BaseResult.getSuccessMessageEntity("修改主数据成功", entity); - } - - /** - * @param object - * @return com.hzya.frame.web.entity.JsonResultEntity - * @Author lvleigang - * @Description 主数据设置查询数据源 - * @Date 9:40 上午 2023/10/18 - **/ - @Override - public JsonResultEntity queryMdmModuleDb(JSONObject object) { - MdmModuleEntity entity = getData("jsonStr", object, MdmModuleEntity.class); - //判断分页 - if (entity == null) { - return BaseResult.getFailureMessageEntity("系统错误"); - } - if (entity.getMdmCode() == null || "".equals(entity.getMdmCode())) { - return BaseResult.getFailureMessageEntity("系统错误"); - } - MdmDbVo mdmDbVo = new MdmDbVo(); - //获取主数据 - MdmModuleEntity mdmModuleEntity = mdmServiceCache.getMdmModuleEntity(entity.getMdmCode()); - //查询设置的规则表 - MdmTableCodeRuleEntity mdmTableCodeRuleEntity = new MdmTableCodeRuleEntity(); - mdmTableCodeRuleEntity.setSts("Y"); - mdmTableCodeRuleEntity.setMdmId(mdmModuleEntity.getId()); - List mdmTableCodeRuleEntityList = mdmServiceCache.queryMdmTableCodeRuleEntity(mdmTableCodeRuleEntity); - mdmDbVo.setMdmTableCodeRuleEntityList(mdmTableCodeRuleEntityList); - //查询数据源表 - MdmModuleDbEntity queryDb = new MdmModuleDbEntity(); - queryDb.setMdmId(mdmModuleEntity.getId()); - queryDb.setSts("Y"); - List mdmModuleDbEntityList = mdmServiceCache.queryMdmModuleDb(queryDb); - //数据源字段 - MdmModuleDbFiledsEntity queryDbFiled = new MdmModuleDbFiledsEntity(); - queryDbFiled.setMdmId(mdmModuleEntity.getId()); - queryDbFiled.setSts("Y"); - List mdmModuleDbFiledsEntityList = mdmServiceCache.queryMdmModuleDbFileds(queryDbFiled); - //数据源字段规则 - MdmModuleDbFiledsRuleEntity queryDbFiledRule = new MdmModuleDbFiledsRuleEntity(); - queryDbFiledRule.setMdmId(mdmModuleEntity.getId()); - queryDbFiledRule.setSts("Y"); - List mdmModuleDbFiledsRuleEntityList = mdmServiceCache.queryMdmModuleDbFiledsRule(queryDbFiledRule); - //组装数据 - setMdmDb(mdmDbVo, mdmModuleDbEntityList, mdmModuleDbFiledsEntityList, mdmModuleDbFiledsRuleEntityList); - return BaseResult.getSuccessMessageEntity("查询数据成功", mdmDbVo); - } - /** - * @param mdmDbVo 返回对象 - * @param mdmModuleDbEntityList 数据表 - * @param mdmModuleDbFiledsEntityList 字段 - * @param mdmModuleDbFiledsRuleEntityList 字段属性 - * @return void - * @Author lvleigang - * @Description 组装返回数据 - * @Date 4:51 下午 2023/10/18 - **/ - private void setMdmDb(MdmDbVo mdmDbVo, List mdmModuleDbEntityList, List mdmModuleDbFiledsEntityList, List mdmModuleDbFiledsRuleEntityList) { - //主数据主表 - MdmModuleDbEntity mainMdmModuleDb = new MdmModuleDbEntity(); - //主数据子表 - List sublistMdmModuleDb = new ArrayList<>(); - //主数据主表字段 - List mainMdmModuleDbFileds = new ArrayList<>(); - - - if (mdmModuleDbEntityList != null && mdmModuleDbEntityList.size() > 0) { - for (int i = 0; i < mdmModuleDbEntityList.size(); i++) { - if ("1".equals(mdmModuleDbEntityList.get(i).getDbType())) { - //1、主表 2、明细 - mainMdmModuleDb = mdmModuleDbEntityList.get(i); - //循环字段表 - if (mdmModuleDbFiledsEntityList != null && mdmModuleDbFiledsEntityList.size() > 0) { - for (int i1 = 0; i1 < mdmModuleDbFiledsEntityList.size(); i1++) { - if (mdmModuleDbEntityList.get(i).getId().equals(mdmModuleDbFiledsEntityList.get(i1).getDbId())) { - mainMdmModuleDbFileds.add(mdmModuleDbFiledsEntityList.get(i1)); - List mdmModuleDbFiledsRules = new ArrayList<>(); - //循环字段属性 - if (mdmModuleDbFiledsRuleEntityList != null && mdmModuleDbFiledsRuleEntityList.size() > 0) { - for (int i2 = 0; i2 < mdmModuleDbFiledsRuleEntityList.size(); i2++) { - if (mdmModuleDbFiledsEntityList.get(i1).getDbId().equals(mdmModuleDbFiledsRuleEntityList.get(i2).getDbId()) - && mdmModuleDbFiledsEntityList.get(i1).getId().equals(mdmModuleDbFiledsRuleEntityList.get(i2).getFiledId())) { - mdmModuleDbFiledsRules.add(mdmModuleDbFiledsRuleEntityList.get(i2)); - } - } - } - mdmModuleDbFiledsEntityList.get(i1).setMdmModuleDbFiledsRules(mdmModuleDbFiledsRules); - } - } - } - } else if ("2".equals(mdmModuleDbEntityList.get(i).getDbType())) { - //2、明细 - sublistMdmModuleDb.add(mdmModuleDbEntityList.get(i)); - //循环字段表 - if (mdmModuleDbFiledsEntityList != null && mdmModuleDbFiledsEntityList.size() > 0) { - List sublistMdmModuleDbFileds = new ArrayList<>(); - for (int i1 = 0; i1 < mdmModuleDbFiledsEntityList.size(); i1++) { - if (mdmModuleDbEntityList.get(i).getId().equals(mdmModuleDbFiledsEntityList.get(i1).getDbId())) { - sublistMdmModuleDbFileds.add(mdmModuleDbFiledsEntityList.get(i1)); - List mdmModuleDbFiledsRules = new ArrayList<>(); - //循环字段属性 - if (mdmModuleDbFiledsRuleEntityList != null && mdmModuleDbFiledsRuleEntityList.size() > 0) { - for (int i2 = 0; i2 < mdmModuleDbFiledsRuleEntityList.size(); i2++) { - if (mdmModuleDbFiledsEntityList.get(i1).getDbId().equals(mdmModuleDbFiledsRuleEntityList.get(i2).getDbId()) - && mdmModuleDbFiledsEntityList.get(i1).getId().equals(mdmModuleDbFiledsRuleEntityList.get(i2).getFiledId())) { - mdmModuleDbFiledsRules.add(mdmModuleDbFiledsRuleEntityList.get(i2)); - } - } - } - mdmModuleDbFiledsEntityList.get(i1).setMdmModuleDbFiledsRules(mdmModuleDbFiledsRules); - } - } - mdmModuleDbEntityList.get(i).setSublistMdmModuleDbFileds(sublistMdmModuleDbFileds); - } - } - } - } - mainMdmModuleDb.setSublistMdmModuleDbFileds(mainMdmModuleDbFileds); - mdmDbVo.setMainMdmModuleDb(mainMdmModuleDb); - mdmDbVo.setSublistMdmModuleDb(sublistMdmModuleDb); - } - - /** - * @param object - * @return com.hzya.frame.web.entity.JsonResultEntity - * @Author lvleigang - * @Description 主数据设置保存数据源 - * @Date 9:40 上午 2023/10/18 - **/ - @Override - public JsonResultEntity saveMdmModuleDb(JSONObject object) { - //判断新增还是修改,保存数据生成表结构 - MdmDto entity = getData("jsonStr", object, MdmDto.class); - if (entity == null) { - return BaseResult.getFailureMessageEntity("参数不允许为空"); - } - if (entity.getMdmCode() == null || "".equals(entity.getMdmCode())) { - return BaseResult.getFailureMessageEntity("系统错误"); - } - //单据规则校验 - if(entity.getMdmTableCodeRuleEntityList() == null || entity.getMdmTableCodeRuleEntityList().size() == 0){ - return BaseResult.getFailureMessageEntity("请先设置单据规则"); - } - //主表校验 - if (entity.getMainMdmModuleDb() == null || entity.getMainMdmModuleDb().getDbName() == null || "".equals(entity.getMainMdmModuleDb().getDbName())) { - return BaseResult.getFailureMessageEntity("请先输入主表名称"); - } - MdmModuleEntity mdmModuleEntity = mdmServiceCache.getMdmModuleEntity(entity.getMdmCode()); - //主数据主表 - MdmModuleDbEntity mainMdmModuleDb = entity.getMainMdmModuleDb(); - //主数据主表字段 - List mainMdmModuleDbFileds = mainMdmModuleDb.getSublistMdmModuleDbFileds(); - //主数据子表 - List sublistMdmModuleDb = entity.getSublistMdmModuleDb(); - //单据规则 - List mdmTableCodeRuleEntities = entity.getMdmTableCodeRuleEntityList(); - // 需要校验表是否存在 - if (checkTable(mainMdmModuleDb.getDbName())) { - return BaseResult.getFailureMessageEntity("主表表名已经存在"); - } - if(mainMdmModuleDbFileds == null || mainMdmModuleDbFileds.size() == 0){ - return BaseResult.getFailureMessageEntity("请先设置主表字段"); - } - //判断明细表 - if (sublistMdmModuleDb != null && sublistMdmModuleDb.size() > 0) { - for (int i = 0; i < sublistMdmModuleDb.size(); i++) { - // 需要校验表是否存在 - if (checkTable(sublistMdmModuleDb.get(i).getDbName())) { - return BaseResult.getFailureMessageEntity("子表" + sublistMdmModuleDb.get(i).getDbName() + "已经存在"); - } - if (sublistMdmModuleDb.get(i).getSublistMdmModuleDbFileds() == null && sublistMdmModuleDb.get(i).getSublistMdmModuleDbFileds().size() == 0) { - return BaseResult.getFailureMessageEntity("请先设置子表" + sublistMdmModuleDb.get(i).getDbName() + "的字段"); - } - - } - } - //处理数据 - //分别设置成 数据源 数据源字段 数据源规则表 设置是否新增修改 没有id新增,有ID修改 - List mdmModuleDbEntities = new ArrayList<>(); - List mdmModuleDbFiledsEntities = new ArrayList<>(); - List mdmModuleDbFiledsRuleEntities = new ArrayList<>(); - - //主表 - if(mainMdmModuleDb.getId() != null && !"".equals(mainMdmModuleDb.getId())){ - //修改 - mainMdmModuleDb.setDataType("2"); - mainMdmModuleDb.setUpdate(); - }else { - //新增 - mainMdmModuleDb.setDataType("1"); - mainMdmModuleDb.setMdmId(mdmModuleEntity.getId()); - mainMdmModuleDb.setCreate(); - } - mainMdmModuleDb.setDbType("1"); - mdmModuleDbEntities.add(mainMdmModuleDb); - for (int i = 0; i < mdmTableCodeRuleEntities.size(); i++) { - mdmTableCodeRuleEntities.get(i).setMdmId(mdmModuleEntity.getId()); - mdmTableCodeRuleEntities.get(i).setDbId(mainMdmModuleDb.getId()); - mdmTableCodeRuleEntities.get(i).setCreate(); - } - for (int i = 0; i < mainMdmModuleDbFileds.size(); i++) { - if(mainMdmModuleDbFileds.get(i).getId() != null && !"".equals(mainMdmModuleDbFileds.get(i).getId())){ - //修改 - mainMdmModuleDbFileds.get(i).setDataType("2"); - mainMdmModuleDbFileds.get(i).setUpdate(); - }else { - //新增 - mainMdmModuleDbFileds.get(i).setDataType("1"); - mainMdmModuleDbFileds.get(i).setCreate(); - } - mainMdmModuleDbFileds.get(i).setMdmId(mdmModuleEntity.getId()); - mainMdmModuleDbFileds.get(i).setDbId(mainMdmModuleDb.getId()); - mainMdmModuleDbFileds.get(i).setAddType("1"); - mainMdmModuleDbFileds.get(i).setUpdateType("1"); - mainMdmModuleDbFileds.get(i).setShowType("1"); - mainMdmModuleDbFileds.get(i).setQueryType("1"); - mainMdmModuleDbFileds.get(i).setListType("1"); - mainMdmModuleDbFileds.get(i).setViewType("1"); - if(mainMdmModuleDbFileds.get(i).getMdmModuleDbFiledsRules() != null && mainMdmModuleDbFileds.get(i).getMdmModuleDbFiledsRules().size() > 0){ - for (int i1 = 0; i1 < mainMdmModuleDbFileds.get(i).getMdmModuleDbFiledsRules().size(); i1++) { - MdmModuleDbFiledsRuleEntity mdmModuleDbFiledsRuleEntity = mainMdmModuleDbFileds.get(i).getMdmModuleDbFiledsRules().get(i1); - if(mdmModuleDbFiledsRuleEntity.getId() != null && !"".equals(mdmModuleDbFiledsRuleEntity.getId())){ - //修改 - mdmModuleDbFiledsRuleEntity.setDataType("2"); - mdmModuleDbFiledsRuleEntity.setUpdate(); - }else { - //新增 - mdmModuleDbFiledsRuleEntity.setDataType("1"); - mdmModuleDbFiledsRuleEntity.setCreate(); - } - mdmModuleDbFiledsRuleEntities.add(mdmModuleDbFiledsRuleEntity); - } - } - mdmModuleDbFiledsEntities.add(mainMdmModuleDbFileds.get(i)); - } - if("1".equals(mainMdmModuleDb.getDataType())){ - //新增 设置默认字段 - List moduleDbFiledsEntities = getCreateMdm(mdmModuleEntity.getId(),mainMdmModuleDb.getId(),"1"); - mdmModuleDbFiledsEntities.addAll(moduleDbFiledsEntities); - } - //明细表 - if(sublistMdmModuleDb != null && sublistMdmModuleDb.size() > 0){ - for (int i = 0; i < sublistMdmModuleDb.size(); i++) { - MdmModuleDbEntity mdmModuleDbEntity = sublistMdmModuleDb.get(i); - if(mdmModuleDbEntity.getId() != null && !"".equals(mdmModuleDbEntity.getId())){ - //修改 - mdmModuleDbEntity.setDataType("2"); - mdmModuleDbEntity.setUpdate(); - }else { - //新增 - mdmModuleDbEntity.setDataType("1"); - mdmModuleDbEntity.setMdmId(mdmModuleEntity.getId()); - mdmModuleDbEntity.setCreate(); - } - mainMdmModuleDb.setDbType("2"); - mdmModuleDbEntities.add(mdmModuleDbEntity); - for (int a = 0; a < mdmModuleDbEntity.getSublistMdmModuleDbFileds().size(); a++) { - if(mdmModuleDbEntity.getSublistMdmModuleDbFileds().get(a).getId() != null && !"".equals(mdmModuleDbEntity.getSublistMdmModuleDbFileds().get(a).getId())){ - //修改 - mdmModuleDbEntity.getSublistMdmModuleDbFileds().get(a).setDataType("2"); - mdmModuleDbEntity.getSublistMdmModuleDbFileds().get(a).setUpdate(); - }else { - //新增 - mdmModuleDbEntity.getSublistMdmModuleDbFileds().get(a).setDataType("1"); - mdmModuleDbEntity.getSublistMdmModuleDbFileds().get(a).setCreate(); - } - mdmModuleDbEntity.getSublistMdmModuleDbFileds().get(a).setMdmId(mdmModuleEntity.getId()); - mdmModuleDbEntity.getSublistMdmModuleDbFileds().get(a).setDbId(mainMdmModuleDb.getId()); - mdmModuleDbEntity.getSublistMdmModuleDbFileds().get(a).setAddType("1"); - mdmModuleDbEntity.getSublistMdmModuleDbFileds().get(a).setUpdateType("1"); - mdmModuleDbEntity.getSublistMdmModuleDbFileds().get(a).setShowType("1"); - mdmModuleDbEntity.getSublistMdmModuleDbFileds().get(a).setQueryType("1"); - mdmModuleDbEntity.getSublistMdmModuleDbFileds().get(a).setListType("1"); - mdmModuleDbEntity.getSublistMdmModuleDbFileds().get(a).setViewType("1"); - if(mdmModuleDbEntity.getSublistMdmModuleDbFileds().get(a).getMdmModuleDbFiledsRules() != null && mdmModuleDbEntity.getSublistMdmModuleDbFileds().get(a).getMdmModuleDbFiledsRules().size() > 0){ - for (int i1 = 0; i1 < mainMdmModuleDbFileds.get(a).getMdmModuleDbFiledsRules().size(); i1++) { - MdmModuleDbFiledsRuleEntity mdmModuleDbFiledsRuleEntity = mainMdmModuleDbFileds.get(a).getMdmModuleDbFiledsRules().get(i1); - if(mdmModuleDbFiledsRuleEntity.getId() != null && !"".equals(mdmModuleDbFiledsRuleEntity.getId())){ - //修改 - mdmModuleDbFiledsRuleEntity.setDataType("2"); - mdmModuleDbFiledsRuleEntity.setUpdate(); - }else { - //新增 - mdmModuleDbFiledsRuleEntity.setDataType("1"); - mdmModuleDbFiledsRuleEntity.setCreate(); - } - mdmModuleDbFiledsRuleEntities.add(mdmModuleDbFiledsRuleEntity); - } - } - mdmModuleDbFiledsEntities.add(mdmModuleDbEntity.getSublistMdmModuleDbFileds().get(a)); - } - if("1".equals(mainMdmModuleDb.getDataType())){ - //新增 设置默认字段 - List moduleDbFiledsEntities = getCreateMdm(mdmModuleEntity.getId(),mainMdmModuleDb.getId(),"2"); - mdmModuleDbFiledsEntities.addAll(moduleDbFiledsEntities); - } - } - } - - - //新增日志表 - if("1".equals(mainMdmModuleDb.getDataType())){ - MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); - mdmModuleDbEntity.setMdmId(mdmModuleEntity.getId()); - mdmModuleDbEntity.setDbName(mainMdmModuleDb.getDbName()+"_option_log"); - mdmModuleDbEntity.setDbType("3"); - mdmModuleDbEntity.setDataType("1"); - mdmModuleDbEntity.setCreate(); - mdmModuleDbEntities.add(mdmModuleDbEntity); - //新增 设置日志表 - List moduleDbFiledsEntities = getCreateMdm(mdmModuleEntity.getId(),mdmModuleDbEntity.getId(),"3"); - mdmModuleDbFiledsEntities.addAll(moduleDbFiledsEntities); - - MdmModuleDbEntity mdmModuleDbEntity1 = new MdmModuleDbEntity(); - mdmModuleDbEntity1.setMdmId(mdmModuleEntity.getId()); - mdmModuleDbEntity1.setDbName(mainMdmModuleDb.getDbName()+"_option_log"); - mdmModuleDbEntity1.setDbType("4"); - mdmModuleDbEntity1.setDataType("1"); - mdmModuleDbEntity1.setCreate(); - mdmModuleDbEntities.add(mdmModuleDbEntity1); - //新增 设置日志表 - List moduleDbFiledsEntities1 = getCreateMdm(mdmModuleEntity.getId(),mdmModuleDbEntity1.getId(),"4"); - mdmModuleDbFiledsEntities.addAll(moduleDbFiledsEntities1); - } - //保存单据规则 - mdmServiceCache.saveMdmTableCodeRule(mdmModuleEntity.getId(),mdmTableCodeRuleEntities); - //保存db - mdmServiceCache.saveMdmModuleDb(mdmModuleEntity.getId(),mdmModuleDbEntities); - //保存字段 - mdmServiceCache.saveMdmModuleDbFileds(mdmModuleEntity.getId(),mdmModuleDbFiledsEntities); - //保存规则 - mdmServiceCache.saveMdmModuleDbFiledsRule(mdmModuleEntity.getId(),mdmModuleDbFiledsRuleEntities); - //创建或者修改表 - - for (int i = 0; i < mdmModuleDbEntities.size(); i++) { - Map maps = new HashMap<>(); - maps.put("tableName", mdmModuleDbEntities.get(i).getDbName());//表名 - maps.put("tableRemark", mdmModuleDbEntities.get(i).getRemark());//表备注 - List dbFiledsDtos = new ArrayList<>(); - for (int i1 = 0; i1 < mdmModuleDbFiledsEntities.size(); i1++) { - if(mdmModuleDbEntities.get(i).getId().equals(mdmModuleDbFiledsEntities.get(i1).getDbId())){ - dbFiledsDtos.add(new DbFiledsDto(mdmModuleDbFiledsEntities.get(i1).getDataType(), mdmModuleDbFiledsEntities.get(i1).getChName(), mdmModuleDbFiledsEntities.get(i1).getEnName(), mdmModuleDbFiledsEntities.get(i1).getFiledType(), mdmModuleDbFiledsEntities.get(i1).getFiledLength())); - } - } - maps.put("databaseFields", dbFiledsDtos);//字段 - if("1".equals(mdmModuleDbEntities.get(i).getDataType())){ - mdmModuleDao.createTable(maps); - }else { - Map tablename = new HashMap<>(); - tablename.put("tableName", mdmModuleDbEntities.get(i).getDbName());//表名 - tablename.put("tableRemark", mdmModuleDbEntities.get(i).getRemark());//表备注 - mdmModuleDao.alterTableName(tablename); - mdmModuleDao.alterTable(maps); - } - } - return BaseResult.getSuccessMessageEntity("保存数据源成功"); - } - - /** - * @Author lvleigang - * @Description 新建设置默认字段 - * @Date 2:06 下午 2024/6/3 - * @param mdmId - * @param dbId - * @param type - * @return java.util.List - **/ - private List getCreateMdm(String mdmId, String dbId, String type) { - List mdmModuleDbFiledsEntities = new ArrayList<>(); - MdmModuleDbFiledsEntity id = new MdmModuleDbFiledsEntity(); - id.setMdmId(mdmId); - id.setDbId(dbId); - id.setChName("id"); - id.setEnName("id"); - id.setFiledType("3"); - id.setAddType("2"); - id.setUpdateType("2"); - id.setShowType("2"); - id.setQueryType("2"); - id.setListType("2"); - id.setViewType("2"); - id.setFiledLength("50"); - id.setDataType("1"); - mdmModuleDbFiledsEntities.add(id); - - if("1".equals(type)){ - MdmModuleDbFiledsEntity documentRule = new MdmModuleDbFiledsEntity(); - documentRule.setMdmId(mdmId); - documentRule.setDbId(dbId); - documentRule.setChName("document_rule"); - documentRule.setEnName("单据规则"); - documentRule.setFiledType("3"); - documentRule.setAddType("2"); - documentRule.setUpdateType("1"); - documentRule.setShowType("1"); - documentRule.setQueryType("1"); - documentRule.setListType("1"); - documentRule.setViewType("1"); - documentRule.setFiledLength("50"); - documentRule.setDataType("1"); - mdmModuleDbFiledsEntities.add(documentRule); - } - - if("1".equals(type)){ - MdmModuleDbFiledsEntity document_rule_num = new MdmModuleDbFiledsEntity(); - document_rule_num.setMdmId(mdmId); - document_rule_num.setDbId(dbId); - document_rule_num.setChName("document_rule_num"); - document_rule_num.setEnName("单据规则流水号"); - document_rule_num.setFiledType("1"); - document_rule_num.setAddType("2"); - document_rule_num.setUpdateType("2"); - document_rule_num.setShowType("2"); - document_rule_num.setQueryType("2"); - document_rule_num.setListType("2"); - document_rule_num.setViewType("2"); - document_rule_num.setFiledLength("50"); - document_rule_num.setDataType("1"); - mdmModuleDbFiledsEntities.add(document_rule_num); - } - if("2".equals(type) || "3".equals(type) || "4".equals(type) ){ - MdmModuleDbFiledsEntity formmain_id = new MdmModuleDbFiledsEntity(); - formmain_id.setMdmId(mdmId); - formmain_id.setDbId(dbId); - formmain_id.setChName("formmain_id"); - formmain_id.setEnName("主表id"); - formmain_id.setFiledType("3"); - formmain_id.setAddType("2"); - formmain_id.setUpdateType("2"); - formmain_id.setShowType("2"); - formmain_id.setQueryType("2"); - formmain_id.setListType("2"); - formmain_id.setViewType("2"); - formmain_id.setFiledLength("50"); - formmain_id.setDataType("1"); - mdmModuleDbFiledsEntities.add(formmain_id); - } - //写入日志字段:操作人 - if("3".equals(type)){ - MdmModuleDbFiledsEntity source_name = new MdmModuleDbFiledsEntity(); - source_name.setMdmId(mdmId); - source_name.setDbId(dbId); - source_name.setChName("source_name"); - source_name.setEnName("来源名称"); - source_name.setFiledType("3"); - source_name.setAddType("2"); - source_name.setUpdateType("2"); - source_name.setShowType("2"); - source_name.setQueryType("2"); - source_name.setListType("2"); - source_name.setViewType("2"); - source_name.setFiledLength("50"); - source_name.setDataType("1"); - mdmModuleDbFiledsEntities.add(source_name); - - MdmModuleDbFiledsEntity code = new MdmModuleDbFiledsEntity(); - code.setMdmId(mdmId); - code.setDbId(dbId); - code.setChName("code"); - code.setEnName("编码"); - code.setFiledType("3"); - code.setAddType("2"); - code.setUpdateType("2"); - code.setShowType("2"); - code.setQueryType("2"); - code.setListType("2"); - code.setViewType("2"); - code.setFiledLength("50"); - code.setDataType("1"); - mdmModuleDbFiledsEntities.add(code); - - MdmModuleDbFiledsEntity source_data = new MdmModuleDbFiledsEntity(); - source_data.setMdmId(mdmId); - source_data.setDbId(dbId); - source_data.setChName("source_data"); - source_data.setEnName("源数据"); - source_data.setFiledType("3"); - source_data.setAddType("2"); - source_data.setUpdateType("2"); - source_data.setShowType("2"); - source_data.setQueryType("2"); - source_data.setListType("2"); - source_data.setViewType("2"); - source_data.setFiledLength("255"); - source_data.setDataType("1"); - mdmModuleDbFiledsEntities.add(source_data); - - MdmModuleDbFiledsEntity option_type = new MdmModuleDbFiledsEntity(); - option_type.setMdmId(mdmId); - option_type.setDbId(dbId); - option_type.setChName("option_type"); - option_type.setEnName("操作类型"); - option_type.setFiledType("3"); - option_type.setAddType("2"); - option_type.setUpdateType("2"); - option_type.setShowType("2"); - option_type.setQueryType("2"); - option_type.setListType("2"); - option_type.setViewType("2"); - option_type.setFiledLength("255"); - option_type.setDataType("1"); - mdmModuleDbFiledsEntities.add(option_type); - - MdmModuleDbFiledsEntity option_Name = new MdmModuleDbFiledsEntity(); - option_Name.setMdmId(mdmId); - option_Name.setDbId(dbId); - option_Name.setChName("option_name"); - option_Name.setEnName("操作人"); - option_Name.setFiledType("3"); - option_Name.setAddType("2"); - option_Name.setUpdateType("2"); - option_Name.setShowType("2"); - option_Name.setQueryType("2"); - option_Name.setListType("2"); - option_Name.setViewType("2"); - option_Name.setFiledLength("255"); - option_Name.setDataType("1"); - mdmModuleDbFiledsEntities.add(option_Name); - } - - //目标应用、目标api、 - if("4".equals(type)){ - MdmModuleDbFiledsEntity target_app = new MdmModuleDbFiledsEntity(); - target_app.setMdmId(mdmId); - target_app.setDbId(dbId); - target_app.setChName("target_app"); - target_app.setEnName("目标应用"); - target_app.setFiledType("1"); - target_app.setAddType("2"); - target_app.setUpdateType("2"); - target_app.setShowType("2"); - target_app.setQueryType("2"); - target_app.setListType("2"); - target_app.setViewType("2"); - target_app.setFiledLength("50"); - target_app.setDataType("1"); - mdmModuleDbFiledsEntities.add(target_app); - - MdmModuleDbFiledsEntity target_api = new MdmModuleDbFiledsEntity(); - target_api.setMdmId(mdmId); - target_api.setDbId(dbId); - target_api.setChName("target_api"); - target_api.setEnName("目标api"); - target_api.setFiledType("1"); - target_api.setAddType("2"); - target_api.setUpdateType("2"); - target_api.setShowType("2"); - target_api.setQueryType("2"); - target_api.setListType("2"); - target_api.setViewType("2"); - target_api.setFiledLength("50"); - target_api.setDataType("1"); - mdmModuleDbFiledsEntities.add(target_api); - - MdmModuleDbFiledsEntity source_data = new MdmModuleDbFiledsEntity(); - source_data.setMdmId(mdmId); - source_data.setDbId(dbId); - source_data.setChName("source_data"); - source_data.setEnName("源数据"); - source_data.setFiledType("3"); - source_data.setAddType("2"); - source_data.setUpdateType("2"); - source_data.setShowType("2"); - source_data.setQueryType("2"); - source_data.setListType("2"); - source_data.setViewType("2"); - source_data.setFiledLength("255"); - source_data.setDataType("1"); - mdmModuleDbFiledsEntities.add(source_data); - - MdmModuleDbFiledsEntity option_type = new MdmModuleDbFiledsEntity(); - option_type.setMdmId(mdmId); - option_type.setDbId(dbId); - option_type.setChName("option_type"); - option_type.setEnName("操作类型"); - option_type.setFiledType("3"); - option_type.setAddType("2"); - option_type.setUpdateType("2"); - option_type.setShowType("2"); - option_type.setQueryType("2"); - option_type.setListType("2"); - option_type.setViewType("2"); - option_type.setFiledLength("255"); - option_type.setDataType("1"); - mdmModuleDbFiledsEntities.add(option_type); - } - if("2".equals(type) || "1".equals(type) ) { - MdmModuleDbFiledsEntity data_status = new MdmModuleDbFiledsEntity(); - data_status.setMdmId(mdmId); - data_status.setDbId(dbId); - data_status.setChName("data_status"); - data_status.setEnName("数据状态 Y正常 N删除 F修改"); - data_status.setFiledType("3"); - data_status.setAddType("2"); - data_status.setUpdateType("2"); - data_status.setShowType("2"); - data_status.setQueryType("2"); - data_status.setListType("2"); - data_status.setViewType("2"); - data_status.setFiledLength("1"); - data_status.setDataType("1"); - mdmModuleDbFiledsEntities.add(data_status); - } - if("1".equals(type)){ - MdmModuleDbFiledsEntity add_status = new MdmModuleDbFiledsEntity(); - add_status.setMdmId(mdmId); - add_status.setDbId(dbId); - add_status.setChName("add_status"); - add_status.setEnName("新增数据状态 0待下发 1已下发"); - add_status.setFiledType("3"); - add_status.setAddType("2"); - add_status.setUpdateType("2"); - add_status.setShowType("2"); - add_status.setQueryType("2"); - add_status.setListType("2"); - add_status.setViewType("2"); - add_status.setFiledLength("1"); - add_status.setDataType("1"); - mdmModuleDbFiledsEntities.add(add_status); - } - if("1".equals(type)){ - MdmModuleDbFiledsEntity update_status = new MdmModuleDbFiledsEntity(); - update_status.setMdmId(mdmId); - update_status.setDbId(dbId); - update_status.setChName("update_status"); - update_status.setEnName("修改数据状态 0待下发 1已下发"); - update_status.setFiledType("3"); - update_status.setAddType("2"); - update_status.setUpdateType("2"); - update_status.setShowType("2"); - update_status.setQueryType("2"); - update_status.setListType("2"); - update_status.setViewType("2"); - update_status.setFiledLength("1"); - update_status.setDataType("1"); - mdmModuleDbFiledsEntities.add(update_status); - } - - if("1".equals(type)){ - MdmModuleDbFiledsEntity delete_status = new MdmModuleDbFiledsEntity(); - delete_status.setMdmId(mdmId); - delete_status.setDbId(dbId); - delete_status.setChName("delete_status"); - delete_status.setEnName("删除数据状态 0待下发 1已下发"); - delete_status.setFiledType("3"); - delete_status.setAddType("2"); - delete_status.setUpdateType("2"); - delete_status.setShowType("2"); - delete_status.setQueryType("2"); - delete_status.setListType("2"); - delete_status.setViewType("2"); - delete_status.setFiledLength("1"); - delete_status.setDataType("1"); - mdmModuleDbFiledsEntities.add(delete_status); - } - - MdmModuleDbFiledsEntity sorts = new MdmModuleDbFiledsEntity(); - sorts.setMdmId(mdmId); - sorts.setDbId(dbId); - sorts.setChName("sorts"); - sorts.setEnName("排序"); - sorts.setFiledType("1"); - sorts.setAddType("2"); - sorts.setUpdateType("2"); - sorts.setShowType("2"); - sorts.setQueryType("2"); - sorts.setListType("2"); - sorts.setViewType("2"); - sorts.setFiledLength("20"); - sorts.setDataType("1"); - mdmModuleDbFiledsEntities.add(sorts); - MdmModuleDbFiledsEntity create_user_id = new MdmModuleDbFiledsEntity(); - create_user_id.setMdmId(mdmId); - create_user_id.setDbId(dbId); - create_user_id.setChName("create_user_id"); - create_user_id.setEnName("创建人id"); - create_user_id.setFiledType("3"); - create_user_id.setAddType("2"); - create_user_id.setUpdateType("2"); - create_user_id.setShowType("2"); - create_user_id.setQueryType("2"); - create_user_id.setListType("2"); - create_user_id.setViewType("2"); - create_user_id.setFiledLength("50"); - create_user_id.setDataType("1"); - mdmModuleDbFiledsEntities.add(create_user_id); - MdmModuleDbFiledsEntity create_time = new MdmModuleDbFiledsEntity(); - create_time.setMdmId(mdmId); - create_time.setDbId(dbId); - create_time.setChName("create_time"); - create_time.setEnName("创建时间"); - create_time.setFiledType("4"); - create_time.setAddType("2"); - create_time.setUpdateType("2"); - create_time.setShowType("2"); - create_time.setQueryType("2"); - create_time.setListType("2"); - create_time.setViewType("2"); - create_time.setFiledLength("50"); - create_time.setDataType("1"); - mdmModuleDbFiledsEntities.add(create_time); - MdmModuleDbFiledsEntity modify_user_id = new MdmModuleDbFiledsEntity(); - modify_user_id.setMdmId(mdmId); - modify_user_id.setDbId(dbId); - modify_user_id.setChName("modify_user_id"); - modify_user_id.setEnName("修改人id"); - modify_user_id.setFiledType("3"); - modify_user_id.setAddType("2"); - modify_user_id.setUpdateType("2"); - modify_user_id.setShowType("2"); - modify_user_id.setQueryType("2"); - modify_user_id.setListType("2"); - modify_user_id.setViewType("2"); - modify_user_id.setFiledLength("50"); - modify_user_id.setDataType("1"); - mdmModuleDbFiledsEntities.add(modify_user_id); - MdmModuleDbFiledsEntity modify_time = new MdmModuleDbFiledsEntity(); - modify_time.setMdmId(mdmId); - modify_time.setDbId(dbId); - modify_time.setChName("modify_time"); - modify_time.setEnName("修改时间"); - modify_time.setFiledType("4"); - modify_time.setAddType("2"); - modify_time.setUpdateType("2"); - modify_time.setShowType("2"); - modify_time.setQueryType("2"); - modify_time.setListType("2"); - modify_time.setViewType("2"); - modify_time.setFiledLength("50"); - modify_time.setDataType("1"); - mdmModuleDbFiledsEntities.add(modify_time); - MdmModuleDbFiledsEntity sts = new MdmModuleDbFiledsEntity(); - sts.setMdmId(mdmId); - sts.setDbId(dbId); - sts.setChName("sts"); - sts.setEnName("状态(Y正常N删除)"); - sts.setFiledType("3"); - sts.setAddType("2"); - sts.setUpdateType("2"); - sts.setShowType("2"); - sts.setQueryType("2"); - sts.setListType("2"); - sts.setViewType("2"); - sts.setFiledLength("1"); - sts.setDataType("1"); - mdmModuleDbFiledsEntities.add(sts); - MdmModuleDbFiledsEntity org_id = new MdmModuleDbFiledsEntity(); - org_id.setMdmId(mdmId); - org_id.setDbId(dbId); - org_id.setChName("org_id"); - org_id.setEnName("组织机构ID"); - org_id.setFiledType("3"); - org_id.setAddType("2"); - org_id.setUpdateType("2"); - org_id.setShowType("2"); - org_id.setQueryType("2"); - org_id.setListType("2"); - org_id.setViewType("2"); - org_id.setFiledLength("50"); - org_id.setDataType("1"); - mdmModuleDbFiledsEntities.add(org_id); - MdmModuleDbFiledsEntity company_id = new MdmModuleDbFiledsEntity(); - company_id.setMdmId(mdmId); - company_id.setDbId(dbId); - company_id.setChName("company_id"); - company_id.setEnName("公司id"); - company_id.setFiledType("3"); - company_id.setAddType("2"); - company_id.setUpdateType("2"); - company_id.setShowType("2"); - company_id.setQueryType("2"); - company_id.setListType("2"); - company_id.setViewType("2"); - company_id.setFiledLength("50"); - company_id.setDataType("1"); - mdmModuleDbFiledsEntities.add(company_id); - return mdmModuleDbFiledsEntities; - } - - - /** - * @param object - * @return com.hzya.frame.web.entity.JsonResultEntity - * @Author lvleigang - * @Description 主数据设置查询显示信息 - * @Date 9:40 上午 2023/10/18 - **/ - @Override - public JsonResultEntity queryMdmModuleView(JSONObject object) { - MdmModuleEntity entity = getData("jsonStr", object, MdmModuleEntity.class); - //判断分页 - if (entity == null) { - return BaseResult.getFailureMessageEntity("系统错误"); - } - if (entity.getMdmCode() == null || "".equals(entity.getMdmCode())) { - return BaseResult.getFailureMessageEntity("系统错误"); - } - MdmModuleViewVo mdmModuleViewVo = new MdmModuleViewVo(); - - MdmModuleEntity mdmModuleEntity = mdmServiceCache.getMdmModuleEntity(entity.getMdmCode()); - //查询数据库字段 - MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); - mdmModuleDbEntity.setMdmId(mdmModuleEntity.getId()); - mdmModuleDbEntity.setSts("Y"); - List mdmModuleDbEntities = mdmServiceCache.queryMdmModuleDb(mdmModuleDbEntity); - MdmModuleDbFiledsEntity mdmModuleDbFiledsEntity = new MdmModuleDbFiledsEntity(); - mdmModuleDbFiledsEntity.setMdmId(mdmModuleEntity.getId()); - mdmModuleDbFiledsEntity.setSts("Y"); - List mdmModuleDbFiledsEntities = mdmServiceCache.queryMdmModuleDbFileds(mdmModuleDbFiledsEntity); - - //设置数据库字段 - setFiledType(mdmModuleViewVo,mdmModuleDbEntities,mdmModuleDbFiledsEntities); - - MdmModuleViewDetailEntity mdmModuleViewDetailEntity = new MdmModuleViewDetailEntity(); - mdmModuleViewDetailEntity.setMdmId(mdmModuleEntity.getId()); - mdmModuleViewDetailEntity.setSts("Y"); - List mdmModuleViewDetailEntities = mdmServiceCache.queryMdmModuleViewDetail(mdmModuleViewDetailEntity); - setDbFiledType(mdmModuleViewVo,mdmModuleViewDetailEntities); - MdmModuleViewEntity mdmModuleViewEntity = new MdmModuleViewEntity(); - mdmModuleViewEntity.setMdmId(mdmModuleEntity.getId()); - mdmModuleViewEntity.setSts("Y"); - List moduleViewEntities = mdmServiceCache.queryMdmModuleView(mdmModuleViewEntity); - if(moduleViewEntities != null && moduleViewEntities.size() == 1){ - mdmModuleViewVo.setMdmModuleViewEntity(moduleViewEntities.get(0)); - } - MdmModuleViewButtonEntity mdmModuleViewButtonEntity = new MdmModuleViewButtonEntity(); - mdmModuleViewButtonEntity.setMdmId(mdmModuleEntity.getId()); - mdmModuleViewButtonEntity.setSts("Y"); - List mdmModuleViewButtonEntities = mdmServiceCache.queryMdmModuleViewButton(mdmModuleViewButtonEntity); - mdmModuleViewVo.setDbButtonFiled(mdmModuleViewButtonEntities); - return BaseResult.getSuccessMessageEntity("查询视图成功", mdmModuleViewVo); - } - - private void setDbFiledType(MdmModuleViewVo mdmModuleViewVo, List mdmModuleViewDetailEntityList) { - //新增 - List addFiled = new ArrayList<>(); - //修改 - List editFiled = new ArrayList<>(); - //查看 - List showFiled = new ArrayList<>(); - //查询 - List queryFiled = new ArrayList<>(); - //列表 - List listFiled = new ArrayList<>(); - if (mdmModuleViewDetailEntityList != null && mdmModuleViewDetailEntityList.size() > 0) { - for (int i = 0; i < mdmModuleViewDetailEntityList.size(); i++) { - switch (mdmModuleViewDetailEntityList.get(i).getViewType()) { - //1、查询2、列表3、新增4、修改 5、查看 - case "1": - queryFiled.add(mdmModuleViewDetailEntityList.get(i)); - break; - case "2": - listFiled.add(mdmModuleViewDetailEntityList.get(i)); - break; - case "3": - addFiled.add(mdmModuleViewDetailEntityList.get(i)); - break; - case "4": - editFiled.add(mdmModuleViewDetailEntityList.get(i)); - break; - case "5": - showFiled.add(mdmModuleViewDetailEntityList.get(i)); - break; - default: - } - } - } - mdmModuleViewVo.setDbAddFiled(addFiled); - mdmModuleViewVo.setDbEditFiled(editFiled); - mdmModuleViewVo.setDbShowFiled(showFiled); - mdmModuleViewVo.setDbQueryFiled(queryFiled); - mdmModuleViewVo.setDbListFiled(listFiled); - } - - /** - * @param mdmModuleViewVo - * @param mdmModuleDbEntityList - * @param mdmModuleDbFiledsEntityList - * @return void - * @Author lvleigang - * @Description 设置对应的字段类型 - * @Date 2023/10/25 - **/ - private void setFiledType(MdmModuleViewVo mdmModuleViewVo, List mdmModuleDbEntityList, List mdmModuleDbFiledsEntityList) { - //新增 - List addFiled = new ArrayList<>(); - //修改 - List editFiled = new ArrayList<>(); - //查看 - List showFiled = new ArrayList<>(); - //查询 - List queryFiled = new ArrayList<>(); - //列表 - List listFiled = new ArrayList<>(); - if (mdmModuleDbEntityList != null && mdmModuleDbEntityList.size() > 0) { - for (int i = 0; i < mdmModuleDbEntityList.size(); i++) { - - if (mdmModuleDbFiledsEntityList != null && mdmModuleDbFiledsEntityList.size() > 0) { - for (int i1 = 0; i1 < mdmModuleDbFiledsEntityList.size(); i1++) { - if (mdmModuleDbEntityList.get(i).getId().equals(mdmModuleDbFiledsEntityList.get(i1).getDbId())) { - if("1".equals(mdmModuleDbFiledsEntityList.get(i1).getViewType())){ - if ("1".equals(mdmModuleDbEntityList.get(i).getDbType())) { - //1、主表 - if ("1".equals(mdmModuleDbFiledsEntityList.get(i1).getAddType())) { - addFiled.add(new MdmDbFiledVo(mdmModuleDbFiledsEntityList.get(i1).getId(), "【主表:" + mdmModuleDbEntityList.get(i).getDbName() + "】" + mdmModuleDbFiledsEntityList.get(i1).getChName())); - } - if ("1".equals(mdmModuleDbFiledsEntityList.get(i1).getUpdateType())) { - editFiled.add(new MdmDbFiledVo(mdmModuleDbFiledsEntityList.get(i1).getId(), "【主表:" + mdmModuleDbEntityList.get(i).getDbName() + "】" + mdmModuleDbFiledsEntityList.get(i1).getChName())); - } - if ("1".equals(mdmModuleDbFiledsEntityList.get(i1).getShowType())) { - showFiled.add(new MdmDbFiledVo(mdmModuleDbFiledsEntityList.get(i1).getId(), "【主表:" + mdmModuleDbEntityList.get(i).getDbName() + "】" + mdmModuleDbFiledsEntityList.get(i1).getChName())); - } - if ("1".equals(mdmModuleDbFiledsEntityList.get(i1).getQueryType())) { - queryFiled.add(new MdmDbFiledVo(mdmModuleDbFiledsEntityList.get(i1).getId(), "【主表:" + mdmModuleDbEntityList.get(i).getDbName() + "】" + mdmModuleDbFiledsEntityList.get(i1).getChName())); - } - if ("1".equals(mdmModuleDbFiledsEntityList.get(i1).getListType())) { - listFiled.add(new MdmDbFiledVo(mdmModuleDbFiledsEntityList.get(i1).getId(), "【主表:" + mdmModuleDbEntityList.get(i).getDbName() + "】" + mdmModuleDbFiledsEntityList.get(i1).getChName())); - } - } else if ("2".equals(mdmModuleDbEntityList.get(i).getDbType())){ - //2、明细 - if ("1".equals(mdmModuleDbFiledsEntityList.get(i1).getAddType())) { - addFiled.add(new MdmDbFiledVo(mdmModuleDbFiledsEntityList.get(i1).getId(), "【子表:" + mdmModuleDbEntityList.get(i).getDbName() + "】" + mdmModuleDbFiledsEntityList.get(i1).getChName())); - } - if ("1".equals(mdmModuleDbFiledsEntityList.get(i1).getUpdateType())) { - editFiled.add(new MdmDbFiledVo(mdmModuleDbFiledsEntityList.get(i1).getId(), "【子表:" + mdmModuleDbEntityList.get(i).getDbName() + "】" + mdmModuleDbFiledsEntityList.get(i1).getChName())); - } - if ("1".equals(mdmModuleDbFiledsEntityList.get(i1).getShowType())) { - showFiled.add(new MdmDbFiledVo(mdmModuleDbFiledsEntityList.get(i1).getId(), "【子表:" + mdmModuleDbEntityList.get(i).getDbName() + "】" + mdmModuleDbFiledsEntityList.get(i1).getChName())); - } - if ("1".equals(mdmModuleDbFiledsEntityList.get(i1).getQueryType())) { - queryFiled.add(new MdmDbFiledVo(mdmModuleDbFiledsEntityList.get(i1).getId(), "【子表:" + mdmModuleDbEntityList.get(i).getDbName() + "】" + mdmModuleDbFiledsEntityList.get(i1).getChName())); - } - if ("1".equals(mdmModuleDbFiledsEntityList.get(i1).getListType())) { - listFiled.add(new MdmDbFiledVo(mdmModuleDbFiledsEntityList.get(i1).getId(), "【子表:" + mdmModuleDbEntityList.get(i).getDbName() + "】" + mdmModuleDbFiledsEntityList.get(i1).getChName())); - } - } - } - } - } - } - } - } - mdmModuleViewVo.setAddFiled(addFiled); - mdmModuleViewVo.setEditFiled(editFiled); - mdmModuleViewVo.setShowFiled(showFiled); - mdmModuleViewVo.setQueryFiled(queryFiled); - mdmModuleViewVo.setListFiled(listFiled); - } - /** - * @param object - * @return com.hzya.frame.web.entity.JsonResultEntity - * @Author lvleigang - * @Description 主数据设置修改显示信息 - * @Date 9:40 上午 2023/10/18 - **/ - @Override - public JsonResultEntity doSaveMdmModuleView(JSONObject object) { - MdmModuleViewDto entity = getData("jsonStr", object, MdmModuleViewDto.class); - //判断是否有数据 - if (entity == null) { - return BaseResult.getFailureMessageEntity("参数不允许为空"); - } - if (entity.getMdmCode() == null || "".equals(entity.getMdmCode())) { - return BaseResult.getFailureMessageEntity("系统错误"); - } - if (entity.getMdmModuleViewEntity() == null) { - return BaseResult.getFailureMessageEntity("参数不允许为空"); - } - MdmModuleEntity mdmModuleEntity = mdmServiceCache.getMdmModuleEntity(entity.getMdmCode()); - - //保存视图 - MdmModuleViewEntity mdmModuleViewEntity = entity.getMdmModuleViewEntity(); - mdmModuleViewEntity.setMdmId(mdmModuleEntity.getId()); - if(mdmModuleViewEntity.getId() != null && !"".equals(mdmModuleViewEntity.getId())){ - mdmModuleViewEntity.setDataType("2"); - mdmModuleViewEntity.setUpdate(); - mdmServiceCache.saveMdmModuleView(mdmModuleEntity.getId(),mdmModuleViewEntity); - }else { - mdmModuleViewEntity.setDataType("1"); - mdmModuleViewEntity.setCreate(); - mdmModuleViewDao.save(mdmModuleViewEntity); - } - //保存字段 - List mdmModuleViewDetailEntities = new ArrayList<>(); - //1、查询2、列表3、新增4、修改 5、查看 - saveDbViewFiled(mdmModuleEntity.getId(),mdmModuleViewEntity.getId(),entity.getQueryFiled(),"1",mdmModuleViewDetailEntities); - saveDbViewFiled(mdmModuleEntity.getId(),mdmModuleViewEntity.getId(),entity.getListFiled(),"2",mdmModuleViewDetailEntities); - saveDbViewFiled(mdmModuleEntity.getId(),mdmModuleViewEntity.getId(),entity.getAddFiled(),"3",mdmModuleViewDetailEntities); - saveDbViewFiled(mdmModuleEntity.getId(),mdmModuleViewEntity.getId(),entity.getEditFiled(),"4",mdmModuleViewDetailEntities); - saveDbViewFiled(mdmModuleEntity.getId(),mdmModuleViewEntity.getId(),entity.getShowFiled(),"5",mdmModuleViewDetailEntities); - mdmServiceCache.saveMdmModuleViewDetail(mdmModuleEntity.getId(),mdmModuleViewDetailEntities); - //保存按钮 - List mdmModuleViewButtonEntities = entity.getDbButtonFiled(); - if(mdmModuleViewButtonEntities != null && mdmModuleViewButtonEntities.size() > 0){ - for (int i = 0; i < mdmModuleViewButtonEntities.size(); i++) { - mdmModuleViewButtonEntities.get(i).setMdmId(mdmModuleEntity.getId()); - mdmModuleViewButtonEntities.get(i).setViewId(mdmModuleViewEntity.getId()); - if(mdmModuleViewButtonEntities.get(i).getId() != null && !"".equals(mdmModuleViewButtonEntities.get(i).getId())){ - mdmModuleViewButtonEntities.get(i).setDataType("2"); - mdmModuleViewButtonEntities.get(i).setUpdate(); - }else { - mdmModuleViewButtonEntities.get(i).setDataType("1"); - mdmModuleViewButtonEntities.get(i).setCreate(); - } - } - mdmServiceCache.saveMdmModuleViewButton(mdmModuleEntity.getId(),mdmModuleViewButtonEntities); - } - - //保存菜单 - //保存按钮 - - if("1".equals(mdmModuleViewEntity.getDataType())){ - //新增 - SysMenuConfigEntity module = new SysMenuConfigEntity(); - module.setCreate(); - module.setFormId(mdmModuleEntity.getId()); - if("1".equals(mdmModuleEntity.getMdmType())){ - //1、档案 - module.setParentMenuId("ea22757e99c144fb9ef381dd322e233c"); - }else { - //2、单据 - module.setParentMenuId("58714ddb7ec94f5da91df74efada042f"); - } - module.setMenuName(mdmModuleEntity.getMdmName()); - module.setMenuEnglishName("integrationOptionAdmin" + mdmModuleEntity.getMdmCode()); - module.setMenuIcon(null);//模块图标 - module.setRoute("integrationOptionAdmin/" + mdmModuleEntity.getMdmCode());//路由地址 - module.setMenuPage("integrationOptionV2/index");//一级Layout 二级 ParntView 三级component - module.setRemark("主数据生成菜单"); - module.setVisibles("0"); - module.setShowType("1"); - JSONObject object1 = new JSONObject(); - object1.put("mdmId", mdmModuleEntity.getId());//主数据id - object1.put("mdmCode", mdmModuleEntity.getMdmCode());//主数据编码 - object1.put("viewType", mdmModuleViewEntity.getViewName());//1、树 2、列表 - module.setOptions(object1.toString());//菜单mate参数 - sysMenuConfigDao.save(module); - if(mdmModuleViewButtonEntities != null && mdmModuleViewButtonEntities.size() > 0){ - for (int i = 0; i < mdmModuleViewButtonEntities.size(); i++) { - if("new".equals(mdmModuleViewButtonEntities.get(i).getButtonValue())){ - SysButtonConfigEntity xz = new SysButtonConfigEntity(); - xz.setCode("new"); - xz.setNameCh("新建"); - xz.setNameEn("new"); - xz.setMenuId(module.getId()); - xz.setIconName(""); - xz.setStyles(""); - xz.setBtnFunction("new"); - xz.setRemark("主数据新建按钮"); - xz.setCreate(); - sysButtonConfigDao.save(xz); - } - if("resize".equals(mdmModuleViewButtonEntities.get(i).getButtonValue())){ - - SysButtonConfigEntity cz = new SysButtonConfigEntity(); - cz.setCode("resize"); - cz.setNameCh("重置"); - cz.setNameEn("resize"); - cz.setMenuId(module.getId()); - cz.setIconName(""); - cz.setStyles(""); - cz.setBtnFunction("resize"); - cz.setRemark("主数据重置按钮"); - cz.setCreate(); - sysButtonConfigDao.save(cz); - } - if("search".equals(mdmModuleViewButtonEntities.get(i).getButtonValue())) { - - SysButtonConfigEntity cx = new SysButtonConfigEntity(); - cx.setCode("search"); - cx.setNameCh("查询"); - cx.setNameEn("search"); - cx.setMenuId(module.getId()); - cx.setIconName(""); - cx.setStyles(""); - cx.setBtnFunction("search"); - cx.setRemark("主数据查询按钮"); - cx.setCreate(); - sysButtonConfigDao.save(cx); - } - if("edit".equals(mdmModuleViewButtonEntities.get(i).getButtonValue())) { - - SysButtonConfigEntity xg = new SysButtonConfigEntity(); - xg.setCode("edit"); - xg.setNameCh("修改"); - xg.setNameEn("edit"); - xg.setMenuId(module.getId()); - xg.setIconName(""); - xg.setStyles(""); - xg.setBtnFunction("edit"); - xg.setRemark("主数据修改按钮"); - xg.setCreate(); - sysButtonConfigDao.save(xg); - } - if("dele".equals(mdmModuleViewButtonEntities.get(i).getButtonValue())) { - - SysButtonConfigEntity sc = new SysButtonConfigEntity(); - sc.setCode("dele"); - sc.setNameCh("删除"); - sc.setNameEn("dele"); - sc.setMenuId(module.getId()); - sc.setIconName(""); - sc.setStyles(""); - sc.setBtnFunction("dele"); - sc.setRemark("主数据删除按钮"); - sc.setCreate(); - sysButtonConfigDao.save(sc); - } - if("view".equals(mdmModuleViewButtonEntities.get(i).getButtonValue())) { - - SysButtonConfigEntity ck = new SysButtonConfigEntity(); - ck.setCode("view"); - ck.setNameCh("查看"); - ck.setNameEn("view"); - ck.setMenuId(module.getId()); - ck.setIconName(""); - ck.setStyles(""); - ck.setBtnFunction("view"); - ck.setRemark("主数据查看按钮"); - ck.setCreate(); - sysButtonConfigDao.save(ck); - } - if("send".equals(mdmModuleViewButtonEntities.get(i).getButtonValue())) { - SysButtonConfigEntity xf = new SysButtonConfigEntity(); - xf.setCode("send"); - xf.setNameCh("下发"); - xf.setNameEn("send"); - xf.setMenuId(module.getId()); - xf.setIconName(""); - xf.setStyles(""); - xf.setBtnFunction("send"); - xf.setRemark("主数据下发按钮"); - xf.setCreate(); - sysButtonConfigDao.save(xf); - } - } - } - }else { - //修改 - //修改菜单 注意因为可能修改显示类型,所以需要修改菜单的属性 - SysMenuConfigEntity module = new SysMenuConfigEntity(); - module.setFormId(mdmModuleEntity.getId()); - module.setSts("Y"); - List moduleList = sysMenuConfigDao.queryBase(module); - if (moduleList != null && moduleList.size() == 1) { - module = moduleList.get(0); - module.setUpdate(); - module.setMenuName(mdmModuleEntity.getMdmName()); - JSONObject object1 = new JSONObject(); - object1.put("mdmId", mdmModuleEntity.getId());//主数据id - object1.put("mdmCode", mdmModuleEntity.getMdmCode());//主数据id - object1.put("viewType", mdmModuleViewEntity.getViewName());//1、树 2、列表 - module.setOptions(object1.toString());//菜单mate参数 - sysMenuConfigDao.update(module); - //修改按钮 - //1、查询所有按钮 - SysButtonConfigEntity buttonConfigEntity = new SysButtonConfigEntity(); - buttonConfigEntity.setMenuId(module.getId()); - buttonConfigEntity.setSts("Y"); - List sysButtonConfigEntities = sysButtonConfigDao.queryBase(buttonConfigEntity); - //1、查询按钮权限 - SysPopedomOperateEntity sysPopedomOperateEntity = new SysPopedomOperateEntity(); - sysPopedomOperateEntity.setMenuId(module.getId()); - sysPopedomOperateEntity.setSts("Y"); - List sysPopedomOperateEntities = sysPopedomOperateDao.queryBase(sysPopedomOperateEntity); - //删除按钮和删除按钮权限 - sysButtonConfigDao.logicRemoveMultiCondition(buttonConfigEntity); - sysPopedomOperateDao.logicRemoveMultiCondition(sysPopedomOperateEntity); - //删除处理权限 - doMdmModuleButton(module,mdmModuleViewButtonEntities,sysButtonConfigEntities,sysPopedomOperateEntities); - } - } - return BaseResult.getSuccessMessageEntity("保存显示信息成功"); - } - - /** - * @Author lvleigang - * @Description - * @Date 3:29 下午 2024/6/4 - * @param module 菜单 - * @param mdmModuleViewButtonEntities 主数据按钮 - * @param sysButtonConfigEntities 菜单按钮 - * @param sysPopedomOperateEntities 按钮权限 - * @return void - **/ - private void doMdmModuleButton(SysMenuConfigEntity module,List mdmModuleViewButtonEntities, List sysButtonConfigEntities, List sysPopedomOperateEntities) { - //循环设置的按钮,再循环菜单的按钮,如果有把原先的修改状态,如果没有新增 - if(mdmModuleViewButtonEntities != null && mdmModuleViewButtonEntities.size() > 0){ - for (int i = 0; i < mdmModuleViewButtonEntities.size(); i++) { - boolean flag = false; - if(sysButtonConfigEntities != null && sysButtonConfigEntities.size() > 0){ - for (int i1 = 0; i1 < sysButtonConfigEntities.size(); i1++) { - if(mdmModuleViewButtonEntities.get(i).getButtonValue().equals(sysButtonConfigEntities.get(i1).getCode())){ - flag = true; - sysButtonConfigEntities.get(i1).setSts("Y"); - sysButtonConfigEntities.get(i1).setUpdate(); - sysButtonConfigDao.update(sysButtonConfigEntities.get(i1)); - if(sysPopedomOperateEntities != null && sysPopedomOperateEntities.size() > 0){ - for (int i2 = 0; i2 < sysPopedomOperateEntities.size(); i2++) { - if(sysPopedomOperateEntities.get(i2).getOperate().equals(sysButtonConfigEntities.get(i1).getId())){ - sysPopedomOperateEntities.get(i2).setSts("Y"); - sysPopedomOperateEntities.get(i2).setUpdate(); - sysPopedomOperateDao.update(sysPopedomOperateEntities.get(i2)); - } - } - } - break; - } - } - } - //原先没有需要新增 - if(!flag){ - if("new".equals(mdmModuleViewButtonEntities.get(i).getButtonValue())){ - SysButtonConfigEntity xz = new SysButtonConfigEntity(); - xz.setCode("new"); - xz.setNameCh("新建"); - xz.setNameEn("new"); - xz.setMenuId(module.getId()); - xz.setIconName(""); - xz.setStyles(""); - xz.setBtnFunction("new"); - xz.setRemark("主数据新建按钮"); - xz.setCreate(); - sysButtonConfigDao.save(xz); - } - if("resize".equals(mdmModuleViewButtonEntities.get(i).getButtonValue())){ - - SysButtonConfigEntity cz = new SysButtonConfigEntity(); - cz.setCode("resize"); - cz.setNameCh("重置"); - cz.setNameEn("resize"); - cz.setMenuId(module.getId()); - cz.setIconName(""); - cz.setStyles(""); - cz.setBtnFunction("resize"); - cz.setRemark("主数据重置按钮"); - cz.setCreate(); - sysButtonConfigDao.save(cz); - } - if("search".equals(mdmModuleViewButtonEntities.get(i).getButtonValue())) { - - SysButtonConfigEntity cx = new SysButtonConfigEntity(); - cx.setCode("search"); - cx.setNameCh("查询"); - cx.setNameEn("search"); - cx.setMenuId(module.getId()); - cx.setIconName(""); - cx.setStyles(""); - cx.setBtnFunction("search"); - cx.setRemark("主数据查询按钮"); - cx.setCreate(); - sysButtonConfigDao.save(cx); - } - if("edit".equals(mdmModuleViewButtonEntities.get(i).getButtonValue())) { - - SysButtonConfigEntity xg = new SysButtonConfigEntity(); - xg.setCode("edit"); - xg.setNameCh("修改"); - xg.setNameEn("edit"); - xg.setMenuId(module.getId()); - xg.setIconName(""); - xg.setStyles(""); - xg.setBtnFunction("edit"); - xg.setRemark("主数据修改按钮"); - xg.setCreate(); - sysButtonConfigDao.save(xg); - } - if("dele".equals(mdmModuleViewButtonEntities.get(i).getButtonValue())) { - - SysButtonConfigEntity sc = new SysButtonConfigEntity(); - sc.setCode("dele"); - sc.setNameCh("删除"); - sc.setNameEn("dele"); - sc.setMenuId(module.getId()); - sc.setIconName(""); - sc.setStyles(""); - sc.setBtnFunction("dele"); - sc.setRemark("主数据删除按钮"); - sc.setCreate(); - sysButtonConfigDao.save(sc); - } - if("view".equals(mdmModuleViewButtonEntities.get(i).getButtonValue())) { - - SysButtonConfigEntity ck = new SysButtonConfigEntity(); - ck.setCode("view"); - ck.setNameCh("查看"); - ck.setNameEn("view"); - ck.setMenuId(module.getId()); - ck.setIconName(""); - ck.setStyles(""); - ck.setBtnFunction("view"); - ck.setRemark("主数据查看按钮"); - ck.setCreate(); - sysButtonConfigDao.save(ck); - } - if("send".equals(mdmModuleViewButtonEntities.get(i).getButtonValue())) { - SysButtonConfigEntity xf = new SysButtonConfigEntity(); - xf.setCode("send"); - xf.setNameCh("下发"); - xf.setNameEn("send"); - xf.setMenuId(module.getId()); - xf.setIconName(""); - xf.setStyles(""); - xf.setBtnFunction("send"); - xf.setRemark("主数据下发按钮"); - xf.setCreate(); - sysButtonConfigDao.save(xf); - } - - - } - } - } - } - - /** - * @param object - * @return com.hzya.frame.web.entity.JsonResultEntity - * @Author lvleigang - * @Description 主数据设置查询分发设置 - * @Date 9:40 上午 2023/10/18 - **/ - @Override - public JsonResultEntity queryMdmModuleDistribute(JSONObject object) { - MdmDto entity = getData("jsonStr", object, MdmDto.class); - if (entity == null) { - return BaseResult.getFailureMessageEntity("参数不允许为空"); - } - if (entity.getMdmCode() == null || "".equals(entity.getMdmCode())) { - return BaseResult.getFailureMessageEntity("系统错误"); - } - MdmModuleEntity mdmModuleEntity = mdmServiceCache.getMdmModuleEntity(entity.getMdmCode()); - if(mdmModuleEntity == null || mdmModuleEntity.getId() == null){ - return BaseResult.getFailureMessageEntity("系统错误"); - } - //查询模块下的应用列表 - MdmModuleDistributeEntity mdmModuleDistributeEntity = new MdmModuleDistributeEntity(); - mdmModuleDistributeEntity.setSts("Y"); - mdmModuleDistributeEntity.setMdmId(mdmModuleEntity.getId()); - List mdmModuleDistributeEntities = mdmServiceCache.queryMdmModuleDistribute(mdmModuleEntity.getId(),mdmModuleDistributeEntity); - return BaseResult.getSuccessMessageEntity("查询成功", mdmModuleDistributeEntities); - } - /** - * @param object - * @return com.hzya.frame.web.entity.JsonResultEntity - * @Author lvleigang - * @Description 主数据设置保存分发设置 - * @Date 9:40 上午 2023/10/18 - **/ - @Override - public JsonResultEntity doSaveMdmModuleDistribute(JSONObject object) { - MdmDistributeDto entity = getData("jsonStr", object, MdmDistributeDto.class); - //判断是否有数据 - if (entity == null) { - return BaseResult.getFailureMessageEntity("参数不允许为空"); - } - if (entity.getMdmCode() == null || "".equals(entity.getMdmCode())) { - return BaseResult.getFailureMessageEntity("系统错误"); - } - MdmModuleEntity mdmModuleEntity = mdmServiceCache.getMdmModuleEntity(entity.getMdmCode()); - if(mdmModuleEntity == null || mdmModuleEntity.getId() == null){ - return BaseResult.getFailureMessageEntity("系统错误"); - } - mdmServiceCache.saveMdmModuleDistribute(mdmModuleEntity.getId(),entity.getMdmModuleDistributeEntities()); - return BaseResult.getSuccessMessageEntity("保存发布设置成功"); - } - - /** - * @param object - * @return com.hzya.frame.web.entity.JsonResultEntity - * @Author lvleigang - * @Description 主数据设置查询数据来源 - * @Date 9:40 上午 2023/10/18 - **/ - @Override - public JsonResultEntity queryMdmModuleSource(JSONObject object) { - MdmDto entity = getData("jsonStr", object, MdmDto.class); - if (entity == null) { - return BaseResult.getFailureMessageEntity("参数不允许为空"); - } - if (entity.getMdmCode() == null || "".equals(entity.getMdmCode())) { - return BaseResult.getFailureMessageEntity("系统错误"); - } - MdmModuleEntity mdmModuleEntity = mdmServiceCache.getMdmModuleEntity(entity.getMdmCode()); - if(mdmModuleEntity == null || mdmModuleEntity.getId() == null){ - return BaseResult.getFailureMessageEntity("系统错误"); - } - //查询模块下的应用列表 - MdmModuleSourceEntity mdmModuleSourceEntity = new MdmModuleSourceEntity(); - mdmModuleSourceEntity.setSts("Y"); - mdmModuleSourceEntity.setMdmId(mdmModuleEntity.getId()); - List mdmModuleSourceEntities = mdmServiceCache.queryMdmModuleSource(mdmModuleSourceEntity); - return BaseResult.getSuccessMessageEntity("查询成功", mdmModuleSourceEntities); - } - /** - * @param object - * @return com.hzya.frame.web.entity.JsonResultEntity - * @Author lvleigang - * @Description 主数据设置保存数据来源 - * @Date 9:40 上午 2023/10/18 - **/ - @Override - public JsonResultEntity doSaveMdmModuleSource(JSONObject object) { - MdmSourceDto entity = getData("jsonStr", object, MdmSourceDto.class); - //判断是否有数据 - if (entity == null) { - return BaseResult.getFailureMessageEntity("参数不允许为空"); - } - if (entity.getMdmCode() == null || "".equals(entity.getMdmCode())) { - return BaseResult.getFailureMessageEntity("系统错误"); - } - MdmModuleEntity mdmModuleEntity = mdmServiceCache.getMdmModuleEntity(entity.getMdmCode()); - if(mdmModuleEntity == null || mdmModuleEntity.getId() == null){ - return BaseResult.getFailureMessageEntity("系统错误"); - } - mdmServiceCache.saveMdmModuleSource(mdmModuleEntity.getId(),entity.getMdmModuleSourceEntities()); - return BaseResult.getSuccessMessageEntity("保存发布设置成功"); - } - - /** - * @param jsonObject - * @return com.hzya.frame.web.entity.JsonResultEntity - * @Author lvleigang - * @Description 查询下发日志 - * @Date 11:52 上午 2024/3/27 - **/ - @Override - public JsonResultEntity querySendEntityPage(JSONObject jsonObject) { - MdmModuleSendLogEntity entity = getData("jsonStr", jsonObject, MdmModuleSendLogEntity.class); - //判断分页 - if (entity == null || entity.getPageNum() == null || entity.getPageSize() == null) { - return BaseResult.getFailureMessageEntity("分页查询参数不存在"); - } - if (entity.getMdmCode() == null || "".equals(entity.getMdmCode())) { - return BaseResult.getFailureMessageEntity("系统错误"); - } - MdmModuleEntity mdmModuleEntity = mdmServiceCache.getMdmModuleEntity(entity.getMdmCode()); - if(mdmModuleEntity == null || mdmModuleEntity.getId() == null){ - return BaseResult.getFailureMessageEntity("系统错误"); - } - MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); - mdmModuleDbEntity.setMdmId(mdmModuleEntity.getId()); - mdmModuleDbEntity.setSts("Y"); - List mdmModuleDbEntities = mdmServiceCache.queryMdmModuleDb(mdmModuleDbEntity); - if(mdmModuleDbEntities != null && mdmModuleDbEntities.size() > 0 ){ - for (int i = 0; i < mdmModuleDbEntities.size(); i++) { - if("1".equals(mdmModuleDbEntities.get(i).getDbType())){ - entity.setTableName(mdmModuleDbEntities.get(i).getDbName()+"_send_log"); - break; - } - } - }else { - return BaseResult.getFailureMessageEntity("请先设置数据源"); - } - PageHelper.startPage(entity.getPageNum(), entity.getPageSize()); - List list = mdmModuleSendLogDao.queryByLike(entity); - PageInfo pageInfo = new PageInfo(list); - return BaseResult.getSuccessMessageEntity("查询数据成功", pageInfo); - } - - /** - * @param jsonObject - * @return com.hzya.frame.web.entity.JsonResultEntity - * @Author lvleigang - * @Description 获取下发日志 - * @Date 2:36 下午 2024/3/27 - **/ - @Override - public JsonResultEntity getSendEntity(JSONObject jsonObject) { - MdmModuleSendLogEntity entity = getData("jsonStr", jsonObject, MdmModuleSendLogEntity.class); - if (entity == null) { - return BaseResult.getFailureMessageEntity("参数不允许为空"); - } - if (entity.getId() == null || "".equals(entity.getId())) { - return BaseResult.getFailureMessageEntity("系统错误"); - } - if (entity.getMdmCode() == null || "".equals(entity.getMdmCode())) { - return BaseResult.getFailureMessageEntity("系统错误"); - } - MdmModuleEntity mdmModuleEntity = mdmServiceCache.getMdmModuleEntity(entity.getMdmCode()); - if(mdmModuleEntity == null || mdmModuleEntity.getId() == null){ - return BaseResult.getFailureMessageEntity("系统错误"); - } - MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); - mdmModuleDbEntity.setMdmId(mdmModuleEntity.getId()); - mdmModuleDbEntity.setSts("Y"); - List mdmModuleDbEntities = mdmServiceCache.queryMdmModuleDb(mdmModuleDbEntity); - if(mdmModuleDbEntities != null && mdmModuleDbEntities.size() > 0 ){ - for (int i = 0; i < mdmModuleDbEntities.size(); i++) { - if("1".equals(mdmModuleDbEntities.get(i).getDbType())){ - entity.setTableName(mdmModuleDbEntities.get(i).getDbName()+"_send_log"); - break; - } - } - }else { - return BaseResult.getFailureMessageEntity("请先设置数据源"); - } - entity = mdmModuleSendLogDao.get(entity.getId()); - if (entity == null) { - return BaseResult.getFailureMessageEntity("获取日志失败"); - } - return BaseResult.getSuccessMessageEntity("获取日志成功", entity); - } - - /** - * @param jsonObject - * @return com.hzya.frame.web.entity.JsonResultEntity - * @Author lvleigang - * @Description 删除下发日志 - * @Date 2:37 下午 2024/3/27 - **/ - @Override - public JsonResultEntity deleteSendEntity(JSONObject jsonObject) { - MdmModuleSendLogEntity entity = getData("jsonStr", jsonObject, MdmModuleSendLogEntity.class); - if (entity == null) { - return BaseResult.getFailureMessageEntity("参数不允许为空"); - } - if (entity.getId() == null || "".equals(entity.getId())) { - return BaseResult.getFailureMessageEntity("系统错误"); - } - if (entity.getMdmCode() == null || "".equals(entity.getMdmCode())) { - return BaseResult.getFailureMessageEntity("系统错误"); - } - MdmModuleEntity mdmModuleEntity = mdmServiceCache.getMdmModuleEntity(entity.getMdmCode()); - if(mdmModuleEntity == null || mdmModuleEntity.getId() == null){ - return BaseResult.getFailureMessageEntity("系统错误"); - } - MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); - mdmModuleDbEntity.setMdmId(mdmModuleEntity.getId()); - mdmModuleDbEntity.setSts("Y"); - List mdmModuleDbEntities = mdmServiceCache.queryMdmModuleDb(mdmModuleDbEntity); - if(mdmModuleDbEntities != null && mdmModuleDbEntities.size() > 0 ){ - for (int i = 0; i < mdmModuleDbEntities.size(); i++) { - if("1".equals(mdmModuleDbEntities.get(i).getDbType())){ - entity.setTableName(mdmModuleDbEntities.get(i).getDbName()+"_send_log"); - break; - } - } - }else { - return BaseResult.getFailureMessageEntity("请先设置数据源"); - } - entity.setUpdate(); - mdmModuleSendLogDao.logicRemove(entity); - return BaseResult.getSuccessMessageEntity("删除日志成功"); - } - - - - /** - * @param jsonObject - * @return com.hzya.frame.web.entity.JsonResultEntity - * @Author lvleigang - * @Description 查询操作日志 - * @Date 11:52 上午 2024/3/27 - **/ - @Override - public JsonResultEntity queryOptionEntityPage(JSONObject jsonObject) { - MdmModuleOptionLogEntity entity = getData("jsonStr", jsonObject, MdmModuleOptionLogEntity.class); - //判断分页 - if (entity == null || entity.getPageNum() == null || entity.getPageSize() == null) { - return BaseResult.getFailureMessageEntity("分页查询参数不存在"); - } - if (entity.getMdmCode() == null || "".equals(entity.getMdmCode())) { - return BaseResult.getFailureMessageEntity("系统错误"); - } - MdmModuleEntity mdmModuleEntity = mdmServiceCache.getMdmModuleEntity(entity.getMdmCode()); - if(mdmModuleEntity == null || mdmModuleEntity.getId() == null){ - return BaseResult.getFailureMessageEntity("系统错误"); - } - MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); - mdmModuleDbEntity.setMdmId(mdmModuleEntity.getId()); - mdmModuleDbEntity.setSts("Y"); - List mdmModuleDbEntities = mdmServiceCache.queryMdmModuleDb(mdmModuleDbEntity); - if(mdmModuleDbEntities != null && mdmModuleDbEntities.size() > 0 ){ - for (int i = 0; i < mdmModuleDbEntities.size(); i++) { - if("1".equals(mdmModuleDbEntities.get(i).getDbType())){ - entity.setTableName(mdmModuleDbEntities.get(i).getDbName()+"_option_log"); - break; - } - } - }else { - return BaseResult.getFailureMessageEntity("请先设置数据源"); - } - PageHelper.startPage(entity.getPageNum(), entity.getPageSize()); - List list = mdmModuleOptionLogDao.queryByLike(entity); - PageInfo pageInfo = new PageInfo(list); - return BaseResult.getSuccessMessageEntity("查询数据成功", pageInfo); - } - - /** - * @param jsonObject - * @return com.hzya.frame.web.entity.JsonResultEntity - * @Author lvleigang - * @Description 获取操作日志 - * @Date 2:36 下午 2024/3/27 - **/ - @Override - public JsonResultEntity getOptionEntity(JSONObject jsonObject) { - MdmModuleOptionLogEntity entity = getData("jsonStr", jsonObject, MdmModuleOptionLogEntity.class); - if (entity == null) { - return BaseResult.getFailureMessageEntity("参数不允许为空"); - } - if (entity.getId() == null || "".equals(entity.getId())) { - return BaseResult.getFailureMessageEntity("系统错误"); - } - if (entity.getMdmCode() == null || "".equals(entity.getMdmCode())) { - return BaseResult.getFailureMessageEntity("系统错误"); - } - MdmModuleEntity mdmModuleEntity = mdmServiceCache.getMdmModuleEntity(entity.getMdmCode()); - if(mdmModuleEntity == null || mdmModuleEntity.getId() == null){ - return BaseResult.getFailureMessageEntity("系统错误"); - } - MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); - mdmModuleDbEntity.setMdmId(mdmModuleEntity.getId()); - mdmModuleDbEntity.setSts("Y"); - List mdmModuleDbEntities = mdmServiceCache.queryMdmModuleDb(mdmModuleDbEntity); - if(mdmModuleDbEntities != null && mdmModuleDbEntities.size() > 0 ){ - for (int i = 0; i < mdmModuleDbEntities.size(); i++) { - if("1".equals(mdmModuleDbEntities.get(i).getDbType())){ - entity.setTableName(mdmModuleDbEntities.get(i).getDbName()+"_option_log"); - break; - } - } - }else { - return BaseResult.getFailureMessageEntity("请先设置数据源"); - } - entity = mdmModuleOptionLogDao.get(entity.getId()); - if (entity == null) { - return BaseResult.getFailureMessageEntity("获取日志失败"); - } - return BaseResult.getSuccessMessageEntity("获取日志成功", entity); - } - - /** - * @param jsonObject - * @return com.hzya.frame.web.entity.JsonResultEntity - * @Author lvleigang - * @Description 删除操作日志 - * @Date 2:37 下午 2024/3/27 - **/ - @Override - public JsonResultEntity deleteOptionEntity(JSONObject jsonObject) { - MdmModuleOptionLogEntity entity = getData("jsonStr", jsonObject, MdmModuleOptionLogEntity.class); - if (entity == null) { - return BaseResult.getFailureMessageEntity("参数不允许为空"); - } - if (entity.getId() == null || "".equals(entity.getId())) { - return BaseResult.getFailureMessageEntity("系统错误"); - } - if (entity.getMdmCode() == null || "".equals(entity.getMdmCode())) { - return BaseResult.getFailureMessageEntity("系统错误"); - } - MdmModuleEntity mdmModuleEntity = mdmServiceCache.getMdmModuleEntity(entity.getMdmCode()); - if(mdmModuleEntity == null || mdmModuleEntity.getId() == null){ - return BaseResult.getFailureMessageEntity("系统错误"); - } - MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); - mdmModuleDbEntity.setMdmId(mdmModuleEntity.getId()); - mdmModuleDbEntity.setSts("Y"); - List mdmModuleDbEntities = mdmServiceCache.queryMdmModuleDb(mdmModuleDbEntity); - if(mdmModuleDbEntities != null && mdmModuleDbEntities.size() > 0 ){ - for (int i = 0; i < mdmModuleDbEntities.size(); i++) { - if("1".equals(mdmModuleDbEntities.get(i).getDbType())){ - entity.setTableName(mdmModuleDbEntities.get(i).getDbName()+"_option_log"); - break; - } - } - }else { - return BaseResult.getFailureMessageEntity("请先设置数据源"); - } - entity.setUpdate(); - mdmModuleOptionLogDao.logicRemove(entity); - return BaseResult.getSuccessMessageEntity("删除日志成功"); - } - /** - * @param object - * @return com.hzya.frame.web.entity.JsonResultEntity - * @Author lvleigang - * @Description 主数据设置查询数据源的服务 - * @Date 9:40 上午 2023/10/18 - **/ - @Override - public JsonResultEntity queryMdmModuleServer(JSONObject object) { - MdmModuleDbEntity entity = getData("jsonStr", object, MdmModuleDbEntity.class); - //判断分页 - if (entity == null) { - entity = new MdmModuleDbEntity(); - } - //查询数据源表 - entity.setSts("Y"); - List allDb = mdmModuleDbDao.queryByLike(entity); - List mdmModuleDbEntityList = new ArrayList<>(); - if(allDb != null && allDb.size() > 0){ - for (int i = 0; i < allDb.size(); i++) { - if("1".equals(allDb.get(i).getDbType()) || "2".equals(allDb.get(i).getDbType() )){ - mdmModuleDbEntityList.add(allDb.get(i)); - } - } - } - return BaseResult.getSuccessMessageEntity("查询数据成功", mdmModuleDbEntityList); - } - - /** - * @param object - * @return com.hzya.frame.web.entity.JsonResultEntity - * @Author lvleigang - * @Description 主数据设置查询数据源的服务的字段 - * @Date 9:40 上午 2023/10/18 - **/ - @Override - public JsonResultEntity queryMdmModuleServerFiled(JSONObject object) { - MdmModuleDbEntity entity = getData("jsonStr", object, MdmModuleDbEntity.class); - //判断分页 - if (entity == null) { - return BaseResult.getFailureMessageEntity("参数不允许为空"); - } - if (entity.getDbName() == null || "".equals(entity.getDbName())) { - return BaseResult.getFailureMessageEntity("系统错误"); - } - //查询数据源表 - entity.setSts("Y"); - List dblist = mdmModuleDbDao.queryBase(entity); - if (dblist != null && dblist.size() == 1) { - MdmModuleDbFiledsEntity queryDbFiled = new MdmModuleDbFiledsEntity(); - queryDbFiled.setSts("Y"); - queryDbFiled.setDbId(dblist.get(0).getId()); - queryDbFiled.setViewType("1"); - List list = mdmModuleDbFiledsDao.queryBase(queryDbFiled); - MdmModuleDbFiledsEntity mdmModuleDbFiledsEntity = new MdmModuleDbFiledsEntity(); - mdmModuleDbFiledsEntity.setChName("id"); - mdmModuleDbFiledsEntity.setEnName("id"); - list.add(0, mdmModuleDbFiledsEntity); - return BaseResult.getSuccessMessageEntity("查询数据成功", list); - } else { - return BaseResult.getFailureMessageEntity("服务不存在"); - } - } // - // - /** - * @param object - * @return com.hzya.frame.web.entity.JsonResultEntity - * @Author lvleigang - * @Description 主数据设置查询主表字段 - * @Date 9:40 上午 2023/10/18 - **/ - @Override - public JsonResultEntity queryMdmModuleServerMainFiled(JSONObject object) { - MdmModuleDbEntity entity = getData("jsonStr", object, MdmModuleDbEntity.class); - //判断分页 - if (entity == null) { - return BaseResult.getFailureMessageEntity("参数不允许为空"); - } - if (entity.getMdmId() == null || "".equals(entity.getMdmId())) { - return BaseResult.getFailureMessageEntity("系统错误"); - } - //查询数据源表 - entity.setSts("Y"); - entity.setDbType("1"); - List mdmModuleDbEntityList = mdmModuleDbDao.queryBase(entity); - if (mdmModuleDbEntityList != null && mdmModuleDbEntityList.size() == 1) { - MdmModuleDbFiledsEntity mdmModuleDbFiledsEntity = new MdmModuleDbFiledsEntity(); - mdmModuleDbFiledsEntity.setSts("Y"); - mdmModuleDbFiledsEntity.setViewType("1"); - mdmModuleDbFiledsEntity.setDbId(mdmModuleDbEntityList.get(0).getId()); - List list = mdmModuleDbFiledsDao.queryBase(mdmModuleDbFiledsEntity); - return BaseResult.getSuccessMessageEntity("查询数据成功", list); - } else if (mdmModuleDbEntityList != null && mdmModuleDbEntityList.size() == 0) { - return BaseResult.getFailureMessageEntity("请先配置数据源"); - } else { - return BaseResult.getFailureMessageEntity("查询数据失败"); - } - } - - - + //@Resource + //private IMdmModuleDao mdmModuleDao; + //@Resource + //private IMdmModuleSendLogDao mdmModuleSendLogDao; + //@Resource + //private IMdmModuleOptionLogDao mdmModuleOptionLogDao; + //@Resource + //private IMdmServiceCache mdmServiceCache; + //@Resource + //private ISysMenuConfigDao sysMenuConfigDao; + //@Resource + //private ISysButtonConfigDao sysButtonConfigDao; + //@Resource + //private ISysPopedomOperateDao sysPopedomOperateDao; + //@Resource + //private IMdmModuleDbDao mdmModuleDbDao; + //@Resource + //private IMdmModuleDbFiledsDao mdmModuleDbFiledsDao; + //@Resource + //private IMdmModuleDbFiledsRuleDao mdmModuleDbFiledsRuleDao; + //@Resource + //private IMdmModuleDistributeDao mdmModuleDistributeDao; + //@Resource + //private IMdmModuleDistributeDetailDao mdmModuleDistributeDetailDao; + //@Resource + //private IMdmModuleViewDao mdmModuleViewDao; + //@Resource + //private IMdmModuleViewButtonDao mdmModuleViewButtonDao; + //@Resource + //private IMdmModuleViewDetailDao mdmModuleViewDetailDao; // ///** - // * @param entity - // * @param mainMdmModuleDb - // * @param mainMdmModuleDbFileds + // * @param object + // * @return com.hzya.frame.web.entity.JsonResultEntity + // * @Author lvleigang + // * @Description 主数据列表查询接口分页 + // * @Date 9:40 上午 2023/10/18 + // **/ + //@Override + //public JsonResultEntity queryMdmPage(JSONObject object) { + // MdmModuleEntity entity = getData("jsonStr", object, MdmModuleEntity.class); + // //判断分页 + // if (entity == null || entity.getPageNum() == null || entity.getPageSize() == null) { + // return BaseResult.getFailureMessageEntity("分页查询参数不存在"); + // } + // PageHelper.startPage(entity.getPageNum(), entity.getPageSize()); + // List mdmVos = mdmModuleDao.queryMdm(entity); + // PageInfo pageInfo = new PageInfo(mdmVos); + // return BaseResult.getSuccessMessageEntity("查询数据成功", pageInfo); + //} + // + ///** + // * @param object + // * @return com.hzya.frame.web.entity.JsonResultEntity + // * @Author lvleigang + // * @Description 主数据列表查询接口列表 + // * @Date 9:40 上午 2023/10/18 + // **/ + //@Override + //public JsonResultEntity queryMdmList(JSONObject object) { + // MdmModuleEntity entity = getData("jsonStr", object, MdmModuleEntity.class); + // List mdmVos = mdmModuleDao.queryMdm(entity); + // return BaseResult.getSuccessMessageEntity("查询数据成功", mdmVos); + //} + // + ///** + // * @param object + // * @return com.hzya.frame.web.entity.JsonResultEntity + // * @Author lvleigang + // * @Description 主数据新增 + // * @Date 9:40 上午 2023/10/18 + // **/ + //@Override + //public JsonResultEntity addMdm(JSONObject object) { + // MdmModuleEntity entity = getData("jsonStr", object, MdmModuleEntity.class); + // if (entity == null) { + // return BaseResult.getFailureMessageEntity("参数不允许为空"); + // } + // if (entity.getMdmName() == null || "".equals(entity.getMdmName())) { + // return BaseResult.getFailureMessageEntity("请先输入主数据名称"); + // } + // if (entity.getMdmType() == null || "".equals(entity.getMdmType())) { + // return BaseResult.getFailureMessageEntity("请先选择主数据类型"); + // } + // //新增 + // entity.setCreate(); + // mdmModuleDao.save(entity); + // return BaseResult.getSuccessMessageEntity("保存数据成功", entity); + //} + // + ///** + // * @param object + // * @return com.hzya.frame.web.entity.JsonResultEntity + // * @Author lvleigang + // * @Description 主数据基本信息获取 + // * @Date 9:40 上午 2023/10/18 + // **/ + //@Override + //public JsonResultEntity queryMdmModule(JSONObject object) { + // MdmModuleEntity entity = getData("jsonStr", object, MdmModuleEntity.class); + // if (entity == null) { + // return BaseResult.getFailureMessageEntity("系统错误"); + // } + // if (entity.getMdmCode() == null || "".equals(entity.getMdmCode())) { + // return BaseResult.getFailureMessageEntity("系统错误"); + // } + // //使用缓存 + // MdmModuleEntity mdmModuleEntity = mdmServiceCache.getMdmModuleEntity(entity.getMdmCode()); + // return BaseResult.getSuccessMessageEntity("查询数据成功", mdmModuleEntity); + //} + // + ///** + // * @param object + // * @return com.hzya.frame.web.entity.JsonResultEntity + // * @Author lvleigang + // * @Description 主数据基本信息保存 + // * @Date 9:40 上午 2023/10/18 + // **/ + //@Override + //public JsonResultEntity doSaveMdmModule(JSONObject object) { + // MdmModuleEntity entity = getData("jsonStr", object, MdmModuleEntity.class); + // if (entity == null) { + // return BaseResult.getFailureMessageEntity("参数不允许为空"); + // } + // if (entity.getMdmName() == null || "".equals(entity.getMdmName())) { + // return BaseResult.getFailureMessageEntity("请先输入主数据名称"); + // } + // if (entity.getMdmCode() == null || "".equals(entity.getMdmCode())) { + // return BaseResult.getFailureMessageEntity("系统错误"); + // } + // MdmModuleEntity mdmModuleEntity = mdmServiceCache.getMdmModuleEntity(entity.getMdmCode()); + // if(mdmModuleEntity == null ){ + // return BaseResult.getFailureMessageEntity("系统错误"); + // } + // entity.setId(mdmModuleEntity.getId()); + // //修改 + // entity.setUpdate(); + // mdmServiceCache.updateMdmModuleEntity(entity); + // return BaseResult.getSuccessMessageEntity("修改主数据成功", entity); + //} + // + ///** + // * @param object + // * @return com.hzya.frame.web.entity.JsonResultEntity + // * @Author lvleigang + // * @Description 主数据设置查询数据源 + // * @Date 9:40 上午 2023/10/18 + // **/ + //@Override + //public JsonResultEntity queryMdmModuleDb(JSONObject object) { + // MdmModuleEntity entity = getData("jsonStr", object, MdmModuleEntity.class); + // //判断分页 + // if (entity == null) { + // return BaseResult.getFailureMessageEntity("系统错误"); + // } + // if (entity.getMdmCode() == null || "".equals(entity.getMdmCode())) { + // return BaseResult.getFailureMessageEntity("系统错误"); + // } + // MdmDbVo mdmDbVo = new MdmDbVo(); + // //获取主数据 + // MdmModuleEntity mdmModuleEntity = mdmServiceCache.getMdmModuleEntity(entity.getMdmCode()); + // //查询设置的规则表 + // MdmTableCodeRuleEntity mdmTableCodeRuleEntity = new MdmTableCodeRuleEntity(); + // mdmTableCodeRuleEntity.setSts("Y"); + // mdmTableCodeRuleEntity.setMdmId(mdmModuleEntity.getId()); + // List mdmTableCodeRuleEntityList = mdmServiceCache.queryMdmTableCodeRuleEntity(mdmTableCodeRuleEntity); + // mdmDbVo.setMdmTableCodeRuleEntityList(mdmTableCodeRuleEntityList); + // //查询数据源表 + // MdmModuleDbEntity queryDb = new MdmModuleDbEntity(); + // queryDb.setMdmId(mdmModuleEntity.getId()); + // queryDb.setSts("Y"); + // List mdmModuleDbEntityList = mdmServiceCache.queryMdmModuleDb(queryDb); + // //数据源字段 + // MdmModuleDbFiledsEntity queryDbFiled = new MdmModuleDbFiledsEntity(); + // queryDbFiled.setMdmId(mdmModuleEntity.getId()); + // queryDbFiled.setSts("Y"); + // List mdmModuleDbFiledsEntityList = mdmServiceCache.queryMdmModuleDbFileds(queryDbFiled); + // //数据源字段规则 + // MdmModuleDbFiledsRuleEntity queryDbFiledRule = new MdmModuleDbFiledsRuleEntity(); + // queryDbFiledRule.setMdmId(mdmModuleEntity.getId()); + // queryDbFiledRule.setSts("Y"); + // List mdmModuleDbFiledsRuleEntityList = mdmServiceCache.queryMdmModuleDbFiledsRule(queryDbFiledRule); + // //组装数据 + // setMdmDb(mdmDbVo, mdmModuleDbEntityList, mdmModuleDbFiledsEntityList, mdmModuleDbFiledsRuleEntityList); + // return BaseResult.getSuccessMessageEntity("查询数据成功", mdmDbVo); + //} + ///** + // * @param mdmDbVo 返回对象 + // * @param mdmModuleDbEntityList 数据表 + // * @param mdmModuleDbFiledsEntityList 字段 + // * @param mdmModuleDbFiledsRuleEntityList 字段属性 // * @return void // * @Author lvleigang - // * @Description 设置保存主表和字段以及字段的属性 - // * @Date 10:34 上午 2023/10/19 + // * @Description 组装返回数据 + // * @Date 4:51 下午 2023/10/18 // **/ - //private void setMainTable(MdmDto entity, MdmModuleDbEntity mainMdmModuleDb, List mainMdmModuleDbFileds) { - // //先保存或修改主表数据 - // mainMdmModuleDb.setMdmId(entity.getId()); - // mainMdmModuleDb.setDbType("1"); - // boolean flag = false; + //private void setMdmDb(MdmDbVo mdmDbVo, List mdmModuleDbEntityList, List mdmModuleDbFiledsEntityList, List mdmModuleDbFiledsRuleEntityList) { + // //主数据主表 + // MdmModuleDbEntity mainMdmModuleDb = new MdmModuleDbEntity(); + // //主数据子表 + // List sublistMdmModuleDb = new ArrayList<>(); + // //主数据主表字段 + // List mainMdmModuleDbFileds = new ArrayList<>(); // - // if (mainMdmModuleDb.getId() != null && !"".equals(mainMdmModuleDb.getId())) { - // mainMdmModuleDb.setSts("Y"); - // mainMdmModuleDb.setModify_user_id(StpUtil.getLoginIdAsString()); - // mainMdmModuleDb.setModify_time(new Date()); - // mdmModuleDbDao.update(mainMdmModuleDb); - // //删除规则表 - // MdmModuleDbFiledsRuleEntity delectFiledsRule = new MdmModuleDbFiledsRuleEntity(); - // delectFiledsRule.setMdmId(entity.getId()); - // delectFiledsRule.setModify_user_id(StpUtil.getLoginIdAsString()); - // delectFiledsRule.setModify_time(new Date()); - // mdmModuleDbFiledsRuleDao.logicRemoveMultiCondition(delectFiledsRule); - // } else { - // flag = true; - // mainMdmModuleDb.setId(UUIDUtils.getUUID()); - // mainMdmModuleDb.setSts("Y"); - // mainMdmModuleDb.setCreate_user_id(StpUtil.getLoginIdAsString()); - // mainMdmModuleDb.setModify_user_id(StpUtil.getLoginIdAsString()); - // mainMdmModuleDb.setCreate_time(new Date()); - // mainMdmModuleDb.setModify_time(new Date()); - // mdmModuleDbDao.save(mainMdmModuleDb); - // } - // List dbFiledsDtos = new ArrayList<>(); // - // //保存主表字段 因为字段不允许删除,所以不用先删除再新增 - // if (mainMdmModuleDbFileds != null && mainMdmModuleDbFileds.size() > 0) { - // for (int i = 0; i < mainMdmModuleDbFileds.size(); i++) { - // MdmModuleDbFiledsEntity mdmModuleDbFiledsEntity = mainMdmModuleDbFileds.get(i); - // mdmModuleDbFiledsEntity.setMdmId(entity.getId()); - // mdmModuleDbFiledsEntity.setDbId(mainMdmModuleDb.getId()); - // if (mdmModuleDbFiledsEntity.getId() != null && !"".equals(mdmModuleDbFiledsEntity.getId())) { - // DbFiledsDto dbFiledsDto = new DbFiledsDto("1", mdmModuleDbFiledsEntity.getChName(), mdmModuleDbFiledsEntity.getEnName(), mdmModuleDbFiledsEntity.getFiledType(), mdmModuleDbFiledsEntity.getFiledLength()); - // dbFiledsDtos.add(dbFiledsDto); - // - // mdmModuleDbFiledsEntity.setSts("Y"); - // mdmModuleDbFiledsEntity.setModify_user_id(StpUtil.getLoginIdAsString()); - // mdmModuleDbFiledsEntity.setModify_time(new Date()); - // mdmModuleDbFiledsDao.update(mdmModuleDbFiledsEntity); - // } else { - // DbFiledsDto dbFiledsDto = new DbFiledsDto("2", mdmModuleDbFiledsEntity.getChName(), mdmModuleDbFiledsEntity.getEnName(), mdmModuleDbFiledsEntity.getFiledType(), mdmModuleDbFiledsEntity.getFiledLength()); - // dbFiledsDtos.add(dbFiledsDto); - // mdmModuleDbFiledsEntity.setId(UUIDUtils.getUUID()); - // mdmModuleDbFiledsEntity.setSts("Y"); - // mdmModuleDbFiledsEntity.setCreate_user_id(StpUtil.getLoginIdAsString()); - // mdmModuleDbFiledsEntity.setModify_user_id(StpUtil.getLoginIdAsString()); - // mdmModuleDbFiledsEntity.setCreate_time(new Date()); - // mdmModuleDbFiledsEntity.setModify_time(new Date()); - // mdmModuleDbFiledsDao.save(mdmModuleDbFiledsEntity); - // } - // //修改或保存属性 - // List mdmModuleDbFiledsRules = mdmModuleDbFiledsEntity.getMdmModuleDbFiledsRules(); - // if (mdmModuleDbFiledsRules != null && mdmModuleDbFiledsRules.size() > 0) { - // for (int a = 0; a < mdmModuleDbFiledsRules.size(); a++) { - // MdmModuleDbFiledsRuleEntity mdmModuleDbFiledsRuleEntity = mdmModuleDbFiledsRules.get(a); - // mdmModuleDbFiledsRuleEntity.setMdmId(entity.getId()); - // mdmModuleDbFiledsRuleEntity.setDbId(mainMdmModuleDb.getId()); - // mdmModuleDbFiledsRuleEntity.setFiledId(mdmModuleDbFiledsEntity.getId()); - // if (mdmModuleDbFiledsRuleEntity.getId() != null && !"".equals(mdmModuleDbFiledsRuleEntity.getId())) { - // mdmModuleDbFiledsRuleEntity.setSts("Y"); - // mdmModuleDbFiledsRuleEntity.setModify_user_id(StpUtil.getLoginIdAsString()); - // mdmModuleDbFiledsRuleEntity.setModify_time(new Date()); - // mdmModuleDbFiledsRuleDao.update(mdmModuleDbFiledsRuleEntity); - // } else { - // mdmModuleDbFiledsRuleEntity.setId(UUIDUtils.getUUID()); - // mdmModuleDbFiledsRuleEntity.setSts("Y"); - // mdmModuleDbFiledsRuleEntity.setCreate_user_id(StpUtil.getLoginIdAsString()); - // mdmModuleDbFiledsRuleEntity.setModify_user_id(StpUtil.getLoginIdAsString()); - // mdmModuleDbFiledsRuleEntity.setCreate_time(new Date()); - // mdmModuleDbFiledsRuleEntity.setModify_time(new Date()); - // mdmModuleDbFiledsRuleDao.save(mdmModuleDbFiledsRuleEntity); + // if (mdmModuleDbEntityList != null && mdmModuleDbEntityList.size() > 0) { + // for (int i = 0; i < mdmModuleDbEntityList.size(); i++) { + // if ("1".equals(mdmModuleDbEntityList.get(i).getDbType())) { + // //1、主表 2、明细 + // mainMdmModuleDb = mdmModuleDbEntityList.get(i); + // //循环字段表 + // if (mdmModuleDbFiledsEntityList != null && mdmModuleDbFiledsEntityList.size() > 0) { + // for (int i1 = 0; i1 < mdmModuleDbFiledsEntityList.size(); i1++) { + // if (mdmModuleDbEntityList.get(i).getId().equals(mdmModuleDbFiledsEntityList.get(i1).getDbId())) { + // mainMdmModuleDbFileds.add(mdmModuleDbFiledsEntityList.get(i1)); + // List mdmModuleDbFiledsRules = new ArrayList<>(); + // //循环字段属性 + // if (mdmModuleDbFiledsRuleEntityList != null && mdmModuleDbFiledsRuleEntityList.size() > 0) { + // for (int i2 = 0; i2 < mdmModuleDbFiledsRuleEntityList.size(); i2++) { + // if (mdmModuleDbFiledsEntityList.get(i1).getDbId().equals(mdmModuleDbFiledsRuleEntityList.get(i2).getDbId()) + // && mdmModuleDbFiledsEntityList.get(i1).getId().equals(mdmModuleDbFiledsRuleEntityList.get(i2).getFiledId())) { + // mdmModuleDbFiledsRules.add(mdmModuleDbFiledsRuleEntityList.get(i2)); + // } + // } + // } + // mdmModuleDbFiledsEntityList.get(i1).setMdmModuleDbFiledsRules(mdmModuleDbFiledsRules); + // } // } // } + // } else if ("2".equals(mdmModuleDbEntityList.get(i).getDbType())) { + // //2、明细 + // sublistMdmModuleDb.add(mdmModuleDbEntityList.get(i)); + // //循环字段表 + // if (mdmModuleDbFiledsEntityList != null && mdmModuleDbFiledsEntityList.size() > 0) { + // List sublistMdmModuleDbFileds = new ArrayList<>(); + // for (int i1 = 0; i1 < mdmModuleDbFiledsEntityList.size(); i1++) { + // if (mdmModuleDbEntityList.get(i).getId().equals(mdmModuleDbFiledsEntityList.get(i1).getDbId())) { + // sublistMdmModuleDbFileds.add(mdmModuleDbFiledsEntityList.get(i1)); + // List mdmModuleDbFiledsRules = new ArrayList<>(); + // //循环字段属性 + // if (mdmModuleDbFiledsRuleEntityList != null && mdmModuleDbFiledsRuleEntityList.size() > 0) { + // for (int i2 = 0; i2 < mdmModuleDbFiledsRuleEntityList.size(); i2++) { + // if (mdmModuleDbFiledsEntityList.get(i1).getDbId().equals(mdmModuleDbFiledsRuleEntityList.get(i2).getDbId()) + // && mdmModuleDbFiledsEntityList.get(i1).getId().equals(mdmModuleDbFiledsRuleEntityList.get(i2).getFiledId())) { + // mdmModuleDbFiledsRules.add(mdmModuleDbFiledsRuleEntityList.get(i2)); + // } + // } + // } + // mdmModuleDbFiledsEntityList.get(i1).setMdmModuleDbFiledsRules(mdmModuleDbFiledsRules); + // } + // } + // mdmModuleDbEntityList.get(i).setSublistMdmModuleDbFileds(sublistMdmModuleDbFileds); + // } // } // } // } - // if (flag) { - // //新增 - // Map maps = new HashMap<>(); - // maps.put("dbType", "1");//表类型 - // maps.put("tableName", mainMdmModuleDb.getDbName());//表名 - // maps.put("tableRemark", mainMdmModuleDb.getRemark());//表备注 - // maps.put("databaseFields", dbFiledsDtos);//字段 - // mdmModuleDao.createTable(maps); - // Map mapsDistribute = new HashMap<>(); - // mapsDistribute.put("tableName", mainMdmModuleDb.getDbName() + "_distribute");//表名 - // List distribute = getDistribute(); - // maps.put("databaseFields", distribute);//字段 - // mapsDistribute.put("tableRemark", mainMdmModuleDb.getRemark() + "分发表");//表备注 - // mdmModuleDao.createTableDistribute(mapsDistribute); - // } else { - // //修改 - // Map tablename = new HashMap<>(); - // tablename.put("tableName", mainMdmModuleDb.getDbName());//表名 - // tablename.put("tableRemark", mainMdmModuleDb.getRemark());//表备注 - // mdmModuleDao.alterTableName(tablename); - // Map maps = new HashMap<>(); - // maps.put("tableName", mainMdmModuleDb.getDbName());//表名 - // maps.put("tableRemark", mainMdmModuleDb.getRemark());//表备注 - // maps.put("databaseFields", dbFiledsDtos);//字段 - // mdmModuleDao.alterTable(maps); - // } + // mainMdmModuleDb.setSublistMdmModuleDbFileds(mainMdmModuleDbFileds); + // mdmDbVo.setMainMdmModuleDb(mainMdmModuleDb); + // mdmDbVo.setSublistMdmModuleDb(sublistMdmModuleDb); //} // ///** - // * @param - // * @return java.util.List + // * @param object + // * @return com.hzya.frame.web.entity.JsonResultEntity // * @Author lvleigang - // * @Description 设置分发表字段 - // * @Date 8:49 上午 2023/11/9 + // * @Description 主数据设置保存数据源 + // * @Date 9:40 上午 2023/10/18 // **/ - //private List getDistribute() { - // List dbFiledsDtos = new ArrayList<>(); - // dbFiledsDtos.add(new DbFiledsDto("1", "数据id", "formmain_id", "3", "50")); - // dbFiledsDtos.add(new DbFiledsDto("1", "应用id", "app_id", "3", "50")); - // dbFiledsDtos.add(new DbFiledsDto("1", "状态1、发送成功 2、发送中 3、发送失败", "status", "3", "50")); - // dbFiledsDtos.add(new DbFiledsDto("1", "描述", "msg", "3", "50")); - // return dbFiledsDtos; + //@Override + //public JsonResultEntity saveMdmModuleDb(JSONObject object) { + // //判断新增还是修改,保存数据生成表结构 + // MdmDto entity = getData("jsonStr", object, MdmDto.class); + // if (entity == null) { + // return BaseResult.getFailureMessageEntity("参数不允许为空"); + // } + // if (entity.getMdmCode() == null || "".equals(entity.getMdmCode())) { + // return BaseResult.getFailureMessageEntity("系统错误"); + // } + // //单据规则校验 + // if(entity.getMdmTableCodeRuleEntityList() == null || entity.getMdmTableCodeRuleEntityList().size() == 0){ + // return BaseResult.getFailureMessageEntity("请先设置单据规则"); + // } + // //主表校验 + // if (entity.getMainMdmModuleDb() == null || entity.getMainMdmModuleDb().getDbName() == null || "".equals(entity.getMainMdmModuleDb().getDbName())) { + // return BaseResult.getFailureMessageEntity("请先输入主表名称"); + // } + // MdmModuleEntity mdmModuleEntity = mdmServiceCache.getMdmModuleEntity(entity.getMdmCode()); + // //主数据主表 + // MdmModuleDbEntity mainMdmModuleDb = entity.getMainMdmModuleDb(); + // //主数据主表字段 + // List mainMdmModuleDbFileds = mainMdmModuleDb.getSublistMdmModuleDbFileds(); + // //主数据子表 + // List sublistMdmModuleDb = entity.getSublistMdmModuleDb(); + // //单据规则 + // List mdmTableCodeRuleEntities = entity.getMdmTableCodeRuleEntityList(); + // // 需要校验表是否存在 + // if (checkTable(mainMdmModuleDb.getDbName())) { + // return BaseResult.getFailureMessageEntity("主表表名已经存在"); + // } + // if(mainMdmModuleDbFileds == null || mainMdmModuleDbFileds.size() == 0){ + // return BaseResult.getFailureMessageEntity("请先设置主表字段"); + // } + // //判断明细表 + // if (sublistMdmModuleDb != null && sublistMdmModuleDb.size() > 0) { + // for (int i = 0; i < sublistMdmModuleDb.size(); i++) { + // // 需要校验表是否存在 + // if (checkTable(sublistMdmModuleDb.get(i).getDbName())) { + // return BaseResult.getFailureMessageEntity("子表" + sublistMdmModuleDb.get(i).getDbName() + "已经存在"); + // } + // if (sublistMdmModuleDb.get(i).getSublistMdmModuleDbFileds() == null && sublistMdmModuleDb.get(i).getSublistMdmModuleDbFileds().size() == 0) { + // return BaseResult.getFailureMessageEntity("请先设置子表" + sublistMdmModuleDb.get(i).getDbName() + "的字段"); + // } + // + // } + // } + // //处理数据 + // //分别设置成 数据源 数据源字段 数据源规则表 设置是否新增修改 没有id新增,有ID修改 + // List mdmModuleDbEntities = new ArrayList<>(); + // List mdmModuleDbFiledsEntities = new ArrayList<>(); + // List mdmModuleDbFiledsRuleEntities = new ArrayList<>(); + // + // //主表 + // if(mainMdmModuleDb.getId() != null && !"".equals(mainMdmModuleDb.getId())){ + // //修改 + // mainMdmModuleDb.setDataType("2"); + // mainMdmModuleDb.setUpdate(); + // }else { + // //新增 + // mainMdmModuleDb.setDataType("1"); + // mainMdmModuleDb.setMdmId(mdmModuleEntity.getId()); + // mainMdmModuleDb.setCreate(); + // } + // mainMdmModuleDb.setDbType("1"); + // mdmModuleDbEntities.add(mainMdmModuleDb); + // for (int i = 0; i < mdmTableCodeRuleEntities.size(); i++) { + // mdmTableCodeRuleEntities.get(i).setMdmId(mdmModuleEntity.getId()); + // mdmTableCodeRuleEntities.get(i).setDbId(mainMdmModuleDb.getId()); + // mdmTableCodeRuleEntities.get(i).setCreate(); + // } + // for (int i = 0; i < mainMdmModuleDbFileds.size(); i++) { + // if(mainMdmModuleDbFileds.get(i).getId() != null && !"".equals(mainMdmModuleDbFileds.get(i).getId())){ + // //修改 + // mainMdmModuleDbFileds.get(i).setDataType("2"); + // mainMdmModuleDbFileds.get(i).setUpdate(); + // }else { + // //新增 + // mainMdmModuleDbFileds.get(i).setDataType("1"); + // mainMdmModuleDbFileds.get(i).setCreate(); + // } + // mainMdmModuleDbFileds.get(i).setMdmId(mdmModuleEntity.getId()); + // mainMdmModuleDbFileds.get(i).setDbId(mainMdmModuleDb.getId()); + // mainMdmModuleDbFileds.get(i).setAddType("1"); + // mainMdmModuleDbFileds.get(i).setUpdateType("1"); + // mainMdmModuleDbFileds.get(i).setShowType("1"); + // mainMdmModuleDbFileds.get(i).setQueryType("1"); + // mainMdmModuleDbFileds.get(i).setListType("1"); + // mainMdmModuleDbFileds.get(i).setViewType("1"); + // if(mainMdmModuleDbFileds.get(i).getMdmModuleDbFiledsRules() != null && mainMdmModuleDbFileds.get(i).getMdmModuleDbFiledsRules().size() > 0){ + // for (int i1 = 0; i1 < mainMdmModuleDbFileds.get(i).getMdmModuleDbFiledsRules().size(); i1++) { + // MdmModuleDbFiledsRuleEntity mdmModuleDbFiledsRuleEntity = mainMdmModuleDbFileds.get(i).getMdmModuleDbFiledsRules().get(i1); + // if(mdmModuleDbFiledsRuleEntity.getId() != null && !"".equals(mdmModuleDbFiledsRuleEntity.getId())){ + // //修改 + // mdmModuleDbFiledsRuleEntity.setDataType("2"); + // mdmModuleDbFiledsRuleEntity.setUpdate(); + // }else { + // //新增 + // mdmModuleDbFiledsRuleEntity.setDataType("1"); + // mdmModuleDbFiledsRuleEntity.setCreate(); + // } + // mdmModuleDbFiledsRuleEntities.add(mdmModuleDbFiledsRuleEntity); + // } + // } + // mdmModuleDbFiledsEntities.add(mainMdmModuleDbFileds.get(i)); + // } + // if("1".equals(mainMdmModuleDb.getDataType())){ + // //新增 设置默认字段 + // List moduleDbFiledsEntities = getCreateMdm(mdmModuleEntity.getId(),mainMdmModuleDb.getId(),"1"); + // mdmModuleDbFiledsEntities.addAll(moduleDbFiledsEntities); + // } + // //明细表 + // if(sublistMdmModuleDb != null && sublistMdmModuleDb.size() > 0){ + // for (int i = 0; i < sublistMdmModuleDb.size(); i++) { + // MdmModuleDbEntity mdmModuleDbEntity = sublistMdmModuleDb.get(i); + // if(mdmModuleDbEntity.getId() != null && !"".equals(mdmModuleDbEntity.getId())){ + // //修改 + // mdmModuleDbEntity.setDataType("2"); + // mdmModuleDbEntity.setUpdate(); + // }else { + // //新增 + // mdmModuleDbEntity.setDataType("1"); + // mdmModuleDbEntity.setMdmId(mdmModuleEntity.getId()); + // mdmModuleDbEntity.setCreate(); + // } + // mainMdmModuleDb.setDbType("2"); + // mdmModuleDbEntities.add(mdmModuleDbEntity); + // for (int a = 0; a < mdmModuleDbEntity.getSublistMdmModuleDbFileds().size(); a++) { + // if(mdmModuleDbEntity.getSublistMdmModuleDbFileds().get(a).getId() != null && !"".equals(mdmModuleDbEntity.getSublistMdmModuleDbFileds().get(a).getId())){ + // //修改 + // mdmModuleDbEntity.getSublistMdmModuleDbFileds().get(a).setDataType("2"); + // mdmModuleDbEntity.getSublistMdmModuleDbFileds().get(a).setUpdate(); + // }else { + // //新增 + // mdmModuleDbEntity.getSublistMdmModuleDbFileds().get(a).setDataType("1"); + // mdmModuleDbEntity.getSublistMdmModuleDbFileds().get(a).setCreate(); + // } + // mdmModuleDbEntity.getSublistMdmModuleDbFileds().get(a).setMdmId(mdmModuleEntity.getId()); + // mdmModuleDbEntity.getSublistMdmModuleDbFileds().get(a).setDbId(mainMdmModuleDb.getId()); + // mdmModuleDbEntity.getSublistMdmModuleDbFileds().get(a).setAddType("1"); + // mdmModuleDbEntity.getSublistMdmModuleDbFileds().get(a).setUpdateType("1"); + // mdmModuleDbEntity.getSublistMdmModuleDbFileds().get(a).setShowType("1"); + // mdmModuleDbEntity.getSublistMdmModuleDbFileds().get(a).setQueryType("1"); + // mdmModuleDbEntity.getSublistMdmModuleDbFileds().get(a).setListType("1"); + // mdmModuleDbEntity.getSublistMdmModuleDbFileds().get(a).setViewType("1"); + // if(mdmModuleDbEntity.getSublistMdmModuleDbFileds().get(a).getMdmModuleDbFiledsRules() != null && mdmModuleDbEntity.getSublistMdmModuleDbFileds().get(a).getMdmModuleDbFiledsRules().size() > 0){ + // for (int i1 = 0; i1 < mainMdmModuleDbFileds.get(a).getMdmModuleDbFiledsRules().size(); i1++) { + // MdmModuleDbFiledsRuleEntity mdmModuleDbFiledsRuleEntity = mainMdmModuleDbFileds.get(a).getMdmModuleDbFiledsRules().get(i1); + // if(mdmModuleDbFiledsRuleEntity.getId() != null && !"".equals(mdmModuleDbFiledsRuleEntity.getId())){ + // //修改 + // mdmModuleDbFiledsRuleEntity.setDataType("2"); + // mdmModuleDbFiledsRuleEntity.setUpdate(); + // }else { + // //新增 + // mdmModuleDbFiledsRuleEntity.setDataType("1"); + // mdmModuleDbFiledsRuleEntity.setCreate(); + // } + // mdmModuleDbFiledsRuleEntities.add(mdmModuleDbFiledsRuleEntity); + // } + // } + // mdmModuleDbFiledsEntities.add(mdmModuleDbEntity.getSublistMdmModuleDbFileds().get(a)); + // } + // if("1".equals(mainMdmModuleDb.getDataType())){ + // //新增 设置默认字段 + // List moduleDbFiledsEntities = getCreateMdm(mdmModuleEntity.getId(),mainMdmModuleDb.getId(),"2"); + // mdmModuleDbFiledsEntities.addAll(moduleDbFiledsEntities); + // } + // } + // } + // + // + // //新增日志表 + // if("1".equals(mainMdmModuleDb.getDataType())){ + // MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); + // mdmModuleDbEntity.setMdmId(mdmModuleEntity.getId()); + // mdmModuleDbEntity.setDbName(mainMdmModuleDb.getDbName()+"_option_log"); + // mdmModuleDbEntity.setDbType("3"); + // mdmModuleDbEntity.setDataType("1"); + // mdmModuleDbEntity.setCreate(); + // mdmModuleDbEntities.add(mdmModuleDbEntity); + // //新增 设置日志表 + // List moduleDbFiledsEntities = getCreateMdm(mdmModuleEntity.getId(),mdmModuleDbEntity.getId(),"3"); + // mdmModuleDbFiledsEntities.addAll(moduleDbFiledsEntities); + // + // MdmModuleDbEntity mdmModuleDbEntity1 = new MdmModuleDbEntity(); + // mdmModuleDbEntity1.setMdmId(mdmModuleEntity.getId()); + // mdmModuleDbEntity1.setDbName(mainMdmModuleDb.getDbName()+"_option_log"); + // mdmModuleDbEntity1.setDbType("4"); + // mdmModuleDbEntity1.setDataType("1"); + // mdmModuleDbEntity1.setCreate(); + // mdmModuleDbEntities.add(mdmModuleDbEntity1); + // //新增 设置日志表 + // List moduleDbFiledsEntities1 = getCreateMdm(mdmModuleEntity.getId(),mdmModuleDbEntity1.getId(),"4"); + // mdmModuleDbFiledsEntities.addAll(moduleDbFiledsEntities1); + // } + // //保存单据规则 + // mdmServiceCache.saveMdmTableCodeRule(mdmModuleEntity.getId(),mdmTableCodeRuleEntities); + // //保存db + // mdmServiceCache.saveMdmModuleDb(mdmModuleEntity.getId(),mdmModuleDbEntities); + // //保存字段 + // mdmServiceCache.saveMdmModuleDbFileds(mdmModuleEntity.getId(),mdmModuleDbFiledsEntities); + // //保存规则 + // mdmServiceCache.saveMdmModuleDbFiledsRule(mdmModuleEntity.getId(),mdmModuleDbFiledsRuleEntities); + // //创建或者修改表 + // + // for (int i = 0; i < mdmModuleDbEntities.size(); i++) { + // Map maps = new HashMap<>(); + // maps.put("tableName", mdmModuleDbEntities.get(i).getDbName());//表名 + // maps.put("tableRemark", mdmModuleDbEntities.get(i).getRemark());//表备注 + // List dbFiledsDtos = new ArrayList<>(); + // for (int i1 = 0; i1 < mdmModuleDbFiledsEntities.size(); i1++) { + // if(mdmModuleDbEntities.get(i).getId().equals(mdmModuleDbFiledsEntities.get(i1).getDbId())){ + // dbFiledsDtos.add(new DbFiledsDto(mdmModuleDbFiledsEntities.get(i1).getDataType(), mdmModuleDbFiledsEntities.get(i1).getChName(), mdmModuleDbFiledsEntities.get(i1).getEnName(), mdmModuleDbFiledsEntities.get(i1).getFiledType(), mdmModuleDbFiledsEntities.get(i1).getFiledLength())); + // } + // } + // maps.put("databaseFields", dbFiledsDtos);//字段 + // if("1".equals(mdmModuleDbEntities.get(i).getDataType())){ + // mdmModuleDao.createTable(maps); + // }else { + // Map tablename = new HashMap<>(); + // tablename.put("tableName", mdmModuleDbEntities.get(i).getDbName());//表名 + // tablename.put("tableRemark", mdmModuleDbEntities.get(i).getRemark());//表备注 + // mdmModuleDao.alterTableName(tablename); + // mdmModuleDao.alterTable(maps); + // } + // } + // return BaseResult.getSuccessMessageEntity("保存数据源成功"); + //} + // + ///** + // * @Author lvleigang + // * @Description 新建设置默认字段 + // * @Date 2:06 下午 2024/6/3 + // * @param mdmId + // * @param dbId + // * @param type + // * @return java.util.List + // **/ + //private List getCreateMdm(String mdmId, String dbId, String type) { + // List mdmModuleDbFiledsEntities = new ArrayList<>(); + // MdmModuleDbFiledsEntity id = new MdmModuleDbFiledsEntity(); + // id.setMdmId(mdmId); + // id.setDbId(dbId); + // id.setChName("id"); + // id.setEnName("id"); + // id.setFiledType("3"); + // id.setAddType("2"); + // id.setUpdateType("2"); + // id.setShowType("2"); + // id.setQueryType("2"); + // id.setListType("2"); + // id.setViewType("2"); + // id.setFiledLength("50"); + // id.setDataType("1"); + // mdmModuleDbFiledsEntities.add(id); + // + // if("1".equals(type)){ + // MdmModuleDbFiledsEntity documentRule = new MdmModuleDbFiledsEntity(); + // documentRule.setMdmId(mdmId); + // documentRule.setDbId(dbId); + // documentRule.setChName("document_rule"); + // documentRule.setEnName("单据规则"); + // documentRule.setFiledType("3"); + // documentRule.setAddType("2"); + // documentRule.setUpdateType("1"); + // documentRule.setShowType("1"); + // documentRule.setQueryType("1"); + // documentRule.setListType("1"); + // documentRule.setViewType("1"); + // documentRule.setFiledLength("50"); + // documentRule.setDataType("1"); + // mdmModuleDbFiledsEntities.add(documentRule); + // } + // + // if("1".equals(type)){ + // MdmModuleDbFiledsEntity document_rule_num = new MdmModuleDbFiledsEntity(); + // document_rule_num.setMdmId(mdmId); + // document_rule_num.setDbId(dbId); + // document_rule_num.setChName("document_rule_num"); + // document_rule_num.setEnName("单据规则流水号"); + // document_rule_num.setFiledType("1"); + // document_rule_num.setAddType("2"); + // document_rule_num.setUpdateType("2"); + // document_rule_num.setShowType("2"); + // document_rule_num.setQueryType("2"); + // document_rule_num.setListType("2"); + // document_rule_num.setViewType("2"); + // document_rule_num.setFiledLength("50"); + // document_rule_num.setDataType("1"); + // mdmModuleDbFiledsEntities.add(document_rule_num); + // } + // if("2".equals(type) || "3".equals(type) || "4".equals(type) ){ + // MdmModuleDbFiledsEntity formmain_id = new MdmModuleDbFiledsEntity(); + // formmain_id.setMdmId(mdmId); + // formmain_id.setDbId(dbId); + // formmain_id.setChName("formmain_id"); + // formmain_id.setEnName("主表id"); + // formmain_id.setFiledType("3"); + // formmain_id.setAddType("2"); + // formmain_id.setUpdateType("2"); + // formmain_id.setShowType("2"); + // formmain_id.setQueryType("2"); + // formmain_id.setListType("2"); + // formmain_id.setViewType("2"); + // formmain_id.setFiledLength("50"); + // formmain_id.setDataType("1"); + // mdmModuleDbFiledsEntities.add(formmain_id); + // } + // //写入日志字段:操作人 + // if("3".equals(type)){ + // MdmModuleDbFiledsEntity source_name = new MdmModuleDbFiledsEntity(); + // source_name.setMdmId(mdmId); + // source_name.setDbId(dbId); + // source_name.setChName("source_name"); + // source_name.setEnName("来源名称"); + // source_name.setFiledType("3"); + // source_name.setAddType("2"); + // source_name.setUpdateType("2"); + // source_name.setShowType("2"); + // source_name.setQueryType("2"); + // source_name.setListType("2"); + // source_name.setViewType("2"); + // source_name.setFiledLength("50"); + // source_name.setDataType("1"); + // mdmModuleDbFiledsEntities.add(source_name); + // + // MdmModuleDbFiledsEntity code = new MdmModuleDbFiledsEntity(); + // code.setMdmId(mdmId); + // code.setDbId(dbId); + // code.setChName("code"); + // code.setEnName("编码"); + // code.setFiledType("3"); + // code.setAddType("2"); + // code.setUpdateType("2"); + // code.setShowType("2"); + // code.setQueryType("2"); + // code.setListType("2"); + // code.setViewType("2"); + // code.setFiledLength("50"); + // code.setDataType("1"); + // mdmModuleDbFiledsEntities.add(code); + // + // MdmModuleDbFiledsEntity source_data = new MdmModuleDbFiledsEntity(); + // source_data.setMdmId(mdmId); + // source_data.setDbId(dbId); + // source_data.setChName("source_data"); + // source_data.setEnName("源数据"); + // source_data.setFiledType("3"); + // source_data.setAddType("2"); + // source_data.setUpdateType("2"); + // source_data.setShowType("2"); + // source_data.setQueryType("2"); + // source_data.setListType("2"); + // source_data.setViewType("2"); + // source_data.setFiledLength("255"); + // source_data.setDataType("1"); + // mdmModuleDbFiledsEntities.add(source_data); + // + // MdmModuleDbFiledsEntity option_type = new MdmModuleDbFiledsEntity(); + // option_type.setMdmId(mdmId); + // option_type.setDbId(dbId); + // option_type.setChName("option_type"); + // option_type.setEnName("操作类型"); + // option_type.setFiledType("3"); + // option_type.setAddType("2"); + // option_type.setUpdateType("2"); + // option_type.setShowType("2"); + // option_type.setQueryType("2"); + // option_type.setListType("2"); + // option_type.setViewType("2"); + // option_type.setFiledLength("255"); + // option_type.setDataType("1"); + // mdmModuleDbFiledsEntities.add(option_type); + // + // MdmModuleDbFiledsEntity option_Name = new MdmModuleDbFiledsEntity(); + // option_Name.setMdmId(mdmId); + // option_Name.setDbId(dbId); + // option_Name.setChName("option_name"); + // option_Name.setEnName("操作人"); + // option_Name.setFiledType("3"); + // option_Name.setAddType("2"); + // option_Name.setUpdateType("2"); + // option_Name.setShowType("2"); + // option_Name.setQueryType("2"); + // option_Name.setListType("2"); + // option_Name.setViewType("2"); + // option_Name.setFiledLength("255"); + // option_Name.setDataType("1"); + // mdmModuleDbFiledsEntities.add(option_Name); + // } + // + // //目标应用、目标api、 + // if("4".equals(type)){ + // MdmModuleDbFiledsEntity target_app = new MdmModuleDbFiledsEntity(); + // target_app.setMdmId(mdmId); + // target_app.setDbId(dbId); + // target_app.setChName("target_app"); + // target_app.setEnName("目标应用"); + // target_app.setFiledType("1"); + // target_app.setAddType("2"); + // target_app.setUpdateType("2"); + // target_app.setShowType("2"); + // target_app.setQueryType("2"); + // target_app.setListType("2"); + // target_app.setViewType("2"); + // target_app.setFiledLength("50"); + // target_app.setDataType("1"); + // mdmModuleDbFiledsEntities.add(target_app); + // + // MdmModuleDbFiledsEntity target_api = new MdmModuleDbFiledsEntity(); + // target_api.setMdmId(mdmId); + // target_api.setDbId(dbId); + // target_api.setChName("target_api"); + // target_api.setEnName("目标api"); + // target_api.setFiledType("1"); + // target_api.setAddType("2"); + // target_api.setUpdateType("2"); + // target_api.setShowType("2"); + // target_api.setQueryType("2"); + // target_api.setListType("2"); + // target_api.setViewType("2"); + // target_api.setFiledLength("50"); + // target_api.setDataType("1"); + // mdmModuleDbFiledsEntities.add(target_api); + // + // MdmModuleDbFiledsEntity source_data = new MdmModuleDbFiledsEntity(); + // source_data.setMdmId(mdmId); + // source_data.setDbId(dbId); + // source_data.setChName("source_data"); + // source_data.setEnName("源数据"); + // source_data.setFiledType("3"); + // source_data.setAddType("2"); + // source_data.setUpdateType("2"); + // source_data.setShowType("2"); + // source_data.setQueryType("2"); + // source_data.setListType("2"); + // source_data.setViewType("2"); + // source_data.setFiledLength("255"); + // source_data.setDataType("1"); + // mdmModuleDbFiledsEntities.add(source_data); + // + // MdmModuleDbFiledsEntity option_type = new MdmModuleDbFiledsEntity(); + // option_type.setMdmId(mdmId); + // option_type.setDbId(dbId); + // option_type.setChName("option_type"); + // option_type.setEnName("操作类型"); + // option_type.setFiledType("3"); + // option_type.setAddType("2"); + // option_type.setUpdateType("2"); + // option_type.setShowType("2"); + // option_type.setQueryType("2"); + // option_type.setListType("2"); + // option_type.setViewType("2"); + // option_type.setFiledLength("255"); + // option_type.setDataType("1"); + // mdmModuleDbFiledsEntities.add(option_type); + // } + // if("2".equals(type) || "1".equals(type) ) { + // MdmModuleDbFiledsEntity data_status = new MdmModuleDbFiledsEntity(); + // data_status.setMdmId(mdmId); + // data_status.setDbId(dbId); + // data_status.setChName("data_status"); + // data_status.setEnName("数据状态 Y正常 N删除 F修改"); + // data_status.setFiledType("3"); + // data_status.setAddType("2"); + // data_status.setUpdateType("2"); + // data_status.setShowType("2"); + // data_status.setQueryType("2"); + // data_status.setListType("2"); + // data_status.setViewType("2"); + // data_status.setFiledLength("1"); + // data_status.setDataType("1"); + // mdmModuleDbFiledsEntities.add(data_status); + // } + // if("1".equals(type)){ + // MdmModuleDbFiledsEntity add_status = new MdmModuleDbFiledsEntity(); + // add_status.setMdmId(mdmId); + // add_status.setDbId(dbId); + // add_status.setChName("add_status"); + // add_status.setEnName("新增数据状态 0待下发 1已下发"); + // add_status.setFiledType("3"); + // add_status.setAddType("2"); + // add_status.setUpdateType("2"); + // add_status.setShowType("2"); + // add_status.setQueryType("2"); + // add_status.setListType("2"); + // add_status.setViewType("2"); + // add_status.setFiledLength("1"); + // add_status.setDataType("1"); + // mdmModuleDbFiledsEntities.add(add_status); + // } + // if("1".equals(type)){ + // MdmModuleDbFiledsEntity update_status = new MdmModuleDbFiledsEntity(); + // update_status.setMdmId(mdmId); + // update_status.setDbId(dbId); + // update_status.setChName("update_status"); + // update_status.setEnName("修改数据状态 0待下发 1已下发"); + // update_status.setFiledType("3"); + // update_status.setAddType("2"); + // update_status.setUpdateType("2"); + // update_status.setShowType("2"); + // update_status.setQueryType("2"); + // update_status.setListType("2"); + // update_status.setViewType("2"); + // update_status.setFiledLength("1"); + // update_status.setDataType("1"); + // mdmModuleDbFiledsEntities.add(update_status); + // } + // + // if("1".equals(type)){ + // MdmModuleDbFiledsEntity delete_status = new MdmModuleDbFiledsEntity(); + // delete_status.setMdmId(mdmId); + // delete_status.setDbId(dbId); + // delete_status.setChName("delete_status"); + // delete_status.setEnName("删除数据状态 0待下发 1已下发"); + // delete_status.setFiledType("3"); + // delete_status.setAddType("2"); + // delete_status.setUpdateType("2"); + // delete_status.setShowType("2"); + // delete_status.setQueryType("2"); + // delete_status.setListType("2"); + // delete_status.setViewType("2"); + // delete_status.setFiledLength("1"); + // delete_status.setDataType("1"); + // mdmModuleDbFiledsEntities.add(delete_status); + // } + // + // MdmModuleDbFiledsEntity sorts = new MdmModuleDbFiledsEntity(); + // sorts.setMdmId(mdmId); + // sorts.setDbId(dbId); + // sorts.setChName("sorts"); + // sorts.setEnName("排序"); + // sorts.setFiledType("1"); + // sorts.setAddType("2"); + // sorts.setUpdateType("2"); + // sorts.setShowType("2"); + // sorts.setQueryType("2"); + // sorts.setListType("2"); + // sorts.setViewType("2"); + // sorts.setFiledLength("20"); + // sorts.setDataType("1"); + // mdmModuleDbFiledsEntities.add(sorts); + // MdmModuleDbFiledsEntity create_user_id = new MdmModuleDbFiledsEntity(); + // create_user_id.setMdmId(mdmId); + // create_user_id.setDbId(dbId); + // create_user_id.setChName("create_user_id"); + // create_user_id.setEnName("创建人id"); + // create_user_id.setFiledType("3"); + // create_user_id.setAddType("2"); + // create_user_id.setUpdateType("2"); + // create_user_id.setShowType("2"); + // create_user_id.setQueryType("2"); + // create_user_id.setListType("2"); + // create_user_id.setViewType("2"); + // create_user_id.setFiledLength("50"); + // create_user_id.setDataType("1"); + // mdmModuleDbFiledsEntities.add(create_user_id); + // MdmModuleDbFiledsEntity create_time = new MdmModuleDbFiledsEntity(); + // create_time.setMdmId(mdmId); + // create_time.setDbId(dbId); + // create_time.setChName("create_time"); + // create_time.setEnName("创建时间"); + // create_time.setFiledType("4"); + // create_time.setAddType("2"); + // create_time.setUpdateType("2"); + // create_time.setShowType("2"); + // create_time.setQueryType("2"); + // create_time.setListType("2"); + // create_time.setViewType("2"); + // create_time.setFiledLength("50"); + // create_time.setDataType("1"); + // mdmModuleDbFiledsEntities.add(create_time); + // MdmModuleDbFiledsEntity modify_user_id = new MdmModuleDbFiledsEntity(); + // modify_user_id.setMdmId(mdmId); + // modify_user_id.setDbId(dbId); + // modify_user_id.setChName("modify_user_id"); + // modify_user_id.setEnName("修改人id"); + // modify_user_id.setFiledType("3"); + // modify_user_id.setAddType("2"); + // modify_user_id.setUpdateType("2"); + // modify_user_id.setShowType("2"); + // modify_user_id.setQueryType("2"); + // modify_user_id.setListType("2"); + // modify_user_id.setViewType("2"); + // modify_user_id.setFiledLength("50"); + // modify_user_id.setDataType("1"); + // mdmModuleDbFiledsEntities.add(modify_user_id); + // MdmModuleDbFiledsEntity modify_time = new MdmModuleDbFiledsEntity(); + // modify_time.setMdmId(mdmId); + // modify_time.setDbId(dbId); + // modify_time.setChName("modify_time"); + // modify_time.setEnName("修改时间"); + // modify_time.setFiledType("4"); + // modify_time.setAddType("2"); + // modify_time.setUpdateType("2"); + // modify_time.setShowType("2"); + // modify_time.setQueryType("2"); + // modify_time.setListType("2"); + // modify_time.setViewType("2"); + // modify_time.setFiledLength("50"); + // modify_time.setDataType("1"); + // mdmModuleDbFiledsEntities.add(modify_time); + // MdmModuleDbFiledsEntity sts = new MdmModuleDbFiledsEntity(); + // sts.setMdmId(mdmId); + // sts.setDbId(dbId); + // sts.setChName("sts"); + // sts.setEnName("状态(Y正常N删除)"); + // sts.setFiledType("3"); + // sts.setAddType("2"); + // sts.setUpdateType("2"); + // sts.setShowType("2"); + // sts.setQueryType("2"); + // sts.setListType("2"); + // sts.setViewType("2"); + // sts.setFiledLength("1"); + // sts.setDataType("1"); + // mdmModuleDbFiledsEntities.add(sts); + // MdmModuleDbFiledsEntity org_id = new MdmModuleDbFiledsEntity(); + // org_id.setMdmId(mdmId); + // org_id.setDbId(dbId); + // org_id.setChName("org_id"); + // org_id.setEnName("组织机构ID"); + // org_id.setFiledType("3"); + // org_id.setAddType("2"); + // org_id.setUpdateType("2"); + // org_id.setShowType("2"); + // org_id.setQueryType("2"); + // org_id.setListType("2"); + // org_id.setViewType("2"); + // org_id.setFiledLength("50"); + // org_id.setDataType("1"); + // mdmModuleDbFiledsEntities.add(org_id); + // MdmModuleDbFiledsEntity company_id = new MdmModuleDbFiledsEntity(); + // company_id.setMdmId(mdmId); + // company_id.setDbId(dbId); + // company_id.setChName("company_id"); + // company_id.setEnName("公司id"); + // company_id.setFiledType("3"); + // company_id.setAddType("2"); + // company_id.setUpdateType("2"); + // company_id.setShowType("2"); + // company_id.setQueryType("2"); + // company_id.setListType("2"); + // company_id.setViewType("2"); + // company_id.setFiledLength("50"); + // company_id.setDataType("1"); + // mdmModuleDbFiledsEntities.add(company_id); + // return mdmModuleDbFiledsEntities; //} // - /** - * @param tableName - * @return java.lang.Long - * @Author lvleigang - * @Description 校验表是否存在 - * @Date 3:58 下午 2023/7/11 - **/ - private boolean checkTable(String tableName) { - Map maps = new HashMap<>(); - maps.put("tableName", tableName); - Integer i = mdmModuleDao.checkTable(maps); - if (i != null && i > 0) { - return true; - } - return false; - } // ///** // * @param object @@ -2154,49 +1007,47 @@ public class MdmServiceImpl implements IMdmService { // **/ //@Override //public JsonResultEntity queryMdmModuleView(JSONObject object) { - // MdmDto entity = getData("jsonStr", object, MdmDto.class); + // MdmModuleEntity entity = getData("jsonStr", object, MdmModuleEntity.class); + // //判断分页 // if (entity == null) { - // return BaseResult.getFailureMessageEntity("参数不允许为空"); + // return BaseResult.getFailureMessageEntity("系统错误"); // } - // if (entity.getId() == null || "".equals(entity.getId())) { + // if (entity.getMdmCode() == null || "".equals(entity.getMdmCode())) { // return BaseResult.getFailureMessageEntity("系统错误"); // } // MdmModuleViewVo mdmModuleViewVo = new MdmModuleViewVo(); - // //查询设置各种类型字段 - // //查询模版数据源 + // + // MdmModuleEntity mdmModuleEntity = mdmServiceCache.getMdmModuleEntity(entity.getMdmCode()); + // //查询数据库字段 // MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); - // mdmModuleDbEntity.setMdmId(entity.getId()); + // mdmModuleDbEntity.setMdmId(mdmModuleEntity.getId()); // mdmModuleDbEntity.setSts("Y"); - // List mdmModuleDbEntityList = mdmModuleDbDao.queryBase(mdmModuleDbEntity); - // if (mdmModuleDbEntityList != null && mdmModuleDbEntityList.size() > 0) { - // MdmModuleDbFiledsEntity mdmModuleDbFiledsEntity = new MdmModuleDbFiledsEntity(); - // mdmModuleDbFiledsEntity.setMdmId(entity.getId()); - // mdmModuleDbFiledsEntity.setSts("Y"); - // List mdmModuleDbFiledsEntityList = mdmModuleDbFiledsDao.queryBase(mdmModuleDbFiledsEntity); - // setFiledType(mdmModuleViewVo, mdmModuleDbEntityList, mdmModuleDbFiledsEntityList); - // } - // //查询数据库设置的字段 + // List mdmModuleDbEntities = mdmServiceCache.queryMdmModuleDb(mdmModuleDbEntity); + // MdmModuleDbFiledsEntity mdmModuleDbFiledsEntity = new MdmModuleDbFiledsEntity(); + // mdmModuleDbFiledsEntity.setMdmId(mdmModuleEntity.getId()); + // mdmModuleDbFiledsEntity.setSts("Y"); + // List mdmModuleDbFiledsEntities = mdmServiceCache.queryMdmModuleDbFileds(mdmModuleDbFiledsEntity); + // + // //设置数据库字段 + // setFiledType(mdmModuleViewVo,mdmModuleDbEntities,mdmModuleDbFiledsEntities); + // + // MdmModuleViewDetailEntity mdmModuleViewDetailEntity = new MdmModuleViewDetailEntity(); + // mdmModuleViewDetailEntity.setMdmId(mdmModuleEntity.getId()); + // mdmModuleViewDetailEntity.setSts("Y"); + // List mdmModuleViewDetailEntities = mdmServiceCache.queryMdmModuleViewDetail(mdmModuleViewDetailEntity); + // setDbFiledType(mdmModuleViewVo,mdmModuleViewDetailEntities); // MdmModuleViewEntity mdmModuleViewEntity = new MdmModuleViewEntity(); - // mdmModuleViewEntity.setMdmId(entity.getId()); + // mdmModuleViewEntity.setMdmId(mdmModuleEntity.getId()); // mdmModuleViewEntity.setSts("Y"); - // List moduleViewEntityList = mdmModuleViewDao.queryBase(mdmModuleViewEntity); - // if (moduleViewEntityList != null && moduleViewEntityList.size() == 1) { - // mdmModuleViewVo.setMdmModuleViewEntity(moduleViewEntityList.get(0)); - // //查询明细 - // MdmModuleViewDetailEntity mdmModuleViewDetailEntity = new MdmModuleViewDetailEntity(); - // mdmModuleViewDetailEntity.setMdmId(entity.getId()); - // mdmModuleViewDetailEntity.setViewId(moduleViewEntityList.get(0).getId()); - // mdmModuleViewDetailEntity.setSts("Y"); - // List mdmModuleViewDetailEntityList = mdmModuleViewDetailDao.queryBase(mdmModuleViewDetailEntity); - // setDbFiledType(mdmModuleViewVo, mdmModuleViewDetailEntityList); - // } else { - // mdmModuleViewVo.setMdmModuleViewEntity(new MdmModuleViewEntity()); - // mdmModuleViewVo.setDbAddFiled(new ArrayList<>()); - // mdmModuleViewVo.setDbEditFiled(new ArrayList<>()); - // mdmModuleViewVo.setDbShowFiled(new ArrayList<>()); - // mdmModuleViewVo.setDbQueryFiled(new ArrayList<>()); - // mdmModuleViewVo.setDbListFiled(new ArrayList<>()); + // List moduleViewEntities = mdmServiceCache.queryMdmModuleView(mdmModuleViewEntity); + // if(moduleViewEntities != null && moduleViewEntities.size() == 1){ + // mdmModuleViewVo.setMdmModuleViewEntity(moduleViewEntities.get(0)); // } + // MdmModuleViewButtonEntity mdmModuleViewButtonEntity = new MdmModuleViewButtonEntity(); + // mdmModuleViewButtonEntity.setMdmId(mdmModuleEntity.getId()); + // mdmModuleViewButtonEntity.setSts("Y"); + // List mdmModuleViewButtonEntities = mdmServiceCache.queryMdmModuleViewButton(mdmModuleViewButtonEntity); + // mdmModuleViewVo.setDbButtonFiled(mdmModuleViewButtonEntities); // return BaseResult.getSuccessMessageEntity("查询视图成功", mdmModuleViewVo); //} // @@ -2263,22 +1114,46 @@ public class MdmServiceImpl implements IMdmService { // List listFiled = new ArrayList<>(); // if (mdmModuleDbEntityList != null && mdmModuleDbEntityList.size() > 0) { // for (int i = 0; i < mdmModuleDbEntityList.size(); i++) { + // // if (mdmModuleDbFiledsEntityList != null && mdmModuleDbFiledsEntityList.size() > 0) { // for (int i1 = 0; i1 < mdmModuleDbFiledsEntityList.size(); i1++) { // if (mdmModuleDbEntityList.get(i).getId().equals(mdmModuleDbFiledsEntityList.get(i1).getDbId())) { - // if ("1".equals(mdmModuleDbEntityList.get(i).getDbType())) { - // //1、主表 - // addFiled.add(new MdmDbFiledVo(mdmModuleDbFiledsEntityList.get(i1).getId(), "【主表:" + mdmModuleDbEntityList.get(i).getDbName() + "】" + mdmModuleDbFiledsEntityList.get(i1).getChName())); - // editFiled.add(new MdmDbFiledVo(mdmModuleDbFiledsEntityList.get(i1).getId(), "【主表:" + mdmModuleDbEntityList.get(i).getDbName() + "】" + mdmModuleDbFiledsEntityList.get(i1).getChName())); - // showFiled.add(new MdmDbFiledVo(mdmModuleDbFiledsEntityList.get(i1).getId(), "【主表:" + mdmModuleDbEntityList.get(i).getDbName() + "】" + mdmModuleDbFiledsEntityList.get(i1).getChName())); - // queryFiled.add(new MdmDbFiledVo(mdmModuleDbFiledsEntityList.get(i1).getId(), "【主表:" + mdmModuleDbEntityList.get(i).getDbName() + "】" + mdmModuleDbFiledsEntityList.get(i1).getChName())); - // listFiled.add(new MdmDbFiledVo(mdmModuleDbFiledsEntityList.get(i1).getId(), "【主表:" + mdmModuleDbEntityList.get(i).getDbName() + "】" + mdmModuleDbFiledsEntityList.get(i1).getChName())); - // } else { - // //2、明细 - // queryFiled.add(new MdmDbFiledVo(mdmModuleDbFiledsEntityList.get(i1).getId(), "【子表:" + mdmModuleDbEntityList.get(i).getDbName() + "】" + mdmModuleDbFiledsEntityList.get(i1).getChName())); - // addFiled.add(new MdmDbFiledVo(mdmModuleDbFiledsEntityList.get(i1).getId(), "【子表:" + mdmModuleDbEntityList.get(i).getDbName() + "】" + mdmModuleDbFiledsEntityList.get(i1).getChName())); - // editFiled.add(new MdmDbFiledVo(mdmModuleDbFiledsEntityList.get(i1).getId(), "【子表:" + mdmModuleDbEntityList.get(i).getDbName() + "】" + mdmModuleDbFiledsEntityList.get(i1).getChName())); - // showFiled.add(new MdmDbFiledVo(mdmModuleDbFiledsEntityList.get(i1).getId(), "【子表:" + mdmModuleDbEntityList.get(i).getDbName() + "】" + mdmModuleDbFiledsEntityList.get(i1).getChName())); + // if("1".equals(mdmModuleDbFiledsEntityList.get(i1).getViewType())){ + // if ("1".equals(mdmModuleDbEntityList.get(i).getDbType())) { + // //1、主表 + // if ("1".equals(mdmModuleDbFiledsEntityList.get(i1).getAddType())) { + // addFiled.add(new MdmDbFiledVo(mdmModuleDbFiledsEntityList.get(i1).getId(), "【主表:" + mdmModuleDbEntityList.get(i).getDbName() + "】" + mdmModuleDbFiledsEntityList.get(i1).getChName())); + // } + // if ("1".equals(mdmModuleDbFiledsEntityList.get(i1).getUpdateType())) { + // editFiled.add(new MdmDbFiledVo(mdmModuleDbFiledsEntityList.get(i1).getId(), "【主表:" + mdmModuleDbEntityList.get(i).getDbName() + "】" + mdmModuleDbFiledsEntityList.get(i1).getChName())); + // } + // if ("1".equals(mdmModuleDbFiledsEntityList.get(i1).getShowType())) { + // showFiled.add(new MdmDbFiledVo(mdmModuleDbFiledsEntityList.get(i1).getId(), "【主表:" + mdmModuleDbEntityList.get(i).getDbName() + "】" + mdmModuleDbFiledsEntityList.get(i1).getChName())); + // } + // if ("1".equals(mdmModuleDbFiledsEntityList.get(i1).getQueryType())) { + // queryFiled.add(new MdmDbFiledVo(mdmModuleDbFiledsEntityList.get(i1).getId(), "【主表:" + mdmModuleDbEntityList.get(i).getDbName() + "】" + mdmModuleDbFiledsEntityList.get(i1).getChName())); + // } + // if ("1".equals(mdmModuleDbFiledsEntityList.get(i1).getListType())) { + // listFiled.add(new MdmDbFiledVo(mdmModuleDbFiledsEntityList.get(i1).getId(), "【主表:" + mdmModuleDbEntityList.get(i).getDbName() + "】" + mdmModuleDbFiledsEntityList.get(i1).getChName())); + // } + // } else if ("2".equals(mdmModuleDbEntityList.get(i).getDbType())){ + // //2、明细 + // if ("1".equals(mdmModuleDbFiledsEntityList.get(i1).getAddType())) { + // addFiled.add(new MdmDbFiledVo(mdmModuleDbFiledsEntityList.get(i1).getId(), "【子表:" + mdmModuleDbEntityList.get(i).getDbName() + "】" + mdmModuleDbFiledsEntityList.get(i1).getChName())); + // } + // if ("1".equals(mdmModuleDbFiledsEntityList.get(i1).getUpdateType())) { + // editFiled.add(new MdmDbFiledVo(mdmModuleDbFiledsEntityList.get(i1).getId(), "【子表:" + mdmModuleDbEntityList.get(i).getDbName() + "】" + mdmModuleDbFiledsEntityList.get(i1).getChName())); + // } + // if ("1".equals(mdmModuleDbFiledsEntityList.get(i1).getShowType())) { + // showFiled.add(new MdmDbFiledVo(mdmModuleDbFiledsEntityList.get(i1).getId(), "【子表:" + mdmModuleDbEntityList.get(i).getDbName() + "】" + mdmModuleDbFiledsEntityList.get(i1).getChName())); + // } + // if ("1".equals(mdmModuleDbFiledsEntityList.get(i1).getQueryType())) { + // queryFiled.add(new MdmDbFiledVo(mdmModuleDbFiledsEntityList.get(i1).getId(), "【子表:" + mdmModuleDbEntityList.get(i).getDbName() + "】" + mdmModuleDbFiledsEntityList.get(i1).getChName())); + // } + // if ("1".equals(mdmModuleDbFiledsEntityList.get(i1).getListType())) { + // listFiled.add(new MdmDbFiledVo(mdmModuleDbFiledsEntityList.get(i1).getId(), "【子表:" + mdmModuleDbEntityList.get(i).getDbName() + "】" + mdmModuleDbFiledsEntityList.get(i1).getChName())); + // } + // } // } // } // } @@ -2291,577 +1166,1679 @@ public class MdmServiceImpl implements IMdmService { // mdmModuleViewVo.setQueryFiled(queryFiled); // mdmModuleViewVo.setListFiled(listFiled); //} + ///** + // * @param object + // * @return com.hzya.frame.web.entity.JsonResultEntity + // * @Author lvleigang + // * @Description 主数据设置修改显示信息 + // * @Date 9:40 上午 2023/10/18 + // **/ + //@Override + //public JsonResultEntity doSaveMdmModuleView(JSONObject object) { + // MdmModuleViewDto entity = getData("jsonStr", object, MdmModuleViewDto.class); + // //判断是否有数据 + // if (entity == null) { + // return BaseResult.getFailureMessageEntity("参数不允许为空"); + // } + // if (entity.getMdmCode() == null || "".equals(entity.getMdmCode())) { + // return BaseResult.getFailureMessageEntity("系统错误"); + // } + // if (entity.getMdmModuleViewEntity() == null) { + // return BaseResult.getFailureMessageEntity("参数不允许为空"); + // } + // MdmModuleEntity mdmModuleEntity = mdmServiceCache.getMdmModuleEntity(entity.getMdmCode()); + // + // //保存视图 + // MdmModuleViewEntity mdmModuleViewEntity = entity.getMdmModuleViewEntity(); + // mdmModuleViewEntity.setMdmId(mdmModuleEntity.getId()); + // if(mdmModuleViewEntity.getId() != null && !"".equals(mdmModuleViewEntity.getId())){ + // mdmModuleViewEntity.setDataType("2"); + // mdmModuleViewEntity.setUpdate(); + // mdmServiceCache.saveMdmModuleView(mdmModuleEntity.getId(),mdmModuleViewEntity); + // }else { + // mdmModuleViewEntity.setDataType("1"); + // mdmModuleViewEntity.setCreate(); + // mdmModuleViewDao.save(mdmModuleViewEntity); + // } + // //保存字段 + // List mdmModuleViewDetailEntities = new ArrayList<>(); + // //1、查询2、列表3、新增4、修改 5、查看 + // saveDbViewFiled(mdmModuleEntity.getId(),mdmModuleViewEntity.getId(),entity.getQueryFiled(),"1",mdmModuleViewDetailEntities); + // saveDbViewFiled(mdmModuleEntity.getId(),mdmModuleViewEntity.getId(),entity.getListFiled(),"2",mdmModuleViewDetailEntities); + // saveDbViewFiled(mdmModuleEntity.getId(),mdmModuleViewEntity.getId(),entity.getAddFiled(),"3",mdmModuleViewDetailEntities); + // saveDbViewFiled(mdmModuleEntity.getId(),mdmModuleViewEntity.getId(),entity.getEditFiled(),"4",mdmModuleViewDetailEntities); + // saveDbViewFiled(mdmModuleEntity.getId(),mdmModuleViewEntity.getId(),entity.getShowFiled(),"5",mdmModuleViewDetailEntities); + // mdmServiceCache.saveMdmModuleViewDetail(mdmModuleEntity.getId(),mdmModuleViewDetailEntities); + // //保存按钮 + // List mdmModuleViewButtonEntities = entity.getDbButtonFiled(); + // if(mdmModuleViewButtonEntities != null && mdmModuleViewButtonEntities.size() > 0){ + // for (int i = 0; i < mdmModuleViewButtonEntities.size(); i++) { + // mdmModuleViewButtonEntities.get(i).setMdmId(mdmModuleEntity.getId()); + // mdmModuleViewButtonEntities.get(i).setViewId(mdmModuleViewEntity.getId()); + // if(mdmModuleViewButtonEntities.get(i).getId() != null && !"".equals(mdmModuleViewButtonEntities.get(i).getId())){ + // mdmModuleViewButtonEntities.get(i).setDataType("2"); + // mdmModuleViewButtonEntities.get(i).setUpdate(); + // }else { + // mdmModuleViewButtonEntities.get(i).setDataType("1"); + // mdmModuleViewButtonEntities.get(i).setCreate(); + // } + // } + // mdmServiceCache.saveMdmModuleViewButton(mdmModuleEntity.getId(),mdmModuleViewButtonEntities); + // } + // + // //保存菜单 + // //保存按钮 + // + // if("1".equals(mdmModuleViewEntity.getDataType())){ + // //新增 + // SysMenuConfigEntity module = new SysMenuConfigEntity(); + // module.setCreate(); + // module.setFormId(mdmModuleEntity.getId()); + // if("1".equals(mdmModuleEntity.getMdmType())){ + // //1、档案 + // module.setParentMenuId("ea22757e99c144fb9ef381dd322e233c"); + // }else { + // //2、单据 + // module.setParentMenuId("58714ddb7ec94f5da91df74efada042f"); + // } + // module.setMenuName(mdmModuleEntity.getMdmName()); + // module.setMenuEnglishName("integrationOptionAdmin" + mdmModuleEntity.getMdmCode()); + // module.setMenuIcon(null);//模块图标 + // module.setRoute("integrationOptionAdmin/" + mdmModuleEntity.getMdmCode());//路由地址 + // module.setMenuPage("integrationOptionV2/index");//一级Layout 二级 ParntView 三级component + // module.setRemark("主数据生成菜单"); + // module.setVisibles("0"); + // module.setShowType("1"); + // JSONObject object1 = new JSONObject(); + // object1.put("mdmId", mdmModuleEntity.getId());//主数据id + // object1.put("mdmCode", mdmModuleEntity.getMdmCode());//主数据编码 + // object1.put("viewType", mdmModuleViewEntity.getViewName());//1、树 2、列表 + // module.setOptions(object1.toString());//菜单mate参数 + // sysMenuConfigDao.save(module); + // if(mdmModuleViewButtonEntities != null && mdmModuleViewButtonEntities.size() > 0){ + // for (int i = 0; i < mdmModuleViewButtonEntities.size(); i++) { + // if("new".equals(mdmModuleViewButtonEntities.get(i).getButtonValue())){ + // SysButtonConfigEntity xz = new SysButtonConfigEntity(); + // xz.setCode("new"); + // xz.setNameCh("新建"); + // xz.setNameEn("new"); + // xz.setMenuId(module.getId()); + // xz.setIconName(""); + // xz.setStyles(""); + // xz.setBtnFunction("new"); + // xz.setRemark("主数据新建按钮"); + // xz.setCreate(); + // sysButtonConfigDao.save(xz); + // } + // if("resize".equals(mdmModuleViewButtonEntities.get(i).getButtonValue())){ + // + // SysButtonConfigEntity cz = new SysButtonConfigEntity(); + // cz.setCode("resize"); + // cz.setNameCh("重置"); + // cz.setNameEn("resize"); + // cz.setMenuId(module.getId()); + // cz.setIconName(""); + // cz.setStyles(""); + // cz.setBtnFunction("resize"); + // cz.setRemark("主数据重置按钮"); + // cz.setCreate(); + // sysButtonConfigDao.save(cz); + // } + // if("search".equals(mdmModuleViewButtonEntities.get(i).getButtonValue())) { + // + // SysButtonConfigEntity cx = new SysButtonConfigEntity(); + // cx.setCode("search"); + // cx.setNameCh("查询"); + // cx.setNameEn("search"); + // cx.setMenuId(module.getId()); + // cx.setIconName(""); + // cx.setStyles(""); + // cx.setBtnFunction("search"); + // cx.setRemark("主数据查询按钮"); + // cx.setCreate(); + // sysButtonConfigDao.save(cx); + // } + // if("edit".equals(mdmModuleViewButtonEntities.get(i).getButtonValue())) { + // + // SysButtonConfigEntity xg = new SysButtonConfigEntity(); + // xg.setCode("edit"); + // xg.setNameCh("修改"); + // xg.setNameEn("edit"); + // xg.setMenuId(module.getId()); + // xg.setIconName(""); + // xg.setStyles(""); + // xg.setBtnFunction("edit"); + // xg.setRemark("主数据修改按钮"); + // xg.setCreate(); + // sysButtonConfigDao.save(xg); + // } + // if("dele".equals(mdmModuleViewButtonEntities.get(i).getButtonValue())) { + // + // SysButtonConfigEntity sc = new SysButtonConfigEntity(); + // sc.setCode("dele"); + // sc.setNameCh("删除"); + // sc.setNameEn("dele"); + // sc.setMenuId(module.getId()); + // sc.setIconName(""); + // sc.setStyles(""); + // sc.setBtnFunction("dele"); + // sc.setRemark("主数据删除按钮"); + // sc.setCreate(); + // sysButtonConfigDao.save(sc); + // } + // if("view".equals(mdmModuleViewButtonEntities.get(i).getButtonValue())) { + // + // SysButtonConfigEntity ck = new SysButtonConfigEntity(); + // ck.setCode("view"); + // ck.setNameCh("查看"); + // ck.setNameEn("view"); + // ck.setMenuId(module.getId()); + // ck.setIconName(""); + // ck.setStyles(""); + // ck.setBtnFunction("view"); + // ck.setRemark("主数据查看按钮"); + // ck.setCreate(); + // sysButtonConfigDao.save(ck); + // } + // if("send".equals(mdmModuleViewButtonEntities.get(i).getButtonValue())) { + // SysButtonConfigEntity xf = new SysButtonConfigEntity(); + // xf.setCode("send"); + // xf.setNameCh("下发"); + // xf.setNameEn("send"); + // xf.setMenuId(module.getId()); + // xf.setIconName(""); + // xf.setStyles(""); + // xf.setBtnFunction("send"); + // xf.setRemark("主数据下发按钮"); + // xf.setCreate(); + // sysButtonConfigDao.save(xf); + // } + // } + // } + // }else { + // //修改 + // //修改菜单 注意因为可能修改显示类型,所以需要修改菜单的属性 + // SysMenuConfigEntity module = new SysMenuConfigEntity(); + // module.setFormId(mdmModuleEntity.getId()); + // module.setSts("Y"); + // List moduleList = sysMenuConfigDao.queryBase(module); + // if (moduleList != null && moduleList.size() == 1) { + // module = moduleList.get(0); + // module.setUpdate(); + // module.setMenuName(mdmModuleEntity.getMdmName()); + // JSONObject object1 = new JSONObject(); + // object1.put("mdmId", mdmModuleEntity.getId());//主数据id + // object1.put("mdmCode", mdmModuleEntity.getMdmCode());//主数据id + // object1.put("viewType", mdmModuleViewEntity.getViewName());//1、树 2、列表 + // module.setOptions(object1.toString());//菜单mate参数 + // sysMenuConfigDao.update(module); + // //修改按钮 + // //1、查询所有按钮 + // SysButtonConfigEntity buttonConfigEntity = new SysButtonConfigEntity(); + // buttonConfigEntity.setMenuId(module.getId()); + // buttonConfigEntity.setSts("Y"); + // List sysButtonConfigEntities = sysButtonConfigDao.queryBase(buttonConfigEntity); + // //1、查询按钮权限 + // SysPopedomOperateEntity sysPopedomOperateEntity = new SysPopedomOperateEntity(); + // sysPopedomOperateEntity.setMenuId(module.getId()); + // sysPopedomOperateEntity.setSts("Y"); + // List sysPopedomOperateEntities = sysPopedomOperateDao.queryBase(sysPopedomOperateEntity); + // //删除按钮和删除按钮权限 + // sysButtonConfigDao.logicRemoveMultiCondition(buttonConfigEntity); + // sysPopedomOperateDao.logicRemoveMultiCondition(sysPopedomOperateEntity); + // //删除处理权限 + // doMdmModuleButton(module,mdmModuleViewButtonEntities,sysButtonConfigEntities,sysPopedomOperateEntities); + // } + // } + // return BaseResult.getSuccessMessageEntity("保存显示信息成功"); + //} + // + ///** + // * @Author lvleigang + // * @Description + // * @Date 3:29 下午 2024/6/4 + // * @param module 菜单 + // * @param mdmModuleViewButtonEntities 主数据按钮 + // * @param sysButtonConfigEntities 菜单按钮 + // * @param sysPopedomOperateEntities 按钮权限 + // * @return void + // **/ + //private void doMdmModuleButton(SysMenuConfigEntity module,List mdmModuleViewButtonEntities, List sysButtonConfigEntities, List sysPopedomOperateEntities) { + // //循环设置的按钮,再循环菜单的按钮,如果有把原先的修改状态,如果没有新增 + // if(mdmModuleViewButtonEntities != null && mdmModuleViewButtonEntities.size() > 0){ + // for (int i = 0; i < mdmModuleViewButtonEntities.size(); i++) { + // boolean flag = false; + // if(sysButtonConfigEntities != null && sysButtonConfigEntities.size() > 0){ + // for (int i1 = 0; i1 < sysButtonConfigEntities.size(); i1++) { + // if(mdmModuleViewButtonEntities.get(i).getButtonValue().equals(sysButtonConfigEntities.get(i1).getCode())){ + // flag = true; + // sysButtonConfigEntities.get(i1).setSts("Y"); + // sysButtonConfigEntities.get(i1).setUpdate(); + // sysButtonConfigDao.update(sysButtonConfigEntities.get(i1)); + // if(sysPopedomOperateEntities != null && sysPopedomOperateEntities.size() > 0){ + // for (int i2 = 0; i2 < sysPopedomOperateEntities.size(); i2++) { + // if(sysPopedomOperateEntities.get(i2).getOperate().equals(sysButtonConfigEntities.get(i1).getId())){ + // sysPopedomOperateEntities.get(i2).setSts("Y"); + // sysPopedomOperateEntities.get(i2).setUpdate(); + // sysPopedomOperateDao.update(sysPopedomOperateEntities.get(i2)); + // } + // } + // } + // break; + // } + // } + // } + // //原先没有需要新增 + // if(!flag){ + // if("new".equals(mdmModuleViewButtonEntities.get(i).getButtonValue())){ + // SysButtonConfigEntity xz = new SysButtonConfigEntity(); + // xz.setCode("new"); + // xz.setNameCh("新建"); + // xz.setNameEn("new"); + // xz.setMenuId(module.getId()); + // xz.setIconName(""); + // xz.setStyles(""); + // xz.setBtnFunction("new"); + // xz.setRemark("主数据新建按钮"); + // xz.setCreate(); + // sysButtonConfigDao.save(xz); + // } + // if("resize".equals(mdmModuleViewButtonEntities.get(i).getButtonValue())){ + // + // SysButtonConfigEntity cz = new SysButtonConfigEntity(); + // cz.setCode("resize"); + // cz.setNameCh("重置"); + // cz.setNameEn("resize"); + // cz.setMenuId(module.getId()); + // cz.setIconName(""); + // cz.setStyles(""); + // cz.setBtnFunction("resize"); + // cz.setRemark("主数据重置按钮"); + // cz.setCreate(); + // sysButtonConfigDao.save(cz); + // } + // if("search".equals(mdmModuleViewButtonEntities.get(i).getButtonValue())) { + // + // SysButtonConfigEntity cx = new SysButtonConfigEntity(); + // cx.setCode("search"); + // cx.setNameCh("查询"); + // cx.setNameEn("search"); + // cx.setMenuId(module.getId()); + // cx.setIconName(""); + // cx.setStyles(""); + // cx.setBtnFunction("search"); + // cx.setRemark("主数据查询按钮"); + // cx.setCreate(); + // sysButtonConfigDao.save(cx); + // } + // if("edit".equals(mdmModuleViewButtonEntities.get(i).getButtonValue())) { + // + // SysButtonConfigEntity xg = new SysButtonConfigEntity(); + // xg.setCode("edit"); + // xg.setNameCh("修改"); + // xg.setNameEn("edit"); + // xg.setMenuId(module.getId()); + // xg.setIconName(""); + // xg.setStyles(""); + // xg.setBtnFunction("edit"); + // xg.setRemark("主数据修改按钮"); + // xg.setCreate(); + // sysButtonConfigDao.save(xg); + // } + // if("dele".equals(mdmModuleViewButtonEntities.get(i).getButtonValue())) { + // + // SysButtonConfigEntity sc = new SysButtonConfigEntity(); + // sc.setCode("dele"); + // sc.setNameCh("删除"); + // sc.setNameEn("dele"); + // sc.setMenuId(module.getId()); + // sc.setIconName(""); + // sc.setStyles(""); + // sc.setBtnFunction("dele"); + // sc.setRemark("主数据删除按钮"); + // sc.setCreate(); + // sysButtonConfigDao.save(sc); + // } + // if("view".equals(mdmModuleViewButtonEntities.get(i).getButtonValue())) { + // + // SysButtonConfigEntity ck = new SysButtonConfigEntity(); + // ck.setCode("view"); + // ck.setNameCh("查看"); + // ck.setNameEn("view"); + // ck.setMenuId(module.getId()); + // ck.setIconName(""); + // ck.setStyles(""); + // ck.setBtnFunction("view"); + // ck.setRemark("主数据查看按钮"); + // ck.setCreate(); + // sysButtonConfigDao.save(ck); + // } + // if("send".equals(mdmModuleViewButtonEntities.get(i).getButtonValue())) { + // SysButtonConfigEntity xf = new SysButtonConfigEntity(); + // xf.setCode("send"); + // xf.setNameCh("下发"); + // xf.setNameEn("send"); + // xf.setMenuId(module.getId()); + // xf.setIconName(""); + // xf.setStyles(""); + // xf.setBtnFunction("send"); + // xf.setRemark("主数据下发按钮"); + // xf.setCreate(); + // sysButtonConfigDao.save(xf); + // } // // - - // - /** - * @param mdmDbFiledVoList - * @param type - * @return void - * @Author lvleigang - * @Description 保存数据 - * @Date 1:37 下午 2023/10/25 - **/ - private void saveDbViewFiled(String mdmID, String viewid, List mdmDbFiledVoList, String type,List mdmModuleViewDetailEntities) { - if (mdmDbFiledVoList != null && mdmDbFiledVoList.size() > 0) { - for (int i = 0; i < mdmDbFiledVoList.size(); i++) { - MdmModuleViewDetailEntity mdmModuleViewDetailEntity = new MdmModuleViewDetailEntity(); - mdmModuleViewDetailEntity.setCreate(); - mdmModuleViewDetailEntity.setMdmId(mdmID); - mdmModuleViewDetailEntity.setViewId(viewid); - mdmModuleViewDetailEntity.setViewFiled(mdmDbFiledVoList.get(i).getId()); - mdmModuleViewDetailEntity.setViewType(type); - mdmModuleViewDetailEntity.setDataType("1"); - mdmModuleViewDetailEntities.add(mdmModuleViewDetailEntity); - } - } - } + // } + // } + // } + //} // ///** // * @param object // * @return com.hzya.frame.web.entity.JsonResultEntity // * @Author lvleigang - // * @Description 主数据设置查询权限配置 + // * @Description 主数据设置查询分发设置 // * @Date 9:40 上午 2023/10/18 // **/ //@Override - //public JsonResultEntity queryMdmModuleRule(JSONObject object) { + //public JsonResultEntity queryMdmModuleDistribute(JSONObject object) { // MdmDto entity = getData("jsonStr", object, MdmDto.class); // if (entity == null) { // return BaseResult.getFailureMessageEntity("参数不允许为空"); // } - // if (entity.getId() == null || "".equals(entity.getId())) { + // if (entity.getMdmCode() == null || "".equals(entity.getMdmCode())) { // return BaseResult.getFailureMessageEntity("系统错误"); // } - // //查询模块下的角色列表 - // MdmModuleRoleEntity mdmModuleRoleEntity = new MdmModuleRoleEntity(); - // mdmModuleRoleEntity.setSts("Y"); - // mdmModuleRoleEntity.setMdmId(entity.getId()); - // List mdmModuleRoleEntities = mdmModuleRoleDao.queryBase(mdmModuleRoleEntity); - // if (mdmModuleRoleEntities != null && mdmModuleRoleEntities.size() > 0) { - // MdmModuleRoleButtonEntity mdmModuleRoleButtonEntity = new MdmModuleRoleButtonEntity(); - // mdmModuleRoleButtonEntity.setSts("Y"); - // mdmModuleRoleButtonEntity.setMdmId(entity.getId()); - // List mdmModuleRoleButtonEntities = mdmModuleRoleButtonDao.queryBase(mdmModuleRoleButtonEntity); - // if (mdmModuleRoleButtonEntities != null && mdmModuleRoleButtonEntities.size() > 0) { - // for (int i = 0; i < mdmModuleRoleEntities.size(); i++) { - // List list = new ArrayList<>(); - // for (int i1 = 0; i1 < mdmModuleRoleButtonEntities.size(); i1++) { - // if (mdmModuleRoleEntities.get(i).getRoleId().equals(mdmModuleRoleButtonEntities.get(i1).getRoleId())) { - // list.add(mdmModuleRoleButtonEntities.get(i1)); - // } - // } - // mdmModuleRoleEntities.get(i).setMdmModuleRoleButtonEntities(list); - // } - // } + // MdmModuleEntity mdmModuleEntity = mdmServiceCache.getMdmModuleEntity(entity.getMdmCode()); + // if(mdmModuleEntity == null || mdmModuleEntity.getId() == null){ + // return BaseResult.getFailureMessageEntity("系统错误"); // } - // return BaseResult.getSuccessMessageEntity("查询成功", mdmModuleRoleEntities); + // //查询模块下的应用列表 + // MdmModuleDistributeEntity mdmModuleDistributeEntity = new MdmModuleDistributeEntity(); + // mdmModuleDistributeEntity.setSts("Y"); + // mdmModuleDistributeEntity.setMdmId(mdmModuleEntity.getId()); + // List mdmModuleDistributeEntities = mdmServiceCache.queryMdmModuleDistribute(mdmModuleEntity.getId(),mdmModuleDistributeEntity); + // return BaseResult.getSuccessMessageEntity("查询成功", mdmModuleDistributeEntities); + //} + ///** + // * @param object + // * @return com.hzya.frame.web.entity.JsonResultEntity + // * @Author lvleigang + // * @Description 主数据设置保存分发设置 + // * @Date 9:40 上午 2023/10/18 + // **/ + //@Override + //public JsonResultEntity doSaveMdmModuleDistribute(JSONObject object) { + // MdmDistributeDto entity = getData("jsonStr", object, MdmDistributeDto.class); + // //判断是否有数据 + // if (entity == null) { + // return BaseResult.getFailureMessageEntity("参数不允许为空"); + // } + // if (entity.getMdmCode() == null || "".equals(entity.getMdmCode())) { + // return BaseResult.getFailureMessageEntity("系统错误"); + // } + // MdmModuleEntity mdmModuleEntity = mdmServiceCache.getMdmModuleEntity(entity.getMdmCode()); + // if(mdmModuleEntity == null || mdmModuleEntity.getId() == null){ + // return BaseResult.getFailureMessageEntity("系统错误"); + // } + // mdmServiceCache.saveMdmModuleDistribute(mdmModuleEntity.getId(),entity.getMdmModuleDistributeEntities()); + // return BaseResult.getSuccessMessageEntity("保存发布设置成功"); //} // ///** // * @param object // * @return com.hzya.frame.web.entity.JsonResultEntity // * @Author lvleigang - // * @Description 主数据设置保存权限配置 + // * @Description 主数据设置查询数据来源 // * @Date 9:40 上午 2023/10/18 // **/ //@Override - //public JsonResultEntity doSaveMdmModuleRule(JSONObject object) { - // MdmRoleDto entity = getData("jsonStr", object, MdmRoleDto.class); + //public JsonResultEntity queryMdmModuleSource(JSONObject object) { + // MdmDto entity = getData("jsonStr", object, MdmDto.class); + // if (entity == null) { + // return BaseResult.getFailureMessageEntity("参数不允许为空"); + // } + // if (entity.getMdmCode() == null || "".equals(entity.getMdmCode())) { + // return BaseResult.getFailureMessageEntity("系统错误"); + // } + // MdmModuleEntity mdmModuleEntity = mdmServiceCache.getMdmModuleEntity(entity.getMdmCode()); + // if(mdmModuleEntity == null || mdmModuleEntity.getId() == null){ + // return BaseResult.getFailureMessageEntity("系统错误"); + // } + // //查询模块下的应用列表 + // MdmModuleSourceEntity mdmModuleSourceEntity = new MdmModuleSourceEntity(); + // mdmModuleSourceEntity.setSts("Y"); + // mdmModuleSourceEntity.setMdmId(mdmModuleEntity.getId()); + // List mdmModuleSourceEntities = mdmServiceCache.queryMdmModuleSource(mdmModuleSourceEntity); + // return BaseResult.getSuccessMessageEntity("查询成功", mdmModuleSourceEntities); + //} + ///** + // * @param object + // * @return com.hzya.frame.web.entity.JsonResultEntity + // * @Author lvleigang + // * @Description 主数据设置保存数据来源 + // * @Date 9:40 上午 2023/10/18 + // **/ + //@Override + //public JsonResultEntity doSaveMdmModuleSource(JSONObject object) { + // MdmSourceDto entity = getData("jsonStr", object, MdmSourceDto.class); + // //判断是否有数据 + // if (entity == null) { + // return BaseResult.getFailureMessageEntity("参数不允许为空"); + // } + // if (entity.getMdmCode() == null || "".equals(entity.getMdmCode())) { + // return BaseResult.getFailureMessageEntity("系统错误"); + // } + // MdmModuleEntity mdmModuleEntity = mdmServiceCache.getMdmModuleEntity(entity.getMdmCode()); + // if(mdmModuleEntity == null || mdmModuleEntity.getId() == null){ + // return BaseResult.getFailureMessageEntity("系统错误"); + // } + // mdmServiceCache.saveMdmModuleSource(mdmModuleEntity.getId(),entity.getMdmModuleSourceEntities()); + // return BaseResult.getSuccessMessageEntity("保存发布设置成功"); + //} + // + ///** + // * @param jsonObject + // * @return com.hzya.frame.web.entity.JsonResultEntity + // * @Author lvleigang + // * @Description 查询下发日志 + // * @Date 11:52 上午 2024/3/27 + // **/ + //@Override + //public JsonResultEntity querySendEntityPage(JSONObject jsonObject) { + // MdmModuleSendLogEntity entity = getData("jsonStr", jsonObject, MdmModuleSendLogEntity.class); + // //判断分页 + // if (entity == null || entity.getPageNum() == null || entity.getPageSize() == null) { + // return BaseResult.getFailureMessageEntity("分页查询参数不存在"); + // } + // if (entity.getMdmCode() == null || "".equals(entity.getMdmCode())) { + // return BaseResult.getFailureMessageEntity("系统错误"); + // } + // MdmModuleEntity mdmModuleEntity = mdmServiceCache.getMdmModuleEntity(entity.getMdmCode()); + // if(mdmModuleEntity == null || mdmModuleEntity.getId() == null){ + // return BaseResult.getFailureMessageEntity("系统错误"); + // } + // MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); + // mdmModuleDbEntity.setMdmId(mdmModuleEntity.getId()); + // mdmModuleDbEntity.setSts("Y"); + // List mdmModuleDbEntities = mdmServiceCache.queryMdmModuleDb(mdmModuleDbEntity); + // if(mdmModuleDbEntities != null && mdmModuleDbEntities.size() > 0 ){ + // for (int i = 0; i < mdmModuleDbEntities.size(); i++) { + // if("1".equals(mdmModuleDbEntities.get(i).getDbType())){ + // entity.setTableName(mdmModuleDbEntities.get(i).getDbName()+"_send_log"); + // break; + // } + // } + // }else { + // return BaseResult.getFailureMessageEntity("请先设置数据源"); + // } + // PageHelper.startPage(entity.getPageNum(), entity.getPageSize()); + // List list = mdmModuleSendLogDao.queryByLike(entity); + // PageInfo pageInfo = new PageInfo(list); + // return BaseResult.getSuccessMessageEntity("查询数据成功", pageInfo); + //} + // + ///** + // * @param jsonObject + // * @return com.hzya.frame.web.entity.JsonResultEntity + // * @Author lvleigang + // * @Description 获取下发日志 + // * @Date 2:36 下午 2024/3/27 + // **/ + //@Override + //public JsonResultEntity getSendEntity(JSONObject jsonObject) { + // MdmModuleSendLogEntity entity = getData("jsonStr", jsonObject, MdmModuleSendLogEntity.class); // if (entity == null) { // return BaseResult.getFailureMessageEntity("参数不允许为空"); // } // if (entity.getId() == null || "".equals(entity.getId())) { // return BaseResult.getFailureMessageEntity("系统错误"); // } - // //查询菜单 - // Module module = new Module(); - // module.setFormId(entity.getId()); - // List moduleList = moduleMapper.entity_list_base(module); - // if (moduleList != null && moduleList.size() == 1) { - // module = moduleList.get(0); + // if (entity.getMdmCode() == null || "".equals(entity.getMdmCode())) { + // return BaseResult.getFailureMessageEntity("系统错误"); + // } + // MdmModuleEntity mdmModuleEntity = mdmServiceCache.getMdmModuleEntity(entity.getMdmCode()); + // if(mdmModuleEntity == null || mdmModuleEntity.getId() == null){ + // return BaseResult.getFailureMessageEntity("系统错误"); + // } + // MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); + // mdmModuleDbEntity.setMdmId(mdmModuleEntity.getId()); + // mdmModuleDbEntity.setSts("Y"); + // List mdmModuleDbEntities = mdmServiceCache.queryMdmModuleDb(mdmModuleDbEntity); + // if(mdmModuleDbEntities != null && mdmModuleDbEntities.size() > 0 ){ + // for (int i = 0; i < mdmModuleDbEntities.size(); i++) { + // if("1".equals(mdmModuleDbEntities.get(i).getDbType())){ + // entity.setTableName(mdmModuleDbEntities.get(i).getDbName()+"_send_log"); + // break; + // } + // } + // }else { + // return BaseResult.getFailureMessageEntity("请先设置数据源"); + // } + // entity = mdmModuleSendLogDao.get(entity.getId()); + // if (entity == null) { + // return BaseResult.getFailureMessageEntity("获取日志失败"); + // } + // return BaseResult.getSuccessMessageEntity("获取日志成功", entity); + //} + // + ///** + // * @param jsonObject + // * @return com.hzya.frame.web.entity.JsonResultEntity + // * @Author lvleigang + // * @Description 删除下发日志 + // * @Date 2:37 下午 2024/3/27 + // **/ + //@Override + //public JsonResultEntity deleteSendEntity(JSONObject jsonObject) { + // MdmModuleSendLogEntity entity = getData("jsonStr", jsonObject, MdmModuleSendLogEntity.class); + // if (entity == null) { + // return BaseResult.getFailureMessageEntity("参数不允许为空"); + // } + // if (entity.getId() == null || "".equals(entity.getId())) { + // return BaseResult.getFailureMessageEntity("系统错误"); + // } + // if (entity.getMdmCode() == null || "".equals(entity.getMdmCode())) { + // return BaseResult.getFailureMessageEntity("系统错误"); + // } + // MdmModuleEntity mdmModuleEntity = mdmServiceCache.getMdmModuleEntity(entity.getMdmCode()); + // if(mdmModuleEntity == null || mdmModuleEntity.getId() == null){ + // return BaseResult.getFailureMessageEntity("系统错误"); + // } + // MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); + // mdmModuleDbEntity.setMdmId(mdmModuleEntity.getId()); + // mdmModuleDbEntity.setSts("Y"); + // List mdmModuleDbEntities = mdmServiceCache.queryMdmModuleDb(mdmModuleDbEntity); + // if(mdmModuleDbEntities != null && mdmModuleDbEntities.size() > 0 ){ + // for (int i = 0; i < mdmModuleDbEntities.size(); i++) { + // if("1".equals(mdmModuleDbEntities.get(i).getDbType())){ + // entity.setTableName(mdmModuleDbEntities.get(i).getDbName()+"_send_log"); + // break; + // } + // } + // }else { + // return BaseResult.getFailureMessageEntity("请先设置数据源"); + // } + // entity.setUpdate(); + // mdmModuleSendLogDao.logicRemove(entity); + // return BaseResult.getSuccessMessageEntity("删除日志成功"); + //} + // + // + // + ///** + // * @param jsonObject + // * @return com.hzya.frame.web.entity.JsonResultEntity + // * @Author lvleigang + // * @Description 查询操作日志 + // * @Date 11:52 上午 2024/3/27 + // **/ + //@Override + //public JsonResultEntity queryOptionEntityPage(JSONObject jsonObject) { + // MdmModuleOptionLogEntity entity = getData("jsonStr", jsonObject, MdmModuleOptionLogEntity.class); + // //判断分页 + // if (entity == null || entity.getPageNum() == null || entity.getPageSize() == null) { + // return BaseResult.getFailureMessageEntity("分页查询参数不存在"); + // } + // if (entity.getMdmCode() == null || "".equals(entity.getMdmCode())) { + // return BaseResult.getFailureMessageEntity("系统错误"); + // } + // MdmModuleEntity mdmModuleEntity = mdmServiceCache.getMdmModuleEntity(entity.getMdmCode()); + // if(mdmModuleEntity == null || mdmModuleEntity.getId() == null){ + // return BaseResult.getFailureMessageEntity("系统错误"); + // } + // MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); + // mdmModuleDbEntity.setMdmId(mdmModuleEntity.getId()); + // mdmModuleDbEntity.setSts("Y"); + // List mdmModuleDbEntities = mdmServiceCache.queryMdmModuleDb(mdmModuleDbEntity); + // if(mdmModuleDbEntities != null && mdmModuleDbEntities.size() > 0 ){ + // for (int i = 0; i < mdmModuleDbEntities.size(); i++) { + // if("1".equals(mdmModuleDbEntities.get(i).getDbType())){ + // entity.setTableName(mdmModuleDbEntities.get(i).getDbName()+"_option_log"); + // break; + // } + // } + // }else { + // return BaseResult.getFailureMessageEntity("请先设置数据源"); + // } + // PageHelper.startPage(entity.getPageNum(), entity.getPageSize()); + // List list = mdmModuleOptionLogDao.queryByLike(entity); + // PageInfo pageInfo = new PageInfo(list); + // return BaseResult.getSuccessMessageEntity("查询数据成功", pageInfo); + //} + // + ///** + // * @param jsonObject + // * @return com.hzya.frame.web.entity.JsonResultEntity + // * @Author lvleigang + // * @Description 获取操作日志 + // * @Date 2:36 下午 2024/3/27 + // **/ + //@Override + //public JsonResultEntity getOptionEntity(JSONObject jsonObject) { + // MdmModuleOptionLogEntity entity = getData("jsonStr", jsonObject, MdmModuleOptionLogEntity.class); + // if (entity == null) { + // return BaseResult.getFailureMessageEntity("参数不允许为空"); + // } + // if (entity.getId() == null || "".equals(entity.getId())) { + // return BaseResult.getFailureMessageEntity("系统错误"); + // } + // if (entity.getMdmCode() == null || "".equals(entity.getMdmCode())) { + // return BaseResult.getFailureMessageEntity("系统错误"); + // } + // MdmModuleEntity mdmModuleEntity = mdmServiceCache.getMdmModuleEntity(entity.getMdmCode()); + // if(mdmModuleEntity == null || mdmModuleEntity.getId() == null){ + // return BaseResult.getFailureMessageEntity("系统错误"); + // } + // MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); + // mdmModuleDbEntity.setMdmId(mdmModuleEntity.getId()); + // mdmModuleDbEntity.setSts("Y"); + // List mdmModuleDbEntities = mdmServiceCache.queryMdmModuleDb(mdmModuleDbEntity); + // if(mdmModuleDbEntities != null && mdmModuleDbEntities.size() > 0 ){ + // for (int i = 0; i < mdmModuleDbEntities.size(); i++) { + // if("1".equals(mdmModuleDbEntities.get(i).getDbType())){ + // entity.setTableName(mdmModuleDbEntities.get(i).getDbName()+"_option_log"); + // break; + // } + // } + // }else { + // return BaseResult.getFailureMessageEntity("请先设置数据源"); + // } + // entity = mdmModuleOptionLogDao.get(entity.getId()); + // if (entity == null) { + // return BaseResult.getFailureMessageEntity("获取日志失败"); + // } + // return BaseResult.getSuccessMessageEntity("获取日志成功", entity); + //} + // + ///** + // * @param jsonObject + // * @return com.hzya.frame.web.entity.JsonResultEntity + // * @Author lvleigang + // * @Description 删除操作日志 + // * @Date 2:37 下午 2024/3/27 + // **/ + //@Override + //public JsonResultEntity deleteOptionEntity(JSONObject jsonObject) { + // MdmModuleOptionLogEntity entity = getData("jsonStr", jsonObject, MdmModuleOptionLogEntity.class); + // if (entity == null) { + // return BaseResult.getFailureMessageEntity("参数不允许为空"); + // } + // if (entity.getId() == null || "".equals(entity.getId())) { + // return BaseResult.getFailureMessageEntity("系统错误"); + // } + // if (entity.getMdmCode() == null || "".equals(entity.getMdmCode())) { + // return BaseResult.getFailureMessageEntity("系统错误"); + // } + // MdmModuleEntity mdmModuleEntity = mdmServiceCache.getMdmModuleEntity(entity.getMdmCode()); + // if(mdmModuleEntity == null || mdmModuleEntity.getId() == null){ + // return BaseResult.getFailureMessageEntity("系统错误"); + // } + // MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); + // mdmModuleDbEntity.setMdmId(mdmModuleEntity.getId()); + // mdmModuleDbEntity.setSts("Y"); + // List mdmModuleDbEntities = mdmServiceCache.queryMdmModuleDb(mdmModuleDbEntity); + // if(mdmModuleDbEntities != null && mdmModuleDbEntities.size() > 0 ){ + // for (int i = 0; i < mdmModuleDbEntities.size(); i++) { + // if("1".equals(mdmModuleDbEntities.get(i).getDbType())){ + // entity.setTableName(mdmModuleDbEntities.get(i).getDbName()+"_option_log"); + // break; + // } + // } + // }else { + // return BaseResult.getFailureMessageEntity("请先设置数据源"); + // } + // entity.setUpdate(); + // mdmModuleOptionLogDao.logicRemove(entity); + // return BaseResult.getSuccessMessageEntity("删除日志成功"); + //} + ///** + // * @param object + // * @return com.hzya.frame.web.entity.JsonResultEntity + // * @Author lvleigang + // * @Description 主数据设置查询数据源的服务 + // * @Date 9:40 上午 2023/10/18 + // **/ + //@Override + //public JsonResultEntity queryMdmModuleServer(JSONObject object) { + // MdmModuleDbEntity entity = getData("jsonStr", object, MdmModuleDbEntity.class); + // //判断分页 + // if (entity == null) { + // entity = new MdmModuleDbEntity(); + // } + // //查询数据源表 + // entity.setSts("Y"); + // List allDb = mdmModuleDbDao.queryByLike(entity); + // List mdmModuleDbEntityList = new ArrayList<>(); + // if(allDb != null && allDb.size() > 0){ + // for (int i = 0; i < allDb.size(); i++) { + // if("1".equals(allDb.get(i).getDbType()) || "2".equals(allDb.get(i).getDbType() )){ + // mdmModuleDbEntityList.add(allDb.get(i)); + // } + // } + // } + // return BaseResult.getSuccessMessageEntity("查询数据成功", mdmModuleDbEntityList); + //} + // + ///** + // * @param object + // * @return com.hzya.frame.web.entity.JsonResultEntity + // * @Author lvleigang + // * @Description 主数据设置查询数据源的服务的字段 + // * @Date 9:40 上午 2023/10/18 + // **/ + //@Override + //public JsonResultEntity queryMdmModuleServerFiled(JSONObject object) { + // MdmModuleDbEntity entity = getData("jsonStr", object, MdmModuleDbEntity.class); + // //判断分页 + // if (entity == null) { + // return BaseResult.getFailureMessageEntity("参数不允许为空"); + // } + // if (entity.getDbName() == null || "".equals(entity.getDbName())) { + // return BaseResult.getFailureMessageEntity("系统错误"); + // } + // //查询数据源表 + // entity.setSts("Y"); + // List dblist = mdmModuleDbDao.queryBase(entity); + // if (dblist != null && dblist.size() == 1) { + // MdmModuleDbFiledsEntity queryDbFiled = new MdmModuleDbFiledsEntity(); + // queryDbFiled.setSts("Y"); + // queryDbFiled.setDbId(dblist.get(0).getId()); + // queryDbFiled.setViewType("1"); + // List list = mdmModuleDbFiledsDao.queryBase(queryDbFiled); + // MdmModuleDbFiledsEntity mdmModuleDbFiledsEntity = new MdmModuleDbFiledsEntity(); + // mdmModuleDbFiledsEntity.setChName("id"); + // mdmModuleDbFiledsEntity.setEnName("id"); + // list.add(0, mdmModuleDbFiledsEntity); + // return BaseResult.getSuccessMessageEntity("查询数据成功", list); // } else { - // return BaseResult.getFailureMessageEntity("菜单错误请检查菜单"); + // return BaseResult.getFailureMessageEntity("服务不存在"); // } - // //先删除 - // RoleModule roleModule = new RoleModule(); - // roleModule.setSts("Y"); - // roleModule.setUpdate(); - // roleModule.setModuleId(module.getId()); - // roleModuleMapper.entity_logicDelete_Multi_Condition(roleModule); - // MdmModuleRoleEntity mdmModuleRoleEntity = new MdmModuleRoleEntity(); - // mdmModuleRoleEntity.setMdmId(entity.getId()); - // mdmModuleRoleEntity.setSts("Y"); - // mdmModuleRoleEntity.setModify_user_id(StpUtil.getLoginIdAsString()); - // mdmModuleRoleEntity.setModify_time(new Date()); - // mdmModuleRoleDao.logicRemoveMultiCondition(mdmModuleRoleEntity); - // MdmModuleRoleButtonEntity mdmModuleRoleButtonEntity = new MdmModuleRoleButtonEntity(); - // mdmModuleRoleButtonEntity.setMdmId(entity.getId()); - // mdmModuleRoleButtonEntity.setSts("Y"); - // mdmModuleRoleButtonEntity.setModify_user_id(StpUtil.getLoginIdAsString()); - // mdmModuleRoleButtonEntity.setModify_time(new Date()); - // mdmModuleRoleButtonDao.logicRemoveMultiCondition(mdmModuleRoleButtonEntity); + //} + //// + //// + ///** + // * @param object + // * @return com.hzya.frame.web.entity.JsonResultEntity + // * @Author lvleigang + // * @Description 主数据设置查询主表字段 + // * @Date 9:40 上午 2023/10/18 + // **/ + //@Override + //public JsonResultEntity queryMdmModuleServerMainFiled(JSONObject object) { + // MdmModuleDbEntity entity = getData("jsonStr", object, MdmModuleDbEntity.class); + // //判断分页 + // if (entity == null) { + // return BaseResult.getFailureMessageEntity("参数不允许为空"); + // } + // if (entity.getMdmId() == null || "".equals(entity.getMdmId())) { + // return BaseResult.getFailureMessageEntity("系统错误"); + // } + // //查询数据源表 + // entity.setSts("Y"); + // entity.setDbType("1"); + // List mdmModuleDbEntityList = mdmModuleDbDao.queryBase(entity); + // if (mdmModuleDbEntityList != null && mdmModuleDbEntityList.size() == 1) { + // MdmModuleDbFiledsEntity mdmModuleDbFiledsEntity = new MdmModuleDbFiledsEntity(); + // mdmModuleDbFiledsEntity.setSts("Y"); + // mdmModuleDbFiledsEntity.setViewType("1"); + // mdmModuleDbFiledsEntity.setDbId(mdmModuleDbEntityList.get(0).getId()); + // List list = mdmModuleDbFiledsDao.queryBase(mdmModuleDbFiledsEntity); + // return BaseResult.getSuccessMessageEntity("查询数据成功", list); + // } else if (mdmModuleDbEntityList != null && mdmModuleDbEntityList.size() == 0) { + // return BaseResult.getFailureMessageEntity("请先配置数据源"); + // } else { + // return BaseResult.getFailureMessageEntity("查询数据失败"); + // } + //} // - // if (entity.getMdmModuleRoleEntities() != null && entity.getMdmModuleRoleEntities().size() > 0) { - // for (int i = 0; i < entity.getMdmModuleRoleEntities().size(); i++) { // - // MdmModuleRoleEntity moduleRoleEntity = entity.getMdmModuleRoleEntities().get(i); - // moduleRoleEntity.setMdmId(entity.getId()); - // moduleRoleEntity.setSts("Y"); - // moduleRoleEntity.setModify_user_id(StpUtil.getLoginIdAsString()); - // moduleRoleEntity.setModify_time(new Date()); - // if (moduleRoleEntity.getId() != null && !"".equals(moduleRoleEntity.getId())) { - // //修改 - // mdmModuleRoleDao.update(moduleRoleEntity); - // } else { - // //新增 - // moduleRoleEntity.setId(UUIDUtils.getUUID()); - // moduleRoleEntity.setCreate_user_id(StpUtil.getLoginIdAsString()); - // moduleRoleEntity.setCreate_time(new Date()); - // mdmModuleRoleDao.save(moduleRoleEntity); - // } - // if (moduleRoleEntity.getMdmModuleRoleButtonEntities() != null && moduleRoleEntity.getMdmModuleRoleButtonEntities().size() > 0) { - // for (int i1 = 0; i1 < moduleRoleEntity.getMdmModuleRoleButtonEntities().size(); i1++) { - // MdmModuleRoleButtonEntity moduleRoleButtonEntity = moduleRoleEntity.getMdmModuleRoleButtonEntities().get(i1); - // moduleRoleButtonEntity.setMdmId(entity.getId()); - // moduleRoleButtonEntity.setSts("Y"); - // moduleRoleButtonEntity.setModify_user_id(StpUtil.getLoginIdAsString()); - // moduleRoleButtonEntity.setModify_time(new Date()); - // moduleRoleButtonEntity.setModuleRoleId(moduleRoleEntity.getRoleId()); - // moduleRoleButtonEntity.setRoleId(moduleRoleEntity.getRoleId()); - // if (moduleRoleButtonEntity.getId() != null && !"".equals(moduleRoleButtonEntity.getId())) { - // //修改 - // mdmModuleRoleButtonDao.update(moduleRoleButtonEntity); - // } else { - // //新增 - // moduleRoleButtonEntity.setId(UUIDUtils.getUUID()); - // moduleRoleButtonEntity.setCreate_user_id(StpUtil.getLoginIdAsString()); - // moduleRoleButtonEntity.setCreate_time(new Date()); - // mdmModuleRoleButtonDao.save(moduleRoleButtonEntity); - // } - // } - // } - // //再添加 - // RoleModule saveRole = new RoleModule(); - // saveRole.setCreate(); - // saveRole.setRoleId(moduleRoleEntity.getRoleId()); - // saveRole.setModuleId(module.getId()); - // roleModuleMapper.entity_insert(saveRole); + // + //// + /////** + //// * @param entity + //// * @param mainMdmModuleDb + //// * @param mainMdmModuleDbFileds + //// * @return void + //// * @Author lvleigang + //// * @Description 设置保存主表和字段以及字段的属性 + //// * @Date 10:34 上午 2023/10/19 + //// **/ + ////private void setMainTable(MdmDto entity, MdmModuleDbEntity mainMdmModuleDb, List mainMdmModuleDbFileds) { + //// //先保存或修改主表数据 + //// mainMdmModuleDb.setMdmId(entity.getId()); + //// mainMdmModuleDb.setDbType("1"); + //// boolean flag = false; + //// + //// if (mainMdmModuleDb.getId() != null && !"".equals(mainMdmModuleDb.getId())) { + //// mainMdmModuleDb.setSts("Y"); + //// mainMdmModuleDb.setModify_user_id(StpUtil.getLoginIdAsString()); + //// mainMdmModuleDb.setModify_time(new Date()); + //// mdmModuleDbDao.update(mainMdmModuleDb); + //// //删除规则表 + //// MdmModuleDbFiledsRuleEntity delectFiledsRule = new MdmModuleDbFiledsRuleEntity(); + //// delectFiledsRule.setMdmId(entity.getId()); + //// delectFiledsRule.setModify_user_id(StpUtil.getLoginIdAsString()); + //// delectFiledsRule.setModify_time(new Date()); + //// mdmModuleDbFiledsRuleDao.logicRemoveMultiCondition(delectFiledsRule); + //// } else { + //// flag = true; + //// mainMdmModuleDb.setId(UUIDUtils.getUUID()); + //// mainMdmModuleDb.setSts("Y"); + //// mainMdmModuleDb.setCreate_user_id(StpUtil.getLoginIdAsString()); + //// mainMdmModuleDb.setModify_user_id(StpUtil.getLoginIdAsString()); + //// mainMdmModuleDb.setCreate_time(new Date()); + //// mainMdmModuleDb.setModify_time(new Date()); + //// mdmModuleDbDao.save(mainMdmModuleDb); + //// } + //// List dbFiledsDtos = new ArrayList<>(); + //// + //// //保存主表字段 因为字段不允许删除,所以不用先删除再新增 + //// if (mainMdmModuleDbFileds != null && mainMdmModuleDbFileds.size() > 0) { + //// for (int i = 0; i < mainMdmModuleDbFileds.size(); i++) { + //// MdmModuleDbFiledsEntity mdmModuleDbFiledsEntity = mainMdmModuleDbFileds.get(i); + //// mdmModuleDbFiledsEntity.setMdmId(entity.getId()); + //// mdmModuleDbFiledsEntity.setDbId(mainMdmModuleDb.getId()); + //// if (mdmModuleDbFiledsEntity.getId() != null && !"".equals(mdmModuleDbFiledsEntity.getId())) { + //// DbFiledsDto dbFiledsDto = new DbFiledsDto("1", mdmModuleDbFiledsEntity.getChName(), mdmModuleDbFiledsEntity.getEnName(), mdmModuleDbFiledsEntity.getFiledType(), mdmModuleDbFiledsEntity.getFiledLength()); + //// dbFiledsDtos.add(dbFiledsDto); + //// + //// mdmModuleDbFiledsEntity.setSts("Y"); + //// mdmModuleDbFiledsEntity.setModify_user_id(StpUtil.getLoginIdAsString()); + //// mdmModuleDbFiledsEntity.setModify_time(new Date()); + //// mdmModuleDbFiledsDao.update(mdmModuleDbFiledsEntity); + //// } else { + //// DbFiledsDto dbFiledsDto = new DbFiledsDto("2", mdmModuleDbFiledsEntity.getChName(), mdmModuleDbFiledsEntity.getEnName(), mdmModuleDbFiledsEntity.getFiledType(), mdmModuleDbFiledsEntity.getFiledLength()); + //// dbFiledsDtos.add(dbFiledsDto); + //// mdmModuleDbFiledsEntity.setId(UUIDUtils.getUUID()); + //// mdmModuleDbFiledsEntity.setSts("Y"); + //// mdmModuleDbFiledsEntity.setCreate_user_id(StpUtil.getLoginIdAsString()); + //// mdmModuleDbFiledsEntity.setModify_user_id(StpUtil.getLoginIdAsString()); + //// mdmModuleDbFiledsEntity.setCreate_time(new Date()); + //// mdmModuleDbFiledsEntity.setModify_time(new Date()); + //// mdmModuleDbFiledsDao.save(mdmModuleDbFiledsEntity); + //// } + //// //修改或保存属性 + //// List mdmModuleDbFiledsRules = mdmModuleDbFiledsEntity.getMdmModuleDbFiledsRules(); + //// if (mdmModuleDbFiledsRules != null && mdmModuleDbFiledsRules.size() > 0) { + //// for (int a = 0; a < mdmModuleDbFiledsRules.size(); a++) { + //// MdmModuleDbFiledsRuleEntity mdmModuleDbFiledsRuleEntity = mdmModuleDbFiledsRules.get(a); + //// mdmModuleDbFiledsRuleEntity.setMdmId(entity.getId()); + //// mdmModuleDbFiledsRuleEntity.setDbId(mainMdmModuleDb.getId()); + //// mdmModuleDbFiledsRuleEntity.setFiledId(mdmModuleDbFiledsEntity.getId()); + //// if (mdmModuleDbFiledsRuleEntity.getId() != null && !"".equals(mdmModuleDbFiledsRuleEntity.getId())) { + //// mdmModuleDbFiledsRuleEntity.setSts("Y"); + //// mdmModuleDbFiledsRuleEntity.setModify_user_id(StpUtil.getLoginIdAsString()); + //// mdmModuleDbFiledsRuleEntity.setModify_time(new Date()); + //// mdmModuleDbFiledsRuleDao.update(mdmModuleDbFiledsRuleEntity); + //// } else { + //// mdmModuleDbFiledsRuleEntity.setId(UUIDUtils.getUUID()); + //// mdmModuleDbFiledsRuleEntity.setSts("Y"); + //// mdmModuleDbFiledsRuleEntity.setCreate_user_id(StpUtil.getLoginIdAsString()); + //// mdmModuleDbFiledsRuleEntity.setModify_user_id(StpUtil.getLoginIdAsString()); + //// mdmModuleDbFiledsRuleEntity.setCreate_time(new Date()); + //// mdmModuleDbFiledsRuleEntity.setModify_time(new Date()); + //// mdmModuleDbFiledsRuleDao.save(mdmModuleDbFiledsRuleEntity); + //// } + //// } + //// } + //// } + //// } + //// if (flag) { + //// //新增 + //// Map maps = new HashMap<>(); + //// maps.put("dbType", "1");//表类型 + //// maps.put("tableName", mainMdmModuleDb.getDbName());//表名 + //// maps.put("tableRemark", mainMdmModuleDb.getRemark());//表备注 + //// maps.put("databaseFields", dbFiledsDtos);//字段 + //// mdmModuleDao.createTable(maps); + //// Map mapsDistribute = new HashMap<>(); + //// mapsDistribute.put("tableName", mainMdmModuleDb.getDbName() + "_distribute");//表名 + //// List distribute = getDistribute(); + //// maps.put("databaseFields", distribute);//字段 + //// mapsDistribute.put("tableRemark", mainMdmModuleDb.getRemark() + "分发表");//表备注 + //// mdmModuleDao.createTableDistribute(mapsDistribute); + //// } else { + //// //修改 + //// Map tablename = new HashMap<>(); + //// tablename.put("tableName", mainMdmModuleDb.getDbName());//表名 + //// tablename.put("tableRemark", mainMdmModuleDb.getRemark());//表备注 + //// mdmModuleDao.alterTableName(tablename); + //// Map maps = new HashMap<>(); + //// maps.put("tableName", mainMdmModuleDb.getDbName());//表名 + //// maps.put("tableRemark", mainMdmModuleDb.getRemark());//表备注 + //// maps.put("databaseFields", dbFiledsDtos);//字段 + //// mdmModuleDao.alterTable(maps); + //// } + ////} + //// + /////** + //// * @param + //// * @return java.util.List + //// * @Author lvleigang + //// * @Description 设置分发表字段 + //// * @Date 8:49 上午 2023/11/9 + //// **/ + ////private List getDistribute() { + //// List dbFiledsDtos = new ArrayList<>(); + //// dbFiledsDtos.add(new DbFiledsDto("1", "数据id", "formmain_id", "3", "50")); + //// dbFiledsDtos.add(new DbFiledsDto("1", "应用id", "app_id", "3", "50")); + //// dbFiledsDtos.add(new DbFiledsDto("1", "状态1、发送成功 2、发送中 3、发送失败", "status", "3", "50")); + //// dbFiledsDtos.add(new DbFiledsDto("1", "描述", "msg", "3", "50")); + //// return dbFiledsDtos; + ////} + //// + ///** + // * @param tableName + // * @return java.lang.Long + // * @Author lvleigang + // * @Description 校验表是否存在 + // * @Date 3:58 下午 2023/7/11 + // **/ + //private boolean checkTable(String tableName) { + // Map maps = new HashMap<>(); + // maps.put("tableName", tableName); + // Integer i = mdmModuleDao.checkTable(maps); + // if (i != null && i > 0) { + // return true; + // } + // return false; + //} + //// + /////** + //// * @param object + //// * @return com.hzya.frame.web.entity.JsonResultEntity + //// * @Author lvleigang + //// * @Description 主数据设置查询显示信息 + //// * @Date 9:40 上午 2023/10/18 + //// **/ + ////@Override + ////public JsonResultEntity queryMdmModuleView(JSONObject object) { + //// MdmDto entity = getData("jsonStr", object, MdmDto.class); + //// if (entity == null) { + //// return BaseResult.getFailureMessageEntity("参数不允许为空"); + //// } + //// if (entity.getId() == null || "".equals(entity.getId())) { + //// return BaseResult.getFailureMessageEntity("系统错误"); + //// } + //// MdmModuleViewVo mdmModuleViewVo = new MdmModuleViewVo(); + //// //查询设置各种类型字段 + //// //查询模版数据源 + //// MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); + //// mdmModuleDbEntity.setMdmId(entity.getId()); + //// mdmModuleDbEntity.setSts("Y"); + //// List mdmModuleDbEntityList = mdmModuleDbDao.queryBase(mdmModuleDbEntity); + //// if (mdmModuleDbEntityList != null && mdmModuleDbEntityList.size() > 0) { + //// MdmModuleDbFiledsEntity mdmModuleDbFiledsEntity = new MdmModuleDbFiledsEntity(); + //// mdmModuleDbFiledsEntity.setMdmId(entity.getId()); + //// mdmModuleDbFiledsEntity.setSts("Y"); + //// List mdmModuleDbFiledsEntityList = mdmModuleDbFiledsDao.queryBase(mdmModuleDbFiledsEntity); + //// setFiledType(mdmModuleViewVo, mdmModuleDbEntityList, mdmModuleDbFiledsEntityList); + //// } + //// //查询数据库设置的字段 + //// MdmModuleViewEntity mdmModuleViewEntity = new MdmModuleViewEntity(); + //// mdmModuleViewEntity.setMdmId(entity.getId()); + //// mdmModuleViewEntity.setSts("Y"); + //// List moduleViewEntityList = mdmModuleViewDao.queryBase(mdmModuleViewEntity); + //// if (moduleViewEntityList != null && moduleViewEntityList.size() == 1) { + //// mdmModuleViewVo.setMdmModuleViewEntity(moduleViewEntityList.get(0)); + //// //查询明细 + //// MdmModuleViewDetailEntity mdmModuleViewDetailEntity = new MdmModuleViewDetailEntity(); + //// mdmModuleViewDetailEntity.setMdmId(entity.getId()); + //// mdmModuleViewDetailEntity.setViewId(moduleViewEntityList.get(0).getId()); + //// mdmModuleViewDetailEntity.setSts("Y"); + //// List mdmModuleViewDetailEntityList = mdmModuleViewDetailDao.queryBase(mdmModuleViewDetailEntity); + //// setDbFiledType(mdmModuleViewVo, mdmModuleViewDetailEntityList); + //// } else { + //// mdmModuleViewVo.setMdmModuleViewEntity(new MdmModuleViewEntity()); + //// mdmModuleViewVo.setDbAddFiled(new ArrayList<>()); + //// mdmModuleViewVo.setDbEditFiled(new ArrayList<>()); + //// mdmModuleViewVo.setDbShowFiled(new ArrayList<>()); + //// mdmModuleViewVo.setDbQueryFiled(new ArrayList<>()); + //// mdmModuleViewVo.setDbListFiled(new ArrayList<>()); + //// } + //// return BaseResult.getSuccessMessageEntity("查询视图成功", mdmModuleViewVo); + ////} + //// + ////private void setDbFiledType(MdmModuleViewVo mdmModuleViewVo, List mdmModuleViewDetailEntityList) { + //// //新增 + //// List addFiled = new ArrayList<>(); + //// //修改 + //// List editFiled = new ArrayList<>(); + //// //查看 + //// List showFiled = new ArrayList<>(); + //// //查询 + //// List queryFiled = new ArrayList<>(); + //// //列表 + //// List listFiled = new ArrayList<>(); + //// if (mdmModuleViewDetailEntityList != null && mdmModuleViewDetailEntityList.size() > 0) { + //// for (int i = 0; i < mdmModuleViewDetailEntityList.size(); i++) { + //// switch (mdmModuleViewDetailEntityList.get(i).getViewType()) { + //// //1、查询2、列表3、新增4、修改 5、查看 + //// case "1": + //// queryFiled.add(mdmModuleViewDetailEntityList.get(i)); + //// break; + //// case "2": + //// listFiled.add(mdmModuleViewDetailEntityList.get(i)); + //// break; + //// case "3": + //// addFiled.add(mdmModuleViewDetailEntityList.get(i)); + //// break; + //// case "4": + //// editFiled.add(mdmModuleViewDetailEntityList.get(i)); + //// break; + //// case "5": + //// showFiled.add(mdmModuleViewDetailEntityList.get(i)); + //// break; + //// default: + //// } + //// } + //// } + //// mdmModuleViewVo.setDbAddFiled(addFiled); + //// mdmModuleViewVo.setDbEditFiled(editFiled); + //// mdmModuleViewVo.setDbShowFiled(showFiled); + //// mdmModuleViewVo.setDbQueryFiled(queryFiled); + //// mdmModuleViewVo.setDbListFiled(listFiled); + ////} + //// + /////** + //// * @param mdmModuleViewVo + //// * @param mdmModuleDbEntityList + //// * @param mdmModuleDbFiledsEntityList + //// * @return void + //// * @Author lvleigang + //// * @Description 设置对应的字段类型 + //// * @Date 2023/10/25 + //// **/ + ////private void setFiledType(MdmModuleViewVo mdmModuleViewVo, List mdmModuleDbEntityList, List mdmModuleDbFiledsEntityList) { + //// //新增 + //// List addFiled = new ArrayList<>(); + //// //修改 + //// List editFiled = new ArrayList<>(); + //// //查看 + //// List showFiled = new ArrayList<>(); + //// //查询 + //// List queryFiled = new ArrayList<>(); + //// //列表 + //// List listFiled = new ArrayList<>(); + //// if (mdmModuleDbEntityList != null && mdmModuleDbEntityList.size() > 0) { + //// for (int i = 0; i < mdmModuleDbEntityList.size(); i++) { + //// if (mdmModuleDbFiledsEntityList != null && mdmModuleDbFiledsEntityList.size() > 0) { + //// for (int i1 = 0; i1 < mdmModuleDbFiledsEntityList.size(); i1++) { + //// if (mdmModuleDbEntityList.get(i).getId().equals(mdmModuleDbFiledsEntityList.get(i1).getDbId())) { + //// if ("1".equals(mdmModuleDbEntityList.get(i).getDbType())) { + //// //1、主表 + //// addFiled.add(new MdmDbFiledVo(mdmModuleDbFiledsEntityList.get(i1).getId(), "【主表:" + mdmModuleDbEntityList.get(i).getDbName() + "】" + mdmModuleDbFiledsEntityList.get(i1).getChName())); + //// editFiled.add(new MdmDbFiledVo(mdmModuleDbFiledsEntityList.get(i1).getId(), "【主表:" + mdmModuleDbEntityList.get(i).getDbName() + "】" + mdmModuleDbFiledsEntityList.get(i1).getChName())); + //// showFiled.add(new MdmDbFiledVo(mdmModuleDbFiledsEntityList.get(i1).getId(), "【主表:" + mdmModuleDbEntityList.get(i).getDbName() + "】" + mdmModuleDbFiledsEntityList.get(i1).getChName())); + //// queryFiled.add(new MdmDbFiledVo(mdmModuleDbFiledsEntityList.get(i1).getId(), "【主表:" + mdmModuleDbEntityList.get(i).getDbName() + "】" + mdmModuleDbFiledsEntityList.get(i1).getChName())); + //// listFiled.add(new MdmDbFiledVo(mdmModuleDbFiledsEntityList.get(i1).getId(), "【主表:" + mdmModuleDbEntityList.get(i).getDbName() + "】" + mdmModuleDbFiledsEntityList.get(i1).getChName())); + //// } else { + //// //2、明细 + //// queryFiled.add(new MdmDbFiledVo(mdmModuleDbFiledsEntityList.get(i1).getId(), "【子表:" + mdmModuleDbEntityList.get(i).getDbName() + "】" + mdmModuleDbFiledsEntityList.get(i1).getChName())); + //// addFiled.add(new MdmDbFiledVo(mdmModuleDbFiledsEntityList.get(i1).getId(), "【子表:" + mdmModuleDbEntityList.get(i).getDbName() + "】" + mdmModuleDbFiledsEntityList.get(i1).getChName())); + //// editFiled.add(new MdmDbFiledVo(mdmModuleDbFiledsEntityList.get(i1).getId(), "【子表:" + mdmModuleDbEntityList.get(i).getDbName() + "】" + mdmModuleDbFiledsEntityList.get(i1).getChName())); + //// showFiled.add(new MdmDbFiledVo(mdmModuleDbFiledsEntityList.get(i1).getId(), "【子表:" + mdmModuleDbEntityList.get(i).getDbName() + "】" + mdmModuleDbFiledsEntityList.get(i1).getChName())); + //// } + //// } + //// } + //// } + //// } + //// } + //// mdmModuleViewVo.setAddFiled(addFiled); + //// mdmModuleViewVo.setEditFiled(editFiled); + //// mdmModuleViewVo.setShowFiled(showFiled); + //// mdmModuleViewVo.setQueryFiled(queryFiled); + //// mdmModuleViewVo.setListFiled(listFiled); + ////} + //// + //// + // + //// + ///** + // * @param mdmDbFiledVoList + // * @param type + // * @return void + // * @Author lvleigang + // * @Description 保存数据 + // * @Date 1:37 下午 2023/10/25 + // **/ + //private void saveDbViewFiled(String mdmID, String viewid, List mdmDbFiledVoList, String type,List mdmModuleViewDetailEntities) { + // if (mdmDbFiledVoList != null && mdmDbFiledVoList.size() > 0) { + // for (int i = 0; i < mdmDbFiledVoList.size(); i++) { + // MdmModuleViewDetailEntity mdmModuleViewDetailEntity = new MdmModuleViewDetailEntity(); + // mdmModuleViewDetailEntity.setCreate(); + // mdmModuleViewDetailEntity.setMdmId(mdmID); + // mdmModuleViewDetailEntity.setViewId(viewid); + // mdmModuleViewDetailEntity.setViewFiled(mdmDbFiledVoList.get(i).getId()); + // mdmModuleViewDetailEntity.setViewType(type); + // mdmModuleViewDetailEntity.setDataType("1"); + // mdmModuleViewDetailEntities.add(mdmModuleViewDetailEntity); // } // } - // return BaseResult.getSuccessMessageEntity("保存成功"); //} + //// + /////** + //// * @param object + //// * @return com.hzya.frame.web.entity.JsonResultEntity + //// * @Author lvleigang + //// * @Description 主数据设置查询权限配置 + //// * @Date 9:40 上午 2023/10/18 + //// **/ + ////@Override + ////public JsonResultEntity queryMdmModuleRule(JSONObject object) { + //// MdmDto entity = getData("jsonStr", object, MdmDto.class); + //// if (entity == null) { + //// return BaseResult.getFailureMessageEntity("参数不允许为空"); + //// } + //// if (entity.getId() == null || "".equals(entity.getId())) { + //// return BaseResult.getFailureMessageEntity("系统错误"); + //// } + //// //查询模块下的角色列表 + //// MdmModuleRoleEntity mdmModuleRoleEntity = new MdmModuleRoleEntity(); + //// mdmModuleRoleEntity.setSts("Y"); + //// mdmModuleRoleEntity.setMdmId(entity.getId()); + //// List mdmModuleRoleEntities = mdmModuleRoleDao.queryBase(mdmModuleRoleEntity); + //// if (mdmModuleRoleEntities != null && mdmModuleRoleEntities.size() > 0) { + //// MdmModuleRoleButtonEntity mdmModuleRoleButtonEntity = new MdmModuleRoleButtonEntity(); + //// mdmModuleRoleButtonEntity.setSts("Y"); + //// mdmModuleRoleButtonEntity.setMdmId(entity.getId()); + //// List mdmModuleRoleButtonEntities = mdmModuleRoleButtonDao.queryBase(mdmModuleRoleButtonEntity); + //// if (mdmModuleRoleButtonEntities != null && mdmModuleRoleButtonEntities.size() > 0) { + //// for (int i = 0; i < mdmModuleRoleEntities.size(); i++) { + //// List list = new ArrayList<>(); + //// for (int i1 = 0; i1 < mdmModuleRoleButtonEntities.size(); i1++) { + //// if (mdmModuleRoleEntities.get(i).getRoleId().equals(mdmModuleRoleButtonEntities.get(i1).getRoleId())) { + //// list.add(mdmModuleRoleButtonEntities.get(i1)); + //// } + //// } + //// mdmModuleRoleEntities.get(i).setMdmModuleRoleButtonEntities(list); + //// } + //// } + //// } + //// return BaseResult.getSuccessMessageEntity("查询成功", mdmModuleRoleEntities); + ////} + //// + /////** + //// * @param object + //// * @return com.hzya.frame.web.entity.JsonResultEntity + //// * @Author lvleigang + //// * @Description 主数据设置保存权限配置 + //// * @Date 9:40 上午 2023/10/18 + //// **/ + ////@Override + ////public JsonResultEntity doSaveMdmModuleRule(JSONObject object) { + //// MdmRoleDto entity = getData("jsonStr", object, MdmRoleDto.class); + //// if (entity == null) { + //// return BaseResult.getFailureMessageEntity("参数不允许为空"); + //// } + //// if (entity.getId() == null || "".equals(entity.getId())) { + //// return BaseResult.getFailureMessageEntity("系统错误"); + //// } + //// //查询菜单 + //// Module module = new Module(); + //// module.setFormId(entity.getId()); + //// List moduleList = moduleMapper.entity_list_base(module); + //// if (moduleList != null && moduleList.size() == 1) { + //// module = moduleList.get(0); + //// } else { + //// return BaseResult.getFailureMessageEntity("菜单错误请检查菜单"); + //// } + //// //先删除 + //// RoleModule roleModule = new RoleModule(); + //// roleModule.setSts("Y"); + //// roleModule.setUpdate(); + //// roleModule.setModuleId(module.getId()); + //// roleModuleMapper.entity_logicDelete_Multi_Condition(roleModule); + //// MdmModuleRoleEntity mdmModuleRoleEntity = new MdmModuleRoleEntity(); + //// mdmModuleRoleEntity.setMdmId(entity.getId()); + //// mdmModuleRoleEntity.setSts("Y"); + //// mdmModuleRoleEntity.setModify_user_id(StpUtil.getLoginIdAsString()); + //// mdmModuleRoleEntity.setModify_time(new Date()); + //// mdmModuleRoleDao.logicRemoveMultiCondition(mdmModuleRoleEntity); + //// MdmModuleRoleButtonEntity mdmModuleRoleButtonEntity = new MdmModuleRoleButtonEntity(); + //// mdmModuleRoleButtonEntity.setMdmId(entity.getId()); + //// mdmModuleRoleButtonEntity.setSts("Y"); + //// mdmModuleRoleButtonEntity.setModify_user_id(StpUtil.getLoginIdAsString()); + //// mdmModuleRoleButtonEntity.setModify_time(new Date()); + //// mdmModuleRoleButtonDao.logicRemoveMultiCondition(mdmModuleRoleButtonEntity); + //// + //// if (entity.getMdmModuleRoleEntities() != null && entity.getMdmModuleRoleEntities().size() > 0) { + //// for (int i = 0; i < entity.getMdmModuleRoleEntities().size(); i++) { + //// + //// MdmModuleRoleEntity moduleRoleEntity = entity.getMdmModuleRoleEntities().get(i); + //// moduleRoleEntity.setMdmId(entity.getId()); + //// moduleRoleEntity.setSts("Y"); + //// moduleRoleEntity.setModify_user_id(StpUtil.getLoginIdAsString()); + //// moduleRoleEntity.setModify_time(new Date()); + //// if (moduleRoleEntity.getId() != null && !"".equals(moduleRoleEntity.getId())) { + //// //修改 + //// mdmModuleRoleDao.update(moduleRoleEntity); + //// } else { + //// //新增 + //// moduleRoleEntity.setId(UUIDUtils.getUUID()); + //// moduleRoleEntity.setCreate_user_id(StpUtil.getLoginIdAsString()); + //// moduleRoleEntity.setCreate_time(new Date()); + //// mdmModuleRoleDao.save(moduleRoleEntity); + //// } + //// if (moduleRoleEntity.getMdmModuleRoleButtonEntities() != null && moduleRoleEntity.getMdmModuleRoleButtonEntities().size() > 0) { + //// for (int i1 = 0; i1 < moduleRoleEntity.getMdmModuleRoleButtonEntities().size(); i1++) { + //// MdmModuleRoleButtonEntity moduleRoleButtonEntity = moduleRoleEntity.getMdmModuleRoleButtonEntities().get(i1); + //// moduleRoleButtonEntity.setMdmId(entity.getId()); + //// moduleRoleButtonEntity.setSts("Y"); + //// moduleRoleButtonEntity.setModify_user_id(StpUtil.getLoginIdAsString()); + //// moduleRoleButtonEntity.setModify_time(new Date()); + //// moduleRoleButtonEntity.setModuleRoleId(moduleRoleEntity.getRoleId()); + //// moduleRoleButtonEntity.setRoleId(moduleRoleEntity.getRoleId()); + //// if (moduleRoleButtonEntity.getId() != null && !"".equals(moduleRoleButtonEntity.getId())) { + //// //修改 + //// mdmModuleRoleButtonDao.update(moduleRoleButtonEntity); + //// } else { + //// //新增 + //// moduleRoleButtonEntity.setId(UUIDUtils.getUUID()); + //// moduleRoleButtonEntity.setCreate_user_id(StpUtil.getLoginIdAsString()); + //// moduleRoleButtonEntity.setCreate_time(new Date()); + //// mdmModuleRoleButtonDao.save(moduleRoleButtonEntity); + //// } + //// } + //// } + //// //再添加 + //// RoleModule saveRole = new RoleModule(); + //// saveRole.setCreate(); + //// saveRole.setRoleId(moduleRoleEntity.getRoleId()); + //// saveRole.setModuleId(module.getId()); + //// roleModuleMapper.entity_insert(saveRole); + //// } + //// } + //// return BaseResult.getSuccessMessageEntity("保存成功"); + ////} + //// // - - // - - // - /** - * @param object - * @return com.hzya.frame.web.entity.JsonResultEntity - * @Author lvleigang - * @Description 主数据列表显示 树、查询条件、列表字段、按钮 - * @Date 9:40 上午 2023/10/18 - **/ - @Override - public JsonResultEntity queryMdmShow(JSONObject object) { - MdmDto entity = getData("jsonStr", object, MdmDto.class); - if (entity == null) { - return BaseResult.getFailureMessageEntity("参数不允许为空"); - } - if (entity.getMdmCode() == null || "".equals(entity.getMdmCode())) { - return BaseResult.getFailureMessageEntity("系统错误"); - } - //查询模版 - MdmModuleEntity mdmModuleEntity = mdmServiceCache.getMdmModuleEntity(entity.getMdmCode()); - if(mdmModuleEntity == null || mdmModuleEntity.getId() == null){ - return BaseResult.getFailureMessageEntity("系统错误"); - } - - //设置模版 - MdmViewVo mdmViewVo = new MdmViewVo(); - mdmViewVo.setMdmModuleEntity(mdmModuleEntity); - //查询展示类型 - MdmModuleViewEntity mdmModuleViewEntity = new MdmModuleViewEntity(); - mdmModuleViewEntity.setMdmId(mdmModuleEntity.getId()); - mdmModuleViewEntity.setSts("Y"); - List moduleViewEntityList = mdmServiceCache.queryMdmModuleView(mdmModuleViewEntity); - if (moduleViewEntityList == null || moduleViewEntityList.size() != 1) { - return BaseResult.getFailureMessageEntity("系统错误"); - } - mdmModuleViewEntity = moduleViewEntityList.get(0); - mdmViewVo.setMdmModuleViewEntity(mdmModuleViewEntity); - - //查询数据源主表 - MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); - mdmModuleDbEntity.setMdmId(mdmModuleEntity.getId()); - mdmModuleDbEntity.setSts("Y"); - List mdmModuleDbEntityList = mdmServiceCache.queryMdmModuleDb(mdmModuleDbEntity); - if (mdmModuleDbEntityList == null || mdmModuleDbEntityList.size() == 0) { - return BaseResult.getFailureMessageEntity("系统错误"); - } - //查询数据源表下面的字段 - MdmModuleDbFiledsEntity mdmModuleDbFiledsEntity = new MdmModuleDbFiledsEntity(); - mdmModuleDbFiledsEntity.setMdmId(mdmModuleEntity.getId()); - mdmModuleDbFiledsEntity.setSts("Y"); - List mdmModuleDbFiledsEntityList = mdmServiceCache.queryMdmModuleDbFileds(mdmModuleDbFiledsEntity); - if (mdmModuleDbFiledsEntityList == null || mdmModuleDbFiledsEntityList.size() == 0) { - return BaseResult.getFailureMessageEntity("系统错误"); - } - //查询字段下的规则 - MdmModuleDbFiledsRuleEntity mdmModuleDbFiledsRuleEntity = new MdmModuleDbFiledsRuleEntity(); - mdmModuleDbFiledsRuleEntity.setMdmId(mdmModuleEntity.getId()); - mdmModuleDbFiledsRuleEntity.setSts("Y"); - List mdmModuleDbFiledsRuleEntityList = mdmServiceCache.queryMdmModuleDbFiledsRule(mdmModuleDbFiledsRuleEntity); - if (mdmModuleDbFiledsRuleEntityList == null || mdmModuleDbFiledsRuleEntityList.size() == 0) { - return BaseResult.getFailureMessageEntity("系统错误"); - } - - //查询设置的查询字段 - MdmModuleViewDetailEntity mdmModuleViewDetailEntity = new MdmModuleViewDetailEntity(); - mdmModuleViewDetailEntity.setMdmId(mdmModuleEntity.getId()); - mdmModuleViewDetailEntity.setSts("Y"); - List mdmModuleViewDetailEntities = mdmServiceCache.queryMdmModuleViewDetail(mdmModuleViewDetailEntity); - if (mdmModuleViewDetailEntities == null || mdmModuleViewDetailEntities.size() == 0) { - return BaseResult.getFailureMessageEntity("系统错误"); - } - List queryList = getFiledByType("1",mdmModuleViewDetailEntities,mdmModuleDbEntityList,mdmModuleDbFiledsEntityList,mdmModuleDbFiledsRuleEntityList); - mdmViewVo.setQueryList(queryList); - List listList = getFiledByType("2",mdmModuleViewDetailEntities,mdmModuleDbEntityList,mdmModuleDbFiledsEntityList,mdmModuleDbFiledsRuleEntityList); - mdmViewVo.setListList(listList); - return BaseResult.getSuccessMessageEntity("获取字段成功", mdmViewVo); - } - - /** - * @Author lvleigang - * @Description 根据类型获取字段 - * @Date 9:18 上午 2024/6/6 - * @param viewType 类型 - * @param mdmModuleViewDetailEntities 显示设置的字段 - * @param mdmModuleDbEntityList 表 - * @param mdmModuleDbFiledsEntityList 表字段 - * @param mdmModuleDbFiledsRuleEntityList 字段规则 - * @return java.util.List - **/ - private List getFiledByType(String viewType, List mdmModuleViewDetailEntities, List mdmModuleDbEntityList, List mdmModuleDbFiledsEntityList, List mdmModuleDbFiledsRuleEntityList) { - List mdmViewFiledVos = new ArrayList<>(); - if(mdmModuleViewDetailEntities != null && mdmModuleViewDetailEntities.size() > 0){ - for (int i = 0; i < mdmModuleViewDetailEntities.size(); i++) { - if(viewType.equals(mdmModuleViewDetailEntities.get(i).getViewType())){ - //类型一致 - MdmViewFiledVo mdmViewFiledVo = new MdmViewFiledVo(); - mdmViewFiledVo.setId(mdmModuleViewDetailEntities.get(i).getViewFiled()); - for (int i1 = 0; i1 < mdmModuleDbFiledsEntityList.size(); i1++) { - if(mdmModuleDbFiledsEntityList.get(i1).getId().equals(mdmModuleViewDetailEntities.get(i).getViewFiled())){ - for (int i2 = 0; i2 < mdmModuleDbEntityList.size(); i2++) { - if(mdmModuleDbEntityList.get(i2).getId().equals(mdmModuleDbFiledsEntityList.get(i1).getDbId())){ - mdmViewFiledVo.setDbName(mdmModuleDbEntityList.get(i2).getDbName()); - mdmViewFiledVo.setDbType(mdmModuleDbEntityList.get(i2).getDbType()); - mdmViewFiledVo.setMdmId(mdmModuleDbEntityList.get(i2).getMdmId()); - mdmViewFiledVo.setDbId(mdmModuleDbEntityList.get(i2).getId()); - - break; - } - } - mdmViewFiledVo.setChName(mdmModuleDbFiledsEntityList.get(i1).getChName()); - mdmViewFiledVo.setEnName(mdmModuleDbFiledsEntityList.get(i1).getEnName()); - mdmViewFiledVo.setFiledType(mdmModuleDbFiledsEntityList.get(i1).getFiledType()); - //字段规则 - if(mdmModuleDbFiledsRuleEntityList != null && mdmModuleDbFiledsRuleEntityList.size() > 0){ - List ruleList = new ArrayList<>(); - for (int i2 = 0; i2 < mdmModuleDbFiledsRuleEntityList.size(); i2++) { - if(mdmModuleDbFiledsEntityList.get(i1).getId().equals(mdmModuleDbFiledsRuleEntityList.get(i2).getFiledId())){ - ruleList.add(mdmModuleDbFiledsRuleEntityList.get(i2)); - } - } - mdmViewFiledVo.setRuleList(ruleList); - } - break; - } - } - } - } - } - if(mdmViewFiledVos != null && mdmViewFiledVos.size() > 0){ - for (int i = 0; i < mdmViewFiledVos.size(); i++) { - mdmViewFiledVos.get(i).setSorts(i); - } - } - return mdmViewFiledVos; - } - // - /** - * @param object - * @return com.hzya.frame.web.entity.JsonResultEntity - * @Author lvleigang - * @Description 主数据查询所有字段 - * @Date 9:40 上午 2023/10/18 - **/ - @Override - public JsonResultEntity queryMdmShowAll(JSONObject object) { - MdmDto entity = getData("jsonStr", object, MdmDto.class); - if (entity == null) { - return BaseResult.getFailureMessageEntity("参数不允许为空"); - } - if (entity.getMdmCode() == null || "".equals(entity.getMdmCode())) { - return BaseResult.getFailureMessageEntity("系统错误"); - } - //查询设置各种类型字段 - MdmModuleEntity mdmModuleEntity = mdmServiceCache.getMdmModuleEntity(entity.getMdmCode()); - //查询模版数据源 - MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); - mdmModuleDbEntity.setMdmId(mdmModuleEntity.getId()); - mdmModuleDbEntity.setSts("Y"); - List mdmModuleDbEntityList = mdmServiceCache.queryMdmModuleDb(mdmModuleDbEntity); - List listFiled = new ArrayList<>(); - if (mdmModuleDbEntityList != null && mdmModuleDbEntityList.size() > 0) { - MdmModuleDbFiledsEntity mdmModuleDbFiledsEntity = new MdmModuleDbFiledsEntity(); - mdmModuleDbFiledsEntity.setMdmId(mdmModuleEntity.getId()); - mdmModuleDbFiledsEntity.setSts("Y"); - List mdmModuleDbFiledsEntityList = mdmServiceCache.queryMdmModuleDbFileds(mdmModuleDbFiledsEntity); - // - if (mdmModuleDbEntityList != null && mdmModuleDbEntityList.size() > 0) { - for (int i = 0; i < mdmModuleDbEntityList.size(); i++) { - if("1".equals(mdmModuleDbEntityList.get(i).getDbType()) || "2".equals(mdmModuleDbEntityList.get(i).getDbType())){ - if (mdmModuleDbFiledsEntityList != null && mdmModuleDbFiledsEntityList.size() > 0) { - for (int i1 = 0; i1 < mdmModuleDbFiledsEntityList.size(); i1++) { - if (mdmModuleDbEntityList.get(i).getId().equals(mdmModuleDbFiledsEntityList.get(i1).getDbId())) { - if ("1".equals(mdmModuleDbEntityList.get(i).getDbType())) { - //1、主表 - listFiled.add(new MdmDbFiledVo(mdmModuleDbFiledsEntityList.get(i1).getId(), "【主表:" + mdmModuleDbEntityList.get(i).getDbName() + "】" + mdmModuleDbFiledsEntityList.get(i1).getChName())); - } else { - //2、明细 - listFiled.add(new MdmDbFiledVo(mdmModuleDbFiledsEntityList.get(i1).getId(), "【子表:" + mdmModuleDbEntityList.get(i).getDbName() + "】" + mdmModuleDbFiledsEntityList.get(i1).getChName())); - } - } - } - } - } - } - } - } - return BaseResult.getSuccessMessageEntity("查询视图成功", listFiled); - } + //// // + //// ///** - // * @param mdmModuleRoleButtonEntities - // * @return java.util.List + // * @param object + // * @return com.hzya.frame.web.entity.JsonResultEntity // * @Author lvleigang - // * @Description 设置返回按钮 - // * @Date 4:48 下午 2023/10/26 + // * @Description 主数据列表显示 树、查询条件、列表字段、按钮 + // * @Date 9:40 上午 2023/10/18 // **/ - //private List setButton(List mdmModuleRoleButtonEntities) { - // List mdmViewButtonVoList = new ArrayList<>(); - // if (mdmModuleRoleButtonEntities != null && mdmModuleRoleButtonEntities.size() > 0) { - // for (int i = 0; i < mdmModuleRoleButtonEntities.size(); i++) { - // mdmViewButtonVoList.add(new MdmViewButtonVo(mdmModuleRoleButtonEntities.get(i).getButtonType(), mdmModuleRoleButtonEntities.get(i).getButtonName())); - // } + //@Override + //public JsonResultEntity queryMdmShow(JSONObject object) { + // MdmDto entity = getData("jsonStr", object, MdmDto.class); + // if (entity == null) { + // return BaseResult.getFailureMessageEntity("参数不允许为空"); // } - // return mdmViewButtonVoList; + // if (entity.getMdmCode() == null || "".equals(entity.getMdmCode())) { + // return BaseResult.getFailureMessageEntity("系统错误"); + // } + // //查询模版 + // MdmModuleEntity mdmModuleEntity = mdmServiceCache.getMdmModuleEntity(entity.getMdmCode()); + // if(mdmModuleEntity == null || mdmModuleEntity.getId() == null){ + // return BaseResult.getFailureMessageEntity("系统错误"); + // } + // + // //设置模版 + // MdmViewVo mdmViewVo = new MdmViewVo(); + // mdmViewVo.setMdmModuleEntity(mdmModuleEntity); + // //查询展示类型 + // MdmModuleViewEntity mdmModuleViewEntity = new MdmModuleViewEntity(); + // mdmModuleViewEntity.setMdmId(mdmModuleEntity.getId()); + // mdmModuleViewEntity.setSts("Y"); + // List moduleViewEntityList = mdmServiceCache.queryMdmModuleView(mdmModuleViewEntity); + // if (moduleViewEntityList == null || moduleViewEntityList.size() != 1) { + // return BaseResult.getFailureMessageEntity("系统错误"); + // } + // mdmModuleViewEntity = moduleViewEntityList.get(0); + // mdmViewVo.setMdmModuleViewEntity(mdmModuleViewEntity); + // + // //查询数据源主表 + // MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); + // mdmModuleDbEntity.setMdmId(mdmModuleEntity.getId()); + // mdmModuleDbEntity.setSts("Y"); + // List mdmModuleDbEntityList = mdmServiceCache.queryMdmModuleDb(mdmModuleDbEntity); + // if (mdmModuleDbEntityList == null || mdmModuleDbEntityList.size() == 0) { + // return BaseResult.getFailureMessageEntity("系统错误"); + // } + // //查询数据源表下面的字段 + // MdmModuleDbFiledsEntity mdmModuleDbFiledsEntity = new MdmModuleDbFiledsEntity(); + // mdmModuleDbFiledsEntity.setMdmId(mdmModuleEntity.getId()); + // mdmModuleDbFiledsEntity.setSts("Y"); + // List mdmModuleDbFiledsEntityList = mdmServiceCache.queryMdmModuleDbFileds(mdmModuleDbFiledsEntity); + // if (mdmModuleDbFiledsEntityList == null || mdmModuleDbFiledsEntityList.size() == 0) { + // return BaseResult.getFailureMessageEntity("系统错误"); + // } + // //查询字段下的规则 + // MdmModuleDbFiledsRuleEntity mdmModuleDbFiledsRuleEntity = new MdmModuleDbFiledsRuleEntity(); + // mdmModuleDbFiledsRuleEntity.setMdmId(mdmModuleEntity.getId()); + // mdmModuleDbFiledsRuleEntity.setSts("Y"); + // List mdmModuleDbFiledsRuleEntityList = mdmServiceCache.queryMdmModuleDbFiledsRule(mdmModuleDbFiledsRuleEntity); + // if (mdmModuleDbFiledsRuleEntityList == null || mdmModuleDbFiledsRuleEntityList.size() == 0) { + // return BaseResult.getFailureMessageEntity("系统错误"); + // } + // + // //查询设置的查询字段 + // MdmModuleViewDetailEntity mdmModuleViewDetailEntity = new MdmModuleViewDetailEntity(); + // mdmModuleViewDetailEntity.setMdmId(mdmModuleEntity.getId()); + // mdmModuleViewDetailEntity.setSts("Y"); + // List mdmModuleViewDetailEntities = mdmServiceCache.queryMdmModuleViewDetail(mdmModuleViewDetailEntity); + // if (mdmModuleViewDetailEntities == null || mdmModuleViewDetailEntities.size() == 0) { + // return BaseResult.getFailureMessageEntity("系统错误"); + // } + // List queryList = getFiledByType("1",mdmModuleViewDetailEntities,mdmModuleDbEntityList,mdmModuleDbFiledsEntityList,mdmModuleDbFiledsRuleEntityList); + // mdmViewVo.setQueryList(queryList); + // List listList = getFiledByType("2",mdmModuleViewDetailEntities,mdmModuleDbEntityList,mdmModuleDbFiledsEntityList,mdmModuleDbFiledsRuleEntityList); + // mdmViewVo.setListList(listList); + // return BaseResult.getSuccessMessageEntity("获取字段成功", mdmViewVo); //} // ///** - // * @param allRecords - // * @param checkedMeters - // * @return java.util.List // * @Author lvleigang - // * @Description 取出重复字段数据 - // * @Date 4:34 下午 2023/10/26 - // **/ - //private List getDolist(List allRecords, List checkedMeters) { - // List meterPlan = allRecords.stream() - // .filter(item -> checkedMeters.stream() - // .map(e -> { - // if (!Objects.equals(item.getViewFiled(), e.getViewDetailId())) { - // return null; - // } else { - // return item.getViewFiled(); - // } - // }) - // .collect(Collectors.toList()) - // .contains(item.getViewFiled())) - // .collect(Collectors.toList()); - // return meterPlan; - //} - // - ///** - // * @param mdmModuleDbEntityList 数据源 - // * @param mdmModuleDbFiledsEntityList 数据源下的字段表 - // * @param mdmModuleDbFiledsRuleEntityList 数据源字段的规则表 - // * @param queryList 需要的字段 + // * @Description 根据类型获取字段 + // * @Date 9:18 上午 2024/6/6 + // * @param viewType 类型 + // * @param mdmModuleViewDetailEntities 显示设置的字段 + // * @param mdmModuleDbEntityList 表 + // * @param mdmModuleDbFiledsEntityList 表字段 + // * @param mdmModuleDbFiledsRuleEntityList 字段规则 // * @return java.util.List - // * @Author lvleigang - // * @Description 根据字段设置返回前台字段 - // * @Date 4:11 下午 2023/10/26 // **/ - //private List setQueryList(List mdmModuleDbEntityList, List mdmModuleDbFiledsEntityList, List mdmModuleDbFiledsRuleEntityList, List queryList, boolean flag) { + //private List getFiledByType(String viewType, List mdmModuleViewDetailEntities, List mdmModuleDbEntityList, List mdmModuleDbFiledsEntityList, List mdmModuleDbFiledsRuleEntityList) { // List mdmViewFiledVos = new ArrayList<>(); + // if(mdmModuleViewDetailEntities != null && mdmModuleViewDetailEntities.size() > 0){ + // for (int i = 0; i < mdmModuleViewDetailEntities.size(); i++) { + // if(viewType.equals(mdmModuleViewDetailEntities.get(i).getViewType())){ + // //类型一致 + // MdmViewFiledVo mdmViewFiledVo = new MdmViewFiledVo(); + // mdmViewFiledVo.setId(mdmModuleViewDetailEntities.get(i).getViewFiled()); + // for (int i1 = 0; i1 < mdmModuleDbFiledsEntityList.size(); i1++) { + // if(mdmModuleDbFiledsEntityList.get(i1).getId().equals(mdmModuleViewDetailEntities.get(i).getViewFiled())){ + // for (int i2 = 0; i2 < mdmModuleDbEntityList.size(); i2++) { + // if(mdmModuleDbEntityList.get(i2).getId().equals(mdmModuleDbFiledsEntityList.get(i1).getDbId())){ + // mdmViewFiledVo.setDbName(mdmModuleDbEntityList.get(i2).getDbName()); + // mdmViewFiledVo.setDbType(mdmModuleDbEntityList.get(i2).getDbType()); + // mdmViewFiledVo.setMdmId(mdmModuleDbEntityList.get(i2).getMdmId()); + // mdmViewFiledVo.setDbId(mdmModuleDbEntityList.get(i2).getId()); // - // if (queryList != null && queryList.size() > 0) { - // for (int i = 0; i < queryList.size(); i++) { - // MdmViewFiledVo mdmViewFiledVo = new MdmViewFiledVo(); - // mdmViewFiledVo.setId(queryList.get(i).getViewFiled());//字段id - // mdmViewFiledVo.setSorts(i + 2);//排序 - // for (int i1 = 0; i1 < mdmModuleDbFiledsEntityList.size(); i1++) { - // if (queryList.get(i).getViewFiled().equals(mdmModuleDbFiledsEntityList.get(i1).getId())) { - // mdmViewFiledVo.setFiledType(mdmModuleDbFiledsEntityList.get(i1).getFiledType());//英文名 - // mdmViewFiledVo.setEnName(mdmModuleDbFiledsEntityList.get(i1).getEnName());//英文名 - // mdmViewFiledVo.setChName(mdmModuleDbFiledsEntityList.get(i1).getChName());//中文名 - // for (int i2 = 0; i2 < mdmModuleDbEntityList.size(); i2++) { - // if (mdmModuleDbFiledsEntityList.get(i1).getDbId().equals(mdmModuleDbEntityList.get(i2).getId())) { - // mdmViewFiledVo.setDbType(mdmModuleDbEntityList.get(i2).getDbType());//类型 1、主表 2、明细 - // mdmViewFiledVo.setMdmId(mdmModuleDbEntityList.get(i2).getMdmId());//主数据模版ID - // mdmViewFiledVo.setDbId(mdmModuleDbEntityList.get(i2).getId());//模版数据库id - // mdmViewFiledVo.setDbName(mdmModuleDbEntityList.get(i2).getDbName());//表名 - // - // break; + // break; + // } // } - // } - // break; - // } - // } - // //设置字段规则 - // List ruleList = new ArrayList<>(); - // if (mdmModuleDbFiledsRuleEntityList != null && mdmModuleDbFiledsRuleEntityList.size() > 0) { - // for (int i1 = 0; i1 < mdmModuleDbFiledsRuleEntityList.size(); i1++) { - // if (queryList.get(i).getViewFiled().equals(mdmModuleDbFiledsRuleEntityList.get(i1).getFiledId())) { - // ruleList.add(mdmModuleDbFiledsRuleEntityList.get(i1)); + // mdmViewFiledVo.setChName(mdmModuleDbFiledsEntityList.get(i1).getChName()); + // mdmViewFiledVo.setEnName(mdmModuleDbFiledsEntityList.get(i1).getEnName()); + // mdmViewFiledVo.setFiledType(mdmModuleDbFiledsEntityList.get(i1).getFiledType()); + // //字段规则 + // if(mdmModuleDbFiledsRuleEntityList != null && mdmModuleDbFiledsRuleEntityList.size() > 0){ + // List ruleList = new ArrayList<>(); + // for (int i2 = 0; i2 < mdmModuleDbFiledsRuleEntityList.size(); i2++) { + // if(mdmModuleDbFiledsEntityList.get(i1).getId().equals(mdmModuleDbFiledsRuleEntityList.get(i2).getFiledId())){ + // ruleList.add(mdmModuleDbFiledsRuleEntityList.get(i2)); + // } + // } + // mdmViewFiledVo.setRuleList(ruleList); + // } + // break; // } // } // } - // mdmViewFiledVo.setRuleList(ruleList); - // mdmViewFiledVos.add(mdmViewFiledVo); // } // } - // MdmViewFiledVo mdmViewFiledVo = new MdmViewFiledVo(); - // mdmViewFiledVo.setSorts(1);//排序 - // mdmViewFiledVo.setFiledType("3"); - // mdmViewFiledVo.setEnName("document_rule");//英文名 - // mdmViewFiledVo.setChName("单据编码");//中文名 - // mdmViewFiledVo.setDbType("1");//类型 1、主表 2、明细 - // if (mdmModuleDbEntityList != null && mdmModuleDbEntityList.size() > 0) { - // for (int i = 0; i < mdmModuleDbEntityList.size(); i++) { - // if ("1".equals(mdmModuleDbEntityList.get(i).getDbType())) { - // mdmViewFiledVo.setDbName(mdmModuleDbEntityList.get(i).getDbName());//表名 - // } + // if(mdmViewFiledVos != null && mdmViewFiledVos.size() > 0){ + // for (int i = 0; i < mdmViewFiledVos.size(); i++) { + // mdmViewFiledVos.get(i).setSorts(i); // } // } - // List msgRule = new ArrayList<>(); - // MdmModuleDbFiledsRuleEntity msgRuleTitie = new MdmModuleDbFiledsRuleEntity(); - // msgRuleTitie.setFormName("optionRuleForm"); - // msgRuleTitie.setRuleCode("title"); - // msgRuleTitie.setRuleName("显示名"); - // msgRuleTitie.setRuleType("2"); - // msgRuleTitie.setRuleValue("单据编码"); - // MdmModuleDbFiledsRuleEntity msgRulerow = new MdmModuleDbFiledsRuleEntity(); - // msgRulerow.setFormName("optionRuleForm"); - // msgRulerow.setRuleCode("row"); - // msgRulerow.setRuleName("宽度"); - // msgRulerow.setRuleType("2"); - // msgRulerow.setRuleValue("12"); - // MdmModuleDbFiledsRuleEntity msgRuletype = new MdmModuleDbFiledsRuleEntity(); - // msgRuletype.setFormName("optionRuleForm"); - // msgRuletype.setRuleCode("type"); - // msgRuletype.setRuleName("数据类型"); - // msgRuletype.setRuleType("2"); - // msgRuletype.setRuleValue("input"); - // MdmModuleDbFiledsRuleEntity msgRulerequired = new MdmModuleDbFiledsRuleEntity(); - // msgRulerequired.setFormName("optionRuleForm"); - // msgRulerequired.setRuleCode("required"); - // msgRulerequired.setRuleName("必填"); - // msgRulerequired.setRuleType("2"); - // MdmModuleDbFiledsRuleEntity withs = new MdmModuleDbFiledsRuleEntity(); - // withs.setFormName("optionRuleForm"); - // withs.setRuleCode("width"); - // withs.setRuleName("宽度"); - // withs.setRuleType("2"); - // withs.setRuleValue("200"); - // msgRule.add(withs); - // msgRule.add(msgRulerequired); - // msgRule.add(msgRuletype); - // msgRule.add(msgRulerow); - // msgRule.add(msgRuleTitie); - // mdmViewFiledVo.setRuleList(msgRule); - // mdmViewFiledVos.add(0, mdmViewFiledVo); - // - // //添加分发数量 - // if (flag) { - // addFfsl(mdmModuleDbEntityList, mdmViewFiledVos); - // } // return mdmViewFiledVos; //} - // - //private void addFfsl(List mdmModuleDbEntityList, List mdmViewFiledVos) { - // - // MdmViewFiledVo mdmViewFiledVo = new MdmViewFiledVo(); - // mdmViewFiledVo.setSorts(1);//排序 - // mdmViewFiledVo.setFiledType("1"); - // mdmViewFiledVo.setEnName("qwqwasdasdzxasda");//英文名 - // mdmViewFiledVo.setChName("分发数量");//中文名 - // mdmViewFiledVo.setDbType("1");//类型 1、主表 2、明细 + //// + ///** + // * @param object + // * @return com.hzya.frame.web.entity.JsonResultEntity + // * @Author lvleigang + // * @Description 主数据查询所有字段 + // * @Date 9:40 上午 2023/10/18 + // **/ + //@Override + //public JsonResultEntity queryMdmShowAll(JSONObject object) { + // MdmDto entity = getData("jsonStr", object, MdmDto.class); + // if (entity == null) { + // return BaseResult.getFailureMessageEntity("参数不允许为空"); + // } + // if (entity.getMdmCode() == null || "".equals(entity.getMdmCode())) { + // return BaseResult.getFailureMessageEntity("系统错误"); + // } + // //查询设置各种类型字段 + // MdmModuleEntity mdmModuleEntity = mdmServiceCache.getMdmModuleEntity(entity.getMdmCode()); + // //查询模版数据源 + // MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); + // mdmModuleDbEntity.setMdmId(mdmModuleEntity.getId()); + // mdmModuleDbEntity.setSts("Y"); + // List mdmModuleDbEntityList = mdmServiceCache.queryMdmModuleDb(mdmModuleDbEntity); + // List listFiled = new ArrayList<>(); // if (mdmModuleDbEntityList != null && mdmModuleDbEntityList.size() > 0) { - // for (int i = 0; i < mdmModuleDbEntityList.size(); i++) { - // if ("1".equals(mdmModuleDbEntityList.get(i).getDbType())) { - // mdmViewFiledVo.setDbName(mdmModuleDbEntityList.get(i).getDbName());//表名 + // MdmModuleDbFiledsEntity mdmModuleDbFiledsEntity = new MdmModuleDbFiledsEntity(); + // mdmModuleDbFiledsEntity.setMdmId(mdmModuleEntity.getId()); + // mdmModuleDbFiledsEntity.setSts("Y"); + // List mdmModuleDbFiledsEntityList = mdmServiceCache.queryMdmModuleDbFileds(mdmModuleDbFiledsEntity); + // // + // if (mdmModuleDbEntityList != null && mdmModuleDbEntityList.size() > 0) { + // for (int i = 0; i < mdmModuleDbEntityList.size(); i++) { + // if("1".equals(mdmModuleDbEntityList.get(i).getDbType()) || "2".equals(mdmModuleDbEntityList.get(i).getDbType())){ + // if (mdmModuleDbFiledsEntityList != null && mdmModuleDbFiledsEntityList.size() > 0) { + // for (int i1 = 0; i1 < mdmModuleDbFiledsEntityList.size(); i1++) { + // if (mdmModuleDbEntityList.get(i).getId().equals(mdmModuleDbFiledsEntityList.get(i1).getDbId())) { + // if ("1".equals(mdmModuleDbEntityList.get(i).getDbType())) { + // //1、主表 + // listFiled.add(new MdmDbFiledVo(mdmModuleDbFiledsEntityList.get(i1).getId(), "【主表:" + mdmModuleDbEntityList.get(i).getDbName() + "】" + mdmModuleDbFiledsEntityList.get(i1).getChName())); + // } else { + // //2、明细 + // listFiled.add(new MdmDbFiledVo(mdmModuleDbFiledsEntityList.get(i1).getId(), "【子表:" + mdmModuleDbEntityList.get(i).getDbName() + "】" + mdmModuleDbFiledsEntityList.get(i1).getChName())); + // } + // } + // } + // } + // } // } // } // } - // List msgRule = new ArrayList<>(); - // MdmModuleDbFiledsRuleEntity msgRuleTitie = new MdmModuleDbFiledsRuleEntity(); - // msgRuleTitie.setFormName("optionRuleForm"); - // msgRuleTitie.setRuleCode("title"); - // msgRuleTitie.setRuleName("显示名"); - // msgRuleTitie.setRuleType("2"); - // msgRuleTitie.setRuleValue("分发数量"); - // MdmModuleDbFiledsRuleEntity msgRulerow = new MdmModuleDbFiledsRuleEntity(); - // msgRulerow.setFormName("optionRuleForm"); - // msgRulerow.setRuleCode("row"); - // msgRulerow.setRuleName("宽度"); - // msgRulerow.setRuleType("2"); - // msgRulerow.setRuleValue("6"); - // MdmModuleDbFiledsRuleEntity msgRuletype = new MdmModuleDbFiledsRuleEntity(); - // msgRuletype.setFormName("optionRuleForm"); - // msgRuletype.setRuleCode("type"); - // msgRuletype.setRuleName("数据类型"); - // msgRuletype.setRuleType("2"); - // msgRuletype.setRuleValue("input"); - // MdmModuleDbFiledsRuleEntity msgRulerequired = new MdmModuleDbFiledsRuleEntity(); - // msgRulerequired.setFormName("optionRuleForm"); - // msgRulerequired.setRuleCode("required"); - // msgRulerequired.setRuleName("必填"); - // msgRulerequired.setRuleType("2"); - // msgRule.add(msgRulerequired); - // msgRule.add(msgRuletype); - // msgRule.add(msgRulerow); - // msgRule.add(msgRuleTitie); - // mdmViewFiledVo.setRuleList(msgRule); - // mdmViewFiledVos.add(mdmViewFiledVo); + // return BaseResult.getSuccessMessageEntity("查询视图成功", listFiled); //} - // - /** - * @param object - * @return com.hzya.frame.web.entity.JsonResultEntity - * @Author lvleigang - * @Description 主数据列表显示 业务数据 - * @Date 9:40 上午 2023/10/18 - **/ - @Override - public JsonResultEntity queryMdmShowData(JSONObject object) { - MdmQuery entity = getData("jsonStr", object, MdmQuery.class); - if (entity == null) { - return BaseResult.getFailureMessageEntity("参数不允许为空"); - } - //判断分页 - if (entity == null || entity.getPageNum() == null || entity.getPageSize() == null) { - return BaseResult.getFailureMessageEntity("分页查询参数不存在"); - } - PageHelper.startPage(entity.getPageNum(), entity.getPageSize()); - List> businessResult = mdmModuleDao.queryMdmShowData(entity); - PageInfo pageInfo = new PageInfo(businessResult); - return BaseResult.getSuccessMessageEntity("查询数据成功", pageInfo); - } - // + //// + /////** + //// * @param mdmModuleRoleButtonEntities + //// * @return java.util.List + //// * @Author lvleigang + //// * @Description 设置返回按钮 + //// * @Date 4:48 下午 2023/10/26 + //// **/ + ////private List setButton(List mdmModuleRoleButtonEntities) { + //// List mdmViewButtonVoList = new ArrayList<>(); + //// if (mdmModuleRoleButtonEntities != null && mdmModuleRoleButtonEntities.size() > 0) { + //// for (int i = 0; i < mdmModuleRoleButtonEntities.size(); i++) { + //// mdmViewButtonVoList.add(new MdmViewButtonVo(mdmModuleRoleButtonEntities.get(i).getButtonType(), mdmModuleRoleButtonEntities.get(i).getButtonName())); + //// } + //// } + //// return mdmViewButtonVoList; + ////} + //// + /////** + //// * @param allRecords + //// * @param checkedMeters + //// * @return java.util.List + //// * @Author lvleigang + //// * @Description 取出重复字段数据 + //// * @Date 4:34 下午 2023/10/26 + //// **/ + ////private List getDolist(List allRecords, List checkedMeters) { + //// List meterPlan = allRecords.stream() + //// .filter(item -> checkedMeters.stream() + //// .map(e -> { + //// if (!Objects.equals(item.getViewFiled(), e.getViewDetailId())) { + //// return null; + //// } else { + //// return item.getViewFiled(); + //// } + //// }) + //// .collect(Collectors.toList()) + //// .contains(item.getViewFiled())) + //// .collect(Collectors.toList()); + //// return meterPlan; + ////} + //// + /////** + //// * @param mdmModuleDbEntityList 数据源 + //// * @param mdmModuleDbFiledsEntityList 数据源下的字段表 + //// * @param mdmModuleDbFiledsRuleEntityList 数据源字段的规则表 + //// * @param queryList 需要的字段 + //// * @return java.util.List + //// * @Author lvleigang + //// * @Description 根据字段设置返回前台字段 + //// * @Date 4:11 下午 2023/10/26 + //// **/ + ////private List setQueryList(List mdmModuleDbEntityList, List mdmModuleDbFiledsEntityList, List mdmModuleDbFiledsRuleEntityList, List queryList, boolean flag) { + //// List mdmViewFiledVos = new ArrayList<>(); + //// + //// if (queryList != null && queryList.size() > 0) { + //// for (int i = 0; i < queryList.size(); i++) { + //// MdmViewFiledVo mdmViewFiledVo = new MdmViewFiledVo(); + //// mdmViewFiledVo.setId(queryList.get(i).getViewFiled());//字段id + //// mdmViewFiledVo.setSorts(i + 2);//排序 + //// for (int i1 = 0; i1 < mdmModuleDbFiledsEntityList.size(); i1++) { + //// if (queryList.get(i).getViewFiled().equals(mdmModuleDbFiledsEntityList.get(i1).getId())) { + //// mdmViewFiledVo.setFiledType(mdmModuleDbFiledsEntityList.get(i1).getFiledType());//英文名 + //// mdmViewFiledVo.setEnName(mdmModuleDbFiledsEntityList.get(i1).getEnName());//英文名 + //// mdmViewFiledVo.setChName(mdmModuleDbFiledsEntityList.get(i1).getChName());//中文名 + //// for (int i2 = 0; i2 < mdmModuleDbEntityList.size(); i2++) { + //// if (mdmModuleDbFiledsEntityList.get(i1).getDbId().equals(mdmModuleDbEntityList.get(i2).getId())) { + //// mdmViewFiledVo.setDbType(mdmModuleDbEntityList.get(i2).getDbType());//类型 1、主表 2、明细 + //// mdmViewFiledVo.setMdmId(mdmModuleDbEntityList.get(i2).getMdmId());//主数据模版ID + //// mdmViewFiledVo.setDbId(mdmModuleDbEntityList.get(i2).getId());//模版数据库id + //// mdmViewFiledVo.setDbName(mdmModuleDbEntityList.get(i2).getDbName());//表名 + //// + //// break; + //// } + //// } + //// break; + //// } + //// } + //// //设置字段规则 + //// List ruleList = new ArrayList<>(); + //// if (mdmModuleDbFiledsRuleEntityList != null && mdmModuleDbFiledsRuleEntityList.size() > 0) { + //// for (int i1 = 0; i1 < mdmModuleDbFiledsRuleEntityList.size(); i1++) { + //// if (queryList.get(i).getViewFiled().equals(mdmModuleDbFiledsRuleEntityList.get(i1).getFiledId())) { + //// ruleList.add(mdmModuleDbFiledsRuleEntityList.get(i1)); + //// } + //// } + //// } + //// mdmViewFiledVo.setRuleList(ruleList); + //// mdmViewFiledVos.add(mdmViewFiledVo); + //// } + //// } + //// MdmViewFiledVo mdmViewFiledVo = new MdmViewFiledVo(); + //// mdmViewFiledVo.setSorts(1);//排序 + //// mdmViewFiledVo.setFiledType("3"); + //// mdmViewFiledVo.setEnName("document_rule");//英文名 + //// mdmViewFiledVo.setChName("单据编码");//中文名 + //// mdmViewFiledVo.setDbType("1");//类型 1、主表 2、明细 + //// if (mdmModuleDbEntityList != null && mdmModuleDbEntityList.size() > 0) { + //// for (int i = 0; i < mdmModuleDbEntityList.size(); i++) { + //// if ("1".equals(mdmModuleDbEntityList.get(i).getDbType())) { + //// mdmViewFiledVo.setDbName(mdmModuleDbEntityList.get(i).getDbName());//表名 + //// } + //// } + //// } + //// List msgRule = new ArrayList<>(); + //// MdmModuleDbFiledsRuleEntity msgRuleTitie = new MdmModuleDbFiledsRuleEntity(); + //// msgRuleTitie.setFormName("optionRuleForm"); + //// msgRuleTitie.setRuleCode("title"); + //// msgRuleTitie.setRuleName("显示名"); + //// msgRuleTitie.setRuleType("2"); + //// msgRuleTitie.setRuleValue("单据编码"); + //// MdmModuleDbFiledsRuleEntity msgRulerow = new MdmModuleDbFiledsRuleEntity(); + //// msgRulerow.setFormName("optionRuleForm"); + //// msgRulerow.setRuleCode("row"); + //// msgRulerow.setRuleName("宽度"); + //// msgRulerow.setRuleType("2"); + //// msgRulerow.setRuleValue("12"); + //// MdmModuleDbFiledsRuleEntity msgRuletype = new MdmModuleDbFiledsRuleEntity(); + //// msgRuletype.setFormName("optionRuleForm"); + //// msgRuletype.setRuleCode("type"); + //// msgRuletype.setRuleName("数据类型"); + //// msgRuletype.setRuleType("2"); + //// msgRuletype.setRuleValue("input"); + //// MdmModuleDbFiledsRuleEntity msgRulerequired = new MdmModuleDbFiledsRuleEntity(); + //// msgRulerequired.setFormName("optionRuleForm"); + //// msgRulerequired.setRuleCode("required"); + //// msgRulerequired.setRuleName("必填"); + //// msgRulerequired.setRuleType("2"); + //// MdmModuleDbFiledsRuleEntity withs = new MdmModuleDbFiledsRuleEntity(); + //// withs.setFormName("optionRuleForm"); + //// withs.setRuleCode("width"); + //// withs.setRuleName("宽度"); + //// withs.setRuleType("2"); + //// withs.setRuleValue("200"); + //// msgRule.add(withs); + //// msgRule.add(msgRulerequired); + //// msgRule.add(msgRuletype); + //// msgRule.add(msgRulerow); + //// msgRule.add(msgRuleTitie); + //// mdmViewFiledVo.setRuleList(msgRule); + //// mdmViewFiledVos.add(0, mdmViewFiledVo); + //// + //// //添加分发数量 + //// if (flag) { + //// addFfsl(mdmModuleDbEntityList, mdmViewFiledVos); + //// } + //// return mdmViewFiledVos; + ////} + //// + ////private void addFfsl(List mdmModuleDbEntityList, List mdmViewFiledVos) { + //// + //// MdmViewFiledVo mdmViewFiledVo = new MdmViewFiledVo(); + //// mdmViewFiledVo.setSorts(1);//排序 + //// mdmViewFiledVo.setFiledType("1"); + //// mdmViewFiledVo.setEnName("qwqwasdasdzxasda");//英文名 + //// mdmViewFiledVo.setChName("分发数量");//中文名 + //// mdmViewFiledVo.setDbType("1");//类型 1、主表 2、明细 + //// if (mdmModuleDbEntityList != null && mdmModuleDbEntityList.size() > 0) { + //// for (int i = 0; i < mdmModuleDbEntityList.size(); i++) { + //// if ("1".equals(mdmModuleDbEntityList.get(i).getDbType())) { + //// mdmViewFiledVo.setDbName(mdmModuleDbEntityList.get(i).getDbName());//表名 + //// } + //// } + //// } + //// List msgRule = new ArrayList<>(); + //// MdmModuleDbFiledsRuleEntity msgRuleTitie = new MdmModuleDbFiledsRuleEntity(); + //// msgRuleTitie.setFormName("optionRuleForm"); + //// msgRuleTitie.setRuleCode("title"); + //// msgRuleTitie.setRuleName("显示名"); + //// msgRuleTitie.setRuleType("2"); + //// msgRuleTitie.setRuleValue("分发数量"); + //// MdmModuleDbFiledsRuleEntity msgRulerow = new MdmModuleDbFiledsRuleEntity(); + //// msgRulerow.setFormName("optionRuleForm"); + //// msgRulerow.setRuleCode("row"); + //// msgRulerow.setRuleName("宽度"); + //// msgRulerow.setRuleType("2"); + //// msgRulerow.setRuleValue("6"); + //// MdmModuleDbFiledsRuleEntity msgRuletype = new MdmModuleDbFiledsRuleEntity(); + //// msgRuletype.setFormName("optionRuleForm"); + //// msgRuletype.setRuleCode("type"); + //// msgRuletype.setRuleName("数据类型"); + //// msgRuletype.setRuleType("2"); + //// msgRuletype.setRuleValue("input"); + //// MdmModuleDbFiledsRuleEntity msgRulerequired = new MdmModuleDbFiledsRuleEntity(); + //// msgRulerequired.setFormName("optionRuleForm"); + //// msgRulerequired.setRuleCode("required"); + //// msgRulerequired.setRuleName("必填"); + //// msgRulerequired.setRuleType("2"); + //// msgRule.add(msgRulerequired); + //// msgRule.add(msgRuletype); + //// msgRule.add(msgRulerow); + //// msgRule.add(msgRuleTitie); + //// mdmViewFiledVo.setRuleList(msgRule); + //// mdmViewFiledVos.add(mdmViewFiledVo); + ////} + //// ///** // * @param object // * @return com.hzya.frame.web.entity.JsonResultEntity @@ -2870,7 +2847,653 @@ public class MdmServiceImpl implements IMdmService { // * @Date 9:40 上午 2023/10/18 // **/ //@Override - //public JsonResultEntity queryMdmShowDistribute(JSONObject object) { + //public JsonResultEntity queryMdmShowData(JSONObject object) { + // MdmQuery entity = getData("jsonStr", object, MdmQuery.class); + // if (entity == null) { + // return BaseResult.getFailureMessageEntity("参数不允许为空"); + // } + // //判断分页 + // if (entity == null || entity.getPageNum() == null || entity.getPageSize() == null) { + // return BaseResult.getFailureMessageEntity("分页查询参数不存在"); + // } + // PageHelper.startPage(entity.getPageNum(), entity.getPageSize()); + // List> businessResult = mdmModuleDao.queryMdmShowData(entity); + // PageInfo pageInfo = new PageInfo(businessResult); + // return BaseResult.getSuccessMessageEntity("查询数据成功", pageInfo); + //} + //// + /////** + //// * @param object + //// * @return com.hzya.frame.web.entity.JsonResultEntity + //// * @Author lvleigang + //// * @Description 主数据列表显示 业务数据 + //// * @Date 9:40 上午 2023/10/18 + //// **/ + ////@Override + ////public JsonResultEntity queryMdmShowDistribute(JSONObject object) { + //// MdmDto entity = getData("jsonStr", object, MdmDto.class); + //// if (entity == null) { + //// return BaseResult.getFailureMessageEntity("参数不允许为空"); + //// } + //// if (entity.getMdmCode() == null || "".equals(entity.getMdmCode())) { + //// return BaseResult.getFailureMessageEntity("系统错误"); + //// } + //// if (entity.getId() == null || "".equals(entity.getId())) { + //// return BaseResult.getFailureMessageEntity("系统错误"); + //// } + //// //查询模版 + //// MdmModuleEntity mdmModuleEntity = new MdmModuleEntity(); + //// mdmModuleEntity.setMdmCode(entity.getMdmCode()); + //// mdmModuleEntity.setSts("Y"); + //// List mdmModuleEntities = mdmModuleDao.queryBase(mdmModuleEntity); + //// if (mdmModuleEntities == null || mdmModuleEntities.size() != 1) { + //// return BaseResult.getFailureMessageEntity("系统错误"); + //// } + //// + //// //查询数据源主表 + //// MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); + //// mdmModuleDbEntity.setMdmId(mdmModuleEntities.get(0).getId()); + //// mdmModuleDbEntity.setDbType("1"); + //// mdmModuleDbEntity.setSts("Y"); + //// List mdmModuleDbEntityList = mdmModuleDbDao.queryBase(mdmModuleDbEntity); + //// if (mdmModuleDbEntityList == null || mdmModuleDbEntityList.size() == 0) { + //// return BaseResult.getFailureMessageEntity("系统错误"); + //// } + //// mdmModuleDbEntity = mdmModuleDbEntityList.get(0); + //// Map queryData = new HashMap<>(); + //// queryData.put("tableName", mdmModuleDbEntity.getDbName() + "_distribute");//表名 + //// queryData.put("id", entity.getId());//字段 + //// List datas = mdmModuleDbDao.getServiceByDistributeIdNoCase(queryData); + //// List returnData = new ArrayList<>(); + //// + //// //查询分发表 + //// MdmModuleDistributeEntity mdmModuleDistributeEntity = new MdmModuleDistributeEntity(); + //// mdmModuleDistributeEntity.setMdmId(mdmModuleEntities.get(0).getId()); + //// mdmModuleDistributeEntity.setSts("Y"); + //// List mdmModuleDistributeEntities = mdmModuleDistributeDao.queryBase(mdmModuleDistributeEntity); + //// if (datas != null && datas.size() > 0) { + //// if (mdmModuleDistributeEntities != null && mdmModuleDistributeEntities.size() > 0) { + //// for (int i = 0; i < mdmModuleDistributeEntities.size(); i++) { + //// boolean flag = false; + //// for (int i1 = 0; i1 < datas.size(); i1++) { + //// if (datas.get(i1).getAppId().equals(mdmModuleDistributeEntities.get(i).getAppId())) { + //// flag = true; + //// break; + //// } + //// } + //// if (!flag) { + //// MdmDistributeVo mdmDistributeVo = new MdmDistributeVo(); + //// mdmDistributeVo.setAppId(mdmModuleDistributeEntities.get(i).getAppId()); + //// mdmDistributeVo.setStatus("4"); + //// mdmDistributeVo.setMsg("未发送"); + //// returnData.add(mdmDistributeVo); + //// } + //// } + //// } + //// returnData.addAll(datas); + //// } else { + //// if (mdmModuleDistributeEntities != null && mdmModuleDistributeEntities.size() > 0) { + //// for (int i = 0; i < mdmModuleDistributeEntities.size(); i++) { + //// MdmDistributeVo mdmDistributeVo = new MdmDistributeVo(); + //// mdmDistributeVo.setAppId(mdmModuleDistributeEntities.get(i).getAppId()); + //// mdmDistributeVo.setStatus("4"); + //// mdmDistributeVo.setMsg("未发送"); + //// returnData.add(mdmDistributeVo); + //// } + //// } + //// } + //// return BaseResult.getSuccessMessageEntity("查询数据成功", returnData); + ////} + //// + ///** + // * @param object + // * @return com.hzya.frame.web.entity.JsonResultEntity + // * @Author lvleigang + // * @Description 查询数据(list 或者 分页) + // * @Date 1:33 下午 2023/7/12 + // **/ + //@Override + //public JsonResultEntity queryTemplateData(JSONObject object) { + // MdmDto entity = getData("jsonStr", object, MdmDto.class); + // //校验是否有servecr传参 + // if (!checkStr(entity.getTableName())) { + // return BaseResult.getFailureMessageEntity("请先传递服务名"); + // } + // if (!checkStr(entity.getValue())) { + // return BaseResult.getFailureMessageEntity("请先传递存储字段"); + // } + // if (!checkStr(entity.getLabel())) { + // return BaseResult.getFailureMessageEntity("请先传递显示字段"); + // } + // if (entity.getPageNum() != null && entity.getPageSize() != null) { + // PageHelper.startPage(entity.getPageNum(), entity.getPageSize()); + // List> mapList = mdmModuleDao.querySelectData(entity); + // PageInfo pageInfo = new PageInfo(mapList); + // return BaseResult.getSuccessMessageEntity("查询数据成功", pageInfo); + // } else { + // List> mapList = mdmModuleDao.querySelectData(entity); + // return BaseResult.getSuccessMessageEntity("查询数据成功", mapList); + // } + //} + //// + ///** + // * @param object + // * @return com.hzya.frame.web.entity.JsonResultEntity + // * @Author lvleigang + // * @Description 业务数据树形结构,数据查询 + // * @Date 9:40 上午 2023/10/18 + // **/ + //@Override + //public JsonResultEntity queryMdmShowTreeData(JSONObject object) { + // MdmDto entity = getData("jsonStr", object, MdmDto.class); + // if (entity == null) { + // return BaseResult.getFailureMessageEntity("参数不允许为空"); + // } + // //if (entity.getTableName() == null || "".equals(entity.getTableName())) { + // // return BaseResult.getFailureMessageEntity("系统错误"); + // //} + // if (entity.getLabel() == null || "".equals(entity.getLabel())) { + // return BaseResult.getFailureMessageEntity("系统错误"); + // } + // if (entity.getUpId() == null || "".equals(entity.getUpId())) { + // return BaseResult.getFailureMessageEntity("系统错误"); + // } + // if (entity.getMdmCode() == null || "".equals(entity.getMdmCode())) { + // return BaseResult.getFailureMessageEntity("系统错误"); + // + // } + // //查询模版 + // MdmModuleEntity mdmModuleEntities = mdmServiceCache.getMdmModuleEntity(entity.getMdmCode()); + // if (mdmModuleEntities == null ) { + // return BaseResult.getFailureMessageEntity("系统错误"); + // } + // //查询数据源主表 + // MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); + // mdmModuleDbEntity.setMdmId(mdmModuleEntities.getId()); + // mdmModuleDbEntity.setSts("Y"); + // List mdmModuleDbEntityList = mdmServiceCache.queryMdmModuleDb(mdmModuleDbEntity); + // if (mdmModuleDbEntityList == null || mdmModuleDbEntityList.size() == 0) { + // return BaseResult.getFailureMessageEntity("系统错误"); + // } + // for (int i = 0; i < mdmModuleDbEntityList.size(); i++) { + // if("1".equals(mdmModuleDbEntityList.get(i).getDbType())){ + // mdmModuleDbEntity = mdmModuleDbEntityList.get(i); + // break; + // } + // } + // entity.setTableName(mdmModuleDbEntity.getDbName()); + // + // + // + // if (checkStr(entity.getId())) { + // if (!checkStr(entity.getValue())) { + // return BaseResult.getFailureMessageEntity("请先传递存储字段"); + // } + // if (entity.getId().contains(",")) { + // String[] strArray = entity.getId().split(","); // 使用逗号和空格作为分隔符 + // entity.setIds(strArray); + // List> mapList = mdmModuleDao.queryTemplateDataMore(entity); + // if (mapList == null || mapList.size() == 0) { + // List> returnList = new ArrayList<>(); + // return BaseResult.getSuccessMessageEntity("查询数据成功", returnList); + // } + // List> returnList = gettochilder(strArray, 0, mapList); + // return BaseResult.getSuccessMessageEntity("查询数据成功", returnList); + // } else { + // HashMap mapList = mdmModuleDao.queryTemplateDataOne(entity); + // if (mapList == null || mapList.size() == 0) { + // List> returnList = new ArrayList<>(); + // return BaseResult.getSuccessMessageEntity("查询数据成功", returnList); + // } + // List> returnList = new ArrayList<>(); + // returnList.add(mapList); + // return BaseResult.getSuccessMessageEntity("查询数据成功", returnList); + // } + // } else { + // List> mapList = mdmModuleDao.queryDataAll(entity); + // List> returnList = new ArrayList<>(); + // + // if (mapList != null && mapList.size() > 0) { + // for (int i = 0; i < mapList.size(); i++) { + // //默认为根 + // if (mapList.get(i).get(entity.getUpId()) == null || "".equals(mapList.get(i).get(entity.getUpId()))) { + // List> children = getchilder(mapList.get(i).get("qsdfg").toString(), mapList, entity); + // HashMap re = new HashMap<>(); + // re.put("id", mapList.get(i).get("qsdfg")); + // re.put("label", mapList.get(i).get(entity.getLabel())); + // re.put("upID", mapList.get(i).get(entity.getUpId())); + // if (children != null && children.size() > 0) { + // re.put("children", children); + // } + // returnList.add(re); + // } + // } + // } + // return BaseResult.getSuccessMessageEntity("查询数据成功", returnList); + // } + //} + //// + //private List> gettochilder(String[] strArray, int i, List> mapList) { + // List> maps = new ArrayList<>(); + // for (int i1 = 0; i1 < mapList.size(); i1++) { + // if (strArray[i].equals(mapList.get(i1).get("id").toString())) { + // if (strArray.length >= (i + 2)) { + // mapList.get(i1).put("children", gettochilder(strArray, i + 1, mapList)); + // } + // maps.add(mapList.get(i1)); + // break; + // } + // } + // return maps; + //} + //// + ////private HashMap getFathers(List> mapListAll, HashMap mapList, MdmDto entity) { + //// if (mapList.get("upID") == null) { + //// return mapList; + //// } + //// HashMap retList = new HashMap<>(); + //// if (mapListAll != null && mapListAll.size() > 0) { + //// for (int i = 0; i < mapListAll.size(); i++) { + //// //等于上级id的时候 + //// if (mapListAll.get(i).get("qsdfg").equals(mapList.get("upID"))) { + //// retList.put("id", mapListAll.get(i).get("qsdfg")); + //// retList.put("label", mapListAll.get(i).get(entity.getLabel())); + //// retList.put("upID", mapListAll.get(i).get(entity.getUpId())); + //// List> returnList = new ArrayList<>(); + //// returnList.add(mapList); + //// retList.put("children", returnList); + //// break; + //// } + //// } + //// } + //// HashMap a = getFathers(mapListAll, retList, entity); + //// return a; + ////} + //// + //private List> getchilder(String stringObjectHashMap, List> mapList, MdmDto entity) { + // List> returnList = new ArrayList<>(); + // if (mapList != null && mapList.size() > 0) { + // for (int i = 0; i < mapList.size(); i++) { + // //等于上级id的时候 + // if (stringObjectHashMap.equals(mapList.get(i).get(entity.getUpId()))) { + // List> children = getchilder(mapList.get(i).get(entity.getUpId()) + "," + mapList.get(i).get("qsdfg"), mapList, entity); + // HashMap re = new HashMap<>(); + // re.put("id", mapList.get(i).get("qsdfg")); + // re.put("label", mapList.get(i).get(entity.getLabel())); + // re.put("upID", mapList.get(i).get(entity.getUpId())); + // if (children != null && children.size() > 0) { + // re.put("children", children); + // } + // returnList.add(re); + // } + // } + // } + // return returnList; + //} + //// + ///** + // * @param object + // * @return com.hzya.frame.web.entity.JsonResultEntity + // * @Author lvleigang + // * @Description 主数据详情 区分类型 新增、修改、查看 + // * @Date 9:40 上午 2023/10/18 + // **/ + //@Override + //public JsonResultEntity queryMdmShowDetails(JSONObject object) { + // MdmDto entity = getData("jsonStr", object, MdmDto.class); + // if (entity == null) { + // return BaseResult.getFailureMessageEntity("参数不允许为空"); + // } + // if (entity.getMdmCode() == null || "".equals(entity.getMdmCode())) { + // return BaseResult.getFailureMessageEntity("系统错误"); + // } + // if (entity.getShowType() == null || "".equals(entity.getShowType())) { + // return BaseResult.getFailureMessageEntity("系统错误"); + // } + // //查询模版 + // //List mdmModuleEntities = mdmModuleDao.queryBase(mdmModuleEntity); + // MdmModuleEntity mdmModuleEntities = mdmServiceCache.getMdmModuleEntity(entity.getMdmCode()); + // if (mdmModuleEntities == null) { + // return BaseResult.getFailureMessageEntity("系统错误"); + // } + // MdmDetailViewVo mdmViewVo = new MdmDetailViewVo(); + // mdmViewVo.setMdmModuleEntity(mdmModuleEntities); + // + // //查询数据源主表 + // MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); + // mdmModuleDbEntity.setMdmId(mdmModuleEntities.getId()); + // mdmModuleDbEntity.setSts("Y"); + // List mdmModuleDbEntityList = mdmServiceCache.queryMdmModuleDb(mdmModuleDbEntity); + // if (mdmModuleDbEntityList == null || mdmModuleDbEntityList.size() == 0) { + // return BaseResult.getFailureMessageEntity("系统错误"); + // } + // //查询数据源表下面的字段 + // MdmModuleDbFiledsEntity mdmModuleDbFiledsEntity = new MdmModuleDbFiledsEntity(); + // mdmModuleDbFiledsEntity.setMdmId(mdmModuleEntities.getId()); + // mdmModuleDbFiledsEntity.setSts("Y"); + // List mdmModuleDbFiledsEntityList = mdmServiceCache.queryMdmModuleDbFileds(mdmModuleDbFiledsEntity); + // if (mdmModuleDbFiledsEntityList == null || mdmModuleDbFiledsEntityList.size() == 0) { + // return BaseResult.getFailureMessageEntity("系统错误"); + // } + // //查询字段下的规则 + // MdmModuleDbFiledsRuleEntity mdmModuleDbFiledsRuleEntity = new MdmModuleDbFiledsRuleEntity(); + // mdmModuleDbFiledsRuleEntity.setMdmId(mdmModuleEntities.getId()); + // mdmModuleDbFiledsRuleEntity.setSts("Y"); + // List mdmModuleDbFiledsRuleEntityList = mdmServiceCache.queryMdmModuleDbFiledsRule(mdmModuleDbFiledsRuleEntity); + // if (mdmModuleDbFiledsRuleEntityList == null || mdmModuleDbFiledsRuleEntityList.size() == 0) { + // return BaseResult.getFailureMessageEntity("系统错误"); + // } + // MdmModuleViewDetailEntity mdmModuleViewDetailEntity = new MdmModuleViewDetailEntity(); + // mdmModuleViewDetailEntity.setMdmId(mdmModuleEntities.getId()); + // mdmModuleViewDetailEntity.setSts("Y"); + // mdmModuleViewDetailEntity.setViewType(entity.getShowType());//设置显示字段类型 + // List queryAll = mdmModuleViewDetailDao.queryBase(mdmModuleViewDetailEntity); + // List mdmModuleViewDetailEntityList = new ArrayList<>(); + // if(queryAll != null && queryAll.size() > 0){ + // for (int i = 0; i < queryAll.size(); i++) { + // if(entity.getShowType().equals(queryAll.get(i).getViewType())){ + // mdmModuleViewDetailEntityList.add(queryAll.get(i)); + // } + // } + // } + // //组装数据 + // assembleMdmShowDetails(mdmViewVo, mdmModuleDbEntityList, mdmModuleDbFiledsEntityList, mdmModuleDbFiledsRuleEntityList, mdmModuleViewDetailEntityList, entity.getShowType()); + // return BaseResult.getSuccessMessageEntity("获取字段成功", mdmViewVo); + //} + // + ///** + // * @param mdmViewVo 返回对象 + // * @param mdmModuleDbEntityList 数据源表 + // * @param mdmModuleDbFiledsEntityList 数据源字段 + // * @param mdmModuleDbFiledsRuleEntityList 数据源字段规则 + // * @param mdmModuleViewDetailEntityList 数据源显示字段 + // * @return void + // * @Author lvleigang + // * @Description 组装显示字段 + // * @Date 9:10 上午 2023/11/6 + // **/ + //private void assembleMdmShowDetails(MdmDetailViewVo mdmViewVo, List mdmModuleDbEntityList, List mdmModuleDbFiledsEntityList, List mdmModuleDbFiledsRuleEntityList, List mdmModuleViewDetailEntityList, String showType) { + // //主数据主表 + // MdmModuleDbEntity mainMdmModuleDb = new MdmModuleDbEntity(); + // List mainMdmModuleDbFileds = new ArrayList<>(); + // //主数据子表 + // List sublistMdmModuleDb = new ArrayList<>(); + // + // if (mdmModuleViewDetailEntityList != null && mdmModuleViewDetailEntityList.size() > 0) { + // //先循环数据源表,设置出数据字段 + // for (int i = 0; i < mdmModuleDbEntityList.size(); i++) { + // if ("1".equals(mdmModuleDbEntityList.get(i).getDbType())) { + // //1、主表 2、明细 + // mainMdmModuleDb = mdmModuleDbEntityList.get(i); + // //循环字段表 + // if (mdmModuleDbFiledsEntityList != null && mdmModuleDbFiledsEntityList.size() > 0) { + // for (int i1 = 0; i1 < mdmModuleDbFiledsEntityList.size(); i1++) { + // if (mdmModuleDbEntityList.get(i).getId().equals(mdmModuleDbFiledsEntityList.get(i1).getDbId())) { + // for (int b = 0; b < mdmModuleViewDetailEntityList.size(); b++) { + // if (mdmModuleViewDetailEntityList.get(b).getViewFiled().equals(mdmModuleDbFiledsEntityList.get(i1).getId())) { + // mainMdmModuleDbFileds.add(mdmModuleDbFiledsEntityList.get(i1)); + // List mdmModuleDbFiledsRules = new ArrayList<>(); + // //循环字段属性 + // if (mdmModuleDbFiledsRuleEntityList != null && mdmModuleDbFiledsRuleEntityList.size() > 0) { + // for (int i2 = 0; i2 < mdmModuleDbFiledsRuleEntityList.size(); i2++) { + // if (mdmModuleDbFiledsEntityList.get(i1).getDbId().equals(mdmModuleDbFiledsRuleEntityList.get(i2).getDbId()) + // && mdmModuleDbFiledsEntityList.get(i1).getId().equals(mdmModuleDbFiledsRuleEntityList.get(i2).getFiledId())) { + // mdmModuleDbFiledsRules.add(mdmModuleDbFiledsRuleEntityList.get(i2)); + // } + // } + // } + // mdmModuleDbFiledsEntityList.get(i1).setMdmModuleDbFiledsRules(mdmModuleDbFiledsRules); + // } + // } + // } + // } + // } + // } else if ("2".equals(mdmModuleDbEntityList.get(i).getDbType())) { + // //2、明细 + // sublistMdmModuleDb.add(mdmModuleDbEntityList.get(i)); + // //循环字段表 + // if (mdmModuleDbFiledsEntityList != null && mdmModuleDbFiledsEntityList.size() > 0) { + // List sublistMdmModuleDbFileds = new ArrayList<>(); + // for (int i1 = 0; i1 < mdmModuleDbFiledsEntityList.size(); i1++) { + // if (mdmModuleDbEntityList.get(i).getId().equals(mdmModuleDbFiledsEntityList.get(i1).getDbId())) { + // for (int b = 0; b < mdmModuleViewDetailEntityList.size(); b++) { + // if (mdmModuleViewDetailEntityList.get(b).getViewFiled().equals(mdmModuleDbFiledsEntityList.get(i1).getId())) { + // sublistMdmModuleDbFileds.add(mdmModuleDbFiledsEntityList.get(i1)); + // List mdmModuleDbFiledsRules = new ArrayList<>(); + // //循环字段属性 + // if (mdmModuleDbFiledsRuleEntityList != null && mdmModuleDbFiledsRuleEntityList.size() > 0) { + // for (int i2 = 0; i2 < mdmModuleDbFiledsRuleEntityList.size(); i2++) { + // if (mdmModuleDbFiledsEntityList.get(i1).getDbId().equals(mdmModuleDbFiledsRuleEntityList.get(i2).getDbId()) + // && mdmModuleDbFiledsEntityList.get(i1).getId().equals(mdmModuleDbFiledsRuleEntityList.get(i2).getFiledId())) { + // mdmModuleDbFiledsRules.add(mdmModuleDbFiledsRuleEntityList.get(i2)); + // } + // } + // } + // mdmModuleDbFiledsEntityList.get(i1).setMdmModuleDbFiledsRules(mdmModuleDbFiledsRules); + // } + // } + // + // } + // } + // mdmModuleDbEntityList.get(i).setSublistMdmModuleDbFileds(sublistMdmModuleDbFileds); + // } + // } + // } + // mainMdmModuleDb.setSublistMdmModuleDbFileds(mainMdmModuleDbFileds); + // mdmViewVo.setMainMdmModuleDb(mainMdmModuleDb); + // //主数据子表 + // List mdmModuleDb = new ArrayList<>(); + // if (sublistMdmModuleDb != null && sublistMdmModuleDb.size() > 0) { + // for (int i = 0; i < sublistMdmModuleDb.size(); i++) { + // if (sublistMdmModuleDb.get(i).getSublistMdmModuleDbFileds() != null && sublistMdmModuleDb.get(i).getSublistMdmModuleDbFileds().size() > 0) { + // mdmModuleDb.add(sublistMdmModuleDb.get(i)); + // } + // } + // } + // //if ("5".equals(showType)) { + // // MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); + // // mdmModuleDbEntity.setDbName(mainMdmModuleDb.getDbName() + "_distribute"); + // // mdmModuleDbEntity.setRemark(mainMdmModuleDb.getRemark() + "分发表"); + // // mdmModuleDbEntity.setDbType("2"); + // // List mdmModuleDbFiledsEntityList1 = getDistributeRole(); + // // mdmModuleDbEntity.setSublistMdmModuleDbFileds(mdmModuleDbFiledsEntityList1); + // // mdmModuleDb.add(mdmModuleDbEntity); + // //} + // mdmViewVo.setSublistMdmModuleDb(mdmModuleDb); + // + // } else { + // mdmViewVo.setMainMdmModuleDb(mainMdmModuleDb); + // mdmViewVo.setSublistMdmModuleDb(sublistMdmModuleDb); + // } + //} + //// + ////private List getDistributeRole() { + //// List mdmModuleDbFiledsEntityList = new ArrayList<>(); + //// //app + //// MdmModuleDbFiledsEntity appFiled = new MdmModuleDbFiledsEntity(); + //// appFiled.setChName("应用"); + //// appFiled.setEnName("app_id"); + //// appFiled.setFiledLength("50"); + //// appFiled.setFiledType("3"); + //// List appRule = new ArrayList<>(); + //// MdmModuleDbFiledsRuleEntity appRuleTitie = new MdmModuleDbFiledsRuleEntity(); + //// appRuleTitie.setFormName("optionRuleForm"); + //// appRuleTitie.setRuleCode("title"); + //// appRuleTitie.setRuleName("显示名"); + //// appRuleTitie.setRuleType("2"); + //// appRuleTitie.setRuleValue("应用"); + //// MdmModuleDbFiledsRuleEntity appRulerow = new MdmModuleDbFiledsRuleEntity(); + //// appRulerow.setFormName("optionRuleForm"); + //// appRulerow.setRuleCode("row"); + //// appRulerow.setRuleName("宽度"); + //// appRulerow.setRuleType("2"); + //// appRulerow.setRuleValue("6"); + //// MdmModuleDbFiledsRuleEntity appRuletype = new MdmModuleDbFiledsRuleEntity(); + //// appRuletype.setFormName("optionRuleForm"); + //// appRuletype.setRuleCode("type"); + //// appRuletype.setRuleName("数据类型"); + //// appRuletype.setRuleType("2"); + //// appRuletype.setRuleValue("select"); + //// MdmModuleDbFiledsRuleEntity appRulerequired = new MdmModuleDbFiledsRuleEntity(); + //// appRulerequired.setFormName("optionRuleForm"); + //// appRulerequired.setRuleCode("required"); + //// appRulerequired.setRuleName("必填"); + //// appRulerequired.setRuleType("2"); + //// MdmModuleDbFiledsRuleEntity appRuleservice = new MdmModuleDbFiledsRuleEntity(); + //// appRuleservice.setFormName("typeOptionRuleForm"); + //// appRuleservice.setRuleCode("service"); + //// appRuleservice.setRuleName("服务名称"); + //// appRuleservice.setRuleType("2"); + //// appRuleservice.setRuleValue("sys_application"); + //// MdmModuleDbFiledsRuleEntity appRulelabel = new MdmModuleDbFiledsRuleEntity(); + //// appRulelabel.setFormName("typeOptionRuleForm"); + //// appRulelabel.setRuleCode("label"); + //// appRulelabel.setRuleName("label"); + //// appRulelabel.setRuleType("2"); + //// appRulelabel.setRuleValue("name"); + //// MdmModuleDbFiledsRuleEntity appRulevalue = new MdmModuleDbFiledsRuleEntity(); + //// appRulevalue.setFormName("typeOptionRuleForm"); + //// appRulevalue.setRuleCode("value"); + //// appRulevalue.setRuleName("value"); + //// appRulevalue.setRuleType("2"); + //// appRulevalue.setRuleValue("id"); + //// appRule.add(appRulevalue); + //// appRule.add(appRulelabel); + //// appRule.add(appRuleservice); + //// appRule.add(appRulerequired); + //// appRule.add(appRuletype); + //// appRule.add(appRulerow); + //// appRule.add(appRuleTitie); + //// appFiled.setMdmModuleDbFiledsRules(appRule); + //// mdmModuleDbFiledsEntityList.add(appFiled); + //// + //// + //// //status + //// MdmModuleDbFiledsEntity statusFiled = new MdmModuleDbFiledsEntity(); + //// statusFiled.setChName("状态"); + //// statusFiled.setEnName("status"); + //// statusFiled.setFiledLength("50"); + //// statusFiled.setFiledType("3"); + //// List statusRule = new ArrayList<>(); + //// MdmModuleDbFiledsRuleEntity statusRuleTitie = new MdmModuleDbFiledsRuleEntity(); + //// statusRuleTitie.setFormName("optionRuleForm"); + //// statusRuleTitie.setRuleCode("title"); + //// statusRuleTitie.setRuleName("显示名"); + //// statusRuleTitie.setRuleType("2"); + //// statusRuleTitie.setRuleValue("状态"); + //// MdmModuleDbFiledsRuleEntity statusRulerow = new MdmModuleDbFiledsRuleEntity(); + //// statusRulerow.setFormName("optionRuleForm"); + //// statusRulerow.setRuleCode("row"); + //// statusRulerow.setRuleName("宽度"); + //// statusRulerow.setRuleType("2"); + //// statusRulerow.setRuleValue("6"); + //// MdmModuleDbFiledsRuleEntity statusRuletype = new MdmModuleDbFiledsRuleEntity(); + //// statusRuletype.setFormName("optionRuleForm"); + //// statusRuletype.setRuleCode("type"); + //// statusRuletype.setRuleName("数据类型"); + //// statusRuletype.setRuleType("2"); + //// statusRuletype.setRuleValue("input"); + //// MdmModuleDbFiledsRuleEntity statusRulerequired = new MdmModuleDbFiledsRuleEntity(); + //// statusRulerequired.setFormName("optionRuleForm"); + //// statusRulerequired.setRuleCode("required"); + //// statusRulerequired.setRuleName("必填"); + //// statusRulerequired.setRuleType("2"); + //// statusRule.add(statusRulerequired); + //// statusRule.add(statusRuletype); + //// statusRule.add(statusRulerow); + //// statusRule.add(statusRuleTitie); + //// statusFiled.setMdmModuleDbFiledsRules(statusRule); + //// mdmModuleDbFiledsEntityList.add(statusFiled); + //// + //// + //// //msg + //// MdmModuleDbFiledsEntity msgFiled = new MdmModuleDbFiledsEntity(); + //// msgFiled.setChName("描述"); + //// msgFiled.setEnName("msg"); + //// msgFiled.setFiledLength("200"); + //// msgFiled.setFiledType("3"); + //// List msgRule = new ArrayList<>(); + //// MdmModuleDbFiledsRuleEntity msgRuleTitie = new MdmModuleDbFiledsRuleEntity(); + //// msgRuleTitie.setFormName("optionRuleForm"); + //// msgRuleTitie.setRuleCode("title"); + //// msgRuleTitie.setRuleName("显示名"); + //// msgRuleTitie.setRuleType("2"); + //// msgRuleTitie.setRuleValue("描述"); + //// MdmModuleDbFiledsRuleEntity msgRulerow = new MdmModuleDbFiledsRuleEntity(); + //// msgRulerow.setFormName("optionRuleForm"); + //// msgRulerow.setRuleCode("row"); + //// msgRulerow.setRuleName("宽度"); + //// msgRulerow.setRuleType("2"); + //// msgRulerow.setRuleValue("6"); + //// MdmModuleDbFiledsRuleEntity msgRuletype = new MdmModuleDbFiledsRuleEntity(); + //// msgRuletype.setFormName("optionRuleForm"); + //// msgRuletype.setRuleCode("type"); + //// msgRuletype.setRuleName("数据类型"); + //// msgRuletype.setRuleType("2"); + //// msgRuletype.setRuleValue("input"); + //// MdmModuleDbFiledsRuleEntity msgRulerequired = new MdmModuleDbFiledsRuleEntity(); + //// msgRulerequired.setFormName("optionRuleForm"); + //// msgRulerequired.setRuleCode("required"); + //// msgRulerequired.setRuleName("必填"); + //// msgRulerequired.setRuleType("2"); + //// msgRule.add(msgRulerequired); + //// msgRule.add(msgRuletype); + //// msgRule.add(msgRulerow); + //// msgRule.add(msgRuleTitie); + //// msgFiled.setMdmModuleDbFiledsRules(msgRule); + //// mdmModuleDbFiledsEntityList.add(msgFiled); + //// return mdmModuleDbFiledsEntityList; + ////} + //// + /////** + //// * @param object + //// * @return com.hzya.frame.web.entity.JsonResultEntity + //// * @Author lvleigang + //// * @Description 查询数据(list 或者 分页) + //// * @Date 1:33 下午 2023/7/12 + //// **/ + ////@Override + ////public JsonResultEntity queryMdmOptionData(JSONObject object) { + //// ModuleDto entity = getData("jsonStr", object, ModuleDto.class); + //// //校验是否有servecr传参 + //// if (!checkStr(entity.getService())) { + //// return BaseResult.getFailureMessageEntity("请先传递服务名"); + //// } + //// if (!checkStr(entity.getValue())) { + //// return BaseResult.getFailureMessageEntity("请先传递存储字段"); + //// } + //// if (!checkStr(entity.getLabel())) { + //// return BaseResult.getFailureMessageEntity("请先传递显示字段"); + //// } + //// //查询数据源主表 + //// MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); + //// mdmModuleDbEntity.setId(entity.getId()); + //// mdmModuleDbEntity.setSts("Y"); + //// List mdmModuleDbEntityList = mdmModuleDbDao.queryBase(mdmModuleDbEntity); + //// if (mdmModuleDbEntityList == null || mdmModuleDbEntityList.size() == 0) { + //// return BaseResult.getFailureMessageEntity("系统错误"); + //// } + //// entity.setTableName(mdmModuleDbEntityList.get(0).getDbName()); + //// if (entity.getPageNum() != null && entity.getPageSize() != null) { + //// PageHelper.startPage(entity.getPageNum(), entity.getPageSize()); + //// List> mapList = mdmModuleDao.queryTemplateData(entity); + //// PageInfo pageInfo = new PageInfo(mapList); + //// return BaseResult.getSuccessMessageEntity("查询数据成功", pageInfo); + //// } else { + //// List> mapList = mdmModuleDao.queryTemplateData(entity); + //// return BaseResult.getSuccessMessageEntity("查询数据成功", mapList); + //// } + ////} + //// + ///** + // * @param object + // * @return com.hzya.frame.web.entity.JsonResultEntity + // * @Author lvleigang + // * @Description 主数据详情数据 区分类型 新增、修改、查看 + // * @Date 9:40 上午 2023/10/18 + // **/ + //@Override + //public JsonResultEntity queryMdmShowDetailsData(JSONObject object) { // MdmDto entity = getData("jsonStr", object, MdmDto.class); // if (entity == null) { // return BaseResult.getFailureMessageEntity("参数不允许为空"); @@ -2882,853 +3505,146 @@ public class MdmServiceImpl implements IMdmService { // return BaseResult.getFailureMessageEntity("系统错误"); // } // //查询模版 + // + // MdmModuleEntity mdmModuleEntity = mdmServiceCache.getMdmModuleEntity(entity.getMdmCode()); + // if (mdmModuleEntity == null ) { + // return BaseResult.getFailureMessageEntity("系统错误"); + // } + // //查询数据源主表 + // MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); + // mdmModuleDbEntity.setMdmId(mdmModuleEntity.getId()); + // mdmModuleDbEntity.setSts("Y"); + // List mdmModuleDbEntityList = mdmServiceCache.queryMdmModuleDb(mdmModuleDbEntity); + // if (mdmModuleDbEntityList == null || mdmModuleDbEntityList.size() == 0) { + // return BaseResult.getFailureMessageEntity("系统错误"); + // } + // String tablename = null; + // JSONObject jsonObject = new JSONObject(); + // for (int i = 0; i < mdmModuleDbEntityList.size(); i++) { + // //查询数据 + // Map queryData = new HashMap<>(); + // queryData.put("tableName", mdmModuleDbEntityList.get(i).getDbName());//表名 + // if ("1".equals(mdmModuleDbEntityList.get(i).getDbType())) { + // queryData.put("detailFlag", false);//是否明细 + // queryData.put("id", entity.getId());//字段 + // HashMap datas = mdmModuleDbDao.getServiceDataById(queryData); + // jsonObject.put(mdmModuleDbEntityList.get(i).getDbName(), datas); + // tablename = mdmModuleDbEntityList.get(i).getDbName() + "_distribute"; + // } else { + // queryData.put("detailFlag", true);//是否明细 + // queryData.put("id", entity.getId());//字段 + // List> datas = mdmModuleDbDao.getServiceByFormmainId(queryData); + // jsonObject.put(mdmModuleDbEntityList.get(i).getDbName(), datas); + // } + // } + // if (tablename != null && !"".equals(tablename)) { + // Map queryData = new HashMap<>(); + // queryData.put("tableName", tablename);//表名 + // queryData.put("id", entity.getId());//字段 + // List> datas = mdmModuleDbDao.getServiceByDistributeId(queryData); + // jsonObject.put(tablename, datas); + // } + // + // + // return BaseResult.getSuccessMessageEntity("获取数据成功", jsonObject); + //} + ///** + // * @param object + // * @return com.hzya.frame.web.entity.JsonResultEntity + // * @Author lvleigang + // * @Description 主数据详情数据修改 + // * @Date 9:40 上午 2023/10/18 + // **/ + //@Override + //public JsonResultEntity updateMdmShowDetailsData(JSONObject object) { + // JSONObject jsonObject = getstrObj("jsonStr", object); + // //校验是否有servecr传参 + // if (!checkData(jsonObject, "mdmCode")) { + // return BaseResult.getFailureMessageEntity("请先传递服务名"); + // } + // if (!checkData(jsonObject, "data")) { + // return BaseResult.getFailureMessageEntity("请先传递要修改的数据"); + // } + // JSONObject saveData = jsonObject.getJSONObject("data"); + // //校验唯一 // MdmModuleEntity mdmModuleEntity = new MdmModuleEntity(); - // mdmModuleEntity.setMdmCode(entity.getMdmCode()); + // mdmModuleEntity.setMdmCode(jsonObject.getLong("mdmCode")); // mdmModuleEntity.setSts("Y"); // List mdmModuleEntities = mdmModuleDao.queryBase(mdmModuleEntity); // if (mdmModuleEntities == null || mdmModuleEntities.size() != 1) { // return BaseResult.getFailureMessageEntity("系统错误"); // } - // - // //查询数据源主表 + // mdmModuleEntity = mdmModuleEntities.get(0); // MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); - // mdmModuleDbEntity.setMdmId(mdmModuleEntities.get(0).getId()); - // mdmModuleDbEntity.setDbType("1"); + // mdmModuleDbEntity.setMdmId(mdmModuleEntity.getId()); // mdmModuleDbEntity.setSts("Y"); // List mdmModuleDbEntityList = mdmModuleDbDao.queryBase(mdmModuleDbEntity); // if (mdmModuleDbEntityList == null || mdmModuleDbEntityList.size() == 0) { // return BaseResult.getFailureMessageEntity("系统错误"); // } - // mdmModuleDbEntity = mdmModuleDbEntityList.get(0); - // Map queryData = new HashMap<>(); - // queryData.put("tableName", mdmModuleDbEntity.getDbName() + "_distribute");//表名 - // queryData.put("id", entity.getId());//字段 - // List datas = mdmModuleDbDao.getServiceByDistributeIdNoCase(queryData); - // List returnData = new ArrayList<>(); + // String res = checkDataOnly(jsonObject.getInteger("mdmCode"), saveData, true, mdmModuleEntity, mdmModuleDbEntityList); // - // //查询分发表 - // MdmModuleDistributeEntity mdmModuleDistributeEntity = new MdmModuleDistributeEntity(); - // mdmModuleDistributeEntity.setMdmId(mdmModuleEntities.get(0).getId()); - // mdmModuleDistributeEntity.setSts("Y"); - // List mdmModuleDistributeEntities = mdmModuleDistributeDao.queryBase(mdmModuleDistributeEntity); - // if (datas != null && datas.size() > 0) { - // if (mdmModuleDistributeEntities != null && mdmModuleDistributeEntities.size() > 0) { - // for (int i = 0; i < mdmModuleDistributeEntities.size(); i++) { - // boolean flag = false; - // for (int i1 = 0; i1 < datas.size(); i1++) { - // if (datas.get(i1).getAppId().equals(mdmModuleDistributeEntities.get(i).getAppId())) { - // flag = true; - // break; - // } - // } - // if (!flag) { - // MdmDistributeVo mdmDistributeVo = new MdmDistributeVo(); - // mdmDistributeVo.setAppId(mdmModuleDistributeEntities.get(i).getAppId()); - // mdmDistributeVo.setStatus("4"); - // mdmDistributeVo.setMsg("未发送"); - // returnData.add(mdmDistributeVo); - // } - // } - // } - // returnData.addAll(datas); + // if (res == null || "".equals(res)) { + // return BaseResult.getSuccessMessageEntity("修改数据成功"); // } else { - // if (mdmModuleDistributeEntities != null && mdmModuleDistributeEntities.size() > 0) { - // for (int i = 0; i < mdmModuleDistributeEntities.size(); i++) { - // MdmDistributeVo mdmDistributeVo = new MdmDistributeVo(); - // mdmDistributeVo.setAppId(mdmModuleDistributeEntities.get(i).getAppId()); - // mdmDistributeVo.setStatus("4"); - // mdmDistributeVo.setMsg("未发送"); - // returnData.add(mdmDistributeVo); - // } - // } - // } - // return BaseResult.getSuccessMessageEntity("查询数据成功", returnData); - //} - // - /** - * @param object - * @return com.hzya.frame.web.entity.JsonResultEntity - * @Author lvleigang - * @Description 查询数据(list 或者 分页) - * @Date 1:33 下午 2023/7/12 - **/ - @Override - public JsonResultEntity queryTemplateData(JSONObject object) { - MdmDto entity = getData("jsonStr", object, MdmDto.class); - //校验是否有servecr传参 - if (!checkStr(entity.getTableName())) { - return BaseResult.getFailureMessageEntity("请先传递服务名"); - } - if (!checkStr(entity.getValue())) { - return BaseResult.getFailureMessageEntity("请先传递存储字段"); - } - if (!checkStr(entity.getLabel())) { - return BaseResult.getFailureMessageEntity("请先传递显示字段"); - } - if (entity.getPageNum() != null && entity.getPageSize() != null) { - PageHelper.startPage(entity.getPageNum(), entity.getPageSize()); - List> mapList = mdmModuleDao.querySelectData(entity); - PageInfo pageInfo = new PageInfo(mapList); - return BaseResult.getSuccessMessageEntity("查询数据成功", pageInfo); - } else { - List> mapList = mdmModuleDao.querySelectData(entity); - return BaseResult.getSuccessMessageEntity("查询数据成功", mapList); - } - } - // - /** - * @param object - * @return com.hzya.frame.web.entity.JsonResultEntity - * @Author lvleigang - * @Description 业务数据树形结构,数据查询 - * @Date 9:40 上午 2023/10/18 - **/ - @Override - public JsonResultEntity queryMdmShowTreeData(JSONObject object) { - MdmDto entity = getData("jsonStr", object, MdmDto.class); - if (entity == null) { - return BaseResult.getFailureMessageEntity("参数不允许为空"); - } - //if (entity.getTableName() == null || "".equals(entity.getTableName())) { - // return BaseResult.getFailureMessageEntity("系统错误"); - //} - if (entity.getLabel() == null || "".equals(entity.getLabel())) { - return BaseResult.getFailureMessageEntity("系统错误"); - } - if (entity.getUpId() == null || "".equals(entity.getUpId())) { - return BaseResult.getFailureMessageEntity("系统错误"); - } - if (entity.getMdmCode() == null || "".equals(entity.getMdmCode())) { - return BaseResult.getFailureMessageEntity("系统错误"); - - } - //查询模版 - MdmModuleEntity mdmModuleEntities = mdmServiceCache.getMdmModuleEntity(entity.getMdmCode()); - if (mdmModuleEntities == null ) { - return BaseResult.getFailureMessageEntity("系统错误"); - } - //查询数据源主表 - MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); - mdmModuleDbEntity.setMdmId(mdmModuleEntities.getId()); - mdmModuleDbEntity.setSts("Y"); - List mdmModuleDbEntityList = mdmServiceCache.queryMdmModuleDb(mdmModuleDbEntity); - if (mdmModuleDbEntityList == null || mdmModuleDbEntityList.size() == 0) { - return BaseResult.getFailureMessageEntity("系统错误"); - } - for (int i = 0; i < mdmModuleDbEntityList.size(); i++) { - if("1".equals(mdmModuleDbEntityList.get(i).getDbType())){ - mdmModuleDbEntity = mdmModuleDbEntityList.get(i); - break; - } - } - entity.setTableName(mdmModuleDbEntity.getDbName()); - - - - if (checkStr(entity.getId())) { - if (!checkStr(entity.getValue())) { - return BaseResult.getFailureMessageEntity("请先传递存储字段"); - } - if (entity.getId().contains(",")) { - String[] strArray = entity.getId().split(","); // 使用逗号和空格作为分隔符 - entity.setIds(strArray); - List> mapList = mdmModuleDao.queryTemplateDataMore(entity); - if (mapList == null || mapList.size() == 0) { - List> returnList = new ArrayList<>(); - return BaseResult.getSuccessMessageEntity("查询数据成功", returnList); - } - List> returnList = gettochilder(strArray, 0, mapList); - return BaseResult.getSuccessMessageEntity("查询数据成功", returnList); - } else { - HashMap mapList = mdmModuleDao.queryTemplateDataOne(entity); - if (mapList == null || mapList.size() == 0) { - List> returnList = new ArrayList<>(); - return BaseResult.getSuccessMessageEntity("查询数据成功", returnList); - } - List> returnList = new ArrayList<>(); - returnList.add(mapList); - return BaseResult.getSuccessMessageEntity("查询数据成功", returnList); - } - } else { - List> mapList = mdmModuleDao.queryDataAll(entity); - List> returnList = new ArrayList<>(); - - if (mapList != null && mapList.size() > 0) { - for (int i = 0; i < mapList.size(); i++) { - //默认为根 - if (mapList.get(i).get(entity.getUpId()) == null || "".equals(mapList.get(i).get(entity.getUpId()))) { - List> children = getchilder(mapList.get(i).get("qsdfg").toString(), mapList, entity); - HashMap re = new HashMap<>(); - re.put("id", mapList.get(i).get("qsdfg")); - re.put("label", mapList.get(i).get(entity.getLabel())); - re.put("upID", mapList.get(i).get(entity.getUpId())); - if (children != null && children.size() > 0) { - re.put("children", children); - } - returnList.add(re); - } - } - } - return BaseResult.getSuccessMessageEntity("查询数据成功", returnList); - } - } - // - private List> gettochilder(String[] strArray, int i, List> mapList) { - List> maps = new ArrayList<>(); - for (int i1 = 0; i1 < mapList.size(); i1++) { - if (strArray[i].equals(mapList.get(i1).get("id").toString())) { - if (strArray.length >= (i + 2)) { - mapList.get(i1).put("children", gettochilder(strArray, i + 1, mapList)); - } - maps.add(mapList.get(i1)); - break; - } - } - return maps; - } - // - //private HashMap getFathers(List> mapListAll, HashMap mapList, MdmDto entity) { - // if (mapList.get("upID") == null) { - // return mapList; - // } - // HashMap retList = new HashMap<>(); - // if (mapListAll != null && mapListAll.size() > 0) { - // for (int i = 0; i < mapListAll.size(); i++) { - // //等于上级id的时候 - // if (mapListAll.get(i).get("qsdfg").equals(mapList.get("upID"))) { - // retList.put("id", mapListAll.get(i).get("qsdfg")); - // retList.put("label", mapListAll.get(i).get(entity.getLabel())); - // retList.put("upID", mapListAll.get(i).get(entity.getUpId())); - // List> returnList = new ArrayList<>(); - // returnList.add(mapList); - // retList.put("children", returnList); - // break; - // } - // } - // } - // HashMap a = getFathers(mapListAll, retList, entity); - // return a; - //} - // - private List> getchilder(String stringObjectHashMap, List> mapList, MdmDto entity) { - List> returnList = new ArrayList<>(); - if (mapList != null && mapList.size() > 0) { - for (int i = 0; i < mapList.size(); i++) { - //等于上级id的时候 - if (stringObjectHashMap.equals(mapList.get(i).get(entity.getUpId()))) { - List> children = getchilder(mapList.get(i).get(entity.getUpId()) + "," + mapList.get(i).get("qsdfg"), mapList, entity); - HashMap re = new HashMap<>(); - re.put("id", mapList.get(i).get("qsdfg")); - re.put("label", mapList.get(i).get(entity.getLabel())); - re.put("upID", mapList.get(i).get(entity.getUpId())); - if (children != null && children.size() > 0) { - re.put("children", children); - } - returnList.add(re); - } - } - } - return returnList; - } - // - /** - * @param object - * @return com.hzya.frame.web.entity.JsonResultEntity - * @Author lvleigang - * @Description 主数据详情 区分类型 新增、修改、查看 - * @Date 9:40 上午 2023/10/18 - **/ - @Override - public JsonResultEntity queryMdmShowDetails(JSONObject object) { - MdmDto entity = getData("jsonStr", object, MdmDto.class); - if (entity == null) { - return BaseResult.getFailureMessageEntity("参数不允许为空"); - } - if (entity.getMdmCode() == null || "".equals(entity.getMdmCode())) { - return BaseResult.getFailureMessageEntity("系统错误"); - } - if (entity.getShowType() == null || "".equals(entity.getShowType())) { - return BaseResult.getFailureMessageEntity("系统错误"); - } - //查询模版 - //List mdmModuleEntities = mdmModuleDao.queryBase(mdmModuleEntity); - MdmModuleEntity mdmModuleEntities = mdmServiceCache.getMdmModuleEntity(entity.getMdmCode()); - if (mdmModuleEntities == null) { - return BaseResult.getFailureMessageEntity("系统错误"); - } - MdmDetailViewVo mdmViewVo = new MdmDetailViewVo(); - mdmViewVo.setMdmModuleEntity(mdmModuleEntities); - - //查询数据源主表 - MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); - mdmModuleDbEntity.setMdmId(mdmModuleEntities.getId()); - mdmModuleDbEntity.setSts("Y"); - List mdmModuleDbEntityList = mdmServiceCache.queryMdmModuleDb(mdmModuleDbEntity); - if (mdmModuleDbEntityList == null || mdmModuleDbEntityList.size() == 0) { - return BaseResult.getFailureMessageEntity("系统错误"); - } - //查询数据源表下面的字段 - MdmModuleDbFiledsEntity mdmModuleDbFiledsEntity = new MdmModuleDbFiledsEntity(); - mdmModuleDbFiledsEntity.setMdmId(mdmModuleEntities.getId()); - mdmModuleDbFiledsEntity.setSts("Y"); - List mdmModuleDbFiledsEntityList = mdmServiceCache.queryMdmModuleDbFileds(mdmModuleDbFiledsEntity); - if (mdmModuleDbFiledsEntityList == null || mdmModuleDbFiledsEntityList.size() == 0) { - return BaseResult.getFailureMessageEntity("系统错误"); - } - //查询字段下的规则 - MdmModuleDbFiledsRuleEntity mdmModuleDbFiledsRuleEntity = new MdmModuleDbFiledsRuleEntity(); - mdmModuleDbFiledsRuleEntity.setMdmId(mdmModuleEntities.getId()); - mdmModuleDbFiledsRuleEntity.setSts("Y"); - List mdmModuleDbFiledsRuleEntityList = mdmServiceCache.queryMdmModuleDbFiledsRule(mdmModuleDbFiledsRuleEntity); - if (mdmModuleDbFiledsRuleEntityList == null || mdmModuleDbFiledsRuleEntityList.size() == 0) { - return BaseResult.getFailureMessageEntity("系统错误"); - } - MdmModuleViewDetailEntity mdmModuleViewDetailEntity = new MdmModuleViewDetailEntity(); - mdmModuleViewDetailEntity.setMdmId(mdmModuleEntities.getId()); - mdmModuleViewDetailEntity.setSts("Y"); - mdmModuleViewDetailEntity.setViewType(entity.getShowType());//设置显示字段类型 - List queryAll = mdmModuleViewDetailDao.queryBase(mdmModuleViewDetailEntity); - List mdmModuleViewDetailEntityList = new ArrayList<>(); - if(queryAll != null && queryAll.size() > 0){ - for (int i = 0; i < queryAll.size(); i++) { - if(entity.getShowType().equals(queryAll.get(i).getViewType())){ - mdmModuleViewDetailEntityList.add(queryAll.get(i)); - } - } - } - //组装数据 - assembleMdmShowDetails(mdmViewVo, mdmModuleDbEntityList, mdmModuleDbFiledsEntityList, mdmModuleDbFiledsRuleEntityList, mdmModuleViewDetailEntityList, entity.getShowType()); - return BaseResult.getSuccessMessageEntity("获取字段成功", mdmViewVo); - } - - /** - * @param mdmViewVo 返回对象 - * @param mdmModuleDbEntityList 数据源表 - * @param mdmModuleDbFiledsEntityList 数据源字段 - * @param mdmModuleDbFiledsRuleEntityList 数据源字段规则 - * @param mdmModuleViewDetailEntityList 数据源显示字段 - * @return void - * @Author lvleigang - * @Description 组装显示字段 - * @Date 9:10 上午 2023/11/6 - **/ - private void assembleMdmShowDetails(MdmDetailViewVo mdmViewVo, List mdmModuleDbEntityList, List mdmModuleDbFiledsEntityList, List mdmModuleDbFiledsRuleEntityList, List mdmModuleViewDetailEntityList, String showType) { - //主数据主表 - MdmModuleDbEntity mainMdmModuleDb = new MdmModuleDbEntity(); - List mainMdmModuleDbFileds = new ArrayList<>(); - //主数据子表 - List sublistMdmModuleDb = new ArrayList<>(); - - if (mdmModuleViewDetailEntityList != null && mdmModuleViewDetailEntityList.size() > 0) { - //先循环数据源表,设置出数据字段 - for (int i = 0; i < mdmModuleDbEntityList.size(); i++) { - if ("1".equals(mdmModuleDbEntityList.get(i).getDbType())) { - //1、主表 2、明细 - mainMdmModuleDb = mdmModuleDbEntityList.get(i); - //循环字段表 - if (mdmModuleDbFiledsEntityList != null && mdmModuleDbFiledsEntityList.size() > 0) { - for (int i1 = 0; i1 < mdmModuleDbFiledsEntityList.size(); i1++) { - if (mdmModuleDbEntityList.get(i).getId().equals(mdmModuleDbFiledsEntityList.get(i1).getDbId())) { - for (int b = 0; b < mdmModuleViewDetailEntityList.size(); b++) { - if (mdmModuleViewDetailEntityList.get(b).getViewFiled().equals(mdmModuleDbFiledsEntityList.get(i1).getId())) { - mainMdmModuleDbFileds.add(mdmModuleDbFiledsEntityList.get(i1)); - List mdmModuleDbFiledsRules = new ArrayList<>(); - //循环字段属性 - if (mdmModuleDbFiledsRuleEntityList != null && mdmModuleDbFiledsRuleEntityList.size() > 0) { - for (int i2 = 0; i2 < mdmModuleDbFiledsRuleEntityList.size(); i2++) { - if (mdmModuleDbFiledsEntityList.get(i1).getDbId().equals(mdmModuleDbFiledsRuleEntityList.get(i2).getDbId()) - && mdmModuleDbFiledsEntityList.get(i1).getId().equals(mdmModuleDbFiledsRuleEntityList.get(i2).getFiledId())) { - mdmModuleDbFiledsRules.add(mdmModuleDbFiledsRuleEntityList.get(i2)); - } - } - } - mdmModuleDbFiledsEntityList.get(i1).setMdmModuleDbFiledsRules(mdmModuleDbFiledsRules); - } - } - } - } - } - } else if ("2".equals(mdmModuleDbEntityList.get(i).getDbType())) { - //2、明细 - sublistMdmModuleDb.add(mdmModuleDbEntityList.get(i)); - //循环字段表 - if (mdmModuleDbFiledsEntityList != null && mdmModuleDbFiledsEntityList.size() > 0) { - List sublistMdmModuleDbFileds = new ArrayList<>(); - for (int i1 = 0; i1 < mdmModuleDbFiledsEntityList.size(); i1++) { - if (mdmModuleDbEntityList.get(i).getId().equals(mdmModuleDbFiledsEntityList.get(i1).getDbId())) { - for (int b = 0; b < mdmModuleViewDetailEntityList.size(); b++) { - if (mdmModuleViewDetailEntityList.get(b).getViewFiled().equals(mdmModuleDbFiledsEntityList.get(i1).getId())) { - sublistMdmModuleDbFileds.add(mdmModuleDbFiledsEntityList.get(i1)); - List mdmModuleDbFiledsRules = new ArrayList<>(); - //循环字段属性 - if (mdmModuleDbFiledsRuleEntityList != null && mdmModuleDbFiledsRuleEntityList.size() > 0) { - for (int i2 = 0; i2 < mdmModuleDbFiledsRuleEntityList.size(); i2++) { - if (mdmModuleDbFiledsEntityList.get(i1).getDbId().equals(mdmModuleDbFiledsRuleEntityList.get(i2).getDbId()) - && mdmModuleDbFiledsEntityList.get(i1).getId().equals(mdmModuleDbFiledsRuleEntityList.get(i2).getFiledId())) { - mdmModuleDbFiledsRules.add(mdmModuleDbFiledsRuleEntityList.get(i2)); - } - } - } - mdmModuleDbFiledsEntityList.get(i1).setMdmModuleDbFiledsRules(mdmModuleDbFiledsRules); - } - } - - } - } - mdmModuleDbEntityList.get(i).setSublistMdmModuleDbFileds(sublistMdmModuleDbFileds); - } - } - } - mainMdmModuleDb.setSublistMdmModuleDbFileds(mainMdmModuleDbFileds); - mdmViewVo.setMainMdmModuleDb(mainMdmModuleDb); - //主数据子表 - List mdmModuleDb = new ArrayList<>(); - if (sublistMdmModuleDb != null && sublistMdmModuleDb.size() > 0) { - for (int i = 0; i < sublistMdmModuleDb.size(); i++) { - if (sublistMdmModuleDb.get(i).getSublistMdmModuleDbFileds() != null && sublistMdmModuleDb.get(i).getSublistMdmModuleDbFileds().size() > 0) { - mdmModuleDb.add(sublistMdmModuleDb.get(i)); - } - } - } - //if ("5".equals(showType)) { - // MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); - // mdmModuleDbEntity.setDbName(mainMdmModuleDb.getDbName() + "_distribute"); - // mdmModuleDbEntity.setRemark(mainMdmModuleDb.getRemark() + "分发表"); - // mdmModuleDbEntity.setDbType("2"); - // List mdmModuleDbFiledsEntityList1 = getDistributeRole(); - // mdmModuleDbEntity.setSublistMdmModuleDbFileds(mdmModuleDbFiledsEntityList1); - // mdmModuleDb.add(mdmModuleDbEntity); - //} - mdmViewVo.setSublistMdmModuleDb(mdmModuleDb); - - } else { - mdmViewVo.setMainMdmModuleDb(mainMdmModuleDb); - mdmViewVo.setSublistMdmModuleDb(sublistMdmModuleDb); - } - } - // - //private List getDistributeRole() { - // List mdmModuleDbFiledsEntityList = new ArrayList<>(); - // //app - // MdmModuleDbFiledsEntity appFiled = new MdmModuleDbFiledsEntity(); - // appFiled.setChName("应用"); - // appFiled.setEnName("app_id"); - // appFiled.setFiledLength("50"); - // appFiled.setFiledType("3"); - // List appRule = new ArrayList<>(); - // MdmModuleDbFiledsRuleEntity appRuleTitie = new MdmModuleDbFiledsRuleEntity(); - // appRuleTitie.setFormName("optionRuleForm"); - // appRuleTitie.setRuleCode("title"); - // appRuleTitie.setRuleName("显示名"); - // appRuleTitie.setRuleType("2"); - // appRuleTitie.setRuleValue("应用"); - // MdmModuleDbFiledsRuleEntity appRulerow = new MdmModuleDbFiledsRuleEntity(); - // appRulerow.setFormName("optionRuleForm"); - // appRulerow.setRuleCode("row"); - // appRulerow.setRuleName("宽度"); - // appRulerow.setRuleType("2"); - // appRulerow.setRuleValue("6"); - // MdmModuleDbFiledsRuleEntity appRuletype = new MdmModuleDbFiledsRuleEntity(); - // appRuletype.setFormName("optionRuleForm"); - // appRuletype.setRuleCode("type"); - // appRuletype.setRuleName("数据类型"); - // appRuletype.setRuleType("2"); - // appRuletype.setRuleValue("select"); - // MdmModuleDbFiledsRuleEntity appRulerequired = new MdmModuleDbFiledsRuleEntity(); - // appRulerequired.setFormName("optionRuleForm"); - // appRulerequired.setRuleCode("required"); - // appRulerequired.setRuleName("必填"); - // appRulerequired.setRuleType("2"); - // MdmModuleDbFiledsRuleEntity appRuleservice = new MdmModuleDbFiledsRuleEntity(); - // appRuleservice.setFormName("typeOptionRuleForm"); - // appRuleservice.setRuleCode("service"); - // appRuleservice.setRuleName("服务名称"); - // appRuleservice.setRuleType("2"); - // appRuleservice.setRuleValue("sys_application"); - // MdmModuleDbFiledsRuleEntity appRulelabel = new MdmModuleDbFiledsRuleEntity(); - // appRulelabel.setFormName("typeOptionRuleForm"); - // appRulelabel.setRuleCode("label"); - // appRulelabel.setRuleName("label"); - // appRulelabel.setRuleType("2"); - // appRulelabel.setRuleValue("name"); - // MdmModuleDbFiledsRuleEntity appRulevalue = new MdmModuleDbFiledsRuleEntity(); - // appRulevalue.setFormName("typeOptionRuleForm"); - // appRulevalue.setRuleCode("value"); - // appRulevalue.setRuleName("value"); - // appRulevalue.setRuleType("2"); - // appRulevalue.setRuleValue("id"); - // appRule.add(appRulevalue); - // appRule.add(appRulelabel); - // appRule.add(appRuleservice); - // appRule.add(appRulerequired); - // appRule.add(appRuletype); - // appRule.add(appRulerow); - // appRule.add(appRuleTitie); - // appFiled.setMdmModuleDbFiledsRules(appRule); - // mdmModuleDbFiledsEntityList.add(appFiled); - // - // - // //status - // MdmModuleDbFiledsEntity statusFiled = new MdmModuleDbFiledsEntity(); - // statusFiled.setChName("状态"); - // statusFiled.setEnName("status"); - // statusFiled.setFiledLength("50"); - // statusFiled.setFiledType("3"); - // List statusRule = new ArrayList<>(); - // MdmModuleDbFiledsRuleEntity statusRuleTitie = new MdmModuleDbFiledsRuleEntity(); - // statusRuleTitie.setFormName("optionRuleForm"); - // statusRuleTitie.setRuleCode("title"); - // statusRuleTitie.setRuleName("显示名"); - // statusRuleTitie.setRuleType("2"); - // statusRuleTitie.setRuleValue("状态"); - // MdmModuleDbFiledsRuleEntity statusRulerow = new MdmModuleDbFiledsRuleEntity(); - // statusRulerow.setFormName("optionRuleForm"); - // statusRulerow.setRuleCode("row"); - // statusRulerow.setRuleName("宽度"); - // statusRulerow.setRuleType("2"); - // statusRulerow.setRuleValue("6"); - // MdmModuleDbFiledsRuleEntity statusRuletype = new MdmModuleDbFiledsRuleEntity(); - // statusRuletype.setFormName("optionRuleForm"); - // statusRuletype.setRuleCode("type"); - // statusRuletype.setRuleName("数据类型"); - // statusRuletype.setRuleType("2"); - // statusRuletype.setRuleValue("input"); - // MdmModuleDbFiledsRuleEntity statusRulerequired = new MdmModuleDbFiledsRuleEntity(); - // statusRulerequired.setFormName("optionRuleForm"); - // statusRulerequired.setRuleCode("required"); - // statusRulerequired.setRuleName("必填"); - // statusRulerequired.setRuleType("2"); - // statusRule.add(statusRulerequired); - // statusRule.add(statusRuletype); - // statusRule.add(statusRulerow); - // statusRule.add(statusRuleTitie); - // statusFiled.setMdmModuleDbFiledsRules(statusRule); - // mdmModuleDbFiledsEntityList.add(statusFiled); - // - // - // //msg - // MdmModuleDbFiledsEntity msgFiled = new MdmModuleDbFiledsEntity(); - // msgFiled.setChName("描述"); - // msgFiled.setEnName("msg"); - // msgFiled.setFiledLength("200"); - // msgFiled.setFiledType("3"); - // List msgRule = new ArrayList<>(); - // MdmModuleDbFiledsRuleEntity msgRuleTitie = new MdmModuleDbFiledsRuleEntity(); - // msgRuleTitie.setFormName("optionRuleForm"); - // msgRuleTitie.setRuleCode("title"); - // msgRuleTitie.setRuleName("显示名"); - // msgRuleTitie.setRuleType("2"); - // msgRuleTitie.setRuleValue("描述"); - // MdmModuleDbFiledsRuleEntity msgRulerow = new MdmModuleDbFiledsRuleEntity(); - // msgRulerow.setFormName("optionRuleForm"); - // msgRulerow.setRuleCode("row"); - // msgRulerow.setRuleName("宽度"); - // msgRulerow.setRuleType("2"); - // msgRulerow.setRuleValue("6"); - // MdmModuleDbFiledsRuleEntity msgRuletype = new MdmModuleDbFiledsRuleEntity(); - // msgRuletype.setFormName("optionRuleForm"); - // msgRuletype.setRuleCode("type"); - // msgRuletype.setRuleName("数据类型"); - // msgRuletype.setRuleType("2"); - // msgRuletype.setRuleValue("input"); - // MdmModuleDbFiledsRuleEntity msgRulerequired = new MdmModuleDbFiledsRuleEntity(); - // msgRulerequired.setFormName("optionRuleForm"); - // msgRulerequired.setRuleCode("required"); - // msgRulerequired.setRuleName("必填"); - // msgRulerequired.setRuleType("2"); - // msgRule.add(msgRulerequired); - // msgRule.add(msgRuletype); - // msgRule.add(msgRulerow); - // msgRule.add(msgRuleTitie); - // msgFiled.setMdmModuleDbFiledsRules(msgRule); - // mdmModuleDbFiledsEntityList.add(msgFiled); - // return mdmModuleDbFiledsEntityList; - //} - // - ///** - // * @param object - // * @return com.hzya.frame.web.entity.JsonResultEntity - // * @Author lvleigang - // * @Description 查询数据(list 或者 分页) - // * @Date 1:33 下午 2023/7/12 - // **/ - //@Override - //public JsonResultEntity queryMdmOptionData(JSONObject object) { - // ModuleDto entity = getData("jsonStr", object, ModuleDto.class); - // //校验是否有servecr传参 - // if (!checkStr(entity.getService())) { - // return BaseResult.getFailureMessageEntity("请先传递服务名"); - // } - // if (!checkStr(entity.getValue())) { - // return BaseResult.getFailureMessageEntity("请先传递存储字段"); - // } - // if (!checkStr(entity.getLabel())) { - // return BaseResult.getFailureMessageEntity("请先传递显示字段"); - // } - // //查询数据源主表 - // MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); - // mdmModuleDbEntity.setId(entity.getId()); - // mdmModuleDbEntity.setSts("Y"); - // List mdmModuleDbEntityList = mdmModuleDbDao.queryBase(mdmModuleDbEntity); - // if (mdmModuleDbEntityList == null || mdmModuleDbEntityList.size() == 0) { - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // entity.setTableName(mdmModuleDbEntityList.get(0).getDbName()); - // if (entity.getPageNum() != null && entity.getPageSize() != null) { - // PageHelper.startPage(entity.getPageNum(), entity.getPageSize()); - // List> mapList = mdmModuleDao.queryTemplateData(entity); - // PageInfo pageInfo = new PageInfo(mapList); - // return BaseResult.getSuccessMessageEntity("查询数据成功", pageInfo); - // } else { - // List> mapList = mdmModuleDao.queryTemplateData(entity); - // return BaseResult.getSuccessMessageEntity("查询数据成功", mapList); + // return BaseResult.getFailureMessageEntity(res); // } //} // - /** - * @param object - * @return com.hzya.frame.web.entity.JsonResultEntity - * @Author lvleigang - * @Description 主数据详情数据 区分类型 新增、修改、查看 - * @Date 9:40 上午 2023/10/18 - **/ - @Override - public JsonResultEntity queryMdmShowDetailsData(JSONObject object) { - MdmDto entity = getData("jsonStr", object, MdmDto.class); - if (entity == null) { - return BaseResult.getFailureMessageEntity("参数不允许为空"); - } - if (entity.getMdmCode() == null || "".equals(entity.getMdmCode())) { - return BaseResult.getFailureMessageEntity("系统错误"); - } - if (entity.getId() == null || "".equals(entity.getId())) { - return BaseResult.getFailureMessageEntity("系统错误"); - } - //查询模版 - - MdmModuleEntity mdmModuleEntity = mdmServiceCache.getMdmModuleEntity(entity.getMdmCode()); - if (mdmModuleEntity == null ) { - return BaseResult.getFailureMessageEntity("系统错误"); - } - //查询数据源主表 - MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); - mdmModuleDbEntity.setMdmId(mdmModuleEntity.getId()); - mdmModuleDbEntity.setSts("Y"); - List mdmModuleDbEntityList = mdmServiceCache.queryMdmModuleDb(mdmModuleDbEntity); - if (mdmModuleDbEntityList == null || mdmModuleDbEntityList.size() == 0) { - return BaseResult.getFailureMessageEntity("系统错误"); - } - String tablename = null; - JSONObject jsonObject = new JSONObject(); - for (int i = 0; i < mdmModuleDbEntityList.size(); i++) { - //查询数据 - Map queryData = new HashMap<>(); - queryData.put("tableName", mdmModuleDbEntityList.get(i).getDbName());//表名 - if ("1".equals(mdmModuleDbEntityList.get(i).getDbType())) { - queryData.put("detailFlag", false);//是否明细 - queryData.put("id", entity.getId());//字段 - HashMap datas = mdmModuleDbDao.getServiceDataById(queryData); - jsonObject.put(mdmModuleDbEntityList.get(i).getDbName(), datas); - tablename = mdmModuleDbEntityList.get(i).getDbName() + "_distribute"; - } else { - queryData.put("detailFlag", true);//是否明细 - queryData.put("id", entity.getId());//字段 - List> datas = mdmModuleDbDao.getServiceByFormmainId(queryData); - jsonObject.put(mdmModuleDbEntityList.get(i).getDbName(), datas); - } - } - if (tablename != null && !"".equals(tablename)) { - Map queryData = new HashMap<>(); - queryData.put("tableName", tablename);//表名 - queryData.put("id", entity.getId());//字段 - List> datas = mdmModuleDbDao.getServiceByDistributeId(queryData); - jsonObject.put(tablename, datas); - } - - - return BaseResult.getSuccessMessageEntity("获取数据成功", jsonObject); - } - /** - * @param object - * @return com.hzya.frame.web.entity.JsonResultEntity - * @Author lvleigang - * @Description 主数据详情数据修改 - * @Date 9:40 上午 2023/10/18 - **/ - @Override - public JsonResultEntity updateMdmShowDetailsData(JSONObject object) { - JSONObject jsonObject = getstrObj("jsonStr", object); - //校验是否有servecr传参 - if (!checkData(jsonObject, "mdmCode")) { - return BaseResult.getFailureMessageEntity("请先传递服务名"); - } - if (!checkData(jsonObject, "data")) { - return BaseResult.getFailureMessageEntity("请先传递要修改的数据"); - } - JSONObject saveData = jsonObject.getJSONObject("data"); - //校验唯一 - MdmModuleEntity mdmModuleEntity = new MdmModuleEntity(); - mdmModuleEntity.setMdmCode(jsonObject.getLong("mdmCode")); - mdmModuleEntity.setSts("Y"); - List mdmModuleEntities = mdmModuleDao.queryBase(mdmModuleEntity); - if (mdmModuleEntities == null || mdmModuleEntities.size() != 1) { - return BaseResult.getFailureMessageEntity("系统错误"); - } - mdmModuleEntity = mdmModuleEntities.get(0); - MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); - mdmModuleDbEntity.setMdmId(mdmModuleEntity.getId()); - mdmModuleDbEntity.setSts("Y"); - List mdmModuleDbEntityList = mdmModuleDbDao.queryBase(mdmModuleDbEntity); - if (mdmModuleDbEntityList == null || mdmModuleDbEntityList.size() == 0) { - return BaseResult.getFailureMessageEntity("系统错误"); - } - String res = checkDataOnly(jsonObject.getInteger("mdmCode"), saveData, true, mdmModuleEntity, mdmModuleDbEntityList); - - if (res == null || "".equals(res)) { - return BaseResult.getSuccessMessageEntity("修改数据成功"); - } else { - return BaseResult.getFailureMessageEntity(res); - } - } - - - /** - * @param object - * @return com.hzya.frame.web.entity.JsonResultEntity - * @Author lvleigang - * @Description 主数据详情数据新增 - * @Date 9:40 上午 2023/10/18 - **/ - @Override - public JsonResultEntity saveMdmShowDetailsData(JSONObject object) { - JSONObject jsonObject = getstrObj("jsonStr", object); - //校验是否有servecr传参 - if (!checkData(jsonObject, "mdmCode")) { - return BaseResult.getFailureMessageEntity("请先传递服务名"); - } - if (!checkData(jsonObject, "data")) { - return BaseResult.getFailureMessageEntity("请先传递要修改的数据"); - } - JSONObject saveData = jsonObject.getJSONObject("data"); - //校验唯一 - MdmModuleEntity mdmModuleEntity = new MdmModuleEntity(); - mdmModuleEntity.setMdmCode(jsonObject.getLong("mdmCode")); - mdmModuleEntity.setSts("Y"); - List mdmModuleEntities = mdmModuleDao.queryBase(mdmModuleEntity); - if (mdmModuleEntities == null || mdmModuleEntities.size() != 1) { - return BaseResult.getFailureMessageEntity("系统错误"); - } - mdmModuleEntity = mdmModuleEntities.get(0); - MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); - mdmModuleDbEntity.setMdmId(mdmModuleEntity.getId()); - mdmModuleDbEntity.setSts("Y"); - List mdmModuleDbEntityList = mdmModuleDbDao.queryBase(mdmModuleDbEntity); - if (mdmModuleDbEntityList == null || mdmModuleDbEntityList.size() == 0) { - return BaseResult.getFailureMessageEntity("系统错误"); - } - String res = checkDataOnly(jsonObject.getInteger("mdmCode"), saveData, false, mdmModuleEntity, mdmModuleDbEntityList); - - if (res == null || "".equals(res)) { - return BaseResult.getSuccessMessageEntity("保存数据成功"); - } else { - return BaseResult.getFailureMessageEntity(res); - } - } - // - // - /** - * @param object - * @return com.hzya.frame.web.entity.JsonResultEntity - * @Author lvleigang - * @Description 主数据详情数据修改 - * @Date 9:40 上午 2023/10/18 - **/ - @Override - public JsonResultEntity deleteMdmShowDetailsData(JSONObject object) { - JSONObject jsonObject = getstrObj("jsonStr", object); - //校验是否有servecr传参 - if (!checkData(jsonObject, "mdmCode")) { - return BaseResult.getFailureMessageEntity("请先传递服务名"); - } - if (!checkData(jsonObject, "id")) { - return BaseResult.getFailureMessageEntity("请先传递要删除的数据"); - } - //校验唯一 - MdmModuleEntity mdmModuleEntity = mdmServiceCache.getMdmModuleEntity(jsonObject.getLong("mdmCode")); - if (mdmModuleEntity == null ) { - return BaseResult.getFailureMessageEntity("系统错误"); - } - MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); - mdmModuleDbEntity.setMdmId(mdmModuleEntity.getId()); - mdmModuleDbEntity.setSts("Y"); - List mdmModuleDbEntityList = mdmServiceCache.queryMdmModuleDb(mdmModuleDbEntity); - if (mdmModuleDbEntityList == null || mdmModuleDbEntityList.size() == 0) { - return BaseResult.getFailureMessageEntity("系统错误"); - } - for (int i = 0; i < mdmModuleDbEntityList.size(); i++) { - if ("1".equals(mdmModuleDbEntityList.get(i).getDbType())) { - - //查询视图,如果树形,删除下级及子集 - //查询展示类型 - MdmModuleViewEntity mdmModuleViewEntity = new MdmModuleViewEntity(); - mdmModuleViewEntity.setMdmId(mdmModuleEntity.getId()); - mdmModuleViewEntity.setSts("Y"); - List moduleViewEntityList = mdmServiceCache.queryMdmModuleView(mdmModuleViewEntity); - if (moduleViewEntityList == null || moduleViewEntityList.size() != 1) { - return BaseResult.getFailureMessageEntity("系统错误"); - } - mdmModuleViewEntity = moduleViewEntityList.get(0); - - - //删除自己 - FormmainDeleteDto formmainDeleteDto = new FormmainDeleteDto(); - formmainDeleteDto.setId(jsonObject.getString("id")); - formmainDeleteDto.setLoginId(StpUtil.getLoginIdAsString()); - formmainDeleteDto.setTableName(mdmModuleDbEntityList.get(i).getDbName()); - if (mdmModuleViewEntity != null && mdmModuleViewEntity.getViewName() != null && "1".equals(mdmModuleViewEntity.getViewName()) && - mdmModuleViewEntity.getUpIdFiled() != null && !"".equals(mdmModuleViewEntity.getUpIdFiled())) { - formmainDeleteDto.setUpIdFiled(mdmModuleViewEntity.getUpIdFiled()); - - Map queryData = new HashMap<>(); - queryData.put("tableName", mdmModuleDbEntityList.get(i).getDbName());//表名 - queryData.put("detailFlag", false);//是否明细 - queryData.put("id", jsonObject.getString("id"));//字段 - HashMap datas = mdmModuleDbDao.getServiceDataById(queryData); - String upValue = null; - if (datas != null && datas.get(mdmModuleViewEntity.getUpIdFiled()) != null) { - upValue = datas.get(mdmModuleViewEntity.getUpIdFiled()).toString(); - } - if (upValue != null) { - formmainDeleteDto.setUpIdFiledValue(upValue + "," + jsonObject.getString("id")); - } else { - formmainDeleteDto.setUpIdFiledValue(jsonObject.getString("id")); - } - mdmModuleDao.deleteChilder(formmainDeleteDto); - } - mdmModuleDao.deleteTemplateById(formmainDeleteDto); - - } else { - //删除明细 - FormmainDeleteDto formmainDeleteDto = new FormmainDeleteDto(); - formmainDeleteDto.setFormmain_id(jsonObject.getString("id")); - formmainDeleteDto.setLoginId(StpUtil.getLoginIdAsString()); - formmainDeleteDto.setTableName(mdmModuleDbEntityList.get(i).getDbName()); - mdmModuleDao.deleteTemplateById(formmainDeleteDto); - } - } - return BaseResult.getSuccessMessageEntity("删除数据成功"); - } - // // ///** // * @param object // * @return com.hzya.frame.web.entity.JsonResultEntity // * @Author lvleigang - // * @Description 处理分发数据 + // * @Description 主数据详情数据新增 // * @Date 9:40 上午 2023/10/18 // **/ //@Override - //public JsonResultEntity doMdmDistribute(JSONObject object) { + //public JsonResultEntity saveMdmShowDetailsData(JSONObject object) { + // JSONObject jsonObject = getstrObj("jsonStr", object); + // //校验是否有servecr传参 + // if (!checkData(jsonObject, "mdmCode")) { + // return BaseResult.getFailureMessageEntity("请先传递服务名"); + // } + // if (!checkData(jsonObject, "data")) { + // return BaseResult.getFailureMessageEntity("请先传递要修改的数据"); + // } + // JSONObject saveData = jsonObject.getJSONObject("data"); + // //校验唯一 + // MdmModuleEntity mdmModuleEntity = new MdmModuleEntity(); + // mdmModuleEntity.setMdmCode(jsonObject.getLong("mdmCode")); + // mdmModuleEntity.setSts("Y"); + // List mdmModuleEntities = mdmModuleDao.queryBase(mdmModuleEntity); + // if (mdmModuleEntities == null || mdmModuleEntities.size() != 1) { + // return BaseResult.getFailureMessageEntity("系统错误"); + // } + // mdmModuleEntity = mdmModuleEntities.get(0); + // MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); + // mdmModuleDbEntity.setMdmId(mdmModuleEntity.getId()); + // mdmModuleDbEntity.setSts("Y"); + // List mdmModuleDbEntityList = mdmModuleDbDao.queryBase(mdmModuleDbEntity); + // if (mdmModuleDbEntityList == null || mdmModuleDbEntityList.size() == 0) { + // return BaseResult.getFailureMessageEntity("系统错误"); + // } + // String res = checkDataOnly(jsonObject.getInteger("mdmCode"), saveData, false, mdmModuleEntity, mdmModuleDbEntityList); + // + // if (res == null || "".equals(res)) { + // return BaseResult.getSuccessMessageEntity("保存数据成功"); + // } else { + // return BaseResult.getFailureMessageEntity(res); + // } + //} + //// + //// + ///** + // * @param object + // * @return com.hzya.frame.web.entity.JsonResultEntity + // * @Author lvleigang + // * @Description 主数据详情数据修改 + // * @Date 9:40 上午 2023/10/18 + // **/ + //@Override + //public JsonResultEntity deleteMdmShowDetailsData(JSONObject object) { // JSONObject jsonObject = getstrObj("jsonStr", object); // //校验是否有servecr传参 // if (!checkData(jsonObject, "mdmCode")) { @@ -3737,488 +3653,572 @@ public class MdmServiceImpl implements IMdmService { // if (!checkData(jsonObject, "id")) { // return BaseResult.getFailureMessageEntity("请先传递要删除的数据"); // } - // if (!checkData(jsonObject, "appID")) { - // return BaseResult.getFailureMessageEntity("请先传递要删除的数据"); + // //校验唯一 + // MdmModuleEntity mdmModuleEntity = mdmServiceCache.getMdmModuleEntity(jsonObject.getLong("mdmCode")); + // if (mdmModuleEntity == null ) { + // return BaseResult.getFailureMessageEntity("系统错误"); // } - // if (!checkData(jsonObject, "dataType")) { - // return BaseResult.getFailureMessageEntity("请先传递要删除的数据"); + // MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); + // mdmModuleDbEntity.setMdmId(mdmModuleEntity.getId()); + // mdmModuleDbEntity.setSts("Y"); + // List mdmModuleDbEntityList = mdmServiceCache.queryMdmModuleDb(mdmModuleDbEntity); + // if (mdmModuleDbEntityList == null || mdmModuleDbEntityList.size() == 0) { + // return BaseResult.getFailureMessageEntity("系统错误"); // } - // if("2".equals(jsonObject.getString("dataType"))){ - // boolean flag = false; - // //1、根据服务名查询分发数据 - // MdmModuleEntity mdmModuleEntity = new MdmModuleEntity(); - // mdmModuleEntity.setMdmCode(jsonObject.getInteger("mdmCode")); - // mdmModuleEntity.setSts("Y"); - // List mdmModuleEntities = mdmModuleDao.queryBase(mdmModuleEntity); - // if (mdmModuleEntities != null && mdmModuleEntities.size() == 1) { - // MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); - // mdmModuleDbEntity.setMdmId(mdmModuleEntities.get(0).getId()); - // mdmModuleDbEntity.setDbType("1"); - // mdmModuleDbEntity.setSts("Y"); - // List mdmModuleDbEntities = mdmModuleDbDao.queryBase(mdmModuleDbEntity); - // if (mdmModuleDbEntities != null && mdmModuleDbEntities.size() == 1) { - // mdmModuleDbEntity = mdmModuleDbEntities.get(0); + // for (int i = 0; i < mdmModuleDbEntityList.size(); i++) { + // if ("1".equals(mdmModuleDbEntityList.get(i).getDbType())) { + // + // //查询视图,如果树形,删除下级及子集 + // //查询展示类型 + // MdmModuleViewEntity mdmModuleViewEntity = new MdmModuleViewEntity(); + // mdmModuleViewEntity.setMdmId(mdmModuleEntity.getId()); + // mdmModuleViewEntity.setSts("Y"); + // List moduleViewEntityList = mdmServiceCache.queryMdmModuleView(mdmModuleViewEntity); + // if (moduleViewEntityList == null || moduleViewEntityList.size() != 1) { + // return BaseResult.getFailureMessageEntity("系统错误"); // } - // MdmModuleDistributeEntity mdmModuleDistributeEntity = new MdmModuleDistributeEntity(); - // mdmModuleDistributeEntity.setAppId(jsonObject.getString("appID")); - // mdmModuleDistributeEntity.setMdmId(mdmModuleEntities.get(0).getId()); - // List mdmModuleDistributeEntities = mdmModuleDistributeDao.queryBase(mdmModuleDistributeEntity); - // if (mdmModuleDistributeEntities != null && mdmModuleDistributeEntities.size() == 1) { - // if (mdmModuleDistributeEntities.get(0).getAddType() != null && "1".equals(mdmModuleDistributeEntities.get(0).getAddType())) { - // //2、查找插件 - // if (mdmModuleDistributeEntities.get(0).getAddPlug() != null && !"".equals(mdmModuleDistributeEntities.get(0).getAddPlug())) { - // //2、查找插件 - // SysApplicationPluginEntity sysApplicationPluginEntity = sysApplicationPluginDao.get(mdmModuleDistributeEntities.get(0).getAddPlug()); - // if(sysApplicationPluginEntity.getPluginCode() != null && !"".equals(sysApplicationPluginEntity.getPluginCode())){ - // //3、调用插件 - // PluginBaseEntity pluginBaseEntity = PluginUtils.getPluginsById(sysApplicationPluginEntity.getPluginCode()); - // try { - // JsonResultEntity s = pluginBaseEntity.executeBusiness(jsonObject); - // flag = true; - // } catch (Exception e) { - // logger.error("插件处理失败"+e.getMessage()); + // mdmModuleViewEntity = moduleViewEntityList.get(0); + // + // + // //删除自己 + // FormmainDeleteDto formmainDeleteDto = new FormmainDeleteDto(); + // formmainDeleteDto.setId(jsonObject.getString("id")); + // formmainDeleteDto.setLoginId(StpUtil.getLoginIdAsString()); + // formmainDeleteDto.setTableName(mdmModuleDbEntityList.get(i).getDbName()); + // if (mdmModuleViewEntity != null && mdmModuleViewEntity.getViewName() != null && "1".equals(mdmModuleViewEntity.getViewName()) && + // mdmModuleViewEntity.getUpIdFiled() != null && !"".equals(mdmModuleViewEntity.getUpIdFiled())) { + // formmainDeleteDto.setUpIdFiled(mdmModuleViewEntity.getUpIdFiled()); + // + // Map queryData = new HashMap<>(); + // queryData.put("tableName", mdmModuleDbEntityList.get(i).getDbName());//表名 + // queryData.put("detailFlag", false);//是否明细 + // queryData.put("id", jsonObject.getString("id"));//字段 + // HashMap datas = mdmModuleDbDao.getServiceDataById(queryData); + // String upValue = null; + // if (datas != null && datas.get(mdmModuleViewEntity.getUpIdFiled()) != null) { + // upValue = datas.get(mdmModuleViewEntity.getUpIdFiled()).toString(); + // } + // if (upValue != null) { + // formmainDeleteDto.setUpIdFiledValue(upValue + "," + jsonObject.getString("id")); + // } else { + // formmainDeleteDto.setUpIdFiledValue(jsonObject.getString("id")); + // } + // mdmModuleDao.deleteChilder(formmainDeleteDto); + // } + // mdmModuleDao.deleteTemplateById(formmainDeleteDto); + // + // } else { + // //删除明细 + // FormmainDeleteDto formmainDeleteDto = new FormmainDeleteDto(); + // formmainDeleteDto.setFormmain_id(jsonObject.getString("id")); + // formmainDeleteDto.setLoginId(StpUtil.getLoginIdAsString()); + // formmainDeleteDto.setTableName(mdmModuleDbEntityList.get(i).getDbName()); + // mdmModuleDao.deleteTemplateById(formmainDeleteDto); + // } + // } + // return BaseResult.getSuccessMessageEntity("删除数据成功"); + //} + //// + //// + /////** + //// * @param object + //// * @return com.hzya.frame.web.entity.JsonResultEntity + //// * @Author lvleigang + //// * @Description 处理分发数据 + //// * @Date 9:40 上午 2023/10/18 + //// **/ + ////@Override + ////public JsonResultEntity doMdmDistribute(JSONObject object) { + //// JSONObject jsonObject = getstrObj("jsonStr", object); + //// //校验是否有servecr传参 + //// if (!checkData(jsonObject, "mdmCode")) { + //// return BaseResult.getFailureMessageEntity("请先传递服务名"); + //// } + //// if (!checkData(jsonObject, "id")) { + //// return BaseResult.getFailureMessageEntity("请先传递要删除的数据"); + //// } + //// if (!checkData(jsonObject, "appID")) { + //// return BaseResult.getFailureMessageEntity("请先传递要删除的数据"); + //// } + //// if (!checkData(jsonObject, "dataType")) { + //// return BaseResult.getFailureMessageEntity("请先传递要删除的数据"); + //// } + //// if("2".equals(jsonObject.getString("dataType"))){ + //// boolean flag = false; + //// //1、根据服务名查询分发数据 + //// MdmModuleEntity mdmModuleEntity = new MdmModuleEntity(); + //// mdmModuleEntity.setMdmCode(jsonObject.getInteger("mdmCode")); + //// mdmModuleEntity.setSts("Y"); + //// List mdmModuleEntities = mdmModuleDao.queryBase(mdmModuleEntity); + //// if (mdmModuleEntities != null && mdmModuleEntities.size() == 1) { + //// MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); + //// mdmModuleDbEntity.setMdmId(mdmModuleEntities.get(0).getId()); + //// mdmModuleDbEntity.setDbType("1"); + //// mdmModuleDbEntity.setSts("Y"); + //// List mdmModuleDbEntities = mdmModuleDbDao.queryBase(mdmModuleDbEntity); + //// if (mdmModuleDbEntities != null && mdmModuleDbEntities.size() == 1) { + //// mdmModuleDbEntity = mdmModuleDbEntities.get(0); + //// } + //// MdmModuleDistributeEntity mdmModuleDistributeEntity = new MdmModuleDistributeEntity(); + //// mdmModuleDistributeEntity.setAppId(jsonObject.getString("appID")); + //// mdmModuleDistributeEntity.setMdmId(mdmModuleEntities.get(0).getId()); + //// List mdmModuleDistributeEntities = mdmModuleDistributeDao.queryBase(mdmModuleDistributeEntity); + //// if (mdmModuleDistributeEntities != null && mdmModuleDistributeEntities.size() == 1) { + //// if (mdmModuleDistributeEntities.get(0).getAddType() != null && "1".equals(mdmModuleDistributeEntities.get(0).getAddType())) { + //// //2、查找插件 + //// if (mdmModuleDistributeEntities.get(0).getAddPlug() != null && !"".equals(mdmModuleDistributeEntities.get(0).getAddPlug())) { + //// //2、查找插件 + //// SysApplicationPluginEntity sysApplicationPluginEntity = sysApplicationPluginDao.get(mdmModuleDistributeEntities.get(0).getAddPlug()); + //// if(sysApplicationPluginEntity.getPluginCode() != null && !"".equals(sysApplicationPluginEntity.getPluginCode())){ + //// //3、调用插件 + //// PluginBaseEntity pluginBaseEntity = PluginUtils.getPluginsById(sysApplicationPluginEntity.getPluginCode()); + //// try { + //// JsonResultEntity s = pluginBaseEntity.executeBusiness(jsonObject); + //// flag = true; + //// } catch (Exception e) { + //// logger.error("插件处理失败"+e.getMessage()); + //// } + //// } + //// } + //// } else { + //// //TODO 连线 + //// flag = true; + //// } + //// } + //// if(mdmModuleDbEntity.getDbName()!= null && !"".equals(mdmModuleDbEntity.getDbName())) { + //// MdmDistributeEntity mdmDistributeEntity = new MdmDistributeEntity(); + //// mdmDistributeEntity.setCreate(); + //// mdmDistributeEntity.setTableName(mdmModuleDbEntity.getDbName()+"_distribute"); + //// mdmDistributeEntity.setFormmainId(jsonObject.getString("id")); + //// mdmDistributeEntity.setAppId(jsonObject.getString("appID")); + //// mdmDistributeEntity.setStatus("1"); + //// mdmDistributeEntity.setMsg("发送成功"); + //// if (!flag) { + //// mdmDistributeEntity.setStatus("3"); + //// mdmDistributeEntity.setMsg("发送失败"); + //// } + //// mdmModuleDao.saveDistribute(mdmDistributeEntity); + //// return BaseResult.getSuccessMessageEntity("下发数据成功"); + //// + //// }else { + //// return BaseResult.getFailureMessageEntity("系统错误"); + //// } + //// }else { + //// return BaseResult.getFailureMessageEntity("系统错误"); + //// } + //// }else { + //// if (!checkData(jsonObject, "distributeID")) { + //// return BaseResult.getFailureMessageEntity("请先传递分发数据"); + //// } + //// boolean flag = false; + //// //1、根据服务名查询分发数据 + //// MdmModuleEntity mdmModuleEntity = new MdmModuleEntity(); + //// mdmModuleEntity.setMdmCode(jsonObject.getInteger("mdmCode")); + //// mdmModuleEntity.setSts("Y"); + //// List mdmModuleEntities = mdmModuleDao.queryBase(mdmModuleEntity); + //// if (mdmModuleEntities != null && mdmModuleEntities.size() == 1) { + //// MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); + //// mdmModuleDbEntity.setMdmId(mdmModuleEntities.get(0).getId()); + //// mdmModuleDbEntity.setDbType("1"); + //// mdmModuleDbEntity.setSts("Y"); + //// List mdmModuleDbEntities = mdmModuleDbDao.queryBase(mdmModuleDbEntity); + //// if (mdmModuleDbEntities != null && mdmModuleDbEntities.size() == 1) { + //// mdmModuleDbEntity = mdmModuleDbEntities.get(0); + //// } + //// MdmModuleDistributeEntity mdmModuleDistributeEntity = new MdmModuleDistributeEntity(); + //// mdmModuleDistributeEntity.setAppId(jsonObject.getString("appID")); + //// mdmModuleDistributeEntity.setMdmId(mdmModuleEntities.get(0).getId()); + //// List mdmModuleDistributeEntities = mdmModuleDistributeDao.queryBase(mdmModuleDistributeEntity); + //// if (mdmModuleDistributeEntities != null && mdmModuleDistributeEntities.size() == 1) { + //// if (mdmModuleDistributeEntities.get(0).getDeleteType() != null && "1".equals(mdmModuleDistributeEntities.get(0).getDeleteType())) { + //// //2、查找插件 + //// if (mdmModuleDistributeEntities.get(0).getDeletePlug() != null && !"".equals(mdmModuleDistributeEntities.get(0).getDeletePlug())) { + //// //2、查找插件 + //// SysApplicationPluginEntity sysApplicationPluginEntity = sysApplicationPluginDao.get(mdmModuleDistributeEntities.get(0).getDeletePlug()); + //// if(sysApplicationPluginEntity.getPluginCode() != null && !"".equals(sysApplicationPluginEntity.getPluginCode())){ + //// //3、调用插件 + //// PluginBaseEntity pluginBaseEntity = PluginUtils.getPluginsById(sysApplicationPluginEntity.getPluginCode()); + //// try { + //// JsonResultEntity s = pluginBaseEntity.executeBusiness(jsonObject); + //// flag = true; + //// } catch (Exception e) { + //// logger.error("插件处理失败"+e.getMessage()); + //// } + //// } + //// } + //// } else { + //// //TODO 连线 + //// flag = true; + //// } + //// } + //// if(mdmModuleDbEntity.getDbName()!= null && !"".equals(mdmModuleDbEntity.getDbName())) { + //// //删除数据 + //// MdmDistributeEntity mdmDistributeEntity = new MdmDistributeEntity(); + //// mdmDistributeEntity.setId(jsonObject.getString("distributeID")); + //// mdmDistributeEntity.setTableName(mdmModuleDbEntity.getDbName()+"_distribute"); + //// mdmDistributeEntity.setFormmainId(jsonObject.getString("id")); + //// mdmDistributeEntity.setAppId(jsonObject.getString("appID")); + //// mdmDistributeEntity.setStatus("1"); + //// mdmDistributeEntity.setMsg("删除成功"); + //// if (!flag) { + //// mdmDistributeEntity.setStatus("3"); + //// mdmDistributeEntity.setMsg("删除失败"); + //// } + //// mdmModuleDao.updateDistribute(mdmDistributeEntity); + //// return BaseResult.getSuccessMessageEntity("删除数据成功"); + //// + //// }else { + //// return BaseResult.getFailureMessageEntity("系统错误"); + //// } + //// }else { + //// return BaseResult.getFailureMessageEntity("系统错误"); + //// } + //// } + //// + ////} + //// + ///** + // * @param mdmCode + // * @param saveData + // * @param mdmModuleEntity + // * @param mdmModuleDbEntityList + // * @param flag 修改 新增 + // * @return java.lang.String + // * @Author lvleigang + // * @Description 校验数据 + // * @Date 11:20 上午 2023/11/6 + // **/ + //private String checkDataOnly(Integer mdmCode, JSONObject saveData, boolean flag, MdmModuleEntity mdmModuleEntity, List mdmModuleDbEntityList) { + // StringBuffer str = new StringBuffer(); + // + // //查询字段 + // //查询字段下的必填规则 + // MdmModuleDbFiledsEntity mdmModuleDbFiledsEntity = new MdmModuleDbFiledsEntity(); + // mdmModuleDbFiledsEntity.setMdmId(mdmModuleEntity.getId()); + // mdmModuleDbFiledsEntity.setSts("Y"); + // mdmModuleDbFiledsEntity.setRoletype("required"); + // mdmModuleDbFiledsEntity.setRoleValue("true"); + // List mdmModuleDbFiledsEntityList = mdmModuleDbFiledsDao.queryBase(mdmModuleDbFiledsEntity); + // + // if (mdmModuleDbFiledsEntityList != null && mdmModuleDbFiledsEntityList.size() > 0) { + // for (int i = 0; i < mdmModuleDbEntityList.size(); i++) { + // if ("1".equals(mdmModuleDbEntityList.get(i).getDbType())) { + // JSONObject jsonObject = saveData.getJSONObject(mdmModuleDbEntityList.get(i).getDbName()); + // for (int i1 = 0; i1 < mdmModuleDbFiledsEntityList.size(); i1++) { + // if (mdmModuleDbFiledsEntityList.get(i1).getDbId().equals(mdmModuleDbEntityList.get(i).getId())) { + // if (jsonObject.get(mdmModuleDbFiledsEntityList.get(i1).getEnName()) == null || "".equals(jsonObject.getString(mdmModuleDbFiledsEntityList.get(i1).getEnName()))) { + // if (str.toString() != null && !"".equals(str.toString())) { + // str.append(";"); + // } + // str.append(mdmModuleDbEntityList.get(i).getRemark() + "的" + mdmModuleDbFiledsEntityList.get(i1).getChName() + "不为空"); + // } + // } + // } + // } else { + // JSONArray jsonArray = saveData.getJSONArray(mdmModuleDbEntityList.get(i).getDbName()); + // if (jsonArray != null && jsonArray.size() > 0) { + // for (int i1 = 0; i1 < mdmModuleDbFiledsEntityList.size(); i1++) { + // if (mdmModuleDbFiledsEntityList.get(i1).getDbId().equals(mdmModuleDbEntityList.get(i).getId())) { + // for (int i2 = 0; i2 < jsonArray.size(); i2++) { + // JSONObject jsonObject = jsonArray.getJSONObject(i2); + // if (jsonObject.get(mdmModuleDbFiledsEntityList.get(i1).getEnName()) == null || "".equals(jsonObject.getString(mdmModuleDbFiledsEntityList.get(i1).getEnName()))) { + // if (str.toString() != null && !"".equals(str.toString())) { + // str.append(";"); + // } + // str.append(mdmModuleDbEntityList.get(i).getRemark() + "的" + mdmModuleDbFiledsEntityList.get(i1).getChName() + "不为空"); + // break; + // } + // } + // } + // } + // } + // } + // } + // } + // + // if (str == null || "".equals(str.toString())) { + // //校验数据 + // MdmModuleDbFiledsEntity onlyFiledsEntity = new MdmModuleDbFiledsEntity(); + // onlyFiledsEntity.setMdmId(mdmModuleEntity.getId()); + // onlyFiledsEntity.setSts("Y"); + // onlyFiledsEntity.setRoletype("fieldsSole"); + // onlyFiledsEntity.setRoleValue("true"); + // + // List onlyEntityList = mdmModuleDbFiledsDao.queryBase(onlyFiledsEntity); + // + // if (onlyEntityList != null && onlyEntityList.size() > 0) { + // for (int i = 0; i < mdmModuleDbEntityList.size(); i++) { + // if ("1".equals(mdmModuleDbEntityList.get(i).getDbType())) { + // JSONObject jsonObject = saveData.getJSONObject(mdmModuleDbEntityList.get(i).getDbName()); + // for (int i1 = 0; i1 < onlyEntityList.size(); i1++) { + // if (onlyEntityList.get(i1).getDbId().equals(mdmModuleDbEntityList.get(i).getId())) { + // //校验唯一 + // Map map = new HashMap<>(); + // map.put("tableName", mdmModuleDbEntityList.get(i).getDbName()); + // if (flag) { + // map.put("id", jsonObject.getString("id")); + // } + // map.put("filedName", onlyEntityList.get(i1).getEnName()); + // map.put("filedValue", jsonObject.getString(onlyEntityList.get(i1).getEnName())); + // Integer count = mdmModuleDao.checkData(map); + // if (count > 0) { + // if (str.toString() != null && !"".equals(str.toString())) { + // str.append(";"); + // } + // str.append(mdmModuleDbEntityList.get(i).getRemark() + "的" + mdmModuleDbFiledsEntityList.get(i1).getChName() + "已存在"); // } // } // } // } else { - // //TODO 连线 - // flag = true; - // } - // } - // if(mdmModuleDbEntity.getDbName()!= null && !"".equals(mdmModuleDbEntity.getDbName())) { - // MdmDistributeEntity mdmDistributeEntity = new MdmDistributeEntity(); - // mdmDistributeEntity.setCreate(); - // mdmDistributeEntity.setTableName(mdmModuleDbEntity.getDbName()+"_distribute"); - // mdmDistributeEntity.setFormmainId(jsonObject.getString("id")); - // mdmDistributeEntity.setAppId(jsonObject.getString("appID")); - // mdmDistributeEntity.setStatus("1"); - // mdmDistributeEntity.setMsg("发送成功"); - // if (!flag) { - // mdmDistributeEntity.setStatus("3"); - // mdmDistributeEntity.setMsg("发送失败"); - // } - // mdmModuleDao.saveDistribute(mdmDistributeEntity); - // return BaseResult.getSuccessMessageEntity("下发数据成功"); + // JSONArray jsonArray = saveData.getJSONArray(mdmModuleDbEntityList.get(i).getDbName()); + // if (jsonArray != null && jsonArray.size() > 0) { + // for (int i1 = 0; i1 < onlyEntityList.size(); i1++) { + // if (onlyEntityList.get(i1).getDbId().equals(mdmModuleDbEntityList.get(i).getId())) { + // for (int i2 = 0; i2 < jsonArray.size(); i2++) { + // JSONObject jsonObject = jsonArray.getJSONObject(i2); // - // }else { - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // }else { - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // }else { - // if (!checkData(jsonObject, "distributeID")) { - // return BaseResult.getFailureMessageEntity("请先传递分发数据"); - // } - // boolean flag = false; - // //1、根据服务名查询分发数据 - // MdmModuleEntity mdmModuleEntity = new MdmModuleEntity(); - // mdmModuleEntity.setMdmCode(jsonObject.getInteger("mdmCode")); - // mdmModuleEntity.setSts("Y"); - // List mdmModuleEntities = mdmModuleDao.queryBase(mdmModuleEntity); - // if (mdmModuleEntities != null && mdmModuleEntities.size() == 1) { - // MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); - // mdmModuleDbEntity.setMdmId(mdmModuleEntities.get(0).getId()); - // mdmModuleDbEntity.setDbType("1"); - // mdmModuleDbEntity.setSts("Y"); - // List mdmModuleDbEntities = mdmModuleDbDao.queryBase(mdmModuleDbEntity); - // if (mdmModuleDbEntities != null && mdmModuleDbEntities.size() == 1) { - // mdmModuleDbEntity = mdmModuleDbEntities.get(0); - // } - // MdmModuleDistributeEntity mdmModuleDistributeEntity = new MdmModuleDistributeEntity(); - // mdmModuleDistributeEntity.setAppId(jsonObject.getString("appID")); - // mdmModuleDistributeEntity.setMdmId(mdmModuleEntities.get(0).getId()); - // List mdmModuleDistributeEntities = mdmModuleDistributeDao.queryBase(mdmModuleDistributeEntity); - // if (mdmModuleDistributeEntities != null && mdmModuleDistributeEntities.size() == 1) { - // if (mdmModuleDistributeEntities.get(0).getDeleteType() != null && "1".equals(mdmModuleDistributeEntities.get(0).getDeleteType())) { - // //2、查找插件 - // if (mdmModuleDistributeEntities.get(0).getDeletePlug() != null && !"".equals(mdmModuleDistributeEntities.get(0).getDeletePlug())) { - // //2、查找插件 - // SysApplicationPluginEntity sysApplicationPluginEntity = sysApplicationPluginDao.get(mdmModuleDistributeEntities.get(0).getDeletePlug()); - // if(sysApplicationPluginEntity.getPluginCode() != null && !"".equals(sysApplicationPluginEntity.getPluginCode())){ - // //3、调用插件 - // PluginBaseEntity pluginBaseEntity = PluginUtils.getPluginsById(sysApplicationPluginEntity.getPluginCode()); - // try { - // JsonResultEntity s = pluginBaseEntity.executeBusiness(jsonObject); - // flag = true; - // } catch (Exception e) { - // logger.error("插件处理失败"+e.getMessage()); + // //校验唯一 + // Map map = new HashMap<>(); + // map.put("tableName", mdmModuleDbEntityList.get(i).getDbName()); + // if (flag) { + // map.put("id", jsonObject.getString("id")); + // } + // map.put("filedName", onlyEntityList.get(i1).getEnName()); + // map.put("filedValue", jsonObject.getString(onlyEntityList.get(i1).getEnName())); + // Integer count = mdmModuleDao.checkData(map); + // if (count > 0) { + // if (str.toString() != null && !"".equals(str.toString())) { + // str.append(";"); + // } + // str.append(mdmModuleDbEntityList.get(i).getRemark() + "的" + mdmModuleDbFiledsEntityList.get(i1).getChName() + "已存在"); + // break; + // } + // } // } // } // } - // } else { - // //TODO 连线 - // flag = true; // } // } - // if(mdmModuleDbEntity.getDbName()!= null && !"".equals(mdmModuleDbEntity.getDbName())) { - // //删除数据 - // MdmDistributeEntity mdmDistributeEntity = new MdmDistributeEntity(); - // mdmDistributeEntity.setId(jsonObject.getString("distributeID")); - // mdmDistributeEntity.setTableName(mdmModuleDbEntity.getDbName()+"_distribute"); - // mdmDistributeEntity.setFormmainId(jsonObject.getString("id")); - // mdmDistributeEntity.setAppId(jsonObject.getString("appID")); - // mdmDistributeEntity.setStatus("1"); - // mdmDistributeEntity.setMsg("删除成功"); - // if (!flag) { - // mdmDistributeEntity.setStatus("3"); - // mdmDistributeEntity.setMsg("删除失败"); - // } - // mdmModuleDao.updateDistribute(mdmDistributeEntity); - // return BaseResult.getSuccessMessageEntity("删除数据成功"); - // - // }else { - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // }else { - // return BaseResult.getFailureMessageEntity("系统错误"); // } // } // + // + // //保存数据 + // if (str == null || "".equals(str.toString())) { + // String id = UUIDUtils.getUUID(); + // for (int i = 0; i < mdmModuleDbEntityList.size(); i++) { + // if ("1".equals(mdmModuleDbEntityList.get(i).getDbType())) { + // JSONObject jsonObject = saveData.getJSONObject(mdmModuleDbEntityList.get(i).getDbName()); + // //保存数据 + // MdmDataDto mdmDataDto = new MdmDataDto(); + // mdmDataDto.setTableName(mdmModuleDbEntityList.get(i).getDbName()); + // MdmModuleDbFiledsEntity mdmModuleDbFiledsEntity1 = new MdmModuleDbFiledsEntity(); + // mdmModuleDbFiledsEntity1.setMdmId(mdmModuleEntity.getId()); + // mdmModuleDbFiledsEntity1.setDbId(mdmModuleDbEntityList.get(i).getId()); + // mdmModuleDbFiledsEntity1.setSts("Y"); + // List fileds = mdmModuleDbFiledsDao.queryBase(mdmModuleDbFiledsEntity1); + // //查询单据规则 + // MdmTableCodeRuleEntity mdmTableCodeRuleEntity = new MdmTableCodeRuleEntity(); + // mdmTableCodeRuleEntity.setMdmId(mdmModuleEntity.getId()); + // mdmTableCodeRuleEntity.setDbId(mdmModuleDbEntityList.get(i).getId()); + // mdmTableCodeRuleEntity.setSts("Y"); + // List allMdmTableCodeRuleEntities = mdmServiceCache.queryMdmTableCodeRuleEntity(mdmTableCodeRuleEntity); + // List mdmTableCodeRuleEntities = new ArrayList<>(); + // if(allMdmTableCodeRuleEntities != null && allMdmTableCodeRuleEntities.size() > 0){ + // for (int i1 = 0; i1 < allMdmTableCodeRuleEntities.size(); i1++) { + // if(mdmModuleDbEntityList.get(i).getId().equals(allMdmTableCodeRuleEntities.get(i1).getDbId())){ + // mdmTableCodeRuleEntities.add(allMdmTableCodeRuleEntities.get(i1)); + // } + // } + // } + // StringBuffer document_rule = new StringBuffer(); + // Integer document_rule_num = 0; + // if (mdmTableCodeRuleEntities != null && mdmTableCodeRuleEntities.size() > 0) { + // for (int i1 = 0; i1 < mdmTableCodeRuleEntities.size(); i1++) { + // //1、连接符号 2、字符串 3、日期 4、流水号 + // if ("1".equals(mdmTableCodeRuleEntities.get(i1).getDbType())) { + // document_rule.append("-"); + // } else if ("2".equals(mdmTableCodeRuleEntities.get(i1).getDbType())) { + // document_rule.append(mdmTableCodeRuleEntities.get(i1).getDbValue()); + // } else if ("3".equals(mdmTableCodeRuleEntities.get(i1).getDbType())) { + // SimpleDateFormat sdf = new SimpleDateFormat(mdmTableCodeRuleEntities.get(i1).getDbValue());//要转换的时间格式 + // String stra = sdf.format(new Date()); + // document_rule.append(stra); + // } else if ("4".equals(mdmTableCodeRuleEntities.get(i1).getDbType())) { + // document_rule_num = mdmTableCodeRuleEntities.get(i1).getDbValue().length(); + // } + // } + // } + // List mdmDataFiledDtos = new ArrayList<>(); + // for (int i1 = 0; i1 < fileds.size(); i1++) { + // if (jsonObject.get(fileds.get(i1).getEnName()) != null) { + // MdmDataFiledDto mdmDataFiledDto = new MdmDataFiledDto(); + // mdmDataFiledDto.setFiledsName(fileds.get(i1).getEnName()); + // mdmDataFiledDto.setFiledsValue(jsonObject.getString(fileds.get(i1).getEnName())); + // mdmDataFiledDtos.add(mdmDataFiledDto); + // } + // } + // MdmDataFiledDto mdmDataFiledDto = new MdmDataFiledDto(); + // mdmDataFiledDto.setFiledsName("logid"); + // mdmDataFiledDto.setFiledsValue(StpUtil.getLoginIdAsString()); + // mdmDataFiledDtos.add(mdmDataFiledDto); + // mdmDataDto.setMdmDataFiledDtos(mdmDataFiledDtos); + // if (flag) { + // mdmDataDto.setId(jsonObject.getString("id")); + // id = jsonObject.getString("id"); + // int a = mdmModuleDao.updateForm(mdmDataDto); + // } else { + // + // mdmDataDto.setDbType(mdmModuleDbEntityList.get(i).getDbType()); + // mdmDataDto.setDocumentRule(document_rule.toString()); + // mdmDataDto.setDocumentRuleNum(document_rule_num); + // MdmDataFiledDto ids = new MdmDataFiledDto(); + // ids.setFiledsName("id"); + // ids.setFiledsValue(id); + // mdmDataFiledDtos.add(ids); + // mdmDataDto.setMdmDataFiledDtos(mdmDataFiledDtos); + // int a = mdmModuleDao.saveForm(mdmDataDto); + // } + // } + // } + // + // for (int i = 0; i < mdmModuleDbEntityList.size(); i++) { + // if ("2".equals(mdmModuleDbEntityList.get(i).getDbType())) { + // //删除明细 + // FormmainDeleteDto formmainDeleteDto = new FormmainDeleteDto(); + // formmainDeleteDto.setFormmain_id(id); + // formmainDeleteDto.setLoginId(StpUtil.getLoginIdAsString()); + // formmainDeleteDto.setTableName(mdmModuleDbEntityList.get(i).getDbName()); + // mdmModuleDao.deleteTemplateById(formmainDeleteDto); + // + // JSONArray jsonArray = saveData.getJSONArray(mdmModuleDbEntityList.get(i).getDbName()); + // if (jsonArray != null && jsonArray.size() > 0) { + // MdmModuleDbFiledsEntity mdmModuleDbFiledsEntity1 = new MdmModuleDbFiledsEntity(); + // mdmModuleDbFiledsEntity1.setMdmId(mdmModuleEntity.getId()); + // mdmModuleDbFiledsEntity1.setSts("Y"); + // List allfileds = mdmServiceCache.queryMdmModuleDbFileds(mdmModuleDbFiledsEntity1); + // List fileds = new ArrayList<>(); + // if(allfileds != null && allfileds.size() > 0){ + // for (int i1 = 0; i1 < allfileds.size(); i1++) { + // if(mdmModuleDbEntityList.get(i).getId().equals(allfileds.get(i1).getDbId())){ + // fileds.add(allfileds.get(i1)); + // } + // } + // } + // + // for (int i2 = 0; i2 < jsonArray.size(); i2++) { + // JSONObject jsonObject = jsonArray.getJSONObject(i2); + // //保存数据 + // MdmDataDto mdmDataDto = new MdmDataDto(); + // 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); + // } + // 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); + // } + // } + // } + // } + // } + // } + // return str.toString(); //} // - /** - * @param mdmCode - * @param saveData - * @param mdmModuleEntity - * @param mdmModuleDbEntityList - * @param flag 修改 新增 - * @return java.lang.String - * @Author lvleigang - * @Description 校验数据 - * @Date 11:20 上午 2023/11/6 - **/ - private String checkDataOnly(Integer mdmCode, JSONObject saveData, boolean flag, MdmModuleEntity mdmModuleEntity, List mdmModuleDbEntityList) { - StringBuffer str = new StringBuffer(); - - //查询字段 - //查询字段下的必填规则 - MdmModuleDbFiledsEntity mdmModuleDbFiledsEntity = new MdmModuleDbFiledsEntity(); - mdmModuleDbFiledsEntity.setMdmId(mdmModuleEntity.getId()); - mdmModuleDbFiledsEntity.setSts("Y"); - mdmModuleDbFiledsEntity.setRoletype("required"); - mdmModuleDbFiledsEntity.setRoleValue("true"); - List mdmModuleDbFiledsEntityList = mdmModuleDbFiledsDao.queryBase(mdmModuleDbFiledsEntity); - - if (mdmModuleDbFiledsEntityList != null && mdmModuleDbFiledsEntityList.size() > 0) { - for (int i = 0; i < mdmModuleDbEntityList.size(); i++) { - if ("1".equals(mdmModuleDbEntityList.get(i).getDbType())) { - JSONObject jsonObject = saveData.getJSONObject(mdmModuleDbEntityList.get(i).getDbName()); - for (int i1 = 0; i1 < mdmModuleDbFiledsEntityList.size(); i1++) { - if (mdmModuleDbFiledsEntityList.get(i1).getDbId().equals(mdmModuleDbEntityList.get(i).getId())) { - if (jsonObject.get(mdmModuleDbFiledsEntityList.get(i1).getEnName()) == null || "".equals(jsonObject.getString(mdmModuleDbFiledsEntityList.get(i1).getEnName()))) { - if (str.toString() != null && !"".equals(str.toString())) { - str.append(";"); - } - str.append(mdmModuleDbEntityList.get(i).getRemark() + "的" + mdmModuleDbFiledsEntityList.get(i1).getChName() + "不为空"); - } - } - } - } else { - JSONArray jsonArray = saveData.getJSONArray(mdmModuleDbEntityList.get(i).getDbName()); - if (jsonArray != null && jsonArray.size() > 0) { - for (int i1 = 0; i1 < mdmModuleDbFiledsEntityList.size(); i1++) { - if (mdmModuleDbFiledsEntityList.get(i1).getDbId().equals(mdmModuleDbEntityList.get(i).getId())) { - for (int i2 = 0; i2 < jsonArray.size(); i2++) { - JSONObject jsonObject = jsonArray.getJSONObject(i2); - if (jsonObject.get(mdmModuleDbFiledsEntityList.get(i1).getEnName()) == null || "".equals(jsonObject.getString(mdmModuleDbFiledsEntityList.get(i1).getEnName()))) { - if (str.toString() != null && !"".equals(str.toString())) { - str.append(";"); - } - str.append(mdmModuleDbEntityList.get(i).getRemark() + "的" + mdmModuleDbFiledsEntityList.get(i1).getChName() + "不为空"); - break; - } - } - } - } - } - } - } - } - - if (str == null || "".equals(str.toString())) { - //校验数据 - MdmModuleDbFiledsEntity onlyFiledsEntity = new MdmModuleDbFiledsEntity(); - onlyFiledsEntity.setMdmId(mdmModuleEntity.getId()); - onlyFiledsEntity.setSts("Y"); - onlyFiledsEntity.setRoletype("fieldsSole"); - onlyFiledsEntity.setRoleValue("true"); - - List onlyEntityList = mdmModuleDbFiledsDao.queryBase(onlyFiledsEntity); - - if (onlyEntityList != null && onlyEntityList.size() > 0) { - for (int i = 0; i < mdmModuleDbEntityList.size(); i++) { - if ("1".equals(mdmModuleDbEntityList.get(i).getDbType())) { - JSONObject jsonObject = saveData.getJSONObject(mdmModuleDbEntityList.get(i).getDbName()); - for (int i1 = 0; i1 < onlyEntityList.size(); i1++) { - if (onlyEntityList.get(i1).getDbId().equals(mdmModuleDbEntityList.get(i).getId())) { - //校验唯一 - Map map = new HashMap<>(); - map.put("tableName", mdmModuleDbEntityList.get(i).getDbName()); - if (flag) { - map.put("id", jsonObject.getString("id")); - } - map.put("filedName", onlyEntityList.get(i1).getEnName()); - map.put("filedValue", jsonObject.getString(onlyEntityList.get(i1).getEnName())); - Integer count = mdmModuleDao.checkData(map); - if (count > 0) { - if (str.toString() != null && !"".equals(str.toString())) { - str.append(";"); - } - str.append(mdmModuleDbEntityList.get(i).getRemark() + "的" + mdmModuleDbFiledsEntityList.get(i1).getChName() + "已存在"); - } - } - } - } else { - JSONArray jsonArray = saveData.getJSONArray(mdmModuleDbEntityList.get(i).getDbName()); - if (jsonArray != null && jsonArray.size() > 0) { - for (int i1 = 0; i1 < onlyEntityList.size(); i1++) { - if (onlyEntityList.get(i1).getDbId().equals(mdmModuleDbEntityList.get(i).getId())) { - for (int i2 = 0; i2 < jsonArray.size(); i2++) { - JSONObject jsonObject = jsonArray.getJSONObject(i2); - - //校验唯一 - Map map = new HashMap<>(); - map.put("tableName", mdmModuleDbEntityList.get(i).getDbName()); - if (flag) { - map.put("id", jsonObject.getString("id")); - } - map.put("filedName", onlyEntityList.get(i1).getEnName()); - map.put("filedValue", jsonObject.getString(onlyEntityList.get(i1).getEnName())); - Integer count = mdmModuleDao.checkData(map); - if (count > 0) { - if (str.toString() != null && !"".equals(str.toString())) { - str.append(";"); - } - str.append(mdmModuleDbEntityList.get(i).getRemark() + "的" + mdmModuleDbFiledsEntityList.get(i1).getChName() + "已存在"); - break; - } - } - } - } - } - } - } - } - } - - - //保存数据 - if (str == null || "".equals(str.toString())) { - String id = UUIDUtils.getUUID(); - for (int i = 0; i < mdmModuleDbEntityList.size(); i++) { - if ("1".equals(mdmModuleDbEntityList.get(i).getDbType())) { - JSONObject jsonObject = saveData.getJSONObject(mdmModuleDbEntityList.get(i).getDbName()); - //保存数据 - MdmDataDto mdmDataDto = new MdmDataDto(); - mdmDataDto.setTableName(mdmModuleDbEntityList.get(i).getDbName()); - MdmModuleDbFiledsEntity mdmModuleDbFiledsEntity1 = new MdmModuleDbFiledsEntity(); - mdmModuleDbFiledsEntity1.setMdmId(mdmModuleEntity.getId()); - mdmModuleDbFiledsEntity1.setDbId(mdmModuleDbEntityList.get(i).getId()); - mdmModuleDbFiledsEntity1.setSts("Y"); - List fileds = mdmModuleDbFiledsDao.queryBase(mdmModuleDbFiledsEntity1); - //查询单据规则 - MdmTableCodeRuleEntity mdmTableCodeRuleEntity = new MdmTableCodeRuleEntity(); - mdmTableCodeRuleEntity.setMdmId(mdmModuleEntity.getId()); - mdmTableCodeRuleEntity.setDbId(mdmModuleDbEntityList.get(i).getId()); - mdmTableCodeRuleEntity.setSts("Y"); - List allMdmTableCodeRuleEntities = mdmServiceCache.queryMdmTableCodeRuleEntity(mdmTableCodeRuleEntity); - List mdmTableCodeRuleEntities = new ArrayList<>(); - if(allMdmTableCodeRuleEntities != null && allMdmTableCodeRuleEntities.size() > 0){ - for (int i1 = 0; i1 < allMdmTableCodeRuleEntities.size(); i1++) { - if(mdmModuleDbEntityList.get(i).getId().equals(allMdmTableCodeRuleEntities.get(i1).getDbId())){ - mdmTableCodeRuleEntities.add(allMdmTableCodeRuleEntities.get(i1)); - } - } - } - StringBuffer document_rule = new StringBuffer(); - Integer document_rule_num = 0; - if (mdmTableCodeRuleEntities != null && mdmTableCodeRuleEntities.size() > 0) { - for (int i1 = 0; i1 < mdmTableCodeRuleEntities.size(); i1++) { - //1、连接符号 2、字符串 3、日期 4、流水号 - if ("1".equals(mdmTableCodeRuleEntities.get(i1).getDbType())) { - document_rule.append("-"); - } else if ("2".equals(mdmTableCodeRuleEntities.get(i1).getDbType())) { - document_rule.append(mdmTableCodeRuleEntities.get(i1).getDbValue()); - } else if ("3".equals(mdmTableCodeRuleEntities.get(i1).getDbType())) { - SimpleDateFormat sdf = new SimpleDateFormat(mdmTableCodeRuleEntities.get(i1).getDbValue());//要转换的时间格式 - String stra = sdf.format(new Date()); - document_rule.append(stra); - } else if ("4".equals(mdmTableCodeRuleEntities.get(i1).getDbType())) { - document_rule_num = mdmTableCodeRuleEntities.get(i1).getDbValue().length(); - } - } - } - List mdmDataFiledDtos = new ArrayList<>(); - for (int i1 = 0; i1 < fileds.size(); i1++) { - if (jsonObject.get(fileds.get(i1).getEnName()) != null) { - MdmDataFiledDto mdmDataFiledDto = new MdmDataFiledDto(); - mdmDataFiledDto.setFiledsName(fileds.get(i1).getEnName()); - mdmDataFiledDto.setFiledsValue(jsonObject.getString(fileds.get(i1).getEnName())); - mdmDataFiledDtos.add(mdmDataFiledDto); - } - } - MdmDataFiledDto mdmDataFiledDto = new MdmDataFiledDto(); - mdmDataFiledDto.setFiledsName("logid"); - mdmDataFiledDto.setFiledsValue(StpUtil.getLoginIdAsString()); - mdmDataFiledDtos.add(mdmDataFiledDto); - mdmDataDto.setMdmDataFiledDtos(mdmDataFiledDtos); - if (flag) { - mdmDataDto.setId(jsonObject.getString("id")); - id = jsonObject.getString("id"); - int a = mdmModuleDao.updateForm(mdmDataDto); - } else { - - mdmDataDto.setDbType(mdmModuleDbEntityList.get(i).getDbType()); - mdmDataDto.setDocumentRule(document_rule.toString()); - mdmDataDto.setDocumentRuleNum(document_rule_num); - MdmDataFiledDto ids = new MdmDataFiledDto(); - ids.setFiledsName("id"); - ids.setFiledsValue(id); - mdmDataFiledDtos.add(ids); - mdmDataDto.setMdmDataFiledDtos(mdmDataFiledDtos); - int a = mdmModuleDao.saveForm(mdmDataDto); - } - } - } - - for (int i = 0; i < mdmModuleDbEntityList.size(); i++) { - if ("2".equals(mdmModuleDbEntityList.get(i).getDbType())) { - //删除明细 - FormmainDeleteDto formmainDeleteDto = new FormmainDeleteDto(); - formmainDeleteDto.setFormmain_id(id); - formmainDeleteDto.setLoginId(StpUtil.getLoginIdAsString()); - formmainDeleteDto.setTableName(mdmModuleDbEntityList.get(i).getDbName()); - mdmModuleDao.deleteTemplateById(formmainDeleteDto); - - JSONArray jsonArray = saveData.getJSONArray(mdmModuleDbEntityList.get(i).getDbName()); - if (jsonArray != null && jsonArray.size() > 0) { - MdmModuleDbFiledsEntity mdmModuleDbFiledsEntity1 = new MdmModuleDbFiledsEntity(); - mdmModuleDbFiledsEntity1.setMdmId(mdmModuleEntity.getId()); - mdmModuleDbFiledsEntity1.setSts("Y"); - List allfileds = mdmServiceCache.queryMdmModuleDbFileds(mdmModuleDbFiledsEntity1); - List fileds = new ArrayList<>(); - if(allfileds != null && allfileds.size() > 0){ - for (int i1 = 0; i1 < allfileds.size(); i1++) { - if(mdmModuleDbEntityList.get(i).getId().equals(allfileds.get(i1).getDbId())){ - fileds.add(allfileds.get(i1)); - } - } - } - - for (int i2 = 0; i2 < jsonArray.size(); i2++) { - JSONObject jsonObject = jsonArray.getJSONObject(i2); - //保存数据 - MdmDataDto mdmDataDto = new MdmDataDto(); - 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); - } - 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); - } - } - } - } - } - } - return str.toString(); - } - - - /** - * @param jsonObject - * @return boolean - * @Author lvleigang - * @Description 校验是否有值 - * @Date 2:20 下午 2023/7/10 - **/ - private boolean checkData(JSONObject jsonObject, String key) { - if (jsonObject != null - && jsonObject.getString(key) != null - && !"".equals(jsonObject.getString(key))) { - return true; - } - return false; - } - - protected T getData(String key, JSONObject jsonObject, Class clz) { - if (checkStr(jsonObject.getString(key))) { - return jsonObject.getJSONObject(key).toJavaObject(clz); - } - return null; - } - - /** - * @param key - * @param object - * @return com.alibaba.fastjson.JSONObject - * @Author lvleigang - * @Description 获取对象转换成jsonobj - * @Date 11:51 下午 2023/7/10 - **/ - protected JSONObject getstrObj(String key, JSONObject object) { - if (checkStr(object.getString(key))) { - return object.getJSONObject(key); - } - return new JSONObject(); - } - - /** - * @param str - * @return void - * @Author lvleigang - * @Description 校验字符串 - * @Date 11:41 上午 2022/12/7 - **/ - protected Boolean checkStr(String str) { - Boolean flag = true; - if (str == null || "".equals(str)) { - flag = false; - } - return flag; - } - - /** - * @param str - * @return void - * @Author lvleigang - * @Description 校验字符串 - * @Date 11:41 上午 2022/12/7 - **/ - protected Boolean checkInt(Integer str) { - Boolean flag = true; - if (str == null) { - flag = false; - } - return flag; - } + // + ///** + // * @param jsonObject + // * @return boolean + // * @Author lvleigang + // * @Description 校验是否有值 + // * @Date 2:20 下午 2023/7/10 + // **/ + //private boolean checkData(JSONObject jsonObject, String key) { + // if (jsonObject != null + // && jsonObject.getString(key) != null + // && !"".equals(jsonObject.getString(key))) { + // return true; + // } + // return false; + //} + // + //protected T getData(String key, JSONObject jsonObject, Class clz) { + // if (checkStr(jsonObject.getString(key))) { + // return jsonObject.getJSONObject(key).toJavaObject(clz); + // } + // return null; + //} + // + ///** + // * @param key + // * @param object + // * @return com.alibaba.fastjson.JSONObject + // * @Author lvleigang + // * @Description 获取对象转换成jsonobj + // * @Date 11:51 下午 2023/7/10 + // **/ + //protected JSONObject getstrObj(String key, JSONObject object) { + // if (checkStr(object.getString(key))) { + // return object.getJSONObject(key); + // } + // return new JSONObject(); + //} + // + ///** + // * @param str + // * @return void + // * @Author lvleigang + // * @Description 校验字符串 + // * @Date 11:41 上午 2022/12/7 + // **/ + //protected Boolean checkStr(String str) { + // Boolean flag = true; + // if (str == null || "".equals(str)) { + // flag = false; + // } + // return flag; + //} + // + ///** + // * @param str + // * @return void + // * @Author lvleigang + // * @Description 校验字符串 + // * @Date 11:41 上午 2022/12/7 + // **/ + //protected Boolean checkInt(Integer str) { + // Boolean flag = true; + // if (str == null) { + // flag = false; + // } + // return flag; + //} } From 4f30c7f8fb153e3c47dbefe684ebdb8f39fb440d Mon Sep 17 00:00:00 2001 From: lvleigang <957075182@qq.com> Date: Mon, 17 Jun 2024 10:31:13 +0800 Subject: [PATCH 56/80] =?UTF-8?q?=E4=B8=BB=E6=95=B0=E6=8D=AE=E4=BF=AE?= =?UTF-8?q?=E6=94=B9,=E6=95=B0=E6=8D=AE=E6=BA=90=E5=88=87=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/hzya/frame/mdm/entity/MdmDto.java | 10 + .../mdm/mdmModule/entity/MdmModuleEntity.xml | 22 +- .../mdmModule/service/IMdmModuleService.java | 46 + .../service/impl/MdmModuleServiceImpl.java | 626 +- .../entity/MdmModuleDbFiledsEntity.java | 10 + .../entity/MdmModuleDbFiledsRuleEntity.xml | 2 + .../dao/IMdmModuleDistributeDao.java | 2 +- .../dao/impl/MdmModuleDistributeDaoImpl.java | 2 +- .../entity/MdmModuleDistributeEntity.java | 13 +- .../entity/MdmModuleDistributeEntity.xml | 34 +- .../service/IMdmModuleDistributeService.java | 2 +- .../impl/MdmModuleDistributeServiceImpl.java | 2 +- .../dao/IMdmModuleDistributeDetailDao.java | 2 +- .../MdmModuleDistributeDetailDaoImpl.java | 2 +- .../MdmModuleDistributeDetailEntity.java | 34 +- .../MdmModuleDistributeDetailEntity.xml | 55 +- .../IMdmModuleDistributeDetailService.java | 2 +- .../MdmModuleDistributeDetailServiceImpl.java | 2 +- .../entity/MdmModuleSourceEntity.java | 2 +- .../entity/MdmModuleSourceEntity.xml | 5 + .../mdmModuleView/dao/IMdmModuleViewDao.java | 2 + .../dao/impl/MdmModuleViewDaoImpl.java | 11 +- .../entity/MdmModuleViewEntity.java | 2 +- .../entity/MdmModuleViewEntity.xml | 10 +- .../entity/MdmModuleViewButtonEntity.java | 2 +- .../entity/MdmModuleViewDetailEntity.java | 10 + .../hzya/frame/mdm/service/IMdmService.java | 396 +- .../mdm/service/impl/MdmServiceImpl.java | 5731 +++++------------ .../frame/serviceUtil/DsDataSourceUtil.java | 15 +- .../sys/dataSource/dao/ISysDataSourceDao.java | 24 - .../dao/impl/SysDataSourceDaoImpl.java | 47 - .../entity/SysDataSourceEntity.java | 168 - .../dataSource/entity/SysDataSourceEntity.xml | 484 -- .../dataSource/entity/SysDataSourceVo.java | 162 - .../service/ISysDataSourceService.java | 74 - .../impl/SysDataSourceServiceImpl.java | 256 - .../dao/ISysApplicationDatabaseDao.java | 7 +- .../impl/SysApplicationDatabaseDaoImpl.java | 13 +- .../entity/SysApplicationDatabaseEntity.java | 99 +- .../entity/SysApplicationDatabaseEntity.xml | 199 +- .../ISysApplicationDatabaseService.java | 2 +- .../SysApplicationDatabaseServiceImpl.java | 2 +- .../impl/SysApplicationServiceImpl.java | 30 +- .../sysnew/login/impl/LoginServiceImpl.java | 7 + .../aop/AopDynamicRoutingDataSourceInit.java | 15 +- 45 files changed, 2799 insertions(+), 5844 deletions(-) delete mode 100644 service/src/main/java/com/hzya/frame/sys/dataSource/dao/ISysDataSourceDao.java delete mode 100644 service/src/main/java/com/hzya/frame/sys/dataSource/dao/impl/SysDataSourceDaoImpl.java delete mode 100644 service/src/main/java/com/hzya/frame/sys/dataSource/entity/SysDataSourceEntity.java delete mode 100644 service/src/main/java/com/hzya/frame/sys/dataSource/entity/SysDataSourceEntity.xml delete mode 100644 service/src/main/java/com/hzya/frame/sys/dataSource/entity/SysDataSourceVo.java delete mode 100644 service/src/main/java/com/hzya/frame/sys/dataSource/service/ISysDataSourceService.java delete mode 100644 service/src/main/java/com/hzya/frame/sys/dataSource/service/impl/SysDataSourceServiceImpl.java diff --git a/service/src/main/java/com/hzya/frame/mdm/entity/MdmDto.java b/service/src/main/java/com/hzya/frame/mdm/entity/MdmDto.java index 01dd7150..93774e10 100644 --- a/service/src/main/java/com/hzya/frame/mdm/entity/MdmDto.java +++ b/service/src/main/java/com/hzya/frame/mdm/entity/MdmDto.java @@ -25,6 +25,8 @@ public class MdmDto { private String id; //id private String fieldId; + //id + private String dbId; //3、新增4、修改 5、查看 private String showType; //分页 @@ -222,5 +224,13 @@ public class MdmDto { public void setFieldId(String fieldId) { this.fieldId = fieldId; } + + public String getDbId() { + return dbId; + } + + public void setDbId(String dbId) { + this.dbId = dbId; + } } 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 548f0526..7dbd9244 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 @@ -391,14 +391,12 @@ where id = #{id} PRIMARY KEY (`sorts`,`id`) USING BTREE - ) ENGINE = INNODB DEFAULT CHARSET = utf8mb4 COMMENT = #{tableRemark} + ) ENGINE = INNODB DEFAULT CHARSET = utf8mb4 + COMMENT = #{tableRemark} - - - + + diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistribute/dao/IMdmModuleDistributeDao.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistribute/dao/IMdmModuleDistributeDao.java index 2e2f90f5..895f30cd 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistribute/dao/IMdmModuleDistributeDao.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistribute/dao/IMdmModuleDistributeDao.java @@ -7,7 +7,7 @@ import com.hzya.frame.basedao.dao.IBaseDao; * 主数据功能应用分发表(mdm_module_distribute: table)表数据库访问层 * * @author makejava - * @since 2024-06-03 08:47:33 + * @since 2024-06-14 10:06:36 */ public interface IMdmModuleDistributeDao extends IBaseDao { diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistribute/dao/impl/MdmModuleDistributeDaoImpl.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistribute/dao/impl/MdmModuleDistributeDaoImpl.java index 3318c2c2..4c029e80 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistribute/dao/impl/MdmModuleDistributeDaoImpl.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistribute/dao/impl/MdmModuleDistributeDaoImpl.java @@ -8,7 +8,7 @@ import com.hzya.frame.basedao.dao.MybatisGenericDao; * 主数据功能应用分发表(MdmModuleDistribute)表数据库访问层 * * @author makejava - * @since 2024-06-03 08:47:33 + * @since 2024-06-14 10:06:36 */ @Repository(value = "MdmModuleDistributeDaoImpl") public class MdmModuleDistributeDaoImpl extends MybatisGenericDao implements IMdmModuleDistributeDao{ diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistribute/entity/MdmModuleDistributeEntity.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistribute/entity/MdmModuleDistributeEntity.java index 0ce7e336..9b6677b9 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistribute/entity/MdmModuleDistributeEntity.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistribute/entity/MdmModuleDistributeEntity.java @@ -9,7 +9,7 @@ import com.hzya.frame.web.entity.BaseEntity; * 主数据功能应用分发表(MdmModuleDistribute)实体类 * * @author makejava - * @since 2024-06-03 08:47:33 + * @since 2024-06-14 10:06:36 */ public class MdmModuleDistributeEntity extends BaseEntity { @@ -25,8 +25,11 @@ public class MdmModuleDistributeEntity extends BaseEntity { private String deleteApi; /** 启用停用 0、停用1、启用 */ private String enabledState; + /** 主表ID */ + private String dbId; /** 公司id */ private String companyId; + private List mdmModuleDistributeDetailEntities; public String getMdmId() { @@ -77,6 +80,14 @@ public class MdmModuleDistributeEntity extends BaseEntity { this.enabledState = enabledState; } + public String getDbId() { + return dbId; + } + + public void setDbId(String dbId) { + this.dbId = dbId; + } + public String getCompanyId() { return companyId; } diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistribute/entity/MdmModuleDistributeEntity.xml b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistribute/entity/MdmModuleDistributeEntity.xml index 82243342..20e5de5b 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistribute/entity/MdmModuleDistributeEntity.xml +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistribute/entity/MdmModuleDistributeEntity.xml @@ -10,6 +10,7 @@ + @@ -28,6 +29,7 @@ ,add_api ,delete_api ,enabled_state + ,db_id ,sorts ,create_user_id ,create_time @@ -37,6 +39,13 @@ ,org_id ,company_id + + + - + insert into mdm_module_distribute( id , @@ -154,6 +167,7 @@ add_api , delete_api , enabled_state , + db_id , sorts , create_user_id , create_time , @@ -162,6 +176,7 @@ sts , org_id , company_id , + sorts, sts, )values( @@ -173,6 +188,7 @@ #{addApi} , #{deleteApi} , #{enabledState} , + #{dbId} , #{sorts} , #{create_user_id} , #{create_time} , @@ -181,24 +197,25 @@ #{sts} , #{org_id} , #{companyId} , + (select (max(IFNULL( a.sorts, 0 )) + 1) as sort from mdm_module_distribute a WHERE a.sts = 'Y' ), 'Y', ) - - insert into mdm_module_distribute(mdm_id, app_id, update_api, add_api, delete_api, enabled_state, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, sts) + + insert into mdm_module_distribute(mdm_id, app_id, update_api, add_api, delete_api, enabled_state, db_id, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, sts) values - (#{entity.mdmId},#{entity.appId},#{entity.updateApi},#{entity.addApi},#{entity.deleteApi},#{entity.enabledState},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId}, 'Y') + (#{entity.mdmId},#{entity.appId},#{entity.updateApi},#{entity.addApi},#{entity.deleteApi},#{entity.enabledState},#{entity.dbId},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId}, 'Y') - - insert into mdm_module_distribute(mdm_id, app_id, update_api, add_api, delete_api, enabled_state, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id) + + insert into mdm_module_distribute(mdm_id, app_id, update_api, add_api, delete_api, enabled_state, db_id, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id) values - (#{entity.mdmId},#{entity.appId},#{entity.updateApi},#{entity.addApi},#{entity.deleteApi},#{entity.enabledState},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId}) + (#{entity.mdmId},#{entity.appId},#{entity.updateApi},#{entity.addApi},#{entity.deleteApi},#{entity.enabledState},#{entity.dbId},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId}) on duplicate key update mdm_id = values(mdm_id), @@ -207,6 +224,7 @@ add_api = values(add_api), delete_api = values(delete_api), enabled_state = values(enabled_state), + db_id = values(db_id), create_user_id = values(create_user_id), create_time = values(create_time), modify_user_id = values(modify_user_id), @@ -224,6 +242,7 @@ update mdm_module_distribute set add_api = #{addApi}, delete_api = #{deleteApi}, enabled_state = #{enabledState}, + db_id = #{dbId}, create_user_id = #{create_user_id}, create_time = #{create_time}, modify_user_id = #{modify_user_id}, @@ -250,6 +269,7 @@ update mdm_module_distribute set sts= 'N' ,modify_time = #{modify_time},modify_ and add_api = #{addApi} and delete_api = #{deleteApi} and enabled_state = #{enabledState} + and db_id = #{dbId} and sorts = #{sorts} and sts = #{sts} and company_id = #{companyId} diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistribute/service/IMdmModuleDistributeService.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistribute/service/IMdmModuleDistributeService.java index 577b0e3c..ab9fe2da 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistribute/service/IMdmModuleDistributeService.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistribute/service/IMdmModuleDistributeService.java @@ -6,7 +6,7 @@ import com.hzya.frame.basedao.service.IBaseService; * 主数据功能应用分发表(MdmModuleDistribute)表服务接口 * * @author makejava - * @since 2024-06-03 08:47:33 + * @since 2024-06-14 10:06:36 */ public interface IMdmModuleDistributeService extends IBaseService{ } diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistribute/service/impl/MdmModuleDistributeServiceImpl.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistribute/service/impl/MdmModuleDistributeServiceImpl.java index 24fe61e3..5133bc1a 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistribute/service/impl/MdmModuleDistributeServiceImpl.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistribute/service/impl/MdmModuleDistributeServiceImpl.java @@ -11,7 +11,7 @@ import com.hzya.frame.basedao.service.impl.BaseService; * 主数据功能应用分发表(MdmModuleDistribute)表服务实现类 * * @author makejava - * @since 2024-06-03 08:47:33 + * @since 2024-06-14 10:06:36 */ @Service(value = "mdmModuleDistributeService") public class MdmModuleDistributeServiceImpl extends BaseService implements IMdmModuleDistributeService { diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistributeDetail/dao/IMdmModuleDistributeDetailDao.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistributeDetail/dao/IMdmModuleDistributeDetailDao.java index 2b55a63a..3b39e01d 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistributeDetail/dao/IMdmModuleDistributeDetailDao.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistributeDetail/dao/IMdmModuleDistributeDetailDao.java @@ -7,7 +7,7 @@ import com.hzya.frame.basedao.dao.IBaseDao; * 主数据功能应用分发明细表(mdm_module_distribute_detail: table)表数据库访问层 * * @author makejava - * @since 2024-06-03 08:48:18 + * @since 2024-06-14 10:03:50 */ public interface IMdmModuleDistributeDetailDao extends IBaseDao { diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistributeDetail/dao/impl/MdmModuleDistributeDetailDaoImpl.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistributeDetail/dao/impl/MdmModuleDistributeDetailDaoImpl.java index 68878631..c184298c 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistributeDetail/dao/impl/MdmModuleDistributeDetailDaoImpl.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistributeDetail/dao/impl/MdmModuleDistributeDetailDaoImpl.java @@ -8,7 +8,7 @@ import com.hzya.frame.basedao.dao.MybatisGenericDao; * 主数据功能应用分发明细表(MdmModuleDistributeDetail)表数据库访问层 * * @author makejava - * @since 2024-06-03 08:48:18 + * @since 2024-06-14 10:03:50 */ @Repository(value = "MdmModuleDistributeDetailDaoImpl") public class MdmModuleDistributeDetailDaoImpl extends MybatisGenericDao implements IMdmModuleDistributeDetailDao{ diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistributeDetail/entity/MdmModuleDistributeDetailEntity.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistributeDetail/entity/MdmModuleDistributeDetailEntity.java index b0438ba8..18bd952c 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistributeDetail/entity/MdmModuleDistributeDetailEntity.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistributeDetail/entity/MdmModuleDistributeDetailEntity.java @@ -6,7 +6,7 @@ import com.hzya.frame.web.entity.BaseEntity; * 主数据功能应用分发明细表(MdmModuleDistributeDetail)实体类 * * @author makejava - * @since 2024-06-03 08:48:18 + * @since 2024-06-14 10:03:50 */ public class MdmModuleDistributeDetailEntity extends BaseEntity { @@ -18,12 +18,18 @@ public class MdmModuleDistributeDetailEntity extends BaseEntity { private String apiId; /** 数据类型 1、新增2、修改3、删除 */ private String dataType; + /** 左括号 */ + private String leftBracket; /** 字段名 */ private String filedName; - /** 对比类型 1、等于 */ + /** 对比类型 1、等于 2、不等于 3、大于 4、小于 */ private String compareType; /** 目标API字段默认值 */ private String filedVaule; + /** 连接符号 1\and 2\or */ + private String connectionSymbol; + /** 右括号 */ + private String rightParenthesis; /** 公司id */ private String companyId; @@ -60,6 +66,14 @@ public class MdmModuleDistributeDetailEntity extends BaseEntity { this.dataType = dataType; } + public String getLeftBracket() { + return leftBracket; + } + + public void setLeftBracket(String leftBracket) { + this.leftBracket = leftBracket; + } + public String getFiledName() { return filedName; } @@ -84,6 +98,22 @@ public class MdmModuleDistributeDetailEntity extends BaseEntity { this.filedVaule = filedVaule; } + public String getConnectionSymbol() { + return connectionSymbol; + } + + public void setConnectionSymbol(String connectionSymbol) { + this.connectionSymbol = connectionSymbol; + } + + public String getRightParenthesis() { + return rightParenthesis; + } + + public void setRightParenthesis(String rightParenthesis) { + this.rightParenthesis = rightParenthesis; + } + public String getCompanyId() { return companyId; } diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistributeDetail/entity/MdmModuleDistributeDetailEntity.xml b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistributeDetail/entity/MdmModuleDistributeDetailEntity.xml index 15113e4f..962f618a 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistributeDetail/entity/MdmModuleDistributeDetailEntity.xml +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistributeDetail/entity/MdmModuleDistributeDetailEntity.xml @@ -8,9 +8,12 @@ + + + @@ -27,9 +30,12 @@ ,distribute_id ,api_id ,data_type + ,left_bracket ,filed_name ,compare_type ,filed_vaule + ,connection_symbol + ,right_parenthesis ,sorts ,create_user_id ,create_time @@ -39,6 +45,12 @@ ,org_id ,company_id + + - + insert into mdm_module_distribute_detail( id , @@ -158,9 +182,12 @@ distribute_id , api_id , data_type , + left_bracket , filed_name , compare_type , filed_vaule , + connection_symbol , + right_parenthesis , sorts , create_user_id , create_time , @@ -169,6 +196,7 @@ sts , org_id , company_id , + sorts, sts, )values( @@ -178,9 +206,12 @@ #{distributeId} , #{apiId} , #{dataType} , + #{leftBracket} , #{filedName} , #{compareType} , #{filedVaule} , + #{connectionSymbol} , + #{rightParenthesis} , #{sorts} , #{create_user_id} , #{create_time} , @@ -189,33 +220,37 @@ #{sts} , #{org_id} , #{companyId} , + (select (max(IFNULL( a.sorts, 0 )) + 1) as sort from mdm_module_distribute_detail a WHERE a.sts = 'Y' ), 'Y', ) - - insert into mdm_module_distribute_detail(mdm_id, distribute_id, api_id, data_type, filed_name, compare_type, filed_vaule, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, sts) + + insert into mdm_module_distribute_detail(mdm_id, distribute_id, api_id, data_type, left_bracket, filed_name, compare_type, filed_vaule, connection_symbol, right_parenthesis, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, sts) values - (#{entity.mdmId},#{entity.distributeId},#{entity.apiId},#{entity.dataType},#{entity.filedName},#{entity.compareType},#{entity.filedVaule},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId}, 'Y') + (#{entity.mdmId},#{entity.distributeId},#{entity.apiId},#{entity.dataType},#{entity.leftBracket},#{entity.filedName},#{entity.compareType},#{entity.filedVaule},#{entity.connectionSymbol},#{entity.rightParenthesis},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId}, 'Y') - - insert into mdm_module_distribute_detail(mdm_id, distribute_id, api_id, data_type, filed_name, compare_type, filed_vaule, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id) + + insert into mdm_module_distribute_detail(mdm_id, distribute_id, api_id, data_type, left_bracket, filed_name, compare_type, filed_vaule, connection_symbol, right_parenthesis, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id) values - (#{entity.mdmId},#{entity.distributeId},#{entity.apiId},#{entity.dataType},#{entity.filedName},#{entity.compareType},#{entity.filedVaule},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId}) + (#{entity.mdmId},#{entity.distributeId},#{entity.apiId},#{entity.dataType},#{entity.leftBracket},#{entity.filedName},#{entity.compareType},#{entity.filedVaule},#{entity.connectionSymbol},#{entity.rightParenthesis},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId}) on duplicate key update mdm_id = values(mdm_id), distribute_id = values(distribute_id), api_id = values(api_id), data_type = values(data_type), + left_bracket = values(left_bracket), filed_name = values(filed_name), compare_type = values(compare_type), filed_vaule = values(filed_vaule), + connection_symbol = values(connection_symbol), + right_parenthesis = values(right_parenthesis), create_user_id = values(create_user_id), create_time = values(create_time), modify_user_id = values(modify_user_id), @@ -231,9 +266,12 @@ update mdm_module_distribute_detail set distribute_id = #{distributeId}, api_id = #{apiId}, data_type = #{dataType}, + left_bracket = #{leftBracket}, filed_name = #{filedName}, compare_type = #{compareType}, filed_vaule = #{filedVaule}, + connection_symbol = #{connectionSymbol}, + right_parenthesis = #{rightParenthesis}, create_user_id = #{create_user_id}, create_time = #{create_time}, modify_user_id = #{modify_user_id}, @@ -258,9 +296,12 @@ update mdm_module_distribute_detail set sts= 'N' ,modify_time = #{modify_time}, and distribute_id = #{distributeId} and api_id = #{apiId} and data_type = #{dataType} + and left_bracket = #{leftBracket} and filed_name = #{filedName} and compare_type = #{compareType} and filed_vaule = #{filedVaule} + and connection_symbol = #{connectionSymbol} + and right_parenthesis = #{rightParenthesis} and sorts = #{sorts} and sts = #{sts} and company_id = #{companyId} diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistributeDetail/service/IMdmModuleDistributeDetailService.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistributeDetail/service/IMdmModuleDistributeDetailService.java index 9b2fb7f8..735d9003 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistributeDetail/service/IMdmModuleDistributeDetailService.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistributeDetail/service/IMdmModuleDistributeDetailService.java @@ -6,7 +6,7 @@ import com.hzya.frame.basedao.service.IBaseService; * 主数据功能应用分发明细表(MdmModuleDistributeDetail)表服务接口 * * @author makejava - * @since 2024-06-03 08:48:18 + * @since 2024-06-14 10:03:50 */ public interface IMdmModuleDistributeDetailService extends IBaseService{ } diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistributeDetail/service/impl/MdmModuleDistributeDetailServiceImpl.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistributeDetail/service/impl/MdmModuleDistributeDetailServiceImpl.java index 6dd4b505..8dd367f5 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistributeDetail/service/impl/MdmModuleDistributeDetailServiceImpl.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistributeDetail/service/impl/MdmModuleDistributeDetailServiceImpl.java @@ -11,7 +11,7 @@ import com.hzya.frame.basedao.service.impl.BaseService; * 主数据功能应用分发明细表(MdmModuleDistributeDetail)表服务实现类 * * @author makejava - * @since 2024-06-03 08:48:18 + * @since 2024-06-14 10:03:50 */ @Service(value = "mdmModuleDistributeDetailService") public class MdmModuleDistributeDetailServiceImpl extends BaseService implements IMdmModuleDistributeDetailService { diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleSource/entity/MdmModuleSourceEntity.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleSource/entity/MdmModuleSourceEntity.java index 84e0358b..30f3c515 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleSource/entity/MdmModuleSourceEntity.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleSource/entity/MdmModuleSourceEntity.java @@ -12,7 +12,7 @@ public class MdmModuleSourceEntity extends BaseEntity { /** 主数据模版ID */ private String mdmId; - /** 来源类型 */ + /** 来源类型1、插件2、api */ private String sourceType; /** 来源名称 */ private String sourceName; 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 245446f4..b4625605 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 @@ -33,6 +33,11 @@ ,org_id ,company_id + + select count(1) from mdm_module_view + + and mdm_id = #{mdmId} + and (view_filed = #{viewFiled} or up_id_filed = #{upIdFiled}) + and sts='Y' + + diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleViewButton/entity/MdmModuleViewButtonEntity.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleViewButton/entity/MdmModuleViewButtonEntity.java index 6ac2b94f..19949393 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleViewButton/entity/MdmModuleViewButtonEntity.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleViewButton/entity/MdmModuleViewButtonEntity.java @@ -14,7 +14,7 @@ public class MdmModuleViewButtonEntity extends BaseEntity { private String mdmId; /** 视图id */ private String viewId; - /** 类型1、新建2、重置3、查询4、修改 5、删除 6、查看 */ + /** 类型1、新建2、重置3、查询4、修改 5、删除 6、查看 7、下发 */ private String buttonType; /** 按钮值 */ private String buttonValue; diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleViewDetail/entity/MdmModuleViewDetailEntity.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleViewDetail/entity/MdmModuleViewDetailEntity.java index 8d10318a..5b5295d9 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleViewDetail/entity/MdmModuleViewDetailEntity.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleViewDetail/entity/MdmModuleViewDetailEntity.java @@ -16,6 +16,8 @@ public class MdmModuleViewDetailEntity extends BaseEntity { private String viewId; /** 字段 */ private String viewFiled; + /** 字段 */ + private String viewName; /** 类型1、查询2、列表3、新增4、修改 5、查看 */ private String viewType; /** 公司id */ @@ -70,5 +72,13 @@ public class MdmModuleViewDetailEntity extends BaseEntity { public void setDataType(String dataType) { this.dataType = dataType; } + + public String getViewName() { + return viewName; + } + + public void setViewName(String viewName) { + this.viewName = viewName; + } } diff --git a/service/src/main/java/com/hzya/frame/mdm/service/IMdmService.java b/service/src/main/java/com/hzya/frame/mdm/service/IMdmService.java index 920a3cd5..ae9ef52c 100644 --- a/service/src/main/java/com/hzya/frame/mdm/service/IMdmService.java +++ b/service/src/main/java/com/hzya/frame/mdm/service/IMdmService.java @@ -8,264 +8,56 @@ import com.hzya.frame.web.entity.JsonResultEntity; */ public interface IMdmService { - ///** - // * @param jsonObject - // * @return com.hzya.frame.web.entity.JsonResultEntity - // * @Author lvleigang - // * @Description 主数据列表查询接口分页 - // * @Date 9:40 上午 2023/10/18 - // **/ - //JsonResultEntity queryMdmPage(JSONObject jsonObject); + /** + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 主数据列表显示 树、查询条件、列表字段、按钮 + * @Date 9:40 上午 2023/10/18 + **/ + JsonResultEntity queryMdmShow(JSONObject jsonObject); + // + /** + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 主数据查询所有字段 + * @Date 9:40 上午 2023/10/18 + **/ + JsonResultEntity queryMdmShowAll(JSONObject jsonObject); + /** + * @Author lvleigang + * @Description 查询模版数据(list 或者 分页) + * @Date 1:33 下午 2023/7/12 + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + **/ + JsonResultEntity queryTemplateData(JSONObject jsonObject); + /** + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 主数据列表显示 业务数据 + * @Date 9:40 上午 2023/10/18 + **/ + JsonResultEntity queryMdmShowData(JSONObject jsonObject); // ///** // * @param jsonObject // * @return com.hzya.frame.web.entity.JsonResultEntity // * @Author lvleigang - // * @Description 主数据列表查询接口列表 + // * @Description 主数据业务数据 // * @Date 9:40 上午 2023/10/18 // **/ - //JsonResultEntity queryMdmList(JSONObject jsonObject); - // - // - ///** - // * @param jsonObject - // * @return com.hzya.frame.web.entity.JsonResultEntity - // * @Author lvleigang - // * @Description 主数据新增 - // * @Date 9:40 上午 2023/10/18 - // **/ - //JsonResultEntity addMdm(JSONObject jsonObject); - // - // - // - ///** - // * @param jsonObject - // * @return com.hzya.frame.web.entity.JsonResultEntity - // * @Author lvleigang - // * @Description 主数据基本信息获取 - // * @Date 9:40 上午 2023/10/18 - // **/ - //JsonResultEntity queryMdmModule(JSONObject jsonObject); - ///** - // * @param jsonObject - // * @return com.hzya.frame.web.entity.JsonResultEntity - // * @Author lvleigang - // * @Description 主数据基本信息修改 - // * @Date 9:40 上午 2023/10/18 - // **/ - //JsonResultEntity doSaveMdmModule(JSONObject jsonObject); - ///** - // * @param jsonObject - // * @return com.hzya.frame.web.entity.JsonResultEntity - // * @Author lvleigang - // * @Description 主数据设置查询数据源 - // * @Date 9:40 上午 2023/10/18 - // **/ - //JsonResultEntity queryMdmModuleDb(JSONObject jsonObject); - //// - ///** - // * @param jsonObject - // * @return com.hzya.frame.web.entity.JsonResultEntity - // * @Author lvleigang - // * @Description 主数据设置查询数据源的服务 - // * @Date 9:40 上午 2023/10/18 - // **/ - //JsonResultEntity queryMdmModuleServer(JSONObject jsonObject); - ///** - // * @param jsonObject - // * @return com.hzya.frame.web.entity.JsonResultEntity - // * @Author lvleigang - // * @Description 主数据设置查询数据源字段的服务 - // * @Date 9:40 上午 2023/10/18 - // **/ - //JsonResultEntity queryMdmModuleServerFiled(JSONObject jsonObject); - // - ///** - // * @param jsonObject - // * @return com.hzya.frame.web.entity.JsonResultEntity - // * @Author lvleigang - // * @Description 主数据设置查询主表字段 - // * @Date 9:40 上午 2023/10/18 - // **/ - //JsonResultEntity queryMdmModuleServerMainFiled(JSONObject jsonObject); - ///** - // * @param jsonObject - // * @return com.hzya.frame.web.entity.JsonResultEntity - // * @Author lvleigang - // * @Description 主数据设置保存数据源 - // * @Date 9:40 上午 2023/10/18 - // **/ - //JsonResultEntity saveMdmModuleDb(JSONObject jsonObject); - // - // - ///** - // * @param jsonObject - // * @return com.hzya.frame.web.entity.JsonResultEntity - // * @Author lvleigang - // * @Description 主数据设置查询显示信息 - // * @Date 9:40 上午 2023/10/18 - // **/ - //JsonResultEntity queryMdmModuleView(JSONObject jsonObject); - // - ///** - // * @param jsonObject - // * @return com.hzya.frame.web.entity.JsonResultEntity - // * @Author lvleigang - // * @Description 主数据设置修改显示信息 - // * @Date 9:40 上午 2023/10/18 - // **/ - //JsonResultEntity doSaveMdmModuleView(JSONObject jsonObject); - //// - /////** - //// * @param jsonObject - //// * @return com.hzya.frame.web.entity.JsonResultEntity - //// * @Author lvleigang - //// * @Description 主数据设置查询权限配置 - //// * @Date 9:40 上午 2023/10/18 - //// **/ - ////JsonResultEntity queryMdmModuleRule(JSONObject jsonObject); - //// - /////** - //// * @param jsonObject - //// * @return com.hzya.frame.web.entity.JsonResultEntity - //// * @Author lvleigang - //// * @Description 主数据设置保存权限配置 - //// * @Date 9:40 上午 2023/10/18 - //// **/ - ////JsonResultEntity doSaveMdmModuleRule(JSONObject jsonObject); - //// - //// - ///** - // * @param jsonObject - // * @return com.hzya.frame.web.entity.JsonResultEntity - // * @Author lvleigang - // * @Description 主数据设置查询分发设置 - // * @Date 9:40 上午 2023/10/18 - // **/ - //JsonResultEntity queryMdmModuleDistribute(JSONObject jsonObject); - ///** - // * @param jsonObject - // * @return com.hzya.frame.web.entity.JsonResultEntity - // * @Author lvleigang - // * @Description 主数据设置保存分发设置 - // * @Date 9:40 上午 2023/10/18 - // **/ - //JsonResultEntity doSaveMdmModuleDistribute(JSONObject jsonObject); - // - ///** - // * @param jsonObject - // * @return com.hzya.frame.web.entity.JsonResultEntity - // * @Author lvleigang - // * @Description 主数据设置查询数据来源 - // * @Date 9:40 上午 2023/10/18 - // **/ - //JsonResultEntity queryMdmModuleSource(JSONObject jsonObject); - ///** - // * @param jsonObject - // * @return com.hzya.frame.web.entity.JsonResultEntity - // * @Author lvleigang - // * @Description 主数据设置保存数据来源 - // * @Date 9:40 上午 2023/10/18 - // **/ - //JsonResultEntity doSaveMdmModuleSource(JSONObject jsonObject); - // - // - ///** - // * @param jsonObject - // * @return com.hzya.frame.web.entity.JsonResultEntity - // * @Author lvleigang - // * @Description 查询下发日志 - // * @Date 11:52 上午 2024/3/27 - // **/ - //JsonResultEntity querySendEntityPage(JSONObject jsonObject); - // - ///** - // * @param jsonObject - // * @return com.hzya.frame.web.entity.JsonResultEntity - // * @Author lvleigang - // * @Description 获取下发日志 - // * @Date 2:36 下午 2024/3/27 - // **/ - //JsonResultEntity getSendEntity(JSONObject jsonObject); - // - ///** - // * @param jsonObject - // * @return com.hzya.frame.web.entity.JsonResultEntity - // * @Author lvleigang - // * @Description 删除下发日志 - // * @Date 2:37 下午 2024/3/27 - // **/ - //JsonResultEntity deleteSendEntity(JSONObject jsonObject); - // - ///** - // * @param jsonObject - // * @return com.hzya.frame.web.entity.JsonResultEntity - // * @Author lvleigang - // * @Description 查询操作日志 - // * @Date 11:52 上午 2024/3/27 - // **/ - //JsonResultEntity queryOptionEntityPage(JSONObject jsonObject); - // - ///** - // * @param jsonObject - // * @return com.hzya.frame.web.entity.JsonResultEntity - // * @Author lvleigang - // * @Description 获取操作日志 - // * @Date 2:36 下午 2024/3/27 - // **/ - //JsonResultEntity getOptionEntity(JSONObject jsonObject); - // - ///** - // * @param jsonObject - // * @return com.hzya.frame.web.entity.JsonResultEntity - // * @Author lvleigang - // * @Description 删除操作日志 - // * @Date 2:37 下午 2024/3/27 - // **/ - //JsonResultEntity deleteOptionEntity(JSONObject jsonObject); - //// - ///** - // * @param jsonObject - // * @return com.hzya.frame.web.entity.JsonResultEntity - // * @Author lvleigang - // * @Description 主数据列表显示 树、查询条件、列表字段、按钮 - // * @Date 9:40 上午 2023/10/18 - // **/ - //JsonResultEntity queryMdmShow(JSONObject jsonObject); - //// - ///** - // * @param jsonObject - // * @return com.hzya.frame.web.entity.JsonResultEntity - // * @Author lvleigang - // * @Description 主数据查询所有字段 - // * @Date 9:40 上午 2023/10/18 - // **/ - //JsonResultEntity queryMdmShowAll(JSONObject jsonObject); - ///** - // * @Author lvleigang - // * @Description 查询模版数据(list 或者 分页) - // * @Date 1:33 下午 2023/7/12 - // * @param jsonObject - // * @return com.hzya.frame.web.entity.JsonResultEntity - // **/ - //JsonResultEntity queryTemplateData(JSONObject jsonObject); - ///** - // * @param jsonObject - // * @return com.hzya.frame.web.entity.JsonResultEntity - // * @Author lvleigang - // * @Description 主数据列表显示 业务数据 - // * @Date 9:40 上午 2023/10/18 - // **/ - //JsonResultEntity queryMdmShowData(JSONObject jsonObject); - //// - /////** - //// * @param jsonObject - //// * @return com.hzya.frame.web.entity.JsonResultEntity - //// * @Author lvleigang - //// * @Description 主数据业务数据 - //// * @Date 9:40 上午 2023/10/18 - //// **/ - ////JsonResultEntity queryMdmShowDistribute(JSONObject jsonObject); + //JsonResultEntity queryMdmShowDistribute(JSONObject jsonObject); + /** + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 主数据业务数据树结构 + * @Date 9:40 上午 2023/10/18 + **/ + JsonResultEntity queryMdmShowTreeData(JSONObject jsonObject); ///** // * @param jsonObject // * @return com.hzya.frame.web.entity.JsonResultEntity @@ -273,67 +65,59 @@ public interface IMdmService { // * @Description 主数据业务数据树结构 // * @Date 9:40 上午 2023/10/18 // **/ - //JsonResultEntity queryMdmShowTreeData(JSONObject jsonObject); - /////** - //// * @param jsonObject - //// * @return com.hzya.frame.web.entity.JsonResultEntity - //// * @Author lvleigang - //// * @Description 主数据业务数据树结构 - //// * @Date 9:40 上午 2023/10/18 - //// **/ - ////JsonResultEntity queryMdmOptionData(JSONObject jsonObject); - //// - ///** - // * @param jsonObject - // * @return com.hzya.frame.web.entity.JsonResultEntity - // * @Author lvleigang - // * @Description 主数据详情 区分类型 新增、修改、查看 - // * @Date 9:40 上午 2023/10/18 - // **/ - //JsonResultEntity queryMdmShowDetails(JSONObject jsonObject); - //// - ///** - // * @param jsonObject - // * @return com.hzya.frame.web.entity.JsonResultEntity - // * @Author lvleigang - // * @Description 主数据详情数据 区分类型 新增、修改、查看 - // * @Date 9:40 上午 2023/10/18 - // **/ - //JsonResultEntity queryMdmShowDetailsData(JSONObject jsonObject); - //// - ///** - // * @param jsonObject - // * @return com.hzya.frame.web.entity.JsonResultEntity - // * @Author lvleigang - // * @Description 主数据详情数据修改 - // * @Date 9:40 上午 2023/10/18 - // **/ - //JsonResultEntity updateMdmShowDetailsData(JSONObject jsonObject); - ///** - // * @param jsonObject - // * @return com.hzya.frame.web.entity.JsonResultEntity - // * @Author lvleigang - // * @Description 主数据详情数据新增 - // * @Date 9:40 上午 2023/10/18 - // **/ - //JsonResultEntity saveMdmShowDetailsData(JSONObject jsonObject); + //JsonResultEntity queryMdmOptionData(JSONObject jsonObject); // + /** + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 主数据详情 区分类型 新增、修改、查看 + * @Date 9:40 上午 2023/10/18 + **/ + JsonResultEntity queryMdmShowDetails(JSONObject jsonObject); + // + /** + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 主数据详情数据 区分类型 新增、修改、查看 + * @Date 9:40 上午 2023/10/18 + **/ + JsonResultEntity queryMdmShowDetailsData(JSONObject jsonObject); + // + /** + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 主数据详情数据修改 + * @Date 9:40 上午 2023/10/18 + **/ + JsonResultEntity updateMdmShowDetailsData(JSONObject jsonObject); + /** + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 主数据详情数据新增 + * @Date 9:40 上午 2023/10/18 + **/ + JsonResultEntity saveMdmShowDetailsData(JSONObject jsonObject); + + /** + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 主数据删除业务数据 + * @Date 9:40 上午 2023/10/18 + **/ + JsonResultEntity deleteMdmShowDetailsData(JSONObject jsonObject); ///** // * @param jsonObject // * @return com.hzya.frame.web.entity.JsonResultEntity // * @Author lvleigang - // * @Description 主数据删除业务数据 + // * @Description 处理分发数据 // * @Date 9:40 上午 2023/10/18 // **/ - //JsonResultEntity deleteMdmShowDetailsData(JSONObject jsonObject); - /////** - //// * @param jsonObject - //// * @return com.hzya.frame.web.entity.JsonResultEntity - //// * @Author lvleigang - //// * @Description 处理分发数据 - //// * @Date 9:40 上午 2023/10/18 - //// **/ - ////JsonResultEntity doMdmDistribute(JSONObject jsonObject); - // + //JsonResultEntity doMdmDistribute(JSONObject jsonObject); + } 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 30556520..73c99cc4 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 @@ -41,6 +41,7 @@ import com.hzya.frame.mdm.mdmModuleViewButton.dao.IMdmModuleViewButtonDao; import com.hzya.frame.mdm.mdmModuleViewButton.entity.MdmModuleViewButtonEntity; import com.hzya.frame.mdm.mdmModuleViewDetail.dao.IMdmModuleViewDetailDao; import com.hzya.frame.mdm.mdmModuleViewDetail.entity.MdmModuleViewDetailEntity; +import com.hzya.frame.mdm.mdmTableCodeRule.dao.IMdmTableCodeRuleDao; import com.hzya.frame.mdm.mdmTableCodeRule.entity.MdmTableCodeRuleEntity; import com.hzya.frame.mdm.service.IMdmService; @@ -78,2767 +79,446 @@ import java.util.Map; @Service(value = "mdmService") public class MdmServiceImpl implements IMdmService { private final Logger logger = LoggerFactory.getLogger(this.getClass()); + + @Resource + private IMdmModuleDao mdmModuleDao; + @Resource + private IMdmModuleSendLogDao mdmModuleSendLogDao; + @Resource + private IMdmModuleOptionLogDao mdmModuleOptionLogDao; + @Resource + private IMdmServiceCache mdmServiceCache; + @Resource + private ISysMenuConfigDao sysMenuConfigDao; + @Resource + private ISysButtonConfigDao sysButtonConfigDao; + @Resource + private ISysPopedomOperateDao sysPopedomOperateDao; + @Resource + private IMdmModuleDbDao mdmModuleDbDao; + @Resource + private IMdmModuleDbFiledsDao mdmModuleDbFiledsDao; + @Resource + private IMdmModuleDbFiledsRuleDao mdmModuleDbFiledsRuleDao; + @Resource + private IMdmTableCodeRuleDao mdmTableCodeRuleDao; + @Resource + private IMdmModuleDistributeDao mdmModuleDistributeDao; + @Resource + private IMdmModuleDistributeDetailDao mdmModuleDistributeDetailDao; + @Resource + private IMdmModuleViewDao mdmModuleViewDao; + @Resource + private IMdmModuleViewButtonDao mdmModuleViewButtonDao; + @Resource + private IMdmModuleViewDetailDao mdmModuleViewDetailDao; + + + /** + * @param object + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 主数据列表显示 树、查询条件、列表字段、按钮 + * @Date 9:40 上午 2023/10/18 + **/ + @Override + public JsonResultEntity queryMdmShow(JSONObject object) { + MdmDto entity = getData("jsonStr", object, MdmDto.class); + if (entity == null) { + return BaseResult.getFailureMessageEntity("参数不允许为空"); + } + if (entity.getMdmCode() == null || "".equals(entity.getMdmCode())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + //查询模版 + MdmModuleEntity mdmModuleEntity = mdmServiceCache.getMdmModuleEntity(entity.getMdmCode()); + if(mdmModuleEntity == null || mdmModuleEntity.getId() == null){ + return BaseResult.getFailureMessageEntity("系统错误"); + } + + //设置模版 + MdmViewVo mdmViewVo = new MdmViewVo(); + mdmViewVo.setMdmModuleEntity(mdmModuleEntity); + //查询展示类型 + MdmModuleViewEntity mdmModuleViewEntity = new MdmModuleViewEntity(); + mdmModuleViewEntity.setMdmId(mdmModuleEntity.getId()); + mdmModuleViewEntity.setSts("Y"); + List moduleViewEntityList = mdmModuleViewDao.queryBase(mdmModuleViewEntity); + if (moduleViewEntityList == null || moduleViewEntityList.size() != 1) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + mdmModuleViewEntity = moduleViewEntityList.get(0); + mdmViewVo.setMdmModuleViewEntity(mdmModuleViewEntity); + + //查询数据源主表 + MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); + mdmModuleDbEntity.setMdmId(mdmModuleEntity.getId()); + mdmModuleDbEntity.setSts("Y"); + List mdmModuleDbEntityList = mdmServiceCache.queryMdmModuleDb(mdmModuleDbEntity); + if (mdmModuleDbEntityList == null || mdmModuleDbEntityList.size() == 0) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + //查询数据源表下面的字段 + MdmModuleDbFiledsEntity mdmModuleDbFiledsEntity = new MdmModuleDbFiledsEntity(); + mdmModuleDbFiledsEntity.setMdmId(mdmModuleEntity.getId()); + mdmModuleDbFiledsEntity.setSts("Y"); + List mdmModuleDbFiledsEntityList = mdmServiceCache.queryMdmModuleDbFileds(mdmModuleDbFiledsEntity); + if (mdmModuleDbFiledsEntityList == null || mdmModuleDbFiledsEntityList.size() == 0) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + //查询字段下的规则 + MdmModuleDbFiledsRuleEntity mdmModuleDbFiledsRuleEntity = new MdmModuleDbFiledsRuleEntity(); + mdmModuleDbFiledsRuleEntity.setMdmId(mdmModuleEntity.getId()); + mdmModuleDbFiledsRuleEntity.setSts("Y"); + List mdmModuleDbFiledsRuleEntityList = mdmModuleDbFiledsRuleDao.queryBase(mdmModuleDbFiledsRuleEntity); + if (mdmModuleDbFiledsRuleEntityList == null || mdmModuleDbFiledsRuleEntityList.size() == 0) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + + //查询设置的查询字段 + MdmModuleViewDetailEntity mdmModuleViewDetailEntity = new MdmModuleViewDetailEntity(); + mdmModuleViewDetailEntity.setMdmId(mdmModuleEntity.getId()); + mdmModuleViewDetailEntity.setSts("Y"); + List mdmModuleViewDetailEntities = mdmModuleViewDetailDao.queryBase(mdmModuleViewDetailEntity); + if (mdmModuleViewDetailEntities == null || mdmModuleViewDetailEntities.size() == 0) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + List queryList = getFiledByType("1",mdmModuleViewDetailEntities,mdmModuleDbEntityList,mdmModuleDbFiledsEntityList,mdmModuleDbFiledsRuleEntityList); + mdmViewVo.setQueryList(queryList); + List listList = getFiledByType("2",mdmModuleViewDetailEntities,mdmModuleDbEntityList,mdmModuleDbFiledsEntityList,mdmModuleDbFiledsRuleEntityList); + mdmViewVo.setListList(listList); + return BaseResult.getSuccessMessageEntity("获取字段成功", mdmViewVo); + } + + /** + * @Author lvleigang + * @Description 根据类型获取字段 + * @Date 9:18 上午 2024/6/6 + * @param viewType 类型 + * @param mdmModuleViewDetailEntities 显示设置的字段 + * @param mdmModuleDbEntityList 表 + * @param mdmModuleDbFiledsEntityList 表字段 + * @param mdmModuleDbFiledsRuleEntityList 字段规则 + * @return java.util.List + **/ + private List getFiledByType(String viewType, List mdmModuleViewDetailEntities, List mdmModuleDbEntityList, List mdmModuleDbFiledsEntityList, List mdmModuleDbFiledsRuleEntityList) { + List mdmViewFiledVos = new ArrayList<>(); + if(mdmModuleViewDetailEntities != null && mdmModuleViewDetailEntities.size() > 0){ + for (int i = 0; i < mdmModuleViewDetailEntities.size(); i++) { + if(viewType.equals(mdmModuleViewDetailEntities.get(i).getViewType())){ + //类型一致 + MdmViewFiledVo mdmViewFiledVo = new MdmViewFiledVo(); + mdmViewFiledVo.setId(mdmModuleViewDetailEntities.get(i).getViewFiled()); + for (int i1 = 0; i1 < mdmModuleDbFiledsEntityList.size(); i1++) { + if(mdmModuleDbFiledsEntityList.get(i1).getId().equals(mdmModuleViewDetailEntities.get(i).getViewFiled())){ + for (int i2 = 0; i2 < mdmModuleDbEntityList.size(); i2++) { + if(mdmModuleDbEntityList.get(i2).getId().equals(mdmModuleDbFiledsEntityList.get(i1).getDbId())){ + mdmViewFiledVo.setDbName(mdmModuleDbEntityList.get(i2).getDbName()); + mdmViewFiledVo.setDbType(mdmModuleDbEntityList.get(i2).getDbType()); + mdmViewFiledVo.setMdmId(mdmModuleDbEntityList.get(i2).getMdmId()); + mdmViewFiledVo.setDbId(mdmModuleDbEntityList.get(i2).getId()); + + break; + } + } + mdmViewFiledVo.setChName(mdmModuleDbFiledsEntityList.get(i1).getChName()); + mdmViewFiledVo.setEnName(mdmModuleDbFiledsEntityList.get(i1).getEnName()); + mdmViewFiledVo.setFiledType(mdmModuleDbFiledsEntityList.get(i1).getFiledType()); + //字段规则 + if(mdmModuleDbFiledsRuleEntityList != null && mdmModuleDbFiledsRuleEntityList.size() > 0){ + List ruleList = new ArrayList<>(); + for (int i2 = 0; i2 < mdmModuleDbFiledsRuleEntityList.size(); i2++) { + if(mdmModuleDbFiledsEntityList.get(i1).getId().equals(mdmModuleDbFiledsRuleEntityList.get(i2).getFiledId())){ + ruleList.add(mdmModuleDbFiledsRuleEntityList.get(i2)); + } + } + mdmViewFiledVo.setRuleList(ruleList); + } + break; + } + } + } + } + } + if(mdmViewFiledVos != null && mdmViewFiledVos.size() > 0){ + for (int i = 0; i < mdmViewFiledVos.size(); i++) { + mdmViewFiledVos.get(i).setSorts(i); + } + } + return mdmViewFiledVos; + } // - //@Resource - //private IMdmModuleDao mdmModuleDao; - //@Resource - //private IMdmModuleSendLogDao mdmModuleSendLogDao; - //@Resource - //private IMdmModuleOptionLogDao mdmModuleOptionLogDao; - //@Resource - //private IMdmServiceCache mdmServiceCache; - //@Resource - //private ISysMenuConfigDao sysMenuConfigDao; - //@Resource - //private ISysButtonConfigDao sysButtonConfigDao; - //@Resource - //private ISysPopedomOperateDao sysPopedomOperateDao; - //@Resource - //private IMdmModuleDbDao mdmModuleDbDao; - //@Resource - //private IMdmModuleDbFiledsDao mdmModuleDbFiledsDao; - //@Resource - //private IMdmModuleDbFiledsRuleDao mdmModuleDbFiledsRuleDao; - //@Resource - //private IMdmModuleDistributeDao mdmModuleDistributeDao; - //@Resource - //private IMdmModuleDistributeDetailDao mdmModuleDistributeDetailDao; - //@Resource - //private IMdmModuleViewDao mdmModuleViewDao; - //@Resource - //private IMdmModuleViewButtonDao mdmModuleViewButtonDao; - //@Resource - //private IMdmModuleViewDetailDao mdmModuleViewDetailDao; + /** + * @param object + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 主数据查询所有字段 + * @Date 9:40 上午 2023/10/18 + **/ + @Override + public JsonResultEntity queryMdmShowAll(JSONObject object) { + MdmDto entity = getData("jsonStr", object, MdmDto.class); + if (entity == null) { + return BaseResult.getFailureMessageEntity("参数不允许为空"); + } + if (entity.getMdmCode() == null || "".equals(entity.getMdmCode())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + //查询设置各种类型字段 + MdmModuleEntity mdmModuleEntity = mdmServiceCache.getMdmModuleEntity(entity.getMdmCode()); + //查询模版数据源 + MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); + mdmModuleDbEntity.setMdmId(mdmModuleEntity.getId()); + mdmModuleDbEntity.setSts("Y"); + List mdmModuleDbEntityList = mdmServiceCache.queryMdmModuleDb(mdmModuleDbEntity); + List listFiled = new ArrayList<>(); + if (mdmModuleDbEntityList != null && mdmModuleDbEntityList.size() > 0) { + MdmModuleDbFiledsEntity mdmModuleDbFiledsEntity = new MdmModuleDbFiledsEntity(); + mdmModuleDbFiledsEntity.setMdmId(mdmModuleEntity.getId()); + mdmModuleDbFiledsEntity.setSts("Y"); + List mdmModuleDbFiledsEntityList = mdmServiceCache.queryMdmModuleDbFileds(mdmModuleDbFiledsEntity); + // + if (mdmModuleDbEntityList != null && mdmModuleDbEntityList.size() > 0) { + for (int i = 0; i < mdmModuleDbEntityList.size(); i++) { + if("1".equals(mdmModuleDbEntityList.get(i).getDbType()) || "2".equals(mdmModuleDbEntityList.get(i).getDbType())){ + if (mdmModuleDbFiledsEntityList != null && mdmModuleDbFiledsEntityList.size() > 0) { + for (int i1 = 0; i1 < mdmModuleDbFiledsEntityList.size(); i1++) { + if (mdmModuleDbEntityList.get(i).getId().equals(mdmModuleDbFiledsEntityList.get(i1).getDbId())) { + if ("1".equals(mdmModuleDbEntityList.get(i).getDbType())) { + //1、主表 + listFiled.add(new MdmDbFiledVo(mdmModuleDbFiledsEntityList.get(i1).getId(), "【主表:" + mdmModuleDbEntityList.get(i).getDbName() + "】" + mdmModuleDbFiledsEntityList.get(i1).getChName())); + } else { + //2、明细 + listFiled.add(new MdmDbFiledVo(mdmModuleDbFiledsEntityList.get(i1).getId(), "【子表:" + mdmModuleDbEntityList.get(i).getDbName() + "】" + mdmModuleDbFiledsEntityList.get(i1).getChName())); + } + } + } + } + } + } + } + } + return BaseResult.getSuccessMessageEntity("查询视图成功", listFiled); + } // ///** - // * @param object - // * @return com.hzya.frame.web.entity.JsonResultEntity + // * @param mdmModuleRoleButtonEntities + // * @return java.util.List // * @Author lvleigang - // * @Description 主数据列表查询接口分页 - // * @Date 9:40 上午 2023/10/18 + // * @Description 设置返回按钮 + // * @Date 4:48 下午 2023/10/26 // **/ - //@Override - //public JsonResultEntity queryMdmPage(JSONObject object) { - // MdmModuleEntity entity = getData("jsonStr", object, MdmModuleEntity.class); - // //判断分页 - // if (entity == null || entity.getPageNum() == null || entity.getPageSize() == null) { - // return BaseResult.getFailureMessageEntity("分页查询参数不存在"); + //private List setButton(List mdmModuleRoleButtonEntities) { + // List mdmViewButtonVoList = new ArrayList<>(); + // if (mdmModuleRoleButtonEntities != null && mdmModuleRoleButtonEntities.size() > 0) { + // for (int i = 0; i < mdmModuleRoleButtonEntities.size(); i++) { + // mdmViewButtonVoList.add(new MdmViewButtonVo(mdmModuleRoleButtonEntities.get(i).getButtonType(), mdmModuleRoleButtonEntities.get(i).getButtonName())); + // } // } - // PageHelper.startPage(entity.getPageNum(), entity.getPageSize()); - // List mdmVos = mdmModuleDao.queryMdm(entity); - // PageInfo pageInfo = new PageInfo(mdmVos); - // return BaseResult.getSuccessMessageEntity("查询数据成功", pageInfo); + // return mdmViewButtonVoList; //} // ///** - // * @param object - // * @return com.hzya.frame.web.entity.JsonResultEntity + // * @param allRecords + // * @param checkedMeters + // * @return java.util.List // * @Author lvleigang - // * @Description 主数据列表查询接口列表 - // * @Date 9:40 上午 2023/10/18 + // * @Description 取出重复字段数据 + // * @Date 4:34 下午 2023/10/26 // **/ - //@Override - //public JsonResultEntity queryMdmList(JSONObject object) { - // MdmModuleEntity entity = getData("jsonStr", object, MdmModuleEntity.class); - // List mdmVos = mdmModuleDao.queryMdm(entity); - // return BaseResult.getSuccessMessageEntity("查询数据成功", mdmVos); + //private List getDolist(List allRecords, List checkedMeters) { + // List meterPlan = allRecords.stream() + // .filter(item -> checkedMeters.stream() + // .map(e -> { + // if (!Objects.equals(item.getViewFiled(), e.getViewDetailId())) { + // return null; + // } else { + // return item.getViewFiled(); + // } + // }) + // .collect(Collectors.toList()) + // .contains(item.getViewFiled())) + // .collect(Collectors.toList()); + // return meterPlan; //} // ///** - // * @param object - // * @return com.hzya.frame.web.entity.JsonResultEntity + // * @param mdmModuleDbEntityList 数据源 + // * @param mdmModuleDbFiledsEntityList 数据源下的字段表 + // * @param mdmModuleDbFiledsRuleEntityList 数据源字段的规则表 + // * @param queryList 需要的字段 + // * @return java.util.List // * @Author lvleigang - // * @Description 主数据新增 - // * @Date 9:40 上午 2023/10/18 + // * @Description 根据字段设置返回前台字段 + // * @Date 4:11 下午 2023/10/26 // **/ - //@Override - //public JsonResultEntity addMdm(JSONObject object) { - // MdmModuleEntity entity = getData("jsonStr", object, MdmModuleEntity.class); - // if (entity == null) { - // return BaseResult.getFailureMessageEntity("参数不允许为空"); - // } - // if (entity.getMdmName() == null || "".equals(entity.getMdmName())) { - // return BaseResult.getFailureMessageEntity("请先输入主数据名称"); - // } - // if (entity.getMdmType() == null || "".equals(entity.getMdmType())) { - // return BaseResult.getFailureMessageEntity("请先选择主数据类型"); - // } - // //新增 - // entity.setCreate(); - // mdmModuleDao.save(entity); - // return BaseResult.getSuccessMessageEntity("保存数据成功", entity); - //} + //private List setQueryList(List mdmModuleDbEntityList, List mdmModuleDbFiledsEntityList, List mdmModuleDbFiledsRuleEntityList, List queryList, boolean flag) { + // List mdmViewFiledVos = new ArrayList<>(); // - ///** - // * @param object - // * @return com.hzya.frame.web.entity.JsonResultEntity - // * @Author lvleigang - // * @Description 主数据基本信息获取 - // * @Date 9:40 上午 2023/10/18 - // **/ - //@Override - //public JsonResultEntity queryMdmModule(JSONObject object) { - // MdmModuleEntity entity = getData("jsonStr", object, MdmModuleEntity.class); - // if (entity == null) { - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // if (entity.getMdmCode() == null || "".equals(entity.getMdmCode())) { - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // //使用缓存 - // MdmModuleEntity mdmModuleEntity = mdmServiceCache.getMdmModuleEntity(entity.getMdmCode()); - // return BaseResult.getSuccessMessageEntity("查询数据成功", mdmModuleEntity); - //} + // if (queryList != null && queryList.size() > 0) { + // for (int i = 0; i < queryList.size(); i++) { + // MdmViewFiledVo mdmViewFiledVo = new MdmViewFiledVo(); + // mdmViewFiledVo.setId(queryList.get(i).getViewFiled());//字段id + // mdmViewFiledVo.setSorts(i + 2);//排序 + // for (int i1 = 0; i1 < mdmModuleDbFiledsEntityList.size(); i1++) { + // if (queryList.get(i).getViewFiled().equals(mdmModuleDbFiledsEntityList.get(i1).getId())) { + // mdmViewFiledVo.setFiledType(mdmModuleDbFiledsEntityList.get(i1).getFiledType());//英文名 + // mdmViewFiledVo.setEnName(mdmModuleDbFiledsEntityList.get(i1).getEnName());//英文名 + // mdmViewFiledVo.setChName(mdmModuleDbFiledsEntityList.get(i1).getChName());//中文名 + // for (int i2 = 0; i2 < mdmModuleDbEntityList.size(); i2++) { + // if (mdmModuleDbFiledsEntityList.get(i1).getDbId().equals(mdmModuleDbEntityList.get(i2).getId())) { + // mdmViewFiledVo.setDbType(mdmModuleDbEntityList.get(i2).getDbType());//类型 1、主表 2、明细 + // mdmViewFiledVo.setMdmId(mdmModuleDbEntityList.get(i2).getMdmId());//主数据模版ID + // mdmViewFiledVo.setDbId(mdmModuleDbEntityList.get(i2).getId());//模版数据库id + // mdmViewFiledVo.setDbName(mdmModuleDbEntityList.get(i2).getDbName());//表名 // - ///** - // * @param object - // * @return com.hzya.frame.web.entity.JsonResultEntity - // * @Author lvleigang - // * @Description 主数据基本信息保存 - // * @Date 9:40 上午 2023/10/18 - // **/ - //@Override - //public JsonResultEntity doSaveMdmModule(JSONObject object) { - // MdmModuleEntity entity = getData("jsonStr", object, MdmModuleEntity.class); - // if (entity == null) { - // return BaseResult.getFailureMessageEntity("参数不允许为空"); + // break; + // } + // } + // break; + // } + // } + // //设置字段规则 + // List ruleList = new ArrayList<>(); + // if (mdmModuleDbFiledsRuleEntityList != null && mdmModuleDbFiledsRuleEntityList.size() > 0) { + // for (int i1 = 0; i1 < mdmModuleDbFiledsRuleEntityList.size(); i1++) { + // if (queryList.get(i).getViewFiled().equals(mdmModuleDbFiledsRuleEntityList.get(i1).getFiledId())) { + // ruleList.add(mdmModuleDbFiledsRuleEntityList.get(i1)); + // } + // } + // } + // mdmViewFiledVo.setRuleList(ruleList); + // mdmViewFiledVos.add(mdmViewFiledVo); + // } // } - // if (entity.getMdmName() == null || "".equals(entity.getMdmName())) { - // return BaseResult.getFailureMessageEntity("请先输入主数据名称"); - // } - // if (entity.getMdmCode() == null || "".equals(entity.getMdmCode())) { - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // MdmModuleEntity mdmModuleEntity = mdmServiceCache.getMdmModuleEntity(entity.getMdmCode()); - // if(mdmModuleEntity == null ){ - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // entity.setId(mdmModuleEntity.getId()); - // //修改 - // entity.setUpdate(); - // mdmServiceCache.updateMdmModuleEntity(entity); - // return BaseResult.getSuccessMessageEntity("修改主数据成功", entity); - //} - // - ///** - // * @param object - // * @return com.hzya.frame.web.entity.JsonResultEntity - // * @Author lvleigang - // * @Description 主数据设置查询数据源 - // * @Date 9:40 上午 2023/10/18 - // **/ - //@Override - //public JsonResultEntity queryMdmModuleDb(JSONObject object) { - // MdmModuleEntity entity = getData("jsonStr", object, MdmModuleEntity.class); - // //判断分页 - // if (entity == null) { - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // if (entity.getMdmCode() == null || "".equals(entity.getMdmCode())) { - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // MdmDbVo mdmDbVo = new MdmDbVo(); - // //获取主数据 - // MdmModuleEntity mdmModuleEntity = mdmServiceCache.getMdmModuleEntity(entity.getMdmCode()); - // //查询设置的规则表 - // MdmTableCodeRuleEntity mdmTableCodeRuleEntity = new MdmTableCodeRuleEntity(); - // mdmTableCodeRuleEntity.setSts("Y"); - // mdmTableCodeRuleEntity.setMdmId(mdmModuleEntity.getId()); - // List mdmTableCodeRuleEntityList = mdmServiceCache.queryMdmTableCodeRuleEntity(mdmTableCodeRuleEntity); - // mdmDbVo.setMdmTableCodeRuleEntityList(mdmTableCodeRuleEntityList); - // //查询数据源表 - // MdmModuleDbEntity queryDb = new MdmModuleDbEntity(); - // queryDb.setMdmId(mdmModuleEntity.getId()); - // queryDb.setSts("Y"); - // List mdmModuleDbEntityList = mdmServiceCache.queryMdmModuleDb(queryDb); - // //数据源字段 - // MdmModuleDbFiledsEntity queryDbFiled = new MdmModuleDbFiledsEntity(); - // queryDbFiled.setMdmId(mdmModuleEntity.getId()); - // queryDbFiled.setSts("Y"); - // List mdmModuleDbFiledsEntityList = mdmServiceCache.queryMdmModuleDbFileds(queryDbFiled); - // //数据源字段规则 - // MdmModuleDbFiledsRuleEntity queryDbFiledRule = new MdmModuleDbFiledsRuleEntity(); - // queryDbFiledRule.setMdmId(mdmModuleEntity.getId()); - // queryDbFiledRule.setSts("Y"); - // List mdmModuleDbFiledsRuleEntityList = mdmServiceCache.queryMdmModuleDbFiledsRule(queryDbFiledRule); - // //组装数据 - // setMdmDb(mdmDbVo, mdmModuleDbEntityList, mdmModuleDbFiledsEntityList, mdmModuleDbFiledsRuleEntityList); - // return BaseResult.getSuccessMessageEntity("查询数据成功", mdmDbVo); - //} - ///** - // * @param mdmDbVo 返回对象 - // * @param mdmModuleDbEntityList 数据表 - // * @param mdmModuleDbFiledsEntityList 字段 - // * @param mdmModuleDbFiledsRuleEntityList 字段属性 - // * @return void - // * @Author lvleigang - // * @Description 组装返回数据 - // * @Date 4:51 下午 2023/10/18 - // **/ - //private void setMdmDb(MdmDbVo mdmDbVo, List mdmModuleDbEntityList, List mdmModuleDbFiledsEntityList, List mdmModuleDbFiledsRuleEntityList) { - // //主数据主表 - // MdmModuleDbEntity mainMdmModuleDb = new MdmModuleDbEntity(); - // //主数据子表 - // List sublistMdmModuleDb = new ArrayList<>(); - // //主数据主表字段 - // List mainMdmModuleDbFileds = new ArrayList<>(); - // - // + // MdmViewFiledVo mdmViewFiledVo = new MdmViewFiledVo(); + // mdmViewFiledVo.setSorts(1);//排序 + // mdmViewFiledVo.setFiledType("3"); + // mdmViewFiledVo.setEnName("document_rule");//英文名 + // mdmViewFiledVo.setChName("单据编码");//中文名 + // mdmViewFiledVo.setDbType("1");//类型 1、主表 2、明细 // if (mdmModuleDbEntityList != null && mdmModuleDbEntityList.size() > 0) { // for (int i = 0; i < mdmModuleDbEntityList.size(); i++) { // if ("1".equals(mdmModuleDbEntityList.get(i).getDbType())) { - // //1、主表 2、明细 - // mainMdmModuleDb = mdmModuleDbEntityList.get(i); - // //循环字段表 - // if (mdmModuleDbFiledsEntityList != null && mdmModuleDbFiledsEntityList.size() > 0) { - // for (int i1 = 0; i1 < mdmModuleDbFiledsEntityList.size(); i1++) { - // if (mdmModuleDbEntityList.get(i).getId().equals(mdmModuleDbFiledsEntityList.get(i1).getDbId())) { - // mainMdmModuleDbFileds.add(mdmModuleDbFiledsEntityList.get(i1)); - // List mdmModuleDbFiledsRules = new ArrayList<>(); - // //循环字段属性 - // if (mdmModuleDbFiledsRuleEntityList != null && mdmModuleDbFiledsRuleEntityList.size() > 0) { - // for (int i2 = 0; i2 < mdmModuleDbFiledsRuleEntityList.size(); i2++) { - // if (mdmModuleDbFiledsEntityList.get(i1).getDbId().equals(mdmModuleDbFiledsRuleEntityList.get(i2).getDbId()) - // && mdmModuleDbFiledsEntityList.get(i1).getId().equals(mdmModuleDbFiledsRuleEntityList.get(i2).getFiledId())) { - // mdmModuleDbFiledsRules.add(mdmModuleDbFiledsRuleEntityList.get(i2)); - // } - // } - // } - // mdmModuleDbFiledsEntityList.get(i1).setMdmModuleDbFiledsRules(mdmModuleDbFiledsRules); - // } - // } - // } - // } else if ("2".equals(mdmModuleDbEntityList.get(i).getDbType())) { - // //2、明细 - // sublistMdmModuleDb.add(mdmModuleDbEntityList.get(i)); - // //循环字段表 - // if (mdmModuleDbFiledsEntityList != null && mdmModuleDbFiledsEntityList.size() > 0) { - // List sublistMdmModuleDbFileds = new ArrayList<>(); - // for (int i1 = 0; i1 < mdmModuleDbFiledsEntityList.size(); i1++) { - // if (mdmModuleDbEntityList.get(i).getId().equals(mdmModuleDbFiledsEntityList.get(i1).getDbId())) { - // sublistMdmModuleDbFileds.add(mdmModuleDbFiledsEntityList.get(i1)); - // List mdmModuleDbFiledsRules = new ArrayList<>(); - // //循环字段属性 - // if (mdmModuleDbFiledsRuleEntityList != null && mdmModuleDbFiledsRuleEntityList.size() > 0) { - // for (int i2 = 0; i2 < mdmModuleDbFiledsRuleEntityList.size(); i2++) { - // if (mdmModuleDbFiledsEntityList.get(i1).getDbId().equals(mdmModuleDbFiledsRuleEntityList.get(i2).getDbId()) - // && mdmModuleDbFiledsEntityList.get(i1).getId().equals(mdmModuleDbFiledsRuleEntityList.get(i2).getFiledId())) { - // mdmModuleDbFiledsRules.add(mdmModuleDbFiledsRuleEntityList.get(i2)); - // } - // } - // } - // mdmModuleDbFiledsEntityList.get(i1).setMdmModuleDbFiledsRules(mdmModuleDbFiledsRules); - // } - // } - // mdmModuleDbEntityList.get(i).setSublistMdmModuleDbFileds(sublistMdmModuleDbFileds); - // } + // mdmViewFiledVo.setDbName(mdmModuleDbEntityList.get(i).getDbName());//表名 // } // } // } - // mainMdmModuleDb.setSublistMdmModuleDbFileds(mainMdmModuleDbFileds); - // mdmDbVo.setMainMdmModuleDb(mainMdmModuleDb); - // mdmDbVo.setSublistMdmModuleDb(sublistMdmModuleDb); - //} - // - ///** - // * @param object - // * @return com.hzya.frame.web.entity.JsonResultEntity - // * @Author lvleigang - // * @Description 主数据设置保存数据源 - // * @Date 9:40 上午 2023/10/18 - // **/ - //@Override - //public JsonResultEntity saveMdmModuleDb(JSONObject object) { - // //判断新增还是修改,保存数据生成表结构 - // MdmDto entity = getData("jsonStr", object, MdmDto.class); - // if (entity == null) { - // return BaseResult.getFailureMessageEntity("参数不允许为空"); - // } - // if (entity.getMdmCode() == null || "".equals(entity.getMdmCode())) { - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // //单据规则校验 - // if(entity.getMdmTableCodeRuleEntityList() == null || entity.getMdmTableCodeRuleEntityList().size() == 0){ - // return BaseResult.getFailureMessageEntity("请先设置单据规则"); - // } - // //主表校验 - // if (entity.getMainMdmModuleDb() == null || entity.getMainMdmModuleDb().getDbName() == null || "".equals(entity.getMainMdmModuleDb().getDbName())) { - // return BaseResult.getFailureMessageEntity("请先输入主表名称"); - // } - // MdmModuleEntity mdmModuleEntity = mdmServiceCache.getMdmModuleEntity(entity.getMdmCode()); - // //主数据主表 - // MdmModuleDbEntity mainMdmModuleDb = entity.getMainMdmModuleDb(); - // //主数据主表字段 - // List mainMdmModuleDbFileds = mainMdmModuleDb.getSublistMdmModuleDbFileds(); - // //主数据子表 - // List sublistMdmModuleDb = entity.getSublistMdmModuleDb(); - // //单据规则 - // List mdmTableCodeRuleEntities = entity.getMdmTableCodeRuleEntityList(); - // // 需要校验表是否存在 - // if (checkTable(mainMdmModuleDb.getDbName())) { - // return BaseResult.getFailureMessageEntity("主表表名已经存在"); - // } - // if(mainMdmModuleDbFileds == null || mainMdmModuleDbFileds.size() == 0){ - // return BaseResult.getFailureMessageEntity("请先设置主表字段"); - // } - // //判断明细表 - // if (sublistMdmModuleDb != null && sublistMdmModuleDb.size() > 0) { - // for (int i = 0; i < sublistMdmModuleDb.size(); i++) { - // // 需要校验表是否存在 - // if (checkTable(sublistMdmModuleDb.get(i).getDbName())) { - // return BaseResult.getFailureMessageEntity("子表" + sublistMdmModuleDb.get(i).getDbName() + "已经存在"); - // } - // if (sublistMdmModuleDb.get(i).getSublistMdmModuleDbFileds() == null && sublistMdmModuleDb.get(i).getSublistMdmModuleDbFileds().size() == 0) { - // return BaseResult.getFailureMessageEntity("请先设置子表" + sublistMdmModuleDb.get(i).getDbName() + "的字段"); - // } - // - // } - // } - // //处理数据 - // //分别设置成 数据源 数据源字段 数据源规则表 设置是否新增修改 没有id新增,有ID修改 - // List mdmModuleDbEntities = new ArrayList<>(); - // List mdmModuleDbFiledsEntities = new ArrayList<>(); - // List mdmModuleDbFiledsRuleEntities = new ArrayList<>(); - // - // //主表 - // if(mainMdmModuleDb.getId() != null && !"".equals(mainMdmModuleDb.getId())){ - // //修改 - // mainMdmModuleDb.setDataType("2"); - // mainMdmModuleDb.setUpdate(); - // }else { - // //新增 - // mainMdmModuleDb.setDataType("1"); - // mainMdmModuleDb.setMdmId(mdmModuleEntity.getId()); - // mainMdmModuleDb.setCreate(); - // } - // mainMdmModuleDb.setDbType("1"); - // mdmModuleDbEntities.add(mainMdmModuleDb); - // for (int i = 0; i < mdmTableCodeRuleEntities.size(); i++) { - // mdmTableCodeRuleEntities.get(i).setMdmId(mdmModuleEntity.getId()); - // mdmTableCodeRuleEntities.get(i).setDbId(mainMdmModuleDb.getId()); - // mdmTableCodeRuleEntities.get(i).setCreate(); - // } - // for (int i = 0; i < mainMdmModuleDbFileds.size(); i++) { - // if(mainMdmModuleDbFileds.get(i).getId() != null && !"".equals(mainMdmModuleDbFileds.get(i).getId())){ - // //修改 - // mainMdmModuleDbFileds.get(i).setDataType("2"); - // mainMdmModuleDbFileds.get(i).setUpdate(); - // }else { - // //新增 - // mainMdmModuleDbFileds.get(i).setDataType("1"); - // mainMdmModuleDbFileds.get(i).setCreate(); - // } - // mainMdmModuleDbFileds.get(i).setMdmId(mdmModuleEntity.getId()); - // mainMdmModuleDbFileds.get(i).setDbId(mainMdmModuleDb.getId()); - // mainMdmModuleDbFileds.get(i).setAddType("1"); - // mainMdmModuleDbFileds.get(i).setUpdateType("1"); - // mainMdmModuleDbFileds.get(i).setShowType("1"); - // mainMdmModuleDbFileds.get(i).setQueryType("1"); - // mainMdmModuleDbFileds.get(i).setListType("1"); - // mainMdmModuleDbFileds.get(i).setViewType("1"); - // if(mainMdmModuleDbFileds.get(i).getMdmModuleDbFiledsRules() != null && mainMdmModuleDbFileds.get(i).getMdmModuleDbFiledsRules().size() > 0){ - // for (int i1 = 0; i1 < mainMdmModuleDbFileds.get(i).getMdmModuleDbFiledsRules().size(); i1++) { - // MdmModuleDbFiledsRuleEntity mdmModuleDbFiledsRuleEntity = mainMdmModuleDbFileds.get(i).getMdmModuleDbFiledsRules().get(i1); - // if(mdmModuleDbFiledsRuleEntity.getId() != null && !"".equals(mdmModuleDbFiledsRuleEntity.getId())){ - // //修改 - // mdmModuleDbFiledsRuleEntity.setDataType("2"); - // mdmModuleDbFiledsRuleEntity.setUpdate(); - // }else { - // //新增 - // mdmModuleDbFiledsRuleEntity.setDataType("1"); - // mdmModuleDbFiledsRuleEntity.setCreate(); - // } - // mdmModuleDbFiledsRuleEntities.add(mdmModuleDbFiledsRuleEntity); - // } - // } - // mdmModuleDbFiledsEntities.add(mainMdmModuleDbFileds.get(i)); - // } - // if("1".equals(mainMdmModuleDb.getDataType())){ - // //新增 设置默认字段 - // List moduleDbFiledsEntities = getCreateMdm(mdmModuleEntity.getId(),mainMdmModuleDb.getId(),"1"); - // mdmModuleDbFiledsEntities.addAll(moduleDbFiledsEntities); - // } - // //明细表 - // if(sublistMdmModuleDb != null && sublistMdmModuleDb.size() > 0){ - // for (int i = 0; i < sublistMdmModuleDb.size(); i++) { - // MdmModuleDbEntity mdmModuleDbEntity = sublistMdmModuleDb.get(i); - // if(mdmModuleDbEntity.getId() != null && !"".equals(mdmModuleDbEntity.getId())){ - // //修改 - // mdmModuleDbEntity.setDataType("2"); - // mdmModuleDbEntity.setUpdate(); - // }else { - // //新增 - // mdmModuleDbEntity.setDataType("1"); - // mdmModuleDbEntity.setMdmId(mdmModuleEntity.getId()); - // mdmModuleDbEntity.setCreate(); - // } - // mainMdmModuleDb.setDbType("2"); - // mdmModuleDbEntities.add(mdmModuleDbEntity); - // for (int a = 0; a < mdmModuleDbEntity.getSublistMdmModuleDbFileds().size(); a++) { - // if(mdmModuleDbEntity.getSublistMdmModuleDbFileds().get(a).getId() != null && !"".equals(mdmModuleDbEntity.getSublistMdmModuleDbFileds().get(a).getId())){ - // //修改 - // mdmModuleDbEntity.getSublistMdmModuleDbFileds().get(a).setDataType("2"); - // mdmModuleDbEntity.getSublistMdmModuleDbFileds().get(a).setUpdate(); - // }else { - // //新增 - // mdmModuleDbEntity.getSublistMdmModuleDbFileds().get(a).setDataType("1"); - // mdmModuleDbEntity.getSublistMdmModuleDbFileds().get(a).setCreate(); - // } - // mdmModuleDbEntity.getSublistMdmModuleDbFileds().get(a).setMdmId(mdmModuleEntity.getId()); - // mdmModuleDbEntity.getSublistMdmModuleDbFileds().get(a).setDbId(mainMdmModuleDb.getId()); - // mdmModuleDbEntity.getSublistMdmModuleDbFileds().get(a).setAddType("1"); - // mdmModuleDbEntity.getSublistMdmModuleDbFileds().get(a).setUpdateType("1"); - // mdmModuleDbEntity.getSublistMdmModuleDbFileds().get(a).setShowType("1"); - // mdmModuleDbEntity.getSublistMdmModuleDbFileds().get(a).setQueryType("1"); - // mdmModuleDbEntity.getSublistMdmModuleDbFileds().get(a).setListType("1"); - // mdmModuleDbEntity.getSublistMdmModuleDbFileds().get(a).setViewType("1"); - // if(mdmModuleDbEntity.getSublistMdmModuleDbFileds().get(a).getMdmModuleDbFiledsRules() != null && mdmModuleDbEntity.getSublistMdmModuleDbFileds().get(a).getMdmModuleDbFiledsRules().size() > 0){ - // for (int i1 = 0; i1 < mainMdmModuleDbFileds.get(a).getMdmModuleDbFiledsRules().size(); i1++) { - // MdmModuleDbFiledsRuleEntity mdmModuleDbFiledsRuleEntity = mainMdmModuleDbFileds.get(a).getMdmModuleDbFiledsRules().get(i1); - // if(mdmModuleDbFiledsRuleEntity.getId() != null && !"".equals(mdmModuleDbFiledsRuleEntity.getId())){ - // //修改 - // mdmModuleDbFiledsRuleEntity.setDataType("2"); - // mdmModuleDbFiledsRuleEntity.setUpdate(); - // }else { - // //新增 - // mdmModuleDbFiledsRuleEntity.setDataType("1"); - // mdmModuleDbFiledsRuleEntity.setCreate(); - // } - // mdmModuleDbFiledsRuleEntities.add(mdmModuleDbFiledsRuleEntity); - // } - // } - // mdmModuleDbFiledsEntities.add(mdmModuleDbEntity.getSublistMdmModuleDbFileds().get(a)); - // } - // if("1".equals(mainMdmModuleDb.getDataType())){ - // //新增 设置默认字段 - // List moduleDbFiledsEntities = getCreateMdm(mdmModuleEntity.getId(),mainMdmModuleDb.getId(),"2"); - // mdmModuleDbFiledsEntities.addAll(moduleDbFiledsEntities); - // } - // } - // } - // - // - // //新增日志表 - // if("1".equals(mainMdmModuleDb.getDataType())){ - // MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); - // mdmModuleDbEntity.setMdmId(mdmModuleEntity.getId()); - // mdmModuleDbEntity.setDbName(mainMdmModuleDb.getDbName()+"_option_log"); - // mdmModuleDbEntity.setDbType("3"); - // mdmModuleDbEntity.setDataType("1"); - // mdmModuleDbEntity.setCreate(); - // mdmModuleDbEntities.add(mdmModuleDbEntity); - // //新增 设置日志表 - // List moduleDbFiledsEntities = getCreateMdm(mdmModuleEntity.getId(),mdmModuleDbEntity.getId(),"3"); - // mdmModuleDbFiledsEntities.addAll(moduleDbFiledsEntities); - // - // MdmModuleDbEntity mdmModuleDbEntity1 = new MdmModuleDbEntity(); - // mdmModuleDbEntity1.setMdmId(mdmModuleEntity.getId()); - // mdmModuleDbEntity1.setDbName(mainMdmModuleDb.getDbName()+"_option_log"); - // mdmModuleDbEntity1.setDbType("4"); - // mdmModuleDbEntity1.setDataType("1"); - // mdmModuleDbEntity1.setCreate(); - // mdmModuleDbEntities.add(mdmModuleDbEntity1); - // //新增 设置日志表 - // List moduleDbFiledsEntities1 = getCreateMdm(mdmModuleEntity.getId(),mdmModuleDbEntity1.getId(),"4"); - // mdmModuleDbFiledsEntities.addAll(moduleDbFiledsEntities1); - // } - // //保存单据规则 - // mdmServiceCache.saveMdmTableCodeRule(mdmModuleEntity.getId(),mdmTableCodeRuleEntities); - // //保存db - // mdmServiceCache.saveMdmModuleDb(mdmModuleEntity.getId(),mdmModuleDbEntities); - // //保存字段 - // mdmServiceCache.saveMdmModuleDbFileds(mdmModuleEntity.getId(),mdmModuleDbFiledsEntities); - // //保存规则 - // mdmServiceCache.saveMdmModuleDbFiledsRule(mdmModuleEntity.getId(),mdmModuleDbFiledsRuleEntities); - // //创建或者修改表 - // - // for (int i = 0; i < mdmModuleDbEntities.size(); i++) { - // Map maps = new HashMap<>(); - // maps.put("tableName", mdmModuleDbEntities.get(i).getDbName());//表名 - // maps.put("tableRemark", mdmModuleDbEntities.get(i).getRemark());//表备注 - // List dbFiledsDtos = new ArrayList<>(); - // for (int i1 = 0; i1 < mdmModuleDbFiledsEntities.size(); i1++) { - // if(mdmModuleDbEntities.get(i).getId().equals(mdmModuleDbFiledsEntities.get(i1).getDbId())){ - // dbFiledsDtos.add(new DbFiledsDto(mdmModuleDbFiledsEntities.get(i1).getDataType(), mdmModuleDbFiledsEntities.get(i1).getChName(), mdmModuleDbFiledsEntities.get(i1).getEnName(), mdmModuleDbFiledsEntities.get(i1).getFiledType(), mdmModuleDbFiledsEntities.get(i1).getFiledLength())); - // } - // } - // maps.put("databaseFields", dbFiledsDtos);//字段 - // if("1".equals(mdmModuleDbEntities.get(i).getDataType())){ - // mdmModuleDao.createTable(maps); - // }else { - // Map tablename = new HashMap<>(); - // tablename.put("tableName", mdmModuleDbEntities.get(i).getDbName());//表名 - // tablename.put("tableRemark", mdmModuleDbEntities.get(i).getRemark());//表备注 - // mdmModuleDao.alterTableName(tablename); - // mdmModuleDao.alterTable(maps); - // } - // } - // return BaseResult.getSuccessMessageEntity("保存数据源成功"); - //} - // - ///** - // * @Author lvleigang - // * @Description 新建设置默认字段 - // * @Date 2:06 下午 2024/6/3 - // * @param mdmId - // * @param dbId - // * @param type - // * @return java.util.List - // **/ - //private List getCreateMdm(String mdmId, String dbId, String type) { - // List mdmModuleDbFiledsEntities = new ArrayList<>(); - // MdmModuleDbFiledsEntity id = new MdmModuleDbFiledsEntity(); - // id.setMdmId(mdmId); - // id.setDbId(dbId); - // id.setChName("id"); - // id.setEnName("id"); - // id.setFiledType("3"); - // id.setAddType("2"); - // id.setUpdateType("2"); - // id.setShowType("2"); - // id.setQueryType("2"); - // id.setListType("2"); - // id.setViewType("2"); - // id.setFiledLength("50"); - // id.setDataType("1"); - // mdmModuleDbFiledsEntities.add(id); - // - // if("1".equals(type)){ - // MdmModuleDbFiledsEntity documentRule = new MdmModuleDbFiledsEntity(); - // documentRule.setMdmId(mdmId); - // documentRule.setDbId(dbId); - // documentRule.setChName("document_rule"); - // documentRule.setEnName("单据规则"); - // documentRule.setFiledType("3"); - // documentRule.setAddType("2"); - // documentRule.setUpdateType("1"); - // documentRule.setShowType("1"); - // documentRule.setQueryType("1"); - // documentRule.setListType("1"); - // documentRule.setViewType("1"); - // documentRule.setFiledLength("50"); - // documentRule.setDataType("1"); - // mdmModuleDbFiledsEntities.add(documentRule); - // } - // - // if("1".equals(type)){ - // MdmModuleDbFiledsEntity document_rule_num = new MdmModuleDbFiledsEntity(); - // document_rule_num.setMdmId(mdmId); - // document_rule_num.setDbId(dbId); - // document_rule_num.setChName("document_rule_num"); - // document_rule_num.setEnName("单据规则流水号"); - // document_rule_num.setFiledType("1"); - // document_rule_num.setAddType("2"); - // document_rule_num.setUpdateType("2"); - // document_rule_num.setShowType("2"); - // document_rule_num.setQueryType("2"); - // document_rule_num.setListType("2"); - // document_rule_num.setViewType("2"); - // document_rule_num.setFiledLength("50"); - // document_rule_num.setDataType("1"); - // mdmModuleDbFiledsEntities.add(document_rule_num); - // } - // if("2".equals(type) || "3".equals(type) || "4".equals(type) ){ - // MdmModuleDbFiledsEntity formmain_id = new MdmModuleDbFiledsEntity(); - // formmain_id.setMdmId(mdmId); - // formmain_id.setDbId(dbId); - // formmain_id.setChName("formmain_id"); - // formmain_id.setEnName("主表id"); - // formmain_id.setFiledType("3"); - // formmain_id.setAddType("2"); - // formmain_id.setUpdateType("2"); - // formmain_id.setShowType("2"); - // formmain_id.setQueryType("2"); - // formmain_id.setListType("2"); - // formmain_id.setViewType("2"); - // formmain_id.setFiledLength("50"); - // formmain_id.setDataType("1"); - // mdmModuleDbFiledsEntities.add(formmain_id); - // } - // //写入日志字段:操作人 - // if("3".equals(type)){ - // MdmModuleDbFiledsEntity source_name = new MdmModuleDbFiledsEntity(); - // source_name.setMdmId(mdmId); - // source_name.setDbId(dbId); - // source_name.setChName("source_name"); - // source_name.setEnName("来源名称"); - // source_name.setFiledType("3"); - // source_name.setAddType("2"); - // source_name.setUpdateType("2"); - // source_name.setShowType("2"); - // source_name.setQueryType("2"); - // source_name.setListType("2"); - // source_name.setViewType("2"); - // source_name.setFiledLength("50"); - // source_name.setDataType("1"); - // mdmModuleDbFiledsEntities.add(source_name); - // - // MdmModuleDbFiledsEntity code = new MdmModuleDbFiledsEntity(); - // code.setMdmId(mdmId); - // code.setDbId(dbId); - // code.setChName("code"); - // code.setEnName("编码"); - // code.setFiledType("3"); - // code.setAddType("2"); - // code.setUpdateType("2"); - // code.setShowType("2"); - // code.setQueryType("2"); - // code.setListType("2"); - // code.setViewType("2"); - // code.setFiledLength("50"); - // code.setDataType("1"); - // mdmModuleDbFiledsEntities.add(code); - // - // MdmModuleDbFiledsEntity source_data = new MdmModuleDbFiledsEntity(); - // source_data.setMdmId(mdmId); - // source_data.setDbId(dbId); - // source_data.setChName("source_data"); - // source_data.setEnName("源数据"); - // source_data.setFiledType("3"); - // source_data.setAddType("2"); - // source_data.setUpdateType("2"); - // source_data.setShowType("2"); - // source_data.setQueryType("2"); - // source_data.setListType("2"); - // source_data.setViewType("2"); - // source_data.setFiledLength("255"); - // source_data.setDataType("1"); - // mdmModuleDbFiledsEntities.add(source_data); - // - // MdmModuleDbFiledsEntity option_type = new MdmModuleDbFiledsEntity(); - // option_type.setMdmId(mdmId); - // option_type.setDbId(dbId); - // option_type.setChName("option_type"); - // option_type.setEnName("操作类型"); - // option_type.setFiledType("3"); - // option_type.setAddType("2"); - // option_type.setUpdateType("2"); - // option_type.setShowType("2"); - // option_type.setQueryType("2"); - // option_type.setListType("2"); - // option_type.setViewType("2"); - // option_type.setFiledLength("255"); - // option_type.setDataType("1"); - // mdmModuleDbFiledsEntities.add(option_type); - // - // MdmModuleDbFiledsEntity option_Name = new MdmModuleDbFiledsEntity(); - // option_Name.setMdmId(mdmId); - // option_Name.setDbId(dbId); - // option_Name.setChName("option_name"); - // option_Name.setEnName("操作人"); - // option_Name.setFiledType("3"); - // option_Name.setAddType("2"); - // option_Name.setUpdateType("2"); - // option_Name.setShowType("2"); - // option_Name.setQueryType("2"); - // option_Name.setListType("2"); - // option_Name.setViewType("2"); - // option_Name.setFiledLength("255"); - // option_Name.setDataType("1"); - // mdmModuleDbFiledsEntities.add(option_Name); - // } - // - // //目标应用、目标api、 - // if("4".equals(type)){ - // MdmModuleDbFiledsEntity target_app = new MdmModuleDbFiledsEntity(); - // target_app.setMdmId(mdmId); - // target_app.setDbId(dbId); - // target_app.setChName("target_app"); - // target_app.setEnName("目标应用"); - // target_app.setFiledType("1"); - // target_app.setAddType("2"); - // target_app.setUpdateType("2"); - // target_app.setShowType("2"); - // target_app.setQueryType("2"); - // target_app.setListType("2"); - // target_app.setViewType("2"); - // target_app.setFiledLength("50"); - // target_app.setDataType("1"); - // mdmModuleDbFiledsEntities.add(target_app); - // - // MdmModuleDbFiledsEntity target_api = new MdmModuleDbFiledsEntity(); - // target_api.setMdmId(mdmId); - // target_api.setDbId(dbId); - // target_api.setChName("target_api"); - // target_api.setEnName("目标api"); - // target_api.setFiledType("1"); - // target_api.setAddType("2"); - // target_api.setUpdateType("2"); - // target_api.setShowType("2"); - // target_api.setQueryType("2"); - // target_api.setListType("2"); - // target_api.setViewType("2"); - // target_api.setFiledLength("50"); - // target_api.setDataType("1"); - // mdmModuleDbFiledsEntities.add(target_api); - // - // MdmModuleDbFiledsEntity source_data = new MdmModuleDbFiledsEntity(); - // source_data.setMdmId(mdmId); - // source_data.setDbId(dbId); - // source_data.setChName("source_data"); - // source_data.setEnName("源数据"); - // source_data.setFiledType("3"); - // source_data.setAddType("2"); - // source_data.setUpdateType("2"); - // source_data.setShowType("2"); - // source_data.setQueryType("2"); - // source_data.setListType("2"); - // source_data.setViewType("2"); - // source_data.setFiledLength("255"); - // source_data.setDataType("1"); - // mdmModuleDbFiledsEntities.add(source_data); - // - // MdmModuleDbFiledsEntity option_type = new MdmModuleDbFiledsEntity(); - // option_type.setMdmId(mdmId); - // option_type.setDbId(dbId); - // option_type.setChName("option_type"); - // option_type.setEnName("操作类型"); - // option_type.setFiledType("3"); - // option_type.setAddType("2"); - // option_type.setUpdateType("2"); - // option_type.setShowType("2"); - // option_type.setQueryType("2"); - // option_type.setListType("2"); - // option_type.setViewType("2"); - // option_type.setFiledLength("255"); - // option_type.setDataType("1"); - // mdmModuleDbFiledsEntities.add(option_type); - // } - // if("2".equals(type) || "1".equals(type) ) { - // MdmModuleDbFiledsEntity data_status = new MdmModuleDbFiledsEntity(); - // data_status.setMdmId(mdmId); - // data_status.setDbId(dbId); - // data_status.setChName("data_status"); - // data_status.setEnName("数据状态 Y正常 N删除 F修改"); - // data_status.setFiledType("3"); - // data_status.setAddType("2"); - // data_status.setUpdateType("2"); - // data_status.setShowType("2"); - // data_status.setQueryType("2"); - // data_status.setListType("2"); - // data_status.setViewType("2"); - // data_status.setFiledLength("1"); - // data_status.setDataType("1"); - // mdmModuleDbFiledsEntities.add(data_status); - // } - // if("1".equals(type)){ - // MdmModuleDbFiledsEntity add_status = new MdmModuleDbFiledsEntity(); - // add_status.setMdmId(mdmId); - // add_status.setDbId(dbId); - // add_status.setChName("add_status"); - // add_status.setEnName("新增数据状态 0待下发 1已下发"); - // add_status.setFiledType("3"); - // add_status.setAddType("2"); - // add_status.setUpdateType("2"); - // add_status.setShowType("2"); - // add_status.setQueryType("2"); - // add_status.setListType("2"); - // add_status.setViewType("2"); - // add_status.setFiledLength("1"); - // add_status.setDataType("1"); - // mdmModuleDbFiledsEntities.add(add_status); - // } - // if("1".equals(type)){ - // MdmModuleDbFiledsEntity update_status = new MdmModuleDbFiledsEntity(); - // update_status.setMdmId(mdmId); - // update_status.setDbId(dbId); - // update_status.setChName("update_status"); - // update_status.setEnName("修改数据状态 0待下发 1已下发"); - // update_status.setFiledType("3"); - // update_status.setAddType("2"); - // update_status.setUpdateType("2"); - // update_status.setShowType("2"); - // update_status.setQueryType("2"); - // update_status.setListType("2"); - // update_status.setViewType("2"); - // update_status.setFiledLength("1"); - // update_status.setDataType("1"); - // mdmModuleDbFiledsEntities.add(update_status); - // } - // - // if("1".equals(type)){ - // MdmModuleDbFiledsEntity delete_status = new MdmModuleDbFiledsEntity(); - // delete_status.setMdmId(mdmId); - // delete_status.setDbId(dbId); - // delete_status.setChName("delete_status"); - // delete_status.setEnName("删除数据状态 0待下发 1已下发"); - // delete_status.setFiledType("3"); - // delete_status.setAddType("2"); - // delete_status.setUpdateType("2"); - // delete_status.setShowType("2"); - // delete_status.setQueryType("2"); - // delete_status.setListType("2"); - // delete_status.setViewType("2"); - // delete_status.setFiledLength("1"); - // delete_status.setDataType("1"); - // mdmModuleDbFiledsEntities.add(delete_status); - // } - // - // MdmModuleDbFiledsEntity sorts = new MdmModuleDbFiledsEntity(); - // sorts.setMdmId(mdmId); - // sorts.setDbId(dbId); - // sorts.setChName("sorts"); - // sorts.setEnName("排序"); - // sorts.setFiledType("1"); - // sorts.setAddType("2"); - // sorts.setUpdateType("2"); - // sorts.setShowType("2"); - // sorts.setQueryType("2"); - // sorts.setListType("2"); - // sorts.setViewType("2"); - // sorts.setFiledLength("20"); - // sorts.setDataType("1"); - // mdmModuleDbFiledsEntities.add(sorts); - // MdmModuleDbFiledsEntity create_user_id = new MdmModuleDbFiledsEntity(); - // create_user_id.setMdmId(mdmId); - // create_user_id.setDbId(dbId); - // create_user_id.setChName("create_user_id"); - // create_user_id.setEnName("创建人id"); - // create_user_id.setFiledType("3"); - // create_user_id.setAddType("2"); - // create_user_id.setUpdateType("2"); - // create_user_id.setShowType("2"); - // create_user_id.setQueryType("2"); - // create_user_id.setListType("2"); - // create_user_id.setViewType("2"); - // create_user_id.setFiledLength("50"); - // create_user_id.setDataType("1"); - // mdmModuleDbFiledsEntities.add(create_user_id); - // MdmModuleDbFiledsEntity create_time = new MdmModuleDbFiledsEntity(); - // create_time.setMdmId(mdmId); - // create_time.setDbId(dbId); - // create_time.setChName("create_time"); - // create_time.setEnName("创建时间"); - // create_time.setFiledType("4"); - // create_time.setAddType("2"); - // create_time.setUpdateType("2"); - // create_time.setShowType("2"); - // create_time.setQueryType("2"); - // create_time.setListType("2"); - // create_time.setViewType("2"); - // create_time.setFiledLength("50"); - // create_time.setDataType("1"); - // mdmModuleDbFiledsEntities.add(create_time); - // MdmModuleDbFiledsEntity modify_user_id = new MdmModuleDbFiledsEntity(); - // modify_user_id.setMdmId(mdmId); - // modify_user_id.setDbId(dbId); - // modify_user_id.setChName("modify_user_id"); - // modify_user_id.setEnName("修改人id"); - // modify_user_id.setFiledType("3"); - // modify_user_id.setAddType("2"); - // modify_user_id.setUpdateType("2"); - // modify_user_id.setShowType("2"); - // modify_user_id.setQueryType("2"); - // modify_user_id.setListType("2"); - // modify_user_id.setViewType("2"); - // modify_user_id.setFiledLength("50"); - // modify_user_id.setDataType("1"); - // mdmModuleDbFiledsEntities.add(modify_user_id); - // MdmModuleDbFiledsEntity modify_time = new MdmModuleDbFiledsEntity(); - // modify_time.setMdmId(mdmId); - // modify_time.setDbId(dbId); - // modify_time.setChName("modify_time"); - // modify_time.setEnName("修改时间"); - // modify_time.setFiledType("4"); - // modify_time.setAddType("2"); - // modify_time.setUpdateType("2"); - // modify_time.setShowType("2"); - // modify_time.setQueryType("2"); - // modify_time.setListType("2"); - // modify_time.setViewType("2"); - // modify_time.setFiledLength("50"); - // modify_time.setDataType("1"); - // mdmModuleDbFiledsEntities.add(modify_time); - // MdmModuleDbFiledsEntity sts = new MdmModuleDbFiledsEntity(); - // sts.setMdmId(mdmId); - // sts.setDbId(dbId); - // sts.setChName("sts"); - // sts.setEnName("状态(Y正常N删除)"); - // sts.setFiledType("3"); - // sts.setAddType("2"); - // sts.setUpdateType("2"); - // sts.setShowType("2"); - // sts.setQueryType("2"); - // sts.setListType("2"); - // sts.setViewType("2"); - // sts.setFiledLength("1"); - // sts.setDataType("1"); - // mdmModuleDbFiledsEntities.add(sts); - // MdmModuleDbFiledsEntity org_id = new MdmModuleDbFiledsEntity(); - // org_id.setMdmId(mdmId); - // org_id.setDbId(dbId); - // org_id.setChName("org_id"); - // org_id.setEnName("组织机构ID"); - // org_id.setFiledType("3"); - // org_id.setAddType("2"); - // org_id.setUpdateType("2"); - // org_id.setShowType("2"); - // org_id.setQueryType("2"); - // org_id.setListType("2"); - // org_id.setViewType("2"); - // org_id.setFiledLength("50"); - // org_id.setDataType("1"); - // mdmModuleDbFiledsEntities.add(org_id); - // MdmModuleDbFiledsEntity company_id = new MdmModuleDbFiledsEntity(); - // company_id.setMdmId(mdmId); - // company_id.setDbId(dbId); - // company_id.setChName("company_id"); - // company_id.setEnName("公司id"); - // company_id.setFiledType("3"); - // company_id.setAddType("2"); - // company_id.setUpdateType("2"); - // company_id.setShowType("2"); - // company_id.setQueryType("2"); - // company_id.setListType("2"); - // company_id.setViewType("2"); - // company_id.setFiledLength("50"); - // company_id.setDataType("1"); - // mdmModuleDbFiledsEntities.add(company_id); - // return mdmModuleDbFiledsEntities; - //} - // - // - ///** - // * @param object - // * @return com.hzya.frame.web.entity.JsonResultEntity - // * @Author lvleigang - // * @Description 主数据设置查询显示信息 - // * @Date 9:40 上午 2023/10/18 - // **/ - //@Override - //public JsonResultEntity queryMdmModuleView(JSONObject object) { - // MdmModuleEntity entity = getData("jsonStr", object, MdmModuleEntity.class); - // //判断分页 - // if (entity == null) { - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // if (entity.getMdmCode() == null || "".equals(entity.getMdmCode())) { - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // MdmModuleViewVo mdmModuleViewVo = new MdmModuleViewVo(); - // - // MdmModuleEntity mdmModuleEntity = mdmServiceCache.getMdmModuleEntity(entity.getMdmCode()); - // //查询数据库字段 - // MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); - // mdmModuleDbEntity.setMdmId(mdmModuleEntity.getId()); - // mdmModuleDbEntity.setSts("Y"); - // List mdmModuleDbEntities = mdmServiceCache.queryMdmModuleDb(mdmModuleDbEntity); - // MdmModuleDbFiledsEntity mdmModuleDbFiledsEntity = new MdmModuleDbFiledsEntity(); - // mdmModuleDbFiledsEntity.setMdmId(mdmModuleEntity.getId()); - // mdmModuleDbFiledsEntity.setSts("Y"); - // List mdmModuleDbFiledsEntities = mdmServiceCache.queryMdmModuleDbFileds(mdmModuleDbFiledsEntity); - // - // //设置数据库字段 - // setFiledType(mdmModuleViewVo,mdmModuleDbEntities,mdmModuleDbFiledsEntities); - // - // MdmModuleViewDetailEntity mdmModuleViewDetailEntity = new MdmModuleViewDetailEntity(); - // mdmModuleViewDetailEntity.setMdmId(mdmModuleEntity.getId()); - // mdmModuleViewDetailEntity.setSts("Y"); - // List mdmModuleViewDetailEntities = mdmServiceCache.queryMdmModuleViewDetail(mdmModuleViewDetailEntity); - // setDbFiledType(mdmModuleViewVo,mdmModuleViewDetailEntities); - // MdmModuleViewEntity mdmModuleViewEntity = new MdmModuleViewEntity(); - // mdmModuleViewEntity.setMdmId(mdmModuleEntity.getId()); - // mdmModuleViewEntity.setSts("Y"); - // List moduleViewEntities = mdmServiceCache.queryMdmModuleView(mdmModuleViewEntity); - // if(moduleViewEntities != null && moduleViewEntities.size() == 1){ - // mdmModuleViewVo.setMdmModuleViewEntity(moduleViewEntities.get(0)); - // } - // MdmModuleViewButtonEntity mdmModuleViewButtonEntity = new MdmModuleViewButtonEntity(); - // mdmModuleViewButtonEntity.setMdmId(mdmModuleEntity.getId()); - // mdmModuleViewButtonEntity.setSts("Y"); - // List mdmModuleViewButtonEntities = mdmServiceCache.queryMdmModuleViewButton(mdmModuleViewButtonEntity); - // mdmModuleViewVo.setDbButtonFiled(mdmModuleViewButtonEntities); - // return BaseResult.getSuccessMessageEntity("查询视图成功", mdmModuleViewVo); - //} - // - //private void setDbFiledType(MdmModuleViewVo mdmModuleViewVo, List mdmModuleViewDetailEntityList) { - // //新增 - // List addFiled = new ArrayList<>(); - // //修改 - // List editFiled = new ArrayList<>(); - // //查看 - // List showFiled = new ArrayList<>(); - // //查询 - // List queryFiled = new ArrayList<>(); - // //列表 - // List listFiled = new ArrayList<>(); - // if (mdmModuleViewDetailEntityList != null && mdmModuleViewDetailEntityList.size() > 0) { - // for (int i = 0; i < mdmModuleViewDetailEntityList.size(); i++) { - // switch (mdmModuleViewDetailEntityList.get(i).getViewType()) { - // //1、查询2、列表3、新增4、修改 5、查看 - // case "1": - // queryFiled.add(mdmModuleViewDetailEntityList.get(i)); - // break; - // case "2": - // listFiled.add(mdmModuleViewDetailEntityList.get(i)); - // break; - // case "3": - // addFiled.add(mdmModuleViewDetailEntityList.get(i)); - // break; - // case "4": - // editFiled.add(mdmModuleViewDetailEntityList.get(i)); - // break; - // case "5": - // showFiled.add(mdmModuleViewDetailEntityList.get(i)); - // break; - // default: - // } - // } - // } - // mdmModuleViewVo.setDbAddFiled(addFiled); - // mdmModuleViewVo.setDbEditFiled(editFiled); - // mdmModuleViewVo.setDbShowFiled(showFiled); - // mdmModuleViewVo.setDbQueryFiled(queryFiled); - // mdmModuleViewVo.setDbListFiled(listFiled); - //} - // - ///** - // * @param mdmModuleViewVo - // * @param mdmModuleDbEntityList - // * @param mdmModuleDbFiledsEntityList - // * @return void - // * @Author lvleigang - // * @Description 设置对应的字段类型 - // * @Date 2023/10/25 - // **/ - //private void setFiledType(MdmModuleViewVo mdmModuleViewVo, List mdmModuleDbEntityList, List mdmModuleDbFiledsEntityList) { - // //新增 - // List addFiled = new ArrayList<>(); - // //修改 - // List editFiled = new ArrayList<>(); - // //查看 - // List showFiled = new ArrayList<>(); - // //查询 - // List queryFiled = new ArrayList<>(); - // //列表 - // List listFiled = new ArrayList<>(); - // if (mdmModuleDbEntityList != null && mdmModuleDbEntityList.size() > 0) { - // for (int i = 0; i < mdmModuleDbEntityList.size(); i++) { - // - // if (mdmModuleDbFiledsEntityList != null && mdmModuleDbFiledsEntityList.size() > 0) { - // for (int i1 = 0; i1 < mdmModuleDbFiledsEntityList.size(); i1++) { - // if (mdmModuleDbEntityList.get(i).getId().equals(mdmModuleDbFiledsEntityList.get(i1).getDbId())) { - // if("1".equals(mdmModuleDbFiledsEntityList.get(i1).getViewType())){ - // if ("1".equals(mdmModuleDbEntityList.get(i).getDbType())) { - // //1、主表 - // if ("1".equals(mdmModuleDbFiledsEntityList.get(i1).getAddType())) { - // addFiled.add(new MdmDbFiledVo(mdmModuleDbFiledsEntityList.get(i1).getId(), "【主表:" + mdmModuleDbEntityList.get(i).getDbName() + "】" + mdmModuleDbFiledsEntityList.get(i1).getChName())); - // } - // if ("1".equals(mdmModuleDbFiledsEntityList.get(i1).getUpdateType())) { - // editFiled.add(new MdmDbFiledVo(mdmModuleDbFiledsEntityList.get(i1).getId(), "【主表:" + mdmModuleDbEntityList.get(i).getDbName() + "】" + mdmModuleDbFiledsEntityList.get(i1).getChName())); - // } - // if ("1".equals(mdmModuleDbFiledsEntityList.get(i1).getShowType())) { - // showFiled.add(new MdmDbFiledVo(mdmModuleDbFiledsEntityList.get(i1).getId(), "【主表:" + mdmModuleDbEntityList.get(i).getDbName() + "】" + mdmModuleDbFiledsEntityList.get(i1).getChName())); - // } - // if ("1".equals(mdmModuleDbFiledsEntityList.get(i1).getQueryType())) { - // queryFiled.add(new MdmDbFiledVo(mdmModuleDbFiledsEntityList.get(i1).getId(), "【主表:" + mdmModuleDbEntityList.get(i).getDbName() + "】" + mdmModuleDbFiledsEntityList.get(i1).getChName())); - // } - // if ("1".equals(mdmModuleDbFiledsEntityList.get(i1).getListType())) { - // listFiled.add(new MdmDbFiledVo(mdmModuleDbFiledsEntityList.get(i1).getId(), "【主表:" + mdmModuleDbEntityList.get(i).getDbName() + "】" + mdmModuleDbFiledsEntityList.get(i1).getChName())); - // } - // } else if ("2".equals(mdmModuleDbEntityList.get(i).getDbType())){ - // //2、明细 - // if ("1".equals(mdmModuleDbFiledsEntityList.get(i1).getAddType())) { - // addFiled.add(new MdmDbFiledVo(mdmModuleDbFiledsEntityList.get(i1).getId(), "【子表:" + mdmModuleDbEntityList.get(i).getDbName() + "】" + mdmModuleDbFiledsEntityList.get(i1).getChName())); - // } - // if ("1".equals(mdmModuleDbFiledsEntityList.get(i1).getUpdateType())) { - // editFiled.add(new MdmDbFiledVo(mdmModuleDbFiledsEntityList.get(i1).getId(), "【子表:" + mdmModuleDbEntityList.get(i).getDbName() + "】" + mdmModuleDbFiledsEntityList.get(i1).getChName())); - // } - // if ("1".equals(mdmModuleDbFiledsEntityList.get(i1).getShowType())) { - // showFiled.add(new MdmDbFiledVo(mdmModuleDbFiledsEntityList.get(i1).getId(), "【子表:" + mdmModuleDbEntityList.get(i).getDbName() + "】" + mdmModuleDbFiledsEntityList.get(i1).getChName())); - // } - // if ("1".equals(mdmModuleDbFiledsEntityList.get(i1).getQueryType())) { - // queryFiled.add(new MdmDbFiledVo(mdmModuleDbFiledsEntityList.get(i1).getId(), "【子表:" + mdmModuleDbEntityList.get(i).getDbName() + "】" + mdmModuleDbFiledsEntityList.get(i1).getChName())); - // } - // if ("1".equals(mdmModuleDbFiledsEntityList.get(i1).getListType())) { - // listFiled.add(new MdmDbFiledVo(mdmModuleDbFiledsEntityList.get(i1).getId(), "【子表:" + mdmModuleDbEntityList.get(i).getDbName() + "】" + mdmModuleDbFiledsEntityList.get(i1).getChName())); - // } - // } - // } - // } - // } - // } - // } - // } - // mdmModuleViewVo.setAddFiled(addFiled); - // mdmModuleViewVo.setEditFiled(editFiled); - // mdmModuleViewVo.setShowFiled(showFiled); - // mdmModuleViewVo.setQueryFiled(queryFiled); - // mdmModuleViewVo.setListFiled(listFiled); - //} - ///** - // * @param object - // * @return com.hzya.frame.web.entity.JsonResultEntity - // * @Author lvleigang - // * @Description 主数据设置修改显示信息 - // * @Date 9:40 上午 2023/10/18 - // **/ - //@Override - //public JsonResultEntity doSaveMdmModuleView(JSONObject object) { - // MdmModuleViewDto entity = getData("jsonStr", object, MdmModuleViewDto.class); - // //判断是否有数据 - // if (entity == null) { - // return BaseResult.getFailureMessageEntity("参数不允许为空"); - // } - // if (entity.getMdmCode() == null || "".equals(entity.getMdmCode())) { - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // if (entity.getMdmModuleViewEntity() == null) { - // return BaseResult.getFailureMessageEntity("参数不允许为空"); - // } - // MdmModuleEntity mdmModuleEntity = mdmServiceCache.getMdmModuleEntity(entity.getMdmCode()); - // - // //保存视图 - // MdmModuleViewEntity mdmModuleViewEntity = entity.getMdmModuleViewEntity(); - // mdmModuleViewEntity.setMdmId(mdmModuleEntity.getId()); - // if(mdmModuleViewEntity.getId() != null && !"".equals(mdmModuleViewEntity.getId())){ - // mdmModuleViewEntity.setDataType("2"); - // mdmModuleViewEntity.setUpdate(); - // mdmServiceCache.saveMdmModuleView(mdmModuleEntity.getId(),mdmModuleViewEntity); - // }else { - // mdmModuleViewEntity.setDataType("1"); - // mdmModuleViewEntity.setCreate(); - // mdmModuleViewDao.save(mdmModuleViewEntity); - // } - // //保存字段 - // List mdmModuleViewDetailEntities = new ArrayList<>(); - // //1、查询2、列表3、新增4、修改 5、查看 - // saveDbViewFiled(mdmModuleEntity.getId(),mdmModuleViewEntity.getId(),entity.getQueryFiled(),"1",mdmModuleViewDetailEntities); - // saveDbViewFiled(mdmModuleEntity.getId(),mdmModuleViewEntity.getId(),entity.getListFiled(),"2",mdmModuleViewDetailEntities); - // saveDbViewFiled(mdmModuleEntity.getId(),mdmModuleViewEntity.getId(),entity.getAddFiled(),"3",mdmModuleViewDetailEntities); - // saveDbViewFiled(mdmModuleEntity.getId(),mdmModuleViewEntity.getId(),entity.getEditFiled(),"4",mdmModuleViewDetailEntities); - // saveDbViewFiled(mdmModuleEntity.getId(),mdmModuleViewEntity.getId(),entity.getShowFiled(),"5",mdmModuleViewDetailEntities); - // mdmServiceCache.saveMdmModuleViewDetail(mdmModuleEntity.getId(),mdmModuleViewDetailEntities); - // //保存按钮 - // List mdmModuleViewButtonEntities = entity.getDbButtonFiled(); - // if(mdmModuleViewButtonEntities != null && mdmModuleViewButtonEntities.size() > 0){ - // for (int i = 0; i < mdmModuleViewButtonEntities.size(); i++) { - // mdmModuleViewButtonEntities.get(i).setMdmId(mdmModuleEntity.getId()); - // mdmModuleViewButtonEntities.get(i).setViewId(mdmModuleViewEntity.getId()); - // if(mdmModuleViewButtonEntities.get(i).getId() != null && !"".equals(mdmModuleViewButtonEntities.get(i).getId())){ - // mdmModuleViewButtonEntities.get(i).setDataType("2"); - // mdmModuleViewButtonEntities.get(i).setUpdate(); - // }else { - // mdmModuleViewButtonEntities.get(i).setDataType("1"); - // mdmModuleViewButtonEntities.get(i).setCreate(); - // } - // } - // mdmServiceCache.saveMdmModuleViewButton(mdmModuleEntity.getId(),mdmModuleViewButtonEntities); - // } - // - // //保存菜单 - // //保存按钮 - // - // if("1".equals(mdmModuleViewEntity.getDataType())){ - // //新增 - // SysMenuConfigEntity module = new SysMenuConfigEntity(); - // module.setCreate(); - // module.setFormId(mdmModuleEntity.getId()); - // if("1".equals(mdmModuleEntity.getMdmType())){ - // //1、档案 - // module.setParentMenuId("ea22757e99c144fb9ef381dd322e233c"); - // }else { - // //2、单据 - // module.setParentMenuId("58714ddb7ec94f5da91df74efada042f"); - // } - // module.setMenuName(mdmModuleEntity.getMdmName()); - // module.setMenuEnglishName("integrationOptionAdmin" + mdmModuleEntity.getMdmCode()); - // module.setMenuIcon(null);//模块图标 - // module.setRoute("integrationOptionAdmin/" + mdmModuleEntity.getMdmCode());//路由地址 - // module.setMenuPage("integrationOptionV2/index");//一级Layout 二级 ParntView 三级component - // module.setRemark("主数据生成菜单"); - // module.setVisibles("0"); - // module.setShowType("1"); - // JSONObject object1 = new JSONObject(); - // object1.put("mdmId", mdmModuleEntity.getId());//主数据id - // object1.put("mdmCode", mdmModuleEntity.getMdmCode());//主数据编码 - // object1.put("viewType", mdmModuleViewEntity.getViewName());//1、树 2、列表 - // module.setOptions(object1.toString());//菜单mate参数 - // sysMenuConfigDao.save(module); - // if(mdmModuleViewButtonEntities != null && mdmModuleViewButtonEntities.size() > 0){ - // for (int i = 0; i < mdmModuleViewButtonEntities.size(); i++) { - // if("new".equals(mdmModuleViewButtonEntities.get(i).getButtonValue())){ - // SysButtonConfigEntity xz = new SysButtonConfigEntity(); - // xz.setCode("new"); - // xz.setNameCh("新建"); - // xz.setNameEn("new"); - // xz.setMenuId(module.getId()); - // xz.setIconName(""); - // xz.setStyles(""); - // xz.setBtnFunction("new"); - // xz.setRemark("主数据新建按钮"); - // xz.setCreate(); - // sysButtonConfigDao.save(xz); - // } - // if("resize".equals(mdmModuleViewButtonEntities.get(i).getButtonValue())){ - // - // SysButtonConfigEntity cz = new SysButtonConfigEntity(); - // cz.setCode("resize"); - // cz.setNameCh("重置"); - // cz.setNameEn("resize"); - // cz.setMenuId(module.getId()); - // cz.setIconName(""); - // cz.setStyles(""); - // cz.setBtnFunction("resize"); - // cz.setRemark("主数据重置按钮"); - // cz.setCreate(); - // sysButtonConfigDao.save(cz); - // } - // if("search".equals(mdmModuleViewButtonEntities.get(i).getButtonValue())) { - // - // SysButtonConfigEntity cx = new SysButtonConfigEntity(); - // cx.setCode("search"); - // cx.setNameCh("查询"); - // cx.setNameEn("search"); - // cx.setMenuId(module.getId()); - // cx.setIconName(""); - // cx.setStyles(""); - // cx.setBtnFunction("search"); - // cx.setRemark("主数据查询按钮"); - // cx.setCreate(); - // sysButtonConfigDao.save(cx); - // } - // if("edit".equals(mdmModuleViewButtonEntities.get(i).getButtonValue())) { - // - // SysButtonConfigEntity xg = new SysButtonConfigEntity(); - // xg.setCode("edit"); - // xg.setNameCh("修改"); - // xg.setNameEn("edit"); - // xg.setMenuId(module.getId()); - // xg.setIconName(""); - // xg.setStyles(""); - // xg.setBtnFunction("edit"); - // xg.setRemark("主数据修改按钮"); - // xg.setCreate(); - // sysButtonConfigDao.save(xg); - // } - // if("dele".equals(mdmModuleViewButtonEntities.get(i).getButtonValue())) { - // - // SysButtonConfigEntity sc = new SysButtonConfigEntity(); - // sc.setCode("dele"); - // sc.setNameCh("删除"); - // sc.setNameEn("dele"); - // sc.setMenuId(module.getId()); - // sc.setIconName(""); - // sc.setStyles(""); - // sc.setBtnFunction("dele"); - // sc.setRemark("主数据删除按钮"); - // sc.setCreate(); - // sysButtonConfigDao.save(sc); - // } - // if("view".equals(mdmModuleViewButtonEntities.get(i).getButtonValue())) { - // - // SysButtonConfigEntity ck = new SysButtonConfigEntity(); - // ck.setCode("view"); - // ck.setNameCh("查看"); - // ck.setNameEn("view"); - // ck.setMenuId(module.getId()); - // ck.setIconName(""); - // ck.setStyles(""); - // ck.setBtnFunction("view"); - // ck.setRemark("主数据查看按钮"); - // ck.setCreate(); - // sysButtonConfigDao.save(ck); - // } - // if("send".equals(mdmModuleViewButtonEntities.get(i).getButtonValue())) { - // SysButtonConfigEntity xf = new SysButtonConfigEntity(); - // xf.setCode("send"); - // xf.setNameCh("下发"); - // xf.setNameEn("send"); - // xf.setMenuId(module.getId()); - // xf.setIconName(""); - // xf.setStyles(""); - // xf.setBtnFunction("send"); - // xf.setRemark("主数据下发按钮"); - // xf.setCreate(); - // sysButtonConfigDao.save(xf); - // } - // } - // } - // }else { - // //修改 - // //修改菜单 注意因为可能修改显示类型,所以需要修改菜单的属性 - // SysMenuConfigEntity module = new SysMenuConfigEntity(); - // module.setFormId(mdmModuleEntity.getId()); - // module.setSts("Y"); - // List moduleList = sysMenuConfigDao.queryBase(module); - // if (moduleList != null && moduleList.size() == 1) { - // module = moduleList.get(0); - // module.setUpdate(); - // module.setMenuName(mdmModuleEntity.getMdmName()); - // JSONObject object1 = new JSONObject(); - // object1.put("mdmId", mdmModuleEntity.getId());//主数据id - // object1.put("mdmCode", mdmModuleEntity.getMdmCode());//主数据id - // object1.put("viewType", mdmModuleViewEntity.getViewName());//1、树 2、列表 - // module.setOptions(object1.toString());//菜单mate参数 - // sysMenuConfigDao.update(module); - // //修改按钮 - // //1、查询所有按钮 - // SysButtonConfigEntity buttonConfigEntity = new SysButtonConfigEntity(); - // buttonConfigEntity.setMenuId(module.getId()); - // buttonConfigEntity.setSts("Y"); - // List sysButtonConfigEntities = sysButtonConfigDao.queryBase(buttonConfigEntity); - // //1、查询按钮权限 - // SysPopedomOperateEntity sysPopedomOperateEntity = new SysPopedomOperateEntity(); - // sysPopedomOperateEntity.setMenuId(module.getId()); - // sysPopedomOperateEntity.setSts("Y"); - // List sysPopedomOperateEntities = sysPopedomOperateDao.queryBase(sysPopedomOperateEntity); - // //删除按钮和删除按钮权限 - // sysButtonConfigDao.logicRemoveMultiCondition(buttonConfigEntity); - // sysPopedomOperateDao.logicRemoveMultiCondition(sysPopedomOperateEntity); - // //删除处理权限 - // doMdmModuleButton(module,mdmModuleViewButtonEntities,sysButtonConfigEntities,sysPopedomOperateEntities); - // } - // } - // return BaseResult.getSuccessMessageEntity("保存显示信息成功"); - //} - // - ///** - // * @Author lvleigang - // * @Description - // * @Date 3:29 下午 2024/6/4 - // * @param module 菜单 - // * @param mdmModuleViewButtonEntities 主数据按钮 - // * @param sysButtonConfigEntities 菜单按钮 - // * @param sysPopedomOperateEntities 按钮权限 - // * @return void - // **/ - //private void doMdmModuleButton(SysMenuConfigEntity module,List mdmModuleViewButtonEntities, List sysButtonConfigEntities, List sysPopedomOperateEntities) { - // //循环设置的按钮,再循环菜单的按钮,如果有把原先的修改状态,如果没有新增 - // if(mdmModuleViewButtonEntities != null && mdmModuleViewButtonEntities.size() > 0){ - // for (int i = 0; i < mdmModuleViewButtonEntities.size(); i++) { - // boolean flag = false; - // if(sysButtonConfigEntities != null && sysButtonConfigEntities.size() > 0){ - // for (int i1 = 0; i1 < sysButtonConfigEntities.size(); i1++) { - // if(mdmModuleViewButtonEntities.get(i).getButtonValue().equals(sysButtonConfigEntities.get(i1).getCode())){ - // flag = true; - // sysButtonConfigEntities.get(i1).setSts("Y"); - // sysButtonConfigEntities.get(i1).setUpdate(); - // sysButtonConfigDao.update(sysButtonConfigEntities.get(i1)); - // if(sysPopedomOperateEntities != null && sysPopedomOperateEntities.size() > 0){ - // for (int i2 = 0; i2 < sysPopedomOperateEntities.size(); i2++) { - // if(sysPopedomOperateEntities.get(i2).getOperate().equals(sysButtonConfigEntities.get(i1).getId())){ - // sysPopedomOperateEntities.get(i2).setSts("Y"); - // sysPopedomOperateEntities.get(i2).setUpdate(); - // sysPopedomOperateDao.update(sysPopedomOperateEntities.get(i2)); - // } - // } - // } - // break; - // } - // } - // } - // //原先没有需要新增 - // if(!flag){ - // if("new".equals(mdmModuleViewButtonEntities.get(i).getButtonValue())){ - // SysButtonConfigEntity xz = new SysButtonConfigEntity(); - // xz.setCode("new"); - // xz.setNameCh("新建"); - // xz.setNameEn("new"); - // xz.setMenuId(module.getId()); - // xz.setIconName(""); - // xz.setStyles(""); - // xz.setBtnFunction("new"); - // xz.setRemark("主数据新建按钮"); - // xz.setCreate(); - // sysButtonConfigDao.save(xz); - // } - // if("resize".equals(mdmModuleViewButtonEntities.get(i).getButtonValue())){ - // - // SysButtonConfigEntity cz = new SysButtonConfigEntity(); - // cz.setCode("resize"); - // cz.setNameCh("重置"); - // cz.setNameEn("resize"); - // cz.setMenuId(module.getId()); - // cz.setIconName(""); - // cz.setStyles(""); - // cz.setBtnFunction("resize"); - // cz.setRemark("主数据重置按钮"); - // cz.setCreate(); - // sysButtonConfigDao.save(cz); - // } - // if("search".equals(mdmModuleViewButtonEntities.get(i).getButtonValue())) { - // - // SysButtonConfigEntity cx = new SysButtonConfigEntity(); - // cx.setCode("search"); - // cx.setNameCh("查询"); - // cx.setNameEn("search"); - // cx.setMenuId(module.getId()); - // cx.setIconName(""); - // cx.setStyles(""); - // cx.setBtnFunction("search"); - // cx.setRemark("主数据查询按钮"); - // cx.setCreate(); - // sysButtonConfigDao.save(cx); - // } - // if("edit".equals(mdmModuleViewButtonEntities.get(i).getButtonValue())) { - // - // SysButtonConfigEntity xg = new SysButtonConfigEntity(); - // xg.setCode("edit"); - // xg.setNameCh("修改"); - // xg.setNameEn("edit"); - // xg.setMenuId(module.getId()); - // xg.setIconName(""); - // xg.setStyles(""); - // xg.setBtnFunction("edit"); - // xg.setRemark("主数据修改按钮"); - // xg.setCreate(); - // sysButtonConfigDao.save(xg); - // } - // if("dele".equals(mdmModuleViewButtonEntities.get(i).getButtonValue())) { - // - // SysButtonConfigEntity sc = new SysButtonConfigEntity(); - // sc.setCode("dele"); - // sc.setNameCh("删除"); - // sc.setNameEn("dele"); - // sc.setMenuId(module.getId()); - // sc.setIconName(""); - // sc.setStyles(""); - // sc.setBtnFunction("dele"); - // sc.setRemark("主数据删除按钮"); - // sc.setCreate(); - // sysButtonConfigDao.save(sc); - // } - // if("view".equals(mdmModuleViewButtonEntities.get(i).getButtonValue())) { - // - // SysButtonConfigEntity ck = new SysButtonConfigEntity(); - // ck.setCode("view"); - // ck.setNameCh("查看"); - // ck.setNameEn("view"); - // ck.setMenuId(module.getId()); - // ck.setIconName(""); - // ck.setStyles(""); - // ck.setBtnFunction("view"); - // ck.setRemark("主数据查看按钮"); - // ck.setCreate(); - // sysButtonConfigDao.save(ck); - // } - // if("send".equals(mdmModuleViewButtonEntities.get(i).getButtonValue())) { - // SysButtonConfigEntity xf = new SysButtonConfigEntity(); - // xf.setCode("send"); - // xf.setNameCh("下发"); - // xf.setNameEn("send"); - // xf.setMenuId(module.getId()); - // xf.setIconName(""); - // xf.setStyles(""); - // xf.setBtnFunction("send"); - // xf.setRemark("主数据下发按钮"); - // xf.setCreate(); - // sysButtonConfigDao.save(xf); - // } - // - // - // } - // } - // } - //} - // - ///** - // * @param object - // * @return com.hzya.frame.web.entity.JsonResultEntity - // * @Author lvleigang - // * @Description 主数据设置查询分发设置 - // * @Date 9:40 上午 2023/10/18 - // **/ - //@Override - //public JsonResultEntity queryMdmModuleDistribute(JSONObject object) { - // MdmDto entity = getData("jsonStr", object, MdmDto.class); - // if (entity == null) { - // return BaseResult.getFailureMessageEntity("参数不允许为空"); - // } - // if (entity.getMdmCode() == null || "".equals(entity.getMdmCode())) { - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // MdmModuleEntity mdmModuleEntity = mdmServiceCache.getMdmModuleEntity(entity.getMdmCode()); - // if(mdmModuleEntity == null || mdmModuleEntity.getId() == null){ - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // //查询模块下的应用列表 - // MdmModuleDistributeEntity mdmModuleDistributeEntity = new MdmModuleDistributeEntity(); - // mdmModuleDistributeEntity.setSts("Y"); - // mdmModuleDistributeEntity.setMdmId(mdmModuleEntity.getId()); - // List mdmModuleDistributeEntities = mdmServiceCache.queryMdmModuleDistribute(mdmModuleEntity.getId(),mdmModuleDistributeEntity); - // return BaseResult.getSuccessMessageEntity("查询成功", mdmModuleDistributeEntities); - //} - ///** - // * @param object - // * @return com.hzya.frame.web.entity.JsonResultEntity - // * @Author lvleigang - // * @Description 主数据设置保存分发设置 - // * @Date 9:40 上午 2023/10/18 - // **/ - //@Override - //public JsonResultEntity doSaveMdmModuleDistribute(JSONObject object) { - // MdmDistributeDto entity = getData("jsonStr", object, MdmDistributeDto.class); - // //判断是否有数据 - // if (entity == null) { - // return BaseResult.getFailureMessageEntity("参数不允许为空"); - // } - // if (entity.getMdmCode() == null || "".equals(entity.getMdmCode())) { - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // MdmModuleEntity mdmModuleEntity = mdmServiceCache.getMdmModuleEntity(entity.getMdmCode()); - // if(mdmModuleEntity == null || mdmModuleEntity.getId() == null){ - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // mdmServiceCache.saveMdmModuleDistribute(mdmModuleEntity.getId(),entity.getMdmModuleDistributeEntities()); - // return BaseResult.getSuccessMessageEntity("保存发布设置成功"); - //} - // - ///** - // * @param object - // * @return com.hzya.frame.web.entity.JsonResultEntity - // * @Author lvleigang - // * @Description 主数据设置查询数据来源 - // * @Date 9:40 上午 2023/10/18 - // **/ - //@Override - //public JsonResultEntity queryMdmModuleSource(JSONObject object) { - // MdmDto entity = getData("jsonStr", object, MdmDto.class); - // if (entity == null) { - // return BaseResult.getFailureMessageEntity("参数不允许为空"); - // } - // if (entity.getMdmCode() == null || "".equals(entity.getMdmCode())) { - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // MdmModuleEntity mdmModuleEntity = mdmServiceCache.getMdmModuleEntity(entity.getMdmCode()); - // if(mdmModuleEntity == null || mdmModuleEntity.getId() == null){ - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // //查询模块下的应用列表 - // MdmModuleSourceEntity mdmModuleSourceEntity = new MdmModuleSourceEntity(); - // mdmModuleSourceEntity.setSts("Y"); - // mdmModuleSourceEntity.setMdmId(mdmModuleEntity.getId()); - // List mdmModuleSourceEntities = mdmServiceCache.queryMdmModuleSource(mdmModuleSourceEntity); - // return BaseResult.getSuccessMessageEntity("查询成功", mdmModuleSourceEntities); - //} - ///** - // * @param object - // * @return com.hzya.frame.web.entity.JsonResultEntity - // * @Author lvleigang - // * @Description 主数据设置保存数据来源 - // * @Date 9:40 上午 2023/10/18 - // **/ - //@Override - //public JsonResultEntity doSaveMdmModuleSource(JSONObject object) { - // MdmSourceDto entity = getData("jsonStr", object, MdmSourceDto.class); - // //判断是否有数据 - // if (entity == null) { - // return BaseResult.getFailureMessageEntity("参数不允许为空"); - // } - // if (entity.getMdmCode() == null || "".equals(entity.getMdmCode())) { - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // MdmModuleEntity mdmModuleEntity = mdmServiceCache.getMdmModuleEntity(entity.getMdmCode()); - // if(mdmModuleEntity == null || mdmModuleEntity.getId() == null){ - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // mdmServiceCache.saveMdmModuleSource(mdmModuleEntity.getId(),entity.getMdmModuleSourceEntities()); - // return BaseResult.getSuccessMessageEntity("保存发布设置成功"); - //} - // - ///** - // * @param jsonObject - // * @return com.hzya.frame.web.entity.JsonResultEntity - // * @Author lvleigang - // * @Description 查询下发日志 - // * @Date 11:52 上午 2024/3/27 - // **/ - //@Override - //public JsonResultEntity querySendEntityPage(JSONObject jsonObject) { - // MdmModuleSendLogEntity entity = getData("jsonStr", jsonObject, MdmModuleSendLogEntity.class); - // //判断分页 - // if (entity == null || entity.getPageNum() == null || entity.getPageSize() == null) { - // return BaseResult.getFailureMessageEntity("分页查询参数不存在"); - // } - // if (entity.getMdmCode() == null || "".equals(entity.getMdmCode())) { - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // MdmModuleEntity mdmModuleEntity = mdmServiceCache.getMdmModuleEntity(entity.getMdmCode()); - // if(mdmModuleEntity == null || mdmModuleEntity.getId() == null){ - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); - // mdmModuleDbEntity.setMdmId(mdmModuleEntity.getId()); - // mdmModuleDbEntity.setSts("Y"); - // List mdmModuleDbEntities = mdmServiceCache.queryMdmModuleDb(mdmModuleDbEntity); - // if(mdmModuleDbEntities != null && mdmModuleDbEntities.size() > 0 ){ - // for (int i = 0; i < mdmModuleDbEntities.size(); i++) { - // if("1".equals(mdmModuleDbEntities.get(i).getDbType())){ - // entity.setTableName(mdmModuleDbEntities.get(i).getDbName()+"_send_log"); - // break; - // } - // } - // }else { - // return BaseResult.getFailureMessageEntity("请先设置数据源"); - // } - // PageHelper.startPage(entity.getPageNum(), entity.getPageSize()); - // List list = mdmModuleSendLogDao.queryByLike(entity); - // PageInfo pageInfo = new PageInfo(list); - // return BaseResult.getSuccessMessageEntity("查询数据成功", pageInfo); - //} - // - ///** - // * @param jsonObject - // * @return com.hzya.frame.web.entity.JsonResultEntity - // * @Author lvleigang - // * @Description 获取下发日志 - // * @Date 2:36 下午 2024/3/27 - // **/ - //@Override - //public JsonResultEntity getSendEntity(JSONObject jsonObject) { - // MdmModuleSendLogEntity entity = getData("jsonStr", jsonObject, MdmModuleSendLogEntity.class); - // if (entity == null) { - // return BaseResult.getFailureMessageEntity("参数不允许为空"); - // } - // if (entity.getId() == null || "".equals(entity.getId())) { - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // if (entity.getMdmCode() == null || "".equals(entity.getMdmCode())) { - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // MdmModuleEntity mdmModuleEntity = mdmServiceCache.getMdmModuleEntity(entity.getMdmCode()); - // if(mdmModuleEntity == null || mdmModuleEntity.getId() == null){ - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); - // mdmModuleDbEntity.setMdmId(mdmModuleEntity.getId()); - // mdmModuleDbEntity.setSts("Y"); - // List mdmModuleDbEntities = mdmServiceCache.queryMdmModuleDb(mdmModuleDbEntity); - // if(mdmModuleDbEntities != null && mdmModuleDbEntities.size() > 0 ){ - // for (int i = 0; i < mdmModuleDbEntities.size(); i++) { - // if("1".equals(mdmModuleDbEntities.get(i).getDbType())){ - // entity.setTableName(mdmModuleDbEntities.get(i).getDbName()+"_send_log"); - // break; - // } - // } - // }else { - // return BaseResult.getFailureMessageEntity("请先设置数据源"); - // } - // entity = mdmModuleSendLogDao.get(entity.getId()); - // if (entity == null) { - // return BaseResult.getFailureMessageEntity("获取日志失败"); - // } - // return BaseResult.getSuccessMessageEntity("获取日志成功", entity); - //} - // - ///** - // * @param jsonObject - // * @return com.hzya.frame.web.entity.JsonResultEntity - // * @Author lvleigang - // * @Description 删除下发日志 - // * @Date 2:37 下午 2024/3/27 - // **/ - //@Override - //public JsonResultEntity deleteSendEntity(JSONObject jsonObject) { - // MdmModuleSendLogEntity entity = getData("jsonStr", jsonObject, MdmModuleSendLogEntity.class); - // if (entity == null) { - // return BaseResult.getFailureMessageEntity("参数不允许为空"); - // } - // if (entity.getId() == null || "".equals(entity.getId())) { - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // if (entity.getMdmCode() == null || "".equals(entity.getMdmCode())) { - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // MdmModuleEntity mdmModuleEntity = mdmServiceCache.getMdmModuleEntity(entity.getMdmCode()); - // if(mdmModuleEntity == null || mdmModuleEntity.getId() == null){ - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); - // mdmModuleDbEntity.setMdmId(mdmModuleEntity.getId()); - // mdmModuleDbEntity.setSts("Y"); - // List mdmModuleDbEntities = mdmServiceCache.queryMdmModuleDb(mdmModuleDbEntity); - // if(mdmModuleDbEntities != null && mdmModuleDbEntities.size() > 0 ){ - // for (int i = 0; i < mdmModuleDbEntities.size(); i++) { - // if("1".equals(mdmModuleDbEntities.get(i).getDbType())){ - // entity.setTableName(mdmModuleDbEntities.get(i).getDbName()+"_send_log"); - // break; - // } - // } - // }else { - // return BaseResult.getFailureMessageEntity("请先设置数据源"); - // } - // entity.setUpdate(); - // mdmModuleSendLogDao.logicRemove(entity); - // return BaseResult.getSuccessMessageEntity("删除日志成功"); - //} - // - // - // - ///** - // * @param jsonObject - // * @return com.hzya.frame.web.entity.JsonResultEntity - // * @Author lvleigang - // * @Description 查询操作日志 - // * @Date 11:52 上午 2024/3/27 - // **/ - //@Override - //public JsonResultEntity queryOptionEntityPage(JSONObject jsonObject) { - // MdmModuleOptionLogEntity entity = getData("jsonStr", jsonObject, MdmModuleOptionLogEntity.class); - // //判断分页 - // if (entity == null || entity.getPageNum() == null || entity.getPageSize() == null) { - // return BaseResult.getFailureMessageEntity("分页查询参数不存在"); - // } - // if (entity.getMdmCode() == null || "".equals(entity.getMdmCode())) { - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // MdmModuleEntity mdmModuleEntity = mdmServiceCache.getMdmModuleEntity(entity.getMdmCode()); - // if(mdmModuleEntity == null || mdmModuleEntity.getId() == null){ - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); - // mdmModuleDbEntity.setMdmId(mdmModuleEntity.getId()); - // mdmModuleDbEntity.setSts("Y"); - // List mdmModuleDbEntities = mdmServiceCache.queryMdmModuleDb(mdmModuleDbEntity); - // if(mdmModuleDbEntities != null && mdmModuleDbEntities.size() > 0 ){ - // for (int i = 0; i < mdmModuleDbEntities.size(); i++) { - // if("1".equals(mdmModuleDbEntities.get(i).getDbType())){ - // entity.setTableName(mdmModuleDbEntities.get(i).getDbName()+"_option_log"); - // break; - // } - // } - // }else { - // return BaseResult.getFailureMessageEntity("请先设置数据源"); - // } - // PageHelper.startPage(entity.getPageNum(), entity.getPageSize()); - // List list = mdmModuleOptionLogDao.queryByLike(entity); - // PageInfo pageInfo = new PageInfo(list); - // return BaseResult.getSuccessMessageEntity("查询数据成功", pageInfo); - //} - // - ///** - // * @param jsonObject - // * @return com.hzya.frame.web.entity.JsonResultEntity - // * @Author lvleigang - // * @Description 获取操作日志 - // * @Date 2:36 下午 2024/3/27 - // **/ - //@Override - //public JsonResultEntity getOptionEntity(JSONObject jsonObject) { - // MdmModuleOptionLogEntity entity = getData("jsonStr", jsonObject, MdmModuleOptionLogEntity.class); - // if (entity == null) { - // return BaseResult.getFailureMessageEntity("参数不允许为空"); - // } - // if (entity.getId() == null || "".equals(entity.getId())) { - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // if (entity.getMdmCode() == null || "".equals(entity.getMdmCode())) { - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // MdmModuleEntity mdmModuleEntity = mdmServiceCache.getMdmModuleEntity(entity.getMdmCode()); - // if(mdmModuleEntity == null || mdmModuleEntity.getId() == null){ - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); - // mdmModuleDbEntity.setMdmId(mdmModuleEntity.getId()); - // mdmModuleDbEntity.setSts("Y"); - // List mdmModuleDbEntities = mdmServiceCache.queryMdmModuleDb(mdmModuleDbEntity); - // if(mdmModuleDbEntities != null && mdmModuleDbEntities.size() > 0 ){ - // for (int i = 0; i < mdmModuleDbEntities.size(); i++) { - // if("1".equals(mdmModuleDbEntities.get(i).getDbType())){ - // entity.setTableName(mdmModuleDbEntities.get(i).getDbName()+"_option_log"); - // break; - // } - // } - // }else { - // return BaseResult.getFailureMessageEntity("请先设置数据源"); - // } - // entity = mdmModuleOptionLogDao.get(entity.getId()); - // if (entity == null) { - // return BaseResult.getFailureMessageEntity("获取日志失败"); - // } - // return BaseResult.getSuccessMessageEntity("获取日志成功", entity); - //} - // - ///** - // * @param jsonObject - // * @return com.hzya.frame.web.entity.JsonResultEntity - // * @Author lvleigang - // * @Description 删除操作日志 - // * @Date 2:37 下午 2024/3/27 - // **/ - //@Override - //public JsonResultEntity deleteOptionEntity(JSONObject jsonObject) { - // MdmModuleOptionLogEntity entity = getData("jsonStr", jsonObject, MdmModuleOptionLogEntity.class); - // if (entity == null) { - // return BaseResult.getFailureMessageEntity("参数不允许为空"); - // } - // if (entity.getId() == null || "".equals(entity.getId())) { - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // if (entity.getMdmCode() == null || "".equals(entity.getMdmCode())) { - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // MdmModuleEntity mdmModuleEntity = mdmServiceCache.getMdmModuleEntity(entity.getMdmCode()); - // if(mdmModuleEntity == null || mdmModuleEntity.getId() == null){ - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); - // mdmModuleDbEntity.setMdmId(mdmModuleEntity.getId()); - // mdmModuleDbEntity.setSts("Y"); - // List mdmModuleDbEntities = mdmServiceCache.queryMdmModuleDb(mdmModuleDbEntity); - // if(mdmModuleDbEntities != null && mdmModuleDbEntities.size() > 0 ){ - // for (int i = 0; i < mdmModuleDbEntities.size(); i++) { - // if("1".equals(mdmModuleDbEntities.get(i).getDbType())){ - // entity.setTableName(mdmModuleDbEntities.get(i).getDbName()+"_option_log"); - // break; - // } - // } - // }else { - // return BaseResult.getFailureMessageEntity("请先设置数据源"); - // } - // entity.setUpdate(); - // mdmModuleOptionLogDao.logicRemove(entity); - // return BaseResult.getSuccessMessageEntity("删除日志成功"); - //} - ///** - // * @param object - // * @return com.hzya.frame.web.entity.JsonResultEntity - // * @Author lvleigang - // * @Description 主数据设置查询数据源的服务 - // * @Date 9:40 上午 2023/10/18 - // **/ - //@Override - //public JsonResultEntity queryMdmModuleServer(JSONObject object) { - // MdmModuleDbEntity entity = getData("jsonStr", object, MdmModuleDbEntity.class); - // //判断分页 - // if (entity == null) { - // entity = new MdmModuleDbEntity(); - // } - // //查询数据源表 - // entity.setSts("Y"); - // List allDb = mdmModuleDbDao.queryByLike(entity); - // List mdmModuleDbEntityList = new ArrayList<>(); - // if(allDb != null && allDb.size() > 0){ - // for (int i = 0; i < allDb.size(); i++) { - // if("1".equals(allDb.get(i).getDbType()) || "2".equals(allDb.get(i).getDbType() )){ - // mdmModuleDbEntityList.add(allDb.get(i)); - // } - // } - // } - // return BaseResult.getSuccessMessageEntity("查询数据成功", mdmModuleDbEntityList); - //} - // - ///** - // * @param object - // * @return com.hzya.frame.web.entity.JsonResultEntity - // * @Author lvleigang - // * @Description 主数据设置查询数据源的服务的字段 - // * @Date 9:40 上午 2023/10/18 - // **/ - //@Override - //public JsonResultEntity queryMdmModuleServerFiled(JSONObject object) { - // MdmModuleDbEntity entity = getData("jsonStr", object, MdmModuleDbEntity.class); - // //判断分页 - // if (entity == null) { - // return BaseResult.getFailureMessageEntity("参数不允许为空"); - // } - // if (entity.getDbName() == null || "".equals(entity.getDbName())) { - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // //查询数据源表 - // entity.setSts("Y"); - // List dblist = mdmModuleDbDao.queryBase(entity); - // if (dblist != null && dblist.size() == 1) { - // MdmModuleDbFiledsEntity queryDbFiled = new MdmModuleDbFiledsEntity(); - // queryDbFiled.setSts("Y"); - // queryDbFiled.setDbId(dblist.get(0).getId()); - // queryDbFiled.setViewType("1"); - // List list = mdmModuleDbFiledsDao.queryBase(queryDbFiled); - // MdmModuleDbFiledsEntity mdmModuleDbFiledsEntity = new MdmModuleDbFiledsEntity(); - // mdmModuleDbFiledsEntity.setChName("id"); - // mdmModuleDbFiledsEntity.setEnName("id"); - // list.add(0, mdmModuleDbFiledsEntity); - // return BaseResult.getSuccessMessageEntity("查询数据成功", list); - // } else { - // return BaseResult.getFailureMessageEntity("服务不存在"); - // } - //} - //// - //// - ///** - // * @param object - // * @return com.hzya.frame.web.entity.JsonResultEntity - // * @Author lvleigang - // * @Description 主数据设置查询主表字段 - // * @Date 9:40 上午 2023/10/18 - // **/ - //@Override - //public JsonResultEntity queryMdmModuleServerMainFiled(JSONObject object) { - // MdmModuleDbEntity entity = getData("jsonStr", object, MdmModuleDbEntity.class); - // //判断分页 - // if (entity == null) { - // return BaseResult.getFailureMessageEntity("参数不允许为空"); - // } - // if (entity.getMdmId() == null || "".equals(entity.getMdmId())) { - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // //查询数据源表 - // entity.setSts("Y"); - // entity.setDbType("1"); - // List mdmModuleDbEntityList = mdmModuleDbDao.queryBase(entity); - // if (mdmModuleDbEntityList != null && mdmModuleDbEntityList.size() == 1) { - // MdmModuleDbFiledsEntity mdmModuleDbFiledsEntity = new MdmModuleDbFiledsEntity(); - // mdmModuleDbFiledsEntity.setSts("Y"); - // mdmModuleDbFiledsEntity.setViewType("1"); - // mdmModuleDbFiledsEntity.setDbId(mdmModuleDbEntityList.get(0).getId()); - // List list = mdmModuleDbFiledsDao.queryBase(mdmModuleDbFiledsEntity); - // return BaseResult.getSuccessMessageEntity("查询数据成功", list); - // } else if (mdmModuleDbEntityList != null && mdmModuleDbEntityList.size() == 0) { - // return BaseResult.getFailureMessageEntity("请先配置数据源"); - // } else { - // return BaseResult.getFailureMessageEntity("查询数据失败"); - // } - //} - // - // - // - //// - /////** - //// * @param entity - //// * @param mainMdmModuleDb - //// * @param mainMdmModuleDbFileds - //// * @return void - //// * @Author lvleigang - //// * @Description 设置保存主表和字段以及字段的属性 - //// * @Date 10:34 上午 2023/10/19 - //// **/ - ////private void setMainTable(MdmDto entity, MdmModuleDbEntity mainMdmModuleDb, List mainMdmModuleDbFileds) { - //// //先保存或修改主表数据 - //// mainMdmModuleDb.setMdmId(entity.getId()); - //// mainMdmModuleDb.setDbType("1"); - //// boolean flag = false; - //// - //// if (mainMdmModuleDb.getId() != null && !"".equals(mainMdmModuleDb.getId())) { - //// mainMdmModuleDb.setSts("Y"); - //// mainMdmModuleDb.setModify_user_id(StpUtil.getLoginIdAsString()); - //// mainMdmModuleDb.setModify_time(new Date()); - //// mdmModuleDbDao.update(mainMdmModuleDb); - //// //删除规则表 - //// MdmModuleDbFiledsRuleEntity delectFiledsRule = new MdmModuleDbFiledsRuleEntity(); - //// delectFiledsRule.setMdmId(entity.getId()); - //// delectFiledsRule.setModify_user_id(StpUtil.getLoginIdAsString()); - //// delectFiledsRule.setModify_time(new Date()); - //// mdmModuleDbFiledsRuleDao.logicRemoveMultiCondition(delectFiledsRule); - //// } else { - //// flag = true; - //// mainMdmModuleDb.setId(UUIDUtils.getUUID()); - //// mainMdmModuleDb.setSts("Y"); - //// mainMdmModuleDb.setCreate_user_id(StpUtil.getLoginIdAsString()); - //// mainMdmModuleDb.setModify_user_id(StpUtil.getLoginIdAsString()); - //// mainMdmModuleDb.setCreate_time(new Date()); - //// mainMdmModuleDb.setModify_time(new Date()); - //// mdmModuleDbDao.save(mainMdmModuleDb); - //// } - //// List dbFiledsDtos = new ArrayList<>(); - //// - //// //保存主表字段 因为字段不允许删除,所以不用先删除再新增 - //// if (mainMdmModuleDbFileds != null && mainMdmModuleDbFileds.size() > 0) { - //// for (int i = 0; i < mainMdmModuleDbFileds.size(); i++) { - //// MdmModuleDbFiledsEntity mdmModuleDbFiledsEntity = mainMdmModuleDbFileds.get(i); - //// mdmModuleDbFiledsEntity.setMdmId(entity.getId()); - //// mdmModuleDbFiledsEntity.setDbId(mainMdmModuleDb.getId()); - //// if (mdmModuleDbFiledsEntity.getId() != null && !"".equals(mdmModuleDbFiledsEntity.getId())) { - //// DbFiledsDto dbFiledsDto = new DbFiledsDto("1", mdmModuleDbFiledsEntity.getChName(), mdmModuleDbFiledsEntity.getEnName(), mdmModuleDbFiledsEntity.getFiledType(), mdmModuleDbFiledsEntity.getFiledLength()); - //// dbFiledsDtos.add(dbFiledsDto); - //// - //// mdmModuleDbFiledsEntity.setSts("Y"); - //// mdmModuleDbFiledsEntity.setModify_user_id(StpUtil.getLoginIdAsString()); - //// mdmModuleDbFiledsEntity.setModify_time(new Date()); - //// mdmModuleDbFiledsDao.update(mdmModuleDbFiledsEntity); - //// } else { - //// DbFiledsDto dbFiledsDto = new DbFiledsDto("2", mdmModuleDbFiledsEntity.getChName(), mdmModuleDbFiledsEntity.getEnName(), mdmModuleDbFiledsEntity.getFiledType(), mdmModuleDbFiledsEntity.getFiledLength()); - //// dbFiledsDtos.add(dbFiledsDto); - //// mdmModuleDbFiledsEntity.setId(UUIDUtils.getUUID()); - //// mdmModuleDbFiledsEntity.setSts("Y"); - //// mdmModuleDbFiledsEntity.setCreate_user_id(StpUtil.getLoginIdAsString()); - //// mdmModuleDbFiledsEntity.setModify_user_id(StpUtil.getLoginIdAsString()); - //// mdmModuleDbFiledsEntity.setCreate_time(new Date()); - //// mdmModuleDbFiledsEntity.setModify_time(new Date()); - //// mdmModuleDbFiledsDao.save(mdmModuleDbFiledsEntity); - //// } - //// //修改或保存属性 - //// List mdmModuleDbFiledsRules = mdmModuleDbFiledsEntity.getMdmModuleDbFiledsRules(); - //// if (mdmModuleDbFiledsRules != null && mdmModuleDbFiledsRules.size() > 0) { - //// for (int a = 0; a < mdmModuleDbFiledsRules.size(); a++) { - //// MdmModuleDbFiledsRuleEntity mdmModuleDbFiledsRuleEntity = mdmModuleDbFiledsRules.get(a); - //// mdmModuleDbFiledsRuleEntity.setMdmId(entity.getId()); - //// mdmModuleDbFiledsRuleEntity.setDbId(mainMdmModuleDb.getId()); - //// mdmModuleDbFiledsRuleEntity.setFiledId(mdmModuleDbFiledsEntity.getId()); - //// if (mdmModuleDbFiledsRuleEntity.getId() != null && !"".equals(mdmModuleDbFiledsRuleEntity.getId())) { - //// mdmModuleDbFiledsRuleEntity.setSts("Y"); - //// mdmModuleDbFiledsRuleEntity.setModify_user_id(StpUtil.getLoginIdAsString()); - //// mdmModuleDbFiledsRuleEntity.setModify_time(new Date()); - //// mdmModuleDbFiledsRuleDao.update(mdmModuleDbFiledsRuleEntity); - //// } else { - //// mdmModuleDbFiledsRuleEntity.setId(UUIDUtils.getUUID()); - //// mdmModuleDbFiledsRuleEntity.setSts("Y"); - //// mdmModuleDbFiledsRuleEntity.setCreate_user_id(StpUtil.getLoginIdAsString()); - //// mdmModuleDbFiledsRuleEntity.setModify_user_id(StpUtil.getLoginIdAsString()); - //// mdmModuleDbFiledsRuleEntity.setCreate_time(new Date()); - //// mdmModuleDbFiledsRuleEntity.setModify_time(new Date()); - //// mdmModuleDbFiledsRuleDao.save(mdmModuleDbFiledsRuleEntity); - //// } - //// } - //// } - //// } - //// } - //// if (flag) { - //// //新增 - //// Map maps = new HashMap<>(); - //// maps.put("dbType", "1");//表类型 - //// maps.put("tableName", mainMdmModuleDb.getDbName());//表名 - //// maps.put("tableRemark", mainMdmModuleDb.getRemark());//表备注 - //// maps.put("databaseFields", dbFiledsDtos);//字段 - //// mdmModuleDao.createTable(maps); - //// Map mapsDistribute = new HashMap<>(); - //// mapsDistribute.put("tableName", mainMdmModuleDb.getDbName() + "_distribute");//表名 - //// List distribute = getDistribute(); - //// maps.put("databaseFields", distribute);//字段 - //// mapsDistribute.put("tableRemark", mainMdmModuleDb.getRemark() + "分发表");//表备注 - //// mdmModuleDao.createTableDistribute(mapsDistribute); - //// } else { - //// //修改 - //// Map tablename = new HashMap<>(); - //// tablename.put("tableName", mainMdmModuleDb.getDbName());//表名 - //// tablename.put("tableRemark", mainMdmModuleDb.getRemark());//表备注 - //// mdmModuleDao.alterTableName(tablename); - //// Map maps = new HashMap<>(); - //// maps.put("tableName", mainMdmModuleDb.getDbName());//表名 - //// maps.put("tableRemark", mainMdmModuleDb.getRemark());//表备注 - //// maps.put("databaseFields", dbFiledsDtos);//字段 - //// mdmModuleDao.alterTable(maps); - //// } - ////} - //// - /////** - //// * @param - //// * @return java.util.List - //// * @Author lvleigang - //// * @Description 设置分发表字段 - //// * @Date 8:49 上午 2023/11/9 - //// **/ - ////private List getDistribute() { - //// List dbFiledsDtos = new ArrayList<>(); - //// dbFiledsDtos.add(new DbFiledsDto("1", "数据id", "formmain_id", "3", "50")); - //// dbFiledsDtos.add(new DbFiledsDto("1", "应用id", "app_id", "3", "50")); - //// dbFiledsDtos.add(new DbFiledsDto("1", "状态1、发送成功 2、发送中 3、发送失败", "status", "3", "50")); - //// dbFiledsDtos.add(new DbFiledsDto("1", "描述", "msg", "3", "50")); - //// return dbFiledsDtos; - ////} - //// - ///** - // * @param tableName - // * @return java.lang.Long - // * @Author lvleigang - // * @Description 校验表是否存在 - // * @Date 3:58 下午 2023/7/11 - // **/ - //private boolean checkTable(String tableName) { - // Map maps = new HashMap<>(); - // maps.put("tableName", tableName); - // Integer i = mdmModuleDao.checkTable(maps); - // if (i != null && i > 0) { - // return true; - // } - // return false; - //} - //// - /////** - //// * @param object - //// * @return com.hzya.frame.web.entity.JsonResultEntity - //// * @Author lvleigang - //// * @Description 主数据设置查询显示信息 - //// * @Date 9:40 上午 2023/10/18 - //// **/ - ////@Override - ////public JsonResultEntity queryMdmModuleView(JSONObject object) { - //// MdmDto entity = getData("jsonStr", object, MdmDto.class); - //// if (entity == null) { - //// return BaseResult.getFailureMessageEntity("参数不允许为空"); - //// } - //// if (entity.getId() == null || "".equals(entity.getId())) { - //// return BaseResult.getFailureMessageEntity("系统错误"); - //// } - //// MdmModuleViewVo mdmModuleViewVo = new MdmModuleViewVo(); - //// //查询设置各种类型字段 - //// //查询模版数据源 - //// MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); - //// mdmModuleDbEntity.setMdmId(entity.getId()); - //// mdmModuleDbEntity.setSts("Y"); - //// List mdmModuleDbEntityList = mdmModuleDbDao.queryBase(mdmModuleDbEntity); - //// if (mdmModuleDbEntityList != null && mdmModuleDbEntityList.size() > 0) { - //// MdmModuleDbFiledsEntity mdmModuleDbFiledsEntity = new MdmModuleDbFiledsEntity(); - //// mdmModuleDbFiledsEntity.setMdmId(entity.getId()); - //// mdmModuleDbFiledsEntity.setSts("Y"); - //// List mdmModuleDbFiledsEntityList = mdmModuleDbFiledsDao.queryBase(mdmModuleDbFiledsEntity); - //// setFiledType(mdmModuleViewVo, mdmModuleDbEntityList, mdmModuleDbFiledsEntityList); - //// } - //// //查询数据库设置的字段 - //// MdmModuleViewEntity mdmModuleViewEntity = new MdmModuleViewEntity(); - //// mdmModuleViewEntity.setMdmId(entity.getId()); - //// mdmModuleViewEntity.setSts("Y"); - //// List moduleViewEntityList = mdmModuleViewDao.queryBase(mdmModuleViewEntity); - //// if (moduleViewEntityList != null && moduleViewEntityList.size() == 1) { - //// mdmModuleViewVo.setMdmModuleViewEntity(moduleViewEntityList.get(0)); - //// //查询明细 - //// MdmModuleViewDetailEntity mdmModuleViewDetailEntity = new MdmModuleViewDetailEntity(); - //// mdmModuleViewDetailEntity.setMdmId(entity.getId()); - //// mdmModuleViewDetailEntity.setViewId(moduleViewEntityList.get(0).getId()); - //// mdmModuleViewDetailEntity.setSts("Y"); - //// List mdmModuleViewDetailEntityList = mdmModuleViewDetailDao.queryBase(mdmModuleViewDetailEntity); - //// setDbFiledType(mdmModuleViewVo, mdmModuleViewDetailEntityList); - //// } else { - //// mdmModuleViewVo.setMdmModuleViewEntity(new MdmModuleViewEntity()); - //// mdmModuleViewVo.setDbAddFiled(new ArrayList<>()); - //// mdmModuleViewVo.setDbEditFiled(new ArrayList<>()); - //// mdmModuleViewVo.setDbShowFiled(new ArrayList<>()); - //// mdmModuleViewVo.setDbQueryFiled(new ArrayList<>()); - //// mdmModuleViewVo.setDbListFiled(new ArrayList<>()); - //// } - //// return BaseResult.getSuccessMessageEntity("查询视图成功", mdmModuleViewVo); - ////} - //// - ////private void setDbFiledType(MdmModuleViewVo mdmModuleViewVo, List mdmModuleViewDetailEntityList) { - //// //新增 - //// List addFiled = new ArrayList<>(); - //// //修改 - //// List editFiled = new ArrayList<>(); - //// //查看 - //// List showFiled = new ArrayList<>(); - //// //查询 - //// List queryFiled = new ArrayList<>(); - //// //列表 - //// List listFiled = new ArrayList<>(); - //// if (mdmModuleViewDetailEntityList != null && mdmModuleViewDetailEntityList.size() > 0) { - //// for (int i = 0; i < mdmModuleViewDetailEntityList.size(); i++) { - //// switch (mdmModuleViewDetailEntityList.get(i).getViewType()) { - //// //1、查询2、列表3、新增4、修改 5、查看 - //// case "1": - //// queryFiled.add(mdmModuleViewDetailEntityList.get(i)); - //// break; - //// case "2": - //// listFiled.add(mdmModuleViewDetailEntityList.get(i)); - //// break; - //// case "3": - //// addFiled.add(mdmModuleViewDetailEntityList.get(i)); - //// break; - //// case "4": - //// editFiled.add(mdmModuleViewDetailEntityList.get(i)); - //// break; - //// case "5": - //// showFiled.add(mdmModuleViewDetailEntityList.get(i)); - //// break; - //// default: - //// } - //// } - //// } - //// mdmModuleViewVo.setDbAddFiled(addFiled); - //// mdmModuleViewVo.setDbEditFiled(editFiled); - //// mdmModuleViewVo.setDbShowFiled(showFiled); - //// mdmModuleViewVo.setDbQueryFiled(queryFiled); - //// mdmModuleViewVo.setDbListFiled(listFiled); - ////} - //// - /////** - //// * @param mdmModuleViewVo - //// * @param mdmModuleDbEntityList - //// * @param mdmModuleDbFiledsEntityList - //// * @return void - //// * @Author lvleigang - //// * @Description 设置对应的字段类型 - //// * @Date 2023/10/25 - //// **/ - ////private void setFiledType(MdmModuleViewVo mdmModuleViewVo, List mdmModuleDbEntityList, List mdmModuleDbFiledsEntityList) { - //// //新增 - //// List addFiled = new ArrayList<>(); - //// //修改 - //// List editFiled = new ArrayList<>(); - //// //查看 - //// List showFiled = new ArrayList<>(); - //// //查询 - //// List queryFiled = new ArrayList<>(); - //// //列表 - //// List listFiled = new ArrayList<>(); - //// if (mdmModuleDbEntityList != null && mdmModuleDbEntityList.size() > 0) { - //// for (int i = 0; i < mdmModuleDbEntityList.size(); i++) { - //// if (mdmModuleDbFiledsEntityList != null && mdmModuleDbFiledsEntityList.size() > 0) { - //// for (int i1 = 0; i1 < mdmModuleDbFiledsEntityList.size(); i1++) { - //// if (mdmModuleDbEntityList.get(i).getId().equals(mdmModuleDbFiledsEntityList.get(i1).getDbId())) { - //// if ("1".equals(mdmModuleDbEntityList.get(i).getDbType())) { - //// //1、主表 - //// addFiled.add(new MdmDbFiledVo(mdmModuleDbFiledsEntityList.get(i1).getId(), "【主表:" + mdmModuleDbEntityList.get(i).getDbName() + "】" + mdmModuleDbFiledsEntityList.get(i1).getChName())); - //// editFiled.add(new MdmDbFiledVo(mdmModuleDbFiledsEntityList.get(i1).getId(), "【主表:" + mdmModuleDbEntityList.get(i).getDbName() + "】" + mdmModuleDbFiledsEntityList.get(i1).getChName())); - //// showFiled.add(new MdmDbFiledVo(mdmModuleDbFiledsEntityList.get(i1).getId(), "【主表:" + mdmModuleDbEntityList.get(i).getDbName() + "】" + mdmModuleDbFiledsEntityList.get(i1).getChName())); - //// queryFiled.add(new MdmDbFiledVo(mdmModuleDbFiledsEntityList.get(i1).getId(), "【主表:" + mdmModuleDbEntityList.get(i).getDbName() + "】" + mdmModuleDbFiledsEntityList.get(i1).getChName())); - //// listFiled.add(new MdmDbFiledVo(mdmModuleDbFiledsEntityList.get(i1).getId(), "【主表:" + mdmModuleDbEntityList.get(i).getDbName() + "】" + mdmModuleDbFiledsEntityList.get(i1).getChName())); - //// } else { - //// //2、明细 - //// queryFiled.add(new MdmDbFiledVo(mdmModuleDbFiledsEntityList.get(i1).getId(), "【子表:" + mdmModuleDbEntityList.get(i).getDbName() + "】" + mdmModuleDbFiledsEntityList.get(i1).getChName())); - //// addFiled.add(new MdmDbFiledVo(mdmModuleDbFiledsEntityList.get(i1).getId(), "【子表:" + mdmModuleDbEntityList.get(i).getDbName() + "】" + mdmModuleDbFiledsEntityList.get(i1).getChName())); - //// editFiled.add(new MdmDbFiledVo(mdmModuleDbFiledsEntityList.get(i1).getId(), "【子表:" + mdmModuleDbEntityList.get(i).getDbName() + "】" + mdmModuleDbFiledsEntityList.get(i1).getChName())); - //// showFiled.add(new MdmDbFiledVo(mdmModuleDbFiledsEntityList.get(i1).getId(), "【子表:" + mdmModuleDbEntityList.get(i).getDbName() + "】" + mdmModuleDbFiledsEntityList.get(i1).getChName())); - //// } - //// } - //// } - //// } - //// } - //// } - //// mdmModuleViewVo.setAddFiled(addFiled); - //// mdmModuleViewVo.setEditFiled(editFiled); - //// mdmModuleViewVo.setShowFiled(showFiled); - //// mdmModuleViewVo.setQueryFiled(queryFiled); - //// mdmModuleViewVo.setListFiled(listFiled); - ////} - //// - //// - // - //// - ///** - // * @param mdmDbFiledVoList - // * @param type - // * @return void - // * @Author lvleigang - // * @Description 保存数据 - // * @Date 1:37 下午 2023/10/25 - // **/ - //private void saveDbViewFiled(String mdmID, String viewid, List mdmDbFiledVoList, String type,List mdmModuleViewDetailEntities) { - // if (mdmDbFiledVoList != null && mdmDbFiledVoList.size() > 0) { - // for (int i = 0; i < mdmDbFiledVoList.size(); i++) { - // MdmModuleViewDetailEntity mdmModuleViewDetailEntity = new MdmModuleViewDetailEntity(); - // mdmModuleViewDetailEntity.setCreate(); - // mdmModuleViewDetailEntity.setMdmId(mdmID); - // mdmModuleViewDetailEntity.setViewId(viewid); - // mdmModuleViewDetailEntity.setViewFiled(mdmDbFiledVoList.get(i).getId()); - // mdmModuleViewDetailEntity.setViewType(type); - // mdmModuleViewDetailEntity.setDataType("1"); - // mdmModuleViewDetailEntities.add(mdmModuleViewDetailEntity); - // } - // } - //} - //// - /////** - //// * @param object - //// * @return com.hzya.frame.web.entity.JsonResultEntity - //// * @Author lvleigang - //// * @Description 主数据设置查询权限配置 - //// * @Date 9:40 上午 2023/10/18 - //// **/ - ////@Override - ////public JsonResultEntity queryMdmModuleRule(JSONObject object) { - //// MdmDto entity = getData("jsonStr", object, MdmDto.class); - //// if (entity == null) { - //// return BaseResult.getFailureMessageEntity("参数不允许为空"); - //// } - //// if (entity.getId() == null || "".equals(entity.getId())) { - //// return BaseResult.getFailureMessageEntity("系统错误"); - //// } - //// //查询模块下的角色列表 - //// MdmModuleRoleEntity mdmModuleRoleEntity = new MdmModuleRoleEntity(); - //// mdmModuleRoleEntity.setSts("Y"); - //// mdmModuleRoleEntity.setMdmId(entity.getId()); - //// List mdmModuleRoleEntities = mdmModuleRoleDao.queryBase(mdmModuleRoleEntity); - //// if (mdmModuleRoleEntities != null && mdmModuleRoleEntities.size() > 0) { - //// MdmModuleRoleButtonEntity mdmModuleRoleButtonEntity = new MdmModuleRoleButtonEntity(); - //// mdmModuleRoleButtonEntity.setSts("Y"); - //// mdmModuleRoleButtonEntity.setMdmId(entity.getId()); - //// List mdmModuleRoleButtonEntities = mdmModuleRoleButtonDao.queryBase(mdmModuleRoleButtonEntity); - //// if (mdmModuleRoleButtonEntities != null && mdmModuleRoleButtonEntities.size() > 0) { - //// for (int i = 0; i < mdmModuleRoleEntities.size(); i++) { - //// List list = new ArrayList<>(); - //// for (int i1 = 0; i1 < mdmModuleRoleButtonEntities.size(); i1++) { - //// if (mdmModuleRoleEntities.get(i).getRoleId().equals(mdmModuleRoleButtonEntities.get(i1).getRoleId())) { - //// list.add(mdmModuleRoleButtonEntities.get(i1)); - //// } - //// } - //// mdmModuleRoleEntities.get(i).setMdmModuleRoleButtonEntities(list); - //// } - //// } - //// } - //// return BaseResult.getSuccessMessageEntity("查询成功", mdmModuleRoleEntities); - ////} - //// - /////** - //// * @param object - //// * @return com.hzya.frame.web.entity.JsonResultEntity - //// * @Author lvleigang - //// * @Description 主数据设置保存权限配置 - //// * @Date 9:40 上午 2023/10/18 - //// **/ - ////@Override - ////public JsonResultEntity doSaveMdmModuleRule(JSONObject object) { - //// MdmRoleDto entity = getData("jsonStr", object, MdmRoleDto.class); - //// if (entity == null) { - //// return BaseResult.getFailureMessageEntity("参数不允许为空"); - //// } - //// if (entity.getId() == null || "".equals(entity.getId())) { - //// return BaseResult.getFailureMessageEntity("系统错误"); - //// } - //// //查询菜单 - //// Module module = new Module(); - //// module.setFormId(entity.getId()); - //// List moduleList = moduleMapper.entity_list_base(module); - //// if (moduleList != null && moduleList.size() == 1) { - //// module = moduleList.get(0); - //// } else { - //// return BaseResult.getFailureMessageEntity("菜单错误请检查菜单"); - //// } - //// //先删除 - //// RoleModule roleModule = new RoleModule(); - //// roleModule.setSts("Y"); - //// roleModule.setUpdate(); - //// roleModule.setModuleId(module.getId()); - //// roleModuleMapper.entity_logicDelete_Multi_Condition(roleModule); - //// MdmModuleRoleEntity mdmModuleRoleEntity = new MdmModuleRoleEntity(); - //// mdmModuleRoleEntity.setMdmId(entity.getId()); - //// mdmModuleRoleEntity.setSts("Y"); - //// mdmModuleRoleEntity.setModify_user_id(StpUtil.getLoginIdAsString()); - //// mdmModuleRoleEntity.setModify_time(new Date()); - //// mdmModuleRoleDao.logicRemoveMultiCondition(mdmModuleRoleEntity); - //// MdmModuleRoleButtonEntity mdmModuleRoleButtonEntity = new MdmModuleRoleButtonEntity(); - //// mdmModuleRoleButtonEntity.setMdmId(entity.getId()); - //// mdmModuleRoleButtonEntity.setSts("Y"); - //// mdmModuleRoleButtonEntity.setModify_user_id(StpUtil.getLoginIdAsString()); - //// mdmModuleRoleButtonEntity.setModify_time(new Date()); - //// mdmModuleRoleButtonDao.logicRemoveMultiCondition(mdmModuleRoleButtonEntity); - //// - //// if (entity.getMdmModuleRoleEntities() != null && entity.getMdmModuleRoleEntities().size() > 0) { - //// for (int i = 0; i < entity.getMdmModuleRoleEntities().size(); i++) { - //// - //// MdmModuleRoleEntity moduleRoleEntity = entity.getMdmModuleRoleEntities().get(i); - //// moduleRoleEntity.setMdmId(entity.getId()); - //// moduleRoleEntity.setSts("Y"); - //// moduleRoleEntity.setModify_user_id(StpUtil.getLoginIdAsString()); - //// moduleRoleEntity.setModify_time(new Date()); - //// if (moduleRoleEntity.getId() != null && !"".equals(moduleRoleEntity.getId())) { - //// //修改 - //// mdmModuleRoleDao.update(moduleRoleEntity); - //// } else { - //// //新增 - //// moduleRoleEntity.setId(UUIDUtils.getUUID()); - //// moduleRoleEntity.setCreate_user_id(StpUtil.getLoginIdAsString()); - //// moduleRoleEntity.setCreate_time(new Date()); - //// mdmModuleRoleDao.save(moduleRoleEntity); - //// } - //// if (moduleRoleEntity.getMdmModuleRoleButtonEntities() != null && moduleRoleEntity.getMdmModuleRoleButtonEntities().size() > 0) { - //// for (int i1 = 0; i1 < moduleRoleEntity.getMdmModuleRoleButtonEntities().size(); i1++) { - //// MdmModuleRoleButtonEntity moduleRoleButtonEntity = moduleRoleEntity.getMdmModuleRoleButtonEntities().get(i1); - //// moduleRoleButtonEntity.setMdmId(entity.getId()); - //// moduleRoleButtonEntity.setSts("Y"); - //// moduleRoleButtonEntity.setModify_user_id(StpUtil.getLoginIdAsString()); - //// moduleRoleButtonEntity.setModify_time(new Date()); - //// moduleRoleButtonEntity.setModuleRoleId(moduleRoleEntity.getRoleId()); - //// moduleRoleButtonEntity.setRoleId(moduleRoleEntity.getRoleId()); - //// if (moduleRoleButtonEntity.getId() != null && !"".equals(moduleRoleButtonEntity.getId())) { - //// //修改 - //// mdmModuleRoleButtonDao.update(moduleRoleButtonEntity); - //// } else { - //// //新增 - //// moduleRoleButtonEntity.setId(UUIDUtils.getUUID()); - //// moduleRoleButtonEntity.setCreate_user_id(StpUtil.getLoginIdAsString()); - //// moduleRoleButtonEntity.setCreate_time(new Date()); - //// mdmModuleRoleButtonDao.save(moduleRoleButtonEntity); - //// } - //// } - //// } - //// //再添加 - //// RoleModule saveRole = new RoleModule(); - //// saveRole.setCreate(); - //// saveRole.setRoleId(moduleRoleEntity.getRoleId()); - //// saveRole.setModuleId(module.getId()); - //// roleModuleMapper.entity_insert(saveRole); - //// } - //// } - //// return BaseResult.getSuccessMessageEntity("保存成功"); - ////} - //// - // - //// - // - //// - ///** - // * @param object - // * @return com.hzya.frame.web.entity.JsonResultEntity - // * @Author lvleigang - // * @Description 主数据列表显示 树、查询条件、列表字段、按钮 - // * @Date 9:40 上午 2023/10/18 - // **/ - //@Override - //public JsonResultEntity queryMdmShow(JSONObject object) { - // MdmDto entity = getData("jsonStr", object, MdmDto.class); - // if (entity == null) { - // return BaseResult.getFailureMessageEntity("参数不允许为空"); - // } - // if (entity.getMdmCode() == null || "".equals(entity.getMdmCode())) { - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // //查询模版 - // MdmModuleEntity mdmModuleEntity = mdmServiceCache.getMdmModuleEntity(entity.getMdmCode()); - // if(mdmModuleEntity == null || mdmModuleEntity.getId() == null){ - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // - // //设置模版 - // MdmViewVo mdmViewVo = new MdmViewVo(); - // mdmViewVo.setMdmModuleEntity(mdmModuleEntity); - // //查询展示类型 - // MdmModuleViewEntity mdmModuleViewEntity = new MdmModuleViewEntity(); - // mdmModuleViewEntity.setMdmId(mdmModuleEntity.getId()); - // mdmModuleViewEntity.setSts("Y"); - // List moduleViewEntityList = mdmServiceCache.queryMdmModuleView(mdmModuleViewEntity); - // if (moduleViewEntityList == null || moduleViewEntityList.size() != 1) { - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // mdmModuleViewEntity = moduleViewEntityList.get(0); - // mdmViewVo.setMdmModuleViewEntity(mdmModuleViewEntity); - // - // //查询数据源主表 - // MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); - // mdmModuleDbEntity.setMdmId(mdmModuleEntity.getId()); - // mdmModuleDbEntity.setSts("Y"); - // List mdmModuleDbEntityList = mdmServiceCache.queryMdmModuleDb(mdmModuleDbEntity); - // if (mdmModuleDbEntityList == null || mdmModuleDbEntityList.size() == 0) { - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // //查询数据源表下面的字段 - // MdmModuleDbFiledsEntity mdmModuleDbFiledsEntity = new MdmModuleDbFiledsEntity(); - // mdmModuleDbFiledsEntity.setMdmId(mdmModuleEntity.getId()); - // mdmModuleDbFiledsEntity.setSts("Y"); - // List mdmModuleDbFiledsEntityList = mdmServiceCache.queryMdmModuleDbFileds(mdmModuleDbFiledsEntity); - // if (mdmModuleDbFiledsEntityList == null || mdmModuleDbFiledsEntityList.size() == 0) { - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // //查询字段下的规则 - // MdmModuleDbFiledsRuleEntity mdmModuleDbFiledsRuleEntity = new MdmModuleDbFiledsRuleEntity(); - // mdmModuleDbFiledsRuleEntity.setMdmId(mdmModuleEntity.getId()); - // mdmModuleDbFiledsRuleEntity.setSts("Y"); - // List mdmModuleDbFiledsRuleEntityList = mdmServiceCache.queryMdmModuleDbFiledsRule(mdmModuleDbFiledsRuleEntity); - // if (mdmModuleDbFiledsRuleEntityList == null || mdmModuleDbFiledsRuleEntityList.size() == 0) { - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // - // //查询设置的查询字段 - // MdmModuleViewDetailEntity mdmModuleViewDetailEntity = new MdmModuleViewDetailEntity(); - // mdmModuleViewDetailEntity.setMdmId(mdmModuleEntity.getId()); - // mdmModuleViewDetailEntity.setSts("Y"); - // List mdmModuleViewDetailEntities = mdmServiceCache.queryMdmModuleViewDetail(mdmModuleViewDetailEntity); - // if (mdmModuleViewDetailEntities == null || mdmModuleViewDetailEntities.size() == 0) { - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // List queryList = getFiledByType("1",mdmModuleViewDetailEntities,mdmModuleDbEntityList,mdmModuleDbFiledsEntityList,mdmModuleDbFiledsRuleEntityList); - // mdmViewVo.setQueryList(queryList); - // List listList = getFiledByType("2",mdmModuleViewDetailEntities,mdmModuleDbEntityList,mdmModuleDbFiledsEntityList,mdmModuleDbFiledsRuleEntityList); - // mdmViewVo.setListList(listList); - // return BaseResult.getSuccessMessageEntity("获取字段成功", mdmViewVo); - //} - // - ///** - // * @Author lvleigang - // * @Description 根据类型获取字段 - // * @Date 9:18 上午 2024/6/6 - // * @param viewType 类型 - // * @param mdmModuleViewDetailEntities 显示设置的字段 - // * @param mdmModuleDbEntityList 表 - // * @param mdmModuleDbFiledsEntityList 表字段 - // * @param mdmModuleDbFiledsRuleEntityList 字段规则 - // * @return java.util.List - // **/ - //private List getFiledByType(String viewType, List mdmModuleViewDetailEntities, List mdmModuleDbEntityList, List mdmModuleDbFiledsEntityList, List mdmModuleDbFiledsRuleEntityList) { - // List mdmViewFiledVos = new ArrayList<>(); - // if(mdmModuleViewDetailEntities != null && mdmModuleViewDetailEntities.size() > 0){ - // for (int i = 0; i < mdmModuleViewDetailEntities.size(); i++) { - // if(viewType.equals(mdmModuleViewDetailEntities.get(i).getViewType())){ - // //类型一致 - // MdmViewFiledVo mdmViewFiledVo = new MdmViewFiledVo(); - // mdmViewFiledVo.setId(mdmModuleViewDetailEntities.get(i).getViewFiled()); - // for (int i1 = 0; i1 < mdmModuleDbFiledsEntityList.size(); i1++) { - // if(mdmModuleDbFiledsEntityList.get(i1).getId().equals(mdmModuleViewDetailEntities.get(i).getViewFiled())){ - // for (int i2 = 0; i2 < mdmModuleDbEntityList.size(); i2++) { - // if(mdmModuleDbEntityList.get(i2).getId().equals(mdmModuleDbFiledsEntityList.get(i1).getDbId())){ - // mdmViewFiledVo.setDbName(mdmModuleDbEntityList.get(i2).getDbName()); - // mdmViewFiledVo.setDbType(mdmModuleDbEntityList.get(i2).getDbType()); - // mdmViewFiledVo.setMdmId(mdmModuleDbEntityList.get(i2).getMdmId()); - // mdmViewFiledVo.setDbId(mdmModuleDbEntityList.get(i2).getId()); - // - // break; - // } - // } - // mdmViewFiledVo.setChName(mdmModuleDbFiledsEntityList.get(i1).getChName()); - // mdmViewFiledVo.setEnName(mdmModuleDbFiledsEntityList.get(i1).getEnName()); - // mdmViewFiledVo.setFiledType(mdmModuleDbFiledsEntityList.get(i1).getFiledType()); - // //字段规则 - // if(mdmModuleDbFiledsRuleEntityList != null && mdmModuleDbFiledsRuleEntityList.size() > 0){ - // List ruleList = new ArrayList<>(); - // for (int i2 = 0; i2 < mdmModuleDbFiledsRuleEntityList.size(); i2++) { - // if(mdmModuleDbFiledsEntityList.get(i1).getId().equals(mdmModuleDbFiledsRuleEntityList.get(i2).getFiledId())){ - // ruleList.add(mdmModuleDbFiledsRuleEntityList.get(i2)); - // } - // } - // mdmViewFiledVo.setRuleList(ruleList); - // } - // break; - // } - // } - // } - // } - // } - // if(mdmViewFiledVos != null && mdmViewFiledVos.size() > 0){ - // for (int i = 0; i < mdmViewFiledVos.size(); i++) { - // mdmViewFiledVos.get(i).setSorts(i); - // } + // List msgRule = new ArrayList<>(); + // MdmModuleDbFiledsRuleEntity msgRuleTitie = new MdmModuleDbFiledsRuleEntity(); + // msgRuleTitie.setFormName("optionRuleForm"); + // msgRuleTitie.setRuleCode("title"); + // msgRuleTitie.setRuleName("显示名"); + // msgRuleTitie.setRuleType("2"); + // msgRuleTitie.setRuleValue("单据编码"); + // MdmModuleDbFiledsRuleEntity msgRulerow = new MdmModuleDbFiledsRuleEntity(); + // msgRulerow.setFormName("optionRuleForm"); + // msgRulerow.setRuleCode("row"); + // msgRulerow.setRuleName("宽度"); + // msgRulerow.setRuleType("2"); + // msgRulerow.setRuleValue("12"); + // MdmModuleDbFiledsRuleEntity msgRuletype = new MdmModuleDbFiledsRuleEntity(); + // msgRuletype.setFormName("optionRuleForm"); + // msgRuletype.setRuleCode("type"); + // msgRuletype.setRuleName("数据类型"); + // msgRuletype.setRuleType("2"); + // msgRuletype.setRuleValue("input"); + // MdmModuleDbFiledsRuleEntity msgRulerequired = new MdmModuleDbFiledsRuleEntity(); + // msgRulerequired.setFormName("optionRuleForm"); + // msgRulerequired.setRuleCode("required"); + // msgRulerequired.setRuleName("必填"); + // msgRulerequired.setRuleType("2"); + // MdmModuleDbFiledsRuleEntity withs = new MdmModuleDbFiledsRuleEntity(); + // withs.setFormName("optionRuleForm"); + // withs.setRuleCode("width"); + // withs.setRuleName("宽度"); + // withs.setRuleType("2"); + // withs.setRuleValue("200"); + // msgRule.add(withs); + // msgRule.add(msgRulerequired); + // msgRule.add(msgRuletype); + // msgRule.add(msgRulerow); + // msgRule.add(msgRuleTitie); + // mdmViewFiledVo.setRuleList(msgRule); + // mdmViewFiledVos.add(0, mdmViewFiledVo); + // + // //添加分发数量 + // if (flag) { + // addFfsl(mdmModuleDbEntityList, mdmViewFiledVos); // } // return mdmViewFiledVos; //} - //// - ///** - // * @param object - // * @return com.hzya.frame.web.entity.JsonResultEntity - // * @Author lvleigang - // * @Description 主数据查询所有字段 - // * @Date 9:40 上午 2023/10/18 - // **/ - //@Override - //public JsonResultEntity queryMdmShowAll(JSONObject object) { - // MdmDto entity = getData("jsonStr", object, MdmDto.class); - // if (entity == null) { - // return BaseResult.getFailureMessageEntity("参数不允许为空"); - // } - // if (entity.getMdmCode() == null || "".equals(entity.getMdmCode())) { - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // //查询设置各种类型字段 - // MdmModuleEntity mdmModuleEntity = mdmServiceCache.getMdmModuleEntity(entity.getMdmCode()); - // //查询模版数据源 - // MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); - // mdmModuleDbEntity.setMdmId(mdmModuleEntity.getId()); - // mdmModuleDbEntity.setSts("Y"); - // List mdmModuleDbEntityList = mdmServiceCache.queryMdmModuleDb(mdmModuleDbEntity); - // List listFiled = new ArrayList<>(); + // + //private void addFfsl(List mdmModuleDbEntityList, List mdmViewFiledVos) { + // + // MdmViewFiledVo mdmViewFiledVo = new MdmViewFiledVo(); + // mdmViewFiledVo.setSorts(1);//排序 + // mdmViewFiledVo.setFiledType("1"); + // mdmViewFiledVo.setEnName("qwqwasdasdzxasda");//英文名 + // mdmViewFiledVo.setChName("分发数量");//中文名 + // mdmViewFiledVo.setDbType("1");//类型 1、主表 2、明细 // if (mdmModuleDbEntityList != null && mdmModuleDbEntityList.size() > 0) { - // MdmModuleDbFiledsEntity mdmModuleDbFiledsEntity = new MdmModuleDbFiledsEntity(); - // mdmModuleDbFiledsEntity.setMdmId(mdmModuleEntity.getId()); - // mdmModuleDbFiledsEntity.setSts("Y"); - // List mdmModuleDbFiledsEntityList = mdmServiceCache.queryMdmModuleDbFileds(mdmModuleDbFiledsEntity); - // // - // if (mdmModuleDbEntityList != null && mdmModuleDbEntityList.size() > 0) { - // for (int i = 0; i < mdmModuleDbEntityList.size(); i++) { - // if("1".equals(mdmModuleDbEntityList.get(i).getDbType()) || "2".equals(mdmModuleDbEntityList.get(i).getDbType())){ - // if (mdmModuleDbFiledsEntityList != null && mdmModuleDbFiledsEntityList.size() > 0) { - // for (int i1 = 0; i1 < mdmModuleDbFiledsEntityList.size(); i1++) { - // if (mdmModuleDbEntityList.get(i).getId().equals(mdmModuleDbFiledsEntityList.get(i1).getDbId())) { - // if ("1".equals(mdmModuleDbEntityList.get(i).getDbType())) { - // //1、主表 - // listFiled.add(new MdmDbFiledVo(mdmModuleDbFiledsEntityList.get(i1).getId(), "【主表:" + mdmModuleDbEntityList.get(i).getDbName() + "】" + mdmModuleDbFiledsEntityList.get(i1).getChName())); - // } else { - // //2、明细 - // listFiled.add(new MdmDbFiledVo(mdmModuleDbFiledsEntityList.get(i1).getId(), "【子表:" + mdmModuleDbEntityList.get(i).getDbName() + "】" + mdmModuleDbFiledsEntityList.get(i1).getChName())); - // } - // } - // } - // } - // } + // for (int i = 0; i < mdmModuleDbEntityList.size(); i++) { + // if ("1".equals(mdmModuleDbEntityList.get(i).getDbType())) { + // mdmViewFiledVo.setDbName(mdmModuleDbEntityList.get(i).getDbName());//表名 // } // } // } - // return BaseResult.getSuccessMessageEntity("查询视图成功", listFiled); + // List msgRule = new ArrayList<>(); + // MdmModuleDbFiledsRuleEntity msgRuleTitie = new MdmModuleDbFiledsRuleEntity(); + // msgRuleTitie.setFormName("optionRuleForm"); + // msgRuleTitie.setRuleCode("title"); + // msgRuleTitie.setRuleName("显示名"); + // msgRuleTitie.setRuleType("2"); + // msgRuleTitie.setRuleValue("分发数量"); + // MdmModuleDbFiledsRuleEntity msgRulerow = new MdmModuleDbFiledsRuleEntity(); + // msgRulerow.setFormName("optionRuleForm"); + // msgRulerow.setRuleCode("row"); + // msgRulerow.setRuleName("宽度"); + // msgRulerow.setRuleType("2"); + // msgRulerow.setRuleValue("6"); + // MdmModuleDbFiledsRuleEntity msgRuletype = new MdmModuleDbFiledsRuleEntity(); + // msgRuletype.setFormName("optionRuleForm"); + // msgRuletype.setRuleCode("type"); + // msgRuletype.setRuleName("数据类型"); + // msgRuletype.setRuleType("2"); + // msgRuletype.setRuleValue("input"); + // MdmModuleDbFiledsRuleEntity msgRulerequired = new MdmModuleDbFiledsRuleEntity(); + // msgRulerequired.setFormName("optionRuleForm"); + // msgRulerequired.setRuleCode("required"); + // msgRulerequired.setRuleName("必填"); + // msgRulerequired.setRuleType("2"); + // msgRule.add(msgRulerequired); + // msgRule.add(msgRuletype); + // msgRule.add(msgRulerow); + // msgRule.add(msgRuleTitie); + // mdmViewFiledVo.setRuleList(msgRule); + // mdmViewFiledVos.add(mdmViewFiledVo); //} - //// - /////** - //// * @param mdmModuleRoleButtonEntities - //// * @return java.util.List - //// * @Author lvleigang - //// * @Description 设置返回按钮 - //// * @Date 4:48 下午 2023/10/26 - //// **/ - ////private List setButton(List mdmModuleRoleButtonEntities) { - //// List mdmViewButtonVoList = new ArrayList<>(); - //// if (mdmModuleRoleButtonEntities != null && mdmModuleRoleButtonEntities.size() > 0) { - //// for (int i = 0; i < mdmModuleRoleButtonEntities.size(); i++) { - //// mdmViewButtonVoList.add(new MdmViewButtonVo(mdmModuleRoleButtonEntities.get(i).getButtonType(), mdmModuleRoleButtonEntities.get(i).getButtonName())); - //// } - //// } - //// return mdmViewButtonVoList; - ////} - //// - /////** - //// * @param allRecords - //// * @param checkedMeters - //// * @return java.util.List - //// * @Author lvleigang - //// * @Description 取出重复字段数据 - //// * @Date 4:34 下午 2023/10/26 - //// **/ - ////private List getDolist(List allRecords, List checkedMeters) { - //// List meterPlan = allRecords.stream() - //// .filter(item -> checkedMeters.stream() - //// .map(e -> { - //// if (!Objects.equals(item.getViewFiled(), e.getViewDetailId())) { - //// return null; - //// } else { - //// return item.getViewFiled(); - //// } - //// }) - //// .collect(Collectors.toList()) - //// .contains(item.getViewFiled())) - //// .collect(Collectors.toList()); - //// return meterPlan; - ////} - //// - /////** - //// * @param mdmModuleDbEntityList 数据源 - //// * @param mdmModuleDbFiledsEntityList 数据源下的字段表 - //// * @param mdmModuleDbFiledsRuleEntityList 数据源字段的规则表 - //// * @param queryList 需要的字段 - //// * @return java.util.List - //// * @Author lvleigang - //// * @Description 根据字段设置返回前台字段 - //// * @Date 4:11 下午 2023/10/26 - //// **/ - ////private List setQueryList(List mdmModuleDbEntityList, List mdmModuleDbFiledsEntityList, List mdmModuleDbFiledsRuleEntityList, List queryList, boolean flag) { - //// List mdmViewFiledVos = new ArrayList<>(); - //// - //// if (queryList != null && queryList.size() > 0) { - //// for (int i = 0; i < queryList.size(); i++) { - //// MdmViewFiledVo mdmViewFiledVo = new MdmViewFiledVo(); - //// mdmViewFiledVo.setId(queryList.get(i).getViewFiled());//字段id - //// mdmViewFiledVo.setSorts(i + 2);//排序 - //// for (int i1 = 0; i1 < mdmModuleDbFiledsEntityList.size(); i1++) { - //// if (queryList.get(i).getViewFiled().equals(mdmModuleDbFiledsEntityList.get(i1).getId())) { - //// mdmViewFiledVo.setFiledType(mdmModuleDbFiledsEntityList.get(i1).getFiledType());//英文名 - //// mdmViewFiledVo.setEnName(mdmModuleDbFiledsEntityList.get(i1).getEnName());//英文名 - //// mdmViewFiledVo.setChName(mdmModuleDbFiledsEntityList.get(i1).getChName());//中文名 - //// for (int i2 = 0; i2 < mdmModuleDbEntityList.size(); i2++) { - //// if (mdmModuleDbFiledsEntityList.get(i1).getDbId().equals(mdmModuleDbEntityList.get(i2).getId())) { - //// mdmViewFiledVo.setDbType(mdmModuleDbEntityList.get(i2).getDbType());//类型 1、主表 2、明细 - //// mdmViewFiledVo.setMdmId(mdmModuleDbEntityList.get(i2).getMdmId());//主数据模版ID - //// mdmViewFiledVo.setDbId(mdmModuleDbEntityList.get(i2).getId());//模版数据库id - //// mdmViewFiledVo.setDbName(mdmModuleDbEntityList.get(i2).getDbName());//表名 - //// - //// break; - //// } - //// } - //// break; - //// } - //// } - //// //设置字段规则 - //// List ruleList = new ArrayList<>(); - //// if (mdmModuleDbFiledsRuleEntityList != null && mdmModuleDbFiledsRuleEntityList.size() > 0) { - //// for (int i1 = 0; i1 < mdmModuleDbFiledsRuleEntityList.size(); i1++) { - //// if (queryList.get(i).getViewFiled().equals(mdmModuleDbFiledsRuleEntityList.get(i1).getFiledId())) { - //// ruleList.add(mdmModuleDbFiledsRuleEntityList.get(i1)); - //// } - //// } - //// } - //// mdmViewFiledVo.setRuleList(ruleList); - //// mdmViewFiledVos.add(mdmViewFiledVo); - //// } - //// } - //// MdmViewFiledVo mdmViewFiledVo = new MdmViewFiledVo(); - //// mdmViewFiledVo.setSorts(1);//排序 - //// mdmViewFiledVo.setFiledType("3"); - //// mdmViewFiledVo.setEnName("document_rule");//英文名 - //// mdmViewFiledVo.setChName("单据编码");//中文名 - //// mdmViewFiledVo.setDbType("1");//类型 1、主表 2、明细 - //// if (mdmModuleDbEntityList != null && mdmModuleDbEntityList.size() > 0) { - //// for (int i = 0; i < mdmModuleDbEntityList.size(); i++) { - //// if ("1".equals(mdmModuleDbEntityList.get(i).getDbType())) { - //// mdmViewFiledVo.setDbName(mdmModuleDbEntityList.get(i).getDbName());//表名 - //// } - //// } - //// } - //// List msgRule = new ArrayList<>(); - //// MdmModuleDbFiledsRuleEntity msgRuleTitie = new MdmModuleDbFiledsRuleEntity(); - //// msgRuleTitie.setFormName("optionRuleForm"); - //// msgRuleTitie.setRuleCode("title"); - //// msgRuleTitie.setRuleName("显示名"); - //// msgRuleTitie.setRuleType("2"); - //// msgRuleTitie.setRuleValue("单据编码"); - //// MdmModuleDbFiledsRuleEntity msgRulerow = new MdmModuleDbFiledsRuleEntity(); - //// msgRulerow.setFormName("optionRuleForm"); - //// msgRulerow.setRuleCode("row"); - //// msgRulerow.setRuleName("宽度"); - //// msgRulerow.setRuleType("2"); - //// msgRulerow.setRuleValue("12"); - //// MdmModuleDbFiledsRuleEntity msgRuletype = new MdmModuleDbFiledsRuleEntity(); - //// msgRuletype.setFormName("optionRuleForm"); - //// msgRuletype.setRuleCode("type"); - //// msgRuletype.setRuleName("数据类型"); - //// msgRuletype.setRuleType("2"); - //// msgRuletype.setRuleValue("input"); - //// MdmModuleDbFiledsRuleEntity msgRulerequired = new MdmModuleDbFiledsRuleEntity(); - //// msgRulerequired.setFormName("optionRuleForm"); - //// msgRulerequired.setRuleCode("required"); - //// msgRulerequired.setRuleName("必填"); - //// msgRulerequired.setRuleType("2"); - //// MdmModuleDbFiledsRuleEntity withs = new MdmModuleDbFiledsRuleEntity(); - //// withs.setFormName("optionRuleForm"); - //// withs.setRuleCode("width"); - //// withs.setRuleName("宽度"); - //// withs.setRuleType("2"); - //// withs.setRuleValue("200"); - //// msgRule.add(withs); - //// msgRule.add(msgRulerequired); - //// msgRule.add(msgRuletype); - //// msgRule.add(msgRulerow); - //// msgRule.add(msgRuleTitie); - //// mdmViewFiledVo.setRuleList(msgRule); - //// mdmViewFiledVos.add(0, mdmViewFiledVo); - //// - //// //添加分发数量 - //// if (flag) { - //// addFfsl(mdmModuleDbEntityList, mdmViewFiledVos); - //// } - //// return mdmViewFiledVos; - ////} - //// - ////private void addFfsl(List mdmModuleDbEntityList, List mdmViewFiledVos) { - //// - //// MdmViewFiledVo mdmViewFiledVo = new MdmViewFiledVo(); - //// mdmViewFiledVo.setSorts(1);//排序 - //// mdmViewFiledVo.setFiledType("1"); - //// mdmViewFiledVo.setEnName("qwqwasdasdzxasda");//英文名 - //// mdmViewFiledVo.setChName("分发数量");//中文名 - //// mdmViewFiledVo.setDbType("1");//类型 1、主表 2、明细 - //// if (mdmModuleDbEntityList != null && mdmModuleDbEntityList.size() > 0) { - //// for (int i = 0; i < mdmModuleDbEntityList.size(); i++) { - //// if ("1".equals(mdmModuleDbEntityList.get(i).getDbType())) { - //// mdmViewFiledVo.setDbName(mdmModuleDbEntityList.get(i).getDbName());//表名 - //// } - //// } - //// } - //// List msgRule = new ArrayList<>(); - //// MdmModuleDbFiledsRuleEntity msgRuleTitie = new MdmModuleDbFiledsRuleEntity(); - //// msgRuleTitie.setFormName("optionRuleForm"); - //// msgRuleTitie.setRuleCode("title"); - //// msgRuleTitie.setRuleName("显示名"); - //// msgRuleTitie.setRuleType("2"); - //// msgRuleTitie.setRuleValue("分发数量"); - //// MdmModuleDbFiledsRuleEntity msgRulerow = new MdmModuleDbFiledsRuleEntity(); - //// msgRulerow.setFormName("optionRuleForm"); - //// msgRulerow.setRuleCode("row"); - //// msgRulerow.setRuleName("宽度"); - //// msgRulerow.setRuleType("2"); - //// msgRulerow.setRuleValue("6"); - //// MdmModuleDbFiledsRuleEntity msgRuletype = new MdmModuleDbFiledsRuleEntity(); - //// msgRuletype.setFormName("optionRuleForm"); - //// msgRuletype.setRuleCode("type"); - //// msgRuletype.setRuleName("数据类型"); - //// msgRuletype.setRuleType("2"); - //// msgRuletype.setRuleValue("input"); - //// MdmModuleDbFiledsRuleEntity msgRulerequired = new MdmModuleDbFiledsRuleEntity(); - //// msgRulerequired.setFormName("optionRuleForm"); - //// msgRulerequired.setRuleCode("required"); - //// msgRulerequired.setRuleName("必填"); - //// msgRulerequired.setRuleType("2"); - //// msgRule.add(msgRulerequired); - //// msgRule.add(msgRuletype); - //// msgRule.add(msgRulerow); - //// msgRule.add(msgRuleTitie); - //// mdmViewFiledVo.setRuleList(msgRule); - //// mdmViewFiledVos.add(mdmViewFiledVo); - ////} - //// + // + /** + * @param object + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 主数据列表显示 业务数据 + * @Date 9:40 上午 2023/10/18 + **/ + @Override + public JsonResultEntity queryMdmShowData(JSONObject object) { + MdmQuery entity = getData("jsonStr", object, MdmQuery.class); + if (entity == null) { + return BaseResult.getFailureMessageEntity("参数不允许为空"); + } + //判断分页 + if (entity == null || entity.getPageNum() == null || entity.getPageSize() == null) { + return BaseResult.getFailureMessageEntity("分页查询参数不存在"); + } + PageHelper.startPage(entity.getPageNum(), entity.getPageSize()); + List> businessResult = mdmModuleDao.queryMdmShowData(entity); + PageInfo pageInfo = new PageInfo(businessResult); + return BaseResult.getSuccessMessageEntity("查询数据成功", pageInfo); + } + // ///** // * @param object // * @return com.hzya.frame.web.entity.JsonResultEntity @@ -2847,653 +527,7 @@ public class MdmServiceImpl implements IMdmService { // * @Date 9:40 上午 2023/10/18 // **/ //@Override - //public JsonResultEntity queryMdmShowData(JSONObject object) { - // MdmQuery entity = getData("jsonStr", object, MdmQuery.class); - // if (entity == null) { - // return BaseResult.getFailureMessageEntity("参数不允许为空"); - // } - // //判断分页 - // if (entity == null || entity.getPageNum() == null || entity.getPageSize() == null) { - // return BaseResult.getFailureMessageEntity("分页查询参数不存在"); - // } - // PageHelper.startPage(entity.getPageNum(), entity.getPageSize()); - // List> businessResult = mdmModuleDao.queryMdmShowData(entity); - // PageInfo pageInfo = new PageInfo(businessResult); - // return BaseResult.getSuccessMessageEntity("查询数据成功", pageInfo); - //} - //// - /////** - //// * @param object - //// * @return com.hzya.frame.web.entity.JsonResultEntity - //// * @Author lvleigang - //// * @Description 主数据列表显示 业务数据 - //// * @Date 9:40 上午 2023/10/18 - //// **/ - ////@Override - ////public JsonResultEntity queryMdmShowDistribute(JSONObject object) { - //// MdmDto entity = getData("jsonStr", object, MdmDto.class); - //// if (entity == null) { - //// return BaseResult.getFailureMessageEntity("参数不允许为空"); - //// } - //// if (entity.getMdmCode() == null || "".equals(entity.getMdmCode())) { - //// return BaseResult.getFailureMessageEntity("系统错误"); - //// } - //// if (entity.getId() == null || "".equals(entity.getId())) { - //// return BaseResult.getFailureMessageEntity("系统错误"); - //// } - //// //查询模版 - //// MdmModuleEntity mdmModuleEntity = new MdmModuleEntity(); - //// mdmModuleEntity.setMdmCode(entity.getMdmCode()); - //// mdmModuleEntity.setSts("Y"); - //// List mdmModuleEntities = mdmModuleDao.queryBase(mdmModuleEntity); - //// if (mdmModuleEntities == null || mdmModuleEntities.size() != 1) { - //// return BaseResult.getFailureMessageEntity("系统错误"); - //// } - //// - //// //查询数据源主表 - //// MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); - //// mdmModuleDbEntity.setMdmId(mdmModuleEntities.get(0).getId()); - //// mdmModuleDbEntity.setDbType("1"); - //// mdmModuleDbEntity.setSts("Y"); - //// List mdmModuleDbEntityList = mdmModuleDbDao.queryBase(mdmModuleDbEntity); - //// if (mdmModuleDbEntityList == null || mdmModuleDbEntityList.size() == 0) { - //// return BaseResult.getFailureMessageEntity("系统错误"); - //// } - //// mdmModuleDbEntity = mdmModuleDbEntityList.get(0); - //// Map queryData = new HashMap<>(); - //// queryData.put("tableName", mdmModuleDbEntity.getDbName() + "_distribute");//表名 - //// queryData.put("id", entity.getId());//字段 - //// List datas = mdmModuleDbDao.getServiceByDistributeIdNoCase(queryData); - //// List returnData = new ArrayList<>(); - //// - //// //查询分发表 - //// MdmModuleDistributeEntity mdmModuleDistributeEntity = new MdmModuleDistributeEntity(); - //// mdmModuleDistributeEntity.setMdmId(mdmModuleEntities.get(0).getId()); - //// mdmModuleDistributeEntity.setSts("Y"); - //// List mdmModuleDistributeEntities = mdmModuleDistributeDao.queryBase(mdmModuleDistributeEntity); - //// if (datas != null && datas.size() > 0) { - //// if (mdmModuleDistributeEntities != null && mdmModuleDistributeEntities.size() > 0) { - //// for (int i = 0; i < mdmModuleDistributeEntities.size(); i++) { - //// boolean flag = false; - //// for (int i1 = 0; i1 < datas.size(); i1++) { - //// if (datas.get(i1).getAppId().equals(mdmModuleDistributeEntities.get(i).getAppId())) { - //// flag = true; - //// break; - //// } - //// } - //// if (!flag) { - //// MdmDistributeVo mdmDistributeVo = new MdmDistributeVo(); - //// mdmDistributeVo.setAppId(mdmModuleDistributeEntities.get(i).getAppId()); - //// mdmDistributeVo.setStatus("4"); - //// mdmDistributeVo.setMsg("未发送"); - //// returnData.add(mdmDistributeVo); - //// } - //// } - //// } - //// returnData.addAll(datas); - //// } else { - //// if (mdmModuleDistributeEntities != null && mdmModuleDistributeEntities.size() > 0) { - //// for (int i = 0; i < mdmModuleDistributeEntities.size(); i++) { - //// MdmDistributeVo mdmDistributeVo = new MdmDistributeVo(); - //// mdmDistributeVo.setAppId(mdmModuleDistributeEntities.get(i).getAppId()); - //// mdmDistributeVo.setStatus("4"); - //// mdmDistributeVo.setMsg("未发送"); - //// returnData.add(mdmDistributeVo); - //// } - //// } - //// } - //// return BaseResult.getSuccessMessageEntity("查询数据成功", returnData); - ////} - //// - ///** - // * @param object - // * @return com.hzya.frame.web.entity.JsonResultEntity - // * @Author lvleigang - // * @Description 查询数据(list 或者 分页) - // * @Date 1:33 下午 2023/7/12 - // **/ - //@Override - //public JsonResultEntity queryTemplateData(JSONObject object) { - // MdmDto entity = getData("jsonStr", object, MdmDto.class); - // //校验是否有servecr传参 - // if (!checkStr(entity.getTableName())) { - // return BaseResult.getFailureMessageEntity("请先传递服务名"); - // } - // if (!checkStr(entity.getValue())) { - // return BaseResult.getFailureMessageEntity("请先传递存储字段"); - // } - // if (!checkStr(entity.getLabel())) { - // return BaseResult.getFailureMessageEntity("请先传递显示字段"); - // } - // if (entity.getPageNum() != null && entity.getPageSize() != null) { - // PageHelper.startPage(entity.getPageNum(), entity.getPageSize()); - // List> mapList = mdmModuleDao.querySelectData(entity); - // PageInfo pageInfo = new PageInfo(mapList); - // return BaseResult.getSuccessMessageEntity("查询数据成功", pageInfo); - // } else { - // List> mapList = mdmModuleDao.querySelectData(entity); - // return BaseResult.getSuccessMessageEntity("查询数据成功", mapList); - // } - //} - //// - ///** - // * @param object - // * @return com.hzya.frame.web.entity.JsonResultEntity - // * @Author lvleigang - // * @Description 业务数据树形结构,数据查询 - // * @Date 9:40 上午 2023/10/18 - // **/ - //@Override - //public JsonResultEntity queryMdmShowTreeData(JSONObject object) { - // MdmDto entity = getData("jsonStr", object, MdmDto.class); - // if (entity == null) { - // return BaseResult.getFailureMessageEntity("参数不允许为空"); - // } - // //if (entity.getTableName() == null || "".equals(entity.getTableName())) { - // // return BaseResult.getFailureMessageEntity("系统错误"); - // //} - // if (entity.getLabel() == null || "".equals(entity.getLabel())) { - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // if (entity.getUpId() == null || "".equals(entity.getUpId())) { - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // if (entity.getMdmCode() == null || "".equals(entity.getMdmCode())) { - // return BaseResult.getFailureMessageEntity("系统错误"); - // - // } - // //查询模版 - // MdmModuleEntity mdmModuleEntities = mdmServiceCache.getMdmModuleEntity(entity.getMdmCode()); - // if (mdmModuleEntities == null ) { - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // //查询数据源主表 - // MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); - // mdmModuleDbEntity.setMdmId(mdmModuleEntities.getId()); - // mdmModuleDbEntity.setSts("Y"); - // List mdmModuleDbEntityList = mdmServiceCache.queryMdmModuleDb(mdmModuleDbEntity); - // if (mdmModuleDbEntityList == null || mdmModuleDbEntityList.size() == 0) { - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // for (int i = 0; i < mdmModuleDbEntityList.size(); i++) { - // if("1".equals(mdmModuleDbEntityList.get(i).getDbType())){ - // mdmModuleDbEntity = mdmModuleDbEntityList.get(i); - // break; - // } - // } - // entity.setTableName(mdmModuleDbEntity.getDbName()); - // - // - // - // if (checkStr(entity.getId())) { - // if (!checkStr(entity.getValue())) { - // return BaseResult.getFailureMessageEntity("请先传递存储字段"); - // } - // if (entity.getId().contains(",")) { - // String[] strArray = entity.getId().split(","); // 使用逗号和空格作为分隔符 - // entity.setIds(strArray); - // List> mapList = mdmModuleDao.queryTemplateDataMore(entity); - // if (mapList == null || mapList.size() == 0) { - // List> returnList = new ArrayList<>(); - // return BaseResult.getSuccessMessageEntity("查询数据成功", returnList); - // } - // List> returnList = gettochilder(strArray, 0, mapList); - // return BaseResult.getSuccessMessageEntity("查询数据成功", returnList); - // } else { - // HashMap mapList = mdmModuleDao.queryTemplateDataOne(entity); - // if (mapList == null || mapList.size() == 0) { - // List> returnList = new ArrayList<>(); - // return BaseResult.getSuccessMessageEntity("查询数据成功", returnList); - // } - // List> returnList = new ArrayList<>(); - // returnList.add(mapList); - // return BaseResult.getSuccessMessageEntity("查询数据成功", returnList); - // } - // } else { - // List> mapList = mdmModuleDao.queryDataAll(entity); - // List> returnList = new ArrayList<>(); - // - // if (mapList != null && mapList.size() > 0) { - // for (int i = 0; i < mapList.size(); i++) { - // //默认为根 - // if (mapList.get(i).get(entity.getUpId()) == null || "".equals(mapList.get(i).get(entity.getUpId()))) { - // List> children = getchilder(mapList.get(i).get("qsdfg").toString(), mapList, entity); - // HashMap re = new HashMap<>(); - // re.put("id", mapList.get(i).get("qsdfg")); - // re.put("label", mapList.get(i).get(entity.getLabel())); - // re.put("upID", mapList.get(i).get(entity.getUpId())); - // if (children != null && children.size() > 0) { - // re.put("children", children); - // } - // returnList.add(re); - // } - // } - // } - // return BaseResult.getSuccessMessageEntity("查询数据成功", returnList); - // } - //} - //// - //private List> gettochilder(String[] strArray, int i, List> mapList) { - // List> maps = new ArrayList<>(); - // for (int i1 = 0; i1 < mapList.size(); i1++) { - // if (strArray[i].equals(mapList.get(i1).get("id").toString())) { - // if (strArray.length >= (i + 2)) { - // mapList.get(i1).put("children", gettochilder(strArray, i + 1, mapList)); - // } - // maps.add(mapList.get(i1)); - // break; - // } - // } - // return maps; - //} - //// - ////private HashMap getFathers(List> mapListAll, HashMap mapList, MdmDto entity) { - //// if (mapList.get("upID") == null) { - //// return mapList; - //// } - //// HashMap retList = new HashMap<>(); - //// if (mapListAll != null && mapListAll.size() > 0) { - //// for (int i = 0; i < mapListAll.size(); i++) { - //// //等于上级id的时候 - //// if (mapListAll.get(i).get("qsdfg").equals(mapList.get("upID"))) { - //// retList.put("id", mapListAll.get(i).get("qsdfg")); - //// retList.put("label", mapListAll.get(i).get(entity.getLabel())); - //// retList.put("upID", mapListAll.get(i).get(entity.getUpId())); - //// List> returnList = new ArrayList<>(); - //// returnList.add(mapList); - //// retList.put("children", returnList); - //// break; - //// } - //// } - //// } - //// HashMap a = getFathers(mapListAll, retList, entity); - //// return a; - ////} - //// - //private List> getchilder(String stringObjectHashMap, List> mapList, MdmDto entity) { - // List> returnList = new ArrayList<>(); - // if (mapList != null && mapList.size() > 0) { - // for (int i = 0; i < mapList.size(); i++) { - // //等于上级id的时候 - // if (stringObjectHashMap.equals(mapList.get(i).get(entity.getUpId()))) { - // List> children = getchilder(mapList.get(i).get(entity.getUpId()) + "," + mapList.get(i).get("qsdfg"), mapList, entity); - // HashMap re = new HashMap<>(); - // re.put("id", mapList.get(i).get("qsdfg")); - // re.put("label", mapList.get(i).get(entity.getLabel())); - // re.put("upID", mapList.get(i).get(entity.getUpId())); - // if (children != null && children.size() > 0) { - // re.put("children", children); - // } - // returnList.add(re); - // } - // } - // } - // return returnList; - //} - //// - ///** - // * @param object - // * @return com.hzya.frame.web.entity.JsonResultEntity - // * @Author lvleigang - // * @Description 主数据详情 区分类型 新增、修改、查看 - // * @Date 9:40 上午 2023/10/18 - // **/ - //@Override - //public JsonResultEntity queryMdmShowDetails(JSONObject object) { - // MdmDto entity = getData("jsonStr", object, MdmDto.class); - // if (entity == null) { - // return BaseResult.getFailureMessageEntity("参数不允许为空"); - // } - // if (entity.getMdmCode() == null || "".equals(entity.getMdmCode())) { - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // if (entity.getShowType() == null || "".equals(entity.getShowType())) { - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // //查询模版 - // //List mdmModuleEntities = mdmModuleDao.queryBase(mdmModuleEntity); - // MdmModuleEntity mdmModuleEntities = mdmServiceCache.getMdmModuleEntity(entity.getMdmCode()); - // if (mdmModuleEntities == null) { - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // MdmDetailViewVo mdmViewVo = new MdmDetailViewVo(); - // mdmViewVo.setMdmModuleEntity(mdmModuleEntities); - // - // //查询数据源主表 - // MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); - // mdmModuleDbEntity.setMdmId(mdmModuleEntities.getId()); - // mdmModuleDbEntity.setSts("Y"); - // List mdmModuleDbEntityList = mdmServiceCache.queryMdmModuleDb(mdmModuleDbEntity); - // if (mdmModuleDbEntityList == null || mdmModuleDbEntityList.size() == 0) { - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // //查询数据源表下面的字段 - // MdmModuleDbFiledsEntity mdmModuleDbFiledsEntity = new MdmModuleDbFiledsEntity(); - // mdmModuleDbFiledsEntity.setMdmId(mdmModuleEntities.getId()); - // mdmModuleDbFiledsEntity.setSts("Y"); - // List mdmModuleDbFiledsEntityList = mdmServiceCache.queryMdmModuleDbFileds(mdmModuleDbFiledsEntity); - // if (mdmModuleDbFiledsEntityList == null || mdmModuleDbFiledsEntityList.size() == 0) { - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // //查询字段下的规则 - // MdmModuleDbFiledsRuleEntity mdmModuleDbFiledsRuleEntity = new MdmModuleDbFiledsRuleEntity(); - // mdmModuleDbFiledsRuleEntity.setMdmId(mdmModuleEntities.getId()); - // mdmModuleDbFiledsRuleEntity.setSts("Y"); - // List mdmModuleDbFiledsRuleEntityList = mdmServiceCache.queryMdmModuleDbFiledsRule(mdmModuleDbFiledsRuleEntity); - // if (mdmModuleDbFiledsRuleEntityList == null || mdmModuleDbFiledsRuleEntityList.size() == 0) { - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // MdmModuleViewDetailEntity mdmModuleViewDetailEntity = new MdmModuleViewDetailEntity(); - // mdmModuleViewDetailEntity.setMdmId(mdmModuleEntities.getId()); - // mdmModuleViewDetailEntity.setSts("Y"); - // mdmModuleViewDetailEntity.setViewType(entity.getShowType());//设置显示字段类型 - // List queryAll = mdmModuleViewDetailDao.queryBase(mdmModuleViewDetailEntity); - // List mdmModuleViewDetailEntityList = new ArrayList<>(); - // if(queryAll != null && queryAll.size() > 0){ - // for (int i = 0; i < queryAll.size(); i++) { - // if(entity.getShowType().equals(queryAll.get(i).getViewType())){ - // mdmModuleViewDetailEntityList.add(queryAll.get(i)); - // } - // } - // } - // //组装数据 - // assembleMdmShowDetails(mdmViewVo, mdmModuleDbEntityList, mdmModuleDbFiledsEntityList, mdmModuleDbFiledsRuleEntityList, mdmModuleViewDetailEntityList, entity.getShowType()); - // return BaseResult.getSuccessMessageEntity("获取字段成功", mdmViewVo); - //} - // - ///** - // * @param mdmViewVo 返回对象 - // * @param mdmModuleDbEntityList 数据源表 - // * @param mdmModuleDbFiledsEntityList 数据源字段 - // * @param mdmModuleDbFiledsRuleEntityList 数据源字段规则 - // * @param mdmModuleViewDetailEntityList 数据源显示字段 - // * @return void - // * @Author lvleigang - // * @Description 组装显示字段 - // * @Date 9:10 上午 2023/11/6 - // **/ - //private void assembleMdmShowDetails(MdmDetailViewVo mdmViewVo, List mdmModuleDbEntityList, List mdmModuleDbFiledsEntityList, List mdmModuleDbFiledsRuleEntityList, List mdmModuleViewDetailEntityList, String showType) { - // //主数据主表 - // MdmModuleDbEntity mainMdmModuleDb = new MdmModuleDbEntity(); - // List mainMdmModuleDbFileds = new ArrayList<>(); - // //主数据子表 - // List sublistMdmModuleDb = new ArrayList<>(); - // - // if (mdmModuleViewDetailEntityList != null && mdmModuleViewDetailEntityList.size() > 0) { - // //先循环数据源表,设置出数据字段 - // for (int i = 0; i < mdmModuleDbEntityList.size(); i++) { - // if ("1".equals(mdmModuleDbEntityList.get(i).getDbType())) { - // //1、主表 2、明细 - // mainMdmModuleDb = mdmModuleDbEntityList.get(i); - // //循环字段表 - // if (mdmModuleDbFiledsEntityList != null && mdmModuleDbFiledsEntityList.size() > 0) { - // for (int i1 = 0; i1 < mdmModuleDbFiledsEntityList.size(); i1++) { - // if (mdmModuleDbEntityList.get(i).getId().equals(mdmModuleDbFiledsEntityList.get(i1).getDbId())) { - // for (int b = 0; b < mdmModuleViewDetailEntityList.size(); b++) { - // if (mdmModuleViewDetailEntityList.get(b).getViewFiled().equals(mdmModuleDbFiledsEntityList.get(i1).getId())) { - // mainMdmModuleDbFileds.add(mdmModuleDbFiledsEntityList.get(i1)); - // List mdmModuleDbFiledsRules = new ArrayList<>(); - // //循环字段属性 - // if (mdmModuleDbFiledsRuleEntityList != null && mdmModuleDbFiledsRuleEntityList.size() > 0) { - // for (int i2 = 0; i2 < mdmModuleDbFiledsRuleEntityList.size(); i2++) { - // if (mdmModuleDbFiledsEntityList.get(i1).getDbId().equals(mdmModuleDbFiledsRuleEntityList.get(i2).getDbId()) - // && mdmModuleDbFiledsEntityList.get(i1).getId().equals(mdmModuleDbFiledsRuleEntityList.get(i2).getFiledId())) { - // mdmModuleDbFiledsRules.add(mdmModuleDbFiledsRuleEntityList.get(i2)); - // } - // } - // } - // mdmModuleDbFiledsEntityList.get(i1).setMdmModuleDbFiledsRules(mdmModuleDbFiledsRules); - // } - // } - // } - // } - // } - // } else if ("2".equals(mdmModuleDbEntityList.get(i).getDbType())) { - // //2、明细 - // sublistMdmModuleDb.add(mdmModuleDbEntityList.get(i)); - // //循环字段表 - // if (mdmModuleDbFiledsEntityList != null && mdmModuleDbFiledsEntityList.size() > 0) { - // List sublistMdmModuleDbFileds = new ArrayList<>(); - // for (int i1 = 0; i1 < mdmModuleDbFiledsEntityList.size(); i1++) { - // if (mdmModuleDbEntityList.get(i).getId().equals(mdmModuleDbFiledsEntityList.get(i1).getDbId())) { - // for (int b = 0; b < mdmModuleViewDetailEntityList.size(); b++) { - // if (mdmModuleViewDetailEntityList.get(b).getViewFiled().equals(mdmModuleDbFiledsEntityList.get(i1).getId())) { - // sublistMdmModuleDbFileds.add(mdmModuleDbFiledsEntityList.get(i1)); - // List mdmModuleDbFiledsRules = new ArrayList<>(); - // //循环字段属性 - // if (mdmModuleDbFiledsRuleEntityList != null && mdmModuleDbFiledsRuleEntityList.size() > 0) { - // for (int i2 = 0; i2 < mdmModuleDbFiledsRuleEntityList.size(); i2++) { - // if (mdmModuleDbFiledsEntityList.get(i1).getDbId().equals(mdmModuleDbFiledsRuleEntityList.get(i2).getDbId()) - // && mdmModuleDbFiledsEntityList.get(i1).getId().equals(mdmModuleDbFiledsRuleEntityList.get(i2).getFiledId())) { - // mdmModuleDbFiledsRules.add(mdmModuleDbFiledsRuleEntityList.get(i2)); - // } - // } - // } - // mdmModuleDbFiledsEntityList.get(i1).setMdmModuleDbFiledsRules(mdmModuleDbFiledsRules); - // } - // } - // - // } - // } - // mdmModuleDbEntityList.get(i).setSublistMdmModuleDbFileds(sublistMdmModuleDbFileds); - // } - // } - // } - // mainMdmModuleDb.setSublistMdmModuleDbFileds(mainMdmModuleDbFileds); - // mdmViewVo.setMainMdmModuleDb(mainMdmModuleDb); - // //主数据子表 - // List mdmModuleDb = new ArrayList<>(); - // if (sublistMdmModuleDb != null && sublistMdmModuleDb.size() > 0) { - // for (int i = 0; i < sublistMdmModuleDb.size(); i++) { - // if (sublistMdmModuleDb.get(i).getSublistMdmModuleDbFileds() != null && sublistMdmModuleDb.get(i).getSublistMdmModuleDbFileds().size() > 0) { - // mdmModuleDb.add(sublistMdmModuleDb.get(i)); - // } - // } - // } - // //if ("5".equals(showType)) { - // // MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); - // // mdmModuleDbEntity.setDbName(mainMdmModuleDb.getDbName() + "_distribute"); - // // mdmModuleDbEntity.setRemark(mainMdmModuleDb.getRemark() + "分发表"); - // // mdmModuleDbEntity.setDbType("2"); - // // List mdmModuleDbFiledsEntityList1 = getDistributeRole(); - // // mdmModuleDbEntity.setSublistMdmModuleDbFileds(mdmModuleDbFiledsEntityList1); - // // mdmModuleDb.add(mdmModuleDbEntity); - // //} - // mdmViewVo.setSublistMdmModuleDb(mdmModuleDb); - // - // } else { - // mdmViewVo.setMainMdmModuleDb(mainMdmModuleDb); - // mdmViewVo.setSublistMdmModuleDb(sublistMdmModuleDb); - // } - //} - //// - ////private List getDistributeRole() { - //// List mdmModuleDbFiledsEntityList = new ArrayList<>(); - //// //app - //// MdmModuleDbFiledsEntity appFiled = new MdmModuleDbFiledsEntity(); - //// appFiled.setChName("应用"); - //// appFiled.setEnName("app_id"); - //// appFiled.setFiledLength("50"); - //// appFiled.setFiledType("3"); - //// List appRule = new ArrayList<>(); - //// MdmModuleDbFiledsRuleEntity appRuleTitie = new MdmModuleDbFiledsRuleEntity(); - //// appRuleTitie.setFormName("optionRuleForm"); - //// appRuleTitie.setRuleCode("title"); - //// appRuleTitie.setRuleName("显示名"); - //// appRuleTitie.setRuleType("2"); - //// appRuleTitie.setRuleValue("应用"); - //// MdmModuleDbFiledsRuleEntity appRulerow = new MdmModuleDbFiledsRuleEntity(); - //// appRulerow.setFormName("optionRuleForm"); - //// appRulerow.setRuleCode("row"); - //// appRulerow.setRuleName("宽度"); - //// appRulerow.setRuleType("2"); - //// appRulerow.setRuleValue("6"); - //// MdmModuleDbFiledsRuleEntity appRuletype = new MdmModuleDbFiledsRuleEntity(); - //// appRuletype.setFormName("optionRuleForm"); - //// appRuletype.setRuleCode("type"); - //// appRuletype.setRuleName("数据类型"); - //// appRuletype.setRuleType("2"); - //// appRuletype.setRuleValue("select"); - //// MdmModuleDbFiledsRuleEntity appRulerequired = new MdmModuleDbFiledsRuleEntity(); - //// appRulerequired.setFormName("optionRuleForm"); - //// appRulerequired.setRuleCode("required"); - //// appRulerequired.setRuleName("必填"); - //// appRulerequired.setRuleType("2"); - //// MdmModuleDbFiledsRuleEntity appRuleservice = new MdmModuleDbFiledsRuleEntity(); - //// appRuleservice.setFormName("typeOptionRuleForm"); - //// appRuleservice.setRuleCode("service"); - //// appRuleservice.setRuleName("服务名称"); - //// appRuleservice.setRuleType("2"); - //// appRuleservice.setRuleValue("sys_application"); - //// MdmModuleDbFiledsRuleEntity appRulelabel = new MdmModuleDbFiledsRuleEntity(); - //// appRulelabel.setFormName("typeOptionRuleForm"); - //// appRulelabel.setRuleCode("label"); - //// appRulelabel.setRuleName("label"); - //// appRulelabel.setRuleType("2"); - //// appRulelabel.setRuleValue("name"); - //// MdmModuleDbFiledsRuleEntity appRulevalue = new MdmModuleDbFiledsRuleEntity(); - //// appRulevalue.setFormName("typeOptionRuleForm"); - //// appRulevalue.setRuleCode("value"); - //// appRulevalue.setRuleName("value"); - //// appRulevalue.setRuleType("2"); - //// appRulevalue.setRuleValue("id"); - //// appRule.add(appRulevalue); - //// appRule.add(appRulelabel); - //// appRule.add(appRuleservice); - //// appRule.add(appRulerequired); - //// appRule.add(appRuletype); - //// appRule.add(appRulerow); - //// appRule.add(appRuleTitie); - //// appFiled.setMdmModuleDbFiledsRules(appRule); - //// mdmModuleDbFiledsEntityList.add(appFiled); - //// - //// - //// //status - //// MdmModuleDbFiledsEntity statusFiled = new MdmModuleDbFiledsEntity(); - //// statusFiled.setChName("状态"); - //// statusFiled.setEnName("status"); - //// statusFiled.setFiledLength("50"); - //// statusFiled.setFiledType("3"); - //// List statusRule = new ArrayList<>(); - //// MdmModuleDbFiledsRuleEntity statusRuleTitie = new MdmModuleDbFiledsRuleEntity(); - //// statusRuleTitie.setFormName("optionRuleForm"); - //// statusRuleTitie.setRuleCode("title"); - //// statusRuleTitie.setRuleName("显示名"); - //// statusRuleTitie.setRuleType("2"); - //// statusRuleTitie.setRuleValue("状态"); - //// MdmModuleDbFiledsRuleEntity statusRulerow = new MdmModuleDbFiledsRuleEntity(); - //// statusRulerow.setFormName("optionRuleForm"); - //// statusRulerow.setRuleCode("row"); - //// statusRulerow.setRuleName("宽度"); - //// statusRulerow.setRuleType("2"); - //// statusRulerow.setRuleValue("6"); - //// MdmModuleDbFiledsRuleEntity statusRuletype = new MdmModuleDbFiledsRuleEntity(); - //// statusRuletype.setFormName("optionRuleForm"); - //// statusRuletype.setRuleCode("type"); - //// statusRuletype.setRuleName("数据类型"); - //// statusRuletype.setRuleType("2"); - //// statusRuletype.setRuleValue("input"); - //// MdmModuleDbFiledsRuleEntity statusRulerequired = new MdmModuleDbFiledsRuleEntity(); - //// statusRulerequired.setFormName("optionRuleForm"); - //// statusRulerequired.setRuleCode("required"); - //// statusRulerequired.setRuleName("必填"); - //// statusRulerequired.setRuleType("2"); - //// statusRule.add(statusRulerequired); - //// statusRule.add(statusRuletype); - //// statusRule.add(statusRulerow); - //// statusRule.add(statusRuleTitie); - //// statusFiled.setMdmModuleDbFiledsRules(statusRule); - //// mdmModuleDbFiledsEntityList.add(statusFiled); - //// - //// - //// //msg - //// MdmModuleDbFiledsEntity msgFiled = new MdmModuleDbFiledsEntity(); - //// msgFiled.setChName("描述"); - //// msgFiled.setEnName("msg"); - //// msgFiled.setFiledLength("200"); - //// msgFiled.setFiledType("3"); - //// List msgRule = new ArrayList<>(); - //// MdmModuleDbFiledsRuleEntity msgRuleTitie = new MdmModuleDbFiledsRuleEntity(); - //// msgRuleTitie.setFormName("optionRuleForm"); - //// msgRuleTitie.setRuleCode("title"); - //// msgRuleTitie.setRuleName("显示名"); - //// msgRuleTitie.setRuleType("2"); - //// msgRuleTitie.setRuleValue("描述"); - //// MdmModuleDbFiledsRuleEntity msgRulerow = new MdmModuleDbFiledsRuleEntity(); - //// msgRulerow.setFormName("optionRuleForm"); - //// msgRulerow.setRuleCode("row"); - //// msgRulerow.setRuleName("宽度"); - //// msgRulerow.setRuleType("2"); - //// msgRulerow.setRuleValue("6"); - //// MdmModuleDbFiledsRuleEntity msgRuletype = new MdmModuleDbFiledsRuleEntity(); - //// msgRuletype.setFormName("optionRuleForm"); - //// msgRuletype.setRuleCode("type"); - //// msgRuletype.setRuleName("数据类型"); - //// msgRuletype.setRuleType("2"); - //// msgRuletype.setRuleValue("input"); - //// MdmModuleDbFiledsRuleEntity msgRulerequired = new MdmModuleDbFiledsRuleEntity(); - //// msgRulerequired.setFormName("optionRuleForm"); - //// msgRulerequired.setRuleCode("required"); - //// msgRulerequired.setRuleName("必填"); - //// msgRulerequired.setRuleType("2"); - //// msgRule.add(msgRulerequired); - //// msgRule.add(msgRuletype); - //// msgRule.add(msgRulerow); - //// msgRule.add(msgRuleTitie); - //// msgFiled.setMdmModuleDbFiledsRules(msgRule); - //// mdmModuleDbFiledsEntityList.add(msgFiled); - //// return mdmModuleDbFiledsEntityList; - ////} - //// - /////** - //// * @param object - //// * @return com.hzya.frame.web.entity.JsonResultEntity - //// * @Author lvleigang - //// * @Description 查询数据(list 或者 分页) - //// * @Date 1:33 下午 2023/7/12 - //// **/ - ////@Override - ////public JsonResultEntity queryMdmOptionData(JSONObject object) { - //// ModuleDto entity = getData("jsonStr", object, ModuleDto.class); - //// //校验是否有servecr传参 - //// if (!checkStr(entity.getService())) { - //// return BaseResult.getFailureMessageEntity("请先传递服务名"); - //// } - //// if (!checkStr(entity.getValue())) { - //// return BaseResult.getFailureMessageEntity("请先传递存储字段"); - //// } - //// if (!checkStr(entity.getLabel())) { - //// return BaseResult.getFailureMessageEntity("请先传递显示字段"); - //// } - //// //查询数据源主表 - //// MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); - //// mdmModuleDbEntity.setId(entity.getId()); - //// mdmModuleDbEntity.setSts("Y"); - //// List mdmModuleDbEntityList = mdmModuleDbDao.queryBase(mdmModuleDbEntity); - //// if (mdmModuleDbEntityList == null || mdmModuleDbEntityList.size() == 0) { - //// return BaseResult.getFailureMessageEntity("系统错误"); - //// } - //// entity.setTableName(mdmModuleDbEntityList.get(0).getDbName()); - //// if (entity.getPageNum() != null && entity.getPageSize() != null) { - //// PageHelper.startPage(entity.getPageNum(), entity.getPageSize()); - //// List> mapList = mdmModuleDao.queryTemplateData(entity); - //// PageInfo pageInfo = new PageInfo(mapList); - //// return BaseResult.getSuccessMessageEntity("查询数据成功", pageInfo); - //// } else { - //// List> mapList = mdmModuleDao.queryTemplateData(entity); - //// return BaseResult.getSuccessMessageEntity("查询数据成功", mapList); - //// } - ////} - //// - ///** - // * @param object - // * @return com.hzya.frame.web.entity.JsonResultEntity - // * @Author lvleigang - // * @Description 主数据详情数据 区分类型 新增、修改、查看 - // * @Date 9:40 上午 2023/10/18 - // **/ - //@Override - //public JsonResultEntity queryMdmShowDetailsData(JSONObject object) { + //public JsonResultEntity queryMdmShowDistribute(JSONObject object) { // MdmDto entity = getData("jsonStr", object, MdmDto.class); // if (entity == null) { // return BaseResult.getFailureMessageEntity("参数不允许为空"); @@ -3505,146 +539,853 @@ public class MdmServiceImpl implements IMdmService { // return BaseResult.getFailureMessageEntity("系统错误"); // } // //查询模版 - // - // MdmModuleEntity mdmModuleEntity = mdmServiceCache.getMdmModuleEntity(entity.getMdmCode()); - // if (mdmModuleEntity == null ) { + // MdmModuleEntity mdmModuleEntity = new MdmModuleEntity(); + // mdmModuleEntity.setMdmCode(entity.getMdmCode()); + // mdmModuleEntity.setSts("Y"); + // List mdmModuleEntities = mdmModuleDao.queryBase(mdmModuleEntity); + // if (mdmModuleEntities == null || mdmModuleEntities.size() != 1) { // return BaseResult.getFailureMessageEntity("系统错误"); // } + // + // //查询数据源主表 + // MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); + // mdmModuleDbEntity.setMdmId(mdmModuleEntities.get(0).getId()); + // mdmModuleDbEntity.setDbType("1"); + // mdmModuleDbEntity.setSts("Y"); + // List mdmModuleDbEntityList = mdmModuleDbDao.queryBase(mdmModuleDbEntity); + // if (mdmModuleDbEntityList == null || mdmModuleDbEntityList.size() == 0) { + // return BaseResult.getFailureMessageEntity("系统错误"); + // } + // mdmModuleDbEntity = mdmModuleDbEntityList.get(0); + // Map queryData = new HashMap<>(); + // queryData.put("tableName", mdmModuleDbEntity.getDbName() + "_distribute");//表名 + // queryData.put("id", entity.getId());//字段 + // List datas = mdmModuleDbDao.getServiceByDistributeIdNoCase(queryData); + // List returnData = new ArrayList<>(); + // + // //查询分发表 + // MdmModuleDistributeEntity mdmModuleDistributeEntity = new MdmModuleDistributeEntity(); + // mdmModuleDistributeEntity.setMdmId(mdmModuleEntities.get(0).getId()); + // mdmModuleDistributeEntity.setSts("Y"); + // List mdmModuleDistributeEntities = mdmModuleDistributeDao.queryBase(mdmModuleDistributeEntity); + // if (datas != null && datas.size() > 0) { + // if (mdmModuleDistributeEntities != null && mdmModuleDistributeEntities.size() > 0) { + // for (int i = 0; i < mdmModuleDistributeEntities.size(); i++) { + // boolean flag = false; + // for (int i1 = 0; i1 < datas.size(); i1++) { + // if (datas.get(i1).getAppId().equals(mdmModuleDistributeEntities.get(i).getAppId())) { + // flag = true; + // break; + // } + // } + // if (!flag) { + // MdmDistributeVo mdmDistributeVo = new MdmDistributeVo(); + // mdmDistributeVo.setAppId(mdmModuleDistributeEntities.get(i).getAppId()); + // mdmDistributeVo.setStatus("4"); + // mdmDistributeVo.setMsg("未发送"); + // returnData.add(mdmDistributeVo); + // } + // } + // } + // returnData.addAll(datas); + // } else { + // if (mdmModuleDistributeEntities != null && mdmModuleDistributeEntities.size() > 0) { + // for (int i = 0; i < mdmModuleDistributeEntities.size(); i++) { + // MdmDistributeVo mdmDistributeVo = new MdmDistributeVo(); + // mdmDistributeVo.setAppId(mdmModuleDistributeEntities.get(i).getAppId()); + // mdmDistributeVo.setStatus("4"); + // mdmDistributeVo.setMsg("未发送"); + // returnData.add(mdmDistributeVo); + // } + // } + // } + // return BaseResult.getSuccessMessageEntity("查询数据成功", returnData); + //} + // + /** + * @param object + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 查询数据(list 或者 分页) + * @Date 1:33 下午 2023/7/12 + **/ + @Override + public JsonResultEntity queryTemplateData(JSONObject object) { + MdmDto entity = getData("jsonStr", object, MdmDto.class); + //校验是否有servecr传参 + if (!checkStr(entity.getTableName())) { + return BaseResult.getFailureMessageEntity("请先传递服务名"); + } + if (!checkStr(entity.getValue())) { + return BaseResult.getFailureMessageEntity("请先传递存储字段"); + } + if (!checkStr(entity.getLabel())) { + return BaseResult.getFailureMessageEntity("请先传递显示字段"); + } + if (entity.getPageNum() != null && entity.getPageSize() != null) { + PageHelper.startPage(entity.getPageNum(), entity.getPageSize()); + List> mapList = mdmModuleDao.querySelectData(entity); + PageInfo pageInfo = new PageInfo(mapList); + return BaseResult.getSuccessMessageEntity("查询数据成功", pageInfo); + } else { + List> mapList = mdmModuleDao.querySelectData(entity); + return BaseResult.getSuccessMessageEntity("查询数据成功", mapList); + } + } + // + /** + * @param object + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 业务数据树形结构,数据查询 + * @Date 9:40 上午 2023/10/18 + **/ + @Override + public JsonResultEntity queryMdmShowTreeData(JSONObject object) { + MdmDto entity = getData("jsonStr", object, MdmDto.class); + if (entity == null) { + return BaseResult.getFailureMessageEntity("参数不允许为空"); + } + //if (entity.getTableName() == null || "".equals(entity.getTableName())) { + // return BaseResult.getFailureMessageEntity("系统错误"); + //} + if (entity.getLabel() == null || "".equals(entity.getLabel())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + if (entity.getUpId() == null || "".equals(entity.getUpId())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + if (entity.getMdmCode() == null || "".equals(entity.getMdmCode())) { + return BaseResult.getFailureMessageEntity("系统错误"); + + } + //查询模版 + MdmModuleEntity mdmModuleEntities = mdmServiceCache.getMdmModuleEntity(entity.getMdmCode()); + if (mdmModuleEntities == null ) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + //查询数据源主表 + MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); + mdmModuleDbEntity.setMdmId(mdmModuleEntities.getId()); + mdmModuleDbEntity.setSts("Y"); + List mdmModuleDbEntityList = mdmServiceCache.queryMdmModuleDb(mdmModuleDbEntity); + if (mdmModuleDbEntityList == null || mdmModuleDbEntityList.size() == 0) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + for (int i = 0; i < mdmModuleDbEntityList.size(); i++) { + if("1".equals(mdmModuleDbEntityList.get(i).getDbType())){ + mdmModuleDbEntity = mdmModuleDbEntityList.get(i); + break; + } + } + entity.setTableName(mdmModuleDbEntity.getDbName()); + + + + if (checkStr(entity.getId())) { + if (!checkStr(entity.getValue())) { + return BaseResult.getFailureMessageEntity("请先传递存储字段"); + } + if (entity.getId().contains(",")) { + String[] strArray = entity.getId().split(","); // 使用逗号和空格作为分隔符 + entity.setIds(strArray); + List> mapList = mdmModuleDao.queryTemplateDataMore(entity); + if (mapList == null || mapList.size() == 0) { + List> returnList = new ArrayList<>(); + return BaseResult.getSuccessMessageEntity("查询数据成功", returnList); + } + List> returnList = gettochilder(strArray, 0, mapList); + return BaseResult.getSuccessMessageEntity("查询数据成功", returnList); + } else { + HashMap mapList = mdmModuleDao.queryTemplateDataOne(entity); + if (mapList == null || mapList.size() == 0) { + List> returnList = new ArrayList<>(); + return BaseResult.getSuccessMessageEntity("查询数据成功", returnList); + } + List> returnList = new ArrayList<>(); + returnList.add(mapList); + return BaseResult.getSuccessMessageEntity("查询数据成功", returnList); + } + } else { + List> mapList = mdmModuleDao.queryDataAll(entity); + List> returnList = new ArrayList<>(); + + if (mapList != null && mapList.size() > 0) { + for (int i = 0; i < mapList.size(); i++) { + //默认为根 + if (mapList.get(i).get(entity.getUpId()) == null || "".equals(mapList.get(i).get(entity.getUpId()))) { + List> children = getchilder(mapList.get(i).get("qsdfg").toString(), mapList, entity); + HashMap re = new HashMap<>(); + re.put("id", mapList.get(i).get("qsdfg")); + re.put("label", mapList.get(i).get(entity.getLabel())); + re.put("upID", mapList.get(i).get(entity.getUpId())); + if (children != null && children.size() > 0) { + re.put("children", children); + } + returnList.add(re); + } + } + } + return BaseResult.getSuccessMessageEntity("查询数据成功", returnList); + } + } + // + private List> gettochilder(String[] strArray, int i, List> mapList) { + List> maps = new ArrayList<>(); + for (int i1 = 0; i1 < mapList.size(); i1++) { + if (strArray[i].equals(mapList.get(i1).get("id").toString())) { + if (strArray.length >= (i + 2)) { + mapList.get(i1).put("children", gettochilder(strArray, i + 1, mapList)); + } + maps.add(mapList.get(i1)); + break; + } + } + return maps; + } + // + //private HashMap getFathers(List> mapListAll, HashMap mapList, MdmDto entity) { + // if (mapList.get("upID") == null) { + // return mapList; + // } + // HashMap retList = new HashMap<>(); + // if (mapListAll != null && mapListAll.size() > 0) { + // for (int i = 0; i < mapListAll.size(); i++) { + // //等于上级id的时候 + // if (mapListAll.get(i).get("qsdfg").equals(mapList.get("upID"))) { + // retList.put("id", mapListAll.get(i).get("qsdfg")); + // retList.put("label", mapListAll.get(i).get(entity.getLabel())); + // retList.put("upID", mapListAll.get(i).get(entity.getUpId())); + // List> returnList = new ArrayList<>(); + // returnList.add(mapList); + // retList.put("children", returnList); + // break; + // } + // } + // } + // HashMap a = getFathers(mapListAll, retList, entity); + // return a; + //} + // + private List> getchilder(String stringObjectHashMap, List> mapList, MdmDto entity) { + List> returnList = new ArrayList<>(); + if (mapList != null && mapList.size() > 0) { + for (int i = 0; i < mapList.size(); i++) { + //等于上级id的时候 + if (stringObjectHashMap.equals(mapList.get(i).get(entity.getUpId()))) { + List> children = getchilder(mapList.get(i).get(entity.getUpId()) + "," + mapList.get(i).get("qsdfg"), mapList, entity); + HashMap re = new HashMap<>(); + re.put("id", mapList.get(i).get("qsdfg")); + re.put("label", mapList.get(i).get(entity.getLabel())); + re.put("upID", mapList.get(i).get(entity.getUpId())); + if (children != null && children.size() > 0) { + re.put("children", children); + } + returnList.add(re); + } + } + } + return returnList; + } + // + /** + * @param object + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 主数据详情 区分类型 新增、修改、查看 + * @Date 9:40 上午 2023/10/18 + **/ + @Override + public JsonResultEntity queryMdmShowDetails(JSONObject object) { + MdmDto entity = getData("jsonStr", object, MdmDto.class); + if (entity == null) { + return BaseResult.getFailureMessageEntity("参数不允许为空"); + } + if (entity.getMdmCode() == null || "".equals(entity.getMdmCode())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + if (entity.getShowType() == null || "".equals(entity.getShowType())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + //查询模版 + //List mdmModuleEntities = mdmModuleDao.queryBase(mdmModuleEntity); + MdmModuleEntity mdmModuleEntities = mdmServiceCache.getMdmModuleEntity(entity.getMdmCode()); + if (mdmModuleEntities == null) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + MdmDetailViewVo mdmViewVo = new MdmDetailViewVo(); + mdmViewVo.setMdmModuleEntity(mdmModuleEntities); + + //查询数据源主表 + MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); + mdmModuleDbEntity.setMdmId(mdmModuleEntities.getId()); + mdmModuleDbEntity.setSts("Y"); + List mdmModuleDbEntityList = mdmServiceCache.queryMdmModuleDb(mdmModuleDbEntity); + if (mdmModuleDbEntityList == null || mdmModuleDbEntityList.size() == 0) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + //查询数据源表下面的字段 + MdmModuleDbFiledsEntity mdmModuleDbFiledsEntity = new MdmModuleDbFiledsEntity(); + mdmModuleDbFiledsEntity.setMdmId(mdmModuleEntities.getId()); + mdmModuleDbFiledsEntity.setSts("Y"); + List mdmModuleDbFiledsEntityList = mdmServiceCache.queryMdmModuleDbFileds(mdmModuleDbFiledsEntity); + if (mdmModuleDbFiledsEntityList == null || mdmModuleDbFiledsEntityList.size() == 0) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + //查询字段下的规则 + MdmModuleDbFiledsRuleEntity mdmModuleDbFiledsRuleEntity = new MdmModuleDbFiledsRuleEntity(); + mdmModuleDbFiledsRuleEntity.setMdmId(mdmModuleEntities.getId()); + mdmModuleDbFiledsRuleEntity.setSts("Y"); + List mdmModuleDbFiledsRuleEntityList = mdmModuleDbFiledsRuleDao.queryBase(mdmModuleDbFiledsRuleEntity); + if (mdmModuleDbFiledsRuleEntityList == null || mdmModuleDbFiledsRuleEntityList.size() == 0) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + MdmModuleViewDetailEntity mdmModuleViewDetailEntity = new MdmModuleViewDetailEntity(); + mdmModuleViewDetailEntity.setMdmId(mdmModuleEntities.getId()); + mdmModuleViewDetailEntity.setSts("Y"); + mdmModuleViewDetailEntity.setViewType(entity.getShowType());//设置显示字段类型 + List queryAll = mdmModuleViewDetailDao.queryBase(mdmModuleViewDetailEntity); + List mdmModuleViewDetailEntityList = new ArrayList<>(); + if(queryAll != null && queryAll.size() > 0){ + for (int i = 0; i < queryAll.size(); i++) { + if(entity.getShowType().equals(queryAll.get(i).getViewType())){ + mdmModuleViewDetailEntityList.add(queryAll.get(i)); + } + } + } + //组装数据 + assembleMdmShowDetails(mdmViewVo, mdmModuleDbEntityList, mdmModuleDbFiledsEntityList, mdmModuleDbFiledsRuleEntityList, mdmModuleViewDetailEntityList, entity.getShowType()); + return BaseResult.getSuccessMessageEntity("获取字段成功", mdmViewVo); + } + + /** + * @param mdmViewVo 返回对象 + * @param mdmModuleDbEntityList 数据源表 + * @param mdmModuleDbFiledsEntityList 数据源字段 + * @param mdmModuleDbFiledsRuleEntityList 数据源字段规则 + * @param mdmModuleViewDetailEntityList 数据源显示字段 + * @return void + * @Author lvleigang + * @Description 组装显示字段 + * @Date 9:10 上午 2023/11/6 + **/ + private void assembleMdmShowDetails(MdmDetailViewVo mdmViewVo, List mdmModuleDbEntityList, List mdmModuleDbFiledsEntityList, List mdmModuleDbFiledsRuleEntityList, List mdmModuleViewDetailEntityList, String showType) { + //主数据主表 + MdmModuleDbEntity mainMdmModuleDb = new MdmModuleDbEntity(); + List mainMdmModuleDbFileds = new ArrayList<>(); + //主数据子表 + List sublistMdmModuleDb = new ArrayList<>(); + + if (mdmModuleViewDetailEntityList != null && mdmModuleViewDetailEntityList.size() > 0) { + //先循环数据源表,设置出数据字段 + for (int i = 0; i < mdmModuleDbEntityList.size(); i++) { + if ("1".equals(mdmModuleDbEntityList.get(i).getDbType())) { + //1、主表 2、明细 + mainMdmModuleDb = mdmModuleDbEntityList.get(i); + //循环字段表 + if (mdmModuleDbFiledsEntityList != null && mdmModuleDbFiledsEntityList.size() > 0) { + for (int i1 = 0; i1 < mdmModuleDbFiledsEntityList.size(); i1++) { + if (mdmModuleDbEntityList.get(i).getId().equals(mdmModuleDbFiledsEntityList.get(i1).getDbId())) { + for (int b = 0; b < mdmModuleViewDetailEntityList.size(); b++) { + if (mdmModuleViewDetailEntityList.get(b).getViewFiled().equals(mdmModuleDbFiledsEntityList.get(i1).getId())) { + mainMdmModuleDbFileds.add(mdmModuleDbFiledsEntityList.get(i1)); + List mdmModuleDbFiledsRules = new ArrayList<>(); + //循环字段属性 + if (mdmModuleDbFiledsRuleEntityList != null && mdmModuleDbFiledsRuleEntityList.size() > 0) { + for (int i2 = 0; i2 < mdmModuleDbFiledsRuleEntityList.size(); i2++) { + if (mdmModuleDbFiledsEntityList.get(i1).getDbId().equals(mdmModuleDbFiledsRuleEntityList.get(i2).getDbId()) + && mdmModuleDbFiledsEntityList.get(i1).getId().equals(mdmModuleDbFiledsRuleEntityList.get(i2).getFiledId())) { + mdmModuleDbFiledsRules.add(mdmModuleDbFiledsRuleEntityList.get(i2)); + } + } + } + mdmModuleDbFiledsEntityList.get(i1).setMdmModuleDbFiledsRules(mdmModuleDbFiledsRules); + } + } + } + } + } + } else if ("2".equals(mdmModuleDbEntityList.get(i).getDbType())) { + //2、明细 + sublistMdmModuleDb.add(mdmModuleDbEntityList.get(i)); + //循环字段表 + if (mdmModuleDbFiledsEntityList != null && mdmModuleDbFiledsEntityList.size() > 0) { + List sublistMdmModuleDbFileds = new ArrayList<>(); + for (int i1 = 0; i1 < mdmModuleDbFiledsEntityList.size(); i1++) { + if (mdmModuleDbEntityList.get(i).getId().equals(mdmModuleDbFiledsEntityList.get(i1).getDbId())) { + for (int b = 0; b < mdmModuleViewDetailEntityList.size(); b++) { + if (mdmModuleViewDetailEntityList.get(b).getViewFiled().equals(mdmModuleDbFiledsEntityList.get(i1).getId())) { + sublistMdmModuleDbFileds.add(mdmModuleDbFiledsEntityList.get(i1)); + List mdmModuleDbFiledsRules = new ArrayList<>(); + //循环字段属性 + if (mdmModuleDbFiledsRuleEntityList != null && mdmModuleDbFiledsRuleEntityList.size() > 0) { + for (int i2 = 0; i2 < mdmModuleDbFiledsRuleEntityList.size(); i2++) { + if (mdmModuleDbFiledsEntityList.get(i1).getDbId().equals(mdmModuleDbFiledsRuleEntityList.get(i2).getDbId()) + && mdmModuleDbFiledsEntityList.get(i1).getId().equals(mdmModuleDbFiledsRuleEntityList.get(i2).getFiledId())) { + mdmModuleDbFiledsRules.add(mdmModuleDbFiledsRuleEntityList.get(i2)); + } + } + } + mdmModuleDbFiledsEntityList.get(i1).setMdmModuleDbFiledsRules(mdmModuleDbFiledsRules); + } + } + + } + } + mdmModuleDbEntityList.get(i).setSublistMdmModuleDbFileds(sublistMdmModuleDbFileds); + } + } + } + mainMdmModuleDb.setSublistMdmModuleDbFileds(mainMdmModuleDbFileds); + mdmViewVo.setMainMdmModuleDb(mainMdmModuleDb); + //主数据子表 + List mdmModuleDb = new ArrayList<>(); + if (sublistMdmModuleDb != null && sublistMdmModuleDb.size() > 0) { + for (int i = 0; i < sublistMdmModuleDb.size(); i++) { + if (sublistMdmModuleDb.get(i).getSublistMdmModuleDbFileds() != null && sublistMdmModuleDb.get(i).getSublistMdmModuleDbFileds().size() > 0) { + mdmModuleDb.add(sublistMdmModuleDb.get(i)); + } + } + } + //if ("5".equals(showType)) { + // MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); + // mdmModuleDbEntity.setDbName(mainMdmModuleDb.getDbName() + "_distribute"); + // mdmModuleDbEntity.setRemark(mainMdmModuleDb.getRemark() + "分发表"); + // mdmModuleDbEntity.setDbType("2"); + // List mdmModuleDbFiledsEntityList1 = getDistributeRole(); + // mdmModuleDbEntity.setSublistMdmModuleDbFileds(mdmModuleDbFiledsEntityList1); + // mdmModuleDb.add(mdmModuleDbEntity); + //} + mdmViewVo.setSublistMdmModuleDb(mdmModuleDb); + + } else { + mdmViewVo.setMainMdmModuleDb(mainMdmModuleDb); + mdmViewVo.setSublistMdmModuleDb(sublistMdmModuleDb); + } + } + // + //private List getDistributeRole() { + // List mdmModuleDbFiledsEntityList = new ArrayList<>(); + // //app + // MdmModuleDbFiledsEntity appFiled = new MdmModuleDbFiledsEntity(); + // appFiled.setChName("应用"); + // appFiled.setEnName("app_id"); + // appFiled.setFiledLength("50"); + // appFiled.setFiledType("3"); + // List appRule = new ArrayList<>(); + // MdmModuleDbFiledsRuleEntity appRuleTitie = new MdmModuleDbFiledsRuleEntity(); + // appRuleTitie.setFormName("optionRuleForm"); + // appRuleTitie.setRuleCode("title"); + // appRuleTitie.setRuleName("显示名"); + // appRuleTitie.setRuleType("2"); + // appRuleTitie.setRuleValue("应用"); + // MdmModuleDbFiledsRuleEntity appRulerow = new MdmModuleDbFiledsRuleEntity(); + // appRulerow.setFormName("optionRuleForm"); + // appRulerow.setRuleCode("row"); + // appRulerow.setRuleName("宽度"); + // appRulerow.setRuleType("2"); + // appRulerow.setRuleValue("6"); + // MdmModuleDbFiledsRuleEntity appRuletype = new MdmModuleDbFiledsRuleEntity(); + // appRuletype.setFormName("optionRuleForm"); + // appRuletype.setRuleCode("type"); + // appRuletype.setRuleName("数据类型"); + // appRuletype.setRuleType("2"); + // appRuletype.setRuleValue("select"); + // MdmModuleDbFiledsRuleEntity appRulerequired = new MdmModuleDbFiledsRuleEntity(); + // appRulerequired.setFormName("optionRuleForm"); + // appRulerequired.setRuleCode("required"); + // appRulerequired.setRuleName("必填"); + // appRulerequired.setRuleType("2"); + // MdmModuleDbFiledsRuleEntity appRuleservice = new MdmModuleDbFiledsRuleEntity(); + // appRuleservice.setFormName("typeOptionRuleForm"); + // appRuleservice.setRuleCode("service"); + // appRuleservice.setRuleName("服务名称"); + // appRuleservice.setRuleType("2"); + // appRuleservice.setRuleValue("sys_application"); + // MdmModuleDbFiledsRuleEntity appRulelabel = new MdmModuleDbFiledsRuleEntity(); + // appRulelabel.setFormName("typeOptionRuleForm"); + // appRulelabel.setRuleCode("label"); + // appRulelabel.setRuleName("label"); + // appRulelabel.setRuleType("2"); + // appRulelabel.setRuleValue("name"); + // MdmModuleDbFiledsRuleEntity appRulevalue = new MdmModuleDbFiledsRuleEntity(); + // appRulevalue.setFormName("typeOptionRuleForm"); + // appRulevalue.setRuleCode("value"); + // appRulevalue.setRuleName("value"); + // appRulevalue.setRuleType("2"); + // appRulevalue.setRuleValue("id"); + // appRule.add(appRulevalue); + // appRule.add(appRulelabel); + // appRule.add(appRuleservice); + // appRule.add(appRulerequired); + // appRule.add(appRuletype); + // appRule.add(appRulerow); + // appRule.add(appRuleTitie); + // appFiled.setMdmModuleDbFiledsRules(appRule); + // mdmModuleDbFiledsEntityList.add(appFiled); + // + // + // //status + // MdmModuleDbFiledsEntity statusFiled = new MdmModuleDbFiledsEntity(); + // statusFiled.setChName("状态"); + // statusFiled.setEnName("status"); + // statusFiled.setFiledLength("50"); + // statusFiled.setFiledType("3"); + // List statusRule = new ArrayList<>(); + // MdmModuleDbFiledsRuleEntity statusRuleTitie = new MdmModuleDbFiledsRuleEntity(); + // statusRuleTitie.setFormName("optionRuleForm"); + // statusRuleTitie.setRuleCode("title"); + // statusRuleTitie.setRuleName("显示名"); + // statusRuleTitie.setRuleType("2"); + // statusRuleTitie.setRuleValue("状态"); + // MdmModuleDbFiledsRuleEntity statusRulerow = new MdmModuleDbFiledsRuleEntity(); + // statusRulerow.setFormName("optionRuleForm"); + // statusRulerow.setRuleCode("row"); + // statusRulerow.setRuleName("宽度"); + // statusRulerow.setRuleType("2"); + // statusRulerow.setRuleValue("6"); + // MdmModuleDbFiledsRuleEntity statusRuletype = new MdmModuleDbFiledsRuleEntity(); + // statusRuletype.setFormName("optionRuleForm"); + // statusRuletype.setRuleCode("type"); + // statusRuletype.setRuleName("数据类型"); + // statusRuletype.setRuleType("2"); + // statusRuletype.setRuleValue("input"); + // MdmModuleDbFiledsRuleEntity statusRulerequired = new MdmModuleDbFiledsRuleEntity(); + // statusRulerequired.setFormName("optionRuleForm"); + // statusRulerequired.setRuleCode("required"); + // statusRulerequired.setRuleName("必填"); + // statusRulerequired.setRuleType("2"); + // statusRule.add(statusRulerequired); + // statusRule.add(statusRuletype); + // statusRule.add(statusRulerow); + // statusRule.add(statusRuleTitie); + // statusFiled.setMdmModuleDbFiledsRules(statusRule); + // mdmModuleDbFiledsEntityList.add(statusFiled); + // + // + // //msg + // MdmModuleDbFiledsEntity msgFiled = new MdmModuleDbFiledsEntity(); + // msgFiled.setChName("描述"); + // msgFiled.setEnName("msg"); + // msgFiled.setFiledLength("200"); + // msgFiled.setFiledType("3"); + // List msgRule = new ArrayList<>(); + // MdmModuleDbFiledsRuleEntity msgRuleTitie = new MdmModuleDbFiledsRuleEntity(); + // msgRuleTitie.setFormName("optionRuleForm"); + // msgRuleTitie.setRuleCode("title"); + // msgRuleTitie.setRuleName("显示名"); + // msgRuleTitie.setRuleType("2"); + // msgRuleTitie.setRuleValue("描述"); + // MdmModuleDbFiledsRuleEntity msgRulerow = new MdmModuleDbFiledsRuleEntity(); + // msgRulerow.setFormName("optionRuleForm"); + // msgRulerow.setRuleCode("row"); + // msgRulerow.setRuleName("宽度"); + // msgRulerow.setRuleType("2"); + // msgRulerow.setRuleValue("6"); + // MdmModuleDbFiledsRuleEntity msgRuletype = new MdmModuleDbFiledsRuleEntity(); + // msgRuletype.setFormName("optionRuleForm"); + // msgRuletype.setRuleCode("type"); + // msgRuletype.setRuleName("数据类型"); + // msgRuletype.setRuleType("2"); + // msgRuletype.setRuleValue("input"); + // MdmModuleDbFiledsRuleEntity msgRulerequired = new MdmModuleDbFiledsRuleEntity(); + // msgRulerequired.setFormName("optionRuleForm"); + // msgRulerequired.setRuleCode("required"); + // msgRulerequired.setRuleName("必填"); + // msgRulerequired.setRuleType("2"); + // msgRule.add(msgRulerequired); + // msgRule.add(msgRuletype); + // msgRule.add(msgRulerow); + // msgRule.add(msgRuleTitie); + // msgFiled.setMdmModuleDbFiledsRules(msgRule); + // mdmModuleDbFiledsEntityList.add(msgFiled); + // return mdmModuleDbFiledsEntityList; + //} + // + ///** + // * @param object + // * @return com.hzya.frame.web.entity.JsonResultEntity + // * @Author lvleigang + // * @Description 查询数据(list 或者 分页) + // * @Date 1:33 下午 2023/7/12 + // **/ + //@Override + //public JsonResultEntity queryMdmOptionData(JSONObject object) { + // ModuleDto entity = getData("jsonStr", object, ModuleDto.class); + // //校验是否有servecr传参 + // if (!checkStr(entity.getService())) { + // return BaseResult.getFailureMessageEntity("请先传递服务名"); + // } + // if (!checkStr(entity.getValue())) { + // return BaseResult.getFailureMessageEntity("请先传递存储字段"); + // } + // if (!checkStr(entity.getLabel())) { + // return BaseResult.getFailureMessageEntity("请先传递显示字段"); + // } // //查询数据源主表 // MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); - // mdmModuleDbEntity.setMdmId(mdmModuleEntity.getId()); - // mdmModuleDbEntity.setSts("Y"); - // List mdmModuleDbEntityList = mdmServiceCache.queryMdmModuleDb(mdmModuleDbEntity); - // if (mdmModuleDbEntityList == null || mdmModuleDbEntityList.size() == 0) { - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // String tablename = null; - // JSONObject jsonObject = new JSONObject(); - // for (int i = 0; i < mdmModuleDbEntityList.size(); i++) { - // //查询数据 - // Map queryData = new HashMap<>(); - // queryData.put("tableName", mdmModuleDbEntityList.get(i).getDbName());//表名 - // if ("1".equals(mdmModuleDbEntityList.get(i).getDbType())) { - // queryData.put("detailFlag", false);//是否明细 - // queryData.put("id", entity.getId());//字段 - // HashMap datas = mdmModuleDbDao.getServiceDataById(queryData); - // jsonObject.put(mdmModuleDbEntityList.get(i).getDbName(), datas); - // tablename = mdmModuleDbEntityList.get(i).getDbName() + "_distribute"; - // } else { - // queryData.put("detailFlag", true);//是否明细 - // queryData.put("id", entity.getId());//字段 - // List> datas = mdmModuleDbDao.getServiceByFormmainId(queryData); - // jsonObject.put(mdmModuleDbEntityList.get(i).getDbName(), datas); - // } - // } - // if (tablename != null && !"".equals(tablename)) { - // Map queryData = new HashMap<>(); - // queryData.put("tableName", tablename);//表名 - // queryData.put("id", entity.getId());//字段 - // List> datas = mdmModuleDbDao.getServiceByDistributeId(queryData); - // jsonObject.put(tablename, datas); - // } - // - // - // return BaseResult.getSuccessMessageEntity("获取数据成功", jsonObject); - //} - ///** - // * @param object - // * @return com.hzya.frame.web.entity.JsonResultEntity - // * @Author lvleigang - // * @Description 主数据详情数据修改 - // * @Date 9:40 上午 2023/10/18 - // **/ - //@Override - //public JsonResultEntity updateMdmShowDetailsData(JSONObject object) { - // JSONObject jsonObject = getstrObj("jsonStr", object); - // //校验是否有servecr传参 - // if (!checkData(jsonObject, "mdmCode")) { - // return BaseResult.getFailureMessageEntity("请先传递服务名"); - // } - // if (!checkData(jsonObject, "data")) { - // return BaseResult.getFailureMessageEntity("请先传递要修改的数据"); - // } - // JSONObject saveData = jsonObject.getJSONObject("data"); - // //校验唯一 - // MdmModuleEntity mdmModuleEntity = new MdmModuleEntity(); - // mdmModuleEntity.setMdmCode(jsonObject.getLong("mdmCode")); - // mdmModuleEntity.setSts("Y"); - // List mdmModuleEntities = mdmModuleDao.queryBase(mdmModuleEntity); - // if (mdmModuleEntities == null || mdmModuleEntities.size() != 1) { - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // mdmModuleEntity = mdmModuleEntities.get(0); - // MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); - // mdmModuleDbEntity.setMdmId(mdmModuleEntity.getId()); + // mdmModuleDbEntity.setId(entity.getId()); // mdmModuleDbEntity.setSts("Y"); // List mdmModuleDbEntityList = mdmModuleDbDao.queryBase(mdmModuleDbEntity); // if (mdmModuleDbEntityList == null || mdmModuleDbEntityList.size() == 0) { // return BaseResult.getFailureMessageEntity("系统错误"); // } - // String res = checkDataOnly(jsonObject.getInteger("mdmCode"), saveData, true, mdmModuleEntity, mdmModuleDbEntityList); - // - // if (res == null || "".equals(res)) { - // return BaseResult.getSuccessMessageEntity("修改数据成功"); + // entity.setTableName(mdmModuleDbEntityList.get(0).getDbName()); + // if (entity.getPageNum() != null && entity.getPageSize() != null) { + // PageHelper.startPage(entity.getPageNum(), entity.getPageSize()); + // List> mapList = mdmModuleDao.queryTemplateData(entity); + // PageInfo pageInfo = new PageInfo(mapList); + // return BaseResult.getSuccessMessageEntity("查询数据成功", pageInfo); // } else { - // return BaseResult.getFailureMessageEntity(res); + // List> mapList = mdmModuleDao.queryTemplateData(entity); + // return BaseResult.getSuccessMessageEntity("查询数据成功", mapList); // } //} // + /** + * @param object + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 主数据详情数据 区分类型 新增、修改、查看 + * @Date 9:40 上午 2023/10/18 + **/ + @Override + public JsonResultEntity queryMdmShowDetailsData(JSONObject object) { + MdmDto entity = getData("jsonStr", object, MdmDto.class); + if (entity == null) { + return BaseResult.getFailureMessageEntity("参数不允许为空"); + } + if (entity.getMdmCode() == null || "".equals(entity.getMdmCode())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + if (entity.getId() == null || "".equals(entity.getId())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + //查询模版 + + MdmModuleEntity mdmModuleEntity = mdmServiceCache.getMdmModuleEntity(entity.getMdmCode()); + if (mdmModuleEntity == null ) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + //查询数据源主表 + MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); + mdmModuleDbEntity.setMdmId(mdmModuleEntity.getId()); + mdmModuleDbEntity.setSts("Y"); + List mdmModuleDbEntityList = mdmServiceCache.queryMdmModuleDb(mdmModuleDbEntity); + if (mdmModuleDbEntityList == null || mdmModuleDbEntityList.size() == 0) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + String tablename = null; + JSONObject jsonObject = new JSONObject(); + for (int i = 0; i < mdmModuleDbEntityList.size(); i++) { + //查询数据 + Map queryData = new HashMap<>(); + queryData.put("tableName", mdmModuleDbEntityList.get(i).getDbName());//表名 + if ("1".equals(mdmModuleDbEntityList.get(i).getDbType())) { + queryData.put("detailFlag", false);//是否明细 + queryData.put("id", entity.getId());//字段 + HashMap datas = mdmModuleDbDao.getServiceDataById(queryData); + jsonObject.put(mdmModuleDbEntityList.get(i).getDbName(), datas); + tablename = mdmModuleDbEntityList.get(i).getDbName() + "_distribute"; + } else { + queryData.put("detailFlag", true);//是否明细 + queryData.put("id", entity.getId());//字段 + List> datas = mdmModuleDbDao.getServiceByFormmainId(queryData); + jsonObject.put(mdmModuleDbEntityList.get(i).getDbName(), datas); + } + } + if (tablename != null && !"".equals(tablename)) { + Map queryData = new HashMap<>(); + queryData.put("tableName", tablename);//表名 + queryData.put("id", entity.getId());//字段 + List> datas = mdmModuleDbDao.getServiceByDistributeId(queryData); + jsonObject.put(tablename, datas); + } + + + return BaseResult.getSuccessMessageEntity("获取数据成功", jsonObject); + } + /** + * @param object + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 主数据详情数据修改 + * @Date 9:40 上午 2023/10/18 + **/ + @Override + public JsonResultEntity updateMdmShowDetailsData(JSONObject object) { + JSONObject jsonObject = getstrObj("jsonStr", object); + //校验是否有servecr传参 + if (!checkData(jsonObject, "mdmCode")) { + return BaseResult.getFailureMessageEntity("请先传递服务名"); + } + if (!checkData(jsonObject, "data")) { + return BaseResult.getFailureMessageEntity("请先传递要修改的数据"); + } + JSONObject saveData = jsonObject.getJSONObject("data"); + //校验唯一 + MdmModuleEntity mdmModuleEntity = new MdmModuleEntity(); + mdmModuleEntity.setMdmCode(jsonObject.getLong("mdmCode")); + mdmModuleEntity.setSts("Y"); + List mdmModuleEntities = mdmModuleDao.queryBase(mdmModuleEntity); + if (mdmModuleEntities == null || mdmModuleEntities.size() != 1) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + mdmModuleEntity = mdmModuleEntities.get(0); + MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); + mdmModuleDbEntity.setMdmId(mdmModuleEntity.getId()); + mdmModuleDbEntity.setSts("Y"); + List mdmModuleDbEntityList = mdmModuleDbDao.queryBase(mdmModuleDbEntity); + if (mdmModuleDbEntityList == null || mdmModuleDbEntityList.size() == 0) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + String res = checkDataOnly(jsonObject.getInteger("mdmCode"), saveData, true, mdmModuleEntity, mdmModuleDbEntityList); + + if (res == null || "".equals(res)) { + return BaseResult.getSuccessMessageEntity("修改数据成功"); + } else { + return BaseResult.getFailureMessageEntity(res); + } + } + + + /** + * @param object + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 主数据详情数据新增 + * @Date 9:40 上午 2023/10/18 + **/ + @Override + public JsonResultEntity saveMdmShowDetailsData(JSONObject object) { + JSONObject jsonObject = getstrObj("jsonStr", object); + //校验是否有servecr传参 + if (!checkData(jsonObject, "mdmCode")) { + return BaseResult.getFailureMessageEntity("请先传递服务名"); + } + if (!checkData(jsonObject, "data")) { + return BaseResult.getFailureMessageEntity("请先传递要修改的数据"); + } + JSONObject saveData = jsonObject.getJSONObject("data"); + //校验唯一 + MdmModuleEntity mdmModuleEntity = new MdmModuleEntity(); + mdmModuleEntity.setMdmCode(jsonObject.getLong("mdmCode")); + mdmModuleEntity.setSts("Y"); + List mdmModuleEntities = mdmModuleDao.queryBase(mdmModuleEntity); + if (mdmModuleEntities == null || mdmModuleEntities.size() != 1) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + mdmModuleEntity = mdmModuleEntities.get(0); + MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); + mdmModuleDbEntity.setMdmId(mdmModuleEntity.getId()); + mdmModuleDbEntity.setSts("Y"); + List mdmModuleDbEntityList = mdmModuleDbDao.queryBase(mdmModuleDbEntity); + if (mdmModuleDbEntityList == null || mdmModuleDbEntityList.size() == 0) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + String res = checkDataOnly(jsonObject.getInteger("mdmCode"), saveData, false, mdmModuleEntity, mdmModuleDbEntityList); + + if (res == null || "".equals(res)) { + return BaseResult.getSuccessMessageEntity("保存数据成功"); + } else { + return BaseResult.getFailureMessageEntity(res); + } + } + // + // + /** + * @param object + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 主数据详情数据修改 + * @Date 9:40 上午 2023/10/18 + **/ + @Override + public JsonResultEntity deleteMdmShowDetailsData(JSONObject object) { + JSONObject jsonObject = getstrObj("jsonStr", object); + //校验是否有servecr传参 + if (!checkData(jsonObject, "mdmCode")) { + return BaseResult.getFailureMessageEntity("请先传递服务名"); + } + if (!checkData(jsonObject, "id")) { + return BaseResult.getFailureMessageEntity("请先传递要删除的数据"); + } + //校验唯一 + MdmModuleEntity mdmModuleEntity = mdmServiceCache.getMdmModuleEntity(jsonObject.getLong("mdmCode")); + if (mdmModuleEntity == null ) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); + mdmModuleDbEntity.setMdmId(mdmModuleEntity.getId()); + mdmModuleDbEntity.setSts("Y"); + List mdmModuleDbEntityList = mdmServiceCache.queryMdmModuleDb(mdmModuleDbEntity); + if (mdmModuleDbEntityList == null || mdmModuleDbEntityList.size() == 0) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + for (int i = 0; i < mdmModuleDbEntityList.size(); i++) { + if ("1".equals(mdmModuleDbEntityList.get(i).getDbType())) { + + //查询视图,如果树形,删除下级及子集 + //查询展示类型 + MdmModuleViewEntity mdmModuleViewEntity = new MdmModuleViewEntity(); + mdmModuleViewEntity.setMdmId(mdmModuleEntity.getId()); + mdmModuleViewEntity.setSts("Y"); + List moduleViewEntityList = mdmModuleViewDao.queryBase(mdmModuleViewEntity); + if (moduleViewEntityList == null || moduleViewEntityList.size() != 1) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + mdmModuleViewEntity = moduleViewEntityList.get(0); + + + //删除自己 + FormmainDeleteDto formmainDeleteDto = new FormmainDeleteDto(); + formmainDeleteDto.setId(jsonObject.getString("id")); + formmainDeleteDto.setLoginId(StpUtil.getLoginIdAsString()); + formmainDeleteDto.setTableName(mdmModuleDbEntityList.get(i).getDbName()); + if (mdmModuleViewEntity != null && mdmModuleViewEntity.getViewName() != null && "1".equals(mdmModuleViewEntity.getViewName()) && + mdmModuleViewEntity.getUpIdFiled() != null && !"".equals(mdmModuleViewEntity.getUpIdFiled())) { + formmainDeleteDto.setUpIdFiled(mdmModuleViewEntity.getUpIdFiled()); + + Map queryData = new HashMap<>(); + queryData.put("tableName", mdmModuleDbEntityList.get(i).getDbName());//表名 + queryData.put("detailFlag", false);//是否明细 + queryData.put("id", jsonObject.getString("id"));//字段 + HashMap datas = mdmModuleDbDao.getServiceDataById(queryData); + String upValue = null; + if (datas != null && datas.get(mdmModuleViewEntity.getUpIdFiled()) != null) { + upValue = datas.get(mdmModuleViewEntity.getUpIdFiled()).toString(); + } + if (upValue != null) { + formmainDeleteDto.setUpIdFiledValue(upValue + "," + jsonObject.getString("id")); + } else { + formmainDeleteDto.setUpIdFiledValue(jsonObject.getString("id")); + } + mdmModuleDao.deleteChilder(formmainDeleteDto); + } + mdmModuleDao.deleteTemplateById(formmainDeleteDto); + + } else { + //删除明细 + FormmainDeleteDto formmainDeleteDto = new FormmainDeleteDto(); + formmainDeleteDto.setFormmain_id(jsonObject.getString("id")); + formmainDeleteDto.setLoginId(StpUtil.getLoginIdAsString()); + formmainDeleteDto.setTableName(mdmModuleDbEntityList.get(i).getDbName()); + mdmModuleDao.deleteTemplateById(formmainDeleteDto); + } + } + return BaseResult.getSuccessMessageEntity("删除数据成功"); + } + // // ///** // * @param object // * @return com.hzya.frame.web.entity.JsonResultEntity // * @Author lvleigang - // * @Description 主数据详情数据新增 + // * @Description 处理分发数据 // * @Date 9:40 上午 2023/10/18 // **/ //@Override - //public JsonResultEntity saveMdmShowDetailsData(JSONObject object) { - // JSONObject jsonObject = getstrObj("jsonStr", object); - // //校验是否有servecr传参 - // if (!checkData(jsonObject, "mdmCode")) { - // return BaseResult.getFailureMessageEntity("请先传递服务名"); - // } - // if (!checkData(jsonObject, "data")) { - // return BaseResult.getFailureMessageEntity("请先传递要修改的数据"); - // } - // JSONObject saveData = jsonObject.getJSONObject("data"); - // //校验唯一 - // MdmModuleEntity mdmModuleEntity = new MdmModuleEntity(); - // mdmModuleEntity.setMdmCode(jsonObject.getLong("mdmCode")); - // mdmModuleEntity.setSts("Y"); - // List mdmModuleEntities = mdmModuleDao.queryBase(mdmModuleEntity); - // if (mdmModuleEntities == null || mdmModuleEntities.size() != 1) { - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // mdmModuleEntity = mdmModuleEntities.get(0); - // MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); - // mdmModuleDbEntity.setMdmId(mdmModuleEntity.getId()); - // mdmModuleDbEntity.setSts("Y"); - // List mdmModuleDbEntityList = mdmModuleDbDao.queryBase(mdmModuleDbEntity); - // if (mdmModuleDbEntityList == null || mdmModuleDbEntityList.size() == 0) { - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // String res = checkDataOnly(jsonObject.getInteger("mdmCode"), saveData, false, mdmModuleEntity, mdmModuleDbEntityList); - // - // if (res == null || "".equals(res)) { - // return BaseResult.getSuccessMessageEntity("保存数据成功"); - // } else { - // return BaseResult.getFailureMessageEntity(res); - // } - //} - //// - //// - ///** - // * @param object - // * @return com.hzya.frame.web.entity.JsonResultEntity - // * @Author lvleigang - // * @Description 主数据详情数据修改 - // * @Date 9:40 上午 2023/10/18 - // **/ - //@Override - //public JsonResultEntity deleteMdmShowDetailsData(JSONObject object) { + //public JsonResultEntity doMdmDistribute(JSONObject object) { // JSONObject jsonObject = getstrObj("jsonStr", object); // //校验是否有servecr传参 // if (!checkData(jsonObject, "mdmCode")) { @@ -3653,572 +1394,474 @@ public class MdmServiceImpl implements IMdmService { // if (!checkData(jsonObject, "id")) { // return BaseResult.getFailureMessageEntity("请先传递要删除的数据"); // } - // //校验唯一 - // MdmModuleEntity mdmModuleEntity = mdmServiceCache.getMdmModuleEntity(jsonObject.getLong("mdmCode")); - // if (mdmModuleEntity == null ) { - // return BaseResult.getFailureMessageEntity("系统错误"); + // if (!checkData(jsonObject, "appID")) { + // return BaseResult.getFailureMessageEntity("请先传递要删除的数据"); // } - // MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); - // mdmModuleDbEntity.setMdmId(mdmModuleEntity.getId()); - // mdmModuleDbEntity.setSts("Y"); - // List mdmModuleDbEntityList = mdmServiceCache.queryMdmModuleDb(mdmModuleDbEntity); - // if (mdmModuleDbEntityList == null || mdmModuleDbEntityList.size() == 0) { - // return BaseResult.getFailureMessageEntity("系统错误"); + // if (!checkData(jsonObject, "dataType")) { + // return BaseResult.getFailureMessageEntity("请先传递要删除的数据"); // } - // for (int i = 0; i < mdmModuleDbEntityList.size(); i++) { - // if ("1".equals(mdmModuleDbEntityList.get(i).getDbType())) { + // if("2".equals(jsonObject.getString("dataType"))){ + // boolean flag = false; + // //1、根据服务名查询分发数据 + // MdmModuleEntity mdmModuleEntity = new MdmModuleEntity(); + // mdmModuleEntity.setMdmCode(jsonObject.getInteger("mdmCode")); + // mdmModuleEntity.setSts("Y"); + // List mdmModuleEntities = mdmModuleDao.queryBase(mdmModuleEntity); + // if (mdmModuleEntities != null && mdmModuleEntities.size() == 1) { + // MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); + // mdmModuleDbEntity.setMdmId(mdmModuleEntities.get(0).getId()); + // mdmModuleDbEntity.setDbType("1"); + // mdmModuleDbEntity.setSts("Y"); + // List mdmModuleDbEntities = mdmModuleDbDao.queryBase(mdmModuleDbEntity); + // if (mdmModuleDbEntities != null && mdmModuleDbEntities.size() == 1) { + // mdmModuleDbEntity = mdmModuleDbEntities.get(0); + // } + // MdmModuleDistributeEntity mdmModuleDistributeEntity = new MdmModuleDistributeEntity(); + // mdmModuleDistributeEntity.setAppId(jsonObject.getString("appID")); + // mdmModuleDistributeEntity.setMdmId(mdmModuleEntities.get(0).getId()); + // List mdmModuleDistributeEntities = mdmModuleDistributeDao.queryBase(mdmModuleDistributeEntity); + // if (mdmModuleDistributeEntities != null && mdmModuleDistributeEntities.size() == 1) { + // if (mdmModuleDistributeEntities.get(0).getAddType() != null && "1".equals(mdmModuleDistributeEntities.get(0).getAddType())) { + // //2、查找插件 + // if (mdmModuleDistributeEntities.get(0).getAddPlug() != null && !"".equals(mdmModuleDistributeEntities.get(0).getAddPlug())) { + // //2、查找插件 + // SysApplicationPluginEntity sysApplicationPluginEntity = sysApplicationPluginDao.get(mdmModuleDistributeEntities.get(0).getAddPlug()); + // if(sysApplicationPluginEntity.getPluginCode() != null && !"".equals(sysApplicationPluginEntity.getPluginCode())){ + // //3、调用插件 + // PluginBaseEntity pluginBaseEntity = PluginUtils.getPluginsById(sysApplicationPluginEntity.getPluginCode()); + // try { + // JsonResultEntity s = pluginBaseEntity.executeBusiness(jsonObject); + // flag = true; + // } catch (Exception e) { + // logger.error("插件处理失败"+e.getMessage()); + // } + // } + // } + // } else { + // //TODO 连线 + // flag = true; + // } + // } + // if(mdmModuleDbEntity.getDbName()!= null && !"".equals(mdmModuleDbEntity.getDbName())) { + // MdmDistributeEntity mdmDistributeEntity = new MdmDistributeEntity(); + // mdmDistributeEntity.setCreate(); + // mdmDistributeEntity.setTableName(mdmModuleDbEntity.getDbName()+"_distribute"); + // mdmDistributeEntity.setFormmainId(jsonObject.getString("id")); + // mdmDistributeEntity.setAppId(jsonObject.getString("appID")); + // mdmDistributeEntity.setStatus("1"); + // mdmDistributeEntity.setMsg("发送成功"); + // if (!flag) { + // mdmDistributeEntity.setStatus("3"); + // mdmDistributeEntity.setMsg("发送失败"); + // } + // mdmModuleDao.saveDistribute(mdmDistributeEntity); + // return BaseResult.getSuccessMessageEntity("下发数据成功"); // - // //查询视图,如果树形,删除下级及子集 - // //查询展示类型 - // MdmModuleViewEntity mdmModuleViewEntity = new MdmModuleViewEntity(); - // mdmModuleViewEntity.setMdmId(mdmModuleEntity.getId()); - // mdmModuleViewEntity.setSts("Y"); - // List moduleViewEntityList = mdmServiceCache.queryMdmModuleView(mdmModuleViewEntity); - // if (moduleViewEntityList == null || moduleViewEntityList.size() != 1) { + // }else { // return BaseResult.getFailureMessageEntity("系统错误"); // } - // mdmModuleViewEntity = moduleViewEntityList.get(0); - // - // - // //删除自己 - // FormmainDeleteDto formmainDeleteDto = new FormmainDeleteDto(); - // formmainDeleteDto.setId(jsonObject.getString("id")); - // formmainDeleteDto.setLoginId(StpUtil.getLoginIdAsString()); - // formmainDeleteDto.setTableName(mdmModuleDbEntityList.get(i).getDbName()); - // if (mdmModuleViewEntity != null && mdmModuleViewEntity.getViewName() != null && "1".equals(mdmModuleViewEntity.getViewName()) && - // mdmModuleViewEntity.getUpIdFiled() != null && !"".equals(mdmModuleViewEntity.getUpIdFiled())) { - // formmainDeleteDto.setUpIdFiled(mdmModuleViewEntity.getUpIdFiled()); - // - // Map queryData = new HashMap<>(); - // queryData.put("tableName", mdmModuleDbEntityList.get(i).getDbName());//表名 - // queryData.put("detailFlag", false);//是否明细 - // queryData.put("id", jsonObject.getString("id"));//字段 - // HashMap datas = mdmModuleDbDao.getServiceDataById(queryData); - // String upValue = null; - // if (datas != null && datas.get(mdmModuleViewEntity.getUpIdFiled()) != null) { - // upValue = datas.get(mdmModuleViewEntity.getUpIdFiled()).toString(); - // } - // if (upValue != null) { - // formmainDeleteDto.setUpIdFiledValue(upValue + "," + jsonObject.getString("id")); - // } else { - // formmainDeleteDto.setUpIdFiledValue(jsonObject.getString("id")); - // } - // mdmModuleDao.deleteChilder(formmainDeleteDto); - // } - // mdmModuleDao.deleteTemplateById(formmainDeleteDto); - // - // } else { - // //删除明细 - // FormmainDeleteDto formmainDeleteDto = new FormmainDeleteDto(); - // formmainDeleteDto.setFormmain_id(jsonObject.getString("id")); - // formmainDeleteDto.setLoginId(StpUtil.getLoginIdAsString()); - // formmainDeleteDto.setTableName(mdmModuleDbEntityList.get(i).getDbName()); - // mdmModuleDao.deleteTemplateById(formmainDeleteDto); + // }else { + // return BaseResult.getFailureMessageEntity("系统错误"); // } - // } - // return BaseResult.getSuccessMessageEntity("删除数据成功"); - //} - //// - //// - /////** - //// * @param object - //// * @return com.hzya.frame.web.entity.JsonResultEntity - //// * @Author lvleigang - //// * @Description 处理分发数据 - //// * @Date 9:40 上午 2023/10/18 - //// **/ - ////@Override - ////public JsonResultEntity doMdmDistribute(JSONObject object) { - //// JSONObject jsonObject = getstrObj("jsonStr", object); - //// //校验是否有servecr传参 - //// if (!checkData(jsonObject, "mdmCode")) { - //// return BaseResult.getFailureMessageEntity("请先传递服务名"); - //// } - //// if (!checkData(jsonObject, "id")) { - //// return BaseResult.getFailureMessageEntity("请先传递要删除的数据"); - //// } - //// if (!checkData(jsonObject, "appID")) { - //// return BaseResult.getFailureMessageEntity("请先传递要删除的数据"); - //// } - //// if (!checkData(jsonObject, "dataType")) { - //// return BaseResult.getFailureMessageEntity("请先传递要删除的数据"); - //// } - //// if("2".equals(jsonObject.getString("dataType"))){ - //// boolean flag = false; - //// //1、根据服务名查询分发数据 - //// MdmModuleEntity mdmModuleEntity = new MdmModuleEntity(); - //// mdmModuleEntity.setMdmCode(jsonObject.getInteger("mdmCode")); - //// mdmModuleEntity.setSts("Y"); - //// List mdmModuleEntities = mdmModuleDao.queryBase(mdmModuleEntity); - //// if (mdmModuleEntities != null && mdmModuleEntities.size() == 1) { - //// MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); - //// mdmModuleDbEntity.setMdmId(mdmModuleEntities.get(0).getId()); - //// mdmModuleDbEntity.setDbType("1"); - //// mdmModuleDbEntity.setSts("Y"); - //// List mdmModuleDbEntities = mdmModuleDbDao.queryBase(mdmModuleDbEntity); - //// if (mdmModuleDbEntities != null && mdmModuleDbEntities.size() == 1) { - //// mdmModuleDbEntity = mdmModuleDbEntities.get(0); - //// } - //// MdmModuleDistributeEntity mdmModuleDistributeEntity = new MdmModuleDistributeEntity(); - //// mdmModuleDistributeEntity.setAppId(jsonObject.getString("appID")); - //// mdmModuleDistributeEntity.setMdmId(mdmModuleEntities.get(0).getId()); - //// List mdmModuleDistributeEntities = mdmModuleDistributeDao.queryBase(mdmModuleDistributeEntity); - //// if (mdmModuleDistributeEntities != null && mdmModuleDistributeEntities.size() == 1) { - //// if (mdmModuleDistributeEntities.get(0).getAddType() != null && "1".equals(mdmModuleDistributeEntities.get(0).getAddType())) { - //// //2、查找插件 - //// if (mdmModuleDistributeEntities.get(0).getAddPlug() != null && !"".equals(mdmModuleDistributeEntities.get(0).getAddPlug())) { - //// //2、查找插件 - //// SysApplicationPluginEntity sysApplicationPluginEntity = sysApplicationPluginDao.get(mdmModuleDistributeEntities.get(0).getAddPlug()); - //// if(sysApplicationPluginEntity.getPluginCode() != null && !"".equals(sysApplicationPluginEntity.getPluginCode())){ - //// //3、调用插件 - //// PluginBaseEntity pluginBaseEntity = PluginUtils.getPluginsById(sysApplicationPluginEntity.getPluginCode()); - //// try { - //// JsonResultEntity s = pluginBaseEntity.executeBusiness(jsonObject); - //// flag = true; - //// } catch (Exception e) { - //// logger.error("插件处理失败"+e.getMessage()); - //// } - //// } - //// } - //// } else { - //// //TODO 连线 - //// flag = true; - //// } - //// } - //// if(mdmModuleDbEntity.getDbName()!= null && !"".equals(mdmModuleDbEntity.getDbName())) { - //// MdmDistributeEntity mdmDistributeEntity = new MdmDistributeEntity(); - //// mdmDistributeEntity.setCreate(); - //// mdmDistributeEntity.setTableName(mdmModuleDbEntity.getDbName()+"_distribute"); - //// mdmDistributeEntity.setFormmainId(jsonObject.getString("id")); - //// mdmDistributeEntity.setAppId(jsonObject.getString("appID")); - //// mdmDistributeEntity.setStatus("1"); - //// mdmDistributeEntity.setMsg("发送成功"); - //// if (!flag) { - //// mdmDistributeEntity.setStatus("3"); - //// mdmDistributeEntity.setMsg("发送失败"); - //// } - //// mdmModuleDao.saveDistribute(mdmDistributeEntity); - //// return BaseResult.getSuccessMessageEntity("下发数据成功"); - //// - //// }else { - //// return BaseResult.getFailureMessageEntity("系统错误"); - //// } - //// }else { - //// return BaseResult.getFailureMessageEntity("系统错误"); - //// } - //// }else { - //// if (!checkData(jsonObject, "distributeID")) { - //// return BaseResult.getFailureMessageEntity("请先传递分发数据"); - //// } - //// boolean flag = false; - //// //1、根据服务名查询分发数据 - //// MdmModuleEntity mdmModuleEntity = new MdmModuleEntity(); - //// mdmModuleEntity.setMdmCode(jsonObject.getInteger("mdmCode")); - //// mdmModuleEntity.setSts("Y"); - //// List mdmModuleEntities = mdmModuleDao.queryBase(mdmModuleEntity); - //// if (mdmModuleEntities != null && mdmModuleEntities.size() == 1) { - //// MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); - //// mdmModuleDbEntity.setMdmId(mdmModuleEntities.get(0).getId()); - //// mdmModuleDbEntity.setDbType("1"); - //// mdmModuleDbEntity.setSts("Y"); - //// List mdmModuleDbEntities = mdmModuleDbDao.queryBase(mdmModuleDbEntity); - //// if (mdmModuleDbEntities != null && mdmModuleDbEntities.size() == 1) { - //// mdmModuleDbEntity = mdmModuleDbEntities.get(0); - //// } - //// MdmModuleDistributeEntity mdmModuleDistributeEntity = new MdmModuleDistributeEntity(); - //// mdmModuleDistributeEntity.setAppId(jsonObject.getString("appID")); - //// mdmModuleDistributeEntity.setMdmId(mdmModuleEntities.get(0).getId()); - //// List mdmModuleDistributeEntities = mdmModuleDistributeDao.queryBase(mdmModuleDistributeEntity); - //// if (mdmModuleDistributeEntities != null && mdmModuleDistributeEntities.size() == 1) { - //// if (mdmModuleDistributeEntities.get(0).getDeleteType() != null && "1".equals(mdmModuleDistributeEntities.get(0).getDeleteType())) { - //// //2、查找插件 - //// if (mdmModuleDistributeEntities.get(0).getDeletePlug() != null && !"".equals(mdmModuleDistributeEntities.get(0).getDeletePlug())) { - //// //2、查找插件 - //// SysApplicationPluginEntity sysApplicationPluginEntity = sysApplicationPluginDao.get(mdmModuleDistributeEntities.get(0).getDeletePlug()); - //// if(sysApplicationPluginEntity.getPluginCode() != null && !"".equals(sysApplicationPluginEntity.getPluginCode())){ - //// //3、调用插件 - //// PluginBaseEntity pluginBaseEntity = PluginUtils.getPluginsById(sysApplicationPluginEntity.getPluginCode()); - //// try { - //// JsonResultEntity s = pluginBaseEntity.executeBusiness(jsonObject); - //// flag = true; - //// } catch (Exception e) { - //// logger.error("插件处理失败"+e.getMessage()); - //// } - //// } - //// } - //// } else { - //// //TODO 连线 - //// flag = true; - //// } - //// } - //// if(mdmModuleDbEntity.getDbName()!= null && !"".equals(mdmModuleDbEntity.getDbName())) { - //// //删除数据 - //// MdmDistributeEntity mdmDistributeEntity = new MdmDistributeEntity(); - //// mdmDistributeEntity.setId(jsonObject.getString("distributeID")); - //// mdmDistributeEntity.setTableName(mdmModuleDbEntity.getDbName()+"_distribute"); - //// mdmDistributeEntity.setFormmainId(jsonObject.getString("id")); - //// mdmDistributeEntity.setAppId(jsonObject.getString("appID")); - //// mdmDistributeEntity.setStatus("1"); - //// mdmDistributeEntity.setMsg("删除成功"); - //// if (!flag) { - //// mdmDistributeEntity.setStatus("3"); - //// mdmDistributeEntity.setMsg("删除失败"); - //// } - //// mdmModuleDao.updateDistribute(mdmDistributeEntity); - //// return BaseResult.getSuccessMessageEntity("删除数据成功"); - //// - //// }else { - //// return BaseResult.getFailureMessageEntity("系统错误"); - //// } - //// }else { - //// return BaseResult.getFailureMessageEntity("系统错误"); - //// } - //// } - //// - ////} - //// - ///** - // * @param mdmCode - // * @param saveData - // * @param mdmModuleEntity - // * @param mdmModuleDbEntityList - // * @param flag 修改 新增 - // * @return java.lang.String - // * @Author lvleigang - // * @Description 校验数据 - // * @Date 11:20 上午 2023/11/6 - // **/ - //private String checkDataOnly(Integer mdmCode, JSONObject saveData, boolean flag, MdmModuleEntity mdmModuleEntity, List mdmModuleDbEntityList) { - // StringBuffer str = new StringBuffer(); - // - // //查询字段 - // //查询字段下的必填规则 - // MdmModuleDbFiledsEntity mdmModuleDbFiledsEntity = new MdmModuleDbFiledsEntity(); - // mdmModuleDbFiledsEntity.setMdmId(mdmModuleEntity.getId()); - // mdmModuleDbFiledsEntity.setSts("Y"); - // mdmModuleDbFiledsEntity.setRoletype("required"); - // mdmModuleDbFiledsEntity.setRoleValue("true"); - // List mdmModuleDbFiledsEntityList = mdmModuleDbFiledsDao.queryBase(mdmModuleDbFiledsEntity); - // - // if (mdmModuleDbFiledsEntityList != null && mdmModuleDbFiledsEntityList.size() > 0) { - // for (int i = 0; i < mdmModuleDbEntityList.size(); i++) { - // if ("1".equals(mdmModuleDbEntityList.get(i).getDbType())) { - // JSONObject jsonObject = saveData.getJSONObject(mdmModuleDbEntityList.get(i).getDbName()); - // for (int i1 = 0; i1 < mdmModuleDbFiledsEntityList.size(); i1++) { - // if (mdmModuleDbFiledsEntityList.get(i1).getDbId().equals(mdmModuleDbEntityList.get(i).getId())) { - // if (jsonObject.get(mdmModuleDbFiledsEntityList.get(i1).getEnName()) == null || "".equals(jsonObject.getString(mdmModuleDbFiledsEntityList.get(i1).getEnName()))) { - // if (str.toString() != null && !"".equals(str.toString())) { - // str.append(";"); - // } - // str.append(mdmModuleDbEntityList.get(i).getRemark() + "的" + mdmModuleDbFiledsEntityList.get(i1).getChName() + "不为空"); - // } - // } - // } - // } else { - // JSONArray jsonArray = saveData.getJSONArray(mdmModuleDbEntityList.get(i).getDbName()); - // if (jsonArray != null && jsonArray.size() > 0) { - // for (int i1 = 0; i1 < mdmModuleDbFiledsEntityList.size(); i1++) { - // if (mdmModuleDbFiledsEntityList.get(i1).getDbId().equals(mdmModuleDbEntityList.get(i).getId())) { - // for (int i2 = 0; i2 < jsonArray.size(); i2++) { - // JSONObject jsonObject = jsonArray.getJSONObject(i2); - // if (jsonObject.get(mdmModuleDbFiledsEntityList.get(i1).getEnName()) == null || "".equals(jsonObject.getString(mdmModuleDbFiledsEntityList.get(i1).getEnName()))) { - // if (str.toString() != null && !"".equals(str.toString())) { - // str.append(";"); - // } - // str.append(mdmModuleDbEntityList.get(i).getRemark() + "的" + mdmModuleDbFiledsEntityList.get(i1).getChName() + "不为空"); - // break; - // } - // } - // } - // } - // } - // } + // }else { + // if (!checkData(jsonObject, "distributeID")) { + // return BaseResult.getFailureMessageEntity("请先传递分发数据"); // } - // } - // - // if (str == null || "".equals(str.toString())) { - // //校验数据 - // MdmModuleDbFiledsEntity onlyFiledsEntity = new MdmModuleDbFiledsEntity(); - // onlyFiledsEntity.setMdmId(mdmModuleEntity.getId()); - // onlyFiledsEntity.setSts("Y"); - // onlyFiledsEntity.setRoletype("fieldsSole"); - // onlyFiledsEntity.setRoleValue("true"); - // - // List onlyEntityList = mdmModuleDbFiledsDao.queryBase(onlyFiledsEntity); - // - // if (onlyEntityList != null && onlyEntityList.size() > 0) { - // for (int i = 0; i < mdmModuleDbEntityList.size(); i++) { - // if ("1".equals(mdmModuleDbEntityList.get(i).getDbType())) { - // JSONObject jsonObject = saveData.getJSONObject(mdmModuleDbEntityList.get(i).getDbName()); - // for (int i1 = 0; i1 < onlyEntityList.size(); i1++) { - // if (onlyEntityList.get(i1).getDbId().equals(mdmModuleDbEntityList.get(i).getId())) { - // //校验唯一 - // Map map = new HashMap<>(); - // map.put("tableName", mdmModuleDbEntityList.get(i).getDbName()); - // if (flag) { - // map.put("id", jsonObject.getString("id")); - // } - // map.put("filedName", onlyEntityList.get(i1).getEnName()); - // map.put("filedValue", jsonObject.getString(onlyEntityList.get(i1).getEnName())); - // Integer count = mdmModuleDao.checkData(map); - // if (count > 0) { - // if (str.toString() != null && !"".equals(str.toString())) { - // str.append(";"); - // } - // str.append(mdmModuleDbEntityList.get(i).getRemark() + "的" + mdmModuleDbFiledsEntityList.get(i1).getChName() + "已存在"); + // boolean flag = false; + // //1、根据服务名查询分发数据 + // MdmModuleEntity mdmModuleEntity = new MdmModuleEntity(); + // mdmModuleEntity.setMdmCode(jsonObject.getInteger("mdmCode")); + // mdmModuleEntity.setSts("Y"); + // List mdmModuleEntities = mdmModuleDao.queryBase(mdmModuleEntity); + // if (mdmModuleEntities != null && mdmModuleEntities.size() == 1) { + // MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); + // mdmModuleDbEntity.setMdmId(mdmModuleEntities.get(0).getId()); + // mdmModuleDbEntity.setDbType("1"); + // mdmModuleDbEntity.setSts("Y"); + // List mdmModuleDbEntities = mdmModuleDbDao.queryBase(mdmModuleDbEntity); + // if (mdmModuleDbEntities != null && mdmModuleDbEntities.size() == 1) { + // mdmModuleDbEntity = mdmModuleDbEntities.get(0); + // } + // MdmModuleDistributeEntity mdmModuleDistributeEntity = new MdmModuleDistributeEntity(); + // mdmModuleDistributeEntity.setAppId(jsonObject.getString("appID")); + // mdmModuleDistributeEntity.setMdmId(mdmModuleEntities.get(0).getId()); + // List mdmModuleDistributeEntities = mdmModuleDistributeDao.queryBase(mdmModuleDistributeEntity); + // if (mdmModuleDistributeEntities != null && mdmModuleDistributeEntities.size() == 1) { + // if (mdmModuleDistributeEntities.get(0).getDeleteType() != null && "1".equals(mdmModuleDistributeEntities.get(0).getDeleteType())) { + // //2、查找插件 + // if (mdmModuleDistributeEntities.get(0).getDeletePlug() != null && !"".equals(mdmModuleDistributeEntities.get(0).getDeletePlug())) { + // //2、查找插件 + // SysApplicationPluginEntity sysApplicationPluginEntity = sysApplicationPluginDao.get(mdmModuleDistributeEntities.get(0).getDeletePlug()); + // if(sysApplicationPluginEntity.getPluginCode() != null && !"".equals(sysApplicationPluginEntity.getPluginCode())){ + // //3、调用插件 + // PluginBaseEntity pluginBaseEntity = PluginUtils.getPluginsById(sysApplicationPluginEntity.getPluginCode()); + // try { + // JsonResultEntity s = pluginBaseEntity.executeBusiness(jsonObject); + // flag = true; + // } catch (Exception e) { + // logger.error("插件处理失败"+e.getMessage()); // } // } // } // } else { - // JSONArray jsonArray = saveData.getJSONArray(mdmModuleDbEntityList.get(i).getDbName()); - // if (jsonArray != null && jsonArray.size() > 0) { - // for (int i1 = 0; i1 < onlyEntityList.size(); i1++) { - // if (onlyEntityList.get(i1).getDbId().equals(mdmModuleDbEntityList.get(i).getId())) { - // for (int i2 = 0; i2 < jsonArray.size(); i2++) { - // JSONObject jsonObject = jsonArray.getJSONObject(i2); - // - // //校验唯一 - // Map map = new HashMap<>(); - // map.put("tableName", mdmModuleDbEntityList.get(i).getDbName()); - // if (flag) { - // map.put("id", jsonObject.getString("id")); - // } - // map.put("filedName", onlyEntityList.get(i1).getEnName()); - // map.put("filedValue", jsonObject.getString(onlyEntityList.get(i1).getEnName())); - // Integer count = mdmModuleDao.checkData(map); - // if (count > 0) { - // if (str.toString() != null && !"".equals(str.toString())) { - // str.append(";"); - // } - // str.append(mdmModuleDbEntityList.get(i).getRemark() + "的" + mdmModuleDbFiledsEntityList.get(i1).getChName() + "已存在"); - // break; - // } - // } - // } - // } - // } + // //TODO 连线 + // flag = true; // } // } + // if(mdmModuleDbEntity.getDbName()!= null && !"".equals(mdmModuleDbEntity.getDbName())) { + // //删除数据 + // MdmDistributeEntity mdmDistributeEntity = new MdmDistributeEntity(); + // mdmDistributeEntity.setId(jsonObject.getString("distributeID")); + // mdmDistributeEntity.setTableName(mdmModuleDbEntity.getDbName()+"_distribute"); + // mdmDistributeEntity.setFormmainId(jsonObject.getString("id")); + // mdmDistributeEntity.setAppId(jsonObject.getString("appID")); + // mdmDistributeEntity.setStatus("1"); + // mdmDistributeEntity.setMsg("删除成功"); + // if (!flag) { + // mdmDistributeEntity.setStatus("3"); + // mdmDistributeEntity.setMsg("删除失败"); + // } + // mdmModuleDao.updateDistribute(mdmDistributeEntity); + // return BaseResult.getSuccessMessageEntity("删除数据成功"); + // + // }else { + // return BaseResult.getFailureMessageEntity("系统错误"); + // } + // }else { + // return BaseResult.getFailureMessageEntity("系统错误"); // } // } // - // - // //保存数据 - // if (str == null || "".equals(str.toString())) { - // String id = UUIDUtils.getUUID(); - // for (int i = 0; i < mdmModuleDbEntityList.size(); i++) { - // if ("1".equals(mdmModuleDbEntityList.get(i).getDbType())) { - // JSONObject jsonObject = saveData.getJSONObject(mdmModuleDbEntityList.get(i).getDbName()); - // //保存数据 - // MdmDataDto mdmDataDto = new MdmDataDto(); - // mdmDataDto.setTableName(mdmModuleDbEntityList.get(i).getDbName()); - // MdmModuleDbFiledsEntity mdmModuleDbFiledsEntity1 = new MdmModuleDbFiledsEntity(); - // mdmModuleDbFiledsEntity1.setMdmId(mdmModuleEntity.getId()); - // mdmModuleDbFiledsEntity1.setDbId(mdmModuleDbEntityList.get(i).getId()); - // mdmModuleDbFiledsEntity1.setSts("Y"); - // List fileds = mdmModuleDbFiledsDao.queryBase(mdmModuleDbFiledsEntity1); - // //查询单据规则 - // MdmTableCodeRuleEntity mdmTableCodeRuleEntity = new MdmTableCodeRuleEntity(); - // mdmTableCodeRuleEntity.setMdmId(mdmModuleEntity.getId()); - // mdmTableCodeRuleEntity.setDbId(mdmModuleDbEntityList.get(i).getId()); - // mdmTableCodeRuleEntity.setSts("Y"); - // List allMdmTableCodeRuleEntities = mdmServiceCache.queryMdmTableCodeRuleEntity(mdmTableCodeRuleEntity); - // List mdmTableCodeRuleEntities = new ArrayList<>(); - // if(allMdmTableCodeRuleEntities != null && allMdmTableCodeRuleEntities.size() > 0){ - // for (int i1 = 0; i1 < allMdmTableCodeRuleEntities.size(); i1++) { - // if(mdmModuleDbEntityList.get(i).getId().equals(allMdmTableCodeRuleEntities.get(i1).getDbId())){ - // mdmTableCodeRuleEntities.add(allMdmTableCodeRuleEntities.get(i1)); - // } - // } - // } - // StringBuffer document_rule = new StringBuffer(); - // Integer document_rule_num = 0; - // if (mdmTableCodeRuleEntities != null && mdmTableCodeRuleEntities.size() > 0) { - // for (int i1 = 0; i1 < mdmTableCodeRuleEntities.size(); i1++) { - // //1、连接符号 2、字符串 3、日期 4、流水号 - // if ("1".equals(mdmTableCodeRuleEntities.get(i1).getDbType())) { - // document_rule.append("-"); - // } else if ("2".equals(mdmTableCodeRuleEntities.get(i1).getDbType())) { - // document_rule.append(mdmTableCodeRuleEntities.get(i1).getDbValue()); - // } else if ("3".equals(mdmTableCodeRuleEntities.get(i1).getDbType())) { - // SimpleDateFormat sdf = new SimpleDateFormat(mdmTableCodeRuleEntities.get(i1).getDbValue());//要转换的时间格式 - // String stra = sdf.format(new Date()); - // document_rule.append(stra); - // } else if ("4".equals(mdmTableCodeRuleEntities.get(i1).getDbType())) { - // document_rule_num = mdmTableCodeRuleEntities.get(i1).getDbValue().length(); - // } - // } - // } - // List mdmDataFiledDtos = new ArrayList<>(); - // for (int i1 = 0; i1 < fileds.size(); i1++) { - // if (jsonObject.get(fileds.get(i1).getEnName()) != null) { - // MdmDataFiledDto mdmDataFiledDto = new MdmDataFiledDto(); - // mdmDataFiledDto.setFiledsName(fileds.get(i1).getEnName()); - // mdmDataFiledDto.setFiledsValue(jsonObject.getString(fileds.get(i1).getEnName())); - // mdmDataFiledDtos.add(mdmDataFiledDto); - // } - // } - // MdmDataFiledDto mdmDataFiledDto = new MdmDataFiledDto(); - // mdmDataFiledDto.setFiledsName("logid"); - // mdmDataFiledDto.setFiledsValue(StpUtil.getLoginIdAsString()); - // mdmDataFiledDtos.add(mdmDataFiledDto); - // mdmDataDto.setMdmDataFiledDtos(mdmDataFiledDtos); - // if (flag) { - // mdmDataDto.setId(jsonObject.getString("id")); - // id = jsonObject.getString("id"); - // int a = mdmModuleDao.updateForm(mdmDataDto); - // } else { - // - // mdmDataDto.setDbType(mdmModuleDbEntityList.get(i).getDbType()); - // mdmDataDto.setDocumentRule(document_rule.toString()); - // mdmDataDto.setDocumentRuleNum(document_rule_num); - // MdmDataFiledDto ids = new MdmDataFiledDto(); - // ids.setFiledsName("id"); - // ids.setFiledsValue(id); - // mdmDataFiledDtos.add(ids); - // mdmDataDto.setMdmDataFiledDtos(mdmDataFiledDtos); - // int a = mdmModuleDao.saveForm(mdmDataDto); - // } - // } - // } - // - // for (int i = 0; i < mdmModuleDbEntityList.size(); i++) { - // if ("2".equals(mdmModuleDbEntityList.get(i).getDbType())) { - // //删除明细 - // FormmainDeleteDto formmainDeleteDto = new FormmainDeleteDto(); - // formmainDeleteDto.setFormmain_id(id); - // formmainDeleteDto.setLoginId(StpUtil.getLoginIdAsString()); - // formmainDeleteDto.setTableName(mdmModuleDbEntityList.get(i).getDbName()); - // mdmModuleDao.deleteTemplateById(formmainDeleteDto); - // - // JSONArray jsonArray = saveData.getJSONArray(mdmModuleDbEntityList.get(i).getDbName()); - // if (jsonArray != null && jsonArray.size() > 0) { - // MdmModuleDbFiledsEntity mdmModuleDbFiledsEntity1 = new MdmModuleDbFiledsEntity(); - // mdmModuleDbFiledsEntity1.setMdmId(mdmModuleEntity.getId()); - // mdmModuleDbFiledsEntity1.setSts("Y"); - // List allfileds = mdmServiceCache.queryMdmModuleDbFileds(mdmModuleDbFiledsEntity1); - // List fileds = new ArrayList<>(); - // if(allfileds != null && allfileds.size() > 0){ - // for (int i1 = 0; i1 < allfileds.size(); i1++) { - // if(mdmModuleDbEntityList.get(i).getId().equals(allfileds.get(i1).getDbId())){ - // fileds.add(allfileds.get(i1)); - // } - // } - // } - // - // for (int i2 = 0; i2 < jsonArray.size(); i2++) { - // JSONObject jsonObject = jsonArray.getJSONObject(i2); - // //保存数据 - // MdmDataDto mdmDataDto = new MdmDataDto(); - // 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); - // } - // 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); - // } - // } - // } - // } - // } - // } - // return str.toString(); //} // - // - ///** - // * @param jsonObject - // * @return boolean - // * @Author lvleigang - // * @Description 校验是否有值 - // * @Date 2:20 下午 2023/7/10 - // **/ - //private boolean checkData(JSONObject jsonObject, String key) { - // if (jsonObject != null - // && jsonObject.getString(key) != null - // && !"".equals(jsonObject.getString(key))) { - // return true; - // } - // return false; - //} - // - //protected T getData(String key, JSONObject jsonObject, Class clz) { - // if (checkStr(jsonObject.getString(key))) { - // return jsonObject.getJSONObject(key).toJavaObject(clz); - // } - // return null; - //} - // - ///** - // * @param key - // * @param object - // * @return com.alibaba.fastjson.JSONObject - // * @Author lvleigang - // * @Description 获取对象转换成jsonobj - // * @Date 11:51 下午 2023/7/10 - // **/ - //protected JSONObject getstrObj(String key, JSONObject object) { - // if (checkStr(object.getString(key))) { - // return object.getJSONObject(key); - // } - // return new JSONObject(); - //} - // - ///** - // * @param str - // * @return void - // * @Author lvleigang - // * @Description 校验字符串 - // * @Date 11:41 上午 2022/12/7 - // **/ - //protected Boolean checkStr(String str) { - // Boolean flag = true; - // if (str == null || "".equals(str)) { - // flag = false; - // } - // return flag; - //} - // - ///** - // * @param str - // * @return void - // * @Author lvleigang - // * @Description 校验字符串 - // * @Date 11:41 上午 2022/12/7 - // **/ - //protected Boolean checkInt(Integer str) { - // Boolean flag = true; - // if (str == null) { - // flag = false; - // } - // return flag; - //} + /** + * @param mdmCode + * @param saveData + * @param mdmModuleEntity + * @param mdmModuleDbEntityList + * @param flag 修改 新增 + * @return java.lang.String + * @Author lvleigang + * @Description 校验数据 + * @Date 11:20 上午 2023/11/6 + **/ + private String checkDataOnly(Integer mdmCode, JSONObject saveData, boolean flag, MdmModuleEntity mdmModuleEntity, List mdmModuleDbEntityList) { + StringBuffer str = new StringBuffer(); + + //查询字段 + //查询字段下的必填规则 + MdmModuleDbFiledsEntity mdmModuleDbFiledsEntity = new MdmModuleDbFiledsEntity(); + mdmModuleDbFiledsEntity.setMdmId(mdmModuleEntity.getId()); + mdmModuleDbFiledsEntity.setSts("Y"); + mdmModuleDbFiledsEntity.setRoletype("required"); + mdmModuleDbFiledsEntity.setRoleValue("true"); + List mdmModuleDbFiledsEntityList = mdmModuleDbFiledsDao.queryBase(mdmModuleDbFiledsEntity); + + if (mdmModuleDbFiledsEntityList != null && mdmModuleDbFiledsEntityList.size() > 0) { + for (int i = 0; i < mdmModuleDbEntityList.size(); i++) { + if ("1".equals(mdmModuleDbEntityList.get(i).getDbType())) { + JSONObject jsonObject = saveData.getJSONObject(mdmModuleDbEntityList.get(i).getDbName()); + for (int i1 = 0; i1 < mdmModuleDbFiledsEntityList.size(); i1++) { + if (mdmModuleDbFiledsEntityList.get(i1).getDbId().equals(mdmModuleDbEntityList.get(i).getId())) { + if (jsonObject.get(mdmModuleDbFiledsEntityList.get(i1).getEnName()) == null || "".equals(jsonObject.getString(mdmModuleDbFiledsEntityList.get(i1).getEnName()))) { + if (str.toString() != null && !"".equals(str.toString())) { + str.append(";"); + } + str.append(mdmModuleDbEntityList.get(i).getRemark() + "的" + mdmModuleDbFiledsEntityList.get(i1).getChName() + "不为空"); + } + } + } + } else { + JSONArray jsonArray = saveData.getJSONArray(mdmModuleDbEntityList.get(i).getDbName()); + if (jsonArray != null && jsonArray.size() > 0) { + for (int i1 = 0; i1 < mdmModuleDbFiledsEntityList.size(); i1++) { + if (mdmModuleDbFiledsEntityList.get(i1).getDbId().equals(mdmModuleDbEntityList.get(i).getId())) { + for (int i2 = 0; i2 < jsonArray.size(); i2++) { + JSONObject jsonObject = jsonArray.getJSONObject(i2); + if (jsonObject.get(mdmModuleDbFiledsEntityList.get(i1).getEnName()) == null || "".equals(jsonObject.getString(mdmModuleDbFiledsEntityList.get(i1).getEnName()))) { + if (str.toString() != null && !"".equals(str.toString())) { + str.append(";"); + } + str.append(mdmModuleDbEntityList.get(i).getRemark() + "的" + mdmModuleDbFiledsEntityList.get(i1).getChName() + "不为空"); + break; + } + } + } + } + } + } + } + } + + if (str == null || "".equals(str.toString())) { + //校验数据 + MdmModuleDbFiledsEntity onlyFiledsEntity = new MdmModuleDbFiledsEntity(); + onlyFiledsEntity.setMdmId(mdmModuleEntity.getId()); + onlyFiledsEntity.setSts("Y"); + onlyFiledsEntity.setRoletype("fieldsSole"); + onlyFiledsEntity.setRoleValue("true"); + + List onlyEntityList = mdmModuleDbFiledsDao.queryBase(onlyFiledsEntity); + + if (onlyEntityList != null && onlyEntityList.size() > 0) { + for (int i = 0; i < mdmModuleDbEntityList.size(); i++) { + if ("1".equals(mdmModuleDbEntityList.get(i).getDbType())) { + JSONObject jsonObject = saveData.getJSONObject(mdmModuleDbEntityList.get(i).getDbName()); + for (int i1 = 0; i1 < onlyEntityList.size(); i1++) { + if (onlyEntityList.get(i1).getDbId().equals(mdmModuleDbEntityList.get(i).getId())) { + //校验唯一 + Map map = new HashMap<>(); + map.put("tableName", mdmModuleDbEntityList.get(i).getDbName()); + if (flag) { + map.put("id", jsonObject.getString("id")); + } + map.put("filedName", onlyEntityList.get(i1).getEnName()); + map.put("filedValue", jsonObject.getString(onlyEntityList.get(i1).getEnName())); + Integer count = mdmModuleDao.checkData(map); + if (count > 0) { + if (str.toString() != null && !"".equals(str.toString())) { + str.append(";"); + } + str.append(mdmModuleDbEntityList.get(i).getRemark() + "的" + mdmModuleDbFiledsEntityList.get(i1).getChName() + "已存在"); + } + } + } + } else { + JSONArray jsonArray = saveData.getJSONArray(mdmModuleDbEntityList.get(i).getDbName()); + if (jsonArray != null && jsonArray.size() > 0) { + for (int i1 = 0; i1 < onlyEntityList.size(); i1++) { + if (onlyEntityList.get(i1).getDbId().equals(mdmModuleDbEntityList.get(i).getId())) { + for (int i2 = 0; i2 < jsonArray.size(); i2++) { + JSONObject jsonObject = jsonArray.getJSONObject(i2); + + //校验唯一 + Map map = new HashMap<>(); + map.put("tableName", mdmModuleDbEntityList.get(i).getDbName()); + if (flag) { + map.put("id", jsonObject.getString("id")); + } + map.put("filedName", onlyEntityList.get(i1).getEnName()); + map.put("filedValue", jsonObject.getString(onlyEntityList.get(i1).getEnName())); + Integer count = mdmModuleDao.checkData(map); + if (count > 0) { + if (str.toString() != null && !"".equals(str.toString())) { + str.append(";"); + } + str.append(mdmModuleDbEntityList.get(i).getRemark() + "的" + mdmModuleDbFiledsEntityList.get(i1).getChName() + "已存在"); + break; + } + } + } + } + } + } + } + } + } + + + //保存数据 + if (str == null || "".equals(str.toString())) { + String id = UUIDUtils.getUUID(); + for (int i = 0; i < mdmModuleDbEntityList.size(); i++) { + if ("1".equals(mdmModuleDbEntityList.get(i).getDbType())) { + JSONObject jsonObject = saveData.getJSONObject(mdmModuleDbEntityList.get(i).getDbName()); + //保存数据 + MdmDataDto mdmDataDto = new MdmDataDto(); + mdmDataDto.setTableName(mdmModuleDbEntityList.get(i).getDbName()); + MdmModuleDbFiledsEntity mdmModuleDbFiledsEntity1 = new MdmModuleDbFiledsEntity(); + mdmModuleDbFiledsEntity1.setMdmId(mdmModuleEntity.getId()); + mdmModuleDbFiledsEntity1.setDbId(mdmModuleDbEntityList.get(i).getId()); + mdmModuleDbFiledsEntity1.setSts("Y"); + List fileds = mdmModuleDbFiledsDao.queryBase(mdmModuleDbFiledsEntity1); + //查询单据规则 + MdmTableCodeRuleEntity mdmTableCodeRuleEntity = new MdmTableCodeRuleEntity(); + mdmTableCodeRuleEntity.setMdmId(mdmModuleEntity.getId()); + mdmTableCodeRuleEntity.setDbId(mdmModuleDbEntityList.get(i).getId()); + mdmTableCodeRuleEntity.setSts("Y"); + List allMdmTableCodeRuleEntities = mdmTableCodeRuleDao.queryBase(mdmTableCodeRuleEntity); + List mdmTableCodeRuleEntities = new ArrayList<>(); + if(allMdmTableCodeRuleEntities != null && allMdmTableCodeRuleEntities.size() > 0){ + for (int i1 = 0; i1 < allMdmTableCodeRuleEntities.size(); i1++) { + if(mdmModuleDbEntityList.get(i).getId().equals(allMdmTableCodeRuleEntities.get(i1).getDbId())){ + mdmTableCodeRuleEntities.add(allMdmTableCodeRuleEntities.get(i1)); + } + } + } + StringBuffer document_rule = new StringBuffer(); + Integer document_rule_num = 0; + if (mdmTableCodeRuleEntities != null && mdmTableCodeRuleEntities.size() > 0) { + for (int i1 = 0; i1 < mdmTableCodeRuleEntities.size(); i1++) { + //1、连接符号 2、字符串 3、日期 4、流水号 + if ("1".equals(mdmTableCodeRuleEntities.get(i1).getDbType())) { + document_rule.append("-"); + } else if ("2".equals(mdmTableCodeRuleEntities.get(i1).getDbType())) { + document_rule.append(mdmTableCodeRuleEntities.get(i1).getDbValue()); + } else if ("3".equals(mdmTableCodeRuleEntities.get(i1).getDbType())) { + SimpleDateFormat sdf = new SimpleDateFormat(mdmTableCodeRuleEntities.get(i1).getDbValue());//要转换的时间格式 + String stra = sdf.format(new Date()); + document_rule.append(stra); + } else if ("4".equals(mdmTableCodeRuleEntities.get(i1).getDbType())) { + document_rule_num = mdmTableCodeRuleEntities.get(i1).getDbValue().length(); + } + } + } + List mdmDataFiledDtos = new ArrayList<>(); + for (int i1 = 0; i1 < fileds.size(); i1++) { + if (jsonObject.get(fileds.get(i1).getEnName()) != null) { + MdmDataFiledDto mdmDataFiledDto = new MdmDataFiledDto(); + mdmDataFiledDto.setFiledsName(fileds.get(i1).getEnName()); + mdmDataFiledDto.setFiledsValue(jsonObject.getString(fileds.get(i1).getEnName())); + mdmDataFiledDtos.add(mdmDataFiledDto); + } + } + MdmDataFiledDto mdmDataFiledDto = new MdmDataFiledDto(); + mdmDataFiledDto.setFiledsName("logid"); + mdmDataFiledDto.setFiledsValue(StpUtil.getLoginIdAsString()); + mdmDataFiledDtos.add(mdmDataFiledDto); + mdmDataDto.setMdmDataFiledDtos(mdmDataFiledDtos); + if (flag) { + mdmDataDto.setId(jsonObject.getString("id")); + id = jsonObject.getString("id"); + int a = mdmModuleDao.updateForm(mdmDataDto); + } else { + + mdmDataDto.setDbType(mdmModuleDbEntityList.get(i).getDbType()); + mdmDataDto.setDocumentRule(document_rule.toString()); + mdmDataDto.setDocumentRuleNum(document_rule_num); + MdmDataFiledDto ids = new MdmDataFiledDto(); + ids.setFiledsName("id"); + ids.setFiledsValue(id); + mdmDataFiledDtos.add(ids); + mdmDataDto.setMdmDataFiledDtos(mdmDataFiledDtos); + int a = mdmModuleDao.saveForm(mdmDataDto); + } + } + } + + for (int i = 0; i < mdmModuleDbEntityList.size(); i++) { + if ("2".equals(mdmModuleDbEntityList.get(i).getDbType())) { + //删除明细 + FormmainDeleteDto formmainDeleteDto = new FormmainDeleteDto(); + formmainDeleteDto.setFormmain_id(id); + formmainDeleteDto.setLoginId(StpUtil.getLoginIdAsString()); + formmainDeleteDto.setTableName(mdmModuleDbEntityList.get(i).getDbName()); + mdmModuleDao.deleteTemplateById(formmainDeleteDto); + + JSONArray jsonArray = saveData.getJSONArray(mdmModuleDbEntityList.get(i).getDbName()); + if (jsonArray != null && jsonArray.size() > 0) { + MdmModuleDbFiledsEntity mdmModuleDbFiledsEntity1 = new MdmModuleDbFiledsEntity(); + mdmModuleDbFiledsEntity1.setMdmId(mdmModuleEntity.getId()); + mdmModuleDbFiledsEntity1.setSts("Y"); + List allfileds = mdmServiceCache.queryMdmModuleDbFileds(mdmModuleDbFiledsEntity1); + List fileds = new ArrayList<>(); + if(allfileds != null && allfileds.size() > 0){ + for (int i1 = 0; i1 < allfileds.size(); i1++) { + if(mdmModuleDbEntityList.get(i).getId().equals(allfileds.get(i1).getDbId())){ + fileds.add(allfileds.get(i1)); + } + } + } + + for (int i2 = 0; i2 < jsonArray.size(); i2++) { + JSONObject jsonObject = jsonArray.getJSONObject(i2); + //保存数据 + MdmDataDto mdmDataDto = new MdmDataDto(); + 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); + } + 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); + } + } + } + } + } + } + return str.toString(); + } + + + /** + * @param jsonObject + * @return boolean + * @Author lvleigang + * @Description 校验是否有值 + * @Date 2:20 下午 2023/7/10 + **/ + private boolean checkData(JSONObject jsonObject, String key) { + if (jsonObject != null + && jsonObject.getString(key) != null + && !"".equals(jsonObject.getString(key))) { + return true; + } + return false; + } + + protected T getData(String key, JSONObject jsonObject, Class clz) { + if (checkStr(jsonObject.getString(key))) { + return jsonObject.getJSONObject(key).toJavaObject(clz); + } + return null; + } + + /** + * @param key + * @param object + * @return com.alibaba.fastjson.JSONObject + * @Author lvleigang + * @Description 获取对象转换成jsonobj + * @Date 11:51 下午 2023/7/10 + **/ + protected JSONObject getstrObj(String key, JSONObject object) { + if (checkStr(object.getString(key))) { + return object.getJSONObject(key); + } + return new JSONObject(); + } + + /** + * @param str + * @return void + * @Author lvleigang + * @Description 校验字符串 + * @Date 11:41 上午 2022/12/7 + **/ + protected Boolean checkStr(String str) { + Boolean flag = true; + if (str == null || "".equals(str)) { + flag = false; + } + return flag; + } + } 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 693c62e5..b88c5880 100644 --- a/service/src/main/java/com/hzya/frame/serviceUtil/DsDataSourceUtil.java +++ b/service/src/main/java/com/hzya/frame/serviceUtil/DsDataSourceUtil.java @@ -5,7 +5,7 @@ import com.alibaba.fastjson.JSONObject; import com.baomidou.dynamic.datasource.DynamicRoutingDataSource; import com.baomidou.dynamic.datasource.exception.CannotFindDataSourceException; import com.hzya.frame.datasource.DataSourceUtilProperties; -import com.hzya.frame.sys.dataSource.entity.SysDataSourceEntity; +import com.hzya.frame.sysnew.application.database.entity.SysApplicationDatabaseEntity; import com.hzya.frame.sysnew.application.entity.SysApplicationDatasourceDto; import com.hzya.frame.util.AESUtil; import org.slf4j.Logger; @@ -24,21 +24,20 @@ public class DsDataSourceUtil { @Resource private DataSource dataSource; - public void addDataSource(SysDataSourceEntity sysDataSourceVo) throws Exception { + public void addDataSource(SysApplicationDatabaseEntity sysDataSourceVo) throws Exception { DynamicRoutingDataSource ds = (DynamicRoutingDataSource) dataSource; JSONObject defaultDataSourceProperties = new JSONObject(); defaultDataSourceProperties.put("datasource_code", sysDataSourceVo.getSourceCode()); defaultDataSourceProperties.put("source_url", sysDataSourceVo.getSourceUrl()); defaultDataSourceProperties.put("source_type", sysDataSourceVo.getSourceTypeName()); defaultDataSourceProperties.put("login_name", sysDataSourceVo.getLoginName()); - defaultDataSourceProperties.put("password", sysDataSourceVo.getPassword()); + defaultDataSourceProperties.put("password", AESUtil.decrypt(sysDataSourceVo.getPassword())); defaultDataSourceProperties.put("db_name", sysDataSourceVo.getDbName()); logger.info("***初始化数据源-{}:*********", sysDataSourceVo.getSourceName()); DruidDataSource dataSource = createDefaultDataSource(defaultDataSourceProperties); ds.addDataSource(sysDataSourceVo.getSourceCode(), dataSource); logger.info("***初始化数据源-{}成功:*********", sysDataSourceVo.getSourceName()); } - /** * @param code * @return boolean @@ -57,16 +56,16 @@ public class DsDataSourceUtil { } /** - * @param sysDataSourceVo + * @param sysApplicationDatabaseEntity * @return boolean * @Author lvleigang * @Description 修改数据源 * @Date 11:40 上午 2023/9/6 **/ - public void editDataSource(SysDataSourceEntity sysDataSourceVo) throws Exception { + public void editDataSource(SysApplicationDatabaseEntity sysApplicationDatabaseEntity) throws Exception { //先删除后添加 - removeDataSource(sysDataSourceVo.getSourceCode()); - addDataSource(sysDataSourceVo); + removeDataSource(sysApplicationDatabaseEntity.getSourceCode()); + addDataSource(sysApplicationDatabaseEntity); } diff --git a/service/src/main/java/com/hzya/frame/sys/dataSource/dao/ISysDataSourceDao.java b/service/src/main/java/com/hzya/frame/sys/dataSource/dao/ISysDataSourceDao.java deleted file mode 100644 index acfcaf47..00000000 --- a/service/src/main/java/com/hzya/frame/sys/dataSource/dao/ISysDataSourceDao.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.hzya.frame.sys.dataSource.dao; - -import com.hzya.frame.sys.dataSource.entity.SysDataSourceEntity; -import com.hzya.frame.basedao.dao.IBaseDao; -import com.hzya.frame.sys.dataSource.entity.SysDataSourceVo; - -import java.util.List; - -/** - * 数据源表(sys_data_source: table)表数据库访问层 - * - * @author makejava - * @since 2023-09-05 16:07:01 - */ -public interface ISysDataSourceDao extends IBaseDao { - - List queryVoList(SysDataSourceEntity entity); - int queryVoList_COUNT(SysDataSourceEntity entity); - - Integer entity_count_not_id(SysDataSourceEntity checkEntity); - - List queryDSBase(SysDataSourceEntity entity); -} - diff --git a/service/src/main/java/com/hzya/frame/sys/dataSource/dao/impl/SysDataSourceDaoImpl.java b/service/src/main/java/com/hzya/frame/sys/dataSource/dao/impl/SysDataSourceDaoImpl.java deleted file mode 100644 index 0f9948f1..00000000 --- a/service/src/main/java/com/hzya/frame/sys/dataSource/dao/impl/SysDataSourceDaoImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.hzya.frame.sys.dataSource.dao.impl; - -import com.baomidou.dynamic.datasource.annotation.DS; -import com.hzya.frame.sys.dataSource.entity.SysDataSourceEntity; -import com.hzya.frame.sys.dataSource.dao.ISysDataSourceDao; -import com.hzya.frame.sys.dataSource.entity.SysDataSourceVo; -import org.springframework.stereotype.Repository; -import com.hzya.frame.basedao.dao.MybatisGenericDao; - -import java.util.List; - -/** - * 数据源表(SysDataSource)表数据库访问层 - * - * @author makejava - * @since 2023-09-05 16:07:03 - */ -@Repository(value = "SysDataSourceDaoImpl") -public class SysDataSourceDaoImpl extends MybatisGenericDao implements ISysDataSourceDao{ - - - @DS("master") - @Override - public List queryVoList(SysDataSourceEntity entity) { - List o = (List) super.selectList(getSqlIdPrifx() + "queryVoList", entity); - return o; - } - @Override - public int queryVoList_COUNT(SysDataSourceEntity entity) { - int o = (int) super.selectOne(getSqlIdPrifx() + "queryVoList_COUNT", entity); - return o; - } - - @Override - public Integer entity_count_not_id(SysDataSourceEntity entity) { - Integer o = (Integer) super.selectOne(getSqlIdPrifx() + "entity_count_not_id", entity); - return o; - } - - @DS("master") - @Override - public List queryDSBase(SysDataSourceEntity entity) { - List o = (List) super.selectList(getSqlIdPrifx() + "queryDSBase", entity); - return o; - } -} - diff --git a/service/src/main/java/com/hzya/frame/sys/dataSource/entity/SysDataSourceEntity.java b/service/src/main/java/com/hzya/frame/sys/dataSource/entity/SysDataSourceEntity.java deleted file mode 100644 index d830b13b..00000000 --- a/service/src/main/java/com/hzya/frame/sys/dataSource/entity/SysDataSourceEntity.java +++ /dev/null @@ -1,168 +0,0 @@ -package com.hzya.frame.sys.dataSource.entity; - -import java.util.Date; -import com.hzya.frame.web.entity.BaseEntity; -/** - * 数据源表(SysDataSource)实体类 - * - * @author makejava - * @since 2023-09-05 16:07:06 - */ -public class SysDataSourceEntity extends BaseEntity { - - /** 数据源唯一编码 */ - private String sourceCode; - /** 数据源名称 */ - private String sourceName; - /** ip */ - private String sourceIp; - /** 端口 */ - private String sourcePort; - /** 数据库名称 */ - private String dbName; - /** 数据源类型 1oracle 2sqlsever 3mysql */ - private String sourceType; - /** 登录名 */ - private String loginName; - /** 密码 */ - private String password; - /** 选择oracle下服务名称 */ - private String serviceName; - /** 使用状态1启用0锁定 */ - private Integer useState; - /** 数据源状态 1校验成功0校验失败 */ - private String dataState; - - public String getSourceCode() { - return sourceCode; - } - - public void setSourceCode(String sourceCode) { - this.sourceCode = sourceCode; - } - - public String getSourceName() { - return sourceName; - } - - public void setSourceName(String sourceName) { - this.sourceName = sourceName; - } - - public String getSourceIp() { - return sourceIp; - } - - public void setSourceIp(String sourceIp) { - this.sourceIp = sourceIp; - } - - public String getSourcePort() { - return sourcePort; - } - - public void setSourcePort(String sourcePort) { - this.sourcePort = sourcePort; - } - - public String getDbName() { - return dbName; - } - - public void setDbName(String dbName) { - this.dbName = dbName; - } - - public String getSourceType() { - return sourceType; - } - - public void setSourceType(String sourceType) { - this.sourceType = sourceType; - } - - public String getLoginName() { - return loginName; - } - - public void setLoginName(String loginName) { - this.loginName = loginName; - } - - public String getPassword() { - return password; - } - - public void setPassword(String password) { - this.password = password; - } - - public String getServiceName() { - return serviceName; - } - - public void setServiceName(String serviceName) { - this.serviceName = serviceName; - } - - public Integer getUseState() { - return useState; - } - - public void setUseState(Integer useState) { - this.useState = useState; - } - public String getSourceUrl() { - StringBuffer sourceUrl = new StringBuffer(); - if(sourceType != null){ - switch (sourceType) { - case "1": //oracle - //jdbc:oracle:thin:@60.204.132.91:1521:ORCL - sourceUrl.append("jdbc:oracle:thin:@").append(sourceIp).append(":").append(sourcePort).append(":").append(serviceName); - break; - case "2": //sqlsever - //jdbc:sqlserver://221.12.175.82:1433;DatabaseName=U8CLOUD;encrypt=false;trustServerCertificate=true - sourceUrl.append("jdbc:jtds:sqlserver://").append(sourceIp).append(":").append(sourcePort).append("/").append(dbName).append(";encrypt=false;trustServerCertificate=true"); - break; - case "3": //mysql - //jdbc:mysql://hzya.ufyct.com:9096/businesscenternew?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF8&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowLoadLocalInfile=false&autoReconnect=true&failOverReadOnly=false&connectTimeout=30000&socketTimeout=30000&autoReconnectForPools=true - sourceUrl.append("jdbc:mysql://").append(sourceIp).append(":").append(sourcePort).append("/").append(dbName).append("?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF8&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowLoadLocalInfile=false&autoReconnect=true&failOverReadOnly=false&connectTimeout=30000&socketTimeout=30000&autoReconnectForPools=true"); - break; - case "4": //dm - //jdbc:dm://hzya.ufyct.com:9040?schema=businesscenter&characterEncoding=UTF-8 - sourceUrl.append("jdbc:dm://").append(sourceIp).append(":").append(sourcePort).append("?schema=").append(dbName).append("&characterEncoding=UTF-8"); - break; - default: - } - } - return sourceUrl.toString(); - } - public String getSourceTypeName() { - String sourceTypeName = null; - if(sourceType != null){ - switch (sourceType) { - case "1": //oracle - sourceTypeName = "oracle"; - break; - case "2": //sqlsever - sourceTypeName = "sqlServer"; - break; - case "3": //mysql - sourceTypeName = "mysql"; - break; - default: - } - } - - return sourceTypeName; - } - - public String getDataState() { - return dataState; - } - - public void setDataState(String dataState) { - this.dataState = dataState; - } -} - diff --git a/service/src/main/java/com/hzya/frame/sys/dataSource/entity/SysDataSourceEntity.xml b/service/src/main/java/com/hzya/frame/sys/dataSource/entity/SysDataSourceEntity.xml deleted file mode 100644 index 54bbc98d..00000000 --- a/service/src/main/java/com/hzya/frame/sys/dataSource/entity/SysDataSourceEntity.xml +++ /dev/null @@ -1,484 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - id - ,source_code - ,source_name - ,source_ip - ,source_port - ,db_name - ,source_type - ,login_name - ,password - ,service_name - ,use_state - ,data_state - ,sorts - ,create_user_id - ,create_time - ,modify_user_id - ,modify_time - ,sts - ,org_id - - - - - - - - - - - - - - - - - - - - - - - - - - - - insert into sys_data_source( - - id , - source_code , - source_name , - source_ip , - source_port , - db_name , - source_type , - login_name , - password , - service_name , - use_state , - data_state , - sorts , - create_user_id , - create_time , - modify_user_id , - modify_time , - sts , - org_id , - sorts, - sts, - - )values( - - #{id} , - #{sourceCode} , - #{sourceName} , - #{sourceIp} , - #{sourcePort} , - #{dbName} , - #{sourceType} , - #{loginName} , - #{password} , - #{serviceName} , - #{useState} , - #{dataState} , - #{sorts} , - #{create_user_id} , - #{create_time} , - #{modify_user_id} , - #{modify_time} , - #{sts} , - #{org_id} , - (select (max(IFNULL( a.sorts, 0 )) + 1) as sort from sys_data_source a WHERE a.sts - = 'Y' ), - - 'Y', - - ) - - - - insert into sys_data_source(source_code, source_name, source_ip, source_port, db_name, source_type, login_name, - password, service_name, use_state, data_state, sorts, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, - sts) - values - - (#{entity.sourceCode},#{entity.sourceName},#{entity.sourceIp},#{entity.sourcePort},#{entity.dbName},#{entity.sourceType},#{entity.loginName},#{entity.password},#{entity.serviceName},#{entity.useState},#{entity.dataState},#{entity.sorts},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id}, - 'Y') - - - - - insert into sys_data_source(source_code, source_name, source_ip, source_port, db_name, source_type, login_name, - password, service_name, use_state, data_state, sorts, create_user_id, create_time, modify_user_id, modify_time, sts, org_id) - values - - (#{entity.sourceCode},#{entity.sourceName},#{entity.sourceIp},#{entity.sourcePort},#{entity.dbName},#{entity.sourceType},#{entity.loginName},#{entity.password},#{entity.serviceName},#{entity.useState},#{entity.dataState},#{entity.sorts},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id}) - - on duplicate key update - source_code = values(source_code), - source_name = values(source_name), - source_ip = values(source_ip), - source_port = values(source_port), - db_name = values(db_name), - source_type = values(source_type), - login_name = values(login_name), - password = values(password), - service_name = values(service_name), - use_state = values(use_state), - data_state = values(data_state), - sorts = values(sorts), - create_user_id = values(create_user_id), - create_time = values(create_time), - modify_user_id = values(modify_user_id), - modify_time = values(modify_time), - sts = values(sts), - org_id = values(org_id) - - - - update sys_data_source set - - source_code = #{sourceCode}, - source_name = #{sourceName}, - source_ip = #{sourceIp}, - source_port = #{sourcePort}, - db_name = #{dbName}, - source_type = #{sourceType}, - login_name = #{loginName}, - password = #{password}, - service_name = #{serviceName}, - use_state = #{useState}, - data_state = #{dataState}, - sorts = #{sorts}, - create_user_id = #{create_user_id}, - create_time = #{create_time}, - modify_user_id = #{modify_user_id}, - modify_time = #{modify_time}, - sts = #{sts}, - org_id = #{org_id}, - - where id = #{id} - - - -update sys_data_source set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} -where id = #{id} - - - - update sys_data_source set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} - - and id = #{id} - and source_code = #{sourceCode} - and source_name = #{sourceName} - and source_ip = #{sourceIp} - and source_port = #{sourcePort} - and db_name = #{dbName} - and source_type = #{sourceType} - and login_name = #{loginName} - and password = #{password} - and service_name = #{serviceName} - and use_state = #{useState} - and data_state = #{dataState} - and sorts = #{sorts} - and sts = #{sts} - and sts='Y' - - - - - delete from sys_data_source where id = #{id} - - - - diff --git a/service/src/main/java/com/hzya/frame/sys/dataSource/entity/SysDataSourceVo.java b/service/src/main/java/com/hzya/frame/sys/dataSource/entity/SysDataSourceVo.java deleted file mode 100644 index ed00d0d2..00000000 --- a/service/src/main/java/com/hzya/frame/sys/dataSource/entity/SysDataSourceVo.java +++ /dev/null @@ -1,162 +0,0 @@ -package com.hzya.frame.sys.dataSource.entity; - - -import com.hzya.frame.web.exception.BaseSystemException; - -public class SysDataSourceVo { - - /** 主键ID */ - private String id; - /** 数据源编码 */ - private String sourceCode; - /** 数据源名称 */ - private String sourceName; - /** ip */ - private String sourceIp; - /** 端口 */ - private String sourcePort; - /** 数据库名称 */ - private String dbName; - /** 数据源类型 1oracle 2sqlsever 3mysql 4dm*/ - private String sourceType; - /** 登录名 */ - private String loginName; - /** 密码 */ - private String password; - /** 选择oracle下服务名称 */ - private String serviceName; - /** 使用状态1启用0锁定 */ - private Integer useState; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getSourceCode() { - return sourceCode; - } - - public void setSourceCode(String sourceCode) { - this.sourceCode = sourceCode; - } - - public String getSourceName() { - return sourceName; - } - - public void setSourceName(String sourceName) { - this.sourceName = sourceName; - } - - public String getSourceIp() { - return sourceIp; - } - - public void setSourceIp(String sourceIp) { - this.sourceIp = sourceIp; - } - - public String getSourcePort() { - return sourcePort; - } - - public void setSourcePort(String sourcePort) { - this.sourcePort = sourcePort; - } - - public String getDbName() { - return dbName; - } - - public void setDbName(String dbName) { - this.dbName = dbName; - } - - public String getSourceType() { - return sourceType; - } - - public void setSourceType(String sourceType) { - this.sourceType = sourceType; - } - - public String getLoginName() { - return loginName; - } - - public void setLoginName(String loginName) { - this.loginName = loginName; - } - - public String getPassword() { - return password; - } - - public void setPassword(String password) { - this.password = password; - } - - public String getServiceName() { - return serviceName; - } - - public void setServiceName(String serviceName) { - this.serviceName = serviceName; - } - - public Integer getUseState() { - return useState; - } - - public void setUseState(Integer useState) { - this.useState = useState; - } - - public String getSourceUrl() { - StringBuffer sourceUrl = new StringBuffer(); - switch (sourceType) { - case "1": //oracle - //jdbc:oracle:thin:@60.204.132.91:1521:ORCL - sourceUrl.append("jdbc:oracle:thin:@").append(sourceIp).append(":").append(sourcePort).append(":").append(serviceName); - break; - case "2": //sqlsever - //jdbc:sqlserver://221.12.175.82:1433;DatabaseName=U8CLOUD;encrypt=false;trustServerCertificate=true - sourceUrl.append("jdbc:jtds:sqlserver://").append(sourceIp).append(":").append(sourcePort).append("/").append(dbName).append(";encrypt=false;trustServerCertificate=true"); - break; - case "3": //mysql - //jdbc:mysql://hzya.ufyct.com:9096/businesscenter?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF8&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull&useSSL=false - sourceUrl.append("jdbc:mysql://").append(sourceIp).append(":").append(sourcePort).append("/").append(dbName).append("?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF8&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull&useSSL=false"); - break; - case "4": //dm - //jdbc:dm://hzya.ufyct.com:9040?schema=businesscenter&characterEncoding=UTF-8 - sourceUrl.append("jdbc:dm://").append(sourceIp).append(":").append(sourcePort).append("?schema=").append(dbName).append("&characterEncoding=UTF-8"); - break; - default: - } - return sourceUrl.toString(); - } - public String getSourceTypeName() { - String sourceTypeName = null; - switch (sourceType) { - case "1": //oracle - sourceTypeName = "oracle"; - break; - case "2": //sqlsever - sourceTypeName = "sqlServer"; - break; - case "3": //mysql - sourceTypeName = "mysql"; - break; - case "4": //mysql - sourceTypeName = "dm"; - break; - default: - } - return sourceTypeName; - } -} - diff --git a/service/src/main/java/com/hzya/frame/sys/dataSource/service/ISysDataSourceService.java b/service/src/main/java/com/hzya/frame/sys/dataSource/service/ISysDataSourceService.java deleted file mode 100644 index 841841a5..00000000 --- a/service/src/main/java/com/hzya/frame/sys/dataSource/service/ISysDataSourceService.java +++ /dev/null @@ -1,74 +0,0 @@ -package com.hzya.frame.sys.dataSource.service; - -import com.alibaba.fastjson.JSONObject; -import com.hzya.frame.sys.dataSource.entity.SysDataSourceEntity; -import com.hzya.frame.basedao.service.IBaseService; -import com.hzya.frame.web.entity.JsonResultEntity; - -/** - * 数据源表(SysDataSource)表服务接口 - * - * @author makejava - * @since 2023-09-05 16:07:10 - */ -public interface ISysDataSourceService extends IBaseService{ - /** - * @param jsonObject - * @return com.hzya.frame.web.entity.JsonResultEntity - * @Author lvleigang - * @Description 查询列表 - * @Date 2:18 下午 2023/7/17 - **/ - JsonResultEntity queryList(JSONObject jsonObject); - /** - * @param jsonObject - * @return com.hzya.frame.web.entity.JsonResultEntity - * @Author lvleigang - * @Description 查询列表 - * @Date 2:18 下午 2023/7/17 - **/ - JsonResultEntity queryPage(JSONObject jsonObject); - /** - * @param jsonObject - * @return com.hzya.frame.web.entity.JsonResultEntity - * @Author lvleigang - * @Description 获取数据 - * @Date 2:18 下午 2023/7/17 - **/ - JsonResultEntity queryEntity(JSONObject jsonObject); - - /** - * @param jsonObject - * @return com.hzya.frame.web.entity.JsonResultEntity - * @Author lvleigang - * @Description 新增数据 - * @Date 2:18 下午 2023/7/17 - **/ - JsonResultEntity addEntity(JSONObject jsonObject); - - /** - * @param jsonObject - * @return com.hzya.frame.web.entity.JsonResultEntity - * @Author lvleigang - * @Description 修改数据 - * @Date 2:18 下午 2023/7/17 - **/ - JsonResultEntity editEntity(JSONObject jsonObject); - - /** - * @param jsonObject - * @return com.hzya.frame.web.entity.JsonResultEntity - * @Author lvleigang - * @Description 删除数据 - * @Date 2:18 下午 2023/7/17 - **/ - JsonResultEntity deleteEntity(JSONObject jsonObject); - /** - * @Author lvleigang - * @Description 数据源测试接口 测试当前页面数据源是否配置正确 - * @Date 2:08 下午 2023/9/23 - * @param jsonObject - * @return - **/ - JsonResultEntity testDatabase(JSONObject jsonObject); -} diff --git a/service/src/main/java/com/hzya/frame/sys/dataSource/service/impl/SysDataSourceServiceImpl.java b/service/src/main/java/com/hzya/frame/sys/dataSource/service/impl/SysDataSourceServiceImpl.java deleted file mode 100644 index 504cca64..00000000 --- a/service/src/main/java/com/hzya/frame/sys/dataSource/service/impl/SysDataSourceServiceImpl.java +++ /dev/null @@ -1,256 +0,0 @@ -package com.hzya.frame.sys.dataSource.service.impl; - -import cn.dev33.satoken.stp.StpUtil; -import com.alibaba.fastjson.JSONObject; -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.hzya.frame.serviceUtil.DsDataSourceUtil; -import com.hzya.frame.sys.dataSource.entity.SysDataSourceEntity; -import com.hzya.frame.sys.dataSource.dao.ISysDataSourceDao; -import com.hzya.frame.sys.dataSource.entity.SysDataSourceVo; -import com.hzya.frame.sys.dataSource.service.ISysDataSourceService; -import com.hzya.frame.sysnew.application.entity.SysApplicationDatasourceDto; -import com.hzya.frame.util.AESUtil; -import com.hzya.frame.uuid.UUIDUtils; -import com.hzya.frame.web.entity.BaseResult; -import com.hzya.frame.web.entity.JsonResultEntity; -import org.springframework.stereotype.Service; -import org.springframework.beans.factory.annotation.Autowired; -import javax.annotation.Resource; -import com.hzya.frame.basedao.service.impl.BaseService; - -import java.util.Date; -import java.util.List; - -/** - * 数据源表(SysDataSource)表服务实现类 - * - * @author makejava - * @since 2023-09-05 16:07:13 - */ -@Service(value = "sysDataSourceService") -public class SysDataSourceServiceImpl extends BaseService implements ISysDataSourceService { - - private ISysDataSourceDao sysDataSourceDao; - @Resource - private DsDataSourceUtil dsDataSourceUtil; - - @Autowired - public void setSysDataSourceDao(ISysDataSourceDao dao) { - this.sysDataSourceDao = dao; - this.dao = dao; - } - /** - * @param object - * @return com.hzya.frame.web.entity.JsonResultEntity - * @Author lvleigang - * @Description 查询列表 - * @Date 2:18 下午 2023/7/17 - **/ - @Override - public JsonResultEntity queryList(JSONObject object) { - SysDataSourceEntity entity = getData("jsonStr", object, SysDataSourceEntity.class); - List sysDataSourceEntities = sysDataSourceDao.queryVoList(entity); - return BaseResult.getSuccessMessageEntity("查询数据成功", sysDataSourceEntities); - } - - /** - * @param object - * @return com.hzya.frame.web.entity.JsonResultEntity - * @Author lvleigang - * @Description 查询列表 - * @Date 2:18 下午 2023/7/17 - **/ - @Override - public JsonResultEntity queryPage(JSONObject object) { - SysDataSourceEntity entity = getData("jsonStr", object, SysDataSourceEntity.class); - //判断分页 - if(entity == null || entity.getPageNum() == null || entity.getPageSize() == null){ - return BaseResult.getFailureMessageEntity("分页查询参数不存在"); - } - PageHelper.startPage(entity.getPageNum(), entity.getPageSize()); - List sysDataSourceEntities = sysDataSourceDao.queryVoList(entity); - if(sysDataSourceEntities != null && sysDataSourceEntities.size() > 0){ - for (int i = 0; i < sysDataSourceEntities.size(); i++) { - sysDataSourceEntities.get(i).setPassword(AESUtil.decrypt(sysDataSourceEntities.get(i).getPassword())); - } - } - PageInfo pageInfo = new PageInfo(sysDataSourceEntities); - return BaseResult.getSuccessMessageEntity("查询数据成功", pageInfo); - } - - /** - * @param object - * @return com.hzya.frame.web.entity.JsonResultEntity - * @Author lvleigang - * @Description 获取数据 - * @Date 2:18 下午 2023/7/17 - **/ - @Override - public JsonResultEntity queryEntity(JSONObject object) { - SysDataSourceEntity entity = getData("jsonStr", object, SysDataSourceEntity.class); - //判断分页 - if(entity == null || entity.getId() == null || "".equals(entity.getId())){ - return BaseResult.getFailureMessageEntity("请先传递请求主键"); - } - SysDataSourceEntity sysDataSourceEntity = sysDataSourceDao.queryOne(entity); - sysDataSourceEntity.setPassword(AESUtil.decrypt(sysDataSourceEntity.getPassword())); - return BaseResult.getSuccessMessageEntity("查询数据成功", sysDataSourceEntity); - } - - /** - * @param object - * @return com.hzya.frame.web.entity.JsonResultEntity - * @Author lvleigang - * @Description 新增数据 - * @Date 2:18 下午 2023/7/17 - **/ - @Override - public JsonResultEntity addEntity(JSONObject object) { - SysDataSourceEntity entity = getData("jsonStr", object, SysDataSourceEntity.class); - if(entity == null){ - return BaseResult.getFailureMessageEntity("参数不允许为空"); - } - if(entity.getSourceName() == null || "".equals(entity.getSourceName())){ - return BaseResult.getFailureMessageEntity("请先输入数据源名称"); - } - if(entity.getSourceCode() == null || "".equals(entity.getSourceCode())){ - return BaseResult.getFailureMessageEntity("请先输入数据源编码"); - } - SysDataSourceEntity checkEntity = new SysDataSourceEntity(); - checkEntity.setSts("Y"); - checkEntity.setSourceCode(entity.getSourceCode()); - int checkCount = sysDataSourceDao.getCount(checkEntity); - if(checkCount > 0){ - return BaseResult.getFailureMessageEntity("数据源编码已存在"); - } - setCreate(entity); - if(entity.getUseState() == 1){ - try { - dsDataSourceUtil.addDataSource(entity); - entity.setDataState("1"); - } catch (Exception e) { - entity.setDataState("0"); - //return BaseResult.getFailureMessageEntity("初始化数据源失败,请检查数据源配置是否正确"); - } - } - entity.setPassword(AESUtil.encrypt(entity.getPassword())); - sysDataSourceDao.save(entity); - return BaseResult.getSuccessMessageEntity("保存数据源成功",entity.getId()); - } - private void setCreate(SysDataSourceEntity entity) { - entity.setId(UUIDUtils.getUUID()); - entity.setSts("Y"); - entity.setCreate_user_id(StpUtil.getLoginIdAsString()); - entity.setModify_user_id(StpUtil.getLoginIdAsString()); - entity.setCreate_time(new Date()); - entity.setModify_time(new Date()); - } - /** - * @param object - * @return com.hzya.frame.web.entity.JsonResultEntity - * @Author lvleigang - * @Description 修改数据 - * @Date 2:18 下午 2023/7/17 - **/ - @Override - public JsonResultEntity editEntity(JSONObject object) { - SysDataSourceEntity entity = getData("jsonStr", object, SysDataSourceEntity.class); - if(entity == null){ - return BaseResult.getFailureMessageEntity("参数不允许为空"); - } - if(entity.getId() == null || "".equals(entity.getId())){ - return BaseResult.getFailureMessageEntity("系统错误"); - } - if(entity.getSourceName() == null || "".equals(entity.getSourceName())){ - return BaseResult.getFailureMessageEntity("请先输入数据源名称"); - } - if(entity.getSourceCode() == null || "".equals(entity.getSourceCode())){ - return BaseResult.getFailureMessageEntity("请先输入数据源编码"); - } - SysDataSourceEntity checkEntity = new SysDataSourceEntity(); - checkEntity.setSts("Y"); - checkEntity.setId(entity.getId()); - checkEntity.setSourceCode(entity.getSourceCode()); - int checkCount = sysDataSourceDao.entity_count_not_id(checkEntity); - if(checkCount > 0){ - return BaseResult.getFailureMessageEntity("接口编码已存在"); - } - entity.setModify_user_id(StpUtil.getLoginIdAsString()); - entity.setModify_time(new Date()); - entity.setSts("Y"); - if(entity.getUseState() == 1){ - try { - dsDataSourceUtil.editDataSource(entity); - } catch (Exception e) { - //return BaseResult.getSuccessMessageEntity("修改数据源失败,请检查数据源配置是否正确"); - } - }else { - try { - dsDataSourceUtil.removeDataSource(entity.getSourceCode()); - } catch (Exception e) { - return BaseResult.getSuccessMessageEntity("修改数据源失败"); - } - } - if(entity.getPassword() != null ){ - entity.setPassword(AESUtil.encrypt(entity.getPassword())); - } - sysDataSourceDao.update(entity); - return BaseResult.getSuccessMessageEntity("修改数据源成功",entity.getId()); - - } - /** - * @param object - * @return - * @Author lvleigang - * @Description 数据源测试接口 测试当前页面数据源是否配置正确 - * @Date 2:08 下午 2023/9/23 - **/ - @Override - public JsonResultEntity testDatabase(JSONObject object) { - SysDataSourceEntity entity = getData("jsonStr", object, SysDataSourceEntity.class); - if (entity == null) { - return BaseResult.getFailureMessageEntity("系统错误"); - } - SysApplicationDatasourceDto sysApplicationDatasourceDto = new SysApplicationDatasourceDto(); - sysApplicationDatasourceDto.setSourceType(entity.getSourceType()); - sysApplicationDatasourceDto.setSourceUrl(entity.getSourceUrl()); - sysApplicationDatasourceDto.setLoginName(entity.getLoginName()); - sysApplicationDatasourceDto.setPassword(entity.getPassword()); - if (dsDataSourceUtil.testConnection(sysApplicationDatasourceDto)) { - return BaseResult.getSuccessMessageEntity("测试连接数据源成功",true); - } else { - return BaseResult.getSuccessMessageEntity("测试连接数据源失败",false); - } - } - /** - * @param object - * @return com.hzya.frame.web.entity.JsonResultEntity - * @Author lvleigang - * @Description 删除数据 - * @Date 2:18 下午 2023/7/17 - **/ - @Override - public JsonResultEntity deleteEntity(JSONObject object) { - SysDataSourceEntity entity = getData("jsonStr", object, SysDataSourceEntity.class); - //判断编码是否重复 - if (entity == null) { - return BaseResult.getFailureMessageEntity("请先填写内容"); - } - if (entity.getId() == null || "".equals(entity.getId())) { - return BaseResult.getFailureMessageEntity("请先选择数据"); - } - SysDataSourceEntity deleteEntity = sysDataSourceDao.queryOne(entity); - //删除主表和明细表 - entity.setModify_user_id(StpUtil.getLoginIdAsString()); - entity.setModify_time(new Date()); - entity.setSts("Y"); - try { - dsDataSourceUtil.removeDataSource(deleteEntity.getSourceCode()); - } catch (Exception e) { - return BaseResult.getSuccessMessageEntity("删除数据源失败"); - } - sysDataSourceDao.logicRemoveMultiCondition(entity); - return BaseResult.getSuccessMessageEntity("删除成功"); - } -} diff --git a/service/src/main/java/com/hzya/frame/sysnew/application/database/dao/ISysApplicationDatabaseDao.java b/service/src/main/java/com/hzya/frame/sysnew/application/database/dao/ISysApplicationDatabaseDao.java index 110ab6e0..14806c32 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/application/database/dao/ISysApplicationDatabaseDao.java +++ b/service/src/main/java/com/hzya/frame/sysnew/application/database/dao/ISysApplicationDatabaseDao.java @@ -1,15 +1,18 @@ package com.hzya.frame.sysnew.application.database.dao; import com.hzya.frame.sysnew.application.database.entity.SysApplicationDatabaseEntity; -import com.hzya.frame.basedao.dao.IBaseDao; +import com.hzya.frame.basedao.dao.IBaseDao; + +import java.util.List; /** * 数据源表(sys_application_database: table)表数据库访问层 * * @author makejava - * @since 2023-09-25 11:46:27 + * @since 2024-06-16 21:49:26 */ public interface ISysApplicationDatabaseDao extends IBaseDao { + List queryDSBase(SysApplicationDatabaseEntity entity); } diff --git a/service/src/main/java/com/hzya/frame/sysnew/application/database/dao/impl/SysApplicationDatabaseDaoImpl.java b/service/src/main/java/com/hzya/frame/sysnew/application/database/dao/impl/SysApplicationDatabaseDaoImpl.java index 332f2092..6b523995 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/application/database/dao/impl/SysApplicationDatabaseDaoImpl.java +++ b/service/src/main/java/com/hzya/frame/sysnew/application/database/dao/impl/SysApplicationDatabaseDaoImpl.java @@ -1,17 +1,26 @@ package com.hzya.frame.sysnew.application.database.dao.impl; +import com.baomidou.dynamic.datasource.annotation.DS; import com.hzya.frame.sysnew.application.database.entity.SysApplicationDatabaseEntity; import com.hzya.frame.sysnew.application.database.dao.ISysApplicationDatabaseDao; import org.springframework.stereotype.Repository; import com.hzya.frame.basedao.dao.MybatisGenericDao; + +import java.util.List; + /** * 数据源表(SysApplicationDatabase)表数据库访问层 * * @author makejava - * @since 2023-09-25 11:46:31 + * @since 2024-06-16 21:49:30 */ @Repository(value = "SysApplicationDatabaseDaoImpl") public class SysApplicationDatabaseDaoImpl extends MybatisGenericDao implements ISysApplicationDatabaseDao{ - + @DS("master") + @Override + public List queryDSBase(SysApplicationDatabaseEntity entity) { + List o = (List) super.selectList(getSqlIdPrifx() + "queryDSBase", entity); + return o; + } } diff --git a/service/src/main/java/com/hzya/frame/sysnew/application/database/entity/SysApplicationDatabaseEntity.java b/service/src/main/java/com/hzya/frame/sysnew/application/database/entity/SysApplicationDatabaseEntity.java index 03aa04df..a7817419 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/application/database/entity/SysApplicationDatabaseEntity.java +++ b/service/src/main/java/com/hzya/frame/sysnew/application/database/entity/SysApplicationDatabaseEntity.java @@ -6,22 +6,30 @@ import com.hzya.frame.web.entity.BaseEntity; * 数据源表(SysApplicationDatabase)实体类 * * @author makejava - * @since 2023-09-25 11:46:34 + * @since 2024-06-16 21:49:31 */ public class SysApplicationDatabaseEntity extends BaseEntity { /** 应用id */ private String appId; + /** 数据源唯一编码 */ + private String sourceCode; + /** 数据源名称 */ + private String sourceName; /** 数据源类型(1、oracle 2、sqlServer3、mysql) */ private String sourceType; - /** 实例地址 */ - private String sourceUrl; - /** 账户 */ + /** ip */ + private String sourceIp; + /** 端口 */ + private String sourcePort; + /** 登录名 */ private String loginName; /** 密码 */ private String password; /** 库名 */ private String dbName; + /** 选择oracle下服务名称 */ + private String serviceName; /** 数据源是否启用(1、开启 2、关闭) */ private String dbStatus; @@ -34,6 +42,22 @@ public class SysApplicationDatabaseEntity extends BaseEntity { this.appId = appId; } + public String getSourceCode() { + return sourceCode; + } + + public void setSourceCode(String sourceCode) { + this.sourceCode = sourceCode; + } + + public String getSourceName() { + return sourceName; + } + + public void setSourceName(String sourceName) { + this.sourceName = sourceName; + } + public String getSourceType() { return sourceType; } @@ -42,12 +66,20 @@ public class SysApplicationDatabaseEntity extends BaseEntity { this.sourceType = sourceType; } - public String getSourceUrl() { - return sourceUrl; + public String getSourceIp() { + return sourceIp; } - public void setSourceUrl(String sourceUrl) { - this.sourceUrl = sourceUrl; + public void setSourceIp(String sourceIp) { + this.sourceIp = sourceIp; + } + + public String getSourcePort() { + return sourcePort; + } + + public void setSourcePort(String sourcePort) { + this.sourcePort = sourcePort; } public String getLoginName() { @@ -74,6 +106,14 @@ public class SysApplicationDatabaseEntity extends BaseEntity { this.dbName = dbName; } + public String getServiceName() { + return serviceName; + } + + public void setServiceName(String serviceName) { + this.serviceName = serviceName; + } + public String getDbStatus() { return dbStatus; } @@ -81,6 +121,49 @@ public class SysApplicationDatabaseEntity extends BaseEntity { public void setDbStatus(String dbStatus) { this.dbStatus = dbStatus; } + public String getSourceUrl() { + StringBuffer sourceUrl = new StringBuffer(); + if(sourceType != null){ + switch (sourceType) { + case "1": //oracle + //jdbc:oracle:thin:@60.204.132.91:1521:ORCL + sourceUrl.append("jdbc:oracle:thin:@").append(sourceIp).append(":").append(sourcePort).append(":").append(serviceName); + break; + case "2": //sqlsever + //jdbc:sqlserver://221.12.175.82:1433;DatabaseName=U8CLOUD;encrypt=false;trustServerCertificate=true + sourceUrl.append("jdbc:jtds:sqlserver://").append(sourceIp).append(":").append(sourcePort).append("/").append(dbName).append(";encrypt=false;trustServerCertificate=true"); + break; + case "3": //mysql + //jdbc:mysql://hzya.ufyct.com:9096/businesscenternew?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF8&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowLoadLocalInfile=false&autoReconnect=true&failOverReadOnly=false&connectTimeout=30000&socketTimeout=30000&autoReconnectForPools=true + sourceUrl.append("jdbc:mysql://").append(sourceIp).append(":").append(sourcePort).append("/").append(dbName).append("?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF8&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowLoadLocalInfile=false&autoReconnect=true&failOverReadOnly=false&connectTimeout=30000&socketTimeout=30000&autoReconnectForPools=true"); + break; + case "4": //dm + //jdbc:dm://hzya.ufyct.com:9040?schema=businesscenter&characterEncoding=UTF-8 + sourceUrl.append("jdbc:dm://").append(sourceIp).append(":").append(sourcePort).append("?schema=").append(dbName).append("&characterEncoding=UTF-8"); + break; + default: + } + } + return sourceUrl.toString(); + } + public String getSourceTypeName() { + String sourceTypeName = null; + if(sourceType != null){ + switch (sourceType) { + case "1": //oracle + sourceTypeName = "oracle"; + break; + case "2": //sqlsever + sourceTypeName = "sqlServer"; + break; + case "3": //mysql + sourceTypeName = "mysql"; + break; + default: + } + } + return sourceTypeName; + } } diff --git a/service/src/main/java/com/hzya/frame/sysnew/application/database/entity/SysApplicationDatabaseEntity.xml b/service/src/main/java/com/hzya/frame/sysnew/application/database/entity/SysApplicationDatabaseEntity.xml index 67637941..2b51b38e 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/application/database/entity/SysApplicationDatabaseEntity.xml +++ b/service/src/main/java/com/hzya/frame/sysnew/application/database/entity/SysApplicationDatabaseEntity.xml @@ -5,44 +5,46 @@ + + - + + + - - - - + + + + id ,app_id + ,source_code + ,source_name ,source_type - ,source_url + ,source_ip + ,source_port ,login_name ,password ,db_name + ,service_name ,db_status ,sorts - ,org_id - ,sts - ,create_time ,create_user_id - ,modify_time + ,create_time ,modify_user_id + ,modify_time + ,sts + ,org_id - - + select + + from sys_application_database + + and id = #{id} + and app_id = #{appId} + and source_code = #{sourceCode} + and source_name = #{sourceName} + and source_type = #{sourceType} + and source_ip = #{sourceIp} + and source_port = #{sourcePort} + and login_name = #{loginName} + and password = #{password} + and db_name = #{dbName} + and service_name = #{serviceName} + and db_status = #{dbStatus} + and sorts = #{sorts} + and create_user_id = #{create_user_id} + and create_time = #{create_time} + and modify_user_id = #{modify_user_id} + and modify_time = #{modify_time} + and sts = #{sts} + and org_id = #{org_id} + and sts='Y' + + diff --git a/service/src/main/java/com/hzya/frame/sysnew/application/database/service/ISysApplicationDatabaseService.java b/service/src/main/java/com/hzya/frame/sysnew/application/database/service/ISysApplicationDatabaseService.java index 9f4ad126..c1d3776b 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/application/database/service/ISysApplicationDatabaseService.java +++ b/service/src/main/java/com/hzya/frame/sysnew/application/database/service/ISysApplicationDatabaseService.java @@ -6,7 +6,7 @@ import com.hzya.frame.basedao.service.IBaseService; * 数据源表(SysApplicationDatabase)表服务接口 * * @author makejava - * @since 2023-09-25 11:46:39 + * @since 2024-06-16 21:49:32 */ public interface ISysApplicationDatabaseService extends IBaseService{ } diff --git a/service/src/main/java/com/hzya/frame/sysnew/application/database/service/impl/SysApplicationDatabaseServiceImpl.java b/service/src/main/java/com/hzya/frame/sysnew/application/database/service/impl/SysApplicationDatabaseServiceImpl.java index 1f799bc6..881a9151 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/application/database/service/impl/SysApplicationDatabaseServiceImpl.java +++ b/service/src/main/java/com/hzya/frame/sysnew/application/database/service/impl/SysApplicationDatabaseServiceImpl.java @@ -11,7 +11,7 @@ import com.hzya.frame.basedao.service.impl.BaseService; * 数据源表(SysApplicationDatabase)表服务实现类 * * @author makejava - * @since 2023-09-25 11:46:42 + * @since 2024-06-16 21:49:33 */ @Service(value = "sysApplicationDatabaseService") public class SysApplicationDatabaseServiceImpl extends BaseService implements ISysApplicationDatabaseService { 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 5775b7fc..2c90c614 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 @@ -551,14 +551,19 @@ public class SysApplicationServiceImpl extends BaseService 0) { sysApplicationDatabaseEntity = list.get(0); + sysApplicationDatabaseEntity.setPassword(AESUtil.decrypt(sysApplicationDatabaseEntity.getPassword())); } else { sysApplicationDatabaseEntity = null; } diff --git a/service/src/main/java/com/hzya/frame/sysnew/login/impl/LoginServiceImpl.java b/service/src/main/java/com/hzya/frame/sysnew/login/impl/LoginServiceImpl.java index 48fb1f2c..bef5714c 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/login/impl/LoginServiceImpl.java +++ b/service/src/main/java/com/hzya/frame/sysnew/login/impl/LoginServiceImpl.java @@ -3,6 +3,8 @@ package com.hzya.frame.sysnew.login.impl; import cn.dev33.satoken.stp.SaTokenInfo; import cn.dev33.satoken.stp.StpUtil; import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.sysnew.application.dao.ISysApplicationDao; +import com.hzya.frame.sysnew.application.entity.SysApplicationEntity; import com.hzya.frame.sysnew.login.ILoginService; import com.hzya.frame.sysnew.organ.dao.ISysOrganDao; import com.hzya.frame.sysnew.organ.entity.SysOrganEntity; @@ -37,6 +39,8 @@ public class LoginServiceImpl implements ILoginService { @Resource private ISysOrganDao sysOrganDao; + @Resource + private ISysApplicationDao sysApplicationDao; @Resource private InterfaceCache interfaceCache; /** @@ -111,6 +115,9 @@ public class LoginServiceImpl implements ILoginService { res.put("token", token); res.put("userInfo", sysUserEntity); res.put("company", sysOrganEntities); + + + //切换数据源查询 return BaseResult.getSuccessMessageEntity("登录成功", res); } diff --git a/webapp/src/main/java/com/hzya/frame/webapp/web/aop/AopDynamicRoutingDataSourceInit.java b/webapp/src/main/java/com/hzya/frame/webapp/web/aop/AopDynamicRoutingDataSourceInit.java index 390c1f15..9952517e 100644 --- a/webapp/src/main/java/com/hzya/frame/webapp/web/aop/AopDynamicRoutingDataSourceInit.java +++ b/webapp/src/main/java/com/hzya/frame/webapp/web/aop/AopDynamicRoutingDataSourceInit.java @@ -6,9 +6,8 @@ import com.baomidou.dynamic.datasource.DynamicRoutingDataSource; import com.baomidou.dynamic.datasource.annotation.DS; import com.baomidou.dynamic.datasource.exception.CannotFindDataSourceException; import com.hzya.frame.datasource.DataSourceUtilProperties; -import com.hzya.frame.sys.dataSource.dao.ISysDataSourceDao; -import com.hzya.frame.sys.dataSource.entity.SysDataSourceEntity; -import com.hzya.frame.sys.dataSource.entity.SysDataSourceVo; +import com.hzya.frame.sysnew.application.database.dao.ISysApplicationDatabaseDao; +import com.hzya.frame.sysnew.application.database.entity.SysApplicationDatabaseEntity; import com.hzya.frame.util.AESUtil; import com.hzya.frame.web.entity.BaseEntity; import com.hzya.frame.web.exception.BaseSystemException; @@ -38,7 +37,7 @@ public class AopDynamicRoutingDataSourceInit { @Resource private DataSource dataSource; @Resource - private ISysDataSourceDao sysDataSourceDao; + private ISysApplicationDatabaseDao sysApplicationDatabaseDao; @Before("@annotation(dsAnnotation)") @@ -64,12 +63,12 @@ public class AopDynamicRoutingDataSourceInit { dsDatasource = ds.getDataSource(dsValue); } catch (CannotFindDataSourceException exception) { //logger.info("beforeDynamicRoutingDataSourceInitMethod:根据ds获取dsDatasource失败!异常信息:" + "exception.getMessage()" + " 执行初始化数据源:" + dsValue); - SysDataSourceEntity entity = new SysDataSourceEntity(); + SysApplicationDatabaseEntity entity = new SysApplicationDatabaseEntity(); entity.setSts("Y"); - entity.setUseState(1); - entity.setDataState("1"); + entity.setDbStatus("1"); entity.setSourceCode(dsValue); - List sysDataSourceEntities = sysDataSourceDao.queryDSBase(entity); + entity.setDataSourceCode("master"); + List sysDataSourceEntities = sysApplicationDatabaseDao.queryDSBase(entity); //logger.info("beforeDynamicRoutingDataSourceInitMethod:根据dsValue获取数据源信息查询结果 sysDataSourceEntities.size:" + sysDataSourceEntities.size()); if (sysDataSourceEntities != null && sysDataSourceEntities.size() > 0) { for (int i = 0; i < sysDataSourceEntities.size(); i++) { From e753410b89ef42babb01c319c085d7473bf42b8c Mon Sep 17 00:00:00 2001 From: lvleigang <957075182@qq.com> Date: Mon, 17 Jun 2024 11:49:50 +0800 Subject: [PATCH 57/80] =?UTF-8?q?=E4=B8=BB=E6=95=B0=E6=8D=AE=E4=BF=AE?= =?UTF-8?q?=E6=94=B9,=E5=BA=94=E7=94=A8=E6=B7=BB=E5=8A=A0=E8=84=9A?= =?UTF-8?q?=E6=9C=AC=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dao/IMdmModuleDistributeDao.java | 2 +- .../dao/impl/MdmModuleDistributeDaoImpl.java | 2 +- .../entity/MdmModuleDistributeEntity.java | 32 +- .../entity/MdmModuleDistributeEntity.xml | 50 ++- .../service/IMdmModuleDistributeService.java | 2 +- .../impl/MdmModuleDistributeServiceImpl.java | 2 +- .../MdmModuleDistributeDetailEntity.xml | 2 - .../entity/MdmModuleOptionLogEntity.xml | 2 - .../entity/MdmModuleSendLogEntity.xml | 2 - .../entity/MdmModuleSourceEntity.xml | 2 - .../script/dao/ISysApplicationScriptDao.java | 15 + .../dao/impl/SysApplicationScriptDaoImpl.java | 17 + .../entity/SysApplicationScriptEntity.java | 116 +++++++ .../entity/SysApplicationScriptEntity.xml | 304 ++++++++++++++++++ .../service/ISysApplicationScriptService.java | 12 + .../impl/SysApplicationScriptServiceImpl.java | 26 ++ .../service/ISysApplicationService.java | 60 ++++ .../impl/SysApplicationServiceImpl.java | 156 +++++++++ 18 files changed, 778 insertions(+), 26 deletions(-) create mode 100644 service/src/main/java/com/hzya/frame/sysnew/application/script/dao/ISysApplicationScriptDao.java create mode 100644 service/src/main/java/com/hzya/frame/sysnew/application/script/dao/impl/SysApplicationScriptDaoImpl.java create mode 100644 service/src/main/java/com/hzya/frame/sysnew/application/script/entity/SysApplicationScriptEntity.java create mode 100644 service/src/main/java/com/hzya/frame/sysnew/application/script/entity/SysApplicationScriptEntity.xml create mode 100644 service/src/main/java/com/hzya/frame/sysnew/application/script/service/ISysApplicationScriptService.java create mode 100644 service/src/main/java/com/hzya/frame/sysnew/application/script/service/impl/SysApplicationScriptServiceImpl.java diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistribute/dao/IMdmModuleDistributeDao.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistribute/dao/IMdmModuleDistributeDao.java index 895f30cd..5ccc1e4d 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistribute/dao/IMdmModuleDistributeDao.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistribute/dao/IMdmModuleDistributeDao.java @@ -7,7 +7,7 @@ import com.hzya.frame.basedao.dao.IBaseDao; * 主数据功能应用分发表(mdm_module_distribute: table)表数据库访问层 * * @author makejava - * @since 2024-06-14 10:06:36 + * @since 2024-06-17 11:05:32 */ public interface IMdmModuleDistributeDao extends IBaseDao { diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistribute/dao/impl/MdmModuleDistributeDaoImpl.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistribute/dao/impl/MdmModuleDistributeDaoImpl.java index 4c029e80..20fcd94f 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistribute/dao/impl/MdmModuleDistributeDaoImpl.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistribute/dao/impl/MdmModuleDistributeDaoImpl.java @@ -8,7 +8,7 @@ import com.hzya.frame.basedao.dao.MybatisGenericDao; * 主数据功能应用分发表(MdmModuleDistribute)表数据库访问层 * * @author makejava - * @since 2024-06-14 10:06:36 + * @since 2024-06-17 11:05:32 */ @Repository(value = "MdmModuleDistributeDaoImpl") public class MdmModuleDistributeDaoImpl extends MybatisGenericDao implements IMdmModuleDistributeDao{ diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistribute/entity/MdmModuleDistributeEntity.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistribute/entity/MdmModuleDistributeEntity.java index 9b6677b9..08ff46f7 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistribute/entity/MdmModuleDistributeEntity.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistribute/entity/MdmModuleDistributeEntity.java @@ -9,7 +9,7 @@ import com.hzya.frame.web.entity.BaseEntity; * 主数据功能应用分发表(MdmModuleDistribute)实体类 * * @author makejava - * @since 2024-06-14 10:06:36 + * @since 2024-06-17 11:05:33 */ public class MdmModuleDistributeEntity extends BaseEntity { @@ -19,10 +19,16 @@ public class MdmModuleDistributeEntity extends BaseEntity { private String appId; /** 修改接口 */ private String updateApi; + /** 修改插件 */ + private String updateScript; /** 新增接口 */ private String addApi; + /** 新增插件 */ + private String addScript; /** 删除接口 */ private String deleteApi; + /** 删除插件 */ + private String deleteScript; /** 启用停用 0、停用1、启用 */ private String enabledState; /** 主表ID */ @@ -56,6 +62,14 @@ public class MdmModuleDistributeEntity extends BaseEntity { this.updateApi = updateApi; } + public String getUpdateScript() { + return updateScript; + } + + public void setUpdateScript(String updateScript) { + this.updateScript = updateScript; + } + public String getAddApi() { return addApi; } @@ -64,6 +78,14 @@ public class MdmModuleDistributeEntity extends BaseEntity { this.addApi = addApi; } + public String getAddScript() { + return addScript; + } + + public void setAddScript(String addScript) { + this.addScript = addScript; + } + public String getDeleteApi() { return deleteApi; } @@ -72,6 +94,14 @@ public class MdmModuleDistributeEntity extends BaseEntity { this.deleteApi = deleteApi; } + public String getDeleteScript() { + return deleteScript; + } + + public void setDeleteScript(String deleteScript) { + this.deleteScript = deleteScript; + } + public String getEnabledState() { return enabledState; } diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistribute/entity/MdmModuleDistributeEntity.xml b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistribute/entity/MdmModuleDistributeEntity.xml index 20e5de5b..d7822968 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistribute/entity/MdmModuleDistributeEntity.xml +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistribute/entity/MdmModuleDistributeEntity.xml @@ -7,8 +7,11 @@ + + + @@ -26,8 +29,11 @@ ,mdm_id ,app_id ,update_api + ,update_script ,add_api + ,add_script ,delete_api + ,delete_script ,enabled_state ,db_id ,sorts @@ -39,13 +45,6 @@ ,org_id ,company_id - - - + select + + from sys_application_script where id = #{ id } and sts='Y' + + + + + + + + + + + + + + + + insert into sys_application_script( + + id , + app_id , + script_name , + script_code , + script_version , + class_name , + script_data , + script_remark , + release_date , + script_status , + sorts , + create_user_id , + create_time , + modify_user_id , + modify_time , + sts , + org_id , + company_id , + sts, + + )values( + + #{id} , + #{appId} , + #{scriptName} , + #{scriptCode} , + #{scriptVersion} , + CONCAT('g','_',LAST_INSERT_ID()) , + #{scriptData} , + #{scriptRemark} , + #{releaseDate} , + #{scriptStatus} , + #{sorts} , + #{create_user_id} , + #{create_time} , + #{modify_user_id} , + #{modify_time} , + #{sts} , + #{org_id} , + #{companyId} , + 'Y', + + ) + + + + insert into sys_application_script(app_id, script_name, script_code, script_version, class_name, script_data, script_remark, release_date, script_status, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, sts) + values + + (#{entity.appId},#{entity.scriptName},#{entity.scriptCode},#{entity.scriptVersion},#{entity.className},#{entity.scriptData},#{entity.scriptRemark},#{entity.releaseDate},#{entity.scriptStatus},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId}, 'Y') + + + + + insert into sys_application_script(app_id, script_name, script_code, script_version, class_name, script_data, script_remark, release_date, script_status, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id) + values + + (#{entity.appId},#{entity.scriptName},#{entity.scriptCode},#{entity.scriptVersion},#{entity.className},#{entity.scriptData},#{entity.scriptRemark},#{entity.releaseDate},#{entity.scriptStatus},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId}) + + on duplicate key update + app_id = values(app_id), + script_name = values(script_name), + script_code = values(script_code), + script_version = values(script_version), + class_name = values(class_name), + script_data = values(script_data), + script_remark = values(script_remark), + release_date = values(release_date), + script_status = values(script_status), + create_user_id = values(create_user_id), + create_time = values(create_time), + modify_user_id = values(modify_user_id), + modify_time = values(modify_time), + sts = values(sts), + org_id = values(org_id), + company_id = values(company_id) + + +update sys_application_script set + + app_id = #{appId}, + script_name = #{scriptName}, + script_code = #{scriptCode}, + script_version = #{scriptVersion}, + class_name = #{className}, + script_data = #{scriptData}, + script_remark = #{scriptRemark}, + release_date = #{releaseDate}, + script_status = #{scriptStatus}, + create_user_id = #{create_user_id}, + create_time = #{create_time}, + modify_user_id = #{modify_user_id}, + modify_time = #{modify_time}, + sts = #{sts}, + org_id = #{org_id}, + company_id = #{companyId}, + +where id = #{id} + + + +update sys_application_script set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} +where id = #{id} + + + +update sys_application_script set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} + + and id = #{id} + and app_id = #{appId} + and script_name = #{scriptName} + and script_code = #{scriptCode} + and script_version = #{scriptVersion} + and class_name = #{className} + and script_data = #{scriptData} + and script_remark = #{scriptRemark} + and release_date = #{releaseDate} + and script_status = #{scriptStatus} + and sorts = #{sorts} + and sts = #{sts} + and company_id = #{companyId} + and sts='Y' + + + + + delete from sys_application_script where id = #{id} + + + + diff --git a/service/src/main/java/com/hzya/frame/sysnew/application/script/service/ISysApplicationScriptService.java b/service/src/main/java/com/hzya/frame/sysnew/application/script/service/ISysApplicationScriptService.java new file mode 100644 index 00000000..73d7588d --- /dev/null +++ b/service/src/main/java/com/hzya/frame/sysnew/application/script/service/ISysApplicationScriptService.java @@ -0,0 +1,12 @@ +package com.hzya.frame.sysnew.application.script.service; + +import com.hzya.frame.sysnew.application.script.entity.SysApplicationScriptEntity; +import com.hzya.frame.basedao.service.IBaseService; +/** + * 脚本表(SysApplicationScript)表服务接口 + * + * @author makejava + * @since 2024-06-17 11:07:22 + */ +public interface ISysApplicationScriptService extends IBaseService{ +} diff --git a/service/src/main/java/com/hzya/frame/sysnew/application/script/service/impl/SysApplicationScriptServiceImpl.java b/service/src/main/java/com/hzya/frame/sysnew/application/script/service/impl/SysApplicationScriptServiceImpl.java new file mode 100644 index 00000000..59ef35e1 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/sysnew/application/script/service/impl/SysApplicationScriptServiceImpl.java @@ -0,0 +1,26 @@ +package com.hzya.frame.sysnew.application.script.service.impl; + +import com.hzya.frame.sysnew.application.script.entity.SysApplicationScriptEntity; +import com.hzya.frame.sysnew.application.script.dao.ISysApplicationScriptDao; +import com.hzya.frame.sysnew.application.script.service.ISysApplicationScriptService; +import org.springframework.stereotype.Service; +import org.springframework.beans.factory.annotation.Autowired; +import javax.annotation.Resource; +import com.hzya.frame.basedao.service.impl.BaseService; +/** + * 脚本表(SysApplicationScript)表服务实现类 + * + * @author makejava + * @since 2024-06-17 11:07:22 + */ +@Service(value = "sysApplicationScriptService") +public class SysApplicationScriptServiceImpl extends BaseService implements ISysApplicationScriptService { + + private ISysApplicationScriptDao sysApplicationScriptDao; + + @Autowired + public void setSysApplicationScriptDao(ISysApplicationScriptDao dao) { + this.sysApplicationScriptDao = dao; + this.dao = dao; + } +} diff --git a/service/src/main/java/com/hzya/frame/sysnew/application/service/ISysApplicationService.java b/service/src/main/java/com/hzya/frame/sysnew/application/service/ISysApplicationService.java index a4711b39..ad1077cf 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/application/service/ISysApplicationService.java +++ b/service/src/main/java/com/hzya/frame/sysnew/application/service/ISysApplicationService.java @@ -357,4 +357,64 @@ public interface ISysApplicationService extends IBaseService sysApplicationScriptEntities = sysApplicationScriptDao.queryByLike(entity); + PageInfo pageInfo = new PageInfo(sysApplicationScriptEntities); + return BaseResult.getSuccessMessageEntity("查询数据成功", pageInfo); + } + + /** + * @param object + * @return + * @Author lvleigang + * @Description 脚本查询接口 + * @Date 2:09 下午 2023/9/23 + **/ + @Override + public JsonResultEntity queryAppScript(JSONObject object) { + SysApplicationScriptEntity entity = getData("jsonStr", object, SysApplicationScriptEntity.class); + List sysApplicationScriptEntities = sysApplicationScriptDao.queryByLike(entity); + return BaseResult.getSuccessMessageEntity("查询数据成功", sysApplicationScriptEntities); + } + + /** + * @param object + * @return + * @Author lvleigang + * @Description 脚本修改接口 + * @Date 2:09 下午 2023/9/23 + **/ + @Override + public JsonResultEntity saveAppScript(JSONObject object) { + SysApplicationScriptEntity entity = getData("jsonStr", object, SysApplicationScriptEntity.class); + if (entity == null) { + return BaseResult.getFailureMessageEntity("参数不允许为空"); + } + if (entity.getScriptCode() == null || "".equals(entity.getScriptCode())) { + return BaseResult.getFailureMessageEntity("请先输入脚本编号"); + } + if (entity.getScriptData() == null || "".equals(entity.getScriptData())) { + return BaseResult.getFailureMessageEntity("请先输入脚本内容"); + } + entity.setCreate(); + sysApplicationScriptDao.save(entity); + return BaseResult.getSuccessMessageEntity("保存脚本成功", entity.getId()); + } + + /** + * @param object + * @return + * @Author lvleigang + * @Description 脚本修改接口 + * @Date 2:09 下午 2023/9/23 + **/ + @Override + public JsonResultEntity updateAppScript(JSONObject object) { + SysApplicationScriptEntity entity = getData("jsonStr", object, SysApplicationScriptEntity.class); + if (entity == null) { + return BaseResult.getFailureMessageEntity("参数不允许为空"); + } + if (entity.getId() == null || "".equals(entity.getId())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + if (entity.getScriptCode() == null || "".equals(entity.getScriptCode())) { + return BaseResult.getFailureMessageEntity("请先输入脚本编号"); + } + if (entity.getScriptData() == null || "".equals(entity.getScriptData())) { + return BaseResult.getFailureMessageEntity("请先输入脚本内容"); + } + entity.setUpdate(); + sysApplicationScriptDao.update(entity); + return BaseResult.getSuccessMessageEntity("修改脚本成功"); + } + + /** + * @param object + * @return + * @Author lvleigang + * @Description 脚本删除接口 + * @Date 2:10 下午 2023/9/23 + **/ + @Override + public JsonResultEntity deleteAppScript(JSONObject object) { + SysApplicationScriptEntity entity = getData("jsonStr", object, SysApplicationScriptEntity.class); + if (entity == null) { + return BaseResult.getFailureMessageEntity("参数不允许为空"); + } + if (entity.getId() == null || "".equals(entity.getId())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + entity.setUpdate(); + sysApplicationScriptDao.logicRemoveMultiCondition(entity); + return BaseResult.getSuccessMessageEntity("删除脚本成功"); + } + + /** + * @param object + * @return + * @Author lvleigang + * @Description 获取脚本接口 + * @Date 2:10 下午 2023/9/23 + **/ + @Override + public JsonResultEntity getAppScript(JSONObject object) { + SysApplicationScriptEntity entity = getData("jsonStr", object, SysApplicationScriptEntity.class); + if (entity.getId() == null || "".equals(entity.getId())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + //查询接口 + SysApplicationScriptEntity sysApplicationScriptEntity = sysApplicationScriptDao.get(entity.getId()); + return BaseResult.getSuccessMessageEntity("查询数据成功", sysApplicationScriptEntity); + } + + /** + * @param object + * @return + * @Author lvleigang + * @Description 脚本启用停用接口 + * @Date 2:10 下午 2023/9/23 + **/ + @Override + public JsonResultEntity enableOrDisableAppScript(JSONObject object) { + SysApplicationScriptEntity entity = getData("jsonStr", object, SysApplicationScriptEntity.class); + if (entity == null) { + return BaseResult.getFailureMessageEntity("参数不允许为空"); + } + if (entity.getId() == null || "".equals(entity.getId())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + if (entity.getScriptStatus() == null || "".equals(entity.getScriptStatus())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + entity.setUpdate(); + sysApplicationScriptDao.update(entity); + if ("1".equals(entity.getScriptStatus())) {// 1启用2停用 + return BaseResult.getSuccessMessageEntity("启用成功"); + } else { + return BaseResult.getSuccessMessageEntity("停用成功"); + } + } } From 315dc6582a2a021b0c71f01785cf32b47c64bbe1 Mon Sep 17 00:00:00 2001 From: hecan <1718492867@qq.com> Date: Mon, 17 Jun 2024 14:16:14 +0800 Subject: [PATCH 58/80] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=BB=84=E7=BB=87?= =?UTF-8?q?=E5=92=8C=E9=A1=B9=E7=9B=AE=E6=8F=92=E4=BB=B6=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cfgHome/plugin/masterData.project/pluginCfg.xml | 6 ++++++ .../masterData.project/spring/spring-buildpackage-dao.xml | 5 +++++ .../spring/spring-buildpackage-plugin.xml | 5 +++++ .../spring/spring-buildpackage-service.xml | 5 +++++ .../resources/cfgHome/plugin/masterData/org/pluginCfg.xml | 6 ++++++ .../masterData/org/spring/spring-buildpackage-dao.xml | 5 +++++ .../masterData/org/spring/spring-buildpackage-plugin.xml | 5 +++++ .../masterData/org/spring/spring-buildpackage-service.xml | 5 +++++ 8 files changed, 42 insertions(+) create mode 100644 buildpackage/src/main/resources/cfgHome/plugin/masterData.project/pluginCfg.xml create mode 100644 buildpackage/src/main/resources/cfgHome/plugin/masterData.project/spring/spring-buildpackage-dao.xml create mode 100644 buildpackage/src/main/resources/cfgHome/plugin/masterData.project/spring/spring-buildpackage-plugin.xml create mode 100644 buildpackage/src/main/resources/cfgHome/plugin/masterData.project/spring/spring-buildpackage-service.xml create mode 100644 buildpackage/src/main/resources/cfgHome/plugin/masterData/org/pluginCfg.xml create mode 100644 buildpackage/src/main/resources/cfgHome/plugin/masterData/org/spring/spring-buildpackage-dao.xml create mode 100644 buildpackage/src/main/resources/cfgHome/plugin/masterData/org/spring/spring-buildpackage-plugin.xml create mode 100644 buildpackage/src/main/resources/cfgHome/plugin/masterData/org/spring/spring-buildpackage-service.xml diff --git a/buildpackage/src/main/resources/cfgHome/plugin/masterData.project/pluginCfg.xml b/buildpackage/src/main/resources/cfgHome/plugin/masterData.project/pluginCfg.xml new file mode 100644 index 00000000..e6a21caa --- /dev/null +++ b/buildpackage/src/main/resources/cfgHome/plugin/masterData.project/pluginCfg.xml @@ -0,0 +1,6 @@ + + +MdmProjectPlugin +MdmProjectPlugin插件 +90000001 + diff --git a/buildpackage/src/main/resources/cfgHome/plugin/masterData.project/spring/spring-buildpackage-dao.xml b/buildpackage/src/main/resources/cfgHome/plugin/masterData.project/spring/spring-buildpackage-dao.xml new file mode 100644 index 00000000..4b2b24ab --- /dev/null +++ b/buildpackage/src/main/resources/cfgHome/plugin/masterData.project/spring/spring-buildpackage-dao.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/buildpackage/src/main/resources/cfgHome/plugin/masterData.project/spring/spring-buildpackage-plugin.xml b/buildpackage/src/main/resources/cfgHome/plugin/masterData.project/spring/spring-buildpackage-plugin.xml new file mode 100644 index 00000000..272d01ca --- /dev/null +++ b/buildpackage/src/main/resources/cfgHome/plugin/masterData.project/spring/spring-buildpackage-plugin.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/buildpackage/src/main/resources/cfgHome/plugin/masterData.project/spring/spring-buildpackage-service.xml b/buildpackage/src/main/resources/cfgHome/plugin/masterData.project/spring/spring-buildpackage-service.xml new file mode 100644 index 00000000..5b26e6ed --- /dev/null +++ b/buildpackage/src/main/resources/cfgHome/plugin/masterData.project/spring/spring-buildpackage-service.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/buildpackage/src/main/resources/cfgHome/plugin/masterData/org/pluginCfg.xml b/buildpackage/src/main/resources/cfgHome/plugin/masterData/org/pluginCfg.xml new file mode 100644 index 00000000..f2f50ef1 --- /dev/null +++ b/buildpackage/src/main/resources/cfgHome/plugin/masterData/org/pluginCfg.xml @@ -0,0 +1,6 @@ + + +MdmOrgPlugin +MdmOrgPlugin插件 +90000001 + diff --git a/buildpackage/src/main/resources/cfgHome/plugin/masterData/org/spring/spring-buildpackage-dao.xml b/buildpackage/src/main/resources/cfgHome/plugin/masterData/org/spring/spring-buildpackage-dao.xml new file mode 100644 index 00000000..134e2407 --- /dev/null +++ b/buildpackage/src/main/resources/cfgHome/plugin/masterData/org/spring/spring-buildpackage-dao.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/buildpackage/src/main/resources/cfgHome/plugin/masterData/org/spring/spring-buildpackage-plugin.xml b/buildpackage/src/main/resources/cfgHome/plugin/masterData/org/spring/spring-buildpackage-plugin.xml new file mode 100644 index 00000000..a8e39d7b --- /dev/null +++ b/buildpackage/src/main/resources/cfgHome/plugin/masterData/org/spring/spring-buildpackage-plugin.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/buildpackage/src/main/resources/cfgHome/plugin/masterData/org/spring/spring-buildpackage-service.xml b/buildpackage/src/main/resources/cfgHome/plugin/masterData/org/spring/spring-buildpackage-service.xml new file mode 100644 index 00000000..9cea180a --- /dev/null +++ b/buildpackage/src/main/resources/cfgHome/plugin/masterData/org/spring/spring-buildpackage-service.xml @@ -0,0 +1,5 @@ + + + + + From 92ff85498dfa04c1745bb055bfc60ff112083db3 Mon Sep 17 00:00:00 2001 From: hecan <1718492867@qq.com> Date: Mon, 17 Jun 2024 14:59:51 +0800 Subject: [PATCH 59/80] =?UTF-8?q?=E7=94=A8=E6=88=B7=E6=A1=A3=E6=A1=88?= =?UTF-8?q?=E6=8F=92=E4=BB=B6=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/cfgHome/plugin/masterData.user/pluginCfg.xml | 6 ++++++ .../masterData.user/spring/spring-buildpackage-dao.xml | 5 +++++ .../masterData.user/spring/spring-buildpackage-plugin.xml | 5 +++++ .../masterData.user/spring/spring-buildpackage-service.xml | 5 +++++ 4 files changed, 21 insertions(+) create mode 100644 buildpackage/src/main/resources/cfgHome/plugin/masterData.user/pluginCfg.xml create mode 100644 buildpackage/src/main/resources/cfgHome/plugin/masterData.user/spring/spring-buildpackage-dao.xml create mode 100644 buildpackage/src/main/resources/cfgHome/plugin/masterData.user/spring/spring-buildpackage-plugin.xml create mode 100644 buildpackage/src/main/resources/cfgHome/plugin/masterData.user/spring/spring-buildpackage-service.xml diff --git a/buildpackage/src/main/resources/cfgHome/plugin/masterData.user/pluginCfg.xml b/buildpackage/src/main/resources/cfgHome/plugin/masterData.user/pluginCfg.xml new file mode 100644 index 00000000..b7b315a4 --- /dev/null +++ b/buildpackage/src/main/resources/cfgHome/plugin/masterData.user/pluginCfg.xml @@ -0,0 +1,6 @@ + + +MdmUserPlugin +MdmUserPlugin插件 +90000001 + diff --git a/buildpackage/src/main/resources/cfgHome/plugin/masterData.user/spring/spring-buildpackage-dao.xml b/buildpackage/src/main/resources/cfgHome/plugin/masterData.user/spring/spring-buildpackage-dao.xml new file mode 100644 index 00000000..08c20d5f --- /dev/null +++ b/buildpackage/src/main/resources/cfgHome/plugin/masterData.user/spring/spring-buildpackage-dao.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/buildpackage/src/main/resources/cfgHome/plugin/masterData.user/spring/spring-buildpackage-plugin.xml b/buildpackage/src/main/resources/cfgHome/plugin/masterData.user/spring/spring-buildpackage-plugin.xml new file mode 100644 index 00000000..a9e42b61 --- /dev/null +++ b/buildpackage/src/main/resources/cfgHome/plugin/masterData.user/spring/spring-buildpackage-plugin.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/buildpackage/src/main/resources/cfgHome/plugin/masterData.user/spring/spring-buildpackage-service.xml b/buildpackage/src/main/resources/cfgHome/plugin/masterData.user/spring/spring-buildpackage-service.xml new file mode 100644 index 00000000..0b5dc5ca --- /dev/null +++ b/buildpackage/src/main/resources/cfgHome/plugin/masterData.user/spring/spring-buildpackage-service.xml @@ -0,0 +1,5 @@ + + + + + From cbf2fff967011738996c87ed1b6637488e3d02da Mon Sep 17 00:00:00 2001 From: hecan <1718492867@qq.com> Date: Mon, 17 Jun 2024 15:00:04 +0800 Subject: [PATCH 60/80] =?UTF-8?q?=E7=94=A8=E6=88=B7=E6=A1=A3=E6=A1=88?= =?UTF-8?q?=E6=8F=92=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../masterData/user/dao/IMdmUserDao.java | 15 + .../user/dao/impl/MdmUserDaoImpl.java | 15 + .../masterData/user/entity/MdmUserEntity.java | 275 ++++++++++ .../masterData/user/entity/MdmUserEntity.xml | 476 ++++++++++++++++++ .../user/plugin/MdmUserPluginInitializer.java | 50 ++ .../user/service/IMdmUserService.java | 13 + .../user/service/impl/MdmUserServiceImpl.java | 23 + 7 files changed, 867 insertions(+) create mode 100644 buildpackage/src/main/java/com/hzya/frame/plugin/masterData/user/dao/IMdmUserDao.java create mode 100644 buildpackage/src/main/java/com/hzya/frame/plugin/masterData/user/dao/impl/MdmUserDaoImpl.java create mode 100644 buildpackage/src/main/java/com/hzya/frame/plugin/masterData/user/entity/MdmUserEntity.java create mode 100644 buildpackage/src/main/java/com/hzya/frame/plugin/masterData/user/entity/MdmUserEntity.xml create mode 100644 buildpackage/src/main/java/com/hzya/frame/plugin/masterData/user/plugin/MdmUserPluginInitializer.java create mode 100644 buildpackage/src/main/java/com/hzya/frame/plugin/masterData/user/service/IMdmUserService.java create mode 100644 buildpackage/src/main/java/com/hzya/frame/plugin/masterData/user/service/impl/MdmUserServiceImpl.java diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/user/dao/IMdmUserDao.java b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/user/dao/IMdmUserDao.java new file mode 100644 index 00000000..1556e191 --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/user/dao/IMdmUserDao.java @@ -0,0 +1,15 @@ +package com.hzya.frame.plugin.masterData.user.dao; + +import com.hzya.frame.basedao.dao.IBaseDao; +import com.hzya.frame.plugin.masterData.user.entity.MdmUserEntity; + +/** + * 用户档案(mdm_user: table)表数据库访问层 + * + * @author makejava + * @since 2024-06-17 14:52:30 + */ +public interface IMdmUserDao extends IBaseDao { + +} + diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/user/dao/impl/MdmUserDaoImpl.java b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/user/dao/impl/MdmUserDaoImpl.java new file mode 100644 index 00000000..e8d048ea --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/user/dao/impl/MdmUserDaoImpl.java @@ -0,0 +1,15 @@ +package com.hzya.frame.plugin.masterData.user.dao.impl; + +import com.hzya.frame.basedao.dao.MybatisGenericDao; +import com.hzya.frame.plugin.masterData.user.dao.IMdmUserDao; +import com.hzya.frame.plugin.masterData.user.entity.MdmUserEntity; +/** + * 用户档案(MdmUser)表数据库访问层 + * + * @author makejava + * @since 2024-06-17 14:52:30 + */ +public class MdmUserDaoImpl extends MybatisGenericDao implements IMdmUserDao { + +} + diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/user/entity/MdmUserEntity.java b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/user/entity/MdmUserEntity.java new file mode 100644 index 00000000..5a89edcf --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/user/entity/MdmUserEntity.java @@ -0,0 +1,275 @@ +package com.hzya.frame.plugin.masterData.user.entity; + +import com.hzya.frame.web.entity.BaseEntity; +/** + * 用户档案(MdmUser)实体类 + * + * @author makejava + * @since 2024-06-17 14:52:30 + */ +public class MdmUserEntity extends BaseEntity { + + /** 单据规则 */ + private String documentRule; + /** 单据规则流水号 */ + private Long documentRuleNum; + /** 数据状态 Y正常 N删除 F修改 */ + private String dataStatus; + /** 新增数据状态 0待下发 1已下发 */ + private String addStatus; + /** 修改数据状态 0待下发 1已下发 */ + private String updateStatus; + /** 删除数据状态 0待下发 1已下发 */ + private String deleteStatus; + /** 公司id */ + private String companyId; + /** 用户名称 */ + private String userName; + /** 用户编码 */ + private String userCode; + /** 用户密码 */ + private String userPassword; + /** 密码安全级别 */ + private String pwdlevelcode; + /** 密码参数 */ + private String pwdparam; + /** 备注 */ + private String userNote; + /** 生效日期 */ + private String abledate; + /** 失效日期 */ + private String disabledate; + /** 锁定 */ + private String islocked; + /** 用户类型 */ + private String userType; + /** 身份类型 */ + private String baseDocType; + /** 身份 */ + private String pkBaseDoc; + /** 认证类型 */ + private String identityverifycode; + /** 所属组织 */ + private String pkOrg; + /** 数据格式 */ + private String format; + /** CA用户 */ + private String isca; + /** 启用状态 */ + private String enablestate; + /** 内容语种 */ + private String contentlang; + /** 用户编码 */ + private String userCodeQ; + + + public String getDocumentRule() { + return documentRule; + } + + public void setDocumentRule(String documentRule) { + this.documentRule = documentRule; + } + + public Long getDocumentRuleNum() { + return documentRuleNum; + } + + public void setDocumentRuleNum(Long documentRuleNum) { + this.documentRuleNum = documentRuleNum; + } + + public String getDataStatus() { + return dataStatus; + } + + public void setDataStatus(String dataStatus) { + this.dataStatus = dataStatus; + } + + public String getAddStatus() { + return addStatus; + } + + public void setAddStatus(String addStatus) { + this.addStatus = addStatus; + } + + public String getUpdateStatus() { + return updateStatus; + } + + public void setUpdateStatus(String updateStatus) { + this.updateStatus = updateStatus; + } + + public String getDeleteStatus() { + return deleteStatus; + } + + public void setDeleteStatus(String deleteStatus) { + this.deleteStatus = deleteStatus; + } + + public String getCompanyId() { + return companyId; + } + + public void setCompanyId(String companyId) { + this.companyId = companyId; + } + + public String getUserName() { + return userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } + + public String getUserCode() { + return userCode; + } + + public void setUserCode(String userCode) { + this.userCode = userCode; + } + + public String getUserPassword() { + return userPassword; + } + + public void setUserPassword(String userPassword) { + this.userPassword = userPassword; + } + + public String getPwdlevelcode() { + return pwdlevelcode; + } + + public void setPwdlevelcode(String pwdlevelcode) { + this.pwdlevelcode = pwdlevelcode; + } + + public String getPwdparam() { + return pwdparam; + } + + public void setPwdparam(String pwdparam) { + this.pwdparam = pwdparam; + } + + public String getUserNote() { + return userNote; + } + + public void setUserNote(String userNote) { + this.userNote = userNote; + } + + public String getAbledate() { + return abledate; + } + + public void setAbledate(String abledate) { + this.abledate = abledate; + } + + public String getDisabledate() { + return disabledate; + } + + public void setDisabledate(String disabledate) { + this.disabledate = disabledate; + } + + public String getIslocked() { + return islocked; + } + + public void setIslocked(String islocked) { + this.islocked = islocked; + } + + public String getUserType() { + return userType; + } + + public void setUserType(String userType) { + this.userType = userType; + } + + public String getBaseDocType() { + return baseDocType; + } + + public void setBaseDocType(String baseDocType) { + this.baseDocType = baseDocType; + } + + public String getPkBaseDoc() { + return pkBaseDoc; + } + + public void setPkBaseDoc(String pkBaseDoc) { + this.pkBaseDoc = pkBaseDoc; + } + + public String getIdentityverifycode() { + return identityverifycode; + } + + public void setIdentityverifycode(String identityverifycode) { + this.identityverifycode = identityverifycode; + } + + public String getPkOrg() { + return pkOrg; + } + + public void setPkOrg(String pkOrg) { + this.pkOrg = pkOrg; + } + + public String getFormat() { + return format; + } + + public void setFormat(String format) { + this.format = format; + } + + public String getIsca() { + return isca; + } + + public void setIsca(String isca) { + this.isca = isca; + } + + public String getEnablestate() { + return enablestate; + } + + public void setEnablestate(String enablestate) { + this.enablestate = enablestate; + } + + public String getContentlang() { + return contentlang; + } + + public void setContentlang(String contentlang) { + this.contentlang = contentlang; + } + + public String getUserCodeQ() { + return userCodeQ; + } + + public void setUserCodeQ(String userCodeQ) { + this.userCodeQ = userCodeQ; + } + +} + diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/user/entity/MdmUserEntity.xml b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/user/entity/MdmUserEntity.xml new file mode 100644 index 00000000..a05e5cf0 --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/user/entity/MdmUserEntity.xml @@ -0,0 +1,476 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + id + ,document_rule + ,document_rule_num + ,data_status + ,add_status + ,update_status + ,delete_status + ,sorts + ,create_user_id + ,create_time + ,modify_user_id + ,modify_time + ,sts + ,org_id + ,company_id + ,user_name + ,user_code + ,user_password + ,pwdlevelcode + ,pwdparam + ,user_note + ,abledate + ,disabledate + ,islocked + ,user_type + ,base_doc_type + ,pk_base_doc + ,identityverifycode + ,pk_org + ,format + ,isca + ,enablestate + ,contentlang + ,user_code_q + + + + + + + + + + + + + + + + insert into mdm_user( + + id , + document_rule , + document_rule_num , + data_status , + add_status , + update_status , + delete_status , + sorts , + create_user_id , + create_time , + modify_user_id , + modify_time , + sts , + org_id , + company_id , + user_name , + user_code , + user_password , + pwdlevelcode , + pwdparam , + user_note , + abledate , + disabledate , + islocked , + user_type , + base_doc_type , + pk_base_doc , + identityverifycode , + pk_org , + format , + isca , + enablestate , + contentlang , + user_code_q , + sorts, + sts, + + )values( + + #{id} , + #{documentRule} , + #{documentRuleNum} , + #{dataStatus} , + #{addStatus} , + #{updateStatus} , + #{deleteStatus} , + #{sorts} , + #{create_user_id} , + #{create_time} , + #{modify_user_id} , + #{modify_time} , + #{sts} , + #{org_id} , + #{companyId} , + #{userName} , + #{userCode} , + #{userPassword} , + #{pwdlevelcode} , + #{pwdparam} , + #{userNote} , + #{abledate} , + #{disabledate} , + #{islocked} , + #{userType} , + #{baseDocType} , + #{pkBaseDoc} , + #{identityverifycode} , + #{pkOrg} , + #{format} , + #{isca} , + #{enablestate} , + #{contentlang} , + #{userCodeQ} , + (select (max(IFNULL( a.sorts, 0 )) + 1) as sort from mdm_user a WHERE a.sts = 'Y' ), + 'Y', + + ) + + + + insert into mdm_user(document_rule, document_rule_num, data_status, add_status, update_status, delete_status, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, user_name, user_code, user_password, pwdlevelcode, pwdparam, user_note, abledate, disabledate, islocked, user_type, base_doc_type, pk_base_doc, identityverifycode, pk_org, format, isca, enablestate, contentlang, user_code_q, sts) + values + + (#{entity.documentRule},#{entity.documentRuleNum},#{entity.dataStatus},#{entity.addStatus},#{entity.updateStatus},#{entity.deleteStatus},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId},#{entity.userName},#{entity.userCode},#{entity.userPassword},#{entity.pwdlevelcode},#{entity.pwdparam},#{entity.userNote},#{entity.abledate},#{entity.disabledate},#{entity.islocked},#{entity.userType},#{entity.baseDocType},#{entity.pkBaseDoc},#{entity.identityverifycode},#{entity.pkOrg},#{entity.format},#{entity.isca},#{entity.enablestate},#{entity.contentlang},#{entity.userCodeQ}, 'Y') + + + + + insert into mdm_user(document_rule, document_rule_num, data_status, add_status, update_status, delete_status, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, user_name, user_code, user_password, pwdlevelcode, pwdparam, user_note, abledate, disabledate, islocked, user_type, base_doc_type, pk_base_doc, identityverifycode, pk_org, format, isca, enablestate, contentlang, user_code_q) + values + + (#{entity.documentRule},#{entity.documentRuleNum},#{entity.dataStatus},#{entity.addStatus},#{entity.updateStatus},#{entity.deleteStatus},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId},#{entity.userName},#{entity.userCode},#{entity.userPassword},#{entity.pwdlevelcode},#{entity.pwdparam},#{entity.userNote},#{entity.abledate},#{entity.disabledate},#{entity.islocked},#{entity.userType},#{entity.baseDocType},#{entity.pkBaseDoc},#{entity.identityverifycode},#{entity.pkOrg},#{entity.format},#{entity.isca},#{entity.enablestate},#{entity.contentlang},#{entity.userCodeQ}) + + on duplicate key update + document_rule = values(document_rule), + document_rule_num = values(document_rule_num), + data_status = values(data_status), + add_status = values(add_status), + update_status = values(update_status), + delete_status = values(delete_status), + create_user_id = values(create_user_id), + create_time = values(create_time), + modify_user_id = values(modify_user_id), + modify_time = values(modify_time), + sts = values(sts), + org_id = values(org_id), + company_id = values(company_id), + user_name = values(user_name), + user_code = values(user_code), + user_password = values(user_password), + pwdlevelcode = values(pwdlevelcode), + pwdparam = values(pwdparam), + user_note = values(user_note), + abledate = values(abledate), + disabledate = values(disabledate), + islocked = values(islocked), + user_type = values(user_type), + base_doc_type = values(base_doc_type), + pk_base_doc = values(pk_base_doc), + identityverifycode = values(identityverifycode), + pk_org = values(pk_org), + format = values(format), + isca = values(isca), + enablestate = values(enablestate), + contentlang = values(contentlang), + user_code_q = values(user_code_q) + + +update mdm_user set + + document_rule = #{documentRule}, + document_rule_num = #{documentRuleNum}, + data_status = #{dataStatus}, + add_status = #{addStatus}, + update_status = #{updateStatus}, + delete_status = #{deleteStatus}, + create_user_id = #{create_user_id}, + create_time = #{create_time}, + modify_user_id = #{modify_user_id}, + modify_time = #{modify_time}, + sts = #{sts}, + org_id = #{org_id}, + company_id = #{companyId}, + user_name = #{userName}, + user_code = #{userCode}, + user_password = #{userPassword}, + pwdlevelcode = #{pwdlevelcode}, + pwdparam = #{pwdparam}, + user_note = #{userNote}, + abledate = #{abledate}, + disabledate = #{disabledate}, + islocked = #{islocked}, + user_type = #{userType}, + base_doc_type = #{baseDocType}, + pk_base_doc = #{pkBaseDoc}, + identityverifycode = #{identityverifycode}, + pk_org = #{pkOrg}, + format = #{format}, + isca = #{isca}, + enablestate = #{enablestate}, + contentlang = #{contentlang}, + user_code_q = #{userCodeQ}, + +where id = #{id} + + + +update mdm_user set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} +where id = #{id} + + + +update mdm_user set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} + + and id = #{id} + and document_rule = #{documentRule} + and document_rule_num = #{documentRuleNum} + and data_status = #{dataStatus} + and add_status = #{addStatus} + and update_status = #{updateStatus} + and delete_status = #{deleteStatus} + and sorts = #{sorts} + and sts = #{sts} + and company_id = #{companyId} + and user_name = #{userName} + and user_code = #{userCode} + and user_password = #{userPassword} + and pwdlevelcode = #{pwdlevelcode} + and pwdparam = #{pwdparam} + and user_note = #{userNote} + and abledate = #{abledate} + and disabledate = #{disabledate} + and islocked = #{islocked} + and user_type = #{userType} + and base_doc_type = #{baseDocType} + and pk_base_doc = #{pkBaseDoc} + and identityverifycode = #{identityverifycode} + and pk_org = #{pkOrg} + and format = #{format} + and isca = #{isca} + and enablestate = #{enablestate} + and contentlang = #{contentlang} + and user_code_q = #{userCodeQ} + and sts='Y' + + + + + delete from mdm_user where id = #{id} + + + + diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/user/plugin/MdmUserPluginInitializer.java b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/user/plugin/MdmUserPluginInitializer.java new file mode 100644 index 00000000..0fbea074 --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/user/plugin/MdmUserPluginInitializer.java @@ -0,0 +1,50 @@ +package com.hzya.frame.plugin.masterData.user.plugin; +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.base.PluginBaseEntity; +import com.hzya.frame.web.entity.JsonResultEntity; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +/** + * 用户档案(MdmUser)表服务接口 + * + * @author makejava + * @since 2024-06-17 14:52:30 + */ +public class MdmUserPluginInitializer extends PluginBaseEntity{ + Logger logger = LoggerFactory.getLogger(MdmUserPluginInitializer.class); + + @Override + public void initialize() { + logger.info(getPluginLabel() + "執行初始化方法initialize()"); + } + + @Override + public void destroy() { + logger.info(getPluginLabel() + "執行銷毀方法destroy()"); + } + + @Override + public String getPluginId() { + return "MdmUserPlugin"; + } + + @Override + public String getPluginName() { + return "MdmUserPlugin插件"; + } + + @Override + public String getPluginLabel() { + return "MdmUserPlugin"; + } + + @Override + public String getPluginType() { + return "1"; + } + @Override + public JsonResultEntity executeBusiness(JSONObject requestJson) { + logger.info("执行业务代码逻辑"); + return null; + } +} diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/user/service/IMdmUserService.java b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/user/service/IMdmUserService.java new file mode 100644 index 00000000..e7f984eb --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/user/service/IMdmUserService.java @@ -0,0 +1,13 @@ +package com.hzya.frame.plugin.masterData.user.service; + +import com.hzya.frame.basedao.service.IBaseService; +import com.hzya.frame.plugin.masterData.user.entity.MdmUserEntity; + +/** + * 用户档案(MdmUser)表服务接口 + * + * @author makejava + * @since 2024-06-17 14:52:30 + */ +public interface IMdmUserService extends IBaseService{ +} diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/user/service/impl/MdmUserServiceImpl.java b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/user/service/impl/MdmUserServiceImpl.java new file mode 100644 index 00000000..3f88a2d2 --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/user/service/impl/MdmUserServiceImpl.java @@ -0,0 +1,23 @@ +package com.hzya.frame.plugin.masterData.user.service.impl; + +import com.hzya.frame.basedao.service.impl.BaseService; +import com.hzya.frame.plugin.masterData.user.dao.IMdmUserDao; +import com.hzya.frame.plugin.masterData.user.entity.MdmUserEntity; +import com.hzya.frame.plugin.masterData.user.service.IMdmUserService; +import org.springframework.beans.factory.annotation.Autowired; +/** + * 用户档案(MdmUser)表服务实现类 + * + * @author makejava + * @since 2024-06-17 14:52:30 + */ +public class MdmUserServiceImpl extends BaseService implements IMdmUserService { + + private IMdmUserDao mdmUserDao; + + @Autowired + public void setMdmUserDao(IMdmUserDao dao) { + this.mdmUserDao = dao; + this.dao = dao; + } +} From 3fffae8d3c61562b2ed3a783f447ebdc31404b5a Mon Sep 17 00:00:00 2001 From: xiang2lin <251481237@qq.com> Date: Tue, 18 Jun 2024 11:00:52 +0800 Subject: [PATCH 61/80] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=20=20apiUrl=E5=AD=97?= =?UTF-8?q?=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/entity/SysApplicationApiEntity.java | 10 ++++ .../api/entity/SysApplicationApiEntity.xml | 46 ++++++++++++++++++- 2 files changed, 55 insertions(+), 1 deletion(-) diff --git a/service/src/main/java/com/hzya/frame/sysnew/application/api/entity/SysApplicationApiEntity.java b/service/src/main/java/com/hzya/frame/sysnew/application/api/entity/SysApplicationApiEntity.java index e0fc5061..bed8eaf7 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/application/api/entity/SysApplicationApiEntity.java +++ b/service/src/main/java/com/hzya/frame/sysnew/application/api/entity/SysApplicationApiEntity.java @@ -20,6 +20,8 @@ public class SysApplicationApiEntity extends BaseEntity { private String appId; /** api应用名称 */ private String appName; + /** api应用地址 **/ + private String appUrl; /** 目录 */ private String catalogueId; /** 目录名称 */ @@ -291,5 +293,13 @@ public class SysApplicationApiEntity extends BaseEntity { public void setReturnSuccessValue(String returnSuccessValue) { this.returnSuccessValue = returnSuccessValue; } + + public String getAppUrl() { + return appUrl; + } + + public void setAppUrl(String appUrl) { + this.appUrl = appUrl; + } } diff --git a/service/src/main/java/com/hzya/frame/sysnew/application/api/entity/SysApplicationApiEntity.xml b/service/src/main/java/com/hzya/frame/sysnew/application/api/entity/SysApplicationApiEntity.xml index d180eef9..f6596703 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/application/api/entity/SysApplicationApiEntity.xml +++ b/service/src/main/java/com/hzya/frame/sysnew/application/api/entity/SysApplicationApiEntity.xml @@ -10,6 +10,7 @@ + @@ -84,6 +85,7 @@ a.id, a.api_status, b.name as app_name, + b.interfaceAddress as app_url, a.app_id, a.catalogue_id, c.name as catalogue_name, @@ -702,7 +704,7 @@ where id = #{id} - select a.id, a.catalogue_id AS catalogueId, @@ -744,6 +746,48 @@ where id = #{id} order by a.sorts asc + select count(1) from ${tableName} where sts='Y' + + + + + + + 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 677329b2..2bae850a 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 @@ -495,6 +495,16 @@ public class MdmModuleServiceImpl extends BaseService i //新增 设置日志表 setMdmField(mdmModuleDbEntity1, mdmModuleDbFiledsEntities); } + for (int i = 0; i < mdmModuleDbEntities.size(); i++) { + //查看表是否存在 + MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); + mdmModuleDbEntity.setDbName(mdmModuleDbEntities.get(i).getDbName()); + mdmModuleDbEntity.setSts("Y"); + int a = mdmModuleDbDao.getCount(mdmModuleDbEntity); + if(a > 0){ + return BaseResult.getFailureMessageEntity("表已存在,请修改"); + } + } mdmServiceCache.saveOrUpdateMdmModuleDb(entity.getMdmId(), mdmModuleDbEntities); mdmServiceCache.saveOrUpdateMdmModuleDbFileds(entity.getMdmId(), mdmModuleDbFiledsEntities); diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDbFileds/entity/MdmModuleDbFiledsEntity.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDbFileds/entity/MdmModuleDbFiledsEntity.java index 80e26fd1..3e1debd5 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDbFileds/entity/MdmModuleDbFiledsEntity.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDbFileds/entity/MdmModuleDbFiledsEntity.java @@ -1,11 +1,9 @@ package com.hzya.frame.mdm.mdmModuleDbFileds.entity; -import java.util.Date; import java.util.List; import com.hzya.frame.mdm.mdmModuleDbFiledsRule.entity.MdmModuleDbFiledsRuleEntity; import com.hzya.frame.web.entity.BaseEntity; -import org.apache.poi.ss.formula.functions.T; /** * 模版数据库字段表(MdmModuleDbFileds)实体类 diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistribute/dao/IMdmModuleDistributeDao.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistribute/dao/IMdmModuleDistributeDao.java index 5ccc1e4d..ffa3cacc 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistribute/dao/IMdmModuleDistributeDao.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistribute/dao/IMdmModuleDistributeDao.java @@ -7,7 +7,7 @@ import com.hzya.frame.basedao.dao.IBaseDao; * 主数据功能应用分发表(mdm_module_distribute: table)表数据库访问层 * * @author makejava - * @since 2024-06-17 11:05:32 + * @since 2024-06-18 11:39:46 */ public interface IMdmModuleDistributeDao extends IBaseDao { diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistribute/dao/impl/MdmModuleDistributeDaoImpl.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistribute/dao/impl/MdmModuleDistributeDaoImpl.java index 20fcd94f..83ba2db8 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistribute/dao/impl/MdmModuleDistributeDaoImpl.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistribute/dao/impl/MdmModuleDistributeDaoImpl.java @@ -8,7 +8,7 @@ import com.hzya.frame.basedao.dao.MybatisGenericDao; * 主数据功能应用分发表(MdmModuleDistribute)表数据库访问层 * * @author makejava - * @since 2024-06-17 11:05:32 + * @since 2024-06-18 11:39:46 */ @Repository(value = "MdmModuleDistributeDaoImpl") public class MdmModuleDistributeDaoImpl extends MybatisGenericDao implements IMdmModuleDistributeDao{ diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistribute/entity/MdmModuleDistributeEntity.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistribute/entity/MdmModuleDistributeEntity.java index 08ff46f7..30fcf0dc 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistribute/entity/MdmModuleDistributeEntity.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistribute/entity/MdmModuleDistributeEntity.java @@ -9,7 +9,7 @@ import com.hzya.frame.web.entity.BaseEntity; * 主数据功能应用分发表(MdmModuleDistribute)实体类 * * @author makejava - * @since 2024-06-17 11:05:33 + * @since 2024-06-18 11:39:46 */ public class MdmModuleDistributeEntity extends BaseEntity { @@ -17,6 +17,8 @@ public class MdmModuleDistributeEntity extends BaseEntity { private String mdmId; /** 应用id */ private String appId; + /** 触发类型 0、手动1、自动 */ + private String enabledType; /** 修改接口 */ private String updateApi; /** 修改插件 */ @@ -35,8 +37,9 @@ public class MdmModuleDistributeEntity extends BaseEntity { private String dbId; /** 公司id */ private String companyId; + /** 公司id */ + private List mdmModuleDistributeDetailEntities; - private List mdmModuleDistributeDetailEntities; public String getMdmId() { return mdmId; @@ -54,6 +57,14 @@ public class MdmModuleDistributeEntity extends BaseEntity { this.appId = appId; } + public String getEnabledType() { + return enabledType; + } + + public void setEnabledType(String enabledType) { + this.enabledType = enabledType; + } + public String getUpdateApi() { return updateApi; } diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistribute/entity/MdmModuleDistributeEntity.xml b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistribute/entity/MdmModuleDistributeEntity.xml index d7822968..0a959f0f 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistribute/entity/MdmModuleDistributeEntity.xml +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistribute/entity/MdmModuleDistributeEntity.xml @@ -6,6 +6,7 @@ + @@ -28,6 +29,7 @@ id ,mdm_id ,app_id + ,enabled_type ,update_api ,update_script ,add_api @@ -45,6 +47,13 @@ ,org_id ,company_id + + + - + insert into mdm_module_distribute( id , mdm_id , app_id , + enabled_type , update_api , update_script , add_api , @@ -190,6 +204,7 @@ sts , org_id , company_id , + sorts, sts, )values( @@ -197,6 +212,7 @@ #{id} , #{mdmId} , #{appId} , + #{enabledType} , #{updateApi} , #{updateScript} , #{addApi} , @@ -213,28 +229,30 @@ #{sts} , #{org_id} , #{companyId} , + (select (max(IFNULL( a.sorts, 0 )) + 1) as sort from mdm_module_distribute a WHERE a.sts = 'Y' ), 'Y', ) - - insert into mdm_module_distribute(mdm_id, app_id, update_api, update_script, add_api, add_script, delete_api, delete_script, enabled_state, db_id, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, sts) + + insert into mdm_module_distribute(mdm_id, app_id, enabled_type, update_api, update_script, add_api, add_script, delete_api, delete_script, enabled_state, db_id, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, sts) values - (#{entity.mdmId},#{entity.appId},#{entity.updateApi},#{entity.updateScript},#{entity.addApi},#{entity.addScript},#{entity.deleteApi},#{entity.deleteScript},#{entity.enabledState},#{entity.dbId},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId}, 'Y') + (#{entity.mdmId},#{entity.appId},#{entity.enabledType},#{entity.updateApi},#{entity.updateScript},#{entity.addApi},#{entity.addScript},#{entity.deleteApi},#{entity.deleteScript},#{entity.enabledState},#{entity.dbId},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId}, 'Y') - - insert into mdm_module_distribute(mdm_id, app_id, update_api, update_script, add_api, add_script, delete_api, delete_script, enabled_state, db_id, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id) + + insert into mdm_module_distribute(mdm_id, app_id, enabled_type, update_api, update_script, add_api, add_script, delete_api, delete_script, enabled_state, db_id, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id) values - (#{entity.mdmId},#{entity.appId},#{entity.updateApi},#{entity.updateScript},#{entity.addApi},#{entity.addScript},#{entity.deleteApi},#{entity.deleteScript},#{entity.enabledState},#{entity.dbId},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId}) + (#{entity.mdmId},#{entity.appId},#{entity.enabledType},#{entity.updateApi},#{entity.updateScript},#{entity.addApi},#{entity.addScript},#{entity.deleteApi},#{entity.deleteScript},#{entity.enabledState},#{entity.dbId},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId}) on duplicate key update mdm_id = values(mdm_id), app_id = values(app_id), + enabled_type = values(enabled_type), update_api = values(update_api), update_script = values(update_script), add_api = values(add_api), @@ -256,6 +274,7 @@ update mdm_module_distribute set mdm_id = #{mdmId}, app_id = #{appId}, + enabled_type = #{enabledType}, update_api = #{updateApi}, update_script = #{updateScript}, add_api = #{addApi}, @@ -286,6 +305,7 @@ update mdm_module_distribute set sts= 'N' ,modify_time = #{modify_time},modify_ and id = #{id} and mdm_id = #{mdmId} and app_id = #{appId} + and enabled_type = #{enabledType} and update_api = #{updateApi} and update_script = #{updateScript} and add_api = #{addApi} diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistribute/service/IMdmModuleDistributeService.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistribute/service/IMdmModuleDistributeService.java index 7f674ad3..46befe7b 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistribute/service/IMdmModuleDistributeService.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistribute/service/IMdmModuleDistributeService.java @@ -6,7 +6,7 @@ import com.hzya.frame.basedao.service.IBaseService; * 主数据功能应用分发表(MdmModuleDistribute)表服务接口 * * @author makejava - * @since 2024-06-17 11:05:33 + * @since 2024-06-18 11:39:46 */ public interface IMdmModuleDistributeService extends IBaseService{ } diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistribute/service/impl/MdmModuleDistributeServiceImpl.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistribute/service/impl/MdmModuleDistributeServiceImpl.java index bfab4787..29bbea60 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistribute/service/impl/MdmModuleDistributeServiceImpl.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistribute/service/impl/MdmModuleDistributeServiceImpl.java @@ -11,7 +11,7 @@ import com.hzya.frame.basedao.service.impl.BaseService; * 主数据功能应用分发表(MdmModuleDistribute)表服务实现类 * * @author makejava - * @since 2024-06-17 11:05:33 + * @since 2024-06-18 11:39:46 */ @Service(value = "mdmModuleDistributeService") public class MdmModuleDistributeServiceImpl extends BaseService implements IMdmModuleDistributeService { diff --git a/service/src/main/java/com/hzya/frame/sysnew/application/api/entity/SysApplicationApiEntity.java b/service/src/main/java/com/hzya/frame/sysnew/application/api/entity/SysApplicationApiEntity.java index e0fc5061..577ec4ca 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/application/api/entity/SysApplicationApiEntity.java +++ b/service/src/main/java/com/hzya/frame/sysnew/application/api/entity/SysApplicationApiEntity.java @@ -1,6 +1,11 @@ package com.hzya.frame.sysnew.application.api.entity; +import java.util.ArrayList; import java.util.Date; +import java.util.List; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; import com.hzya.frame.web.entity.BaseEntity; /** * 应用api(SysApplicationApi)实体类 @@ -291,5 +296,38 @@ public class SysApplicationApiEntity extends BaseEntity { public void setReturnSuccessValue(String returnSuccessValue) { this.returnSuccessValue = returnSuccessValue; } + + public List getHeaderInValue() { + List jsonObjects = new ArrayList<>(); + if(headerIn != null && !"".equals(headerIn)){ + JSONArray headers = JSONArray.parseArray(headerIn); + if(headers != null && headers.size() > 0){ + for (int i = 0; i < headers.size(); i++) { + JSONObject object = new JSONObject(); + object.put(headers.getJSONObject(i).getString("parameterName"),headers.getJSONObject(i).getString("example")); + jsonObjects.add(object); + } + } + } + return jsonObjects; + } + + public String getQueryInValue() { + StringBuffer jsonObjects = new StringBuffer(); + if(queryIn != null && !"".equals(queryIn)){ + JSONArray querys = JSONArray.parseArray(queryIn); + if(querys != null && querys.size() > 0){ + for (int i = 0; i < querys.size(); i++) { + if(i != 0){ + jsonObjects.append("&"); + } + jsonObjects.append(querys.getJSONObject(i).getString("parameterName")); + jsonObjects.append("="); + jsonObjects.append(querys.getJSONObject(i).getString("example")); + } + } + } + return jsonObjects.toString(); + } } diff --git a/service/src/main/java/com/hzya/frame/sysnew/application/entity/SysApplicationDto.java b/service/src/main/java/com/hzya/frame/sysnew/application/entity/SysApplicationDto.java index 5a797b9a..e619ae21 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/application/entity/SysApplicationDto.java +++ b/service/src/main/java/com/hzya/frame/sysnew/application/entity/SysApplicationDto.java @@ -59,7 +59,8 @@ public class SysApplicationDto { private String systemAddress; //api接口参数表 private List apiParas; - + /** 系统类型 1、致远OA 2、用友U8C 3、用友BIP */ + private String appType; //数据源 private SysApplicationDatabaseEntity databaseEntity; private Integer pageNum; @@ -262,5 +263,13 @@ public class SysApplicationDto { public void setSystemAddress(String systemAddress) { this.systemAddress = systemAddress; } + + public String getAppType() { + return appType; + } + + public void setAppType(String appType) { + this.appType = appType; + } } diff --git a/service/src/main/java/com/hzya/frame/sysnew/application/entity/SysApplicationEntity.java b/service/src/main/java/com/hzya/frame/sysnew/application/entity/SysApplicationEntity.java index 0e9a8131..3eb1ff34 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/application/entity/SysApplicationEntity.java +++ b/service/src/main/java/com/hzya/frame/sysnew/application/entity/SysApplicationEntity.java @@ -43,6 +43,8 @@ public class SysApplicationEntity extends BaseEntity { /** 数据源是否启用(1、开启 2、关闭) */ private String dbStatus; + /** 系统类型 1、致远OA 2、用友U8C 3、用友BIP */ + private String appType; /** appid */ private Integer appId; /** ip白名单 */ @@ -191,5 +193,13 @@ public class SysApplicationEntity extends BaseEntity { public void setSystemAddress(String systemAddress) { this.systemAddress = systemAddress; } + + public String getAppType() { + return appType; + } + + public void setAppType(String appType) { + this.appType = appType; + } } diff --git a/service/src/main/java/com/hzya/frame/sysnew/application/entity/SysApplicationEntity.xml b/service/src/main/java/com/hzya/frame/sysnew/application/entity/SysApplicationEntity.xml index 2187fa57..63ca8873 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/application/entity/SysApplicationEntity.xml +++ b/service/src/main/java/com/hzya/frame/sysnew/application/entity/SysApplicationEntity.xml @@ -22,6 +22,7 @@ + @@ -51,7 +52,8 @@ ,interface_address ,interface_status ,db_status - ,sorts + ,app_type + ,sorts ,org_id ,sts ,create_time @@ -90,6 +92,7 @@ and interface_address = #{interfaceAddress} and interface_status = #{interfaceStatus} and db_status = #{dbStatus} + and app_type = #{appType} and sorts = #{sorts} and org_id = #{org_id} and sts = #{sts} @@ -126,6 +129,7 @@ and interface_address = #{interfaceAddress} and interface_status = #{interfaceStatus} and db_status = #{dbStatus} + and app_type = #{appType} and sorts = #{sorts} and org_id = #{org_id} and sts = #{sts} @@ -164,6 +168,7 @@ and interface_address like concat('%',#{interfaceAddress},'%') and interface_status like concat('%',#{interfaceStatus},'%') and db_status like concat('%',#{dbStatus},'%') + and app_type like concat('%',#{appType},'%') and sorts like concat('%',#{sorts},'%') and org_id like concat('%',#{org_id},'%') and sts like concat('%',#{sts},'%') @@ -202,6 +207,7 @@ or interface_address = #{interfaceAddress} or interface_status = #{interfaceStatus} or db_status = #{dbStatus} + or app_type = #{appType} or sorts = #{sorts} or org_id = #{org_id} or sts = #{sts} @@ -239,6 +245,7 @@ interface_address , interface_status , db_status , + app_type , sorts , org_id , sts , @@ -271,6 +278,7 @@ #{interfaceAddress} , #{interfaceStatus} , #{dbStatus} , + #{appType} , #{sorts} , #{org_id} , #{sts} , @@ -285,18 +293,18 @@ - insert into sys_application(app_logo, app_status, name, version_number, app_id, system_address, access_mode, affiliation_field, manufacturer, app_introduction, client_path, web_path, program_path, public_key, secret_key, interface_address, interface_status, db_status, sorts, org_id, sts, create_time, create_user_id, modify_time, modify_user_id, sts) + insert into sys_application(app_logo, app_status, name, version_number, app_id, system_address, access_mode, affiliation_field, manufacturer, app_introduction, client_path, web_path, program_path, public_key, secret_key, interface_address, interface_status, db_status,app_type, sorts, org_id, sts, create_time, create_user_id, modify_time, modify_user_id, sts) values - (#{entity.appLogo},#{entity.appStatus},#{entity.name},#{entity.versionNumber},#{entity.appId},#{entity.systemAddress},#{entity.accessMode},#{entity.affiliationField},#{entity.manufacturer},#{entity.appIntroduction},#{entity.clientPath},#{entity.webPath},#{entity.programPath},#{entity.publicKey},#{entity.secretKey},#{entity.interfaceAddress},#{entity.interfaceStatus},#{entity.dbStatus},#{entity.sorts},#{entity.org_id},#{entity.sts},#{entity.create_time},#{entity.create_user_id},#{entity.modify_time},#{entity.modify_user_id}, 'Y') + (#{entity.appLogo},#{entity.appStatus},#{entity.name},#{entity.versionNumber},#{entity.appId},#{entity.systemAddress},#{entity.accessMode},#{entity.affiliationField},#{entity.manufacturer},#{entity.appIntroduction},#{entity.clientPath},#{entity.webPath},#{entity.programPath},#{entity.publicKey},#{entity.secretKey},#{entity.interfaceAddress},#{entity.interfaceStatus},#{entity.dbStatus},#{entity.appType},#{entity.sorts},#{entity.org_id},#{entity.sts},#{entity.create_time},#{entity.create_user_id},#{entity.modify_time},#{entity.modify_user_id}, 'Y') - insert into sys_application(app_logo, app_status, name, version_number,app_id,system_address, access_mode, affiliation_field, manufacturer, app_introduction, client_path, web_path, program_path, public_key, secret_key, interface_address, interface_status, db_status, sorts, org_id, sts, create_time, create_user_id, modify_time, modify_user_id) + insert into sys_application(app_logo, app_status, name, version_number,app_id,system_address, access_mode, affiliation_field, manufacturer, app_introduction, client_path, web_path, program_path, public_key, secret_key, interface_address, interface_status, db_status,app_type, sorts, org_id, sts, create_time, create_user_id, modify_time, modify_user_id) values - (#{entity.appLogo},#{entity.appStatus},#{entity.name},#{entity.versionNumber},#{entity.appId},#{entity.systemAddress},#{entity.accessMode},#{entity.affiliationField},#{entity.manufacturer},#{entity.appIntroduction},#{entity.clientPath},#{entity.webPath},#{entity.programPath},#{entity.publicKey},#{entity.secretKey},#{entity.interfaceAddress},#{entity.interfaceStatus},#{entity.dbStatus},#{entity.sorts},#{entity.org_id},#{entity.sts},#{entity.create_time},#{entity.create_user_id},#{entity.modify_time},#{entity.modify_user_id}) + (#{entity.appLogo},#{entity.appStatus},#{entity.name},#{entity.versionNumber},#{entity.appId},#{entity.systemAddress},#{entity.accessMode},#{entity.affiliationField},#{entity.manufacturer},#{entity.appIntroduction},#{entity.clientPath},#{entity.webPath},#{entity.programPath},#{entity.publicKey},#{entity.secretKey},#{entity.interfaceAddress},#{entity.interfaceStatus},#{entity.dbStatus},#{entity.appType},#{entity.sorts},#{entity.org_id},#{entity.sts},#{entity.create_time},#{entity.create_user_id},#{entity.modify_time},#{entity.modify_user_id}) on duplicate key update app_logo = values(app_logo), @@ -317,6 +325,7 @@ interface_address = values(interface_address), interface_status = values(interface_status), db_status = values(db_status), + app_type = values(app_type), sorts = values(sorts), org_id = values(org_id), sts = values(sts), @@ -346,6 +355,7 @@ update sys_application set interface_address = #{interfaceAddress}, interface_status = #{interfaceStatus}, db_status = #{dbStatus}, + app_type = #{appType}, sorts = #{sorts}, org_id = #{org_id}, sts = #{sts}, @@ -384,6 +394,7 @@ update sys_application set sts= 'N' ,modify_time = #{modify_time},modify_user_i and interface_address = #{interfaceAddress} and interface_status = #{interfaceStatus} and db_status = #{dbStatus} + and app_type = #{appType} and sorts = #{sorts} and sts = #{sts} and sts='Y' @@ -411,6 +422,7 @@ update sys_application set sts= 'N' ,modify_time = #{modify_time},modify_user_i ,a.app_introduction as appIntroduction ,a.interface_status as interfaceStatus ,a.db_status as dbStatus + ,a.app_type as appType from sys_application a and a.affiliation_field = #{affiliationField} diff --git a/service/src/main/java/com/hzya/frame/sysnew/application/entity/SysApplicationVo.java b/service/src/main/java/com/hzya/frame/sysnew/application/entity/SysApplicationVo.java index cb3bf8a6..2d6670ef 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/application/entity/SysApplicationVo.java +++ b/service/src/main/java/com/hzya/frame/sysnew/application/entity/SysApplicationVo.java @@ -37,6 +37,8 @@ public class SysApplicationVo { /** 应用是否启用(1、启用 2、停用) */ private String appStatus; + /** 系统类型 1、致远OA 2、用友U8C 3、用友BIP */ + private String appType; public String getId() { return id; } @@ -148,5 +150,13 @@ public class SysApplicationVo { public void setSystemAddress(String systemAddress) { this.systemAddress = systemAddress; } + + public String getAppType() { + return appType; + } + + public void setAppType(String appType) { + this.appType = appType; + } } From 2d4b3af64c684b089b20673d3589b8771e1ea28e Mon Sep 17 00:00:00 2001 From: lvleigang <957075182@qq.com> Date: Tue, 18 Jun 2024 17:17:11 +0800 Subject: [PATCH 64/80] =?UTF-8?q?=E4=B8=BB=E6=95=B0=E6=8D=AE=E4=B8=8B?= =?UTF-8?q?=E5=8F=91=EF=BC=8C=E9=87=8D=E6=96=B0=E5=8F=91=E9=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../plugin/MdmModulePluginInitializer.java | 42 ++++++++++++------- .../api/entity/SysApplicationApiEntity.xml | 4 +- .../service/IGroovyIntegrationService.java | 3 +- .../impl/GroovyIntegrationServiceImpl.java | 5 ++- 4 files changed, 35 insertions(+), 19 deletions(-) diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/mdmDistribute/plugin/MdmModulePluginInitializer.java b/buildpackage/src/main/java/com/hzya/frame/plugin/mdmDistribute/plugin/MdmModulePluginInitializer.java index a4e83262..e8e9d374 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/mdmDistribute/plugin/MdmModulePluginInitializer.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/mdmDistribute/plugin/MdmModulePluginInitializer.java @@ -18,6 +18,7 @@ import com.hzya.frame.sysnew.application.api.dao.ISysApplicationApiDao; import com.hzya.frame.sysnew.application.api.entity.SysApplicationApiEntity; import com.hzya.frame.sysnew.application.dao.ISysApplicationDao; import com.hzya.frame.sysnew.application.entity.SysApplicationEntity; +import com.hzya.frame.sysnew.application.entity.SysExtensionApiEntity; import com.hzya.frame.sysnew.application.script.dao.ISysApplicationScriptDao; import com.hzya.frame.sysnew.application.script.entity.SysApplicationScriptEntity; import com.hzya.frame.sysnew.grovy.service.IGroovyIntegrationService; @@ -118,6 +119,7 @@ public class MdmModulePluginInitializer extends PluginBaseEntity { if (null != requestJson) { //如果这个id不为空,说明是重试的 String id = requestJson.getString("integration_task_living_details_id"); + //执行重新发送 if (StrUtil.isNotEmpty(id)) { //查询日志表 IntegrationTaskLivingDetailsEntity taskDetailEntity = taskLivingDetailsService.get(id); @@ -298,27 +300,33 @@ public class MdmModulePluginInitializer extends PluginBaseEntity { //执行脚本 JSONObject groovy = new JSONObject(); JSONObject parameterJson = new JSONObject(); - parameterJson.put("header",apiEntity.getHeaderInValue()); - //parameterJson.put("body",apiEntity.getBodyIn()); + parameterJson.put("header",apiEntity.getHeaderIn()); + parameterJson.put("body",apiEntity.getBodyIn()); + parameterJson.put("query",apiEntity.getQueryIn()); parameterJson.put("data",object); + /** head */ + Map header = null; + /** query */ + String querys = null; + /** body */ + String bodys = object.toJSONString(); if(scriptEntity != null && scriptEntity.getId() != null ){ groovy.put("code",scriptEntity.getScriptCode()); groovy.put("className",scriptEntity.getClassName()); groovy.put("name",scriptEntity.getScriptName()); groovy.put("methodStr",scriptEntity.getScriptData()); groovy.put("parameterJson",parameterJson); + JSONObject groovyStr = new JSONObject(); + groovyStr.put("jsonStr",groovy); try { - JsonResultEntity jsonResultEntity = groovyIntegrationService.groovyScriptExecution(groovy); - if(!jsonResultEntity.isFlag()){ - taskDetailEntity.setResult("分发脚本转换错误"); - taskLivingDetailsService.updateLogFailToSuccess(taskDetailEntity); - return BaseResult.getFailureMessageEntity("分发脚本转换错误"); - } - JSONObject returnGroovy = JSONObject.parseObject(jsonResultEntity.getAttribute().toString()); + SysExtensionApiEntity jsonResultEntity = groovyIntegrationService.groovyScriptExecution(groovy); + header = jsonResultEntity.getHeaders(); + querys = jsonResultEntity.getQuerys(); + bodys = jsonResultEntity.getBodys(); }catch (Exception e){ taskDetailEntity.setResult("分发脚本转换错误"); taskLivingDetailsService.updateLogFailToSuccess(taskDetailEntity); - return BaseResult.getFailureMessageEntity("分发脚本转换错误"); + //return BaseResult.getFailureMessageEntity("分发脚本转换错误"); } } Map headers = new HashMap<>(); @@ -326,8 +334,11 @@ public class MdmModulePluginInitializer extends PluginBaseEntity { headers.put("secretKey","fviZnLBsQUAGF8w8FSOdJi7XlIm/XAZclMxRagDLfTyJFlvnIBF3w66Hrpfzs8cYj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA="); headers.put("appId",sysApplicationEntity.getAppId().toString()); headers.put("apiCode",apiEntity.getApiCode().toString()); + if(header != null){ + headers.putAll(header); + } //组装数据发送 - JsonResultEntity jsonResultEntity = sendData(apiEntity,headers,object.toJSONString()); + JsonResultEntity jsonResultEntity = sendData(apiEntity,headers,bodys,querys); if(jsonResultEntity.isFlag()){ taskDetailEntity.setResult("发送成功"); taskLivingDetailsService.saveLogFailToSuccess(taskDetailEntity); @@ -339,7 +350,7 @@ public class MdmModulePluginInitializer extends PluginBaseEntity { } } }else { - //执行正常逻辑 + //执行正常下发 } @@ -352,9 +363,12 @@ public class MdmModulePluginInitializer extends PluginBaseEntity { return BaseResult.getSuccessMessageEntity("执行成功"); } - private JsonResultEntity sendData(SysApplicationApiEntity applicationApiEntity, Map headers ,String bodys ) { + private JsonResultEntity sendData(SysApplicationApiEntity applicationApiEntity, Map headers ,String bodys ,String querys) { StringBuffer urls = new StringBuffer(url); - + if (querys != null) { + urls.append("?"); + urls.append(querys); + } HttpClientBuilder httpClientBuilder = HttpClientBuilder.create(); // HttpClient CloseableHttpClient closeableHttpClient = httpClientBuilder.disableCookieManagement().build(); diff --git a/service/src/main/java/com/hzya/frame/sysnew/application/api/entity/SysApplicationApiEntity.xml b/service/src/main/java/com/hzya/frame/sysnew/application/api/entity/SysApplicationApiEntity.xml index f6596703..3b543b9a 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/application/api/entity/SysApplicationApiEntity.xml +++ b/service/src/main/java/com/hzya/frame/sysnew/application/api/entity/SysApplicationApiEntity.xml @@ -85,7 +85,7 @@ a.id, a.api_status, b.name as app_name, - b.interfaceAddress as app_url, + b.interface_address as app_url, a.app_id, a.catalogue_id, c.name as catalogue_name, @@ -704,7 +704,7 @@ where id = #{id} - select a.id, a.catalogue_id AS catalogueId, diff --git a/service/src/main/java/com/hzya/frame/sysnew/grovy/service/IGroovyIntegrationService.java b/service/src/main/java/com/hzya/frame/sysnew/grovy/service/IGroovyIntegrationService.java index c28bd496..ae475ac4 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/grovy/service/IGroovyIntegrationService.java +++ b/service/src/main/java/com/hzya/frame/sysnew/grovy/service/IGroovyIntegrationService.java @@ -1,6 +1,7 @@ package com.hzya.frame.sysnew.grovy.service; import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.sysnew.application.entity.SysExtensionApiEntity; import com.hzya.frame.web.entity.JsonResultEntity; /** @@ -21,5 +22,5 @@ public interface IGroovyIntegrationService { * @param jsonObject 请求参数对象 * @return com.hzya.frame.web.entity.JsonResultEntity **/ - JsonResultEntity groovyScriptExecution(JSONObject jsonObject); + SysExtensionApiEntity groovyScriptExecution(JSONObject jsonObject); } 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 580c718c..3cc6c067 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 @@ -2,6 +2,7 @@ package com.hzya.frame.sysnew.grovy.service.impl; import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.sysnew.application.entity.SysExtensionApiEntity; import com.hzya.frame.sysnew.grovy.service.IGroovyIntegrationService; import com.hzya.frame.util.GroovyUtil; import com.hzya.frame.web.entity.BaseResult; @@ -44,8 +45,8 @@ public class GroovyIntegrationServiceImpl implements IGroovyIntegrationService { } @Override - public JsonResultEntity groovyScriptExecution(JSONObject jsonObject) { + public SysExtensionApiEntity groovyScriptExecution(JSONObject jsonObject) { Object object = GroovyUtil.execute(jsonObject); - return BaseResult.getSuccessMessageEntity(object); + return new SysExtensionApiEntity(); } } From 7fa07577f0f0cd4a1880e8f63820bfeb3306a5ac Mon Sep 17 00:00:00 2001 From: "476474485@qq.com" Date: Wed, 19 Jun 2024 09:54:19 +0800 Subject: [PATCH 65/80] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=BD=AC=E5=8F=91?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E6=94=AF=E6=8C=81byteBodys?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/ISysApplicationService.java | 10 + .../impl/SysApplicationServiceImpl.java | 394 ++++++++++++++++-- .../controler/EntranceController.java | 6 +- 3 files changed, 385 insertions(+), 25 deletions(-) diff --git a/service/src/main/java/com/hzya/frame/sysnew/application/service/ISysApplicationService.java b/service/src/main/java/com/hzya/frame/sysnew/application/service/ISysApplicationService.java index ad1077cf..e1f3290a 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/application/service/ISysApplicationService.java +++ b/service/src/main/java/com/hzya/frame/sysnew/application/service/ISysApplicationService.java @@ -417,4 +417,14 @@ public interface ISysApplicationService extends IBaseService oldheaderMap = ServletUtil.getHeaderMap(request); + String oldquerys = request.getQueryString(); + //应用key + String publicKey = request.getHeader("publicKey"); + //应用密钥 + String secretKey = request.getHeader("secretKey"); + //appId + String appId = request.getHeader("appId"); + //apiCode + String apiCode = request.getHeader("apiCode"); + + String ip = IPHelper.getIpAddr(request); + if (publicKey == null || "".equals(publicKey)) { + return BaseResult.getFailureMessageEntity("请先传递公钥"); + } + if (secretKey == null || "".equals(secretKey)) { + return BaseResult.getFailureMessageEntity("请先传递密钥"); + } + if (appId == null || "".equals(appId)) { + return BaseResult.getFailureMessageEntity("请先传递接收方应用"); + } + if (apiCode == null || "".equals(apiCode)) { + return BaseResult.getFailureMessageEntity("请先传递发送接口"); + } + + logger.info("请求参数:publicKey:【" + publicKey + "】secretKey:【" + secretKey + "】appId:【" + appId + "】apiCode:【" + apiCode); + //根据请求a应用的公钥、密钥是否能查找到一条数据 + + SysApplicationEntity sendApp = getAppByPublicKeySecretKey(publicKey, secretKey); + if (sendApp == null) { + //saveLog(new SysApplicationEntity(), new SysApplicationEntity(), new SysApplicationApiEntity(), oldbodys, null, oldheaderMap, null, null, oldquerys, null, null, false,"公钥、密钥错误"); + return BaseResult.getFailureMessageEntity("公钥、密钥错误,请联系管理员"); + } + //判断应用是否启用 + if (sendApp.getAppStatus() == null || !"1".equals(sendApp.getAppStatus())) { + saveLog(sendApp, new SysApplicationEntity(), new SysApplicationApiEntity(), oldbodys, null, oldheaderMap, null, null, oldquerys, null, null, false,sendApp.getName() + "应用未启用"); + return BaseResult.getFailureMessageEntity(sendApp.getName() + "应用未启用,请联系管理员"); + } + + + SysApplicationEntity receiveApp = getAppByAppId(appId); + if (receiveApp == null) { + saveLog(sendApp, new SysApplicationEntity(), new SysApplicationApiEntity(), oldbodys, null, oldheaderMap, null, null, oldquerys, null, null, false,"根据appId:" + appId + "未匹配到应用"); + return BaseResult.getFailureMessageEntity("根据appId:" + appId + "未匹配到应用,请联系管理员"); + } + //判断应用是否启用 + if (receiveApp.getAppStatus() == null || !"1".equals(receiveApp.getAppStatus())) { + saveLog(sendApp, receiveApp, new SysApplicationApiEntity(), oldbodys, null, oldheaderMap, null, null, oldquerys, null, null, false,receiveApp.getName() + "应用未启用" ); + return BaseResult.getFailureMessageEntity(receiveApp.getName() + "应用未启用,请联系管理员"); + } + //判断应用接口是否启用 + if (receiveApp.getInterfaceStatus() == null || !"1".equals(receiveApp.getInterfaceStatus())) { + saveLog(sendApp, receiveApp, new SysApplicationApiEntity(), oldbodys, null, oldheaderMap, null, null, oldquerys, null, null, false,receiveApp.getName() + "应用接口环境未启用" ); + return BaseResult.getFailureMessageEntity(receiveApp.getName() + "应用接口环境未启用,请联系管理员"); + } + + SysApplicationApiEntity receiveApi = getApiByAppIdApiCode(receiveApp.getId(), apiCode); + if (receiveApi == null) { + saveLog(sendApp, receiveApp, receiveApi, oldbodys, null, oldheaderMap, null, null, oldquerys, null, null, false,receiveApp.getName() + ":" + apiCode + "未启用或者未创建" ); + return BaseResult.getFailureMessageEntity(receiveApp.getName() + ":" + apiCode + "未启用或者未创建"); + } + + SysApplicationApiAuthEntity sysApplicationApiAuthEntity = getApiAuthByNameAppId(sendApp.getId(), receiveApp.getId()); + if (sysApplicationApiAuthEntity == null) { + saveLog(sendApp, receiveApp, receiveApi, oldbodys, null, oldheaderMap, null, null, oldquerys, null, null, false,receiveApp.getName() + "应用权限配置错误" ); + return BaseResult.getFailureMessageEntity(receiveApp.getName() + "应用权限配置错误"); + } + if (sysApplicationApiAuthEntity.getSystemAddress() != null && !"".equals(sysApplicationApiAuthEntity.getSystemAddress()) + && !sysApplicationApiAuthEntity.getSystemAddress().contains(ip)) { + saveLog(sendApp, receiveApp, receiveApi, oldbodys, null, oldheaderMap, null, null, oldquerys, null, null, false,receiveApp.getName() + "发送应用" + receiveApp.getName() + "的ip白名单配置错误" ); + return BaseResult.getFailureMessageEntity(receiveApp.getName() + "发送应用" + receiveApp.getName() + "的ip白名单配置错误"); + } + + SysApplicationApiAuthDetailEntity sysApplicationApiAuthDetailEntity = getApiAuthDetailByAppIdApiIdTripartiteSystemId(receiveApp.getId(), receiveApi.getId(), sysApplicationApiAuthEntity.getId()); + if (sysApplicationApiAuthDetailEntity == null) { + saveLog(sendApp, receiveApp, receiveApi, oldbodys, null, oldheaderMap, null, null, oldquerys, null, null, false,receiveApi.getApiName() + "未授权给" + sendApp.getName() ); + return BaseResult.getFailureMessageEntity(receiveApi.getApiName() + "未授权给" + sendApp.getName() + ",请联系管理员"); + } + SysExtensionApiEntity sysExtensionApiEntity = new SysExtensionApiEntity(); + + + List a = Arrays.asList(new String[]{"apicode", "appid", "secretkey", "publickey", "x-forwarded-for", "cookie", "x-forwarded-proto", "x-real-ip", "content-length", "accept-language", "host", "content-type", "connection", "cache-control", "accept-encoding", "pragma", "accept", "user-agent"}); + Map headers = new HashMap<>(); + if (receiveApi.getHeaderIn() != null && !"".equals(receiveApi.getHeaderIn())) { + JSONArray jsonArray = JSONArray.parseArray(receiveApi.getHeaderIn()); + if (jsonArray != null && jsonArray.size() > 0) { + for (int i = 0; i < jsonArray.size(); i++) { + JSONObject object1 = jsonArray.getJSONObject(i); + headers.put(object1.getString("parameterName"), object1.getString("example")); + } + } + } + if (oldheaderMap != null && oldheaderMap.size() > 0) { + for (Map.Entry entry : oldheaderMap.entrySet()) { + if (!a.contains(entry.getKey())) { + headers.put(entry.getKey(), entry.getValue()); + } + } + } + + + + sysExtensionApiEntity.setSendApp(sendApp); + sysExtensionApiEntity.setReceiveApp(receiveApp); + sysExtensionApiEntity.setReceiveApi(receiveApi); + sysExtensionApiEntity.setHeaders(headers); + sysExtensionApiEntity.setQuerys(oldquerys); + sysExtensionApiEntity.setBodys(oldbodys); + Method[] methods = null; + Object object = null; + + + + + // 判断是否有内部api 是否扩展api 1、启用 2、停用 + if (receiveApi.getExtensionApi() != null && "1".equals(receiveApi.getExtensionApi()) + && receiveApi.getBeanName() != null && !"".equals(receiveApi.getBeanName()) + && receiveApi.getFunName() != null && !"".equals(receiveApi.getFunName()) + ) { + //获取类 + try { + object = ApplicationContextUtil.getBeanByName(receiveApi.getBeanName()); + } catch (SecurityException e) { + + } + //获取类下面的方法 + methods = object.getClass().getMethods(); + if (methods == null || methods.length == 0) { + return BaseResult.getFailureMessageEntity("未找到内部方法,请联系管理员"); + } + for (Method m : methods) { + if (null != m) { + if (m.getName().equals(receiveApi.getFunName().trim())) { + try { + logger.info("invoke开始>>>>>>>>>>>>>>>>>>>>>>>>>>>>"); + sysExtensionApiEntity = (SysExtensionApiEntity) m.invoke(object, sysExtensionApiEntity); + logger.info("invoke结束>>>>>>>>>>>>>>>>>>>>>>>>>>>>"); + } catch (Exception e) { + logger.error("invokeException{}", e.getMessage()); + return BaseResult.getFailureMessageEntity("内部方法执行错误,请联系管理员"); + } + } + } + } + + } + headers = sysExtensionApiEntity.getHeaders(); + String querys = sysExtensionApiEntity.getQuerys(); + + byte[] byteBodys = sysExtensionApiEntity.getByteBodys(); + //设置参数获取参数 + StringBuffer url = new StringBuffer(); + if(!receiveApi.getDestinationAddress().toLowerCase().startsWith("http")){ + url.append(receiveApp.getInterfaceAddress()); + } + url.append(receiveApi.getDestinationAddress()); + if (querys != null) { + url.append("?"); + url.append(querys); + } + Integer outTime = 6000; + if (receiveApi.getTimeoutPeriod() != null && !"".equals(receiveApi.getTimeoutPeriod())) { + outTime = Integer.valueOf(receiveApi.getTimeoutPeriod()); + } + //1、POST 2、GET + String method = "POST"; + if ("2".equals(receiveApi.getRequestMethod())) { + method = "GET"; + } + //List a = Arrays.asList(new String[]{"apicode", "appid", "secretkey", "publickey", "x-forwarded-for", "cookie", "x-forwarded-proto", "x-real-ip", "content-length", "accept-language", "host", "content-type", "connection", "cache-control", "accept-encoding", "pragma", "accept", "user-agent"}); + //Map headers = new HashMap<>(); + //if (receiveApi.getHeaderIn() != null && !"".equals(receiveApi.getHeaderIn())) { + // JSONArray jsonArray = JSONArray.parseArray(receiveApi.getHeaderIn()); + // if (jsonArray != null && jsonArray.size() > 0) { + // for (int i = 0; i < jsonArray.size(); i++) { + // JSONObject object1 = jsonArray.getJSONObject(i); + // headers.put(object1.getString("parameterName"), object1.getString("example")); + // } + // } + //} + //if (headerMap != null && headerMap.size() > 0) { + // for (Map.Entry entry : headerMap.entrySet()) { + // if (!a.contains(entry.getKey())) { + // headers.put(entry.getKey(), entry.getValue()); + // } + // } + //} + + + if ("POST".equals(method)) { + HttpClientBuilder httpClientBuilder = HttpClientBuilder.create(); + // HttpClient + CloseableHttpClient closeableHttpClient = httpClientBuilder.disableCookieManagement().build(); + HttpPost post = new HttpPost(url.toString()); + CloseableHttpResponse response = null; + + RequestConfig requestConfig = RequestConfig.custom().setConnectTimeout(outTime).build(); + post.setConfig(requestConfig);//设置请求参数【超时时间】 + + if (headers != null && headers.size() > 0) { + for (String key : headers.keySet()) { + post.setHeader(key, headers.get(key)); + } + } + StringBuilder body = new StringBuilder(); + boolean flag = true; + try { + if (byteBodys != null && !"".equals(byteBodys)) { + ByteArrayEntity entity = new ByteArrayEntity(byteBodys); + entity.setContentType("application/json"); + post.setEntity(entity); + } + response = closeableHttpClient.execute(post); + + HttpEntity entity = response.getEntity(); + synchronized (lock) { + body.append(EntityUtils.toString(entity,"UTF-8")); + } + flag = true; + logger.info("返回结果:" + body); + } catch (Exception e) { + logger.error("请求错误:" + e.getMessage()); + body.append(e.getMessage()); + flag = false; + } finally { + try { + // 关闭响应对象 + if (response != null) { + response.close(); + } + // 关闭响应对象 + if (closeableHttpClient != null) { + closeableHttpClient.close(); + } + } catch (IOException e) { + e.printStackTrace(); + } + + } + logger.info("保存日志开始"); + SysMessageManageLogEntity sysMessageManageLogEntity = saveLog(sendApp, receiveApp, receiveApi, oldbodys,String.valueOf(byteBodys), oldheaderMap,headers, headers, oldquerys,querys, body.toString(),true,null); + if (methods != null && methods.length > 0) { + for (Method m : methods) { + if (null != m) { + if (m.getName().equals(receiveApi.getFunName().trim()+"CallBack")) { + try { + logger.info("invoke开始>>>>>>>>>>>>>>>>>>>>>>>>>>>>"); + m.invoke(object, sysMessageManageLogEntity); + logger.info("invoke结束>>>>>>>>>>>>>>>>>>>>>>>>>>>>"); + } catch (Exception e) { + logger.error("invokeException{}", e.getMessage()); + } + } + } + } + } + logger.info("保存日志结束"); + if (flag) { + if (JSONUtil.isTypeJSON(body.toString())) { + JSONObject jsonObject = JSONObject.parseObject(body.toString()); + if(sysMessageManageLogEntity.getStatus() != null && "3".equals(sysMessageManageLogEntity.getStatus())){ + return BaseResult.getSuccessMessageEntity("转发成功", jsonObject); + }else { + return BaseResult.getFailureMessageEntity("转发失败", jsonObject); + } + } else { + if(sysMessageManageLogEntity.getStatus() != null && "3".equals(sysMessageManageLogEntity.getStatus())){ + return BaseResult.getSuccessMessageEntity("转发成功", body); + }else { + return BaseResult.getFailureMessageEntity("转发失败", body); + } + } + } else { + return BaseResult.getFailureMessageEntity("转发失败", body); + } + + } else {//GET + + HttpClientBuilder httpClientBuilder = HttpClientBuilder.create(); + // HttpClient + CloseableHttpClient closeableHttpClient = httpClientBuilder.disableCookieManagement().build(); + HttpGet get = new HttpGet(url.toString()); + CloseableHttpResponse response = null; + + RequestConfig requestConfig = RequestConfig.custom().setConnectTimeout(outTime).build(); + get.setConfig(requestConfig);//设置请求参数【超时时间】 + if (headers != null && headers.size() > 0) { + for (String key : headers.keySet()) { + get.setHeader(key, headers.get(key)); + } + } + StringBuilder body = new StringBuilder(); + + boolean flag = true; + try { + response = closeableHttpClient.execute(get); + HttpEntity entity = response.getEntity(); + synchronized (lock) { + body.append(EntityUtils.toString(entity,"UTF-8")); + } + flag = true; + logger.info("返回结果:" + body); + } catch (Exception e) { + logger.error("请求错误:" + e.getMessage()); + body.append(e.getMessage()); + flag = false; + } finally { + try { + // 关闭响应对象 + if (response != null) { + response.close(); + } + // 关闭响应对象 + if (closeableHttpClient != null) { + closeableHttpClient.close(); + } + } catch (IOException e) { + e.printStackTrace(); + } + } + logger.info("保存日志开始"); + SysMessageManageLogEntity sysMessageManageLogEntity = saveLog(sendApp, receiveApp, receiveApi, oldbodys,String.valueOf(byteBodys), oldheaderMap,headers, headers, oldquerys,querys, body.toString(), true,null); + if (methods != null && methods.length > 0) { + for (Method m : methods) { + if (null != m) { + if (m.getName().equals(receiveApi.getFunName().trim()+"CallBack")) { + try { + logger.info("invoke开始>>>>>>>>>>>>>>>>>>>>>>>>>>>>"); + m.invoke(object, sysMessageManageLogEntity); + logger.info("invoke结束>>>>>>>>>>>>>>>>>>>>>>>>>>>>"); + } catch (Exception e) { + logger.error("invokeException{}", e.getMessage()); + } + } + } + } + } + logger.info("保存日志结束"); + if (flag) { + if (JSONUtil.isTypeJSON(body.toString())) { + JSONObject jsonObject = JSONObject.parseObject(body.toString()); + if(sysMessageManageLogEntity.getStatus() != null && "3".equals(sysMessageManageLogEntity.getStatus())){ + return BaseResult.getSuccessMessageEntity("转发成功", jsonObject); + }else { + return BaseResult.getFailureMessageEntity("转发失败", jsonObject); + } + } else { + if(sysMessageManageLogEntity.getStatus() != null && "3".equals(sysMessageManageLogEntity.getStatus())){ + return BaseResult.getSuccessMessageEntity("转发成功", body); + }else { + return BaseResult.getFailureMessageEntity("转发失败", body); + } + } + } else { + return BaseResult.getFailureMessageEntity("转发失败", body); + } + } + } } diff --git a/webapp/src/main/java/com/hzya/frame/webapp/entrance/controler/EntranceController.java b/webapp/src/main/java/com/hzya/frame/webapp/entrance/controler/EntranceController.java index 0ae99bfc..9b994348 100644 --- a/webapp/src/main/java/com/hzya/frame/webapp/entrance/controler/EntranceController.java +++ b/webapp/src/main/java/com/hzya/frame/webapp/entrance/controler/EntranceController.java @@ -164,5 +164,9 @@ public class EntranceController { public JsonResultEntity externalCallInterface(ServletRequest servletRequest, ServletResponse servletResponse) throws Exception { return sysApplicationService.externalCallInterface(servletRequest,servletResponse); } - + @RequestMapping(value = "/externalCallInterface") + @ResponseBody + public JsonResultEntity externalCallInterfaceToESB(ServletRequest servletRequest, ServletResponse servletResponse) throws Exception { + return sysApplicationService.externalCallInterfaceToESB(servletRequest,servletResponse); + } } From f645cb96db1d34bf3cc3523348c04ec0d3f06bbc Mon Sep 17 00:00:00 2001 From: "476474485@qq.com" Date: Wed, 19 Jun 2024 10:03:46 +0800 Subject: [PATCH 66/80] =?UTF-8?q?=E5=A2=9E=E5=8A=A0byte=E6=95=B0=E7=BB=84?= =?UTF-8?q?=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../application/entity/SysExtensionApiEntity.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/service/src/main/java/com/hzya/frame/sysnew/application/entity/SysExtensionApiEntity.java b/service/src/main/java/com/hzya/frame/sysnew/application/entity/SysExtensionApiEntity.java index 7668e887..baff9a85 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/application/entity/SysExtensionApiEntity.java +++ b/service/src/main/java/com/hzya/frame/sysnew/application/entity/SysExtensionApiEntity.java @@ -13,6 +13,8 @@ public class SysExtensionApiEntity { private String querys; /** body */ private String bodys; + //byteBodys + private byte[] byteBodys; /** 发送方应用 */ private SysApplicationEntity sendApp; /** 接收方应用 */ @@ -67,5 +69,13 @@ public class SysExtensionApiEntity { public void setReceiveApi(SysApplicationApiEntity receiveApi) { this.receiveApi = receiveApi; } + + public byte[] getByteBodys() { + return byteBodys; + } + + public void setByteBodys(byte[] byteBodys) { + this.byteBodys = byteBodys; + } } From 73c5eb06cfc515ed275a624ef535715b36857f41 Mon Sep 17 00:00:00 2001 From: "476474485@qq.com" Date: Wed, 19 Jun 2024 10:10:22 +0800 Subject: [PATCH 67/80] =?UTF-8?q?=E5=A2=9E=E5=8A=A0externalCallInterfaceTo?= =?UTF-8?q?ESB=E6=96=B9=E6=B3=95=E5=85=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../frame/webapp/entrance/controler/EntranceController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webapp/src/main/java/com/hzya/frame/webapp/entrance/controler/EntranceController.java b/webapp/src/main/java/com/hzya/frame/webapp/entrance/controler/EntranceController.java index 9b994348..3fab59ec 100644 --- a/webapp/src/main/java/com/hzya/frame/webapp/entrance/controler/EntranceController.java +++ b/webapp/src/main/java/com/hzya/frame/webapp/entrance/controler/EntranceController.java @@ -164,7 +164,7 @@ public class EntranceController { public JsonResultEntity externalCallInterface(ServletRequest servletRequest, ServletResponse servletResponse) throws Exception { return sysApplicationService.externalCallInterface(servletRequest,servletResponse); } - @RequestMapping(value = "/externalCallInterface") + @RequestMapping(value = "/externalCallInterfaceToESB") @ResponseBody public JsonResultEntity externalCallInterfaceToESB(ServletRequest servletRequest, ServletResponse servletResponse) throws Exception { return sysApplicationService.externalCallInterfaceToESB(servletRequest,servletResponse); From 0ba8aebf25e2ee3b7f37c2e0e899f8e45d22e7d3 Mon Sep 17 00:00:00 2001 From: lvleigang <957075182@qq.com> Date: Wed, 19 Jun 2024 10:16:47 +0800 Subject: [PATCH 68/80] =?UTF-8?q?=E4=B8=BB=E6=95=B0=E6=8D=AE=E4=B8=8B?= =?UTF-8?q?=E5=8F=91=EF=BC=8C=E9=87=8D=E6=96=B0=E5=8F=91=E9=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../plugin/MdmModulePluginInitializer.java | 33 +++++-- .../mdm/mdmModule/dao/IMdmModuleDao.java | 2 +- .../mdmModule/dao/impl/MdmModuleDaoImpl.java | 2 +- .../mdm/mdmModule/entity/MdmModuleEntity.xml | 30 ++++++ .../service/impl/MdmModuleServiceImpl.java | 17 ++++ .../entity/MdmModuleOptionLogEntity.java | 9 ++ .../entity/MdmModuleOptionLogEntity.xml | 21 ++++- .../dao/IMdmModuleSourceDao.java | 12 +-- .../dao/impl/MdmModuleSourceDaoImpl.java | 5 +- .../entity/MdmModuleSourceEntity.java | 57 +++++++++++- .../entity/MdmModuleSourceEntity.xml | 91 +++++++++++++++---- .../service/IMdmModuleSourceService.java | 2 +- .../impl/MdmModuleSourceServiceImpl.java | 2 +- 13 files changed, 235 insertions(+), 48 deletions(-) diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/mdmDistribute/plugin/MdmModulePluginInitializer.java b/buildpackage/src/main/java/com/hzya/frame/plugin/mdmDistribute/plugin/MdmModulePluginInitializer.java index e8e9d374..52b75b12 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/mdmDistribute/plugin/MdmModulePluginInitializer.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/mdmDistribute/plugin/MdmModulePluginInitializer.java @@ -13,6 +13,8 @@ import com.hzya.frame.mdm.mdmModuleDbFiledsRule.dao.IMdmModuleDbFiledsRuleDao; import com.hzya.frame.mdm.mdmModuleDbFiledsRule.entity.MdmModuleDbFiledsRuleEntity; import com.hzya.frame.mdm.mdmModuleDistribute.dao.IMdmModuleDistributeDao; import com.hzya.frame.mdm.mdmModuleDistribute.entity.MdmModuleDistributeEntity; +import com.hzya.frame.mdm.mdmModuleDistributeDetail.dao.IMdmModuleDistributeDetailDao; +import com.hzya.frame.mdm.mdmModuleDistributeDetail.entity.MdmModuleDistributeDetailEntity; import com.hzya.frame.mdm.service.IMdmServiceCache; import com.hzya.frame.sysnew.application.api.dao.ISysApplicationApiDao; import com.hzya.frame.sysnew.application.api.entity.SysApplicationApiEntity; @@ -57,7 +59,7 @@ import java.util.Map; public class MdmModulePluginInitializer extends PluginBaseEntity { Logger logger = LoggerFactory.getLogger(MdmModulePluginInitializer.class); @Resource - private IIntegrationTaskLivingDetailsDao integrationTaskLivingDetailsDao; + private IMdmModuleDistributeDetailDao mdmModuleDistributeDetailDao; @Resource private IIntegrationTaskLivingDetailsService taskLivingDetailsService; @Resource @@ -176,6 +178,11 @@ public class MdmModulePluginInitializer extends PluginBaseEntity { return BaseResult.getFailureMessageEntity("分发已停用"); } + MdmModuleDistributeDetailEntity mdmModuleDistributeDetailEntity = new MdmModuleDistributeDetailEntity() ; + mdmModuleDistributeDetailEntity.setDistributeId(distributeId); + mdmModuleDistributeDetailEntity.setSts("Y"); + List mdmModuleDistributeDetailEntities = mdmModuleDistributeDetailDao.queryBase(mdmModuleDistributeDetailEntity); + // 启用停用 0、停用 //if("1".equals(mdmModuleDistributeEntity.getEnabledType())){ // taskDetailEntity.setResult("分发为手动下发"); @@ -221,7 +228,6 @@ public class MdmModulePluginInitializer extends PluginBaseEntity { taskDetailEntity.setResult("应用不存在"); taskLivingDetailsService.updateLogFailToSuccess(taskDetailEntity); return BaseResult.getFailureMessageEntity("应用不存在"); - } //获取主数据db字段,以及字段的规则 @@ -232,11 +238,12 @@ public class MdmModulePluginInitializer extends PluginBaseEntity { queryFildRule.setMdmId(mdmModuleEntity.getId()); queryFildRule.setRuleCode("service"); List mdmModuleDbFiledsRuleEntities = mdmModuleDbFiledsRuleDao.queryBase(queryFildRule); + //获取主数据db对应的实体表的数据 JSONObject object = new JSONObject(); for (int i = 0; i < mdmModuleDbEntities.size(); i++) { if("1".equals(mdmModuleDbEntities.get(i).getDbType())){ - Map map = new HashMap<>(); + Map map = new HashMap<>(); map.put("tableName",mdmModuleDbEntities.get(i).getDbName()); map.put("documentRule",documentRule); object = mdmModuleDao.queryMdmST(map); @@ -245,6 +252,20 @@ public class MdmModulePluginInitializer extends PluginBaseEntity { taskLivingDetailsService.updateLogFailToSuccess(taskDetailEntity); return BaseResult.getFailureMessageEntity("当前数据不存在"); } + if(mdmModuleDistributeDetailEntities != null && mdmModuleDistributeDetailEntities.size() > 0){ + for (int i1 = 0; i1 < mdmModuleDistributeDetailEntities.size(); i1++) { + Map checkData = new HashMap<>(); + checkData.put("tableName",mdmModuleDbEntities.get(i).getDbName()); + checkData.put("documentRule",documentRule); + checkData.put("mdmModuleDistributeDetailEntities",mdmModuleDistributeDetailEntities); + JSONObject object1 = mdmModuleDao.queryMdmST(checkData); + if(object1.getString("id") == null || "".equals(object1.getString("id")) ){ + taskDetailEntity.setResult("当前数据不符合规则不发送"); + taskLivingDetailsService.updateLogFailToSuccess(taskDetailEntity); + return BaseResult.getFailureMessageEntity("当前数据不符合规则不发送"); + } + } + } //查看主表是否有字段是关联的 if(mdmModuleDbFiledsRuleEntities != null && mdmModuleDbFiledsRuleEntities.size() > 0){ for (int i1 = 0; i1 < mdmModuleDbFiledsRuleEntities.size(); i1++) { @@ -252,7 +273,7 @@ public class MdmModulePluginInitializer extends PluginBaseEntity { if(mdmModuleDbFiledsEntities != null && mdmModuleDbFiledsEntities.size() > 0){ for (int i2 = 0; i2 < mdmModuleDbFiledsEntities.size(); i2++) { if(mdmModuleDbFiledsRuleEntities.get(i1).getFiledId().equals(mdmModuleDbFiledsEntities.get(i2).getId())){ - Map mapDetail = new HashMap<>(); + Map mapDetail = new HashMap<>(); mapDetail.put("tableName",mdmModuleDbFiledsRuleEntities.get(i1).getRuleValue()); mapDetail.put("id",object.getString(mdmModuleDbFiledsEntities.get(i2).getEnName())); JSONObject objectDetail = mdmModuleDao.queryMdmST(mapDetail); @@ -281,7 +302,7 @@ public class MdmModulePluginInitializer extends PluginBaseEntity { for (int i2 = 0; i2 < mdmModuleDbFiledsEntities.size(); i2++) { if(mdmModuleDbFiledsRuleEntities.get(i1).getFiledId().equals(mdmModuleDbFiledsEntities.get(i2).getId())){ for (int i3 = 0; i3 < detail.size(); i3++) { - Map mapDetail = new HashMap<>(); + Map mapDetail = new HashMap<>(); mapDetail.put("tableName",mdmModuleDbFiledsRuleEntities.get(i1).getRuleValue()); mapDetail.put("id",detail.get(i3).getString(mdmModuleDbFiledsEntities.get(i2).getEnName())); JSONObject objectDetail = mdmModuleDao.queryMdmST(mapDetail); @@ -326,7 +347,7 @@ public class MdmModulePluginInitializer extends PluginBaseEntity { }catch (Exception e){ taskDetailEntity.setResult("分发脚本转换错误"); taskLivingDetailsService.updateLogFailToSuccess(taskDetailEntity); - //return BaseResult.getFailureMessageEntity("分发脚本转换错误"); + return BaseResult.getFailureMessageEntity("分发脚本转换错误"); } } Map headers = new HashMap<>(); diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModule/dao/IMdmModuleDao.java b/service/src/main/java/com/hzya/frame/mdm/mdmModule/dao/IMdmModuleDao.java index f40843a7..482285af 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModule/dao/IMdmModuleDao.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModule/dao/IMdmModuleDao.java @@ -49,7 +49,7 @@ public interface IMdmModuleDao extends IBaseDao { Integer deleteTable(Map maps); - JSONObject queryMdmST(Map maps); + JSONObject queryMdmST(Map maps); List queryMdmSTDetail(Map maps); } diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModule/dao/impl/MdmModuleDaoImpl.java b/service/src/main/java/com/hzya/frame/mdm/mdmModule/dao/impl/MdmModuleDaoImpl.java index 36537041..d17aa1d0 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModule/dao/impl/MdmModuleDaoImpl.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModule/dao/impl/MdmModuleDaoImpl.java @@ -148,7 +148,7 @@ public class MdmModuleDaoImpl extends MybatisGenericDao } @Override - public JSONObject queryMdmST(Map maps) { + public JSONObject queryMdmST(Map maps) { JSONObject o = (JSONObject) super.selectOne(getSqlIdPrifx() + "queryMdmST", maps); return o; } diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModule/entity/MdmModuleEntity.xml b/service/src/main/java/com/hzya/frame/mdm/mdmModule/entity/MdmModuleEntity.xml index 75ff1531..dfc09897 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 @@ -801,6 +801,36 @@ where id = #{id} and document_rule = #{documentRule} and id = #{id} + + AND + + ${item.leftBracket} ${item.filedName} + + + = + + + != + + + > + + + < + + + #{item.filedVaule} + + + and + + + or + + + ${item.rightParenthesis} + + and sts = 'Y' 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 2bae850a..23437fe6 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 @@ -619,6 +619,23 @@ public class MdmModuleServiceImpl extends BaseService i source_name.setDataType("1"); mdmModuleDbFiledsEntities.add(source_name); + MdmModuleDbFiledsEntity data_type = new MdmModuleDbFiledsEntity(); + data_type.setMdmId(entity.getMdmId()); + data_type.setDbId(entity.getId()); + data_type.setEnName("data_type"); + data_type.setChName("状态"); + data_type.setFiledType("3"); + data_type.setAddType("1"); + data_type.setUpdateType("1"); + data_type.setShowType("1"); + data_type.setQueryType("1"); + data_type.setListType("1"); + data_type.setViewType("1"); + data_type.setFiledLength("255"); + data_type.setCreate(); + data_type.setDataType("1"); + mdmModuleDbFiledsEntities.add(data_type); + MdmModuleDbFiledsEntity code = new MdmModuleDbFiledsEntity(); code.setMdmId(entity.getMdmId()); code.setDbId(entity.getId()); diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleOptionLog/entity/MdmModuleOptionLogEntity.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleOptionLog/entity/MdmModuleOptionLogEntity.java index d4af3ede..aaf6f341 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleOptionLog/entity/MdmModuleOptionLogEntity.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleOptionLog/entity/MdmModuleOptionLogEntity.java @@ -17,6 +17,8 @@ public class MdmModuleOptionLogEntity extends BaseEntity { private String formmainId; /** 来源名称 */ private String sourceName; + /** 状态 1、成功2、失败 */ + private String dataType; /** 编码 */ private String code; /** source_data */ @@ -28,6 +30,13 @@ public class MdmModuleOptionLogEntity extends BaseEntity { /** 公司id */ private String companyId; + public String getDataType() { + return dataType; + } + + public void setDataType(String dataType) { + this.dataType = dataType; + } public String getFormmainId() { return formmainId; diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleOptionLog/entity/MdmModuleOptionLogEntity.xml b/service/src/main/java/com/hzya/frame/mdm/mdmModuleOptionLog/entity/MdmModuleOptionLogEntity.xml index 0ff0cabc..f6708c43 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleOptionLog/entity/MdmModuleOptionLogEntity.xml +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleOptionLog/entity/MdmModuleOptionLogEntity.xml @@ -6,6 +6,7 @@ + @@ -24,7 +25,8 @@ id ,formmain_id ,source_name - ,code + ,data_type + ,code ,source_data ,option_type ,option_name @@ -51,6 +53,7 @@ and id = #{id} and formmain_id = #{formmainId} and source_name = #{sourceName} + and data_type = #{dataType} and code = #{code} and source_data = #{sourceData} and option_type = #{optionType} @@ -76,6 +79,7 @@ and id = #{id} and formmain_id = #{formmainId} and source_name = #{sourceName} + and data_type = #{dataType} and code = #{code} and source_data = #{sourceData} and option_type = #{optionType} @@ -103,6 +107,7 @@ and id like concat('%',#{id},'%') and formmain_id like concat('%',#{formmainId},'%') and source_name like concat('%',#{sourceName},'%') + and data_type like concat('%',#{dataType},'%') and code like concat('%',#{code},'%') and source_data like concat('%',#{sourceData},'%') and option_type like concat('%',#{optionType},'%') @@ -130,6 +135,7 @@ or id = #{id} or formmain_id = #{formmainId} or source_name = #{sourceName} + or data_type = #{dataType} or code = #{code} or source_data = #{sourceData} or option_type = #{optionType} @@ -155,6 +161,7 @@ id , formmain_id , source_name , + data_type , code , source_data , option_type , @@ -174,6 +181,7 @@ #{id} , #{formmainId} , #{sourceName} , + #{dataType} , #{code} , #{sourceData} , #{optionType} , @@ -192,22 +200,23 @@ - insert into ${tableName}(formmain_id, source_name, code, source_data, option_type, option_name, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, sts) + insert into ${tableName}(formmain_id, source_name,data_type, code, source_data, option_type, option_name, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, sts) values - (#{entity.formmainId},#{entity.sourceName},#{entity.code},#{entity.sourceData},#{entity.optionType},#{entity.optionName},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId}, 'Y') + (#{entity.formmainId},#{entity.sourceName},#{entity.dataType},#{entity.code},#{entity.sourceData},#{entity.optionType},#{entity.optionName},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId}, 'Y') - insert into ${tableName}(formmain_id, source_name, code, source_data, option_type, option_name, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id) + insert into ${tableName}(formmain_id, source_name,data_type, code, source_data, option_type, option_name, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id) values - (#{entity.formmainId},#{entity.sourceName},#{entity.code},#{entity.sourceData},#{entity.optionType},#{entity.optionName},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId}) + (#{entity.formmainId},#{entity.sourceName},#{entity.dataType},#{entity.code},#{entity.sourceData},#{entity.optionType},#{entity.optionName},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId}) on duplicate key update formmain_id = values(formmain_id), source_name = values(source_name), + data_type = values(data_type), code = values(code), source_data = values(source_data), option_type = values(option_type), @@ -225,6 +234,7 @@ update ${tableName} set formmain_id = #{formmainId}, source_name = #{sourceName}, + data_type = #{dataType}, code = #{code}, source_data = #{sourceData}, option_type = #{optionType}, @@ -251,6 +261,7 @@ update ${tableName} set sts= 'N' ,modify_time = #{modify_time},modify_user_id = and id = #{id} and formmain_id = #{formmainId} and source_name = #{sourceName} + and data_type = #{dataType} and code = #{code} and source_data = #{sourceData} and option_type = #{optionType} diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleSource/dao/IMdmModuleSourceDao.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleSource/dao/IMdmModuleSourceDao.java index cc3b08c8..6d290781 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleSource/dao/IMdmModuleSourceDao.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleSource/dao/IMdmModuleSourceDao.java @@ -9,19 +9,17 @@ import java.util.List; * 主数据数据来源(mdm_module_source: table)表数据库访问层 * * @author makejava - * @since 2024-06-05 11:42:56 + * @since 2024-06-19 09:11:50 */ public interface IMdmModuleSourceDao extends IBaseDao { - /** - * + * * @content 根据数据来源内类型是插件的应用类型做分组 - * @Param - * @Return - * @Author hecan + * @Param + * @Return + * @Author hecan * @Date 2024/6/6 10:43 * **/ List MdmModuleSourceentityGroupByType(); - } diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleSource/dao/impl/MdmModuleSourceDaoImpl.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleSource/dao/impl/MdmModuleSourceDaoImpl.java index 4e025854..3392fd01 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleSource/dao/impl/MdmModuleSourceDaoImpl.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleSource/dao/impl/MdmModuleSourceDaoImpl.java @@ -11,10 +11,11 @@ import java.util.List; * 主数据数据来源(MdmModuleSource)表数据库访问层 * * @author makejava - * @since 2024-06-05 11:42:56 + * @since 2024-06-19 09:11:50 */ @Repository(value = "MdmModuleSourceDaoImpl") public class MdmModuleSourceDaoImpl extends MybatisGenericDao implements IMdmModuleSourceDao{ + //根据数据来源内类型是插件的应用类型做分组 @Override public List MdmModuleSourceentityGroupByType() { @@ -22,7 +23,5 @@ public class MdmModuleSourceDaoImpl extends MybatisGenericDao + + + + + @@ -23,7 +28,12 @@ ,mdm_id ,source_type ,source_name + ,trigger_type ,source_code + ,add_api + ,update_api + ,delete_api + ,enabled_state ,sorts ,create_user_id ,create_time @@ -33,11 +43,6 @@ ,org_id ,company_id - - - - - + insert into mdm_module_source( id , mdm_id , source_type , source_name , + trigger_type , source_code , + add_api , + update_api , + delete_api , + enabled_state , sorts , create_user_id , create_time , @@ -161,6 +183,7 @@ sts , org_id , company_id , + sorts, sts, )values( @@ -169,7 +192,12 @@ #{mdmId} , #{sourceType} , #{sourceName} , + #{triggerType} , #{sourceCode} , + #{addApi} , + #{updateApi} , + #{deleteApi} , + #{enabledState} , #{sorts} , #{create_user_id} , #{create_time} , @@ -178,30 +206,36 @@ #{sts} , #{org_id} , #{companyId} , + (select (max(IFNULL( a.sorts, 0 )) + 1) as sort from mdm_module_source a WHERE a.sts = 'Y' ), 'Y', ) - - insert into mdm_module_source(mdm_id, source_type, source_name, source_code, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, sts) + + insert into mdm_module_source(mdm_id, source_type, source_name, trigger_type, source_code, add_api, update_api, delete_api, enabled_state, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, sts) values - (#{entity.mdmId},#{entity.sourceType},#{entity.sourceName},#{entity.sourceCode},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId}, 'Y') + (#{entity.mdmId},#{entity.sourceType},#{entity.sourceName},#{entity.triggerType},#{entity.sourceCode},#{entity.addApi},#{entity.updateApi},#{entity.deleteApi},#{entity.enabledState},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId}, 'Y') - - insert into mdm_module_source(mdm_id, source_type, source_name, source_code, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id) + + insert into mdm_module_source(mdm_id, source_type, source_name, trigger_type, source_code, add_api, update_api, delete_api, enabled_state, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id) values - (#{entity.mdmId},#{entity.sourceType},#{entity.sourceName},#{entity.sourceCode},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId}) + (#{entity.mdmId},#{entity.sourceType},#{entity.sourceName},#{entity.triggerType},#{entity.sourceCode},#{entity.addApi},#{entity.updateApi},#{entity.deleteApi},#{entity.enabledState},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId}) on duplicate key update mdm_id = values(mdm_id), source_type = values(source_type), source_name = values(source_name), + trigger_type = values(trigger_type), source_code = values(source_code), + add_api = values(add_api), + update_api = values(update_api), + delete_api = values(delete_api), + enabled_state = values(enabled_state), create_user_id = values(create_user_id), create_time = values(create_time), modify_user_id = values(modify_user_id), @@ -216,7 +250,12 @@ update mdm_module_source set mdm_id = #{mdmId}, source_type = #{sourceType}, source_name = #{sourceName}, + trigger_type = #{triggerType}, source_code = #{sourceCode}, + add_api = #{addApi}, + update_api = #{updateApi}, + delete_api = #{deleteApi}, + enabled_state = #{enabledState}, create_user_id = #{create_user_id}, create_time = #{create_time}, modify_user_id = #{modify_user_id}, @@ -240,7 +279,12 @@ update mdm_module_source set sts= 'N' ,modify_time = #{modify_time},modify_user and mdm_id = #{mdmId} and source_type = #{sourceType} and source_name = #{sourceName} + and trigger_type = #{triggerType} and source_code = #{sourceCode} + and add_api = #{addApi} + and update_api = #{updateApi} + and delete_api = #{deleteApi} + and enabled_state = #{enabledState} and sorts = #{sorts} and sts = #{sts} and company_id = #{companyId} @@ -251,6 +295,13 @@ 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/mdm/mdmModuleSource/service/IMdmModuleSourceService.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleSource/service/IMdmModuleSourceService.java index f622682c..990da6bd 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleSource/service/IMdmModuleSourceService.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleSource/service/IMdmModuleSourceService.java @@ -6,7 +6,7 @@ import com.hzya.frame.basedao.service.IBaseService; * 主数据数据来源(MdmModuleSource)表服务接口 * * @author makejava - * @since 2024-06-05 11:42:57 + * @since 2024-06-19 09:11:50 */ public interface IMdmModuleSourceService extends IBaseService{ } diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleSource/service/impl/MdmModuleSourceServiceImpl.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleSource/service/impl/MdmModuleSourceServiceImpl.java index f9afb989..206df786 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleSource/service/impl/MdmModuleSourceServiceImpl.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleSource/service/impl/MdmModuleSourceServiceImpl.java @@ -11,7 +11,7 @@ import com.hzya.frame.basedao.service.impl.BaseService; * 主数据数据来源(MdmModuleSource)表服务实现类 * * @author makejava - * @since 2024-06-05 11:42:57 + * @since 2024-06-19 09:11:50 */ @Service(value = "mdmModuleSourceService") public class MdmModuleSourceServiceImpl extends BaseService implements IMdmModuleSourceService { From b595bba61b829748b45e2b9d97bea3ede5087490 Mon Sep 17 00:00:00 2001 From: lvleigang <957075182@qq.com> Date: Wed, 19 Jun 2024 10:17:03 +0800 Subject: [PATCH 69/80] =?UTF-8?q?=E4=B8=BB=E6=95=B0=E6=8D=AE=E4=B8=8B?= =?UTF-8?q?=E5=8F=91=EF=BC=8C=E9=87=8D=E6=96=B0=E5=8F=91=E9=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/hzya/frame/mdm/mdmModule/entity/MdmModuleEntity.xml | 3 +++ 1 file changed, 3 insertions(+) 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 dfc09897..75d7a866 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 @@ -397,6 +397,9 @@ where id = #{id} + + + - + insert into mdm_org( id , @@ -276,7 +276,7 @@ ) - + insert into mdm_org(document_rule, document_rule_num, org_code, org_name, org_address, org_countryzone, org_innercode, org_memo, org_mnecode, org_ncindustry, org_fatherorg, org_principal, org_tel, data_status, add_status, update_status, delete_status, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, sts) values @@ -284,7 +284,7 @@ - + insert into mdm_org(document_rule, document_rule_num, org_code, org_name, org_address, org_countryzone, org_innercode, org_memo, org_mnecode, org_ncindustry, org_fatherorg, org_principal, org_tel, data_status, add_status, update_status, delete_status, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id) values diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/project/entity/MdmProjectEntity.xml b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/project/entity/MdmProjectEntity.xml index 93ec1958..467882e1 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/project/entity/MdmProjectEntity.xml +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/project/entity/MdmProjectEntity.xml @@ -204,7 +204,7 @@ - + insert into mdm_project( id , @@ -268,7 +268,7 @@ ) - + insert into mdm_project(document_rule, document_rule_num, project_code, project_name, project_bill_type, project_memo, project_currtype, project_dutier, project_duty_dept, project_org, project_parentpro, project_sh_name, data_status, add_status, update_status, delete_status, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, sts) values @@ -276,7 +276,7 @@ - + insert into mdm_project(document_rule, document_rule_num, project_code, project_name, project_bill_type, project_memo, project_currtype, project_dutier, project_duty_dept, project_org, project_parentpro, project_sh_name, data_status, add_status, update_status, delete_status, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id) values diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/user/entity/MdmUserEntity.xml b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/user/entity/MdmUserEntity.xml index a05e5cf0..b594d94b 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/user/entity/MdmUserEntity.xml +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/user/entity/MdmUserEntity.xml @@ -258,7 +258,7 @@ - + insert into mdm_user( id , @@ -340,7 +340,7 @@ ) - + insert into mdm_user(document_rule, document_rule_num, data_status, add_status, update_status, delete_status, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, user_name, user_code, user_password, pwdlevelcode, pwdparam, user_note, abledate, disabledate, islocked, user_type, base_doc_type, pk_base_doc, identityverifycode, pk_org, format, isca, enablestate, contentlang, user_code_q, sts) values @@ -348,7 +348,7 @@ - + insert into mdm_user(document_rule, document_rule_num, data_status, add_status, update_status, delete_status, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, user_name, user_code, user_password, pwdlevelcode, pwdparam, user_note, abledate, disabledate, islocked, user_type, base_doc_type, pk_base_doc, identityverifycode, pk_org, format, isca, enablestate, contentlang, user_code_q) values diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/mdmDistribute/plugin/MdmModulePluginInitializer.java b/buildpackage/src/main/java/com/hzya/frame/plugin/mdmDistribute/plugin/MdmModulePluginInitializer.java index 52b75b12..7aff0fb1 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/mdmDistribute/plugin/MdmModulePluginInitializer.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/mdmDistribute/plugin/MdmModulePluginInitializer.java @@ -253,17 +253,15 @@ public class MdmModulePluginInitializer extends PluginBaseEntity { return BaseResult.getFailureMessageEntity("当前数据不存在"); } if(mdmModuleDistributeDetailEntities != null && mdmModuleDistributeDetailEntities.size() > 0){ - for (int i1 = 0; i1 < mdmModuleDistributeDetailEntities.size(); i1++) { - Map checkData = new HashMap<>(); - checkData.put("tableName",mdmModuleDbEntities.get(i).getDbName()); - checkData.put("documentRule",documentRule); - checkData.put("mdmModuleDistributeDetailEntities",mdmModuleDistributeDetailEntities); - JSONObject object1 = mdmModuleDao.queryMdmST(checkData); - if(object1.getString("id") == null || "".equals(object1.getString("id")) ){ - taskDetailEntity.setResult("当前数据不符合规则不发送"); - taskLivingDetailsService.updateLogFailToSuccess(taskDetailEntity); - return BaseResult.getFailureMessageEntity("当前数据不符合规则不发送"); - } + Map checkData = new HashMap<>(); + checkData.put("tableName",mdmModuleDbEntities.get(i).getDbName()); + checkData.put("documentRule",documentRule); + checkData.put("mdmModuleDistributeDetailEntities",mdmModuleDistributeDetailEntities); + JSONObject object1 = mdmModuleDao.queryMdmST(checkData); + if(object1.getString("id") == null || "".equals(object1.getString("id")) ){ + taskDetailEntity.setResult("当前数据不符合规则不发送"); + taskLivingDetailsService.updateLogFailToSuccess(taskDetailEntity); + return BaseResult.getFailureMessageEntity("当前数据不符合规则不发送"); } } //查看主表是否有字段是关联的 @@ -370,9 +368,63 @@ public class MdmModulePluginInitializer extends PluginBaseEntity { return BaseResult.getFailureMessageEntity("发送错误"); } } - }else { - //执行正常下发 + }else {//执行正常下发 + //查询主数据 + MdmModuleEntity queryMdmModuleEntity = new MdmModuleEntity(); + queryMdmModuleEntity.setSts("Y"); + List mdmModuleEntities = mdmModuleDao.queryBase(queryMdmModuleEntity); + if(mdmModuleEntities == null || mdmModuleEntities.size() == 0){ + return BaseResult.getSuccessMessageEntity("主数据未设置,不需要下发"); + } + //查询下发的配置 没有直接跳过 + for (int i = 0; i < mdmModuleEntities.size(); i++) { + MdmModuleDistributeEntity queryMdmModuleDistributeEntity = new MdmModuleDistributeEntity(); + queryMdmModuleDistributeEntity.setMdmId(mdmModuleEntities.get(i).getId()); + queryMdmModuleDistributeEntity.setEnabledType("1"); + queryMdmModuleDistributeEntity.setEnabledState("1"); + List mdmModuleDistributeEntities = mdmModuleDistributeDao.queryBase(queryMdmModuleDistributeEntity); + if(mdmModuleDistributeEntities == null || mdmModuleDistributeEntities.size() == 0){ + continue; + } + for (int i1 = 0; i1 < mdmModuleDistributeEntities.size(); i1++) { + //查询主数据db + MdmModuleDbEntity queryMdmModuleDbEntity = new MdmModuleDbEntity(); + queryMdmModuleDbEntity.setMdmId(mdmModuleEntities.get(i).getId()); + List mdmModuleDbEntities = mdmServiceCache.queryMdmModuleDb(queryMdmModuleDbEntity); + if(mdmModuleDbEntities == null || mdmModuleDbEntities.size() == 0){ + continue; + } + //查询主数据字段 + MdmModuleDbFiledsEntity queryFild = new MdmModuleDbFiledsEntity(); + queryFild.setMdmId(mdmModuleEntities.get(i).getId()); + List mdmModuleDbFiledsEntities = mdmServiceCache.queryMdmModuleDbFileds(queryFild); + if(mdmModuleDbFiledsEntities == null || mdmModuleDbFiledsEntities.size() == 0){ + continue; + } + //查询下发的配置 + MdmModuleDistributeDetailEntity mdmModuleDistributeDetailEntity = new MdmModuleDistributeDetailEntity() ; + mdmModuleDistributeDetailEntity.setDistributeId(mdmModuleDistributeEntities.get(i1).getId()); + mdmModuleDistributeDetailEntity.setSts("Y"); + List mdmModuleDistributeDetailEntities = mdmModuleDistributeDetailDao.queryBase(mdmModuleDistributeDetailEntity); + + + + + } + } + + //查询一千条数据 + + //查询这一千条数据是否符合规则 + + //查询是否已经手动发送过。只有新增校验,查询发送日志是否已经有这条数据 + + //组装数据发送 + + //保存日志 + + //所有下发发送完成,修改数据状态 } } 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 75d7a866..c1a13e78 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 @@ -806,7 +806,7 @@ where id = #{id} and id = #{id} AND - + ${item.leftBracket} ${item.filedName} 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 23437fe6..84dba275 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 @@ -2268,6 +2268,24 @@ public class MdmModuleServiceImpl extends BaseService i return BaseResult.getFailureMessageEntity("系统错误"); } List list = mdmModuleDistributeDao.queryBase(entity); + if(list != null && list.size() > 0){ + MdmModuleDistributeDetailEntity mdmModuleDistributeDetailEntity = new MdmModuleDistributeDetailEntity(); + mdmModuleDistributeDetailEntity.setMdmId(entity.getMdmId()); + mdmModuleDistributeDetailEntity.setSts("Y"); + List listDetail = mdmModuleDistributeDetailDao.queryBase(mdmModuleDistributeDetailEntity); + if(listDetail != null && listDetail.size() > 0){ + for (int i = 0; i < list.size(); i++) { + List mdmModuleDistributeDetailEntities = new ArrayList<>(); + for (int i1 = 0; i1 < listDetail.size(); i1++) { + if(listDetail.get(i1).getDistributeId().equals(list.get(i).getId())){ + mdmModuleDistributeDetailEntities.add(listDetail.get(i1) ); + } + } + list.get(i).setMdmModuleDistributeDetailEntities(mdmModuleDistributeDetailEntities); + } + } + + } return BaseResult.getSuccessMessageEntity("获取分发设置成功", list); } @@ -2348,12 +2366,16 @@ public class MdmModuleServiceImpl extends BaseService i mdmModuleDistributeDetailDao.logicRemoveMultiCondition(mdmModuleDistributeDetailEntity); if (entity.getMdmModuleDistributeDetailEntities() != null && entity.getMdmModuleDistributeDetailEntities().size() > 0) { for (int i = 0; i < entity.getMdmModuleDistributeDetailEntities().size(); i++) { + entity.getMdmModuleDistributeDetailEntities().get(i).setSts("Y"); + entity.getMdmModuleDistributeDetailEntities().get(i).setMdmId(entity.getMdmId()); entity.getMdmModuleDistributeDetailEntities().get(i).setSts("Y"); if (entity.getMdmModuleDistributeDetailEntities().get(i).getId() != null) { entity.getMdmModuleDistributeDetailEntities().get(i).setUpdate(); + entity.getMdmModuleDistributeDetailEntities().get(i).setDistributeId(entity.getId()); mdmModuleDistributeDetailDao.update(entity.getMdmModuleDistributeDetailEntities().get(i)); } else { entity.getMdmModuleDistributeDetailEntities().get(i).setCreate(); + entity.getMdmModuleDistributeDetailEntities().get(i).setDistributeId(entity.getId()); mdmModuleDistributeDetailDao.save(entity.getMdmModuleDistributeDetailEntities().get(i)); } } diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistribute/entity/MdmModuleDistributeEntity.xml b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistribute/entity/MdmModuleDistributeEntity.xml index 0a959f0f..ffedf135 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistribute/entity/MdmModuleDistributeEntity.xml +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistribute/entity/MdmModuleDistributeEntity.xml @@ -181,7 +181,7 @@ - + insert into mdm_module_distribute( id , @@ -235,7 +235,7 @@ ) - + insert into mdm_module_distribute(mdm_id, app_id, enabled_type, update_api, update_script, add_api, add_script, delete_api, delete_script, enabled_state, db_id, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, sts) values @@ -243,7 +243,7 @@ - + insert into mdm_module_distribute(mdm_id, app_id, enabled_type, update_api, update_script, add_api, add_script, delete_api, delete_script, enabled_state, db_id, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id) values diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistributeDetail/dao/IMdmModuleDistributeDetailDao.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistributeDetail/dao/IMdmModuleDistributeDetailDao.java index 3b39e01d..962a0d5a 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistributeDetail/dao/IMdmModuleDistributeDetailDao.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistributeDetail/dao/IMdmModuleDistributeDetailDao.java @@ -7,7 +7,7 @@ import com.hzya.frame.basedao.dao.IBaseDao; * 主数据功能应用分发明细表(mdm_module_distribute_detail: table)表数据库访问层 * * @author makejava - * @since 2024-06-14 10:03:50 + * @since 2024-06-19 10:34:58 */ public interface IMdmModuleDistributeDetailDao extends IBaseDao { diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistributeDetail/dao/impl/MdmModuleDistributeDetailDaoImpl.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistributeDetail/dao/impl/MdmModuleDistributeDetailDaoImpl.java index c184298c..8507d00c 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistributeDetail/dao/impl/MdmModuleDistributeDetailDaoImpl.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistributeDetail/dao/impl/MdmModuleDistributeDetailDaoImpl.java @@ -8,7 +8,7 @@ import com.hzya.frame.basedao.dao.MybatisGenericDao; * 主数据功能应用分发明细表(MdmModuleDistributeDetail)表数据库访问层 * * @author makejava - * @since 2024-06-14 10:03:50 + * @since 2024-06-19 10:34:58 */ @Repository(value = "MdmModuleDistributeDetailDaoImpl") public class MdmModuleDistributeDetailDaoImpl extends MybatisGenericDao implements IMdmModuleDistributeDetailDao{ diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistributeDetail/entity/MdmModuleDistributeDetailEntity.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistributeDetail/entity/MdmModuleDistributeDetailEntity.java index 18bd952c..d1acefd1 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistributeDetail/entity/MdmModuleDistributeDetailEntity.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistributeDetail/entity/MdmModuleDistributeDetailEntity.java @@ -6,7 +6,7 @@ import com.hzya.frame.web.entity.BaseEntity; * 主数据功能应用分发明细表(MdmModuleDistributeDetail)实体类 * * @author makejava - * @since 2024-06-14 10:03:50 + * @since 2024-06-19 10:34:58 */ public class MdmModuleDistributeDetailEntity extends BaseEntity { @@ -20,6 +20,8 @@ public class MdmModuleDistributeDetailEntity extends BaseEntity { private String dataType; /** 左括号 */ private String leftBracket; + /** 字段id */ + private String filedId; /** 字段名 */ private String filedName; /** 对比类型 1、等于 2、不等于 3、大于 4、小于 */ @@ -74,6 +76,14 @@ public class MdmModuleDistributeDetailEntity extends BaseEntity { this.leftBracket = leftBracket; } + public String getFiledId() { + return filedId; + } + + public void setFiledId(String filedId) { + this.filedId = filedId; + } + public String getFiledName() { return filedName; } diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistributeDetail/entity/MdmModuleDistributeDetailEntity.xml b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistributeDetail/entity/MdmModuleDistributeDetailEntity.xml index 171168f4..ceef3625 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistributeDetail/entity/MdmModuleDistributeDetailEntity.xml +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistributeDetail/entity/MdmModuleDistributeDetailEntity.xml @@ -9,6 +9,7 @@ + @@ -31,6 +32,7 @@ ,api_id ,data_type ,left_bracket + ,filed_id ,filed_name ,compare_type ,filed_vaule @@ -45,12 +47,6 @@ ,org_id ,company_id - - - + insert into mdm_module_source( id , @@ -212,7 +212,7 @@ ) - + insert into mdm_module_source(mdm_id, source_type, source_name, trigger_type, source_code, add_api, update_api, delete_api, enabled_state, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, sts) values @@ -220,7 +220,7 @@ - + insert into mdm_module_source(mdm_id, source_type, source_name, trigger_type, source_code, add_api, update_api, delete_api, enabled_state, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id) values diff --git a/service/src/main/java/com/hzya/frame/sys/contrastTask/entity/SysContrastTaskEntity.xml b/service/src/main/java/com/hzya/frame/sys/contrastTask/entity/SysContrastTaskEntity.xml index 67e6d489..36518c9d 100644 --- a/service/src/main/java/com/hzya/frame/sys/contrastTask/entity/SysContrastTaskEntity.xml +++ b/service/src/main/java/com/hzya/frame/sys/contrastTask/entity/SysContrastTaskEntity.xml @@ -161,7 +161,7 @@ + keyProperty=""> insert into sys_contrast_task( id , @@ -209,7 +209,7 @@ ) - + insert into sys_contrast_task(id, service_name, left_app_id, left_api_id, right_app_id, right_api_id, task_status, task_msg, sorts, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, match_mode, sts) @@ -220,7 +220,7 @@ - + insert into sys_contrast_task(id, service_name, left_app_id, left_api_id, right_app_id, right_api_id, task_status, task_msg, sorts, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, match_mode) values diff --git a/service/src/main/java/com/hzya/frame/sys/file/download/entity/FileDownloadEntity.xml b/service/src/main/java/com/hzya/frame/sys/file/download/entity/FileDownloadEntity.xml index 514d0581..edea0765 100644 --- a/service/src/main/java/com/hzya/frame/sys/file/download/entity/FileDownloadEntity.xml +++ b/service/src/main/java/com/hzya/frame/sys/file/download/entity/FileDownloadEntity.xml @@ -179,7 +179,7 @@ 'Y' ) - + select last_insert_id() as id diff --git a/service/src/main/java/com/hzya/frame/sys/moduleNew/entity/SysModuleNewEntity.xml b/service/src/main/java/com/hzya/frame/sys/moduleNew/entity/SysModuleNewEntity.xml index 8863b52f..bd928cd1 100644 --- a/service/src/main/java/com/hzya/frame/sys/moduleNew/entity/SysModuleNewEntity.xml +++ b/service/src/main/java/com/hzya/frame/sys/moduleNew/entity/SysModuleNewEntity.xml @@ -272,7 +272,7 @@ 'Y' ) - + select last_insert_id() as id diff --git a/service/src/main/java/com/hzya/frame/sys/serviceMethod/entity/SysServiceMethodEntity.xml b/service/src/main/java/com/hzya/frame/sys/serviceMethod/entity/SysServiceMethodEntity.xml index ef755315..e7435715 100644 --- a/service/src/main/java/com/hzya/frame/sys/serviceMethod/entity/SysServiceMethodEntity.xml +++ b/service/src/main/java/com/hzya/frame/sys/serviceMethod/entity/SysServiceMethodEntity.xml @@ -120,7 +120,7 @@ - + insert into sys_service_method( id , @@ -156,7 +156,7 @@ ) - + insert into sys_service_method(service_key, service_value, remark, sorts, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, sts) values @@ -164,7 +164,7 @@ - + insert into sys_service_method(service_key, service_value, remark, sorts, create_user_id, create_time, modify_user_id, modify_time, sts, org_id) values diff --git a/service/src/main/java/com/hzya/frame/sys/templateButton/entity/SysTemplateButtonEntity.xml b/service/src/main/java/com/hzya/frame/sys/templateButton/entity/SysTemplateButtonEntity.xml index e6c368dc..3d57717c 100644 --- a/service/src/main/java/com/hzya/frame/sys/templateButton/entity/SysTemplateButtonEntity.xml +++ b/service/src/main/java/com/hzya/frame/sys/templateButton/entity/SysTemplateButtonEntity.xml @@ -169,8 +169,8 @@ + parameterType="com.hzya.frame.sys.templateButton.entity.SysTemplateButtonEntity" + > insert into sys_template_button( id , @@ -218,7 +218,7 @@ ) - + insert into sys_template_button(template_id, service_name, table_name, button_type, button_title, button_style, button_sort, button_icon, sorts, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, sts) values @@ -228,7 +228,7 @@ - + insert into sys_template_button(template_id, service_name, table_name, button_type, button_title, button_style, button_sort, button_icon, sorts, create_user_id, create_time, modify_user_id, modify_time, sts, org_id) values diff --git a/service/src/main/java/com/hzya/frame/sys/userTemplateButton/entity/SysUserTemplateButtonEntity.xml b/service/src/main/java/com/hzya/frame/sys/userTemplateButton/entity/SysUserTemplateButtonEntity.xml index 8faa1f95..b5771031 100644 --- a/service/src/main/java/com/hzya/frame/sys/userTemplateButton/entity/SysUserTemplateButtonEntity.xml +++ b/service/src/main/java/com/hzya/frame/sys/userTemplateButton/entity/SysUserTemplateButtonEntity.xml @@ -126,7 +126,7 @@ - + insert into sys_user_template_button( id , @@ -164,7 +164,7 @@ ) - + insert into sys_user_template_button(template_id, service_name, button_id, user_id, sorts, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, sts) values @@ -172,7 +172,7 @@ - + insert into sys_user_template_button(template_id, service_name, button_id, user_id, sorts, create_user_id, create_time, modify_user_id, modify_time, sts, org_id) values diff --git a/service/src/main/java/com/hzya/frame/sysnew/application/api/entity/SysApplicationApiEntity.xml b/service/src/main/java/com/hzya/frame/sysnew/application/api/entity/SysApplicationApiEntity.xml index 3b543b9a..0f46b8fa 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/application/api/entity/SysApplicationApiEntity.xml +++ b/service/src/main/java/com/hzya/frame/sysnew/application/api/entity/SysApplicationApiEntity.xml @@ -354,7 +354,7 @@ WHERE + > insert into sys_application_api( id , @@ -442,7 +442,7 @@ WHERE ) - + insert into sys_application_api(api_status,api_code,api_path, app_id, catalogue_id, api_name, api_remark, need_Login, authentication_port, parameter_passing_mode, destination_address, request_coding, request_method, timeout_period, current_limiting, header_in, query_in, body_in_type, body_in, body_out, bean_name,return_msg,return_success_field,return_success_value, fun_name, extension_api, sorts, create_user_id, @@ -454,7 +454,7 @@ WHERE - + insert into sys_application_api(api_status,api_code,api_path, app_id, catalogue_id, api_name, api_remark, need_Login, authentication_port, parameter_passing_mode, destination_address, request_coding, request_method, timeout_period, current_limiting, header_in, query_in, body_in_type, body_in, body_out,bean_name,return_msg,return_success_field,return_success_value,fun_name,extension_api, sorts, create_user_id, diff --git a/service/src/main/java/com/hzya/frame/sysnew/application/apiAuth/entity/SysApplicationApiAuthEntity.xml b/service/src/main/java/com/hzya/frame/sysnew/application/apiAuth/entity/SysApplicationApiAuthEntity.xml index 1ab0fe04..320d6534 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/application/apiAuth/entity/SysApplicationApiAuthEntity.xml +++ b/service/src/main/java/com/hzya/frame/sysnew/application/apiAuth/entity/SysApplicationApiAuthEntity.xml @@ -132,7 +132,7 @@ - + insert into sys_application_api_auth( id , @@ -170,7 +170,7 @@ ) - + insert into sys_application_api_auth(app_id, system_status, name, system_address, sorts, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, sts) values @@ -178,7 +178,7 @@ - + insert into sys_application_api_auth(app_id, system_status, name, system_address, sorts, create_user_id, create_time, modify_user_id, modify_time, sts, org_id) values diff --git a/service/src/main/java/com/hzya/frame/sysnew/application/apiAythDetail/entity/SysApplicationApiAuthDetailEntity.xml b/service/src/main/java/com/hzya/frame/sysnew/application/apiAythDetail/entity/SysApplicationApiAuthDetailEntity.xml index 4008260c..36f5b6e4 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/application/apiAythDetail/entity/SysApplicationApiAuthDetailEntity.xml +++ b/service/src/main/java/com/hzya/frame/sysnew/application/apiAythDetail/entity/SysApplicationApiAuthDetailEntity.xml @@ -132,7 +132,7 @@ - + insert into sys_application_api_auth_detail( id , @@ -170,7 +170,7 @@ ) - + insert into sys_application_api_auth_detail(app_id, catalogue_id, api_id, tripartite_system_id, sorts, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, sts) values @@ -178,7 +178,7 @@ - + insert into sys_application_api_auth_detail(app_id, catalogue_id, api_id, tripartite_system_id, sorts, create_user_id, create_time, modify_user_id, modify_time, sts, org_id) values diff --git a/service/src/main/java/com/hzya/frame/sysnew/application/apiPara/entity/SysApplicationApiParaEntity.xml b/service/src/main/java/com/hzya/frame/sysnew/application/apiPara/entity/SysApplicationApiParaEntity.xml index 6229a63d..820be8f6 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/application/apiPara/entity/SysApplicationApiParaEntity.xml +++ b/service/src/main/java/com/hzya/frame/sysnew/application/apiPara/entity/SysApplicationApiParaEntity.xml @@ -132,7 +132,7 @@ - + insert into sys_application_api_para( id , @@ -170,7 +170,7 @@ ) - + insert into sys_application_api_para(app_id, interface_key, interface_value, interface_type, sorts, org_id, sts, create_time, create_user_id, modify_time, modify_user_id, sts) values @@ -178,7 +178,7 @@ - + insert into sys_application_api_para(app_id, interface_key, interface_value, interface_type, sorts, org_id, sts, create_time, create_user_id, modify_time, modify_user_id) values diff --git a/service/src/main/java/com/hzya/frame/sysnew/application/apiType/entity/SysApplicationApiTypeEntity.xml b/service/src/main/java/com/hzya/frame/sysnew/application/apiType/entity/SysApplicationApiTypeEntity.xml index d0d9e9fe..2aff6d2c 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/application/apiType/entity/SysApplicationApiTypeEntity.xml +++ b/service/src/main/java/com/hzya/frame/sysnew/application/apiType/entity/SysApplicationApiTypeEntity.xml @@ -138,7 +138,7 @@ - + insert into sys_application_api_type( id , @@ -172,7 +172,7 @@ ) - + insert into sys_application_api_type(app_id, name, sorts, org_id, sts, create_time, create_user_id, modify_time, modify_user_id, sts) values @@ -180,7 +180,7 @@ - + insert into sys_application_api_type(app_id, name, sorts, org_id, sts, create_time, create_user_id, modify_time, modify_user_id) values diff --git a/service/src/main/java/com/hzya/frame/sysnew/application/database/entity/SysApplicationDatabaseEntity.xml b/service/src/main/java/com/hzya/frame/sysnew/application/database/entity/SysApplicationDatabaseEntity.xml index 2b51b38e..c9030192 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/application/database/entity/SysApplicationDatabaseEntity.xml +++ b/service/src/main/java/com/hzya/frame/sysnew/application/database/entity/SysApplicationDatabaseEntity.xml @@ -168,7 +168,7 @@ - + insert into sys_application_database( id , @@ -220,7 +220,7 @@ ) - + insert into sys_application_database(app_id, source_code, source_name, source_type, source_ip, source_port, login_name, password, db_name, service_name, db_status, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, sts) values @@ -228,7 +228,7 @@ - + insert into sys_application_database(app_id, source_code, source_name, source_type, source_ip, source_port, login_name, password, db_name, service_name, db_status, create_user_id, create_time, modify_user_id, modify_time, sts, org_id) values diff --git a/service/src/main/java/com/hzya/frame/sysnew/application/entity/SysApplicationEntity.xml b/service/src/main/java/com/hzya/frame/sysnew/application/entity/SysApplicationEntity.xml index 63ca8873..45b65b4d 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/application/entity/SysApplicationEntity.xml +++ b/service/src/main/java/com/hzya/frame/sysnew/application/entity/SysApplicationEntity.xml @@ -222,7 +222,7 @@ - + insert into sys_application( id , @@ -292,7 +292,7 @@ ) - + insert into sys_application(app_logo, app_status, name, version_number, app_id, system_address, access_mode, affiliation_field, manufacturer, app_introduction, client_path, web_path, program_path, public_key, secret_key, interface_address, interface_status, db_status,app_type, sorts, org_id, sts, create_time, create_user_id, modify_time, modify_user_id, sts) values @@ -300,7 +300,7 @@ - + insert into sys_application(app_logo, app_status, name, version_number,app_id,system_address, access_mode, affiliation_field, manufacturer, app_introduction, client_path, web_path, program_path, public_key, secret_key, interface_address, interface_status, db_status,app_type, sorts, org_id, sts, create_time, create_user_id, modify_time, modify_user_id) values diff --git a/service/src/main/java/com/hzya/frame/sysnew/application/plugin/entity/SysApplicationPluginEntity.xml b/service/src/main/java/com/hzya/frame/sysnew/application/plugin/entity/SysApplicationPluginEntity.xml index 1338856a..cff4a897 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/application/plugin/entity/SysApplicationPluginEntity.xml +++ b/service/src/main/java/com/hzya/frame/sysnew/application/plugin/entity/SysApplicationPluginEntity.xml @@ -150,7 +150,7 @@ - + insert into sys_application_plugin( id , @@ -194,7 +194,7 @@ ) - + insert into sys_application_plugin(app_id, plugin_name, plugin_code, plugin_version, plugin_remark, release_date, plugin_status, sorts, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, sts) values @@ -202,7 +202,7 @@ - + insert into sys_application_plugin(app_id, plugin_name, plugin_code, plugin_version, plugin_remark, release_date, plugin_status, sorts, create_user_id, create_time, modify_user_id, modify_time, sts, org_id) values diff --git a/service/src/main/java/com/hzya/frame/sysnew/homeComponent/entity/SysHomeComponentEntity.xml b/service/src/main/java/com/hzya/frame/sysnew/homeComponent/entity/SysHomeComponentEntity.xml index fbd96673..2028853d 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/homeComponent/entity/SysHomeComponentEntity.xml +++ b/service/src/main/java/com/hzya/frame/sysnew/homeComponent/entity/SysHomeComponentEntity.xml @@ -142,7 +142,7 @@ + keyProperty=""> insert into sys_home_component( id , @@ -184,7 +184,7 @@ ) - + insert into sys_home_component(id, name, code, state, remark, sorts, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, sts) values @@ -194,7 +194,7 @@ - + insert into sys_home_component(id, name, code, state, remark, sorts, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id) values diff --git a/service/src/main/java/com/hzya/frame/sysnew/integratedForegroundTask/entity/SysIntegratedForegroundTaskEntity.xml b/service/src/main/java/com/hzya/frame/sysnew/integratedForegroundTask/entity/SysIntegratedForegroundTaskEntity.xml index 78fd315d..19dcb1d6 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/integratedForegroundTask/entity/SysIntegratedForegroundTaskEntity.xml +++ b/service/src/main/java/com/hzya/frame/sysnew/integratedForegroundTask/entity/SysIntegratedForegroundTaskEntity.xml @@ -131,7 +131,7 @@ from sys_integrated_foreground_task where id = #{ id } and sts='Y' - + insert into sys_integrated_foreground_task( id , @@ -169,7 +169,7 @@ ) - + insert into sys_integrated_foreground_task(workshop_name, plug_id, plug_name, remark, sorts, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, sts) values @@ -177,7 +177,7 @@ - + insert into sys_integrated_foreground_task(workshop_name, plug_id, plug_name, remark, sorts, create_user_id, create_time, modify_user_id, modify_time, sts, org_id) values diff --git a/service/src/main/java/com/hzya/frame/sysnew/integratedForegroundTaskDetail/entity/SysIntegratedForegroundTaskDetailEntity.xml b/service/src/main/java/com/hzya/frame/sysnew/integratedForegroundTaskDetail/entity/SysIntegratedForegroundTaskDetailEntity.xml index f9c35743..9f15654d 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/integratedForegroundTaskDetail/entity/SysIntegratedForegroundTaskDetailEntity.xml +++ b/service/src/main/java/com/hzya/frame/sysnew/integratedForegroundTaskDetail/entity/SysIntegratedForegroundTaskDetailEntity.xml @@ -138,7 +138,7 @@ - + insert into sys_integrated_foreground_task_detail( id , @@ -180,7 +180,7 @@ ) - + insert into sys_integrated_foreground_task_detail(formmain_id, arg_code, arg_name, arg_type, arg_value, remark, sorts, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, sts) values @@ -188,7 +188,7 @@ - + insert into sys_integrated_foreground_task_detail(formmain_id, arg_code, arg_name, arg_type, arg_value, remark, sorts, create_user_id, create_time, modify_user_id, modify_time, sts, org_id) values diff --git a/service/src/main/java/com/hzya/frame/sysnew/integratedForegroundTaskParameter/entity/SysIntegratedForegroundTaskParameterEntity.xml b/service/src/main/java/com/hzya/frame/sysnew/integratedForegroundTaskParameter/entity/SysIntegratedForegroundTaskParameterEntity.xml index c124271e..ca053452 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/integratedForegroundTaskParameter/entity/SysIntegratedForegroundTaskParameterEntity.xml +++ b/service/src/main/java/com/hzya/frame/sysnew/integratedForegroundTaskParameter/entity/SysIntegratedForegroundTaskParameterEntity.xml @@ -120,7 +120,7 @@ - + insert into sys_integrated_foreground_task_parameter( id , @@ -156,7 +156,7 @@ ) - + insert into sys_integrated_foreground_task_parameter(formmain_id, in_parameter, remark, sorts, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, sts) values @@ -164,7 +164,7 @@ - + insert into sys_integrated_foreground_task_parameter(formmain_id, in_parameter, remark, sorts, create_user_id, create_time, modify_user_id, modify_time, sts, org_id) values diff --git a/service/src/main/java/com/hzya/frame/sysnew/messageManage/entity/SysMessageManageEntity.xml b/service/src/main/java/com/hzya/frame/sysnew/messageManage/entity/SysMessageManageEntity.xml index a4968ef5..e89991a8 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/messageManage/entity/SysMessageManageEntity.xml +++ b/service/src/main/java/com/hzya/frame/sysnew/messageManage/entity/SysMessageManageEntity.xml @@ -172,7 +172,7 @@ + > insert into sys_message_manage( id , @@ -216,7 +216,7 @@ ) - + insert into sys_message_manage(theme, code, send_app, send_api, data_type, remark, sorts, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, sts) values @@ -226,7 +226,7 @@ - + insert into sys_message_manage(theme, code, send_app, send_api, data_type, remark, sorts, create_user_id, create_time, modify_user_id, modify_time, sts, org_id) values diff --git a/service/src/main/java/com/hzya/frame/sysnew/messageManageDetail/entity/SysMessageManageDetailEntity.xml b/service/src/main/java/com/hzya/frame/sysnew/messageManageDetail/entity/SysMessageManageDetailEntity.xml index fde5ed64..8567830e 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/messageManageDetail/entity/SysMessageManageDetailEntity.xml +++ b/service/src/main/java/com/hzya/frame/sysnew/messageManageDetail/entity/SysMessageManageDetailEntity.xml @@ -162,8 +162,8 @@ + parameterType="com.hzya.frame.sysnew.messageManageDetail.entity.SysMessageManageDetailEntity" + > insert into sys_message_manage_detail( id , @@ -211,7 +211,7 @@ ) - + insert into sys_message_manage_detail(formmain_id, receive_name, receive_code, receive_app, receive_api, data_type, return_type, remark, sorts, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, sts) values @@ -221,7 +221,7 @@ - + insert into sys_message_manage_detail(formmain_id, receive_name, receive_code, receive_app, receive_api, data_type, return_type, remark, sorts, create_user_id, create_time, modify_user_id, modify_time, sts, org_id) values diff --git a/service/src/main/java/com/hzya/frame/sysnew/messageManageLog/entity/SysMessageManageLogEntity.xml b/service/src/main/java/com/hzya/frame/sysnew/messageManageLog/entity/SysMessageManageLogEntity.xml index a0135edf..52e822e8 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/messageManageLog/entity/SysMessageManageLogEntity.xml +++ b/service/src/main/java/com/hzya/frame/sysnew/messageManageLog/entity/SysMessageManageLogEntity.xml @@ -290,7 +290,7 @@ + > insert into @@ -357,7 +357,7 @@ ) - + insert into sys_message_manage_log(message_manage_id, theme, message_code, send_app, send_api, receive_code, receive_app, receive_api, source_data, target_data, return_data, return_type,error_status, status, remark, sorts, create_user_id, @@ -369,7 +369,7 @@ - + insert into sys_message_manage_log(message_manage_id, theme, message_code, send_app, send_api, receive_code, receive_app, receive_api, source_data, target_data, return_data, return_type,error_status, status, remark, sorts, create_user_id, diff --git a/service/src/main/java/com/hzya/frame/sysnew/messageManageLogBack/detail/entity/SysMessageManageLogDetailBackEntity.xml b/service/src/main/java/com/hzya/frame/sysnew/messageManageLogBack/detail/entity/SysMessageManageLogDetailBackEntity.xml index d8200586..99512ec8 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/messageManageLogBack/detail/entity/SysMessageManageLogDetailBackEntity.xml +++ b/service/src/main/java/com/hzya/frame/sysnew/messageManageLogBack/detail/entity/SysMessageManageLogDetailBackEntity.xml @@ -140,7 +140,7 @@ + > insert into sys_message_manage_log_detail_back( id , @@ -180,7 +180,7 @@ ) - + insert into sys_message_manage_log_detail_back(id,message_manage_id, source_data, target_data, return_data,sorts, create_user_id, create_time, modify_user_id, modify_time, sts, org_id) values @@ -189,7 +189,7 @@ - + insert into sys_message_manage_log_detail_back(message_manage_id, source_data, target_data, return_data, sorts, create_user_id, create_time, modify_user_id, modify_time, sts, org_id) values diff --git a/service/src/main/java/com/hzya/frame/sysnew/messageManageLogBack/entity/SysMessageManageLogBackEntity.xml b/service/src/main/java/com/hzya/frame/sysnew/messageManageLogBack/entity/SysMessageManageLogBackEntity.xml index 4bd5ff28..b4f63096 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/messageManageLogBack/entity/SysMessageManageLogBackEntity.xml +++ b/service/src/main/java/com/hzya/frame/sysnew/messageManageLogBack/entity/SysMessageManageLogBackEntity.xml @@ -273,7 +273,7 @@ + > insert into sys_message_manage_log_back( id , @@ -335,7 +335,7 @@ ) - + insert into sys_message_manage_log_back(id,message_manage_id, theme, message_code, send_app, send_api, receive_code, receive_app, receive_api, source_data, target_data, return_data, return_type,error_status, status, remark, sorts, create_user_id, create_time, modify_user_id, modify_time, sts, org_id) @@ -345,7 +345,7 @@ - + insert into sys_message_manage_log_back(message_manage_id, theme, message_code, send_app, send_api, receive_code, receive_app, receive_api, source_data, target_data, return_data, return_type,error_status, status, remark, sorts, create_user_id, create_time, modify_user_id, modify_time, sts, org_id) diff --git a/service/src/main/java/com/hzya/frame/sysnew/messageManageLogDetail/entity/SysMessageManageLogDetailEntity.xml b/service/src/main/java/com/hzya/frame/sysnew/messageManageLogDetail/entity/SysMessageManageLogDetailEntity.xml index c12fe5ed..b7ebe0b4 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/messageManageLogDetail/entity/SysMessageManageLogDetailEntity.xml +++ b/service/src/main/java/com/hzya/frame/sysnew/messageManageLogDetail/entity/SysMessageManageLogDetailEntity.xml @@ -140,7 +140,7 @@ + > insert into sys_message_manage_log_detail( id , @@ -176,7 +176,7 @@ ) - + insert into sys_message_manage_log_detail(message_manage_id, source_data, target_data, return_data,sorts, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, sts) values @@ -186,7 +186,7 @@ - + insert into sys_message_manage_log_detail(message_manage_id, source_data, target_data, return_data, sorts, create_user_id, create_time, modify_user_id, modify_time, sts, org_id) values diff --git a/service/src/main/java/com/hzya/frame/sysnew/plugArg/entity/SysPlugArgEntity.xml b/service/src/main/java/com/hzya/frame/sysnew/plugArg/entity/SysPlugArgEntity.xml index e58a4c4f..69b3daf8 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/plugArg/entity/SysPlugArgEntity.xml +++ b/service/src/main/java/com/hzya/frame/sysnew/plugArg/entity/SysPlugArgEntity.xml @@ -131,7 +131,7 @@ - + insert into sys_plug_arg( id , @@ -169,7 +169,7 @@ ) - + insert into sys_plug_arg(id, plug_id, plug_code, plug_name, remark, sorts, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, sts) values @@ -177,7 +177,7 @@ - + insert into sys_plug_arg(id, plug_id, plug_code, plug_name, remark, sorts, create_user_id, create_time, modify_user_id, modify_time, sts, org_id) values diff --git a/service/src/main/java/com/hzya/frame/sysnew/plugArgDeatil/entity/SysPlugArgDetailEntity.xml b/service/src/main/java/com/hzya/frame/sysnew/plugArgDeatil/entity/SysPlugArgDetailEntity.xml index 49543da7..91993353 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/plugArgDeatil/entity/SysPlugArgDetailEntity.xml +++ b/service/src/main/java/com/hzya/frame/sysnew/plugArgDeatil/entity/SysPlugArgDetailEntity.xml @@ -142,7 +142,7 @@ + > insert into sys_plug_arg_detail( id , @@ -184,7 +184,7 @@ ) - + insert into sys_plug_arg_detail(formmain_id, arg_code, arg_name, arg_type, remark, sorts, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, sts) values @@ -194,7 +194,7 @@ - + insert into sys_plug_arg_detail(formmain_id, arg_code, arg_name, arg_type, remark, sorts, create_user_id, create_time, modify_user_id, modify_time, sts, org_id) values From b11be510182acc98e776ada5d82ac25077754de5 Mon Sep 17 00:00:00 2001 From: xiang2lin <251481237@qq.com> Date: Wed, 19 Jun 2024 17:48:14 +0800 Subject: [PATCH 72/80] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=BE=BE=E6=A2=A6?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=BA=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../database/entity/SysApplicationDatabaseEntity.java | 3 +++ .../webapp/web/aop/AopDynamicRoutingDataSourceInit.java | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/service/src/main/java/com/hzya/frame/sysnew/application/database/entity/SysApplicationDatabaseEntity.java b/service/src/main/java/com/hzya/frame/sysnew/application/database/entity/SysApplicationDatabaseEntity.java index a7817419..19aba575 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/application/database/entity/SysApplicationDatabaseEntity.java +++ b/service/src/main/java/com/hzya/frame/sysnew/application/database/entity/SysApplicationDatabaseEntity.java @@ -159,6 +159,9 @@ public class SysApplicationDatabaseEntity extends BaseEntity { case "3": //mysql sourceTypeName = "mysql"; break; + case "4": //dm + sourceTypeName = "dm"; + break; default: } } diff --git a/webapp/src/main/java/com/hzya/frame/webapp/web/aop/AopDynamicRoutingDataSourceInit.java b/webapp/src/main/java/com/hzya/frame/webapp/web/aop/AopDynamicRoutingDataSourceInit.java index 9952517e..e4d9c3f1 100644 --- a/webapp/src/main/java/com/hzya/frame/webapp/web/aop/AopDynamicRoutingDataSourceInit.java +++ b/webapp/src/main/java/com/hzya/frame/webapp/web/aop/AopDynamicRoutingDataSourceInit.java @@ -116,9 +116,9 @@ public class AopDynamicRoutingDataSourceInit { } else if ("sqlServer".equalsIgnoreCase(source_type)) { driveClass = DataSourceUtilProperties.SQL2005DRIVER; } -// else if ("dm".equalsIgnoreCase(source_type)) { -// driveClass = DataSourceUtilProperties.dm; -// } + else if ("dm".equalsIgnoreCase(source_type)) { + driveClass = DataSourceUtilProperties.dm; + } try { //测试连接 Class.forName(driveClass); From 4e94526a30e3b48aef552388b53f75d006b15ed6 Mon Sep 17 00:00:00 2001 From: lvleigang <957075182@qq.com> Date: Thu, 20 Jun 2024 08:43:33 +0800 Subject: [PATCH 73/80] =?UTF-8?q?=E4=B8=BB=E6=95=B0=E6=8D=AE=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../plugin/MdmModulePluginInitializer.java | 580 +++++++++++++++-- .../com/hzya/frame/mdm/entity/MdmQuery.java | 10 + .../mdm/mdmModule/dao/IMdmModuleDao.java | 3 + .../mdmModule/dao/impl/MdmModuleDaoImpl.java | 10 + .../mdm/mdmModule/entity/MdmModuleEntity.xml | 50 +- .../service/impl/MdmModuleServiceImpl.java | 8 +- .../entity/MdmModuleDbFiledsEntity.xml | 8 + .../MdmModuleDistributeDetailEntity.xml | 592 ++++++++++-------- .../entity/MdmModuleSendLogEntity.java | 2 +- .../entity/MdmModuleSourceEntity.xml | 6 + .../mdm/service/impl/MdmServiceImpl.java | 174 ++++- 11 files changed, 1099 insertions(+), 344 deletions(-) diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/mdmDistribute/plugin/MdmModulePluginInitializer.java b/buildpackage/src/main/java/com/hzya/frame/plugin/mdmDistribute/plugin/MdmModulePluginInitializer.java index 7aff0fb1..23a36396 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/mdmDistribute/plugin/MdmModulePluginInitializer.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/mdmDistribute/plugin/MdmModulePluginInitializer.java @@ -2,7 +2,6 @@ package com.hzya.frame.plugin.mdmDistribute.plugin; import cn.hutool.core.util.StrUtil; import cn.hutool.json.JSONUtil; -import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import com.hzya.frame.base.PluginBaseEntity; import com.hzya.frame.mdm.mdmModule.dao.IMdmModuleDao; @@ -15,6 +14,8 @@ import com.hzya.frame.mdm.mdmModuleDistribute.dao.IMdmModuleDistributeDao; import com.hzya.frame.mdm.mdmModuleDistribute.entity.MdmModuleDistributeEntity; import com.hzya.frame.mdm.mdmModuleDistributeDetail.dao.IMdmModuleDistributeDetailDao; import com.hzya.frame.mdm.mdmModuleDistributeDetail.entity.MdmModuleDistributeDetailEntity; +import com.hzya.frame.mdm.mdmModuleSendLog.dao.IMdmModuleSendLogDao; +import com.hzya.frame.mdm.mdmModuleSendLog.entity.MdmModuleSendLogEntity; import com.hzya.frame.mdm.service.IMdmServiceCache; import com.hzya.frame.sysnew.application.api.dao.ISysApplicationApiDao; import com.hzya.frame.sysnew.application.api.entity.SysApplicationApiEntity; @@ -24,10 +25,9 @@ import com.hzya.frame.sysnew.application.entity.SysExtensionApiEntity; import com.hzya.frame.sysnew.application.script.dao.ISysApplicationScriptDao; import com.hzya.frame.sysnew.application.script.entity.SysApplicationScriptEntity; import com.hzya.frame.sysnew.grovy.service.IGroovyIntegrationService; -import com.hzya.frame.sysnew.integtationTaskLivingDetails.dao.IIntegrationTaskLivingDetailsDao; import com.hzya.frame.sysnew.integtationTaskLivingDetails.entity.IntegrationTaskLivingDetailsEntity; import com.hzya.frame.sysnew.integtationTaskLivingDetails.service.IIntegrationTaskLivingDetailsService; -import com.hzya.frame.sysnew.messageManageLog.entity.SysMessageManageLogEntity; +import com.hzya.frame.uuid.UUIDUtils; import com.hzya.frame.web.entity.BaseResult; import com.hzya.frame.web.entity.JsonResultEntity; import org.apache.http.HttpEntity; @@ -40,12 +40,12 @@ import org.apache.http.impl.client.HttpClientBuilder; import org.apache.http.util.EntityUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import javax.annotation.Resource; import java.io.IOException; -import java.lang.reflect.Method; +import java.util.ArrayList; +import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -78,6 +78,8 @@ public class MdmModulePluginInitializer extends PluginBaseEntity { private IMdmModuleDao mdmModuleDao; @Resource private IMdmServiceCache mdmServiceCache; + @Resource + private IMdmModuleSendLogDao mdmModuleSendLogDao; @Value("${ax.url}") private String url ; @@ -387,45 +389,35 @@ public class MdmModulePluginInitializer extends PluginBaseEntity { if(mdmModuleDistributeEntities == null || mdmModuleDistributeEntities.size() == 0){ continue; } - for (int i1 = 0; i1 < mdmModuleDistributeEntities.size(); i1++) { - //查询主数据db - MdmModuleDbEntity queryMdmModuleDbEntity = new MdmModuleDbEntity(); - queryMdmModuleDbEntity.setMdmId(mdmModuleEntities.get(i).getId()); - List mdmModuleDbEntities = mdmServiceCache.queryMdmModuleDb(queryMdmModuleDbEntity); - if(mdmModuleDbEntities == null || mdmModuleDbEntities.size() == 0){ - continue; - } - //查询主数据字段 - MdmModuleDbFiledsEntity queryFild = new MdmModuleDbFiledsEntity(); - queryFild.setMdmId(mdmModuleEntities.get(i).getId()); - List mdmModuleDbFiledsEntities = mdmServiceCache.queryMdmModuleDbFileds(queryFild); - if(mdmModuleDbFiledsEntities == null || mdmModuleDbFiledsEntities.size() == 0){ - continue; - } - //查询下发的配置 - MdmModuleDistributeDetailEntity mdmModuleDistributeDetailEntity = new MdmModuleDistributeDetailEntity() ; - mdmModuleDistributeDetailEntity.setDistributeId(mdmModuleDistributeEntities.get(i1).getId()); - mdmModuleDistributeDetailEntity.setSts("Y"); - List mdmModuleDistributeDetailEntities = mdmModuleDistributeDetailDao.queryBase(mdmModuleDistributeDetailEntity); - - - - + //查询主数据db + MdmModuleDbEntity queryMdmModuleDbEntity = new MdmModuleDbEntity(); + queryMdmModuleDbEntity.setMdmId(mdmModuleEntities.get(i).getId()); + List mdmModuleDbEntities = mdmServiceCache.queryMdmModuleDb(queryMdmModuleDbEntity); + if(mdmModuleDbEntities == null || mdmModuleDbEntities.size() == 0){ + continue; } + //查询主数据字段 + MdmModuleDbFiledsEntity queryFild = new MdmModuleDbFiledsEntity(); + queryFild.setMdmId(mdmModuleEntities.get(i).getId()); + List mdmModuleDbFiledsEntities = mdmServiceCache.queryMdmModuleDbFileds(queryFild); + if(mdmModuleDbFiledsEntities == null || mdmModuleDbFiledsEntities.size() == 0){ + continue; + } + //字段的规则 + MdmModuleDbFiledsRuleEntity queryFildRule = new MdmModuleDbFiledsRuleEntity(); + queryFildRule.setMdmId(mdmModuleEntities.get(i).getId()); + queryFildRule.setRuleCode("service"); + List mdmModuleDbFiledsRuleEntities = mdmModuleDbFiledsRuleDao.queryBase(queryFildRule); + + //新增 + doAdd(mdmModuleDbEntities,mdmModuleDistributeEntities,mdmModuleDbFiledsRuleEntities,mdmModuleDbFiledsEntities); + //修改 + doUpdate(mdmModuleDbEntities,mdmModuleDistributeEntities,mdmModuleDbFiledsRuleEntities,mdmModuleDbFiledsEntities); + //删除 + doDelete(mdmModuleDbEntities,mdmModuleDistributeEntities,mdmModuleDbFiledsRuleEntities,mdmModuleDbFiledsEntities); + } - //查询一千条数据 - - //查询这一千条数据是否符合规则 - - //查询是否已经手动发送过。只有新增校验,查询发送日志是否已经有这条数据 - - //组装数据发送 - - //保存日志 - - //所有下发发送完成,修改数据状态 - } } logger.info("执行成功"); @@ -436,6 +428,512 @@ public class MdmModulePluginInitializer extends PluginBaseEntity { return BaseResult.getSuccessMessageEntity("执行成功"); } + private void doDelete(List mdmModuleDbEntities, List mdmModuleDistributeEntities, List mdmModuleDbFiledsRuleEntities, List mdmModuleDbFiledsEntities) { + //查询一千条数据 + String mainDb = null; + List objects = new ArrayList<>(); + for (int i2 = 0; i2 < mdmModuleDbEntities.size(); i2++) { + if("1".equals(mdmModuleDbEntities.get(i2).getDbType())) { + mainDb = mdmModuleDbEntities.get(i2).getDbName(); + } + } + if(mainDb == null){ + return; + } + Map map1 = new HashMap<>(); + map1.put("tableName",mainDb); + map1.put("dataStatus", "N"); + map1.put("deleteStatus", "0"); + map1.put("size", 1000); + objects = mdmModuleDao.queryMdmSTs(map1); + + if(objects == null || objects.size() == 0){ + return; + } + for (int i1 = 0; i1 < mdmModuleDistributeEntities.size(); i1++) { + //查询下发的配置 + MdmModuleDistributeDetailEntity mdmModuleDistributeDetailEntity = new MdmModuleDistributeDetailEntity() ; + mdmModuleDistributeDetailEntity.setDistributeId(mdmModuleDistributeEntities.get(i1).getId()); + mdmModuleDistributeDetailEntity.setSts("Y"); + List mdmModuleDistributeDetailEntities = mdmModuleDistributeDetailDao.queryBase(mdmModuleDistributeDetailEntity); + //查询这一千条数据是否符合规则 + Map map = new HashMap<>(); + map.put("tableName", mainDb); + map.put("dataStatus", "N"); + map.put("deleteStatus", "0"); + map.put("mdmModuleDistributeDetailEntities", mdmModuleDistributeDetailEntities); + map.put("ids", objects); + List doObjects = mdmModuleDao.queryMdmSTs(map); + if(doObjects == null || doObjects.size() == 0){ + continue; + } + if(mdmModuleDistributeEntities.get(i1).getDeleteApi() == null || "".equals(mdmModuleDistributeEntities.get(i1).getDeleteApi())){ + for (int i = 0; i < doObjects.size(); i++) { + saveMdmModuleSendLogEntity(objects.get(i).getString("id"),null,null,doObjects.get(i).toJSONString(),"3"); + } + return ; + } + SysApplicationApiEntity apiEntity = sysApplicationApiDao.get(mdmModuleDistributeEntities.get(i1).getDeleteApi()); + if(apiEntity == null || apiEntity.getId() == null ){ + for (int i = 0; i < doObjects.size(); i++) { + saveMdmModuleSendLogEntity(objects.get(i).getString("id"),null,null,doObjects.get(i).toJSONString(),"3"); + } + return ; + } + SysApplicationEntity sysApplicationEntity = sysApplicationDao.get(apiEntity.getAppId()); + if(sysApplicationEntity == null || sysApplicationEntity.getId() == null ){ + for (int i = 0; i < doObjects.size(); i++) { + saveMdmModuleSendLogEntity(objects.get(i).getString("id"),null,apiEntity.getApiName(),doObjects.get(i).toJSONString(),"3"); + } + return ; + } + + SysApplicationScriptEntity scriptEntity = null; + if(mdmModuleDistributeEntities.get(i1).getDeleteScript() != null && !"".equals(mdmModuleDistributeEntities.get(i1).getDeleteScript())){ + scriptEntity = sysApplicationScriptDao.get(mdmModuleDistributeEntities.get(i1).getDeleteScript()); + if(scriptEntity == null || scriptEntity.getId() == null ){ + for (int i = 0; i < doObjects.size(); i++) { + saveMdmModuleSendLogEntity(objects.get(i).getString("id"),sysApplicationEntity.getName(),apiEntity.getApiName(),doObjects.get(i).toJSONString(),"3"); + } + return ; + } + } + + for (int i = 0; i < doObjects.size(); i++) { + //查询发送日志是否已经有这条数据 + MdmModuleSendLogEntity mdmModuleSendLogEntity = new MdmModuleSendLogEntity(); + mdmModuleSendLogEntity.setTableName(mainDb+"_send_log"); + mdmModuleSendLogEntity.setFormmainId(doObjects.get(i).getString("id")); + mdmModuleSendLogEntity.setSts("Y"); + mdmModuleSendLogEntity.setOptionType("3"); + Integer num = mdmModuleSendLogDao.getCount(mdmModuleSendLogEntity); + if(num > 0){//已经过不发送 + continue; + } + getDetailData(mdmModuleDbEntities,doObjects.get(i),mdmModuleDbFiledsRuleEntities,mdmModuleDbFiledsEntities); + + //执行脚本 + JSONObject groovy = new JSONObject(); + JSONObject parameterJson = new JSONObject(); + parameterJson.put("header",apiEntity.getHeaderIn()); + parameterJson.put("body",apiEntity.getBodyIn()); + parameterJson.put("query",apiEntity.getQueryIn()); + parameterJson.put("data",doObjects.get(i)); + /** head */ + Map header = null; + /** query */ + String querys = null; + /** body */ + String bodys = doObjects.get(i).toJSONString(); + if(scriptEntity != null && scriptEntity.getId() != null ){ + groovy.put("code",scriptEntity.getScriptCode()); + groovy.put("className",scriptEntity.getClassName()); + groovy.put("name",scriptEntity.getScriptName()); + groovy.put("methodStr",scriptEntity.getScriptData()); + groovy.put("parameterJson",parameterJson); + JSONObject groovyStr = new JSONObject(); + groovyStr.put("jsonStr",groovy); + try { + SysExtensionApiEntity jsonResultEntity = groovyIntegrationService.groovyScriptExecution(groovy); + header = jsonResultEntity.getHeaders(); + querys = jsonResultEntity.getQuerys(); + bodys = jsonResultEntity.getBodys(); + }catch (Exception e){ + saveMdmModuleSendLogEntity(objects.get(i).getString("id"),sysApplicationEntity.getName(),apiEntity.getApiName(),doObjects.get(i).toJSONString(),"3"); + continue; + } + } + Map headers = new HashMap<>(); + headers.put("publicKey","ZJYAWb7lhAUTYqekPkU+uHJv1/ObJxb7dT7sD8HPRDGAgyhCe7eDIk+3zDUT+v578prj"); + headers.put("secretKey","fviZnLBsQUAGF8w8FSOdJi7XlIm/XAZclMxRagDLfTyJFlvnIBF3w66Hrpfzs8cYj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA="); + headers.put("appId",sysApplicationEntity.getAppId().toString()); + headers.put("apiCode",apiEntity.getApiCode().toString()); + if(header != null){ + headers.putAll(header); + } + //组装数据发送 + JsonResultEntity jsonResultEntity = sendData(apiEntity,headers,bodys,querys); + if(jsonResultEntity.isFlag()){ + //保存日志 + saveMdmModuleSendLogEntity(objects.get(i).getString("id"),sysApplicationEntity.getName(),apiEntity.getApiName(),doObjects.get(i).toJSONString(),"3"); + continue; + }else { + //保存日志 + saveMdmModuleSendLogEntity(objects.get(i).getString("id"),sysApplicationEntity.getName(),apiEntity.getApiName(),doObjects.get(i).toJSONString(),"3"); + continue; + } + } + + } + + //所有下发发送完成,修改数据状态 + for (int i = 0; i < objects.size(); i++) { + Map updateMap = new HashMap<>(); + updateMap.put("tableName",mainDb); + updateMap.put("dataStatus", "N"); + updateMap.put("deleteStatus", "1"); + updateMap.put("id", objects.get(i).getString("id")); + mdmModuleDao.updateMdmSTs(updateMap); + } + } + + private void doUpdate(List mdmModuleDbEntities, List mdmModuleDistributeEntities, List mdmModuleDbFiledsRuleEntities, List mdmModuleDbFiledsEntities) { + //查询一千条数据 + String mainDb = null; + List objects = new ArrayList<>(); + for (int i2 = 0; i2 < mdmModuleDbEntities.size(); i2++) { + if("1".equals(mdmModuleDbEntities.get(i2).getDbType())) { + mainDb = mdmModuleDbEntities.get(i2).getDbName(); + } + } + if(mainDb == null){ + return; + } + Map map1 = new HashMap<>(); + map1.put("tableName",mainDb); + map1.put("dataStatus", "F"); + map1.put("updateStatus", "0"); + map1.put("size", 1000); + objects = mdmModuleDao.queryMdmSTs(map1); + + if(objects == null || objects.size() == 0){ + return; + } + for (int i1 = 0; i1 < mdmModuleDistributeEntities.size(); i1++) { + //查询下发的配置 + MdmModuleDistributeDetailEntity mdmModuleDistributeDetailEntity = new MdmModuleDistributeDetailEntity() ; + mdmModuleDistributeDetailEntity.setDistributeId(mdmModuleDistributeEntities.get(i1).getId()); + mdmModuleDistributeDetailEntity.setSts("Y"); + List mdmModuleDistributeDetailEntities = mdmModuleDistributeDetailDao.queryBase(mdmModuleDistributeDetailEntity); + //查询这一千条数据是否符合规则 + Map map = new HashMap<>(); + map.put("tableName", mainDb); + map.put("dataStatus", "F"); + map.put("updateStatus", "0"); + map.put("mdmModuleDistributeDetailEntities", mdmModuleDistributeDetailEntities); + map.put("ids", objects); + List doObjects = mdmModuleDao.queryMdmSTs(map); + if(doObjects == null || doObjects.size() == 0){ + continue; + } + if(mdmModuleDistributeEntities.get(i1).getUpdateApi() == null || "".equals(mdmModuleDistributeEntities.get(i1).getUpdateApi())){ + for (int i = 0; i < doObjects.size(); i++) { + saveMdmModuleSendLogEntity(objects.get(i).getString("id"),null,null,doObjects.get(i).toJSONString(),"2"); + } + return ; + } + SysApplicationApiEntity apiEntity = sysApplicationApiDao.get(mdmModuleDistributeEntities.get(i1).getUpdateApi()); + if(apiEntity == null || apiEntity.getId() == null ){ + for (int i = 0; i < doObjects.size(); i++) { + saveMdmModuleSendLogEntity(objects.get(i).getString("id"),null,null,doObjects.get(i).toJSONString(),"2"); + } + return ; + } + SysApplicationEntity sysApplicationEntity = sysApplicationDao.get(apiEntity.getAppId()); + if(sysApplicationEntity == null || sysApplicationEntity.getId() == null ){ + for (int i = 0; i < doObjects.size(); i++) { + saveMdmModuleSendLogEntity(objects.get(i).getString("id"),null,apiEntity.getApiName(),doObjects.get(i).toJSONString(),"2"); + } + return ; + } + + SysApplicationScriptEntity scriptEntity = null; + if(mdmModuleDistributeEntities.get(i1).getUpdateScript() != null && !"".equals(mdmModuleDistributeEntities.get(i1).getUpdateScript())){ + scriptEntity = sysApplicationScriptDao.get(mdmModuleDistributeEntities.get(i1).getUpdateScript()); + if(scriptEntity == null || scriptEntity.getId() == null ){ + for (int i = 0; i < doObjects.size(); i++) { + saveMdmModuleSendLogEntity(objects.get(i).getString("id"),sysApplicationEntity.getName(),apiEntity.getApiName(),doObjects.get(i).toJSONString(),"2"); + } + return ; + } + } + + for (int i = 0; i < doObjects.size(); i++) { + + getDetailData(mdmModuleDbEntities,doObjects.get(i),mdmModuleDbFiledsRuleEntities,mdmModuleDbFiledsEntities); + + //执行脚本 + JSONObject groovy = new JSONObject(); + JSONObject parameterJson = new JSONObject(); + parameterJson.put("header",apiEntity.getHeaderIn()); + parameterJson.put("body",apiEntity.getBodyIn()); + parameterJson.put("query",apiEntity.getQueryIn()); + parameterJson.put("data",doObjects.get(i)); + /** head */ + Map header = null; + /** query */ + String querys = null; + /** body */ + String bodys = doObjects.get(i).toJSONString(); + if(scriptEntity != null && scriptEntity.getId() != null ){ + groovy.put("code",scriptEntity.getScriptCode()); + groovy.put("className",scriptEntity.getClassName()); + groovy.put("name",scriptEntity.getScriptName()); + groovy.put("methodStr",scriptEntity.getScriptData()); + groovy.put("parameterJson",parameterJson); + JSONObject groovyStr = new JSONObject(); + groovyStr.put("jsonStr",groovy); + try { + SysExtensionApiEntity jsonResultEntity = groovyIntegrationService.groovyScriptExecution(groovy); + header = jsonResultEntity.getHeaders(); + querys = jsonResultEntity.getQuerys(); + bodys = jsonResultEntity.getBodys(); + }catch (Exception e){ + saveMdmModuleSendLogEntity(objects.get(i).getString("id"),sysApplicationEntity.getName(),apiEntity.getApiName(),doObjects.get(i).toJSONString(),"2"); + continue; + } + } + Map headers = new HashMap<>(); + headers.put("publicKey","ZJYAWb7lhAUTYqekPkU+uHJv1/ObJxb7dT7sD8HPRDGAgyhCe7eDIk+3zDUT+v578prj"); + headers.put("secretKey","fviZnLBsQUAGF8w8FSOdJi7XlIm/XAZclMxRagDLfTyJFlvnIBF3w66Hrpfzs8cYj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA="); + headers.put("appId",sysApplicationEntity.getAppId().toString()); + headers.put("apiCode",apiEntity.getApiCode().toString()); + if(header != null){ + headers.putAll(header); + } + //组装数据发送 + JsonResultEntity jsonResultEntity = sendData(apiEntity,headers,bodys,querys); + if(jsonResultEntity.isFlag()){ + //保存日志 + saveMdmModuleSendLogEntity(objects.get(i).getString("id"),sysApplicationEntity.getName(),apiEntity.getApiName(),doObjects.get(i).toJSONString(),"2"); + continue; + }else { + //保存日志 + saveMdmModuleSendLogEntity(objects.get(i).getString("id"),sysApplicationEntity.getName(),apiEntity.getApiName(),doObjects.get(i).toJSONString(),"2"); + continue; + } + } + } + + //所有下发发送完成,修改数据状态 + for (int i = 0; i < objects.size(); i++) { + Map updateMap = new HashMap<>(); + updateMap.put("tableName",mainDb); + updateMap.put("dataStatus", "F"); + updateMap.put("updateStatus", "1"); + updateMap.put("id", objects.get(i).getString("id")); + mdmModuleDao.updateMdmSTs(updateMap); + } + } + + /** + * @Author lvleigang + * @Description 处理新增数据 + * @Date 1:55 下午 2024/6/19 + * @param mdmModuleDbEntities + * @param mdmModuleDistributeEntities + * @return void + **/ + private void doAdd(List mdmModuleDbEntities, List mdmModuleDistributeEntities,List mdmModuleDbFiledsRuleEntities,List mdmModuleDbFiledsEntities ) { + //查询一千条数据 + String mainDb = null; + List objects = new ArrayList<>(); + for (int i2 = 0; i2 < mdmModuleDbEntities.size(); i2++) { + if("1".equals(mdmModuleDbEntities.get(i2).getDbType())) { + mainDb = mdmModuleDbEntities.get(i2).getDbName(); + } + } + if(mainDb == null){ + return; + } + Map map1 = new HashMap<>(); + map1.put("tableName",mainDb); + map1.put("dataStatus", "Y"); + map1.put("addStatus", "0"); + map1.put("size", 1000); + objects = mdmModuleDao.queryMdmSTs(map1); + + if(objects == null || objects.size() == 0){ + return; + } + for (int i1 = 0; i1 < mdmModuleDistributeEntities.size(); i1++) { + //查询下发的配置 + MdmModuleDistributeDetailEntity mdmModuleDistributeDetailEntity = new MdmModuleDistributeDetailEntity() ; + mdmModuleDistributeDetailEntity.setDistributeId(mdmModuleDistributeEntities.get(i1).getId()); + mdmModuleDistributeDetailEntity.setSts("Y"); + List mdmModuleDistributeDetailEntities = mdmModuleDistributeDetailDao.queryBase(mdmModuleDistributeDetailEntity); + //查询这一千条数据是否符合规则 + Map map = new HashMap<>(); + map.put("tableName", mainDb); + map.put("dataStatus", "Y"); + map.put("addStatus", "0"); + map.put("mdmModuleDistributeDetailEntities", mdmModuleDistributeDetailEntities); + map.put("ids", objects); + List doObjects = mdmModuleDao.queryMdmSTs(map); + if(doObjects == null || doObjects.size() == 0){ + continue; + } + if(mdmModuleDistributeEntities.get(i1).getAddApi() == null || "".equals(mdmModuleDistributeEntities.get(i1).getAddApi())){ + for (int i = 0; i < doObjects.size(); i++) { + saveMdmModuleSendLogEntity(objects.get(i).getString("id"),null,null,doObjects.get(i).toJSONString(),"1"); + } + return ; + } + SysApplicationApiEntity apiEntity = sysApplicationApiDao.get(mdmModuleDistributeEntities.get(i1).getAddApi()); + if(apiEntity == null || apiEntity.getId() == null ){ + for (int i = 0; i < doObjects.size(); i++) { + saveMdmModuleSendLogEntity(objects.get(i).getString("id"),null,null,doObjects.get(i).toJSONString(),"1"); + } + return ; + } + SysApplicationEntity sysApplicationEntity = sysApplicationDao.get(apiEntity.getAppId()); + if(sysApplicationEntity == null || sysApplicationEntity.getId() == null ){ + for (int i = 0; i < doObjects.size(); i++) { + saveMdmModuleSendLogEntity(objects.get(i).getString("id"),null,apiEntity.getApiName(),doObjects.get(i).toJSONString(),"1"); + } + return ; + } + + SysApplicationScriptEntity scriptEntity = null; + if(mdmModuleDistributeEntities.get(i1).getAddScript() != null && !"".equals(mdmModuleDistributeEntities.get(i1).getAddScript())){ + scriptEntity = sysApplicationScriptDao.get(mdmModuleDistributeEntities.get(i1).getAddScript()); + if(scriptEntity == null || scriptEntity.getId() == null ){ + for (int i = 0; i < doObjects.size(); i++) { + saveMdmModuleSendLogEntity(objects.get(i).getString("id"),sysApplicationEntity.getName(),apiEntity.getApiName(),doObjects.get(i).toJSONString(),"1"); + } + return ; + } + } + + for (int i = 0; i < doObjects.size(); i++) { + //查询是否已经手动发送过。只有新增校验,查询发送日志是否已经有这条数据 + MdmModuleSendLogEntity mdmModuleSendLogEntity = new MdmModuleSendLogEntity(); + mdmModuleSendLogEntity.setTableName(mainDb+"_send_log"); + mdmModuleSendLogEntity.setFormmainId(doObjects.get(i).getString("id")); + mdmModuleSendLogEntity.setSts("Y"); + mdmModuleSendLogEntity.setOptionType("1"); + Integer num = mdmModuleSendLogDao.getCount(mdmModuleSendLogEntity); + if(num > 0){//已经新增过不发送 + continue; + } + getDetailData(mdmModuleDbEntities,doObjects.get(i),mdmModuleDbFiledsRuleEntities,mdmModuleDbFiledsEntities); + + //执行脚本 + JSONObject groovy = new JSONObject(); + JSONObject parameterJson = new JSONObject(); + parameterJson.put("header",apiEntity.getHeaderIn()); + parameterJson.put("body",apiEntity.getBodyIn()); + parameterJson.put("query",apiEntity.getQueryIn()); + parameterJson.put("data",doObjects.get(i)); + /** head */ + Map header = null; + /** query */ + String querys = null; + /** body */ + String bodys = doObjects.get(i).toJSONString(); + if(scriptEntity != null && scriptEntity.getId() != null ){ + groovy.put("code",scriptEntity.getScriptCode()); + groovy.put("className",scriptEntity.getClassName()); + groovy.put("name",scriptEntity.getScriptName()); + groovy.put("methodStr",scriptEntity.getScriptData()); + groovy.put("parameterJson",parameterJson); + JSONObject groovyStr = new JSONObject(); + groovyStr.put("jsonStr",groovy); + try { + SysExtensionApiEntity jsonResultEntity = groovyIntegrationService.groovyScriptExecution(groovy); + header = jsonResultEntity.getHeaders(); + querys = jsonResultEntity.getQuerys(); + bodys = jsonResultEntity.getBodys(); + }catch (Exception e){ + saveMdmModuleSendLogEntity(objects.get(i).getString("id"),sysApplicationEntity.getName(),apiEntity.getApiName(),doObjects.get(i).toJSONString(),"1"); + continue; + } + } + Map headers = new HashMap<>(); + headers.put("publicKey","ZJYAWb7lhAUTYqekPkU+uHJv1/ObJxb7dT7sD8HPRDGAgyhCe7eDIk+3zDUT+v578prj"); + headers.put("secretKey","fviZnLBsQUAGF8w8FSOdJi7XlIm/XAZclMxRagDLfTyJFlvnIBF3w66Hrpfzs8cYj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA="); + headers.put("appId",sysApplicationEntity.getAppId().toString()); + headers.put("apiCode",apiEntity.getApiCode().toString()); + if(header != null){ + headers.putAll(header); + } + //组装数据发送 + JsonResultEntity jsonResultEntity = sendData(apiEntity,headers,bodys,querys); + if(jsonResultEntity.isFlag()){ + //保存日志 + saveMdmModuleSendLogEntity(objects.get(i).getString("id"),sysApplicationEntity.getName(),apiEntity.getApiName(),doObjects.get(i).toJSONString(),"1"); + continue; + }else { + //保存日志 + saveMdmModuleSendLogEntity(objects.get(i).getString("id"),sysApplicationEntity.getName(),apiEntity.getApiName(),doObjects.get(i).toJSONString(),"1"); + continue; + } + } + + + + + + } + + //所有下发发送完成,修改数据状态 + for (int i = 0; i < objects.size(); i++) { + Map updateMap = new HashMap<>(); + updateMap.put("tableName",mainDb); + updateMap.put("dataStatus", "Y"); + updateMap.put("addStatus", "1"); + updateMap.put("id", objects.get(i).getString("id")); + mdmModuleDao.updateMdmSTs(updateMap); + } + } + + private void saveMdmModuleSendLogEntity(String formmain_id,String target_app,String target_api,String source_data, String option_type) { + MdmModuleSendLogEntity mdmModuleSendLogEntity = new MdmModuleSendLogEntity(); + mdmModuleSendLogEntity.setCreate(); + mdmModuleSendLogEntity.setId(UUIDUtils.getUUID()); + mdmModuleSendLogEntity.setSts("Y"); + mdmModuleSendLogEntity.setCreate_user_id("1"); + mdmModuleSendLogEntity.setModify_user_id("1"); + mdmModuleSendLogEntity.setCreate_time(new Date()); + mdmModuleSendLogEntity.setModify_time(new Date()); + mdmModuleSendLogEntity.setOrg_id("0"); + mdmModuleSendLogEntity.setCompanyId("0"); + mdmModuleSendLogEntity.setFormmainId(formmain_id); + mdmModuleSendLogEntity.setTargetApp(target_app); + mdmModuleSendLogEntity.setTargetApi(target_api); + mdmModuleSendLogEntity.setSourceData(source_data); + mdmModuleSendLogEntity.setOptionType(option_type); + mdmModuleSendLogDao.save(mdmModuleSendLogEntity); + } + + private JSONObject getDetailData(List mdmModuleDbEntities, JSONObject object, List mdmModuleDbFiledsRuleEntities,List mdmModuleDbFiledsEntities) { + + for (int i = 0; i < mdmModuleDbEntities.size(); i++) { + if("2".equals(mdmModuleDbEntities.get(i).getDbType())){ + Map map = new HashMap<>(); + map.put("tableName",mdmModuleDbEntities.get(i).getDbName()); + map.put("formmainId",object.getString("id")); + List detail = mdmModuleDao.queryMdmSTDetail(map); + //查看主表是否有字段是关联的 + if(detail != null && detail.size() > 0){ + if(mdmModuleDbFiledsRuleEntities != null && mdmModuleDbFiledsRuleEntities.size() > 0){ + for (int i1 = 0; i1 < mdmModuleDbFiledsRuleEntities.size(); i1++) { + if(mdmModuleDbFiledsRuleEntities.get(i1).getDbId().equals(mdmModuleDbEntities.get(i).getId())){ + if(mdmModuleDbFiledsEntities != null && mdmModuleDbFiledsEntities.size() > 0){ + for (int i2 = 0; i2 < mdmModuleDbFiledsEntities.size(); i2++) { + if(mdmModuleDbFiledsRuleEntities.get(i1).getFiledId().equals(mdmModuleDbFiledsEntities.get(i2).getId())){ + for (int i3 = 0; i3 < detail.size(); i3++) { + Map mapDetail = new HashMap<>(); + mapDetail.put("tableName",mdmModuleDbFiledsRuleEntities.get(i1).getRuleValue()); + mapDetail.put("id",detail.get(i3).getString(mdmModuleDbFiledsEntities.get(i2).getEnName())); + JSONObject objectDetail = mdmModuleDao.queryMdmST(mapDetail); + detail.get(i3).put(mdmModuleDbFiledsEntities.get(i2).getEnName(),objectDetail); + } + } + } + } + } + } + } + } + object.put(mdmModuleDbEntities.get(i).getDbName(),detail); + } + } + + return object; + } + + private JsonResultEntity sendData(SysApplicationApiEntity applicationApiEntity, Map headers ,String bodys ,String querys) { StringBuffer urls = new StringBuffer(url); if (querys != null) { diff --git a/service/src/main/java/com/hzya/frame/mdm/entity/MdmQuery.java b/service/src/main/java/com/hzya/frame/mdm/entity/MdmQuery.java index bda7c895..be40977f 100644 --- a/service/src/main/java/com/hzya/frame/mdm/entity/MdmQuery.java +++ b/service/src/main/java/com/hzya/frame/mdm/entity/MdmQuery.java @@ -9,6 +9,8 @@ public class MdmQuery { //分页 private Integer pageNum; + //分页 + private Long mdmCode; private Integer pageSize; //表名 private String tableName; @@ -66,4 +68,12 @@ public class MdmQuery { public void setDetailQueryCondition(List detailQueryCondition) { this.detailQueryCondition = detailQueryCondition; } + + public Long getMdmCode() { + return mdmCode; + } + + public void setMdmCode(Long mdmCode) { + this.mdmCode = mdmCode; + } } diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModule/dao/IMdmModuleDao.java b/service/src/main/java/com/hzya/frame/mdm/mdmModule/dao/IMdmModuleDao.java index 482285af..c13defa1 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModule/dao/IMdmModuleDao.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModule/dao/IMdmModuleDao.java @@ -52,5 +52,8 @@ public interface IMdmModuleDao extends IBaseDao { JSONObject queryMdmST(Map maps); List queryMdmSTDetail(Map maps); + List queryMdmSTs(Map map); + + void updateMdmSTs(Map updateMap); } diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModule/dao/impl/MdmModuleDaoImpl.java b/service/src/main/java/com/hzya/frame/mdm/mdmModule/dao/impl/MdmModuleDaoImpl.java index d17aa1d0..497b69b5 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModule/dao/impl/MdmModuleDaoImpl.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModule/dao/impl/MdmModuleDaoImpl.java @@ -152,6 +152,16 @@ public class MdmModuleDaoImpl extends MybatisGenericDao JSONObject o = (JSONObject) super.selectOne(getSqlIdPrifx() + "queryMdmST", maps); return o; } + @Override + public List queryMdmSTs(Map maps) { + List o = (List) super.selectList(getSqlIdPrifx() + "queryMdmST", maps); + return o; + } + + @Override + public void updateMdmSTs(Map maps) { + super.update(getSqlIdPrifx() + "updateMdmSTs", maps); + } @Override public List queryMdmSTDetail(Map maps) { 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 c1a13e78..931920b1 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 @@ -751,7 +751,8 @@ where id = #{id} update ${tableName} set - sts='N',modify_time = now(),modify_user_id = #{loginId} + data_status ='N',modify_time = now(),modify_user_id = #{loginId} + ,delete_status = '0' and id = #{id} and formmain_id = #{formmain_id} @@ -761,7 +762,7 @@ where id = #{id} update ${tableName} set - sts='N',modify_time = now(),modify_user_id = #{loginId} + data_status='N',modify_time = now(),modify_user_id = #{loginId},delete_status = '0' and ${upIdFiled} like concat(#{upIdFiledValue},'%') @@ -803,6 +804,10 @@ where id = #{id} select * from ${tableName} and document_rule = #{documentRule} + and data_status = #{dataStatus} + and add_status = #{addStatus} + and update_status = #{updateStatus} + and delete_status = #{deleteStatus} and id = #{id} AND @@ -825,16 +830,39 @@ where id = #{id} #{item.filedVaule} - and + + + ${item.rightParenthesis} and + + + ${item.rightParenthesis} + + - or + + + ${item.rightParenthesis} or + + + ${item.rightParenthesis} + + + + ${item.rightParenthesis} + - ${item.rightParenthesis} + + + + AND id in + + #{item.id} and sts = 'Y' + limit #{size} @@ -843,5 +871,17 @@ where id = #{id} parameterType="java.util.HashMap"> select * from ${tableName} where sts='Y' and formmain_id = #{formmainId} + + + update ${tableName} set + + , add_status = #{addStatus} + ,modify_time = now() + + + and id = #{id} + and data_status = #{dataStatus} + + 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 84dba275..59217212 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 @@ -558,7 +558,7 @@ public class MdmModuleServiceImpl extends BaseService i documentRule.setShowType("1"); documentRule.setQueryType("1"); documentRule.setListType("1"); - documentRule.setViewType("2"); + documentRule.setViewType("1"); documentRule.setFiledLength("50"); documentRule.setCreate(); documentRule.setDataType("1"); @@ -780,14 +780,14 @@ public class MdmModuleServiceImpl extends BaseService i data_status.setMdmId(entity.getMdmId()); data_status.setDbId(entity.getId()); data_status.setEnName("data_status"); - data_status.setChName("数据状态 Y正常 N删除 F修改"); + data_status.setChName("数据状态"); data_status.setFiledType("3"); data_status.setAddType("2"); data_status.setUpdateType("2"); data_status.setShowType("2"); data_status.setQueryType("2"); - data_status.setListType("2"); - data_status.setViewType("2"); + data_status.setListType("1"); + data_status.setViewType("1"); data_status.setFiledLength("1"); data_status.setCreate(); data_status.setDataType("1"); diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDbFileds/entity/MdmModuleDbFiledsEntity.xml b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDbFileds/entity/MdmModuleDbFiledsEntity.xml index cdac2db1..540c0e9f 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDbFileds/entity/MdmModuleDbFiledsEntity.xml +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDbFileds/entity/MdmModuleDbFiledsEntity.xml @@ -76,6 +76,14 @@ and sts = #{sts} and org_id = #{org_id} and company_id = #{companyId} + + and id in ( + select + filed_id + from mdm_module_db_fileds_rule + where sts='Y' and rule_code = #{roletype} and rule_value = #{roleValue} + ) + and sts='Y' order by sorts asc diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistributeDetail/entity/MdmModuleDistributeDetailEntity.xml b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistributeDetail/entity/MdmModuleDistributeDetailEntity.xml index ceef3625..df6e705c 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistributeDetail/entity/MdmModuleDistributeDetailEntity.xml +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistributeDetail/entity/MdmModuleDistributeDetailEntity.xml @@ -2,30 +2,31 @@ - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + - + id ,mdm_id ,distribute_id @@ -47,274 +48,311 @@ ,org_id ,company_id - - + select + + from mdm_module_distribute_detail + + and id = #{id} + and mdm_id = #{mdmId} + and distribute_id = #{distributeId} + and api_id = #{apiId} + and data_type = #{dataType} + and left_bracket = #{leftBracket} + and filed_id = #{filedId} + and filed_name = #{filedName} + and compare_type = #{compareType} + and filed_vaule = #{filedVaule} + and connection_symbol = #{connectionSymbol} + + and right_parenthesis = #{rightParenthesis} + + and sorts = #{sorts} + and create_user_id = #{create_user_id} + and create_time = #{create_time} + and modify_user_id = #{modify_user_id} + and modify_time = #{modify_time} + and sts = #{sts} + and org_id = #{org_id} + and company_id = #{companyId} and sts='Y' - - order by sorts asc - order by ${sort} ${order} - - - - + + + - + select + + from mdm_module_distribute_detail + + and id like concat('%',#{id},'%') + and mdm_id like concat('%',#{mdmId},'%') + and distribute_id like + concat('%',#{distributeId},'%') + + and api_id like concat('%',#{apiId},'%') + and data_type like concat('%',#{dataType},'%') + and left_bracket like concat('%',#{leftBracket},'%') + + and filed_id like concat('%',#{filedId},'%') + and filed_name like concat('%',#{filedName},'%') + and compare_type like concat('%',#{compareType},'%') + + and filed_vaule like concat('%',#{filedVaule},'%') + and connection_symbol like + concat('%',#{connectionSymbol},'%') + + and right_parenthesis like + concat('%',#{rightParenthesis},'%') + + and sorts like concat('%',#{sorts},'%') + and create_user_id like + concat('%',#{create_user_id},'%') + + and create_time like concat('%',#{create_time},'%') + and modify_user_id like + concat('%',#{modify_user_id},'%') + + and modify_time like concat('%',#{modify_time},'%') + and sts like concat('%',#{sts},'%') + and org_id like concat('%',#{org_id},'%') + and company_id like concat('%',#{companyId},'%') and sts='Y' - - order by sorts asc - order by ${sort} ${order} - + + order by sorts asc + order by ${sort} ${order} + - - + select + + from mdm_module_distribute_detail + + or id = #{id} + or mdm_id = #{mdmId} + or distribute_id = #{distributeId} + or api_id = #{apiId} + or data_type = #{dataType} + or left_bracket = #{leftBracket} + or filed_id = #{filedId} + or filed_name = #{filedName} + or compare_type = #{compareType} + or filed_vaule = #{filedVaule} + or connection_symbol = #{connectionSymbol} + + or right_parenthesis = #{rightParenthesis} + + or sorts = #{sorts} + or create_user_id = #{create_user_id} + or create_time = #{create_time} + or modify_user_id = #{modify_user_id} + or modify_time = #{modify_time} + or sts = #{sts} + or org_id = #{org_id} + or company_id = #{companyId} and sts='Y' - - order by sorts asc - order by ${sort} ${order} - + + order by sorts asc + order by ${sort} ${order} + - - - insert into mdm_module_distribute_detail( - - id , - mdm_id , - distribute_id , - api_id , - data_type , - left_bracket , - filed_id , - filed_name , - compare_type , - filed_vaule , - connection_symbol , - right_parenthesis , - sorts , - create_user_id , - create_time , - modify_user_id , - modify_time , - sts , - org_id , - company_id , + + + insert into mdm_module_distribute_detail( + + id , + mdm_id , + distribute_id , + api_id , + data_type , + left_bracket , + filed_id , + filed_name , + compare_type , + filed_vaule , + connection_symbol , + right_parenthesis , + sorts , + create_user_id , + create_time , + modify_user_id , + modify_time , + sts , + org_id , + company_id , sorts, - sts, - - )values( - - #{id} , - #{mdmId} , - #{distributeId} , - #{apiId} , - #{dataType} , - #{leftBracket} , - #{filedId} , - #{filedName} , - #{compareType} , - #{filedVaule} , - #{connectionSymbol} , - #{rightParenthesis} , - #{sorts} , - #{create_user_id} , - #{create_time} , - #{modify_user_id} , - #{modify_time} , - #{sts} , - #{org_id} , - #{companyId} , - (select (max(IFNULL( a.sorts, 0 )) + 1) as sort from mdm_module_distribute_detail a WHERE a.sts = 'Y' ), - 'Y', - - ) - - - - insert into mdm_module_distribute_detail(mdm_id, distribute_id, api_id, data_type, left_bracket, filed_id, filed_name, compare_type, filed_vaule, connection_symbol, right_parenthesis, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, sts) - values - - (#{entity.mdmId},#{entity.distributeId},#{entity.apiId},#{entity.dataType},#{entity.leftBracket},#{entity.filedId},#{entity.filedName},#{entity.compareType},#{entity.filedVaule},#{entity.connectionSymbol},#{entity.rightParenthesis},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId}, 'Y') - - - - - insert into mdm_module_distribute_detail(mdm_id, distribute_id, api_id, data_type, left_bracket, filed_id, filed_name, compare_type, filed_vaule, connection_symbol, right_parenthesis, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id) - values - - (#{entity.mdmId},#{entity.distributeId},#{entity.apiId},#{entity.dataType},#{entity.leftBracket},#{entity.filedId},#{entity.filedName},#{entity.compareType},#{entity.filedVaule},#{entity.connectionSymbol},#{entity.rightParenthesis},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId}) - - on duplicate key update - mdm_id = values(mdm_id), - distribute_id = values(distribute_id), - api_id = values(api_id), - data_type = values(data_type), - left_bracket = values(left_bracket), - filed_id = values(filed_id), - filed_name = values(filed_name), - compare_type = values(compare_type), - filed_vaule = values(filed_vaule), - connection_symbol = values(connection_symbol), - right_parenthesis = values(right_parenthesis), - create_user_id = values(create_user_id), - create_time = values(create_time), - modify_user_id = values(modify_user_id), - modify_time = values(modify_time), - sts = values(sts), - org_id = values(org_id), - company_id = values(company_id) - - -update mdm_module_distribute_detail set - - mdm_id = #{mdmId}, - distribute_id = #{distributeId}, - api_id = #{apiId}, - data_type = #{dataType}, - left_bracket = #{leftBracket}, - filed_id = #{filedId}, - filed_name = #{filedName}, - compare_type = #{compareType}, - filed_vaule = #{filedVaule}, - connection_symbol = #{connectionSymbol}, - right_parenthesis = #{rightParenthesis}, - create_user_id = #{create_user_id}, - create_time = #{create_time}, - modify_user_id = #{modify_user_id}, - modify_time = #{modify_time}, - sts = #{sts}, - org_id = #{org_id}, - company_id = #{companyId}, - -where id = #{id} - - - + sts, + + )values( + + #{id} , + #{mdmId} , + #{distributeId} , + #{apiId} , + #{dataType} , + #{leftBracket} , + #{filedId} , + #{filedName} , + #{compareType} , + #{filedVaule} , + #{connectionSymbol} , + #{rightParenthesis} , + #{sorts} , + #{create_user_id} , + #{create_time} , + #{modify_user_id} , + #{modify_time} , + #{sts} , + #{org_id} , + #{companyId} , + (select (max(IFNULL( a.sorts, 0 )) + 1) as sort from mdm_module_distribute_detail + a WHERE a.sts = 'Y' ), + + 'Y', + + ) + + + + insert into mdm_module_distribute_detail(mdm_id, distribute_id, api_id, data_type, left_bracket, filed_id, + filed_name, compare_type, filed_vaule, connection_symbol, right_parenthesis, create_user_id, create_time, + modify_user_id, modify_time, sts, org_id, company_id, sts) + values + + (#{entity.mdmId},#{entity.distributeId},#{entity.apiId},#{entity.dataType},#{entity.leftBracket},#{entity.filedId},#{entity.filedName},#{entity.compareType},#{entity.filedVaule},#{entity.connectionSymbol},#{entity.rightParenthesis},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId}, + 'Y') + + + + + insert into mdm_module_distribute_detail(mdm_id, distribute_id, api_id, data_type, left_bracket, filed_id, + filed_name, compare_type, filed_vaule, connection_symbol, right_parenthesis, create_user_id, create_time, + modify_user_id, modify_time, sts, org_id, company_id) + values + + (#{entity.mdmId},#{entity.distributeId},#{entity.apiId},#{entity.dataType},#{entity.leftBracket},#{entity.filedId},#{entity.filedName},#{entity.compareType},#{entity.filedVaule},#{entity.connectionSymbol},#{entity.rightParenthesis},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId}) + + on duplicate key update + mdm_id = values(mdm_id), + distribute_id = values(distribute_id), + api_id = values(api_id), + data_type = values(data_type), + left_bracket = values(left_bracket), + filed_id = values(filed_id), + filed_name = values(filed_name), + compare_type = values(compare_type), + filed_vaule = values(filed_vaule), + connection_symbol = values(connection_symbol), + right_parenthesis = values(right_parenthesis), + create_user_id = values(create_user_id), + create_time = values(create_time), + modify_user_id = values(modify_user_id), + modify_time = values(modify_time), + sts = values(sts), + org_id = values(org_id), + company_id = values(company_id) + + + + update mdm_module_distribute_detail set + + mdm_id = #{mdmId}, + distribute_id = #{distributeId}, + api_id = #{apiId}, + data_type = #{dataType}, + left_bracket = #{leftBracket}, + filed_id = #{filedId}, + filed_name = #{filedName}, + compare_type = #{compareType}, + filed_vaule = #{filedVaule}, + connection_symbol = #{connectionSymbol}, + right_parenthesis = #{rightParenthesis}, + create_user_id = #{create_user_id}, + create_time = #{create_time}, + modify_user_id = #{modify_user_id}, + modify_time = #{modify_time}, + sts = #{sts}, + org_id = #{org_id}, + company_id = #{companyId}, + + where id = #{id} + + + update mdm_module_distribute_detail set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} where id = #{id} - - -update mdm_module_distribute_detail set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} - - and id = #{id} - and mdm_id = #{mdmId} - and distribute_id = #{distributeId} - and api_id = #{apiId} - and data_type = #{dataType} - and left_bracket = #{leftBracket} - and filed_id = #{filedId} - and filed_name = #{filedName} - and compare_type = #{compareType} - and filed_vaule = #{filedVaule} - and connection_symbol = #{connectionSymbol} - and right_parenthesis = #{rightParenthesis} - and sorts = #{sorts} - and sts = #{sts} - and company_id = #{companyId} + + + update mdm_module_distribute_detail set sts= 'N' ,modify_time = #{modify_time},modify_user_id = + #{modify_user_id} + + and id = #{id} + and mdm_id = #{mdmId} + and distribute_id = #{distributeId} + and api_id = #{apiId} + and data_type = #{dataType} + and left_bracket = #{leftBracket} + and filed_id = #{filedId} + and filed_name = #{filedName} + and compare_type = #{compareType} + and filed_vaule = #{filedVaule} + and connection_symbol = #{connectionSymbol} + + and right_parenthesis = #{rightParenthesis} + + and sorts = #{sorts} + and sts = #{sts} + and company_id = #{companyId} and sts='Y' - - - - + + + + delete from mdm_module_distribute_detail where id = #{id} diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleSendLog/entity/MdmModuleSendLogEntity.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleSendLog/entity/MdmModuleSendLogEntity.java index 20995957..05c4ec95 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleSendLog/entity/MdmModuleSendLogEntity.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleSendLog/entity/MdmModuleSendLogEntity.java @@ -21,7 +21,7 @@ public class MdmModuleSendLogEntity extends BaseEntity { private String targetApi; /** 源数据 */ private String sourceData; - /** 操作类型 */ + /** 操作类型 1新增2、修改3、删除*/ private String optionType; /** 公司id */ private String companyId; 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 60b0346c..1918707d 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 @@ -44,6 +44,12 @@ ,company_id + + @@ -608,7 +608,7 @@ where id = #{id} from ${tableName} and id = #{id} - and sts = 'Y' + and sts = 'Y' and data_status != 'N' order by sorts asc @@ -620,7 +620,7 @@ where id = #{id} ${label}, ${upId} from ${tableName} - where sts = 'Y' + where sts = 'Y' and data_status != 'N' order by sorts asc diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModule/service/IMdmModuleService.java b/service/src/main/java/com/hzya/frame/mdm/mdmModule/service/IMdmModuleService.java index 5d45e907..ca980443 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModule/service/IMdmModuleService.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModule/service/IMdmModuleService.java @@ -388,4 +388,13 @@ public interface IMdmModuleService extends IBaseService * @return com.hzya.frame.web.entity.JsonResultEntity **/ JsonResultEntity queryMdmMainDBField(JSONObject jsonObject); + + /** + * @Author lvleigang + * @Description 主数据-分发设置-列表获取 + * @Date 11:43 上午 2024/6/11 + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + **/ + JsonResultEntity queryMdmDistributeByMdmCode(JSONObject jsonObject); } 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 59217212..c5b3d267 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 @@ -311,6 +311,7 @@ public class MdmModuleServiceImpl extends BaseService i } entity.setCreate(); mdmModuleDao.save(entity); + entity = mdmModuleDao.get(entity.getId()); return BaseResult.getSuccessMessageEntity("保存成功",entity); } @@ -631,11 +632,28 @@ public class MdmModuleServiceImpl extends BaseService i data_type.setQueryType("1"); data_type.setListType("1"); data_type.setViewType("1"); - data_type.setFiledLength("255"); + data_type.setFiledLength("50"); data_type.setCreate(); data_type.setDataType("1"); mdmModuleDbFiledsEntities.add(data_type); + MdmModuleDbFiledsEntity remark = new MdmModuleDbFiledsEntity(); + remark.setMdmId(entity.getMdmId()); + remark.setDbId(entity.getId()); + remark.setEnName("remark"); + remark.setChName("备注"); + remark.setFiledType("3"); + remark.setAddType("1"); + remark.setUpdateType("1"); + remark.setShowType("1"); + remark.setQueryType("1"); + remark.setListType("1"); + remark.setViewType("1"); + remark.setFiledLength("255"); + remark.setCreate(); + remark.setDataType("1"); + mdmModuleDbFiledsEntities.add(remark); + MdmModuleDbFiledsEntity code = new MdmModuleDbFiledsEntity(); code.setMdmId(entity.getMdmId()); code.setDbId(entity.getId()); @@ -774,6 +792,40 @@ public class MdmModuleServiceImpl extends BaseService i option_type.setCreate(); option_type.setDataType("1"); mdmModuleDbFiledsEntities.add(option_type); + + MdmModuleDbFiledsEntity data_type = new MdmModuleDbFiledsEntity(); + data_type.setMdmId(entity.getMdmId()); + data_type.setDbId(entity.getId()); + data_type.setEnName("data_type"); + data_type.setChName("状态"); + data_type.setFiledType("3"); + data_type.setAddType("1"); + data_type.setUpdateType("1"); + data_type.setShowType("1"); + data_type.setQueryType("1"); + data_type.setListType("1"); + data_type.setViewType("1"); + data_type.setFiledLength("255"); + data_type.setCreate(); + data_type.setDataType("1"); + mdmModuleDbFiledsEntities.add(data_type); + + MdmModuleDbFiledsEntity remark = new MdmModuleDbFiledsEntity(); + remark.setMdmId(entity.getMdmId()); + remark.setDbId(entity.getId()); + remark.setEnName("remark"); + remark.setChName("备注"); + remark.setFiledType("3"); + remark.setAddType("1"); + remark.setUpdateType("1"); + remark.setShowType("1"); + remark.setQueryType("1"); + remark.setListType("1"); + remark.setViewType("1"); + remark.setFiledLength("255"); + remark.setCreate(); + remark.setDataType("1"); + mdmModuleDbFiledsEntities.add(remark); } if ("2".equals(entity.getDbType()) || "1".equals(entity.getDbType())) { MdmModuleDbFiledsEntity data_status = new MdmModuleDbFiledsEntity(); @@ -786,8 +838,8 @@ public class MdmModuleServiceImpl extends BaseService i data_status.setUpdateType("2"); data_status.setShowType("2"); data_status.setQueryType("2"); - data_status.setListType("1"); - data_status.setViewType("1"); + data_status.setListType("2"); + data_status.setViewType("2"); data_status.setFiledLength("1"); data_status.setCreate(); data_status.setDataType("1"); @@ -2616,4 +2668,27 @@ public class MdmModuleServiceImpl extends BaseService i } return BaseResult.getSuccessMessageEntity("查询数据成功", list); } + + + /** + * @param object + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 主数据-分发设置-列表获取 + * @Date 11:43 上午 2024/6/11 + **/ + @Override + public JsonResultEntity queryMdmDistributeByMdmCode(JSONObject object) { + MdmModuleDistributeEntity entity = getData("jsonStr", object, MdmModuleDistributeEntity.class); + if (entity == null) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + if (entity.getMdmCode() == null || "".equals(entity.getMdmCode())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + MdmModuleEntity mdmModuleEntity = mdmServiceCache.getMdmModuleEntity(entity.getMdmCode()); + entity.setMdmId(mdmModuleEntity.getId()); + List list = mdmModuleDistributeDao.queryBase(entity); + return BaseResult.getSuccessMessageEntity("获取分发设置成功", list); + } } diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistribute/dao/IMdmModuleDistributeDao.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistribute/dao/IMdmModuleDistributeDao.java index ffa3cacc..44cc5cec 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistribute/dao/IMdmModuleDistributeDao.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistribute/dao/IMdmModuleDistributeDao.java @@ -11,5 +11,6 @@ import com.hzya.frame.basedao.dao.IBaseDao; */ public interface IMdmModuleDistributeDao extends IBaseDao { + Integer queryCountUse(MdmModuleDistributeEntity mdmModuleDistributeEntity); } diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistribute/dao/impl/MdmModuleDistributeDaoImpl.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistribute/dao/impl/MdmModuleDistributeDaoImpl.java index 83ba2db8..3f9560f8 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistribute/dao/impl/MdmModuleDistributeDaoImpl.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistribute/dao/impl/MdmModuleDistributeDaoImpl.java @@ -4,6 +4,9 @@ import com.hzya.frame.mdm.mdmModuleDistribute.entity.MdmModuleDistributeEntity; import com.hzya.frame.mdm.mdmModuleDistribute.dao.IMdmModuleDistributeDao; import org.springframework.stereotype.Repository; import com.hzya.frame.basedao.dao.MybatisGenericDao; + +import java.util.HashMap; + /** * 主数据功能应用分发表(MdmModuleDistribute)表数据库访问层 * @@ -12,6 +15,11 @@ import com.hzya.frame.basedao.dao.MybatisGenericDao; */ @Repository(value = "MdmModuleDistributeDaoImpl") public class MdmModuleDistributeDaoImpl extends MybatisGenericDao implements IMdmModuleDistributeDao{ - + + @Override + public Integer queryCountUse(MdmModuleDistributeEntity mdmModuleDistributeEntity) { + Integer o = (Integer) super.selectOne(getSqlIdPrifx() + "queryCountUse", mdmModuleDistributeEntity); + return o; + } } diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistribute/entity/MdmModuleDistributeEntity.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistribute/entity/MdmModuleDistributeEntity.java index 30fcf0dc..02783ec9 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistribute/entity/MdmModuleDistributeEntity.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistribute/entity/MdmModuleDistributeEntity.java @@ -17,6 +17,8 @@ public class MdmModuleDistributeEntity extends BaseEntity { private String mdmId; /** 应用id */ private String appId; + /** 应用id */ + private Long mdmCode; /** 触发类型 0、手动1、自动 */ private String enabledType; /** 修改接口 */ @@ -40,6 +42,13 @@ public class MdmModuleDistributeEntity extends BaseEntity { /** 公司id */ private List mdmModuleDistributeDetailEntities; + public Long getMdmCode() { + return mdmCode; + } + + public void setMdmCode(Long mdmCode) { + this.mdmCode = mdmCode; + } public String getMdmId() { return mdmId; @@ -144,5 +153,7 @@ public class MdmModuleDistributeEntity extends BaseEntity { public void setMdmModuleDistributeDetailEntities(List mdmModuleDistributeDetailEntities) { this.mdmModuleDistributeDetailEntities = mdmModuleDistributeDetailEntities; } + + } diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistribute/entity/MdmModuleDistributeEntity.xml b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistribute/entity/MdmModuleDistributeEntity.xml index ffedf135..03266e78 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistribute/entity/MdmModuleDistributeEntity.xml +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistribute/entity/MdmModuleDistributeEntity.xml @@ -324,6 +324,16 @@ update mdm_module_distribute set sts= 'N' ,modify_time = #{modify_time},modify_ delete from mdm_module_distribute where id = #{id} - + + diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleOptionLog/entity/MdmModuleOptionLogEntity.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleOptionLog/entity/MdmModuleOptionLogEntity.java index aaf6f341..525fce33 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleOptionLog/entity/MdmModuleOptionLogEntity.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleOptionLog/entity/MdmModuleOptionLogEntity.java @@ -19,6 +19,8 @@ public class MdmModuleOptionLogEntity extends BaseEntity { private String sourceName; /** 状态 1、成功2、失败 */ private String dataType; + /** 备注 */ + private String remark; /** 编码 */ private String code; /** source_data */ @@ -30,6 +32,15 @@ public class MdmModuleOptionLogEntity extends BaseEntity { /** 公司id */ private String companyId; + + public String getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark; + } + public String getDataType() { return dataType; } diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleOptionLog/entity/MdmModuleOptionLogEntity.xml b/service/src/main/java/com/hzya/frame/mdm/mdmModuleOptionLog/entity/MdmModuleOptionLogEntity.xml index f6708c43..c4df7ee5 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleOptionLog/entity/MdmModuleOptionLogEntity.xml +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleOptionLog/entity/MdmModuleOptionLogEntity.xml @@ -8,6 +8,7 @@ + @@ -27,7 +28,8 @@ ,source_name ,data_type ,code - ,source_data + ,remark + ,source_data ,option_type ,option_name ,sorts @@ -55,6 +57,7 @@ and source_name = #{sourceName} and data_type = #{dataType} and code = #{code} + and remark = #{remark} and source_data = #{sourceData} and option_type = #{optionType} and option_name = #{optionName} @@ -81,6 +84,7 @@ and source_name = #{sourceName} and data_type = #{dataType} and code = #{code} + and remark = #{remark} and source_data = #{sourceData} and option_type = #{optionType} and option_name = #{optionName} @@ -109,6 +113,7 @@ and source_name like concat('%',#{sourceName},'%') and data_type like concat('%',#{dataType},'%') and code like concat('%',#{code},'%') + and remark like concat('%',#{remark},'%') and source_data like concat('%',#{sourceData},'%') and option_type like concat('%',#{optionType},'%') and option_name like concat('%',#{optionName},'%') @@ -122,7 +127,7 @@ and company_id like concat('%',#{companyId},'%') and sts='Y' - order by sorts asc + order by sorts desc order by ${sort} ${order} @@ -137,6 +142,7 @@ or source_name = #{sourceName} or data_type = #{dataType} or code = #{code} + or remark = #{remark} or source_data = #{sourceData} or option_type = #{optionType} or option_name = #{optionName} @@ -163,6 +169,7 @@ source_name , data_type , code , + remark , source_data , option_type , option_name , @@ -183,6 +190,7 @@ #{sourceName} , #{dataType} , #{code} , + #{remark} , #{sourceData} , #{optionType} , #{optionName} , @@ -200,24 +208,25 @@ - insert into ${tableName}(formmain_id, source_name,data_type, code, source_data, option_type, option_name, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, sts) + insert into ${tableName}(formmain_id, source_name,data_type, code,remark, source_data, option_type, option_name, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, sts) values - (#{entity.formmainId},#{entity.sourceName},#{entity.dataType},#{entity.code},#{entity.sourceData},#{entity.optionType},#{entity.optionName},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId}, 'Y') + (#{entity.formmainId},#{entity.sourceName},#{entity.dataType},#{entity.code},#{entity.remark},#{entity.sourceData},#{entity.optionType},#{entity.optionName},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId}, 'Y') - insert into ${tableName}(formmain_id, source_name,data_type, code, source_data, option_type, option_name, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id) + insert into ${tableName}(formmain_id, source_name,data_type, code, remark, source_data, option_type, option_name, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id) values - (#{entity.formmainId},#{entity.sourceName},#{entity.dataType},#{entity.code},#{entity.sourceData},#{entity.optionType},#{entity.optionName},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId}) + (#{entity.formmainId},#{entity.sourceName},#{entity.dataType},#{entity.code},#{entity.remark},#{entity.sourceData},#{entity.optionType},#{entity.optionName},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId}) on duplicate key update formmain_id = values(formmain_id), source_name = values(source_name), data_type = values(data_type), code = values(code), + remark = values(remark), source_data = values(source_data), option_type = values(option_type), option_name = values(option_name), @@ -236,6 +245,7 @@ update ${tableName} set source_name = #{sourceName}, data_type = #{dataType}, code = #{code}, + remark = #{remark}, source_data = #{sourceData}, option_type = #{optionType}, option_name = #{optionName}, @@ -263,6 +273,7 @@ update ${tableName} set sts= 'N' ,modify_time = #{modify_time},modify_user_id = and source_name = #{sourceName} and data_type = #{dataType} and code = #{code} + and remark = #{remark} and source_data = #{sourceData} and option_type = #{optionType} and option_name = #{optionName} diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleSendLog/entity/MdmModuleSendLogEntity.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleSendLog/entity/MdmModuleSendLogEntity.java index 05c4ec95..1a09ceed 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleSendLog/entity/MdmModuleSendLogEntity.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleSendLog/entity/MdmModuleSendLogEntity.java @@ -21,11 +21,30 @@ public class MdmModuleSendLogEntity extends BaseEntity { private String targetApi; /** 源数据 */ private String sourceData; + /** 状态 1、成功2、失败 */ + private String dataType; + /** 备注 */ + private String remark; /** 操作类型 1新增2、修改3、删除*/ private String optionType; /** 公司id */ private String companyId; + public String getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark; + } + + public String getDataType() { + return dataType; + } + + public void setDataType(String dataType) { + this.dataType = dataType; + } public String getFormmainId() { return formmainId; diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleSendLog/entity/MdmModuleSendLogEntity.xml b/service/src/main/java/com/hzya/frame/mdm/mdmModuleSendLog/entity/MdmModuleSendLogEntity.xml index e3beb6bd..718563ca 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleSendLog/entity/MdmModuleSendLogEntity.xml +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleSendLog/entity/MdmModuleSendLogEntity.xml @@ -9,6 +9,8 @@ + + @@ -26,7 +28,9 @@ ,target_api ,source_data ,option_type - ,sorts + ,remark + ,data_type + ,sorts ,create_user_id ,create_time ,modify_user_id @@ -53,6 +57,8 @@ and target_api = #{targetApi} and source_data = #{sourceData} and option_type = #{optionType} + and remark = #{remark} + and data_type = #{dataType} and sorts = #{sorts} and create_user_id = #{create_user_id} and create_time = #{create_time} @@ -77,6 +83,8 @@ and target_api = #{targetApi} and source_data = #{sourceData} and option_type = #{optionType} + and remark = #{remark} + and data_type = #{dataType} and sorts = #{sorts} and create_user_id = #{create_user_id} and create_time = #{create_time} @@ -103,6 +111,8 @@ and target_api like concat('%',#{targetApi},'%') and source_data like concat('%',#{sourceData},'%') and option_type like concat('%',#{optionType},'%') + and remark like concat('%',#{remark},'%') + and data_type like concat('%',#{dataType},'%') and sorts like concat('%',#{sorts},'%') and create_user_id like concat('%',#{create_user_id},'%') and create_time like concat('%',#{create_time},'%') @@ -113,7 +123,7 @@ and company_id like concat('%',#{companyId},'%') and sts='Y' - order by sorts asc + order by sorts desc order by ${sort} ${order} @@ -129,6 +139,8 @@ or target_api = #{targetApi} or source_data = #{sourceData} or option_type = #{optionType} + or remark = #{remark} + or data_type = #{dataType} or sorts = #{sorts} or create_user_id = #{create_user_id} or create_time = #{create_time} @@ -153,6 +165,8 @@ target_api , source_data , option_type , + remark , + data_type , sorts , create_user_id , create_time , @@ -171,6 +185,8 @@ #{targetApi} , #{sourceData} , #{optionType} , + #{remark} , + #{dataType} , #{sorts} , #{create_user_id} , #{create_time} , @@ -185,18 +201,18 @@ - insert into ${tableName}(formmain_id, target_app, target_api, source_data, option_type, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, sts) + insert into ${tableName}(formmain_id, target_app, target_api, source_data, option_type,remark,data_type, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, sts) values - (#{entity.formmainId},#{entity.targetApp},#{entity.targetApi},#{entity.sourceData},#{entity.optionType},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId}, 'Y') + (#{entity.formmainId},#{entity.targetApp},#{entity.targetApi},#{entity.sourceData},#{entity.optionType},#{entity.remark},#{entity.dataType},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId}, 'Y') - insert into ${tableName}(formmain_id, target_app, target_api, source_data, option_type, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id) + insert into ${tableName}(formmain_id, target_app, target_api, source_data, option_type,remark,data_type, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id) values - (#{entity.formmainId},#{entity.targetApp},#{entity.targetApi},#{entity.sourceData},#{entity.optionType},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId}) + (#{entity.formmainId},#{entity.targetApp},#{entity.targetApi},#{entity.sourceData},#{entity.optionType},#{entity.remark},#{entity.dataType},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId}) on duplicate key update formmain_id = values(formmain_id), @@ -204,6 +220,8 @@ target_api = values(target_api), source_data = values(source_data), option_type = values(option_type), + remark = values(remark), + data_type = values(data_type), create_user_id = values(create_user_id), create_time = values(create_time), modify_user_id = values(modify_user_id), @@ -220,6 +238,8 @@ update ${tableName} set target_api = #{targetApi}, source_data = #{sourceData}, option_type = #{optionType}, + remark = #{remark}, + data_type = #{dataType}, create_user_id = #{create_user_id}, create_time = #{create_time}, modify_user_id = #{modify_user_id}, @@ -245,6 +265,8 @@ update ${tableName} set sts= 'N' ,modify_time = #{modify_time},modify_user_id = and target_api = #{targetApi} and source_data = #{sourceData} and option_type = #{optionType} + and remark = #{remark} + and data_type = #{dataType} and sorts = #{sorts} and sts = #{sts} and company_id = #{companyId} diff --git a/service/src/main/java/com/hzya/frame/mdm/service/IMdmService.java b/service/src/main/java/com/hzya/frame/mdm/service/IMdmService.java index ae9ef52c..557009fe 100644 --- a/service/src/main/java/com/hzya/frame/mdm/service/IMdmService.java +++ b/service/src/main/java/com/hzya/frame/mdm/service/IMdmService.java @@ -110,14 +110,14 @@ public interface IMdmService { * @Date 9:40 上午 2023/10/18 **/ JsonResultEntity deleteMdmShowDetailsData(JSONObject jsonObject); - ///** - // * @param jsonObject - // * @return com.hzya.frame.web.entity.JsonResultEntity - // * @Author lvleigang - // * @Description 处理分发数据 - // * @Date 9:40 上午 2023/10/18 - // **/ - //JsonResultEntity doMdmDistribute(JSONObject jsonObject); + /** + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 处理分发数据 + * @Date 9:40 上午 2023/10/18 + **/ + JsonResultEntity doMdmDistribute(JSONObject jsonObject); } 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 d09b3cb4..168ca76b 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 @@ -1,10 +1,12 @@ package com.hzya.frame.mdm.service.impl; import cn.dev33.satoken.stp.StpUtil; +import cn.hutool.json.JSONUtil; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; +import com.hzya.frame.base.PluginBaseEntity; import com.hzya.frame.mdm.entity.DbFiledsDto; import com.hzya.frame.mdm.entity.MdmDataDto; import com.hzya.frame.mdm.entity.MdmDataFiledDto; @@ -30,6 +32,7 @@ import com.hzya.frame.mdm.mdmModuleDbFiledsRule.entity.MdmModuleDbFiledsRuleEnti import com.hzya.frame.mdm.mdmModuleDistribute.dao.IMdmModuleDistributeDao; import com.hzya.frame.mdm.mdmModuleDistribute.entity.MdmModuleDistributeEntity; import com.hzya.frame.mdm.mdmModuleDistributeDetail.dao.IMdmModuleDistributeDetailDao; +import com.hzya.frame.mdm.mdmModuleDistributeDetail.entity.MdmModuleDistributeDetailEntity; import com.hzya.frame.mdm.mdmModuleOptionLog.dao.IMdmModuleOptionLogDao; import com.hzya.frame.mdm.mdmModuleOptionLog.entity.MdmModuleOptionLogEntity; import com.hzya.frame.mdm.mdmModuleSendLog.dao.IMdmModuleSendLogDao; @@ -47,24 +50,45 @@ import com.hzya.frame.mdm.service.IMdmService; import com.hzya.frame.mdm.service.IMdmServiceCache; import com.hzya.frame.sys.entity.FormmainDeleteDto; +import com.hzya.frame.sysnew.application.api.dao.ISysApplicationApiDao; +import com.hzya.frame.sysnew.application.api.entity.SysApplicationApiEntity; +import com.hzya.frame.sysnew.application.dao.ISysApplicationDao; +import com.hzya.frame.sysnew.application.entity.SysApplicationEntity; +import com.hzya.frame.sysnew.application.entity.SysExtensionApiEntity; +import com.hzya.frame.sysnew.application.plugin.entity.SysApplicationPluginEntity; +import com.hzya.frame.sysnew.application.script.dao.ISysApplicationScriptDao; +import com.hzya.frame.sysnew.application.script.entity.SysApplicationScriptEntity; import com.hzya.frame.sysnew.buttonConfig.dao.ISysButtonConfigDao; import com.hzya.frame.sysnew.buttonConfig.entity.SysButtonConfigEntity; +import com.hzya.frame.sysnew.grovy.service.IGroovyIntegrationService; import com.hzya.frame.sysnew.menuConfig.dao.ISysMenuConfigDao; import com.hzya.frame.sysnew.menuConfig.entity.SysMenuConfigEntity; import com.hzya.frame.sysnew.popedomOperate.dao.ISysPopedomOperateDao; import com.hzya.frame.sysnew.popedomOperate.entity.SysPopedomOperateEntity; +import com.hzya.frame.sysnew.user.dao.ISysUserDao; import com.hzya.frame.sysnew.user.entity.SysUserEntity; import com.hzya.frame.sysnew.userCompany.entity.SysUserCompanyEntity; import com.hzya.frame.sysnew.userRoles.entity.SysUserRolesEntity; +import com.hzya.frame.util.PluginUtils; import com.hzya.frame.uuid.UUIDUtils; import com.hzya.frame.web.entity.BaseResult; import com.hzya.frame.web.entity.JsonResultEntity; +import org.apache.http.HttpEntity; +import org.apache.http.client.config.RequestConfig; +import org.apache.http.client.methods.CloseableHttpResponse; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.entity.ByteArrayEntity; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClientBuilder; +import org.apache.http.util.EntityUtils; import org.checkerframework.checker.units.qual.A; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import javax.annotation.Resource; +import java.io.IOException; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Arrays; @@ -81,8 +105,17 @@ import java.util.Map; public class MdmServiceImpl implements IMdmService { private final Logger logger = LoggerFactory.getLogger(this.getClass()); + @Resource + private ISysApplicationDao sysApplicationDao; + @Resource + private ISysApplicationApiDao sysApplicationApiDao; + @Resource + private ISysApplicationScriptDao sysApplicationScriptDao; @Resource private IMdmModuleDao mdmModuleDao; + + @Resource + private IGroovyIntegrationService groovyIntegrationService; @Resource private IMdmModuleSendLogDao mdmModuleSendLogDao; @Resource @@ -98,6 +131,8 @@ public class MdmServiceImpl implements IMdmService { @Resource private IMdmModuleDbDao mdmModuleDbDao; @Resource + private ISysUserDao sysUserDao; + @Resource private IMdmModuleDbFiledsDao mdmModuleDbFiledsDao; @Resource private IMdmModuleDbFiledsRuleDao mdmModuleDbFiledsRuleDao; @@ -113,7 +148,10 @@ public class MdmServiceImpl implements IMdmService { private IMdmModuleViewButtonDao mdmModuleViewButtonDao; @Resource private IMdmModuleViewDetailDao mdmModuleViewDetailDao; - + //多线程请求加锁 HttpRequest 构造方法是静态的 + private final Object lock = new Object(); + @Value("${ax.url}") + private String url; /** * @param object @@ -133,7 +171,7 @@ public class MdmServiceImpl implements IMdmService { } //查询模版 MdmModuleEntity mdmModuleEntity = mdmServiceCache.getMdmModuleEntity(entity.getMdmCode()); - if(mdmModuleEntity == null || mdmModuleEntity.getId() == null){ + if (mdmModuleEntity == null || mdmModuleEntity.getId() == null) { return BaseResult.getFailureMessageEntity("系统错误"); } @@ -184,28 +222,28 @@ public class MdmServiceImpl implements IMdmService { if (mdmModuleViewDetailEntities == null || mdmModuleViewDetailEntities.size() == 0) { return BaseResult.getFailureMessageEntity("系统错误"); } - List queryList = getFiledByType("1",mdmModuleViewDetailEntities,mdmModuleDbEntityList,mdmModuleDbFiledsEntityList,mdmModuleDbFiledsRuleEntityList); + List queryList = getFiledByType("1", mdmModuleViewDetailEntities, mdmModuleDbEntityList, mdmModuleDbFiledsEntityList, mdmModuleDbFiledsRuleEntityList); mdmViewVo.setQueryList(queryList); - List listList = getFiledByType("2",mdmModuleViewDetailEntities,mdmModuleDbEntityList,mdmModuleDbFiledsEntityList,mdmModuleDbFiledsRuleEntityList); + List listList = getFiledByType("2", mdmModuleViewDetailEntities, mdmModuleDbEntityList, mdmModuleDbFiledsEntityList, mdmModuleDbFiledsRuleEntityList); mdmViewVo.setListList(listList); return BaseResult.getSuccessMessageEntity("获取字段成功", mdmViewVo); } /** - * @Author lvleigang - * @Description 根据类型获取字段 - * @Date 9:18 上午 2024/6/6 - * @param viewType 类型 - * @param mdmModuleViewDetailEntities 显示设置的字段 - * @param mdmModuleDbEntityList 表 - * @param mdmModuleDbFiledsEntityList 表字段 + * @param viewType 类型 + * @param mdmModuleViewDetailEntities 显示设置的字段 + * @param mdmModuleDbEntityList 表 + * @param mdmModuleDbFiledsEntityList 表字段 * @param mdmModuleDbFiledsRuleEntityList 字段规则 * @return java.util.List + * @Author lvleigang + * @Description 根据类型获取字段 + * @Date 9:18 上午 2024/6/6 **/ private List getFiledByType(String viewType, List mdmModuleViewDetailEntities, List mdmModuleDbEntityList, List mdmModuleDbFiledsEntityList, List mdmModuleDbFiledsRuleEntityList) { List mdmViewFiledVos = new ArrayList<>(); for (int i = 0; i < mdmModuleDbEntityList.size(); i++) { - if("1".equals(mdmModuleDbEntityList.get(i).getDbType())){ + if ("1".equals(mdmModuleDbEntityList.get(i).getDbType())) { MdmViewFiledVo rule = new MdmViewFiledVo(); rule.setDbName(mdmModuleDbEntityList.get(i).getDbName()); rule.setDbType("1"); @@ -252,16 +290,16 @@ public class MdmServiceImpl implements IMdmService { rule.setRuleList(msgRule); } } - if(mdmModuleViewDetailEntities != null && mdmModuleViewDetailEntities.size() > 0){ + if (mdmModuleViewDetailEntities != null && mdmModuleViewDetailEntities.size() > 0) { for (int i = 0; i < mdmModuleViewDetailEntities.size(); i++) { - if(viewType.equals(mdmModuleViewDetailEntities.get(i).getViewType())){ + if (viewType.equals(mdmModuleViewDetailEntities.get(i).getViewType())) { //类型一致 MdmViewFiledVo mdmViewFiledVo = new MdmViewFiledVo(); mdmViewFiledVo.setId(mdmModuleViewDetailEntities.get(i).getViewFiled()); for (int i1 = 0; i1 < mdmModuleDbFiledsEntityList.size(); i1++) { - if(mdmModuleDbFiledsEntityList.get(i1).getId().equals(mdmModuleViewDetailEntities.get(i).getViewFiled())){ + if (mdmModuleDbFiledsEntityList.get(i1).getId().equals(mdmModuleViewDetailEntities.get(i).getViewFiled())) { for (int i2 = 0; i2 < mdmModuleDbEntityList.size(); i2++) { - if(mdmModuleDbEntityList.get(i2).getId().equals(mdmModuleDbFiledsEntityList.get(i1).getDbId())){ + if (mdmModuleDbEntityList.get(i2).getId().equals(mdmModuleDbFiledsEntityList.get(i1).getDbId())) { mdmViewFiledVo.setDbName(mdmModuleDbEntityList.get(i2).getDbName()); mdmViewFiledVo.setDbType(mdmModuleDbEntityList.get(i2).getDbType()); mdmViewFiledVo.setMdmId(mdmModuleDbEntityList.get(i2).getMdmId()); @@ -275,15 +313,15 @@ public class MdmServiceImpl implements IMdmService { mdmViewFiledVo.setFiledType(mdmModuleDbFiledsEntityList.get(i1).getFiledType()); //字段规则 - if(mdmModuleDbFiledsRuleEntityList != null && mdmModuleDbFiledsRuleEntityList.size() > 0){ + if (mdmModuleDbFiledsRuleEntityList != null && mdmModuleDbFiledsRuleEntityList.size() > 0) { List ruleList = new ArrayList<>(); for (int i2 = 0; i2 < mdmModuleDbFiledsRuleEntityList.size(); i2++) { - if(mdmModuleDbFiledsEntityList.get(i1).getId().equals(mdmModuleDbFiledsRuleEntityList.get(i2).getFiledId())){ + if (mdmModuleDbFiledsEntityList.get(i1).getId().equals(mdmModuleDbFiledsRuleEntityList.get(i2).getFiledId())) { ruleList.add(mdmModuleDbFiledsRuleEntityList.get(i2)); } } mdmViewFiledVo.setRuleList(ruleList); - if("data_status".equals(mdmModuleDbFiledsEntityList.get(i1).getEnName())){ + if ("data_status".equals(mdmModuleDbFiledsEntityList.get(i1).getEnName())) { List a = new ArrayList<>(); MdmModuleDbFiledsRuleEntity msgRuleTitie = new MdmModuleDbFiledsRuleEntity(); @@ -330,7 +368,7 @@ public class MdmServiceImpl implements IMdmService { } } } - if(mdmViewFiledVos != null && mdmViewFiledVos.size() > 0){ + if (mdmViewFiledVos != null && mdmViewFiledVos.size() > 0) { for (int i = 0; i < mdmViewFiledVos.size(); i++) { mdmViewFiledVos.get(i).setSorts(i); } @@ -338,6 +376,7 @@ public class MdmServiceImpl implements IMdmService { return mdmViewFiledVos; } // + /** * @param object * @return com.hzya.frame.web.entity.JsonResultEntity @@ -370,7 +409,7 @@ public class MdmServiceImpl implements IMdmService { // if (mdmModuleDbEntityList != null && mdmModuleDbEntityList.size() > 0) { for (int i = 0; i < mdmModuleDbEntityList.size(); i++) { - if("1".equals(mdmModuleDbEntityList.get(i).getDbType()) || "2".equals(mdmModuleDbEntityList.get(i).getDbType())){ + if ("1".equals(mdmModuleDbEntityList.get(i).getDbType()) || "2".equals(mdmModuleDbEntityList.get(i).getDbType())) { if (mdmModuleDbFiledsEntityList != null && mdmModuleDbFiledsEntityList.size() > 0) { for (int i1 = 0; i1 < mdmModuleDbFiledsEntityList.size(); i1++) { if (mdmModuleDbEntityList.get(i).getId().equals(mdmModuleDbFiledsEntityList.get(i1).getDbId())) { @@ -586,6 +625,7 @@ public class MdmServiceImpl implements IMdmService { // mdmViewFiledVos.add(mdmViewFiledVo); //} // + /** * @param object * @return com.hzya.frame.web.entity.JsonResultEntity @@ -599,22 +639,23 @@ public class MdmServiceImpl implements IMdmService { if (entity == null) { return BaseResult.getFailureMessageEntity("参数不允许为空"); } - entity.setMdmCode(10007L); - MdmModuleEntity mdmModuleEntity = mdmServiceCache.getMdmModuleEntity(entity.getMdmCode()); - if(mdmModuleEntity == null || mdmModuleEntity.getId() == null ){ - return BaseResult.getFailureMessageEntity("主数据设置错误"); - } - MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); - mdmModuleDbEntity.setMdmId(mdmModuleEntity.getId()); - mdmModuleDbEntity.setSts("Y"); - List mdmModuleDbEntities = mdmServiceCache.queryMdmModuleDb(mdmModuleDbEntity); - if(mdmModuleDbEntities == null || mdmModuleDbEntities.size() == 0){ - return BaseResult.getFailureMessageEntity("主数据设置错误"); - } - for (int i = 0; i < mdmModuleDbEntities.size(); i++) { - if("1".equals(mdmModuleDbEntities.get(i).getDbType())){ - entity.setTableName(mdmModuleDbEntities.get(i).getDbName()); - break; + if(entity.getMdmCode() != null && !"".equals(entity.getMdmCode())){ + MdmModuleEntity mdmModuleEntity = mdmServiceCache.getMdmModuleEntity(entity.getMdmCode()); + if (mdmModuleEntity == null || mdmModuleEntity.getId() == null) { + return BaseResult.getFailureMessageEntity("主数据设置错误"); + } + MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); + mdmModuleDbEntity.setMdmId(mdmModuleEntity.getId()); + mdmModuleDbEntity.setSts("Y"); + List mdmModuleDbEntities = mdmServiceCache.queryMdmModuleDb(mdmModuleDbEntity); + if (mdmModuleDbEntities == null || mdmModuleDbEntities.size() == 0) { + return BaseResult.getFailureMessageEntity("主数据设置错误"); + } + for (int i = 0; i < mdmModuleDbEntities.size(); i++) { + if ("1".equals(mdmModuleDbEntities.get(i).getDbType())) { + entity.setTableName(mdmModuleDbEntities.get(i).getDbName()); + break; + } } } //判断分页 @@ -710,6 +751,7 @@ public class MdmServiceImpl implements IMdmService { // return BaseResult.getSuccessMessageEntity("查询数据成功", returnData); //} // + /** * @param object * @return com.hzya.frame.web.entity.JsonResultEntity @@ -741,6 +783,7 @@ public class MdmServiceImpl implements IMdmService { } } // + /** * @param object * @return com.hzya.frame.web.entity.JsonResultEntity @@ -763,32 +806,28 @@ public class MdmServiceImpl implements IMdmService { if (entity.getUpId() == null || "".equals(entity.getUpId())) { return BaseResult.getFailureMessageEntity("系统错误"); } - if (entity.getMdmCode() == null || "".equals(entity.getMdmCode())) { - return BaseResult.getFailureMessageEntity("系统错误"); - - } - //查询模版 - MdmModuleEntity mdmModuleEntities = mdmServiceCache.getMdmModuleEntity(entity.getMdmCode()); - if (mdmModuleEntities == null ) { - return BaseResult.getFailureMessageEntity("系统错误"); - } - //查询数据源主表 - MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); - mdmModuleDbEntity.setMdmId(mdmModuleEntities.getId()); - mdmModuleDbEntity.setSts("Y"); - List mdmModuleDbEntityList = mdmServiceCache.queryMdmModuleDb(mdmModuleDbEntity); - if (mdmModuleDbEntityList == null || mdmModuleDbEntityList.size() == 0) { - return BaseResult.getFailureMessageEntity("系统错误"); - } - for (int i = 0; i < mdmModuleDbEntityList.size(); i++) { - if("1".equals(mdmModuleDbEntityList.get(i).getDbType())){ - mdmModuleDbEntity = mdmModuleDbEntityList.get(i); - break; + if(entity.getMdmCode() != null && !"".equals(entity.getMdmCode())){ + //查询模版 + MdmModuleEntity mdmModuleEntities = mdmServiceCache.getMdmModuleEntity(entity.getMdmCode()); + if (mdmModuleEntities == null) { + return BaseResult.getFailureMessageEntity("系统错误"); } + //查询数据源主表 + MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); + mdmModuleDbEntity.setMdmId(mdmModuleEntities.getId()); + mdmModuleDbEntity.setSts("Y"); + List mdmModuleDbEntityList = mdmServiceCache.queryMdmModuleDb(mdmModuleDbEntity); + if (mdmModuleDbEntityList == null || mdmModuleDbEntityList.size() == 0) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + for (int i = 0; i < mdmModuleDbEntityList.size(); i++) { + if ("1".equals(mdmModuleDbEntityList.get(i).getDbType())) { + mdmModuleDbEntity = mdmModuleDbEntityList.get(i); + break; + } + } + entity.setTableName(mdmModuleDbEntity.getDbName()); } - entity.setTableName(mdmModuleDbEntity.getDbName()); - - if (checkStr(entity.getId())) { if (!checkStr(entity.getValue())) { @@ -837,6 +876,7 @@ public class MdmServiceImpl implements IMdmService { return BaseResult.getSuccessMessageEntity("查询数据成功", returnList); } } + // private List> gettochilder(String[] strArray, int i, List> mapList) { List> maps = new ArrayList<>(); @@ -851,6 +891,7 @@ public class MdmServiceImpl implements IMdmService { } return maps; } + // //private HashMap getFathers(List> mapListAll, HashMap mapList, MdmDto entity) { // if (mapList.get("upID") == null) { @@ -896,6 +937,7 @@ public class MdmServiceImpl implements IMdmService { return returnList; } // + /** * @param object * @return com.hzya.frame.web.entity.JsonResultEntity @@ -954,9 +996,9 @@ public class MdmServiceImpl implements IMdmService { mdmModuleViewDetailEntity.setViewType(entity.getShowType());//设置显示字段类型 List queryAll = mdmModuleViewDetailDao.queryBase(mdmModuleViewDetailEntity); List mdmModuleViewDetailEntityList = new ArrayList<>(); - if(queryAll != null && queryAll.size() > 0){ + if (queryAll != null && queryAll.size() > 0) { for (int i = 0; i < queryAll.size(); i++) { - if(entity.getShowType().equals(queryAll.get(i).getViewType())){ + if (entity.getShowType().equals(queryAll.get(i).getViewType())) { mdmModuleViewDetailEntityList.add(queryAll.get(i)); } } @@ -1250,6 +1292,7 @@ public class MdmServiceImpl implements IMdmService { // } //} // + /** * @param object * @return com.hzya.frame.web.entity.JsonResultEntity @@ -1272,7 +1315,7 @@ public class MdmServiceImpl implements IMdmService { //查询模版 MdmModuleEntity mdmModuleEntity = mdmServiceCache.getMdmModuleEntity(entity.getMdmCode()); - if (mdmModuleEntity == null ) { + if (mdmModuleEntity == null) { return BaseResult.getFailureMessageEntity("系统错误"); } //查询数据源主表 @@ -1313,6 +1356,7 @@ public class MdmServiceImpl implements IMdmService { return BaseResult.getSuccessMessageEntity("获取数据成功", jsonObject); } + /** * @param object * @return com.hzya.frame.web.entity.JsonResultEntity @@ -1347,7 +1391,7 @@ public class MdmServiceImpl implements IMdmService { if (mdmModuleDbEntityList == null || mdmModuleDbEntityList.size() == 0) { return BaseResult.getFailureMessageEntity("系统错误"); } - String res = checkDataOnly(jsonObject.getInteger("mdmCode"), saveData, true, mdmModuleEntity, mdmModuleDbEntityList); + String res = checkDataOnly(jsonObject.getInteger("mdmCode"), saveData, true, mdmModuleEntity, mdmModuleDbEntityList,"界面修改"); if (res == null || "".equals(res)) { return BaseResult.getSuccessMessageEntity("修改数据成功"); @@ -1391,7 +1435,9 @@ public class MdmServiceImpl implements IMdmService { if (mdmModuleDbEntityList == null || mdmModuleDbEntityList.size() == 0) { return BaseResult.getFailureMessageEntity("系统错误"); } - String res = checkDataOnly(jsonObject.getInteger("mdmCode"), saveData, false, mdmModuleEntity, mdmModuleDbEntityList); + + + String res = checkDataOnly(jsonObject.getInteger("mdmCode"), saveData, false, mdmModuleEntity, mdmModuleDbEntityList,"界面新增"); if (res == null || "".equals(res)) { return BaseResult.getSuccessMessageEntity("保存数据成功"); @@ -1399,8 +1445,29 @@ public class MdmServiceImpl implements IMdmService { return BaseResult.getFailureMessageEntity(res); } } + + private void saveOption(String dbname ,Long mdmCode ,JSONObject jsonObject,String id,String msg) { + MdmModuleOptionLogEntity mdmModuleOptionLogEntity = new MdmModuleOptionLogEntity(); + mdmModuleOptionLogEntity.setTableName(dbname+"_option_log"); + mdmModuleOptionLogEntity.setMdmCode(mdmCode); + mdmModuleOptionLogEntity.setFormmainId(id); + mdmModuleOptionLogEntity.setSourceName("数智中台"); + mdmModuleOptionLogEntity.setDataType("1"); + mdmModuleOptionLogEntity.setRemark(msg); + mdmModuleOptionLogEntity.setCode("800004"); + mdmModuleOptionLogEntity.setSourceData(jsonObject.toJSONString()); + mdmModuleOptionLogEntity.setOptionType(msg); + SysUserEntity sysUserEntity = sysUserDao.get(StpUtil.getLoginIdAsString()); + if(sysUserEntity != null){ + mdmModuleOptionLogEntity.setOptionName(sysUserEntity.getPersonName()); + } + mdmModuleOptionLogEntity.setCreate(); + mdmModuleOptionLogDao.save(mdmModuleOptionLogEntity); + + } // // + /** * @param object * @return com.hzya.frame.web.entity.JsonResultEntity @@ -1420,7 +1487,7 @@ public class MdmServiceImpl implements IMdmService { } //校验唯一 MdmModuleEntity mdmModuleEntity = mdmServiceCache.getMdmModuleEntity(jsonObject.getLong("mdmCode")); - if (mdmModuleEntity == null ) { + if (mdmModuleEntity == null) { return BaseResult.getFailureMessageEntity("系统错误"); } MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); @@ -1430,9 +1497,10 @@ public class MdmServiceImpl implements IMdmService { if (mdmModuleDbEntityList == null || mdmModuleDbEntityList.size() == 0) { return BaseResult.getFailureMessageEntity("系统错误"); } + String dbname = null; for (int i = 0; i < mdmModuleDbEntityList.size(); i++) { if ("1".equals(mdmModuleDbEntityList.get(i).getDbType())) { - + dbname = mdmModuleDbEntityList.get(i).getDbName(); //查询视图,如果树形,删除下级及子集 //查询展示类型 MdmModuleViewEntity mdmModuleViewEntity = new MdmModuleViewEntity(); @@ -1472,7 +1540,7 @@ public class MdmServiceImpl implements IMdmService { } mdmModuleDao.deleteTemplateById(formmainDeleteDto); - }else if ("2".equals(mdmModuleDbEntityList.get(i).getDbType())) { + } else if ("2".equals(mdmModuleDbEntityList.get(i).getDbType())) { //删除明细 FormmainDeleteDto formmainDeleteDto = new FormmainDeleteDto(); formmainDeleteDto.setFormmain_id(jsonObject.getString("id")); @@ -1480,168 +1548,338 @@ public class MdmServiceImpl implements IMdmService { formmainDeleteDto.setTableName(mdmModuleDbEntityList.get(i).getDbName()); mdmModuleDao.deleteTemplateById(formmainDeleteDto); } + + } + saveOption(dbname,mdmModuleEntity.getMdmCode(),jsonObject,jsonObject.getString("id"),"界面删除"); return BaseResult.getSuccessMessageEntity("删除数据成功"); } - // - // - ///** - // * @param object - // * @return com.hzya.frame.web.entity.JsonResultEntity - // * @Author lvleigang - // * @Description 处理分发数据 - // * @Date 9:40 上午 2023/10/18 - // **/ - //@Override - //public JsonResultEntity doMdmDistribute(JSONObject object) { - // JSONObject jsonObject = getstrObj("jsonStr", object); - // //校验是否有servecr传参 - // if (!checkData(jsonObject, "mdmCode")) { - // return BaseResult.getFailureMessageEntity("请先传递服务名"); - // } - // if (!checkData(jsonObject, "id")) { - // return BaseResult.getFailureMessageEntity("请先传递要删除的数据"); - // } - // if (!checkData(jsonObject, "appID")) { - // return BaseResult.getFailureMessageEntity("请先传递要删除的数据"); - // } - // if (!checkData(jsonObject, "dataType")) { - // return BaseResult.getFailureMessageEntity("请先传递要删除的数据"); - // } - // if("2".equals(jsonObject.getString("dataType"))){ - // boolean flag = false; - // //1、根据服务名查询分发数据 - // MdmModuleEntity mdmModuleEntity = new MdmModuleEntity(); - // mdmModuleEntity.setMdmCode(jsonObject.getInteger("mdmCode")); - // mdmModuleEntity.setSts("Y"); - // List mdmModuleEntities = mdmModuleDao.queryBase(mdmModuleEntity); - // if (mdmModuleEntities != null && mdmModuleEntities.size() == 1) { - // MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); - // mdmModuleDbEntity.setMdmId(mdmModuleEntities.get(0).getId()); - // mdmModuleDbEntity.setDbType("1"); - // mdmModuleDbEntity.setSts("Y"); - // List mdmModuleDbEntities = mdmModuleDbDao.queryBase(mdmModuleDbEntity); - // if (mdmModuleDbEntities != null && mdmModuleDbEntities.size() == 1) { - // mdmModuleDbEntity = mdmModuleDbEntities.get(0); - // } - // MdmModuleDistributeEntity mdmModuleDistributeEntity = new MdmModuleDistributeEntity(); - // mdmModuleDistributeEntity.setAppId(jsonObject.getString("appID")); - // mdmModuleDistributeEntity.setMdmId(mdmModuleEntities.get(0).getId()); - // List mdmModuleDistributeEntities = mdmModuleDistributeDao.queryBase(mdmModuleDistributeEntity); - // if (mdmModuleDistributeEntities != null && mdmModuleDistributeEntities.size() == 1) { - // if (mdmModuleDistributeEntities.get(0).getAddType() != null && "1".equals(mdmModuleDistributeEntities.get(0).getAddType())) { - // //2、查找插件 - // if (mdmModuleDistributeEntities.get(0).getAddPlug() != null && !"".equals(mdmModuleDistributeEntities.get(0).getAddPlug())) { - // //2、查找插件 - // SysApplicationPluginEntity sysApplicationPluginEntity = sysApplicationPluginDao.get(mdmModuleDistributeEntities.get(0).getAddPlug()); - // if(sysApplicationPluginEntity.getPluginCode() != null && !"".equals(sysApplicationPluginEntity.getPluginCode())){ - // //3、调用插件 - // PluginBaseEntity pluginBaseEntity = PluginUtils.getPluginsById(sysApplicationPluginEntity.getPluginCode()); - // try { - // JsonResultEntity s = pluginBaseEntity.executeBusiness(jsonObject); - // flag = true; - // } catch (Exception e) { - // logger.error("插件处理失败"+e.getMessage()); - // } - // } - // } - // } else { - // //TODO 连线 - // flag = true; - // } - // } - // if(mdmModuleDbEntity.getDbName()!= null && !"".equals(mdmModuleDbEntity.getDbName())) { - // MdmDistributeEntity mdmDistributeEntity = new MdmDistributeEntity(); - // mdmDistributeEntity.setCreate(); - // mdmDistributeEntity.setTableName(mdmModuleDbEntity.getDbName()+"_distribute"); - // mdmDistributeEntity.setFormmainId(jsonObject.getString("id")); - // mdmDistributeEntity.setAppId(jsonObject.getString("appID")); - // mdmDistributeEntity.setStatus("1"); - // mdmDistributeEntity.setMsg("发送成功"); - // if (!flag) { - // mdmDistributeEntity.setStatus("3"); - // mdmDistributeEntity.setMsg("发送失败"); - // } - // mdmModuleDao.saveDistribute(mdmDistributeEntity); - // return BaseResult.getSuccessMessageEntity("下发数据成功"); - // - // }else { - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // }else { - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // }else { - // if (!checkData(jsonObject, "distributeID")) { - // return BaseResult.getFailureMessageEntity("请先传递分发数据"); - // } - // boolean flag = false; - // //1、根据服务名查询分发数据 - // MdmModuleEntity mdmModuleEntity = new MdmModuleEntity(); - // mdmModuleEntity.setMdmCode(jsonObject.getInteger("mdmCode")); - // mdmModuleEntity.setSts("Y"); - // List mdmModuleEntities = mdmModuleDao.queryBase(mdmModuleEntity); - // if (mdmModuleEntities != null && mdmModuleEntities.size() == 1) { - // MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); - // mdmModuleDbEntity.setMdmId(mdmModuleEntities.get(0).getId()); - // mdmModuleDbEntity.setDbType("1"); - // mdmModuleDbEntity.setSts("Y"); - // List mdmModuleDbEntities = mdmModuleDbDao.queryBase(mdmModuleDbEntity); - // if (mdmModuleDbEntities != null && mdmModuleDbEntities.size() == 1) { - // mdmModuleDbEntity = mdmModuleDbEntities.get(0); - // } - // MdmModuleDistributeEntity mdmModuleDistributeEntity = new MdmModuleDistributeEntity(); - // mdmModuleDistributeEntity.setAppId(jsonObject.getString("appID")); - // mdmModuleDistributeEntity.setMdmId(mdmModuleEntities.get(0).getId()); - // List mdmModuleDistributeEntities = mdmModuleDistributeDao.queryBase(mdmModuleDistributeEntity); - // if (mdmModuleDistributeEntities != null && mdmModuleDistributeEntities.size() == 1) { - // if (mdmModuleDistributeEntities.get(0).getDeleteType() != null && "1".equals(mdmModuleDistributeEntities.get(0).getDeleteType())) { - // //2、查找插件 - // if (mdmModuleDistributeEntities.get(0).getDeletePlug() != null && !"".equals(mdmModuleDistributeEntities.get(0).getDeletePlug())) { - // //2、查找插件 - // SysApplicationPluginEntity sysApplicationPluginEntity = sysApplicationPluginDao.get(mdmModuleDistributeEntities.get(0).getDeletePlug()); - // if(sysApplicationPluginEntity.getPluginCode() != null && !"".equals(sysApplicationPluginEntity.getPluginCode())){ - // //3、调用插件 - // PluginBaseEntity pluginBaseEntity = PluginUtils.getPluginsById(sysApplicationPluginEntity.getPluginCode()); - // try { - // JsonResultEntity s = pluginBaseEntity.executeBusiness(jsonObject); - // flag = true; - // } catch (Exception e) { - // logger.error("插件处理失败"+e.getMessage()); - // } - // } - // } - // } else { - // //TODO 连线 - // flag = true; - // } - // } - // if(mdmModuleDbEntity.getDbName()!= null && !"".equals(mdmModuleDbEntity.getDbName())) { - // //删除数据 - // MdmDistributeEntity mdmDistributeEntity = new MdmDistributeEntity(); - // mdmDistributeEntity.setId(jsonObject.getString("distributeID")); - // mdmDistributeEntity.setTableName(mdmModuleDbEntity.getDbName()+"_distribute"); - // mdmDistributeEntity.setFormmainId(jsonObject.getString("id")); - // mdmDistributeEntity.setAppId(jsonObject.getString("appID")); - // mdmDistributeEntity.setStatus("1"); - // mdmDistributeEntity.setMsg("删除成功"); - // if (!flag) { - // mdmDistributeEntity.setStatus("3"); - // mdmDistributeEntity.setMsg("删除失败"); - // } - // mdmModuleDao.updateDistribute(mdmDistributeEntity); - // return BaseResult.getSuccessMessageEntity("删除数据成功"); - // - // }else { - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // }else { - // return BaseResult.getFailureMessageEntity("系统错误"); - // } - // } - // - //} - // + + /** + * @param jsonStr + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 处理分发数据 + * @Date 9:40 上午 2023/10/18 + **/ + @Override + public JsonResultEntity doMdmDistribute(JSONObject jsonStr) { + JSONObject jsonObject = getstrObj("jsonStr", jsonStr); + //校验是否有servecr传参 + if (!checkData(jsonObject, "mdmCode")) { + return BaseResult.getFailureMessageEntity("请先传递服务名"); + } + if (!checkData(jsonObject, "id")) { + return BaseResult.getFailureMessageEntity("请先传递要下发数据"); + } + if (!checkData(jsonObject, "distributeId")) { + return BaseResult.getFailureMessageEntity("请先传递要下发的数据"); + } + if (!checkData(jsonObject, "type")) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + Long mdmCode = jsonObject.getLong("mdmCode");//主数据编码 + String id = jsonObject.getString("id");//行数据的单据规则编码 + String distributeId = jsonObject.getString("distributeId");//发送表id + String type = jsonObject.getString("type");//发送类型,1、新增2、修改3、删除 + + String apiId = null; + String scriptId = null; + //查找对应数据,组装数据发送 + + //获取主数据信息 + MdmModuleEntity mdmModuleEntity = mdmServiceCache.getMdmModuleEntity(mdmCode); + if (mdmModuleEntity == null || mdmModuleEntity.getId() == null) { + return BaseResult.getFailureMessageEntity("主数据不存在"); + } + + //获取主数据db + MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); + mdmModuleDbEntity.setMdmId(mdmModuleEntity.getId()); + List mdmModuleDbEntities = mdmServiceCache.queryMdmModuleDb(mdmModuleDbEntity); + if (mdmModuleDbEntities == null || mdmModuleDbEntities.size() == 0) { + return BaseResult.getFailureMessageEntity("主数据数据源不存在"); + } + + //获取分发表 + //获取分发的接口 + MdmModuleDistributeEntity mdmModuleDistributeEntity = mdmModuleDistributeDao.get(distributeId); + if (mdmModuleDistributeEntity == null || mdmModuleDistributeEntity.getId() == null) { + return BaseResult.getFailureMessageEntity("分发不存在"); + } + // 启用停用 0、停用 + if ("0".equals(mdmModuleDistributeEntity.getEnabledState())) { + return BaseResult.getFailureMessageEntity("分发已停用"); + } + MdmModuleDistributeDetailEntity mdmModuleDistributeDetailEntity = new MdmModuleDistributeDetailEntity(); + mdmModuleDistributeDetailEntity.setDistributeId(distributeId); + mdmModuleDistributeDetailEntity.setSts("Y"); + List mdmModuleDistributeDetailEntities = mdmModuleDistributeDetailDao.queryBase(mdmModuleDistributeDetailEntity); + + // 启用停用 0、停用 + if ("1".equals(mdmModuleDistributeEntity.getEnabledType())) { + return BaseResult.getFailureMessageEntity("分发为自动下发,不允许手动下发"); + } + //1、新增2、修改3、删除 + if ("1".equals(type)) { + apiId = mdmModuleDistributeEntity.getAddApi(); + scriptId = mdmModuleDistributeEntity.getAddScript(); + } else if ("2".equals(type)) { + apiId = mdmModuleDistributeEntity.getUpdateApi(); + scriptId = mdmModuleDistributeEntity.getUpdateScript(); + + } else if ("3".equals(type)) { + apiId = mdmModuleDistributeEntity.getDeleteApi(); + scriptId = mdmModuleDistributeEntity.getDeleteScript(); + } + if (apiId == null || "".equals(apiId)) { + return BaseResult.getFailureMessageEntity("分发接口未选择,请先选择"); + } + SysApplicationScriptEntity scriptEntity = null; + if (scriptId != null && !"".equals(scriptId)) { + scriptEntity = sysApplicationScriptDao.get(scriptId); + if (scriptEntity == null || scriptEntity.getId() == null) { + return BaseResult.getFailureMessageEntity("分发接口脚本不存在"); + } + } + SysApplicationApiEntity apiEntity = sysApplicationApiDao.get(apiId); + if (apiEntity == null || apiEntity.getId() == null) { + return BaseResult.getFailureMessageEntity("分发接口不存在"); + + } + SysApplicationEntity sysApplicationEntity = sysApplicationDao.get(apiEntity.getAppId()); + if (sysApplicationEntity == null || sysApplicationEntity.getId() == null) { + return BaseResult.getFailureMessageEntity("应用不存在"); + } + + //获取主数据db字段,以及字段的规则 + MdmModuleDbFiledsEntity queryFild = new MdmModuleDbFiledsEntity(); + queryFild.setMdmId(mdmModuleEntity.getId()); + List mdmModuleDbFiledsEntities = mdmServiceCache.queryMdmModuleDbFileds(queryFild); + MdmModuleDbFiledsRuleEntity queryFildRule = new MdmModuleDbFiledsRuleEntity(); + queryFildRule.setMdmId(mdmModuleEntity.getId()); + queryFildRule.setRuleCode("service"); + List mdmModuleDbFiledsRuleEntities = mdmModuleDbFiledsRuleDao.queryBase(queryFildRule); + + String dbname = null; + //获取主数据db对应的实体表的数据 + JSONObject object = new JSONObject(); + for (int i = 0; i < mdmModuleDbEntities.size(); i++) { + if ("1".equals(mdmModuleDbEntities.get(i).getDbType())) { + dbname = mdmModuleDbEntities.get(i).getDbName(); + Map map = new HashMap<>(); + map.put("tableName", mdmModuleDbEntities.get(i).getDbName()); + map.put("id", id); + object = mdmModuleDao.queryMdmST(map); + if (object.getString("id") == null || "".equals(object.getString("id"))) { + return BaseResult.getFailureMessageEntity("当前数据不存在"); + } + if (mdmModuleDistributeDetailEntities != null && mdmModuleDistributeDetailEntities.size() > 0) { + Map checkData = new HashMap<>(); + checkData.put("tableName", mdmModuleDbEntities.get(i).getDbName()); + checkData.put("id", id); + checkData.put("mdmModuleDistributeDetailEntities", mdmModuleDistributeDetailEntities); + JSONObject object1 = mdmModuleDao.queryMdmST(checkData); + if (object1.getString("id") == null || "".equals(object1.getString("id"))) { + return BaseResult.getFailureMessageEntity("当前数据不符合规则不发送"); + } + } + //查看主表是否有字段是关联的 + if (mdmModuleDbFiledsRuleEntities != null && mdmModuleDbFiledsRuleEntities.size() > 0) { + for (int i1 = 0; i1 < mdmModuleDbFiledsRuleEntities.size(); i1++) { + if (mdmModuleDbFiledsRuleEntities.get(i1).getDbId().equals(mdmModuleDbEntities.get(i).getId())) { + if (mdmModuleDbFiledsEntities != null && mdmModuleDbFiledsEntities.size() > 0) { + for (int i2 = 0; i2 < mdmModuleDbFiledsEntities.size(); i2++) { + if (mdmModuleDbFiledsRuleEntities.get(i1).getFiledId().equals(mdmModuleDbFiledsEntities.get(i2).getId())) { + Map mapDetail = new HashMap<>(); + mapDetail.put("tableName", mdmModuleDbFiledsRuleEntities.get(i1).getRuleValue()); + mapDetail.put("id", object.getString(mdmModuleDbFiledsEntities.get(i2).getEnName())); + JSONObject objectDetail = mdmModuleDao.queryMdmST(mapDetail); + object.put(mdmModuleDbFiledsEntities.get(i2).getEnName(), objectDetail); + } + } + } + } + } + } + } + } + + for (int i = 0; i < mdmModuleDbEntities.size(); i++) { + if ("2".equals(mdmModuleDbEntities.get(i).getDbType())) { + Map map = new HashMap<>(); + map.put("tableName", mdmModuleDbEntities.get(i).getDbName()); + map.put("formmainId", object.getString("id")); + List detail = mdmModuleDao.queryMdmSTDetail(map); + //查看主表是否有字段是关联的 + if (detail != null && detail.size() > 0) { + if (mdmModuleDbFiledsRuleEntities != null && mdmModuleDbFiledsRuleEntities.size() > 0) { + for (int i1 = 0; i1 < mdmModuleDbFiledsRuleEntities.size(); i1++) { + if (mdmModuleDbFiledsRuleEntities.get(i1).getDbId().equals(mdmModuleDbEntities.get(i).getId())) { + if (mdmModuleDbFiledsEntities != null && mdmModuleDbFiledsEntities.size() > 0) { + for (int i2 = 0; i2 < mdmModuleDbFiledsEntities.size(); i2++) { + if (mdmModuleDbFiledsRuleEntities.get(i1).getFiledId().equals(mdmModuleDbFiledsEntities.get(i2).getId())) { + for (int i3 = 0; i3 < detail.size(); i3++) { + Map mapDetail = new HashMap<>(); + mapDetail.put("tableName", mdmModuleDbFiledsRuleEntities.get(i1).getRuleValue()); + mapDetail.put("id", detail.get(i3).getString(mdmModuleDbFiledsEntities.get(i2).getEnName())); + JSONObject objectDetail = mdmModuleDao.queryMdmST(mapDetail); + detail.get(i3).put(mdmModuleDbFiledsEntities.get(i2).getEnName(), objectDetail); + } + } + } + } + } + } + } + } + object.put(mdmModuleDbEntities.get(i).getDbName(), detail); + } + } + //执行脚本 + JSONObject groovy = new JSONObject(); + JSONObject parameterJson = new JSONObject(); + parameterJson.put("header", apiEntity.getHeaderIn()); + parameterJson.put("body", apiEntity.getBodyIn()); + parameterJson.put("query", apiEntity.getQueryIn()); + parameterJson.put("data", object); + /** head */ + Map header = null; + /** query */ + String querys = null; + /** body */ + String bodys = object.toJSONString(); + if (scriptEntity != null && scriptEntity.getId() != null) { + groovy.put("code", scriptEntity.getScriptCode()); + groovy.put("className", scriptEntity.getClassName()); + groovy.put("name", scriptEntity.getScriptName()); + groovy.put("methodStr", scriptEntity.getScriptData()); + groovy.put("parameterJson", parameterJson); + JSONObject groovyStr = new JSONObject(); + groovyStr.put("jsonStr", groovy); + try { + //SysExtensionApiEntity jsonResultEntity = groovyIntegrationService.groovyScriptExecution(groovy); + SysExtensionApiEntity jsonResultEntity = new SysExtensionApiEntity(); + jsonResultEntity.setBodys("{\"ufinterface\":{\"billtype\":\"supplier\",\"sender\":\"OA\",\"replace\":\"Y\",\"isexchange\":\"Y\",\"account\":\"01\",\"groupcode\":\"00\"},\"bill\":{\"billhead\":{\"pk_country\":\"CN\",\"pk_group\":\"00\",\"enablestate\":\"2\",\"code\":\"01004\",\"supprop\":\"0\",\"pk_format\":\"ZH-CN\",\"pk_supplierclass\":\"S01\",\"custstate\":\"1\",\"name\":\"\",\"pk_timezone\":\"P0800\",\"taxpayerid\":\"087981489021135119\",\"pk_org\":\"003\"}}}"); + header = jsonResultEntity.getHeaders(); + querys = jsonResultEntity.getQuerys(); + bodys = jsonResultEntity.getBodys(); + } catch (Exception e) { + return BaseResult.getFailureMessageEntity("分发脚本转换错误"); + } + } + Map headers = new HashMap<>(); + headers.put("publicKey", "ZJYAWb7lhAUTYqekPkU+uHJv1/ObJxb7dT7sD8HPRDGAgyhCe7eDIk+3zDUT+v578prj"); + headers.put("secretKey", "fviZnLBsQUAGF8w8FSOdJi7XlIm/XAZclMxRagDLfTyJFlvnIBF3w66Hrpfzs8cYj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA="); + headers.put("appId", sysApplicationEntity.getAppId().toString()); + headers.put("apiCode", apiEntity.getApiCode().toString()); + if (header != null) { + headers.putAll(header); + } + //组装数据发送 + JsonResultEntity jsonResultEntity = sendData(apiEntity, headers, bodys, querys); + if (jsonResultEntity.isFlag()) { + saveMdmModuleSendLogEntity("1","发送成功",dbname,object.getString("id"), sysApplicationEntity.getName(), apiEntity.getApiName(), object.toJSONString(), type); + return BaseResult.getFailureMessageEntity("发送成功"); + } else { + saveMdmModuleSendLogEntity("2","转发失败",dbname,object.getString("id"), sysApplicationEntity.getName(), apiEntity.getApiName(), object.toJSONString(), type); + return BaseResult.getFailureMessageEntity("发送错误:"+jsonResultEntity.getMsg()); + } + } + + private void saveMdmModuleSendLogEntity(String dataType,String remark,String dbname,String formmain_id, String target_app, String target_api, String source_data, String option_type) { + MdmModuleSendLogEntity mdmModuleSendLogEntity = new MdmModuleSendLogEntity(); + mdmModuleSendLogEntity.setTableName(dbname+"_send_log"); + mdmModuleSendLogEntity.setCreate(); + mdmModuleSendLogEntity.setId(UUIDUtils.getUUID()); + mdmModuleSendLogEntity.setSts("Y"); + mdmModuleSendLogEntity.setCreate_user_id("1"); + mdmModuleSendLogEntity.setModify_user_id("1"); + mdmModuleSendLogEntity.setCreate_time(new Date()); + mdmModuleSendLogEntity.setModify_time(new Date()); + mdmModuleSendLogEntity.setOrg_id("0"); + mdmModuleSendLogEntity.setCompanyId("0"); + mdmModuleSendLogEntity.setFormmainId(formmain_id); + mdmModuleSendLogEntity.setTargetApp(target_app); + mdmModuleSendLogEntity.setTargetApi(target_api); + mdmModuleSendLogEntity.setSourceData(source_data); + mdmModuleSendLogEntity.setOptionType(option_type); + mdmModuleSendLogEntity.setDataType(dataType); + mdmModuleSendLogEntity.setRemark(remark); + mdmModuleSendLogDao.save(mdmModuleSendLogEntity); + } + + private JsonResultEntity sendData(SysApplicationApiEntity applicationApiEntity, Map headers, String bodys, String querys) { + StringBuffer urls = new StringBuffer(url); + if (querys != null) { + urls.append("?"); + urls.append(querys); + } + HttpClientBuilder httpClientBuilder = HttpClientBuilder.create(); + // HttpClient + CloseableHttpClient closeableHttpClient = httpClientBuilder.disableCookieManagement().build(); + HttpPost post = new HttpPost(urls.toString()); + CloseableHttpResponse response = null; + + RequestConfig requestConfig = RequestConfig.custom().setConnectTimeout(Integer.valueOf(applicationApiEntity.getTimeoutPeriod())).build(); + post.setConfig(requestConfig);//设置请求参数【超时时间】 + + if (headers != null && headers.size() > 0) { + for (String key : headers.keySet()) { + post.setHeader(key, headers.get(key)); + } + } + StringBuilder body = new StringBuilder(); + boolean flag = true; + try { + if (bodys != null && !"".equals(bodys)) { + ByteArrayEntity entity = new ByteArrayEntity(bodys.getBytes("UTF-8")); + entity.setContentType("application/json"); + post.setEntity(entity); + } + response = closeableHttpClient.execute(post); + + HttpEntity entity = response.getEntity(); + synchronized (lock) { + body.append(EntityUtils.toString(entity, "UTF-8")); + } + flag = true; + logger.info("返回结果:" + body); + } catch (Exception e) { + logger.error("请求错误:" + e.getMessage()); + body.append(e.getMessage()); + flag = false; + } finally { + try { + // 关闭响应对象 + if (response != null) { + response.close(); + } + // 关闭响应对象 + if (closeableHttpClient != null) { + closeableHttpClient.close(); + } + } catch (IOException e) { + e.printStackTrace(); + } + + } + if (flag) { + if (JSONUtil.isTypeJSON(body.toString())) { + JsonResultEntity jsonResultEntity = JSONObject.parseObject(body.toString(), JsonResultEntity.class); + if (jsonResultEntity.isFlag()) { + return BaseResult.getSuccessMessageEntity("转发成功", body); + } else { + return BaseResult.getFailureMessageEntity("转发失败", body); + } + } else { + return BaseResult.getFailureMessageEntity("转发失败", body); + } + } else { + return BaseResult.getFailureMessageEntity("转发失败", body); + } + } + /** * @param mdmCode * @param saveData @@ -1653,9 +1891,14 @@ public class MdmServiceImpl implements IMdmService { * @Description 校验数据 * @Date 11:20 上午 2023/11/6 **/ - private String checkDataOnly(Integer mdmCode, JSONObject saveData, boolean flag, MdmModuleEntity mdmModuleEntity, List mdmModuleDbEntityList) { + private String checkDataOnly(long mdmCode, JSONObject saveData, boolean flag, MdmModuleEntity mdmModuleEntity, List mdmModuleDbEntityList,String msg) { StringBuffer str = new StringBuffer(); - + String dbname = null; + for (int i = 0; i < mdmModuleDbEntityList.size(); i++) { + if("1".equals(mdmModuleDbEntityList.get(i).getDbType())){ + dbname = mdmModuleDbEntityList.get(i).getDbName(); + } + } //查询字段 //查询字段下的必填规则 MdmModuleDbFiledsEntity mdmModuleDbFiledsEntity = new MdmModuleDbFiledsEntity(); @@ -1789,7 +2032,7 @@ public class MdmServiceImpl implements IMdmService { mdmTableCodeRuleEntity.setSts("Y"); List allMdmTableCodeRuleEntities = mdmTableCodeRuleDao.queryBase(mdmTableCodeRuleEntity); List mdmTableCodeRuleEntities = new ArrayList<>(); - if(allMdmTableCodeRuleEntities != null && allMdmTableCodeRuleEntities.size() > 0){ + if (allMdmTableCodeRuleEntities != null && allMdmTableCodeRuleEntities.size() > 0) { mdmTableCodeRuleEntities = allMdmTableCodeRuleEntities; //for (int i1 = 0; i1 < allMdmTableCodeRuleEntities.size(); i1++) { // if(mdmModuleDbEntityList.get(i).getId().equals(allMdmTableCodeRuleEntities.get(i1).getDbId())){ @@ -1838,7 +2081,8 @@ public class MdmServiceImpl implements IMdmService { mdmDataFiledDtos.add(update_status); MdmDataFiledDto data_status = new MdmDataFiledDto(); data_status.setFiledsName("data_status"); - data_status.setFiledsValue("F");; + data_status.setFiledsValue("F"); + ; mdmDataFiledDtos.add(data_status); int a = mdmModuleDao.updateForm(mdmDataDto); } else { @@ -1852,15 +2096,18 @@ public class MdmServiceImpl implements IMdmService { mdmDataFiledDtos.add(ids); MdmDataFiledDto data_status = new MdmDataFiledDto(); data_status.setFiledsName("data_status"); - data_status.setFiledsValue("Y");; + data_status.setFiledsValue("Y"); + ; mdmDataFiledDtos.add(data_status); MdmDataFiledDto org_id = new MdmDataFiledDto(); org_id.setFiledsName("org_id"); - org_id.setFiledsValue("Y");; + org_id.setFiledsValue("Y"); + ; mdmDataFiledDtos.add(org_id); MdmDataFiledDto company_id = new MdmDataFiledDto(); company_id.setFiledsName("company_id"); - company_id.setFiledsValue("Y");; + company_id.setFiledsValue("Y"); + ; mdmDataFiledDtos.add(company_id); MdmDataFiledDto add_status = new MdmDataFiledDto(); @@ -1897,9 +2144,9 @@ public class MdmServiceImpl implements IMdmService { mdmModuleDbFiledsEntity1.setSts("Y"); List allfileds = mdmServiceCache.queryMdmModuleDbFileds(mdmModuleDbFiledsEntity1); List fileds = new ArrayList<>(); - if(allfileds != null && allfileds.size() > 0){ + if (allfileds != null && allfileds.size() > 0) { for (int i1 = 0; i1 < allfileds.size(); i1++) { - if(mdmModuleDbEntityList.get(i).getId().equals(allfileds.get(i1).getDbId())){ + if (mdmModuleDbEntityList.get(i).getId().equals(allfileds.get(i1).getDbId())) { fileds.add(allfileds.get(i1)); } } @@ -1948,6 +2195,9 @@ public class MdmServiceImpl implements IMdmService { } } } + + saveOption(dbname,mdmCode,saveData,id,msg); + } return str.toString(); } 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 d36dc4b2..ad3ba58b 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 @@ -11,6 +11,8 @@ import com.baomidou.dynamic.datasource.annotation.DSTransactional; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import com.hzya.frame.basedao.service.impl.BaseService; +import com.hzya.frame.mdm.mdmModuleDistribute.dao.IMdmModuleDistributeDao; +import com.hzya.frame.mdm.mdmModuleDistribute.entity.MdmModuleDistributeEntity; import com.hzya.frame.serviceUtil.DsDataSourceUtil; import com.hzya.frame.sysnew.application.api.dao.ISysApplicationApiDao; import com.hzya.frame.sysnew.application.api.entity.SysApplicationApiDto; @@ -104,7 +106,8 @@ public class SysApplicationServiceImpl extends BaseService 0){ + return BaseResult.getFailureMessageEntity("脚本已经被使用,请先取消关联"); + } entity.setUpdate(); sysApplicationScriptDao.logicRemoveMultiCondition(entity); return BaseResult.getSuccessMessageEntity("删除脚本成功"); From c6d4f8ad3a58056ae12cab7ee45e397bf4b9f973 Mon Sep 17 00:00:00 2001 From: lvleigang <957075182@qq.com> Date: Thu, 20 Jun 2024 17:15:15 +0800 Subject: [PATCH 75/80] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=BE=B3=E6=98=9Furl?= =?UTF-8?q?=E7=9A=84=E5=90=8D=E7=A7=B0=EF=BC=8C=E6=89=80=E6=9C=89=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE=E9=83=BD=E5=8F=AF=E4=BB=A5=E4=BD=BF=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../plugin/mdmDistribute/plugin/MdmModulePluginInitializer.java | 2 +- buildpackage/src/main/resources/application-ax.yml | 2 +- buildpackage/src/main/resources/application-hclocal.yml | 2 +- buildpackage/src/main/resources/application-llg.yml | 2 +- buildpackage/src/main/resources/application-local.yml | 2 +- buildpackage/src/main/resources/application-yuqh.yml | 2 +- buildpackage/src/main/resources/application.yml | 2 +- .../java/com/hzya/frame/mdm/service/impl/MdmServiceImpl.java | 2 +- .../java/com/hzya/frame/u8c/ax/service/impl/AxServiceImpl.java | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/mdmDistribute/plugin/MdmModulePluginInitializer.java b/buildpackage/src/main/java/com/hzya/frame/plugin/mdmDistribute/plugin/MdmModulePluginInitializer.java index 34a4325d..6c683a0a 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/mdmDistribute/plugin/MdmModulePluginInitializer.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/mdmDistribute/plugin/MdmModulePluginInitializer.java @@ -81,7 +81,7 @@ public class MdmModulePluginInitializer extends PluginBaseEntity { @Resource private IMdmModuleSendLogDao mdmModuleSendLogDao; - @Value("${ax.url}") + @Value("${zt.url}") private String url ; //多线程请求加锁 HttpRequest 构造方法是静态的 diff --git a/buildpackage/src/main/resources/application-ax.yml b/buildpackage/src/main/resources/application-ax.yml index ffd172f8..fda31564 100644 --- a/buildpackage/src/main/resources/application-ax.yml +++ b/buildpackage/src/main/resources/application-ax.yml @@ -19,5 +19,5 @@ spring: savefile: # 文件保存路径 path: E:\yongansystem\file -ax: +zt: url: http://127.0.0.1:9081/kangarooDataCenterV3/entranceController/externalCallInterface \ No newline at end of file diff --git a/buildpackage/src/main/resources/application-hclocal.yml b/buildpackage/src/main/resources/application-hclocal.yml index b88db817..3e44c377 100644 --- a/buildpackage/src/main/resources/application-hclocal.yml +++ b/buildpackage/src/main/resources/application-hclocal.yml @@ -23,5 +23,5 @@ spring: savefile: # 文件保存路径 path: D:\yongansystem\kangarooDataCenter\v3\logs -ax: +zt: url: http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface \ No newline at end of file diff --git a/buildpackage/src/main/resources/application-llg.yml b/buildpackage/src/main/resources/application-llg.yml index 25a80574..d1c57a17 100644 --- a/buildpackage/src/main/resources/application-llg.yml +++ b/buildpackage/src/main/resources/application-llg.yml @@ -24,5 +24,5 @@ spring: savefile: # 文件保存路径 path: /Users/apple/Desktop/log/local -ax: +zt: url: http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface \ No newline at end of file diff --git a/buildpackage/src/main/resources/application-local.yml b/buildpackage/src/main/resources/application-local.yml index e2364fc0..4fc3208a 100644 --- a/buildpackage/src/main/resources/application-local.yml +++ b/buildpackage/src/main/resources/application-local.yml @@ -19,5 +19,5 @@ spring: savefile: # 文件保存路径 path: /Users/apple/Desktop/log/local -ax: +zt: url: http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface \ No newline at end of file diff --git a/buildpackage/src/main/resources/application-yuqh.yml b/buildpackage/src/main/resources/application-yuqh.yml index 47544edc..b5209253 100644 --- a/buildpackage/src/main/resources/application-yuqh.yml +++ b/buildpackage/src/main/resources/application-yuqh.yml @@ -19,5 +19,5 @@ spring: savefile: # 文件保存路径 path: E:\yongansystem\log -ax: +zt: url: http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface \ No newline at end of file diff --git a/buildpackage/src/main/resources/application.yml b/buildpackage/src/main/resources/application.yml index ceab32b0..9a669fa1 100644 --- a/buildpackage/src/main/resources/application.yml +++ b/buildpackage/src/main/resources/application.yml @@ -90,7 +90,7 @@ mybatis-plus: global-config: db-config: id-type: auto # 主键策略 -ax: +zt: url: # 积木报表工具 #JimuReport[minidao配置] 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 168ca76b..05fd7920 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 @@ -150,7 +150,7 @@ public class MdmServiceImpl implements IMdmService { private IMdmModuleViewDetailDao mdmModuleViewDetailDao; //多线程请求加锁 HttpRequest 构造方法是静态的 private final Object lock = new Object(); - @Value("${ax.url}") + @Value("${zt.url}") private String url; /** diff --git a/service/src/main/java/com/hzya/frame/u8c/ax/service/impl/AxServiceImpl.java b/service/src/main/java/com/hzya/frame/u8c/ax/service/impl/AxServiceImpl.java index e9ef121d..866b91a3 100644 --- a/service/src/main/java/com/hzya/frame/u8c/ax/service/impl/AxServiceImpl.java +++ b/service/src/main/java/com/hzya/frame/u8c/ax/service/impl/AxServiceImpl.java @@ -38,7 +38,7 @@ public class AxServiceImpl extends BaseService implement this.axDao = dao; this.dao = dao; } - @Value("${ax.url}") + @Value("${zt.url}") private String voucherUrl; private final String publicKey = "ZJYAWb7lhAUTYqekPkU+uHJv1/ObJxb7dT7sD8HPRDGAgyhCe7eDIk+3zDUT+v578prj"; private final String secretKey = "fviZnLBsQUAGF8w8FSOdJi7XlIm/XAZclMxRagDLfTyJFlvnIBF3w66Hrpfzs8cYj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA="; From 299ba86d6095d78a49ee965142090527f06641a0 Mon Sep 17 00:00:00 2001 From: hecan <1718492867@qq.com> Date: Fri, 21 Jun 2024 09:29:09 +0800 Subject: [PATCH 76/80] =?UTF-8?q?=E8=B0=83=E6=95=B4=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=EF=BC=8C=E5=AD=90=E8=A1=A8=E4=B8=8D=E6=96=B0=E5=A2=9E=E6=93=8D?= =?UTF-8?q?=E4=BD=9C=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/ComparisonServiceImpl.java | 57 ++++++++++--------- 1 file changed, 29 insertions(+), 28 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 f0464a0e..21a02ea4 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 @@ -137,13 +137,13 @@ public class ComparisonServiceImpl extends BaseService Map map = new HashMap<>();//将主表数据存到map中 Map mapDetails = new HashMap<>();//将子表数据存到map中 if (comparisonEntities != null && comparisonEntities.size() > 0) { - map=spliceMainMap(comparisonEntities,jsonObjectMain,map,comparisonEntity); - mapDetails=spliceDetailMap(comparisonEntities,mapDetails,comparisonDetailsEntity,jsonArray); - String uuid=null; - if(jsonObjectMain.getString("id")==null){ + map = spliceMainMap(comparisonEntities, jsonObjectMain, map, comparisonEntity); + mapDetails = spliceDetailMap(comparisonEntities, mapDetails, comparisonDetailsEntity, jsonArray); + String uuid = null; + if (jsonObjectMain.getString("id") == null) { uuid = UUIDUtils.getUUID(); map.put("id", uuid); - }else{ + } else { uuid = jsonObjectMain.getString("id"); map.put("id", jsonObjectMain.getString("id")); } @@ -153,47 +153,48 @@ public class ComparisonServiceImpl extends BaseService 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");//删除状态 + 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 { - comparisonEntityRule= comparisonDao.queryComparisonById(comparisonEntityRule); - String documentRule =comparisonEntityRule.getDocumentRule();; //"KH-2024-05-30-1"; - logger.info("通用数据保存接口中根据mId查询出来的单据规则为:{}",documentRule); - if(documentRule !=null){ + 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("-")); + 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); + String ruleSuffixLength = documentRule.substring(documentRule.lastIndexOf("-") + 1); int ruleSuffix = ruleSuffixLength.length(); //生成单据规则 - comparisonEntity.setRulePrefix(rulePrefix); - comparisonEntity.setRuleMiddle(ruleMiddle); - comparisonEntity.setRuleSuffix(ruleSuffix); + comparisonEntityRule.setRulePrefix(rulePrefix); + comparisonEntityRule.setRuleMiddle(ruleMiddle); + comparisonEntityRule.setRuleSuffix(ruleSuffix); try { //新生成单据规则保存到数据库 - comparisonEntityRule = comparisonDao.queryComparisonRule(comparisonEntity); - map.put("document_rule", comparisonEntityRule.getDocumentRule());//单据规则 - map.put("document_rule_num", comparisonEntityRule.getDocumentRuleNum());//单据规则流水号 - comparisonEntity.setMap(map); + 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()); + } catch (Exception e) { + logger.info("通用数据保存接口中查询单据规则错误:{}", e.getMessage()); return BaseResult.getFailureMessageEntity("保存失败"); } try { //保存主表数据 - ComparisonEntity comparisonEntityOne = comparisonDao.saveComparison(comparisonEntity); + ComparisonEntity comparisonEntityOne = comparisonDao.saveComparison(comparisonEntityRule); //保存子表数据 if (mapDetails != null && mapDetails.size() > 0) { String uuidDetail = UUIDUtils.getUUID(); @@ -211,10 +212,10 @@ public class ComparisonServiceImpl extends BaseService //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"); + //controlsLogDaoimpl.saveControlsLog(uuidDetail,jsonObject.getString("appName"),jsonObject.getString("appCode"),jsonObject.toJSONString(),"接口新增",jsonObject.getString("optionName"),comparisonDetailsEntity.getDbName()+"_option_log"); } //保存操作日志 - controlsLogDaoimpl.saveControlsLog(uuid,jsonObject.getString("appName"),jsonObject.getString("appCode"),jsonObject.toJSONString(),"接口新增",jsonObject.getString("optionName"),comparisonEntity.getDbName()+"_option_log"); + controlsLogDaoimpl.saveControlsLog(uuid,jsonObject.getString("appName"),jsonObject.getString("appCode"),jsonObject.toJSONString(),"接口新增",jsonObject.getString("optionName"),comparisonEntityRule.getDbName()+"_option_log"); return BaseResult.getSuccessMessageEntity("保存成功", map); } catch (Exception e) { logger.info("保存通用数据时候错误:{}", e.getMessage()); From d4b2ff16ff3c659a55de38ff9a76b7546d29bea2 Mon Sep 17 00:00:00 2001 From: hecan <1718492867@qq.com> Date: Fri, 21 Jun 2024 10:26:50 +0800 Subject: [PATCH 77/80] =?UTF-8?q?=E8=B0=83=E6=95=B4=E9=80=9A=E7=94=A8?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=9F=A5=E8=AF=A2=EF=BC=8C=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E5=AD=90=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/ComparisonServiceImpl.java | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) 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 21a02ea4..6e3226f4 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 @@ -61,6 +61,7 @@ public class ComparisonServiceImpl extends BaseService return BaseResult.getFailureMessageEntity("主数据编码为空"); } ComparisonEntity comparisonEntity = jsonObject.toJavaObject(ComparisonEntity.class); + ComparisonDetailsEntity comparisonDetailsEntity=new ComparisonDetailsEntity(); List comparisonEntities=new ArrayList<>(); try { //根据主数据编码查询表名称,字段名称等信息 10001 @@ -85,12 +86,27 @@ public class ComparisonServiceImpl extends BaseService map.remove("appCode"); } } + if (entity.getDbType().equals("2")) { + comparisonDetailsEntity.setDbName(entity.getDbName()); + } } } comparisonEntity.setMap(map); try { List> comparisonEntitiePages = comparisonDao.queryComparisonPage(comparisonEntity); - PageInfo pageInfo = new PageInfo(comparisonEntitiePages); + JSONArray jsonArray=new JSONArray(); + if(CollectionUtils.isNotEmpty(comparisonEntitiePages)){ + for (Map comparisonEntitiePage : comparisonEntitiePages) { + comparisonDetailsEntity.setFormmainId(String.valueOf(comparisonEntitiePage.get("id"))); + List> maps = comparisonDetailsDao.queryComparisonDetailsPage(comparisonDetailsEntity); + jsonArray.add(maps); + } + } + JSONObject jsonObjects=new JSONObject(); + jsonObjects.put("main",comparisonEntitiePages); + jsonObjects.put("details",jsonArray); + List jsonObjects1 = JSON.parseArray(jsonObjects.toJSONString(), JSONObject.class); + PageInfo pageInfo = new PageInfo(jsonObjects1); return BaseResult.getSuccessMessageEntity("查询成功", pageInfo); } catch (Exception e) { logger.info("查询通用数据错误:{}", e.getMessage()); From 8ab6b88fb0286da1fd6077176de9cdb559a9cf35 Mon Sep 17 00:00:00 2001 From: hecan <1718492867@qq.com> Date: Fri, 21 Jun 2024 11:37:24 +0800 Subject: [PATCH 78/80] =?UTF-8?q?=E8=B0=83=E6=95=B4=E9=80=9A=E7=94=A8?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=9F=A5=E8=AF=A2=E8=BF=94=E5=9B=9E=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/ComparisonServiceImpl.java | 19 ++++++++++++------- 1 file changed, 12 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 6e3226f4..4de0f073 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 @@ -93,20 +93,25 @@ public class ComparisonServiceImpl extends BaseService } comparisonEntity.setMap(map); try { + List list=new ArrayList<>(); + //查询主表数据 List> comparisonEntitiePages = comparisonDao.queryComparisonPage(comparisonEntity); - JSONArray jsonArray=new JSONArray(); if(CollectionUtils.isNotEmpty(comparisonEntitiePages)){ 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); - jsonArray.add(maps); + if(CollectionUtils.isNotEmpty(maps)){ + jsonObjects.put(comparisonDetailsEntity.getDbName(),maps); + }else { + jsonObjects.put(comparisonDetailsEntity.getDbName(),new JSONArray()); + } + list.add(jsonObjects); } } - JSONObject jsonObjects=new JSONObject(); - jsonObjects.put("main",comparisonEntitiePages); - jsonObjects.put("details",jsonArray); - List jsonObjects1 = JSON.parseArray(jsonObjects.toJSONString(), JSONObject.class); - PageInfo pageInfo = new PageInfo(jsonObjects1); + PageInfo pageInfo = new PageInfo(list); return BaseResult.getSuccessMessageEntity("查询成功", pageInfo); } catch (Exception e) { logger.info("查询通用数据错误:{}", e.getMessage()); From 6b39d8b54dd965ecce3d0d6b63325a560dd7ec69 Mon Sep 17 00:00:00 2001 From: hecan <1718492867@qq.com> Date: Fri, 21 Jun 2024 11:41:18 +0800 Subject: [PATCH 79/80] =?UTF-8?q?=E5=8E=BB=E6=8E=89=E6=98=8E=E7=BB=86?= =?UTF-8?q?=E5=BE=97=E6=93=8D=E4=BD=9C=E4=BF=9D=E5=AD=98=E6=97=A5=E5=BF=97?= 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 4de0f073..0045280f 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 @@ -318,7 +318,7 @@ public class ComparisonServiceImpl extends BaseService 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"); + // controlsLogDaoimpl.saveControlsLog(comparisonDetailsEntity.getId(),jsonObject.getString("appName"),jsonObject.getString("appCode"),jsonObject.toJSONString(),"接口更新",jsonObject.getString("optionName"),comparisonDetailsEntity.getDbName()+"_option_log"); } //保存操作日志 controlsLogDaoimpl.saveControlsLog(comparisonEntity.getId(),jsonObject.getString("appName"),jsonObject.getString("appCode"),jsonObject.toJSONString(),"接口更新",jsonObject.getString("optionName"),comparisonEntity.getDbName()+"_option_log"); @@ -390,7 +390,7 @@ public class ComparisonServiceImpl extends BaseService comparisonDetailsEntity.setFormmainId(jsonObjectMain.getString("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"); + // controlsLogDaoimpl.saveControlsLog(comparisonDetailsEntity.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("删除成功",integer); From e1adda59aeb1d29e30178535f5dd982239b8f698 Mon Sep 17 00:00:00 2001 From: hecan <1718492867@qq.com> Date: Fri, 21 Jun 2024 13:59:12 +0800 Subject: [PATCH 80/80] =?UTF-8?q?=E5=AE=A2=E6=88=B7=E6=A1=A3=E6=A1=88?= =?UTF-8?q?=E6=8F=92=E4=BB=B6=E4=BB=A5=E5=8F=8A=E6=98=8E=E7=BB=86=E6=8F=92?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bank/dao/IMdmCustomerBankDao.java | 15 + .../bank/dao/impl/MdmCustomerBankDaoImpl.java | 16 + .../bank/entity/MdmCustomerBankEntity.java | 86 ++++ .../bank/entity/MdmCustomerBankEntity.xml | 267 +++++++++++++ .../MdmCustomerBankPluginInitializer.java | 50 +++ .../bank/service/IMdmCustomerBankService.java | 12 + .../impl/MdmCustomerBankServiceImpl.java | 25 ++ .../customer/dao/IMdmCustomerDao.java | 15 + .../customer/dao/impl/MdmCustomerDaoImpl.java | 16 + .../customer/entity/MdmCustomerEntity.java | 186 +++++++++ .../customer/entity/MdmCustomerEntity.xml | 377 ++++++++++++++++++ .../plugin/MdmCustomerPluginInitializer.java | 50 +++ .../customer/service/IMdmCustomerService.java | 12 + .../service/impl/MdmCustomerServiceImpl.java | 25 ++ .../masterData.customer.bank/pluginCfg.xml | 6 + .../spring/spring-buildpackage-dao.xml | 5 + .../spring/spring-buildpackage-plugin.xml | 5 + .../spring/spring-buildpackage-service.xml | 5 + .../plugin/masterData.customer/pluginCfg.xml | 6 + .../spring/spring-buildpackage-dao.xml | 5 + .../spring/spring-buildpackage-plugin.xml | 5 + .../spring/spring-buildpackage-service.xml | 5 + 22 files changed, 1194 insertions(+) create mode 100644 buildpackage/src/main/java/com/hzya/frame/plugin/masterData/customer/bank/dao/IMdmCustomerBankDao.java create mode 100644 buildpackage/src/main/java/com/hzya/frame/plugin/masterData/customer/bank/dao/impl/MdmCustomerBankDaoImpl.java create mode 100644 buildpackage/src/main/java/com/hzya/frame/plugin/masterData/customer/bank/entity/MdmCustomerBankEntity.java create mode 100644 buildpackage/src/main/java/com/hzya/frame/plugin/masterData/customer/bank/entity/MdmCustomerBankEntity.xml create mode 100644 buildpackage/src/main/java/com/hzya/frame/plugin/masterData/customer/bank/plugin/MdmCustomerBankPluginInitializer.java create mode 100644 buildpackage/src/main/java/com/hzya/frame/plugin/masterData/customer/bank/service/IMdmCustomerBankService.java create mode 100644 buildpackage/src/main/java/com/hzya/frame/plugin/masterData/customer/bank/service/impl/MdmCustomerBankServiceImpl.java create mode 100644 buildpackage/src/main/java/com/hzya/frame/plugin/masterData/customer/dao/IMdmCustomerDao.java create mode 100644 buildpackage/src/main/java/com/hzya/frame/plugin/masterData/customer/dao/impl/MdmCustomerDaoImpl.java create mode 100644 buildpackage/src/main/java/com/hzya/frame/plugin/masterData/customer/entity/MdmCustomerEntity.java create mode 100644 buildpackage/src/main/java/com/hzya/frame/plugin/masterData/customer/entity/MdmCustomerEntity.xml create mode 100644 buildpackage/src/main/java/com/hzya/frame/plugin/masterData/customer/plugin/MdmCustomerPluginInitializer.java create mode 100644 buildpackage/src/main/java/com/hzya/frame/plugin/masterData/customer/service/IMdmCustomerService.java create mode 100644 buildpackage/src/main/java/com/hzya/frame/plugin/masterData/customer/service/impl/MdmCustomerServiceImpl.java create mode 100644 buildpackage/src/main/resources/cfgHome/plugin/masterData.customer.bank/pluginCfg.xml create mode 100644 buildpackage/src/main/resources/cfgHome/plugin/masterData.customer.bank/spring/spring-buildpackage-dao.xml create mode 100644 buildpackage/src/main/resources/cfgHome/plugin/masterData.customer.bank/spring/spring-buildpackage-plugin.xml create mode 100644 buildpackage/src/main/resources/cfgHome/plugin/masterData.customer.bank/spring/spring-buildpackage-service.xml create mode 100644 buildpackage/src/main/resources/cfgHome/plugin/masterData.customer/pluginCfg.xml create mode 100644 buildpackage/src/main/resources/cfgHome/plugin/masterData.customer/spring/spring-buildpackage-dao.xml create mode 100644 buildpackage/src/main/resources/cfgHome/plugin/masterData.customer/spring/spring-buildpackage-plugin.xml create mode 100644 buildpackage/src/main/resources/cfgHome/plugin/masterData.customer/spring/spring-buildpackage-service.xml diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/customer/bank/dao/IMdmCustomerBankDao.java b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/customer/bank/dao/IMdmCustomerBankDao.java new file mode 100644 index 00000000..d22d954a --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/customer/bank/dao/IMdmCustomerBankDao.java @@ -0,0 +1,15 @@ +package com.hzya.frame.plugin.masterData.customer.bank.dao; + +import com.hzya.frame.plugin.masterData.customer.bank.entity.MdmCustomerBankEntity; +import com.hzya.frame.basedao.dao.IBaseDao; + +/** + * 客户银行(mdm_customer_bank: table)表数据库访问层 + * + * @author makejava + * @since 2024-06-21 13:55:55 + */ +public interface IMdmCustomerBankDao extends IBaseDao { + +} + diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/customer/bank/dao/impl/MdmCustomerBankDaoImpl.java b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/customer/bank/dao/impl/MdmCustomerBankDaoImpl.java new file mode 100644 index 00000000..78161b29 --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/customer/bank/dao/impl/MdmCustomerBankDaoImpl.java @@ -0,0 +1,16 @@ +package com.hzya.frame.plugin.masterData.customer.bank.dao.impl; + +import com.hzya.frame.plugin.masterData.customer.bank.entity.MdmCustomerBankEntity; +import com.hzya.frame.plugin.masterData.customer.bank.dao.IMdmCustomerBankDao; +import org.springframework.stereotype.Repository; +import com.hzya.frame.basedao.dao.MybatisGenericDao; +/** + * 客户银行(MdmCustomerBank)表数据库访问层 + * + * @author makejava + * @since 2024-06-21 13:55:55 + */ +public class MdmCustomerBankDaoImpl extends MybatisGenericDao implements IMdmCustomerBankDao{ + +} + diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/customer/bank/entity/MdmCustomerBankEntity.java b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/customer/bank/entity/MdmCustomerBankEntity.java new file mode 100644 index 00000000..4c389315 --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/customer/bank/entity/MdmCustomerBankEntity.java @@ -0,0 +1,86 @@ +package com.hzya.frame.plugin.masterData.customer.bank.entity; + +import java.util.Date; +import com.hzya.frame.web.entity.BaseEntity; +/** + * 客户银行(MdmCustomerBank)实体类 + * + * @author makejava + * @since 2024-06-21 13:55:55 + */ +public class MdmCustomerBankEntity extends BaseEntity { + + /** formmain_id */ + private String formmainId; + /** 数据状态 Y正常 N删除 F修改 */ + private String dataStatus; + /** 公司id */ + private String companyId; + /** 银行 */ + private String bank; + /** 开户银行 */ + private String pkBankdoc; + /** 账号 */ + private String accnum; + /** 联行号 */ + private String combinenum; + + + public String getFormmainId() { + return formmainId; + } + + public void setFormmainId(String formmainId) { + this.formmainId = formmainId; + } + + public String getDataStatus() { + return dataStatus; + } + + public void setDataStatus(String dataStatus) { + this.dataStatus = dataStatus; + } + + public String getCompanyId() { + return companyId; + } + + public void setCompanyId(String companyId) { + this.companyId = companyId; + } + + public String getBank() { + return bank; + } + + public void setBank(String bank) { + this.bank = bank; + } + + public String getPkBankdoc() { + return pkBankdoc; + } + + public void setPkBankdoc(String pkBankdoc) { + this.pkBankdoc = pkBankdoc; + } + + public String getAccnum() { + return accnum; + } + + public void setAccnum(String accnum) { + this.accnum = accnum; + } + + public String getCombinenum() { + return combinenum; + } + + public void setCombinenum(String combinenum) { + this.combinenum = combinenum; + } + +} + diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/customer/bank/entity/MdmCustomerBankEntity.xml b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/customer/bank/entity/MdmCustomerBankEntity.xml new file mode 100644 index 00000000..3689e8c9 --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/customer/bank/entity/MdmCustomerBankEntity.xml @@ -0,0 +1,267 @@ + + + + + + + + + + + + + + + + + + + + + + + + id + ,formmain_id + ,data_status + ,sorts + ,create_user_id + ,create_time + ,modify_user_id + ,modify_time + ,sts + ,org_id + ,company_id + ,bank + ,pk_bankdoc + ,accnum + ,combinenum + + + + + + + + + + + + + + + + insert into mdm_customer_bank( + + id , + formmain_id , + data_status , + sorts , + create_user_id , + create_time , + modify_user_id , + modify_time , + sts , + org_id , + company_id , + bank , + pk_bankdoc , + accnum , + combinenum , + sorts, + sts, + + )values( + + #{id} , + #{formmainId} , + #{dataStatus} , + #{sorts} , + #{create_user_id} , + #{create_time} , + #{modify_user_id} , + #{modify_time} , + #{sts} , + #{org_id} , + #{companyId} , + #{bank} , + #{pkBankdoc} , + #{accnum} , + #{combinenum} , + (select (max(IFNULL( a.sorts, 0 )) + 1) as sort from mdm_customer_bank a WHERE a.sts = 'Y' ), + 'Y', + + ) + + + + insert into mdm_customer_bank(formmain_id, data_status, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, bank, pk_bankdoc, accnum, combinenum, sts) + values + + (#{entity.formmainId},#{entity.dataStatus},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId},#{entity.bank},#{entity.pkBankdoc},#{entity.accnum},#{entity.combinenum}, 'Y') + + + + + insert into mdm_customer_bank(formmain_id, data_status, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, bank, pk_bankdoc, accnum, combinenum) + values + + (#{entity.formmainId},#{entity.dataStatus},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId},#{entity.bank},#{entity.pkBankdoc},#{entity.accnum},#{entity.combinenum}) + + on duplicate key update + formmain_id = values(formmain_id), + data_status = values(data_status), + create_user_id = values(create_user_id), + create_time = values(create_time), + modify_user_id = values(modify_user_id), + modify_time = values(modify_time), + sts = values(sts), + org_id = values(org_id), + company_id = values(company_id), + bank = values(bank), + pk_bankdoc = values(pk_bankdoc), + accnum = values(accnum), + combinenum = values(combinenum) + + +update mdm_customer_bank set + + formmain_id = #{formmainId}, + data_status = #{dataStatus}, + create_user_id = #{create_user_id}, + create_time = #{create_time}, + modify_user_id = #{modify_user_id}, + modify_time = #{modify_time}, + sts = #{sts}, + org_id = #{org_id}, + company_id = #{companyId}, + bank = #{bank}, + pk_bankdoc = #{pkBankdoc}, + accnum = #{accnum}, + combinenum = #{combinenum}, + +where id = #{id} + + + +update mdm_customer_bank set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} +where id = #{id} + + + +update mdm_customer_bank set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} + + and id = #{id} + and formmain_id = #{formmainId} + and data_status = #{dataStatus} + and sorts = #{sorts} + and sts = #{sts} + and company_id = #{companyId} + and bank = #{bank} + and pk_bankdoc = #{pkBankdoc} + and accnum = #{accnum} + and combinenum = #{combinenum} + and sts='Y' + + + + + delete from mdm_customer_bank where id = #{id} + + + + diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/customer/bank/plugin/MdmCustomerBankPluginInitializer.java b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/customer/bank/plugin/MdmCustomerBankPluginInitializer.java new file mode 100644 index 00000000..e62824b8 --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/customer/bank/plugin/MdmCustomerBankPluginInitializer.java @@ -0,0 +1,50 @@ +package com.hzya.frame.plugin.masterData.customer.bank.plugin; +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.base.PluginBaseEntity; +import com.hzya.frame.web.entity.JsonResultEntity; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +/** + * 客户银行(MdmCustomerBank)表服务接口 + * + * @author makejava + * @since 2024-06-21 13:55:55 + */ +public class MdmCustomerBankPluginInitializer extends PluginBaseEntity{ + Logger logger = LoggerFactory.getLogger(MdmCustomerBankPluginInitializer.class); + + @Override + public void initialize() { + logger.info(getPluginLabel() + "執行初始化方法initialize()"); + } + + @Override + public void destroy() { + logger.info(getPluginLabel() + "執行銷毀方法destroy()"); + } + + @Override + public String getPluginId() { + return "MdmCustomerBankPlugin"; + } + + @Override + public String getPluginName() { + return "MdmCustomerBankPlugin插件"; + } + + @Override + public String getPluginLabel() { + return "MdmCustomerBankPlugin"; + } + + @Override + public String getPluginType() { + return "1"; + } + @Override + public JsonResultEntity executeBusiness(JSONObject requestJson) { + logger.info("执行业务代码逻辑"); + return null; + } +} diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/customer/bank/service/IMdmCustomerBankService.java b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/customer/bank/service/IMdmCustomerBankService.java new file mode 100644 index 00000000..b1be580d --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/customer/bank/service/IMdmCustomerBankService.java @@ -0,0 +1,12 @@ +package com.hzya.frame.plugin.masterData.customer.bank.service; + +import com.hzya.frame.plugin.masterData.customer.bank.entity.MdmCustomerBankEntity; +import com.hzya.frame.basedao.service.IBaseService; +/** + * 客户银行(MdmCustomerBank)表服务接口 + * + * @author makejava + * @since 2024-06-21 13:55:55 + */ +public interface IMdmCustomerBankService extends IBaseService{ +} diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/customer/bank/service/impl/MdmCustomerBankServiceImpl.java b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/customer/bank/service/impl/MdmCustomerBankServiceImpl.java new file mode 100644 index 00000000..11fe5130 --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/customer/bank/service/impl/MdmCustomerBankServiceImpl.java @@ -0,0 +1,25 @@ +package com.hzya.frame.plugin.masterData.customer.bank.service.impl; + +import com.hzya.frame.plugin.masterData.customer.bank.entity.MdmCustomerBankEntity; +import com.hzya.frame.plugin.masterData.customer.bank.dao.IMdmCustomerBankDao; +import com.hzya.frame.plugin.masterData.customer.bank.service.IMdmCustomerBankService; +import org.springframework.stereotype.Service; +import org.springframework.beans.factory.annotation.Autowired; +import javax.annotation.Resource; +import com.hzya.frame.basedao.service.impl.BaseService; +/** + * 客户银行(MdmCustomerBank)表服务实现类 + * + * @author makejava + * @since 2024-06-21 13:55:55 + */ +public class MdmCustomerBankServiceImpl extends BaseService implements IMdmCustomerBankService { + + private IMdmCustomerBankDao mdmCustomerBankDao; + + @Autowired + public void setMdmCustomerBankDao(IMdmCustomerBankDao dao) { + this.mdmCustomerBankDao = dao; + this.dao = dao; + } +} diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/customer/dao/IMdmCustomerDao.java b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/customer/dao/IMdmCustomerDao.java new file mode 100644 index 00000000..8b8ae96e --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/customer/dao/IMdmCustomerDao.java @@ -0,0 +1,15 @@ +package com.hzya.frame.plugin.masterData.customer.dao; + +import com.hzya.frame.plugin.masterData.customer.entity.MdmCustomerEntity; +import com.hzya.frame.basedao.dao.IBaseDao; + +/** + * 客户档案(mdm_customer: table)表数据库访问层 + * + * @author makejava + * @since 2024-06-21 13:52:35 + */ +public interface IMdmCustomerDao extends IBaseDao { + +} + diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/customer/dao/impl/MdmCustomerDaoImpl.java b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/customer/dao/impl/MdmCustomerDaoImpl.java new file mode 100644 index 00000000..8899979b --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/customer/dao/impl/MdmCustomerDaoImpl.java @@ -0,0 +1,16 @@ +package com.hzya.frame.plugin.masterData.customer.dao.impl; + +import com.hzya.frame.plugin.masterData.customer.entity.MdmCustomerEntity; +import com.hzya.frame.plugin.masterData.customer.dao.IMdmCustomerDao; +import org.springframework.stereotype.Repository; +import com.hzya.frame.basedao.dao.MybatisGenericDao; +/** + * 客户档案(MdmCustomer)表数据库访问层 + * + * @author makejava + * @since 2024-06-21 13:52:35 + */ +public class MdmCustomerDaoImpl extends MybatisGenericDao implements IMdmCustomerDao{ + +} + diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/customer/entity/MdmCustomerEntity.java b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/customer/entity/MdmCustomerEntity.java new file mode 100644 index 00000000..7e61cc1c --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/customer/entity/MdmCustomerEntity.java @@ -0,0 +1,186 @@ +package com.hzya.frame.plugin.masterData.customer.entity; + +import java.util.Date; +import com.hzya.frame.web.entity.BaseEntity; +/** + * 客户档案(MdmCustomer)实体类 + * + * @author makejava + * @since 2024-06-21 13:52:35 + */ +public class MdmCustomerEntity extends BaseEntity { + + /** 单据规则 */ + private String documentRule; + /** 单据规则流水号 */ + private Long documentRuleNum; + /** 数据状态 Y正常 N删除 F修改 */ + private String dataStatus; + /** 新增数据状态 0待下发 1已下发 */ + private String addStatus; + /** 修改数据状态 0待下发 1已下发 */ + private String updateStatus; + /** 删除数据状态 0待下发 1已下发 */ + private String deleteStatus; + /** 公司id */ + private String companyId; + /** 客户编码 */ + private String code; + /** 客户类型 */ + private String custprop; + /** 客户状态 */ + private String custstate; + /** 启用状态 */ + private String enablestate; + /** 客户名称 */ + private String name; + /** 国家/地区 */ + private String pkCountry; + /** 客户基本分类 */ + private String pkCustclass; + /** 所属集团 */ + private String pkGroup; + /** 所属组织 */ + private String pkOrg; + /** 纳税人登记号 */ + private String taxpayerid; + + + public String getDocumentRule() { + return documentRule; + } + + public void setDocumentRule(String documentRule) { + this.documentRule = documentRule; + } + + public Long getDocumentRuleNum() { + return documentRuleNum; + } + + public void setDocumentRuleNum(Long documentRuleNum) { + this.documentRuleNum = documentRuleNum; + } + + public String getDataStatus() { + return dataStatus; + } + + public void setDataStatus(String dataStatus) { + this.dataStatus = dataStatus; + } + + public String getAddStatus() { + return addStatus; + } + + public void setAddStatus(String addStatus) { + this.addStatus = addStatus; + } + + public String getUpdateStatus() { + return updateStatus; + } + + public void setUpdateStatus(String updateStatus) { + this.updateStatus = updateStatus; + } + + public String getDeleteStatus() { + return deleteStatus; + } + + public void setDeleteStatus(String deleteStatus) { + this.deleteStatus = deleteStatus; + } + + public String getCompanyId() { + return companyId; + } + + public void setCompanyId(String companyId) { + this.companyId = companyId; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getCustprop() { + return custprop; + } + + public void setCustprop(String custprop) { + this.custprop = custprop; + } + + public String getCuststate() { + return custstate; + } + + public void setCuststate(String custstate) { + this.custstate = custstate; + } + + public String getEnablestate() { + return enablestate; + } + + public void setEnablestate(String enablestate) { + this.enablestate = enablestate; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getPkCountry() { + return pkCountry; + } + + public void setPkCountry(String pkCountry) { + this.pkCountry = pkCountry; + } + + public String getPkCustclass() { + return pkCustclass; + } + + public void setPkCustclass(String pkCustclass) { + this.pkCustclass = pkCustclass; + } + + public String getPkGroup() { + return pkGroup; + } + + public void setPkGroup(String pkGroup) { + this.pkGroup = pkGroup; + } + + public String getPkOrg() { + return pkOrg; + } + + public void setPkOrg(String pkOrg) { + this.pkOrg = pkOrg; + } + + public String getTaxpayerid() { + return taxpayerid; + } + + public void setTaxpayerid(String taxpayerid) { + this.taxpayerid = taxpayerid; + } + +} + diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/customer/entity/MdmCustomerEntity.xml b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/customer/entity/MdmCustomerEntity.xml new file mode 100644 index 00000000..41c3a4ff --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/customer/entity/MdmCustomerEntity.xml @@ -0,0 +1,377 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + id + ,document_rule + ,document_rule_num + ,data_status + ,add_status + ,update_status + ,delete_status + ,sorts + ,create_user_id + ,create_time + ,modify_user_id + ,modify_time + ,sts + ,org_id + ,company_id + ,code + ,custprop + ,custstate + ,enablestate + ,name + ,pk_country + ,pk_custclass + ,pk_group + ,pk_org + ,taxpayerid + + + + + + + + + + + + + + + + insert into mdm_customer( + + id , + document_rule , + document_rule_num , + data_status , + add_status , + update_status , + delete_status , + sorts , + create_user_id , + create_time , + modify_user_id , + modify_time , + sts , + org_id , + company_id , + code , + custprop , + custstate , + enablestate , + name , + pk_country , + pk_custclass , + pk_group , + pk_org , + taxpayerid , + sorts, + sts, + + )values( + + #{id} , + #{documentRule} , + #{documentRuleNum} , + #{dataStatus} , + #{addStatus} , + #{updateStatus} , + #{deleteStatus} , + #{sorts} , + #{create_user_id} , + #{create_time} , + #{modify_user_id} , + #{modify_time} , + #{sts} , + #{org_id} , + #{companyId} , + #{code} , + #{custprop} , + #{custstate} , + #{enablestate} , + #{name} , + #{pkCountry} , + #{pkCustclass} , + #{pkGroup} , + #{pkOrg} , + #{taxpayerid} , + (select (max(IFNULL( a.sorts, 0 )) + 1) as sort from mdm_customer a WHERE a.sts = 'Y' ), + 'Y', + + ) + + + + insert into mdm_customer(document_rule, document_rule_num, data_status, add_status, update_status, delete_status, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, code, custprop, custstate, enablestate, name, pk_country, pk_custclass, pk_group, pk_org, taxpayerid, sts) + values + + (#{entity.documentRule},#{entity.documentRuleNum},#{entity.dataStatus},#{entity.addStatus},#{entity.updateStatus},#{entity.deleteStatus},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId},#{entity.code},#{entity.custprop},#{entity.custstate},#{entity.enablestate},#{entity.name},#{entity.pkCountry},#{entity.pkCustclass},#{entity.pkGroup},#{entity.pkOrg},#{entity.taxpayerid}, 'Y') + + + + + insert into mdm_customer(document_rule, document_rule_num, data_status, add_status, update_status, delete_status, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, code, custprop, custstate, enablestate, name, pk_country, pk_custclass, pk_group, pk_org, taxpayerid) + values + + (#{entity.documentRule},#{entity.documentRuleNum},#{entity.dataStatus},#{entity.addStatus},#{entity.updateStatus},#{entity.deleteStatus},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId},#{entity.code},#{entity.custprop},#{entity.custstate},#{entity.enablestate},#{entity.name},#{entity.pkCountry},#{entity.pkCustclass},#{entity.pkGroup},#{entity.pkOrg},#{entity.taxpayerid}) + + on duplicate key update + document_rule = values(document_rule), + document_rule_num = values(document_rule_num), + data_status = values(data_status), + add_status = values(add_status), + update_status = values(update_status), + delete_status = values(delete_status), + create_user_id = values(create_user_id), + create_time = values(create_time), + modify_user_id = values(modify_user_id), + modify_time = values(modify_time), + sts = values(sts), + org_id = values(org_id), + company_id = values(company_id), + code = values(code), + custprop = values(custprop), + custstate = values(custstate), + enablestate = values(enablestate), + name = values(name), + pk_country = values(pk_country), + pk_custclass = values(pk_custclass), + pk_group = values(pk_group), + pk_org = values(pk_org), + taxpayerid = values(taxpayerid) + + +update mdm_customer set + + document_rule = #{documentRule}, + document_rule_num = #{documentRuleNum}, + data_status = #{dataStatus}, + add_status = #{addStatus}, + update_status = #{updateStatus}, + delete_status = #{deleteStatus}, + create_user_id = #{create_user_id}, + create_time = #{create_time}, + modify_user_id = #{modify_user_id}, + modify_time = #{modify_time}, + sts = #{sts}, + org_id = #{org_id}, + company_id = #{companyId}, + code = #{code}, + custprop = #{custprop}, + custstate = #{custstate}, + enablestate = #{enablestate}, + name = #{name}, + pk_country = #{pkCountry}, + pk_custclass = #{pkCustclass}, + pk_group = #{pkGroup}, + pk_org = #{pkOrg}, + taxpayerid = #{taxpayerid}, + +where id = #{id} + + + +update mdm_customer set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} +where id = #{id} + + + +update mdm_customer set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} + + and id = #{id} + and document_rule = #{documentRule} + and document_rule_num = #{documentRuleNum} + and data_status = #{dataStatus} + and add_status = #{addStatus} + and update_status = #{updateStatus} + and delete_status = #{deleteStatus} + and sorts = #{sorts} + and sts = #{sts} + and company_id = #{companyId} + and code = #{code} + and custprop = #{custprop} + and custstate = #{custstate} + and enablestate = #{enablestate} + and name = #{name} + and pk_country = #{pkCountry} + and pk_custclass = #{pkCustclass} + and pk_group = #{pkGroup} + and pk_org = #{pkOrg} + and taxpayerid = #{taxpayerid} + and sts='Y' + + + + + delete from mdm_customer where id = #{id} + + + + diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/customer/plugin/MdmCustomerPluginInitializer.java b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/customer/plugin/MdmCustomerPluginInitializer.java new file mode 100644 index 00000000..a1eb009e --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/customer/plugin/MdmCustomerPluginInitializer.java @@ -0,0 +1,50 @@ +package com.hzya.frame.plugin.masterData.customer.plugin; +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.base.PluginBaseEntity; +import com.hzya.frame.web.entity.JsonResultEntity; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +/** + * 客户档案(MdmCustomer)表服务接口 + * + * @author makejava + * @since 2024-06-21 13:52:35 + */ +public class MdmCustomerPluginInitializer extends PluginBaseEntity{ + Logger logger = LoggerFactory.getLogger(MdmCustomerPluginInitializer.class); + + @Override + public void initialize() { + logger.info(getPluginLabel() + "執行初始化方法initialize()"); + } + + @Override + public void destroy() { + logger.info(getPluginLabel() + "執行銷毀方法destroy()"); + } + + @Override + public String getPluginId() { + return "MdmCustomerPlugin"; + } + + @Override + public String getPluginName() { + return "MdmCustomerPlugin插件"; + } + + @Override + public String getPluginLabel() { + return "MdmCustomerPlugin"; + } + + @Override + public String getPluginType() { + return "1"; + } + @Override + public JsonResultEntity executeBusiness(JSONObject requestJson) { + logger.info("执行业务代码逻辑"); + return null; + } +} diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/customer/service/IMdmCustomerService.java b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/customer/service/IMdmCustomerService.java new file mode 100644 index 00000000..83ea4dfe --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/customer/service/IMdmCustomerService.java @@ -0,0 +1,12 @@ +package com.hzya.frame.plugin.masterData.customer.service; + +import com.hzya.frame.plugin.masterData.customer.entity.MdmCustomerEntity; +import com.hzya.frame.basedao.service.IBaseService; +/** + * 客户档案(MdmCustomer)表服务接口 + * + * @author makejava + * @since 2024-06-21 13:52:35 + */ +public interface IMdmCustomerService extends IBaseService{ +} diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/customer/service/impl/MdmCustomerServiceImpl.java b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/customer/service/impl/MdmCustomerServiceImpl.java new file mode 100644 index 00000000..6e48b6d1 --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/customer/service/impl/MdmCustomerServiceImpl.java @@ -0,0 +1,25 @@ +package com.hzya.frame.plugin.masterData.customer.service.impl; + +import com.hzya.frame.plugin.masterData.customer.entity.MdmCustomerEntity; +import com.hzya.frame.plugin.masterData.customer.dao.IMdmCustomerDao; +import com.hzya.frame.plugin.masterData.customer.service.IMdmCustomerService; +import org.springframework.stereotype.Service; +import org.springframework.beans.factory.annotation.Autowired; +import javax.annotation.Resource; +import com.hzya.frame.basedao.service.impl.BaseService; +/** + * 客户档案(MdmCustomer)表服务实现类 + * + * @author makejava + * @since 2024-06-21 13:52:35 + */ +public class MdmCustomerServiceImpl extends BaseService implements IMdmCustomerService { + + private IMdmCustomerDao mdmCustomerDao; + + @Autowired + public void setMdmCustomerDao(IMdmCustomerDao dao) { + this.mdmCustomerDao = dao; + this.dao = dao; + } +} diff --git a/buildpackage/src/main/resources/cfgHome/plugin/masterData.customer.bank/pluginCfg.xml b/buildpackage/src/main/resources/cfgHome/plugin/masterData.customer.bank/pluginCfg.xml new file mode 100644 index 00000000..5543d57a --- /dev/null +++ b/buildpackage/src/main/resources/cfgHome/plugin/masterData.customer.bank/pluginCfg.xml @@ -0,0 +1,6 @@ + + +MdmCustomerBankPlugin +MdmCustomerBankPlugin插件 +90000001 + diff --git a/buildpackage/src/main/resources/cfgHome/plugin/masterData.customer.bank/spring/spring-buildpackage-dao.xml b/buildpackage/src/main/resources/cfgHome/plugin/masterData.customer.bank/spring/spring-buildpackage-dao.xml new file mode 100644 index 00000000..d3358861 --- /dev/null +++ b/buildpackage/src/main/resources/cfgHome/plugin/masterData.customer.bank/spring/spring-buildpackage-dao.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/buildpackage/src/main/resources/cfgHome/plugin/masterData.customer.bank/spring/spring-buildpackage-plugin.xml b/buildpackage/src/main/resources/cfgHome/plugin/masterData.customer.bank/spring/spring-buildpackage-plugin.xml new file mode 100644 index 00000000..d99236a7 --- /dev/null +++ b/buildpackage/src/main/resources/cfgHome/plugin/masterData.customer.bank/spring/spring-buildpackage-plugin.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/buildpackage/src/main/resources/cfgHome/plugin/masterData.customer.bank/spring/spring-buildpackage-service.xml b/buildpackage/src/main/resources/cfgHome/plugin/masterData.customer.bank/spring/spring-buildpackage-service.xml new file mode 100644 index 00000000..5fe75f54 --- /dev/null +++ b/buildpackage/src/main/resources/cfgHome/plugin/masterData.customer.bank/spring/spring-buildpackage-service.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/buildpackage/src/main/resources/cfgHome/plugin/masterData.customer/pluginCfg.xml b/buildpackage/src/main/resources/cfgHome/plugin/masterData.customer/pluginCfg.xml new file mode 100644 index 00000000..df03dbcd --- /dev/null +++ b/buildpackage/src/main/resources/cfgHome/plugin/masterData.customer/pluginCfg.xml @@ -0,0 +1,6 @@ + + +MdmCustomerPlugin +MdmCustomerPlugin插件 +90000001 + diff --git a/buildpackage/src/main/resources/cfgHome/plugin/masterData.customer/spring/spring-buildpackage-dao.xml b/buildpackage/src/main/resources/cfgHome/plugin/masterData.customer/spring/spring-buildpackage-dao.xml new file mode 100644 index 00000000..62161706 --- /dev/null +++ b/buildpackage/src/main/resources/cfgHome/plugin/masterData.customer/spring/spring-buildpackage-dao.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/buildpackage/src/main/resources/cfgHome/plugin/masterData.customer/spring/spring-buildpackage-plugin.xml b/buildpackage/src/main/resources/cfgHome/plugin/masterData.customer/spring/spring-buildpackage-plugin.xml new file mode 100644 index 00000000..41c79445 --- /dev/null +++ b/buildpackage/src/main/resources/cfgHome/plugin/masterData.customer/spring/spring-buildpackage-plugin.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/buildpackage/src/main/resources/cfgHome/plugin/masterData.customer/spring/spring-buildpackage-service.xml b/buildpackage/src/main/resources/cfgHome/plugin/masterData.customer/spring/spring-buildpackage-service.xml new file mode 100644 index 00000000..cdbf695b --- /dev/null +++ b/buildpackage/src/main/resources/cfgHome/plugin/masterData.customer/spring/spring-buildpackage-service.xml @@ -0,0 +1,5 @@ + + + + +