From c14f537ba7ca0583377bbe9ebbbfa96e85dd29a8 Mon Sep 17 00:00:00 2001 From: lihao Date: Tue, 25 Mar 2025 15:27:47 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=87=E8=B4=AD=E8=AE=A2=E5=8D=95=E6=8E=A8?= =?UTF-8?q?=E9=80=81=E5=A7=94=E5=A4=96=E8=AE=A2=E5=8D=95=E6=A0=A1=E9=AA=8C?= =?UTF-8?q?=EF=BC=8C=E5=A7=94=E5=A4=96=E8=AE=A2=E5=8D=95=E7=94=9F=E6=88=90?= =?UTF-8?q?=E5=A4=87=E6=96=99=E6=98=8E=E7=BB=86=E5=8F=96=E6=B6=88=E6=A0=A1?= =?UTF-8?q?=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../datas/PickmSubItemDataFromBom.java | 145 ++++++++++++++++++ .../pu/poorder/action/PushScOrderCheck.java | 42 +++++ .../poorder/config/action/poorderhandle.xml | 5 + .../config/authorize/order_authorize.xml | 1 + 4 files changed, 193 insertions(+) create mode 100644 mmpac/src/private/nc/bs/mmpac/pickm/rule/subitems/datas/PickmSubItemDataFromBom.java create mode 100644 pu/src/client/nccloud/web/pu/poorder/action/PushScOrderCheck.java diff --git a/mmpac/src/private/nc/bs/mmpac/pickm/rule/subitems/datas/PickmSubItemDataFromBom.java b/mmpac/src/private/nc/bs/mmpac/pickm/rule/subitems/datas/PickmSubItemDataFromBom.java new file mode 100644 index 0000000..4630150 --- /dev/null +++ b/mmpac/src/private/nc/bs/mmpac/pickm/rule/subitems/datas/PickmSubItemDataFromBom.java @@ -0,0 +1,145 @@ +// +// Source code recreated from a .class file by IntelliJ IDEA +// (powered by FernFlower decompiler) +// + +package nc.bs.mmpac.pickm.rule.subitems.datas; + +import nc.bs.mmpac.pickm.adapter.BomServiceAdapter; +import nc.bs.mmpac.pickm.rule.subitems.cache.PickmSubItemBuilderDateCache; +import nc.bs.pubapp.AppBsContext; +import nc.pubitf.sc.m61.mm.SCOrderQtyResultParamForPickm; +import nc.util.mmf.framework.base.MMNumberUtil; +import nc.util.mmf.framework.base.MMValueCheck; +import nc.vo.bd.bom.bom0202.paramvo.BomItemQueryParamForPickm; +import nc.vo.bd.vermatch.enumeration.MfgTypeEnum; +import nc.vo.mmpac.mo.param.MOSubItemQueryResultVO4Pickm; +import nc.vo.mmpac.pickm.consts.PickmLangConsts; +import nc.vo.mmpac.pickm.entity.AggPickmVO; +import nc.vo.mmpac.pickm.entity.PickmHeadVO; +import nc.vo.mmpac.pickm.enumeration.FsourcetypeEnum; +import nc.vo.pub.lang.UFDouble; +import nc.vo.pubapp.pattern.exception.ExceptionUtils; + +public class PickmSubItemDataFromBom { + private PickmSubItemBuilderDateCache subItemdateCache; + + public PickmSubItemDataFromBom(PickmSubItemBuilderDateCache cache) { + this.subItemdateCache = cache; + } + + public void getSubItemDataFromBom(AggPickmVO[] aggVOs) { + for(AggPickmVO aggPickmVO : aggVOs) { + PickmHeadVO pickmHeadVO = aggPickmVO.getParentVO(); + if (FsourcetypeEnum.WWBILL_STATE.equalsValue(pickmHeadVO.getFsourcetype())) { + if(!"61-Cxx-01".equals(pickmHeadVO.getVfirsttrantype())){ + if (MMValueCheck.isEmpty(pickmHeadVO.getVbomversion())) { + ExceptionUtils.wrappBusinessException(PickmLangConsts.getHIT_BOMNULL()); + } + + BomItemQueryParamForPickm param = this.getBomQueryParamFromSc(pickmHeadVO, pickmHeadVO.getVbomversion()); + this.subItemdateCache.setBomQueryParamList(param); + } + } else { + if (FsourcetypeEnum.MOBILL_STATE.equalsValue(pickmHeadVO.getFsourcetype())) { + if (pickmHeadVO.getVbomversion() == null && pickmHeadVO.getVpbomversion() == null) { + continue; + } + + if (pickmHeadVO.getVbomversion() != null) { + BomItemQueryParamForPickm param = this.getBomQueryParamFromMO(pickmHeadVO, pickmHeadVO.getVbomversion()); + this.subItemdateCache.setBomQueryParamList(param); + } + + if (pickmHeadVO.getVpbomversion() != null) { + BomItemQueryParamForPickm param = this.getBomQueryParamFromMO(pickmHeadVO, pickmHeadVO.getVpbomversion()); + this.subItemdateCache.setBomQueryParamList(param); + } + } + + if (FsourcetypeEnum.HAND_STATE.equalsValue(pickmHeadVO.getFsourcetype())) { + if (pickmHeadVO.getVbomversion() == null && pickmHeadVO.getVpbomversion() == null) { + ExceptionUtils.wrappBusinessException(PickmLangConsts.getHIT_BOMNULL()); + } + + if (pickmHeadVO.getVbomversion() != null) { + BomItemQueryParamForPickm param = this.getBomQueryParamFromHand(pickmHeadVO, pickmHeadVO.getVbomversion()); + this.subItemdateCache.setBomQueryParamList(param); + } + + if (pickmHeadVO.getVpbomversion() != null) { + BomItemQueryParamForPickm param = this.getBomQueryParamFromHand(pickmHeadVO, pickmHeadVO.getVpbomversion()); + this.subItemdateCache.setBomQueryParamList(param); + } + } + } + } + + this.subItemdateCache.setAggBomMap(BomServiceAdapter.queryBomItemForPI_New((BomItemQueryParamForPickm[])this.subItemdateCache.getBomQueryParamList().toArray(new BomItemQueryParamForPickm[0]))); + } + + private BomItemQueryParamForPickm getBomQueryParamFromMO(PickmHeadVO headVO, String bomID) { + BomItemQueryParamForPickm param = new BomItemQueryParamForPickm(); + String key = null; + if ("55A2".equals(headVO.getVsourcebilltype())) { + String var10000 = headVO.getCsourcebillrowid(); + key = var10000 + headVO.getVsourcebilltype(); + } else if ("55C2".equals(headVO.getVsourcebilltype())) { + String var6 = headVO.getCsourcebillid(); + key = var6 + headVO.getVsourcebilltype(); + } + + MOSubItemQueryResultVO4Pickm moparam = (MOSubItemQueryResultVO4Pickm)this.subItemdateCache.getMoDataMap().get(key); + param.setCbomid(bomID); + param.setDemandDate(moparam.getTplanstarttime().getDate()); + param.setCcustomerid(headVO.getCcustomerid()); + param.setCprojectid(headVO.getCprojectid()); + param.setManuTpye(Integer.valueOf(MfgTypeEnum.PRODUCTION.getEnumValue().getValue())); + param.setCbomQuery(false); + param.setPk_org(headVO.getPk_org()); + if (MMNumberUtil.isEqualZero(headVO.getNnumber())) { + param.setNnum(UFDouble.ONE_DBL); + } else { + param.setNnum(headVO.getNnumber()); + } + + param.setCsrcid(key + param.getCbomid() + param.getDemandDate() + param.getCcustomerid() + param.getCprojectid()); + return param; + } + + private BomItemQueryParamForPickm getBomQueryParamFromSc(PickmHeadVO headVO, String bomID) { + BomItemQueryParamForPickm param = new BomItemQueryParamForPickm(); + String key = headVO.getCsourcebillrowid(); + SCOrderQtyResultParamForPickm scparam = this.subItemdateCache.getScDataMap(key); + param.setCbomid(bomID); + param.setDemandDate(scparam.getDplanarrvdate()); + param.setCcustomerid(headVO.getCcustomerid()); + param.setCprojectid(headVO.getCprojectid()); + param.setManuTpye(Integer.valueOf(MfgTypeEnum.ENTRUST.getEnumValue().getValue())); + param.setCbomQuery(false); + param.setPk_org(headVO.getPk_org()); + param.setNnum(headVO.getNnumber()); + param.setCsrcid(key + param.getCbomid() + param.getDemandDate() + param.getCcustomerid() + param.getCprojectid()); + return param; + } + + private BomItemQueryParamForPickm getBomQueryParamFromHand(PickmHeadVO headVO, String bomID) { + BomItemQueryParamForPickm param = new BomItemQueryParamForPickm(); + String key = headVO.getCsourcebillrowid(); + param.setCbomid(bomID); + param.setDemandDate(AppBsContext.getInstance().getBusiDate()); + param.setCcustomerid(headVO.getCcustomerid()); + param.setCprojectid(headVO.getCprojectid()); + param.setManuTpye(Integer.valueOf(MfgTypeEnum.PRODUCTION.getEnumValue().getValue())); + param.setCbomQuery(false); + param.setPk_org(headVO.getPk_org()); + if (MMNumberUtil.isEqualZero(headVO.getNnumber())) { + param.setNnum(UFDouble.ONE_DBL); + } else { + param.setNnum(headVO.getNnumber()); + } + + param.setCsrcid(key + param.getCbomid() + param.getDemandDate() + param.getCcustomerid() + param.getCprojectid()); + return param; + } +} diff --git a/pu/src/client/nccloud/web/pu/poorder/action/PushScOrderCheck.java b/pu/src/client/nccloud/web/pu/poorder/action/PushScOrderCheck.java new file mode 100644 index 0000000..082b962 --- /dev/null +++ b/pu/src/client/nccloud/web/pu/poorder/action/PushScOrderCheck.java @@ -0,0 +1,42 @@ +package nccloud.web.pu.poorder.action; + +import nc.bs.dao.BaseDAO; +import nc.impl.pubapp.pattern.data.bill.BillQuery; +import nc.itf.scmpub.reference.uap.pf.PfServiceScmUtil; +import nc.jdbc.framework.processor.MapListProcessor; +import nc.vo.pu.m21.entity.OrderVO; +import nc.vo.pub.lang.UFBoolean; +import nc.vo.sc.m61.entity.SCOrderVO; +import nc.vo.sc.m61.entity.context.SCOrderContxt; +import nccloud.framework.core.json.IJson; +import nccloud.framework.web.action.itf.ICommonAction; +import nccloud.framework.web.container.IRequest; +import nccloud.framework.web.json.JsonFactory; +import nccloud.framework.web.ui.pattern.billcard.BillCard; +import nccloud.web.sc.scorder.entity.QueryInfoSCOrder; +import nccloud.web.sc.scorder.util.SCOrderBillCardOperator; +import nccloud.web.scmpub.pub.resexp.PfResumeExceptionNccUtils; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Map; + +public class PushScOrderCheck implements ICommonAction { + public PushScOrderCheck() { + } + public Object doAction(IRequest request) { + + String read = request.read(); + + Map paraMap = (Map) JsonFactory.create().fromJson(read, Map.class); + try { + String[] hids =paraMap.get("pk").toString().split(","); + String sql = "select csrcid from sc_order_b where dr = 0 and csrcid = '" +hids[0]+"'"; + BaseDAO dao = new BaseDAO(); + ArrayList> al = (ArrayList>)dao.executeQuery(sql, new MapListProcessor()); + return al; + } catch (Exception ex) { + return PfResumeExceptionNccUtils.handleResumeException(ex); + } + } +} diff --git a/pu/src/client/yyconfig/modules/pu/poorder/config/action/poorderhandle.xml b/pu/src/client/yyconfig/modules/pu/poorder/config/action/poorderhandle.xml index 16d3eaa..93af29f 100644 --- a/pu/src/client/yyconfig/modules/pu/poorder/config/action/poorderhandle.xml +++ b/pu/src/client/yyconfig/modules/pu/poorder/config/action/poorderhandle.xml @@ -387,5 +387,10 @@ nccloud.web.pu.poorder.action.PushScOrderAction OrderTOSaleBill + + pu.poorder.pushScOrderCheck + + nccloud.web.pu.poorder.action.PushScOrderCheck + diff --git a/pu/src/client/yyconfig/modules/pu/poorder/config/authorize/order_authorize.xml b/pu/src/client/yyconfig/modules/pu/poorder/config/authorize/order_authorize.xml index 2174cec..516f9d2 100644 --- a/pu/src/client/yyconfig/modules/pu/poorder/config/authorize/order_authorize.xml +++ b/pu/src/client/yyconfig/modules/pu/poorder/config/authorize/order_authorize.xml @@ -174,6 +174,7 @@ 401200000,401200002,401200004,401200006 pu.poorder.pushScOrderAction + pu.poorder.pushScOrderCheck