Explorar el Código

融资管理盖章 供应商授信查询条件,供应商授信新增修改限制条件

peixh hace 4 años
padre
commit
df01f26363

+ 1 - 0
sc-service/src/main/java/com/huyi/service/creditLine/controller/CreditLineController.java

@@ -171,6 +171,7 @@ public class CreditLineController extends BaseController {
                 //查询核心企业授信额度ID下的供应商授信额度总和
                 QueryWrapper<ZcFinanceSupplierQuota> supplierQueryWrapper = new QueryWrapper<>();
                 supplierQueryWrapper.eq("zfsq_core_quota_id", zfpcrId);
+                supplierQueryWrapper.eq("zfsq_status","00");
                 supplierQueryWrapper.select("IFNULL(CAST(ROUND(SUM(zfsq_amount),2)AS CHAR),'0.00') AS zfsqAmount");
                 ZcFinanceSupplierQuota supplierQuota = iZcFinanceSupplierQuotaService.getOne(supplierQueryWrapper);
                 //供应商已使用额度总和

+ 3 - 3
sc-service/src/main/java/com/huyi/service/financeRecord/controller/FinanceRecordController.java

@@ -330,7 +330,7 @@ public class FinanceRecordController extends BaseController {
             zcChargeInf.setZciFinanceId(zfrId);
             //手续费
             String zciAmount = AmtUtil.divide(zfpcrChargeRate, "100", 4);
-            zciAmount = AmtUtil.subtract(zfrAmount, zciAmount, 2);
+            zciAmount = AmtUtil.multiply(zfrAmount, zciAmount, 2);
             zcChargeInf.setZciAmount(zciAmount);
             //创建人
             zcChargeInf.setCreateBy(userId);
@@ -498,10 +498,10 @@ public class FinanceRecordController extends BaseController {
     public AjaxResult getRecordSealFile(@RequestBody Map<String,Object> map)throws Exception
     {
         //获取融信编号
-        String zfiId = CommonUtil.objToString(map.get("zfrFinanceId"));
+        String zfrId = CommonUtil.objToString(map.get("zfrId"));
         //查询融信和文件的关系表
         LambdaQueryWrapper<ZcFinanceRecordFileRel> relLambdaQueryWrapper = new LambdaQueryWrapper<>();
-        relLambdaQueryWrapper.eq(ZcFinanceRecordFileRel::getZfrfrFinanceId,zfiId);
+        relLambdaQueryWrapper.eq(ZcFinanceRecordFileRel::getZfrfrFinanceId,zfrId);
         List<ZcFinanceRecordFileRel> recordFileRelList =  financeRecordFileRelService.findZcFinanceRecordFileRels(relLambdaQueryWrapper);
         //文件信息
         List<PubFileInf> list  = new ArrayList<>();

+ 21 - 12
sc-service/src/main/java/com/huyi/service/financeRecord/controller/RecordSealController.java

@@ -352,6 +352,8 @@ public class RecordSealController extends BaseController {
         }
         //存放合同编号
         List<String> contractIdList = new ArrayList<>();
+        //融资id
+        String zfrId = CommonUtil.objToString(map.get("zfrId"));
         //获取授信编号
         String zfiCoreQuotaId = CommonUtil.objToString(map.get("zfiCoreQuotaId"));
         //获取产品
@@ -479,7 +481,7 @@ public class RecordSealController extends BaseController {
             //查询合同
             LambdaQueryWrapper<ZcFinanceContract> contractLambdaQueryWrapper = new LambdaQueryWrapper<>();
             contractLambdaQueryWrapper.in(ZcFinanceContract::getZfcId,contractIdList);
-            contractLambdaQueryWrapper.like(ZcFinanceContract::getZfcNode,"01");
+            contractLambdaQueryWrapper.like(ZcFinanceContract::getZfcNode,code);
             contractLambdaQueryWrapper.orderByAsc(ZcFinanceContract::getZfcFile);
             contractList =   contractService.findZcFinanceContracts(contractLambdaQueryWrapper);
             if(contractList.size() > 0 ){
@@ -583,16 +585,22 @@ public class RecordSealController extends BaseController {
 //                doc.saveToFile(directory + fileName + currecntDate + ".pdf", FileFormat.PDF);
                 WordPdfUtil.doc2pdf(filePath,directory + fileName + currecntDate + ".pdf");
                 filePath = directory + fileName + currecntDate + ".pdf";
+                logger.info("不是已盖章文件的" + filePath + "!!!!!!!!!");
+                logger.info("不是已盖章文件的" + fileName + "!!!!!!!!!");
+                System.out.println("====================" + filePath +"++++++++++++++++");
                 /**-------- word 转PDF 结束--------**/
                 // 是已盖章文件
             }
-//            else {
-//                // 文件服务器的文件下载到本地
-//                PubFileInf fileInf = fileInfService.getById(financeFileList.get(0).getZfrfrFileId());
-//                filePath = downloadFile(fileInf.getPfiFileUrl(), fileInf.getPfiFileName());
-//                int index  = fileInf.getPfiFileName().indexOf(".");
-//                fileName = fileInf.getPfiFileName().substring(0,index);
-//            }
+            else {
+                // 文件服务器的文件下载到本地
+                PubFileInf fileInf = fileInfService.getById(financeFileList.get(0).getZffrFileId());
+                filePath = downloadFile(fileInf.getPfiFileUrl(), fileInf.getPfiFileName());
+                int index  = fileInf.getPfiFileName().indexOf(".");
+                fileName = fileInf.getPfiFileName().substring(0,index);
+
+                logger.info("是已盖章文件的" + filePath + "!!!!!!!!!");
+                logger.info("是已盖章文件的" + fileName + "!!!!!!!!!");
+            }
 
             /**-------- 获取合同盖章关键字 开始--------**/
             //获取合同信息
@@ -680,7 +688,8 @@ public class RecordSealController extends BaseController {
                 // zc_finance_file_rel 存入数据
                 //recordFileRel = new ZcFinanceRecordFileRel();
                 recordFileRel.setZfrfrId(IdUtils.fastSimpleUUID());
-                recordFileRel.setZfrfrFinanceId(zfiId);
+                //融资id
+                recordFileRel.setZfrfrFinanceId(zfrId);
                 recordFileRel.setZfrfrContractId(contractList.get(i).getZfcId());
                 // 已盖章文件
 //            }
@@ -718,16 +727,16 @@ public class RecordSealController extends BaseController {
 //        finance.setUpdateBy(userId);
 //        financeInfService.updateById(finance);
         //修改融资状态
-        LambdaQueryWrapper<ZcFinanceRecord> queryWrapper = new LambdaQueryWrapper<>();
-        queryWrapper.eq(ZcFinanceRecord::getZfrFinanceId,zfiId);
         ZcFinanceRecord zcFinanceRecord = new ZcFinanceRecord();
+        //融资id
+        zcFinanceRecord.setZfrId(zfrId);
         //融资状态(00:融资中 01:已放款 02:融资失败 03:已结算 04:合同待签署)
         zcFinanceRecord.setZfrStatus("00");
         //修改时间
         zcFinanceRecord.setUpdateTime(DateUtils.getNowDate());
         //修改人
         zcFinanceRecord.setUpdateBy(userId);
-        iZcFinanceRecordService.update(zcFinanceRecord,queryWrapper);
+        iZcFinanceRecordService.updateById(zcFinanceRecord);
         /**-------- 盖章完成修改融信状态和融资状态 结束--------**/
         return AjaxResult.success();
     }

+ 23 - 2
sc-service/src/main/java/com/huyi/service/supplierCreditLine/controller/SupplierCreditLineController.java

@@ -89,7 +89,7 @@ public class SupplierCreditLineController extends BaseController {
                   //授信额度范围
                   @RequestParam (required=false) String AmountB,
                   //状态(00:有效 01:失效)
-                  @RequestParam (required=false) String zfpcrStatus,
+                  @RequestParam (required=false) String zfsqStatus,
                   //核心企业授信额度ID
                   @RequestParam (required=false) String zfsqId,
                   QueryRequest request) {
@@ -112,7 +112,7 @@ public class SupplierCreditLineController extends BaseController {
             map.put("AmountB", CommonUtil.objToBigDecimal(AmountB));
         }
         //状态(00:有效 01:失效)
-        map.put("zfpcrStatus",zfpcrStatus);
+        map.put("zfsqStatus",zfsqStatus);
         //核心企业授信额度ID
         map.put("zfsqId",zfsqId);
         IPage<Map> list = supplierCreditLineService.selectSupplierCreditLineList(map, request);
@@ -178,6 +178,15 @@ public class SupplierCreditLineController extends BaseController {
         if (zfsqAccountBank.length() > 30){
             throw new Exception("企业还款账户开户行长度过长");
         }
+        //查询此企业是否已授信
+        LambdaQueryWrapper<ZcFinanceSupplierQuota> supplierWrapper = new LambdaQueryWrapper<>();
+        supplierWrapper.eq(ZcFinanceSupplierQuota::getZfsqCoreQuotaId,zfsqCoreQuotaId);
+        supplierWrapper.eq(ZcFinanceSupplierQuota::getZfsqCompanyId,zfsqCompanyId);
+        supplierWrapper.ne(ZcFinanceSupplierQuota::getZfsqStatus,"99");
+        int count = iZcFinanceSupplierQuotaService.count(supplierWrapper);
+        if (count > 0){
+            throw new Exception("此企业已授信");
+        }
         //查询核心企业授信额度ID下的供应商授信额度总和
         QueryWrapper<ZcFinanceSupplierQuota> queryWrapper = new QueryWrapper<>();
         queryWrapper.eq("zfsq_core_quota_id",zfsqCoreQuotaId);
@@ -223,6 +232,8 @@ public class SupplierCreditLineController extends BaseController {
         LoginUser userInfo = tokenService.getLoginUser();
         SysUser user = userInfo.getSysUser();
         String userId = user.getUserId() + "";
+        //主键
+        String zfsqId = zcFinanceSupplierQuota.getZfsqId();
         //供应商
         String zfsqCompanyId = zcFinanceSupplierQuota.getZfsqCompanyId();
         //授信额度
@@ -253,6 +264,16 @@ public class SupplierCreditLineController extends BaseController {
         if (zfsqAccountBank.length() > 30){
             throw new Exception("企业还款账户开户行长度过长");
         }
+        //查询此企业是否已授信
+        LambdaQueryWrapper<ZcFinanceSupplierQuota> supplierWrapper = new LambdaQueryWrapper<>();
+        supplierWrapper.ne(ZcFinanceSupplierQuota::getZfsqId,zfsqId);
+        supplierWrapper.eq(ZcFinanceSupplierQuota::getZfsqCoreQuotaId,zfsqCoreQuotaId);
+        supplierWrapper.eq(ZcFinanceSupplierQuota::getZfsqCompanyId,zfsqCompanyId);
+        supplierWrapper.ne(ZcFinanceSupplierQuota::getZfsqStatus,"99");
+        int count = iZcFinanceSupplierQuotaService.count(supplierWrapper);
+        if (count > 0){
+            throw new Exception("此企业已授信");
+        }
         //查询核心企业授信额度ID下的供应商授信额度总和
         QueryWrapper<ZcFinanceSupplierQuota> queryWrapper = new QueryWrapper<>();
         queryWrapper.eq("zfsq_core_quota_id",zfsqCoreQuotaId);

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

@@ -25,8 +25,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <if test="paramMap.AmountB != null  and paramMap.AmountB != '' or paramMap.AmountB==0 ">
             and zfsq_amount &lt;=  #{paramMap.AmountB}
         </if>
-        <if test="paramMap.zfpcrStatus != null  and paramMap.zfpcrStatus != ''">
-            and zfpcr_status = #{paramMap.zfpcrStatus}
+        <if test="paramMap.zfsqStatus != null  and paramMap.zfsqStatus != ''">
+            and zfsq_status = #{paramMap.zfsqStatus}
         </if>
         order by zc_finance_supplier_quota.create_time desc
     </select>