Bladeren bron

确权修改

xuefy 3 jaren geleden
bovenliggende
commit
aab1f66395

+ 40 - 6
sc-service/src/main/java/com/huyi/service/credit/controller/CreditHandleController.java

@@ -100,12 +100,27 @@ public class CreditHandleController extends BaseController {
         SysUser use = userInfo.getSysUser();
         //获取融信编号
         String  zfiId = CommonUtil.objToString(map.get("zfiId"));
+        //获取融信信息
+        ZcFinanceInf finance =  financeInfService.getById(zfiId);
+        if(finance == null){
+            throw  new Exception("获取融信信息失败");
+        }
+        //获取原先的融信金额
+        String oldAmt = finance.getZfiAmount();
+        //获取签发金额
+        String zfiAmount = CommonUtil.objToString(map.get("zfiAmount"));
+        //现在的签发金额大于原先的融信金额
+        if(CommonUtil.compare(zfiAmount,oldAmt) == 1){
+            throw  new Exception("签发金额的值不可大于之前签发金额的值");
+        }
         //获取融信类型
         String zfiCreateType = CommonUtil.objToString(map.get("zfiCreateType"));
         //获取通过或者拒绝
         String flag = CommonUtil.objToString(map.get("flag"));
         //产品
         String zfpId = CommonUtil.objToString(map.get("zfpId"));
+        //获取当前时间
+        Date createTime = DateUtils.getNowDate();
         //供应商申请并且通过
         if("0".equals(zfiCreateType) && "00".equals(flag)){
             //获取授信额度
@@ -114,8 +129,7 @@ public class CreditHandleController extends BaseController {
             if(CommonUtil.isEmpty(zfiCoreQuotaId)){
                 throw new Exception("请选择授信额度");
             }
-            //获取签发金额
-            String zfiAmount = CommonUtil.objToString(map.get("zfiAmount"));
+
             //获取可用金额
             String availableAmt = CommonUtil.objToString(map.get("availableAmt"));
             //获取融资最小金额
@@ -157,10 +171,32 @@ public class CreditHandleController extends BaseController {
                 Date signDate = simpleDateFormat.parse(zfiExpireDate);
                 financeInf.setZfiExpireDate(signDate);
             }
+            //签发金额
+            financeInf.setZfiAmount(zfiAmount);
+            financeInf.setUpdateTime(createTime);
+            financeInf.setUpdateBy(CommonUtil.objToString(use.getUserId()));
+            financeInfService.updateById(financeInf);
+        }else if("2".equals(zfiCreateType) && "00".equals(flag)){//供应商开立并且通过
+            ZcFinanceInf financeInf = new ZcFinanceInf();
+            //编号
+            financeInf.setZfiId(zfiId);
+            //承诺付款日
+            String zfiExpireDate = CommonUtil.objToString(map.get("zfiExpireDate"));
+            if(CommonUtil.isEmpty(zfiExpireDate)){
+                throw new Exception("请选择承诺付款日");
+            }
+            if(!CommonUtil.isEmpty(zfiExpireDate)){
+                SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
+                Date signDate = simpleDateFormat.parse(zfiExpireDate);
+                financeInf.setZfiExpireDate(signDate);
+            }
+            //签发金额
+            financeInf.setZfiAmount(zfiAmount);
+            financeInf.setUpdateTime(createTime);
+            financeInf.setUpdateBy(CommonUtil.objToString(use.getUserId()));
             financeInfService.updateById(financeInf);
         }
-        //获取当前时间
-        Date createTime = DateUtils.getNowDate();
+
         if("01".equals(flag)){//拒绝
             ZcFinanceInf financeInf = new ZcFinanceInf();
             //编号
@@ -185,8 +221,6 @@ public class CreditHandleController extends BaseController {
             String handler = CommonUtil.objToString(companyRelList.get(0).getSucrUserId());
             //融信编号
             String zfiNumber = CommonUtil.objToString(map.get("zfiNumber"));
-            //融信金额
-            String zfiAmount = CommonUtil.objToString(map.get("zfiAmount"));
             //金额大写
             String bigAmt = AmtUtil.convert(AmtUtil.moneyFormat(zfiAmount));
             //核心企业