From 98c7a50769647c5adb0a57b145c3a51689379b01 Mon Sep 17 00:00:00 2001 From: lihao Date: Fri, 17 Oct 2025 16:47:37 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=9F=E4=BA=A7=E6=8A=A5=E5=91=8A=E5=9B=9E?= =?UTF-8?q?=E5=86=99=E7=94=9F=E4=BA=A7=E8=AE=A2=E5=8D=95=E5=AE=8C=E5=B7=A5?= =?UTF-8?q?=E6=95=B0=E9=87=8F=EF=BC=8C=E7=94=9F=E4=BA=A7=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E5=AE=8C=E6=88=90=E6=BA=90=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mmpac/pmo/wr/PublicPMOService4WrImpl.java | 1102 +++++++++++++++++ 1 file changed, 1102 insertions(+) create mode 100644 mmpac/src/private/nc/pubimpl/mmpac/pmo/wr/PublicPMOService4WrImpl.java diff --git a/mmpac/src/private/nc/pubimpl/mmpac/pmo/wr/PublicPMOService4WrImpl.java b/mmpac/src/private/nc/pubimpl/mmpac/pmo/wr/PublicPMOService4WrImpl.java new file mode 100644 index 00000000..124f6ade --- /dev/null +++ b/mmpac/src/private/nc/pubimpl/mmpac/pmo/wr/PublicPMOService4WrImpl.java @@ -0,0 +1,1102 @@ +// +// Source code recreated from a .class file by IntelliJ IDEA +// (powered by FernFlower decompiler) +// + +package nc.pubimpl.mmpac.pmo.wr; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import nc.bs.framework.common.NCLocator; +import nc.bs.mmpac.pmo.pac0002.bp.PMOCloseBP; +import nc.bs.mmpac.pmo.pac0002.bp.query.PMOAggVOQueryBP; +import nc.bs.mmpac.pmo.pac0002.bp.query.PMOCheckAutoCloseBP; +import nc.bs.mmpac.pmo.pac0002.bp.rewrite.PMOWrRewriteBP; +import nc.bs.mmpac.pmo.pac0002.bp.service.PMOBPService; +import nc.bs.mmpac.pmo.pac0002.bp.util.PMOBPCalUtil; +import nc.bs.mmpac.pmo.pac0002.bp.util.PMOBPUtil; +import nc.bs.mmpac.pmo.pac0002.rule.PMOATPUpdateRule; +import nc.bs.pubapp.AppBsContext; +import nc.impl.pubapp.pattern.data.vo.VOQuery; +import nc.impl.pubapp.pattern.data.vo.tool.VOConcurrentTool; +import nc.itf.uap.IUAPQueryBS; +import nc.jdbc.framework.processor.ColumnListProcessor; +import nc.mmbd.utils.factoryparam.MMBDFactoryParameter; +import nc.pubitf.mmpac.pmo.wr.IPublicPMOService4Wr; +import nc.util.mmf.busi.measure.MeasureHelper; +import nc.util.mmf.busi.measure.NumScaleUtil; +import nc.util.mmf.framework.base.MMArrayUtil; +import nc.util.mmf.framework.base.MMMapUtil; +import nc.util.mmf.framework.base.MMNumberUtil; +import nc.util.mmf.framework.base.MMValueCheck; +import nc.util.mmf.framework.db.MMSqlBuilder; +import nc.util.mmf.framework.db.MMTempTable; +import nc.util.mmf.framework.gc.GCBillTransferTool; +import nc.util.mmf.framework.gc.GCBillUpdate; +import nc.vo.mmpac.pickm.entity.PickmHeadVO; +import nc.vo.mmpac.pickm.entity.PickmItemVO; +import nc.vo.mmpac.pmo.pac0002.constant.PMOConstLang; +import nc.vo.mmpac.pmo.pac0002.entity.PMOAggVO; +import nc.vo.mmpac.pmo.pac0002.entity.PMOHeadVO; +import nc.vo.mmpac.pmo.pac0002.entity.PMOItemVO; +import nc.vo.mmpac.pmo.pac0002.entity.PMOPlanOutputVO; +import nc.vo.mmpac.pmo.pac0002.enumeration.PMOFItemStatusEnum; +import nc.vo.mmpac.pmo.parameter.CheckWrDiscardNumParam; +import nc.vo.mmpac.pmo.parameter.PMORewriteParaVO; +import nc.vo.mmpac.pmo.parameter.Param55A4To55A2; +import nc.vo.mmpac.wr.pwr.param.PwrDiscardInNumForPmo; +import nc.vo.pub.BusinessException; +import nc.vo.pub.lang.UFBoolean; +import nc.vo.pub.lang.UFDateTime; +import nc.vo.pub.lang.UFDouble; +import nc.vo.pubapp.AppContext; +import nc.vo.pubapp.pattern.exception.ExceptionUtils; +import nc.vo.pubapp.pattern.pub.MapList; +import nc.vo.util.BDPKLockUtil; + +public class PublicPMOService4WrImpl implements IPublicPMOService4Wr { + private static final String TMP_SOURCE_BID_TABLE_NAME = "tmp_mm_srcbid"; + + public PublicPMOService4WrImpl() { + } + + public void rewriteMoWrNumForWr(PMORewriteParaVO[] oldparas) throws BusinessException { + try { + if (MMArrayUtil.isEmpty(oldparas)) { + return; + } + + PMORewriteParaVO[] paras = PMOBPUtil.transferParam(oldparas); + MapList paraMapList = new MapList(); + List hidList = new ArrayList(); + + for(PMORewriteParaVO para : paras) { + paraMapList.put(para.getCpmobid(), para); + if (!hidList.contains(para.getCpmohid())) { + hidList.add(para.getCpmohid()); + } + } + + PMOAggVO[] aggvos = (new PMOAggVOQueryBP()).getPMOAggVOsByIds((String[])hidList.toArray(new String[0])); + if (MMValueCheck.isEmpty(aggvos)) { + ExceptionUtils.wrappBusinessException(PMOConstLang.getMSG_REWRITE_WRNUM_AUTOERROR()); + } + + Set originbidSet = new HashSet(); + Set bidSet = paraMapList.keySet(); + Map headMap = new HashMap(); + Map itemMap = new HashMap(); + + for(PMOAggVO aggvo : aggvos) { + PMOHeadVO headvo = aggvo.getParentVO(); + if (hidList.contains(headvo.getCpmohid())) { + headMap.put(headvo.getCpmohid(), headvo); + } + + PMOItemVO[] items = aggvo.getChildrenVO(); + if (!MMArrayUtil.isEmpty(items)) { + for(PMOItemVO item : items) { + originbidSet.add(item.getCmoid()); + if (bidSet.contains(item.getCmoid())) { + itemMap.put(item.getCmoid(), item); + } + } + } + } + + if (MMMapUtil.isEmpty(itemMap)) { + return; + } + + PMOItemVO[] items = (PMOItemVO[])itemMap.values().toArray(new PMOItemVO[0]); + + for(PMORewriteParaVO para : paras) { + if (!originbidSet.contains(para.getCpmobid())) { + ExceptionUtils.wrappBusinessException(PMOConstLang.getMSG_PMO_DeleteLine()); + } + } + + BDPKLockUtil.lockSuperVO(items); + this.checkMOstatus(items, headMap); + Set cmaterials = new HashSet(); + Set ctrantypes = new HashSet(); + Set pk_orgs = new HashSet(); + MapList sortOrgMarMap = new MapList(); + + for(PMOItemVO item : items) { + if (!cmaterials.contains(item.getCmaterialvid())) { + cmaterials.add(item.getCmaterialvid()); + } + + PMOHeadVO head = (PMOHeadVO)headMap.get(item.getCpmohid()); + if (!MMValueCheck.isEmpty(head) && !ctrantypes.contains(head.getCtrantypeid())) { + ctrantypes.add(head.getCtrantypeid()); + } + + if (!pk_orgs.contains(item.getPk_org())) { + pk_orgs.add(item.getPk_org()); + } + + sortOrgMarMap.put(item.getPk_org(), item.getCmaterialvid()); + } + + Map prodtolerance = new HashMap(); + + for(Map.Entry> entry : sortOrgMarMap.entrySet()) { + Map tempdowntolerance = PMOBPCalUtil.getProdtolerance((String)entry.getKey(), (String[])((List)entry.getValue()).toArray(new String[0])); + if (MMMapUtil.isNotEmpty(tempdowntolerance)) { + prodtolerance.putAll(tempdowntolerance); + } + } + + Map intolerance = PMOBPCalUtil.getInStockControlScope((String[])cmaterials.toArray(new String[0])); + Map autodonepara = PMOBPService.getIPMOTransTypeQueryService().getBAutoFinishByTranTypeIDs((String[])ctrantypes.toArray(new String[0])); + Map bpara = MMBDFactoryParameter.getPAC012BatchParaBoolean((String[])pk_orgs.toArray(new String[0])); + this.checkWrts(paraMapList, items); + List planoutputList = new ArrayList(); + + for(int i = 0; i < items.length; ++i) { + List paraList = paraMapList.get(items[i].getCmoid()); + PMOPlanOutputVO[] moPlanOutVOS = items[i].getPlanoutputs(); + if (!MMArrayUtil.isEmpty(moPlanOutVOS)) { + for(PMOPlanOutputVO planOutVO : moPlanOutVOS) { + boolean isupd = false; + + for(PMORewriteParaVO paravo : paraList) { + if (!MMMapUtil.isEmpty(paravo.getPoutMap())) { + UFDouble delNum = MMNumberUtil.toNotNullValue((UFDouble)paravo.getPoutMap().get(planOutVO.getCplanoutputid())); + if (MMNumberUtil.isNotNullAndNotZero(delNum)) { + (new NumScaleUtil()).checkNumberScale(new UFDouble[]{delNum}, planOutVO.getCunitid()); + } + + if (MMNumberUtil.isNotNullAndNotZero(delNum)) { + UFDouble wrNum = MMNumberUtil.add(new UFDouble[]{delNum, MMNumberUtil.toNotNullValue(planOutVO.getNwrnum())}); + planOutVO.setNwrnum(wrNum); + planOutVO.setStatus(1); + PMOBPCalUtil.fillReAssNumber("nplanoutputnum", "nastplanoutputnum", planOutVO, "vchangerate", "nwrnum", "nwrastnum"); + isupd = true; + } + } + } + + if (isupd) { + planoutputList.add(planOutVO); + } + } + } + + for(PMORewriteParaVO paravo : paraList) { + UFDouble delNum = MMNumberUtil.toNotNullValue(paravo.getDelNum()); + if (MMNumberUtil.isNotNullAndNotZero(delNum)) { + (new NumScaleUtil()).checkNumberScale(new UFDouble[]{delNum}, items[i].getCunitid()); + } + + UFDouble wrNum = MMNumberUtil.add(new UFDouble[]{delNum, MMNumberUtil.toNotNullValue(items[i].getNwrnum())}); + items[i].setNwrnum(wrNum); + PMOBPCalUtil.fillReAssNumber("nplanputnum", "nplanputastnum", items[i], "vchangerate", "nwrnum", "nwrastnum"); + items[i].setStatus(1); + } + } + + List filterList = new ArrayList(); + List putplanfinishList = new ArrayList(); + + for(PMOItemVO item : items) { + String var10001 = item.getPk_org(); + UFDouble downPara = (UFDouble)prodtolerance.get(var10001 + "#" + item.getCmaterialvid()); + UFDouble compareplanputnum = item.getNplanputnum(); + if (MMNumberUtil.isGtZero(downPara)) { + compareplanputnum = MMNumberUtil.multiply(new UFDouble[]{item.getNplanputnum(), MMNumberUtil.sub(UFDouble.ONE_DBL, new UFDouble[]{downPara.div((double)100.0F)})}); + } + + UFBoolean flag = UFBoolean.FALSE; + if (!MMMapUtil.isEmpty(bpara)) { + flag = (UFBoolean)bpara.get(item.getPk_org()); + if (null == flag) { + flag = UFBoolean.FALSE; + } + } + + if (flag.booleanValue()) { + UFDouble dpara = (UFDouble)intolerance.get(item.getCmaterialvid()); + UFDouble dparabl = UFDouble.ONE_DBL; + if (!MMValueCheck.isEmpty(bpara)) { + dparabl = MMNumberUtil.add(new UFDouble[]{UFDouble.ONE_DBL, dpara.div((double)100.0F)}); + } + + UFDouble totalputnum = MMNumberUtil.add(new UFDouble[]{item.getNplanputnum(), item.getNrejectnum()}); + if (MMNumberUtil.isLsEqual(item.getNwrnum(), MMNumberUtil.multiply(new UFDouble[]{totalputnum, dparabl}))) { + filterList.add(item); + } + + if (MMNumberUtil.isGtEqual(item.getNwrnum(), compareplanputnum) && !MMMapUtil.isEmpty(autodonepara)) { + PMOHeadVO head = (PMOHeadVO)headMap.get(item.getCpmohid()); + UFBoolean autoFlag = (UFBoolean)autodonepara.get(head.getCtrantypeid()); + if (autoFlag.booleanValue()) { + item.setFitemstatus(Integer.valueOf(PMOFItemStatusEnum.FINISH.getEnumValue().getValue())); + item.setTactendtime(new UFDateTime(AppBsContext.getInstance().getBusiDate().toPersisted())); + item.setStatus(1); + putplanfinishList.add(item.getCmoid()); + } + } + + if (MMNumberUtil.isLs(item.getNwrnum(), compareplanputnum) && item.getFitemstatus().equals(Integer.valueOf(PMOFItemStatusEnum.FINISH.getEnumValue().getValue()))) { + item.setFitemstatus(Integer.valueOf(PMOFItemStatusEnum.PUT.getEnumValue().getValue())); + item.setTactendtime((UFDateTime)null); + item.setStatus(1); + } + } else { + UFDouble divNum = MMNumberUtil.add(new UFDouble[]{item.getNzcgnum(), item.getNzwwnum()}); + divNum = MMNumberUtil.add(new UFDouble[]{divNum, item.getNzdbnum()}); + UFDouble totalWRnum = MMNumberUtil.add(new UFDouble[]{divNum, item.getNwrnum()}); + if (!MMNumberUtil.isLsZero(item.getNwrnum())) { + filterList.add(item); + } + + if (totalWRnum.doubleValue() >= compareplanputnum.doubleValue() && !MMMapUtil.isEmpty(autodonepara)) { + PMOHeadVO head = (PMOHeadVO)headMap.get(item.getCpmohid()); + UFBoolean autoFlag = (UFBoolean)autodonepara.get(head.getCtrantypeid()); + if (autoFlag.booleanValue()) { + item.setFitemstatus(Integer.valueOf(PMOFItemStatusEnum.FINISH.getEnumValue().getValue())); + item.setTactendtime(new UFDateTime(AppBsContext.getInstance().getBusiDate().toPersisted())); + item.setStatus(1); + putplanfinishList.add(item.getCmoid()); + } + } + + if (totalWRnum.doubleValue() < compareplanputnum.doubleValue() && item.getFitemstatus().equals(Integer.valueOf(PMOFItemStatusEnum.FINISH.getEnumValue().getValue()))) { + item.setFitemstatus(Integer.valueOf(PMOFItemStatusEnum.PUT.getEnumValue().getValue())); + item.setTactendtime((UFDateTime)null); + item.setStatus(1); + } + } + } + + List allList = Arrays.asList(items); + if (allList.size() - filterList.size() != 0) { + ExceptionUtils.wrappBusinessException(PMOConstLang.getMSG_REWRITE_PARANUMERROR()); + } + + GCBillTransferTool transferTool = new GCBillTransferTool(aggvos); + PMOAggVO[] originBills = (PMOAggVO[])transferTool.getOriginBills(); + GCBillUpdate billupdate = new GCBillUpdate(); + PMOAggVO[] newvos = (PMOAggVO[])billupdate.update(aggvos, originBills); + this.finishPutplan(putplanfinishList); + } catch (Exception e) { + ExceptionUtils.marsh(e); + } + + } + + private void finishPutplan(List itemidList) { + if (!MMValueCheck.isEmpty(itemidList)) { + try { + PMOBPService.getPutPlanService4Pmo().setPutPlanComplete4Pmo((String[])itemidList.toArray(new String[0])); + } catch (BusinessException e) { + ExceptionUtils.wrappException(e); + } + + } + } + + public void rewriteMOInNumForWr(PMORewriteParaVO[] oldparas) throws BusinessException { + try { + if (MMArrayUtil.isEmpty(oldparas)) { + return; + } + + PMORewriteParaVO[] paras = PMOBPUtil.transferParam(oldparas); + MapList paraMapList = new MapList(); + List hidList = new ArrayList(); + + for(PMORewriteParaVO para : paras) { + paraMapList.put(para.getCpmobid(), para); + if (!hidList.contains(para.getCpmohid())) { + hidList.add(para.getCpmohid()); + } + } + + PMOAggVO[] aggvos = (new PMOAggVOQueryBP()).getPMOAggVOsByIds((String[])hidList.toArray(new String[0])); + Set bidSet = paraMapList.keySet(); + Map headMap = new HashMap(); + Map itemMap = new HashMap(); + + for(PMOAggVO aggvo : aggvos) { + PMOHeadVO headvo = aggvo.getParentVO(); + if (hidList.contains(headvo.getCpmohid())) { + headMap.put(headvo.getCpmohid(), headvo); + } + + PMOItemVO[] items = aggvo.getChildrenVO(); + if (!MMArrayUtil.isEmpty(items)) { + for(PMOItemVO item : items) { + if (bidSet.contains(item.getCmoid())) { + itemMap.put(item.getCmoid(), item); + } + } + } + } + + if (MMMapUtil.isEmpty(itemMap)) { + return; + } + + PMOItemVO[] items = (PMOItemVO[])itemMap.values().toArray(new PMOItemVO[0]); + this.checkMOstatus(items, headMap); + List planoutputvos = new ArrayList(); + Set closeItemIds = new HashSet(); + Map autoMap = (new PMOCheckAutoCloseBP()).getAutoCloseMap(aggvos); + + for(PMOItemVO item : items) { + List paraList = paraMapList.get(item.getCmoid()); + if (paraList.size() != 0) { + PMORewriteParaVO[] paraVO = (PMORewriteParaVO[])paraList.toArray(new PMORewriteParaVO[0]); + PMOPlanOutputVO[] moPlanOutVOS = item.getPlanoutputs(); + if (!MMArrayUtil.isEmpty(moPlanOutVOS)) { + for(PMOPlanOutputVO planOutVO : moPlanOutVOS) { + UFDouble delNum = UFDouble.ZERO_DBL; + if (!MMArrayUtil.isEmpty(paraVO)) { + for(int i = 0; i < paraVO.length; ++i) { + if (MMMapUtil.isNotEmpty(paraVO[i].getPoutMap())) { + delNum = MMNumberUtil.add(new UFDouble[]{(UFDouble)paraVO[i].getPoutMap().get(planOutVO.getCplanoutputid()), delNum}); + } + } + + if (MMNumberUtil.isNotNullAndNotZero(delNum)) { + (new NumScaleUtil()).checkNumberScale(new UFDouble[]{delNum}, planOutVO.getCunitid()); + } + + planOutVO.setNinnum(MMNumberUtil.add(new UFDouble[]{delNum, planOutVO.getNinnum()})); + PMOBPCalUtil.fillReAssNumber("nplanoutputnum", "nastplanoutputnum", planOutVO, "vchangerate", "ninnum", "ninastnum"); + planOutVO.setStatus(1); + planoutputvos.add(planOutVO); + } + } + + if (autoMap.containsKey(moPlanOutVOS[0].getCmoid())) { + String autoClose = (String)autoMap.get(moPlanOutVOS[0].getCmoid()); + String newautoClose = "Y"; + + for(PMOPlanOutputVO planOutVO : moPlanOutVOS) { + if (MMNumberUtil.isGt(planOutVO.getNwrnum(), planOutVO.getNinnum())) { + newautoClose = "N"; + } + } + + if (!newautoClose.equals(autoClose)) { + autoMap.put(moPlanOutVOS[0].getCmoid(), newautoClose); + } + } + } + + UFDouble delNum = UFDouble.ZERO_DBL; + if (!MMArrayUtil.isEmpty(paraVO)) { + for(int i = 0; i < paraVO.length; ++i) { + delNum = MMNumberUtil.add(new UFDouble[]{paraVO[i].getDelNum(), delNum}); + } + + if (MMNumberUtil.isNotNullAndNotZero(delNum)) { + (new NumScaleUtil()).checkNumberScale(new UFDouble[]{delNum}, item.getCunitid()); + } + + item.setNinnum(MMNumberUtil.add(new UFDouble[]{item.getNinnum(), delNum})); + PMOBPCalUtil.fillReAssNumber("nplanputnum", "nplanputastnum", item, "vchangerate", "ninnum", "ninastnum"); + UFDouble tempdbl = MMNumberUtil.add(new UFDouble[]{item.getNinnum(), item.getNrebillnum(), item.getNrwbillnum()}); + if (autoMap.containsKey(item.getCmoid()) && ((String)autoMap.get(item.getCmoid())).equals("Y")) { + item.setFitemstatus(Integer.valueOf(PMOFItemStatusEnum.CLOSE.getEnumValue().getValue())); + item.setMocloser(AppContext.getInstance().getPkUser()); + item.setTmoclosedtime(new UFDateTime(AppContext.getInstance().getBusiDate().toPersisted())); + closeItemIds.add(item.getCmoid()); + } + + if (MMNumberUtil.isLs(tempdbl, item.getNwrnum()) && PMOFItemStatusEnum.CLOSE.equalsValue(item.getFitemstatus())) { + item.setFitemstatus(Integer.valueOf(PMOFItemStatusEnum.FINISH.getEnumValue().getValue())); + item.setMocloser((String)null); + item.setTmoclosedtime((UFDateTime)null); + } + + item.setStatus(1); + } + } + } + + GCBillTransferTool transferTool = new GCBillTransferTool(aggvos); + PMOAggVO[] originBills = (PMOAggVO[])transferTool.getOriginBills(); + GCBillUpdate billupdate = new GCBillUpdate(); + PMOAggVO[] newvos = (PMOAggVO[])billupdate.update(aggvos, originBills); + (new PMOCloseBP()).colseAfterRuleProcesser(closeItemIds, newvos, originBills, true); + } catch (Exception e) { + ExceptionUtils.marsh(e); + } + + } + + public void rewriteMORwNumForWr(PMORewriteParaVO[] oldparas) throws BusinessException { + if (!MMArrayUtil.isEmpty(oldparas)) { + try { + PMORewriteParaVO[] paras = PMOBPUtil.transferParam(oldparas); + MapList paraMapList = new MapList(); + List hidList = new ArrayList(); + + for(PMORewriteParaVO para : paras) { + paraMapList.put(para.getCpmobid(), para); + if (!hidList.contains(para.getCpmohid())) { + hidList.add(para.getCpmohid()); + } + } + + PMOAggVO[] aggvos = (new PMOAggVOQueryBP()).getPMOAggVOsByIds((String[])hidList.toArray(new String[0])); + (new PMOATPUpdateRule(true, "55A2")).process(aggvos); + Set bidSet = paraMapList.keySet(); + Map itemMap = new HashMap(); + Map headMap = new HashMap(); + + for(PMOAggVO aggvo : aggvos) { + PMOHeadVO headvo = aggvo.getParentVO(); + headMap.put(headvo.getCpmohid(), headvo); + PMOItemVO[] items = aggvo.getChildrenVO(); + if (!MMArrayUtil.isEmpty(items)) { + for(PMOItemVO item : items) { + if (bidSet.contains(item.getCmoid())) { + itemMap.put(item.getCmoid(), item); + } + } + } + } + + if (MMMapUtil.isEmpty(itemMap)) { + return; + } + + PMOItemVO[] items = (PMOItemVO[])itemMap.values().toArray(new PMOItemVO[0]); + + for(PMOItemVO item : items) { + List paraList = paraMapList.get(item.getCmoid()); + if (paraList.size() != 0) { + PMORewriteParaVO[] paraVO = (PMORewriteParaVO[])paraList.toArray(new PMORewriteParaVO[0]); + UFDouble delNum = UFDouble.ZERO_DBL; + if (!MMArrayUtil.isEmpty(paraVO)) { + for(int i = 0; i < paraVO.length; ++i) { + delNum = MMNumberUtil.add(new UFDouble[]{paraVO[i].getDelNum(), delNum}); + } + + if (MMNumberUtil.isNotNullAndNotZero(delNum)) { + (new NumScaleUtil()).checkNumberScale(new UFDouble[]{delNum}, item.getCunitid()); + } + + item.setNrwnum(MMNumberUtil.add(new UFDouble[]{item.getNrwnum(), delNum})); + if (MMNumberUtil.isLs(item.getNrwnum(), MMNumberUtil.add(new UFDouble[]{item.getNrwbillnum(), item.getNrejectnum()}))) { + String vbillcode = ((PMOHeadVO)headMap.get(item.getCpmohid())).getVbillcode(); + String vrowno = item.getVrowno(); + ExceptionUtils.wrappBusinessException(PMOConstLang.getMSG_REWRITE_RWNUM(vbillcode, vrowno)); + } + + item.setNrwastnum(MeasureHelper.getAssNum(item.getNrwnum(), item.getVchangerate())); + item.setStatus(1); + } + } + } + + GCBillTransferTool transferTool = new GCBillTransferTool(aggvos); + PMOAggVO[] originBills = (PMOAggVO[])transferTool.getOriginBills(); + GCBillUpdate billupdate = new GCBillUpdate(); + PMOAggVO[] newvos = (PMOAggVO[])billupdate.update(aggvos, originBills); + (new PMOATPUpdateRule(false, "55A2")).process(newvos); + } catch (Exception e) { + ExceptionUtils.marsh(e); + } + + } + } + + public PMOItemVO[] getPlanOutInfoForWr(String[] itemids) throws BusinessException { + try { + if (MMArrayUtil.isEmpty(itemids)) { + return null; + } else { + VOQuery itemquery = new VOQuery(PMOItemVO.class); + PMOItemVO[] items = (PMOItemVO[])itemquery.query(itemids); + if (MMArrayUtil.isEmpty(items)) { + return null; + } else { + MMSqlBuilder sql = new MMSqlBuilder(); + sql.append(" and "); + sql.append("cmoid", itemids); + VOQuery planoutquery = new VOQuery(PMOPlanOutputVO.class); + PMOPlanOutputVO[] planouts = (PMOPlanOutputVO[])planoutquery.query(sql.toString(), (String)null); + MapList planoutMapList = new MapList(); + if (!MMArrayUtil.isEmpty(planouts)) { + for(PMOPlanOutputVO planout : planouts) { + planoutMapList.put(planout.getCmoid(), planout); + } + } + + for(PMOItemVO item : items) { + List planoutList = planoutMapList.get(item.getCmoid()); + if (planoutList != null && planoutList.size() > 0) { + item.setPlanoutputs((PMOPlanOutputVO[])planoutList.toArray(new PMOPlanOutputVO[planoutList.size()])); + } + } + + return items; + } + } + } catch (Exception e) { + ExceptionUtils.marsh(e); + return null; + } + } + + private void checkMOstatus(PMOItemVO[] items, Map headMap) { + if (!MMArrayUtil.isEmpty(items)) { + StringBuilder msg = new StringBuilder(""); + + for(PMOItemVO item : items) { + if (PMOFItemStatusEnum.PLAN.equalsValue(item.getFitemstatus()) || PMOFItemStatusEnum.AUDIT.equalsValue(item.getFitemstatus())) { + PMOHeadVO head = (PMOHeadVO)headMap.get(item.getCpmohid()); + String vbillcode = ""; + String vrowno = ""; + if (!MMValueCheck.isEmpty(head)) { + vbillcode = head.getVbillcode(); + vrowno = item.getVrowno(); + } + + msg.append(PMOConstLang.getMSG_REWRITE_WRNUM_AUTOERROR(vbillcode, vrowno)).append("\n"); + } + + if (PMOFItemStatusEnum.CLOSE.equalsValue(item.getFitemstatus())) { + PMOHeadVO head = (PMOHeadVO)headMap.get(item.getCpmohid()); + String vbillcode = ""; + String vrowno = ""; + if (!MMValueCheck.isEmpty(head)) { + vbillcode = head.getVbillcode(); + vrowno = item.getVrowno(); + } + + msg.append(PMOConstLang.getMSG_REWRITE_WRNUM_CLOSEERROR(vbillcode, vrowno)).append("\n"); + } + } + + if (msg.length() > 0) { + ExceptionUtils.wrappBusinessException(msg.toString()); + } + } + + } + + private void checkWrts(MapList mapList, PMOItemVO[] vos) { + if (MMValueCheck.isEmpty(mapList) || MMArrayUtil.isEmpty(vos)) { + ExceptionUtils.wrappBusinessException(PMOConstLang.getMSG_REWRITE_PARAERROR()); + } + + MapList paraList = new MapList(); + List itemList = new ArrayList(); + + for(int i = 0; i < vos.length; ++i) { + List paraListByid = mapList.get(vos[i].getCmoid()); + if (2 == ((PMORewriteParaVO)paraListByid.get(0)).getBillStatus() && !MMValueCheck.isEmpty(((PMORewriteParaVO)paraListByid.get(0)).getBillTs())) { + paraList.putAll(vos[i].getCmoid(), paraListByid); + itemList.add(vos[i]); + } + } + + if (paraList.size() > 0) { + PMOItemVO[] newvos = (PMOItemVO[])itemList.toArray(new PMOItemVO[0]); + PMOItemVO[] originalVOs = this.construcnVOs(paraList, newvos); + (new VOConcurrentTool()).checkTS(newvos, originalVOs); + } + } + + private PMOItemVO[] construcnVOs(MapList paraMapList, PMOItemVO[] vos) { + List itemList = new ArrayList(); + + for(int i = 0; i < vos.length; ++i) { + List paraListByid = paraMapList.get(vos[i].getCmoid()); + PMOItemVO vo = new PMOItemVO(); + vo.setTs(((PMORewriteParaVO)paraListByid.get(0)).getBillTs()); + vo.setPrimaryKey(vos[i].getPrimaryKey()); + itemList.add(vo); + } + + return (PMOItemVO[])itemList.toArray(new PMOItemVO[itemList.size()]); + } + + public Map filterDelieveredMo(String[] moids) throws BusinessException { + try { + IUAPQueryBS service = (IUAPQueryBS)NCLocator.getInstance().lookup(IUAPQueryBS.class); + StringBuilder sql = new StringBuilder(); + sql.append(" select ").append("csourcebillid").append(" from ").append(PickmHeadVO.getDefaultTableName()).append(" inner join ").append(PickmItemVO.getDefaultTableName()).append(" on ").append(PickmHeadVO.getDefaultTableName()).append(".").append("cpickmid").append("=").append(PickmItemVO.getDefaultTableName()).append(".").append("cpickmid").append(" where ").append("vsourcebilltype").append("='55A2'").append(" and ").append(MMTempTable.getWhereInSQL("tmp_mm_srcbid", moids, "csourcebillid")); + StringBuilder sql1 = sql.append(" and ").append(PickmItemVO.getDefaultTableName()).append(".").append("naccoutnum").append(">0").append(" and ").append(PickmItemVO.getDefaultTableName()).append(".").append("bbackflush").append("='N'"); + List doutMoids = (List)service.executeQuery(sql1.toString(), new ColumnListProcessor()); + StringBuilder sql2 = sql.append(" and ").append(PickmItemVO.getDefaultTableName()).append(".").append("bbackflush").append("='Y'"); + List transMoids = (List)service.executeQuery(sql2.toString(), new ColumnListProcessor()); + doutMoids.addAll(transMoids); + Map returnmap = new HashMap(); + + for(String moid : moids) { + if (doutMoids.contains(moid)) { + returnmap.put(moid, UFBoolean.TRUE); + } else { + returnmap.put(moid, UFBoolean.FALSE); + } + } + + return returnmap; + } catch (Exception e) { + ExceptionUtils.marsh(e); + return null; + } + } + + public Map filterFinishedMo(String[] moids) throws BusinessException { + try { + IUAPQueryBS service = (IUAPQueryBS)NCLocator.getInstance().lookup(IUAPQueryBS.class); + StringBuilder sql = new StringBuilder(); + sql.append("select ").append("cmoid").append(" from ").append((new PMOItemVO()).getTableName()).append(" where ").append(MMTempTable.getWhereInSQL("tmp_mm_srcbid", moids, "cmoid")).append(" and ").append("fitemstatus").append("=").append(PMOFItemStatusEnum.FINISH.value()); + List finishedMoIds = (List)service.executeQuery(sql.toString(), new ColumnListProcessor()); + Map moStatus = new HashMap(); + if (!MMValueCheck.isEmpty(finishedMoIds)) { + for(String itemid : moids) { + if (finishedMoIds.contains(itemid)) { + moStatus.put(itemid, UFBoolean.TRUE); + } else { + moStatus.put(itemid, UFBoolean.FALSE); + } + } + + return moStatus; + } else { + for(String itemid : moids) { + moStatus.put(itemid, UFBoolean.FALSE); + } + + return moStatus; + } + } catch (Exception e) { + ExceptionUtils.marsh(e); + return null; + } + } + + public Map getNrwNum(String[] moids) throws BusinessException { + try { + VOQuery sevice = new VOQuery(PMOItemVO.class, new String[]{"cpmohid", "cmoid", "nrwnum", "nrwbillnum", "nplanputnum", "nmmnum"}); + PMOItemVO[] items = (PMOItemVO[])sevice.query(moids); + Map resultMap = new HashMap(); + + for(int i = 0; i < items.length; ++i) { + PwrDiscardInNumForPmo numVO = new PwrDiscardInNumForPmo(); + numVO.setPmoDiscardInNum(items[i].getNrwnum()); + numVO.setPmoDiscardInWrNum(items[i].getNrwbillnum()); + numVO.setPmoPlanNum(items[i].getNplanputnum()); + numVO.setPmoPlanOutNum(items[i].getNmmnum()); + resultMap.put(items[i].getCmoid(), numVO); + } + + return resultMap; + } catch (Exception e) { + ExceptionUtils.marsh(e); + return null; + } + } + + public Map getBomIDByBid(String[] itemids) throws BusinessException { + try { + if (MMArrayUtil.isEmpty(itemids)) { + return null; + } else { + VOQuery itemquery = new VOQuery(PMOItemVO.class, new String[]{"cmoid", "cbomversionid"}); + PMOItemVO[] items = (PMOItemVO[])itemquery.query(itemids); + if (MMArrayUtil.isEmpty(items)) { + return null; + } else { + Map rtnMap = new HashMap(); + + for(PMOItemVO item : items) { + rtnMap.put(item.getCmoid(), item.getCbomversionid()); + } + + return rtnMap; + } + } + } catch (Exception e) { + ExceptionUtils.marsh(e); + return null; + } + } + + public Map checkDeleteSrcWr(String[] gids) throws BusinessException { + try { + if (MMArrayUtil.isEmpty(gids)) { + return null; + } else { + VOQuery itemquery = new VOQuery(PMOItemVO.class, new String[]{"vsrcbid"}); + MMSqlBuilder sql = new MMSqlBuilder(); + sql.append(" and "); + sql.append("vsrcbid", gids); + PMOItemVO[] items = (PMOItemVO[])itemquery.query(sql.toString(), (String)null); + if (MMArrayUtil.isEmpty(items)) { + return null; + } else { + Map rtnMap = new HashMap(); + + for(PMOItemVO item : items) { + rtnMap.put(item.getVsrcbid(), UFBoolean.TRUE); + } + + for(String gid : gids) { + if (!rtnMap.containsKey(gid)) { + rtnMap.put(gid, UFBoolean.FALSE); + } + } + + return rtnMap; + } + } + } catch (Exception e) { + ExceptionUtils.marsh(e); + return null; + } + } + + public Map checkUpdateDisCardNum(CheckWrDiscardNumParam[] wrUpdateParam) throws BusinessException { + try { + if (MMArrayUtil.isEmpty(wrUpdateParam)) { + return null; + } else { + VOQuery itemquery = new VOQuery(PMOItemVO.class, new String[]{"vsrcbid", "nmmnum"}); + Map wrmap = new HashMap(); + + for(CheckWrDiscardNumParam param : wrUpdateParam) { + wrmap.put(param.getBid(), param.getNnum()); + } + + MMSqlBuilder sql = new MMSqlBuilder(); + sql.append(" and "); + sql.append("vsrcbid", (String[])wrmap.keySet().toArray(new String[wrmap.keySet().size()])); + PMOItemVO[] items = (PMOItemVO[])itemquery.query(sql.toString(), (String)null); + if (MMArrayUtil.isEmpty(items)) { + return null; + } else { + Map numMap = new HashMap(); + + for(PMOItemVO item : items) { + if (!numMap.containsKey(item.getVsrcbid())) { + numMap.put(item.getVsrcbid(), item.getNmmnum()); + } else { + UFDouble tempNum = (UFDouble)numMap.get(item.getVsrcbid()); + numMap.put(item.getVsrcbid(), MMNumberUtil.add(new UFDouble[]{tempNum, item.getNmmnum()})); + } + } + + Map rtnMap = new HashMap(); + + for(String bid : wrmap.keySet()) { + UFDouble wrnum = (UFDouble)wrmap.get(bid); + if (MMNumberUtil.isGtEqual(wrnum, (UFDouble)numMap.get(bid))) { + rtnMap.put(bid, UFBoolean.FALSE); + } else { + rtnMap.put(bid, UFBoolean.TRUE); + } + } + + return rtnMap; + } + } + } catch (Exception e) { + ExceptionUtils.marsh(e); + return null; + } + } + + public void rewriteMoWrNumForWrME(PMORewriteParaVO[] oldparas) throws BusinessException { + try { + if (MMArrayUtil.isEmpty(oldparas)) { + return; + } + + PMORewriteParaVO[] paras = PMOBPUtil.transferParam(oldparas); + MapList paraMapList = new MapList(); + List hidList = new ArrayList(); + + for(PMORewriteParaVO para : paras) { + paraMapList.put(para.getCpmobid(), para); + if (!hidList.contains(para.getCpmohid())) { + hidList.add(para.getCpmohid()); + } + } + + PMOAggVO[] aggvos = (new PMOAggVOQueryBP()).getPMOAggVOsByIds((String[])hidList.toArray(new String[0])); + Set bidSet = paraMapList.keySet(); + Map headMap = new HashMap(); + Map itemMap = new HashMap(); + + for(PMOAggVO aggvo : aggvos) { + PMOHeadVO headvo = aggvo.getParentVO(); + if (hidList.contains(headvo.getCpmohid())) { + headMap.put(headvo.getCpmohid(), headvo); + } + + PMOItemVO[] items = aggvo.getChildrenVO(); + if (!MMArrayUtil.isEmpty(items)) { + for(PMOItemVO item : items) { + if (bidSet.contains(item.getCmoid())) { + itemMap.put(item.getCmoid(), item); + } + } + } + } + + if (MMMapUtil.isEmpty(itemMap)) { + return; + } + + PMOItemVO[] items = (PMOItemVO[])itemMap.values().toArray(new PMOItemVO[0]); + BDPKLockUtil.lockSuperVO(items); + this.checkMOstatus(items, headMap); + Set cmaterials = new HashSet(); + Set ctrantypes = new HashSet(); + Set pk_orgs = new HashSet(); + + for(PMOItemVO item : items) { + if (!cmaterials.contains(item.getCmaterialvid())) { + cmaterials.add(item.getCmaterialvid()); + } + + PMOHeadVO head = (PMOHeadVO)headMap.get(item.getCpmohid()); + if (!MMValueCheck.isEmpty(head) && !ctrantypes.contains(head.getCtrantypeid())) { + ctrantypes.add(head.getCtrantypeid()); + } + + if (!pk_orgs.contains(item.getPk_org())) { + pk_orgs.add(item.getPk_org()); + } + } + + Map intolerance = PMOBPCalUtil.getInStockControlScope((String[])cmaterials.toArray(new String[0])); + Map autodonepara = PMOBPService.getIPMOTransTypeQueryService().getBAutoFinishByTranTypeIDs((String[])ctrantypes.toArray(new String[0])); + Map bpara = MMBDFactoryParameter.getPAC012BatchParaBoolean((String[])pk_orgs.toArray(new String[0])); + PMOHeadVO[] headvos = (PMOHeadVO[])headMap.values().toArray(new PMOHeadVO[0]); + this.checkWrts(paraMapList, items); + List planoutputList = new ArrayList(); + + for(int i = 0; i < items.length; ++i) { + List paraList = paraMapList.get(items[i].getCmoid()); + PMOPlanOutputVO[] moPlanOutVOS = items[i].getPlanoutputs(); + if (!MMArrayUtil.isEmpty(moPlanOutVOS)) { + for(PMOPlanOutputVO planOutVO : moPlanOutVOS) { + boolean isupd = false; + + for(PMORewriteParaVO paravo : paraList) { + if (!MMMapUtil.isEmpty(paravo.getPoutMap())) { + UFDouble delNum = MMNumberUtil.toNotNullValue((UFDouble)paravo.getPoutMap().get(planOutVO.getCplanoutputid())); + if (MMNumberUtil.isNotNullAndNotZero(delNum)) { + (new NumScaleUtil()).checkNumberScale(new UFDouble[]{delNum}, planOutVO.getCunitid()); + } + + if (MMNumberUtil.isNotNullAndNotZero(delNum)) { + UFDouble wrNum = MMNumberUtil.add(new UFDouble[]{delNum, MMNumberUtil.toNotNullValue(planOutVO.getNwrnum())}); + planOutVO.setNwrnum(wrNum); + planOutVO.setStatus(1); + PMOBPCalUtil.fillReAssNumber("nplanoutputnum", "nastplanoutputnum", planOutVO, "vchangerate", "nwrnum", "nwrastnum"); + isupd = true; + } + } + } + + if (isupd) { + planoutputList.add(planOutVO); + } + } + } + + for(PMORewriteParaVO paravo : paraList) { + UFDouble delNum = MMNumberUtil.toNotNullValue(paravo.getDelNum()); + if (MMNumberUtil.isNotNullAndNotZero(delNum)) { + (new NumScaleUtil()).checkNumberScale(new UFDouble[]{delNum}, items[i].getCunitid()); + } + + UFDouble wrNum = MMNumberUtil.add(new UFDouble[]{delNum, MMNumberUtil.toNotNullValue(items[i].getNwrnum())}); + items[i].setNwrnum(wrNum); + PMOBPCalUtil.fillReAssNumber("nplanputnum", "nplanputastnum", items[i], "vchangerate", "nwrnum", "nwrastnum"); + items[i].setStatus(1); + } + } + + List filterList = new ArrayList(); + new ArrayList(); + + for(PMOItemVO item : items) { + UFBoolean flag = UFBoolean.FALSE; + if (!MMMapUtil.isEmpty(bpara)) { + flag = (UFBoolean)bpara.get(item.getPk_org()); + if (null == flag) { + flag = UFBoolean.FALSE; + } + } + + if (flag.booleanValue()) { + UFDouble dpara = (UFDouble)intolerance.get(item.getCmaterialvid()); + UFDouble dparabl = UFDouble.ONE_DBL; + if (!MMValueCheck.isEmpty(bpara)) { + dparabl = MMNumberUtil.add(new UFDouble[]{UFDouble.ONE_DBL, dpara.div((double)100.0F)}); + } + + UFDouble totalputnum = MMNumberUtil.add(new UFDouble[]{item.getNplanputnum(), item.getNrejectnum()}); + if (MMNumberUtil.isLsEqual(item.getNwrnum(), MMNumberUtil.multiply(new UFDouble[]{totalputnum, dparabl}))) { + filterList.add(item); + } + + if (MMNumberUtil.isLs(item.getNwrnum(), item.getNplanputnum()) && item.getFitemstatus().equals(Integer.valueOf(PMOFItemStatusEnum.FINISH.getEnumValue().getValue()))) { + item.setFitemstatus(Integer.valueOf(PMOFItemStatusEnum.PUT.getEnumValue().getValue())); + item.setTactendtime((UFDateTime)null); + item.setStatus(1); + } + } else { + UFDouble divNum = MMNumberUtil.add(new UFDouble[]{item.getNzcgnum(), item.getNzwwnum()}); + divNum = MMNumberUtil.add(new UFDouble[]{divNum, item.getNzdbnum()}); + UFDouble totalWRnum = MMNumberUtil.add(new UFDouble[]{divNum, item.getNwrnum()}); + if (!MMNumberUtil.isLsZero(item.getNwrnum())) { + filterList.add(item); + } + + if (totalWRnum.doubleValue() < item.getNplanputnum().doubleValue() && item.getFitemstatus().equals(Integer.valueOf(PMOFItemStatusEnum.FINISH.getEnumValue().getValue()))) { + item.setFitemstatus(Integer.valueOf(PMOFItemStatusEnum.PUT.getEnumValue().getValue())); + item.setTactendtime((UFDateTime)null); + item.setStatus(1); + } + } + } + + GCBillTransferTool transferTool = new GCBillTransferTool(aggvos); + PMOAggVO[] originBills = (PMOAggVO[])transferTool.getOriginBills(); + GCBillUpdate billupdate = new GCBillUpdate(); + PMOAggVO[] var61 = (PMOAggVO[])billupdate.update(aggvos, originBills); + } catch (Exception e) { + ExceptionUtils.marsh(e); + } + + } + + public void rewriteMOInNumForWrME(PMORewriteParaVO[] oldparas) throws BusinessException { + try { + if (MMArrayUtil.isEmpty(oldparas)) { + return; + } + + PMORewriteParaVO[] paras = PMOBPUtil.transferParam(oldparas); + MapList paraMapList = new MapList(); + List hidList = new ArrayList(); + + for(PMORewriteParaVO para : paras) { + paraMapList.put(para.getCpmobid(), para); + if (!hidList.contains(para.getCpmohid())) { + hidList.add(para.getCpmohid()); + } + } + + PMOAggVO[] aggvos = (new PMOAggVOQueryBP()).getPMOAggVOsByIds((String[])hidList.toArray(new String[0])); + Set bidSet = paraMapList.keySet(); + Map headMap = new HashMap(); + Map itemMap = new HashMap(); + + for(PMOAggVO aggvo : aggvos) { + PMOHeadVO headvo = aggvo.getParentVO(); + if (hidList.contains(headvo.getCpmohid())) { + headMap.put(headvo.getCpmohid(), headvo); + } + + PMOItemVO[] items = aggvo.getChildrenVO(); + if (!MMArrayUtil.isEmpty(items)) { + for(PMOItemVO item : items) { + if (bidSet.contains(item.getCmoid())) { + itemMap.put(item.getCmoid(), item); + } + } + } + } + + if (MMMapUtil.isEmpty(itemMap)) { + return; + } + + PMOItemVO[] items = (PMOItemVO[])itemMap.values().toArray(new PMOItemVO[0]); + this.checkMOstatus(items, headMap); + List planoutputvos = new ArrayList(); + + for(PMOItemVO item : items) { + List paraList = paraMapList.get(item.getCmoid()); + if (paraList.size() != 0) { + PMORewriteParaVO[] paraVO = (PMORewriteParaVO[])paraList.toArray(new PMORewriteParaVO[0]); + PMOPlanOutputVO[] moPlanOutVOS = item.getPlanoutputs(); + if (!MMArrayUtil.isEmpty(moPlanOutVOS)) { + for(PMOPlanOutputVO planOutVO : moPlanOutVOS) { + UFDouble delNum = UFDouble.ZERO_DBL; + if (!MMArrayUtil.isEmpty(paraVO)) { + for(int i = 0; i < paraVO.length; ++i) { + if (MMMapUtil.isNotEmpty(paraVO[i].getPoutMap())) { + delNum = MMNumberUtil.add(new UFDouble[]{(UFDouble)paraVO[i].getPoutMap().get(planOutVO.getCplanoutputid()), delNum}); + } + } + + if (MMNumberUtil.isNotNullAndNotZero(delNum)) { + (new NumScaleUtil()).checkNumberScale(new UFDouble[]{delNum}, planOutVO.getCunitid()); + } + + planOutVO.setNinnum(MMNumberUtil.add(new UFDouble[]{delNum, planOutVO.getNinnum()})); + PMOBPCalUtil.fillReAssNumber("nplanoutputnum", "nastplanoutputnum", planOutVO, "vchangerate", "ninnum", "ninastnum"); + planOutVO.setStatus(1); + planoutputvos.add(planOutVO); + } + } + } + + UFDouble delNum = UFDouble.ZERO_DBL; + if (!MMArrayUtil.isEmpty(paraVO)) { + for(int i = 0; i < paraVO.length; ++i) { + delNum = MMNumberUtil.add(new UFDouble[]{paraVO[i].getDelNum(), delNum}); + } + + if (MMNumberUtil.isNotNullAndNotZero(delNum)) { + (new NumScaleUtil()).checkNumberScale(new UFDouble[]{delNum}, item.getCunitid()); + } + + item.setNinnum(MMNumberUtil.add(new UFDouble[]{item.getNinnum(), delNum})); + PMOBPCalUtil.fillReAssNumber("nplanputnum", "nplanputastnum", item, "vchangerate", "ninnum", "ninastnum"); + UFDouble tempdbl = MMNumberUtil.add(new UFDouble[]{item.getNinnum(), item.getNrebillnum(), item.getNrwbillnum()}); + if (MMNumberUtil.isLs(tempdbl, item.getNmmnum()) && PMOFItemStatusEnum.CLOSE.equalsValue(item.getFitemstatus())) { + item.setFitemstatus(Integer.valueOf(PMOFItemStatusEnum.FINISH.getEnumValue().getValue())); + item.setMocloser((String)null); + item.setTmoclosedtime((UFDateTime)null); + } + + item.setStatus(1); + } + } + } + + GCBillTransferTool transferTool = new GCBillTransferTool(aggvos); + PMOAggVO[] originBills = (PMOAggVO[])transferTool.getOriginBills(); + GCBillUpdate billupdate = new GCBillUpdate(); + PMOAggVO[] var38 = (PMOAggVO[])billupdate.update(aggvos, originBills); + } catch (Exception e) { + ExceptionUtils.marsh(e); + } + + } + + public PMOAggVO[] rewriteNrejectnum(Param55A4To55A2[] params) throws BusinessException { + try { + PMOWrRewriteBP wrRewriteBP = new PMOWrRewriteBP(); + return wrRewriteBP.rewritePMOWrRejectNum(params); + } catch (Exception e) { + ExceptionUtils.marsh(e); + return null; + } + } +}