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