Browse Source

融信详情

peixh 3 years ago
parent
commit
c0daa31518

+ 19 - 1
sc-service/src/main/java/com/huyi/service/credit/controller/OwnCreditController.java

@@ -83,6 +83,9 @@ public class OwnCreditController extends BaseController {
     //银行账户表
     @Autowired
     private IPayBankAccInfService bankAccInfService;
+    //融资记录服务类
+    @Autowired
+    private IZcFinanceRecordService iZcFinanceRecordService;
 
     /**
      * 查询融信信息
@@ -204,6 +207,11 @@ public class OwnCreditController extends BaseController {
     @PreAuthorize(hasPermi = "credit:credit:query")
     @GetMapping(value = "/{zfiId}")
     public AjaxResult getInfo(@PathVariable("zfiId") String zfiId,QueryRequest request) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException {
+        //查询当前操作员
+        LoginUser userInfo = tokenService.getLoginUser();
+        SysUser use = userInfo.getSysUser();
+        //企业类型
+        String companyType = use.getCompanyType();
         //查询融信详情
         ZcFinanceInf financeInf =  financeInfService.getById(zfiId);
         if(financeInf == null){
@@ -335,7 +343,17 @@ public class OwnCreditController extends BaseController {
             //起止日期
             map.put("stopDate",stopDate);
         }
-
+        //查询融资薪资
+        LambdaQueryWrapper<ZcFinanceRecord> queryWrapper = new LambdaQueryWrapper<>();
+        queryWrapper.eq(ZcFinanceRecord::getZfrFinanceId,zfiId);
+        queryWrapper.and(i -> i.eq(ZcFinanceRecord::getZfrStatus,"01").or().eq(ZcFinanceRecord::getZfrStatus,"03"));
+        List<ZcFinanceRecord> recordList = iZcFinanceRecordService.findZcFinanceRecords(queryWrapper);
+        String zfrId = "";
+        if (recordList.size() > 0) {
+            zfrId = recordList.get(0).getZfrId();
+        }
+        map.put("zfrId",zfrId);
+        map.put("companyType",companyType);
         return AjaxResult.success(map);
     }
 

+ 5 - 3
sc-service/src/main/java/com/huyi/service/supplierCreditLine/controller/SupplierCreditLineController.java

@@ -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);

+ 1 - 0
sc-service/src/main/resources/mapper/supplierCreditLine/SupplierCreditLineMapper.xml

@@ -9,6 +9,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         zfsq_id         'zfsqId',
         zfsq_amount     'zfsqAmount',
         zfsq_status     'zfsqStatus',
+        zfsq_core_quota_id 'zfsqCoreQuotaId',
         scy_name        'scyName',
         scy_social_code 'scySocialCode'
         FROM zc_finance_supplier_quota