修复 MES 接口数据同步问题

- 移除了不必要的导入信息,简化了代码结构
- 在销售订单审批后同步规则中,添加了固定汇率字段
- 修改了采购合同签订后同步规则中的生成标志字段
- 移除了采购入库单签订后同步规则中未使用的字段
This commit is contained in:
张明 2025-05-21 20:59:27 +08:00
parent d2520b6bfb
commit f1354e1697
3 changed files with 5 additions and 22 deletions

View File

@ -91,24 +91,11 @@ public class AfterSigningSynchronizeRuleMES implements IRule<PurchaseInVO> {
dataObj.put("creator", transferCodeByPk(PsndocVO.getDefaultTableName(),
PsndocVO.NAME, PsndocVO.PK_PSNDOC, hvo.getCwhsmanagerid())); // 保管员
dataObj.put("remark", hvo.getVnote()); // 备注
// 添加采购员信息 - 来自cbizid字段
// String purchaser = transferCodeByPk(PsndocVO.getDefaultTableName(),
// PsndocVO.NAME, PsndocVO.PK_PSNDOC, hvo.getCbizid());
// if (purchaser != null && !purchaser.isEmpty()) {
// dataObj.put("purchaser", purchaser); // 采购员
// }
// // 添加供应商信息 - 来自cvendorid字段
// String supplier = transferCodeByPk(SupplierVO.getDefaultTableName(),
// SupplierVO.CODE, SupplierVO.PK_SUPPLIER, hvo.getCvendorid());
// if (supplier != null && !supplier.isEmpty()) {
// dataObj.put("supplierId", supplier); // 供应商编码
// }
// 构建明细
List<JSONObject> detailsList = new ArrayList<>();
if (bvos != null) {
for (PurchaseInBodyVO bvo : bvos) {
JSONObject detailMap = new JSONObject();
// TODO 没有字段
detailMap.put("originalOrderNo", hvo.getVbillcode()); // 采购收货单号
detailMap.put("sequenceNum", bvo.getCrowno()); // 采购收货单序号
// 物料编码 - 必填
@ -118,7 +105,6 @@ public class AfterSigningSynchronizeRuleMES implements IRule<PurchaseInVO> {
detailMap.put("storageId", transferCodeByPk(RackVO.getDefaultTableName(),
RackVO.CODE, RackVO.PK_RACK, bvo.getClocationid())); // 库位编码
detailMap.put("batchNum", bvo.getVbatchcode()); // 物料批号
// 数量信息 - 根据字段表修正
UFDouble assistNum = bvo.getNassistnum(); // 实收数量
detailMap.put("quantity", assistNum != null ? assistNum.doubleValue() : null); // 入库数量

View File

@ -118,6 +118,8 @@ public class AfterSigningSynchronizeRuleMES implements IRule<SaleOutVO> {
dataObj.put("effDate", null);
//寄售仓库ID
dataObj.put("consignStoreId", null);
// 生成方式
dataObj.put("genType", null);
//寄售事务类型
dataObj.put("consignType", null);
//经办人工号
@ -129,7 +131,7 @@ public class AfterSigningSynchronizeRuleMES implements IRule<SaleOutVO> {
//客户ID
dataObj.put("customId", transferCodeByPk(CustomerVO.getDefaultTableName(), CustomerVO.CODE, CustomerVO.PK_CUSTOMER, hvo.getCcustomerid()));
//生成标志
dataObj.put("mark", "W");
dataObj.put("mark", "Y");
//备注
dataObj.put("remark", hvo.getVnote());
// 构建Details明细数组

View File

@ -13,9 +13,6 @@ import nc.vo.bd.cust.CustomerVO;
import nc.vo.bd.material.MaterialVO;
import nc.vo.bd.material.measdoc.MeasdocVO;
import nc.vo.bd.psn.PsndocVO;
import nc.vo.cmp.util.StringUtils;
import nc.vo.ic.m4c.entity.SaleOutVO;
import nc.vo.org.DeptVO;
import nc.vo.pub.BusinessException;
import nc.vo.pub.billtype.BilltypeVO;
import nc.vo.pub.lang.UFDate;
@ -31,7 +28,6 @@ import nccloud.pubift.commen.itf.utils.IHttpPostOtherSys;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
@ -113,6 +109,8 @@ public class AfterApprovingSynchronizeRuleMES implements IRule<SaleOrderVO> {
// 货币必填最大长度3
String currencyCode = transferCodeByPk(CurrtypeVO.getDefaultTableName(), CurrtypeVO.CODE, CurrtypeVO.PK_CURRTYPE, head.getCorigcurrencyid());
data.put("currency", currencyCode);
// »ãÂÊ ±íÌånexchangerate
data.put("exchangeRate", 1);
// 其他非必填字段一律设为null
data.put("priceListId", null);
data.put("invoicingUnit", transferCodeByPk(CustomerVO.getDefaultTableName(), CustomerVO.CODE, CustomerVO.PK_CUSTOMER, head.getCinvoicecustid()));
@ -141,7 +139,6 @@ public class AfterApprovingSynchronizeRuleMES implements IRule<SaleOrderVO> {
if (bodys != null) {
for (SaleOrderBVO body : bodys) {
JSONObject detailItem = new JSONObject();
// 以下字段需要表体的字段
// 需求日期 表体dreceivedate
UFDate dreceivedate = body.getDreceivedate();
@ -149,8 +146,6 @@ public class AfterApprovingSynchronizeRuleMES implements IRule<SaleOrderVO> {
// 计划发货日期 表体dsenddate
UFDate dsenddate = body.getDsenddate();
data.put("deliveryDate", dsenddate != null ? dsenddate.toString().substring(0, 10) : null);
// »ãÂÊ ±íÌånexchangerate
data.put("exchangeRate", body.getVchangerate() != null ? transferSpecialField(body.getVchangerate()) : null);
// 以下表体所需字段
// 序号
detailItem.put("sequenceNum", body.getCrowno());