添加注释

This commit is contained in:
xuhaihui 2025-06-17 14:37:14 +08:00
parent 914e721dfa
commit 4824ca3b57
1 changed files with 29 additions and 27 deletions

View File

@ -22,12 +22,13 @@ import java.util.Iterator;
import java.util.List;
import java.util.Map;
// 付款申请单提交审核操作插件
public class PaymentApplyFundExtOp extends PaymentApplyFundOp {
@Override
public void onPreparePropertys(PreparePropertysEventArgs e) {
super.onPreparePropertys(e);
// e.getFieldKeys().add("zcgj_pricetype");
// e.getFieldKeys().add("zcgj_pricetype");
}
@Override
@ -48,60 +49,61 @@ public class PaymentApplyFundExtOp extends PaymentApplyFundOp {
int var4 = dataEntities.length;
label50:
for(int var5 = 0; var5 < var4; ++var5) {
for (int var5 = 0; var5 < var4; ++var5) {
DynamicObject paymentApply = var3[var5];
DynamicObjectCollection entryCol = paymentApply.getDynamicObjectCollection("entryentity");
DynamicObjectCollection entryCol = paymentApply.getDynamicObjectCollection("entryentity");//付款信息分录
Iterator var8 = entryCol.iterator();
while(true) {
while(true) {
while (true) {
while (true) {
if (!var8.hasNext()) {
continue label50;
}
DynamicObject entry = (DynamicObject)var8.next();
DynamicObject contract = entry.getDynamicObject("contract");
if(contract != null){
BigDecimal thisApplyOfTaxAmt = entry.getBigDecimal("applyoftaxamount");
BigDecimal deduction = entry.getBigDecimal("thisdeduction");
BigDecimal contractDeduction = (BigDecimal)contractDeductionMap.getOrDefault(contract.getLong("id"), BigDecimal.ZERO);
DynamicObject entry = (DynamicObject) var8.next();
DynamicObject contract = entry.getDynamicObject("contract");//合同名称
if (contract != null) {
BigDecimal thisApplyOfTaxAmt = entry.getBigDecimal("applyoftaxamount");//本次应付金额
BigDecimal deduction = entry.getBigDecimal("thisdeduction");//本期预付款抵扣
BigDecimal contractDeduction = (BigDecimal) contractDeductionMap.getOrDefault(contract.getLong("id"), BigDecimal.ZERO);
contractDeductionMap.put(contract.getLong("id"), contractDeduction.add(deduction));
String type = entry.getString("paymenttype");
String type = entry.getString("paymenttype");//支付类型
QFilter contractFilter = new QFilter("contract", "=", contract.getLong("id"));
QFilter typeFilter = new QFilter("type", "=", type);
DynamicObject node = entry.getDynamicObject("paynode");
String nodeText = entry.getString("paynodetext");
DynamicObject node = entry.getDynamicObject("paynode");//节点隐藏
String nodeText = entry.getString("paynodetext");//节点
if (node != null) {
typeFilter.and("paynode", "=", node.getPkValue());
} else if (StringUtils.isNotEmpty(nodeText)) {
typeFilter.and("node", "=", nodeText);
}
DynamicObject[] contTypeAmts = BusinessDataServiceHelper.load("ecpf_conttypeamt", "totalshowamt,totaldeductionamt", new QFilter[]{contractFilter, typeFilter});
DynamicObject[] contTypeAmts = BusinessDataServiceHelper.load("ecpf_conttypeamt",
"totalshowamt,totaldeductionamt", new QFilter[]{contractFilter, typeFilter});//合同的收付类型对应金额单
if (contTypeAmts != null && contTypeAmts.length != 0) {
DynamicObject[] var28 = contTypeAmts;
int var26 = contTypeAmts.length;
for(int var27 = 0; var27 < var26; ++var27) {
for (int var27 = 0; var27 < var26; ++var27) {
DynamicObject contTypeAmt = var28[var27];
BigDecimal totalShowAmt = contTypeAmt.getBigDecimal("totalshowamt");
BigDecimal totalShowAmt = contTypeAmt.getBigDecimal("totalshowamt");//合同的收付类型对应金额单-累计应付金额
contTypeAmt.set("totalshowamt", totalShowAmt.add(thisApplyOfTaxAmt));
BigDecimal totalDeduction = contTypeAmt.getBigDecimal("totaldeductionamt");
BigDecimal totalDeduction = contTypeAmt.getBigDecimal("totaldeductionamt");//合同的收付类型对应金额单-累计申请抵扣金额
contTypeAmt.set("totaldeductionamt", totalDeduction.add(deduction));
}
SaveServiceHelper.save(contTypeAmts);
} else {
BigDecimal payRate = entry.getBigDecimal("controlrate");
MainEntityType entityType = EntityMetadataCache.getDataEntityType("ecpf_conttypeamt");
BigDecimal payRate = entry.getBigDecimal("controlrate");//付款控制比例%
MainEntityType entityType = EntityMetadataCache.getDataEntityType("ecpf_conttypeamt");//合同的收付类型对应金额单
DynamicObject newContTypeAmtObj = new DynamicObject(entityType);
newContTypeAmtObj.set("contract", contract);
newContTypeAmtObj.set("type", type);
newContTypeAmtObj.set("ratio", payRate);
newContTypeAmtObj.set("totalshowamt", thisApplyOfTaxAmt);
newContTypeAmtObj.set("totaldeductionamt", deduction);
newContTypeAmtObj.set("paynode", entry.get("paynode"));
newContTypeAmtObj.set("node", entry.get("paynode") == null ? entry.get("paynodetext") : "");
newContTypeAmtObj.set("contract", contract);//合同
newContTypeAmtObj.set("type", type);//收付款类型
newContTypeAmtObj.set("ratio", payRate);//收付款比例%
newContTypeAmtObj.set("totalshowamt", thisApplyOfTaxAmt);//累计应付金额
newContTypeAmtObj.set("totaldeductionamt", deduction);//累计申请抵扣金额
newContTypeAmtObj.set("paynode", entry.get("paynode"));//节点隐藏
newContTypeAmtObj.set("node", entry.get("paynode") == null ? entry.get("paynodetext") : "");//节点
SaveServiceHelper.save(new DynamicObject[]{newContTypeAmtObj});
}
}