|
@@ -482,6 +482,31 @@ public class OwnCreditController extends BaseController {
|
|
|
//类型--1查询反向产品 0 查询正向产品
|
|
|
map.put("type",type);
|
|
|
List<Map> creditLineList = ownCreditService.selectCreditLineList(map);
|
|
|
+ for(int i = 0 ; i < creditLineList.size();i++){
|
|
|
+ Map<String,String> mmp = creditLineList.get(i);
|
|
|
+ //获取授信额度编号
|
|
|
+ String sxId = mmp.get("zfpcrId");
|
|
|
+ LambdaQueryWrapper<ZcFinanceProComRel> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ //公司
|
|
|
+ lambdaQueryWrapper.eq(ZcFinanceProComRel::getZfpcrCompanyId,companyId);
|
|
|
+ //授信编号
|
|
|
+ lambdaQueryWrapper.eq(ZcFinanceProComRel::getZfpcrId,sxId);
|
|
|
+ //授信额度
|
|
|
+ String amount = "";
|
|
|
+ List<ZcFinanceProComRel> list = financeProComRelService.findZcFinanceProComRels(lambdaQueryWrapper);
|
|
|
+ if(list.size() < 1){
|
|
|
+ return AjaxResult.error("获取授信额度信息失败");
|
|
|
+ }
|
|
|
+ amount = list.get(0).getZfpcrAmount();
|
|
|
+ //获取已用的授信额度
|
|
|
+ Map m = new HashMap();
|
|
|
+ m.put("zfpcrId",sxId);
|
|
|
+ m.put("companyId",companyId);
|
|
|
+ String userdBalance = ownCreditService.getUsedBalance(m);
|
|
|
+ //获取剩余额度
|
|
|
+ String remaining = AmtUtil.subtract(amount,userdBalance,2);
|
|
|
+ mmp.put("remaining",remaining);
|
|
|
+ }
|
|
|
return AjaxResult.success(creditLineList);
|
|
|
}
|
|
|
|
|
@@ -502,8 +527,33 @@ public class OwnCreditController extends BaseController {
|
|
|
map.put("zfsqCompanyId", companyId);
|
|
|
//授信额度编号
|
|
|
map.put("zfsqId",zfsqId);
|
|
|
-
|
|
|
List<Map> creditLineList = ownCreditService.selectSupplierCreditLineList(map);
|
|
|
+ for(int i = 0 ; i < creditLineList.size();i++){
|
|
|
+ Map<String,String> mmp = creditLineList.get(i);
|
|
|
+ //获取授信编号
|
|
|
+ String sxId = mmp.get("zfsqId");
|
|
|
+ //查询供应商的授信额度
|
|
|
+ LambdaQueryWrapper<ZcFinanceSupplierQuota> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ //公司
|
|
|
+ lambdaQueryWrapper.eq(ZcFinanceSupplierQuota::getZfsqCompanyId,companyId);
|
|
|
+ //授信编号
|
|
|
+ lambdaQueryWrapper.eq(ZcFinanceSupplierQuota::getZfsqId,sxId);
|
|
|
+ //授信额度
|
|
|
+ String amount = "";
|
|
|
+ List<ZcFinanceSupplierQuota> list = financeSupplierQuotaService.findZcFinanceSupplierQuotas(lambdaQueryWrapper);
|
|
|
+ if(list.size() < 1){
|
|
|
+ return AjaxResult.error("获取授信额度信息失败");
|
|
|
+ }
|
|
|
+ amount = list.get(0).getZfsqAmount();
|
|
|
+ //获取已用的授信额度
|
|
|
+ Map m = new HashMap();
|
|
|
+ m.put("zfsqId",sxId);
|
|
|
+ m.put("companyId",companyId);
|
|
|
+ String userdBalance = ownCreditService.getSupplierUsedBalance(m);
|
|
|
+ //获取剩余额度
|
|
|
+ String remaining = AmtUtil.subtract(amount,userdBalance,2);
|
|
|
+ mmp.put("remaining",remaining);
|
|
|
+ }
|
|
|
return AjaxResult.success(creditLineList);
|
|
|
}
|
|
|
|