档案对照
This commit is contained in:
parent
5aea5a5fd6
commit
fcc4b15b2a
|
@ -0,0 +1,71 @@
|
|||
package com.hzya.frame.sysnew.comparison.dao;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.hzya.frame.basedao.dao.IBaseDao;
|
||||
import com.hzya.frame.sysnew.comparison.entity.ComparisonDetailsEntity;
|
||||
import com.hzya.frame.sysnew.comparison.entity.ComparisonEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface IComparisonDao extends IBaseDao<ComparisonEntity, String> {
|
||||
|
||||
/**
|
||||
*
|
||||
* @content 根据主数据编码查询表名,字段名等信息
|
||||
* @Param
|
||||
* @Return
|
||||
* @Author hecan
|
||||
* @Date 2024/5/7 16:05
|
||||
* **/
|
||||
List<ComparisonEntity> queryComparison(ComparisonEntity comparison);
|
||||
|
||||
/**
|
||||
*
|
||||
* @content 分页查询数据
|
||||
* @Param
|
||||
* @Return
|
||||
* @Author hecan
|
||||
* @Date 2024/5/9 15:11
|
||||
* **/
|
||||
List<ComparisonEntity> queryComparisonPage(ComparisonEntity comparison);
|
||||
|
||||
/**
|
||||
*
|
||||
* @content 保存档案对照数据
|
||||
* @Param
|
||||
* @Return
|
||||
* @Author hecan
|
||||
* @Date 2024/5/7 16:56
|
||||
* **/
|
||||
ComparisonEntity saveComparison(ComparisonEntity comparison);
|
||||
|
||||
/**
|
||||
*
|
||||
* @content 生成单据规则 如:CK-yyyyMMdd-0001
|
||||
* @Param
|
||||
* @Return
|
||||
* @Author hecan
|
||||
* @Date 2024/5/9 9:42
|
||||
* **/
|
||||
ComparisonEntity queryComparisonRule(ComparisonEntity comparison);
|
||||
|
||||
/**
|
||||
*
|
||||
* @content 更新档案对照数据
|
||||
* @Param
|
||||
* @Return
|
||||
* @Author hecan
|
||||
* @Date 2024/5/9 10:32
|
||||
* **/
|
||||
Integer updateComparisonByType(ComparisonEntity comparison);
|
||||
|
||||
/**
|
||||
*
|
||||
* @content 删除档案对照数据
|
||||
* @Param
|
||||
* @Return
|
||||
* @Author hecan
|
||||
* @Date 2024/5/9 14:09
|
||||
* **/
|
||||
Integer deleteComparison(ComparisonEntity comparison);
|
||||
}
|
|
@ -0,0 +1,50 @@
|
|||
package com.hzya.frame.sysnew.comparison.dao;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.hzya.frame.basedao.dao.IBaseDao;
|
||||
import com.hzya.frame.sysnew.comparison.entity.ComparisonDetailsEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface IComparisonDetailsDao extends IBaseDao<ComparisonDetailsEntity, String> {
|
||||
|
||||
/**
|
||||
*
|
||||
* @content 保存档案对照子表数据
|
||||
* @Param
|
||||
* @Return
|
||||
* @Author hecan
|
||||
* @Date 2024/5/9 10:41
|
||||
* **/
|
||||
ComparisonDetailsEntity saveComparisonDetails(ComparisonDetailsEntity comparisonDetailsEntity);
|
||||
|
||||
/**
|
||||
*
|
||||
* @content 更新档案对照子表数据
|
||||
* @Param
|
||||
* @Return
|
||||
* @Author hecan
|
||||
* @Date 2024/5/9 10:41
|
||||
* **/
|
||||
Integer updateComparisonDetailsByType(ComparisonDetailsEntity comparisonDetailsEntity);
|
||||
|
||||
/**
|
||||
*
|
||||
* @content 删除档案对照子表数据
|
||||
* @Param
|
||||
* @Return
|
||||
* @Author hecan
|
||||
* @Date 2024/5/9 14:11
|
||||
* **/
|
||||
Integer deleteComparisonDetails(ComparisonDetailsEntity comparisonDetailsEntity);
|
||||
|
||||
/**
|
||||
*
|
||||
* @content 分页查询子表数据
|
||||
* @Param
|
||||
* @Return
|
||||
* @Author hecan
|
||||
* @Date 2024/5/9 15:34
|
||||
* **/
|
||||
List<ComparisonDetailsEntity> queryComparisonDetailsPage(ComparisonDetailsEntity comparisonDetailsEntity);
|
||||
}
|
|
@ -0,0 +1,54 @@
|
|||
package com.hzya.frame.sysnew.comparison.dao.impl;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.hzya.frame.basedao.dao.MybatisGenericDao;
|
||||
import com.hzya.frame.sysnew.comparison.dao.IComparisonDao;
|
||||
import com.hzya.frame.sysnew.comparison.entity.ComparisonEntity;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Repository(value = "comparisonDaoImpl")
|
||||
public class ComparisonDaoImpl extends MybatisGenericDao<ComparisonEntity, String> implements IComparisonDao {
|
||||
//根据主数据编码查询表名,字段名等信息
|
||||
@Override
|
||||
public List<ComparisonEntity> queryComparison(ComparisonEntity comparison) {
|
||||
List<ComparisonEntity> query = super.query(getSqlIdPrifx() + "queryComparison", comparison);
|
||||
return query;
|
||||
}
|
||||
|
||||
//分页查询
|
||||
@Override
|
||||
public List<ComparisonEntity> queryComparisonPage(ComparisonEntity comparison) {
|
||||
List<ComparisonEntity> query = super.query(getSqlIdPrifx() + "queryComparisonPage", comparison);
|
||||
return query;
|
||||
}
|
||||
|
||||
//保存数据
|
||||
@Override
|
||||
public ComparisonEntity saveComparison(ComparisonEntity comparison) {
|
||||
ComparisonEntity comparisonEntity = super.save(getSqlIdPrifx() + "saveComparison", comparison);
|
||||
return comparisonEntity;
|
||||
}
|
||||
|
||||
//生成单据规则
|
||||
@Override
|
||||
public ComparisonEntity queryComparisonRule(ComparisonEntity comparison) {
|
||||
List<ComparisonEntity> comparisonEntities = super.query(getSqlIdPrifx() + "queryComparisonRule", comparison);
|
||||
return comparisonEntities.get(0);
|
||||
}
|
||||
|
||||
//更新档案对照数据
|
||||
@Override
|
||||
public Integer updateComparisonByType(ComparisonEntity comparison) {
|
||||
int update = super.update(getSqlIdPrifx() + "updateComparisonByType", comparison);
|
||||
return update;
|
||||
}
|
||||
|
||||
//删除档案对照数据
|
||||
@Override
|
||||
public Integer deleteComparison(ComparisonEntity comparison) {
|
||||
int delete = super.delete(getSqlIdPrifx() + "deleteComparison", comparison);
|
||||
return delete;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,45 @@
|
|||
package com.hzya.frame.sysnew.comparison.dao.impl;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.hzya.frame.basedao.dao.MybatisGenericDao;
|
||||
import com.hzya.frame.sysnew.comparison.dao.IComparisonDao;
|
||||
import com.hzya.frame.sysnew.comparison.dao.IComparisonDetailsDao;
|
||||
import com.hzya.frame.sysnew.comparison.entity.ComparisonDetailsEntity;
|
||||
import com.hzya.frame.sysnew.comparison.entity.ComparisonEntity;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Repository(value = "comparisonDetailsDaoImpl")
|
||||
public class ComparisonDetailsDaoImpl extends MybatisGenericDao<ComparisonDetailsEntity, String> implements IComparisonDetailsDao {
|
||||
|
||||
//保存档案对照子表数据
|
||||
@Override
|
||||
public ComparisonDetailsEntity saveComparisonDetails(ComparisonDetailsEntity comparisonDetailsEntity) {
|
||||
ComparisonDetailsEntity detailsEntity = super.save(getSqlIdPrifx() + "saveComparisonDetails", comparisonDetailsEntity);
|
||||
return detailsEntity;
|
||||
}
|
||||
|
||||
//更新档案对照子表数据
|
||||
@Override
|
||||
public Integer updateComparisonDetailsByType(ComparisonDetailsEntity comparisonDetailsEntity) {
|
||||
int update = super.update(getSqlIdPrifx()+"updateComparisonDetailsByType", comparisonDetailsEntity);
|
||||
return update;
|
||||
}
|
||||
|
||||
//删除档案对照子表的数据
|
||||
@Override
|
||||
public Integer deleteComparisonDetails(ComparisonDetailsEntity comparisonDetailsEntity) {
|
||||
int delete = super.delete(getSqlIdPrifx() + "deleteComparisonDetails", comparisonDetailsEntity);
|
||||
return delete;
|
||||
}
|
||||
|
||||
//分页查询子表数据
|
||||
@Override
|
||||
public List<ComparisonDetailsEntity> queryComparisonDetailsPage(ComparisonDetailsEntity comparisonDetailsEntity) {
|
||||
List<ComparisonDetailsEntity> query = super.query(getSqlIdPrifx() + "queryComparisonDetailsPage", comparisonDetailsEntity);
|
||||
return query;
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,323 @@
|
|||
package com.hzya.frame.sysnew.comparison.entity;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.hzya.frame.web.entity.BaseEntity;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
*
|
||||
* @content 档案对照明细实体类
|
||||
* @Param
|
||||
* @Return
|
||||
* @Author hecan
|
||||
* @Date 2024/5/7 15:50
|
||||
* **/
|
||||
public class ComparisonDetailsEntity extends BaseEntity {
|
||||
|
||||
private String contrastType;//对照类型
|
||||
private String documentRule;//单据规则
|
||||
private Long documentRuleNum;//单据规则流水号
|
||||
private String sszz;//所属组织
|
||||
private String bz;//备注
|
||||
private String formmainId;//上级id
|
||||
private String taskLinvingId;//集成任务-实例_id
|
||||
private String result;//返回结果
|
||||
private String queryCondition;//原始查询条件
|
||||
private String rootAppPk;//源系统主键
|
||||
private String rootAppBill;//原系统单据
|
||||
private String rootAppNewData;//最新源系统数据详情
|
||||
private String newTransmitInfo;//最新传输信息
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date newPushDate;//最新推送时间
|
||||
private String repairPust;//是否补推(Y是N不是)
|
||||
private String senceId;//场景id
|
||||
private String newState;//最新推送状态
|
||||
private String businessDate;//单据业务日期
|
||||
private String pluginId;//插件id
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date processingTime;//处理时间
|
||||
private String processingRemarks;//处理备注
|
||||
private String processorName;//处理⼈名称
|
||||
private String processor;//处理⼈
|
||||
private String newSystemNumber;//下游系统单号
|
||||
private String newSystemPrimary;//下游系统主键
|
||||
|
||||
private String mdmName;//主数据名称
|
||||
private String mdmCode;//主数据编码
|
||||
private String dbName;//表名
|
||||
private String dbType;//类型 1、主表 2、明细
|
||||
private String enName;//字段名 英文
|
||||
private String chName;// 字段名 中文
|
||||
private String filedType;//字段类型 1、BIGINT 2、DECIMAL 3、VARCHAR 4、DATETIME
|
||||
|
||||
private Map<String,Object> mapDetails;
|
||||
|
||||
public String getMdmName() {
|
||||
return mdmName;
|
||||
}
|
||||
|
||||
public void setMdmName(String mdmName) {
|
||||
this.mdmName = mdmName;
|
||||
}
|
||||
|
||||
public String getMdmCode() {
|
||||
return mdmCode;
|
||||
}
|
||||
|
||||
public void setMdmCode(String mdmCode) {
|
||||
this.mdmCode = mdmCode;
|
||||
}
|
||||
|
||||
public String getDbName() {
|
||||
return dbName;
|
||||
}
|
||||
|
||||
public void setDbName(String dbName) {
|
||||
this.dbName = dbName;
|
||||
}
|
||||
|
||||
public String getDbType() {
|
||||
return dbType;
|
||||
}
|
||||
|
||||
public void setDbType(String dbType) {
|
||||
this.dbType = dbType;
|
||||
}
|
||||
|
||||
public String getEnName() {
|
||||
return enName;
|
||||
}
|
||||
|
||||
public void setEnName(String enName) {
|
||||
this.enName = enName;
|
||||
}
|
||||
|
||||
public String getChName() {
|
||||
return chName;
|
||||
}
|
||||
|
||||
public void setChName(String chName) {
|
||||
this.chName = chName;
|
||||
}
|
||||
|
||||
public String getFiledType() {
|
||||
return filedType;
|
||||
}
|
||||
|
||||
public void setFiledType(String filedType) {
|
||||
this.filedType = filedType;
|
||||
}
|
||||
|
||||
public Map<String, Object> getMapDetails() {
|
||||
return mapDetails;
|
||||
}
|
||||
|
||||
public void setMapDetails(Map<String, Object> mapDetails) {
|
||||
this.mapDetails = mapDetails;
|
||||
}
|
||||
|
||||
public String getContrastType() {
|
||||
return contrastType;
|
||||
}
|
||||
|
||||
public void setContrastType(String contrastType) {
|
||||
this.contrastType = contrastType;
|
||||
}
|
||||
|
||||
public String getDocumentRule() {
|
||||
return documentRule;
|
||||
}
|
||||
|
||||
public void setDocumentRule(String documentRule) {
|
||||
this.documentRule = documentRule;
|
||||
}
|
||||
|
||||
public Long getDocumentRuleNum() {
|
||||
return documentRuleNum;
|
||||
}
|
||||
|
||||
public void setDocumentRuleNum(Long documentRuleNum) {
|
||||
this.documentRuleNum = documentRuleNum;
|
||||
}
|
||||
|
||||
public String getSszz() {
|
||||
return sszz;
|
||||
}
|
||||
|
||||
public void setSszz(String sszz) {
|
||||
this.sszz = sszz;
|
||||
}
|
||||
|
||||
public String getBz() {
|
||||
return bz;
|
||||
}
|
||||
|
||||
public void setBz(String bz) {
|
||||
this.bz = bz;
|
||||
}
|
||||
|
||||
public String getFormmainId() {
|
||||
return formmainId;
|
||||
}
|
||||
|
||||
public void setFormmainId(String formmainId) {
|
||||
this.formmainId = formmainId;
|
||||
}
|
||||
|
||||
public String getTaskLinvingId() {
|
||||
return taskLinvingId;
|
||||
}
|
||||
|
||||
public void setTaskLinvingId(String taskLinvingId) {
|
||||
this.taskLinvingId = taskLinvingId;
|
||||
}
|
||||
|
||||
public String getResult() {
|
||||
return result;
|
||||
}
|
||||
|
||||
public void setResult(String result) {
|
||||
this.result = result;
|
||||
}
|
||||
|
||||
public String getQueryCondition() {
|
||||
return queryCondition;
|
||||
}
|
||||
|
||||
public void setQueryCondition(String queryCondition) {
|
||||
this.queryCondition = queryCondition;
|
||||
}
|
||||
|
||||
public String getRootAppPk() {
|
||||
return rootAppPk;
|
||||
}
|
||||
|
||||
public void setRootAppPk(String rootAppPk) {
|
||||
this.rootAppPk = rootAppPk;
|
||||
}
|
||||
|
||||
public String getRootAppBill() {
|
||||
return rootAppBill;
|
||||
}
|
||||
|
||||
public void setRootAppBill(String rootAppBill) {
|
||||
this.rootAppBill = rootAppBill;
|
||||
}
|
||||
|
||||
public String getRootAppNewData() {
|
||||
return rootAppNewData;
|
||||
}
|
||||
|
||||
public void setRootAppNewData(String rootAppNewData) {
|
||||
this.rootAppNewData = rootAppNewData;
|
||||
}
|
||||
|
||||
public String getNewTransmitInfo() {
|
||||
return newTransmitInfo;
|
||||
}
|
||||
|
||||
public void setNewTransmitInfo(String newTransmitInfo) {
|
||||
this.newTransmitInfo = newTransmitInfo;
|
||||
}
|
||||
|
||||
public Date getNewPushDate() {
|
||||
return newPushDate;
|
||||
}
|
||||
|
||||
public void setNewPushDate(Date newPushDate) {
|
||||
this.newPushDate = newPushDate;
|
||||
}
|
||||
|
||||
public String getRepairPust() {
|
||||
return repairPust;
|
||||
}
|
||||
|
||||
public void setRepairPust(String repairPust) {
|
||||
this.repairPust = repairPust;
|
||||
}
|
||||
|
||||
public String getSenceId() {
|
||||
return senceId;
|
||||
}
|
||||
|
||||
public void setSenceId(String senceId) {
|
||||
this.senceId = senceId;
|
||||
}
|
||||
|
||||
public String getNewState() {
|
||||
return newState;
|
||||
}
|
||||
|
||||
public void setNewState(String newState) {
|
||||
this.newState = newState;
|
||||
}
|
||||
|
||||
public String getBusinessDate() {
|
||||
return businessDate;
|
||||
}
|
||||
|
||||
public void setBusinessDate(String businessDate) {
|
||||
this.businessDate = businessDate;
|
||||
}
|
||||
|
||||
public String getPluginId() {
|
||||
return pluginId;
|
||||
}
|
||||
|
||||
public void setPluginId(String pluginId) {
|
||||
this.pluginId = pluginId;
|
||||
}
|
||||
|
||||
public Date getProcessingTime() {
|
||||
return processingTime;
|
||||
}
|
||||
|
||||
public void setProcessingTime(Date processingTime) {
|
||||
this.processingTime = processingTime;
|
||||
}
|
||||
|
||||
public String getProcessingRemarks() {
|
||||
return processingRemarks;
|
||||
}
|
||||
|
||||
public void setProcessingRemarks(String processingRemarks) {
|
||||
this.processingRemarks = processingRemarks;
|
||||
}
|
||||
|
||||
public String getProcessorName() {
|
||||
return processorName;
|
||||
}
|
||||
|
||||
public void setProcessorName(String processorName) {
|
||||
this.processorName = processorName;
|
||||
}
|
||||
|
||||
public String getProcessor() {
|
||||
return processor;
|
||||
}
|
||||
|
||||
public void setProcessor(String processor) {
|
||||
this.processor = processor;
|
||||
}
|
||||
|
||||
public String getNewSystemNumber() {
|
||||
return newSystemNumber;
|
||||
}
|
||||
|
||||
public void setNewSystemNumber(String newSystemNumber) {
|
||||
this.newSystemNumber = newSystemNumber;
|
||||
}
|
||||
|
||||
public String getNewSystemPrimary() {
|
||||
return newSystemPrimary;
|
||||
}
|
||||
|
||||
public void setNewSystemPrimary(String newSystemPrimary) {
|
||||
this.newSystemPrimary = newSystemPrimary;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,89 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.hzya.frame.sysnew.comparison.dao.impl.ComparisonDetailsDaoImpl">
|
||||
<resultMap id="get-ComparisonDetailsEntity-result" type="com.hzya.frame.sysnew.comparison.entity.ComparisonDetailsEntity" >
|
||||
<result property="id" column="id" jdbcType="VARCHAR"/>
|
||||
<result property="documentRule" column="document_rule" jdbcType="VARCHAR"/>
|
||||
<result property="documentRuleNum" column="document_rule_num" jdbcType="VARCHAR"/>
|
||||
<result property="sszz" column="sszz" jdbcType="VARCHAR"/>
|
||||
<result property="bz" column="bz" jdbcType="VARCHAR"/>
|
||||
<result property="formmainId" column="formmain_id" jdbcType="VARCHAR"/>
|
||||
<result property="taskLinvingId" column="task_linving_id" jdbcType="VARCHAR"/>
|
||||
<result property="result" column="result" jdbcType="VARCHAR"/>
|
||||
<result property="queryCondition" column="query_condition" jdbcType="VARCHAR"/>
|
||||
<result property="rootAppPk" column="root_app_pk" jdbcType="VARCHAR"/>
|
||||
<result property="rootAppBill" column="root_app_bill" jdbcType="VARCHAR"/>
|
||||
<result property="rootAppNewData" column="root_app_new_data" jdbcType="VARCHAR"/>
|
||||
<result property="newTransmitInfo" column="new_transmit_info" jdbcType="VARCHAR"/>
|
||||
<result property="newPushDate" column="new_push_date" jdbcType="TIMESTAMP"/>
|
||||
<result property="repairPust" column="repair_pust" jdbcType="VARCHAR"/>
|
||||
<result property="senceId" column="sence_id" jdbcType="VARCHAR"/>
|
||||
<result property="newState" column="new_state" jdbcType="VARCHAR"/>
|
||||
<result property="businessDate" column="business_date" jdbcType="VARCHAR"/>
|
||||
<result property="pluginId" column="plugin_id" jdbcType="VARCHAR"/>
|
||||
<result property="processingTime" column="processing_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="processingRemarks" column="processing_remarks" jdbcType="VARCHAR"/>
|
||||
<result property="processorName" column="processor_name" jdbcType="VARCHAR"/>
|
||||
<result property="processor" column="processor" jdbcType="VARCHAR"/>
|
||||
<result property="newSystemNumber" column="new_system_number" jdbcType="VARCHAR"/>
|
||||
<result property="newSystemPrimary" column="new_system_primary" 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>
|
||||
|
||||
<select id="queryComparisonDetailsPage" resultMap="get-ComparisonDetailsEntity-result"
|
||||
parameterType="com.hzya.frame.sysnew.comparison.entity.ComparisonDetailsEntity">
|
||||
select * from ${dbName}
|
||||
where formmain_id=#{formmainId} and sts='Y'
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
<insert id="saveComparisonDetails" parameterType = "java.util.Map">
|
||||
insert into ${dbName}
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<foreach collection="mapDetails.keySet()" item="column">
|
||||
${column},
|
||||
</foreach>
|
||||
</trim>
|
||||
values
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<foreach collection="mapDetails.values()" item="value">
|
||||
#{value},
|
||||
</foreach>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<!--通过主键修改方法-->
|
||||
<update id="updateComparisonDetailsByType" parameterType = "java.util.Map" >
|
||||
update ${dbName}
|
||||
<set>
|
||||
<foreach collection="mapDetails.entrySet()" item="value" index="key" separator=",">
|
||||
${key} =#{value}
|
||||
</foreach>
|
||||
</set>
|
||||
where formmain_id=#{formmainId} and sts='Y'
|
||||
</update>
|
||||
|
||||
<!-- 多条件逻辑删除 -->
|
||||
<update id="deleteComparisonDetails" parameterType = "java.util.Map" >
|
||||
update
|
||||
${dbName}
|
||||
set sts= 'N' ,modify_time = now(),modify_user_id = #{modify_user_id}
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<!--<foreach collection="mapDetails.entrySet()" item="value" index="key">
|
||||
${key} =#{value}
|
||||
</foreach>-->
|
||||
and formmain_id=#{formmainId} and sts='Y'
|
||||
</trim>
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,607 @@
|
|||
package com.hzya.frame.sysnew.comparison.entity;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.hzya.frame.web.entity.BaseEntity;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
*
|
||||
* @content 档案对照实体类
|
||||
* @Param
|
||||
* @Return
|
||||
* @Author hecan
|
||||
* @Date 2024/5/7 15:50
|
||||
* **/
|
||||
public class ComparisonEntity extends BaseEntity {
|
||||
private String contrastType;//对照类型
|
||||
private String documentRule;//单据规则
|
||||
private Long documentRuleNum;//单据规则流水号
|
||||
private String ckbm;//仓库编码
|
||||
private String ckmc;//仓库名称
|
||||
private String cklx;//仓库类型
|
||||
private String ckdz;//仓库地址
|
||||
private String fzr;//负责人
|
||||
private String dh;//电话
|
||||
private String ssdd;//所属地点
|
||||
private String bz;//备注
|
||||
private String ssck;//所属仓库
|
||||
private String hwbm;//货位编码
|
||||
|
||||
private String hwmc;//货位名称
|
||||
private String hwrj;//货位容积
|
||||
private String dd;//地点
|
||||
private String sjzz;//上级组织
|
||||
private String zzbm;//组织编码
|
||||
private String zzmc;//组织名称
|
||||
private String fr;//法人
|
||||
private String dz;//地址
|
||||
private String taskCode;//任务编码
|
||||
private String taskName;//任务名称
|
||||
private String taskClasses;//任务分类
|
||||
private String taskCron;//任务策略
|
||||
private String taskTag;//任务标识
|
||||
private String funInfo;//功能介绍/任务描述'
|
||||
private String senceId;//场景id
|
||||
private String remark;//备注
|
||||
private String taskStatus;//任务状态
|
||||
private String serverName;//服务名称
|
||||
private String plug;//插件
|
||||
private String plugId;//插件id
|
||||
|
||||
private String taskLinvingId;//集成任务-实例_id
|
||||
private String result;//返回结果
|
||||
private String queryCondition;//原始查询条件
|
||||
private String rootAppPk;//源系统主键
|
||||
private String rootAppBill;//原系统单据
|
||||
private String rootAppNewData;//最新源系统数据详情
|
||||
private String newTransmitInfo;//最新传输信息
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date newPushDate;//最新推送时间
|
||||
private String repairPust;//是否补推(Y是N不是)
|
||||
private String newState;//最新推送状态
|
||||
private String businessDate;//单据业务日期
|
||||
private String pluginId;//插件id
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date processingTime;//处理时间
|
||||
private String processingRemarks;//处理备注
|
||||
private String processorName;//处理⼈名称
|
||||
private String processor;//处理⼈
|
||||
private String newSystemNumber;//下游系统单号
|
||||
private String newSystemPrimary;//下游系统主键
|
||||
|
||||
private String mdmName;//主数据名称
|
||||
private String mdmCode;//主数据编码
|
||||
private String dbName;//表名
|
||||
private String dbType;//类型 1、主表 2、明细
|
||||
private String enName;//字段名 英文
|
||||
private String chName;// 字段名 中文
|
||||
private String filedType;//字段类型 1、BIGINT 2、DECIMAL 3、VARCHAR 4、DATETIME
|
||||
|
||||
private Map<String,Object> map;
|
||||
private ComparisonDetailsEntity comparisonDetailsEntity;
|
||||
private String sszz;//所属组织
|
||||
private String formmainId;//上级id
|
||||
|
||||
private String rulePrefix;//规则前缀 CK-yyyyMMdd-0001中的CK
|
||||
|
||||
private List<ComparisonDetailsEntity> comparisonDetailsEntityList;
|
||||
|
||||
public List<ComparisonDetailsEntity> getComparisonDetailsEntityList() {
|
||||
return comparisonDetailsEntityList;
|
||||
}
|
||||
|
||||
public void setComparisonDetailsEntityList(List<ComparisonDetailsEntity> comparisonDetailsEntityList) {
|
||||
this.comparisonDetailsEntityList = comparisonDetailsEntityList;
|
||||
}
|
||||
|
||||
public String getRulePrefix() {
|
||||
return rulePrefix;
|
||||
}
|
||||
|
||||
public void setRulePrefix(String rulePrefix) {
|
||||
this.rulePrefix = rulePrefix;
|
||||
}
|
||||
|
||||
public String getSszz() {
|
||||
return sszz;
|
||||
}
|
||||
|
||||
public void setSszz(String sszz) {
|
||||
this.sszz = sszz;
|
||||
}
|
||||
|
||||
public String getFormmainId() {
|
||||
return formmainId;
|
||||
}
|
||||
|
||||
public void setFormmainId(String formmainId) {
|
||||
this.formmainId = formmainId;
|
||||
}
|
||||
|
||||
public ComparisonDetailsEntity getComparisonDetailsEntity() {
|
||||
return comparisonDetailsEntity;
|
||||
}
|
||||
|
||||
public void setComparisonDetailsEntity(ComparisonDetailsEntity comparisonDetailsEntity) {
|
||||
this.comparisonDetailsEntity = comparisonDetailsEntity;
|
||||
}
|
||||
|
||||
public Map<String, Object> getMap() {
|
||||
return map;
|
||||
}
|
||||
|
||||
public void setMap(Map<String, Object> map) {
|
||||
this.map = map;
|
||||
}
|
||||
|
||||
|
||||
public String getMdmName() {
|
||||
return mdmName;
|
||||
}
|
||||
|
||||
public void setMdmName(String mdmName) {
|
||||
this.mdmName = mdmName;
|
||||
}
|
||||
|
||||
public String getMdmCode() {
|
||||
return mdmCode;
|
||||
}
|
||||
|
||||
public void setMdmCode(String mdmCode) {
|
||||
this.mdmCode = mdmCode;
|
||||
}
|
||||
|
||||
public String getDbName() {
|
||||
return dbName;
|
||||
}
|
||||
|
||||
public void setDbName(String dbName) {
|
||||
this.dbName = dbName;
|
||||
}
|
||||
|
||||
public String getDbType() {
|
||||
return dbType;
|
||||
}
|
||||
|
||||
public void setDbType(String dbType) {
|
||||
this.dbType = dbType;
|
||||
}
|
||||
|
||||
public String getEnName() {
|
||||
return enName;
|
||||
}
|
||||
|
||||
public void setEnName(String enName) {
|
||||
this.enName = enName;
|
||||
}
|
||||
|
||||
public String getChName() {
|
||||
return chName;
|
||||
}
|
||||
|
||||
public void setChName(String chName) {
|
||||
this.chName = chName;
|
||||
}
|
||||
|
||||
public String getFiledType() {
|
||||
return filedType;
|
||||
}
|
||||
|
||||
public void setFiledType(String filedType) {
|
||||
this.filedType = filedType;
|
||||
}
|
||||
|
||||
public String getTaskLinvingId() {
|
||||
return taskLinvingId;
|
||||
}
|
||||
|
||||
public void setTaskLinvingId(String taskLinvingId) {
|
||||
this.taskLinvingId = taskLinvingId;
|
||||
}
|
||||
|
||||
public String getResult() {
|
||||
return result;
|
||||
}
|
||||
|
||||
public void setResult(String result) {
|
||||
this.result = result;
|
||||
}
|
||||
|
||||
public String getQueryCondition() {
|
||||
return queryCondition;
|
||||
}
|
||||
|
||||
public void setQueryCondition(String queryCondition) {
|
||||
this.queryCondition = queryCondition;
|
||||
}
|
||||
|
||||
public String getRootAppPk() {
|
||||
return rootAppPk;
|
||||
}
|
||||
|
||||
public void setRootAppPk(String rootAppPk) {
|
||||
this.rootAppPk = rootAppPk;
|
||||
}
|
||||
|
||||
public String getRootAppBill() {
|
||||
return rootAppBill;
|
||||
}
|
||||
|
||||
public void setRootAppBill(String rootAppBill) {
|
||||
this.rootAppBill = rootAppBill;
|
||||
}
|
||||
|
||||
public String getRootAppNewData() {
|
||||
return rootAppNewData;
|
||||
}
|
||||
|
||||
public void setRootAppNewData(String rootAppNewData) {
|
||||
this.rootAppNewData = rootAppNewData;
|
||||
}
|
||||
|
||||
public String getNewTransmitInfo() {
|
||||
return newTransmitInfo;
|
||||
}
|
||||
|
||||
public void setNewTransmitInfo(String newTransmitInfo) {
|
||||
this.newTransmitInfo = newTransmitInfo;
|
||||
}
|
||||
|
||||
public Date getNewPushDate() {
|
||||
return newPushDate;
|
||||
}
|
||||
|
||||
public void setNewPushDate(Date newPushDate) {
|
||||
this.newPushDate = newPushDate;
|
||||
}
|
||||
|
||||
public String getRepairPust() {
|
||||
return repairPust;
|
||||
}
|
||||
|
||||
public void setRepairPust(String repairPust) {
|
||||
this.repairPust = repairPust;
|
||||
}
|
||||
|
||||
public String getNewState() {
|
||||
return newState;
|
||||
}
|
||||
|
||||
public void setNewState(String newState) {
|
||||
this.newState = newState;
|
||||
}
|
||||
|
||||
public String getBusinessDate() {
|
||||
return businessDate;
|
||||
}
|
||||
|
||||
public void setBusinessDate(String businessDate) {
|
||||
this.businessDate = businessDate;
|
||||
}
|
||||
|
||||
public String getPluginId() {
|
||||
return pluginId;
|
||||
}
|
||||
|
||||
public void setPluginId(String pluginId) {
|
||||
this.pluginId = pluginId;
|
||||
}
|
||||
|
||||
public Date getProcessingTime() {
|
||||
return processingTime;
|
||||
}
|
||||
|
||||
public void setProcessingTime(Date processingTime) {
|
||||
this.processingTime = processingTime;
|
||||
}
|
||||
|
||||
public String getProcessingRemarks() {
|
||||
return processingRemarks;
|
||||
}
|
||||
|
||||
public void setProcessingRemarks(String processingRemarks) {
|
||||
this.processingRemarks = processingRemarks;
|
||||
}
|
||||
|
||||
public String getProcessorName() {
|
||||
return processorName;
|
||||
}
|
||||
|
||||
public void setProcessorName(String processorName) {
|
||||
this.processorName = processorName;
|
||||
}
|
||||
|
||||
public String getProcessor() {
|
||||
return processor;
|
||||
}
|
||||
|
||||
public void setProcessor(String processor) {
|
||||
this.processor = processor;
|
||||
}
|
||||
|
||||
public String getNewSystemNumber() {
|
||||
return newSystemNumber;
|
||||
}
|
||||
|
||||
public void setNewSystemNumber(String newSystemNumber) {
|
||||
this.newSystemNumber = newSystemNumber;
|
||||
}
|
||||
|
||||
public String getNewSystemPrimary() {
|
||||
return newSystemPrimary;
|
||||
}
|
||||
|
||||
public void setNewSystemPrimary(String newSystemPrimary) {
|
||||
this.newSystemPrimary = newSystemPrimary;
|
||||
}
|
||||
|
||||
public String getContrastType() {
|
||||
return contrastType;
|
||||
}
|
||||
|
||||
public void setContrastType(String contrastType) {
|
||||
this.contrastType = contrastType;
|
||||
}
|
||||
|
||||
public String getDocumentRule() {
|
||||
return documentRule;
|
||||
}
|
||||
|
||||
public void setDocumentRule(String documentRule) {
|
||||
this.documentRule = documentRule;
|
||||
}
|
||||
|
||||
public Long getDocumentRuleNum() {
|
||||
return documentRuleNum;
|
||||
}
|
||||
|
||||
public void setDocumentRuleNum(Long documentRuleNum) {
|
||||
this.documentRuleNum = documentRuleNum;
|
||||
}
|
||||
|
||||
public String getCkbm() {
|
||||
return ckbm;
|
||||
}
|
||||
|
||||
public void setCkbm(String ckbm) {
|
||||
this.ckbm = ckbm;
|
||||
}
|
||||
|
||||
public String getCkmc() {
|
||||
return ckmc;
|
||||
}
|
||||
|
||||
public void setCkmc(String ckmc) {
|
||||
this.ckmc = ckmc;
|
||||
}
|
||||
|
||||
public String getCklx() {
|
||||
return cklx;
|
||||
}
|
||||
|
||||
public void setCklx(String cklx) {
|
||||
this.cklx = cklx;
|
||||
}
|
||||
|
||||
public String getCkdz() {
|
||||
return ckdz;
|
||||
}
|
||||
|
||||
public void setCkdz(String ckdz) {
|
||||
this.ckdz = ckdz;
|
||||
}
|
||||
|
||||
public String getFzr() {
|
||||
return fzr;
|
||||
}
|
||||
|
||||
public void setFzr(String fzr) {
|
||||
this.fzr = fzr;
|
||||
}
|
||||
|
||||
public String getDh() {
|
||||
return dh;
|
||||
}
|
||||
|
||||
public void setDh(String dh) {
|
||||
this.dh = dh;
|
||||
}
|
||||
|
||||
public String getSsdd() {
|
||||
return ssdd;
|
||||
}
|
||||
|
||||
public void setSsdd(String ssdd) {
|
||||
this.ssdd = ssdd;
|
||||
}
|
||||
|
||||
public String getBz() {
|
||||
return bz;
|
||||
}
|
||||
|
||||
public void setBz(String bz) {
|
||||
this.bz = bz;
|
||||
}
|
||||
|
||||
public String getSsck() {
|
||||
return ssck;
|
||||
}
|
||||
|
||||
public void setSsck(String ssck) {
|
||||
this.ssck = ssck;
|
||||
}
|
||||
|
||||
public String getHwbm() {
|
||||
return hwbm;
|
||||
}
|
||||
|
||||
public void setHwbm(String hwbm) {
|
||||
this.hwbm = hwbm;
|
||||
}
|
||||
|
||||
public String getHwmc() {
|
||||
return hwmc;
|
||||
}
|
||||
|
||||
public void setHwmc(String hwmc) {
|
||||
this.hwmc = hwmc;
|
||||
}
|
||||
|
||||
public String getHwrj() {
|
||||
return hwrj;
|
||||
}
|
||||
|
||||
public void setHwrj(String hwrj) {
|
||||
this.hwrj = hwrj;
|
||||
}
|
||||
|
||||
public String getDd() {
|
||||
return dd;
|
||||
}
|
||||
|
||||
public void setDd(String dd) {
|
||||
this.dd = dd;
|
||||
}
|
||||
|
||||
public String getSjzz() {
|
||||
return sjzz;
|
||||
}
|
||||
|
||||
public void setSjzz(String sjzz) {
|
||||
this.sjzz = sjzz;
|
||||
}
|
||||
|
||||
public String getZzbm() {
|
||||
return zzbm;
|
||||
}
|
||||
|
||||
public void setZzbm(String zzbm) {
|
||||
this.zzbm = zzbm;
|
||||
}
|
||||
|
||||
public String getZzmc() {
|
||||
return zzmc;
|
||||
}
|
||||
|
||||
public void setZzmc(String zzmc) {
|
||||
this.zzmc = zzmc;
|
||||
}
|
||||
|
||||
public String getFr() {
|
||||
return fr;
|
||||
}
|
||||
|
||||
public void setFr(String fr) {
|
||||
this.fr = fr;
|
||||
}
|
||||
|
||||
public String getDz() {
|
||||
return dz;
|
||||
}
|
||||
|
||||
public void setDz(String dz) {
|
||||
this.dz = dz;
|
||||
}
|
||||
|
||||
public String getTaskCode() {
|
||||
return taskCode;
|
||||
}
|
||||
|
||||
public void setTaskCode(String taskCode) {
|
||||
this.taskCode = taskCode;
|
||||
}
|
||||
|
||||
public String getTaskName() {
|
||||
return taskName;
|
||||
}
|
||||
|
||||
public void setTaskName(String taskName) {
|
||||
this.taskName = taskName;
|
||||
}
|
||||
|
||||
public String getTaskClasses() {
|
||||
return taskClasses;
|
||||
}
|
||||
|
||||
public void setTaskClasses(String taskClasses) {
|
||||
this.taskClasses = taskClasses;
|
||||
}
|
||||
|
||||
public String getTaskCron() {
|
||||
return taskCron;
|
||||
}
|
||||
|
||||
public void setTaskCron(String taskCron) {
|
||||
this.taskCron = taskCron;
|
||||
}
|
||||
|
||||
public String getTaskTag() {
|
||||
return taskTag;
|
||||
}
|
||||
|
||||
public void setTaskTag(String taskTag) {
|
||||
this.taskTag = taskTag;
|
||||
}
|
||||
|
||||
public String getFunInfo() {
|
||||
return funInfo;
|
||||
}
|
||||
|
||||
public void setFunInfo(String funInfo) {
|
||||
this.funInfo = funInfo;
|
||||
}
|
||||
|
||||
public String getSenceId() {
|
||||
return senceId;
|
||||
}
|
||||
|
||||
public void setSenceId(String senceId) {
|
||||
this.senceId = senceId;
|
||||
}
|
||||
|
||||
public String getRemark() {
|
||||
return remark;
|
||||
}
|
||||
|
||||
public void setRemark(String remark) {
|
||||
this.remark = remark;
|
||||
}
|
||||
|
||||
public String getTaskStatus() {
|
||||
return taskStatus;
|
||||
}
|
||||
|
||||
public void setTaskStatus(String taskStatus) {
|
||||
this.taskStatus = taskStatus;
|
||||
}
|
||||
|
||||
public String getServerName() {
|
||||
return serverName;
|
||||
}
|
||||
|
||||
public void setServerName(String serverName) {
|
||||
this.serverName = serverName;
|
||||
}
|
||||
|
||||
public String getPlug() {
|
||||
return plug;
|
||||
}
|
||||
|
||||
public void setPlug(String plug) {
|
||||
this.plug = plug;
|
||||
}
|
||||
|
||||
public String getPlugId() {
|
||||
return plugId;
|
||||
}
|
||||
|
||||
public void setPlugId(String plugId) {
|
||||
this.plugId = plugId;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,158 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.hzya.frame.sysnew.comparison.dao.impl.ComparisonDaoImpl">
|
||||
<resultMap id="get-ComparisonEntity-result" type="com.hzya.frame.sysnew.comparison.entity.ComparisonEntity" >
|
||||
<result property="id" column="id" jdbcType="VARCHAR"/>
|
||||
<result property="ckbm" column="ckbm" jdbcType="VARCHAR"/>
|
||||
<result property="ckmc" column="ckmc" jdbcType="VARCHAR"/>
|
||||
<result property="cklx" column="cklx" jdbcType="VARCHAR"/>
|
||||
<result property="ckdz" column="ckdz" jdbcType="VARCHAR"/>
|
||||
<result property="fzr" column="fzr" jdbcType="VARCHAR"/>
|
||||
<result property="dh" column="dh" jdbcType="VARCHAR"/>
|
||||
<result property="ssdd" column="ssdd" jdbcType="VARCHAR"/>
|
||||
<result property="bz" column="bz" jdbcType="VARCHAR"/>
|
||||
<result property="ssck" column="ssck" jdbcType="VARCHAR"/>
|
||||
<result property="hwbm" column="hwbm" jdbcType="VARCHAR"/>
|
||||
<result property="hwmc" column="hwmc" jdbcType="VARCHAR"/>
|
||||
<result property="hwrj" column="hwrj" jdbcType="VARCHAR"/>
|
||||
<result property="dd" column="dd" jdbcType="VARCHAR"/>
|
||||
<result property="sjzz" column="sjzz" jdbcType="VARCHAR"/>
|
||||
<result property="zzbm" column="zzbm" jdbcType="VARCHAR"/>
|
||||
<result property="zzmc" column="zzmc" jdbcType="VARCHAR"/>
|
||||
<result property="fr" column="fr" jdbcType="VARCHAR"/>
|
||||
<result property="dz" column="dz" jdbcType="VARCHAR"/>
|
||||
<result property="taskCode" column="task_code" jdbcType="VARCHAR"/>
|
||||
<result property="taskName" column="task_name" jdbcType="VARCHAR"/>
|
||||
<result property="taskClasses" column="task_classes" jdbcType="VARCHAR"/>
|
||||
<result property="taskCron" column="task_cron" jdbcType="VARCHAR"/>
|
||||
<result property="taskTag" column="task_tag" jdbcType="VARCHAR"/>
|
||||
<result property="funInfo" column="fun_info" jdbcType="VARCHAR"/>
|
||||
<result property="senceId" column="sence_id" jdbcType="VARCHAR"/>
|
||||
<result property="remark" column="remark" jdbcType="VARCHAR"/>
|
||||
<result property="taskStatus" column="task_status" jdbcType="VARCHAR"/>
|
||||
<result property="serverName" column="server_name" jdbcType="VARCHAR"/>
|
||||
<result property="plug" column="plug" jdbcType="VARCHAR"/>
|
||||
<result property="plugId" column="plug_id" jdbcType="VARCHAR"/>
|
||||
|
||||
<result property="taskLinvingId" column="task_linving_id" jdbcType="VARCHAR"/>
|
||||
<result property="result" column="result" jdbcType="VARCHAR"/>
|
||||
<result property="queryCondition" column="query_condition" jdbcType="VARCHAR"/>
|
||||
<result property="rootAppPk" column="root_app_pk" jdbcType="VARCHAR"/>
|
||||
<result property="rootAppBill" column="root_app_bill" jdbcType="VARCHAR"/>
|
||||
<result property="rootAppNewData" column="root_app_new_data" jdbcType="VARCHAR"/>
|
||||
<result property="newTransmitInfo" column="new_transmit_info" jdbcType="VARCHAR"/>
|
||||
<result property="newPushDate" column="new_push_date" jdbcType="TIMESTAMP"/>
|
||||
<result property="repairPust" column="repair_pust" jdbcType="VARCHAR"/>
|
||||
<result property="senceId" column="sence_id" jdbcType="VARCHAR"/>
|
||||
<result property="newState" column="new_state" jdbcType="VARCHAR"/>
|
||||
<result property="businessDate" column="business_date" jdbcType="VARCHAR"/>
|
||||
<result property="pluginId" column="plugin_id" jdbcType="VARCHAR"/>
|
||||
<result property="processingTime" column="processing_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="processingRemarks" column="processing_remarks" jdbcType="VARCHAR"/>
|
||||
<result property="processorName" column="processor_name" jdbcType="VARCHAR"/>
|
||||
<result property="processor" column="processor" jdbcType="VARCHAR"/>
|
||||
<result property="newSystemNumber" column="new_system_number" jdbcType="VARCHAR"/>
|
||||
<result property="newSystemPrimary" column="new_system_primary" 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>
|
||||
|
||||
<!--分页查询数据-->
|
||||
<select id="queryComparisonPage" resultMap="get-ComparisonEntity-result"
|
||||
parameterType = "java.util.Map">
|
||||
select * from ${dbName}
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<foreach collection="map.entrySet()" item="value" index="key">
|
||||
and ${key} like concat('%',#{value},'%')
|
||||
</foreach>
|
||||
and sts='Y'
|
||||
</trim>
|
||||
</select>
|
||||
|
||||
<!--根据主数据编码查询数据-->
|
||||
<select id="queryComparison" resultMap="get-ComparisonEntity-result"
|
||||
parameterType="com.hzya.frame.sysnew.comparison.entity.ComparisonEntity">
|
||||
select m.mdm_name as mdmName,m.mdm_code as mdmCode,moddb.db_name as dbName,
|
||||
moddb.db_type as dbType,filed.en_name as enName,filed.ch_name as chName,filed.filed_type as filedType
|
||||
from mdm_module m
|
||||
left join mdm_module_db moddb on m.id=moddb.mdm_id
|
||||
left join mdm_module_db_fileds filed
|
||||
on filed.mdm_id=m.id and filed.db_id=moddb.id
|
||||
where m.mdm_code= #{mdmCode}
|
||||
</select>
|
||||
|
||||
<!--生成单据规则-->
|
||||
<select id="queryComparisonRule" resultMap="get-ComparisonEntity-result"
|
||||
parameterType="com.hzya.frame.sysnew.comparison.entity.ComparisonEntity">
|
||||
select
|
||||
case when
|
||||
length(IFNULL(max(right(document_rule,'4')), '0')+1)=2 then
|
||||
concat(#{rulePrefix},'-',REPLACE(LEFT(NOW(),10),'-',''),'-','00',IFNULL(max(right(document_rule,'4')), '0')+1)
|
||||
when length(IFNULL(max(right(document_rule,'4')), '0')+1)=1 then
|
||||
concat(#{rulePrefix},'-',REPLACE(LEFT(NOW(),10),'-',''),'-','000',IFNULL(max(right(document_rule,'4')), '0')+1)
|
||||
when length(IFNULL(max(right(document_rule,'4')), '0')+1)=3 then
|
||||
concat(#{rulePrefix},'-',REPLACE(LEFT(NOW(),10),'-',''),'-','0',IFNULL(max(right(document_rule,'4')), '0')+1)
|
||||
else concat(#{rulePrefix},'-',REPLACE(LEFT(NOW(),10),'-',''),'-','',IFNULL(max(right(document_rule,'4')), '0')+1) end
|
||||
as documentRule,
|
||||
right(case when
|
||||
length(IFNULL(max(right(document_rule,'4')), '0')+1)=2 then
|
||||
concat(#{rulePrefix},'-',REPLACE(LEFT(NOW(),10),'-',''),'-','00',IFNULL(max(right(document_rule,'4')), '0')+1)
|
||||
when length(IFNULL(max(right(document_rule,'4')), '0')+1)=1 then
|
||||
concat(#{rulePrefix},'-',REPLACE(LEFT(NOW(),10),'-',''),'-','000',IFNULL(max(right(document_rule,'4')), '0')+1)
|
||||
when length(IFNULL(max(right(document_rule,'4')), '0')+1)=3 then
|
||||
concat(#{rulePrefix},'-',REPLACE(LEFT(NOW(),10),'-',''),'-','0',IFNULL(max(right(document_rule,'4')), '0')+1)
|
||||
else concat(#{rulePrefix},'-',REPLACE(LEFT(NOW(),10),'-',''),'-','',IFNULL(max(right(document_rule,'4')), '0')+1) end,4) as documentRuleNum
|
||||
from ${dbName} where document_rule like concat(#{rulePrefix},'-',REPLACE(LEFT(NOW(),10),'-',''),'-','%');
|
||||
</select>
|
||||
|
||||
|
||||
<!--新增档案数据-->
|
||||
<insert id="saveComparison" parameterType = "java.util.Map">
|
||||
insert into ${dbName}
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<foreach collection="map.keySet()" item="column">
|
||||
${column},
|
||||
</foreach>
|
||||
</trim>
|
||||
values
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<foreach collection="map.values()" item="value">
|
||||
#{value},
|
||||
</foreach>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<!--通过主键修改方法-->
|
||||
<update id="updateComparisonByType" parameterType = "java.util.Map" >
|
||||
update ${dbName}
|
||||
<set>
|
||||
<foreach collection="map.entrySet()" item="value" index="key" separator=",">
|
||||
${key} =#{value}
|
||||
</foreach>
|
||||
</set>
|
||||
where id=#{id} and sts='Y'
|
||||
</update>
|
||||
|
||||
|
||||
<!-- 多条件逻辑删除 -->
|
||||
<update id="deleteComparison" parameterType = "java.util.Map" >
|
||||
update
|
||||
${dbName}
|
||||
set sts= 'N' ,modify_time = now(),modify_user_id = #{modify_user_id}
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<foreach collection="map.entrySet()" item="value" index="key">
|
||||
and ${key} =#{value}
|
||||
</foreach>
|
||||
and id=#{id} and sts='Y'
|
||||
</trim>
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
package com.hzya.frame.sysnew.comparison.service;
|
||||
|
||||
import com.hzya.frame.basedao.service.IBaseService;
|
||||
import com.hzya.frame.sysnew.comparison.entity.ComparisonDetailsEntity;
|
||||
|
||||
public interface IComparisonDetailsService extends IBaseService<ComparisonDetailsEntity, String> {
|
||||
}
|
|
@ -0,0 +1,49 @@
|
|||
package com.hzya.frame.sysnew.comparison.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.hzya.frame.basedao.service.IBaseService;
|
||||
import com.hzya.frame.sysnew.comparison.entity.ComparisonEntity;
|
||||
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||
|
||||
public interface IComparisonService extends IBaseService<ComparisonEntity, String> {
|
||||
|
||||
/**
|
||||
*
|
||||
* @content 分页查询档案对照数据
|
||||
* @Param
|
||||
* @Return
|
||||
* @Author hecan
|
||||
* @Date 2024/5/7 15:55
|
||||
* **/
|
||||
JsonResultEntity queryEntityPage(JSONObject jsonObject);
|
||||
|
||||
/**
|
||||
*
|
||||
* @content 新增档案对照数据
|
||||
* @Param
|
||||
* @Return
|
||||
* @Author hecan
|
||||
* @Date 2024/5/7 16:52
|
||||
* **/
|
||||
JsonResultEntity saveEntity(JSONObject jsonObject);
|
||||
|
||||
/**
|
||||
*
|
||||
* @content 编辑档案对照数据
|
||||
* @Param
|
||||
* @Return
|
||||
* @Author hecan
|
||||
* @Date 2024/5/9 10:19
|
||||
* **/
|
||||
JsonResultEntity updateEntity(JSONObject jsonObject);
|
||||
|
||||
/**
|
||||
*
|
||||
* @content 删除档案对照数据
|
||||
* @Param
|
||||
* @Return
|
||||
* @Author hecan
|
||||
* @Date 2024/5/9 13:59
|
||||
* **/
|
||||
JsonResultEntity deleteEntity(JSONObject jsonObject);
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
package com.hzya.frame.sysnew.comparison.service.impl;
|
||||
|
||||
import com.hzya.frame.basedao.service.impl.BaseService;
|
||||
import com.hzya.frame.sysnew.comparison.entity.ComparisonDetailsEntity;
|
||||
import com.hzya.frame.sysnew.comparison.service.IComparisonDetailsService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service(value = "comparisonDetailsServiceImpl")
|
||||
public class ComparisonDetailsServiceImpl extends BaseService<ComparisonDetailsEntity, String> implements IComparisonDetailsService {
|
||||
}
|
|
@ -0,0 +1,334 @@
|
|||
package com.hzya.frame.sysnew.comparison.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.hzya.frame.basedao.service.impl.BaseService;
|
||||
import com.hzya.frame.sysnew.comparison.dao.IComparisonDao;
|
||||
import com.hzya.frame.sysnew.comparison.dao.IComparisonDetailsDao;
|
||||
import com.hzya.frame.sysnew.comparison.entity.ComparisonDetailsEntity;
|
||||
import com.hzya.frame.sysnew.comparison.entity.ComparisonEntity;
|
||||
import com.hzya.frame.sysnew.comparison.service.IComparisonService;
|
||||
import com.hzya.frame.sysnew.generalData.dao.IGeneralDataDao;
|
||||
import com.hzya.frame.uuid.UUIDUtils;
|
||||
import com.hzya.frame.web.entity.BaseResult;
|
||||
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import sun.java2d.pipe.AAShapePipe;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
@Service(value = "comparisonServiceImpl")
|
||||
public class ComparisonServiceImpl extends BaseService<ComparisonEntity, String> implements IComparisonService {
|
||||
|
||||
private IComparisonDao comparisonDao;
|
||||
|
||||
@Autowired
|
||||
private IComparisonDetailsDao comparisonDetailsDao;
|
||||
|
||||
@Autowired
|
||||
public void setGeneralDataDao(IComparisonDao dao) {
|
||||
this.comparisonDao = dao;
|
||||
this.dao = dao;
|
||||
}
|
||||
|
||||
//分页查询档案对照数据
|
||||
@Override
|
||||
public JsonResultEntity queryEntityPage(JSONObject json) {
|
||||
JSONObject jsonObject = json.getJSONObject("jsonStr");
|
||||
if (jsonObject == null) {
|
||||
return BaseResult.getFailureMessageEntity("数据为空,请先传递数据");
|
||||
}
|
||||
if (!checkStr(jsonObject.getString("mdmCode"))) {
|
||||
return BaseResult.getFailureMessageEntity("主数据编码为空");
|
||||
}
|
||||
ComparisonEntity comparisonEntity = jsonObject.toJavaObject(ComparisonEntity.class);
|
||||
List<ComparisonEntity> comparisonEntities=new ArrayList<>();
|
||||
try {
|
||||
//根据主数据编码查询表名称,字段名称等信息 10001
|
||||
comparisonEntities = comparisonDao.queryComparison(comparisonEntity);
|
||||
}catch (Exception e){
|
||||
logger.info("根据主数据编码查询信息错误:{}",e.getMessage());
|
||||
return BaseResult.getFailureMessageEntity("查询失败",e.getMessage());
|
||||
}
|
||||
Map<String, Object> map = new HashMap<>();//将主表数据存到map中
|
||||
if (comparisonEntities != null && comparisonEntities.size() > 0) {
|
||||
for (ComparisonEntity entity : comparisonEntities) {
|
||||
//遍历主表下面的所有key,字段名
|
||||
for (String key : jsonObject.keySet()) {
|
||||
if (entity.getDbType().equals("1")) {
|
||||
comparisonEntity.setDbName(entity.getDbName());
|
||||
if(!"mdmCode".equals(key)){
|
||||
map.put(key, jsonObject.getString(key));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
comparisonEntity.setMap(map);
|
||||
try {
|
||||
List<ComparisonEntity> comparisonEntitiePages = comparisonDao.queryComparisonPage(comparisonEntity);
|
||||
PageInfo pageInfo = new PageInfo(comparisonEntitiePages);
|
||||
return BaseResult.getSuccessMessageEntity("查询成功", pageInfo);
|
||||
} catch (Exception e) {
|
||||
logger.info("查询档案对照错误:{}", e.getMessage());
|
||||
return BaseResult.getFailureMessageEntity("查询失败", e.getMessage());
|
||||
}
|
||||
}
|
||||
return BaseResult.getFailureMessageEntity("查询失败","请检查传递参数");
|
||||
}
|
||||
|
||||
//新增档案对照数据
|
||||
@Override
|
||||
public JsonResultEntity saveEntity(JSONObject json) {
|
||||
JSONObject jsonObject = json.getJSONObject("jsonStr");
|
||||
if (jsonObject == null) {
|
||||
return BaseResult.getFailureMessageEntity("数据为空,请先传递数据");
|
||||
}
|
||||
if (!checkStr(jsonObject.getString("mdmCode"))) {
|
||||
return BaseResult.getFailureMessageEntity("主数据编码为空");
|
||||
}
|
||||
if (!checkStr(jsonObject.getString("rulePrefix"))) {
|
||||
return BaseResult.getFailureMessageEntity("规则为空");
|
||||
}
|
||||
ComparisonEntity comparisonEntity = jsonObject.toJavaObject(ComparisonEntity.class);
|
||||
ComparisonDetailsEntity comparisonDetailsEntity=new ComparisonDetailsEntity();
|
||||
List<ComparisonEntity> comparisonEntities=new ArrayList<>();
|
||||
try {
|
||||
//根据主数据编码查询表名称,字段名称等信息 10001
|
||||
comparisonEntities = comparisonDao.queryComparison(comparisonEntity);
|
||||
}catch (Exception e){
|
||||
logger.info("根据主数据编码查询信息错误:{}",e.getMessage());
|
||||
return BaseResult.getFailureMessageEntity("保存失败",e.getMessage());
|
||||
}
|
||||
String main = jsonObject.getString("main");//获取主表数据
|
||||
JSONArray jsonArray = jsonObject.getJSONArray("details");//获取子表数据
|
||||
JSONObject jsonObjectMain = JSONObject.parseObject(main);
|
||||
if(jsonObjectMain != null ) {
|
||||
Map<String, Object> map = new HashMap<>();//将主表数据存到map中
|
||||
Map<String, Object> mapDetails = new HashMap<>();//将子表数据存到map中
|
||||
if (comparisonEntities != null && comparisonEntities.size() > 0) {
|
||||
for (ComparisonEntity entity : comparisonEntities) {
|
||||
//遍历主表下面的所有key,字段名
|
||||
for (String key : jsonObjectMain.keySet()) {
|
||||
if (entity.getDbType().equals("1")) {
|
||||
comparisonEntity.setDbName(entity.getDbName());
|
||||
map.put(key, jsonObjectMain.getString(key));
|
||||
}
|
||||
}
|
||||
}
|
||||
if (jsonArray != null && jsonArray.size() > 0) {
|
||||
for (Object object : jsonArray) {
|
||||
JSONObject jsonObjectDetails = (JSONObject) JSON.toJSON(object);
|
||||
for (ComparisonEntity entity : comparisonEntities) {
|
||||
//遍历主表下面的所有key,字段名
|
||||
for (String key : jsonObjectDetails.keySet()) {
|
||||
if (entity.getDbType().equals("2")) {
|
||||
comparisonDetailsEntity.setDbName(entity.getDbName());
|
||||
mapDetails.put(key, jsonObjectDetails.getString(key));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
String uuid = UUIDUtils.getUUID();
|
||||
map.put("id", uuid);
|
||||
map.put("create_user_id", "c796fd9ba4c9f5ff3cc2fa41a040e443");
|
||||
map.put("modify_user_id", "c796fd9ba4c9f5ff3cc2fa41a040e443");
|
||||
map.put("org_id", "0");
|
||||
map.put("create_time", new Date());
|
||||
map.put("modify_time", new Date());
|
||||
map.put("sts", "Y");
|
||||
comparisonEntity.setMap(map);
|
||||
//生成单据规则
|
||||
comparisonEntity.setRulePrefix(jsonObject.getString("rulePrefix"));
|
||||
try {
|
||||
ComparisonEntity comparisonEntityRule = comparisonDao.queryComparisonRule(comparisonEntity);
|
||||
map.put("document_rule", comparisonEntityRule.getDocumentRule());//单据规则
|
||||
map.put("document_rule_num", comparisonEntityRule.getDocumentRuleNum());//单据规则流水号
|
||||
} catch (Exception e) {
|
||||
logger.info("保存档案对照时候生成单据规则错误:{}", e.getMessage());
|
||||
return BaseResult.getFailureMessageEntity("保存失败", e.getMessage());
|
||||
}
|
||||
try {
|
||||
//保存主表数据
|
||||
ComparisonEntity comparisonEntityOne = comparisonDao.saveComparison(comparisonEntity);
|
||||
//保存子表数据
|
||||
if (mapDetails != null && mapDetails.size() > 0) {
|
||||
mapDetails.put("id", UUIDUtils.getUUID());
|
||||
mapDetails.put("formmain_id", uuid);
|
||||
mapDetails.put("create_user_id", "c796fd9ba4c9f5ff3cc2fa41a040e443");
|
||||
mapDetails.put("modify_user_id", "c796fd9ba4c9f5ff3cc2fa41a040e443");
|
||||
mapDetails.put("org_id", "0");
|
||||
mapDetails.put("create_time", new Date());
|
||||
mapDetails.put("modify_time", new Date());
|
||||
mapDetails.put("sts", "Y");
|
||||
comparisonDetailsEntity.setMapDetails(mapDetails);
|
||||
ComparisonDetailsEntity comparisonDetailsEntityOne = comparisonDetailsDao.saveComparisonDetails(comparisonDetailsEntity);
|
||||
comparisonEntityOne.setComparisonDetailsEntity(comparisonDetailsEntityOne);
|
||||
}
|
||||
return BaseResult.getSuccessMessageEntity("保存成功", comparisonEntityOne);
|
||||
} catch (Exception e) {
|
||||
logger.info("保存档案对照时候错误:{}", e.getMessage());
|
||||
return BaseResult.getFailureMessageEntity("保存失败", e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
return BaseResult.getFailureMessageEntity("查询失败","请检查传递参数");
|
||||
}
|
||||
|
||||
//更新档案对照数据
|
||||
@Override
|
||||
public JsonResultEntity updateEntity(JSONObject json) {
|
||||
JSONObject jsonObject = json.getJSONObject("jsonStr");
|
||||
if (jsonObject == null) {
|
||||
return BaseResult.getFailureMessageEntity("数据为空,请先传递数据");
|
||||
}
|
||||
if (!checkStr(jsonObject.getString("mdmCode"))) {
|
||||
return BaseResult.getFailureMessageEntity("主数据编码为空");
|
||||
}
|
||||
ComparisonEntity comparisonEntity = jsonObject.toJavaObject(ComparisonEntity.class);
|
||||
ComparisonDetailsEntity comparisonDetailsEntity=new ComparisonDetailsEntity();
|
||||
JSONObject jsonObjectMain=jsonObject.getJSONObject("main");//获取主表数据
|
||||
JSONArray jsonArray = jsonObject.getJSONArray("details");//获取子表数据
|
||||
if(!checkStr(jsonObjectMain.getString("id"))){
|
||||
return BaseResult.getFailureMessageEntity("更新时候主表id不能为空");
|
||||
}
|
||||
List<ComparisonEntity> comparisonEntities=new ArrayList<>();
|
||||
//根据主数据编码查询表名称,字段名称等信息 10001
|
||||
try {
|
||||
comparisonEntities = comparisonDao.queryComparison(comparisonEntity);
|
||||
}catch (Exception e){
|
||||
logger.info("根据主数据编码查询信息错误:{}",e.getMessage());
|
||||
return BaseResult.getFailureMessageEntity("更新失败",e.getMessage());
|
||||
}
|
||||
Map<String,Object> map=new HashMap<>();//将主表数据存到map中
|
||||
Map<String,Object> mapDetails=new HashMap<>();//将子表数据存到map中
|
||||
if(comparisonEntities !=null && comparisonEntities.size()>0) {
|
||||
for (ComparisonEntity entity : comparisonEntities) {
|
||||
//遍历主表下面的所有key,字段名
|
||||
for (String key : jsonObjectMain.keySet()) {
|
||||
if (entity.getDbType().equals("1")) {
|
||||
comparisonEntity.setDbName(entity.getDbName());
|
||||
map.put(key, jsonObjectMain.getString(key));
|
||||
}
|
||||
}
|
||||
}
|
||||
if (jsonArray != null && jsonArray.size() > 0) {
|
||||
for (Object object : jsonArray) {
|
||||
JSONObject jsonObjectDetails = (JSONObject) JSON.toJSON(object);
|
||||
for (ComparisonEntity entity : comparisonEntities) {
|
||||
//遍历主表下面的所有key,字段名
|
||||
for (String key : jsonObjectDetails.keySet()) {
|
||||
if (entity.getDbType().equals("2")) {
|
||||
comparisonDetailsEntity.setDbName(entity.getDbName());
|
||||
mapDetails.put(key, jsonObjectDetails.getString(key));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
map.put("create_user_id", "c796fd9ba4c9f5ff3cc2fa41a040e443");
|
||||
map.put("modify_user_id", "c796fd9ba4c9f5ff3cc2fa41a040e443");
|
||||
map.put("org_id", "0");
|
||||
map.put("modify_time", new Date());
|
||||
map.put("sts", "Y");
|
||||
comparisonEntity.setMap(map);
|
||||
comparisonEntity.setId(jsonObjectMain.getString("id"));
|
||||
/*//生成单据规则
|
||||
comparisonEntity.setRulePrefix(jsonObject.getString("rulePrefix"));
|
||||
try {
|
||||
ComparisonEntity comparisonEntityRule = comparisonDao.queryComparisonRule(comparisonEntity);
|
||||
map.put("document_rule",comparisonEntityRule.getDocumentRule());//单据规则
|
||||
map.put("document_rule_num",comparisonEntityRule.getDocumentRuleNum());//单据规则流水号
|
||||
}catch (Exception e){
|
||||
logger.info("更新档案对照时候生成单据规则错误:{}",e.getMessage());
|
||||
return BaseResult.getFailureMessageEntity("更新失败",e.getMessage());
|
||||
}*/
|
||||
try {
|
||||
//保存主表数据
|
||||
Integer integer = comparisonDao.updateComparisonByType(comparisonEntity);
|
||||
if (integer > 0) {
|
||||
//保存子表数据
|
||||
if (mapDetails != null && mapDetails.size() > 0) {
|
||||
mapDetails.put("create_user_id", "c796fd9ba4c9f5ff3cc2fa41a040e443");
|
||||
mapDetails.put("modify_user_id", "c796fd9ba4c9f5ff3cc2fa41a040e443");
|
||||
mapDetails.put("org_id", "0");
|
||||
mapDetails.put("modify_time", new Date());
|
||||
mapDetails.put("sts", "Y");
|
||||
comparisonDetailsEntity.setFormmainId(jsonObjectMain.getString("id"));
|
||||
comparisonDetailsEntity.setMapDetails(mapDetails);
|
||||
comparisonDetailsDao.updateComparisonDetailsByType(comparisonDetailsEntity);
|
||||
return BaseResult.getSuccessMessageEntity("更新成功", integer);
|
||||
}
|
||||
}else{
|
||||
return BaseResult.getFailureMessageEntity("更新失败", "请查看id是否在表中存在");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.info("更新档案对照时候错误:{}", e.getMessage());
|
||||
return BaseResult.getFailureMessageEntity("更新失败", e.getMessage());
|
||||
}
|
||||
}
|
||||
return BaseResult.getFailureMessageEntity("查询失败","请检查传递参数");
|
||||
}
|
||||
|
||||
//删除当初对照数据
|
||||
@Override
|
||||
public JsonResultEntity deleteEntity(JSONObject json) {
|
||||
JSONObject jsonObject = json.getJSONObject("jsonStr");
|
||||
if (jsonObject == null) {
|
||||
return BaseResult.getFailureMessageEntity("数据为空,请先传递数据");
|
||||
}
|
||||
if (!checkStr(jsonObject.getString("mdmCode"))) {
|
||||
return BaseResult.getFailureMessageEntity("主数据编码为空");
|
||||
}
|
||||
ComparisonEntity comparisonEntity = jsonObject.toJavaObject(ComparisonEntity.class);
|
||||
ComparisonDetailsEntity comparisonDetailsEntity=new ComparisonDetailsEntity();
|
||||
JSONObject jsonObjectMain=jsonObject.getJSONObject("main");//获取主表数据
|
||||
if(!checkStr(jsonObjectMain.getString("id"))){
|
||||
return BaseResult.getFailureMessageEntity("删除时候主表id不能为空");
|
||||
}
|
||||
List<ComparisonEntity> comparisonEntities=new ArrayList<>();
|
||||
//根据主数据编码查询表名称,字段名称等信息 10001
|
||||
try {
|
||||
comparisonEntities = comparisonDao.queryComparison(comparisonEntity);
|
||||
}catch (Exception e){
|
||||
logger.info("根据主数据编码查询信息错误:{}",e.getMessage());
|
||||
return BaseResult.getFailureMessageEntity("删除失败",e.getMessage());
|
||||
}
|
||||
Map<String,Object> map=new HashMap<>();
|
||||
if(comparisonEntities !=null && comparisonEntities.size()>0) {
|
||||
for (ComparisonEntity entity : comparisonEntities) {
|
||||
//遍历主表下面的所有key,字段名
|
||||
for (String key : jsonObjectMain.keySet()) {
|
||||
if (entity.getDbType().equals("1")) {
|
||||
comparisonEntity.setDbName(entity.getDbName());
|
||||
map.put(key, jsonObjectMain.getString(key));
|
||||
}
|
||||
if(entity.getDbType().equals("2")){
|
||||
comparisonDetailsEntity.setDbName(entity.getDbName());
|
||||
}
|
||||
}
|
||||
}
|
||||
comparisonEntity.setId(jsonObjectMain.getString("id"));
|
||||
comparisonEntity.setModify_user_id("c796fd9ba4c9f5ff3cc2fa41a040e443");
|
||||
comparisonEntity.setMap(map);
|
||||
try {
|
||||
Integer integer = comparisonDao.deleteComparison(comparisonEntity);
|
||||
if(integer>0){
|
||||
comparisonDetailsEntity.setFormmainId(jsonObjectMain.getString("id"));
|
||||
comparisonDetailsEntity.setModify_user_id("c796fd9ba4c9f5ff3cc2fa41a040e443");
|
||||
comparisonDetailsDao.deleteComparisonDetails(comparisonDetailsEntity);
|
||||
return BaseResult.getSuccessMessageEntity("删除成功",integer);
|
||||
}else{
|
||||
return BaseResult.getFailureMessageEntity("删除失败","请查看id是否在表中存在");
|
||||
}
|
||||
}catch (Exception e){
|
||||
logger.info("删除档案对照数据错误:{}",e.getMessage());
|
||||
return BaseResult.getFailureMessageEntity("删除失败",e.getMessage());
|
||||
}
|
||||
}
|
||||
return BaseResult.getFailureMessageEntity("查询失败","请检查传递参数");
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue