Ver código fonte

融资方签收,补充资料的待办跳转页面修改,增加判断有无内部审批,没有内部审批,直接通过

xuefy 3 anos atrás
pai
commit
87e6c337cf

+ 51 - 5
sc-service/src/main/java/com/huyi/service/common/flowable/controller/FlowableController.java

@@ -6,6 +6,7 @@ import com.huyi.service.base.entity.*;
 import com.huyi.service.base.service.*;
 import com.huyi.service.common.financeLog.FinanceLog;
 import com.huyi.service.common.flowable.service.ApprovalService;
+import com.huyi.service.util.FlowableService;
 import com.keao.tianhu.starter.mybatis.plus.entity.QueryRequest;
 import com.tianhu.common.core.utils.CommonUtil;
 import com.tianhu.common.core.utils.DateUtils;
@@ -80,6 +81,8 @@ public class  FlowableController extends BaseController
     //待办服务类
     @Autowired
     private  ISysNoticeService sysNoticeService;
+    @Autowired
+    private FlowableService flowableService;
 
 
     /**
@@ -375,7 +378,7 @@ public class  FlowableController extends BaseController
                 String supplierName = supplierCompany.getScyName();
                 //标题
                 String title = "【合同签署】由【"+supplierName+"】发起的融信【"+zfiNumber+"】资料待签署合同";
-                remoteSystemService.sendNotice(zfiSupplierId, zfiId,title,"00","","03","0",supplierUserId.toString(),"", "01", "/credit/creditSeal/"+zfiId);
+                remoteSystemService.sendNotice(zfiSupplierId, zfiId,title,"00","","03","0",supplierUserId.toString(),"", "01", "/credit/addInformation/"+zfiId);
 
                 /**融信操作日志*/
                 financeLog.addFinanceLog(zfiId, "平台资料审核【通过】,融信资料提交《"+supplierName+"》签收", null, FinanceLog.STATUS_TWO);
@@ -470,9 +473,52 @@ public class  FlowableController extends BaseController
             }else if ("0".equals(zfiCreateType)){
                 //融信状态(00:待确权 01:待签收 02:已生效 03:已失效 04:融资中 05:已融资 06:平台退回)
                 zcFinanceInf.setZfiStatus("00");
-                /**融信操作日志*/
-                financeLog.addFinanceLog(id, "平台资料审核【通过】,融信资料提交《"+coreName+"》确权", null, FinanceLog.STATUS_ONE);
-                financeLog.addFinanceLog(id, "融信确权【审批中】融信资料提交于《"+coreName+"》确权", null, FinanceLog.STATUS_ONE);
+                //需要查询核心企业有没有开启确权审批
+                //获取核心企业
+                String coreCompanyId = inf.getZfiCoreId();
+                Map<String,Object> map = new HashMap<>();
+                //menuId
+                map.put("menuId","1000000007");
+                map.put("companyId",coreCompanyId);
+                Map<String,Object> mmp = flowableService.selectApproval(map);
+                //不等于200
+                if(CommonUtil.compare(CommonUtil.objToString(mmp.get("code")),"200") != 0){
+                    throw  new Exception("查询审批流程失败");
+                }
+                List<Map<String,Object>>  list = (List<Map<String, Object>>) mmp.get("data");
+                //未开启流程审批
+                if(list.size() < 1){
+                    //核心企业通过
+                    zcFinanceInf.setZfiCoreStatus("01");
+                    //获取核心企业经办人
+                    LambdaQueryWrapper<SysUserCompanyRel> queryWrapper = new LambdaQueryWrapper<>();
+                    //核心企业Id
+                    queryWrapper.eq(SysUserCompanyRel::getSucrCompanyId,zfiCoreId);
+                    //是否经办人(1:是)
+                    queryWrapper.eq(SysUserCompanyRel::getSucrHandler,"1");
+                    List<SysUserCompanyRel> userList = iSysUserCompanyRelService.findSysUserCompanyRels(queryWrapper);
+                    if(userList.size() < 1){
+                        throw  new Exception("获取经办人信息失败");
+                    }
+                    Long use = userList.get(0).getSucrUserId();
+                    //发起人Id
+                    Long userId = Long.valueOf(zcFinanceInf.getCreateBy());
+                    //根据发起人Id获取发送人姓名
+                    SysUser sysUser = iSysUserService.getById(userId);
+                    //姓名
+                    String userName = sysUser.getNickName();
+                    remoteSystemService.sendNotice(zfiCoreId, zfiId,
+                            "确权审批融信编号为" + zfiNumber + "的资料待盖章,审批发起人为" + userName,
+                            "00",null,"03","0", use.toString(),null, "01", "/credit/confirmationAudit/" + zfiId);
+                    //TODO 经办人发送最终消息通知
+                    remoteSystemService.sendNotice(zfiCoreId, id,
+                            "确权审批融信编号为" + zfiNumber + "的资料审批已通过",
+                            "01","01",null,"0", use.toString(), null, null, null);
+                }else{
+                    /**融信操作日志*/
+                    financeLog.addFinanceLog(id, "平台资料审核【通过】,融信资料提交《"+coreName+"》确权", null, FinanceLog.STATUS_ONE);
+                    financeLog.addFinanceLog(id, "融信确权【审批中】融信资料提交于《"+coreName+"》确权", null, FinanceLog.STATUS_ONE);
+                }
             }
             //TODO 融资企业开立时, 给融资企业经办人生成盖章待办
             else if ("2".equals(zfiCreateType)){
@@ -525,7 +571,7 @@ public class  FlowableController extends BaseController
             ZcFinanceInf zcFinanceInf = zcFinanceInfService.getById(id);
             //待办标题
             String tittle = "【融资企业签收】由【"+sysCompany.getScyName() +"】发起的融信编号为【"+ zcFinanceInf.getZfiNumber()+"】的资料待签署";
-            remoteSystemService.sendNotice(companyId,id,tittle,"00","","03","0",userId,"", "01", "/credit/addInformation/"+id);
+            remoteSystemService.sendNotice(companyId,id,tittle,"00","","03","0",userId,"", "01", "/credit/signFor/"+id);
             //TODo 给融资企业生成盖章待办
         }
         //融资审批通过

+ 84 - 14
sc-service/src/main/java/com/huyi/service/credit/controller/OwnMessageController.java

@@ -8,6 +8,7 @@ import com.huyi.service.common.financeLog.FinanceLog;
 import com.huyi.service.constant.FileConstants;
 import com.huyi.service.credit.service.OwnCreditService;
 import com.huyi.service.util.DocumentConstant;
+import com.huyi.service.util.FlowableService;
 import com.keao.tianhu.core.util.AmtUtil;
 import com.tianhu.common.core.cfca.AxqCommonUtil;
 import com.tianhu.common.core.cfca.CfcaUtil;
@@ -109,6 +110,10 @@ public class OwnMessageController extends BaseController {
     //往来账款服务类
     @Autowired
     private IZcBillInfService  billInfService;
+    @Autowired
+    private FlowableService flowableService;
+    @Autowired
+    private ISysUserService iSysUserService;
 
     /**
      * 发送短信
@@ -690,6 +695,13 @@ public class OwnMessageController extends BaseController {
         if(coreHanderList.size() > 0){
             coreHandler = CommonUtil.objToString(coreHanderList.get(0).getSucrUserId());
         }
+
+        //发起人Id
+        Long createId = Long.valueOf(financeInf.getCreateBy());
+        //根据发起人Id获取发送人姓名
+        com.huyi.service.base.entity.SysUser sysUser = iSysUserService.getById(createId);
+        //姓名
+        String userName = sysUser.getNickName();
         //核心开立
         if("1".equals(createType)){
             //核心企业
@@ -763,6 +775,41 @@ public class OwnMessageController extends BaseController {
                 finance.setZfiId(zfiId);
                 //待签收
                 finance.setZfiStatus("01");
+                //查询融资方有没有开启签收审批
+                Map<String,Object> pp = new HashMap<>();
+                //menuId
+                pp.put("menuId","1000000005");
+                pp.put("companyId",zfiSupplierId);
+                Map<String,Object> mmp = flowableService.selectApproval(pp);
+                //不等于200
+                if(CommonUtil.compare(CommonUtil.objToString(mmp.get("code")),"200") != 0){
+                    throw  new Exception("查询审批流程失败");
+                }
+                List<Map<String,Object>>  openList = (List<Map<String, Object>>) mmp.get("data");
+                //未开启流程审批
+                if(openList.size() < 1){
+                    //融资企业通过
+                    finance.setZfiSupplierStatus("01");
+                    String tittle = "【融资企业签收】由【"+openName+"】发起的融信编号为【"+ financeInf.getZfiNumber()+"】的资料待签署";
+                    remoteSystemService.sendNotice(companyId,zfiId,tittle,"00","","03","0",financeInf.getCreateBy(),"", "01", "/credit/signFor/"+zfiId);
+                    //签收待办改为已办
+                    LambdaQueryWrapper<SysNotice> queryWrapper = new LambdaQueryWrapper<>();
+                    queryWrapper.eq(SysNotice::getTableId,zfiId);
+                    queryWrapper.eq(SysNotice::getType,"00");
+                    queryWrapper.eq(SysNotice::getWorkType,"04");
+                    queryWrapper.eq(SysNotice::getStatus,"0");
+                    SysNotice notice = new SysNotice();
+                    notice.setStatus("1");
+                    sysNoticeService.update(notice,queryWrapper);
+                }else{
+                    //给融资企业经办人生成签收待办
+                    String title = "【融资签收】"+openName+"的【"+zfiNumber+"】,融信金额【"+AmtUtil.moneyFormat(zfiAmount)+"】,(大写:"+zfiAmountBig+"),融信待签收";
+                    remoteSystemService.sendNotice(zfiSupplierId,zfiId,title,"00","","04","0",supplierHandler,"", "01", "/credit/signFor/"+zfiId);
+
+                    /**融信操作日志*/
+                    financeLog.addFinanceLog(zfiId, "融信确权【通过】,融信提交于《"+receiverName+"》签收", user.getUserId(), FinanceLog.STATUS_TWO);
+                    financeLog.addFinanceLog(zfiId, "《"+receiverName+"》待签收", user.getUserId(), FinanceLog.STATUS_TWO);
+                }
                 //修改时间
                 finance.setUpdateTime(DateUtils.getNowDate());
                 //修改人
@@ -774,13 +821,7 @@ public class OwnMessageController extends BaseController {
                 if(num != 1){
                     throw new Exception("盖章异常");
                 }
-                //给融资企业经办人生成签收待办
-                String title = "【融资签收】"+openName+"的【"+zfiNumber+"】,融信金额【"+AmtUtil.moneyFormat(zfiAmount)+"】,(大写:"+zfiAmountBig+"),融信待签收";
-                remoteSystemService.sendNotice(zfiSupplierId,zfiId,title,"00","","04","0",supplierHandler,"", "01", "/credit/signFor/"+zfiId);
 
-                /**融信操作日志*/
-                financeLog.addFinanceLog(zfiId, "融信确权【通过】,融信提交于《"+receiverName+"》签收", user.getUserId(), FinanceLog.STATUS_TWO);
-                financeLog.addFinanceLog(zfiId, "《"+receiverName+"》待签收", user.getUserId(), FinanceLog.STATUS_TWO);
 
             }else if("02".equals(companyType)){
                 //融资企业
@@ -870,14 +911,47 @@ public class OwnMessageController extends BaseController {
                 finance.setZfiId(zfiId);
                 //待确权
                 finance.setZfiStatus("00");
+                //查询核心企业有无开启确权审批
+                Map<String,Object> pp = new HashMap<>();
+                //menuId
+                pp.put("menuId","1000000007");
+                pp.put("companyId",zfiCoreId);
+                Map<String,Object> mmp = flowableService.selectApproval(pp);
+                //不等于200
+                if(CommonUtil.compare(CommonUtil.objToString(mmp.get("code")),"200") != 0){
+                    throw  new Exception("查询审批流程失败");
+                }
+                List<Map<String,Object>>  openList = (List<Map<String, Object>>) mmp.get("data");
+                //没有开启确权审批
+                if(openList.size() < 1){
+                    //核心审批通过
+                    finance.setZfiCoreStatus("01");
+                    remoteSystemService.sendNotice(zfiCoreId, zfiId,
+                            "确权审批融信编号为" + zfiNumber + "的资料待盖章,审批发起人为" + userName,
+                            "00",null,"03","0", coreHandler,null, "01", "/credit/confirmationAudit/" + zfiId);
+                    //TODO 经办人发送最终消息通知
+                    remoteSystemService.sendNotice(zfiCoreId, zfiId,
+                            "确权审批融信编号为" + zfiNumber + "的资料审批已通过",
+                            "01","01",null,"0", coreHandler, null, null, null);
+                    //确权待办改为已办
+                    LambdaQueryWrapper<SysNotice> queryWrapper = new LambdaQueryWrapper<>();
+                    queryWrapper.eq(SysNotice::getTableId,zfiId);
+                    queryWrapper.eq(SysNotice::getType,"00");
+                    queryWrapper.eq(SysNotice::getWorkType,"02");
+                    queryWrapper.eq(SysNotice::getStatus,"0");
+                    SysNotice notice = new SysNotice();
+                    notice.setStatus("1");
+                    sysNoticeService.update(notice,queryWrapper);
+                }else{
+                    //给核心企业经办人生成一条确权待办
+                    String  title = "【融信待确权】由"+receiverName+"提交的融信【"+zfiNumber+"】,融信金额【"+AmtUtil.moneyFormat(zfiAmount)+"】,(大写:"+zfiAmountBig+"),融信待确权";
+                    remoteSystemService.sendNotice(zfiCoreId,zfiId,title,"00","","02","0",coreHandler,"", "01", "/credit/confirmationAudit/"+zfiId);
+                }
                 //修改时间
                 finance.setUpdateTime(DateUtils.getNowDate());
                 //修改人
                 finance.setUpdateBy(userId);
                 financeInfService.updateById(finance);
-                //给核心企业经办人生成一条确权待办
-                String  title = "【融信待确权】由"+receiverName+"提交的融信【"+zfiNumber+"】,融信金额【"+AmtUtil.moneyFormat(zfiAmount)+"】,(大写:"+zfiAmountBig+"),融信待确权";
-                remoteSystemService.sendNotice(zfiCoreId,zfiId,title,"00","","02","0",coreHandler,"", "01", "/credit/confirmationAudit/"+zfiId);
             }
 
         }
@@ -885,11 +959,7 @@ public class OwnMessageController extends BaseController {
         LambdaQueryWrapper<SysNotice> queryWrapper = new LambdaQueryWrapper<>();
         queryWrapper.eq(SysNotice::getTableId,zfiId);
         queryWrapper.eq(SysNotice::getType,"00");
-        List<String> typeList = new ArrayList<>();
-        typeList.add("02");
-        typeList.add("03");
-        typeList.add("04");
-        queryWrapper.in(SysNotice::getWorkType,typeList);
+        queryWrapper.eq(SysNotice::getWorkType,"03");
         queryWrapper.eq(SysNotice::getStatus,"0");
         SysNotice notice = new SysNotice();
         notice.setStatus("1");