|
@@ -0,0 +1,29 @@
|
|
|
+package nc.impl.pu.m25.action;
|
|
|
+
|
|
|
+import nc.bs.ic.base.InvoiceAfterSubmitEvent;
|
|
|
+import nc.impl.pu.m25.action.rule.sendapprove.ApproveFlowCheckRule;
|
|
|
+import nc.impl.pu.m25.action.rule.sendapprove.InvoiceStateChgRule;
|
|
|
+import nc.impl.pubapp.pattern.data.bill.BillUpdate;
|
|
|
+import nc.impl.pubapp.pattern.data.bill.tool.BillTransferTool;
|
|
|
+import nc.impl.pubapp.pattern.rule.plugin.IPluginPoint;
|
|
|
+import nc.impl.pubapp.pattern.rule.processer.AroundProcesser;
|
|
|
+import nc.vo.pu.m25.entity.InvoiceVO;
|
|
|
+
|
|
|
+public class InvoiceSendApproveAction {
|
|
|
+ public InvoiceVO[] sendapprove(InvoiceVO[] invoiceVOs) {
|
|
|
+ BillTransferTool<InvoiceVO> tool = new BillTransferTool(invoiceVOs);
|
|
|
+ InvoiceVO[] orgVos = (InvoiceVO[]) tool.getOriginBills();
|
|
|
+ AroundProcesser<InvoiceVO> processer = new AroundProcesser((IPluginPoint) null);
|
|
|
+ this.addRule(processer);
|
|
|
+ processer.before(invoiceVOs);
|
|
|
+ processer.after(invoiceVOs);
|
|
|
+ InvoiceVO[] updatedVos = (InvoiceVO[]) (new BillUpdate()).update(invoiceVOs, orgVos);
|
|
|
+ return (InvoiceVO[]) tool.getBillForToClient(updatedVos);
|
|
|
+ }
|
|
|
+
|
|
|
+ private void addRule(AroundProcesser<InvoiceVO> processer) {
|
|
|
+ processer.addBeforeFinalRule(new ApproveFlowCheckRule());
|
|
|
+ processer.addBeforeFinalRule(new InvoiceStateChgRule());
|
|
|
+ processer.addAfterFinalRule(new InvoiceAfterSubmitEvent());
|
|
|
+ }
|
|
|
+}
|