소스 검색

授信导入问题;审批待办改为已办问题,融信弹窗数据处理;费用列表数据处理

sqg 3 년 전
부모
커밋
77bc16121e

+ 108 - 0
sc-service/src/main/java/com/huyi/service/common/flowable/controller/FlowableController.java

@@ -77,6 +77,9 @@ public class  FlowableController extends BaseController
     //往来账款服务类
     @Autowired
     private IZcBillInfService  billInfService;
+    //待办服务类
+    @Autowired
+    private  ISysNoticeService sysNoticeService;
 
 
     /**
@@ -580,6 +583,19 @@ public class  FlowableController extends BaseController
                 zcFinanceInf.setZfiCoreStatus("02");
             }
             zcFinanceInfService.updateById(zcFinanceInf);
+            //待办更改为已办
+            LambdaQueryWrapper<SysNotice> noticeLambdaQueryWrapper = new LambdaQueryWrapper<>();
+            //待办
+            noticeLambdaQueryWrapper.eq(SysNotice::getStatus,"0");
+            //融信编号
+            noticeLambdaQueryWrapper.eq(SysNotice::getTableId,id);
+            noticeLambdaQueryWrapper.and(i -> i.eq(SysNotice::getWorkType,"00").or().eq(SysNotice::getWorkType,"01"));
+            //待办
+            noticeLambdaQueryWrapper.eq(SysNotice::getType,"00");
+            SysNotice notice = new SysNotice();
+            //已办
+            notice.setStatus("1");
+            sysNoticeService.update(notice,noticeLambdaQueryWrapper);
             //根据Id查询实体类
             ZcFinanceInf financeInf = zcFinanceInfService.getById(id);
             //核心企业Id
@@ -613,6 +629,19 @@ public class  FlowableController extends BaseController
                 zcFinanceInf.setZfiCoreStatus("02");
             }
             zcFinanceInfService.updateById(zcFinanceInf);
+            //待办更改为已办
+            LambdaQueryWrapper<SysNotice> noticeLambdaQueryWrapper = new LambdaQueryWrapper<>();
+            //待办
+            noticeLambdaQueryWrapper.eq(SysNotice::getStatus,"0");
+            //融信编号
+            noticeLambdaQueryWrapper.eq(SysNotice::getTableId,id);
+            noticeLambdaQueryWrapper.and(i -> i.eq(SysNotice::getWorkType,"00").or().eq(SysNotice::getWorkType,"01"));
+            //待办
+            noticeLambdaQueryWrapper.eq(SysNotice::getType,"00");
+            SysNotice notice = new SysNotice();
+            //已办
+            notice.setStatus("1");
+            sysNoticeService.update(notice,noticeLambdaQueryWrapper);
             //根据主键获取实体
             ZcFinanceInf financeInf = zcFinanceInfService.getById(id);
             //核心企业Id
@@ -663,6 +692,19 @@ public class  FlowableController extends BaseController
 //                zcFinanceInf.setZfiSupplierStatus("03");
 //            }
             zcFinanceInfService.update(zcFinanceInf,lambdaQueryWrapper);
+            //待办更改为已办
+            LambdaQueryWrapper<SysNotice> noticeLambdaQueryWrapper = new LambdaQueryWrapper<>();
+            //待办
+            noticeLambdaQueryWrapper.eq(SysNotice::getStatus,"0");
+            //融信编号
+            noticeLambdaQueryWrapper.eq(SysNotice::getTableId,id);
+            noticeLambdaQueryWrapper.and(i -> i.eq(SysNotice::getWorkType,"00").or().eq(SysNotice::getWorkType,"01"));
+            //待办
+            noticeLambdaQueryWrapper.eq(SysNotice::getType,"00");
+            SysNotice notice = new SysNotice();
+            //已办
+            notice.setStatus("1");
+            sysNoticeService.update(notice,noticeLambdaQueryWrapper);
             //TODO 发起人最终结果【拒绝】消息通知
             //查询发起人,融资企业Id
             ZcFinanceInf financeInf = zcFinanceInfService.getById(zfiId);
@@ -700,6 +742,19 @@ public class  FlowableController extends BaseController
 //                zcFinanceInf.setZfiSupplierStatus("03");
 //            }
             zcFinanceInfService.update(zcFinanceInf,lambdaQueryWrapper);
+            //待办更改为已办
+            LambdaQueryWrapper<SysNotice> noticeLambdaQueryWrapper = new LambdaQueryWrapper<>();
+            //待办
+            noticeLambdaQueryWrapper.eq(SysNotice::getStatus,"0");
+            //融信编号
+            noticeLambdaQueryWrapper.eq(SysNotice::getTableId,id);
+            noticeLambdaQueryWrapper.and(i -> i.eq(SysNotice::getWorkType,"00").or().eq(SysNotice::getWorkType,"01"));
+            //待办
+            noticeLambdaQueryWrapper.eq(SysNotice::getType,"00");
+            SysNotice notice = new SysNotice();
+            //已办
+            notice.setStatus("1");
+            sysNoticeService.update(notice,noticeLambdaQueryWrapper);
             //TODO 发起人最终结果【拒绝】消息通知
             //查询发起人,融资企业Id
             ZcFinanceInf financeInf = zcFinanceInfService.getById(zfiId);
@@ -729,6 +784,19 @@ public class  FlowableController extends BaseController
                 zcFinanceInf.setZfiSupplierStatus("02");
             }
             zcFinanceInfService.update(zcFinanceInf,wrapper);
+            //待办更改为已办
+            LambdaQueryWrapper<SysNotice> noticeLambdaQueryWrapper = new LambdaQueryWrapper<>();
+            //待办
+            noticeLambdaQueryWrapper.eq(SysNotice::getStatus,"0");
+            //融信编号
+            noticeLambdaQueryWrapper.eq(SysNotice::getTableId,id);
+            noticeLambdaQueryWrapper.and(i -> i.eq(SysNotice::getWorkType,"00").or().eq(SysNotice::getWorkType,"01"));
+            //待办
+            noticeLambdaQueryWrapper.eq(SysNotice::getType,"00");
+            SysNotice notice = new SysNotice();
+            //已办
+            notice.setStatus("1");
+            sysNoticeService.update(notice,noticeLambdaQueryWrapper);
         }
         //平台审批拒绝
         else if("1000000004".equals(menuId)){
@@ -757,6 +825,19 @@ public class  FlowableController extends BaseController
             }
             //更新融信状态
             zcFinanceInfService.update(zcFinanceInf,wrapper);
+            //待办更改为已办
+            LambdaQueryWrapper<SysNotice> noticeLambdaQueryWrapper = new LambdaQueryWrapper<>();
+            //待办
+            noticeLambdaQueryWrapper.eq(SysNotice::getStatus,"0");
+            //融信编号
+            noticeLambdaQueryWrapper.eq(SysNotice::getTableId,id);
+            noticeLambdaQueryWrapper.and(i -> i.eq(SysNotice::getWorkType,"00").or().eq(SysNotice::getWorkType,"01"));
+            //待办
+            noticeLambdaQueryWrapper.eq(SysNotice::getType,"00");
+            SysNotice notice = new SysNotice();
+            //已办
+            notice.setStatus("1");
+            sysNoticeService.update(notice,noticeLambdaQueryWrapper);
             // TODO 不管什么类型都给 融资企业经办人 最终结果【拒绝】消息通知
             /*----------查询供应商企业经办人----------*/
             //查询用户与企业关系表
@@ -806,6 +887,19 @@ public class  FlowableController extends BaseController
             //审批拒绝
             zcFinanceInf.setZfiSupplierStatus("02");
             zcFinanceInfService.update(zcFinanceInf,lambdaQueryWrapper);
+            //待办更改为已办
+            LambdaQueryWrapper<SysNotice> noticeLambdaQueryWrapper = new LambdaQueryWrapper<>();
+            //待办
+            noticeLambdaQueryWrapper.eq(SysNotice::getStatus,"0");
+            //融信编号
+            noticeLambdaQueryWrapper.eq(SysNotice::getTableId,id);
+            noticeLambdaQueryWrapper.and(i -> i.eq(SysNotice::getWorkType,"00").or().eq(SysNotice::getWorkType,"01"));
+            //待办
+            noticeLambdaQueryWrapper.eq(SysNotice::getType,"00");
+            SysNotice notice = new SysNotice();
+            //已办
+            notice.setStatus("1");
+            sysNoticeService.update(notice,noticeLambdaQueryWrapper);
             //待办标题
             String tittle = "融资企业签收由"+sysCompany.getScyName() +"发起的:融信编号为:"+ id+"的资料代签收";
             remoteSystemService.sendNotice(companyId,id,tittle,"00",null,"03","0",userId,null, null, null);
@@ -826,6 +920,20 @@ public class  FlowableController extends BaseController
             //审批拒绝
             zcFinanceInf.setZfiStatus("02");
             zcFinanceInfService.update(zcFinanceInf,lambdaQueryWrapper);
+            //待办更改为已办
+            LambdaQueryWrapper<SysNotice> noticeLambdaQueryWrapper = new LambdaQueryWrapper<>();
+            //待办
+            noticeLambdaQueryWrapper.eq(SysNotice::getStatus,"0");
+            //融信编号
+            noticeLambdaQueryWrapper.eq(SysNotice::getTableId,id);
+            //待签收
+            noticeLambdaQueryWrapper.eq(SysNotice::getWorkType,"08");
+            //待办
+            noticeLambdaQueryWrapper.eq(SysNotice::getType,"00");
+            SysNotice notice = new SysNotice();
+            //已办
+            notice.setStatus("1");
+            sysNoticeService.update(notice,noticeLambdaQueryWrapper);
         }
         return AjaxResult.success();
     }

+ 26 - 31
sc-service/src/main/java/com/huyi/service/credit/controller/OwnCreditController.java

@@ -407,45 +407,40 @@ public class OwnCreditController extends BaseController {
         //产品
         String productId = financeInf.getZfiProductId();
         ZcFinanceProduct product = productService.getById(productId);
-        //查询融资薪资
-        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();
-        }
         //计算最长融信期限:intervalTime
         String intervalTime = "";
         //融信有效期
         String validity = "";
-        if(CommonUtil.isNotEmpty(zfrId)) {
-            ZcFinanceRecord zcFinanceRecord = iZcFinanceRecordService.getById(zfrId);
-            //签发有效期
-            Date zfiEffectiveDate = financeInf.getZfiEffectiveDate();
+        //签发有效期
+        Date zfiEffectiveDate = financeInf.getZfiEffectiveDate();
+        //承诺还款日
+        Date zfiExpireDate = financeInf.getZfiExpireDate();
+        if (CommonUtil.isNotEmpty(zfiExpireDate + "") && CommonUtil.isNotEmpty(zfiEffectiveDate + "")) {
+            //格式化日期
             SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
             String zfiEffective = simpleDateFormat.format(zfiEffectiveDate);
             Date zfiEffectives = new SimpleDateFormat("yyyy-MM-dd").parse(zfiEffective);
-            //承诺还款日
-            Date zfrRepaymentDate = zcFinanceRecord.getZfrRepaymentDate();
-            String zfrRepayment = simpleDateFormat.format(zfrRepaymentDate);
+            String zfrRepayment = simpleDateFormat.format(zfiExpireDate);
             Date repaymentDates = new SimpleDateFormat("yyyy-MM-dd").parse(zfrRepayment);
-            if (CommonUtil.isNotEmpty(zfrRepaymentDate + "") && CommonUtil.isNotEmpty(zfiEffectiveDate + "")) {
-                Calendar cal = Calendar.getInstance();
-                cal.setTime(zfiEffectives);
-                long effectiveDate = cal.getTimeInMillis();
-                cal.setTime(repaymentDates);
-                long repaymentDate = cal.getTimeInMillis();
-                int betweenDays = (int)(effectiveDate - repaymentDate) / (1000 * 3600 * 24);
-                intervalTime = String.valueOf(Math.abs(betweenDays));
-            }
-            //最短账期
-            String zfpShortestPeriod = product.getZfpShortestPeriod();
-            if(CommonUtil.isNotEmpty(zfrRepaymentDate + "") && CommonUtil.isNotEmpty(zfpShortestPeriod)){
-                Integer period = Integer.parseInt(zfpShortestPeriod);
-                validity = new SimpleDateFormat("yyyy-MM-dd").format(DateUtils.addDays(repaymentDates,-period));
-            }
+            //计算最长融信期限
+            Calendar cal = Calendar.getInstance();
+            cal.setTime(zfiEffectives);
+            long effectiveDate = cal.getTimeInMillis();
+            cal.setTime(repaymentDates);
+            long repaymentDate = cal.getTimeInMillis();
+            int betweenDays = (int)(effectiveDate - repaymentDate) / (1000 * 3600 * 24);
+            intervalTime = String.valueOf(Math.abs(betweenDays));
+        }
+        //最短账期
+        String zfpShortestPeriod = product.getZfpShortestPeriod();
+        if(CommonUtil.isNotEmpty(zfiExpireDate + "") && CommonUtil.isNotEmpty(zfpShortestPeriod)){
+            //格式化日期
+            SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
+            String zfrRepayment = simpleDateFormat.format(zfiExpireDate);
+            Date repaymentDates = new SimpleDateFormat("yyyy-MM-dd").parse(zfrRepayment);
+            //计算融信有效期
+            Integer period = Integer.parseInt(zfpShortestPeriod);
+            validity = new SimpleDateFormat("yyyy-MM-dd").format(DateUtils.addDays(repaymentDates,-period));
         }
         //最长融信期限
         map.put("intervalTime", intervalTime);

+ 7 - 0
sc-service/src/main/java/com/huyi/service/supplierCreditLine/controller/SupplierCreditLineController.java

@@ -446,6 +446,13 @@ public class SupplierCreditLineController extends BaseController {
     @PostMapping("/importData/{zfpcrId}/{zfpcrCompanyId}")
     public AjaxResult importData(@PathVariable String zfpcrId,@PathVariable String zfpcrCompanyId, MultipartFile file) throws Exception
     {
+        //获取文件名
+        String originalFileName = file.getOriginalFilename();
+        String fileName = originalFileName.substring(originalFileName.lastIndexOf("."));
+        //只能导入xls或xlsx
+        if(!".xlsx".equals(fileName) && !".xls".equals(fileName)){
+            throw new Exception("仅允许导入“xls”或“xlsx”格式文件!");
+        }
         //列表对应字段
         List<String> columnName = new ArrayList<>();
         columnName.add("scyName");

+ 1 - 1
sc-service/src/main/resources/mapper/cost/OwnCostManageMapper.xml

@@ -155,7 +155,7 @@
         WHERE 1=1
             AND z.zci_invoice_status = '1'
             AND z.zci_status = '02'
-            AND zfr_status = '01'
+            AND (zfr_status = '01' OR zfr_status = '03')
         <if test="paramMap.supScyName != null and paramMap.supScyName != '' ">
             AND s.scy_name LIKE CONCAT('%', #{paramMap.supScyName}, '%')
         </if>