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/31] =?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/31] =?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/31] =?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/31] =?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/31] =?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/31] =?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/31] =?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: Thu, 30 May 2024 15:13:54 +0800 Subject: [PATCH 08/31] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=89=A9=E5=B1=95?= =?UTF-8?q?=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/SeeyonExtServiceImpl.java | 133 +++++++++++------- 1 file changed, 80 insertions(+), 53 deletions(-) diff --git a/service/src/main/java/com/hzya/frame/seeyon/service/impl/SeeyonExtServiceImpl.java b/service/src/main/java/com/hzya/frame/seeyon/service/impl/SeeyonExtServiceImpl.java index a8bfe514..677a14a2 100644 --- a/service/src/main/java/com/hzya/frame/seeyon/service/impl/SeeyonExtServiceImpl.java +++ b/service/src/main/java/com/hzya/frame/seeyon/service/impl/SeeyonExtServiceImpl.java @@ -1,5 +1,6 @@ package com.hzya.frame.seeyon.service.impl; +import cn.hutool.core.date.DateUtil; import cn.hutool.core.util.StrUtil; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; @@ -60,17 +61,15 @@ public class SeeyonExtServiceImpl implements ISeeyonExtService { } //根据forApp组装不同参数 switch (formApp){ - case "4728403652378707515":// + case "-8691606453890363968":// hzyaExtData.put("billCode", "cunhuoabc123456"); getInventory(businessData,param); break; - case "供应商": - hzyaExtData.put("billCode", ""); - getSupplier(businessData,param); + case "6223456019738676230": + getSupplier(businessData,param,hzyaExtData); break; - case "客户": - hzyaExtData.put("billCode", ""); - getCustomer(businessData,param); + case "-9122508232154527168": + getCustomer(businessData,param,hzyaExtData); break; default: param.setBodys("未匹配到表单!当前formID:"+ formApp); @@ -93,6 +92,8 @@ public class SeeyonExtServiceImpl implements ISeeyonExtService { */ @Override public void ydcSeeyon2u8CallBack(SysMessageManageLogEntity logEntity) { + + //在这里记录日志 JSONObject targetData = JSON.parseObject(logEntity.getTargetData());//这个对象里的body是 发送到u8的请求报文 JSONObject sourceData = JSON.parseObject(logEntity.getSourceData()); @@ -102,11 +103,25 @@ public class SeeyonExtServiceImpl implements ISeeyonExtService { JSONArray formMainIds = new JSONArray(); formMainIds.add(sourceBody.getString("id")); JSONObject param = new JSONObject(); - param.put("formAppId",sourceBody.getString("formApp")); + String formApp = sourceBody.getString("formApp"); + param.put("formAppId",formApp); param.put("formMainIds",formMainIds); param.put("dataSourceCode","ht_oa_sqlserver"); param.put("eventType",sourceBody.getString("eventType")); + //把返回的单号更新到oa档案表 + String sql = ""; + switch (formApp){ + case "-8691606453890363968"://存货 + sql = ""; + break; + case "6223456019738676230"://供应商 + sql = "update formmain_0229 set field0002 = '' where field0001 = "+hzyaExtData.getString("billCode"); + break; + case "-9122508232154527168"://客户 + sql = "update formmain_0230 set field0002 = '' where field0001 = "+hzyaExtData.getString("billCode"); + break; + } IntegrationTaskLivingDetailsEntity logDetails = new IntegrationTaskLivingDetailsEntity(); logDetails.setRootAppPk(JSON.toJSONString(param)); logDetails.setRootAppBill(hzyaExtData.getString("billCode")); @@ -138,76 +153,88 @@ public class SeeyonExtServiceImpl implements ISeeyonExtService { //存货参数组装 private SysExtensionApiEntity getInventory(JSONObject businessData,SysExtensionApiEntity param){ if (null != businessData){ - JSONObject jsonObject = new JSONObject(); - jsonObject.put("Token", "Hzya1314_CheckSkip"); - jsonObject.put("billid", "123"); - jsonObject.put("AccId", "005"); + JSONObject formmain0227 = businessData.getJSONObject("formmain_0227"); + JSONArray formson0228Arr = businessData.getJSONArray("formson_0228"); + for (int i=0; i< formson0228Arr.size(); i++){ + JSONObject formson0228 = formson0228Arr.getJSONObject(i); + JSONObject jsonObject = new JSONObject(); + jsonObject.put("Token", "Hzya1314_CheckSkip"); + jsonObject.put("billid", formson0228.getString("id")); + jsonObject.put("AccId", formmain0227.getString("field0015")); - JSONObject oArchives = new JSONObject(); - oArchives.put("cInvCode", "cyp12"); - oArchives.put("cInvCCode", "0101"); - oArchives.put("cInvName", "测试"); - oArchives.put("cGroupCode", "01"); - oArchives.put("cComUnitCode", "0101"); + JSONObject oArchives = new JSONObject(); + oArchives.put("cInvCode", formson0228.getString("field0002")); + oArchives.put("cInvCCode", formson0228.getString("field0005")); + oArchives.put("cInvName", formson0228.getString("field0003")); + //todo 这个没值 + oArchives.put("cGroupCode", "01"); + oArchives.put("cComUnitCode", formson0228.getString("field0006")); - jsonObject.put("oArchives", oArchives); - param.setBodys(JSON.toJSONString(jsonObject)); + jsonObject.put("oArchives", oArchives); + param.setBodys(JSON.toJSONString(jsonObject)); + } } return param; } //供应商参数组装 - private SysExtensionApiEntity getSupplier(JSONObject businessData,SysExtensionApiEntity param){ + private SysExtensionApiEntity getSupplier(JSONObject businessData,SysExtensionApiEntity param,JSONObject hzyaExtData){ if (null != businessData){ + JSONObject formmain0225 = businessData.getJSONObject("formmain_0225"); JSONObject jsonObject = new JSONObject(); - jsonObject.put("billid", "123"); - jsonObject.put("AccId", "888"); + jsonObject.put("billid", formmain0225.getString("id")); + jsonObject.put("AccId", formmain0225.getString("field0020")); jsonObject.put("Token", U8Util.getToken()); JSONObject oArchives = new JSONObject(); - oArchives.put("cVenCode", "0001"); - oArchives.put("cVenName ", "测试0001"); - oArchives.put("cVenAbbName", "测试0001简称"); - oArchives.put("cVCCode", "01"); - oArchives.put("cVenExch_name", "人民币"); - oArchives.put("bVenTax", "false"); - oArchives.put("bLicenceDate", "false"); - oArchives.put("bBusinessDate", "false"); - oArchives.put("bProxyDate", "false"); - oArchives.put("bPassGMP", "false"); - oArchives.put("bVenCargo", "false"); - oArchives.put("bProxyForeign", "true"); - oArchives.put("bVenService", "true"); - oArchives.put("iVenGSPType", "0"); - oArchives.put("bVenOverseas", "false"); - oArchives.put("bVenAccPeriodMng", "false"); - oArchives.put("bVenHomeBranch", "false"); - oArchives.put("dVenCreateDatetime", "2023-01-04 10:00"); - oArchives.put("cVenRegCode", "税号"); - oArchives.put("cVenBank", "开户银行"); - oArchives.put("cVenAccount", "银行账号"); - + oArchives.put("cVenCode", formmain0225.getString("field0002")); + oArchives.put("cVenName ", formmain0225.getString("field0003")); + oArchives.put("cVenAbbName", formmain0225.getString("field0004")); + oArchives.put("cVCCode", formmain0225.getString("field0006")); + oArchives.put("cVenExch_name", formmain0225.getString("field0010")); + //oArchives.put("bVenTax", "false"); + //oArchives.put("bLicenceDate", "false"); + //oArchives.put("bBusinessDate", "false"); + //oArchives.put("bProxyDate", "false"); + //oArchives.put("bPassGMP", "false"); + //oArchives.put("bVenCargo", "false"); + //oArchives.put("bProxyForeign", "true"); + //oArchives.put("bVenService", "true"); + //oArchives.put("iVenGSPType", "0"); + //oArchives.put("bVenOverseas", "false"); + //oArchives.put("bVenAccPeriodMng", "false"); + //oArchives.put("bVenHomeBranch", "false"); + oArchives.put("dVenCreateDatetime", DateUtil.now()); + oArchives.put("cVenRegCode", formmain0225.getString("field0009")); + oArchives.put("cVenBank", formmain0225.getString("field0011")); + oArchives.put("cVenAccount", formmain0225.getString("field0012")); jsonObject.put("oArchives", oArchives); param.setBodys(JSON.toJSONString(jsonObject)); + hzyaExtData.put("billCode", formmain0225.getString("field0001")); + hzyaExtData.put("formmainId", formmain0225.getString("id")); } return param; } //客户参数组装 - private SysExtensionApiEntity getCustomer(JSONObject businessData,SysExtensionApiEntity param){ + private SysExtensionApiEntity getCustomer(JSONObject businessData,SysExtensionApiEntity param,JSONObject hzyaExtData){ if (null != businessData){ + JSONObject formmain0226 = businessData.getJSONObject("formmain_0226"); JSONObject jsonObject = new JSONObject(); - jsonObject.put("billid", "123"); - jsonObject.put("AccId", "888"); + jsonObject.put("billid", formmain0226.getString("id")); + jsonObject.put("AccId", formmain0226.getString("field0025")); jsonObject.put("Token", "Hzya1314_CheckSkip"); JSONObject oArchives = new JSONObject(); - oArchives.put("cCusCode", "0001"); - oArchives.put("cCusName", "测试0001"); - oArchives.put("cCusAbbName", "测试0001"); - oArchives.put("cCCCode", "01"); - oArchives.put("cCusExch_name", "人民币"); + oArchives.put("cCusCode", formmain0226.getString("field0002")); + oArchives.put("cCusName", formmain0226.getString("field0007")); + oArchives.put("cCusAbbName", formmain0226.getString("field0008")); + oArchives.put("cCCCode", formmain0226.getString("field0012")); + oArchives.put("cCusExch_name", formmain0226.getString("field0013")); + // todo 这个字段没值 oArchives.put("cCusMngTypeCode", "999"); jsonObject.put("oArchives", oArchives); param.setBodys(JSON.toJSONString(jsonObject)); + hzyaExtData.put("billCode",formmain0226.getString("field0001")); + hzyaExtData.put("formmainId",formmain0226.getString("id")); } return param; } From 478211ad96c410cfd33a7daf2d779a859b531a11 Mon Sep 17 00:00:00 2001 From: lvleigang <957075182@qq.com> Date: Fri, 31 May 2024 09:12:40 +0800 Subject: [PATCH 09/31] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=BB=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E7=94=9F=E6=88=90=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ....3__mdm_add_updateApi_and_enabledState.sql | 3 + .../hzya/frame/mdm/entity/DbFiledsDto.java | 83 - .../com/hzya/frame/mdm/entity/MdmDataDto.java | 69 - .../frame/mdm/entity/MdmDataFiledDto.java | 29 - .../hzya/frame/mdm/entity/MdmDbFiledVo.java | 37 - .../com/hzya/frame/mdm/entity/MdmDbVo.java | 57 - .../frame/mdm/entity/MdmDetailViewVo.java | 41 - .../frame/mdm/entity/MdmDistributeDto.java | 34 - .../frame/mdm/entity/MdmDistributeEntity.java | 53 - .../frame/mdm/entity/MdmDistributeVo.java | 55 - .../com/hzya/frame/mdm/entity/MdmDto.java | 205 -- .../frame/mdm/entity/MdmModuleViewDto.java | 81 - .../frame/mdm/entity/MdmModuleViewVo.java | 123 - .../com/hzya/frame/mdm/entity/MdmQuery.java | 69 - .../com/hzya/frame/mdm/entity/MdmRoleDto.java | 32 - .../frame/mdm/entity/MdmViewButtonVo.java | 34 - .../hzya/frame/mdm/entity/MdmViewFiledVo.java | 114 - .../com/hzya/frame/mdm/entity/MdmViewVo.java | 73 - .../java/com/hzya/frame/mdm/entity/MdmVo.java | 122 - .../mdm/mdmModule/dao/IMdmModuleDao.java | 47 +- .../mdm/mdmModule/entity/MdmModuleEntity.java | 58 +- .../mdm/mdmModule/entity/MdmModuleEntity.xml | 939 ++--- .../mdmModule/service/IMdmModuleService.java | 5 +- .../service/impl/MdmModuleServiceImpl.java | 19 +- .../mdm/mdmModuleDb/dao/IMdmModuleDbDao.java | 18 +- .../dao/impl/MdmModuleDbDaoImpl.java | 40 +- .../mdmModuleDb/entity/MdmModuleDbEntity.java | 45 +- .../mdmModuleDb/entity/MdmModuleDbEntity.xml | 495 ++- .../service/IMdmModuleDbService.java | 5 +- .../service/impl/MdmModuleDbServiceImpl.java | 19 +- .../dao/IMdmModuleDbFiledsDao.java | 4 +- .../dao/impl/MdmModuleDbFiledsDaoImpl.java | 7 +- .../entity/MdmModuleDbFiledsEntity.java | 138 +- .../entity/MdmModuleDbFiledsEntity.xml | 538 +-- .../service/IMdmModuleDbFiledsService.java | 5 +- .../impl/MdmModuleDbFiledsServiceImpl.java | 19 +- .../dao/IMdmModuleDbFiledsRuleDao.java | 2 +- .../impl/MdmModuleDbFiledsRuleDaoImpl.java | 2 +- .../entity/MdmModuleDbFiledsRuleEntity.java | 12 +- .../entity/MdmModuleDbFiledsRuleEntity.xml | 37 +- .../IMdmModuleDbFiledsRuleService.java | 2 +- .../MdmModuleDbFiledsRuleServiceImpl.java | 2 +- .../dao/IMdmModuleDbFiledsRuleFilesDao.java | 15 - .../MdmModuleDbFiledsRuleFilesDaoImpl.java | 18 - .../MdmModuleDbFiledsRuleFilesEntity.java | 66 - .../MdmModuleDbFiledsRuleFilesEntity.xml | 254 -- .../IMdmModuleDbFiledsRuleFilesService.java | 13 - ...MdmModuleDbFiledsRuleFilesServiceImpl.java | 29 - .../dao/IMdmModuleDistributeDao.java | 2 +- .../dao/impl/MdmModuleDistributeDaoImpl.java | 2 +- .../entity/MdmModuleDistributeEntity.java | 76 +- .../entity/MdmModuleDistributeEntity.xml | 95 +- .../service/IMdmModuleDistributeService.java | 2 +- .../impl/MdmModuleDistributeServiceImpl.java | 2 +- .../dao/IMdmModuleDistributeDetailDao.java | 15 - .../MdmModuleDistributeDetailDaoImpl.java | 17 - .../MdmModuleDistributeDetailEntity.java | 144 - .../MdmModuleDistributeDetailEntity.xml | 333 -- .../IMdmModuleDistributeDetailService.java | 12 - .../MdmModuleDistributeDetailServiceImpl.java | 26 - .../mdmModuleRole/dao/IMdmModuleRoleDao.java | 15 - .../dao/impl/MdmModuleRoleDaoImpl.java | 18 - .../entity/MdmModuleRoleEntity.java | 52 - .../entity/MdmModuleRoleEntity.xml | 227 -- .../service/IMdmModuleRoleService.java | 13 - .../impl/MdmModuleRoleServiceImpl.java | 29 - .../dao/IMdmModuleRoleButtonDao.java | 15 - .../dao/impl/MdmModuleRoleButtonDaoImpl.java | 18 - .../entity/MdmModuleRoleButtonEntity.java | 92 - .../entity/MdmModuleRoleButtonEntity.xml | 271 -- .../service/IMdmModuleRoleButtonService.java | 13 - .../impl/MdmModuleRoleButtonServiceImpl.java | 29 - .../dao/IMdmModuleUserViewDao.java | 15 - .../dao/impl/MdmModuleUserViewDaoImpl.java | 18 - .../entity/MdmModuleUserViewEntity.java | 54 - .../entity/MdmModuleUserViewEntity.xml | 241 -- .../service/IMdmModuleUserViewService.java | 13 - .../impl/MdmModuleUserViewServiceImpl.java | 29 - .../mdmModuleView/dao/IMdmModuleViewDao.java | 4 +- .../dao/impl/MdmModuleViewDaoImpl.java | 7 +- .../entity/MdmModuleViewEntity.java | 40 +- .../entity/MdmModuleViewEntity.xml | 422 ++- .../service/IMdmModuleViewService.java | 5 +- .../impl/MdmModuleViewServiceImpl.java | 19 +- .../dao/IMdmModuleViewButtonDao.java | 15 + .../dao/impl/MdmModuleViewButtonDaoImpl.java | 17 + .../entity/MdmModuleViewButtonEntity.java | 66 + .../entity/MdmModuleViewButtonEntity.xml} | 161 +- .../service/IMdmModuleViewButtonService.java | 12 + .../impl/MdmModuleViewButtonServiceImpl.java | 26 + .../dao/IMdmModuleViewDetailDao.java | 4 +- .../dao/impl/MdmModuleViewDetailDaoImpl.java | 7 +- .../entity/MdmModuleViewDetailEntity.java | 40 +- .../entity/MdmModuleViewDetailEntity.xml | 424 ++- .../service/IMdmModuleViewDetailService.java | 5 +- .../impl/MdmModuleViewDetailServiceImpl.java | 19 +- .../dao/IMdmTableCodeRuleDao.java | 15 - .../dao/impl/MdmTableCodeRuleDaoImpl.java | 17 - .../entity/MdmTableCodeRuleEntity.java | 76 - .../service/IMdmTableCodeRuleService.java | 12 - .../impl/MdmTableCodeRuleServiceImpl.java | 26 - .../hzya/frame/mdm/service/IMdmService.java | 248 -- .../mdm/service/impl/MdmServiceImpl.java | 3152 +---------------- 103 files changed, 1705 insertions(+), 9189 deletions(-) create mode 100644 buildpackage/src/main/resources/flyway/V3.0.3__mdm_add_updateApi_and_enabledState.sql delete mode 100644 service/src/main/java/com/hzya/frame/mdm/entity/DbFiledsDto.java delete mode 100644 service/src/main/java/com/hzya/frame/mdm/entity/MdmDataDto.java delete mode 100644 service/src/main/java/com/hzya/frame/mdm/entity/MdmDataFiledDto.java delete mode 100644 service/src/main/java/com/hzya/frame/mdm/entity/MdmDbFiledVo.java delete mode 100644 service/src/main/java/com/hzya/frame/mdm/entity/MdmDbVo.java delete mode 100644 service/src/main/java/com/hzya/frame/mdm/entity/MdmDetailViewVo.java delete mode 100644 service/src/main/java/com/hzya/frame/mdm/entity/MdmDistributeDto.java delete mode 100644 service/src/main/java/com/hzya/frame/mdm/entity/MdmDistributeEntity.java delete mode 100644 service/src/main/java/com/hzya/frame/mdm/entity/MdmDistributeVo.java delete mode 100644 service/src/main/java/com/hzya/frame/mdm/entity/MdmDto.java delete mode 100644 service/src/main/java/com/hzya/frame/mdm/entity/MdmModuleViewDto.java delete mode 100644 service/src/main/java/com/hzya/frame/mdm/entity/MdmModuleViewVo.java delete mode 100644 service/src/main/java/com/hzya/frame/mdm/entity/MdmQuery.java delete mode 100644 service/src/main/java/com/hzya/frame/mdm/entity/MdmRoleDto.java delete mode 100644 service/src/main/java/com/hzya/frame/mdm/entity/MdmViewButtonVo.java delete mode 100644 service/src/main/java/com/hzya/frame/mdm/entity/MdmViewFiledVo.java delete mode 100644 service/src/main/java/com/hzya/frame/mdm/entity/MdmViewVo.java delete mode 100644 service/src/main/java/com/hzya/frame/mdm/entity/MdmVo.java delete mode 100644 service/src/main/java/com/hzya/frame/mdm/mdmModuleDbFiledsRuleFiles/dao/IMdmModuleDbFiledsRuleFilesDao.java delete mode 100644 service/src/main/java/com/hzya/frame/mdm/mdmModuleDbFiledsRuleFiles/dao/impl/MdmModuleDbFiledsRuleFilesDaoImpl.java delete mode 100644 service/src/main/java/com/hzya/frame/mdm/mdmModuleDbFiledsRuleFiles/entity/MdmModuleDbFiledsRuleFilesEntity.java delete mode 100644 service/src/main/java/com/hzya/frame/mdm/mdmModuleDbFiledsRuleFiles/entity/MdmModuleDbFiledsRuleFilesEntity.xml delete mode 100644 service/src/main/java/com/hzya/frame/mdm/mdmModuleDbFiledsRuleFiles/service/IMdmModuleDbFiledsRuleFilesService.java delete mode 100644 service/src/main/java/com/hzya/frame/mdm/mdmModuleDbFiledsRuleFiles/service/impl/MdmModuleDbFiledsRuleFilesServiceImpl.java delete mode 100644 service/src/main/java/com/hzya/frame/mdm/mdmModuleDistributeDetail/dao/IMdmModuleDistributeDetailDao.java delete mode 100644 service/src/main/java/com/hzya/frame/mdm/mdmModuleDistributeDetail/dao/impl/MdmModuleDistributeDetailDaoImpl.java delete mode 100644 service/src/main/java/com/hzya/frame/mdm/mdmModuleDistributeDetail/entity/MdmModuleDistributeDetailEntity.java delete mode 100644 service/src/main/java/com/hzya/frame/mdm/mdmModuleDistributeDetail/entity/MdmModuleDistributeDetailEntity.xml delete mode 100644 service/src/main/java/com/hzya/frame/mdm/mdmModuleDistributeDetail/service/IMdmModuleDistributeDetailService.java delete mode 100644 service/src/main/java/com/hzya/frame/mdm/mdmModuleDistributeDetail/service/impl/MdmModuleDistributeDetailServiceImpl.java delete mode 100644 service/src/main/java/com/hzya/frame/mdm/mdmModuleRole/dao/IMdmModuleRoleDao.java delete mode 100644 service/src/main/java/com/hzya/frame/mdm/mdmModuleRole/dao/impl/MdmModuleRoleDaoImpl.java delete mode 100644 service/src/main/java/com/hzya/frame/mdm/mdmModuleRole/entity/MdmModuleRoleEntity.java delete mode 100644 service/src/main/java/com/hzya/frame/mdm/mdmModuleRole/entity/MdmModuleRoleEntity.xml delete mode 100644 service/src/main/java/com/hzya/frame/mdm/mdmModuleRole/service/IMdmModuleRoleService.java delete mode 100644 service/src/main/java/com/hzya/frame/mdm/mdmModuleRole/service/impl/MdmModuleRoleServiceImpl.java delete mode 100644 service/src/main/java/com/hzya/frame/mdm/mdmModuleRoleButton/dao/IMdmModuleRoleButtonDao.java delete mode 100644 service/src/main/java/com/hzya/frame/mdm/mdmModuleRoleButton/dao/impl/MdmModuleRoleButtonDaoImpl.java delete mode 100644 service/src/main/java/com/hzya/frame/mdm/mdmModuleRoleButton/entity/MdmModuleRoleButtonEntity.java delete mode 100644 service/src/main/java/com/hzya/frame/mdm/mdmModuleRoleButton/entity/MdmModuleRoleButtonEntity.xml delete mode 100644 service/src/main/java/com/hzya/frame/mdm/mdmModuleRoleButton/service/IMdmModuleRoleButtonService.java delete mode 100644 service/src/main/java/com/hzya/frame/mdm/mdmModuleRoleButton/service/impl/MdmModuleRoleButtonServiceImpl.java delete mode 100644 service/src/main/java/com/hzya/frame/mdm/mdmModuleUserView/dao/IMdmModuleUserViewDao.java delete mode 100644 service/src/main/java/com/hzya/frame/mdm/mdmModuleUserView/dao/impl/MdmModuleUserViewDaoImpl.java delete mode 100644 service/src/main/java/com/hzya/frame/mdm/mdmModuleUserView/entity/MdmModuleUserViewEntity.java delete mode 100644 service/src/main/java/com/hzya/frame/mdm/mdmModuleUserView/entity/MdmModuleUserViewEntity.xml delete mode 100644 service/src/main/java/com/hzya/frame/mdm/mdmModuleUserView/service/IMdmModuleUserViewService.java delete mode 100644 service/src/main/java/com/hzya/frame/mdm/mdmModuleUserView/service/impl/MdmModuleUserViewServiceImpl.java create mode 100644 service/src/main/java/com/hzya/frame/mdm/mdmModuleViewButton/dao/IMdmModuleViewButtonDao.java create mode 100644 service/src/main/java/com/hzya/frame/mdm/mdmModuleViewButton/dao/impl/MdmModuleViewButtonDaoImpl.java create mode 100644 service/src/main/java/com/hzya/frame/mdm/mdmModuleViewButton/entity/MdmModuleViewButtonEntity.java rename service/src/main/java/com/hzya/frame/mdm/{mdmTableCodeRule/entity/MdmTableCodeRuleEntity.xml => mdmModuleViewButton/entity/MdmModuleViewButtonEntity.xml} (58%) create mode 100644 service/src/main/java/com/hzya/frame/mdm/mdmModuleViewButton/service/IMdmModuleViewButtonService.java create mode 100644 service/src/main/java/com/hzya/frame/mdm/mdmModuleViewButton/service/impl/MdmModuleViewButtonServiceImpl.java delete mode 100644 service/src/main/java/com/hzya/frame/mdm/mdmTableCodeRule/dao/IMdmTableCodeRuleDao.java delete mode 100644 service/src/main/java/com/hzya/frame/mdm/mdmTableCodeRule/dao/impl/MdmTableCodeRuleDaoImpl.java delete mode 100644 service/src/main/java/com/hzya/frame/mdm/mdmTableCodeRule/entity/MdmTableCodeRuleEntity.java delete mode 100644 service/src/main/java/com/hzya/frame/mdm/mdmTableCodeRule/service/IMdmTableCodeRuleService.java delete mode 100644 service/src/main/java/com/hzya/frame/mdm/mdmTableCodeRule/service/impl/MdmTableCodeRuleServiceImpl.java diff --git a/buildpackage/src/main/resources/flyway/V3.0.3__mdm_add_updateApi_and_enabledState.sql b/buildpackage/src/main/resources/flyway/V3.0.3__mdm_add_updateApi_and_enabledState.sql new file mode 100644 index 00000000..393f0fdc --- /dev/null +++ b/buildpackage/src/main/resources/flyway/V3.0.3__mdm_add_updateApi_and_enabledState.sql @@ -0,0 +1,3 @@ +ALTER TABLE mdm_module_distribute ADD COLUMN update_api VARCHAR(50) DEFAULT NULL COMMENT '修改接口'; +ALTER TABLE mdm_module_distribute ADD COLUMN enabled_state CHAR(1) DEFAULT NULL COMMENT '启用停用 0、停用1、启用'; +COMMIT; \ No newline at end of file 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 deleted file mode 100644 index ae094e16..00000000 --- a/service/src/main/java/com/hzya/frame/mdm/entity/DbFiledsDto.java +++ /dev/null @@ -1,83 +0,0 @@ -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/MdmDataDto.java b/service/src/main/java/com/hzya/frame/mdm/entity/MdmDataDto.java deleted file mode 100644 index 0370431c..00000000 --- a/service/src/main/java/com/hzya/frame/mdm/entity/MdmDataDto.java +++ /dev/null @@ -1,69 +0,0 @@ -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 deleted file mode 100644 index d9e40e8d..00000000 --- a/service/src/main/java/com/hzya/frame/mdm/entity/MdmDataFiledDto.java +++ /dev/null @@ -1,29 +0,0 @@ -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/MdmDbFiledVo.java b/service/src/main/java/com/hzya/frame/mdm/entity/MdmDbFiledVo.java deleted file mode 100644 index 70da08eb..00000000 --- a/service/src/main/java/com/hzya/frame/mdm/entity/MdmDbFiledVo.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.hzya.frame.mdm.entity; - -import com.hzya.frame.mdm.mdmModuleDb.entity.MdmModuleDbEntity; -import com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity; -import com.hzya.frame.mdm.mdmModuleDbFiledsRuleFiles.entity.MdmModuleDbFiledsRuleFilesEntity; - -import java.util.List; - -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/MdmDbVo.java b/service/src/main/java/com/hzya/frame/mdm/entity/MdmDbVo.java deleted file mode 100644 index ed01bc0b..00000000 --- a/service/src/main/java/com/hzya/frame/mdm/entity/MdmDbVo.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.hzya.frame.mdm.entity; - -import com.fasterxml.jackson.annotation.JsonFormat; -import com.hzya.frame.mdm.mdmModuleDb.entity.MdmModuleDbEntity; -import com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity; -import com.hzya.frame.mdm.mdmModuleDbFiledsRuleFiles.entity.MdmModuleDbFiledsRuleFilesEntity; -import com.hzya.frame.mdm.mdmTableCodeRule.entity.MdmTableCodeRuleEntity; -import org.springframework.format.annotation.DateTimeFormat; - -import java.util.Date; -import java.util.List; - -public class MdmDbVo { - - //主数据主表 - private MdmModuleDbEntity mainMdmModuleDb; - //主数据子表 - private List sublistMdmModuleDb; - //控件字段规则属性 - private List moduleDbFiledsRuleFiles; - //单据编码规则 - private List mdmTableCodeRuleEntityList; - - - public List getMdmTableCodeRuleEntityList() { - return mdmTableCodeRuleEntityList; - } - - public void setMdmTableCodeRuleEntityList(List mdmTableCodeRuleEntityList) { - this.mdmTableCodeRuleEntityList = mdmTableCodeRuleEntityList; - } - - public List getModuleDbFiledsRuleFiles() { - return moduleDbFiledsRuleFiles; - } - - public void setModuleDbFiledsRuleFiles(List moduleDbFiledsRuleFiles) { - this.moduleDbFiledsRuleFiles = moduleDbFiledsRuleFiles; - } - - 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/MdmDetailViewVo.java b/service/src/main/java/com/hzya/frame/mdm/entity/MdmDetailViewVo.java deleted file mode 100644 index 586e4d7d..00000000 --- a/service/src/main/java/com/hzya/frame/mdm/entity/MdmDetailViewVo.java +++ /dev/null @@ -1,41 +0,0 @@ -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/MdmDistributeDto.java b/service/src/main/java/com/hzya/frame/mdm/entity/MdmDistributeDto.java deleted file mode 100644 index d27cc712..00000000 --- a/service/src/main/java/com/hzya/frame/mdm/entity/MdmDistributeDto.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.hzya.frame.mdm.entity; - - -import com.hzya.frame.mdm.mdmModuleDistribute.entity.MdmModuleDistributeEntity; -import com.hzya.frame.mdm.mdmModuleRole.entity.MdmModuleRoleEntity; - -import java.util.List; - -public class MdmDistributeDto { - - //id - private String id; - - - - private List mdmModuleDistributeEntities; - - public List getMdmModuleDistributeEntities() { - return mdmModuleDistributeEntities; - } - - public void setMdmModuleDistributeEntities(List mdmModuleDistributeEntities) { - this.mdmModuleDistributeEntities = mdmModuleDistributeEntities; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } -} - diff --git a/service/src/main/java/com/hzya/frame/mdm/entity/MdmDistributeEntity.java b/service/src/main/java/com/hzya/frame/mdm/entity/MdmDistributeEntity.java deleted file mode 100644 index 1511ea4f..00000000 --- a/service/src/main/java/com/hzya/frame/mdm/entity/MdmDistributeEntity.java +++ /dev/null @@ -1,53 +0,0 @@ -package com.hzya.frame.mdm.entity; - -import com.hzya.frame.web.entity.BaseEntity; - -public class MdmDistributeEntity extends BaseEntity { - - private String tableName; - private String formmainId; - private String appId; - private String status;//1、发送成功 2、发送中 3、发送失败 4、未发送 - private String msg; - - public String getTableName() { - return tableName; - } - - public void setTableName(String tableName) { - this.tableName = tableName; - } - - public String getFormmainId() { - return formmainId; - } - - public void setFormmainId(String formmainId) { - this.formmainId = formmainId; - } - - public String getAppId() { - return appId; - } - - public void setAppId(String appId) { - this.appId = appId; - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - public String getMsg() { - return msg; - } - - public void setMsg(String msg) { - this.msg = msg; - } -} - diff --git a/service/src/main/java/com/hzya/frame/mdm/entity/MdmDistributeVo.java b/service/src/main/java/com/hzya/frame/mdm/entity/MdmDistributeVo.java deleted file mode 100644 index dcf828ec..00000000 --- a/service/src/main/java/com/hzya/frame/mdm/entity/MdmDistributeVo.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.hzya.frame.mdm.entity; - -public class MdmDistributeVo { - - /** - * 数据 - */ - private String formmainId; - - /** - * 应用id - */ - private String appId; - /** - * 状态 1、发送成功 2、发送中 3、发送失败 4、未发送 - */ - private String status; - /** - *描述 - */ - private String msg; - - public String getFormmainId() { - return formmainId; - } - - public void setFormmainId(String formmainId) { - this.formmainId = formmainId; - } - - public String getAppId() { - return appId; - } - - public void setAppId(String appId) { - this.appId = appId; - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - public String getMsg() { - return msg; - } - - public void setMsg(String msg) { - this.msg = msg; - } -} - 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 deleted file mode 100644 index 762303a8..00000000 --- a/service/src/main/java/com/hzya/frame/mdm/entity/MdmDto.java +++ /dev/null @@ -1,205 +0,0 @@ -package com.hzya.frame.mdm.entity; - - -import com.hzya.frame.mdm.mdmModuleDb.entity.MdmModuleDbEntity; -import com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity; -import com.hzya.frame.mdm.mdmTableCodeRule.entity.MdmTableCodeRuleEntity; - -import java.util.List; - -public class MdmDto { - - //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 Integer mdmCode; - //主数据类型 - private String mdmType; - //描述 - private String remark; - //描述 - private String[] ids; - //单据编码规则 - private List mdmTableCodeRuleEntityList; - //主数据主表 - private MdmModuleDbEntity mainMdmModuleDb; - //主数据子表 - private List sublistMdmModuleDb; - - private String tableName; - private String value; - - private String label; - private String lableValue; - - private String upId; - - - public String getLableValue() { - return lableValue; - } - - public void setLableValue(String lableValue) { - this.lableValue = lableValue; - } - - public String getValue() { - return value; - } - - public void setValue(String value) { - this.value = value; - } - - 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; - } - - public String getMdmName() { - return mdmName; - } - - public void setMdmName(String mdmName) { - this.mdmName = mdmName; - } - - public Integer getMdmCode() { - return mdmCode; - } - - public void setMdmCode(Integer mdmCode) { - this.mdmCode = mdmCode; - } - - public String getMdmType() { - return mdmType; - } - - public void setMdmType(String mdmType) { - this.mdmType = mdmType; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - 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 getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public String getShowType() { - return showType; - } - - public void setShowType(String showType) { - this.showType = showType; - } - - public List getMdmTableCodeRuleEntityList() { - return mdmTableCodeRuleEntityList; - } - - public void setMdmTableCodeRuleEntityList(List mdmTableCodeRuleEntityList) { - this.mdmTableCodeRuleEntityList = mdmTableCodeRuleEntityList; - } - - 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 getTableName() { - return tableName; - } - - public void setTableName(String tableName) { - this.tableName = tableName; - } - - public String getLabel() { - return label; - } - - public void setLabel(String label) { - this.label = label; - } - - public String getUpId() { - return upId; - } - - public void setUpId(String upId) { - this.upId = upId; - } - - public String[] getIds() { - return ids; - } - - public void setIds(String[] ids) { - this.ids = ids; - } -} - 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 deleted file mode 100644 index 4386ac8c..00000000 --- a/service/src/main/java/com/hzya/frame/mdm/entity/MdmModuleViewDto.java +++ /dev/null @@ -1,81 +0,0 @@ -package com.hzya.frame.mdm.entity; - -import com.hzya.frame.mdm.mdmModuleView.entity.MdmModuleViewEntity; -import com.hzya.frame.mdm.mdmModuleViewDetail.entity.MdmModuleViewDetailEntity; - -import java.util.List; - -public class MdmModuleViewDto { - - //id - private String id; - //模版 - private MdmModuleViewEntity mdmModuleViewEntity; - //新增 - private List addFiled; - //修改 - private List editFiled; - //查看 - private List showFiled; - //查询 - private List queryFiled; - //列表 - private List listFiled; - - 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 String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } -} - 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 deleted file mode 100644 index e41fc9ae..00000000 --- a/service/src/main/java/com/hzya/frame/mdm/entity/MdmModuleViewVo.java +++ /dev/null @@ -1,123 +0,0 @@ -package com.hzya.frame.mdm.entity; - -import com.hzya.frame.mdm.mdmModuleView.entity.MdmModuleViewEntity; -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; - - 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; - } -} - 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 deleted file mode 100644 index bda7c895..00000000 --- a/service/src/main/java/com/hzya/frame/mdm/entity/MdmQuery.java +++ /dev/null @@ -1,69 +0,0 @@ -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/entity/MdmRoleDto.java b/service/src/main/java/com/hzya/frame/mdm/entity/MdmRoleDto.java deleted file mode 100644 index 1a235852..00000000 --- a/service/src/main/java/com/hzya/frame/mdm/entity/MdmRoleDto.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.hzya.frame.mdm.entity; - - -import com.hzya.frame.mdm.mdmModuleRole.entity.MdmModuleRoleEntity; - -import java.util.List; - -public class MdmRoleDto { - - //id - private String id; - - - private List mdmModuleRoleEntities; - - public List getMdmModuleRoleEntities() { - return mdmModuleRoleEntities; - } - - public void setMdmModuleRoleEntities(List mdmModuleRoleEntities) { - this.mdmModuleRoleEntities = mdmModuleRoleEntities; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } -} - diff --git a/service/src/main/java/com/hzya/frame/mdm/entity/MdmViewButtonVo.java b/service/src/main/java/com/hzya/frame/mdm/entity/MdmViewButtonVo.java deleted file mode 100644 index 4722a7b8..00000000 --- a/service/src/main/java/com/hzya/frame/mdm/entity/MdmViewButtonVo.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.hzya.frame.mdm.entity; - -public class MdmViewButtonVo { - - //按钮类型 - private String buttonType; - //按钮名 - private String buttonName; - - public String getButtonType() { - return buttonType; - } - - public void setButtonType(String buttonType) { - this.buttonType = buttonType; - } - - public String getButtonName() { - return buttonName; - } - - public void setButtonName(String buttonName) { - this.buttonName = buttonName; - } - - public MdmViewButtonVo() { - } - - public MdmViewButtonVo(String buttonType, String buttonName) { - this.buttonType = buttonType; - this.buttonName = buttonName; - } -} - 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 deleted file mode 100644 index f1e25c5a..00000000 --- a/service/src/main/java/com/hzya/frame/mdm/entity/MdmViewFiledVo.java +++ /dev/null @@ -1,114 +0,0 @@ -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 deleted file mode 100644 index 25749a1b..00000000 --- a/service/src/main/java/com/hzya/frame/mdm/entity/MdmViewVo.java +++ /dev/null @@ -1,73 +0,0 @@ -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; - //按钮 - private List buttonList; - - 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 List getButtonList() { - return buttonList; - } - - public void setButtonList(List buttonList) { - this.buttonList = buttonList; - } - - 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/entity/MdmVo.java b/service/src/main/java/com/hzya/frame/mdm/entity/MdmVo.java deleted file mode 100644 index a382ed00..00000000 --- a/service/src/main/java/com/hzya/frame/mdm/entity/MdmVo.java +++ /dev/null @@ -1,122 +0,0 @@ -package com.hzya.frame.mdm.entity; - -import com.fasterxml.jackson.annotation.JsonFormat; -import org.springframework.format.annotation.DateTimeFormat; - -import java.util.Date; - -public class MdmVo { - - //id - private String id; - //主数据名称 - private String mdmName; - //主数据编码 - private String mdmCode; - //主数据类型 1、档案 2、单据 - private String mdmType; - //主数据类型 1、档案 2、单据 - private String mdmTypeName; - //描述 - private String remark; - - /** logo(地址或者id) */ - private String mdmLogo; - private String createUserId; - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") - @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private Date createTime; - private String modifyUserId; - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") - @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private Date modifyTime; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - 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 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 getMdmTypeName() { - return mdmTypeName; - } - - public void setMdmTypeName(String mdmTypeName) { - this.mdmTypeName = mdmTypeName; - } - - public String getCreateUserId() { - return createUserId; - } - - public void setCreateUserId(String createUserId) { - this.createUserId = createUserId; - } - - public Date getCreateTime() { - return createTime; - } - - public void setCreateTime(Date createTime) { - this.createTime = createTime; - } - - public String getModifyUserId() { - return modifyUserId; - } - - public void setModifyUserId(String modifyUserId) { - this.modifyUserId = modifyUserId; - } - - public Date getModifyTime() { - return modifyTime; - } - - public void setModifyTime(Date modifyTime) { - this.modifyTime = modifyTime; - } - - public String getMdmLogo() { - return mdmLogo; - } - - public void setMdmLogo(String mdmLogo) { - this.mdmLogo = mdmLogo; - } -} - 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 5dbd47ec..fedf6b4e 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,58 +1,15 @@ package com.hzya.frame.mdm.mdmModule.dao; -import com.hzya.frame.mdm.entity.MdmDataDto; -import com.hzya.frame.mdm.entity.MdmDistributeEntity; -import com.hzya.frame.mdm.entity.MdmDto; -import com.hzya.frame.mdm.entity.MdmQuery; -import com.hzya.frame.mdm.entity.MdmVo; import com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity; -import com.hzya.frame.basedao.dao.IBaseDao; -import com.hzya.frame.sys.entity.FormmainDeleteDto; -import com.hzya.frame.sys.entity.ModuleDto; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import com.hzya.frame.basedao.dao.IBaseDao; /** * 主数据模版(mdm_module: table)表数据库访问层 * * @author makejava - * @since 2023-10-17 15:25:41 + * @since 2024-05-30 16:56:53 */ public interface IMdmModuleDao extends IBaseDao { - List queryMdm(MdmDto entity); - - Integer checkTable(Map maps); - - Integer createTable(Map maps); - Integer createTableDistribute(Map maps); - Integer alterTable(Map maps); - Integer alterTableName(Map maps); - - List> queryMdmShowData(MdmQuery entity); - - Integer checkData(Map map); - - Integer updateForm(MdmDataDto mdmDataDto); - Integer saveForm(MdmDataDto mdmDataDto); - - Integer deleteTemplateById(FormmainDeleteDto formmainDeleteDto); - - List> queryDataAll(MdmDto entity); - - List> queryTemplateData(ModuleDto entity); - - HashMap queryTemplateDataOne(MdmDto entity); - - List> queryTemplateDataMore(MdmDto entity); - List> querySelectData(MdmDto entity); - - Integer deleteChilder(FormmainDeleteDto formmainDeleteDto); - - Integer saveDistribute(MdmDistributeEntity mdmDistributeEntity); - - Integer updateDistribute(MdmDistributeEntity mdmDistributeEntity); } diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModule/entity/MdmModuleEntity.java b/service/src/main/java/com/hzya/frame/mdm/mdmModule/entity/MdmModuleEntity.java index 021797ed..90a32672 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModule/entity/MdmModuleEntity.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModule/entity/MdmModuleEntity.java @@ -1,36 +1,27 @@ package com.hzya.frame.mdm.mdmModule.entity; import java.util.Date; - import com.hzya.frame.web.entity.BaseEntity; - /** * 主数据模版(MdmModule)实体类 * * @author makejava - * @since 2023-10-17 15:25:42 + * @since 2024-05-30 16:56:53 */ public class MdmModuleEntity extends BaseEntity { - - - /** logo(地址或者id) */ - private String mdmLogo; - /** - * 主数据名称 - */ - private String mdmName; - /** - * 主数据编码 - */ - private Integer mdmCode; - /** - * 主数据类型 1、档案 2、单据 - */ - private String mdmType; - /** - * 描述 - */ - private String remark; + + /** 主数据名称 */ + private String mdmName; + /** logo */ + private String mdmLogo; + /** 主数据编码 */ + private Long mdmCode; + /** 主数据类型 1、档案 2、单据 */ + private String mdmType; + /** 描述 */ + private String remark; + /** 公司id */ + private String companyId; public String getMdmName() { @@ -41,11 +32,19 @@ public class MdmModuleEntity extends BaseEntity { this.mdmName = mdmName; } - public Integer getMdmCode() { + public String getMdmLogo() { + return mdmLogo; + } + + public void setMdmLogo(String mdmLogo) { + this.mdmLogo = mdmLogo; + } + + public Long getMdmCode() { return mdmCode; } - public void setMdmCode(Integer mdmCode) { + public void setMdmCode(Long mdmCode) { this.mdmCode = mdmCode; } @@ -65,12 +64,13 @@ public class MdmModuleEntity extends BaseEntity { this.remark = remark; } - public String getMdmLogo() { - return mdmLogo; + public String getCompanyId() { + return companyId; } - public void setMdmLogo(String mdmLogo) { - this.mdmLogo = mdmLogo; + public void setCompanyId(String companyId) { + this.companyId = companyId; } + } 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 1da23211..f9902171 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,27 +2,28 @@ - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - + id ,mdm_name - ,mdm_logo - ,mdm_code + ,mdm_logo + ,mdm_code ,mdm_type ,remark ,sorts @@ -32,722 +33,224 @@ ,modify_time ,sts ,org_id + ,company_id - - - - + 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 , - 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} , - 'Y', - - ) - - - - insert into mdm_module(mdm_name,mdm_logo, mdm_code, mdm_type, remark, sorts, create_user_id, create_time, modify_user_id, - modify_time, sts, org_id, sts) - values - - (#{entity.mdmName},#{entity.mdmLogo},#{entity.mdmCode},#{entity.mdmType},#{entity.remark},#{entity.sorts},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id}, - 'Y') - - - - - insert into mdm_module(mdm_name, mdm_logo, mdm_code, mdm_type, remark, sorts, create_user_id, create_time, modify_user_id, - modify_time, sts, org_id) - values - - (#{entity.mdmName},#{entity.mdmLogo},#{entity.mdmCode},#{entity.mdmType},#{entity.remark},#{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 - mdm_name = values(mdm_name), - mdm_logo = values(mdm_logo), - mdm_code = values(mdm_code), - mdm_type = values(mdm_type), - remark = values(remark), - 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 mdm_module set - - mdm_name = #{mdmName}, - mdm_logo = #{mdmLogo}, - mdm_code = #{mdmCode}, - mdm_type = #{mdmType}, - remark = #{remark}, - 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} - - - + + + insert into mdm_module( + + id , + mdm_name , + mdm_logo , + mdm_code , + mdm_type , + remark , + sorts , + create_user_id , + create_time , + modify_user_id , + modify_time , + sts , + org_id , + company_id , + sorts, + sts, + + )values( + + #{id} , + #{mdmName} , + #{mdmLogo} , + #{mdmCode} , + #{mdmType} , + #{remark} , + #{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 a WHERE a.sts = 'Y' ), + '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} + + +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} - - - - - - - - - - - - - - - - - - - - - - - - - - insert into ${tableName}( - - - - - ${item.filedsName}, - - - create_user_id, - modify_user_id, - - - - sorts, - create_time, - modify_time, - sts, - - document_rule, - document_rule_num, - - - )values - ( - - - - - #{item.filedsValue}, - - - #{item.filedsValue}, - #{item.filedsValue}, - - - - (select (max(IFNULL( a.sorts, 0 )) + 1) as sort from ${tableName} a WHERE - a.sts = 'Y' ), - 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 - - - - - ${item.filedsName} = #{item.filedsValue}, - - - modify_user_id = #{item.filedsValue}, - - - - modify_time = now(), - - where id = #{id} - - - - 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' - - - - - - - - - - - - - - - - - - - - insert into ${tableName}( - - id , - formmain_id , - app_id , - status , - msg , - sorts , - create_user_id , - create_time , - modify_user_id , - modify_time , - sts , - org_id , - company_id , - sts, - - )values( - - #{id} , - #{formmainId} , - #{appId} , - #{status} , - #{msg} , - #{sorts} , - #{create_user_id} , - #{create_time} , - #{modify_user_id} , - #{modify_time} , - #{sts} , - #{org_id} , - #{companyId} , - 'Y', - - ) - - - - update ${tableName} set - - formmain_id = #{formmainId}, - app_id = #{appId}, - status = #{status}, - msg = #{msg}, - modify_user_id = #{modify_user_id}, - modify_time = #{modify_time}, - sts = #{sts}, - org_id = #{org_id}, - - where id = #{id} - 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 837cb3e4..a45d87ce 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 @@ -2,12 +2,11 @@ package com.hzya.frame.mdm.mdmModule.service; import com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity; import com.hzya.frame.basedao.service.IBaseService; - /** * 主数据模版(MdmModule)表服务接口 * * @author makejava - * @since 2023-10-17 15:25:44 + * @since 2024-05-30 16:56:54 */ -public interface IMdmModuleService extends IBaseService { +public interface IMdmModuleService extends IBaseService{ } 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 b82af615..cbca01ff 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 @@ -3,27 +3,24 @@ package com.hzya.frame.mdm.mdmModule.service.impl; 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 org.springframework.stereotype.Service; import org.springframework.beans.factory.annotation.Autowired; - import javax.annotation.Resource; - import com.hzya.frame.basedao.service.impl.BaseService; - /** * 主数据模版(MdmModule)表服务实现类 * * @author makejava - * @since 2023-10-17 15:25:44 + * @since 2024-05-30 16:56:54 */ @Service(value = "mdmModuleService") public class MdmModuleServiceImpl extends BaseService implements IMdmModuleService { - + private IMdmModuleDao mdmModuleDao; - + @Autowired - public void setMdmModuleDao(IMdmModuleDao dao) { - this.mdmModuleDao = dao; - this.dao = dao; - } + public void setMdmModuleDao(IMdmModuleDao dao) { + this.mdmModuleDao = dao; + this.dao = dao; + } } 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 b2a48a17..c756aa73 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,29 +1,15 @@ package com.hzya.frame.mdm.mdmModuleDb.dao; -import com.hzya.frame.mdm.entity.MdmDistributeVo; -import com.hzya.frame.mdm.entity.MdmDto; import com.hzya.frame.mdm.mdmModuleDb.entity.MdmModuleDbEntity; -import com.hzya.frame.basedao.dao.IBaseDao; -import com.hzya.frame.sys.entity.ModuleDto; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import com.hzya.frame.basedao.dao.IBaseDao; /** * 模版数据库表(mdm_module_db: table)表数据库访问层 * * @author makejava - * @since 2023-10-17 15:26:49 + * @since 2024-05-30 16:58:05 */ public interface IMdmModuleDbDao extends IBaseDao { - HashMap getServiceDataById(Map queryData); - - List> getServiceByFormmainId(Map queryData); - List> getServiceByDistributeId(Map queryData); - List getServiceByDistributeIdNoCase(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 76eeaf7e..d16293ca 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 @@ -1,51 +1,17 @@ package com.hzya.frame.mdm.mdmModuleDb.dao.impl; -import com.hzya.frame.mdm.entity.MdmDistributeVo; -import com.hzya.frame.mdm.entity.MdmDto; import com.hzya.frame.mdm.mdmModuleDb.entity.MdmModuleDbEntity; import com.hzya.frame.mdm.mdmModuleDb.dao.IMdmModuleDbDao; -import com.hzya.frame.sys.entity.ModuleDto; 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)表数据库访问层 * * @author makejava - * @since 2023-10-17 15:26:49 + * @since 2024-05-30 16:58:05 */ @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; - - } - @Override - public List getServiceByDistributeIdNoCase(Map maps) { - List o = (List) super.selectList(getSqlIdPrifx() + "getServiceByDistributeIdNoCase", maps); - return o; - - } - +public class MdmModuleDbDaoImpl extends MybatisGenericDao implements IMdmModuleDbDao{ + } diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDb/entity/MdmModuleDbEntity.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDb/entity/MdmModuleDbEntity.java index 9d50b509..22a7acfe 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDb/entity/MdmModuleDbEntity.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDb/entity/MdmModuleDbEntity.java @@ -1,38 +1,26 @@ package com.hzya.frame.mdm.mdmModuleDb.entity; import java.util.Date; -import java.util.List; - -import com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity; import com.hzya.frame.web.entity.BaseEntity; - /** * 模版数据库表(MdmModuleDb)实体类 * * @author makejava - * @since 2023-10-17 15:26:49 + * @since 2024-05-30 16:58:05 */ public class MdmModuleDbEntity extends BaseEntity { + + /** 主数据模版ID */ + private String mdmId; + /** 表名 */ + private String dbName; + /** 类型 1、主表 2、明细 3、操作日志 4、下发日志 */ + private String dbType; + /** 备注 */ + private String remark; + /** 公司id */ + private String companyId; - /** - * 主数据模版ID - */ - private String mdmId; - /** - * 表名 - */ - private String dbName; - /** - * 类型 1、主表 2、明细 - */ - private String dbType; - /** - * 备注 - */ - private String remark; - - //主数据子表字段 - private List sublistMdmModuleDbFileds; public String getMdmId() { return mdmId; @@ -66,12 +54,13 @@ public class MdmModuleDbEntity extends BaseEntity { this.remark = remark; } - public List getSublistMdmModuleDbFileds() { - return sublistMdmModuleDbFileds; + public String getCompanyId() { + return companyId; } - public void setSublistMdmModuleDbFileds(List sublistMdmModuleDbFileds) { - this.sublistMdmModuleDbFileds = sublistMdmModuleDbFileds; + public void setCompanyId(String companyId) { + this.companyId = companyId; } + } 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 f6e61edf..09204cac 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 @@ -2,22 +2,23 @@ - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - + id ,mdm_id ,db_name @@ -30,293 +31,215 @@ ,modify_time ,sts ,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 , - sts, - - )values( - - #{id} , - #{mdmId} , - #{dbName} , - #{dbType} , - #{remark} , - #{sorts} , - #{create_user_id} , - #{create_time} , - #{modify_user_id} , - #{modify_time} , - #{sts} , - #{org_id} , - - 'Y', - - ) - - - - insert into mdm_module_db(mdm_id, db_name, db_type, remark, sorts, create_user_id, create_time, modify_user_id, - modify_time, sts, org_id, sts) - values - - (#{entity.mdmId},#{entity.dbName},#{entity.dbType},#{entity.remark},#{entity.sorts},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id}, - 'Y') - - - - - insert into mdm_module_db(mdm_id, db_name, db_type, remark, sorts, create_user_id, create_time, modify_user_id, - modify_time, sts, org_id) - values - - (#{entity.mdmId},#{entity.dbName},#{entity.dbType},#{entity.remark},#{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 - mdm_id = values(mdm_id), - db_name = values(db_name), - db_type = values(db_type), - remark = values(remark), - 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 mdm_module_db set - - mdm_id = #{mdmId}, - db_name = #{dbName}, - db_type = #{dbType}, - remark = #{remark}, - 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} - - - + + + 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 , + sorts, + sts, + + )values( + + #{id} , + #{mdmId} , + #{dbName} , + #{dbType} , + #{remark} , + #{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_db a WHERE a.sts = 'Y' ), + '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} + + +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} - - - - - - - - - diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDb/service/IMdmModuleDbService.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDb/service/IMdmModuleDbService.java index c041826d..f1bfc14b 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDb/service/IMdmModuleDbService.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDb/service/IMdmModuleDbService.java @@ -2,12 +2,11 @@ package com.hzya.frame.mdm.mdmModuleDb.service; import com.hzya.frame.mdm.mdmModuleDb.entity.MdmModuleDbEntity; import com.hzya.frame.basedao.service.IBaseService; - /** * 模版数据库表(MdmModuleDb)表服务接口 * * @author makejava - * @since 2023-10-17 15:26:51 + * @since 2024-05-30 16:58:05 */ -public interface IMdmModuleDbService extends IBaseService { +public interface IMdmModuleDbService extends IBaseService{ } diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDb/service/impl/MdmModuleDbServiceImpl.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDb/service/impl/MdmModuleDbServiceImpl.java index b017b6a0..0af82f65 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDb/service/impl/MdmModuleDbServiceImpl.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDb/service/impl/MdmModuleDbServiceImpl.java @@ -3,27 +3,24 @@ package com.hzya.frame.mdm.mdmModuleDb.service.impl; import com.hzya.frame.mdm.mdmModuleDb.entity.MdmModuleDbEntity; import com.hzya.frame.mdm.mdmModuleDb.dao.IMdmModuleDbDao; import com.hzya.frame.mdm.mdmModuleDb.service.IMdmModuleDbService; -import org.springframework.stereotype.Service; +import org.springframework.stereotype.Service; import org.springframework.beans.factory.annotation.Autowired; - import javax.annotation.Resource; - import com.hzya.frame.basedao.service.impl.BaseService; - /** * 模版数据库表(MdmModuleDb)表服务实现类 * * @author makejava - * @since 2023-10-17 15:26:51 + * @since 2024-05-30 16:58:05 */ @Service(value = "mdmModuleDbService") public class MdmModuleDbServiceImpl extends BaseService implements IMdmModuleDbService { - + private IMdmModuleDbDao mdmModuleDbDao; - + @Autowired - public void setMdmModuleDbDao(IMdmModuleDbDao dao) { - this.mdmModuleDbDao = dao; - this.dao = dao; - } + public void setMdmModuleDbDao(IMdmModuleDbDao dao) { + this.mdmModuleDbDao = dao; + this.dao = dao; + } } 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 174e6a09..85ae9c76 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 @@ -1,13 +1,13 @@ package com.hzya.frame.mdm.mdmModuleDbFileds.dao; import com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity; -import com.hzya.frame.basedao.dao.IBaseDao; +import com.hzya.frame.basedao.dao.IBaseDao; /** * 模版数据库字段表(mdm_module_db_fileds: table)表数据库访问层 * * @author makejava - * @since 2023-10-17 15:28:06 + * @since 2024-05-30 16:59:05 */ public interface IMdmModuleDbFiledsDao extends IBaseDao { 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 362f1f76..42497b13 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 @@ -4,15 +4,14 @@ import com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity; import com.hzya.frame.mdm.mdmModuleDbFileds.dao.IMdmModuleDbFiledsDao; import org.springframework.stereotype.Repository; import com.hzya.frame.basedao.dao.MybatisGenericDao; - /** * 模版数据库字段表(MdmModuleDbFileds)表数据库访问层 * * @author makejava - * @since 2023-10-17 15:28:07 + * @since 2024-05-30 16:59:05 */ @Repository(value = "MdmModuleDbFiledsDaoImpl") -public class MdmModuleDbFiledsDaoImpl extends MybatisGenericDao implements IMdmModuleDbFiledsDao { - +public class MdmModuleDbFiledsDaoImpl extends MybatisGenericDao implements IMdmModuleDbFiledsDao{ + } 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 998924ea..3dfe1ee5 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,61 +1,42 @@ 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; - /** * 模版数据库字段表(MdmModuleDbFileds)实体类 * * @author makejava - * @since 2023-10-17 15:28:07 + * @since 2024-05-30 16:59:05 */ public class MdmModuleDbFiledsEntity extends BaseEntity { + + /** 主数据模版ID */ + private String mdmId; + /** 模版数据库id */ + private String dbId; + /** 中文名 */ + private String chName; + /** 英文名 */ + private String enName; + /** 字段类型 1、BIGINT 2、DECIMAL 3、VARCHAR 4、DATETIME */ + private String filedType; + /** 显示类型:新增 */ + private String addType; + /** 显示类型:修改 */ + private String updateType; + /** 显示类型:查看 */ + private String showType; + /** 显示类型:查询 */ + private String queryType; + /** 显示类型:列表 */ + private String listType; + /** 显示类型:显示 */ + private String viewType; + /** 长度 */ + private String filedLength; + /** 公司id */ + private String companyId; - /** - * 主数据模版ID - */ - private String mdmId; - /** - * 模版数据库id - */ - private String dbId; - /** - * 中文名 - */ - private String chName; - /** - * 英文名 - */ - private String enName; - /** - * 字段类型 1、BIGINT 2、DECIMAL 3、VARCHAR 4、DATETIME - */ - private String filedType; - /** - * 长度 - */ - private String filedLength; - /** - * roletype - */ - private String roletype; - /** - * roletype - */ - private String roleValue; - //字段规则 - private List mdmModuleDbFiledsRules; - - public List getMdmModuleDbFiledsRules() { - return mdmModuleDbFiledsRules; - } - - public void setMdmModuleDbFiledsRules(List mdmModuleDbFiledsRules) { - this.mdmModuleDbFiledsRules = mdmModuleDbFiledsRules; - } public String getMdmId() { return mdmId; @@ -97,6 +78,54 @@ public class MdmModuleDbFiledsEntity extends BaseEntity { this.filedType = filedType; } + public String getAddType() { + return addType; + } + + public void setAddType(String addType) { + this.addType = addType; + } + + public String getUpdateType() { + return updateType; + } + + public void setUpdateType(String updateType) { + this.updateType = updateType; + } + + public String getShowType() { + return showType; + } + + public void setShowType(String showType) { + this.showType = showType; + } + + public String getQueryType() { + return queryType; + } + + public void setQueryType(String queryType) { + this.queryType = queryType; + } + + public String getListType() { + return listType; + } + + public void setListType(String listType) { + this.listType = listType; + } + + public String getViewType() { + return viewType; + } + + public void setViewType(String viewType) { + this.viewType = viewType; + } + public String getFiledLength() { return filedLength; } @@ -105,20 +134,13 @@ public class MdmModuleDbFiledsEntity extends BaseEntity { this.filedLength = filedLength; } - public String getRoletype() { - return roletype; + public String getCompanyId() { + return companyId; } - public void setRoletype(String roletype) { - this.roletype = roletype; + public void setCompanyId(String companyId) { + this.companyId = companyId; } - public String getRoleValue() { - return roleValue; - } - - public void setRoleValue(String roleValue) { - this.roleValue = roleValue; - } } 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 80a7af17..5cfc68c1 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 @@ -2,31 +2,43 @@ - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + - + id ,mdm_id ,db_id ,ch_name ,en_name ,filed_type + ,add_type + ,update_type + ,show_type + ,query_type + ,list_type + ,view_type ,filed_length ,sorts ,create_user_id @@ -35,245 +47,285 @@ ,modify_time ,sts ,org_id + ,company_id - - + select + + from mdm_module_db_fileds + + and id = #{id} + and mdm_id = #{mdmId} + and db_id = #{dbId} + and ch_name = #{chName} + and en_name = #{enName} + and filed_type = #{filedType} + and add_type = #{addType} + and update_type = #{updateType} + and show_type = #{showType} + and query_type = #{queryType} + and list_type = #{listType} + and view_type = #{viewType} + and filed_length = #{filedLength} + 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_fileds + + and id like concat('%',#{id},'%') + and mdm_id like concat('%',#{mdmId},'%') + and db_id like concat('%',#{dbId},'%') + and ch_name like concat('%',#{chName},'%') + and en_name like concat('%',#{enName},'%') + and filed_type like concat('%',#{filedType},'%') + and add_type like concat('%',#{addType},'%') + and update_type like concat('%',#{updateType},'%') + and show_type like concat('%',#{showType},'%') + and query_type like concat('%',#{queryType},'%') + and list_type like concat('%',#{listType},'%') + and view_type like concat('%',#{viewType},'%') + and filed_length like concat('%',#{filedLength},'%') + 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_fileds + + or id = #{id} + or mdm_id = #{mdmId} + or db_id = #{dbId} + or ch_name = #{chName} + or en_name = #{enName} + or filed_type = #{filedType} + or add_type = #{addType} + or update_type = #{updateType} + or show_type = #{showType} + or query_type = #{queryType} + or list_type = #{listType} + or view_type = #{viewType} + or filed_length = #{filedLength} + 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_fileds( - - id , - mdm_id , - db_id , - ch_name , - en_name , - filed_type , - filed_length , - sorts , - create_user_id , - create_time , - modify_user_id , - modify_time , - sts , - org_id , - sts, - - )values( - - #{id} , - #{mdmId} , - #{dbId} , - #{chName} , - #{enName} , - #{filedType} , - #{filedLength} , - #{sorts} , - #{create_user_id} , - #{create_time} , - #{modify_user_id} , - #{modify_time} , - #{sts} , - #{org_id} , - - 'Y', - - ) - - - - insert into mdm_module_db_fileds(mdm_id, db_id, ch_name, en_name, filed_type, filed_length, sorts, - create_user_id, create_time, modify_user_id, modify_time, sts, org_id, sts) - values - - (#{entity.mdmId},#{entity.dbId},#{entity.chName},#{entity.enName},#{entity.filedType},#{entity.filedLength},#{entity.sorts},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id}, - 'Y') - - - - - insert into mdm_module_db_fileds(mdm_id, db_id, ch_name, en_name, filed_type, filed_length, sorts, - create_user_id, create_time, modify_user_id, modify_time, sts, org_id) - values - - (#{entity.mdmId},#{entity.dbId},#{entity.chName},#{entity.enName},#{entity.filedType},#{entity.filedLength},#{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 - mdm_id = values(mdm_id), - db_id = values(db_id), - ch_name = values(ch_name), - en_name = values(en_name), - filed_type = values(filed_type), - filed_length = values(filed_length), - 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 mdm_module_db_fileds set - - mdm_id = #{mdmId}, - db_id = #{dbId}, - ch_name = #{chName}, - en_name = #{enName}, - filed_type = #{filedType}, - filed_length = #{filedLength}, - 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} - - - + + + insert into mdm_module_db_fileds( + + id , + mdm_id , + db_id , + ch_name , + en_name , + filed_type , + add_type , + update_type , + show_type , + query_type , + list_type , + view_type , + filed_length , + sorts , + create_user_id , + create_time , + modify_user_id , + modify_time , + sts , + org_id , + company_id , + sorts, + sts, + + )values( + + #{id} , + #{mdmId} , + #{dbId} , + #{chName} , + #{enName} , + #{filedType} , + #{addType} , + #{updateType} , + #{showType} , + #{queryType} , + #{listType} , + #{viewType} , + #{filedLength} , + #{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_db_fileds a WHERE a.sts = 'Y' ), + 'Y', + + ) + + + + insert into mdm_module_db_fileds(mdm_id, db_id, ch_name, en_name, filed_type, add_type, update_type, show_type, query_type, list_type, view_type, filed_length, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, sts) + values + + (#{entity.mdmId},#{entity.dbId},#{entity.chName},#{entity.enName},#{entity.filedType},#{entity.addType},#{entity.updateType},#{entity.showType},#{entity.queryType},#{entity.listType},#{entity.viewType},#{entity.filedLength},#{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_fileds(mdm_id, db_id, ch_name, en_name, filed_type, add_type, update_type, show_type, query_type, list_type, view_type, filed_length, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id) + values + + (#{entity.mdmId},#{entity.dbId},#{entity.chName},#{entity.enName},#{entity.filedType},#{entity.addType},#{entity.updateType},#{entity.showType},#{entity.queryType},#{entity.listType},#{entity.viewType},#{entity.filedLength},#{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_id = values(db_id), + ch_name = values(ch_name), + en_name = values(en_name), + filed_type = values(filed_type), + add_type = values(add_type), + update_type = values(update_type), + show_type = values(show_type), + query_type = values(query_type), + list_type = values(list_type), + view_type = values(view_type), + filed_length = values(filed_length), + 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_fileds set + + mdm_id = #{mdmId}, + db_id = #{dbId}, + ch_name = #{chName}, + en_name = #{enName}, + filed_type = #{filedType}, + add_type = #{addType}, + update_type = #{updateType}, + show_type = #{showType}, + query_type = #{queryType}, + list_type = #{listType}, + view_type = #{viewType}, + filed_length = #{filedLength}, + 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_fileds set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} where id = #{id} - - - update mdm_module_db_fileds set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} - - and id = #{id} - and mdm_id = #{mdmId} - and db_id = #{dbId} - and ch_name = #{chName} - and en_name = #{enName} - and filed_type = #{filedType} - and filed_length = #{filedLength} - and sorts = #{sorts} - and sts = #{sts} + + +update mdm_module_db_fileds set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} + + and id = #{id} + and mdm_id = #{mdmId} + and db_id = #{dbId} + and ch_name = #{chName} + and en_name = #{enName} + and filed_type = #{filedType} + and add_type = #{addType} + and update_type = #{updateType} + and show_type = #{showType} + and query_type = #{queryType} + and list_type = #{listType} + and view_type = #{viewType} + and filed_length = #{filedLength} + and sorts = #{sorts} + and sts = #{sts} + and company_id = #{companyId} and sts='Y' - - - - + + + + delete from mdm_module_db_fileds where id = #{id} diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDbFileds/service/IMdmModuleDbFiledsService.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDbFileds/service/IMdmModuleDbFiledsService.java index 78f21fbb..c4a0378a 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDbFileds/service/IMdmModuleDbFiledsService.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDbFileds/service/IMdmModuleDbFiledsService.java @@ -2,12 +2,11 @@ package com.hzya.frame.mdm.mdmModuleDbFileds.service; import com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity; import com.hzya.frame.basedao.service.IBaseService; - /** * 模版数据库字段表(MdmModuleDbFileds)表服务接口 * * @author makejava - * @since 2023-10-17 15:28:09 + * @since 2024-05-30 16:59:05 */ -public interface IMdmModuleDbFiledsService extends IBaseService { +public interface IMdmModuleDbFiledsService extends IBaseService{ } diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDbFileds/service/impl/MdmModuleDbFiledsServiceImpl.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDbFileds/service/impl/MdmModuleDbFiledsServiceImpl.java index 016eea5e..585ecffc 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDbFileds/service/impl/MdmModuleDbFiledsServiceImpl.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDbFileds/service/impl/MdmModuleDbFiledsServiceImpl.java @@ -3,27 +3,24 @@ package com.hzya.frame.mdm.mdmModuleDbFileds.service.impl; import com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity; import com.hzya.frame.mdm.mdmModuleDbFileds.dao.IMdmModuleDbFiledsDao; import com.hzya.frame.mdm.mdmModuleDbFileds.service.IMdmModuleDbFiledsService; -import org.springframework.stereotype.Service; +import org.springframework.stereotype.Service; import org.springframework.beans.factory.annotation.Autowired; - import javax.annotation.Resource; - import com.hzya.frame.basedao.service.impl.BaseService; - /** * 模版数据库字段表(MdmModuleDbFileds)表服务实现类 * * @author makejava - * @since 2023-10-17 15:28:09 + * @since 2024-05-30 16:59:05 */ @Service(value = "mdmModuleDbFiledsService") public class MdmModuleDbFiledsServiceImpl extends BaseService implements IMdmModuleDbFiledsService { - + private IMdmModuleDbFiledsDao mdmModuleDbFiledsDao; - + @Autowired - public void setMdmModuleDbFiledsDao(IMdmModuleDbFiledsDao dao) { - this.mdmModuleDbFiledsDao = dao; - this.dao = dao; - } + public void setMdmModuleDbFiledsDao(IMdmModuleDbFiledsDao dao) { + this.mdmModuleDbFiledsDao = dao; + this.dao = dao; + } } 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 7b81046f..cae56910 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 @@ -7,7 +7,7 @@ import com.hzya.frame.basedao.dao.IBaseDao; * 模版数据库字段规则表(mdm_module_db_fileds_rule: table)表数据库访问层 * * @author makejava - * @since 2023-11-04 11:16:44 + * @since 2024-05-30 16:59:59 */ public interface IMdmModuleDbFiledsRuleDao extends IBaseDao { 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 1a0d4f6b..43cb75a6 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 @@ -8,7 +8,7 @@ import com.hzya.frame.basedao.dao.MybatisGenericDao; * 模版数据库字段规则表(MdmModuleDbFiledsRule)表数据库访问层 * * @author makejava - * @since 2023-11-04 11:16:44 + * @since 2024-05-30 16:59:59 */ @Repository(value = "MdmModuleDbFiledsRuleDaoImpl") public class MdmModuleDbFiledsRuleDaoImpl extends MybatisGenericDao implements IMdmModuleDbFiledsRuleDao{ diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDbFiledsRule/entity/MdmModuleDbFiledsRuleEntity.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDbFiledsRule/entity/MdmModuleDbFiledsRuleEntity.java index 8d71cc18..2e30e449 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDbFiledsRule/entity/MdmModuleDbFiledsRuleEntity.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDbFiledsRule/entity/MdmModuleDbFiledsRuleEntity.java @@ -6,7 +6,7 @@ import com.hzya.frame.web.entity.BaseEntity; * 模版数据库字段规则表(MdmModuleDbFiledsRule)实体类 * * @author makejava - * @since 2023-11-04 11:16:44 + * @since 2024-05-30 16:59:59 */ public class MdmModuleDbFiledsRuleEntity extends BaseEntity { @@ -26,6 +26,8 @@ public class MdmModuleDbFiledsRuleEntity extends BaseEntity { private String ruleValue; /** 规则类型1、表单属性 2、控件属性 */ private String ruleType; + /** 公司id */ + private String companyId; public String getMdmId() { @@ -92,5 +94,13 @@ public class MdmModuleDbFiledsRuleEntity extends BaseEntity { this.ruleType = ruleType; } + public String getCompanyId() { + return companyId; + } + + public void setCompanyId(String companyId) { + this.companyId = companyId; + } + } 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 81a375a2..94ea0aa7 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 @@ -19,6 +19,7 @@ + @@ -38,6 +39,7 @@ ,modify_time ,sts ,org_id + ,company_id - + insert into mdm_module_db_fileds_rule( id , @@ -169,6 +175,8 @@ modify_time , sts , org_id , + company_id , + sorts, sts, )values( @@ -189,24 +197,26 @@ #{modify_time} , #{sts} , #{org_id} , + #{companyId} , + (select (max(IFNULL( a.sorts, 0 )) + 1) as sort from mdm_module_db_fileds_rule a WHERE a.sts = 'Y' ), 'Y', ) - - insert into mdm_module_db_fileds_rule(mdm_id, form_name, db_id, filed_id, rule_name, rule_code, rule_value, rule_type, sorts, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, sts) + + insert into mdm_module_db_fileds_rule(mdm_id, form_name, db_id, filed_id, rule_name, rule_code, rule_value, rule_type, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, sts) values - (#{entity.mdmId},#{entity.formName},#{entity.dbId},#{entity.filedId},#{entity.ruleName},#{entity.ruleCode},#{entity.ruleValue},#{entity.ruleType},#{entity.sorts},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id}, 'Y') + (#{entity.mdmId},#{entity.formName},#{entity.dbId},#{entity.filedId},#{entity.ruleName},#{entity.ruleCode},#{entity.ruleValue},#{entity.ruleType},#{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_fileds_rule(mdm_id, form_name, db_id, filed_id, rule_name, rule_code, rule_value, rule_type, sorts, create_user_id, create_time, modify_user_id, modify_time, sts, org_id) + + insert into mdm_module_db_fileds_rule(mdm_id, form_name, db_id, filed_id, rule_name, rule_code, rule_value, rule_type, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id) values - (#{entity.mdmId},#{entity.formName},#{entity.dbId},#{entity.filedId},#{entity.ruleName},#{entity.ruleCode},#{entity.ruleValue},#{entity.ruleType},#{entity.sorts},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id}) + (#{entity.mdmId},#{entity.formName},#{entity.dbId},#{entity.filedId},#{entity.ruleName},#{entity.ruleCode},#{entity.ruleValue},#{entity.ruleType},#{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), @@ -217,13 +227,13 @@ rule_code = values(rule_code), rule_value = values(rule_value), rule_type = values(rule_type), - 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) + org_id = values(org_id), + company_id = values(company_id) update mdm_module_db_fileds_rule set @@ -236,14 +246,14 @@ update mdm_module_db_fileds_rule set rule_code = #{ruleCode}, rule_value = #{ruleValue}, rule_type = #{ruleType}, - 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}, - + company_id = #{companyId}, + where id = #{id} @@ -266,7 +276,8 @@ update mdm_module_db_fileds_rule set sts= 'N' ,modify_time = #{modify_time},mod and rule_type = #{ruleType} and sorts = #{sorts} and sts = #{sts} - and sts='Y' + and company_id = #{companyId} + and sts='Y' diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDbFiledsRule/service/IMdmModuleDbFiledsRuleService.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDbFiledsRule/service/IMdmModuleDbFiledsRuleService.java index b679d0d3..26d2b517 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDbFiledsRule/service/IMdmModuleDbFiledsRuleService.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDbFiledsRule/service/IMdmModuleDbFiledsRuleService.java @@ -6,7 +6,7 @@ import com.hzya.frame.basedao.service.IBaseService; * 模版数据库字段规则表(MdmModuleDbFiledsRule)表服务接口 * * @author makejava - * @since 2023-11-04 11:16:44 + * @since 2024-05-30 16:59:59 */ public interface IMdmModuleDbFiledsRuleService extends IBaseService{ } diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDbFiledsRule/service/impl/MdmModuleDbFiledsRuleServiceImpl.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDbFiledsRule/service/impl/MdmModuleDbFiledsRuleServiceImpl.java index 941a5171..ba897603 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDbFiledsRule/service/impl/MdmModuleDbFiledsRuleServiceImpl.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDbFiledsRule/service/impl/MdmModuleDbFiledsRuleServiceImpl.java @@ -11,7 +11,7 @@ import com.hzya.frame.basedao.service.impl.BaseService; * 模版数据库字段规则表(MdmModuleDbFiledsRule)表服务实现类 * * @author makejava - * @since 2023-11-04 11:16:44 + * @since 2024-05-30 16:59:59 */ @Service(value = "mdmModuleDbFiledsRuleService") public class MdmModuleDbFiledsRuleServiceImpl extends BaseService implements IMdmModuleDbFiledsRuleService { diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDbFiledsRuleFiles/dao/IMdmModuleDbFiledsRuleFilesDao.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDbFiledsRuleFiles/dao/IMdmModuleDbFiledsRuleFilesDao.java deleted file mode 100644 index 8335ffae..00000000 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDbFiledsRuleFiles/dao/IMdmModuleDbFiledsRuleFilesDao.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.hzya.frame.mdm.mdmModuleDbFiledsRuleFiles.dao; - -import com.hzya.frame.mdm.mdmModuleDbFiledsRuleFiles.entity.MdmModuleDbFiledsRuleFilesEntity; -import com.hzya.frame.basedao.dao.IBaseDao; - -/** - * 模版数据库字段规则档案表(mdm_module_db_fileds_rule_files: table)表数据库访问层 - * - * @author makejava - * @since 2023-10-17 15:30:12 - */ -public interface IMdmModuleDbFiledsRuleFilesDao extends IBaseDao { - -} - diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDbFiledsRuleFiles/dao/impl/MdmModuleDbFiledsRuleFilesDaoImpl.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDbFiledsRuleFiles/dao/impl/MdmModuleDbFiledsRuleFilesDaoImpl.java deleted file mode 100644 index f5f0d497..00000000 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDbFiledsRuleFiles/dao/impl/MdmModuleDbFiledsRuleFilesDaoImpl.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.hzya.frame.mdm.mdmModuleDbFiledsRuleFiles.dao.impl; - -import com.hzya.frame.mdm.mdmModuleDbFiledsRuleFiles.entity.MdmModuleDbFiledsRuleFilesEntity; -import com.hzya.frame.mdm.mdmModuleDbFiledsRuleFiles.dao.IMdmModuleDbFiledsRuleFilesDao; -import org.springframework.stereotype.Repository; -import com.hzya.frame.basedao.dao.MybatisGenericDao; - -/** - * 模版数据库字段规则档案表(MdmModuleDbFiledsRuleFiles)表数据库访问层 - * - * @author makejava - * @since 2023-10-17 15:30:12 - */ -@Repository(value = "MdmModuleDbFiledsRuleFilesDaoImpl") -public class MdmModuleDbFiledsRuleFilesDaoImpl extends MybatisGenericDao implements IMdmModuleDbFiledsRuleFilesDao { - -} - diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDbFiledsRuleFiles/entity/MdmModuleDbFiledsRuleFilesEntity.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDbFiledsRuleFiles/entity/MdmModuleDbFiledsRuleFilesEntity.java deleted file mode 100644 index 7f9bf614..00000000 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDbFiledsRuleFiles/entity/MdmModuleDbFiledsRuleFilesEntity.java +++ /dev/null @@ -1,66 +0,0 @@ -package com.hzya.frame.mdm.mdmModuleDbFiledsRuleFiles.entity; - -import java.util.Date; - -import com.hzya.frame.web.entity.BaseEntity; - -/** - * 模版数据库字段规则档案表(MdmModuleDbFiledsRuleFiles)实体类 - * - * @author makejava - * @since 2023-10-17 15:30:13 - */ -public class MdmModuleDbFiledsRuleFilesEntity extends BaseEntity { - - /** - * 规则名称 - */ - private String ruleName; - /** - * 规则编码 - */ - private String ruleCode; - /** - * 规则类型 1、表单属性 2、控件属性 - */ - private String ruleType; - /** - * 规则值 - */ - private String ruleValue; - - - public String getRuleName() { - return ruleName; - } - - public void setRuleName(String ruleName) { - this.ruleName = ruleName; - } - - public String getRuleCode() { - return ruleCode; - } - - public void setRuleCode(String ruleCode) { - this.ruleCode = ruleCode; - } - - public String getRuleType() { - return ruleType; - } - - public void setRuleType(String ruleType) { - this.ruleType = ruleType; - } - - public String getRuleValue() { - return ruleValue; - } - - public void setRuleValue(String ruleValue) { - this.ruleValue = ruleValue; - } - -} - diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDbFiledsRuleFiles/entity/MdmModuleDbFiledsRuleFilesEntity.xml b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDbFiledsRuleFiles/entity/MdmModuleDbFiledsRuleFilesEntity.xml deleted file mode 100644 index cdcf8eec..00000000 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDbFiledsRuleFiles/entity/MdmModuleDbFiledsRuleFilesEntity.xml +++ /dev/null @@ -1,254 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - id - ,rule_name - ,rule_code - ,rule_type - ,rule_value - ,sorts - ,create_user_id - ,create_time - ,modify_user_id - ,modify_time - ,sts - ,org_id - - - - - - - - - - - - - - - - insert into mdm_module_db_fileds_rule_files( - - id , - rule_name , - rule_code , - rule_type , - rule_value , - sorts , - create_user_id , - create_time , - modify_user_id , - modify_time , - sts , - org_id , - sts, - - )values( - - #{id} , - #{ruleName} , - #{ruleCode} , - #{ruleType} , - #{ruleValue} , - #{sorts} , - #{create_user_id} , - #{create_time} , - #{modify_user_id} , - #{modify_time} , - #{sts} , - #{org_id} , - - 'Y', - - ) - - - - insert into mdm_module_db_fileds_rule_files(rule_name, rule_code, rule_type, rule_value, sorts, create_user_id, - create_time, modify_user_id, modify_time, sts, org_id, sts) - values - - (#{entity.ruleName},#{entity.ruleCode},#{entity.ruleType},#{entity.ruleValue},#{entity.sorts},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id}, - 'Y') - - - - - insert into mdm_module_db_fileds_rule_files(rule_name, rule_code, rule_type, rule_value, sorts, create_user_id, - create_time, modify_user_id, modify_time, sts, org_id) - values - - (#{entity.ruleName},#{entity.ruleCode},#{entity.ruleType},#{entity.ruleValue},#{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 - rule_name = values(rule_name), - rule_code = values(rule_code), - rule_type = values(rule_type), - rule_value = values(rule_value), - 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 mdm_module_db_fileds_rule_files set - - rule_name = #{ruleName}, - rule_code = #{ruleCode}, - rule_type = #{ruleType}, - rule_value = #{ruleValue}, - 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 mdm_module_db_fileds_rule_files set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} -where id = #{id} - - - - update mdm_module_db_fileds_rule_files set sts= 'N' ,modify_time = #{modify_time},modify_user_id = - #{modify_user_id} - - and id = #{id} - and rule_name = #{ruleName} - and rule_code = #{ruleCode} - and rule_type = #{ruleType} - and rule_value = #{ruleValue} - and sorts = #{sorts} - and sts = #{sts} - and sts='Y' - - - - - delete from mdm_module_db_fileds_rule_files where id = #{id} - - - - diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDbFiledsRuleFiles/service/IMdmModuleDbFiledsRuleFilesService.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDbFiledsRuleFiles/service/IMdmModuleDbFiledsRuleFilesService.java deleted file mode 100644 index 75e81394..00000000 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDbFiledsRuleFiles/service/IMdmModuleDbFiledsRuleFilesService.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.hzya.frame.mdm.mdmModuleDbFiledsRuleFiles.service; - -import com.hzya.frame.mdm.mdmModuleDbFiledsRuleFiles.entity.MdmModuleDbFiledsRuleFilesEntity; -import com.hzya.frame.basedao.service.IBaseService; - -/** - * 模版数据库字段规则档案表(MdmModuleDbFiledsRuleFiles)表服务接口 - * - * @author makejava - * @since 2023-10-17 15:30:14 - */ -public interface IMdmModuleDbFiledsRuleFilesService extends IBaseService { -} diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDbFiledsRuleFiles/service/impl/MdmModuleDbFiledsRuleFilesServiceImpl.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDbFiledsRuleFiles/service/impl/MdmModuleDbFiledsRuleFilesServiceImpl.java deleted file mode 100644 index c056dd51..00000000 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDbFiledsRuleFiles/service/impl/MdmModuleDbFiledsRuleFilesServiceImpl.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.hzya.frame.mdm.mdmModuleDbFiledsRuleFiles.service.impl; - -import com.hzya.frame.mdm.mdmModuleDbFiledsRuleFiles.entity.MdmModuleDbFiledsRuleFilesEntity; -import com.hzya.frame.mdm.mdmModuleDbFiledsRuleFiles.dao.IMdmModuleDbFiledsRuleFilesDao; -import com.hzya.frame.mdm.mdmModuleDbFiledsRuleFiles.service.IMdmModuleDbFiledsRuleFilesService; -import org.springframework.stereotype.Service; -import org.springframework.beans.factory.annotation.Autowired; - -import javax.annotation.Resource; - -import com.hzya.frame.basedao.service.impl.BaseService; - -/** - * 模版数据库字段规则档案表(MdmModuleDbFiledsRuleFiles)表服务实现类 - * - * @author makejava - * @since 2023-10-17 15:30:15 - */ -@Service(value = "mdmModuleDbFiledsRuleFilesService") -public class MdmModuleDbFiledsRuleFilesServiceImpl extends BaseService implements IMdmModuleDbFiledsRuleFilesService { - - private IMdmModuleDbFiledsRuleFilesDao mdmModuleDbFiledsRuleFilesDao; - - @Autowired - public void setMdmModuleDbFiledsRuleFilesDao(IMdmModuleDbFiledsRuleFilesDao dao) { - this.mdmModuleDbFiledsRuleFilesDao = dao; - this.dao = dao; - } -} 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 1bb97fe8..db9d3be5 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 2023-11-06 15:27:41 + * @since 2024-05-30 17:02:43 */ 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 e4070581..3b91fabb 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 2023-11-06 15:27:42 + * @since 2024-05-30 17:02:43 */ @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 d65a44eb..542d0b27 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,15 +1,12 @@ 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)实体类 * * @author makejava - * @since 2023-11-06 15:27:42 + * @since 2024-05-30 17:02:43 */ public class MdmModuleDistributeEntity extends BaseEntity { @@ -17,36 +14,17 @@ public class MdmModuleDistributeEntity extends BaseEntity { private String mdmId; /** 应用id */ private String appId; + /** 修改接口 */ + private String updateApi; /** 新增接口 */ private String addApi; /** 删除接口 */ private String deleteApi; - /** 新增使用类型 */ - private String addType; - /** 删除使用类型 */ - private String deleteType; - /** 新增插件 */ - private String addPlug; - /** 删除插件 */ - private String deletePlug; - private List addList; - private List deleteList; + /** 启用停用 0、停用1、启用 */ + private String enabledState; + /** 公司id */ + private String companyId; - public List getAddList() { - return addList; - } - - public void setAddList(List addList) { - this.addList = addList; - } - - public List getDeleteList() { - return deleteList; - } - - public void setDeleteList(List deleteList) { - this.deleteList = deleteList; - } public String getMdmId() { return mdmId; @@ -64,6 +42,14 @@ public class MdmModuleDistributeEntity extends BaseEntity { this.appId = appId; } + public String getUpdateApi() { + return updateApi; + } + + public void setUpdateApi(String updateApi) { + this.updateApi = updateApi; + } + public String getAddApi() { return addApi; } @@ -80,36 +66,20 @@ public class MdmModuleDistributeEntity extends BaseEntity { this.deleteApi = deleteApi; } - public String getAddType() { - return addType; + public String getEnabledState() { + return enabledState; } - public void setAddType(String addType) { - this.addType = addType; + public void setEnabledState(String enabledState) { + this.enabledState = enabledState; } - public String getDeleteType() { - return deleteType; + public String getCompanyId() { + return companyId; } - public void setDeleteType(String deleteType) { - this.deleteType = deleteType; - } - - public String getAddPlug() { - return addPlug; - } - - public void setAddPlug(String addPlug) { - this.addPlug = addPlug; - } - - public String getDeletePlug() { - return deletePlug; - } - - public void setDeletePlug(String deletePlug) { - this.deletePlug = deletePlug; + public void setCompanyId(String companyId) { + this.companyId = 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 24b315ff..2690bdf6 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,10 +6,10 @@ + - - + @@ -17,18 +17,17 @@ - - + id ,mdm_id ,app_id + ,update_api ,add_api ,delete_api - ,add_type - ,delete_type + ,enabled_state ,sorts ,create_user_id ,create_time @@ -36,8 +35,7 @@ ,modify_time ,sts ,org_id - ,add_plug - ,delete_plug + ,company_id - + insert into mdm_module_distribute( id , mdm_id , app_id , + update_api , add_api , delete_api , - add_type , - delete_type , + enabled_state , sorts , create_user_id , create_time , @@ -167,8 +161,8 @@ modify_time , sts , org_id , - add_plug , - delete_plug , + company_id , + sorts, sts, )values( @@ -176,10 +170,10 @@ #{id} , #{mdmId} , #{appId} , + #{updateApi} , #{addApi} , #{deleteApi} , - #{addType} , - #{deleteType} , + #{enabledState} , #{sorts} , #{create_user_id} , #{create_time} , @@ -187,62 +181,58 @@ #{modify_time} , #{sts} , #{org_id} , - #{addPlug} , - #{deletePlug} , + #{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, add_api, delete_api, add_type, delete_type, sorts, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, add_plug, delete_plug, sts) + + 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) values - (#{entity.mdmId},#{entity.appId},#{entity.addApi},#{entity.deleteApi},#{entity.addType},#{entity.deleteType},#{entity.sorts},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.addPlug},#{entity.deletePlug}, 'Y') + (#{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') - - insert into mdm_module_distribute(mdm_id, app_id, add_api, delete_api, add_type, delete_type, sorts, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, add_plug, delete_plug) + + 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) values - (#{entity.mdmId},#{entity.appId},#{entity.addApi},#{entity.deleteApi},#{entity.addType},#{entity.deleteType},#{entity.sorts},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.addPlug},#{entity.deletePlug}) + (#{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}) on duplicate key update mdm_id = values(mdm_id), app_id = values(app_id), + update_api = values(update_api), add_api = values(add_api), delete_api = values(delete_api), - add_type = values(add_type), - delete_type = values(delete_type), - sorts = values(sorts), + enabled_state = values(enabled_state), 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), - add_plug = values(add_plug), - delete_plug = values(delete_plug) + company_id = values(company_id) update mdm_module_distribute set mdm_id = #{mdmId}, app_id = #{appId}, + update_api = #{updateApi}, add_api = #{addApi}, delete_api = #{deleteApi}, - add_type = #{addType}, - delete_type = #{deleteType}, - sorts = #{sorts}, + enabled_state = #{enabledState}, 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}, - add_plug = #{addPlug}, - delete_plug = #{deletePlug}, + company_id = #{companyId}, where id = #{id} @@ -258,14 +248,13 @@ update mdm_module_distribute set sts= 'N' ,modify_time = #{modify_time},modify_ and id = #{id} and mdm_id = #{mdmId} and app_id = #{appId} + and update_api = #{updateApi} and add_api = #{addApi} and delete_api = #{deleteApi} - and add_type = #{addType} - and delete_type = #{deleteType} + and enabled_state = #{enabledState} and sorts = #{sorts} and sts = #{sts} - and add_plug = #{addPlug} - and delete_plug = #{deletePlug} + and company_id = #{companyId} and sts='Y' 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 474d58c9..e997c97c 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 2023-11-06 15:27:42 + * @since 2024-05-30 17:02:44 */ 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 0ccdb809..8479bf2c 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 2023-11-06 15:27:42 + * @since 2024-05-30 17:02:44 */ @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 deleted file mode 100644 index 90278a9f..00000000 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistributeDetail/dao/IMdmModuleDistributeDetailDao.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.hzya.frame.mdm.mdmModuleDistributeDetail.dao; - -import com.hzya.frame.mdm.mdmModuleDistributeDetail.entity.MdmModuleDistributeDetailEntity; -import com.hzya.frame.basedao.dao.IBaseDao; - -/** - * 主数据功能应用分发明细表(mdm_module_distribute_detail: table)表数据库访问层 - * - * @author makejava - * @since 2023-11-07 09:11:31 - */ -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 deleted file mode 100644 index daeb3dc5..00000000 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistributeDetail/dao/impl/MdmModuleDistributeDetailDaoImpl.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.hzya.frame.mdm.mdmModuleDistributeDetail.dao.impl; - -import com.hzya.frame.mdm.mdmModuleDistributeDetail.entity.MdmModuleDistributeDetailEntity; -import com.hzya.frame.mdm.mdmModuleDistributeDetail.dao.IMdmModuleDistributeDetailDao; -import org.springframework.stereotype.Repository; -import com.hzya.frame.basedao.dao.MybatisGenericDao; -/** - * 主数据功能应用分发明细表(MdmModuleDistributeDetail)表数据库访问层 - * - * @author makejava - * @since 2023-11-07 09:11:31 - */ -@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 deleted file mode 100644 index 89f45fe7..00000000 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistributeDetail/entity/MdmModuleDistributeDetailEntity.java +++ /dev/null @@ -1,144 +0,0 @@ -package com.hzya.frame.mdm.mdmModuleDistributeDetail.entity; - -import java.util.Date; -import com.hzya.frame.web.entity.BaseEntity; -/** - * 主数据功能应用分发明细表(MdmModuleDistributeDetail)实体类 - * - * @author makejava - * @since 2023-11-07 09:11:31 - */ -public class MdmModuleDistributeDetailEntity extends BaseEntity { - - /** 主数据模版ID */ - private String mdmId; - /** 应用分发id */ - private String distributeId; - /** 接口id */ - private String apiId; - /** 源API字段 */ - private String sourceField; - /** 源API字段名 */ - private String sourceName; - /** 目标API字段 */ - private String targetField; - /** 目标API字段名 */ - private String targetName; - /** 目标API字段默认值 */ - private String defaultVaule; - /** 源字段层级 */ - private String sourceFieldPath; - /** 目标字段层级 */ - private String targetFieldPath; - private String targetPath; - private String sourcePath; - /** 连线信息 */ - private String coordinate; - - - public String getMdmId() { - return mdmId; - } - - public void setMdmId(String mdmId) { - this.mdmId = mdmId; - } - - public String getDistributeId() { - return distributeId; - } - - public void setDistributeId(String distributeId) { - this.distributeId = distributeId; - } - - public String getApiId() { - return apiId; - } - - public void setApiId(String apiId) { - this.apiId = apiId; - } - - public String getSourceField() { - return sourceField; - } - - public void setSourceField(String sourceField) { - this.sourceField = sourceField; - } - - public String getSourceName() { - return sourceName; - } - - public void setSourceName(String sourceName) { - this.sourceName = sourceName; - } - - public String getTargetField() { - return targetField; - } - - public void setTargetField(String targetField) { - this.targetField = targetField; - } - - public String getTargetName() { - return targetName; - } - - public void setTargetName(String targetName) { - this.targetName = targetName; - } - - public String getDefaultVaule() { - return defaultVaule; - } - - public void setDefaultVaule(String defaultVaule) { - this.defaultVaule = defaultVaule; - } - - public String getSourceFieldPath() { - return sourceFieldPath; - } - - public void setSourceFieldPath(String sourceFieldPath) { - this.sourceFieldPath = sourceFieldPath; - } - - public String getTargetFieldPath() { - return targetFieldPath; - } - - public void setTargetFieldPath(String targetFieldPath) { - this.targetFieldPath = targetFieldPath; - } - - public String getTargetPath() { - return targetPath; - } - - public void setTargetPath(String targetPath) { - this.targetPath = targetPath; - } - - public String getSourcePath() { - return sourcePath; - } - - public void setSourcePath(String sourcePath) { - this.sourcePath = sourcePath; - } - - public String getCoordinate() { - return coordinate; - } - - public void setCoordinate(String coordinate) { - this.coordinate = coordinate; - } - -} - 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 deleted file mode 100644 index a3b4dfe7..00000000 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistributeDetail/entity/MdmModuleDistributeDetailEntity.xml +++ /dev/null @@ -1,333 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - id - ,mdm_id - ,distribute_id - ,api_id - ,source_field - ,source_name - ,target_field - ,target_name - ,default_vaule - ,source_field_path - ,target_field_path - ,target_path - ,source_path - ,sorts - ,create_user_id - ,create_time - ,modify_user_id - ,modify_time - ,sts - ,org_id - ,coordinate - - - - - - - - - - - - - - - - insert into mdm_module_distribute_detail( - - id , - mdm_id , - distribute_id , - api_id , - source_field , - source_name , - target_field , - target_name , - default_vaule , - source_field_path , - target_field_path , - target_path , - source_path , - sorts , - create_user_id , - create_time , - modify_user_id , - modify_time , - sts , - org_id , - coordinate , - sts, - - )values( - - #{id} , - #{mdmId} , - #{distributeId} , - #{apiId} , - #{sourceField} , - #{sourceName} , - #{targetField} , - #{targetName} , - #{defaultVaule} , - #{sourceFieldPath} , - #{targetFieldPath} , - #{targetPath} , - #{sourcePath} , - #{sorts} , - #{create_user_id} , - #{create_time} , - #{modify_user_id} , - #{modify_time} , - #{sts} , - #{org_id} , - #{coordinate} , - 'Y', - - ) - - - - insert into mdm_module_distribute_detail(mdm_id, distribute_id, api_id, source_field, source_name, target_field, target_name, default_vaule, source_field_path, target_field_path, target_path, source_path, sorts, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, coordinate, sts) - values - - (#{entity.mdmId},#{entity.distributeId},#{entity.apiId},#{entity.sourceField},#{entity.sourceName},#{entity.targetField},#{entity.targetName},#{entity.defaultVaule},#{entity.sourceFieldPath},#{entity.targetFieldPath},#{entity.targetPath},#{entity.sourcePath},#{entity.sorts},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.coordinate}, 'Y') - - - - - insert into mdm_module_distribute_detail(mdm_id, distribute_id, api_id, source_field, source_name, target_field, target_name, default_vaule, source_field_path, target_field_path, target_path, source_path, sorts, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, coordinate) - values - - (#{entity.mdmId},#{entity.distributeId},#{entity.apiId},#{entity.sourceField},#{entity.sourceName},#{entity.targetField},#{entity.targetName},#{entity.defaultVaule},#{entity.sourceFieldPath},#{entity.targetFieldPath},#{entity.targetPath},#{entity.sourcePath},#{entity.sorts},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.coordinate}) - - on duplicate key update - mdm_id = values(mdm_id), - distribute_id = values(distribute_id), - api_id = values(api_id), - source_field = values(source_field), - source_name = values(source_name), - target_field = values(target_field), - target_name = values(target_name), - default_vaule = values(default_vaule), - source_field_path = values(source_field_path), - target_field_path = values(target_field_path), - target_path = values(target_path), - source_path = values(source_path), - 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), - coordinate = values(coordinate) - - -update mdm_module_distribute_detail set - - mdm_id = #{mdmId}, - distribute_id = #{distributeId}, - api_id = #{apiId}, - source_field = #{sourceField}, - source_name = #{sourceName}, - target_field = #{targetField}, - target_name = #{targetName}, - default_vaule = #{defaultVaule}, - source_field_path = #{sourceFieldPath}, - target_field_path = #{targetFieldPath}, - target_path = #{targetPath}, - source_path = #{sourcePath}, - 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}, - coordinate = #{coordinate}, - -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 source_field = #{sourceField} - and source_name = #{sourceName} - and target_field = #{targetField} - and target_name = #{targetName} - and default_vaule = #{defaultVaule} - and source_field_path = #{sourceFieldPath} - and target_field_path = #{targetFieldPath} - and target_path = #{targetPath} - and source_path = #{sourcePath} - and sorts = #{sorts} - and sts = #{sts} - and coordinate = #{coordinate} - and sts='Y' - - - - - delete from mdm_module_distribute_detail where id = #{id} - - - - 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 deleted file mode 100644 index 1239a232..00000000 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistributeDetail/service/IMdmModuleDistributeDetailService.java +++ /dev/null @@ -1,12 +0,0 @@ -package com.hzya.frame.mdm.mdmModuleDistributeDetail.service; - -import com.hzya.frame.mdm.mdmModuleDistributeDetail.entity.MdmModuleDistributeDetailEntity; -import com.hzya.frame.basedao.service.IBaseService; -/** - * 主数据功能应用分发明细表(MdmModuleDistributeDetail)表服务接口 - * - * @author makejava - * @since 2023-11-07 09:11:31 - */ -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 deleted file mode 100644 index 71aef349..00000000 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistributeDetail/service/impl/MdmModuleDistributeDetailServiceImpl.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.hzya.frame.mdm.mdmModuleDistributeDetail.service.impl; - -import com.hzya.frame.mdm.mdmModuleDistributeDetail.entity.MdmModuleDistributeDetailEntity; -import com.hzya.frame.mdm.mdmModuleDistributeDetail.dao.IMdmModuleDistributeDetailDao; -import com.hzya.frame.mdm.mdmModuleDistributeDetail.service.IMdmModuleDistributeDetailService; -import org.springframework.stereotype.Service; -import org.springframework.beans.factory.annotation.Autowired; -import javax.annotation.Resource; -import com.hzya.frame.basedao.service.impl.BaseService; -/** - * 主数据功能应用分发明细表(MdmModuleDistributeDetail)表服务实现类 - * - * @author makejava - * @since 2023-11-07 09:11:31 - */ -@Service(value = "mdmModuleDistributeDetailService") -public class MdmModuleDistributeDetailServiceImpl extends BaseService implements IMdmModuleDistributeDetailService { - - private IMdmModuleDistributeDetailDao mdmModuleDistributeDetailDao; - - @Autowired - public void setMdmModuleDistributeDetailDao(IMdmModuleDistributeDetailDao dao) { - this.mdmModuleDistributeDetailDao = dao; - this.dao = dao; - } -} diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleRole/dao/IMdmModuleRoleDao.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleRole/dao/IMdmModuleRoleDao.java deleted file mode 100644 index 405d975f..00000000 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleRole/dao/IMdmModuleRoleDao.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.hzya.frame.mdm.mdmModuleRole.dao; - -import com.hzya.frame.mdm.mdmModuleRole.entity.MdmModuleRoleEntity; -import com.hzya.frame.basedao.dao.IBaseDao; - -/** - * 主数据功能角色表(mdm_module_role: table)表数据库访问层 - * - * @author makejava - * @since 2023-10-17 15:32:25 - */ -public interface IMdmModuleRoleDao extends IBaseDao { - -} - diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleRole/dao/impl/MdmModuleRoleDaoImpl.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleRole/dao/impl/MdmModuleRoleDaoImpl.java deleted file mode 100644 index 7a5b8602..00000000 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleRole/dao/impl/MdmModuleRoleDaoImpl.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.hzya.frame.mdm.mdmModuleRole.dao.impl; - -import com.hzya.frame.mdm.mdmModuleRole.entity.MdmModuleRoleEntity; -import com.hzya.frame.mdm.mdmModuleRole.dao.IMdmModuleRoleDao; -import org.springframework.stereotype.Repository; -import com.hzya.frame.basedao.dao.MybatisGenericDao; - -/** - * 主数据功能角色表(MdmModuleRole)表数据库访问层 - * - * @author makejava - * @since 2023-10-17 15:32:25 - */ -@Repository(value = "MdmModuleRoleDaoImpl") -public class MdmModuleRoleDaoImpl extends MybatisGenericDao implements IMdmModuleRoleDao { - -} - diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleRole/entity/MdmModuleRoleEntity.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleRole/entity/MdmModuleRoleEntity.java deleted file mode 100644 index 992ed5e7..00000000 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleRole/entity/MdmModuleRoleEntity.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.hzya.frame.mdm.mdmModuleRole.entity; - -import java.util.Date; -import java.util.List; - -import com.hzya.frame.mdm.mdmModuleRoleButton.entity.MdmModuleRoleButtonEntity; -import com.hzya.frame.web.entity.BaseEntity; - -/** - * 主数据功能角色表(MdmModuleRole)实体类 - * - * @author makejava - * @since 2023-10-17 15:32:25 - */ -public class MdmModuleRoleEntity extends BaseEntity { - - /** - * 主数据模版ID - */ - private String mdmId; - /** - * 角色id - */ - private String roleId; - - //角色按钮 - private List mdmModuleRoleButtonEntities; - public String getMdmId() { - return mdmId; - } - - public void setMdmId(String mdmId) { - this.mdmId = mdmId; - } - - public String getRoleId() { - return roleId; - } - - public void setRoleId(String roleId) { - this.roleId = roleId; - } - - public List getMdmModuleRoleButtonEntities() { - return mdmModuleRoleButtonEntities; - } - - public void setMdmModuleRoleButtonEntities(List mdmModuleRoleButtonEntities) { - this.mdmModuleRoleButtonEntities = mdmModuleRoleButtonEntities; - } -} - diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleRole/entity/MdmModuleRoleEntity.xml b/service/src/main/java/com/hzya/frame/mdm/mdmModuleRole/entity/MdmModuleRoleEntity.xml deleted file mode 100644 index b0a78a5b..00000000 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleRole/entity/MdmModuleRoleEntity.xml +++ /dev/null @@ -1,227 +0,0 @@ - - - - - - - - - - - - - - - - - - - id - ,mdm_id - ,role_id - ,sorts - ,create_user_id - ,create_time - ,modify_user_id - ,modify_time - ,sts - ,org_id - - - - - - - - - - - - - - - - insert into mdm_module_role( - - id , - mdm_id , - role_id , - sorts , - create_user_id , - create_time , - modify_user_id , - modify_time , - sts , - org_id , - sts, - - )values( - - #{id} , - #{mdmId} , - #{roleId} , - #{sorts} , - #{create_user_id} , - #{create_time} , - #{modify_user_id} , - #{modify_time} , - #{sts} , - #{org_id} , - - 'Y', - - ) - - - - insert into mdm_module_role(mdm_id, role_id, sorts, create_user_id, create_time, modify_user_id, modify_time, - sts, org_id, sts) - values - - (#{entity.mdmId},#{entity.roleId},#{entity.sorts},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id}, - 'Y') - - - - - insert into mdm_module_role(mdm_id, role_id, sorts, create_user_id, create_time, modify_user_id, modify_time, - sts, org_id) - values - - (#{entity.mdmId},#{entity.roleId},#{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 - mdm_id = values(mdm_id), - role_id = values(role_id), - 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 mdm_module_role set - - mdm_id = #{mdmId}, - role_id = #{roleId}, - 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 mdm_module_role set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} -where id = #{id} - - - - update mdm_module_role set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} - - and id = #{id} - and mdm_id = #{mdmId} - and role_id = #{roleId} - and sorts = #{sorts} - and sts = #{sts} - and sts='Y' - - - - - delete from mdm_module_role where id = #{id} - - - - diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleRole/service/IMdmModuleRoleService.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleRole/service/IMdmModuleRoleService.java deleted file mode 100644 index dfca9fc8..00000000 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleRole/service/IMdmModuleRoleService.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.hzya.frame.mdm.mdmModuleRole.service; - -import com.hzya.frame.mdm.mdmModuleRole.entity.MdmModuleRoleEntity; -import com.hzya.frame.basedao.service.IBaseService; - -/** - * 主数据功能角色表(MdmModuleRole)表服务接口 - * - * @author makejava - * @since 2023-10-17 15:32:26 - */ -public interface IMdmModuleRoleService extends IBaseService { -} diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleRole/service/impl/MdmModuleRoleServiceImpl.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleRole/service/impl/MdmModuleRoleServiceImpl.java deleted file mode 100644 index da3d0b94..00000000 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleRole/service/impl/MdmModuleRoleServiceImpl.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.hzya.frame.mdm.mdmModuleRole.service.impl; - -import com.hzya.frame.mdm.mdmModuleRole.entity.MdmModuleRoleEntity; -import com.hzya.frame.mdm.mdmModuleRole.dao.IMdmModuleRoleDao; -import com.hzya.frame.mdm.mdmModuleRole.service.IMdmModuleRoleService; -import org.springframework.stereotype.Service; -import org.springframework.beans.factory.annotation.Autowired; - -import javax.annotation.Resource; - -import com.hzya.frame.basedao.service.impl.BaseService; - -/** - * 主数据功能角色表(MdmModuleRole)表服务实现类 - * - * @author makejava - * @since 2023-10-17 15:32:27 - */ -@Service(value = "mdmModuleRoleService") -public class MdmModuleRoleServiceImpl extends BaseService implements IMdmModuleRoleService { - - private IMdmModuleRoleDao mdmModuleRoleDao; - - @Autowired - public void setMdmModuleRoleDao(IMdmModuleRoleDao dao) { - this.mdmModuleRoleDao = dao; - this.dao = dao; - } -} diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleRoleButton/dao/IMdmModuleRoleButtonDao.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleRoleButton/dao/IMdmModuleRoleButtonDao.java deleted file mode 100644 index 37e5690a..00000000 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleRoleButton/dao/IMdmModuleRoleButtonDao.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.hzya.frame.mdm.mdmModuleRoleButton.dao; - -import com.hzya.frame.mdm.mdmModuleRoleButton.entity.MdmModuleRoleButtonEntity; -import com.hzya.frame.basedao.dao.IBaseDao; - -/** - * 主数据功能角色按钮表(mdm_module_role_button: table)表数据库访问层 - * - * @author makejava - * @since 2023-10-17 15:33:09 - */ -public interface IMdmModuleRoleButtonDao extends IBaseDao { - -} - diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleRoleButton/dao/impl/MdmModuleRoleButtonDaoImpl.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleRoleButton/dao/impl/MdmModuleRoleButtonDaoImpl.java deleted file mode 100644 index 322c53e4..00000000 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleRoleButton/dao/impl/MdmModuleRoleButtonDaoImpl.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.hzya.frame.mdm.mdmModuleRoleButton.dao.impl; - -import com.hzya.frame.mdm.mdmModuleRoleButton.entity.MdmModuleRoleButtonEntity; -import com.hzya.frame.mdm.mdmModuleRoleButton.dao.IMdmModuleRoleButtonDao; -import org.springframework.stereotype.Repository; -import com.hzya.frame.basedao.dao.MybatisGenericDao; - -/** - * 主数据功能角色按钮表(MdmModuleRoleButton)表数据库访问层 - * - * @author makejava - * @since 2023-10-17 15:33:10 - */ -@Repository(value = "MdmModuleRoleButtonDaoImpl") -public class MdmModuleRoleButtonDaoImpl extends MybatisGenericDao implements IMdmModuleRoleButtonDao { - -} - diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleRoleButton/entity/MdmModuleRoleButtonEntity.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleRoleButton/entity/MdmModuleRoleButtonEntity.java deleted file mode 100644 index fa71faf2..00000000 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleRoleButton/entity/MdmModuleRoleButtonEntity.java +++ /dev/null @@ -1,92 +0,0 @@ -package com.hzya.frame.mdm.mdmModuleRoleButton.entity; - -import java.util.Date; -import java.util.List; - -import com.hzya.frame.sys.userRole.entity.UserRole; -import com.hzya.frame.web.entity.BaseEntity; - -/** - * 主数据功能角色按钮表(MdmModuleRoleButton)实体类 - * - * @author makejava - * @since 2023-10-17 15:33:10 - */ -public class MdmModuleRoleButtonEntity extends BaseEntity { - - /** - * 主数据模版ID - */ - private String mdmId; - /** - * 模块角色id - */ - private String moduleRoleId; - /** - * 角色id - */ - private String roleId; - /** - * 按钮类型 - */ - private String buttonType; - /** - * 按钮名 - */ - private String buttonName; - - /** - * 角色ids - */ - private List roleIds; - - public List getRoleIds() { - return roleIds; - } - - public void setRoleIds(List roleIds) { - this.roleIds = roleIds; - } - - public String getMdmId() { - return mdmId; - } - - public void setMdmId(String mdmId) { - this.mdmId = mdmId; - } - - public String getModuleRoleId() { - return moduleRoleId; - } - - public void setModuleRoleId(String moduleRoleId) { - this.moduleRoleId = moduleRoleId; - } - - public String getRoleId() { - return roleId; - } - - public void setRoleId(String roleId) { - this.roleId = roleId; - } - - public String getButtonType() { - return buttonType; - } - - public void setButtonType(String buttonType) { - this.buttonType = buttonType; - } - - public String getButtonName() { - return buttonName; - } - - public void setButtonName(String buttonName) { - this.buttonName = buttonName; - } - -} - diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleRoleButton/entity/MdmModuleRoleButtonEntity.xml b/service/src/main/java/com/hzya/frame/mdm/mdmModuleRoleButton/entity/MdmModuleRoleButtonEntity.xml deleted file mode 100644 index 44ed53a7..00000000 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleRoleButton/entity/MdmModuleRoleButtonEntity.xml +++ /dev/null @@ -1,271 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - id - ,mdm_id - ,module_role_id - ,role_id - ,button_type - ,button_name - ,sorts - ,create_user_id - ,create_time - ,modify_user_id - ,modify_time - ,sts - ,org_id - - - - - - - - - - - - - - - - insert into mdm_module_role_button( - - id , - mdm_id , - module_role_id , - role_id , - button_type , - button_name , - sorts , - create_user_id , - create_time , - modify_user_id , - modify_time , - sts , - org_id , - sts, - - )values( - - #{id} , - #{mdmId} , - #{moduleRoleId} , - #{roleId} , - #{buttonType} , - #{buttonName} , - #{sorts} , - #{create_user_id} , - #{create_time} , - #{modify_user_id} , - #{modify_time} , - #{sts} , - #{org_id} , - - 'Y', - - ) - - - - insert into mdm_module_role_button(mdm_id, module_role_id, role_id, button_type, button_name, sorts, - create_user_id, create_time, modify_user_id, modify_time, sts, org_id, sts) - values - - (#{entity.mdmId},#{entity.moduleRoleId},#{entity.roleId},#{entity.buttonType},#{entity.buttonName},#{entity.sorts},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id}, - 'Y') - - - - - insert into mdm_module_role_button(mdm_id, module_role_id, role_id, button_type, button_name, sorts, - create_user_id, create_time, modify_user_id, modify_time, sts, org_id) - values - - (#{entity.mdmId},#{entity.moduleRoleId},#{entity.roleId},#{entity.buttonType},#{entity.buttonName},#{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 - mdm_id = values(mdm_id), - module_role_id = values(module_role_id), - role_id = values(role_id), - button_type = values(button_type), - button_name = values(button_name), - 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 mdm_module_role_button set - - mdm_id = #{mdmId}, - module_role_id = #{moduleRoleId}, - role_id = #{roleId}, - button_type = #{buttonType}, - button_name = #{buttonName}, - 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 mdm_module_role_button set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} -where id = #{id} - - - - update mdm_module_role_button set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} - - and id = #{id} - and mdm_id = #{mdmId} - and module_role_id = #{moduleRoleId} - and role_id = #{roleId} - and button_type = #{buttonType} - and button_name = #{buttonName} - and sorts = #{sorts} - and sts = #{sts} - and sts='Y' - - - - - delete from mdm_module_role_button where id = #{id} - - - - diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleRoleButton/service/IMdmModuleRoleButtonService.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleRoleButton/service/IMdmModuleRoleButtonService.java deleted file mode 100644 index 3f956fd2..00000000 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleRoleButton/service/IMdmModuleRoleButtonService.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.hzya.frame.mdm.mdmModuleRoleButton.service; - -import com.hzya.frame.mdm.mdmModuleRoleButton.entity.MdmModuleRoleButtonEntity; -import com.hzya.frame.basedao.service.IBaseService; - -/** - * 主数据功能角色按钮表(MdmModuleRoleButton)表服务接口 - * - * @author makejava - * @since 2023-10-17 15:33:11 - */ -public interface IMdmModuleRoleButtonService extends IBaseService { -} diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleRoleButton/service/impl/MdmModuleRoleButtonServiceImpl.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleRoleButton/service/impl/MdmModuleRoleButtonServiceImpl.java deleted file mode 100644 index bc5bfc73..00000000 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleRoleButton/service/impl/MdmModuleRoleButtonServiceImpl.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.hzya.frame.mdm.mdmModuleRoleButton.service.impl; - -import com.hzya.frame.mdm.mdmModuleRoleButton.entity.MdmModuleRoleButtonEntity; -import com.hzya.frame.mdm.mdmModuleRoleButton.dao.IMdmModuleRoleButtonDao; -import com.hzya.frame.mdm.mdmModuleRoleButton.service.IMdmModuleRoleButtonService; -import org.springframework.stereotype.Service; -import org.springframework.beans.factory.annotation.Autowired; - -import javax.annotation.Resource; - -import com.hzya.frame.basedao.service.impl.BaseService; - -/** - * 主数据功能角色按钮表(MdmModuleRoleButton)表服务实现类 - * - * @author makejava - * @since 2023-10-17 15:33:12 - */ -@Service(value = "mdmModuleRoleButtonService") -public class MdmModuleRoleButtonServiceImpl extends BaseService implements IMdmModuleRoleButtonService { - - private IMdmModuleRoleButtonDao mdmModuleRoleButtonDao; - - @Autowired - public void setMdmModuleRoleButtonDao(IMdmModuleRoleButtonDao dao) { - this.mdmModuleRoleButtonDao = dao; - this.dao = dao; - } -} diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleUserView/dao/IMdmModuleUserViewDao.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleUserView/dao/IMdmModuleUserViewDao.java deleted file mode 100644 index 1e2f0494..00000000 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleUserView/dao/IMdmModuleUserViewDao.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.hzya.frame.mdm.mdmModuleUserView.dao; - -import com.hzya.frame.mdm.mdmModuleUserView.entity.MdmModuleUserViewEntity; -import com.hzya.frame.basedao.dao.IBaseDao; - -/** - * 主数据用户视图表(mdm_module_user_view: table)表数据库访问层 - * - * @author makejava - * @since 2023-10-17 15:33:47 - */ -public interface IMdmModuleUserViewDao extends IBaseDao { - -} - diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleUserView/dao/impl/MdmModuleUserViewDaoImpl.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleUserView/dao/impl/MdmModuleUserViewDaoImpl.java deleted file mode 100644 index 37970aee..00000000 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleUserView/dao/impl/MdmModuleUserViewDaoImpl.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.hzya.frame.mdm.mdmModuleUserView.dao.impl; - -import com.hzya.frame.mdm.mdmModuleUserView.entity.MdmModuleUserViewEntity; -import com.hzya.frame.mdm.mdmModuleUserView.dao.IMdmModuleUserViewDao; -import org.springframework.stereotype.Repository; -import com.hzya.frame.basedao.dao.MybatisGenericDao; - -/** - * 主数据用户视图表(MdmModuleUserView)表数据库访问层 - * - * @author makejava - * @since 2023-10-17 15:33:47 - */ -@Repository(value = "MdmModuleUserViewDaoImpl") -public class MdmModuleUserViewDaoImpl extends MybatisGenericDao implements IMdmModuleUserViewDao { - -} - diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleUserView/entity/MdmModuleUserViewEntity.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleUserView/entity/MdmModuleUserViewEntity.java deleted file mode 100644 index 7a1ef8e3..00000000 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleUserView/entity/MdmModuleUserViewEntity.java +++ /dev/null @@ -1,54 +0,0 @@ -package com.hzya.frame.mdm.mdmModuleUserView.entity; - -import java.util.Date; - -import com.hzya.frame.web.entity.BaseEntity; - -/** - * 主数据用户视图表(MdmModuleUserView)实体类 - * - * @author makejava - * @since 2023-10-17 15:33:48 - */ -public class MdmModuleUserViewEntity extends BaseEntity { - - /** - * 主数据模版ID - */ - private String mdmId; - /** - * 用户id - */ - private String userId; - /** - * 视图明细id - */ - private String viewDetailId; - - - public String getMdmId() { - return mdmId; - } - - public void setMdmId(String mdmId) { - this.mdmId = mdmId; - } - - public String getUserId() { - return userId; - } - - public void setUserId(String userId) { - this.userId = userId; - } - - public String getViewDetailId() { - return viewDetailId; - } - - public void setViewDetailId(String viewDetailId) { - this.viewDetailId = viewDetailId; - } - -} - diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleUserView/entity/MdmModuleUserViewEntity.xml b/service/src/main/java/com/hzya/frame/mdm/mdmModuleUserView/entity/MdmModuleUserViewEntity.xml deleted file mode 100644 index f99172ea..00000000 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleUserView/entity/MdmModuleUserViewEntity.xml +++ /dev/null @@ -1,241 +0,0 @@ - - - - - - - - - - - - - - - - - - - - id - ,mdm_id - ,user_id - ,view_detail_id - ,sorts - ,create_user_id - ,create_time - ,modify_user_id - ,modify_time - ,sts - ,org_id - - - - - - - - - - - - - - - - insert into mdm_module_user_view( - - id , - mdm_id , - user_id , - view_detail_id , - sorts , - create_user_id , - create_time , - modify_user_id , - modify_time , - sts , - org_id , - sts, - - )values( - - #{id} , - #{mdmId} , - #{userId} , - #{viewDetailId} , - #{sorts} , - #{create_user_id} , - #{create_time} , - #{modify_user_id} , - #{modify_time} , - #{sts} , - #{org_id} , - - 'Y', - - ) - - - - insert into mdm_module_user_view(mdm_id, user_id, view_detail_id, sorts, create_user_id, create_time, - modify_user_id, modify_time, sts, org_id, sts) - values - - (#{entity.mdmId},#{entity.userId},#{entity.viewDetailId},#{entity.sorts},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id}, - 'Y') - - - - - insert into mdm_module_user_view(mdm_id, user_id, view_detail_id, sorts, create_user_id, create_time, - modify_user_id, modify_time, sts, org_id) - values - - (#{entity.mdmId},#{entity.userId},#{entity.viewDetailId},#{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 - mdm_id = values(mdm_id), - user_id = values(user_id), - view_detail_id = values(view_detail_id), - 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 mdm_module_user_view set - - mdm_id = #{mdmId}, - user_id = #{userId}, - view_detail_id = #{viewDetailId}, - 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 mdm_module_user_view set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} -where id = #{id} - - - - update mdm_module_user_view set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} - - and id = #{id} - and mdm_id = #{mdmId} - and user_id = #{userId} - and view_detail_id = #{viewDetailId} - and sorts = #{sorts} - and sts = #{sts} - and sts='Y' - - - - - delete from mdm_module_user_view where id = #{id} - - - - diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleUserView/service/IMdmModuleUserViewService.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleUserView/service/IMdmModuleUserViewService.java deleted file mode 100644 index 05ee428b..00000000 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleUserView/service/IMdmModuleUserViewService.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.hzya.frame.mdm.mdmModuleUserView.service; - -import com.hzya.frame.mdm.mdmModuleUserView.entity.MdmModuleUserViewEntity; -import com.hzya.frame.basedao.service.IBaseService; - -/** - * 主数据用户视图表(MdmModuleUserView)表服务接口 - * - * @author makejava - * @since 2023-10-17 15:33:48 - */ -public interface IMdmModuleUserViewService extends IBaseService { -} diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleUserView/service/impl/MdmModuleUserViewServiceImpl.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleUserView/service/impl/MdmModuleUserViewServiceImpl.java deleted file mode 100644 index d3984f4b..00000000 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleUserView/service/impl/MdmModuleUserViewServiceImpl.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.hzya.frame.mdm.mdmModuleUserView.service.impl; - -import com.hzya.frame.mdm.mdmModuleUserView.entity.MdmModuleUserViewEntity; -import com.hzya.frame.mdm.mdmModuleUserView.dao.IMdmModuleUserViewDao; -import com.hzya.frame.mdm.mdmModuleUserView.service.IMdmModuleUserViewService; -import org.springframework.stereotype.Service; -import org.springframework.beans.factory.annotation.Autowired; - -import javax.annotation.Resource; - -import com.hzya.frame.basedao.service.impl.BaseService; - -/** - * 主数据用户视图表(MdmModuleUserView)表服务实现类 - * - * @author makejava - * @since 2023-10-17 15:33:49 - */ -@Service(value = "mdmModuleUserViewService") -public class MdmModuleUserViewServiceImpl extends BaseService implements IMdmModuleUserViewService { - - private IMdmModuleUserViewDao mdmModuleUserViewDao; - - @Autowired - public void setMdmModuleUserViewDao(IMdmModuleUserViewDao dao) { - this.mdmModuleUserViewDao = dao; - this.dao = dao; - } -} diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleView/dao/IMdmModuleViewDao.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleView/dao/IMdmModuleViewDao.java index b9bedcc9..3c4a63e6 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleView/dao/IMdmModuleViewDao.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleView/dao/IMdmModuleViewDao.java @@ -1,13 +1,13 @@ package com.hzya.frame.mdm.mdmModuleView.dao; import com.hzya.frame.mdm.mdmModuleView.entity.MdmModuleViewEntity; -import com.hzya.frame.basedao.dao.IBaseDao; +import com.hzya.frame.basedao.dao.IBaseDao; /** * 主数据视图表(mdm_module_view: table)表数据库访问层 * * @author makejava - * @since 2023-10-17 15:34:17 + * @since 2024-05-30 17:03:24 */ public interface IMdmModuleViewDao extends IBaseDao { diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleView/dao/impl/MdmModuleViewDaoImpl.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleView/dao/impl/MdmModuleViewDaoImpl.java index c9a5af9f..60b2e844 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleView/dao/impl/MdmModuleViewDaoImpl.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleView/dao/impl/MdmModuleViewDaoImpl.java @@ -4,15 +4,14 @@ import com.hzya.frame.mdm.mdmModuleView.entity.MdmModuleViewEntity; import com.hzya.frame.mdm.mdmModuleView.dao.IMdmModuleViewDao; import org.springframework.stereotype.Repository; import com.hzya.frame.basedao.dao.MybatisGenericDao; - /** * 主数据视图表(MdmModuleView)表数据库访问层 * * @author makejava - * @since 2023-10-17 15:34:17 + * @since 2024-05-30 17:03:24 */ @Repository(value = "MdmModuleViewDaoImpl") -public class MdmModuleViewDaoImpl extends MybatisGenericDao implements IMdmModuleViewDao { - +public class MdmModuleViewDaoImpl extends MybatisGenericDao implements IMdmModuleViewDao{ + } 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 83d451fd..94540106 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 @@ -1,33 +1,25 @@ package com.hzya.frame.mdm.mdmModuleView.entity; import java.util.Date; - import com.hzya.frame.web.entity.BaseEntity; - /** * 主数据视图表(MdmModuleView)实体类 * * @author makejava - * @since 2023-10-17 15:34:17 + * @since 2024-05-30 17:03:24 */ public class MdmModuleViewEntity extends BaseEntity { - - /** - * 主数据模版ID - */ - private String mdmId; - /** - * 显示类型 1、树 2、列表 - */ - private String viewName; - /** - * 显示字段 - */ - private String viewFiled; - /** - * 上级id字段 - */ - private String upIdFiled; + + /** 主数据模版ID */ + private String mdmId; + /** 显示类型 */ + private String viewName; + /** 显示字段 */ + private String viewFiled; + /** 上级id字段 */ + private String upIdFiled; + /** 公司id */ + private String companyId; public String getMdmId() { @@ -62,5 +54,13 @@ public class MdmModuleViewEntity extends BaseEntity { this.upIdFiled = upIdFiled; } + public String getCompanyId() { + return companyId; + } + + public void setCompanyId(String companyId) { + this.companyId = companyId; + } + } diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleView/entity/MdmModuleViewEntity.xml b/service/src/main/java/com/hzya/frame/mdm/mdmModuleView/entity/MdmModuleViewEntity.xml index 14def405..2e99cc32 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleView/entity/MdmModuleViewEntity.xml +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleView/entity/MdmModuleViewEntity.xml @@ -2,22 +2,23 @@ - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - + id ,mdm_id ,view_name @@ -30,218 +31,213 @@ ,modify_time ,sts ,org_id + ,company_id - - + select + + from mdm_module_view + + and id = #{id} + and mdm_id = #{mdmId} + and view_name = #{viewName} + and view_filed = #{viewFiled} + and up_id_filed = #{upIdFiled} + 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_view + + and id like concat('%',#{id},'%') + and mdm_id like concat('%',#{mdmId},'%') + and view_name like concat('%',#{viewName},'%') + and view_filed like concat('%',#{viewFiled},'%') + and up_id_filed like concat('%',#{upIdFiled},'%') + 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_view + + or id = #{id} + or mdm_id = #{mdmId} + or view_name = #{viewName} + or view_filed = #{viewFiled} + or up_id_filed = #{upIdFiled} + 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_view( - - id , - mdm_id , - view_name , - view_filed , - up_id_filed , - sorts , - create_user_id , - create_time , - modify_user_id , - modify_time , - sts , - org_id , - sts, - - )values( - - #{id} , - #{mdmId} , - #{viewName} , - #{viewFiled} , - #{upIdFiled} , - #{sorts} , - #{create_user_id} , - #{create_time} , - #{modify_user_id} , - #{modify_time} , - #{sts} , - #{org_id} , - - 'Y', - - ) - - - - insert into mdm_module_view(mdm_id, view_name, view_filed, up_id_filed, sorts, create_user_id, create_time, - modify_user_id, modify_time, sts, org_id, sts) - values - - (#{entity.mdmId},#{entity.viewName},#{entity.viewFiled},#{entity.upIdFiled},#{entity.sorts},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id}, - 'Y') - - - - - insert into mdm_module_view(mdm_id, view_name, view_filed, up_id_filed, sorts, create_user_id, create_time, - modify_user_id, modify_time, sts, org_id) - values - - (#{entity.mdmId},#{entity.viewName},#{entity.viewFiled},#{entity.upIdFiled},#{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 - mdm_id = values(mdm_id), - view_name = values(view_name), - view_filed = values(view_filed), - up_id_filed = values(up_id_filed), - 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 mdm_module_view set - - mdm_id = #{mdmId}, - view_name = #{viewName}, - view_filed = #{viewFiled}, - up_id_filed = #{upIdFiled}, - 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} - - - + + + insert into mdm_module_view( + + id , + mdm_id , + view_name , + view_filed , + up_id_filed , + sorts , + create_user_id , + create_time , + modify_user_id , + modify_time , + sts , + org_id , + company_id , + sorts, + sts, + + )values( + + #{id} , + #{mdmId} , + #{viewName} , + #{viewFiled} , + #{upIdFiled} , + #{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_view a WHERE a.sts = 'Y' ), + 'Y', + + ) + + + + insert into mdm_module_view(mdm_id, view_name, view_filed, up_id_filed, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, sts) + values + + (#{entity.mdmId},#{entity.viewName},#{entity.viewFiled},#{entity.upIdFiled},#{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_view(mdm_id, view_name, view_filed, up_id_filed, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id) + values + + (#{entity.mdmId},#{entity.viewName},#{entity.viewFiled},#{entity.upIdFiled},#{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), + view_name = values(view_name), + view_filed = values(view_filed), + up_id_filed = values(up_id_filed), + 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_view set + + mdm_id = #{mdmId}, + view_name = #{viewName}, + view_filed = #{viewFiled}, + up_id_filed = #{upIdFiled}, + 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_view set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} where id = #{id} - - - update mdm_module_view set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} - - and id = #{id} - and mdm_id = #{mdmId} - and view_name = #{viewName} - and view_filed = #{viewFiled} - and up_id_filed = #{upIdFiled} - and sorts = #{sorts} - and sts = #{sts} + + +update mdm_module_view set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} + + and id = #{id} + and mdm_id = #{mdmId} + and view_name = #{viewName} + and view_filed = #{viewFiled} + and up_id_filed = #{upIdFiled} + and sorts = #{sorts} + and sts = #{sts} + and company_id = #{companyId} and sts='Y' - - - - + + + + delete from mdm_module_view where id = #{id} diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleView/service/IMdmModuleViewService.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleView/service/IMdmModuleViewService.java index ffcd3338..e389eae0 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleView/service/IMdmModuleViewService.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleView/service/IMdmModuleViewService.java @@ -2,12 +2,11 @@ package com.hzya.frame.mdm.mdmModuleView.service; import com.hzya.frame.mdm.mdmModuleView.entity.MdmModuleViewEntity; import com.hzya.frame.basedao.service.IBaseService; - /** * 主数据视图表(MdmModuleView)表服务接口 * * @author makejava - * @since 2023-10-17 15:34:18 + * @since 2024-05-30 17:03:24 */ -public interface IMdmModuleViewService extends IBaseService { +public interface IMdmModuleViewService extends IBaseService{ } diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleView/service/impl/MdmModuleViewServiceImpl.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleView/service/impl/MdmModuleViewServiceImpl.java index 7029f030..ec23ecc4 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleView/service/impl/MdmModuleViewServiceImpl.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleView/service/impl/MdmModuleViewServiceImpl.java @@ -3,27 +3,24 @@ package com.hzya.frame.mdm.mdmModuleView.service.impl; import com.hzya.frame.mdm.mdmModuleView.entity.MdmModuleViewEntity; import com.hzya.frame.mdm.mdmModuleView.dao.IMdmModuleViewDao; import com.hzya.frame.mdm.mdmModuleView.service.IMdmModuleViewService; -import org.springframework.stereotype.Service; +import org.springframework.stereotype.Service; import org.springframework.beans.factory.annotation.Autowired; - import javax.annotation.Resource; - import com.hzya.frame.basedao.service.impl.BaseService; - /** * 主数据视图表(MdmModuleView)表服务实现类 * * @author makejava - * @since 2023-10-17 15:34:19 + * @since 2024-05-30 17:03:24 */ @Service(value = "mdmModuleViewService") public class MdmModuleViewServiceImpl extends BaseService implements IMdmModuleViewService { - + private IMdmModuleViewDao mdmModuleViewDao; - + @Autowired - public void setMdmModuleViewDao(IMdmModuleViewDao dao) { - this.mdmModuleViewDao = dao; - this.dao = dao; - } + public void setMdmModuleViewDao(IMdmModuleViewDao dao) { + this.mdmModuleViewDao = dao; + this.dao = dao; + } } diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleViewButton/dao/IMdmModuleViewButtonDao.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleViewButton/dao/IMdmModuleViewButtonDao.java new file mode 100644 index 00000000..48d7c1d2 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleViewButton/dao/IMdmModuleViewButtonDao.java @@ -0,0 +1,15 @@ +package com.hzya.frame.mdm.mdmModuleViewButton.dao; + +import com.hzya.frame.mdm.mdmModuleViewButton.entity.MdmModuleViewButtonEntity; +import com.hzya.frame.basedao.dao.IBaseDao; + +/** + * 主数据视图按钮表(mdm_module_view_button: table)表数据库访问层 + * + * @author makejava + * @since 2024-05-30 17:05:15 + */ +public interface IMdmModuleViewButtonDao extends IBaseDao { + +} + diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleViewButton/dao/impl/MdmModuleViewButtonDaoImpl.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleViewButton/dao/impl/MdmModuleViewButtonDaoImpl.java new file mode 100644 index 00000000..de0814cd --- /dev/null +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleViewButton/dao/impl/MdmModuleViewButtonDaoImpl.java @@ -0,0 +1,17 @@ +package com.hzya.frame.mdm.mdmModuleViewButton.dao.impl; + +import com.hzya.frame.mdm.mdmModuleViewButton.entity.MdmModuleViewButtonEntity; +import com.hzya.frame.mdm.mdmModuleViewButton.dao.IMdmModuleViewButtonDao; +import org.springframework.stereotype.Repository; +import com.hzya.frame.basedao.dao.MybatisGenericDao; +/** + * 主数据视图按钮表(MdmModuleViewButton)表数据库访问层 + * + * @author makejava + * @since 2024-05-30 17:05:15 + */ +@Repository(value = "MdmModuleViewButtonDaoImpl") +public class MdmModuleViewButtonDaoImpl extends MybatisGenericDao implements IMdmModuleViewButtonDao{ + +} + 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 new file mode 100644 index 00000000..2cbfd6b1 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleViewButton/entity/MdmModuleViewButtonEntity.java @@ -0,0 +1,66 @@ +package com.hzya.frame.mdm.mdmModuleViewButton.entity; + +import java.util.Date; +import com.hzya.frame.web.entity.BaseEntity; +/** + * 主数据视图按钮表(MdmModuleViewButton)实体类 + * + * @author makejava + * @since 2024-05-30 17:05:15 + */ +public class MdmModuleViewButtonEntity extends BaseEntity { + + /** 主数据模版ID */ + private String mdmId; + /** 视图id */ + private String viewId; + /** 类型1、新建2、重置3、查询4、修改 5、删除 6、查看 */ + private String buttonType; + /** 按钮值 */ + private String buttonValue; + /** 公司id */ + private String companyId; + + + public String getMdmId() { + return mdmId; + } + + public void setMdmId(String mdmId) { + this.mdmId = mdmId; + } + + public String getViewId() { + return viewId; + } + + public void setViewId(String viewId) { + this.viewId = viewId; + } + + public String getButtonType() { + return buttonType; + } + + public void setButtonType(String buttonType) { + this.buttonType = buttonType; + } + + public String getButtonValue() { + return buttonValue; + } + + public void setButtonValue(String buttonValue) { + this.buttonValue = buttonValue; + } + + public String getCompanyId() { + return companyId; + } + + public void setCompanyId(String companyId) { + this.companyId = companyId; + } + +} + diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmTableCodeRule/entity/MdmTableCodeRuleEntity.xml b/service/src/main/java/com/hzya/frame/mdm/mdmModuleViewButton/entity/MdmModuleViewButtonEntity.xml similarity index 58% rename from service/src/main/java/com/hzya/frame/mdm/mdmTableCodeRule/entity/MdmTableCodeRuleEntity.xml rename to service/src/main/java/com/hzya/frame/mdm/mdmModuleViewButton/entity/MdmModuleViewButtonEntity.xml index 38427b56..05cf8351 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmTableCodeRule/entity/MdmTableCodeRuleEntity.xml +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleViewButton/entity/MdmModuleViewButtonEntity.xml @@ -1,14 +1,13 @@ - + - + - - - - + + + @@ -16,16 +15,15 @@ - + - + id ,mdm_id - ,db_id - ,db_name - ,db_type - ,remark + ,view_id + ,button_type + ,button_value ,sorts ,create_user_id ,create_time @@ -33,20 +31,19 @@ ,modify_time ,sts ,org_id - ,db_value + ,company_id - select - - from mdm_table_code_rule + + from mdm_module_view_button and id = #{id} and mdm_id = #{mdmId} - and db_id = #{dbId} - and db_name = #{dbName} - and db_type = #{dbType} - and remark = #{remark} + and view_id = #{viewId} + and button_type = #{buttonType} + and button_value = #{buttonValue} and sorts = #{sorts} and create_user_id = #{create_user_id} and create_time = #{create_time} @@ -54,7 +51,7 @@ and modify_time = #{modify_time} and sts = #{sts} and org_id = #{org_id} - and db_value = #{dbValue} + and company_id = #{companyId} and sts='Y' order by sorts asc @@ -62,15 +59,14 @@ - + select count(1) from mdm_module_view_button and id = #{id} and mdm_id = #{mdmId} - and db_id = #{dbId} - and db_name = #{dbName} - and db_type = #{dbType} - and remark = #{remark} + and view_id = #{viewId} + and button_type = #{buttonType} + and button_value = #{buttonValue} and sorts = #{sorts} and create_user_id = #{create_user_id} and create_time = #{create_time} @@ -78,7 +74,7 @@ and modify_time = #{modify_time} and sts = #{sts} and org_id = #{org_id} - and db_value = #{dbValue} + and company_id = #{companyId} and sts='Y' order by sorts asc @@ -86,17 +82,16 @@ - select - - from mdm_table_code_rule + + from mdm_module_view_button and id like concat('%',#{id},'%') and mdm_id like concat('%',#{mdmId},'%') - and db_id like concat('%',#{dbId},'%') - and db_name like concat('%',#{dbName},'%') - and db_type like concat('%',#{dbType},'%') - and remark like concat('%',#{remark},'%') + and view_id like concat('%',#{viewId},'%') + and button_type like concat('%',#{buttonType},'%') + and button_value like concat('%',#{buttonValue},'%') and sorts like concat('%',#{sorts},'%') and create_user_id like concat('%',#{create_user_id},'%') and create_time like concat('%',#{create_time},'%') @@ -104,7 +99,7 @@ and modify_time like concat('%',#{modify_time},'%') and sts like concat('%',#{sts},'%') and org_id like concat('%',#{org_id},'%') - and db_value like concat('%',#{dbValue},'%') + and company_id like concat('%',#{companyId},'%') and sts='Y' order by sorts asc @@ -112,17 +107,16 @@ - select - - from mdm_table_code_rule + + from mdm_module_view_button or id = #{id} or mdm_id = #{mdmId} - or db_id = #{dbId} - or db_name = #{dbName} - or db_type = #{dbType} - or remark = #{remark} + or view_id = #{viewId} + or button_type = #{buttonType} + or button_value = #{buttonValue} or sorts = #{sorts} or create_user_id = #{create_user_id} or create_time = #{create_time} @@ -130,7 +124,7 @@ or modify_time = #{modify_time} or sts = #{sts} or org_id = #{org_id} - or db_value = #{dbValue} + or company_id = #{companyId} and sts='Y' order by sorts asc @@ -138,15 +132,14 @@ - - insert into mdm_table_code_rule( + + insert into mdm_module_view_button( id , mdm_id , - db_id , - db_name , - db_type , - remark , + view_id , + button_type , + button_value , sorts , create_user_id , create_time , @@ -154,17 +147,17 @@ modify_time , sts , org_id , - db_value , + company_id , + sorts, sts, )values( #{id} , #{mdmId} , - #{dbId} , - #{dbName} , - #{dbType} , - #{remark} , + #{viewId} , + #{buttonType} , + #{buttonValue} , #{sorts} , #{create_user_id} , #{create_time} , @@ -172,84 +165,80 @@ #{modify_time} , #{sts} , #{org_id} , - #{dbValue} , + #{companyId} , + (select (max(IFNULL( a.sorts, 0 )) + 1) as sort from mdm_module_view_button a WHERE a.sts = 'Y' ), 'Y', ) - - insert into mdm_table_code_rule(mdm_id, db_id, db_name, db_type, remark, sorts, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, db_value, sts) + + insert into mdm_module_view_button(mdm_id, view_id, button_type, button_value, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, sts) values - (#{entity.mdmId},#{entity.dbId},#{entity.dbName},#{entity.dbType},#{entity.remark},#{entity.sorts},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.dbValue}, 'Y') + (#{entity.mdmId},#{entity.viewId},#{entity.buttonType},#{entity.buttonValue},#{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_table_code_rule(mdm_id, db_id, db_name, db_type, remark, sorts, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, db_value) + + insert into mdm_module_view_button(mdm_id, view_id, button_type, button_value, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id) values - (#{entity.mdmId},#{entity.dbId},#{entity.dbName},#{entity.dbType},#{entity.remark},#{entity.sorts},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.dbValue}) + (#{entity.mdmId},#{entity.viewId},#{entity.buttonType},#{entity.buttonValue},#{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_id = values(db_id), - db_name = values(db_name), - db_type = values(db_type), - remark = values(remark), - sorts = values(sorts), + view_id = values(view_id), + button_type = values(button_type), + button_value = values(button_value), 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), - db_value = values(db_value) + company_id = values(company_id) - -update mdm_table_code_rule set + +update mdm_module_view_button set mdm_id = #{mdmId}, - db_id = #{dbId}, - db_name = #{dbName}, - db_type = #{dbType}, - remark = #{remark}, - sorts = #{sorts}, + view_id = #{viewId}, + button_type = #{buttonType}, + button_value = #{buttonValue}, 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}, - db_value = #{dbValue}, + company_id = #{companyId}, where id = #{id} - -update mdm_table_code_rule set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} + +update mdm_module_view_button set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} where id = #{id} - -update mdm_table_code_rule set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} + +update mdm_module_view_button set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} and id = #{id} and mdm_id = #{mdmId} - and db_id = #{dbId} - and db_name = #{dbName} - and db_type = #{dbType} - and remark = #{remark} + and view_id = #{viewId} + and button_type = #{buttonType} + and button_value = #{buttonValue} and sorts = #{sorts} and sts = #{sts} - and db_value = #{dbValue} + and company_id = #{companyId} and sts='Y' - delete from mdm_table_code_rule where id = #{id} + delete from mdm_module_view_button where id = #{id} diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleViewButton/service/IMdmModuleViewButtonService.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleViewButton/service/IMdmModuleViewButtonService.java new file mode 100644 index 00000000..edea1981 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleViewButton/service/IMdmModuleViewButtonService.java @@ -0,0 +1,12 @@ +package com.hzya.frame.mdm.mdmModuleViewButton.service; + +import com.hzya.frame.mdm.mdmModuleViewButton.entity.MdmModuleViewButtonEntity; +import com.hzya.frame.basedao.service.IBaseService; +/** + * 主数据视图按钮表(MdmModuleViewButton)表服务接口 + * + * @author makejava + * @since 2024-05-30 17:05:15 + */ +public interface IMdmModuleViewButtonService extends IBaseService{ +} diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleViewButton/service/impl/MdmModuleViewButtonServiceImpl.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleViewButton/service/impl/MdmModuleViewButtonServiceImpl.java new file mode 100644 index 00000000..053d5c82 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleViewButton/service/impl/MdmModuleViewButtonServiceImpl.java @@ -0,0 +1,26 @@ +package com.hzya.frame.mdm.mdmModuleViewButton.service.impl; + +import com.hzya.frame.mdm.mdmModuleViewButton.entity.MdmModuleViewButtonEntity; +import com.hzya.frame.mdm.mdmModuleViewButton.dao.IMdmModuleViewButtonDao; +import com.hzya.frame.mdm.mdmModuleViewButton.service.IMdmModuleViewButtonService; +import org.springframework.stereotype.Service; +import org.springframework.beans.factory.annotation.Autowired; +import javax.annotation.Resource; +import com.hzya.frame.basedao.service.impl.BaseService; +/** + * 主数据视图按钮表(MdmModuleViewButton)表服务实现类 + * + * @author makejava + * @since 2024-05-30 17:05:15 + */ +@Service(value = "mdmModuleViewButtonService") +public class MdmModuleViewButtonServiceImpl extends BaseService implements IMdmModuleViewButtonService { + + private IMdmModuleViewButtonDao mdmModuleViewButtonDao; + + @Autowired + public void setMdmModuleViewButtonDao(IMdmModuleViewButtonDao dao) { + this.mdmModuleViewButtonDao = dao; + this.dao = dao; + } +} diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleViewDetail/dao/IMdmModuleViewDetailDao.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleViewDetail/dao/IMdmModuleViewDetailDao.java index c5623fb1..91379efb 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleViewDetail/dao/IMdmModuleViewDetailDao.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleViewDetail/dao/IMdmModuleViewDetailDao.java @@ -1,13 +1,13 @@ package com.hzya.frame.mdm.mdmModuleViewDetail.dao; import com.hzya.frame.mdm.mdmModuleViewDetail.entity.MdmModuleViewDetailEntity; -import com.hzya.frame.basedao.dao.IBaseDao; +import com.hzya.frame.basedao.dao.IBaseDao; /** * 主数据视图明细表(mdm_module_view_detail: table)表数据库访问层 * * @author makejava - * @since 2023-10-17 15:34:58 + * @since 2024-05-30 17:04:17 */ public interface IMdmModuleViewDetailDao extends IBaseDao { diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleViewDetail/dao/impl/MdmModuleViewDetailDaoImpl.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleViewDetail/dao/impl/MdmModuleViewDetailDaoImpl.java index 4dd7e229..25f67fce 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleViewDetail/dao/impl/MdmModuleViewDetailDaoImpl.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleViewDetail/dao/impl/MdmModuleViewDetailDaoImpl.java @@ -4,15 +4,14 @@ import com.hzya.frame.mdm.mdmModuleViewDetail.entity.MdmModuleViewDetailEntity; import com.hzya.frame.mdm.mdmModuleViewDetail.dao.IMdmModuleViewDetailDao; import org.springframework.stereotype.Repository; import com.hzya.frame.basedao.dao.MybatisGenericDao; - /** * 主数据视图明细表(MdmModuleViewDetail)表数据库访问层 * * @author makejava - * @since 2023-10-17 15:34:58 + * @since 2024-05-30 17:04:17 */ @Repository(value = "MdmModuleViewDetailDaoImpl") -public class MdmModuleViewDetailDaoImpl extends MybatisGenericDao implements IMdmModuleViewDetailDao { - +public class MdmModuleViewDetailDaoImpl extends MybatisGenericDao implements IMdmModuleViewDetailDao{ + } 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 c9151239..7d481354 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 @@ -1,33 +1,25 @@ package com.hzya.frame.mdm.mdmModuleViewDetail.entity; import java.util.Date; - import com.hzya.frame.web.entity.BaseEntity; - /** * 主数据视图明细表(MdmModuleViewDetail)实体类 * * @author makejava - * @since 2023-10-17 15:34:59 + * @since 2024-05-30 17:04:17 */ public class MdmModuleViewDetailEntity extends BaseEntity { - - /** - * 主数据模版ID - */ - private String mdmId; - /** - * 视图id - */ - private String viewId; - /** - * 字段 id - */ - private String viewFiled; - /** - * 类型1、查询2、列表3、新增4、修改 5、查看 - */ - private String viewType; + + /** 主数据模版ID */ + private String mdmId; + /** 视图id */ + private String viewId; + /** 字段 */ + private String viewFiled; + /** 类型1、查询2、列表3、新增4、修改 5、查看 */ + private String viewType; + /** 公司id */ + private String companyId; public String getMdmId() { @@ -62,5 +54,13 @@ public class MdmModuleViewDetailEntity extends BaseEntity { this.viewType = viewType; } + public String getCompanyId() { + return companyId; + } + + public void setCompanyId(String companyId) { + this.companyId = companyId; + } + } diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleViewDetail/entity/MdmModuleViewDetailEntity.xml b/service/src/main/java/com/hzya/frame/mdm/mdmModuleViewDetail/entity/MdmModuleViewDetailEntity.xml index 2a612e07..c995e929 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleViewDetail/entity/MdmModuleViewDetailEntity.xml +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleViewDetail/entity/MdmModuleViewDetailEntity.xml @@ -2,23 +2,23 @@ - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - + id ,mdm_id ,view_id @@ -31,219 +31,213 @@ ,modify_time ,sts ,org_id + ,company_id - - + select + + from mdm_module_view_detail + + and id = #{id} + and mdm_id = #{mdmId} + and view_id = #{viewId} + and view_filed = #{viewFiled} + and view_type = #{viewType} + 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_view_detail + + and id like concat('%',#{id},'%') + and mdm_id like concat('%',#{mdmId},'%') + and view_id like concat('%',#{viewId},'%') + and view_filed like concat('%',#{viewFiled},'%') + and view_type like concat('%',#{viewType},'%') + 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_view_detail + + or id = #{id} + or mdm_id = #{mdmId} + or view_id = #{viewId} + or view_filed = #{viewFiled} + or view_type = #{viewType} + 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_view_detail( - - id , - mdm_id , - view_id , - view_filed , - view_type , - sorts , - create_user_id , - create_time , - modify_user_id , - modify_time , - sts , - org_id , - sts, - - )values( - - #{id} , - #{mdmId} , - #{viewId} , - #{viewFiled} , - #{viewType} , - #{sorts} , - #{create_user_id} , - #{create_time} , - #{modify_user_id} , - #{modify_time} , - #{sts} , - #{org_id} , - - 'Y', - - ) - - - - insert into mdm_module_view_detail(mdm_id, view_id, view_filed, view_type, sorts, create_user_id, create_time, - modify_user_id, modify_time, sts, org_id, sts) - values - - (#{entity.mdmId},#{entity.viewId},#{entity.viewFiled},#{entity.viewType},#{entity.sorts},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id}, - 'Y') - - - - - insert into mdm_module_view_detail(mdm_id, view_id, view_filed, view_type, sorts, create_user_id, create_time, - modify_user_id, modify_time, sts, org_id) - values - - (#{entity.mdmId},#{entity.viewId},#{entity.viewFiled},#{entity.viewType},#{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 - mdm_id = values(mdm_id), - view_id = values(view_id), - view_filed = values(view_filed), - view_type = values(view_type), - 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 mdm_module_view_detail set - - mdm_id = #{mdmId}, - view_id = #{viewId}, - view_filed = #{viewFiled}, - view_type = #{viewType}, - 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} - - - + + + insert into mdm_module_view_detail( + + id , + mdm_id , + view_id , + view_filed , + view_type , + sorts , + create_user_id , + create_time , + modify_user_id , + modify_time , + sts , + org_id , + company_id , + sorts, + sts, + + )values( + + #{id} , + #{mdmId} , + #{viewId} , + #{viewFiled} , + #{viewType} , + #{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_view_detail a WHERE a.sts = 'Y' ), + 'Y', + + ) + + + + insert into mdm_module_view_detail(mdm_id, view_id, view_filed, view_type, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, sts) + values + + (#{entity.mdmId},#{entity.viewId},#{entity.viewFiled},#{entity.viewType},#{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_view_detail(mdm_id, view_id, view_filed, view_type, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id) + values + + (#{entity.mdmId},#{entity.viewId},#{entity.viewFiled},#{entity.viewType},#{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), + view_id = values(view_id), + view_filed = values(view_filed), + view_type = values(view_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 mdm_module_view_detail set + + mdm_id = #{mdmId}, + view_id = #{viewId}, + view_filed = #{viewFiled}, + view_type = #{viewType}, + 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_view_detail set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} where id = #{id} - - - update mdm_module_view_detail set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} - - and id = #{id} - and mdm_id = #{mdmId} - and view_id = #{viewId} - and view_filed = #{viewFiled} - and view_type = #{viewType} - and sorts = #{sorts} - and sts = #{sts} + + +update mdm_module_view_detail set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} + + and id = #{id} + and mdm_id = #{mdmId} + and view_id = #{viewId} + and view_filed = #{viewFiled} + and view_type = #{viewType} + and sorts = #{sorts} + and sts = #{sts} + and company_id = #{companyId} and sts='Y' - - - - + + + + delete from mdm_module_view_detail where id = #{id} diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleViewDetail/service/IMdmModuleViewDetailService.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleViewDetail/service/IMdmModuleViewDetailService.java index cf055f0a..724604c9 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleViewDetail/service/IMdmModuleViewDetailService.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleViewDetail/service/IMdmModuleViewDetailService.java @@ -2,12 +2,11 @@ package com.hzya.frame.mdm.mdmModuleViewDetail.service; import com.hzya.frame.mdm.mdmModuleViewDetail.entity.MdmModuleViewDetailEntity; import com.hzya.frame.basedao.service.IBaseService; - /** * 主数据视图明细表(MdmModuleViewDetail)表服务接口 * * @author makejava - * @since 2023-10-17 15:35:00 + * @since 2024-05-30 17:04:17 */ -public interface IMdmModuleViewDetailService extends IBaseService { +public interface IMdmModuleViewDetailService extends IBaseService{ } diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleViewDetail/service/impl/MdmModuleViewDetailServiceImpl.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleViewDetail/service/impl/MdmModuleViewDetailServiceImpl.java index fb83c460..b5995fe9 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleViewDetail/service/impl/MdmModuleViewDetailServiceImpl.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleViewDetail/service/impl/MdmModuleViewDetailServiceImpl.java @@ -3,27 +3,24 @@ package com.hzya.frame.mdm.mdmModuleViewDetail.service.impl; import com.hzya.frame.mdm.mdmModuleViewDetail.entity.MdmModuleViewDetailEntity; import com.hzya.frame.mdm.mdmModuleViewDetail.dao.IMdmModuleViewDetailDao; import com.hzya.frame.mdm.mdmModuleViewDetail.service.IMdmModuleViewDetailService; -import org.springframework.stereotype.Service; +import org.springframework.stereotype.Service; import org.springframework.beans.factory.annotation.Autowired; - import javax.annotation.Resource; - import com.hzya.frame.basedao.service.impl.BaseService; - /** * 主数据视图明细表(MdmModuleViewDetail)表服务实现类 * * @author makejava - * @since 2023-10-17 15:35:00 + * @since 2024-05-30 17:04:17 */ @Service(value = "mdmModuleViewDetailService") public class MdmModuleViewDetailServiceImpl extends BaseService implements IMdmModuleViewDetailService { - + private IMdmModuleViewDetailDao mdmModuleViewDetailDao; - + @Autowired - public void setMdmModuleViewDetailDao(IMdmModuleViewDetailDao dao) { - this.mdmModuleViewDetailDao = dao; - this.dao = dao; - } + public void setMdmModuleViewDetailDao(IMdmModuleViewDetailDao dao) { + this.mdmModuleViewDetailDao = dao; + this.dao = dao; + } } diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmTableCodeRule/dao/IMdmTableCodeRuleDao.java b/service/src/main/java/com/hzya/frame/mdm/mdmTableCodeRule/dao/IMdmTableCodeRuleDao.java deleted file mode 100644 index a900d337..00000000 --- a/service/src/main/java/com/hzya/frame/mdm/mdmTableCodeRule/dao/IMdmTableCodeRuleDao.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.hzya.frame.mdm.mdmTableCodeRule.dao; - -import com.hzya.frame.mdm.mdmTableCodeRule.entity.MdmTableCodeRuleEntity; -import com.hzya.frame.basedao.dao.IBaseDao; - -/** - * 模版数据表编码规则表(mdm_table_code_rule: table)表数据库访问层 - * - * @author makejava - * @since 2023-11-06 16:12:34 - */ -public interface IMdmTableCodeRuleDao extends IBaseDao { - -} - diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmTableCodeRule/dao/impl/MdmTableCodeRuleDaoImpl.java b/service/src/main/java/com/hzya/frame/mdm/mdmTableCodeRule/dao/impl/MdmTableCodeRuleDaoImpl.java deleted file mode 100644 index b7452719..00000000 --- a/service/src/main/java/com/hzya/frame/mdm/mdmTableCodeRule/dao/impl/MdmTableCodeRuleDaoImpl.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.hzya.frame.mdm.mdmTableCodeRule.dao.impl; - -import com.hzya.frame.mdm.mdmTableCodeRule.entity.MdmTableCodeRuleEntity; -import com.hzya.frame.mdm.mdmTableCodeRule.dao.IMdmTableCodeRuleDao; -import org.springframework.stereotype.Repository; -import com.hzya.frame.basedao.dao.MybatisGenericDao; -/** - * 模版数据表编码规则表(MdmTableCodeRule)表数据库访问层 - * - * @author makejava - * @since 2023-11-06 16:12:35 - */ -@Repository(value = "MdmTableCodeRuleDaoImpl") -public class MdmTableCodeRuleDaoImpl extends MybatisGenericDao implements IMdmTableCodeRuleDao{ - -} - diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmTableCodeRule/entity/MdmTableCodeRuleEntity.java b/service/src/main/java/com/hzya/frame/mdm/mdmTableCodeRule/entity/MdmTableCodeRuleEntity.java deleted file mode 100644 index cca012ab..00000000 --- a/service/src/main/java/com/hzya/frame/mdm/mdmTableCodeRule/entity/MdmTableCodeRuleEntity.java +++ /dev/null @@ -1,76 +0,0 @@ -package com.hzya.frame.mdm.mdmTableCodeRule.entity; - -import java.util.Date; -import com.hzya.frame.web.entity.BaseEntity; -/** - * 模版数据表编码规则表(MdmTableCodeRule)实体类 - * - * @author makejava - * @since 2023-11-06 16:12:35 - */ -public class MdmTableCodeRuleEntity extends BaseEntity { - - /** 主数据模版ID */ - private String mdmId; - /** db_id */ - private String dbId; - /** 规则 */ - private String dbName; - /** 类型 1、连接符号 2、字符串 3、日期 4、流水号 */ - private String dbType; - /** 备注 */ - private String remark; - /** 规则值 */ - private String dbValue; - - - 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 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 getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public String getDbValue() { - return dbValue; - } - - public void setDbValue(String dbValue) { - this.dbValue = dbValue; - } - -} - diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmTableCodeRule/service/IMdmTableCodeRuleService.java b/service/src/main/java/com/hzya/frame/mdm/mdmTableCodeRule/service/IMdmTableCodeRuleService.java deleted file mode 100644 index d1872516..00000000 --- a/service/src/main/java/com/hzya/frame/mdm/mdmTableCodeRule/service/IMdmTableCodeRuleService.java +++ /dev/null @@ -1,12 +0,0 @@ -package com.hzya.frame.mdm.mdmTableCodeRule.service; - -import com.hzya.frame.mdm.mdmTableCodeRule.entity.MdmTableCodeRuleEntity; -import com.hzya.frame.basedao.service.IBaseService; -/** - * 模版数据表编码规则表(MdmTableCodeRule)表服务接口 - * - * @author makejava - * @since 2023-11-06 16:12:35 - */ -public interface IMdmTableCodeRuleService extends IBaseService{ -} diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmTableCodeRule/service/impl/MdmTableCodeRuleServiceImpl.java b/service/src/main/java/com/hzya/frame/mdm/mdmTableCodeRule/service/impl/MdmTableCodeRuleServiceImpl.java deleted file mode 100644 index e2020e70..00000000 --- a/service/src/main/java/com/hzya/frame/mdm/mdmTableCodeRule/service/impl/MdmTableCodeRuleServiceImpl.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.hzya.frame.mdm.mdmTableCodeRule.service.impl; - -import com.hzya.frame.mdm.mdmTableCodeRule.entity.MdmTableCodeRuleEntity; -import com.hzya.frame.mdm.mdmTableCodeRule.dao.IMdmTableCodeRuleDao; -import com.hzya.frame.mdm.mdmTableCodeRule.service.IMdmTableCodeRuleService; -import org.springframework.stereotype.Service; -import org.springframework.beans.factory.annotation.Autowired; -import javax.annotation.Resource; -import com.hzya.frame.basedao.service.impl.BaseService; -/** - * 模版数据表编码规则表(MdmTableCodeRule)表服务实现类 - * - * @author makejava - * @since 2023-11-06 16:12:35 - */ -@Service(value = "mdmTableCodeRuleService") -public class MdmTableCodeRuleServiceImpl extends BaseService implements IMdmTableCodeRuleService { - - private IMdmTableCodeRuleDao mdmTableCodeRuleDao; - - @Autowired - public void setMdmTableCodeRuleDao(IMdmTableCodeRuleDao dao) { - this.mdmTableCodeRuleDao = dao; - this.dao = dao; - } -} 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 6a3e4754..9c4de712 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 @@ -9,252 +9,4 @@ 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 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 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 - * @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 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 处理分发数据 - * @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 12f1bd59..620dc735 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,87 +1,12 @@ 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.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.MdmDistributeEntity; -import com.hzya.frame.mdm.entity.MdmDistributeVo; -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.MdmRoleDto; -import com.hzya.frame.mdm.entity.MdmViewButtonVo; -import com.hzya.frame.mdm.entity.MdmViewFiledVo; -import com.hzya.frame.mdm.entity.MdmViewVo; -import com.hzya.frame.mdm.entity.MdmVo; -import com.hzya.frame.mdm.mdmModule.dao.IMdmModuleDao; -import com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity; -import com.hzya.frame.mdm.mdmModuleDb.dao.IMdmModuleDbDao; -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.mdmModuleDbFiledsRuleFiles.dao.IMdmModuleDbFiledsRuleFilesDao; -import com.hzya.frame.mdm.mdmModuleDbFiledsRuleFiles.entity.MdmModuleDbFiledsRuleFilesEntity; -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.mdmModuleRole.dao.IMdmModuleRoleDao; -import com.hzya.frame.mdm.mdmModuleRole.entity.MdmModuleRoleEntity; -import com.hzya.frame.mdm.mdmModuleRoleButton.dao.IMdmModuleRoleButtonDao; -import com.hzya.frame.mdm.mdmModuleRoleButton.entity.MdmModuleRoleButtonEntity; -import com.hzya.frame.mdm.mdmModuleUserView.dao.IMdmModuleUserViewDao; -import com.hzya.frame.mdm.mdmModuleUserView.entity.MdmModuleUserViewEntity; -import com.hzya.frame.mdm.mdmModuleView.dao.IMdmModuleViewDao; -import com.hzya.frame.mdm.mdmModuleView.entity.MdmModuleViewEntity; -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; -import com.hzya.frame.sys.entity.FormmainDeleteDto; -import com.hzya.frame.sys.entity.ModuleDto; -import com.hzya.frame.sys.module.dao.IModuleMapper; -import com.hzya.frame.sys.module.entity.Module; -import com.hzya.frame.sys.roleModule.dao.IRoleModuleMapper; -import com.hzya.frame.sys.roleModule.entity.RoleModule; -import com.hzya.frame.sys.userRole.dao.IUserRoleMapper; -import com.hzya.frame.sys.userRole.entity.UserRole; -import com.hzya.frame.sysnew.application.plugin.dao.ISysApplicationPluginDao; -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; -import com.hzya.frame.web.entity.BaseResult; -import com.hzya.frame.web.entity.JsonResultEntity; + 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; -import java.util.Objects; -import java.util.stream.Collectors; + /** * 主数据服务实现类 @@ -90,3078 +15,5 @@ import java.util.stream.Collectors; public class MdmServiceImpl implements IMdmService { private final Logger logger = LoggerFactory.getLogger(this.getClass()); - @Resource - protected IModuleMapper moduleMapper; - @Resource - protected IRoleModuleMapper roleModuleMapper; - @Resource - private IMdmModuleDao mdmModuleDao; //主数据模版 - @Resource - private IMdmModuleDbDao mdmModuleDbDao;//模版数据库表 - @Resource - private IMdmModuleDbFiledsDao mdmModuleDbFiledsDao;//模版数据库字段表 - @Resource - private IMdmModuleDbFiledsRuleDao mdmModuleDbFiledsRuleDao;//模版数据库字段规则表 - @Resource - private IMdmModuleDbFiledsRuleFilesDao mdmModuleDbFiledsRuleFilesDao;//模版数据库字段规则档案表 - @Resource - private IMdmModuleDistributeDao mdmModuleDistributeDao;//主数据功能应用分发表 - @Resource - private IMdmModuleDistributeDetailDao mdmModuleDistributeDetailDao;//主数据功能应用分发明细表 - @Resource - private IMdmModuleRoleDao mdmModuleRoleDao;//主数据功能角色表 - @Resource - private IMdmModuleRoleButtonDao mdmModuleRoleButtonDao;//主数据功能角色按钮表 - @Resource - private IMdmModuleUserViewDao mdmModuleUserViewDao;//主数据用户视图表 - @Resource - private IMdmModuleViewDao mdmModuleViewDao;//主数据视图表 - @Resource - private IMdmModuleViewDetailDao mdmModuleViewDetailDao;//主数据视图明细表 - @Resource - private IMdmTableCodeRuleDao mdmTableCodeRuleDao;//模版数据表编码规则表 - @Resource - protected ISysApplicationPluginDao sysApplicationPluginDao; - @Resource - private ISysMenuConfigDao sysMenuConfigDao; - @Resource - private ISysButtonConfigDao sysButtonConfigDao; - - /** - * @param object - * @return com.hzya.frame.web.entity.JsonResultEntity - * @Author lvleigang - * @Description 主数据列表查询接口分页 - * @Date 9:40 上午 2023/10/18 - **/ - @Override - public JsonResultEntity queryMdmPage(JSONObject object) { - MdmDto entity = getData("jsonStr", object, MdmDto.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) { - MdmDto entity = getData("jsonStr", object, MdmDto.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 queryMdmModule(JSONObject object) { - MdmModuleEntity entity = getData("jsonStr", object, MdmModuleEntity.class); - MdmModuleEntity mdmModuleEntity = mdmModuleDao.queryOne(entity); - 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.getId() == null || "".equals(entity.getId())) { - //新增 - 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()); - mdmModuleDao.save(entity); - } else { - //修改 - entity.setSts("Y"); - entity.setModify_user_id(StpUtil.getLoginIdAsString()); - entity.setModify_time(new Date()); - mdmModuleDao.update(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) { - MdmDto entity = getData("jsonStr", object, MdmDto.class); - //判断分页 - if (entity == null) { - return BaseResult.getFailureMessageEntity("参数不允许为空"); - } - if (entity.getId() == null || "".equals(entity.getId())) { - return BaseResult.getFailureMessageEntity("系统错误"); - } - MdmDbVo mdmDbVo = new MdmDbVo(); - - //查询设置的规则表 - MdmModuleDbFiledsRuleFilesEntity mdmModuleDbFiledsRuleFilesEntity = new MdmModuleDbFiledsRuleFilesEntity(); - mdmModuleDbFiledsRuleFilesEntity.setSts("Y"); - List moduleDbFiledsRuleFiles = mdmModuleDbFiledsRuleFilesDao.queryBase(mdmModuleDbFiledsRuleFilesEntity); - mdmDbVo.setModuleDbFiledsRuleFiles(moduleDbFiledsRuleFiles); - //查询设置的规则表 - MdmTableCodeRuleEntity mdmTableCodeRuleEntity = new MdmTableCodeRuleEntity(); - mdmTableCodeRuleEntity.setSts("Y"); - mdmTableCodeRuleEntity.setMdmId(entity.getId()); - List mdmTableCodeRuleEntityList = mdmTableCodeRuleDao.queryBase(mdmTableCodeRuleEntity); - mdmDbVo.setMdmTableCodeRuleEntityList(mdmTableCodeRuleEntityList); - //查询数据源表 - MdmModuleDbEntity queryDb = new MdmModuleDbEntity(); - queryDb.setMdmId(entity.getId()); - queryDb.setSts("Y"); - List mdmModuleDbEntityList = mdmModuleDbDao.queryBase(queryDb); - List mdmModuleDbFiledsEntityList = null; - List mdmModuleDbFiledsRuleEntityList = null; - //存在表查询数据下的字段 - if (mdmModuleDbEntityList != null && mdmModuleDbEntityList.size() > 0) { - MdmModuleDbFiledsEntity queryDbFiled = new MdmModuleDbFiledsEntity(); - queryDbFiled.setMdmId(entity.getId()); - queryDbFiled.setSts("Y"); - mdmModuleDbFiledsEntityList = mdmModuleDbFiledsDao.queryBase(queryDbFiled); - //存在字段查询字段的属性 - if (mdmModuleDbFiledsEntityList != null && mdmModuleDbFiledsEntityList.size() > 0) { - MdmModuleDbFiledsRuleEntity queryDbFiledRule = new MdmModuleDbFiledsRuleEntity(); - queryDbFiledRule.setMdmId(entity.getId()); - queryDbFiledRule.setSts("Y"); - mdmModuleDbFiledsRuleEntityList = mdmModuleDbFiledsRuleDao.queryBase(queryDbFiledRule); - } - } - //组装数据 - setMdmDb(mdmDbVo, mdmModuleDbEntityList, mdmModuleDbFiledsEntityList, mdmModuleDbFiledsRuleEntityList); - return BaseResult.getSuccessMessageEntity("查询数据成功", mdmDbVo); - } - - - /** - * @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 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 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 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.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 - * @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 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 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 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 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 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 - * @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())) { - //查询模版 - 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()); - } - - - 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("系统错误"); - } - //查询模版 - 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); - } - } - - 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("参数不允许为空"); - } - 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); - } - - - 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 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 { - 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 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 4d9fdcae7a4d4f409e701873cb1168434a9c9bb9 Mon Sep 17 00:00:00 2001 From: lvleigang <957075182@qq.com> Date: Mon, 3 Jun 2024 08:45:36 +0800 Subject: [PATCH 10/31] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8E=92=E5=BA=8F?= =?UTF-8?q?=E9=A1=BA=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../integtationTaskLog/entity/IntegrationTaskLogEntity.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/service/src/main/java/com/hzya/frame/sysnew/integtationTaskLog/entity/IntegrationTaskLogEntity.xml b/service/src/main/java/com/hzya/frame/sysnew/integtationTaskLog/entity/IntegrationTaskLogEntity.xml index a5a9d746..68a3bff1 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/integtationTaskLog/entity/IntegrationTaskLogEntity.xml +++ b/service/src/main/java/com/hzya/frame/sysnew/integtationTaskLog/entity/IntegrationTaskLogEntity.xml @@ -143,7 +143,7 @@ and company_id like concat('%',#{companyId},'%') and sts='Y' - order by sorts asc + order by sorts desc order by ${sort} ${order} From 2741e28ba1bebbf19a4152ada539eb4486503e62 Mon Sep 17 00:00:00 2001 From: lvleigang <957075182@qq.com> Date: Mon, 3 Jun 2024 08:49:43 +0800 Subject: [PATCH 11/31] =?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/mdmModule/dao/IMdmModuleDao.java | 2 +- .../mdmModule/dao/impl/MdmModuleDaoImpl.java | 134 +-------- .../mdm/mdmModule/entity/MdmModuleEntity.java | 2 +- .../mdmModule/service/IMdmModuleService.java | 2 +- .../service/impl/MdmModuleServiceImpl.java | 2 +- .../mdm/mdmModuleDb/dao/IMdmModuleDbDao.java | 2 +- .../dao/impl/MdmModuleDbDaoImpl.java | 2 +- .../mdmModuleDb/entity/MdmModuleDbEntity.java | 2 +- .../service/IMdmModuleDbService.java | 2 +- .../service/impl/MdmModuleDbServiceImpl.java | 2 +- .../dao/IMdmModuleDbFiledsDao.java | 2 +- .../dao/impl/MdmModuleDbFiledsDaoImpl.java | 2 +- .../entity/MdmModuleDbFiledsEntity.java | 2 +- .../service/IMdmModuleDbFiledsService.java | 2 +- .../impl/MdmModuleDbFiledsServiceImpl.java | 2 +- .../dao/IMdmModuleDbFiledsRuleDao.java | 2 +- .../impl/MdmModuleDbFiledsRuleDaoImpl.java | 2 +- .../entity/MdmModuleDbFiledsRuleEntity.java | 2 +- .../IMdmModuleDbFiledsRuleService.java | 2 +- .../MdmModuleDbFiledsRuleServiceImpl.java | 2 +- .../dao/IMdmModuleDistributeDao.java | 2 +- .../dao/impl/MdmModuleDistributeDaoImpl.java | 2 +- .../entity/MdmModuleDistributeEntity.java | 2 +- .../service/IMdmModuleDistributeService.java | 2 +- .../impl/MdmModuleDistributeServiceImpl.java | 2 +- .../dao/IMdmModuleDistributeDetailDao.java | 15 + .../MdmModuleDistributeDetailDaoImpl.java | 17 ++ .../MdmModuleDistributeDetailEntity.java | 96 ++++++ .../MdmModuleDistributeDetailEntity.xml | 278 ++++++++++++++++++ .../IMdmModuleDistributeDetailService.java | 12 + .../MdmModuleDistributeDetailServiceImpl.java | 26 ++ .../mdmModuleView/dao/IMdmModuleViewDao.java | 2 +- .../dao/impl/MdmModuleViewDaoImpl.java | 2 +- .../entity/MdmModuleViewEntity.java | 2 +- .../service/IMdmModuleViewService.java | 2 +- .../impl/MdmModuleViewServiceImpl.java | 2 +- .../dao/IMdmModuleViewButtonDao.java | 2 +- .../dao/impl/MdmModuleViewButtonDaoImpl.java | 2 +- .../entity/MdmModuleViewButtonEntity.java | 2 +- .../service/IMdmModuleViewButtonService.java | 2 +- .../impl/MdmModuleViewButtonServiceImpl.java | 2 +- .../dao/IMdmModuleViewDetailDao.java | 2 +- .../dao/impl/MdmModuleViewDetailDaoImpl.java | 2 +- .../entity/MdmModuleViewDetailEntity.java | 2 +- .../service/IMdmModuleViewDetailService.java | 2 +- .../impl/MdmModuleViewDetailServiceImpl.java | 2 +- 46 files changed, 486 insertions(+), 170 deletions(-) create mode 100644 service/src/main/java/com/hzya/frame/mdm/mdmModuleDistributeDetail/dao/IMdmModuleDistributeDetailDao.java create mode 100644 service/src/main/java/com/hzya/frame/mdm/mdmModuleDistributeDetail/dao/impl/MdmModuleDistributeDetailDaoImpl.java create mode 100644 service/src/main/java/com/hzya/frame/mdm/mdmModuleDistributeDetail/entity/MdmModuleDistributeDetailEntity.java create mode 100644 service/src/main/java/com/hzya/frame/mdm/mdmModuleDistributeDetail/entity/MdmModuleDistributeDetailEntity.xml create mode 100644 service/src/main/java/com/hzya/frame/mdm/mdmModuleDistributeDetail/service/IMdmModuleDistributeDetailService.java create mode 100644 service/src/main/java/com/hzya/frame/mdm/mdmModuleDistributeDetail/service/impl/MdmModuleDistributeDetailServiceImpl.java 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 fedf6b4e..a4c661ae 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 @@ -7,7 +7,7 @@ import com.hzya.frame.basedao.dao.IBaseDao; * 主数据模版(mdm_module: table)表数据库访问层 * * @author makejava - * @since 2024-05-30 16:56:53 + * @since 2024-06-03 08:46:29 */ public interface IMdmModuleDao extends IBaseDao { 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 caabbdff..a7fa1684 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,145 +1,17 @@ package com.hzya.frame.mdm.mdmModule.dao.impl; -import com.hzya.frame.mdm.entity.MdmDataDto; -import com.hzya.frame.mdm.entity.MdmDistributeEntity; -import com.hzya.frame.mdm.entity.MdmDto; -import com.hzya.frame.mdm.entity.MdmQuery; -import com.hzya.frame.mdm.entity.MdmVo; import com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity; import com.hzya.frame.mdm.mdmModule.dao.IMdmModuleDao; -import com.hzya.frame.sys.entity.FormmainDeleteDto; -import com.hzya.frame.sys.entity.ModuleDto; import org.springframework.stereotype.Repository; import com.hzya.frame.basedao.dao.MybatisGenericDao; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - /** * 主数据模版(MdmModule)表数据库访问层 * * @author makejava - * @since 2023-10-17 15:25:42 + * @since 2024-06-03 08:46:29 */ @Repository(value = "MdmModuleDaoImpl") -public class MdmModuleDaoImpl extends MybatisGenericDao implements IMdmModuleDao { - - @Override - public List queryMdm(MdmDto entity) { - List o = (List) super.selectList(getSqlIdPrifx() + "queryMdm", entity); - return o; - } - - @Override - public Integer checkTable(Map maps) { - Integer o = (Integer) super.selectOne(getSqlIdPrifx() + "checkTable", maps); - return o; - - } - - @Override - public Integer createTable(Map maps) { - Integer o = (Integer) super.selectOne(getSqlIdPrifx() + "createTable", maps); - return o; - } - @Override - public Integer createTableDistribute(Map maps) { - Integer o = (Integer) super.selectOne(getSqlIdPrifx() + "createTableDistribute", 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; - - } - @Override - public Integer checkData(Map maps) { - Integer o = (Integer) super.selectOne(getSqlIdPrifx() + "checkData", maps); - return o; - - } - @Override - public List> querySelectData(MdmDto entity) { - List> o = (List>) super.selectList(getSqlIdPrifx() + "querySelectData", entity); - return o; - - } - - @Override - public List> queryTemplateDataMore(MdmDto entity) { - List> o = (List>) super.selectList(getSqlIdPrifx() + "queryTemplateDataMore", entity); - return o; - - } - - @Override - public List> queryMdmShowData(MdmQuery entity) { - List> o = (List>) super.selectList(getSqlIdPrifx() + "queryMdmShowData", entity); - return o; - } - @Override - public List> queryDataAll(MdmDto entity) { - List> o = (List>) super.selectList(getSqlIdPrifx() + "queryDataAll", entity); - return o; - } - - @Override - public List> queryTemplateData(ModuleDto entity) { - List> o = (List>) super.selectList(getSqlIdPrifx() + "queryTemplateData", entity); - return o; - - } - @Override - public Integer updateForm(MdmDataDto mdmDataDto) { - Integer o = super.update(getSqlIdPrifx() + "updateForm", mdmDataDto); - return o; - - } - @Override - public Integer saveForm(MdmDataDto mdmDataDto) { - Integer o = super.update(getSqlIdPrifx() + "saveForm", mdmDataDto); - return o; - - } - - @Override - public Integer deleteTemplateById(FormmainDeleteDto entity) { - Integer o = super.delete(getSqlIdPrifx() + "deleteTemplateById", entity); - return o; - - } - - @Override - public Integer deleteChilder(FormmainDeleteDto entity) { - Integer o = super.delete(getSqlIdPrifx() + "deleteChilder", entity); - return o; - - } - - @Override - public Integer saveDistribute(MdmDistributeEntity mdmDistributeEntity) { - Integer o = super.insert(getSqlIdPrifx() + "saveDistribute", mdmDistributeEntity); - return o; - } - @Override - public Integer updateDistribute(MdmDistributeEntity mdmDistributeEntity) { - Integer o = super.update(getSqlIdPrifx() + "updateDistribute", mdmDistributeEntity); - return o; - } - - @Override - public HashMap queryTemplateDataOne(MdmDto entity) { - HashMap o = (HashMap) super.selectOne(getSqlIdPrifx() + "queryTemplateDataOne", entity); - return o; - - } +public class MdmModuleDaoImpl extends MybatisGenericDao implements IMdmModuleDao{ + } diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModule/entity/MdmModuleEntity.java b/service/src/main/java/com/hzya/frame/mdm/mdmModule/entity/MdmModuleEntity.java index 90a32672..2d34005d 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModule/entity/MdmModuleEntity.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModule/entity/MdmModuleEntity.java @@ -6,7 +6,7 @@ import com.hzya.frame.web.entity.BaseEntity; * 主数据模版(MdmModule)实体类 * * @author makejava - * @since 2024-05-30 16:56:53 + * @since 2024-06-03 08:46:29 */ public class MdmModuleEntity extends BaseEntity { 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 a45d87ce..02372e74 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 @@ -6,7 +6,7 @@ import com.hzya.frame.basedao.service.IBaseService; * 主数据模版(MdmModule)表服务接口 * * @author makejava - * @since 2024-05-30 16:56:54 + * @since 2024-06-03 08:46:29 */ public interface IMdmModuleService extends IBaseService{ } 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 cbca01ff..a47b3505 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 @@ -11,7 +11,7 @@ import com.hzya.frame.basedao.service.impl.BaseService; * 主数据模版(MdmModule)表服务实现类 * * @author makejava - * @since 2024-05-30 16:56:54 + * @since 2024-06-03 08:46:29 */ @Service(value = "mdmModuleService") public class MdmModuleServiceImpl extends BaseService implements IMdmModuleService { 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 c756aa73..92b955dd 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 @@ -7,7 +7,7 @@ import com.hzya.frame.basedao.dao.IBaseDao; * 模版数据库表(mdm_module_db: table)表数据库访问层 * * @author makejava - * @since 2024-05-30 16:58:05 + * @since 2024-06-03 08:46:48 */ public interface IMdmModuleDbDao extends IBaseDao { 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 d16293ca..77d8c8bb 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 @@ -8,7 +8,7 @@ import com.hzya.frame.basedao.dao.MybatisGenericDao; * 模版数据库表(MdmModuleDb)表数据库访问层 * * @author makejava - * @since 2024-05-30 16:58:05 + * @since 2024-06-03 08:46:50 */ @Repository(value = "MdmModuleDbDaoImpl") public class MdmModuleDbDaoImpl extends MybatisGenericDao implements IMdmModuleDbDao{ diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDb/entity/MdmModuleDbEntity.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDb/entity/MdmModuleDbEntity.java index 22a7acfe..ae612a36 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDb/entity/MdmModuleDbEntity.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDb/entity/MdmModuleDbEntity.java @@ -6,7 +6,7 @@ import com.hzya.frame.web.entity.BaseEntity; * 模版数据库表(MdmModuleDb)实体类 * * @author makejava - * @since 2024-05-30 16:58:05 + * @since 2024-06-03 08:46:50 */ public class MdmModuleDbEntity extends BaseEntity { diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDb/service/IMdmModuleDbService.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDb/service/IMdmModuleDbService.java index f1bfc14b..7104bf51 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDb/service/IMdmModuleDbService.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDb/service/IMdmModuleDbService.java @@ -6,7 +6,7 @@ import com.hzya.frame.basedao.service.IBaseService; * 模版数据库表(MdmModuleDb)表服务接口 * * @author makejava - * @since 2024-05-30 16:58:05 + * @since 2024-06-03 08:46:51 */ public interface IMdmModuleDbService extends IBaseService{ } diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDb/service/impl/MdmModuleDbServiceImpl.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDb/service/impl/MdmModuleDbServiceImpl.java index 0af82f65..511df1b4 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDb/service/impl/MdmModuleDbServiceImpl.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDb/service/impl/MdmModuleDbServiceImpl.java @@ -11,7 +11,7 @@ import com.hzya.frame.basedao.service.impl.BaseService; * 模版数据库表(MdmModuleDb)表服务实现类 * * @author makejava - * @since 2024-05-30 16:58:05 + * @since 2024-06-03 08:46:52 */ @Service(value = "mdmModuleDbService") public class MdmModuleDbServiceImpl extends BaseService implements IMdmModuleDbService { 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 85ae9c76..9bbd8915 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 @@ -7,7 +7,7 @@ import com.hzya.frame.basedao.dao.IBaseDao; * 模版数据库字段表(mdm_module_db_fileds: table)表数据库访问层 * * @author makejava - * @since 2024-05-30 16:59:05 + * @since 2024-06-03 08:47:01 */ public interface IMdmModuleDbFiledsDao extends IBaseDao { 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 42497b13..1e32d5a9 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 @@ -8,7 +8,7 @@ import com.hzya.frame.basedao.dao.MybatisGenericDao; * 模版数据库字段表(MdmModuleDbFileds)表数据库访问层 * * @author makejava - * @since 2024-05-30 16:59:05 + * @since 2024-06-03 08:47:01 */ @Repository(value = "MdmModuleDbFiledsDaoImpl") public class MdmModuleDbFiledsDaoImpl extends MybatisGenericDao implements IMdmModuleDbFiledsDao{ 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 3dfe1ee5..4453cbd2 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 @@ -6,7 +6,7 @@ import com.hzya.frame.web.entity.BaseEntity; * 模版数据库字段表(MdmModuleDbFileds)实体类 * * @author makejava - * @since 2024-05-30 16:59:05 + * @since 2024-06-03 08:47:01 */ public class MdmModuleDbFiledsEntity extends BaseEntity { diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDbFileds/service/IMdmModuleDbFiledsService.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDbFileds/service/IMdmModuleDbFiledsService.java index c4a0378a..e08b44aa 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDbFileds/service/IMdmModuleDbFiledsService.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDbFileds/service/IMdmModuleDbFiledsService.java @@ -6,7 +6,7 @@ import com.hzya.frame.basedao.service.IBaseService; * 模版数据库字段表(MdmModuleDbFileds)表服务接口 * * @author makejava - * @since 2024-05-30 16:59:05 + * @since 2024-06-03 08:47:01 */ public interface IMdmModuleDbFiledsService extends IBaseService{ } diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDbFileds/service/impl/MdmModuleDbFiledsServiceImpl.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDbFileds/service/impl/MdmModuleDbFiledsServiceImpl.java index 585ecffc..82ecb3f0 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDbFileds/service/impl/MdmModuleDbFiledsServiceImpl.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDbFileds/service/impl/MdmModuleDbFiledsServiceImpl.java @@ -11,7 +11,7 @@ import com.hzya.frame.basedao.service.impl.BaseService; * 模版数据库字段表(MdmModuleDbFileds)表服务实现类 * * @author makejava - * @since 2024-05-30 16:59:05 + * @since 2024-06-03 08:47:01 */ @Service(value = "mdmModuleDbFiledsService") public class MdmModuleDbFiledsServiceImpl extends BaseService implements IMdmModuleDbFiledsService { 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 cae56910..7e29594b 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 @@ -7,7 +7,7 @@ import com.hzya.frame.basedao.dao.IBaseDao; * 模版数据库字段规则表(mdm_module_db_fileds_rule: table)表数据库访问层 * * @author makejava - * @since 2024-05-30 16:59:59 + * @since 2024-06-03 08:47:10 */ public interface IMdmModuleDbFiledsRuleDao extends IBaseDao { 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 43cb75a6..d3c4f630 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 @@ -8,7 +8,7 @@ import com.hzya.frame.basedao.dao.MybatisGenericDao; * 模版数据库字段规则表(MdmModuleDbFiledsRule)表数据库访问层 * * @author makejava - * @since 2024-05-30 16:59:59 + * @since 2024-06-03 08:47:10 */ @Repository(value = "MdmModuleDbFiledsRuleDaoImpl") public class MdmModuleDbFiledsRuleDaoImpl extends MybatisGenericDao implements IMdmModuleDbFiledsRuleDao{ diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDbFiledsRule/entity/MdmModuleDbFiledsRuleEntity.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDbFiledsRule/entity/MdmModuleDbFiledsRuleEntity.java index 2e30e449..59f24cfb 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDbFiledsRule/entity/MdmModuleDbFiledsRuleEntity.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDbFiledsRule/entity/MdmModuleDbFiledsRuleEntity.java @@ -6,7 +6,7 @@ import com.hzya.frame.web.entity.BaseEntity; * 模版数据库字段规则表(MdmModuleDbFiledsRule)实体类 * * @author makejava - * @since 2024-05-30 16:59:59 + * @since 2024-06-03 08:47:10 */ public class MdmModuleDbFiledsRuleEntity extends BaseEntity { diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDbFiledsRule/service/IMdmModuleDbFiledsRuleService.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDbFiledsRule/service/IMdmModuleDbFiledsRuleService.java index 26d2b517..710c7f0a 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDbFiledsRule/service/IMdmModuleDbFiledsRuleService.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDbFiledsRule/service/IMdmModuleDbFiledsRuleService.java @@ -6,7 +6,7 @@ import com.hzya.frame.basedao.service.IBaseService; * 模版数据库字段规则表(MdmModuleDbFiledsRule)表服务接口 * * @author makejava - * @since 2024-05-30 16:59:59 + * @since 2024-06-03 08:47:10 */ public interface IMdmModuleDbFiledsRuleService extends IBaseService{ } diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDbFiledsRule/service/impl/MdmModuleDbFiledsRuleServiceImpl.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDbFiledsRule/service/impl/MdmModuleDbFiledsRuleServiceImpl.java index ba897603..8b987300 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDbFiledsRule/service/impl/MdmModuleDbFiledsRuleServiceImpl.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDbFiledsRule/service/impl/MdmModuleDbFiledsRuleServiceImpl.java @@ -11,7 +11,7 @@ import com.hzya.frame.basedao.service.impl.BaseService; * 模版数据库字段规则表(MdmModuleDbFiledsRule)表服务实现类 * * @author makejava - * @since 2024-05-30 16:59:59 + * @since 2024-06-03 08:47:10 */ @Service(value = "mdmModuleDbFiledsRuleService") public class MdmModuleDbFiledsRuleServiceImpl extends BaseService implements IMdmModuleDbFiledsRuleService { 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 db9d3be5..2e2f90f5 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-05-30 17:02:43 + * @since 2024-06-03 08:47:33 */ 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 3b91fabb..3318c2c2 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-05-30 17:02:43 + * @since 2024-06-03 08:47:33 */ @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 542d0b27..23df5360 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 @@ -6,7 +6,7 @@ import com.hzya.frame.web.entity.BaseEntity; * 主数据功能应用分发表(MdmModuleDistribute)实体类 * * @author makejava - * @since 2024-05-30 17:02:43 + * @since 2024-06-03 08:47:33 */ public class MdmModuleDistributeEntity extends BaseEntity { 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 e997c97c..577b0e3c 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-05-30 17:02:44 + * @since 2024-06-03 08:47:33 */ 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 8479bf2c..24fe61e3 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-05-30 17:02:44 + * @since 2024-06-03 08:47:33 */ @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 new file mode 100644 index 00000000..2b55a63a --- /dev/null +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistributeDetail/dao/IMdmModuleDistributeDetailDao.java @@ -0,0 +1,15 @@ +package com.hzya.frame.mdm.mdmModuleDistributeDetail.dao; + +import com.hzya.frame.mdm.mdmModuleDistributeDetail.entity.MdmModuleDistributeDetailEntity; +import com.hzya.frame.basedao.dao.IBaseDao; + +/** + * 主数据功能应用分发明细表(mdm_module_distribute_detail: table)表数据库访问层 + * + * @author makejava + * @since 2024-06-03 08:48:18 + */ +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 new file mode 100644 index 00000000..68878631 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistributeDetail/dao/impl/MdmModuleDistributeDetailDaoImpl.java @@ -0,0 +1,17 @@ +package com.hzya.frame.mdm.mdmModuleDistributeDetail.dao.impl; + +import com.hzya.frame.mdm.mdmModuleDistributeDetail.entity.MdmModuleDistributeDetailEntity; +import com.hzya.frame.mdm.mdmModuleDistributeDetail.dao.IMdmModuleDistributeDetailDao; +import org.springframework.stereotype.Repository; +import com.hzya.frame.basedao.dao.MybatisGenericDao; +/** + * 主数据功能应用分发明细表(MdmModuleDistributeDetail)表数据库访问层 + * + * @author makejava + * @since 2024-06-03 08:48:18 + */ +@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 new file mode 100644 index 00000000..b0438ba8 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistributeDetail/entity/MdmModuleDistributeDetailEntity.java @@ -0,0 +1,96 @@ +package com.hzya.frame.mdm.mdmModuleDistributeDetail.entity; + +import java.util.Date; +import com.hzya.frame.web.entity.BaseEntity; +/** + * 主数据功能应用分发明细表(MdmModuleDistributeDetail)实体类 + * + * @author makejava + * @since 2024-06-03 08:48:18 + */ +public class MdmModuleDistributeDetailEntity extends BaseEntity { + + /** 主数据模版ID */ + private String mdmId; + /** 应用分发id */ + private String distributeId; + /** 接口id */ + private String apiId; + /** 数据类型 1、新增2、修改3、删除 */ + private String dataType; + /** 字段名 */ + private String filedName; + /** 对比类型 1、等于 */ + private String compareType; + /** 目标API字段默认值 */ + private String filedVaule; + /** 公司id */ + private String companyId; + + + public String getMdmId() { + return mdmId; + } + + public void setMdmId(String mdmId) { + this.mdmId = mdmId; + } + + public String getDistributeId() { + return distributeId; + } + + public void setDistributeId(String distributeId) { + this.distributeId = distributeId; + } + + public String getApiId() { + return apiId; + } + + public void setApiId(String apiId) { + this.apiId = apiId; + } + + public String getDataType() { + return dataType; + } + + public void setDataType(String dataType) { + this.dataType = dataType; + } + + public String getFiledName() { + return filedName; + } + + public void setFiledName(String filedName) { + this.filedName = filedName; + } + + public String getCompareType() { + return compareType; + } + + public void setCompareType(String compareType) { + this.compareType = compareType; + } + + public String getFiledVaule() { + return filedVaule; + } + + public void setFiledVaule(String filedVaule) { + this.filedVaule = filedVaule; + } + + public String getCompanyId() { + return companyId; + } + + public void setCompanyId(String companyId) { + this.companyId = 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 new file mode 100644 index 00000000..ca6fe0c9 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistributeDetail/entity/MdmModuleDistributeDetailEntity.xml @@ -0,0 +1,278 @@ + + + + + + + + + + + + + + + + + + + + + + + + + id + ,mdm_id + ,distribute_id + ,api_id + ,data_type + ,filed_name + ,compare_type + ,filed_vaule + ,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 , + filed_name , + compare_type , + filed_vaule , + sorts , + create_user_id , + create_time , + modify_user_id , + modify_time , + sts , + org_id , + company_id , + sorts, + sts, + + )values( + + #{id} , + #{mdmId} , + #{distributeId} , + #{apiId} , + #{dataType} , + #{filedName} , + #{compareType} , + #{filedVaule} , + #{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, filed_name, compare_type, filed_vaule, 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') + + + + + 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) + 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}) + + on duplicate key update + mdm_id = values(mdm_id), + distribute_id = values(distribute_id), + api_id = values(api_id), + data_type = values(data_type), + filed_name = values(filed_name), + compare_type = values(compare_type), + filed_vaule = values(filed_vaule), + 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}, + filed_name = #{filedName}, + compare_type = #{compareType}, + filed_vaule = #{filedVaule}, + 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 filed_name = #{filedName} + and compare_type = #{compareType} + and filed_vaule = #{filedVaule} + 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/mdmModuleDistributeDetail/service/IMdmModuleDistributeDetailService.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistributeDetail/service/IMdmModuleDistributeDetailService.java new file mode 100644 index 00000000..9b2fb7f8 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistributeDetail/service/IMdmModuleDistributeDetailService.java @@ -0,0 +1,12 @@ +package com.hzya.frame.mdm.mdmModuleDistributeDetail.service; + +import com.hzya.frame.mdm.mdmModuleDistributeDetail.entity.MdmModuleDistributeDetailEntity; +import com.hzya.frame.basedao.service.IBaseService; +/** + * 主数据功能应用分发明细表(MdmModuleDistributeDetail)表服务接口 + * + * @author makejava + * @since 2024-06-03 08:48:18 + */ +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 new file mode 100644 index 00000000..6dd4b505 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistributeDetail/service/impl/MdmModuleDistributeDetailServiceImpl.java @@ -0,0 +1,26 @@ +package com.hzya.frame.mdm.mdmModuleDistributeDetail.service.impl; + +import com.hzya.frame.mdm.mdmModuleDistributeDetail.entity.MdmModuleDistributeDetailEntity; +import com.hzya.frame.mdm.mdmModuleDistributeDetail.dao.IMdmModuleDistributeDetailDao; +import com.hzya.frame.mdm.mdmModuleDistributeDetail.service.IMdmModuleDistributeDetailService; +import org.springframework.stereotype.Service; +import org.springframework.beans.factory.annotation.Autowired; +import javax.annotation.Resource; +import com.hzya.frame.basedao.service.impl.BaseService; +/** + * 主数据功能应用分发明细表(MdmModuleDistributeDetail)表服务实现类 + * + * @author makejava + * @since 2024-06-03 08:48:18 + */ +@Service(value = "mdmModuleDistributeDetailService") +public class MdmModuleDistributeDetailServiceImpl extends BaseService implements IMdmModuleDistributeDetailService { + + private IMdmModuleDistributeDetailDao mdmModuleDistributeDetailDao; + + @Autowired + public void setMdmModuleDistributeDetailDao(IMdmModuleDistributeDetailDao dao) { + this.mdmModuleDistributeDetailDao = dao; + this.dao = dao; + } +} diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleView/dao/IMdmModuleViewDao.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleView/dao/IMdmModuleViewDao.java index 3c4a63e6..c1daba93 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleView/dao/IMdmModuleViewDao.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleView/dao/IMdmModuleViewDao.java @@ -7,7 +7,7 @@ import com.hzya.frame.basedao.dao.IBaseDao; * 主数据视图表(mdm_module_view: table)表数据库访问层 * * @author makejava - * @since 2024-05-30 17:03:24 + * @since 2024-06-03 08:48:37 */ public interface IMdmModuleViewDao extends IBaseDao { diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleView/dao/impl/MdmModuleViewDaoImpl.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleView/dao/impl/MdmModuleViewDaoImpl.java index 60b2e844..453f7b44 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleView/dao/impl/MdmModuleViewDaoImpl.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleView/dao/impl/MdmModuleViewDaoImpl.java @@ -8,7 +8,7 @@ import com.hzya.frame.basedao.dao.MybatisGenericDao; * 主数据视图表(MdmModuleView)表数据库访问层 * * @author makejava - * @since 2024-05-30 17:03:24 + * @since 2024-06-03 08:48:37 */ @Repository(value = "MdmModuleViewDaoImpl") public class MdmModuleViewDaoImpl extends MybatisGenericDao implements IMdmModuleViewDao{ 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 94540106..9c1344ba 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 @@ -6,7 +6,7 @@ import com.hzya.frame.web.entity.BaseEntity; * 主数据视图表(MdmModuleView)实体类 * * @author makejava - * @since 2024-05-30 17:03:24 + * @since 2024-06-03 08:48:37 */ public class MdmModuleViewEntity extends BaseEntity { diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleView/service/IMdmModuleViewService.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleView/service/IMdmModuleViewService.java index e389eae0..5a9399ff 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleView/service/IMdmModuleViewService.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleView/service/IMdmModuleViewService.java @@ -6,7 +6,7 @@ import com.hzya.frame.basedao.service.IBaseService; * 主数据视图表(MdmModuleView)表服务接口 * * @author makejava - * @since 2024-05-30 17:03:24 + * @since 2024-06-03 08:48:37 */ public interface IMdmModuleViewService extends IBaseService{ } diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleView/service/impl/MdmModuleViewServiceImpl.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleView/service/impl/MdmModuleViewServiceImpl.java index ec23ecc4..7bc7b2f5 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleView/service/impl/MdmModuleViewServiceImpl.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleView/service/impl/MdmModuleViewServiceImpl.java @@ -11,7 +11,7 @@ import com.hzya.frame.basedao.service.impl.BaseService; * 主数据视图表(MdmModuleView)表服务实现类 * * @author makejava - * @since 2024-05-30 17:03:24 + * @since 2024-06-03 08:48:37 */ @Service(value = "mdmModuleViewService") public class MdmModuleViewServiceImpl extends BaseService implements IMdmModuleViewService { diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleViewButton/dao/IMdmModuleViewButtonDao.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleViewButton/dao/IMdmModuleViewButtonDao.java index 48d7c1d2..66472d77 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleViewButton/dao/IMdmModuleViewButtonDao.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleViewButton/dao/IMdmModuleViewButtonDao.java @@ -7,7 +7,7 @@ import com.hzya.frame.basedao.dao.IBaseDao; * 主数据视图按钮表(mdm_module_view_button: table)表数据库访问层 * * @author makejava - * @since 2024-05-30 17:05:15 + * @since 2024-06-03 08:48:46 */ public interface IMdmModuleViewButtonDao extends IBaseDao { diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleViewButton/dao/impl/MdmModuleViewButtonDaoImpl.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleViewButton/dao/impl/MdmModuleViewButtonDaoImpl.java index de0814cd..6d790b3e 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleViewButton/dao/impl/MdmModuleViewButtonDaoImpl.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleViewButton/dao/impl/MdmModuleViewButtonDaoImpl.java @@ -8,7 +8,7 @@ import com.hzya.frame.basedao.dao.MybatisGenericDao; * 主数据视图按钮表(MdmModuleViewButton)表数据库访问层 * * @author makejava - * @since 2024-05-30 17:05:15 + * @since 2024-06-03 08:48:46 */ @Repository(value = "MdmModuleViewButtonDaoImpl") public class MdmModuleViewButtonDaoImpl extends MybatisGenericDao implements IMdmModuleViewButtonDao{ 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 2cbfd6b1..261b8bdf 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 @@ -6,7 +6,7 @@ import com.hzya.frame.web.entity.BaseEntity; * 主数据视图按钮表(MdmModuleViewButton)实体类 * * @author makejava - * @since 2024-05-30 17:05:15 + * @since 2024-06-03 08:48:46 */ public class MdmModuleViewButtonEntity extends BaseEntity { diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleViewButton/service/IMdmModuleViewButtonService.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleViewButton/service/IMdmModuleViewButtonService.java index edea1981..b5e0ce7e 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleViewButton/service/IMdmModuleViewButtonService.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleViewButton/service/IMdmModuleViewButtonService.java @@ -6,7 +6,7 @@ import com.hzya.frame.basedao.service.IBaseService; * 主数据视图按钮表(MdmModuleViewButton)表服务接口 * * @author makejava - * @since 2024-05-30 17:05:15 + * @since 2024-06-03 08:48:46 */ public interface IMdmModuleViewButtonService extends IBaseService{ } diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleViewButton/service/impl/MdmModuleViewButtonServiceImpl.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleViewButton/service/impl/MdmModuleViewButtonServiceImpl.java index 053d5c82..5b05c552 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleViewButton/service/impl/MdmModuleViewButtonServiceImpl.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleViewButton/service/impl/MdmModuleViewButtonServiceImpl.java @@ -11,7 +11,7 @@ import com.hzya.frame.basedao.service.impl.BaseService; * 主数据视图按钮表(MdmModuleViewButton)表服务实现类 * * @author makejava - * @since 2024-05-30 17:05:15 + * @since 2024-06-03 08:48:46 */ @Service(value = "mdmModuleViewButtonService") public class MdmModuleViewButtonServiceImpl extends BaseService implements IMdmModuleViewButtonService { diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleViewDetail/dao/IMdmModuleViewDetailDao.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleViewDetail/dao/IMdmModuleViewDetailDao.java index 91379efb..248da365 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleViewDetail/dao/IMdmModuleViewDetailDao.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleViewDetail/dao/IMdmModuleViewDetailDao.java @@ -7,7 +7,7 @@ import com.hzya.frame.basedao.dao.IBaseDao; * 主数据视图明细表(mdm_module_view_detail: table)表数据库访问层 * * @author makejava - * @since 2024-05-30 17:04:17 + * @since 2024-06-03 08:48:55 */ public interface IMdmModuleViewDetailDao extends IBaseDao { diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleViewDetail/dao/impl/MdmModuleViewDetailDaoImpl.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleViewDetail/dao/impl/MdmModuleViewDetailDaoImpl.java index 25f67fce..4b692a49 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleViewDetail/dao/impl/MdmModuleViewDetailDaoImpl.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleViewDetail/dao/impl/MdmModuleViewDetailDaoImpl.java @@ -8,7 +8,7 @@ import com.hzya.frame.basedao.dao.MybatisGenericDao; * 主数据视图明细表(MdmModuleViewDetail)表数据库访问层 * * @author makejava - * @since 2024-05-30 17:04:17 + * @since 2024-06-03 08:48:55 */ @Repository(value = "MdmModuleViewDetailDaoImpl") public class MdmModuleViewDetailDaoImpl extends MybatisGenericDao implements IMdmModuleViewDetailDao{ 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 7d481354..e49e3044 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 @@ -6,7 +6,7 @@ import com.hzya.frame.web.entity.BaseEntity; * 主数据视图明细表(MdmModuleViewDetail)实体类 * * @author makejava - * @since 2024-05-30 17:04:17 + * @since 2024-06-03 08:48:55 */ public class MdmModuleViewDetailEntity extends BaseEntity { diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleViewDetail/service/IMdmModuleViewDetailService.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleViewDetail/service/IMdmModuleViewDetailService.java index 724604c9..cea4b1dc 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleViewDetail/service/IMdmModuleViewDetailService.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleViewDetail/service/IMdmModuleViewDetailService.java @@ -6,7 +6,7 @@ import com.hzya.frame.basedao.service.IBaseService; * 主数据视图明细表(MdmModuleViewDetail)表服务接口 * * @author makejava - * @since 2024-05-30 17:04:17 + * @since 2024-06-03 08:48:55 */ public interface IMdmModuleViewDetailService extends IBaseService{ } diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleViewDetail/service/impl/MdmModuleViewDetailServiceImpl.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleViewDetail/service/impl/MdmModuleViewDetailServiceImpl.java index b5995fe9..34ffa328 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleViewDetail/service/impl/MdmModuleViewDetailServiceImpl.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleViewDetail/service/impl/MdmModuleViewDetailServiceImpl.java @@ -11,7 +11,7 @@ import com.hzya.frame.basedao.service.impl.BaseService; * 主数据视图明细表(MdmModuleViewDetail)表服务实现类 * * @author makejava - * @since 2024-05-30 17:04:17 + * @since 2024-06-03 08:48:55 */ @Service(value = "mdmModuleViewDetailService") public class MdmModuleViewDetailServiceImpl extends BaseService implements IMdmModuleViewDetailService { From 9aceb2f78b5440339177aa0fca88e9c088c63fd8 Mon Sep 17 00:00:00 2001 From: lvleigang <957075182@qq.com> Date: Mon, 3 Jun 2024 13:39:48 +0800 Subject: [PATCH 12/31] =?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 --- .../com/hzya/frame/mdm/entity/MdmDto.java | 52 + .../mdm/mdmModule/dao/IMdmModuleDao.java | 11 +- .../mdmModule/dao/impl/MdmModuleDaoImpl.java | 24 +- .../mdm/mdmModule/entity/MdmModuleEntity.java | 19 + .../mdm/mdmModule/entity/MdmModuleEntity.xml | 63 +- .../mdmModuleDb/entity/MdmModuleDbEntity.java | 22 + .../mdmModuleDb/entity/MdmModuleDbEntity.xml | 8 +- .../entity/MdmModuleDbFiledsEntity.java | 22 +- .../entity/MdmModuleDbFiledsEntity.xml | 8 +- .../entity/MdmModuleDbFiledsRuleEntity.java | 10 +- .../entity/MdmModuleDbFiledsRuleEntity.xml | 8 +- .../entity/MdmModuleDistributeEntity.xml | 8 +- .../MdmModuleDistributeDetailEntity.xml | 8 +- .../entity/MdmModuleViewEntity.xml | 8 +- .../entity/MdmModuleViewButtonEntity.xml | 8 +- .../entity/MdmModuleViewDetailEntity.xml | 8 +- .../dao/IMdmTableCodeRuleDao.java | 15 + .../dao/impl/MdmTableCodeRuleDaoImpl.java | 17 + .../entity/MdmTableCodeRuleEntity.java | 86 + .../entity/MdmTableCodeRuleEntity.xml | 265 ++ .../service/IMdmTableCodeRuleService.java | 12 + .../impl/MdmTableCodeRuleServiceImpl.java | 26 + .../hzya/frame/mdm/service/IMdmService.java | 256 ++ .../frame/mdm/service/IMdmServiceCache.java | 37 + .../mdm/service/impl/MdmServiceCache.java | 103 + .../mdm/service/impl/MdmServiceImpl.java | 3217 +++++++++++++++++ .../sysnew/login/impl/LoginServiceImpl.java | 60 +- 27 files changed, 4302 insertions(+), 79 deletions(-) create mode 100644 service/src/main/java/com/hzya/frame/mdm/entity/MdmDto.java create mode 100644 service/src/main/java/com/hzya/frame/mdm/mdmTableCodeRule/dao/IMdmTableCodeRuleDao.java create mode 100644 service/src/main/java/com/hzya/frame/mdm/mdmTableCodeRule/dao/impl/MdmTableCodeRuleDaoImpl.java create mode 100644 service/src/main/java/com/hzya/frame/mdm/mdmTableCodeRule/entity/MdmTableCodeRuleEntity.java create mode 100644 service/src/main/java/com/hzya/frame/mdm/mdmTableCodeRule/entity/MdmTableCodeRuleEntity.xml create mode 100644 service/src/main/java/com/hzya/frame/mdm/mdmTableCodeRule/service/IMdmTableCodeRuleService.java create mode 100644 service/src/main/java/com/hzya/frame/mdm/mdmTableCodeRule/service/impl/MdmTableCodeRuleServiceImpl.java create mode 100644 service/src/main/java/com/hzya/frame/mdm/service/IMdmServiceCache.java create mode 100644 service/src/main/java/com/hzya/frame/mdm/service/impl/MdmServiceCache.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 new file mode 100644 index 00000000..b5e8332d --- /dev/null +++ b/service/src/main/java/com/hzya/frame/mdm/entity/MdmDto.java @@ -0,0 +1,52 @@ +package com.hzya.frame.mdm.entity; + + +import com.hzya.frame.mdm.mdmModuleDb.entity.MdmModuleDbEntity; +import com.hzya.frame.mdm.mdmTableCodeRule.entity.MdmTableCodeRuleEntity; + +import java.util.List; + +public class MdmDto { + + //主数据编码 + private Long mdmCode; + //单据编码规则 + private List mdmTableCodeRuleEntityList; + //主数据主表 + private MdmModuleDbEntity mainMdmModuleDb; + //主数据子表 + private List sublistMdmModuleDb; + + public Long getMdmCode() { + return mdmCode; + } + + public void setMdmCode(Long mdmCode) { + this.mdmCode = mdmCode; + } + + public List getMdmTableCodeRuleEntityList() { + return mdmTableCodeRuleEntityList; + } + + public void setMdmTableCodeRuleEntityList(List mdmTableCodeRuleEntityList) { + this.mdmTableCodeRuleEntityList = mdmTableCodeRuleEntityList; + } + + 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/mdmModule/dao/IMdmModuleDao.java b/service/src/main/java/com/hzya/frame/mdm/mdmModule/dao/IMdmModuleDao.java index a4c661ae..8dcabbcb 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,7 +1,10 @@ package com.hzya.frame.mdm.mdmModule.dao; import com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity; -import com.hzya.frame.basedao.dao.IBaseDao; +import com.hzya.frame.basedao.dao.IBaseDao; + +import java.util.List; +import java.util.Map; /** * 主数据模版(mdm_module: table)表数据库访问层 @@ -11,5 +14,11 @@ import com.hzya.frame.basedao.dao.IBaseDao; */ public interface IMdmModuleDao extends IBaseDao { + List queryMdm(MdmModuleEntity entity); + + MdmModuleEntity getByMdmCode(Long mdmCode); + + Integer checkTable(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 a7fa1684..fda4b148 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 @@ -4,6 +4,10 @@ import com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity; import com.hzya.frame.mdm.mdmModule.dao.IMdmModuleDao; import org.springframework.stereotype.Repository; import com.hzya.frame.basedao.dao.MybatisGenericDao; + +import java.util.List; +import java.util.Map; + /** * 主数据模版(MdmModule)表数据库访问层 * @@ -12,6 +16,24 @@ import com.hzya.frame.basedao.dao.MybatisGenericDao; */ @Repository(value = "MdmModuleDaoImpl") public class MdmModuleDaoImpl extends MybatisGenericDao implements IMdmModuleDao{ - + + @Override + public List queryMdm(MdmModuleEntity entity) { + List o = (List) super.selectList(getSqlIdPrifx() + "queryMdm", entity); + return o; + } + + @Override + public MdmModuleEntity getByMdmCode(Long mdmCode) { + MdmModuleEntity mdmModuleEntity = (MdmModuleEntity) super.query(getSqlIdPrifx() + "getByMdmCode",mdmCode); + return mdmModuleEntity; + } + + @Override + public Integer checkTable(Map maps) { + Integer o = (Integer) super.selectOne(getSqlIdPrifx() + "checkTable", maps); + return o; + + } } diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModule/entity/MdmModuleEntity.java b/service/src/main/java/com/hzya/frame/mdm/mdmModule/entity/MdmModuleEntity.java index 2d34005d..ab16aca7 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModule/entity/MdmModuleEntity.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModule/entity/MdmModuleEntity.java @@ -22,6 +22,10 @@ public class MdmModuleEntity extends BaseEntity { private String remark; /** 公司id */ private String companyId; + //创建人 + private String createUser; + //修改人 + private String modifyUser; public String getMdmName() { @@ -72,5 +76,20 @@ public class MdmModuleEntity extends BaseEntity { this.companyId = companyId; } + public String getModifyUser() { + return modifyUser; + } + + public void setModifyUser(String modifyUser) { + this.modifyUser = modifyUser; + } + + public String getCreateUser() { + return createUser; + } + + public void setCreateUser(String createUser) { + this.createUser = createUser; + } } 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 f9902171..f323ccab 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 @@ -9,6 +9,8 @@ + + @@ -35,6 +37,12 @@ ,org_id ,company_id + + - + insert into mdm_module( id , mdm_name , mdm_logo , mdm_code , + mdm_code , mdm_type , remark , sorts , @@ -155,7 +164,6 @@ sts , org_id , company_id , - sorts, sts, )values( @@ -164,6 +172,7 @@ #{mdmName} , #{mdmLogo} , #{mdmCode} , + (SELECT IFNULL(MAX(b.mdm_code)+1,10001) AS mdmCode FROM mdm_module b ), #{mdmType} , #{remark} , #{sorts} , @@ -174,13 +183,12 @@ #{sts} , #{org_id} , #{companyId} , - (select (max(IFNULL( a.sorts, 0 )) + 1) as sort from mdm_module a WHERE a.sts = 'Y' ), '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 @@ -188,7 +196,7 @@ - + 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 @@ -251,6 +259,51 @@ update mdm_module set sts= 'N' ,modify_time = #{modify_time},modify_user_id = # delete from mdm_module where id = #{id} + + + + + + diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDb/entity/MdmModuleDbEntity.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDb/entity/MdmModuleDbEntity.java index ae612a36..71ad1ac2 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDb/entity/MdmModuleDbEntity.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDb/entity/MdmModuleDbEntity.java @@ -1,6 +1,10 @@ package com.hzya.frame.mdm.mdmModuleDb.entity; import java.util.Date; +import java.util.List; + +import com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity; +import com.hzya.frame.mdm.mdmModuleDbFiledsRule.entity.MdmModuleDbFiledsRuleEntity; import com.hzya.frame.web.entity.BaseEntity; /** * 模版数据库表(MdmModuleDb)实体类 @@ -20,6 +24,9 @@ public class MdmModuleDbEntity extends BaseEntity { private String remark; /** 公司id */ private String companyId; + /** 数据类型 1、新增 2、修改 */ + private String dataType; + private List sublistMdmModuleDbFileds; public String getMdmId() { @@ -62,5 +69,20 @@ public class MdmModuleDbEntity extends BaseEntity { this.companyId = companyId; } + public List getSublistMdmModuleDbFileds() { + return sublistMdmModuleDbFileds; + } + + public void setSublistMdmModuleDbFileds(List sublistMdmModuleDbFileds) { + this.sublistMdmModuleDbFileds = sublistMdmModuleDbFileds; + } + + public String getDataType() { + return dataType; + } + + public void setDataType(String dataType) { + this.dataType = dataType; + } } 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 09204cac..383d4ca7 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 @@ -132,7 +132,7 @@ - + insert into mdm_module_db( id , @@ -148,7 +148,6 @@ sts , org_id , company_id , - sorts, sts, )values( @@ -166,13 +165,12 @@ #{sts} , #{org_id} , #{companyId} , - (select (max(IFNULL( a.sorts, 0 )) + 1) as sort from mdm_module_db a WHERE a.sts = 'Y' ), '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 @@ -180,7 +178,7 @@ - + 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 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 4453cbd2..194a0ace 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,6 +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; /** * 模版数据库字段表(MdmModuleDbFileds)实体类 @@ -36,7 +39,9 @@ public class MdmModuleDbFiledsEntity extends BaseEntity { private String filedLength; /** 公司id */ private String companyId; - + /** 数据类型 1、新增 2、修改 */ + private String dataType; + private List mdmModuleDbFiledsRules; public String getMdmId() { return mdmId; @@ -142,5 +147,20 @@ public class MdmModuleDbFiledsEntity extends BaseEntity { this.companyId = companyId; } + public List getMdmModuleDbFiledsRules() { + return mdmModuleDbFiledsRules; + } + + public void setMdmModuleDbFiledsRules(List mdmModuleDbFiledsRules) { + this.mdmModuleDbFiledsRules = mdmModuleDbFiledsRules; + } + + public String getDataType() { + return dataType; + } + + public void setDataType(String dataType) { + this.dataType = dataType; + } } 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 5cfc68c1..8e4d37a4 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 @@ -180,7 +180,7 @@ - + insert into mdm_module_db_fileds( id , @@ -204,7 +204,6 @@ sts , org_id , company_id , - sorts, sts, )values( @@ -230,13 +229,12 @@ #{sts} , #{org_id} , #{companyId} , - (select (max(IFNULL( a.sorts, 0 )) + 1) as sort from mdm_module_db_fileds a WHERE a.sts = 'Y' ), 'Y', ) - + insert into mdm_module_db_fileds(mdm_id, db_id, ch_name, en_name, filed_type, add_type, update_type, show_type, query_type, list_type, view_type, filed_length, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, sts) values @@ -244,7 +242,7 @@ - + insert into mdm_module_db_fileds(mdm_id, db_id, ch_name, en_name, filed_type, add_type, update_type, show_type, query_type, list_type, view_type, filed_length, 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/mdmModuleDbFiledsRule/entity/MdmModuleDbFiledsRuleEntity.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDbFiledsRule/entity/MdmModuleDbFiledsRuleEntity.java index 59f24cfb..e0031f98 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleDbFiledsRule/entity/MdmModuleDbFiledsRuleEntity.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDbFiledsRule/entity/MdmModuleDbFiledsRuleEntity.java @@ -28,7 +28,8 @@ public class MdmModuleDbFiledsRuleEntity extends BaseEntity { private String ruleType; /** 公司id */ private String companyId; - + /** 数据类型 1、新增 2、修改 */ + private String dataType; public String getMdmId() { return mdmId; @@ -102,5 +103,12 @@ public class MdmModuleDbFiledsRuleEntity 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/mdmModuleDbFiledsRule/entity/MdmModuleDbFiledsRuleEntity.xml b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDbFiledsRule/entity/MdmModuleDbFiledsRuleEntity.xml index 94ea0aa7..2d1e1e9f 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 @@ -156,7 +156,7 @@ - + insert into mdm_module_db_fileds_rule( id , @@ -176,7 +176,6 @@ sts , org_id , company_id , - sorts, sts, )values( @@ -198,13 +197,12 @@ #{sts} , #{org_id} , #{companyId} , - (select (max(IFNULL( a.sorts, 0 )) + 1) as sort from mdm_module_db_fileds_rule a WHERE a.sts = 'Y' ), 'Y', ) - + insert into mdm_module_db_fileds_rule(mdm_id, form_name, db_id, filed_id, rule_name, rule_code, rule_value, rule_type, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, sts) values @@ -212,7 +210,7 @@ - + insert into mdm_module_db_fileds_rule(mdm_id, form_name, db_id, filed_id, rule_name, rule_code, rule_value, rule_type, 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/mdmModuleDistribute/entity/MdmModuleDistributeEntity.xml b/service/src/main/java/com/hzya/frame/mdm/mdmModuleDistribute/entity/MdmModuleDistributeEntity.xml index 2690bdf6..82243342 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 @@ -144,7 +144,7 @@ - + insert into mdm_module_distribute( id , @@ -162,7 +162,6 @@ sts , org_id , company_id , - sorts, sts, )values( @@ -182,13 +181,12 @@ #{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) values @@ -196,7 +194,7 @@ - + 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) values 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 ca6fe0c9..15113e4f 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 @@ -150,7 +150,7 @@ - + insert into mdm_module_distribute_detail( id , @@ -169,7 +169,6 @@ sts , org_id , company_id , - sorts, sts, )values( @@ -190,13 +189,12 @@ #{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) values @@ -204,7 +202,7 @@ - + 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) values diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleView/entity/MdmModuleViewEntity.xml b/service/src/main/java/com/hzya/frame/mdm/mdmModuleView/entity/MdmModuleViewEntity.xml index 2e99cc32..0e990f0d 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleView/entity/MdmModuleViewEntity.xml +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleView/entity/MdmModuleViewEntity.xml @@ -132,7 +132,7 @@ - + insert into mdm_module_view( id , @@ -148,7 +148,6 @@ sts , org_id , company_id , - sorts, sts, )values( @@ -166,13 +165,12 @@ #{sts} , #{org_id} , #{companyId} , - (select (max(IFNULL( a.sorts, 0 )) + 1) as sort from mdm_module_view a WHERE a.sts = 'Y' ), 'Y', ) - + insert into mdm_module_view(mdm_id, view_name, view_filed, up_id_filed, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, sts) values @@ -180,7 +178,7 @@ - + insert into mdm_module_view(mdm_id, view_name, view_filed, up_id_filed, 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/mdmModuleViewButton/entity/MdmModuleViewButtonEntity.xml b/service/src/main/java/com/hzya/frame/mdm/mdmModuleViewButton/entity/MdmModuleViewButtonEntity.xml index 05cf8351..e13d7aa0 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleViewButton/entity/MdmModuleViewButtonEntity.xml +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleViewButton/entity/MdmModuleViewButtonEntity.xml @@ -132,7 +132,7 @@ - + insert into mdm_module_view_button( id , @@ -148,7 +148,6 @@ sts , org_id , company_id , - sorts, sts, )values( @@ -166,13 +165,12 @@ #{sts} , #{org_id} , #{companyId} , - (select (max(IFNULL( a.sorts, 0 )) + 1) as sort from mdm_module_view_button a WHERE a.sts = 'Y' ), 'Y', ) - + insert into mdm_module_view_button(mdm_id, view_id, button_type, button_value, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, sts) values @@ -180,7 +178,7 @@ - + insert into mdm_module_view_button(mdm_id, view_id, button_type, button_value, 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/mdmModuleViewDetail/entity/MdmModuleViewDetailEntity.xml b/service/src/main/java/com/hzya/frame/mdm/mdmModuleViewDetail/entity/MdmModuleViewDetailEntity.xml index c995e929..1b61a2da 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleViewDetail/entity/MdmModuleViewDetailEntity.xml +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleViewDetail/entity/MdmModuleViewDetailEntity.xml @@ -132,7 +132,7 @@ - + insert into mdm_module_view_detail( id , @@ -148,7 +148,6 @@ sts , org_id , company_id , - sorts, sts, )values( @@ -166,13 +165,12 @@ #{sts} , #{org_id} , #{companyId} , - (select (max(IFNULL( a.sorts, 0 )) + 1) as sort from mdm_module_view_detail a WHERE a.sts = 'Y' ), 'Y', ) - + insert into mdm_module_view_detail(mdm_id, view_id, view_filed, view_type, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, sts) values @@ -180,7 +178,7 @@ - + insert into mdm_module_view_detail(mdm_id, view_id, view_filed, view_type, 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/mdmTableCodeRule/dao/IMdmTableCodeRuleDao.java b/service/src/main/java/com/hzya/frame/mdm/mdmTableCodeRule/dao/IMdmTableCodeRuleDao.java new file mode 100644 index 00000000..bf6031ad --- /dev/null +++ b/service/src/main/java/com/hzya/frame/mdm/mdmTableCodeRule/dao/IMdmTableCodeRuleDao.java @@ -0,0 +1,15 @@ +package com.hzya.frame.mdm.mdmTableCodeRule.dao; + +import com.hzya.frame.mdm.mdmTableCodeRule.entity.MdmTableCodeRuleEntity; +import com.hzya.frame.basedao.dao.IBaseDao; + +/** + * 模版数据表编码规则表(mdm_table_code_rule: table)表数据库访问层 + * + * @author makejava + * @since 2024-06-03 10:56:13 + */ +public interface IMdmTableCodeRuleDao extends IBaseDao { + +} + diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmTableCodeRule/dao/impl/MdmTableCodeRuleDaoImpl.java b/service/src/main/java/com/hzya/frame/mdm/mdmTableCodeRule/dao/impl/MdmTableCodeRuleDaoImpl.java new file mode 100644 index 00000000..3f47ae31 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/mdm/mdmTableCodeRule/dao/impl/MdmTableCodeRuleDaoImpl.java @@ -0,0 +1,17 @@ +package com.hzya.frame.mdm.mdmTableCodeRule.dao.impl; + +import com.hzya.frame.mdm.mdmTableCodeRule.entity.MdmTableCodeRuleEntity; +import com.hzya.frame.mdm.mdmTableCodeRule.dao.IMdmTableCodeRuleDao; +import org.springframework.stereotype.Repository; +import com.hzya.frame.basedao.dao.MybatisGenericDao; +/** + * 模版数据表编码规则表(MdmTableCodeRule)表数据库访问层 + * + * @author makejava + * @since 2024-06-03 10:56:13 + */ +@Repository(value = "MdmTableCodeRuleDaoImpl") +public class MdmTableCodeRuleDaoImpl extends MybatisGenericDao implements IMdmTableCodeRuleDao{ + +} + diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmTableCodeRule/entity/MdmTableCodeRuleEntity.java b/service/src/main/java/com/hzya/frame/mdm/mdmTableCodeRule/entity/MdmTableCodeRuleEntity.java new file mode 100644 index 00000000..0b5c0531 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/mdm/mdmTableCodeRule/entity/MdmTableCodeRuleEntity.java @@ -0,0 +1,86 @@ +package com.hzya.frame.mdm.mdmTableCodeRule.entity; + +import java.util.Date; +import com.hzya.frame.web.entity.BaseEntity; +/** + * 模版数据表编码规则表(MdmTableCodeRule)实体类 + * + * @author makejava + * @since 2024-06-03 10:56:13 + */ +public class MdmTableCodeRuleEntity extends BaseEntity { + + /** 主数据模版ID */ + private String mdmId; + /** db_id */ + private String dbId; + /** 规则 */ + private String dbName; + /** 类型 1、固定值 2、日期 3、流水 */ + private String dbType; + /** 备注 */ + private String remark; + /** 规则值 */ + private String dbValue; + /** 公司id */ + private String companyId; + + + 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 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 getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark; + } + + public String getDbValue() { + return dbValue; + } + + public void setDbValue(String dbValue) { + this.dbValue = dbValue; + } + + public String getCompanyId() { + return companyId; + } + + public void setCompanyId(String companyId) { + this.companyId = companyId; + } + +} + diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmTableCodeRule/entity/MdmTableCodeRuleEntity.xml b/service/src/main/java/com/hzya/frame/mdm/mdmTableCodeRule/entity/MdmTableCodeRuleEntity.xml new file mode 100644 index 00000000..20bf14eb --- /dev/null +++ b/service/src/main/java/com/hzya/frame/mdm/mdmTableCodeRule/entity/MdmTableCodeRuleEntity.xml @@ -0,0 +1,265 @@ + + + + + + + + + + + + + + + + + + + + + + + + id + ,mdm_id + ,db_id + ,db_name + ,db_type + ,remark + ,db_value + ,sorts + ,create_user_id + ,create_time + ,modify_user_id + ,modify_time + ,sts + ,org_id + ,company_id + + + + + + + + + + + + + + + + insert into mdm_table_code_rule( + + id , + mdm_id , + db_id , + db_name , + db_type , + remark , + db_value , + sorts , + create_user_id , + create_time , + modify_user_id , + modify_time , + sts , + org_id , + company_id , + sts, + + )values( + + #{id} , + #{mdmId} , + #{dbId} , + #{dbName} , + #{dbType} , + #{remark} , + #{dbValue} , + #{sorts} , + #{create_user_id} , + #{create_time} , + #{modify_user_id} , + #{modify_time} , + #{sts} , + #{org_id} , + #{companyId} , + 'Y', + + ) + + + + insert into mdm_table_code_rule(mdm_id, db_id, db_name, db_type, remark, db_value, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, sts) + values + + (#{entity.mdmId},#{entity.dbId},#{entity.dbName},#{entity.dbType},#{entity.remark},#{entity.dbValue},#{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_table_code_rule(mdm_id, db_id, db_name, db_type, remark, db_value, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id) + values + + (#{entity.mdmId},#{entity.dbId},#{entity.dbName},#{entity.dbType},#{entity.remark},#{entity.dbValue},#{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_id = values(db_id), + db_name = values(db_name), + db_type = values(db_type), + remark = values(remark), + db_value = values(db_value), + 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_table_code_rule set + + mdm_id = #{mdmId}, + db_id = #{dbId}, + db_name = #{dbName}, + db_type = #{dbType}, + remark = #{remark}, + db_value = #{dbValue}, + 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_table_code_rule set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} +where id = #{id} + + + +update mdm_table_code_rule set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} + + and id = #{id} + and mdm_id = #{mdmId} + and db_id = #{dbId} + and db_name = #{dbName} + and db_type = #{dbType} + and remark = #{remark} + and db_value = #{dbValue} + and sorts = #{sorts} + and sts = #{sts} + and company_id = #{companyId} + and sts='Y' + + + + + delete from mdm_table_code_rule where id = #{id} + + + + diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmTableCodeRule/service/IMdmTableCodeRuleService.java b/service/src/main/java/com/hzya/frame/mdm/mdmTableCodeRule/service/IMdmTableCodeRuleService.java new file mode 100644 index 00000000..17dbe140 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/mdm/mdmTableCodeRule/service/IMdmTableCodeRuleService.java @@ -0,0 +1,12 @@ +package com.hzya.frame.mdm.mdmTableCodeRule.service; + +import com.hzya.frame.mdm.mdmTableCodeRule.entity.MdmTableCodeRuleEntity; +import com.hzya.frame.basedao.service.IBaseService; +/** + * 模版数据表编码规则表(MdmTableCodeRule)表服务接口 + * + * @author makejava + * @since 2024-06-03 10:56:13 + */ +public interface IMdmTableCodeRuleService extends IBaseService{ +} diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmTableCodeRule/service/impl/MdmTableCodeRuleServiceImpl.java b/service/src/main/java/com/hzya/frame/mdm/mdmTableCodeRule/service/impl/MdmTableCodeRuleServiceImpl.java new file mode 100644 index 00000000..314a261a --- /dev/null +++ b/service/src/main/java/com/hzya/frame/mdm/mdmTableCodeRule/service/impl/MdmTableCodeRuleServiceImpl.java @@ -0,0 +1,26 @@ +package com.hzya.frame.mdm.mdmTableCodeRule.service.impl; + +import com.hzya.frame.mdm.mdmTableCodeRule.entity.MdmTableCodeRuleEntity; +import com.hzya.frame.mdm.mdmTableCodeRule.dao.IMdmTableCodeRuleDao; +import com.hzya.frame.mdm.mdmTableCodeRule.service.IMdmTableCodeRuleService; +import org.springframework.stereotype.Service; +import org.springframework.beans.factory.annotation.Autowired; +import javax.annotation.Resource; +import com.hzya.frame.basedao.service.impl.BaseService; +/** + * 模版数据表编码规则表(MdmTableCodeRule)表服务实现类 + * + * @author makejava + * @since 2024-06-03 10:56:13 + */ +@Service(value = "mdmTableCodeRuleService") +public class MdmTableCodeRuleServiceImpl extends BaseService implements IMdmTableCodeRuleService { + + private IMdmTableCodeRuleDao mdmTableCodeRuleDao; + + @Autowired + public void setMdmTableCodeRuleDao(IMdmTableCodeRuleDao dao) { + this.mdmTableCodeRuleDao = dao; + this.dao = dao; + } +} 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 9c4de712..40968767 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,5 +8,261 @@ 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 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 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 + // * @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 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 处理分发数据 + // * @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 new file mode 100644 index 00000000..56dc07d0 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/mdm/service/IMdmServiceCache.java @@ -0,0 +1,37 @@ +package com.hzya.frame.mdm.service; + +import com.alibaba.fastjson.JSONObject; +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.mdmTableCodeRule.entity.MdmTableCodeRuleEntity; +import com.hzya.frame.web.entity.JsonResultEntity; + +import java.util.List; + +/** + * 主数据服务接口 + */ +public interface IMdmServiceCache { + + + /** + * @Author lvleigang + * @Description 获取模版主表 + * @Date 10:13 上午 2024/6/3 + * @param mdmCode + * @return com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity + **/ + MdmModuleEntity getMdmModuleEntity(Long mdmCode); + + 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 new file mode 100644 index 00000000..dcafef9a --- /dev/null +++ b/service/src/main/java/com/hzya/frame/mdm/service/impl/MdmServiceCache.java @@ -0,0 +1,103 @@ +package com.hzya.frame.mdm.service.impl; + +import com.alibaba.fastjson.JSONObject; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import com.hzya.frame.mdm.mdmModule.dao.IMdmModuleDao; +import com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity; +import com.hzya.frame.mdm.mdmModuleDb.dao.IMdmModuleDbDao; +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.mdmModuleDistributeDetail.dao.IMdmModuleDistributeDetailDao; +import com.hzya.frame.mdm.mdmModuleView.dao.IMdmModuleViewDao; +import com.hzya.frame.mdm.mdmModuleViewButton.dao.IMdmModuleViewButtonDao; +import com.hzya.frame.mdm.mdmModuleViewDetail.dao.IMdmModuleViewDetailDao; +import com.hzya.frame.mdm.mdmTableCodeRule.dao.IMdmTableCodeRuleDao; +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.web.entity.BaseResult; +import com.hzya.frame.web.entity.JsonResultEntity; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.cache.annotation.CacheEvict; +import org.springframework.cache.annotation.Cacheable; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.List; + + +/** + * 主数据服务实现类 + */ +@Service(value = "mdmServiceCache") +public class MdmServiceCache implements IMdmServiceCache { + private final Logger logger = LoggerFactory.getLogger(this.getClass()); + @Resource + private IMdmModuleDao mdmModuleDao; + @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; + @Resource + private IMdmTableCodeRuleDao mdmTableCodeRuleDao; + + @Override + @Cacheable(cacheNames="mdmModule",key = "#mdmCode") + public MdmModuleEntity getMdmModuleEntity(Long mdmCode) { + MdmModuleEntity entity = mdmModuleDao.getByMdmCode(mdmCode); + return entity; + } + + @Override + @CacheEvict(cacheNames="mdmModule",key = "#entity.mdmCode") + public void updateMdmModuleEntity(MdmModuleEntity entity) { + mdmModuleDao.update(entity); + } + + @Override + @Cacheable(cacheNames="mdmTableCodeRule",key = "#mdmId") + public List queryMdmTableCodeRuleEntity(MdmTableCodeRuleEntity entity) { + List mdmTableCodeRuleEntityList = mdmTableCodeRuleDao.queryBase(entity); + return mdmTableCodeRuleEntityList; + } + + @Override + @Cacheable(cacheNames="mdmModuleDb",key = "#mdmId") + public List queryMdmModuleDb(MdmModuleDbEntity entity) { + List mdmModuleDbEntities = mdmModuleDbDao.queryBase(entity); + return mdmModuleDbEntities; + } + + @Override + @Cacheable(cacheNames="mdmModuleDbFileds",key = "#mdmId") + public List queryMdmModuleDbFileds(MdmModuleDbFiledsEntity entity) { + List mdmModuleDbFiledsEntities = mdmModuleDbFiledsDao.queryBase(entity); + return mdmModuleDbFiledsEntities; + } + + @Override + @Cacheable(cacheNames="mdmModuleDbFiledsRule",key = "#mdmId") + public List queryMdmModuleDbFiledsRule(MdmModuleDbFiledsRuleEntity entity) { + List mdmModuleDbFiledsRuleEntities = mdmModuleDbFiledsRuleDao.queryBase(entity); + return mdmModuleDbFiledsRuleEntities; + } +} 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 620dc735..99506fb6 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,11 +1,58 @@ 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.MdmDbVo; +import com.hzya.frame.mdm.entity.MdmDto; +import com.hzya.frame.mdm.mdmModule.dao.IMdmModuleDao; +import com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity; +import com.hzya.frame.mdm.mdmModuleDb.dao.IMdmModuleDbDao; +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.mdmModuleView.dao.IMdmModuleViewDao; +import com.hzya.frame.mdm.mdmModuleView.entity.MdmModuleViewEntity; +import com.hzya.frame.mdm.mdmModuleViewButton.dao.IMdmModuleViewButtonDao; +import com.hzya.frame.mdm.mdmModuleViewDetail.dao.IMdmModuleViewDetailDao; +import com.hzya.frame.mdm.mdmModuleViewDetail.entity.MdmModuleViewDetailEntity; +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.entity.SysButtonConfigEntity; +import com.hzya.frame.sysnew.menuConfig.entity.SysMenuConfigEntity; +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.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; +import java.util.Objects; +import java.util.stream.Collectors; /** @@ -15,5 +62,3175 @@ import org.springframework.stereotype.Service; public class MdmServiceImpl implements IMdmService { private final Logger logger = LoggerFactory.getLogger(this.getClass()); + @Resource + private IMdmModuleDao mdmModuleDao; + @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 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("系统错误"); + } + //修改 + 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 (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())){ + + } + + + //明细表 + + + + ////设置保存主表和字段以及字段的属性 + //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); + + 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 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 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 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 + // * @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 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 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 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 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 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 + // * @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())) { + // //查询模版 + // 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()); + // } + // + // + // 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("系统错误"); + // } + // //查询模版 + // 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); + // } + //} + // + //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("参数不允许为空"); + // } + // 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); + // } + // + // + // 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 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 { + // 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 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; + } } 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 0a299f73..48fb1f2c 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 @@ -67,36 +67,36 @@ public class LoginServiceImpl implements ILoginService { return BaseResult.getFailureMessageEntity("当前用户已停用,请先启用"); } //校验当前登陆人是否有权限 - boolean flag = false; - SysInterfaceEntity sysInterfaceEntity = (SysInterfaceEntity) interfaceCache.get("6","beanNameloginServiceinterfacNamedoLogin"); - if(sysInterfaceEntity == null || sysInterfaceEntity.getId() == null){ - return BaseResult.getFailureMessageEntity("用户无访问权限,请联系管理员"); - } - //查询用户权限 - if(!flag){ - SysPopedomInterfaceEntity userPopedomInterfaceEntity = (SysPopedomInterfaceEntity) interfaceCache.get("4","userId"+sysUserEntity.getId()+"interfaceId"+sysInterfaceEntity.getId()); - if(userPopedomInterfaceEntity != null && userPopedomInterfaceEntity.getId() != null ){ - flag = true; - } - } - //查询用户角色的权限 - if(!flag){ - List userRoleMap = (List) interfaceCache.get("3",null); - if(userRoleMap != null && userRoleMap.size() > 0){ - for (SysUserRolesEntity sysUserRolesEntity : userRoleMap) { - if(sysUserRolesEntity.getUserId().equals(sysUserEntity.getId())){ - SysPopedomInterfaceEntity sysPopedomInterfaceEntity = (SysPopedomInterfaceEntity) interfaceCache.get("5","roleId"+sysUserRolesEntity.getRoleId()+"interfaceId"+sysInterfaceEntity.getId()); - if(sysPopedomInterfaceEntity != null && sysPopedomInterfaceEntity.getId() != null ){ - flag = true; - break; - } - } - } - } - } - if(!flag){ - return BaseResult.getFailureMessageEntity("用户无访问权限,请联系管理员"); - } + //boolean flag = false; + //SysInterfaceEntity sysInterfaceEntity = (SysInterfaceEntity) interfaceCache.get("6","beanNameloginServiceinterfacNamedoLogin"); + //if(sysInterfaceEntity == null || sysInterfaceEntity.getId() == null){ + // return BaseResult.getFailureMessageEntity("用户无访问权限,请联系管理员"); + //} + ////查询用户权限 + //if(!flag){ + // SysPopedomInterfaceEntity userPopedomInterfaceEntity = (SysPopedomInterfaceEntity) interfaceCache.get("4","userId"+sysUserEntity.getId()+"interfaceId"+sysInterfaceEntity.getId()); + // if(userPopedomInterfaceEntity != null && userPopedomInterfaceEntity.getId() != null ){ + // flag = true; + // } + //} + ////查询用户角色的权限 + //if(!flag){ + // List userRoleMap = (List) interfaceCache.get("3",null); + // if(userRoleMap != null && userRoleMap.size() > 0){ + // for (SysUserRolesEntity sysUserRolesEntity : userRoleMap) { + // if(sysUserRolesEntity.getUserId().equals(sysUserEntity.getId())){ + // SysPopedomInterfaceEntity sysPopedomInterfaceEntity = (SysPopedomInterfaceEntity) interfaceCache.get("5","roleId"+sysUserRolesEntity.getRoleId()+"interfaceId"+sysInterfaceEntity.getId()); + // if(sysPopedomInterfaceEntity != null && sysPopedomInterfaceEntity.getId() != null ){ + // flag = true; + // break; + // } + // } + // } + // } + //} + //if(!flag){ + // return BaseResult.getFailureMessageEntity("用户无访问权限,请联系管理员"); + //} //登录 StpUtil.login(sysUserEntity.getId()); //获取token From 270d0dc51050fe34f0216e02039013392853cf30 Mon Sep 17 00:00:00 2001 From: lvleigang <957075182@qq.com> Date: Mon, 3 Jun 2024 13:39:57 +0800 Subject: [PATCH 13/31] =?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 --- .../com/hzya/frame/mdm/entity/MdmDbVo.java | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 service/src/main/java/com/hzya/frame/mdm/entity/MdmDbVo.java diff --git a/service/src/main/java/com/hzya/frame/mdm/entity/MdmDbVo.java b/service/src/main/java/com/hzya/frame/mdm/entity/MdmDbVo.java new file mode 100644 index 00000000..4062fd9d --- /dev/null +++ b/service/src/main/java/com/hzya/frame/mdm/entity/MdmDbVo.java @@ -0,0 +1,43 @@ +package com.hzya.frame.mdm.entity; + +import com.hzya.frame.mdm.mdmModuleDb.entity.MdmModuleDbEntity; +import com.hzya.frame.mdm.mdmTableCodeRule.entity.MdmTableCodeRuleEntity; + +import java.util.List; + +public class MdmDbVo { + + //单据编码规则 + private List mdmTableCodeRuleEntityList; + //主数据主表 + private MdmModuleDbEntity mainMdmModuleDb; + //主数据子表 + private List sublistMdmModuleDb; + + + + public List getMdmTableCodeRuleEntityList() { + return mdmTableCodeRuleEntityList; + } + + public void setMdmTableCodeRuleEntityList(List mdmTableCodeRuleEntityList) { + this.mdmTableCodeRuleEntityList = mdmTableCodeRuleEntityList; + } + + 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; + } +} + From 64f15e43616e7c517c915e7ac1d132eaa21217aa Mon Sep 17 00:00:00 2001 From: lvleigang <957075182@qq.com> Date: Tue, 4 Jun 2024 09:08:43 +0800 Subject: [PATCH 14/31] =?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 15/31] =?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 16/31] =?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 17/31] =?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 18/31] =?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 ce8f2063b2e94787a16ee4630ac123e9eca10675 Mon Sep 17 00:00:00 2001 From: lvleigang <957075182@qq.com> Date: Wed, 5 Jun 2024 11:43:40 +0800 Subject: [PATCH 19/31] =?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 20/31] =?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 21/31] =?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 22/31] =?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 23/31] =?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 24/31] =?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 25/31] =?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 26/31] =?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 27/31] =?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 28/31] =?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 29/31] =?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 30/31] =?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 aa6da4bf77422fa3bffe144e8f448ef1067a1a9c Mon Sep 17 00:00:00 2001 From: hecan <1718492867@qq.com> Date: Tue, 11 Jun 2024 10:14:38 +0800 Subject: [PATCH 31/31] =?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' + + + + +