From 3e15bd6457b5c7ca949fe7e59bb0196b6748a2ef Mon Sep 17 00:00:00 2001 From: lihao Date: Fri, 29 Aug 2025 14:31:23 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=B5=AE=E7=82=B9=E6=95=B0bu?= =?UTF-8?q?g?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ic/ic/saleout/saveBeforeCheck.java | 10 ++++-- .../maintain/rule/delete/UpdatePickmRule.java | 33 +++++++++++++++++-- 2 files changed, 37 insertions(+), 6 deletions(-) diff --git a/ic/src/public/nccloud/resources/ic/ic/saleout/saveBeforeCheck.java b/ic/src/public/nccloud/resources/ic/ic/saleout/saveBeforeCheck.java index 325ecb6..74f6d52 100644 --- a/ic/src/public/nccloud/resources/ic/ic/saleout/saveBeforeCheck.java +++ b/ic/src/public/nccloud/resources/ic/ic/saleout/saveBeforeCheck.java @@ -115,10 +115,14 @@ public class saveBeforeCheck implements IBusinessListener { Object nassistnumObj = valMap.get("nassistnum"); String nassistnums = (nassistnumObj != null) ? nassistnumObj.toString() : ""; double nassistnum = (nassistnums.isEmpty()) ? 0 : Double.parseDouble(nassistnums);// 累计出库主数量 - if (sQty < (nassistnum + bdsfnum)) { - throw new BusinessException("销售出库单明细" + (i + 1) + ",累计出库实发数量'" + (nassistnum + bdsfnum) - + "'大于销售订单累计发货申请数量'" + sQty + "',无法保存!"); + if (new UFDouble(sQty).compareTo((new UFDouble(nassistnum).add(new UFDouble(bdnum)))) <0) { + throw new BusinessException("销售出库单明细" + (i + 1) + ",累计出库实发数量'" + (new UFDouble(nassistnum).add(new UFDouble(bdnum)).toString()) + + "'大于销售订单累计发货申请数量'" + (new UFDouble(sQty)).toString() + "',无法保存!"); } +// if (sQty < (nassistnum + bdsfnum)) { +// throw new BusinessException("销售出库单明细" + (i + 1) + ",累计出库实发数量'" + (nassistnum + bdsfnum) +// + "'大于销售订单累计发货申请数量'" + sQty + "',无法保存!"); +// } } catch (NumberFormatException e) { throw new BusinessException("累计发货申请数量、累计出库数量转化数值失败" + e); } diff --git a/pu/src/private/nc/bs/pu/m20/maintain/rule/delete/UpdatePickmRule.java b/pu/src/private/nc/bs/pu/m20/maintain/rule/delete/UpdatePickmRule.java index 9280eeb..300bbc0 100644 --- a/pu/src/private/nc/bs/pu/m20/maintain/rule/delete/UpdatePickmRule.java +++ b/pu/src/private/nc/bs/pu/m20/maintain/rule/delete/UpdatePickmRule.java @@ -13,11 +13,15 @@ import nc.impl.pubapp.pattern.rule.IRule; import nc.vo.pu.m20.entity.PraybillItemVO; import nc.vo.pu.m20.entity.PraybillVO; import nc.vo.pu.pub.constant.PUMDValue; +import nc.vo.pub.BusinessException; +import nc.vo.pub.lang.UFDouble; import nc.vo.pubapp.pattern.exception.ExceptionUtils; import nccloud.commons.lang.ArrayUtils; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; /** * 璇疯喘鍗曞垹闄ゆ椂鍥炲啓澶囨枡璁″垝鏄惁涓嬭揪瀛楁 @@ -30,22 +34,35 @@ public class UpdatePickmRule implements IRule { if (!ArrayUtils.isEmpty(vos)) { try { List pk= new ArrayList(); + List> updateList = new ArrayList<>(); for (PraybillVO vo : vos) { PraybillItemVO[] praybillItemVOS=vo.getBVO(); for (PraybillItemVO praybillItemVO : praybillItemVOS) { if("55A3".equals(praybillItemVO.getCsourcetypecode())){ + Map map = new HashMap<>(); + map.put("num",praybillItemVO.getNastnum()); + map.put("pk",praybillItemVO.getCfirstbid()); pk.add(praybillItemVO.getCsourcebid()); } } } + + if(!updateList.isEmpty()){ +// 鍥炲啓宸茬粡涓嬭揪鏁伴噺 + updetaPmoNum(updateList); + } if(!pk.isEmpty()){ //鍥炲啓鏄惁涓嬫柟涓烘槸 updetaPmo(pk); } - } catch (Exception e) { - ExceptionUtils.wrappException(e); + } catch (BusinessException e) { + try { + throw new BusinessException(e.getMessage()); + } catch (BusinessException ex) { + throw new RuntimeException(ex); + } } } @@ -67,9 +84,19 @@ public class UpdatePickmRule implements IRule { } else { result = "'" + (String) arrayList.get(0) + "'"; } - String sql = " update mm_pickm_b set vbdef13='N' where mm_pickm_b.cpickm_bid in(" + result + ")"; + String sql = " update mm_pickm_b set vbdef13='N' where mm_pickm_b.cpickm_bid in(" + result + ") and mm_pickm_b.vbdef16='0' "; BaseDAO dao = new BaseDAO(); dao.executeUpdate(sql); } + private void updetaPmoNum(List> updateList) throws DAOException { + BaseDAO dao = new BaseDAO(); + for (Map updateMap : updateList) { + String sql = " update mm_pickm_b set vbdef16 = TO_CHAR(TO_NUMBER(vbdef16) -TO_NUMBER('"+((UFDouble)updateMap.get("num")).toString()+"')) where mm_pickm_b.cpickm_bid ='" + updateMap.get("pk") + "'"; + + dao.executeUpdate(sql); + } + + + } }