Selaa lähdekoodia

修改代办标题中的企业名称

郎学彬 3 vuotta sitten
vanhempi
commit
3958406dbb

+ 67 - 40
sc-service/src/main/java/com/huyi/service/common/flowable/controller/FlowableController.java

@@ -119,6 +119,14 @@ public class  FlowableController extends BaseController
             @RequestParam("id") String id,
             @RequestParam("menuId") String menuId,
             @RequestParam("companyId") String companyId) throws Exception {
+        //根据id获取融信信息
+        ZcFinanceInf financeInf = zcFinanceInfService.getById(id);
+        //核心企业id
+        String zfiCoreId = financeInf.getZfiCoreId();
+        //融资企业id
+        String zfiSupplierId = financeInf.getZfiSupplierId();
+        //创建类型
+        String zfiCreateType = financeInf.getZfiCreateType();
         //核心企业融信开立审批
         if("1000000000".equals(menuId)){
             //修改
@@ -128,10 +136,6 @@ public class  FlowableController extends BaseController
             //审批通过
             zcFinanceInf.setZfiCoreStatus("01");
             zcFinanceInfService.updateById(zcFinanceInf);
-            //根据id获取融信信息
-            ZcFinanceInf financeInf = zcFinanceInfService.getById(id);
-            //核心企业id
-            String zfiCoreId = financeInf.getZfiCoreId();
             //发起人
             Long userId = Long.valueOf(financeInf.getCreateBy());
             //融信编号
@@ -151,7 +155,7 @@ public class  FlowableController extends BaseController
             //发送盖章待办
             String zfiId = id;
             remoteSystemService.sendNotice(zfiCoreId, zfiId,
-                    "核心企业开立审批融信编号为" + zfiNumber + "的资料待盖章,审批发起人为" + userName,
+                    "【核心开立】审批融信编号【" + zfiNumber + "】的资料待盖章,审批发起人为" + userName,
                     "00",null,"03","0", use.toString(),null, "01", "/credit/creditSeal/" + zfiId);
             //向发起人发起最终结果
             //发送人
@@ -164,8 +168,6 @@ public class  FlowableController extends BaseController
             ZcFinanceInf zcFinanceInf = zcFinanceInfService.getById(id);
             zcFinanceInf.setZfiCoreStatus("01");
             zcFinanceInfService.updateById(zcFinanceInf);
-            //核心企业Id
-            String zfiCoreId = zcFinanceInf.getZfiCoreId();
             //融信编号
             String zfiNumber = zcFinanceInf.getZfiNumber();
             //发起人Id
@@ -184,7 +186,7 @@ public class  FlowableController extends BaseController
             Long use = list.get(0).getSucrUserId();
             String zfiId = id;
             remoteSystemService.sendNotice(zfiCoreId, zfiId,
-                    "确权审批融信编号为" + zfiNumber + "的资料待盖章,审批发起人为" + userName,
+                    "【确权审批】融信编号【" + zfiNumber + "】的资料待盖章,审批发起人为" + userName,
                     "00",null,"03","0", use.toString(),null, "01", "/credit/confirmationAudit/" + zfiId);
             //TODO 经办人发送最终消息通知
             remoteSystemService.sendNotice(zfiCoreId, id,
@@ -202,8 +204,6 @@ public class  FlowableController extends BaseController
             //审批通过
             zcFinanceInf.setZfiSupplierStatus("01");
             zcFinanceInfService.update(zcFinanceInf,lambdaQueryWrapper);
-            //查询发起人,融资企业Id
-            ZcFinanceInf financeInf = zcFinanceInfService.getById(zfiId);
             //发起人Id
             Long user = Long.valueOf(financeInf.getCreateBy());
             //融资企业
@@ -266,18 +266,18 @@ public class  FlowableController extends BaseController
                 //调用平台审批
                 approvalService.addPlatformApproval(map);
             }else {
-                ZcFinanceInf financeInf = new ZcFinanceInf();
+                ZcFinanceInf financeInfs = new ZcFinanceInf();
                 //主键
-                financeInf.setZfiId(zfiId);
+                financeInfs.setZfiId(zfiId);
                 //平台审批状态(00:审批中, 01:审批通过, 02:审批拒绝, 03:暂存)
-                financeInf.setZfiPlatformStatus("01");
+                financeInfs.setZfiPlatformStatus("01");
                 //融资方审批状态(00:审批中, 01:审批通过, 02:审批拒绝, 03:暂存)
-                financeInf.setZfiSupplierStatus("01");
+                financeInfs.setZfiSupplierStatus("01");
                 //融信状态(00:待确权 01:待签收 02:已生效 03:已失效 04:融资中 05:已融资 06:平台退回)
 //                financeInf.setZfiStatus("02");
                 //签收日期
 //                financeInf.setZfiSignDate(DateUtils.getNowDate());
-                zcFinanceInfService.updateById(financeInf);
+                zcFinanceInfService.updateById(financeInfs);
                 //TODO 给融资企业经办人生成盖章待办
                 //融信编码
                 String zfiNumber = inf.getZfiNumber();
@@ -290,19 +290,24 @@ public class  FlowableController extends BaseController
                 if(list.size()>0){
                     user = list.get(0).getSucrUserId();
                 }
-                String title = "【合同签署】由【" + companyName +"】发起的融信【" + zfiNumber + "】资料待签署合同";
+                //核心企业名称
+                SysCompany coreCompany = sysCompanyService.getById(inf.getZfiCoreId());
+                String coreCompanyName = coreCompany.getScyName();
+                String title = "";
+                if("1".equals(zfiCreateType)){
+                    title = "【合同签署】由【" + coreCompanyName +"】发起的融信【" + zfiNumber + "】资料待签署合同";
+                }else{
+                    title = "【合同签署】由【" + companyName +"】发起的融信【" + zfiNumber + "】资料待签署合同";
+                }
+
                 remoteSystemService.sendNotice(company,zfiId,title,"00","","03","1",user.toString(),"", "01", "/credit/creditSeal/"+zfiId);
 
                 /**融信操作日志*/
-                //融资企业名称
-                SysCompany coreCompany = sysCompanyService.getById(inf.getZfiCoreId());
-                String coreCompanyName = coreCompany.getScyName();
+
           /*      financeLog.addFinanceLog(zfiId, "平台资料审核【通过】,融信资料提交《"+coreCompanyName+"》确权", null, FinanceLog.STATUS_ONE);
                 financeLog.addFinanceLog(zfiId, "融信确权生效【审批中】融信资料提交于《"+coreCompanyName+"》确权", null, FinanceLog.STATUS_ONE);*/
             }
             //TODO 发起人最终结果【通过】消息通知
-            //查询发起人,融资企业Id
-            ZcFinanceInf financeInf = zcFinanceInfService.getById(zfiId);
             //发起人Id
             Long user = Long.valueOf(financeInf.getCreateBy());
             //融信编号
@@ -334,8 +339,6 @@ public class  FlowableController extends BaseController
             String zfiProductId = inf.getZfiProductId();
             //融信编号
             String zfiNumber = inf.getZfiNumber();
-            //供应商企业id
-            String zfiSupplierId = inf.getZfiSupplierId();
             //查询融资产品是否需要平台审批
             ZcFinanceProduct zcFinanceProduct = iZcFinanceProductService.getById(zfiProductId);
             //是否需平台审批(0:不需要,1:需要)
@@ -376,10 +379,19 @@ public class  FlowableController extends BaseController
                 /*--------查询供应商企业名称-----------*/
                 //查询企业表
                 SysCompany supplierCompany = sysCompanyService.getById(zfiSupplierId);
-                //企业名称
+                //融资企业名称
                 String supplierName = supplierCompany.getScyName();
+                //查询企业表
+                SysCompany coreCompany = sysCompanyService.getById(zfiCoreId);
+                //核心企业名称
+                String coreName = coreCompany.getScyName();
+                String title = "";
+                if("1".equals(zfiCreateType)){
+                    title = "【合同签署】由【"+coreName+"】发起的融信【"+zfiNumber+"】资料待签署合同";
+                }else{
+                    title = "【合同签署】由【"+supplierName+"】发起的融信【"+zfiNumber+"】资料待签署合同";
+                }
                 //标题
-                String title = "【合同签署】由【"+supplierName+"】发起的融信【"+zfiNumber+"】资料待签署合同";
                 remoteSystemService.sendNotice(zfiSupplierId, zfiId,title,"00","","03","0",supplierUserId.toString(),"", "01", "/credit/addInformation/"+zfiId);
 
                 /**融信操作日志*/
@@ -398,12 +410,6 @@ public class  FlowableController extends BaseController
             ZcFinanceInf inf = zcFinanceInfService.getById(zfiId);
             //融信编号
             String zfiNumber = inf.getZfiNumber();
-            //核心企业id
-            String zfiCoreId = inf.getZfiCoreId();
-            //供应商企业id
-            String zfiSupplierId = inf.getZfiSupplierId();
-            //融信创建(0:供应商申请, 1:核心企业开立, 2:供应商开立)
-            String zfiCreateType = inf.getZfiCreateType();
             /*----------查询核心企业经办人----------*/
             //查询用户与企业关系表
             LambdaQueryWrapper<SysUserCompanyRel>companyWrapper = new LambdaQueryWrapper<>();
@@ -510,7 +516,7 @@ public class  FlowableController extends BaseController
                     //姓名
                     String userName = sysUser.getNickName();
                     remoteSystemService.sendNotice(zfiCoreId, zfiId,
-                            "确权审批融信编号为" + zfiNumber + "的资料待盖章,审批发起人为" + userName,
+                            "【确权审批】融信编号【" + zfiNumber + "】的资料待盖章,审批发起人为" + userName,
                             "00",null,"03","0", use.toString(),null, "01", "/credit/confirmationAudit/" + zfiId);
                     //TODO 经办人发送最终消息通知
                     remoteSystemService.sendNotice(zfiCoreId, id,
@@ -561,8 +567,7 @@ public class  FlowableController extends BaseController
             userQueryWrapper.eq(SysUserCompanyRel::getSucrHandler,"1");
             List<SysUserCompanyRel> userList = iSysUserCompanyRelService.findSysUserCompanyRels(userQueryWrapper);
             String userId= String.valueOf(userList.get(0).getSucrUserId());
-            //查询企业名称
-            SysCompany sysCompany = sysCompanyService.getById(companyId);
+
             LambdaQueryWrapper<ZcFinanceInf> lambdaQueryWrapper = new LambdaQueryWrapper<>();
             lambdaQueryWrapper.eq(ZcFinanceInf::getZfiId,id);
             ZcFinanceInf zcfInf = new ZcFinanceInf();
@@ -571,8 +576,20 @@ public class  FlowableController extends BaseController
             zcFinanceInfService.update(zcfInf,lambdaQueryWrapper);
             //查询融信信息
             ZcFinanceInf zcFinanceInf = zcFinanceInfService.getById(id);
+            //查询核心企业名称
+            SysCompany coreCompany = sysCompanyService.getById(zfiCoreId);
+            String coreName = coreCompany.getScyName();
+            //查询供应商企业名称
+            SysCompany supplierCompany = sysCompanyService.getById(zfiSupplierId);
+            String supplierName = supplierCompany.getScyName();
             //待办标题
-            String tittle = "【融资企业签收】由【"+sysCompany.getScyName() +"】发起的融信编号为【"+ zcFinanceInf.getZfiNumber()+"】的资料待签署";
+            String tittle = "";
+            if("1".equals(zfiCreateType)){
+                tittle = "【融资企业签收】由【"+coreName +"】发起的融信编号为【"+ zcFinanceInf.getZfiNumber()+"】的资料待签署";
+            }else {
+                tittle = "【融资企业签收】由【"+supplierName +"】发起的融信编号为【"+ zcFinanceInf.getZfiNumber()+"】的资料待签署";
+            }
+
             remoteSystemService.sendNotice(companyId,id,tittle,"00","","03","0",userId,"", "01", "/credit/signFor/"+id);
             //TODo 给融资企业生成盖章待办
         }
@@ -726,7 +743,7 @@ public class  FlowableController extends BaseController
             //确权待办
             String titles = "【内部审核退回】融信【"+ zfiNumber +"】内部审批退回,请维护资料后,再次提交内部审核。";
             remoteSystemService.sendNotice(zfiCoreId, id,titles,
-                    "00",null,"02","0", user.toString(), null, null, "/credit/confirmationAudit/"+zfiId);
+                    "00",null,"02","0", user.toString(), null, "01", "/credit/confirmationAudit/"+zfiId);
         }
         //融资企业融信申请拒绝
         else if("1000000002".equals(menuId)){
@@ -915,7 +932,7 @@ public class  FlowableController extends BaseController
             //企业名称
             String coreName = coreCompany.getScyName();
             //标题
-            String title = "【审批拒绝】【"+coreName +"】的融信【"+zfiNumber+"】审批被拒绝,拒绝的理由为:【"+reason+"】";
+            String title = "【审批拒绝】融信编号【"+zfiNumber+"】审批被拒绝,拒绝的理由为:【"+reason+"】";
             remoteSystemService.sendNotice(zfiSupplierId, zfiId,title,"01","02","","0",supplierUserId.toString(),"", null, null);
 
             /**融信操作日志*/
@@ -940,8 +957,7 @@ public class  FlowableController extends BaseController
             String zfiNumber = inf.getZfiNumber();
             //融信创建(0:供应商申请, 1:核心企业开立, 2:供应商开立)
             String zfiCreateType = inf.getZfiCreateType();
-            //查询企业名称
-            SysCompany sysCompany = sysCompanyService.getById(companyId);
+
             LambdaQueryWrapper<ZcFinanceInf> lambdaQueryWrapper = new LambdaQueryWrapper<>();
             lambdaQueryWrapper.eq(ZcFinanceInf::getZfiId,id);
             ZcFinanceInf zcFinanceInf = new ZcFinanceInf();
@@ -962,7 +978,18 @@ public class  FlowableController extends BaseController
             notice.setStatus("1");
             sysNoticeService.update(notice,noticeLambdaQueryWrapper);
             //待办标题
-            String tittle = "【融资签收】由【" + sysCompany.getScyName() + "】发起的:融信编号【" + zfiNumber + "】资料代签收";
+            //查询企业名称
+            SysCompany coreCompany = sysCompanyService.getById(inf.getZfiCoreId());
+            String coreName = coreCompany.getScyName();
+            SysCompany supplierCompany = sysCompanyService.getById(inf.getZfiSupplierId());
+            String supplierName = supplierCompany.getScyName();
+            String tittle = "";
+            if("1".equals(zfiCreateType)){
+                tittle = "【融资签收】由【" + coreName + "】发起的:融信编号【" + zfiNumber + "】资料代签收";
+            }else{
+                tittle = "【融资签收】由【" + supplierName + "】发起的:融信编号【" + zfiNumber + "】资料代签收";
+            }
+
             remoteSystemService.sendNotice(companyId, id, tittle, "00", null, "03", "0", userId, null, "01", "/credit/signFor/"+id);
             //TODO 给融资企业经办人签收待办
         }//融资审批

+ 53 - 5
sc-service/src/main/java/com/huyi/service/common/flowable/service/impl/ApprovalServiceImpl.java

@@ -73,11 +73,18 @@ public class ApprovalServiceImpl implements ApprovalService {
         String zfiCoreId = 	CommonUtil.objToString(map.get("zfiCoreId"));
         //融资企业Id
         String zfiSupplierId = CommonUtil.objToString(map.get("zfiSupplierId"));
+        String zfiCreateType ="";
+        if(map.containsKey("zfiCreateType")){
+            zfiCreateType = CommonUtil.objToString(map.get("zfiCreateType"));
+        }
         LambdaQueryWrapper<SysCompany> queryWrapper = new LambdaQueryWrapper<>();
         queryWrapper.eq(SysCompany::getScyId,zfiCoreId);
         List<SysCompany> list = iSysCompanyService.findSysCompanys(queryWrapper);
         //核心企业名称
         String scyName = list.get(0).getScyName();
+        //融资企业
+        SysCompany company = iSysCompanyService.getById(zfiSupplierId);
+        String supplierName = company.getScyName();
         //查询当前操作员
         LoginUser user = tokenService.getLoginUser();
         //当前企业ID
@@ -122,8 +129,14 @@ public class ApprovalServiceImpl implements ApprovalService {
                 lambdaQueryWrapper.eq(SysUserCompanyRel::getSucrHandler,"1");
                 List<SysUserCompanyRel> listUser = iSysUserCompanyRelService.findSysUserCompanyRels(lambdaQueryWrapper);
                 //发送盖章待办
+                String title = "";
+                if("1".equals(zfiCreateType)){
+                    title = "【核心开立】审批由【"+ scyName + "】发起的融信编号【" + zfiNumber + "】的资料待盖章";
+                }else{
+                    title = "【核心开立】审批由【"+ supplierName + "】发起的融信编号【" + zfiNumber + "】的资料待盖章";
+                }
                 remoteSystemService.sendNotice(zfiCoreId, zfiId,
-                        "【核心开立】审批由【"+ scyName + "】发起的融信编号【" + zfiNumber + "】的资料待盖章",
+                        title,
                         "00",null,"03","0", listUser.get(0).getSucrUserId().toString(),null, "01", "/credit/creditSeal/" + zfiId);
                 //向发起人发送最终结果【通过】消息通知
                 remoteSystemService.sendNotice(companyId, String.valueOf(userId),
@@ -229,7 +242,7 @@ public class ApprovalServiceImpl implements ApprovalService {
                 //签收日期
                 zcFinanceInf.setZfiSignDate(DateUtils.getNowDate());
                 //TODO 融资企业经办人盖章代办
-                String title = "【合同签署】由【"+supplierName+"】发起的融信【"+zfiNumber+"】资料待签署合同";
+                String title = "【合同签署】由【"+coreName+"】发起的融信【"+zfiNumber+"】资料待签署合同";
                 remoteSystemService.sendNotice(zfiSupplierId, zfiId,title,"00","","03","0",supplierUserId.toString(),"", "01", "/credit/creditSeal/"+zfiId);
                 /**融信操作日志*/
                 financeLog.addFinanceLog(CommonUtil.objToString(map.get("zfiId")), "平台资料审核【通过】,融信资料提交《"+supplierName+"》签收", null, FinanceLog.STATUS_TWO);
@@ -257,7 +270,13 @@ public class ApprovalServiceImpl implements ApprovalService {
             }
             // TODO 不管什么类型都给 核心企业经办人 确权待办
             //标题
-            String titles = "【融信确权】由【"+coreName+"】发起的融信【"+zfiNumber+"】资料待确权";
+            String titles ="";
+            if("1".equals(zfiCreateType)){
+                titles = "【融信确权】由【"+coreName+"】发起的融信【"+zfiNumber+"】资料待确权";
+            }else{
+                titles = "【融信确权】由【"+supplierName+"】发起的融信【"+zfiNumber+"】资料待确权";
+            }
+
             remoteSystemService.sendNotice(zfiCoreId, zfiId,titles,"00","","02","0",coreUserId.toString(),"", "01", "/credit/confirmationAudit/"+zfiId);
             zcFinanceInfService.updateById(zcFinanceInf);
         }else if (!"200".equals(resMap.get("code"))) {
@@ -349,6 +368,12 @@ public class ApprovalServiceImpl implements ApprovalService {
     public void addSignApproval(@RequestBody Map map) throws Exception {
         Map<String, Object> flowParam = new HashMap<String, Object>();
         String companyId = CommonUtil.objToString(map.get("zfiSupplierId"));
+        //核心企业Id
+        String zfiCoreId = CommonUtil.objToString(map.get("zfiCoreId"));
+        String zfiCreateType ="";
+        if(map.containsKey("zfiCreateType")){
+            zfiCreateType = CommonUtil.objToString(map.get("zfiCreateType"));
+        }
         LambdaQueryWrapper<SysUserCompanyRel> userQueryWrapper = new LambdaQueryWrapper<>();
         userQueryWrapper.eq(SysUserCompanyRel::getSucrCompanyId,companyId);
         userQueryWrapper.eq(SysUserCompanyRel::getSucrHandler,"1");
@@ -357,6 +382,9 @@ public class ApprovalServiceImpl implements ApprovalService {
         //查询用户名称
         SysUser sysUser = iSysUserService.getById(userId);
         SysCompany sysCompany = iSysCompanyService.getById(companyId);
+        //核心企业
+        SysCompany company = iSysCompanyService.getById(zfiCoreId);
+        String coreName = company.getScyName();
         String userName =  sysUser.getNickName();
         //查询当前操作员
         flowParam.put("menuId", "1000000005");
@@ -394,7 +422,12 @@ public class ApprovalServiceImpl implements ApprovalService {
             zcFinanceInf.setZfiSupplierStatus("01");
             zcFinanceInfService.updateById(zcFinanceInf);
             //待办标题
-            String tittle = "【融资企业签收】由【"+sysCompany.getScyName() +"】发起的:融信编号为【"+ CommonUtil.objToString(map.get("zfiNumber"))+"】的资料待签署";
+            String tittle = "";
+            if("1".equals(zfiCreateType)){
+                tittle = "【融资企业签收】由【"+coreName +"】发起的:融信编号为【"+ CommonUtil.objToString(map.get("zfiNumber"))+"】的资料待签署";
+            }else {
+                tittle = "【融资企业签收】由【"+sysCompany.getScyName() +"】发起的:融信编号为【"+ CommonUtil.objToString(map.get("zfiNumber"))+"】的资料待签署";
+            }
             remoteSystemService.sendNotice(companyId,CommonUtil.objToString(map.get("zfiId")),tittle,"00",null,"03","0",userId,null, "01", "/credit/addInformation/"+CommonUtil.objToString(map.get("zfiId")));
             //TODO 给融资企业经办人盖章待办
         }else if ("450".equals(resMap.get("code"))) {
@@ -495,11 +528,20 @@ public class ApprovalServiceImpl implements ApprovalService {
         Map<String, Object> flowParam = new HashMap<String, Object>();
         //查询当前操作员
         String companyId = CommonUtil.objToString(map.get("zfiSupplierId"));
+        //核心企业Id
+        String zfiCoreId = CommonUtil.objToString(map.get("zfiCoreId"));
         LambdaQueryWrapper<SysUserCompanyRel> userQueryWrapper = new LambdaQueryWrapper<>();
         userQueryWrapper.eq(SysUserCompanyRel::getSucrCompanyId,companyId);
         userQueryWrapper.eq(SysUserCompanyRel::getSucrHandler,"1");
         List<SysUserCompanyRel> userList = iSysUserCompanyRelService.findSysUserCompanyRels(userQueryWrapper);
         String userId= String.valueOf(userList.get(0).getSucrUserId());
+        //融资企业
+        SysCompany company = iSysCompanyService.getById(zfiCoreId);
+        String coreName = company.getScyName();
+        String zfiCreateType ="";
+        if(map.containsKey("zfiCreateType")){
+            zfiCreateType = CommonUtil.objToString(map.get("zfiCreateType"));
+        }
         //查询用户名称
         SysUser sysUser = iSysUserService.getById(userId);
         String userName =  sysUser.getNickName();
@@ -598,7 +640,13 @@ public class ApprovalServiceImpl implements ApprovalService {
                 //financeInf.setZfiSignDate(DateUtils.getNowDate());
 //                zcFinanceInfService.updateById(financeInf);
                 //TODO 给融资企业经办人生成一条盖章待办
-                String title = "【合同签署】由【"+supplierName+"】发起的融信【"+zfiNumber+"】资料待签署合同";
+                String title = "";
+                if("1".equals(zfiCreateType)){
+                    title = "【合同签署】由【"+coreName+"】发起的融信【"+zfiNumber+"】资料待签署合同";
+                }else {
+                     title = "【合同签署】由【"+supplierName+"】发起的融信【"+zfiNumber+"】资料待签署合同";
+                }
+
                 remoteSystemService.sendNotice(zfiSupplierId, zfiId,title,"00","","03","0",supplierUserId.toString(),"", "01", "/credit/creditSeal/"+zfiId);
 
                 /**融信操作日志*/