提交人:陈绍鑫

日期:2025/6/4 12:30
内容:担保合同列表插件
This commit is contained in:
陈绍鑫 2025-06-04 15:48:02 +08:00
parent 5571bfd3bb
commit 948b6a0372
1 changed files with 8 additions and 2 deletions

View File

@ -10,6 +10,7 @@ import kd.bos.orm.query.QFilter;
import kd.bos.servicehelper.BusinessDataServiceHelper;
import kd.bos.servicehelper.QueryServiceHelper;
import kd.tmc.fbp.common.constant.Constants;
import kd.tmc.fbp.common.enums.BillStatusEnum;
import kd.tmc.fbp.common.helper.GuaranteeUseHelper;
import kd.tmc.fbp.common.helper.TmcBusinessBaseHelper;
import kd.tmc.fbp.common.helper.TmcDataServiceHelper;
@ -18,6 +19,7 @@ import kd.tmc.gm.common.helper.GuaranteeContractHelper;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.text.DecimalFormat;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
@ -35,6 +37,7 @@ public class guaranteecontListPlugin extends AbstractListPlugin {
DynamicObject gContractCcy = e.getRowData().getDynamicObject("currency");
Long gContractCcyId = (Long)gContractCcy.getPkValue();
QFilter gQF = new QFilter("gcontract.id", "=", id);
gQF.and("billstatus", "=", BillStatusEnum.AUDIT.getValue());
DynamicObjectCollection gcUseBills = QueryServiceHelper.query("gm_guaranteeuse", String.join(",", gcProps), gQF.toArray());
Map<Long, BigDecimal> letterCreditMap = GuaranteeContractHelper.getLetterCreditMap(gcUseBills);
Map<Long, BigDecimal> loanBillMap = GuaranteeContractHelper.getLoanBillMap(gcUseBills);
@ -46,7 +49,8 @@ public class guaranteecontListPlugin extends AbstractListPlugin {
BigDecimal debtBalance = gcBIll.getBigDecimal("gdebtbalance");
if ("lc_lettercredit".equals(gcBIll.get("gsrcbilltype")) && EmptyUtil.isNoEmpty((BigDecimal)letterCreditMap.get(gcBIll.getLong("gsrcbillid")))) {
debtBalance = ((BigDecimal)letterCreditMap.get(gcBIll.getLong("gsrcbillid"))).multiply(gcBIll.getBigDecimal("gratio")).divide(Constants.ONE_HUNDRED, 4, RoundingMode.HALF_UP);
} else if (Arrays.asList("cfm_loanbill_b_l", "cfm_loanbill_e_l", "cfm_loanbill", "cim_invest_loanbill").contains(gcBIll.get("gsrcbilltype")) && EmptyUtil.isNoEmpty((BigDecimal)loanBillMap.get(gcBIll.getLong("gsrcbillid")))) {
}
else if (Arrays.asList("cfm_loanbill_b_l", "cfm_loanbill_e_l", "cfm_loanbill", "cim_invest_loanbill").contains(gcBIll.get("gsrcbilltype")) && EmptyUtil.isNoEmpty((BigDecimal)loanBillMap.get(gcBIll.getLong("gsrcbillid")))) {
debtBalance = ((BigDecimal)loanBillMap.get(gcBIll.getLong("gsrcbillid"))).multiply(gcBIll.getBigDecimal("gratio")).divide(Constants.ONE_HUNDRED, 4, RoundingMode.HALF_UP);
}
Long debtBillCcy = gcBIll.getLong("gdebtcurrency");
@ -58,7 +62,9 @@ public class guaranteecontListPlugin extends AbstractListPlugin {
}
}
}
e.setFormatValue(sumOfBal);
DecimalFormat df = new DecimalFormat("¥#,##0.00");
String formattedAmount = df.format(sumOfBal);
e.setFormatValue(formattedAmount);
}
}
}