From e2be42eacecda5f06510fd172182542acc6f7c5b Mon Sep 17 00:00:00 2001 From: mzr Date: Wed, 28 May 2025 19:49:24 +0800 Subject: [PATCH] =?UTF-8?q?=E9=94=80=E5=94=AE=E8=AE=A2=E5=8D=95=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E6=8E=A5=E5=8F=A3=E8=B0=83=E6=95=B4=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E7=89=A9=E6=96=99=E8=A1=8C=E7=9A=84=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/so/m30/APISaleOrderMaitainImpl.java | 28 +++++++++++-------- 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/so/src/private/nccloud/api/impl/so/m30/APISaleOrderMaitainImpl.java b/so/src/private/nccloud/api/impl/so/m30/APISaleOrderMaitainImpl.java index ac275d6..a5bf14b 100644 --- a/so/src/private/nccloud/api/impl/so/m30/APISaleOrderMaitainImpl.java +++ b/so/src/private/nccloud/api/impl/so/m30/APISaleOrderMaitainImpl.java @@ -320,17 +320,24 @@ public class APISaleOrderMaitainImpl implements IAPISaleOrderMaitain { if (null == originVos || originVos.length == 0) { ExceptionUtils.wrappBusinessException("根据传入数据未匹配到相关数据"); } - Map delMap = new HashMap<>(); + Map> delBipMap = new HashMap<>(); for (Map objectMap : paramList) { Map headdata = (Map) objectMap.get(HEADTABLE); - delMap.put(headdata.get("csaleorderid") + "", headdata.getOrDefault("delId", "") + ""); + String csaleorderid = headdata.get("csaleorderid") + ""; List bodyArr = (List) objectMap.get(BODYTABLE); + List delIds = new ArrayList<>(); for (Object body : bodyArr) { Map bodydata = (Map) body; if ((bodydata.getOrDefault("vbdef11", "") + "").isEmpty()) { // 如果vbdef11为空则标记为新增行 bodydata.put("status", "add"); } + if (!(bodydata.getOrDefault("csaleorderbid", "") + "").isEmpty()) { + delIds.add(bodydata.get("csaleorderbid") + ""); + } + } + if (!delIds.isEmpty()) { + delBipMap.put(csaleorderid, delIds); } } @@ -356,20 +363,17 @@ public class APISaleOrderMaitainImpl implements IAPISaleOrderMaitain { SaleOrderVO bipVo = vosMap.get(primaryKey); // 设置单据状态 hvo.setStatus(VOStatus.UPDATED); - String delId = delMap.get(primaryKey); + List bipIds = delBipMap.get(primaryKey); // 比较combinBillVOs中的BVO和vos中的BVO for (SaleOrderBVO bvo : vo.getChildrenVO()) { - bvo.setStatus(VOStatus.UPDATED); + bvo.setStatus(VOStatus.DELETED); String csaleorderbid = bvo.getCsaleorderbid(); - // 设置删除的物料行的状态,在bip传的数据中找不到 - if (StringUtils.isNotEmpty(delId)) { - String[] delIds = delId.split(",", -1); - String vbdef11 = bvo.getVbdef11(); - // 如果BIP合同销售订单的主键在删除的数组中,则设置为删除状态 - if (Arrays.asList(delIds).contains(vbdef11)) { - bvo.setStatus(VOStatus.DELETED); - NCCForUAPLogger.debug("findDeletedBids:" + VOStatus.DELETED + ",csaleorderbid = " + csaleorderbid); + // 设置物料行的状态,在bip传的数据中找到则修改 + if (bipIds != null && !bipIds.isEmpty()) { + // 明细行设置为修改状态 + if (bipIds.contains(csaleorderbid)) { + bvo.setStatus(VOStatus.UPDATED); } } }