付款申请单 候补发票

This commit is contained in:
程小伟 2025-05-13 14:35:11 +08:00
parent e383a443af
commit 312790e980
1 changed files with 25 additions and 3 deletions

View File

@ -2,6 +2,7 @@ package zcgj.zcdev.zcdev.pr.plugin.form;
import dm.jdbc.util.StringUtil; import dm.jdbc.util.StringUtil;
import kd.bos.bill.AbstractBillPlugIn; import kd.bos.bill.AbstractBillPlugIn;
import kd.bos.context.RequestContext;
import kd.bos.dataentity.entity.DynamicObject; import kd.bos.dataentity.entity.DynamicObject;
import kd.bos.dataentity.entity.DynamicObjectCollection; import kd.bos.dataentity.entity.DynamicObjectCollection;
import kd.bos.dataentity.resource.ResManager; import kd.bos.dataentity.resource.ResManager;
@ -22,13 +23,15 @@ import kd.bos.logging.LogFactory;
import kd.bos.orm.query.QFilter; import kd.bos.orm.query.QFilter;
import kd.bos.servicehelper.BusinessDataServiceHelper; import kd.bos.servicehelper.BusinessDataServiceHelper;
import kd.bos.servicehelper.operation.SaveServiceHelper; import kd.bos.servicehelper.operation.SaveServiceHelper;
import kd.ec.basedata.common.invoicecloud.InvoiceDataHandleHelper;
import kd.ec.basedata.common.invoicecloud.bean.InvoiceVO;
import kd.ec.contract.formplugin.PaymentApplyEditUI; import kd.ec.contract.formplugin.PaymentApplyEditUI;
import kd.ec.contract.utils.ImportInvoiceUtils;
import kd.sdk.plugin.Plugin; import kd.sdk.plugin.Plugin;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.ArrayList; import java.util.*;
import java.util.List;
public class SupplementInvoiceBillPlugin extends PaymentApplyEditUI { public class SupplementInvoiceBillPlugin extends PaymentApplyEditUI {
private static final Log log = LogFactory.getLog(SupplementInvoiceBillPlugin.class); private static final Log log = LogFactory.getLog(SupplementInvoiceBillPlugin.class);
@ -55,6 +58,8 @@ public class SupplementInvoiceBillPlugin extends PaymentApplyEditUI {
} }
} }
private void unapplyInvoftaxamtRevise(BeforeDoOperationEventArgs args) { private void unapplyInvoftaxamtRevise(BeforeDoOperationEventArgs args) {
int rowCount = this.getModel().getEntryRowCount("subentryentity"); int rowCount = this.getModel().getEntryRowCount("subentryentity");
log.info("SupplementInvoiceBillPlugin:子单据体行数:"+rowCount); log.info("SupplementInvoiceBillPlugin:子单据体行数:"+rowCount);
@ -109,6 +114,10 @@ public class SupplementInvoiceBillPlugin extends PaymentApplyEditUI {
@Override @Override
public void propertyChanged(PropertyChangedArgs e) { public void propertyChanged(PropertyChangedArgs e) {
if (!"C".equals(this.getModel().getValue("billstatus"))){
super.propertyChanged(e);//单据不是审核状态走父类
}
//单据为审核走以下逻辑
log.info("SupplementInvoiceBillPlugin:发生变动的字段:"+e.getProperty().getName()); log.info("SupplementInvoiceBillPlugin:发生变动的字段:"+e.getProperty().getName());
String billId = this.getModel().getDataEntity().getPkValue().toString(); String billId = this.getModel().getDataEntity().getPkValue().toString();
// log.info("SupplementInvoiceBillPlugin:主键值:"+billId); // log.info("SupplementInvoiceBillPlugin:主键值:"+billId);
@ -230,8 +239,13 @@ public class SupplementInvoiceBillPlugin extends PaymentApplyEditUI {
public void closedCallBack(ClosedCallBackEvent event) { public void closedCallBack(ClosedCallBackEvent event) {
String billId = this.getModel().getDataEntity().getPkValue().toString(); String billId = this.getModel().getDataEntity().getPkValue().toString();
log.info("SupplementInvoiceBillPlugin:主键值:"+billId); log.info("SupplementInvoiceBillPlugin:主键值:"+billId);
if (!billId.equals("0") && "A".equals(this.getModel().getValue("billstatus"))){ if (!"C".equals(this.getModel().getValue("billstatus"))){
super.closedCallBack(event); super.closedCallBack(event);
String actionId = event.getActionId();
Object returnData = event.getReturnData();
if (actionId.equals("selectinvoice") && returnData != null) {
this.selectInvoiceCallBack(returnData);
}
} else if (!billId.equals("0") &&"C".equals(this.getModel().getValue("billstatus"))){ } else if (!billId.equals("0") &&"C".equals(this.getModel().getValue("billstatus"))){
String actionId = event.getActionId();//获取回调标识 String actionId = event.getActionId();//获取回调标识
Object returnData = event.getReturnData();//获取子页面返回的数据 Object returnData = event.getReturnData();//获取子页面返回的数据
@ -245,6 +259,14 @@ public class SupplementInvoiceBillPlugin extends PaymentApplyEditUI {
} }
protected void selectInvoiceCallBack(Object returnData) {
DynamicObject org = (DynamicObject)this.getModel().getValue("fiaccountorg");
List<InvoiceVO> invoiceVOList = InvoiceDataHandleHelper.parseXhInvoiceCloudReturnData(returnData);
Map<Boolean, Set<DynamicObject>> invoiceMap = CustomInvoiceDataHandleHelper.processInvoiceVO(invoiceVOList, RequestContext.get().getCurrUserId(), org.getLong("id"), new Date(), "ec_in_invoice", (DynamicObject)this.getModel().getValue("currency"), true);
ImportInvoiceUtils invoiceUtils = new ImportInvoiceUtils(this.getView(), this.getPageCache());
this.addInvoiceToEntry(invoiceUtils, invoiceMap);
}
protected void invoiceCloseCallBack1(ClosedCallBackEvent event) { protected void invoiceCloseCallBack1(ClosedCallBackEvent event) {
ListSelectedRowCollection rows = (ListSelectedRowCollection)event.getReturnData(); ListSelectedRowCollection rows = (ListSelectedRowCollection)event.getReturnData();
DynamicObject[] invArr = new DynamicObject[rows.size()]; DynamicObject[] invArr = new DynamicObject[rows.size()];