|
@@ -931,6 +931,33 @@ public class OwnCreditController extends BaseController {
|
|
|
String zfpSplit = CommonUtil.objToString(map.get("zfpSplit"));
|
|
|
//获取放款方式
|
|
|
String zfpcrLoanType = CommonUtil.objToString(map.get("zfpcrLoanType"));
|
|
|
+ String zfsqId = CommonUtil.objToString(map.get("zfsqId"));
|
|
|
+ String remaining ="";
|
|
|
+ if(CommonUtil.isNotEmpty(zfsqId)){
|
|
|
+ //查询供应商的授信额度
|
|
|
+ LambdaQueryWrapper<ZcFinanceSupplierQuota> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ //公司
|
|
|
+ lambdaQueryWrapper.eq(ZcFinanceSupplierQuota::getZfsqCompanyId,companyId);
|
|
|
+ //授信编号
|
|
|
+ lambdaQueryWrapper.eq(ZcFinanceSupplierQuota::getZfsqId,zfsqId);
|
|
|
+ //授信额度
|
|
|
+ String amount = "";
|
|
|
+ List<ZcFinanceSupplierQuota> list = financeSupplierQuotaService.findZcFinanceSupplierQuotas(lambdaQueryWrapper);
|
|
|
+ System.out.println("list====================>"+list);
|
|
|
+ if(list.size() < 1){
|
|
|
+ return AjaxResult.error("获取授信额度信息失败");
|
|
|
+ }
|
|
|
+ amount = list.get(0).getZfsqAmount();
|
|
|
+ //获取已用的授信额度
|
|
|
+ Map m = new HashMap();
|
|
|
+ m.put("zfsqId",zfsqId);
|
|
|
+ m.put("companyId",companyId);
|
|
|
+ String userdBalance = ownCreditService.getSupplierUsedBalance(m);
|
|
|
+ System.out.println("userdBalance====================>"+userdBalance);
|
|
|
+ //获取剩余额度
|
|
|
+ remaining = AmtUtil.subtract(amount,userdBalance,2);
|
|
|
+ }
|
|
|
+ System.out.println("remaining====================>"+remaining);
|
|
|
//融信编号
|
|
|
String str = "";
|
|
|
//判断类型
|
|
@@ -984,10 +1011,17 @@ public class OwnCreditController extends BaseController {
|
|
|
//非供应商申请
|
|
|
if(!"0".equals(type)){
|
|
|
//获取可用额度
|
|
|
- String availableAmt = CommonUtil.objToString(map.get("availableAmt"));
|
|
|
- if(CommonUtil.compare(zfiAmount,availableAmt) == 1){
|
|
|
- throw new Exception("签发金额不可大于可用额度");
|
|
|
+ if(CommonUtil.isEmpty(remaining)){
|
|
|
+ String availableAmt = CommonUtil.objToString(map.get("availableAmt"));
|
|
|
+ if(CommonUtil.compare(zfiAmount,availableAmt) == 1){
|
|
|
+ throw new Exception("签发金额不可大于可用额度");
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ if(CommonUtil.compare(zfiAmount,remaining) == 1){
|
|
|
+ throw new Exception("签发金额不可大于可用额度");
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
//获取产品的最小融资金额
|
|
|
String zfpMinimumAmount = CommonUtil.objToString(map.get("zfpMinimumAmount"));
|
|
|
//如果最小融资金额大于签发金额
|