From 845b3c766a9b0ba690b9a16b78221076b4016680 Mon Sep 17 00:00:00 2001 From: lihao Date: Fri, 6 Jun 2025 09:35:04 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=98=E6=AC=BE=E5=8D=95=E4=BF=9D=E5=AD=98?= =?UTF-8?q?=E6=BA=90=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../private/nc/bs/pub/action/N_F3_SAVE.java | 113 ++++++++++++++++++ 1 file changed, 113 insertions(+) create mode 100644 arap/src/private/nc/bs/pub/action/N_F3_SAVE.java diff --git a/arap/src/private/nc/bs/pub/action/N_F3_SAVE.java b/arap/src/private/nc/bs/pub/action/N_F3_SAVE.java new file mode 100644 index 0000000..ee95445 --- /dev/null +++ b/arap/src/private/nc/bs/pub/action/N_F3_SAVE.java @@ -0,0 +1,113 @@ +// +// Source code recreated from a .class file by IntelliJ IDEA +// (powered by FernFlower decompiler) +// + +package nc.bs.pub.action; + +import java.math.BigDecimal; +import java.util.Hashtable; +import nc.bs.arap.actions.N_BASE_ACTION; +import nc.bs.arap.paybp.PayBillBO; +import nc.bs.framework.common.NCLocator; +import nc.bs.logging.Logger; +import nc.vo.arap.pay.AggPayBillVO; +import nc.vo.arap.pub.ArapConstant; +import nc.vo.arap.pub.BillEnumCollection.ApproveStatus; +import nc.vo.fipub.exception.ExceptionHandler; +import nc.vo.pub.AggregatedValueObject; +import nc.vo.pub.BusinessException; +import nc.vo.pub.compiler.PfParameterVO; +import nccloud.bs.arap.util.commit.ArapCommitUtil; +import nccloud.pubitf.arap.arappub.IArapBillPubUtilService; + +public class N_F3_SAVE extends N_BASE_ACTION { + private Hashtable m_keyHas; + + public N_F3_SAVE() { + new Hashtable(); + } + + private boolean hasBill(String primaryKey) throws BusinessException { + boolean hasBill = false; + if (primaryKey != null) { + AggPayBillVO[] bvos = null; + + try { + PayBillBO payableBO = new PayBillBO(); + bvos = payableBO.findBillByPrimaryKey(new String[]{primaryKey}); + } catch (Exception e) { + Logger.error(e.getMessage(), e); + } + + if (bvos != null && bvos.length != 0 && bvos[0] != null) { + hasBill = true; + } + } + + return hasBill; + } + + public Object runComClass(PfParameterVO paraVo) throws BusinessException { + try { + if (paraVo.m_preValueVos == null) { + return null; + } else { + Object obj = null; + super.m_tmpVo = paraVo; + if (paraVo.isCloudEntry) { + String actionCode = ArapConstant.SAVE; + ((IArapBillPubUtilService)NCLocator.getInstance().lookup(IArapBillPubUtilService.class)).interceptorVaildator(paraVo.m_preValueVos, actionCode); + } + + this.setParameter("context", paraVo.m_preValueVos); + this.beforeCheck(); + String primaryKey = paraVo.m_preValueVos[0].getParentVO().getPrimaryKey(); + if (this.hasBill(primaryKey)) { + obj = this.runClass("nc.bs.arap.actions.PaybillEditSaveBatchBSAction", "updateVOs", "&context:nc.vo.pub.AggregatedValueObject[]", paraVo, this.m_keyHas); + } else { + paraVo = this.approveStatusChange(paraVo); + obj = this.runClass("nc.bs.arap.actions.PaybillSaveBatchBSAction", "insertVOs", "&context:nc.vo.pub.AggregatedValueObject[]", paraVo, this.m_keyHas); + } + + this.afterCheck(); + obj = (new ArapCommitUtil()).autoCommit(obj); + return obj; + } + } catch (Exception exception) { + throw ExceptionHandler.handleException(this.getClass(), exception); + } + } + + protected 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); + } + + } + + public String getCodeRemark() { + return " arap action script not allowed to modify ,all rights reserved!"; + } + + private PfParameterVO approveStatusChange(PfParameterVO paraVo) { + for(AggregatedValueObject vo : paraVo.m_preValueVos) { + vo.getParentVO().setAttributeValue("approvestatus", ApproveStatus.NOSTATE.VALUE); + } + + return paraVo; + } + + private PfParameterVO def10Change(PfParameterVO paraVo) { + for(AggregatedValueObject vo : paraVo.m_preValueVos) { + vo.getParentVO().setAttributeValue("approvestatus", ApproveStatus.NOSTATE.VALUE); + } + + return paraVo; + } + +}