parent
b5c75191ee
commit
66caff6a37
|
|
@ -78,7 +78,7 @@ public class CdmInterestAccrualPlugin extends AbstractOperationServicePlugIn imp
|
|||
String FeeBillSelectField = "id,billno,org,feetype,currency,amountrate,payamt,kdsz_pushjx";
|
||||
DynamicObject[] feeBills = BusinessDataServiceHelper.load(FeeBill_KEY, FeeBillSelectField, new QFilter[]{filter});
|
||||
if (feeBills == null || feeBills.length == 0){
|
||||
logger.info("应付票据:" + billNo + "没有费用明细无需下推!");
|
||||
logger.info("应付票据:" + billNo + "没有费用明细需要下推!");
|
||||
continue;
|
||||
}
|
||||
OperationResult result = genJXBill(dataMap,feeBills);
|
||||
|
|
@ -97,8 +97,8 @@ public class CdmInterestAccrualPlugin extends AbstractOperationServicePlugIn imp
|
|||
payEntry.set("kdsz_interestbill",successPkId);
|
||||
payEntry.set("kdsz_interestbillno",jxBill.getString("billno"));
|
||||
payEntry.set("kdsz_interestbillid",successPkId);
|
||||
// payEntry.set("",);
|
||||
// payEntry.set("",);
|
||||
payEntry.set("kdsz_valuedate",jxBill.getDate("kdsz_valuedate"));
|
||||
payEntry.set("kdsz_settledate",jxBill.getDate("kdsz_maturitydate"));
|
||||
// payEntry.set("",);
|
||||
}
|
||||
SaveServiceHelper.save(new DynamicObject[]{bill});
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ import kd.bos.servicehelper.operation.SaveServiceHelper;
|
|||
import kd.sdk.plugin.Plugin;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
|
||||
/**
|
||||
* 计息单删除校验以及反写上游开票登记、费用明细下推状态
|
||||
|
|
@ -56,6 +57,7 @@ public class InterestAccrualDeletePlugin extends AbstractOperationServicePlugIn
|
|||
for (DynamicObject bill : bills) {
|
||||
String srcEntity = bill.getString("kdsz_srcentity");
|
||||
Object srcBillId = bill.get("kdsz_srcbillid");
|
||||
//根据源单id,源单类型找到源单并将下推状态改为未下推
|
||||
DynamicObject feeBill = BusinessDataServiceHelper.loadSingle(srcBillId, srcEntity);
|
||||
if (feeBill != null) {
|
||||
feeBill.set("kdsz_pushjx","A");
|
||||
|
|
@ -66,18 +68,22 @@ public class InterestAccrualDeletePlugin extends AbstractOperationServicePlugIn
|
|||
long pjId = feeEntry.getLong("srcbillid");
|
||||
srcBillIds.add(pjId);
|
||||
}
|
||||
//根据费用明细分录的上游id查询上游单据的付息记录并将本条计息单的记录删除
|
||||
QFilter filter = new QFilter("id", "in", srcBillIds);
|
||||
// TODO: 2025/12/10 暂时定为开票登记
|
||||
Long id = bill.getLong("id");
|
||||
DynamicObject[] srcBills = BusinessDataServiceHelper.load("cdm_payablebill",
|
||||
"id,kdsz_payentry.kdsz_interestbillid", new QFilter[]{filter});
|
||||
for (DynamicObject srcBill : srcBills) {
|
||||
DynamicObjectCollection srcPayEntries = srcBill.getDynamicObjectCollection("kdsz_payentry");
|
||||
for (int i = srcPayEntries.size() - 1; i > 0 ; i--) {
|
||||
DynamicObject srcPayEntry = srcPayEntries.get(i);
|
||||
long srcJXBillId = srcPayEntry.getLong("kdsz_interestbillid");
|
||||
long id = bill.getLong("id");
|
||||
if (srcJXBillId == id){
|
||||
srcPayEntries.remove( i);
|
||||
if (srcPayEntries != null){
|
||||
Iterator<DynamicObject> iterator = srcPayEntries.iterator();
|
||||
while (iterator.hasNext()){
|
||||
DynamicObject next = iterator.next();
|
||||
Long srcJXBillId = next.getLong("kdsz_interestbillid");
|
||||
if (srcJXBillId.compareTo( id) == 0){
|
||||
iterator.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue