付款单保存源码
This commit is contained in:
parent
540c964ce5
commit
845b3c766a
|
@ -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<String, Object> 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;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue