Merge branch 'dev' into 'test'

国贸2.0系统推送合同回调:消息固定R_JG_MY_00应答,_interfaceType__固定传R_MY_JG_10

See merge request jygk/dsc-base!18
This commit is contained in:
孙承赐
2025-11-11 10:31:06 +00:00
37 changed files with 488 additions and 172 deletions

View File

@@ -36,6 +36,7 @@ import com.zt.plat.module.erp.controller.admin.erp.vo.ErpContractSaveReqVO;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.validation.annotation.Validated;
@@ -44,9 +45,7 @@ import org.springframework.web.bind.annotation.RestController;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.time.*;
import java.time.format.DateTimeFormatter;
import java.util.*;
import java.util.stream.Collectors;
@@ -178,7 +177,7 @@ public class ContractApiImpl implements ContractApi {
SystemRelativityDO systemRelativityDO = systemRelativityMapper.selectOne("UP_ID", externalId);
if ("I".equals(operateFlag)) {
if (systemRelativityDO != null && systemRelativityDO.getDownId() != null) { // 修改合同
contractId = systemRelativityDO.getDownId();
contractId = Long.parseLong(systemRelativityDO.getDownId());
contractMainDO.setId(contractId);
contractMainMapper.updateById(contractMainDO);
} else { // 新增合同
@@ -187,15 +186,15 @@ public class ContractApiImpl implements ContractApi {
// 生成关联数据
SystemRelativityDO saveRelation = new SystemRelativityDO();
saveRelation.setUpId(Long.parseLong(externalId));
saveRelation.setDownId(contractId);
saveRelation.setUpId(externalId);
saveRelation.setDownId(contractId.toString());
saveRelation.setWay(DictEnum.BSE_SYS_REL_WY_EXTERNAL.getCode());
saveRelation.setStatus(DictEnum.BSE_SYS_REL_TP_CONTRACT.getCode());
systemRelativityMapper.insert(saveRelation);
}
} else if ("D".equals(operateFlag)) {
if (systemRelativityDO == null || systemRelativityDO.getDownId() == null) throw exception(CONTRACT_NOT_EXISTS);
contractId = systemRelativityDO.getDownId();
contractId = Long.parseLong(systemRelativityDO.getDownId());
contractMainMapper.deleteById(contractId);
// 删除动态条款信息
contractOtherFormMapper.delete("CTRT_MAIN_ID", contractId.toString());
@@ -378,17 +377,17 @@ public class ContractApiImpl implements ContractApi {
// 返回数据
IntPushContractRespVO body = new IntPushContractRespVO();
body.set__requestId_(pushReqVO.get__requestId_());
body.set__interfaceType__(pushReqVO.get__interfaceType__());
body.set__interfaceType__("R_MY_JG_10");
body.setBusiBillCode(pushReqVO.getBusiBillCode());
body.setCode(code);
body.setMessage(String.format("推送合同[%s]%s", pushReqVO.getData().getContractCode(), code >= 0 ? "成功" : "失败:" + msg));
body.setMessage(String.format("推送合同[%s]%s", pushReqVO.getBusiBillCode(), code >= 0 ? "成功" : "失败:" + msg));
body.setDatetime(DateTimeFormatter.ofPattern("yyyyMMddHHmmss").format(LocalDateTime.now()));
body.setSystem("JYGK");
body.setOperateFlag(pushReqVO.getOperateFlag());
// 回调参数
JSONObject req = new JSONObject();
req.set("messageKey", pushReqVO.getBusiBillCode());
req.set("messageKey", "R_JG_MY_00");
req.set("messageBody", body);
try {
log.info("国贸系统推送合同回调参数:{}",req);
@@ -565,13 +564,21 @@ public class ContractApiImpl implements ContractApi {
// 是否虚拟合同 默认值:否(0)
contractMainDO.setContractVirtual(DictEnum.ERP_CTRT_YN_NO.getCode());
// 代理方 默认值:NULL
// 签署日期 -> 签约日期 (40-签约必填, 格式: yyyyMMdd)
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMddHHmmss");
contractMainDO.setSignDate(LocalDateTime.parse(reqVO.getSignDate()+"000000", formatter));
// 开始日期 -> 合同有效期起 (格式: yyyyMMdd)
contractMainDO.setStartDate(LocalDateTime.parse(reqVO.getContractStartDate()+"000000", formatter));
// 结束日期 -> 合同有效期止 (格式: yyyyMMdd)
contractMainDO.setEndDate(LocalDateTime.parse(reqVO.getContractEndDate()+"000000", formatter));
// 签署日期 -> 签约日期 (40-签约必填)
if (StringUtils.isNotEmpty(reqVO.getSignDate())) {
contractMainDO.setSignDate(Instant.ofEpochMilli(Long.parseLong(reqVO.getSignDate()))
.atZone(ZoneId.systemDefault()).toLocalDateTime());
}
// 开始日期 -> 合同有效期
if (StringUtils.isNotEmpty(reqVO.getContractStartDate())) {
contractMainDO.setStartDate(Instant.ofEpochMilli(Long.parseLong(reqVO.getContractStartDate()))
.atZone(ZoneId.systemDefault()).toLocalDateTime());
}
// 结束日期 -> 合同有效期止
if (StringUtils.isNotEmpty(reqVO.getContractEndDate())) {
contractMainDO.setEndDate(Instant.ofEpochMilli(Long.parseLong(reqVO.getContractEndDate()))
.atZone(ZoneId.systemDefault()).toLocalDateTime());
}
// 币种 -> 合同币种
contractMainDO.setCurrency(reqVO.getCurrencyCode());
// 原币金额 -> 预估含税总金额

View File

@@ -7,9 +7,9 @@ import lombok.Data;
@Schema(description = "关联订单请求参数 VO")
public class LinkOrderReqVO {
@Schema(description = "上游订单号")
private Long upOrderId;
private String upOrderId;
@Schema(description = "下游订单号")
private Long downOrderId;
private String downOrderId;
@Schema(description = "关联订单类型")
private String linkOrderType;
}

View File

@@ -1,5 +1,6 @@
package com.zt.plat.module.contractorder.controller.admin.purchaseorder.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import lombok.*;
import java.util.*;
import io.swagger.v3.oas.annotations.media.Schema;
@@ -133,5 +134,8 @@ public class PurchaseOrderPageReqVO extends PageParam {
@Schema(description = "订单分类")
private String splyBsnTp;
@Schema(description = "货权转移类型(字典ASY_MTNG_TP)")
private String meteringType;
}

View File

@@ -196,4 +196,8 @@ public class PurchaseOrderRespVO {
@ExcelProperty(" 审批意见")
private String reviewOpinion;
@Schema(description = "货权转移类型(字典ASY_MTNG_TP)")
@ExcelProperty("货权转移类型(字典ASY_MTNG_TP)")
private String meteringType;
}

View File

@@ -178,4 +178,21 @@ public class PurchaseOrderSaveReqVO {
@Schema(description = "订单分类(字典SPLY_BSN_TP)", example = "2")
@ExcelProperty("订单分类")
private String splyBsnTp;
@Schema(description = "货权转移类型(字典ASY_MTNG_TP)")
@ExcelProperty("货权转移类型(字典ASY_MTNG_TP)")
private String meteringType;
@Schema(description = "产品组名")
@ExcelProperty("产品组名")
private String pdtGrpName;
@Schema(description = "产品组编码")
@ExcelProperty("产品组编码")
private String pdtGrpCdg;
@Schema(description = "付款方名称")
@ExcelProperty("付款方名称")
private String payerName;
@Schema(description = "付款方编码")
@ExcelProperty("付款方编码")
private String payerNum;
}

View File

@@ -156,4 +156,7 @@ public class SalesOrderPageReqVO extends PageParam {
@ExcelProperty("产品组编码")
private String pdtGrpCdg;
@Schema(description = "货权转移类型(字典ASY_MTNG_TP)")
private String meteringType;
}

View File

@@ -220,5 +220,8 @@ public class SalesOrderRespVO {
@Schema(description = "付款方编码")
@ExcelProperty("付款方编码")
private String payerNum;
@Schema(description = "货权转移类型(字典ASY_MTNG_TP)")
@ExcelProperty("货权转移类型(字典ASY_MTNG_TP)")
private String meteringType;
}

View File

@@ -198,4 +198,8 @@ public class SalesOrderSaveReqVO {
@Schema(description = "付款方编码")
@ExcelProperty("付款方编码")
private String payerNum;
@Schema(description = "货权转移类型(字典ASY_MTNG_TP)")
@ExcelProperty("货权转移类型(字典ASY_MTNG_TP)")
private String meteringType;
}

View File

@@ -3,6 +3,7 @@ package com.zt.plat.module.contractorder.dal.dataobject.contract;
import com.baomidou.mybatisplus.annotation.*;
import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO;
import lombok.*;
import java.math.BigDecimal;
import java.time.LocalDateTime;
@@ -205,12 +206,12 @@ public class ContractMainDO extends BusinessBaseDO {
@TableField("RMK")
private String remark;
/**
* 施工类型编号;与ERP(HTLXBH)对应,拓展信息
* 施工类型编号(字典:ERP_CTRT_HTLXBH);与ERP(HTLXBH)对应,拓展信息
*/
@TableField("CON_TP_NUM")
private String constructionTypeNumber;
/**
* 施工类型名称;与ERP(HTLXMC)对应,拓展信息
* 施工类型名称(字典:ERP_CTRT_HTLXBH);与ERP(HTLXMC)对应,拓展信息
*/
@TableField("CON_TP_NAME")
private String constructionTypeName;
@@ -399,4 +400,14 @@ public class ContractMainDO extends BusinessBaseDO {
*/
@TableField("AGT_NAME")
private String agentName;
/**
* 货权转移类型(字典ASY_MTNG_TP)
*/
@TableField("MTNG_TP")
private String meteringType;
/**
* 模板中间表ID
*/
@TableField("BSN_ID")
private Long businessId;
}

View File

@@ -31,12 +31,12 @@ public class SystemRelativityDO extends BusinessBaseDO {
* 上游主键
*/
@TableField("UP_ID")
private Long upId;
private String upId;
/**
* 下游主键
*/
@TableField("DOWN_ID")
private Long downId;
private String downId;
/**
* 方式系统;内关联/系统外关联
*/

Some files were not shown because too many files have changed in this diff Show More