This commit is contained in:
xiang2lin 2024-08-05 09:23:11 +08:00
commit e200fd768d
23 changed files with 1038 additions and 354 deletions

View File

@ -99,6 +99,12 @@
<profile.active>zqt</profile.active>
</properties>
</profile>
<profile>
<id>dongj</id> <!--越城区-->
<properties>
<profile.active>dongj</profile.active>
</properties>
</profile>
</profiles>
<build>
<finalName>kangarooDataCenterV3</finalName>

View File

@ -452,6 +452,7 @@ public class MdmModulePluginInitializer extends PluginBaseEntity {
}
}
} catch (Exception e) {
logger.info("执行异常错误原因:"+e);
logger.error("新增返回脚本解析保存三方id错误"+jsonResultEntity.getAttribute());
taskDetailEntity.setResult("新增返回脚本解析保存三方id错误");
taskLivingDetailsService.updateLogFailToSuccess(taskDetailEntity);
@ -473,7 +474,6 @@ public class MdmModulePluginInitializer extends PluginBaseEntity {
//查询主数据
MdmModuleEntity queryMdmModuleEntity = new MdmModuleEntity();
queryMdmModuleEntity.setSts("Y");
queryMdmModuleEntity.setMdmCode(10004L);
List<MdmModuleEntity> mdmModuleEntities = mdmModuleDao.queryBase(queryMdmModuleEntity);
if(mdmModuleEntities == null || mdmModuleEntities.size() == 0){
return BaseResult.getSuccessMessageEntity("主数据未设置,不需要下发");

View File

@ -58,7 +58,7 @@ public class BipUtil {
}
return null;
}
public static String sendOaToDj(String parm, String apiCode){
public static String sendOaToU8c(String parm, String apiCode){
String baseUrl = "http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface";
System.out.println("推送参数"+parm);
String result = HttpRequest.post(baseUrl)

View File

@ -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;
}
}

View File

@ -64,5 +64,9 @@ 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);
void updataTreeUpDataDetail(Map<String, String> updateMaps);
}

View File

@ -171,6 +171,16 @@ 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 void updataTreeUpDataDetail(Map<String, String> maps) {
super.update(getSqlIdPrifx() + "updataTreeUpDataDetail", maps);
}
@Override
public List<String> queryMdMFields(Map<String, Object> maps) {
List<String> o = (List<String>) super.selectList(getSqlIdPrifx() + "queryMdMFields", maps);

View File

@ -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
@ -1005,9 +1008,9 @@ where id = #{id}
</foreach>
</if>
and sts = 'Y'
order by sorts asc
<if test="size != null and size !='' ">limit #{size}</if>
</trim>
order by sorts asc
</select>
<!-- 分页查询列表 采用like格式 -->
@ -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,42 @@ 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>
<update id="updataTreeUpDataDetail" parameterType="java.util.HashMap">
UPDATE ${tableName} a
JOIN ${mainDBTable} b ON a.formmain_id = b.id and b.sts = 'Y'
SET
a.${upFiled}=CONCAT(#{newData},SUBSTRING_INDEX(${upFiled},#{oldData},-1)),
a.modify_time = now(),
a.modify_user_id = '1',
a.data_status = 'F',
b.update_status = '0' ,
b.data_status = 'F',
b.modify_time = now(),
b.modify_user_id = '1'
WHERE
a.${upFiled} LIKE concat( #{oldData}, '%' )
AND a.sts = 'Y'
AND a.data_status != 'N'
AND b.sts = 'Y'
AND b.data_status != 'N'
</update>
</mapper>

View File

@ -1,7 +1,10 @@
package com.hzya.frame.mdm.mdmModuleDbFiledsRule.dao;
import com.hzya.frame.mdm.mdmModuleDbFiledsRule.entity.MdmModuleDbFiledsRuleEntity;
import com.hzya.frame.basedao.dao.IBaseDao;
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);
}

View File

@ -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;
}
}

View File

@ -2,27 +2,28 @@
<!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" >
<result property="id" column="id" jdbcType="VARCHAR"/>
<result property="mdmId" column="mdm_id" jdbcType="VARCHAR"/>
<result property="formName" column="form_name" jdbcType="VARCHAR"/>
<result property="dbId" column="db_id" jdbcType="VARCHAR"/>
<result property="filedId" column="filed_id" jdbcType="VARCHAR"/>
<result property="ruleName" column="rule_name" jdbcType="VARCHAR"/>
<result property="ruleCode" column="rule_code" jdbcType="VARCHAR"/>
<result property="ruleValue" column="rule_value" jdbcType="VARCHAR"/>
<result property="ruleType" column="rule_type" jdbcType="VARCHAR"/>
<result property="sorts" column="sorts" jdbcType="INTEGER"/>
<result property="create_user_id" column="create_user_id" jdbcType="VARCHAR"/>
<result property="create_time" column="create_time" jdbcType="TIMESTAMP"/>
<result property="modify_user_id" column="modify_user_id" jdbcType="VARCHAR"/>
<result property="modify_time" column="modify_time" jdbcType="TIMESTAMP"/>
<result property="sts" column="sts" jdbcType="VARCHAR"/>
<result property="org_id" column="org_id" jdbcType="VARCHAR"/>
<result property="companyId" column="company_id" jdbcType="VARCHAR"/>
</resultMap>
<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"/>
<result property="dbId" column="db_id" jdbcType="VARCHAR"/>
<result property="filedId" column="filed_id" jdbcType="VARCHAR"/>
<result property="ruleName" column="rule_name" jdbcType="VARCHAR"/>
<result property="ruleCode" column="rule_code" jdbcType="VARCHAR"/>
<result property="ruleValue" column="rule_value" jdbcType="VARCHAR"/>
<result property="ruleType" column="rule_type" jdbcType="VARCHAR"/>
<result property="sorts" column="sorts" jdbcType="INTEGER"/>
<result property="create_user_id" column="create_user_id" jdbcType="VARCHAR"/>
<result property="create_time" column="create_time" jdbcType="TIMESTAMP"/>
<result property="modify_user_id" column="modify_user_id" jdbcType="VARCHAR"/>
<result property="modify_time" column="modify_time" jdbcType="TIMESTAMP"/>
<result property="sts" column="sts" jdbcType="VARCHAR"/>
<result property="org_id" column="org_id" jdbcType="VARCHAR"/>
<result property="companyId" column="company_id" jdbcType="VARCHAR"/>
</resultMap>
<!-- 查询的字段-->
<sql id = "MdmModuleDbFiledsRuleEntity_Base_Column_List">
<sql id="MdmModuleDbFiledsRuleEntity_Base_Column_List">
id
,mdm_id
,form_name
@ -39,261 +40,303 @@
,modify_time
,sts
,org_id
,company_id
</sql>
<!-- 查询 采用==查询 -->
<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
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> and id = #{id} </if>
<if test="mdmId != null and mdmId != ''"> and mdm_id = #{mdmId} </if>
<if test="formName != null and formName != ''"> and form_name = #{formName} </if>
<if test="dbId != null and dbId != ''"> and db_id = #{dbId} </if>
<if test="filedId != null and filedId != ''"> and filed_id = #{filedId} </if>
<if test="ruleName != null and ruleName != ''"> and rule_name = #{ruleName} </if>
<if test="ruleCode != null and ruleCode != ''"> and rule_code = #{ruleCode} </if>
<if test="ruleValue != null and ruleValue != ''"> and rule_value = #{ruleValue} </if>
<if test="ruleType != null and ruleType != ''"> and rule_type = #{ruleType} </if>
<if test="sorts != null"> and sorts = #{sorts} </if>
<if test="create_user_id != null and create_user_id != ''"> and create_user_id = #{create_user_id} </if>
<if test="create_time != null"> and create_time = #{create_time} </if>
<if test="modify_user_id != null and modify_user_id != ''"> and modify_user_id = #{modify_user_id} </if>
<if test="modify_time != null"> and modify_time = #{modify_time} </if>
<if test="sts != null and sts != ''"> and sts = #{sts} </if>
<if test="org_id != null and org_id != ''"> and org_id = #{org_id} </if>
<if test="companyId != null and companyId != ''"> and company_id = #{companyId} </if>
,company_id
</sql>
<!-- 查询 采用==查询 -->
<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
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''">and id = #{id}</if>
<if test="mdmId != null and mdmId != ''">and mdm_id = #{mdmId}</if>
<if test="formName != null and formName != ''">and form_name = #{formName}</if>
<if test="dbId != null and dbId != ''">and db_id = #{dbId}</if>
<if test="filedId != null and filedId != ''">and filed_id = #{filedId}</if>
<if test="ruleName != null and ruleName != ''">and rule_name = #{ruleName}</if>
<if test="ruleCode != null and ruleCode != ''">and rule_code = #{ruleCode}</if>
<if test="ruleValue != null and ruleValue != ''">and rule_value = #{ruleValue}</if>
<if test="ruleType != null and ruleType != ''">and rule_type = #{ruleType}</if>
<if test="sorts != null">and sorts = #{sorts}</if>
<if test="create_user_id != null and create_user_id != ''">and create_user_id = #{create_user_id}</if>
<if test="create_time != null">and create_time = #{create_time}</if>
<if test="modify_user_id != null and modify_user_id != ''">and modify_user_id = #{modify_user_id}</if>
<if test="modify_time != null">and modify_time = #{modify_time}</if>
<if test="sts != null and sts != ''">and sts = #{sts}</if>
<if test="org_id != null and org_id != ''">and org_id = #{org_id}</if>
<if test="companyId != null and companyId != ''">and company_id = #{companyId}</if>
and sts='Y'
</trim>
<if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
</select>
<!-- 查询符合条件的数量 -->
<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>
<if test="mdmId != null and mdmId != ''"> and mdm_id = #{mdmId} </if>
<if test="formName != null and formName != ''"> and form_name = #{formName} </if>
<if test="dbId != null and dbId != ''"> and db_id = #{dbId} </if>
<if test="filedId != null and filedId != ''"> and filed_id = #{filedId} </if>
<if test="ruleName != null and ruleName != ''"> and rule_name = #{ruleName} </if>
<if test="ruleCode != null and ruleCode != ''"> and rule_code = #{ruleCode} </if>
<if test="ruleValue != null and ruleValue != ''"> and rule_value = #{ruleValue} </if>
<if test="ruleType != null and ruleType != ''"> and rule_type = #{ruleType} </if>
<if test="sorts != null"> and sorts = #{sorts} </if>
<if test="create_user_id != null and create_user_id != ''"> and create_user_id = #{create_user_id} </if>
<if test="create_time != null"> and create_time = #{create_time} </if>
<if test="modify_user_id != null and modify_user_id != ''"> and modify_user_id = #{modify_user_id} </if>
<if test="modify_time != null"> and modify_time = #{modify_time} </if>
<if test="sts != null and sts != ''"> and sts = #{sts} </if>
<if test="org_id != null and org_id != ''"> and org_id = #{org_id} </if>
<if test="companyId != null and companyId != ''"> and company_id = #{companyId} </if>
</trim>
<if test=" sort == null or sort == ''.toString() ">order by sorts asc</if>
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
</select>
<!-- 查询符合条件的数量 -->
<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>
<if test="mdmId != null and mdmId != ''">and mdm_id = #{mdmId}</if>
<if test="formName != null and formName != ''">and form_name = #{formName}</if>
<if test="dbId != null and dbId != ''">and db_id = #{dbId}</if>
<if test="filedId != null and filedId != ''">and filed_id = #{filedId}</if>
<if test="ruleName != null and ruleName != ''">and rule_name = #{ruleName}</if>
<if test="ruleCode != null and ruleCode != ''">and rule_code = #{ruleCode}</if>
<if test="ruleValue != null and ruleValue != ''">and rule_value = #{ruleValue}</if>
<if test="ruleType != null and ruleType != ''">and rule_type = #{ruleType}</if>
<if test="sorts != null">and sorts = #{sorts}</if>
<if test="create_user_id != null and create_user_id != ''">and create_user_id = #{create_user_id}</if>
<if test="create_time != null">and create_time = #{create_time}</if>
<if test="modify_user_id != null and modify_user_id != ''">and modify_user_id = #{modify_user_id}</if>
<if test="modify_time != null">and modify_time = #{modify_time}</if>
<if test="sts != null and sts != ''">and sts = #{sts}</if>
<if test="org_id != null and org_id != ''">and org_id = #{org_id}</if>
<if test="companyId != null and companyId != ''">and company_id = #{companyId}</if>
and sts='Y'
</trim>
<if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
<if test=" sort !='' and sort!=null and order !='' and order!=null "> order by ${sort} ${order}</if>
</trim>
<if test=" sort == null or sort == ''.toString() ">order by sorts asc</if>
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
</select>
<!-- 分页查询列表 采用like格式 -->
<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
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> and id like concat('%',#{id},'%') </if>
<if test="mdmId != null and mdmId != ''"> and mdm_id like concat('%',#{mdmId},'%') </if>
<if test="formName != null and formName != ''"> and form_name like concat('%',#{formName},'%') </if>
<if test="dbId != null and dbId != ''"> and db_id like concat('%',#{dbId},'%') </if>
<if test="filedId != null and filedId != ''"> and filed_id like concat('%',#{filedId},'%') </if>
<if test="ruleName != null and ruleName != ''"> and rule_name like concat('%',#{ruleName},'%') </if>
<if test="ruleCode != null and ruleCode != ''"> and rule_code like concat('%',#{ruleCode},'%') </if>
<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_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_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>
<if test="companyId != null and companyId != ''"> and company_id like concat('%',#{companyId},'%') </if>
<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
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''">and id like concat('%',#{id},'%')</if>
<if test="mdmId != null and mdmId != ''">and mdm_id like concat('%',#{mdmId},'%')</if>
<if test="formName != null and formName != ''">and form_name like concat('%',#{formName},'%')</if>
<if test="dbId != null and dbId != ''">and db_id like concat('%',#{dbId},'%')</if>
<if test="filedId != null and filedId != ''">and filed_id like concat('%',#{filedId},'%')</if>
<if test="ruleName != null and ruleName != ''">and rule_name like concat('%',#{ruleName},'%')</if>
<if test="ruleCode != null and ruleCode != ''">and rule_code like concat('%',#{ruleCode},'%')</if>
<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_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_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>
<if test="companyId != null and companyId != ''">and company_id like concat('%',#{companyId},'%')</if>
and sts='Y'
</trim>
<if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
</select>
</trim>
<if test=" sort == null or sort == ''.toString() ">order by sorts asc</if>
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
</select>
<!-- 查询列表 字段采用or格式 -->
<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
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> or id = #{id} </if>
<if test="mdmId != null and mdmId != ''"> or mdm_id = #{mdmId} </if>
<if test="formName != null and formName != ''"> or form_name = #{formName} </if>
<if test="dbId != null and dbId != ''"> or db_id = #{dbId} </if>
<if test="filedId != null and filedId != ''"> or filed_id = #{filedId} </if>
<if test="ruleName != null and ruleName != ''"> or rule_name = #{ruleName} </if>
<if test="ruleCode != null and ruleCode != ''"> or rule_code = #{ruleCode} </if>
<if test="ruleValue != null and ruleValue != ''"> or rule_value = #{ruleValue} </if>
<if test="ruleType != null and ruleType != ''"> or rule_type = #{ruleType} </if>
<if test="sorts != null"> or sorts = #{sorts} </if>
<if test="create_user_id != null and create_user_id != ''"> or create_user_id = #{create_user_id} </if>
<if test="create_time != null"> or create_time = #{create_time} </if>
<if test="modify_user_id != null and modify_user_id != ''"> or modify_user_id = #{modify_user_id} </if>
<if test="modify_time != null"> or modify_time = #{modify_time} </if>
<if test="sts != null and sts != ''"> or sts = #{sts} </if>
<if test="org_id != null and org_id != ''"> or org_id = #{org_id} </if>
<if test="companyId != null and companyId != ''"> or company_id = #{companyId} </if>
<!-- 查询列表 字段采用or格式 -->
<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
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''">or id = #{id}</if>
<if test="mdmId != null and mdmId != ''">or mdm_id = #{mdmId}</if>
<if test="formName != null and formName != ''">or form_name = #{formName}</if>
<if test="dbId != null and dbId != ''">or db_id = #{dbId}</if>
<if test="filedId != null and filedId != ''">or filed_id = #{filedId}</if>
<if test="ruleName != null and ruleName != ''">or rule_name = #{ruleName}</if>
<if test="ruleCode != null and ruleCode != ''">or rule_code = #{ruleCode}</if>
<if test="ruleValue != null and ruleValue != ''">or rule_value = #{ruleValue}</if>
<if test="ruleType != null and ruleType != ''">or rule_type = #{ruleType}</if>
<if test="sorts != null">or sorts = #{sorts}</if>
<if test="create_user_id != null and create_user_id != ''">or create_user_id = #{create_user_id}</if>
<if test="create_time != null">or create_time = #{create_time}</if>
<if test="modify_user_id != null and modify_user_id != ''">or modify_user_id = #{modify_user_id}</if>
<if test="modify_time != null">or modify_time = #{modify_time}</if>
<if test="sts != null and sts != ''">or sts = #{sts}</if>
<if test="org_id != null and org_id != ''">or org_id = #{org_id}</if>
<if test="companyId != null and companyId != ''">or company_id = #{companyId}</if>
and sts='Y'
</trim>
<if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
</select>
</trim>
<if test=" sort == null or sort == ''.toString() ">order by sorts asc</if>
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
</select>
<!--新增所有列-->
<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>
<if test="mdmId != null and mdmId != ''"> mdm_id , </if>
<if test="formName != null and formName != ''"> form_name , </if>
<if test="dbId != null and dbId != ''"> db_id , </if>
<if test="filedId != null and filedId != ''"> filed_id , </if>
<if test="ruleName != null and ruleName != ''"> rule_name , </if>
<if test="ruleCode != null and ruleCode != ''"> rule_code , </if>
<if test="ruleValue != null and ruleValue != ''"> rule_value , </if>
<if test="ruleType != null and ruleType != ''"> rule_type , </if>
<if test="sorts != null"> sorts , </if>
<if test="create_user_id != null and create_user_id != ''"> create_user_id , </if>
<if test="create_time != null"> create_time , </if>
<if test="modify_user_id != null and modify_user_id != ''"> modify_user_id , </if>
<if test="modify_time != null"> modify_time , </if>
<if test="sts != null and sts != ''"> sts , </if>
<if test="org_id != null and org_id != ''"> org_id , </if>
<if test="companyId != null and companyId != ''"> company_id , </if>
<if test="sts == null ">sts,</if>
</trim>
)values(
<trim suffix="" suffixOverrides=",">
<if test="id != null and id != ''"> #{id} ,</if>
<if test="mdmId != null and mdmId != ''"> #{mdmId} ,</if>
<if test="formName != null and formName != ''"> #{formName} ,</if>
<if test="dbId != null and dbId != ''"> #{dbId} ,</if>
<if test="filedId != null and filedId != ''"> #{filedId} ,</if>
<if test="ruleName != null and ruleName != ''"> #{ruleName} ,</if>
<if test="ruleCode != null and ruleCode != ''"> #{ruleCode} ,</if>
<if test="ruleValue != null and ruleValue != ''"> #{ruleValue} ,</if>
<if test="ruleType != null and ruleType != ''"> #{ruleType} ,</if>
<if test="sorts != null"> #{sorts} ,</if>
<if test="create_user_id != null and create_user_id != ''"> #{create_user_id} ,</if>
<if test="create_time != null"> #{create_time} ,</if>
<if test="modify_user_id != null and modify_user_id != ''"> #{modify_user_id} ,</if>
<if test="modify_time != null"> #{modify_time} ,</if>
<if test="sts != null and sts != ''"> #{sts} ,</if>
<if test="org_id != null and org_id != ''"> #{org_id} ,</if>
<if test="companyId != null and companyId != ''"> #{companyId} ,</if>
<if test="sts == null ">'Y',</if>
</trim>
)
</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)
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')
</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)
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})
</foreach>
on duplicate key update
mdm_id = values(mdm_id),
form_name = values(form_name),
db_id = values(db_id),
filed_id = values(filed_id),
rule_name = values(rule_name),
rule_code = values(rule_code),
rule_value = values(rule_value),
rule_type = values(rule_type),
create_user_id = values(create_user_id),
create_time = values(create_time),
modify_user_id = values(modify_user_id),
modify_time = values(modify_time),
sts = values(sts),
org_id = values(org_id),
company_id = values(company_id)</insert>
<!--通过主键修改方法-->
<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>
<if test="formName != null and formName != ''"> form_name = #{formName},</if>
<if test="dbId != null and dbId != ''"> db_id = #{dbId},</if>
<if test="filedId != null and filedId != ''"> filed_id = #{filedId},</if>
<if test="ruleName != null and ruleName != ''"> rule_name = #{ruleName},</if>
<if test="ruleCode != null and ruleCode != ''"> rule_code = #{ruleCode},</if>
<if test="ruleValue != null and ruleValue != ''"> rule_value = #{ruleValue},</if>
<if test="ruleType != null and ruleType != ''"> rule_type = #{ruleType},</if>
<if test="create_user_id != null and create_user_id != ''"> create_user_id = #{create_user_id},</if>
<if test="create_time != null"> create_time = #{create_time},</if>
<if test="modify_user_id != null and modify_user_id != ''"> modify_user_id = #{modify_user_id},</if>
<if test="modify_time != null"> modify_time = #{modify_time},</if>
<if test="sts != null and sts != ''"> sts = #{sts},</if>
<if test="org_id != null and org_id != ''"> org_id = #{org_id},</if>
<if test="companyId != null and companyId != ''"> company_id = #{companyId},</if>
</trim>
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}
where id = #{id}
</update>
<!-- 多条件逻辑删除 -->
<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>
<if test="mdmId != null and mdmId != ''"> and mdm_id = #{mdmId} </if>
<if test="formName != null and formName != ''"> and form_name = #{formName} </if>
<if test="dbId != null and dbId != ''"> and db_id = #{dbId} </if>
<if test="filedId != null and filedId != ''"> and filed_id = #{filedId} </if>
<if test="ruleName != null and ruleName != ''"> and rule_name = #{ruleName} </if>
<if test="ruleCode != null and ruleCode != ''"> and rule_code = #{ruleCode} </if>
<if test="ruleValue != null and ruleValue != ''"> and rule_value = #{ruleValue} </if>
<if test="ruleType != null and ruleType != ''"> and rule_type = #{ruleType} </if>
<if test="sorts != null"> and sorts = #{sorts} </if>
<if test="sts != null and sts != ''"> and sts = #{sts} </if>
<if test="companyId != null and companyId != ''"> and company_id = #{companyId} </if>
<!--新增所有列-->
<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>
<if test="mdmId != null and mdmId != ''">mdm_id ,</if>
<if test="formName != null and formName != ''">form_name ,</if>
<if test="dbId != null and dbId != ''">db_id ,</if>
<if test="filedId != null and filedId != ''">filed_id ,</if>
<if test="ruleName != null and ruleName != ''">rule_name ,</if>
<if test="ruleCode != null and ruleCode != ''">rule_code ,</if>
<if test="ruleValue != null and ruleValue != ''">rule_value ,</if>
<if test="ruleType != null and ruleType != ''">rule_type ,</if>
<if test="sorts != null">sorts ,</if>
<if test="create_user_id != null and create_user_id != ''">create_user_id ,</if>
<if test="create_time != null">create_time ,</if>
<if test="modify_user_id != null and modify_user_id != ''">modify_user_id ,</if>
<if test="modify_time != null">modify_time ,</if>
<if test="sts != null and sts != ''">sts ,</if>
<if test="org_id != null and org_id != ''">org_id ,</if>
<if test="companyId != null and companyId != ''">company_id ,</if>
<if test="sts == null ">sts,</if>
</trim>
)values(
<trim suffix="" suffixOverrides=",">
<if test="id != null and id != ''">#{id} ,</if>
<if test="mdmId != null and mdmId != ''">#{mdmId} ,</if>
<if test="formName != null and formName != ''">#{formName} ,</if>
<if test="dbId != null and dbId != ''">#{dbId} ,</if>
<if test="filedId != null and filedId != ''">#{filedId} ,</if>
<if test="ruleName != null and ruleName != ''">#{ruleName} ,</if>
<if test="ruleCode != null and ruleCode != ''">#{ruleCode} ,</if>
<if test="ruleValue != null and ruleValue != ''">#{ruleValue} ,</if>
<if test="ruleType != null and ruleType != ''">#{ruleType} ,</if>
<if test="sorts != null">#{sorts} ,</if>
<if test="create_user_id != null and create_user_id != ''">#{create_user_id} ,</if>
<if test="create_time != null">#{create_time} ,</if>
<if test="modify_user_id != null and modify_user_id != ''">#{modify_user_id} ,</if>
<if test="modify_time != null">#{modify_time} ,</if>
<if test="sts != null and sts != ''">#{sts} ,</if>
<if test="org_id != null and org_id != ''">#{org_id} ,</if>
<if test="companyId != null and companyId != ''">#{companyId} ,</if>
<if test="sts == null ">'Y',</if>
</trim>
)
</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)
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')
</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)
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})
</foreach>
on duplicate key update
mdm_id = values(mdm_id),
form_name = values(form_name),
db_id = values(db_id),
filed_id = values(filed_id),
rule_name = values(rule_name),
rule_code = values(rule_code),
rule_value = values(rule_value),
rule_type = values(rule_type),
create_user_id = values(create_user_id),
create_time = values(create_time),
modify_user_id = values(modify_user_id),
modify_time = values(modify_time),
sts = values(sts),
org_id = values(org_id),
company_id = values(company_id)
</insert>
<!--通过主键修改方法-->
<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>
<if test="formName != null and formName != ''">form_name = #{formName},</if>
<if test="dbId != null and dbId != ''">db_id = #{dbId},</if>
<if test="filedId != null and filedId != ''">filed_id = #{filedId},</if>
<if test="ruleName != null and ruleName != ''">rule_name = #{ruleName},</if>
<if test="ruleCode != null and ruleCode != ''">rule_code = #{ruleCode},</if>
<if test="ruleValue != null and ruleValue != ''">rule_value = #{ruleValue},</if>
<if test="ruleType != null and ruleType != ''">rule_type = #{ruleType},</if>
<if test="create_user_id != null and create_user_id != ''">create_user_id = #{create_user_id},</if>
<if test="create_time != null">create_time = #{create_time},</if>
<if test="modify_user_id != null and modify_user_id != ''">modify_user_id = #{modify_user_id},</if>
<if test="modify_time != null">modify_time = #{modify_time},</if>
<if test="sts != null and sts != ''">sts = #{sts},</if>
<if test="org_id != null and org_id != ''">org_id = #{org_id},</if>
<if test="companyId != null and companyId != ''">company_id = #{companyId},</if>
</trim>
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}
where id = #{id}
</update>
<!-- 多条件逻辑删除 -->
<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>
<if test="mdmId != null and mdmId != ''">and mdm_id = #{mdmId}</if>
<if test="formName != null and formName != ''">and form_name = #{formName}</if>
<if test="dbId != null and dbId != ''">and db_id = #{dbId}</if>
<if test="filedId != null and filedId != ''">and filed_id = #{filedId}</if>
<if test="ruleName != null and ruleName != ''">and rule_name = #{ruleName}</if>
<if test="ruleCode != null and ruleCode != ''">and rule_code = #{ruleCode}</if>
<if test="ruleValue != null and ruleValue != ''">and rule_value = #{ruleValue}</if>
<if test="ruleType != null and ruleType != ''">and rule_type = #{ruleType}</if>
<if test="sorts != null">and sorts = #{sorts}</if>
<if test="sts != null and sts != ''">and sts = #{sts}</if>
<if test="companyId != null and companyId != ''">and company_id = #{companyId}</if>
and sts='Y'
</trim>
</update>
<!--通过主键删除-->
<delete id="entity_delete">
delete from mdm_module_db_fileds_rule where id = #{id}
</delete>
</trim>
</update>
<!--通过主键删除-->
<delete id="entity_delete">
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 count(1) from mdm_module_db_fileds_rule
<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>
<if test="ruleCode != null and ruleCode != ''"> and rule_code = #{ruleCode} </if>
<if test="ruleValue != null and ruleValue != ''"> and rule_value = #{ruleValue} </if>
<if test="mdmId != null and mdmId != ''">and mdm_id != #{mdmId}</if>
<if test="ruleCode != null and ruleCode != ''">and rule_code = #{ruleCode}</if>
<if test="ruleValue != null and ruleValue != ''">and rule_value = #{ruleValue}</if>
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>

View File

@ -1,8 +1,11 @@
package com.hzya.frame.mdm.service;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.mdm.entity.MdmDataFiledDto;
import com.hzya.frame.web.entity.JsonResultEntity;
import java.util.List;
/**
* 主数据服务接口
*/
@ -118,6 +121,15 @@ public interface IMdmService {
* @Date 9:40 上午 2023/10/18
**/
JsonResultEntity doMdmDistribute(JSONObject jsonObject) throws Exception;
/**
* @Author lvleigang
* @Description 修改树结构的下级以及其他使用地方数据
* @Date 9:12 上午 2024/8/2
* @param mdmId 主数据mdmId
* @param tableName 主数据的表名
* @param id 数据id
* @param mdmDataFiledDtos 数据
* @return void
**/
void updateTreeUseData(String mdmId, String tableName, String id, List<MdmDataFiledDto> mdmDataFiledDtos);
}

View File

@ -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());
@ -2611,6 +2612,11 @@ public class MdmServiceImpl implements IMdmService {
mdmDataDto.setId(jsonObject.getString("id"));
id = jsonObject.getString("id");
updateTreeUseData(mdmModuleEntity.getId(),mdmDataDto.getTableName(),id,mdmDataFiledDtos);
int a = mdmModuleDao.updateForm(mdmDataDto);
} else {
@ -2762,6 +2768,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());
@ -2776,6 +2783,132 @@ public class MdmServiceImpl implements IMdmService {
return str.toString();
}
/**
* @Author lvleigang
* @Description 修改树结构的下级以及其他使用地方数据
* @Date 9:12 上午 2024/8/2
* @param mdmId 主数据mdmId
* @param tableName 主数据的表名
* @param id 数据id
* @param mdmDataFiledDtos 数据
* @return void
**/
public void updateTreeUseData(String mdmId, String tableName, String id, List<MdmDataFiledDto> mdmDataFiledDtos) {
//查询是否设置的树形
MdmModuleViewEntity mdmModuleViewEntity = new MdmModuleViewEntity();
mdmModuleViewEntity.setMdmId(mdmId);
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", tableName);//表名
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 (!"".equals(oldData)) {
oldData = oldData + "," + id;
} else {
oldData = id;
}
if (!"".equals(newData)) {
newData = newData + "," + id;
} else {
newData = id;
}
if (!upFlag) {
//查询引用地方
Map<String, String> maps = new HashMap<>();
maps.put("service", tableName);
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 {//明细表上的字段
Map<String, String> updateMaps = new HashMap<>();
updateMaps.put("mainDBTable", mainDBTable);
updateMaps.put("tableName", dataDBTable);
updateMaps.put("upFiled", upFiled);
updateMaps.put("oldData", oldData);
updateMaps.put("newData", newData);
updateMaps.put("modify_user_id", StpUtil.getLoginIdAsString());
mdmModuleDao.updataTreeUpDataDetail(updateMaps);
}
}
}
}
}
}
/**
* @param jsonObject

View File

@ -15,13 +15,21 @@ public interface INingboBankTreasuryService {
/**
* @Author lvleigang
* @Description 单笔查证接口
* @Description 发送宁波银行
* @Date 4:45 下午 2024/7/9
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
**/
Object sendNbBank(JSONObject jsonObject);
/**
* @Author lvleigang
* @Description 发送宁波银行下载文件
* @Date 4:45 下午 2024/7/9
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
**/
Object sendNbBankFileDownload(JSONObject jsonObject);
/**
*
* @content 此方法获取初始化参数拼接请求参数

View File

@ -13,6 +13,8 @@ import com.hzya.frame.web.entity.JsonResultEntity;
import com.nbcb.sdk.OpenSDK;
import com.nbcb.sdk.aes.exception.SDKException;
import com.nbcb.sdk.aes.param.ConfigParam;
import com.nbcb.sdk.file.FileDownloadResponse;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
@ -85,6 +87,69 @@ public class NingboBankTreasuryServiceImpl implements INingboBankTreasuryService
}
}
/**
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
* @Author lvleigang
* @Description 发送宁波银行下载文件
*
* @Date 4:45 下午 2024/7/9
**/
@Override
public Object sendNbBankFileDownload(JSONObject jsonObject) {
JSONObject returnJson = new JSONObject();
JSONObject entity = getstrObj("jsonStr", jsonObject);
String dataJson = entity.getString("Data");
JSONObject data = JSONObject.parseObject(dataJson);
JSONObject dataFileid = data.getJSONObject("Data");
String appKey = entity.getString("appKey");
String privateKey = entity.getString("privateKey");
String publicUrl = entity.getString("publicUrl");
String publicKey = entity.getString("publicKey");
String productID = entity.getString("productID");
String serviceID = entity.getString("serviceID");
//初始化宁波银行OpenSDK
try {
ConfigParam configParam = new ConfigParam(privateKey,publicUrl,appKey,publicKey,10000,20000);
OpenSDK.dynamicInit(configParam,true);
} catch (SDKException e) {
logger.error("初始化宁波银行OpenSDK错误:{}",e.getMessage());
returnJson.put("retCode","9999");
returnJson.put("retMsg","初始化宁波银行OpenSDK错误");
return returnJson;
}
//发送数据
try {
FileDownloadResponse returnData = OpenSDK.sendFileDownload(productID,"open-filegateway",dataFileid.getString("fileId"),null);
if(returnData == null || "".equals(returnData)){
returnJson.put("retCode","9999");
returnJson.put("retMsg","发送宁波银行OpenSDK返回错误");
return returnJson;
}
try {
//returnJson = JSONObject.parseObject(returnData);
//JSONObject retData = returnJson.getJSONObject("Data");
String retCode = returnData.getRetCode();
String retMsg = returnData.getRetMsg();
returnJson.put("data",returnData.getData());
returnJson.put("retCode",retCode);
returnJson.put("retMsg",retMsg);
return returnJson;
} catch (Exception e) {
returnJson.put("retCode","9999");
returnJson.put("retMsg","发送宁波银行OpenSDK返回转换Json错误");
return returnJson;
}
} catch (Exception e) {
returnJson.put("retCode","9999");
returnJson.put("retMsg","发送宁波银行OpenSDK错误");
return returnJson;
}
}
/**
* 分页方式 全量查询境内账户交易明细
* accTransactionReq.custId 客户号 必填

View File

@ -3,15 +3,168 @@ package com.hzya.frame.seeyon.receiptFor.entity;
import com.hzya.frame.web.entity.BaseEntity;
public class ReceiptForEntity extends BaseEntity {
private String dfybje;
private String djrq;
private String djrq;//field0003单据日期合同申请日期
private String dwbm;
private String hbbm;
private String hbbm;//field0090客商客商编码客商档案
private String lrr;
private String shr;
private String shrq;
private String state;
private String djbh;//field0001单据号
private Long wldx;//field0004往来对象
private String deptid;//field0091部门部门档案部门编码
private String ywybm;//field0092业务员人员档案业务员编码
private String bfyhzh;//field0060收款银行账号客户方账号
private String skyhmc;//field0062收款银行名称客户方开户行
private String dfyhzh;//field0014付款银行账号我方账号
private String fkyhmc;//field0051付款银行名称我方开户行
private String bzbm;//field0072币种默认CNY币种编码
private String dfbbje;
private String dfybje;
private String ddh;
private String bbhl;
private String contractno;
public String getDfbbje() {
return dfbbje;
}
public void setDfbbje(String dfbbje) {
this.dfbbje = dfbbje;
}
public String getDdh() {
return ddh;
}
public void setDdh(String ddh) {
this.ddh = ddh;
}
public String getBbhl() {
return bbhl;
}
public void setBbhl(String bbhl) {
this.bbhl = bbhl;
}
public String getContractno() {
return contractno;
}
public void setContractno(String contractno) {
this.contractno = contractno;
}
private String fph;//field0019发票号
private String zy;//field0059摘要
private String bzbm_code;//field0073币种编码
public String getFph() {
return fph;
}
public void setFph(String fph) {
this.fph = fph;
}
public String getZy() {
return zy;
}
public void setZy(String zy) {
this.zy = zy;
}
public String getBzbm_code() {
return bzbm_code;
}
public void setBzbm_code(String bzbm_code) {
this.bzbm_code = bzbm_code;
}
public String getDjbh() {
return djbh;
}
public void setDjbh(String djbh) {
this.djbh = djbh;
}
public Long getWldx() {
return wldx;
}
public void setWldx(Long wldx) {
this.wldx = wldx;
}
public String getDeptid() {
return deptid;
}
public void setDeptid(String deptid) {
this.deptid = deptid;
}
public String getYwybm() {
return ywybm;
}
public void setYwybm(String ywybm) {
this.ywybm = ywybm;
}
public String getBfyhzh() {
return bfyhzh;
}
public void setBfyhzh(String bfyhzh) {
this.bfyhzh = bfyhzh;
}
public String getSkyhmc() {
return skyhmc;
}
public void setSkyhmc(String skyhmc) {
this.skyhmc = skyhmc;
}
public String getDfyhzh() {
return dfyhzh;
}
public void setDfyhzh(String dfyhzh) {
this.dfyhzh = dfyhzh;
}
public String getFkyhmc() {
return fkyhmc;
}
public void setFkyhmc(String fkyhmc) {
this.fkyhmc = fkyhmc;
}
public String getBzbm() {
return bzbm;
}
public void setBzbm(String bzbm) {
this.bzbm = bzbm;
}
public String getState() {
return state;

View File

@ -13,6 +13,20 @@
<result property="shr" column="r_shr" jdbcType="VARCHAR"/>
<result property="shrq" column="r_shrq" jdbcType="VARCHAR"/>
<result property="djbh" column="r_djbh" jdbcType="VARCHAR"/>
<result property="wldx" column="r_wldx" jdbcType="INTEGER"/>
<result property="deptid" column="r_deptid" jdbcType="VARCHAR"/>
<result property="ywybm" column="r_ywybm" jdbcType="VARCHAR"/>
<result property="bfyhzh" column="r_bfyhzh" jdbcType="VARCHAR"/>
<result property="skyhmc" column="r_skyhmc" jdbcType="VARCHAR"/>
<result property="dfyhzh" column="r_dfyhzh" jdbcType="VARCHAR"/>
<result property="fkyhmc" column="r_fkyhmc" jdbcType="VARCHAR"/>
<result property="bzbm" column="r_bzbm" jdbcType="VARCHAR"/>
<result property="fph" column="r_fph" jdbcType="VARCHAR"/>
<result property="zy" column="r_zy" jdbcType="VARCHAR"/>
<result property="bzbm_code" column="r_bzbm_code" jdbcType="VARCHAR"/>
<result property="dfbbje" column="r_dfbbje" jdbcType="VARCHAR"/>
</resultMap>
<!-- <select id="ReceiptForEntity_list_base" resultMap="get-ReceiptForEntity-result" parameterType="com.hzya.frame.seeyon.receiptFor.entity.ReceiptForEntity">-->
@ -25,30 +39,61 @@
<!-- '17633965916' as r_shr,-->
<!-- '2024-07-23' as r_shrq-->
<!-- from formmain_0045-->
<!-- </select>-->
<!-- <select id="ReceiptForEntity_list_base" resultMap="get-ReceiptForEntity-result" parameterType="com.hzya.frame.seeyon.receiptFor.entity.ReceiptForEntity">-->
<!-- select-->
<!-- id,-->
<!-- '1' as r_dfybje,-->
<!-- '2024-07-23' as r_djrq,-->
<!-- '001' as r_dwbm,-->
<!-- field0090 as r_hbbm,-->
<!-- field0092 as r_lrr,-->
<!-- field0094 as r_shr,-->
<!-- '2024-07-23' as r_shrq-->
<!-- from formmain_0045-->
<!-- where field0089 = 'N'-->
<!-- <trim>-->
<!-- <if test="id !=null and id!=''">and id like concat('%',#{id},'%')</if>-->
<!-- </trim>-->
<!-- </select>-->
<select id="ReceiptForEntity_list_base" resultMap="get-ReceiptForEntity-result" parameterType="com.hzya.frame.seeyon.receiptFor.entity.ReceiptForEntity">
select
id,
'1' as r_dfybje,
'2024-07-23' as r_djrq,
'001' as r_dwbm,
'C000001' as r_hbbm,
'17633965916' as r_lrr,
'17633965916' as r_shr,
'2024-07-23' as r_shrq
field0003 as r_djrq,
field0003 as r_shrq,
field0047 as r_dwbm,
field0090 as r_hbbm,
field0092 as r_lrr,
field0092 as r_shr,
field0013 as r_dfbbje,
field0011 as r_dfybje,
field0019 as r_fph,
field0059 as r_zy,
field0073 as r_bzbm_code,
field0001 as r_djbh,
field0004 as r_wldx,
field0091 as r_deptid,
field0060 as r_bfyhzh,
field0062 as r_skyhmc,
field0014 as r_dfyhzh,
field0051 as r_fkyhmc,
field0073 as r_bzbm,
field0092 as r_ywybm
from formmain_0045
where sts = 'N'
<trim>
<if test="id !=null and id!=''">and id like concat('%',#{id},'%')</if>
</trim>
where field0089 = 'N'
<trim>
<if test="id !=null and id!=''">and id like concat('%',#{id},'%')</if>
</trim>
</select>
<!-- ReceiptForEntity_update_state-->
<!--通过主键修改方法-->
<update id="ReceiptForEntity_update_state" parameterType = "com.hzya.frame.seeyon.receiptFor.entity.ReceiptForEntity" >
update formmain_0045 set state = #{state} where id = #{id}
update formmain_0045 set field0089 = #{state} where id = #{id}
</update>

View File

@ -66,12 +66,11 @@ public class ReceiptForServiceImpl extends BaseService<ReceiptForEntity,String>
JSONObject main = bindingAdd(rec);
logger.info("收款认领单推送数据:"+main.toString());
String result = BipUtil.sendOaToDj(main.toString(),"8000350034");
String result = BipUtil.sendOaToU8c(main.toString(),"8000350034");
logger.info("收款认领单推送结果:"+result);
IntegrationTaskLivingDetailsEntity logDetails = new IntegrationTaskLivingDetailsEntity();
logDetails.setRootAppPk(rec.getId());
//logDetails.setRootAppBill();
//不知道源系统单据是什么所以先注释掉了
logDetails.setRootAppBill(rec.getDjbh());
logDetails.setNewTransmitInfo(result);
logDetails.setNewPushDate(new Date());
logDetails.setRootAppNewData(JSON.toJSONString(rec));
@ -81,17 +80,16 @@ public class ReceiptForServiceImpl extends BaseService<ReceiptForEntity,String>
boolean flag = resultObj.get("status").equals("success");
if(flag){
// 推送成功更新状态
rec.setState("1");
rec.setState("Y");
}else{
// 推送失败
rec.setState("0");
rec.setState("N");
}
rec.setDataSourceCode(requestJson.getString("db_code"));
try{
if(StrUtil.isEmpty(interId)){
if(flag){
//首推成功
//由于字段匹配问题logDetails中没设置单据号因此会保存失败
taskLivingDetailsService.saveLogToSuccess(logDetails);
}else{
//首推失败
@ -124,29 +122,99 @@ public class ReceiptForServiceImpl extends BaseService<ReceiptForEntity,String>
return new JsonResultEntity("成功",true,resultEntity);
}
// @NotNull
// private JSONObject bindingAdd(ReceiptForEntity rec) {
// String djrq = rec.getDjrq().substring(0,10);
// if(djrq.length()>10){
// djrq = rec.getDjrq().substring(0,10);
// }
// String shrq = rec.getShrq().substring(0,10);
// if(shrq.length()>10){
// shrq = rec.getShrq().substring(0,10);
// }
//
// JSONObject childrenJson = new JSONObject();
// childrenJson.put("dfybje",rec.getDfybje());
//
// childrenJson.put("dfbbje","24");
// childrenJson.put("dfybje","12");
// childrenJson.put("ddh","1231231");
// childrenJson.put("fph","fph12312");
// childrenJson.put("zy","zy");
// childrenJson.put("bzbm_code","CNY");
// childrenJson.put("bbhl","2");
// childrenJson.put("contractno","hth123123");
//
//
// JSONArray childrenArray = new JSONArray();
// childrenArray.add(childrenJson);
//
// JSONObject parentvo = new JSONObject();
// parentvo.put("djrq",djrq);
// parentvo.put("dwbm",rec.getDwbm());
// parentvo.put("hbbm",rec.getHbbm());
// parentvo.put("lrr",rec.getLrr());
// parentvo.put("shr",rec.getShr());
// parentvo.put("shrq",shrq);
//
// JSONObject billvoJson = new JSONObject();
// billvoJson.put("children",childrenArray);
// billvoJson.put("parentvo",parentvo);
//
// JSONArray billvoArray = new JSONArray();
// billvoArray.add(billvoJson);
// JSONObject main = new JSONObject();
// main.put("billvo",billvoArray);
// return main;
// }
@NotNull
private JSONObject bindingAdd(ReceiptForEntity rec) {
String djrq = rec.getDjrq().substring(0,10);
if(djrq.length()>19){
djrq = rec.getDjrq().substring(0,10);
}
String shrq = rec.getShrq().substring(0,10);
if(shrq.length()>19){
shrq = rec.getShrq().substring(0,10);
}
// if(rec.getDjrq()!=null){
// String djrq = rec.getDjrq().substring(0,10);
// if(djrq.length()>10){
// djrq = rec.getDjrq().substring(0,10);
// }
// }
// if(rec.getShrq()!=null){
// String shrq = rec.getShrq().substring(0,10);
// if(shrq.length()>10){
// shrq = rec.getShrq().substring(0,10);
// }
// }
JSONObject childrenJson = new JSONObject();
childrenJson.put("dfybje",rec.getDfybje());
//childrenJson.put("dfbbje",rec.getDfbbje());
childrenJson.put("ddh",rec.getDdh());
childrenJson.put("fph",rec.getFph());
childrenJson.put("zy",rec.getZy());
childrenJson.put("bzbm_code",rec.getBzbm_code());
childrenJson.put("bbhl",rec.getBbhl());
childrenJson.put("contractno",rec.getContractno());
JSONObject dfybjeJson = new JSONObject();
dfybjeJson.put("dfybje",rec.getDfybje());
JSONArray childrenArray = new JSONArray();
childrenArray.add(dfybjeJson);
childrenArray.add(childrenJson);
JSONObject parentvo = new JSONObject();
parentvo.put("djrq",djrq);
parentvo.put("djrq",rec.getDjrq().substring(0,10));
parentvo.put("dwbm",rec.getDwbm());
parentvo.put("hbbm",rec.getHbbm());
parentvo.put("lrr",rec.getLrr());
parentvo.put("shr",rec.getShr());
parentvo.put("shrq",shrq);
parentvo.put("shrq",rec.getShrq().substring(0,10));
parentvo.put("djbh",rec.getDjbh());
//parentvo.put("wldx",rec.getWldx());
parentvo.put("deptid",rec.getDeptid());
//parentvo.put("ywybm",rec.getYwybm());
//parentvo.put("bfyhzh",rec.getBfyhzh());
parentvo.put("skyhmc",rec.getSkyhmc());
//parentvo.put("dfyhzh",rec.getDfyhzh());
parentvo.put("fkyhmc",rec.getFkyhmc());
parentvo.put("bzbm",rec.getBzbm());
JSONObject billvoJson = new JSONObject();
billvoJson.put("children",childrenArray);

View File

@ -2099,7 +2099,25 @@ public class SysApplicationServiceImpl extends BaseService<SysApplicationEntity,
send.put("header", headers);
send.put("querys", querys);
sysMessageManageLogEntity.setTargetData(send.toString());//目标data
sysMessageManageLogEntity.setReturnData(body);//返回信息
if(receiveApp.getAppType() != null && "4".equals(receiveApp.getAppType())){//宁波银行
JSONObject jsonObject1 = JSONObject.parseObject(body);
String retCode = jsonObject1.getString("retCode");
if(retCode != null && "0000".equals(retCode)){
JSONObject jsonObject2 = JSONObject.parseObject(jsonObject1.getString("data"));
String fileBytes = jsonObject2.getString("fileBytes");
if(fileBytes != null && !"".equals(fileBytes)){
jsonObject2.put("fileBytes","");
jsonObject1.put("data",jsonObject2);
sysMessageManageLogEntity.setReturnData(jsonObject1.toJSONString());//返回信息
}else {
sysMessageManageLogEntity.setReturnData(body);//返回信息
}
}else {
sysMessageManageLogEntity.setReturnData(body);//返回信息
}
}else {
sysMessageManageLogEntity.setReturnData(body);//返回信息
}
//校验返回

View File

@ -232,9 +232,8 @@ public class MasterDataServiceImpl extends BaseService<ComparisonEntity, String>
jsonObjectUser.put("mdmCode", mdmCode);
jsonStr.put("jsonStr", jsonObjectUser);
//先查询编码和名称查询是否存在
JsonResultEntity jsonResultEntity = comparisonServiceimpl.queryEntityPage(jsonStr);
Object attribute = jsonResultEntity.getAttribute();
logger.info("得到的attribute值为{}", attribute);
Object attribute = comparisonServiceimpl.queryEntityPage(jsonStr);
logger.info("得到的attribute值为{}", jsonStr.toJSONString(attribute));
JSONObject jsonObjectAttribute = (JSONObject) JSON.toJSON(attribute);
JSONArray jsonArrayList = jsonObjectAttribute.getJSONArray("list");
//如果jsonArrayList为null说明没有值在表中不存在
@ -250,20 +249,22 @@ public class MasterDataServiceImpl extends BaseService<ComparisonEntity, String>
hashMap.put("mdmCode", mdmCode);
hashMap.put("optionName", "数智中台");
jsonStr.put("jsonStr", hashMap);
JsonResultEntity result = comparisonServiceimpl.saveEntity(jsonStr);
if(!result.isFlag()){
throw new BaseSystemException("主数据保存失败"+ result.getMsg());
}
Object result = comparisonServiceimpl.saveEntity(jsonStr);
logger.info("新增结果为:{}", JSON.toJSONString(result));
// if(!result.isFlag()){
// throw new BaseSystemException("主数据保存失败"+ result.getMsg());
// }
} else {
hashMap.put("appName","数智中台");
hashMap.put("appCode","800004");
hashMap.put("mdmCode", mdmCode);
hashMap.put("optionName", "数智中台");
jsonStr.put("jsonStr", hashMap);
JsonResultEntity result = comparisonServiceimpl.updateEntity(jsonStr);
if(!result.isFlag()){
//throw new BaseSystemException("主数据更新失败"+ result.getMsg());
}
Object result = comparisonServiceimpl.updateEntity(jsonStr);
logger.info("更新结果为:{}", JSON.toJSONString(result));
// if(!result.isFlag()){
// //throw new BaseSystemException("主数据更新失败"+ result.getMsg());
// }
}
}
return null;

View File

@ -2,6 +2,7 @@ package com.hzya.frame.sysnew.comparison.service;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.github.pagehelper.PageInfo;
import com.hzya.frame.basedao.service.IBaseService;
import com.hzya.frame.sysnew.application.entity.SysExtensionApiEntity;
import com.hzya.frame.sysnew.comparison.entity.ComparisonEntity;
@ -17,7 +18,7 @@ public interface IComparisonService extends IBaseService<ComparisonEntity, Strin
* @Author hecan
* @Date 2024/5/7 15:55
* **/
JsonResultEntity queryEntityPage(JSONObject jsonObject);
Object queryEntityPage(JSONObject jsonObject);
/**
*
@ -27,7 +28,7 @@ public interface IComparisonService extends IBaseService<ComparisonEntity, Strin
* @Author hecan
* @Date 2024/5/7 16:52
* **/
JsonResultEntity saveEntity(JSONObject jsonObject);
Object saveEntity(JSONObject jsonObject);
/**
*
@ -37,7 +38,7 @@ public interface IComparisonService extends IBaseService<ComparisonEntity, Strin
* @Author hecan
* @Date 2024/5/9 10:19
* **/
JsonResultEntity updateEntity(JSONObject jsonObject);
Object updateEntity(JSONObject jsonObject);
/**
*
@ -47,7 +48,7 @@ public interface IComparisonService extends IBaseService<ComparisonEntity, Strin
* @Author hecan
* @Date 2024/5/9 13:59
* **/
JsonResultEntity deleteEntity(JSONObject jsonObject);
Object deleteEntity(JSONObject jsonObject);
/**
*

View File

@ -57,8 +57,9 @@ public class ComparisonServiceImpl extends BaseService<ComparisonEntity, String>
//分页查询通用数据数据
@Override
public JsonResultEntity queryEntityPage(JSONObject json) {
public Object queryEntityPage(JSONObject json) {
JSONObject jsonObject = json.getJSONObject("jsonStr");
JSONObject json1 = new JSONObject();
if (jsonObject == null) {
return BaseResult.getFailureMessageEntity("数据为空,请先传递数据");
}
@ -122,7 +123,10 @@ public class ComparisonServiceImpl extends BaseService<ComparisonEntity, String>
}
}
PageInfo pageInfo = new PageInfo(list);
return BaseResult.getSuccessMessageEntity("查询成功", pageInfo);
json1.put("status","200");
json1.put("pageInfo",pageInfo);
return json1;
} catch (Exception e) {
logger.info("查询通用数据错误:{}", e.getMessage());
return BaseResult.getFailureMessageEntity("查询失败");
@ -133,7 +137,7 @@ public class ComparisonServiceImpl extends BaseService<ComparisonEntity, String>
//新增通用数据数据
@Override
public JsonResultEntity saveEntity(JSONObject json) {
public Object saveEntity(JSONObject json) {
JSONObject jsonObject = json.getJSONObject("jsonStr");
if (jsonObject == null) {
return BaseResult.getFailureMessageEntity("数据为空,请先传递数据");
@ -330,7 +334,10 @@ public class ComparisonServiceImpl extends BaseService<ComparisonEntity, String>
list.add(jsonObjectList);
//保存操作日志
controlsLogDaoimpl.saveControlsLog(uuid,jsonObject.getString("appName"),jsonObject.getString("appCode"),jsonObject.toJSONString(),"接口新增",jsonObject.getString("optionName"),tableName+"_option_log","1");
return BaseResult.getSuccessMessageEntity("保存成功", list);
JSONObject json1 = new JSONObject();
json1.put("status","200");
json1.put("list",list);
return json1;
} catch (Exception e) {
logger.info("保存通用数据时候错误:{}", e.getMessage());
//保存操作日志
@ -345,7 +352,7 @@ public class ComparisonServiceImpl extends BaseService<ComparisonEntity, String>
//更新通用数据数据
@Override
public JsonResultEntity updateEntity(JSONObject json) {
public Object updateEntity(JSONObject json) {
JSONObject jsonObject = json.getJSONObject("jsonStr");
if (jsonObject == null) {
return BaseResult.getFailureMessageEntity("数据为空,请先传递数据");
@ -465,7 +472,10 @@ public class ComparisonServiceImpl extends BaseService<ComparisonEntity, String>
jsonObjects.add(jsonObjectList);
//保存操作日志
controlsLogDaoimpl.saveControlsLog(comparisonEntity.getId(),jsonObject.getString("appName"),jsonObject.getString("appCode"),jsonObject.toJSONString(),"接口更新",jsonObject.getString("optionName"),comparisonEntity.getDbName()+"_option_log","1");
return BaseResult.getSuccessMessageEntity("更新成功", jsonObjects);
JSONObject json1 = new JSONObject();
json1.put("status","200");
json1.put("list",jsonObjects);
return json1;
}else{
return BaseResult.getFailureMessageEntity("更新失败");
}
@ -487,7 +497,7 @@ public class ComparisonServiceImpl extends BaseService<ComparisonEntity, String>
//删除通用数据
@Override
public JsonResultEntity deleteEntity(JSONObject json) {
public Object deleteEntity(JSONObject json) {
JSONObject jsonObject = json.getJSONObject("jsonStr");
if (jsonObject == null) {
return BaseResult.getFailureMessageEntity("数据为空,请先传递数据");
@ -575,7 +585,10 @@ public class ComparisonServiceImpl extends BaseService<ComparisonEntity, String>
// controlsLogDaoimpl.saveControlsLog(comparisonDetailsEntity.getId(),jsonObject.getString("appName"),jsonObject.getString("appCode"),jsonObject.toJSONString(),"接口删除",jsonObject.getString("optionName"),comparisonEntity.getDbName()+"_option_log");
}
controlsLogDaoimpl.saveControlsLog(comparisonEntity.getId(),jsonObject.getString("appName"),jsonObject.getString("appCode"),jsonObject.toJSONString(),"接口删除",jsonObject.getString("optionName"),comparisonEntity.getDbName()+"_option_log","1");
return BaseResult.getSuccessMessageEntity("删除成功",integer);
JSONObject json1 = new JSONObject();
json1.put("status","200");
json1.put("integer",integer);
return json1;
}else{
return BaseResult.getFailureMessageEntity("删除失败","请查看data_id是否在表中存在");
}

View File

@ -34,42 +34,49 @@ public class GroovyIntegrationServiceImpl implements IGroovyIntegrationService {
}
public static void main(String[] args) {
java.lang.String str = "{\"data\":{\"enablestate\":\"2\",\"user_password\":\"Hzya@1314\",\"gender\":\"12312\",\"user_name\":\"测试用户\",\"modify_time\":1719305835000,\"document_rule_num\":112,\"pk_org\":{\"org_mnecode\":\"1\",\"modify_time\":1718866279000,\"document_rule_num\":4,\"add_status\":\"0\",\"org_address\":\"1\",\"delete_status\":\"1\",\"org_innercode\":\"1\",\"id\":\"f7a8cee35fce4aa8ab266b3c7f125d7d\",\"data_status\":\"F\",\"modify_user_id\":\"1\",\"org_name\":\"开发部\",\"sorts\":4,\"document_rule\":\"ZZ-2024-06-20-00004\",\"create_user_id\":\"1\",\"create_time\":1718864103000,\"company_id\":\"Y\",\"org_memo\":\"1\",\"update_status\":\"0\",\"sts\":\"Y\",\"org_tel\":\"1\",\"org_id\":\"Y\",\"org_ncindustry\":\"1\",\"org_fatherorg\":\"c4913dde8da142bab4206fc084269382\",\"org_code\":\"003\",\"org_principal\":\"1\",\"org_countryzone\":\"1\"},\"add_status\":\"0\",\"pwdlevelcode\":\"\",\"user_type\":\"1\",\"user_code\":\"17633965916\",\"delete_status\":\"1\",\"id\":\"d99fe4e1c211450a960f7a1057da0d2c\",\"data_status\":\"F\",\"modify_user_id\":\"1\",\"sorts\":346,\"document_rule\":\"YH-2024-06-25-00112\",\"create_user_id\":\"1\",\"create_time\":1719305229000,\"company_id\":\"Y\",\"user_code_q\":\"KP003\",\"format\":\"ZH-CN\",\"mobile\":\"123123\",\"identityverifycode\":\"静态密码验证\",\"islocked\":\"N\",\"update_status\":\"0\",\"base_doc_type\":\"0\",\"sts\":\"Y\",\"login_name\":\"123123\",\"pwdparam\":\"2024-06-17\",\"org_id\":\"Y\",\"abledate\":\"2024-06-17 00:00:00\",\"isca\":\"Y\",\"contentlang\":\"ZH\"},\"query\":\"[]\",\"header\":\"[{\\\"parameterType\\\":\\\"fundamental\\\",\\\"length\\\":\\\"100\\\",\\\"index\\\":0,\\\"description\\\":\\\"MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA87rrNR\\\",\\\"concreteType\\\":\\\"String\\\",\\\"id\\\":\\\"7127798c-b731-453a-b3ac-cfe9033eeace\\\",\\\"parameterName\\\":\\\"pubKey\\\",\\\"required\\\":true,\\\"example\\\":\\\"MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA87rrNREgMNeOEOwlvM2iqqEfshDadRHziDSB2PbRnoMqSv1nGr3XBlZuseNj5HmxDEkLhOdfyw0yjzoz3wK7XhFpeN4Iyf7NT7hps5jAQMEpnul9Qwmj5qUr/eK5SaO9H8n7sh9BvCdrX9oRUh+U2/ceA3O+y/MUHk5DRvSadc8FhpqbOaNBbAzPnyYAwpVUPvaJ90jcGN1ZG99HR1GEzC+Cn9s6vgt7dYL6ysMs36bSP47xraDSxpfr0CLwa6JV/9KjLIeqL1ZaMtK0CJ1zJGCBA6O6kgxeE9Ul7q2lSS6mPAEJ78izaTYsrjhLpKT+eTtFBOLFbiCrbLp8tVE5kwIDAQAB\\\"},{\\\"parameterType\\\":\\\"fundamental\\\",\\\"length\\\":\\\"50\\\",\\\"index\\\":1,\\\"description\\\":\\\"OA\\\",\\\"concreteType\\\":\\\"String\\\",\\\"id\\\":\\\"7f965281-df0f-4d2f-b005-07e061fcde49\\\",\\\"parameterName\\\":\\\"client_id\\\",\\\"required\\\":true,\\\"example\\\":\\\"OA\\\"},{\\\"parameterType\\\":\\\"authport\\\",\\\"length\\\":\\\"50\\\",\\\"index\\\":2,\\\"concreteType\\\":\\\"String\\\",\\\"id\\\":\\\"cbc0e105-17c0-4385-8863-8903303edc1f\\\",\\\"parameterName\\\":\\\"access_token\\\",\\\"example\\\":[\\\"attribute\\\",\\\"data\\\",\\\"access_token\\\"]}]\",\"body\":\"[{\\\"index\\\":0,\\\"id\\\":\\\"beeedbc6-24c2-4093-9a5e-20fced9fb1b4\\\",\\\"parameterName\\\":\\\"body\\\",\\\"first\\\":true}]\"}";
A88772 s = new A88772();
s.execute(str);
// java.lang.String str = "{\"data\":{\"document_rule\":\"WLFL-2024-07-31-00025\",\"create_user_id\":\"1\",\"create_time\":1722405930000,\"company_id\":\"Y\",\"modify_time\":1722405930000,\"materiel_classify_name\":\"测试下发一级\",\"document_rule_num\":25,\"materiel_classify_code\":\"09\",\"add_status\":\"0\",\"update_status\":\"0\",\"sts\":\"Y\",\"delete_status\":\"1\",\"org_id\":\"Y\",\"id\":\"3dac9727cc0648baa8c1355464ad44b8\",\"data_status\":\"F\",\"modify_user_id\":\"1\",\"sorts\":34},\"query\":\"[]\",\"header\":\"[{\\\"parameterType\\\":\\\"fundamental\\\",\\\"concreteType\\\":\\\"String\\\",\\\"index\\\":0,\\\"parameterName\\\":\\\"usercode\\\",\\\"id\\\":\\\"e2c4013a-a5ad-4d21-9e91-aac0dd738838\\\",\\\"example\\\":\\\"17633965916\\\"},{\\\"parameterType\\\":\\\"fundamental\\\",\\\"concreteType\\\":\\\"String\\\",\\\"index\\\":1,\\\"parameterName\\\":\\\"password\\\",\\\"id\\\":\\\"22373440-45f5-450c-9497-40ede659e831\\\",\\\"example\\\":\\\"92d40fd65a74377608c0039eaafdba99\\\"},{\\\"parameterType\\\":\\\"fundamental\\\",\\\"concreteType\\\":\\\"String\\\",\\\"index\\\":2,\\\"parameterName\\\":\\\"trantype\\\",\\\"id\\\":\\\"12fd925a-29c1-42ca-a3e6-edf3c925c495\\\",\\\"example\\\":\\\"code\\\"},{\\\"parameterType\\\":\\\"fundamental\\\",\\\"concreteType\\\":\\\"String\\\",\\\"index\\\":3,\\\"parameterName\\\":\\\"system\\\",\\\"id\\\":\\\"11dd627c-bb82-4304-bff0-2ba54e2b8907\\\",\\\"example\\\":\\\"01\\\"}]\",\"tripartiteId\":\"0001A110000000000R6D\",\"body\":\"[{\\\"parameterType\\\":\\\"complex\\\",\\\"children\\\":[{\\\"parameterType\\\":\\\"complexlist\\\",\\\"children\\\":[{\\\"parameterType\\\":\\\"fundamental\\\",\\\"concreteType\\\":\\\"String\\\",\\\"index\\\":2,\\\"description\\\":\\\"分类编码\\\",\\\"parameterName\\\":\\\"invclasscode\\\",\\\"id\\\":\\\"3b2af319-87c8-400a-b38a-d54f9b207f26\\\",\\\"example\\\":\\\"04\\\"},{\\\"parameterType\\\":\\\"fundamental\\\",\\\"concreteType\\\":\\\"String\\\",\\\"index\\\":3,\\\"description\\\":\\\"分类名称\\\",\\\"parameterName\\\":\\\"invclassname\\\",\\\"id\\\":\\\"7c5bd695-ed84-4a92-a1c7-31c862e98d21\\\",\\\"example\\\":\\\"成品测试1\\\"},{\\\"parameterType\\\":\\\"fundamental\\\",\\\"concreteType\\\":\\\"String\\\",\\\"index\\\":4,\\\"description\\\":\\\"公司编码默认0001\\\",\\\"parameterName\\\":\\\"pk_corp\\\",\\\"id\\\":\\\"482d659b-b374-4fb5-b31b-32bca4a6d8be\\\",\\\"example\\\":\\\"0001\\\"},{\\\"parameterType\\\":\\\"fundamental\\\",\\\"concreteType\\\":\\\"String\\\",\\\"index\\\":5,\\\"description\\\":\\\"分类主键\\\",\\\"parameterName\\\":\\\"pk_invcl\\\",\\\"id\\\":\\\"3fa6caac-e0cd-4ec7-8df4-7c990504ee25\\\",\\\"example\\\":\\\"0001F11000000000I6NN\\\"}],\\\"concreteType\\\":\\\"ObjectCom\\\",\\\"index\\\":1,\\\"parameterName\\\":\\\"invcl\\\",\\\"id\\\":\\\"0638670a-e65d-46e1-aabd-adc7a956c4cb\\\"}],\\\"concreteType\\\":\\\"Object\\\",\\\"index\\\":0,\\\"id\\\":\\\"81cdd912-9bf3-4cb4-b74f-2a8ee27de93a\\\",\\\"parameterName\\\":\\\"body\\\",\\\"first\\\":true}]\"}";
// A88772 s = new A88772();
// System.out.println(s.execute(str));
String str = "{\"data\":\"{\\\"msg\\\":\\\"转发成功\\\",\\\"type\\\":null,\\\"flag\\\":true,\\\"status\\\":\\\"200\\\",\\\"attribute\\\":{\\\"data\\\":\\\"[{\\\\\\\"pk_invcl\\\\\\\":\\\\\\\"0001A110000000000QPW\\\\\\\",\\\\\\\"invclasscode\\\\\\\":\\\\\\\"09\\\\\\\",\\\\\\\"invclassname\\\\\\\":\\\\\\\"测试下发一级\\\\\\\",\\\\\\\"invclasslev\\\\\\\":\\\\\\\"1\\\\\\\",\\\\\\\"pk_corp\\\\\\\":\\\\\\\"0001\\\\\\\"}]\\\",\\\"taskNumber\\\":\\\"202407310125\\\",\\\"status\\\":\\\"success\\\"}}\"}";
g_482610back t = new g_482610back();
System.out.println(t.execute(str));
}
static class test0001{
String execute(String jsonStr) {
com.alibaba.fastjson.JSONObject returnObject = new com.alibaba.fastjson.JSONObject();
com.alibaba.fastjson.JSONObject reqData = com.alibaba.fastjson.JSON.parseObject(jsonStr);
if(null !=reqData){
com.alibaba.fastjson.JSONObject header = new com.alibaba.fastjson.JSONObject();
if(null !=reqData.getString("status")&& !"".equals(reqData.getString("status"))){
com.alibaba.fastjson.JSONArray dataArr = com.alibaba.fastjson.JSON.parseArray(reqData.getString("data"));
com.alibaba.fastjson.JSONObject data = (JSONObject) dataArr.get(0);
returnObject.put("success","true");
returnObject.put("tripartiteId",data.getString("pk_invcl"));
}else{
returnObject.put("success","false");
}
}else{
returnObject.put("success","false");
}
return returnObject.toJSONString();
}
}
static class A88772 {
String execute(String jsonStr) {
com.alibaba.fastjson.JSONObject returnObject = new com.alibaba.fastjson.JSONObject();
com.alibaba.fastjson.JSONObject bodys = new com.alibaba.fastjson.JSONObject();
com.alibaba.fastjson.JSONArray invcl = new com.alibaba.fastjson.JSONArray();
com.alibaba.fastjson.JSONObject main = new com.alibaba.fastjson.JSONObject();
com.alibaba.fastjson.JSONObject reqData = com.alibaba.fastjson.JSON.parseObject(jsonStr);
com.alibaba.fastjson.JSONObject data = reqData.getJSONObject("data");
com.alibaba.fastjson.JSONObject ufinterfaceObject = new com.alibaba.fastjson.JSONObject();
ufinterfaceObject.put("billtype", "customer");
ufinterfaceObject.put("isexchange", "Y");
ufinterfaceObject.put("replace", "Y");
ufinterfaceObject.put("sender", "openUser");
ufinterfaceObject.put("account", "ycjf");
ufinterfaceObject.put("groupcode", "ycjf");
com.alibaba.fastjson.JSONObject billObject = new com.alibaba.fastjson.JSONObject();
com.alibaba.fastjson.JSONObject billheadObject = new com.alibaba.fastjson.JSONObject();
billheadObject.put("code", data.get("code"));
billheadObject.put("custprop", data.get("custprop"));
billheadObject.put("custstate", data.get("custstate"));
billheadObject.put("pk_custclass", data.get("pk_custclass"));
billheadObject.put("pk_country", data.get("pk_country"));
billheadObject.put("pk_timezone", "P0800");
billheadObject.put("pk_format", "ZH-CN");
billheadObject.put("enablestate", data.get("enablestate"));
billheadObject.put("name", data.get("name"));
billheadObject.put("pk_group", data.get("pk_group"));
billheadObject.put("pk_org", data.get("pk_org"));
billheadObject.put("taxpayerid", data.get("taxpayerid"));
billObject.put("billhead", billheadObject);
ufinterfaceObject.put("bill", billObject);
bodys.put("ufinterface", ufinterfaceObject);
main.put("invclasscode", data.getString("materiel_classify_code"));
main.put("invclassname", data.getString("materiel_classify_name"));
main.put("pk_invcl", reqData.getString("tripartiteId"));
main.put("pk_corp", "0001");
invcl.add(main);
bodys.put("invcl",invcl);
returnObject.put("bodys",bodys.toJSONString());
return returnObject.toJSONString();
@ -79,6 +86,29 @@ public class GroovyIntegrationServiceImpl implements IGroovyIntegrationService {
}
}
static class g_482610back {
String execute(String jsonStr){
com.alibaba.fastjson.JSONObject returnObject = new com.alibaba.fastjson.JSONObject();
com.alibaba.fastjson.JSONObject resData = com.alibaba.fastjson.JSON.parseObject(jsonStr);
if("200".equals(resData.getJSONObject("data").get("status"))){
com.alibaba.fastjson.JSONObject reqData = resData.getJSONObject("data").getJSONObject("attribute");
if(null !=reqData){
com.alibaba.fastjson.JSONObject header = new com.alibaba.fastjson.JSONObject();
if(null !=reqData.getString("status")&& !"".equals(reqData.getString("status"))){
com.alibaba.fastjson.JSONArray dataArr = com.alibaba.fastjson.JSON.parseArray(reqData.getString("data"));
// com.alibaba.fastjson.JSONObject data = (com.alibaba.fastjson.JSONObject) dataArr.get(0);
com.alibaba.fastjson.JSONObject data = dataArr.getJSONObject(0);
returnObject.put("success","true");
returnObject.put("tripartiteId",data.getString("pk_invcl"));
}else{
returnObject.put("success","false");
}
}else{
returnObject.put("success","false");
}
}else {
returnObject.put("success","false");
}
return returnObject.toJSONString(); } }
}

View File

@ -59,7 +59,15 @@
parameterType="com.hzya.frame.sysnew.messageManageLog.entity.SysMessageManageLogEntity">
select
<include refid="SysMessageManageLogEntity_Base_Column_List"/>
from sys_message_manage_log
from
<choose>
<when test=" status != null and status.trim() != '' and status == 3">
sys_message_manage_log_success
</when>
<otherwise>
sys_message_manage_log
</otherwise>
</choose>
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''">and id = #{id}</if>
<if test="messageManageId != null and messageManageId != ''">and message_manage_id = #{messageManageId}</if>