Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
xuhaihui 2025-09-11 17:21:31 +08:00
commit a0abea63f2
3 changed files with 141 additions and 36 deletions

View File

@ -78,7 +78,8 @@ public class FundingplanapplyPlugin extends AbstractBillPlugIn implements Plugin
orderBySeq("zcgj_infundproject_entry","zcgj_in_seq");
orderBySeq("zcgj_outfundproject_entry","zcgj_out_seq");
this.getView().setEnable(false, 6, "zcgj_cashamt","zcgj_bankamt","zcgj_businessamt","zcgj_supplyamt","zcgj_otheramt","zcgj_totalamt");
this.getView().setEnable(false, 3, "zcgj_cashamt","zcgj_bankamt","zcgj_businessamt","zcgj_supplyamt","zcgj_otheramt","zcgj_totalamt");
this.getView().setEnable(false, 7, "zcgj_cashamt","zcgj_bankamt","zcgj_businessamt","zcgj_supplyamt","zcgj_otheramt","zcgj_totalamt");
}
//项目排序
@ -106,7 +107,6 @@ public class FundingplanapplyPlugin extends AbstractBillPlugIn implements Plugin
int year = LocalDate.now().getYear();
List<QFilter> searchFilterList = new ArrayList<>();
//查询申请人下的今年的探亲差旅单据
searchFilterList.add(new QFilter("zcgj_org", QCP.equals, org.getLong("id")));
searchFilterList.add( new QFilter("zcgj_period.number", QCP.like, year+"%"));
DynamicObject[] load = BusinessDataServiceHelper.load("zcgj_ec_fundingplanapply",
@ -210,6 +210,77 @@ public class FundingplanapplyPlugin extends AbstractBillPlugIn implements Plugin
this.getView().updateView("zcgj_infundlastentry");
}
Object periodObj = this.getModel().getValue("zcgj_period");
if(periodObj!=null){
DynamicObject period = (DynamicObject) periodObj;
List<QFilter> searchFilterListzj = new ArrayList<>();
searchFilterListzj.add(new QFilter("zcgj_org", QCP.equals, org.getLong("id")));
searchFilterListzj.add( new QFilter("zcgj_period.number", QCP.equals, period.getString("number")));
DynamicObject[] loadzj = BusinessDataServiceHelper.load("zcgj_ec_fundingplanapply",
"zcgj_period,zcgj_fundplyentry.zcgj_funditem," +
"zcgj_fundplyentry.zcgj_cashamt,zcgj_fundplyentry.zcgj_bankamt " +
",zcgj_fundplyentry.zcgj_businessamt,zcgj_fundplyentry.zcgj_supplyamt,zcgj_fundplyentry.zcgj_otheramt " +
",zcgj_fundplyentry.zcgj_totalamt " +
",createtime",
searchFilterListzj.toArray(new QFilter[]{}), "createtime desc");
if(loadzj!=null && loadzj.length>0){
DynamicObjectCollection fundplyentry = this.getModel().getDataEntity(true).getDynamicObjectCollection("zcgj_fundplyentry");
BigDecimal cashamtAll = BigDecimal.ZERO;
BigDecimal bankamtAll = BigDecimal.ZERO;
BigDecimal businessamtAll = BigDecimal.ZERO;
BigDecimal supplyamtAll = BigDecimal.ZERO;
BigDecimal otheramtAll = BigDecimal.ZERO;
BigDecimal totalamtAll = BigDecimal.ZERO;
for (DynamicObject dynamicObject : loadzj) {
DynamicObjectCollection zcgjFundplyentry = dynamicObject.getDynamicObjectCollection("zcgj_fundplyentry");
for (DynamicObject dy : zcgjFundplyentry) {
DynamicObject zcgjFunditem = dy.getDynamicObject("zcgj_funditem");
if(zcgjFunditem!=null && "ZJXM008".equals(zcgjFunditem.getString("number"))){
BigDecimal zcgjCashamt = dy.getBigDecimal("zcgj_cashamt") != null ?dy.getBigDecimal("zcgj_cashamt"): BigDecimal.ZERO;
BigDecimal zcgjBankamt = dy.getBigDecimal("zcgj_bankamt") != null ?dy.getBigDecimal("zcgj_bankamt"): BigDecimal.ZERO;
BigDecimal zcgjBusinessamt = dy.getBigDecimal("zcgj_businessamt") != null ?dy.getBigDecimal("zcgj_businessamt"): BigDecimal.ZERO;
BigDecimal zcgjSupplyamt = dy.getBigDecimal("zcgj_supplyamt") != null ?dy.getBigDecimal("zcgj_supplyamt"): BigDecimal.ZERO;
BigDecimal zcgjOtheramt = dy.getBigDecimal("zcgj_otheramt") != null ?dy.getBigDecimal("zcgj_otheramt"): BigDecimal.ZERO;
BigDecimal zcgjTotalamt = dy.getBigDecimal("zcgj_totalamt") != null ?dy.getBigDecimal("zcgj_totalamt"): BigDecimal.ZERO;
cashamtAll = cashamtAll.add(zcgjCashamt);
bankamtAll = bankamtAll.add(zcgjBankamt);
businessamtAll = businessamtAll.add(zcgjBusinessamt);
supplyamtAll = supplyamtAll.add(zcgjSupplyamt);
otheramtAll = otheramtAll.add(zcgjOtheramt);
totalamtAll = totalamtAll.add(zcgjTotalamt);
}
}
}
DynamicObject fundplyentry3 = fundplyentry.get(3);
fundplyentry3.set("zcgj_cashamt", cashamtAll);
fundplyentry3.set("zcgj_bankamt", bankamtAll);
fundplyentry3.set("zcgj_businessamt", businessamtAll);
fundplyentry3.set("zcgj_supplyamt", supplyamtAll);
fundplyentry3.set("zcgj_otheramt", otheramtAll);
fundplyentry3.set("zcgj_totalamt", totalamtAll);
this.getModel().setValue("zcgj_cashamtbak", cashamtAll);
this.getModel().setValue("zcgj_bankamtbak", bankamtAll);
this.getModel().setValue("zcgj_businessamtbak", businessamtAll);
this.getModel().setValue("zcgj_supplyamtbak", supplyamtAll);
this.getModel().setValue("zcgj_otheramtbak", otheramtAll);
this.getModel().setValue("zcgj_totalamtbak", totalamtAll);
this.getView().updateView("zcgj_fundplyentry");
this.getView().updateView("zcgj_cashamtbak");
this.getView().updateView("zcgj_bankamtbak");
this.getView().updateView("zcgj_businessamtbak");
this.getView().updateView("zcgj_supplyamtbak");
this.getView().updateView("zcgj_otheramtbak");
this.getView().updateView("zcgj_totalamtbak");
}
}
}
@Override
@ -279,40 +350,43 @@ public class FundingplanapplyPlugin extends AbstractBillPlugIn implements Plugin
int rowIndex = changeData.getRowIndex();
DynamicObjectCollection fundplyentry = this.getModel().getDataEntity(true).getDynamicObjectCollection("zcgj_fundplyentry");
//4-5+3
BigDecimal zcgjCashamt4 = fundplyentry.get(4).getBigDecimal("zcgj_cashamt") == null?BigDecimal.ZERO:fundplyentry.get(4).getBigDecimal("zcgj_cashamt");
BigDecimal zcgjBankamt4 = fundplyentry.get(4).getBigDecimal("zcgj_bankamt") == null?BigDecimal.ZERO:fundplyentry.get(4).getBigDecimal("zcgj_bankamt");
BigDecimal zcgjBusinessamt4 = fundplyentry.get(4).getBigDecimal("zcgj_businessamt") == null?BigDecimal.ZERO:fundplyentry.get(4).getBigDecimal("zcgj_businessamt");
BigDecimal zcgjSupplyamt4 = fundplyentry.get(4).getBigDecimal("zcgj_supplyamt") == null?BigDecimal.ZERO: fundplyentry.get(4).getBigDecimal("zcgj_supplyamt") ;
//5-6+4
BigDecimal zcgjCashamt5 = fundplyentry.get(5).getBigDecimal("zcgj_cashamt") == null?BigDecimal.ZERO:fundplyentry.get(4).getBigDecimal("zcgj_cashamt");
BigDecimal zcgjBankamt5 = fundplyentry.get(5).getBigDecimal("zcgj_bankamt") == null?BigDecimal.ZERO:fundplyentry.get(4).getBigDecimal("zcgj_bankamt");
BigDecimal zcgjBusinessamt5 = fundplyentry.get(5).getBigDecimal("zcgj_businessamt") == null?BigDecimal.ZERO:fundplyentry.get(4).getBigDecimal("zcgj_businessamt");
BigDecimal zcgjSupplyamt5 = fundplyentry.get(5).getBigDecimal("zcgj_supplyamt") == null?BigDecimal.ZERO: fundplyentry.get(4).getBigDecimal("zcgj_supplyamt") ;
BigDecimal zcgjOtheramt5 = fundplyentry.get(5).getBigDecimal("zcgj_otheramt")== null?BigDecimal.ZERO:fundplyentry.get(4).getBigDecimal("zcgj_otheramt");
BigDecimal zcgjCashamt6 = fundplyentry.get(6).getBigDecimal("zcgj_cashamt")== null?BigDecimal.ZERO:fundplyentry.get(6).getBigDecimal("zcgj_cashamt");
BigDecimal zcgjBankamt6 = fundplyentry.get(6).getBigDecimal("zcgj_bankamt")== null?BigDecimal.ZERO:fundplyentry.get(6).getBigDecimal("zcgj_bankamt");
BigDecimal zcgjBusinessamt6 = fundplyentry.get(6).getBigDecimal("zcgj_businessamt")== null?BigDecimal.ZERO:fundplyentry.get(6).getBigDecimal("zcgj_businessamt");
BigDecimal zcgjSupplyamt6 = fundplyentry.get(6).getBigDecimal("zcgj_supplyamt")== null?BigDecimal.ZERO:fundplyentry.get(6).getBigDecimal("zcgj_supplyamt");
BigDecimal zcgjOtheramt6 = fundplyentry.get(6).getBigDecimal("zcgj_otheramt")== null?BigDecimal.ZERO:fundplyentry.get(6).getBigDecimal("zcgj_otheramt");
BigDecimal zcgjCashamt4 = fundplyentry.get(4).getBigDecimal("zcgj_cashamt")== null?BigDecimal.ZERO:fundplyentry.get(4).getBigDecimal("zcgj_cashamt");
BigDecimal zcgjBankamt4 = fundplyentry.get(4).getBigDecimal("zcgj_bankamt")== null?BigDecimal.ZERO:fundplyentry.get(4).getBigDecimal("zcgj_bankamt");
BigDecimal zcgjBusinessamt4 = fundplyentry.get(4).getBigDecimal("zcgj_businessamt")== null?BigDecimal.ZERO:fundplyentry.get(4).getBigDecimal("zcgj_businessamt");
BigDecimal zcgjSupplyamt4 = fundplyentry.get(4).getBigDecimal("zcgj_supplyamt")== null?BigDecimal.ZERO:fundplyentry.get(4).getBigDecimal("zcgj_supplyamt");
BigDecimal zcgjOtheramt4 = fundplyentry.get(4).getBigDecimal("zcgj_otheramt")== null?BigDecimal.ZERO:fundplyentry.get(4).getBigDecimal("zcgj_otheramt");
BigDecimal zcgjCashamt5 = fundplyentry.get(5).getBigDecimal("zcgj_cashamt")== null?BigDecimal.ZERO:fundplyentry.get(5).getBigDecimal("zcgj_cashamt");
BigDecimal zcgjBankamt5 = fundplyentry.get(5).getBigDecimal("zcgj_bankamt")== null?BigDecimal.ZERO:fundplyentry.get(5).getBigDecimal("zcgj_bankamt");
BigDecimal zcgjBusinessamt5 = fundplyentry.get(5).getBigDecimal("zcgj_businessamt")== null?BigDecimal.ZERO:fundplyentry.get(5).getBigDecimal("zcgj_businessamt");
BigDecimal zcgjSupplyamt5 = fundplyentry.get(5).getBigDecimal("zcgj_supplyamt")== null?BigDecimal.ZERO:fundplyentry.get(5).getBigDecimal("zcgj_supplyamt");
BigDecimal zcgjOtheramt5 = fundplyentry.get(5).getBigDecimal("zcgj_otheramt")== null?BigDecimal.ZERO:fundplyentry.get(5).getBigDecimal("zcgj_otheramt");
BigDecimal zcgjCashamt3 = fundplyentry.get(3).getBigDecimal("zcgj_cashamt")== null?BigDecimal.ZERO:fundplyentry.get(3).getBigDecimal("zcgj_cashamt");
BigDecimal zcgjBankamt3 = fundplyentry.get(3).getBigDecimal("zcgj_bankamt")== null?BigDecimal.ZERO:fundplyentry.get(3).getBigDecimal("zcgj_bankamt");
BigDecimal zcgjBusinessamt3 = fundplyentry.get(3).getBigDecimal("zcgj_businessamt")== null?BigDecimal.ZERO:fundplyentry.get(3).getBigDecimal("zcgj_businessamt");
BigDecimal zcgjSupplyamt3 = fundplyentry.get(3).getBigDecimal("zcgj_supplyamt")== null?BigDecimal.ZERO:fundplyentry.get(3).getBigDecimal("zcgj_supplyamt");
BigDecimal zcgjOtheramt3 = fundplyentry.get(3).getBigDecimal("zcgj_otheramt")== null?BigDecimal.ZERO:fundplyentry.get(3).getBigDecimal("zcgj_otheramt");
fundplyentry.get(6).set("zcgj_cashamt",zcgjCashamt4.subtract(zcgjCashamt5).add(zcgjCashamt3));
fundplyentry.get(6).set("zcgj_bankamt",zcgjBankamt4.subtract(zcgjBankamt5).add(zcgjBankamt3));
fundplyentry.get(6).set("zcgj_businessamt",zcgjBusinessamt4.subtract(zcgjBusinessamt5).add(zcgjBusinessamt3));
fundplyentry.get(6).set("zcgj_supplyamt",zcgjSupplyamt4.subtract(zcgjSupplyamt5).add(zcgjSupplyamt3));
fundplyentry.get(6).set("zcgj_otheramt",zcgjOtheramt4.subtract(zcgjOtheramt5).add(zcgjOtheramt3));
BigDecimal allAmt = fundplyentry.get(6).getBigDecimal("zcgj_cashamt")
.add(fundplyentry.get(6).getBigDecimal("zcgj_bankamt"))
.add(fundplyentry.get(6).getBigDecimal("zcgj_businessamt"))
.add(fundplyentry.get(6).getBigDecimal("zcgj_supplyamt"))
.add(fundplyentry.get(6).getBigDecimal("zcgj_otheramt"));
fundplyentry.get(6).set("zcgj_totalamt",allAmt);
fundplyentry.get(7).set("zcgj_cashamt",zcgjCashamt5.subtract(zcgjCashamt6).add(zcgjCashamt4));
fundplyentry.get(7).set("zcgj_bankamt",zcgjBankamt5.subtract(zcgjBankamt6).add(zcgjBankamt4));
fundplyentry.get(7).set("zcgj_businessamt",zcgjBusinessamt5.subtract(zcgjBusinessamt6).add(zcgjBusinessamt4));
fundplyentry.get(7).set("zcgj_supplyamt",zcgjSupplyamt5.subtract(zcgjSupplyamt6).add(zcgjSupplyamt4));
fundplyentry.get(7).set("zcgj_otheramt",zcgjOtheramt5.subtract(zcgjOtheramt6).add(zcgjOtheramt4));
BigDecimal allAmt = fundplyentry.get(7).getBigDecimal("zcgj_cashamt")
.add(fundplyentry.get(7).getBigDecimal("zcgj_bankamt"))
.add(fundplyentry.get(7).getBigDecimal("zcgj_businessamt"))
.add(fundplyentry.get(7).getBigDecimal("zcgj_supplyamt"))
.add(fundplyentry.get(7).getBigDecimal("zcgj_otheramt"));
fundplyentry.get(7).set("zcgj_totalamt",allAmt);
//锁定
this.getView().setEnable(false, 6, "zcgj_cashamt","zcgj_bankamt","zcgj_businessamt","zcgj_supplyamt","zcgj_otheramt","zcgj_totalamt");
this.getView().setEnable(false, 3, "zcgj_cashamt","zcgj_bankamt","zcgj_businessamt","zcgj_supplyamt","zcgj_otheramt","zcgj_totalamt");
this.getView().setEnable(false, 7, "zcgj_cashamt","zcgj_bankamt","zcgj_businessamt","zcgj_supplyamt","zcgj_otheramt","zcgj_totalamt");
this.getView().updateView("zcgj_fundplyentry",rowIndex);
this.getView().updateView("zcgj_fundplyentry",6);
this.getView().updateView("zcgj_fundplyentry",3);
this.getView().updateView("zcgj_fundplyentry",7);
//本月申请金额带入财务部核定金额分录
if(rowIndex == 2){
@ -322,11 +396,15 @@ public class FundingplanapplyPlugin extends AbstractBillPlugIn implements Plugin
}
public void calfinApprovedAmount(DynamicObjectCollection fundplyentry){
//本次申请金额
BigDecimal zcgjCashamt2 = fundplyentry.get(2).getBigDecimal("zcgj_cashamt")== null?BigDecimal.ZERO:fundplyentry.get(2).getBigDecimal("zcgj_cashamt");
BigDecimal zcgjBankamt2 = fundplyentry.get(2).getBigDecimal("zcgj_bankamt")== null?BigDecimal.ZERO:fundplyentry.get(2).getBigDecimal("zcgj_bankamt");
BigDecimal zcgjBusinessamt2 = fundplyentry.get(2).getBigDecimal("zcgj_businessamt")== null?BigDecimal.ZERO:fundplyentry.get(2).getBigDecimal("zcgj_businessamt");
BigDecimal zcgjSupplyamt2 = fundplyentry.get(2).getBigDecimal("zcgj_supplyamt")== null?BigDecimal.ZERO:fundplyentry.get(2).getBigDecimal("zcgj_supplyamt");
BigDecimal zcgjOtheramt2 = fundplyentry.get(2).getBigDecimal("zcgj_otheramt")== null?BigDecimal.ZERO:fundplyentry.get(2).getBigDecimal("zcgj_otheramt");
BigDecimal zcgjTotalamt2 = fundplyentry.get(2).getBigDecimal("zcgj_totalamt")== null?BigDecimal.ZERO:fundplyentry.get(2).getBigDecimal("zcgj_totalamt");
DynamicObjectCollection zcgjFinApprovedAmount = this.getModel().getDataEntity().getDynamicObjectCollection("zcgj_fin_approved_amount");
for (DynamicObject dynamicObject : zcgjFinApprovedAmount) {
@ -363,7 +441,34 @@ public class FundingplanapplyPlugin extends AbstractBillPlugIn implements Plugin
dynamicObject.set("zcgj_amount_remaining",zcgjOtheramt2);
}
}
BigDecimal zcgjCashamtbak = (BigDecimal) this.getModel().getValue("zcgj_cashamtbak");
BigDecimal zcgjBankamtbak = (BigDecimal) this.getModel().getValue("zcgj_bankamtbak");
BigDecimal zcgjBusinessamtbak = (BigDecimal) this.getModel().getValue("zcgj_businessamtbak");
BigDecimal zcgjSupplyamtbak = (BigDecimal) this.getModel().getValue("zcgj_supplyamtbak");
BigDecimal zcgjOtheramtbak = (BigDecimal) this.getModel().getValue("zcgj_otheramtbak");
BigDecimal zcgjTotalamtbak = (BigDecimal) this.getModel().getValue("zcgj_totalamtbak");
DynamicObjectCollection zcgjFundplyentry = this.getModel().getDataEntity().getDynamicObjectCollection("zcgj_fundplyentry");
DynamicObject zcgjFundplyentry3 = zcgjFundplyentry.get(3);
zcgjCashamtbak = zcgjCashamtbak.add(zcgjCashamt2);
zcgjBankamtbak = zcgjBankamtbak.add(zcgjBankamt2);
zcgjBusinessamtbak = zcgjBusinessamtbak.add(zcgjBusinessamt2);
zcgjSupplyamtbak = zcgjSupplyamtbak.add(zcgjSupplyamt2);
zcgjOtheramtbak = zcgjOtheramtbak.add(zcgjOtheramt2);
zcgjTotalamtbak = zcgjTotalamtbak.add(zcgjTotalamt2);
zcgjFundplyentry3.set("zcgj_cashamt",zcgjCashamtbak);
zcgjFundplyentry3.set("zcgj_bankamt",zcgjBankamtbak);
zcgjFundplyentry3.set("zcgj_businessamt",zcgjBusinessamtbak);
zcgjFundplyentry3.set("zcgj_supplyamt",zcgjSupplyamtbak);
zcgjFundplyentry3.set("zcgj_otheramt",zcgjOtheramtbak);
zcgjFundplyentry3.set("zcgj_totalamt",zcgjTotalamtbak);
getView().updateView("zcgj_fin_approved_amount");
getView().updateView("zcgj_fundplyentry");
}
// 获取某年份的第一天

View File

@ -183,7 +183,7 @@ public class InContractFinaceConfirmeInvoicePlugin extends AbstractBillPlugIn im
DynamicObject org = (DynamicObject)this.getModel().getValue("zcgj_invoice_org");
//List<InvoiceVO> invoiceVOList = InvoiceDataHandleHelper.parseXhInvoiceCloudReturnData(returnData);
List<InvoiceVO> invoiceVOList = CustomInvoiceDataHandleHelper.parseXhInvoiceCloudReturnData(returnData);
Map<Boolean, Set<DynamicObject>> invoiceMap = InvoiceDataHandleHelper.processInvoiceVO(invoiceVOList, RequestContext.get().getCurrUserId(),
Map<Boolean, Set<DynamicObject>> invoiceMap = CustomInvoiceDataHandleHelper.processInvoiceVO(invoiceVOList, RequestContext.get().getCurrUserId(),
org.getLong("id"), new Date(), "ec_out_invoice", (DynamicObject)this.getModel().getValue("zcgj_currency"), true);
ImportInvoiceUtils invoiceUtils = new ImportInvoiceUtils(this.getView(), this.getPageCache());
this.addInvoiceToEntry(invoiceUtils, invoiceMap);

View File

@ -247,7 +247,7 @@ public class MaterialInbFinaceConfirmeInvoicePlugin extends AbstractBillPlugIn i
} else {
currency = (DynamicObject) this.getModel().getValue("stdcurrency");//本位币别
}
Map<Boolean, Set<DynamicObject>> invoiceMap = InvoiceDataHandleHelper.processInvoiceVO(invoiceVOList, RequestContext.get().getCurrUserId(),
Map<Boolean, Set<DynamicObject>> invoiceMap = CustomInvoiceDataHandleHelper.processInvoiceVO(invoiceVOList, RequestContext.get().getCurrUserId(),
org.getLong("id"), new Date(), "ec_in_invoice", currency, true);
ImportInvoiceUtils invoiceUtils = new ImportInvoiceUtils(this.getView(), this.getPageCache());
this.addInvoiceToEntry(invoiceUtils, invoiceMap);
@ -299,7 +299,7 @@ public class MaterialInbFinaceConfirmeInvoicePlugin extends AbstractBillPlugIn i
if (unApplyAmount != null && unApplyAmount.doubleValue() <= (double) 0.0F) {
this.getView().showTipNotification(String.format(ResManager.loadKDString("发票号码%s金额已经被关联完毕不可重复使用", "PaymentApplyEditUI_23", "ec-contract-formplugin", new Object[0]), invoice.getString("invoiceno")));
} else {
// DynamicObject upContract = (DynamicObject) this.getModel().getValue("zcgj_contract");
DynamicObject upContract = (DynamicObject) this.getModel().getValue("contract");
int rowIndex = this.getModel().createNewEntryRow("zcgj_entryentity");
this.getModel().setValue("zcgj_invoice", invoice.getPkValue(), rowIndex);
this.getModel().setValue("zcgj_invoicecurrency", invoice.getDynamicObject("currency") == null ? Long.valueOf("0") : invoice.getDynamicObject("currency").getPkValue(), rowIndex);
@ -310,7 +310,7 @@ public class MaterialInbFinaceConfirmeInvoicePlugin extends AbstractBillPlugIn i
this.getModel().setValue("zcgj_unapplyinvtax", invoice.getBigDecimal("unapplyinvtax"), rowIndex);
this.getModel().setValue("zcgj_applyinvoftaxamt", invoice.getBigDecimal("unapplyamount"), rowIndex);
invoice.set("isclaimed", true);
// invoice.set("contract", upContract);
invoice.set("contract", upContract);
invoice.set("project", (DynamicObject) this.getModel().getValue("project"));
invoice.set("connecttype", "contract");
invArr.add(invoice);