|
@@ -4,6 +4,7 @@ import com.alibaba.druid.util.StringUtils;
|
|
|
import dm.jdbc.util.StringUtil;
|
|
|
import fi.cas.common.SettlementStatusEnum;
|
|
|
import kd.bos.dataentity.entity.DynamicObject;
|
|
|
+import kd.bos.dataentity.entity.DynamicObjectCollection;
|
|
|
import kd.bos.entity.plugin.AbstractOperationServicePlugIn;
|
|
|
import kd.bos.entity.plugin.args.BeginOperationTransactionArgs;
|
|
|
import kd.bos.orm.query.QCP;
|
|
@@ -12,6 +13,7 @@ import kd.bos.servicehelper.BusinessDataServiceHelper;
|
|
|
import kd.bos.servicehelper.operation.SaveServiceHelper;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
+import java.util.Date;
|
|
|
import java.util.HashMap;
|
|
|
|
|
|
//付款处理单付款反写
|
|
@@ -28,6 +30,14 @@ public class PaymentProcessOpPlugin extends AbstractOperationServicePlugIn {
|
|
|
for (int i = 0; i < dynamicObjects.length; i++) {
|
|
|
//当前单头数据包
|
|
|
DynamicObject info = BusinessDataServiceHelper.loadSingle(dynamicObjects[i].getPkValue(), dynamicObjects[i].getDynamicObjectType().getName());
|
|
|
+ //付款金额
|
|
|
+ BigDecimal actpayamt = info.getBigDecimal("actpayamt");
|
|
|
+ //单据编号
|
|
|
+ String billno = info.getString("billno");
|
|
|
+ //付款处理id
|
|
|
+ long id = info.getLong("id");
|
|
|
+ //付款日期
|
|
|
+ Date paydate = info.getDate("paydate");
|
|
|
//获取源单id
|
|
|
Long sourcebillid = info.getLong("sourcebillid");
|
|
|
//存储源单分录id和付款处理分录实付金额
|
|
@@ -181,6 +191,15 @@ public class PaymentProcessOpPlugin extends AbstractOperationServicePlugIn {
|
|
|
htInfo.set("nckd_settleamount", nckd_settleamount);
|
|
|
htInfo.set("nckd_unsettleamount", nckd_unsettleamount);
|
|
|
}
|
|
|
+
|
|
|
+ //反写付款明细
|
|
|
+ DynamicObjectCollection entryEntity = htInfo.getDynamicObjectCollection("nckd_payentry");
|
|
|
+ DynamicObject entry1 = entryEntity.addNew();
|
|
|
+ entry1.set("nckd_pay_billno1", billno);//付款处理单据编号
|
|
|
+ entry1.set("nckd_pay_id1", id);//付款处理单据id
|
|
|
+ entry1.set("nckd_amountfield1", actpayamt);//付款金额
|
|
|
+ entry1.set("nckd_timefield1", paydate);//付款日期
|
|
|
+
|
|
|
SaveServiceHelper.save(new DynamicObject[]{htInfo});
|
|
|
}
|
|
|
}
|