From dc913b0687c48fb83e9d0809992ef132f048258b Mon Sep 17 00:00:00 2001 From: mzr <1562242162@qq.com> Date: Thu, 27 Mar 2025 11:32:01 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=88=E5=B9=B6=E5=A4=87=E6=96=99=E8=AE=A1?= =?UTF-8?q?=E5=88=92=E7=94=9F=E6=88=90=E5=87=BA=E5=BA=93=E7=94=B3=E8=AF=B7?= =?UTF-8?q?=E5=8D=95-2005=E9=80=82=E9=85=8D2312?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ic/META-INF/ictk.upm | 10 + .../action/QueryPickmFor4455Action.java | 109 ++++++++ .../action/TransToSapplyBill1Action.java | 48 ++++ .../ic/outbound/config/action/sapplybill.xml | 110 ++++++++ .../config/authorize/sapplybill_authorize.xml | 27 ++ .../nc/bs/pub/action/N_4455_WRITE.java | 148 +++++++++++ .../OutboundTransferVoServiceImpl1.java | 243 ++++++++++++++++++ .../service/IOutboundTransferVoService1.java | 14 + .../m422x/query/Abstract422XRefQueryBP1.java | 88 +++++++ .../nc/bs/pu/m422x/query/QueryFor4455BP1.java | 54 ++++ .../m422x/ic/m4455/Query422XFor4455Impl.java | 40 +++ .../pu/m422x/ic/m4455/IQuery422XFor4455.java | 17 ++ .../nc/vo/pu/m422x/entity/PickmAppVOMeta.java | 21 ++ .../nc/vo/pu/m422x/entity/PickmReqAppVO.java | 48 ++++ 14 files changed, 977 insertions(+) create mode 100644 ic/META-INF/ictk.upm create mode 100644 ic/src/client/nccloud/web/ic/outbound/sapplybill/action/QueryPickmFor4455Action.java create mode 100644 ic/src/client/nccloud/web/ic/outbound/sapplybill/action/TransToSapplyBill1Action.java create mode 100644 ic/src/client/yyconfig/modules/ic/outbound/config/action/sapplybill.xml create mode 100644 ic/src/client/yyconfig/modules/ic/outbound/config/authorize/sapplybill_authorize.xml create mode 100644 ic/src/private/nc/bs/pub/action/N_4455_WRITE.java create mode 100644 ic/src/private/nccloud/pubimpl/ic/outbound/service/OutboundTransferVoServiceImpl1.java create mode 100644 ic/src/public/nccloud/pubitf/ic/outbound/service/IOutboundTransferVoService1.java create mode 100644 pu/src/private/nc/bs/pu/m422x/query/Abstract422XRefQueryBP1.java create mode 100644 pu/src/private/nc/bs/pu/m422x/query/QueryFor4455BP1.java create mode 100644 pu/src/private/nc/pubimpl/pu/m422x/ic/m4455/Query422XFor4455Impl.java create mode 100644 pu/src/public/nc/pubitf/pu/m422x/ic/m4455/IQuery422XFor4455.java create mode 100644 pu/src/public/nc/vo/pu/m422x/entity/PickmAppVOMeta.java create mode 100644 pu/src/public/nc/vo/pu/m422x/entity/PickmReqAppVO.java diff --git a/ic/META-INF/ictk.upm b/ic/META-INF/ictk.upm new file mode 100644 index 0000000..bdce4e7 --- /dev/null +++ b/ic/META-INF/ictk.upm @@ -0,0 +1,10 @@ + + + + + + nccloud.pubitf.ic.outbound.service.IOutboundTransferVoService1 + nccloud.pubimpl.ic.outbound.service.OutboundTransferVoServiceImpl1 + + + \ No newline at end of file diff --git a/ic/src/client/nccloud/web/ic/outbound/sapplybill/action/QueryPickmFor4455Action.java b/ic/src/client/nccloud/web/ic/outbound/sapplybill/action/QueryPickmFor4455Action.java new file mode 100644 index 0000000..ea03788 --- /dev/null +++ b/ic/src/client/nccloud/web/ic/outbound/sapplybill/action/QueryPickmFor4455Action.java @@ -0,0 +1,109 @@ +package nccloud.web.ic.outbound.sapplybill.action; + +import nc.pub.templet.converter.util.helper.ExceptionUtils; +import nc.pubitf.pu.m422x.ic.m4455.IQuery422XFor4455; +import nc.ui.querytemplate.querytree.IQueryScheme; +import nc.vo.ic.pub.util.StringUtil; +import nc.vo.ic.pub.util.ValueCheckUtil; +import nc.vo.pu.m422x.entity.PickmReqAppVO; +import nc.vo.pub.BusinessException; +import nc.vo.scmpub.res.billtype.ICBillType; +import nccloud.dto.scmpub.page.entity.SCMQueryTreeFormatVO; +import nccloud.framework.core.json.IJson; +import nccloud.framework.service.ServiceLocator; +import nccloud.framework.web.action.itf.ICommonAction; +import nccloud.framework.web.container.ClientInfo; +import nccloud.framework.web.container.IRequest; +import nccloud.framework.web.container.SessionContext; +import nccloud.framework.web.json.JsonFactory; +import nccloud.framework.web.ui.pattern.billgrid.BillGrid; +import nccloud.framework.web.ui.pattern.billgrid.BillGridOperator; +import nccloud.nc.vo.pub.pf.PullBillInfoVO; +import nccloud.pubitf.ic.pub.service.IICPubQueryService; +import nccloud.pubitf.platform.query.INCCloudQueryService; +import nccloud.pubitf.riart.businesstype.IPFBusinessTypeService; + +import java.util.List; + +/** + * 查询备料计划的数据-出库申请单拉单使用 + * + * @author mzr + * @date 2024/12/21 + */ +public class QueryPickmFor4455Action implements ICommonAction { + public Object doAction(IRequest request) { + String read = request.read(); + IJson json = JsonFactory.create(); + SCMQueryTreeFormatVO info = (SCMQueryTreeFormatVO) json.fromJson(read, SCMQueryTreeFormatVO.class); + + INCCloudQueryService queryutil = (INCCloudQueryService) ServiceLocator.find(INCCloudQueryService.class); + IQueryScheme scheme = queryutil.convertCondition(info.getQueryInfo()); + + /*Object transtype = info.getQueryInfo().getUserdefObj().get("transtype"); + PullBillInfoVO[] refbillinfos = queryRefPara(transtype); + appendRefWhr(scheme, refbillinfos);*/ + + IICPubQueryService schemeservice = (IICPubQueryService) ServiceLocator.find(IICPubQueryService.class); + + scheme = schemeservice.appendOrgPermission(scheme); + + PickmReqAppVO[] vos = null; + + IQuery422XFor4455 queryService = (IQuery422XFor4455) ServiceLocator.find(IQuery422XFor4455.class); + try { + vos = queryService.queryPickmAppsFor4455(scheme); + } catch (BusinessException e) { + ExceptionUtils.wrapException(e); + } + if (null == vos) { + return null; + } + // VO与UI数据格式转换 卡片列表:BillGridOperator + BillGridOperator operator = new BillGridOperator(info.getTempletid(), info.getPageCode()); + BillGrid[] grids = operator.toBillGrids(vos); + /*if (grids != null) { + StoreReqScaleUtil util = new StoreReqScaleUtil(); + for (BillGrid billGrid : grids) { + util.processGrid(billGrid, false); + } + }*/ + return grids; + } + + private void appendRefWhr(IQueryScheme scheme, PullBillInfoVO[] refbillinfos) { + if (null == refbillinfos || refbillinfos.length == 0) { + return; + } + + for (PullBillInfoVO info : refbillinfos) { + if ("422X".equals(info.getSrc_billtype())) { + List busitypes = info.getBusitypes(); + if (!ValueCheckUtil.isNullORZeroLength(busitypes)) { + scheme.put("busitypearray", busitypes.toArray(new String[0])); + List tranList = info.getTranstypes(); + if (!ValueCheckUtil.isNullORZeroLength(tranList) + && !StringUtil.isSEmptyOrNull((String) tranList.get(0))) { + scheme.put("transtypearray", tranList.toArray(new String[0])); + } + } + } + } + } + + private PullBillInfoVO[] queryRefPara(Object transtype) { + ClientInfo clientinfo = SessionContext.getInstance().getClientInfo(); + String groupId = clientinfo.getPk_group(); + String userId = clientinfo.getUserid(); + + IPFBusinessTypeService pfservice = (IPFBusinessTypeService) ServiceLocator.find(IPFBusinessTypeService.class); + PullBillInfoVO[] refbillinfos = null; + try { + refbillinfos = pfservice.getPullBillInfo(ICBillType.SapplyBill.getCode(), + (null == transtype) ? null : (String) transtype, groupId, userId); + } catch (BusinessException e) { + ExceptionUtils.wrapException(e); + } + return refbillinfos; + } +} \ No newline at end of file diff --git a/ic/src/client/nccloud/web/ic/outbound/sapplybill/action/TransToSapplyBill1Action.java b/ic/src/client/nccloud/web/ic/outbound/sapplybill/action/TransToSapplyBill1Action.java new file mode 100644 index 0000000..1c3f664 --- /dev/null +++ b/ic/src/client/nccloud/web/ic/outbound/sapplybill/action/TransToSapplyBill1Action.java @@ -0,0 +1,48 @@ +// +// Source code recreated from a .class file by IntelliJ IDEA +// (powered by FernFlower decompiler) +// + +package nccloud.web.ic.outbound.sapplybill.action; + +import nc.vo.ic.m4455.entity.SapplyBillVO; +import nccloud.dto.ic.pub.entity.TransferInfo; +import nccloud.framework.core.json.IJson; +import nccloud.framework.service.ServiceLocator; +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.framework.web.ui.pattern.billcard.BillCardOperator; +import nccloud.pubitf.ic.outbound.service.IOutboundTransferVoService1; +import nccloud.web.ic.pub.precision.ICBaseBillcardPrecisionHandler; + +/** + * 备料计划转出库申请 + * + * @author mzr + * @date 2024/12/25 + */ +public class TransToSapplyBill1Action implements ICommonAction { + public TransToSapplyBill1Action() { + } + + public Object doAction(IRequest request) { + String read = request.read(); + IJson json = JsonFactory.create(); + TransferInfo transInfo = (TransferInfo) json.fromJson(read, TransferInfo.class); + SapplyBillVO[] vos = null; + IOutboundTransferVoService1 service = (IOutboundTransferVoService1) ServiceLocator.find(IOutboundTransferVoService1.class); + vos = service.transPickmTo4455(transInfo); + BillCardOperator operator = new BillCardOperator(transInfo.getPagecode()); + BillCard[] cards = new BillCard[vos.length]; + + for (int i = 0; i < vos.length; ++i) { + cards[i] = operator.toCard(vos[i]); + ICBaseBillcardPrecisionHandler handler = new SapplyBillPrecisionHandler(cards[i]); + handler.process(); + } + + return cards; + } +} diff --git a/ic/src/client/yyconfig/modules/ic/outbound/config/action/sapplybill.xml b/ic/src/client/yyconfig/modules/ic/outbound/config/action/sapplybill.xml new file mode 100644 index 0000000..47a6ba6 --- /dev/null +++ b/ic/src/client/yyconfig/modules/ic/outbound/config/action/sapplybill.xml @@ -0,0 +1,110 @@ + + + + ic.sapplybill.query + + nccloud.web.ic.outbound.sapplybill.action.SapplyBillQueryAction + + + ic.sapplybill.queryPage + + nccloud.web.ic.outbound.sapplybill.action.SapplyBillPageQueryAction + + + ic.sapplybill.maintain + + nccloud.web.ic.outbound.sapplybill.action.SapplyBillMaintainAction + Commit,UnCommit,Delete + + + ic.sapplybill.save + + nccloud.web.ic.outbound.sapplybill.action.SapplyBillSaveAction + Save + + + ic.sapplybill.saveAndCommit + + nccloud.web.ic.outbound.sapplybill.action.SapplyBillSaveCommitAction + SaveCommit, Commit + + + ic.sapplybill.canbecopy + + nccloud.web.ic.outbound.sapplybill.action.SapplyBillBeforeCopyAction + + + ic.sapplybill.copy + + nccloud.web.ic.outbound.sapplybill.action.SapplyBillCopyAction + Copy + + + ic.sapplybill.cardquery + + nccloud.web.ic.outbound.sapplybill.action.SapplyBillQueryCardAction + + + ic.sapplybill.query422x + + nccloud.web.ic.outbound.sapplybill.action.Query422XFor4455Action + + + ic.sapplybill.transfervo + + nccloud.web.ic.outbound.sapplybill.action.TransToSapplyBillAction + + + ic.sapplybill.queryPickm + + nccloud.web.ic.outbound.sapplybill.action.QueryPickmFor4455Action + + + ic.sapplybill.transfervo1 + + nccloud.web.ic.outbound.sapplybill.action.TransToSapplyBill1Action + + + ic.sapplybill.print + + nccloud.web.ic.outbound.sapplybill.action.SapplyBillPrintAction + Print,output,Print_list + + + ic.sapplybill.combine + + nccloud.web.ic.outbound.sapplybill.action.SapplyBillCombineAction + CombinePrint + + + ic.sapplybill.checkprem + + nccloud.web.ic.outbound.sapplybill.action.SapplyBillDataPermissionAction + Edit,Print + + + ic.sapplybill.headAfterEdit + + nccloud.web.ic.outbound.sapplybill.events.SapplyBillHeadAfterEventAction + + + ic.sapplybill.bodyAfterEdit + + nccloud.web.ic.outbound.sapplybill.events.SapplyBillBodyAfterEditAction + + + ic.sapplybill.rowOpenClose + + nccloud.web.ic.outbound.sapplybill.action.SapplyBillRowOpenCloseAction + + + ic.sapplybill.billOpenClose + + nccloud.web.ic.outbound.sapplybill.action.SapplyBillOpenCloseAction + + + ic.sapplybill.ntpLinkList + + nccloud.web.ic.outbound.sapplybill.action.SapplyBillNtpLinkListAction + + \ No newline at end of file diff --git a/ic/src/client/yyconfig/modules/ic/outbound/config/authorize/sapplybill_authorize.xml b/ic/src/client/yyconfig/modules/ic/outbound/config/authorize/sapplybill_authorize.xml new file mode 100644 index 0000000..4949b3b --- /dev/null +++ b/ic/src/client/yyconfig/modules/ic/outbound/config/authorize/sapplybill_authorize.xml @@ -0,0 +1,27 @@ + + + 400801200,400801204 + + ic.sapplybill.query + ic.sapplybill.queryPage + ic.sapplybill.maintain + ic.sapplybill.save + ic.sapplybill.saveAndCommit + ic.sapplybill.canbecopy + ic.sapplybill.copy + ic.sapplybill.cardquery + ic.sapplybill.query422x + ic.sapplybill.transfervo + ic.sapplybill.queryPickm + ic.sapplybill.transfervo1 + ic.sapplybill.print + ic.sapplybill.combine + ic.sapplybill.checkprem + ic.sapplybill.headAfterEdit + ic.sapplybill.bodyAfterEdit + ic.sapplybill.rowOpenClose + ic.sapplybill.billOpenClose + ic.sapplybill.ntpLinkList + + + diff --git a/ic/src/private/nc/bs/pub/action/N_4455_WRITE.java b/ic/src/private/nc/bs/pub/action/N_4455_WRITE.java new file mode 100644 index 0000000..f742e6a --- /dev/null +++ b/ic/src/private/nc/bs/pub/action/N_4455_WRITE.java @@ -0,0 +1,148 @@ +// +// Source code recreated from a .class file by IntelliJ IDEA +// (powered by FernFlower decompiler) +// + +package nc.bs.pub.action; + +import java.util.Hashtable; + +import nc.bs.dao.BaseDAO; +import nc.bs.framework.common.NCLocator; +import nc.bs.ic.pub.env.ICBSContext; +import nc.bs.ic.pub.util.ICBillVOQuery; +import nc.bs.pub.compiler.AbstractCompiler2; +import nc.bs.scmpub.pf.PfParameterUtil; +import nc.itf.ic.m4455.self.ISapplyBillMaintain; +import nc.jdbc.framework.processor.ColumnProcessor; +import nc.vo.ic.m4455.entity.SapplyBillBodyVO; +import nc.vo.ic.m4455.entity.SapplyBillVO; +import nc.vo.ic.pub.pf.ICPFParameter; +import nc.vo.ic.pub.util.ValueCheckUtil; +import nc.vo.ml.NCLangRes4VoTransl; +import nc.vo.pub.BusinessException; +import nc.vo.pub.compiler.PfParameterVO; +import nc.vo.pub.lang.UFDouble; +import nc.vo.pubapp.pattern.exception.ExceptionUtils; +import nc.vo.pubapp.pattern.pub.MathTool; +import nccloud.baseapp.core.log.NCCForUAPLogger; + +/** + * 鍚堝苟澶囨枡璁″垝淇濆瓨鍓嶆牎楠岀敵璇锋暟閲忔槸鍚﹁秴杩囪鍒掓暟閲-2005閫傞厤2312 + * + * @author mzr + * @date 2025/3/26 + */ +public class N_4455_WRITE extends AbstractCompiler2 { + private Hashtable m_keyHas = null; + private Hashtable m_methodReturnHas = new Hashtable(); + + private BaseDAO baseDAO = null; + + public N_4455_WRITE() { + } + + public Object runComClass(PfParameterVO vo) throws BusinessException { + try { + super.m_tmpVo = vo; + ICBSContext context = new ICBSContext(); + ICPFParameter pfparam = (ICPFParameter)this.getUserObj(); + if (pfparam == null) { + pfparam = new ICPFParameter(); + } + + if (ValueCheckUtil.isNullORZeroLength(pfparam.getBusinessCheckMap())) { + pfparam.setBAtpCheckFlag(false); + } + + context.setICPFParameter(pfparam); + SapplyBillVO[] outVOs = (SapplyBillVO[])this.getVos(); + // 淇濆瓨鍓嶆牎楠岀敵璇锋暟閲忔槸鍚﹁秴杩囪鍒掓暟閲 + for (SapplyBillVO billVO : outVOs) { + SapplyBillBodyVO[] bodyVOS = billVO.getBodys(); + for (SapplyBillBodyVO bodyVO : bodyVOS) { + // 鍙垽鏂潵婧愬崟鎹槸澶囨枡璁″垝鐨勫嚭搴撶敵璇 + if (!"55A3".equals(bodyVO.getCsourcetype())) { + continue; + } + String csourcebillbid = bodyVO.getCsourcebillbid(); + // 鏌ヨ澶囨枡璁″垝涓殑璁″垝鍑哄簱鏁伴噺锛岄氳繃澶囨枡璁″垝鐨勮〃浣撲富閿 + String getPlanNumSql = "SELECT nplanoutastnum " + + "FROM mm_pickm_b " + + "WHERE NVL(dr,0) = 0 AND cpickm_bid = '[csourcebillbid]'"; + getPlanNumSql = getPlanNumSql.replace("[csourcebillbid]", csourcebillbid); + Object nplanoutastnum = getBaseDAO().executeQuery(getPlanNumSql, + new ColumnProcessor("nplanoutastnum")); + if (nplanoutastnum == null) { + continue; + } + UFDouble plantNum = new UFDouble(String.valueOf(nplanoutastnum)); + // 閫氳繃澶囨枡璁″垝鐨勮〃浣撲富閿煡璇㈠凡鐢宠鏁伴噺 + String getApplyNumSql = "SELECT NVL(SUM(nassistnum),0) nassistnum " + + "FROM ic_sapply_b " + + "WHERE NVL(dr,0) = 0 AND csourcebillbid = '[csourcebillbid]'"; + getApplyNumSql = getApplyNumSql.replace("[csourcebillbid]", csourcebillbid); + // 淇敼鐨勬椂鍊欏姞涓婂瓙琛ㄤ富閿 + if (null != outVOs[0] && null != outVOs[0].getHead() && null != outVOs[0].getHead().getCgeneralhid()) { + getApplyNumSql += " AND cgeneralbid != '" + bodyVO.getPrimaryKey() + "'"; + } + Object nassistnum = getBaseDAO().executeQuery(getApplyNumSql, + new ColumnProcessor("nassistnum")); + UFDouble applyNum = new UFDouble(String.valueOf(nassistnum)); + NCCForUAPLogger.debug(String.format( + "鍑哄簱鐢宠淇濆瓨: 鏉ユ簮鍗曟嵁琛ㄤ綋涓婚敭 = [%S], 璁″垝鍑哄簱鏁伴噺 = [%S], 宸茬敵璇锋暟閲 = [%S], 鏈鐢宠鏁伴噺 = [%S],", + csourcebillbid, plantNum, applyNum, bodyVO.getNassistnum() + )); + UFDouble applyNum1 = applyNum.add(bodyVO.getNassistnum()); + if (MathTool.compareTo(plantNum, applyNum1) < 0) { + nccloud.framework.core.exception.ExceptionUtils.wrapBusinessException("鐢宠鏁伴噺宸茶秴鍑鸿鍒掓暟閲忥紝璇锋鏌ワ紒"); + } + } + } + if (null != outVOs[0] && null != outVOs[0].getHead() && null != outVOs[0].getHead().getCgeneralhid()) { + PfParameterUtil util = new PfParameterUtil(this.getPfParameterVO(), outVOs); + SapplyBillVO[] originBills = (SapplyBillVO[])util.getOrginBills(); + if (originBills == null) { + originBills = (SapplyBillVO[])(new ICBillVOQuery()).fetchVOWithLoc(outVOs); + } + + SapplyBillVO[] clientFullBills = (SapplyBillVO[])util.getClientFullInfoBill(); + return ((ISapplyBillMaintain)NCLocator.getInstance().lookup(ISapplyBillMaintain.class)).update(clientFullBills, originBills); + } else { + SapplyBillVO[] retunVos = new SapplyBillVO[outVOs.length]; + ISapplyBillMaintain service = (ISapplyBillMaintain)NCLocator.getInstance().lookup(ISapplyBillMaintain.class); + + for(int i = 0; i < outVOs.length; ++i) { + retunVos[i] = service.insert(new SapplyBillVO[]{outVOs[i]})[0]; + } + + return retunVos; + } + } catch (Exception ex) { + ExceptionUtils.marsh(ex); + return null; + } + } + + public String getCodeRemark() { + return NCLangRes4VoTransl.getNCLangRes().getStrByID("4008003_0", "04008003-0108"); + } + + private void setParameter(String key, Object val) { + if (this.m_keyHas == null) { + this.m_keyHas = new Hashtable(); + } + + if (val != null) { + this.m_keyHas.put(key, val); + } + + } + + private BaseDAO getBaseDAO() { + if (this.baseDAO == null) { + this.baseDAO = new BaseDAO(); + } + return this.baseDAO; + } +} diff --git a/ic/src/private/nccloud/pubimpl/ic/outbound/service/OutboundTransferVoServiceImpl1.java b/ic/src/private/nccloud/pubimpl/ic/outbound/service/OutboundTransferVoServiceImpl1.java new file mode 100644 index 0000000..373de2a --- /dev/null +++ b/ic/src/private/nccloud/pubimpl/ic/outbound/service/OutboundTransferVoServiceImpl1.java @@ -0,0 +1,243 @@ +// +// Source code recreated from a .class file by IntelliJ IDEA +// (powered by FernFlower decompiler) +// + +package nccloud.pubimpl.ic.outbound.service; + +import nc.bs.framework.common.InvocationInfoProxy; +import nc.bs.framework.common.NCLocator; +import nc.impl.pubapp.pattern.data.vo.VOQuery; +import nc.itf.scmpub.reference.uap.pf.PfServiceScmUtil; +import nc.itf.uap.pf.IPfExchangeService; +import nc.vo.ic.general.deal.TransBillBaseProcess; +import nc.vo.ic.general.define.ICBillBodyVO; +import nc.vo.ic.general.define.ICBillHeadVO; +import nc.vo.ic.general.define.ICBillVO; +import nc.vo.ic.m4455.entity.SapplyBillVO; +import nc.vo.ic.m4c.deal.Bill4CFor45Process; +import nc.vo.ic.m4c.entity.SaleOutVO; +import nc.vo.ic.material.query.InvInfoQuery; +import nc.vo.ic.org.OrgInfoQuery; +import nc.vo.ic.param.ICSysParam; +import nc.vo.ic.pub.calc.BusiCalculator; +import nc.vo.ic.pub.define.ICContext; +import nc.vo.ic.pub.pf.billtype.BillTypeInfoQuery; +import nc.vo.ic.pub.util.StringUtil; +import nc.vo.ic.pub.util.VOEntityUtil; +import nc.vo.ic.pub.util.ValueCheckUtil; +import nc.vo.ic.warehouse.WarehouseInfoQuery; +import nc.vo.ml.LanguageVO; +import nc.vo.ml.NCLangRes4VoTransl; +import nc.vo.mmpac.pickm.entity.PickmHeadVO; +import nc.vo.mmpac.pickm.entity.PickmItemVO; +import nc.vo.pu.m422x.entity.PickmReqAppVO; +import nc.vo.pub.AggregatedValueObject; +import nc.vo.pub.BusinessException; +import nc.vo.pub.CircularlyAccessibleValueObject; +import nc.vo.pub.compiler.PfParameterVO; +import nc.vo.pub.lang.UFDate; +import nc.vo.pub.lang.UFDateTime; +import nc.vo.pub.pfflow01.BillbusinessVO; +import nc.vo.pubapp.pattern.exception.ExceptionUtils; +import nc.vo.pubapp.scale.ScaleUtils; +import nc.vo.pubapp.util.VORowNoUtils; +import nc.vo.scmpub.res.billtype.ICBillType; +import nc.vo.scmpub.res.billtype.SOBillType; +import nccloud.dto.ic.pub.entity.TransVoInfo; +import nccloud.dto.ic.pub.entity.TransferInfo; +import nccloud.pubitf.ic.outbound.service.IOutboundTransferVoService1; + +import java.util.ArrayList; +import java.util.List; + +public class OutboundTransferVoServiceImpl1 implements IOutboundTransferVoService1 { + public static final Integer ZERO_INTEGER = 0; + private ICContext context = new ICContext() { + public String getUserID() { + return InvocationInfoProxy.getInstance().getUserId(); + } + + public UFDateTime getServerDateTime() { + return null; + } + + public String getPk_group() { + return InvocationInfoProxy.getInstance().getGroupId(); + } + + public String getModuleEnableDate() { + return null; + } + + public LanguageVO getCurrentLanguage() { + return null; + } + + public UFDateTime getBizDateTime() { + return new UFDateTime(InvocationInfoProxy.getInstance().getBizDateTime()); + } + + public UFDate getBizDate() { + return new UFDate(InvocationInfoProxy.getInstance().getBizDateTime()); + } + + public String getBDDocMultLangName(String bddocname) { + return null; + } + }; + + public SapplyBillVO[] transPickmTo4455(TransferInfo info) { + if (null == info) { + return null; + } else { + TransVoInfo[] voInfos = info.getInfo(); + if (voInfos.length < 1) { + return null; + } else { + VOQuery query = new VOQuery(PickmHeadVO.class); + PickmHeadVO[] hvos = (PickmHeadVO[]) query.query(info.getInfo()[0].getHids()); + VOQuery queryb = new VOQuery(PickmItemVO.class); + PickmItemVO[] bvos = (PickmItemVO[]) queryb.query(info.getInfo()[0].getBids()); + PickmReqAppVO[] volist = new PickmReqAppVO[hvos.length]; + + for (int i = 0; i < hvos.length; ++i) { + PickmReqAppVO vo = new PickmReqAppVO(); + vo.setParentVO(hvos[i]); + List bodyvo = new ArrayList(); + + for (int j = 0; j < bvos.length; ++j) { + if (bvos[j].getCpickmid().equals(hvos[i].getCpickmid())) { + bodyvo.add(bvos[j]); + } + } + + vo.setChildrenVO((CircularlyAccessibleValueObject[]) bodyvo.toArray(new PickmItemVO[0])); + volist[i] = vo; + } + + IPfExchangeService service = (IPfExchangeService) NCLocator.getInstance().lookup(IPfExchangeService.class); + AggregatedValueObject[] vochange = new AggregatedValueObject[0]; + + try { + String cbilltype = info.getInfo()[0].getCbilltype(); + vochange = service.runChangeDataAryNeedClassify(cbilltype, ICBillType.SapplyBill.getCode(), volist, (PfParameterVO) null, -1); + } catch (BusinessException e) { + ExceptionUtils.wrappBusinessException(e.getMessage()); + } + + vochange = this.addFromSource(vochange); + return (SapplyBillVO[]) ((SapplyBillVO[]) vochange); + } + } + } + + + private AggregatedValueObject[] addFromSource(AggregatedValueObject[] retvos) { + this.processRowNO(this.processAfterVoChange((AggregatedValueObject[]) retvos)); + if (retvos instanceof SaleOutVO[]) { + Bill4CFor45Process proc = new Bill4CFor45Process(false); + proc.setBPushSave(false); + proc.setBusiCalc(BusiCalculator.getBusiCalculatorAtBS()); + proc.setIcSysParam(new ICSysParam(InvocationInfoProxy.getInstance().getGroupId())); + proc.setInvQuery(new InvInfoQuery()); + proc.setOrgInfoQry(new OrgInfoQuery()); + proc.setScale(ScaleUtils.getScaleUtilAtBS()); + proc.setWhQuery(new WarehouseInfoQuery()); + proc.setBilltypeQuery(new BillTypeInfoQuery()); + proc.setContext(this.context); + retvos = proc.changeToSaleOutVO((SaleOutVO[]) ((SaleOutVO[]) retvos)); + this.checkCbiz((SaleOutVO[]) ((SaleOutVO[]) retvos)); + } + + return (AggregatedValueObject[]) retvos; + } + + protected AggregatedValueObject[] processAfterVoChange(AggregatedValueObject[] retvos) { + this.setClientDbilldate(retvos); + TransBillBaseProcess process = new TransBillBaseProcess(false, false); + process.setBusiCalc(BusiCalculator.getBusiCalculatorAtBS()); + process.setIcSysParam(new ICSysParam(InvocationInfoProxy.getInstance().getGroupId())); + process.setInvQuery(new InvInfoQuery()); + process.setOrgInfoQry(new OrgInfoQuery()); + process.setScale(ScaleUtils.getScaleUtilAtBS()); + process.setWhQuery(new WarehouseInfoQuery()); + process.setBilltypeQuery(new BillTypeInfoQuery()); + process.setContext(this.context); + return process.processBillVOs((ICBillVO[]) ((ICBillVO[]) retvos)); + } + + protected void setClientDbilldate(AggregatedValueObject[] retvos) { + long time = InvocationInfoProxy.getInstance().getBizDateTime(); + UFDate date = new UFDate(time); + AggregatedValueObject[] var5 = retvos; + int var6 = retvos.length; + + for (int var7 = 0; var7 < var6; ++var7) { + AggregatedValueObject retvo = var5[var7]; + ICBillVO billvo = (ICBillVO) retvo; + billvo.getHead().setDbilldate(date); + } + + } + + protected AggregatedValueObject[] processRowNO(AggregatedValueObject[] retvos) { + if (ValueCheckUtil.isNullORZeroLength(retvos)) { + return retvos; + } else { + long time = InvocationInfoProxy.getInstance().getBizDateTime(); + UFDate date = new UFDate(time); + AggregatedValueObject[] var5 = retvos; + int var6 = retvos.length; + + for (int var7 = 0; var7 < var6; ++var7) { + AggregatedValueObject bill = var5[var7]; + CircularlyAccessibleValueObject[] bodys = bill.getChildrenVO(); + if (!ValueCheckUtil.isNullORZeroLength(bodys)) { + CircularlyAccessibleValueObject[] var10 = bodys; + int var11 = bodys.length; + + for (int var12 = 0; var12 < var11; ++var12) { + CircularlyAccessibleValueObject body = var10[var12]; + body.setAttributeValue("crowno", (Object) null); + if (body.getAttributeValue("nnum") != null) { + body.setAttributeValue("dbizdate", date); + } + } + + VORowNoUtils.setVOsRowNoByRule(bodys, "crowno"); + } + } + + return retvos; + } + } + + private void checkCbiz(SaleOutVO[] vos) { + String[] cbiztypes = VOEntityUtil.getVOsNotRepeatValue(VOEntityUtil.getHeadVOs(vos), "cbiztype"); + if (!ValueCheckUtil.isNullORZeroLength(cbiztypes)) { + String pk_group = InvocationInfoProxy.getInstance().getGroupId(); + String arriveCode = SOBillType.Delivery.getCode(); + String[] var5 = cbiztypes; + int var6 = cbiztypes.length; + + for (int var7 = 0; var7 < var6; ++var7) { + String biztype = var5[var7]; + BillbusinessVO[] businessVOs = PfServiceScmUtil.findBillbusinessVOs(biztype, pk_group); + if (!ValueCheckUtil.isNullORZeroLength(businessVOs)) { + BillbusinessVO[] var10 = businessVOs; + int var11 = businessVOs.length; + + for (int var12 = 0; var12 < var11; ++var12) { + BillbusinessVO vo = var10[var12]; + if (StringUtil.isStringEqual(vo.getPk_billtype(), arriveCode)) { + ExceptionUtils.wrappBusinessException(NCLangRes4VoTransl.getNCLangRes().getStrByID("4008003_0", "04008003-0251")); + } + } + } + } + + } + } + +} diff --git a/ic/src/public/nccloud/pubitf/ic/outbound/service/IOutboundTransferVoService1.java b/ic/src/public/nccloud/pubitf/ic/outbound/service/IOutboundTransferVoService1.java new file mode 100644 index 0000000..cfcc993 --- /dev/null +++ b/ic/src/public/nccloud/pubitf/ic/outbound/service/IOutboundTransferVoService1.java @@ -0,0 +1,14 @@ +// +// Source code recreated from a .class file by IntelliJ IDEA +// (powered by FernFlower decompiler) +// + +package nccloud.pubitf.ic.outbound.service; + +import nc.vo.ic.m4455.entity.SapplyBillVO; +import nccloud.dto.ic.pub.entity.TransferInfo; + +public interface IOutboundTransferVoService1 { + SapplyBillVO[] transPickmTo4455(TransferInfo info); + +} diff --git a/pu/src/private/nc/bs/pu/m422x/query/Abstract422XRefQueryBP1.java b/pu/src/private/nc/bs/pu/m422x/query/Abstract422XRefQueryBP1.java new file mode 100644 index 0000000..db13bcf --- /dev/null +++ b/pu/src/private/nc/bs/pu/m422x/query/Abstract422XRefQueryBP1.java @@ -0,0 +1,88 @@ +// +// Source code recreated from a .class file by IntelliJ IDEA +// (powered by FernFlower decompiler) +// + +package nc.bs.pu.m422x.query; + +import nc.bs.scmpub.util.SCMDataAccessUtils; +import nc.impl.pubapp.pattern.data.vo.VOQuery; +import nc.ui.querytemplate.querytree.IQueryScheme; +import nc.vo.mmpac.pickm.entity.PickmHeadVO; +import nc.vo.mmpac.pickm.entity.PickmItemVO; +import nc.vo.pu.m422x.entity.PickmReqAppVO; +import nc.vo.pubapp.pattern.model.tool.BillComposite; +import nc.vo.pubapp.query2.sql.process.QuerySchemeProcessor; + +import java.util.HashSet; +import java.util.Set; + +public abstract class Abstract422XRefQueryBP1 { + protected String headtb; + protected String itemtb; + protected QuerySchemeProcessor psor; + + public Abstract422XRefQueryBP1(IQueryScheme queryScheme) { + this.psor = new QuerySchemeProcessor(queryScheme); + this.headtb = this.psor.getMainTableAlias(); + // this.itemtb = this.psor.getTableAliasOfAttribute("pk_storereq_b.pk_storereq_b"); + } + + public String getHeadtb() { + return this.headtb; + } + + public String getItemtb() { + return this.itemtb; + } + + public QuerySchemeProcessor getPsor() { + return this.psor; + } + + public abstract StringBuilder makeGetPKSql(); + + public PickmReqAppVO[] queryPickmReqVOs() { + SCMDataAccessUtils utils = new SCMDataAccessUtils(10000); + // this.psor.appendCurrentGroup(); + StringBuilder sql = this.makeGetPKSql(); + String[][] pks = utils.query(sql.toString()).toTwoDimensionStringArray(); + if (null != pks && pks.length != 0) { + Set headPks = new HashSet(); + String[] itemPks = new String[pks.length]; + + for (int i = 0; i < pks.length; ++i) { + headPks.add(pks[i][0]); + itemPks[i] = pks[i][1]; + } + + PickmHeadVO[] headers = (PickmHeadVO[]) (new VOQuery(PickmHeadVO.class)).query((String[]) headPks.toArray(new String[headPks.size()])); + PickmItemVO[] items = (PickmItemVO[]) (new VOQuery(PickmItemVO.class)).query(itemPks); + BillComposite bc = new BillComposite(PickmReqAppVO.class); + PickmReqAppVO tempVO = new PickmReqAppVO(); + bc.append(tempVO.getMetaData().getParent(), headers); + bc.append(tempVO.getMetaData().getVOMeta(PickmItemVO.class), items); + PickmReqAppVO[] queryResult = (PickmReqAppVO[]) bc.composite(); + // return this.processQueryResult(queryResult); + return queryResult; + } else { + return null; + } + } + + public void setHeadtb(String headtb) { + this.headtb = headtb; + } + + public void setItemtb(String itemtb) { + this.itemtb = itemtb; + } + + public void setPsor(QuerySchemeProcessor psor) { + this.psor = psor; + } + + protected PickmReqAppVO[] processQueryResult(PickmReqAppVO[] queryResult) { + return queryResult; + } +} diff --git a/pu/src/private/nc/bs/pu/m422x/query/QueryFor4455BP1.java b/pu/src/private/nc/bs/pu/m422x/query/QueryFor4455BP1.java new file mode 100644 index 0000000..179ae09 --- /dev/null +++ b/pu/src/private/nc/bs/pu/m422x/query/QueryFor4455BP1.java @@ -0,0 +1,54 @@ +// +// Source code recreated from a .class file by IntelliJ IDEA +// (powered by FernFlower decompiler) +// + +package nc.bs.pu.m422x.query; + +import nc.bs.pu.m422x.plugin.StoreReqAppPluginPoint; +import nc.bs.pu.m422x.query.rule.CanOutreqNumCalcRule; +import nc.impl.pubapp.pattern.rule.processer.AroundProcesser; +import nc.ui.querytemplate.querytree.IQueryScheme; +import nc.vo.pu.m422x.entity.StoreReqAppVO; +import nccloud.baseapp.core.log.NCCForUAPLogger; +import nccloud.commons.lang.ArrayUtils; + +public class QueryFor4455BP1 extends Abstract422XRefQueryBP1 { + public QueryFor4455BP1(IQueryScheme queryScheme) { + super(queryScheme); + } + + private void addRule(AroundProcesser processer) { + processer.addAfterRule(new CanOutreqNumCalcRule()); + } + + public StringBuilder makeGetPKSql() { + StringBuilder wholeSql = new StringBuilder(); + wholeSql.append(" SELECT DISTINCT a.cpickmid,b.cpickm_bid"); + wholeSql.append(" FROM"); + wholeSql.append(" ("); + wholeSql.append(" SELECT cpickmid"); + wholeSql.append(this.psor.getFinalFromWhere()); + // 查询审核通过 + wholeSql.append(" AND fbillstatus = 1"); + // wholeSql.append(" AND APPROVERTIME > '2024-11-01'"); + // NCCForUAPLogger.debug("finalFromWhere = " + this.psor.getFinalFromWhere()); + wholeSql.append(" ) a"); + wholeSql.append(" INNER JOIN mm_pickm_b b ON b.cpickmid = a.cpickmid AND b.dr = 0 "); + // 未出库数量>0 + wholeSql.append(" WHERE "); + wholeSql.append(" ( COALESCE(b.nplanoutastnum, 0) - COALESCE(b.nshouldastnum, 0) - COALESCE(b.npscastnum, 0) - COALESCE(b.naccoutastnum, 0) ) > 0 "); + NCCForUAPLogger.debug("wholeSql = " + wholeSql); + return wholeSql; + } + + protected StoreReqAppVO[] processQueryResult(StoreReqAppVO[] queryResult) { + if (ArrayUtils.isEmpty(queryResult)) { + return null; + } else { + AroundProcesser processer = new AroundProcesser(StoreReqAppPluginPoint.PULL_4455); + this.addRule(processer); + return (StoreReqAppVO[]) processer.after(queryResult); + } + } +} diff --git a/pu/src/private/nc/pubimpl/pu/m422x/ic/m4455/Query422XFor4455Impl.java b/pu/src/private/nc/pubimpl/pu/m422x/ic/m4455/Query422XFor4455Impl.java new file mode 100644 index 0000000..44d3fd0 --- /dev/null +++ b/pu/src/private/nc/pubimpl/pu/m422x/ic/m4455/Query422XFor4455Impl.java @@ -0,0 +1,40 @@ +// +// Source code recreated from a .class file by IntelliJ IDEA +// (powered by FernFlower decompiler) +// + +package nc.pubimpl.pu.m422x.ic.m4455; + +import nc.bs.pu.m422x.query.QueryFor4455BP; +import nc.bs.pu.m422x.query.QueryFor4455BP1; +import nc.pubitf.pu.m422x.ic.m4455.IQuery422XFor4455; +import nc.ui.querytemplate.querytree.IQueryScheme; +import nc.vo.pu.m422x.entity.PickmReqAppVO; +import nc.vo.pu.m422x.entity.StoreReqAppVO; +import nc.vo.pub.BusinessException; +import nc.vo.pubapp.pattern.exception.ExceptionUtils; + +public class Query422XFor4455Impl implements IQuery422XFor4455 { + public Query422XFor4455Impl() { + } + + @Override + public StoreReqAppVO[] queryStoreReqAppsFor4455(IQueryScheme queryScheme) throws BusinessException { + try { + return (new QueryFor4455BP(queryScheme)).queryStoreReqVOs(); + } catch (Exception e) { + ExceptionUtils.marsh(e); + return null; + } + } + + @Override + public PickmReqAppVO[] queryPickmAppsFor4455(IQueryScheme queryScheme) throws BusinessException { + try { + return (new QueryFor4455BP1(queryScheme)).queryPickmReqVOs(); + } catch (Exception e) { + ExceptionUtils.marsh(e); + return null; + } + } +} diff --git a/pu/src/public/nc/pubitf/pu/m422x/ic/m4455/IQuery422XFor4455.java b/pu/src/public/nc/pubitf/pu/m422x/ic/m4455/IQuery422XFor4455.java new file mode 100644 index 0000000..05edca6 --- /dev/null +++ b/pu/src/public/nc/pubitf/pu/m422x/ic/m4455/IQuery422XFor4455.java @@ -0,0 +1,17 @@ +// +// Source code recreated from a .class file by IntelliJ IDEA +// (powered by FernFlower decompiler) +// + +package nc.pubitf.pu.m422x.ic.m4455; + +import nc.ui.querytemplate.querytree.IQueryScheme; +import nc.vo.pu.m422x.entity.PickmReqAppVO; +import nc.vo.pu.m422x.entity.StoreReqAppVO; +import nc.vo.pub.BusinessException; + +public interface IQuery422XFor4455 { + StoreReqAppVO[] queryStoreReqAppsFor4455(IQueryScheme var1) throws BusinessException; + + PickmReqAppVO[] queryPickmAppsFor4455(IQueryScheme queryScheme) throws BusinessException; +} diff --git a/pu/src/public/nc/vo/pu/m422x/entity/PickmAppVOMeta.java b/pu/src/public/nc/vo/pu/m422x/entity/PickmAppVOMeta.java new file mode 100644 index 0000000..95d7e42 --- /dev/null +++ b/pu/src/public/nc/vo/pu/m422x/entity/PickmAppVOMeta.java @@ -0,0 +1,21 @@ +// +// Source code recreated from a .class file by IntelliJ IDEA +// (powered by FernFlower decompiler) +// + +package nc.vo.pu.m422x.entity; + +import nc.vo.mmpac.pickm.entity.PickmHeadVO; +import nc.vo.mmpac.pickm.entity.PickmItemVO; +import nc.vo.pubapp.pattern.model.meta.entity.bill.AbstractBillMeta; + +public class PickmAppVOMeta extends AbstractBillMeta { + public PickmAppVOMeta() { + this.init(); + } + + public void init() { + this.setParent(PickmHeadVO.class); + this.addChildren(PickmItemVO.class); + } +} diff --git a/pu/src/public/nc/vo/pu/m422x/entity/PickmReqAppVO.java b/pu/src/public/nc/vo/pu/m422x/entity/PickmReqAppVO.java new file mode 100644 index 0000000..9b2be38 --- /dev/null +++ b/pu/src/public/nc/vo/pu/m422x/entity/PickmReqAppVO.java @@ -0,0 +1,48 @@ +// +// Source code recreated from a .class file by IntelliJ IDEA +// (powered by FernFlower decompiler) +// + +package nc.vo.pu.m422x.entity; + +import nc.vo.annotation.AggVoInfo; +import nc.vo.mmpac.pickm.entity.PickmHeadVO; +import nc.vo.mmpac.pickm.entity.PickmItemVO; +import nc.vo.pubapp.pattern.model.entity.bill.AbstractBill; +import nc.vo.pubapp.pattern.model.meta.entity.bill.BillMetaFactory; +import nc.vo.pubapp.pattern.model.meta.entity.bill.IBillMeta; + +@AggVoInfo( + parentVO = "nc.vo.mmpac.pickm.entity.PickmHeadVO" +) +public class PickmReqAppVO extends AbstractBill { + private static final long serialVersionUID = -3077249229044777149L; + + public PickmReqAppVO() { + } + + /*public static StoreReqAppCloseVO[] getCloseVO(PickmReqAppVO[] vos) { + return (StoreReqAppCloseVO[]) (new BillToViewConvertor(StoreReqAppCloseVO.class)).convert(vos); + }*/ + + public PickmItemVO[] getBVO() { + return (PickmItemVO[]) ((PickmItemVO[]) this.getChildrenVO()); + } + + public PickmHeadVO getHVO() { + return (PickmHeadVO) this.getParent(); + } + + public IBillMeta getMetaData() { + IBillMeta billMeta = BillMetaFactory.getInstance().getBillMeta(PickmAppVOMeta.class); + return billMeta; + } + + public void setBVO(PickmItemVO[] voaChildren) { + this.setChildrenVO(voaChildren); + } + + public void setHVO(PickmHeadVO voaParent) { + this.setParent(voaParent); + } +}