|
@@ -337,8 +337,10 @@ public class SupplierCreditLineController extends BaseController {
|
|
|
@PutMapping("/changeStatus")
|
|
|
public AjaxResult changeStatus(@RequestBody ZcFinanceSupplierQuota zcFinanceSupplierQuota) throws Exception
|
|
|
{
|
|
|
- //授信id
|
|
|
+ //供应商授信id
|
|
|
String zfsqId = zcFinanceSupplierQuota.getZfsqId();
|
|
|
+ //核心授信id
|
|
|
+ String zfsqCoreQuotaId = zcFinanceSupplierQuota.getZfsqCoreQuotaId();
|
|
|
//授信额度
|
|
|
String zfsqAmount = zcFinanceSupplierQuota.getZfsqAmount();
|
|
|
//授信状态
|
|
@@ -353,7 +355,7 @@ public class SupplierCreditLineController extends BaseController {
|
|
|
int result = CommonUtil.compare("0",zfiAmount);
|
|
|
//查询核心企业授信额度ID下的供应商授信额度总和
|
|
|
QueryWrapper<ZcFinanceSupplierQuota> supplierWrapper = new QueryWrapper<>();
|
|
|
- supplierWrapper.eq("zfsq_core_quota_id",zfsqId);
|
|
|
+ supplierWrapper.eq("zfsq_core_quota_id",zfsqCoreQuotaId);
|
|
|
supplierWrapper.eq("zfsq_status","00");
|
|
|
supplierWrapper.select("IFNULL(CAST(ROUND(SUM(zfsq_amount),2)AS CHAR),'0') AS zfsqAmount");
|
|
|
ZcFinanceSupplierQuota supplierQuota = iZcFinanceSupplierQuotaService.getOne(supplierWrapper);
|
|
@@ -361,7 +363,7 @@ public class SupplierCreditLineController extends BaseController {
|
|
|
//额度总和 + 本次授信额度
|
|
|
totalAmount = AmtUtil.add(totalAmount,zfsqAmount,2);
|
|
|
//查询核心企业的授信额度
|
|
|
- ZcFinanceProComRel zcFinanceProComRel = iZcFinanceProComRelService.getById(zfsqId);
|
|
|
+ ZcFinanceProComRel zcFinanceProComRel = iZcFinanceProComRelService.getById(zfsqCoreQuotaId);
|
|
|
String zfpcrAmount = zcFinanceProComRel.getZfpcrAmount();
|
|
|
//此核心企业下的供应商授信额度 > 核心企业的授信额度 => 授信额度已超额
|
|
|
int results = CommonUtil.compare(totalAmount,zfpcrAmount);
|