|
|
@@ -10,10 +10,13 @@ import kd.bos.form.control.events.ItemClickEvent;
|
|
|
import kd.bos.form.events.BeforeDoOperationEventArgs;
|
|
|
import kd.bos.form.operate.FormOperate;
|
|
|
import kd.bos.form.plugin.AbstractFormPlugin;
|
|
|
+import kd.bos.logging.Log;
|
|
|
+import kd.bos.logging.LogFactory;
|
|
|
import kd.bos.orm.query.QCP;
|
|
|
import kd.bos.orm.query.QFilter;
|
|
|
import kd.bos.servicehelper.QueryServiceHelper;
|
|
|
import kd.sdk.plugin.Plugin;
|
|
|
+import nckd.xtpoc.fi.app.plugin.operate.PublicReimburseCusOpPlugin;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
import java.util.ArrayList;
|
|
|
@@ -25,7 +28,7 @@ import java.util.List;
|
|
|
*/
|
|
|
public class SettlebillFormPlugin extends AbstractFormPlugin implements Plugin {
|
|
|
|
|
|
-
|
|
|
+ private static final Log logger = LogFactory.getLog(SettlebillFormPlugin.class);
|
|
|
/**
|
|
|
* 结算规则 费用预提单
|
|
|
*/
|
|
|
@@ -189,7 +192,6 @@ public class SettlebillFormPlugin extends AbstractFormPlugin implements Plugin {
|
|
|
newEntry.set("nckd_billtype", "费用预提单");
|
|
|
newEntry.set("nckd_billno", maintDyn.getString("billno"));
|
|
|
newEntry.set("nckd_date", maintDyn.getDate("fiperiod"));
|
|
|
- newEntry.set("nckd_supp", "");
|
|
|
newEntry.set("nckd_amount", maintDyn.getBigDecimal("expenseentryentity.expenseamount"));
|
|
|
newEntry.set("nckd_writeamount", maintDyn.getBigDecimal("expenseentryentity.expenseamount"));
|
|
|
descEntries.add(newEntry);
|
|
|
@@ -221,7 +223,8 @@ public class SettlebillFormPlugin extends AbstractFormPlugin implements Plugin {
|
|
|
newEntry.set("nckd_billtype1", "对公报销");
|
|
|
newEntry.set("nckd_billno1", assistDyn.getString("billno"));
|
|
|
newEntry.set("nckd_date1", assistDyn.getDate("bizdate"));
|
|
|
- newEntry.set("nckd_supp1", assistDyn.getString("billpayerid.name"));
|
|
|
+ logger.info("SettlebillFormPlugin: "+assistDyn.getString("billpayerid.name"));
|
|
|
+ newEntry.set("nckd_supp", assistDyn.getString("billpayerid.name"));
|
|
|
newEntry.set("nckd_amount1", assistDyn.getBigDecimal("expenseentryentity.expenseamount"));
|
|
|
newEntry.set("nckd_writeoffamount", assistDyn.getBigDecimal("expenseentryentity.expenseamount"));
|
|
|
descEntries1.add(newEntry);
|
|
|
@@ -259,10 +262,12 @@ public class SettlebillFormPlugin extends AbstractFormPlugin implements Plugin {
|
|
|
BigDecimal mainUnwrittenAmount = mainBill.getBigDecimal("nckd_writeamount");
|
|
|
if (mainUnwrittenAmount == null || mainUnwrittenAmount.compareTo(BigDecimal.ZERO) <= 0) {
|
|
|
System.out.println("第" + (i+1) + "行主体金额已无未核销金额,跳过");
|
|
|
+ logger.info("SettlebillFormPlugin: "+"第" + (i+1) + "行主体金额已无未核销金额,跳过");
|
|
|
continue;
|
|
|
}
|
|
|
|
|
|
System.out.println("处理第" + (i+1) + "行主体金额,未核销金额:" + mainUnwrittenAmount);
|
|
|
+ logger.info("SettlebillFormPlugin: "+ "处理第" + (i+1) + "行主体金额,未核销金额:" + mainUnwrittenAmount);
|
|
|
|
|
|
// 对当前主体行与辅助集进行逐行核销
|
|
|
BigDecimal remainingMainAmount = mainUnwrittenAmount;
|
|
|
@@ -293,12 +298,17 @@ public class SettlebillFormPlugin extends AbstractFormPlugin implements Plugin {
|
|
|
System.out.println("主体行" + (i+1) + "与辅助行" + (j+1) + "核销金额:" + writeOffAmount +
|
|
|
",主体剩余未核销:" + remainingMainAmount +
|
|
|
",辅助剩余未核销:" + newAssistUnwrittenAmount);
|
|
|
+ logger.info("SettlebillFormPlugin: "+ (i+1) + "与辅助行" + (j+1) + "核销金额:" + writeOffAmount +
|
|
|
+ ",主体剩余未核销:" + remainingMainAmount +
|
|
|
+ ",辅助剩余未核销:" + newAssistUnwrittenAmount);
|
|
|
}
|
|
|
|
|
|
if (remainingMainAmount.compareTo(BigDecimal.ZERO) <= 0) {
|
|
|
System.out.println("第" + (i+1) + "行主体金额已全部核销完成");
|
|
|
+ logger.info("SettlebillFormPlugin: "+ (i+1) + "行主体金额已全部核销完成");
|
|
|
} else {
|
|
|
System.out.println("第" + (i+1) + "行主体金额部分核销,剩余未核销金额:" + remainingMainAmount);
|
|
|
+ logger.info("SettlebillFormPlugin: 第" + (i+1) + "行主体金额部分核销,剩余未核销金额:" + remainingMainAmount);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -306,6 +316,7 @@ public class SettlebillFormPlugin extends AbstractFormPlugin implements Plugin {
|
|
|
checkRemainingAssistAmounts();
|
|
|
|
|
|
System.out.println("主体与辅助金额集逐行核销处理完成");
|
|
|
+ logger.info("SettlebillFormPlugin: 主体与辅助金额集逐行核销处理完成");
|
|
|
}
|
|
|
|
|
|
/**
|