Merge branch 'dev' of http://ufidahz.com.cn:9015/root/kangarooDataCenterV3 into dongj
Conflicts: buildpackage/src/main/java/com/hzya/frame/plugin/mdmDistribute/plugin/MdmModulePluginInitializer.java
This commit is contained in:
commit
110d08f7f7
|
@ -7,6 +7,7 @@ import java.util.List;
|
|||
|
||||
public class MdmDataDto {
|
||||
|
||||
private String mdmId;
|
||||
private String id;
|
||||
private String tableName;
|
||||
private String documentRule;
|
||||
|
@ -65,5 +66,13 @@ public class MdmDataDto {
|
|||
public void setDbType(String dbType) {
|
||||
this.dbType = dbType;
|
||||
}
|
||||
|
||||
public String getMdmId() {
|
||||
return mdmId;
|
||||
}
|
||||
|
||||
public void setMdmId(String mdmId) {
|
||||
this.mdmId = mdmId;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -64,5 +64,7 @@ public interface IMdmModuleDao extends IBaseDao<MdmModuleEntity, String> {
|
|||
* @return java.util.List<java.lang.Object>
|
||||
**/
|
||||
List<String> queryMdMFields(Map<String, Object> maps);
|
||||
|
||||
void updataTreeUpData(Map<String, String> updateMaps);
|
||||
}
|
||||
|
||||
|
|
|
@ -162,7 +162,7 @@ public class MdmModuleDaoImpl extends MybatisGenericDao<MdmModuleEntity, String>
|
|||
}
|
||||
@Override
|
||||
public List<JSONObject> queryMdmSTs(Map<String, Object> maps) {
|
||||
List<JSONObject> o = (List<JSONObject>) super.selectList(getSqlIdPrifx() + "queryMdmST", maps);
|
||||
List<JSONObject> o = (List<JSONObject>) super.selectList(getSqlIdPrifx() + "queryMdmSTs", maps);
|
||||
return o;
|
||||
}
|
||||
|
||||
|
@ -171,6 +171,11 @@ public class MdmModuleDaoImpl extends MybatisGenericDao<MdmModuleEntity, String>
|
|||
super.update(getSqlIdPrifx() + "updateMdmSTs", maps);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updataTreeUpData(Map<String, String> maps) {
|
||||
super.update(getSqlIdPrifx() + "updataTreeUpData", maps);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> queryMdMFields(Map<String, Object> maps) {
|
||||
List<String> o = (List<String>) super.selectList(getSqlIdPrifx() + "queryMdMFields", maps);
|
||||
|
|
|
@ -397,6 +397,9 @@ where id = #{id}
|
|||
`company_id` varchar(50) DEFAULT NULL COMMENT '公司id',
|
||||
`data_type` varchar(50) DEFAULT NULL COMMENT '状态 1、成功2、失败',
|
||||
`remark` varchar(255) DEFAULT NULL COMMENT '备注',
|
||||
`distribute_id` varchar(50) DEFAULT NULL COMMENT 'distribute_id',
|
||||
`api_id` varchar(50) DEFAULT NULL COMMENT 'apiid',
|
||||
`app_id` varchar(50) DEFAULT NULL COMMENT 'app_id',
|
||||
</when>
|
||||
</choose>
|
||||
PRIMARY KEY (`sorts`,`id`) USING BTREE
|
||||
|
@ -933,7 +936,7 @@ where id = #{id}
|
|||
WHERE table_name = #{tableName}
|
||||
</select>
|
||||
<!-- 分页查询列表 采用like格式 -->
|
||||
<select id="queryMdmST" resultType="com.alibaba.fastjson.JSONObject" parameterType="java.util.HashMap">
|
||||
<select id="queryMdmSTs" resultType="com.alibaba.fastjson.JSONObject" parameterType="java.util.HashMap">
|
||||
select
|
||||
|
||||
<if test="field != null and field.size>0">
|
||||
|
@ -1030,6 +1033,8 @@ where id = #{id}
|
|||
update ${tableName} set
|
||||
<trim prefixOverrides=",">
|
||||
<if test="addStatus != null and addStatus !='' ">, add_status = #{addStatus}</if>
|
||||
<if test="updateStatus != null and updateStatus !='' ">, update_status = #{updateStatus}</if>
|
||||
<if test="deleteStatus != null and deleteStatus !='' ">, delete_status = #{deleteStatus}</if>
|
||||
,modify_time = now()
|
||||
</trim>
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
|
@ -1037,5 +1042,19 @@ where id = #{id}
|
|||
<if test="dataStatus != null and dataStatus !='' ">and data_status = #{dataStatus}</if>
|
||||
</trim>
|
||||
</update>
|
||||
|
||||
|
||||
<update id="updataTreeUpData" parameterType="java.util.HashMap">
|
||||
UPDATE ${tableName}
|
||||
SET ${upFiled} = CONCAT(#{newData},SUBSTRING_INDEX( ${upFiled}, #{oldData},- 1 )),
|
||||
modify_time = now(),
|
||||
modify_user_id = #{modify_user_id},
|
||||
data_status = 'F',
|
||||
update_status = '0'
|
||||
WHERE
|
||||
${upFiled} LIKE concat(#{oldData},'%')
|
||||
AND sts = 'Y'
|
||||
AND data_status != 'N'
|
||||
</update>
|
||||
</mapper>
|
||||
|
||||
|
|
|
@ -3,6 +3,9 @@ package com.hzya.frame.mdm.mdmModuleDbFiledsRule.dao;
|
|||
import com.hzya.frame.mdm.mdmModuleDbFiledsRule.entity.MdmModuleDbFiledsRuleEntity;
|
||||
import com.hzya.frame.basedao.dao.IBaseDao;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 模版数据库字段规则表(mdm_module_db_fileds_rule: table)表数据库访问层
|
||||
*
|
||||
|
@ -12,5 +15,7 @@ import com.hzya.frame.basedao.dao.IBaseDao;
|
|||
public interface IMdmModuleDbFiledsRuleDao extends IBaseDao<MdmModuleDbFiledsRuleEntity, String> {
|
||||
|
||||
Integer queryUserMdm(MdmModuleDbFiledsRuleEntity queryCount);
|
||||
|
||||
List<MdmModuleDbFiledsRuleEntity> queryServiceQuote(Map<String, String> maps);
|
||||
}
|
||||
|
||||
|
|
|
@ -4,6 +4,10 @@ import com.hzya.frame.mdm.mdmModuleDbFiledsRule.entity.MdmModuleDbFiledsRuleEnti
|
|||
import com.hzya.frame.mdm.mdmModuleDbFiledsRule.dao.IMdmModuleDbFiledsRuleDao;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import com.hzya.frame.basedao.dao.MybatisGenericDao;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 模版数据库字段规则表(MdmModuleDbFiledsRule)表数据库访问层
|
||||
*
|
||||
|
@ -18,5 +22,11 @@ public class MdmModuleDbFiledsRuleDaoImpl extends MybatisGenericDao<MdmModuleDbF
|
|||
Integer o = (Integer) super.selectOne(getSqlIdPrifx() + "queryUserMdm", queryCount);
|
||||
return o;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MdmModuleDbFiledsRuleEntity> queryServiceQuote(Map<String, String> maps) {
|
||||
List<MdmModuleDbFiledsRuleEntity> o = (List<MdmModuleDbFiledsRuleEntity>) super.selectList(getSqlIdPrifx() + "queryServiceQuote", maps);
|
||||
return o;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -2,7 +2,8 @@
|
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.hzya.frame.mdm.mdmModuleDbFiledsRule.dao.impl.MdmModuleDbFiledsRuleDaoImpl">
|
||||
|
||||
<resultMap id="get-MdmModuleDbFiledsRuleEntity-result" type="com.hzya.frame.mdm.mdmModuleDbFiledsRule.entity.MdmModuleDbFiledsRuleEntity" >
|
||||
<resultMap id="get-MdmModuleDbFiledsRuleEntity-result"
|
||||
type="com.hzya.frame.mdm.mdmModuleDbFiledsRule.entity.MdmModuleDbFiledsRuleEntity">
|
||||
<result property="id" column="id" jdbcType="VARCHAR"/>
|
||||
<result property="mdmId" column="mdm_id" jdbcType="VARCHAR"/>
|
||||
<result property="formName" column="form_name" jdbcType="VARCHAR"/>
|
||||
|
@ -42,7 +43,8 @@
|
|||
,company_id
|
||||
</sql>
|
||||
<!-- 查询 采用==查询 -->
|
||||
<select id="entity_list_base" resultMap="get-MdmModuleDbFiledsRuleEntity-result" parameterType = "com.hzya.frame.mdm.mdmModuleDbFiledsRule.entity.MdmModuleDbFiledsRuleEntity">
|
||||
<select id="entity_list_base" resultMap="get-MdmModuleDbFiledsRuleEntity-result"
|
||||
parameterType="com.hzya.frame.mdm.mdmModuleDbFiledsRule.entity.MdmModuleDbFiledsRuleEntity">
|
||||
select
|
||||
<include refid="MdmModuleDbFiledsRuleEntity_Base_Column_List"/>
|
||||
from mdm_module_db_fileds_rule
|
||||
|
@ -71,7 +73,8 @@
|
|||
</select>
|
||||
|
||||
<!-- 查询符合条件的数量 -->
|
||||
<select id="entity_count" resultType="Integer" parameterType = "com.hzya.frame.mdm.mdmModuleDbFiledsRule.entity.MdmModuleDbFiledsRuleEntity">
|
||||
<select id="entity_count" resultType="Integer"
|
||||
parameterType="com.hzya.frame.mdm.mdmModuleDbFiledsRule.entity.MdmModuleDbFiledsRuleEntity">
|
||||
select count(1) from mdm_module_db_fileds_rule
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''">and id = #{id}</if>
|
||||
|
@ -98,7 +101,8 @@
|
|||
</select>
|
||||
|
||||
<!-- 分页查询列表 采用like格式 -->
|
||||
<select id="entity_list_like" resultMap="get-MdmModuleDbFiledsRuleEntity-result" parameterType = "com.hzya.frame.mdm.mdmModuleDbFiledsRule.entity.MdmModuleDbFiledsRuleEntity">
|
||||
<select id="entity_list_like" resultMap="get-MdmModuleDbFiledsRuleEntity-result"
|
||||
parameterType="com.hzya.frame.mdm.mdmModuleDbFiledsRule.entity.MdmModuleDbFiledsRuleEntity">
|
||||
select
|
||||
<include refid="MdmModuleDbFiledsRuleEntity_Base_Column_List"/>
|
||||
from mdm_module_db_fileds_rule
|
||||
|
@ -113,9 +117,13 @@
|
|||
<if test="ruleValue != null and ruleValue != ''">and rule_value like concat('%',#{ruleValue},'%')</if>
|
||||
<if test="ruleType != null and ruleType != ''">and rule_type like concat('%',#{ruleType},'%')</if>
|
||||
<if test="sorts != null">and sorts like concat('%',#{sorts},'%')</if>
|
||||
<if test="create_user_id != null and create_user_id != ''"> and create_user_id like concat('%',#{create_user_id},'%') </if>
|
||||
<if test="create_user_id != null and create_user_id != ''">and create_user_id like
|
||||
concat('%',#{create_user_id},'%')
|
||||
</if>
|
||||
<if test="create_time != null">and create_time like concat('%',#{create_time},'%')</if>
|
||||
<if test="modify_user_id != null and modify_user_id != ''"> and modify_user_id like concat('%',#{modify_user_id},'%') </if>
|
||||
<if test="modify_user_id != null and modify_user_id != ''">and modify_user_id like
|
||||
concat('%',#{modify_user_id},'%')
|
||||
</if>
|
||||
<if test="modify_time != null">and modify_time like concat('%',#{modify_time},'%')</if>
|
||||
<if test="sts != null and sts != ''">and sts like concat('%',#{sts},'%')</if>
|
||||
<if test="org_id != null and org_id != ''">and org_id like concat('%',#{org_id},'%')</if>
|
||||
|
@ -127,7 +135,8 @@
|
|||
</select>
|
||||
|
||||
<!-- 查询列表 字段采用or格式 -->
|
||||
<select id="MdmModuleDbFiledsRuleentity_list_or" resultMap="get-MdmModuleDbFiledsRuleEntity-result" parameterType = "com.hzya.frame.mdm.mdmModuleDbFiledsRule.entity.MdmModuleDbFiledsRuleEntity">
|
||||
<select id="MdmModuleDbFiledsRuleentity_list_or" resultMap="get-MdmModuleDbFiledsRuleEntity-result"
|
||||
parameterType="com.hzya.frame.mdm.mdmModuleDbFiledsRule.entity.MdmModuleDbFiledsRuleEntity">
|
||||
select
|
||||
<include refid="MdmModuleDbFiledsRuleEntity_Base_Column_List"/>
|
||||
from mdm_module_db_fileds_rule
|
||||
|
@ -156,7 +165,8 @@
|
|||
</select>
|
||||
|
||||
<!--新增所有列-->
|
||||
<insert id="entity_insert" parameterType = "com.hzya.frame.mdm.mdmModuleDbFiledsRule.entity.MdmModuleDbFiledsRuleEntity" >
|
||||
<insert id="entity_insert"
|
||||
parameterType="com.hzya.frame.mdm.mdmModuleDbFiledsRule.entity.MdmModuleDbFiledsRuleEntity">
|
||||
insert into mdm_module_db_fileds_rule(
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="id != null and id != ''">id ,</if>
|
||||
|
@ -203,15 +213,18 @@
|
|||
</insert>
|
||||
<!-- 批量新增 -->
|
||||
<insert id="entityInsertBatch">
|
||||
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)
|
||||
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
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.mdmId},#{entity.formName},#{entity.dbId},#{entity.filedId},#{entity.ruleName},#{entity.ruleCode},#{entity.ruleValue},#{entity.ruleType},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId}, 'Y')
|
||||
(#{entity.mdmId},#{entity.formName},#{entity.dbId},#{entity.filedId},#{entity.ruleName},#{entity.ruleCode},#{entity.ruleValue},#{entity.ruleType},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId},
|
||||
'Y')
|
||||
</foreach>
|
||||
</insert>
|
||||
<!-- 批量新增或者修改-->
|
||||
<insert id="entityInsertOrUpdateBatch">
|
||||
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)
|
||||
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
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.mdmId},#{entity.formName},#{entity.dbId},#{entity.filedId},#{entity.ruleName},#{entity.ruleCode},#{entity.ruleValue},#{entity.ruleType},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId})
|
||||
|
@ -231,9 +244,11 @@
|
|||
modify_time = values(modify_time),
|
||||
sts = values(sts),
|
||||
org_id = values(org_id),
|
||||
company_id = values(company_id)</insert>
|
||||
company_id = values(company_id)
|
||||
</insert>
|
||||
<!--通过主键修改方法-->
|
||||
<update id="entity_update" parameterType = "com.hzya.frame.mdm.mdmModuleDbFiledsRule.entity.MdmModuleDbFiledsRuleEntity" >
|
||||
<update id="entity_update"
|
||||
parameterType="com.hzya.frame.mdm.mdmModuleDbFiledsRule.entity.MdmModuleDbFiledsRuleEntity">
|
||||
update mdm_module_db_fileds_rule set
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="mdmId != null and mdmId != ''">mdm_id = #{mdmId},</if>
|
||||
|
@ -255,12 +270,17 @@ update mdm_module_db_fileds_rule set
|
|||
where id = #{id}
|
||||
</update>
|
||||
<!-- 逻辑删除 -->
|
||||
<update id="entity_logicDelete" parameterType = "com.hzya.frame.mdm.mdmModuleDbFiledsRule.entity.MdmModuleDbFiledsRuleEntity" >
|
||||
update mdm_module_db_fileds_rule set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
|
||||
<update id="entity_logicDelete"
|
||||
parameterType="com.hzya.frame.mdm.mdmModuleDbFiledsRule.entity.MdmModuleDbFiledsRuleEntity">
|
||||
update mdm_module_db_fileds_rule
|
||||
set sts= 'N',
|
||||
modify_time = #{modify_time},
|
||||
modify_user_id = #{modify_user_id}
|
||||
where id = #{id}
|
||||
</update>
|
||||
<!-- 多条件逻辑删除 -->
|
||||
<update id="entity_logicDelete_Multi_Condition" parameterType = "com.hzya.frame.mdm.mdmModuleDbFiledsRule.entity.MdmModuleDbFiledsRuleEntity" >
|
||||
<update id="entity_logicDelete_Multi_Condition"
|
||||
parameterType="com.hzya.frame.mdm.mdmModuleDbFiledsRule.entity.MdmModuleDbFiledsRuleEntity">
|
||||
update mdm_module_db_fileds_rule set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''">and id = #{id}</if>
|
||||
|
@ -280,11 +300,14 @@ update mdm_module_db_fileds_rule set sts= 'N' ,modify_time = #{modify_time},mod
|
|||
</update>
|
||||
<!--通过主键删除-->
|
||||
<delete id="entity_delete">
|
||||
delete from mdm_module_db_fileds_rule where id = #{id}
|
||||
delete
|
||||
from mdm_module_db_fileds_rule
|
||||
where id = #{id}
|
||||
</delete>
|
||||
|
||||
<!-- 查询符合条件的数量 -->
|
||||
<select id="queryUserMdm" resultType="Integer" parameterType = "com.hzya.frame.mdm.mdmModuleDbFiledsRule.entity.MdmModuleDbFiledsRuleEntity">
|
||||
<select id="queryUserMdm" resultType="Integer"
|
||||
parameterType="com.hzya.frame.mdm.mdmModuleDbFiledsRule.entity.MdmModuleDbFiledsRuleEntity">
|
||||
select count(1) from mdm_module_db_fileds_rule
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="mdmId != null and mdmId != ''">and mdm_id != #{mdmId}</if>
|
||||
|
@ -293,7 +316,27 @@ update mdm_module_db_fileds_rule set sts= 'N' ,modify_time = #{modify_time},mod
|
|||
and sts='Y'
|
||||
</trim>
|
||||
</select>
|
||||
<!-- 查询列表 字段采用or格式 -->
|
||||
<select id="queryServiceQuote" resultMap="get-MdmModuleDbFiledsRuleEntity-result">
|
||||
|
||||
SELECT filed_id,
|
||||
db_id,
|
||||
mdm_id
|
||||
from (
|
||||
SELECT filed_id,
|
||||
db_id,
|
||||
mdm_id,
|
||||
COUNT(*) as num
|
||||
FROM mdm_module_db_fileds_rule
|
||||
WHERE `sts` = 'Y'
|
||||
and (
|
||||
(rule_code = 'type' and rule_value = 'treeselect')
|
||||
or (rule_code = 'service' and rule_value = #{service})
|
||||
or (rule_code = 'upId' and rule_value = #{upId})
|
||||
)
|
||||
GROUP BY filed_id, db_id, mdm_id) a
|
||||
WHERE a.num = 3
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
|
|
|
@ -2537,6 +2537,7 @@ public class MdmServiceImpl implements IMdmService {
|
|||
JSONObject jsonObject = saveData.getJSONObject(mdmModuleDbEntityList.get(i).getDbName());
|
||||
//保存数据
|
||||
MdmDataDto mdmDataDto = new MdmDataDto();
|
||||
mdmDataDto.setMdmId(mdmModuleEntity.getId());
|
||||
mdmDataDto.setTableName(mdmModuleDbEntityList.get(i).getDbName());
|
||||
MdmModuleDbFiledsEntity mdmModuleDbFiledsEntity1 = new MdmModuleDbFiledsEntity();
|
||||
mdmModuleDbFiledsEntity1.setMdmId(mdmModuleEntity.getId());
|
||||
|
@ -2610,7 +2611,104 @@ public class MdmServiceImpl implements IMdmService {
|
|||
if (flag) {
|
||||
mdmDataDto.setId(jsonObject.getString("id"));
|
||||
id = jsonObject.getString("id");
|
||||
boolean asdasd = false;
|
||||
if(asdasd){
|
||||
//查询是否设置的树形
|
||||
MdmModuleViewEntity mdmModuleViewEntity = new MdmModuleViewEntity();
|
||||
mdmModuleViewEntity.setMdmId(mdmModuleEntity.getId());
|
||||
mdmModuleViewEntity.setViewName("1");
|
||||
mdmModuleViewEntity.setSts("Y");
|
||||
List<MdmModuleViewEntity> moduleViewEntityList = mdmModuleViewDao.queryBase(mdmModuleViewEntity);
|
||||
if (moduleViewEntityList != null && moduleViewEntityList.size() == 1) {
|
||||
mdmModuleViewEntity = moduleViewEntityList.get(0);
|
||||
//查询数据
|
||||
Map<String, Object> queryData = new HashMap<>();
|
||||
queryData.put("tableName", mdmDataDto.getTableName());//表名
|
||||
queryData.put("detailFlag", false);//是否明细
|
||||
queryData.put("id", id);//字段
|
||||
HashMap<String, Object> datas = mdmModuleDbDao.getServiceDataById(queryData);
|
||||
convertKeysToLowerCase(datas);
|
||||
//对比值是否有修改
|
||||
boolean upFlag = false;
|
||||
String oldData = "";
|
||||
|
||||
String newData = "";
|
||||
|
||||
for (int i1 = 0; i1 < mdmDataFiledDtos.size(); i1++) {
|
||||
if (mdmDataFiledDtos.get(i1).getFiledsName().equals(mdmModuleViewEntity.getUpIdFiled())) {
|
||||
newData = mdmDataFiledDtos.get(i1).getFiledsValue();
|
||||
oldData = datas.get(mdmDataFiledDtos.get(i1).getFiledsName()).toString();
|
||||
|
||||
if (mdmDataFiledDtos.get(i1).getFiledsValue().equals(datas.get(mdmDataFiledDtos.get(i1).getFiledsName()).toString())) {
|
||||
upFlag = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (upFlag) {
|
||||
//查询引用地方
|
||||
Map<String, String> maps = new HashMap<>();
|
||||
maps.put("service",mdmDataDto.getTableName());
|
||||
maps.put("upId",mdmModuleViewEntity.getUpIdFiled());
|
||||
//maps.put("mdmId",mdmModuleEntity.getId());
|
||||
List<MdmModuleDbFiledsRuleEntity> mdmModuleDbFiledsRuleEntities = mdmModuleDbFiledsRuleDao.queryServiceQuote(maps);
|
||||
if(mdmModuleDbFiledsRuleEntities != null && mdmModuleDbFiledsRuleEntities.size() > 0){
|
||||
for (int i1 = 0; i1 < mdmModuleDbFiledsRuleEntities.size(); i1++) {
|
||||
//查询字段
|
||||
String upFiled = "";
|
||||
|
||||
MdmModuleDbFiledsEntity moduleDbFiledsEntity = new MdmModuleDbFiledsEntity();
|
||||
moduleDbFiledsEntity.setMdmId(mdmModuleDbFiledsRuleEntities.get(i1).getMdmId());
|
||||
moduleDbFiledsEntity.setSts("Y");
|
||||
List<MdmModuleDbFiledsEntity> mdmModuleDbFiledsEntities = mdmServiceCache.queryMdmModuleDbFileds(moduleDbFiledsEntity);
|
||||
if(mdmModuleDbFiledsEntities != null && mdmModuleDbFiledsEntities.size() > 0){
|
||||
for (int i2 = 0; i2 < mdmModuleDbFiledsEntities.size(); i2++) {
|
||||
if(mdmModuleDbFiledsRuleEntities.get(i1).getFiledId().equals(mdmModuleDbFiledsEntities.get(i2).getId())){
|
||||
upFiled = mdmModuleDbFiledsEntities.get(i2).getEnName();
|
||||
}
|
||||
}
|
||||
}
|
||||
//修改引用数据
|
||||
//查看是否主表
|
||||
MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity();
|
||||
mdmModuleDbEntity.setMdmId(mdmModuleDbFiledsRuleEntities.get(i1).getMdmId());
|
||||
mdmModuleDbEntity.setSts("Y");
|
||||
List<MdmModuleDbEntity> mdmModuleDbEntities = mdmServiceCache.queryMdmModuleDb(mdmModuleDbEntity);
|
||||
//设置主表
|
||||
String mainDBTable = "";
|
||||
String dataDBTable = "";
|
||||
if(mdmModuleDbEntities != null && mdmModuleDbEntities.size() > 0){
|
||||
for (int i2 = 0; i2 < mdmModuleDbEntities.size(); i2++) {
|
||||
//主表
|
||||
if("1".equals(mdmModuleDbEntities.get(i2).getDbType())){
|
||||
mainDBTable = mdmModuleDbEntities.get(i2).getDbName();
|
||||
}
|
||||
if(mdmModuleDbFiledsRuleEntities.get(i1).getDbId().equals(mdmModuleDbEntities.get(i2).getId())){
|
||||
dataDBTable = mdmModuleDbEntities.get(i2).getDbName();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(mainDBTable.equals(dataDBTable)){//主表上的字段
|
||||
Map<String, String> updateMaps = new HashMap<>();
|
||||
updateMaps.put("tableName",dataDBTable);
|
||||
updateMaps.put("upFiled",upFiled);
|
||||
updateMaps.put("oldData",oldData);
|
||||
updateMaps.put("newData",newData);
|
||||
updateMaps.put("modify_user_id",StpUtil.getLoginIdAsString());
|
||||
mdmModuleDao.updataTreeUpData(updateMaps);
|
||||
}else {//明细表上的字段
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
int a = mdmModuleDao.updateForm(mdmDataDto);
|
||||
} else {
|
||||
|
||||
|
@ -2762,6 +2860,7 @@ public class MdmServiceImpl implements IMdmService {
|
|||
mdmDataDto.setMdmDataFiledDtos(mdmDataFiledDtos);
|
||||
if (jsonObject.getString("id") != null) {
|
||||
mdmDataDto.setId(jsonObject.getString("id"));
|
||||
|
||||
int a = mdmModuleDao.updateForm(mdmDataDto);
|
||||
} else {
|
||||
mdmDataDto.setDbType(mdmModuleDbEntityList.get(i).getDbType());
|
||||
|
|
Loading…
Reference in New Issue