Procházet zdrojové kódy

融资新增返回融资记录id 合同作废接口 合同签署待办

dudm před 3 roky
rodič
revize
5c8f3c1e89

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

@@ -592,6 +592,10 @@ public class  FlowableController extends BaseController
 //            //审批通过
 //            zcfInf.setZfiStatus("04");
 //            zcFinanceInfService.update(zcfInf,lambdaQueryWrapper);
+            ZcFinanceRecord financeRecord = zcFinanceRecordService.getById(id);
+            //待办标题
+            String tittle = "【署融资合同签】您申请的融资金额¥"+financeRecord.getZfrAmount() +"已通过内部审核,请签署融资合同";
+            remoteSystemService.sendNotice(companyId,id,tittle,"00","","03","0",financeRecord.getZfrHandler(),"", "01", "/financeRecord/recordSeal/"+id);
         }
 
         return AjaxResult.success();

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

@@ -388,7 +388,9 @@ public class FinanceRecordController extends BaseController {
         //已办
         notice.setStatus("1");
         sysNoticeService.update(notice,noticeLambdaQueryWrapper);
-        return AjaxResult.success();
+        Map result = new HashMap();
+        result.put("zfrId",zfrId);
+        return AjaxResult.success(result);
     }
 
     /**
@@ -879,5 +881,91 @@ public class FinanceRecordController extends BaseController {
             return conn.getInputStream();
     }
 
+
+    /**
+     * 合同作废
+     * @param map
+     * @return
+     * @throws Exception
+     */
+    @Log(title = "融资合同作废", businessType = BusinessType.UPDATE)
+    @Transactional(rollbackFor = Exception.class)
+    @PutMapping("/cancelContract")
+    public AjaxResult sealRefuse(@RequestBody Map<String,Object> map)throws Exception
+    {
+        //判断当前用户是否为该公司的经办人
+        //获取此操作员
+        //当前公司
+        String companyId = tokenService.getLoginUser().getSysUser().getCompanyId();
+        //获取当前用户
+        String currentUserId = CommonUtil.objToString(tokenService.getLoginUser().getSysUser().getUserId());
+        //查询当前用户是否是经办人
+        LambdaQueryWrapper<SysUserCompanyRel> companyRelWrapper = new LambdaQueryWrapper<>();
+        companyRelWrapper.eq(SysUserCompanyRel::getSucrUserId,currentUserId);
+        companyRelWrapper.eq(SysUserCompanyRel::getSucrCompanyId,companyId);
+        companyRelWrapper.eq(SysUserCompanyRel::getSucrHandler,"1");
+        List<SysUserCompanyRel> list = iSysUserCompanyRelService.findSysUserCompanyRels(companyRelWrapper);
+        if (list.size() < 1){
+            return AjaxResult.error("此操作需经办人权限,请确认您是否是经办人");
+        }
+        //获取融资编号
+        String zfrId = CommonUtil.objToString(map.get("zfrId"));
+        ZcFinanceInf financeInf = new ZcFinanceInf();
+        //获取时间
+        Date  time =  DateUtils.getNowDate();
+        //获取此操作员
+        LoginUser userInfo = tokenService.getLoginUser();
+        SysUser user = userInfo.getSysUser();
+        String userId = user.getUserId() + "";
+
+        /*---------------修改融资表----------*/
+        ZcFinanceRecord zcFinanceRecord = iZcFinanceRecordService.getById(zfrId);
+        //融资状态 02融资失败
+        zcFinanceRecord.setZfrStatus("02");
+        //修改人
+        zcFinanceRecord.setUpdateBy(userId);
+        //修改时间
+        zcFinanceRecord.setUpdateTime(time);
+        iZcFinanceRecordService.updateZcFinanceRecord(zcFinanceRecord);
+        /*-------------修改费用表--------*/
+        //查询此融资是否已存在
+        LambdaQueryWrapper<ZcChargeInf> queryWrapper = new LambdaQueryWrapper<>();
+        queryWrapper.eq(ZcChargeInf::getZciFinanceId,zfrId);
+
+        ZcChargeInf zcChargeInf = new ZcChargeInf();
+        //状态 99 删除
+        zcChargeInf.setZciStatus("99");
+        //修改人
+        zcChargeInf.setUpdateBy(userId);
+        //修改时间
+        zcChargeInf.setUpdateTime(time);
+        iZcChargeInfService.update(zcChargeInf, queryWrapper);
+        /*----------修改融信表状态---------------*/
+        ZcFinanceInf zcFinanceInf = iZcFinanceInfService.getById(zcFinanceRecord.getZfrFinanceId());
+        //融信状态(00:待确权 01:待签收 02:已生效 03:已失效 04:融资中 05:已融资 06:平台退回)
+        zcFinanceInf.setZfiStatus("02");
+        //修改人
+        zcFinanceInf.setUpdateBy(userId);
+        //修改时间
+        zcFinanceInf.setUpdateTime(time);
+        iZcFinanceInfService.updateZcFinanceInf(zcFinanceInf);
+
+        //待办更改为已办
+        LambdaQueryWrapper<SysNotice> noticeLambdaQueryWrapper = new LambdaQueryWrapper<>();
+        //待办
+        noticeLambdaQueryWrapper.eq(SysNotice::getStatus,"0");
+        //融信编号
+        noticeLambdaQueryWrapper.eq(SysNotice::getTableId,zfrId);
+        //待盖章
+        noticeLambdaQueryWrapper.eq(SysNotice::getWorkType,"03");
+        //待办
+        noticeLambdaQueryWrapper.eq(SysNotice::getType,"00");
+        SysNotice notice = new SysNotice();
+        //已办
+        notice.setStatus("1");
+        sysNoticeService.update(notice,noticeLambdaQueryWrapper);
+        return AjaxResult.success();
+    }
+
 }