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