Bläddra i källkod

消息发送修改

tudc 3 år sedan
förälder
incheckning
643e90e108

+ 16 - 41
sc-service/src/main/java/com/huyi/service/common/flowable/controller/FlowableController.java

@@ -137,23 +137,16 @@ public class  FlowableController extends BaseController
             lambdaQueryWrapper.eq(SysUserCompanyRel::getSucrHandler,"1");
             List<SysUserCompanyRel> listUser = iSysUserCompanyRelService.findSysUserCompanyRels(lambdaQueryWrapper);
             //获取发送人
-            Long use = null;
-            List<Long> longUserList = new ArrayList<>();
-            if(listUser.size() > 0) {
-                use = listUser.get(0).getSucrUserId();
-                longUserList.add(use);
-            }
+            Long use = listUser.get(0).getSucrUserId();
             //发送盖章待办
             remoteSystemService.sendNotice(zfiCoreId, id,
                     "核心企业开立审批融信编号为" + zfiNumber + "的资料待盖章,审批发起人为" + userName,
-                    "00",null,"03","0", longUserList,null);
+                    "00",null,"03","0", use.toString(),null);
             //向发起人发起最终结果
             //发送人
-            List<Long> longUser = new ArrayList<>();
-            longUser.add(userId);
             remoteSystemService.sendNotice(zfiCoreId, id,
                     "核心企业开立融信编号为" + zfiNumber + "的资料审批已通过",
-                    "01","01",null,"0", longUser, null);
+                    "01","01",null,"0", userId.toString(), null);
             //核心企业确权审批
         }else if("1000000007".equals(menuId)){
             //融信主键
@@ -177,15 +170,10 @@ public class  FlowableController extends BaseController
             //是否经办人(1:是)
             queryWrapper.eq(SysUserCompanyRel::getSucrHandler,"1");
             List<SysUserCompanyRel> list = iSysUserCompanyRelService.findSysUserCompanyRels(queryWrapper);
-            Long use = null;
-            List<Long> longUserList = new ArrayList<>();
-            if(list.size() > 0){
-                use = list.get(0).getSucrUserId();
-                longUserList.add(use);
-            }
+            Long use = list.get(0).getSucrUserId();
             remoteSystemService.sendNotice(zfiCoreId, id,
                     "确权审批融信编号为" + zfiNumber + "的资料待盖章,审批发起人为" + userName,
-                    "00",null,"03","0", longUserList,null);
+                    "00",null,"03","0", use.toString(),null);
         }
         //融资企业融信申请审批通过
         else if("1000000002".equals(menuId)){
@@ -211,11 +199,9 @@ public class  FlowableController extends BaseController
             //创建人名称
             SysUser sysUser = sysUserService.getById(user);
             String userName = sysUser.getNickName();
-            List list = new ArrayList();
-            list.add(user);
             //TODO  发起人最终结果【通过】消息通知
             String title = "【审批通过】由"+ userName +"于"+ createTime +"发起的:融信"+ number +"资料审核已通过,请进行下一步业务操作;";
-            remoteSystemService.sendNotice(company,zfiId,title,"01","01","","0",list,"");
+            remoteSystemService.sendNotice(company,zfiId,title,"01","01","","0",user.toString(),"");
             //调用平台审批接口
             Map map = new HashMap();
             //实体类转map
@@ -283,10 +269,8 @@ public class  FlowableController extends BaseController
                 if(list.size()>0){
                     user = list.get(0).getSucrUserId();
                 }
-                List userList = new ArrayList();
-                userList.add(user);
                 String title = "【合同签署】由【" + companyName +"】发起的融信【" + zfiNumber + "】资料待签署合同";
-                remoteSystemService.sendNotice(company,zfiId,"title","00","","03","1",userList,"");
+                remoteSystemService.sendNotice(company,zfiId,"title","00","","03","1",user.toString(),"");
             }
             //TODO 发起人最终结果【通过】消息通知
             //查询发起人,融资企业Id
@@ -302,10 +286,8 @@ public class  FlowableController extends BaseController
             //创建人名称
             SysUser sysUser = sysUserService.getById(user);
             String userName = sysUser.getNickName();
-            List list = new ArrayList();
-            list.add(user);
             String title = "【审批通过】由"+ userName +"于"+ createTime +"发起的:融信"+ number +"资料审核已通过,请进行下一步业务操作;";
-            remoteSystemService.sendNotice(company,zfiId,title,"01","01","","0",list,"");
+            remoteSystemService.sendNotice(company,zfiId,title,"01","01","","0",user.toString(),"");
         }//融资企业补充资料审批通过
         else if("1000000003".equals(menuId)){
             LambdaQueryWrapper<ZcFinanceInf> wrapper = new LambdaQueryWrapper<>();
@@ -363,12 +345,7 @@ public class  FlowableController extends BaseController
                 userCompanyWrapper.eq(SysUserCompanyRel::getSucrHandler,"1");
                 List<SysUserCompanyRel> userCompanyList = iSysUserCompanyRelService.findSysUserCompanyRels(userCompanyWrapper);
                 //经办人
-                Long supplierUserId = null;
-                if (userCompanyList.size() > 0){
-                    supplierUserId = userCompanyList.get(0).getSucrUserId();
-                }
-                List supplierUserList = new ArrayList();
-                supplierUserList.add(supplierUserId);
+                Long supplierUserId = userCompanyList.get(0).getSucrUserId();;
                 /*--------查询供应商企业名称-----------*/
                 //查询企业表
                 SysCompany supplierCompany = sysCompanyService.getById(zfiSupplierId);
@@ -376,7 +353,7 @@ public class  FlowableController extends BaseController
                 String supplierName = supplierCompany.getScyName();
                 //标题
                 String title = "【合同签署】由【"+supplierName+"】发起的融信【"+zfiNumber+"】资料待签署合同";
-                remoteSystemService.sendNotice(zfiSupplierId, zfiId,title,"00","","03","0",supplierUserList,"");
+                remoteSystemService.sendNotice(zfiSupplierId, zfiId,title,"00","","03","0",supplierUserId.toString(),"");
 
             }
         } //平台审批通过
@@ -440,7 +417,7 @@ public class  FlowableController extends BaseController
             else if ("2".equals(zfiCreateType)){
                 //标题
                 String title = "【合同签署】由【"+supplierName+"】发起的融信【"+zfiNumber+"】资料待签署合同";
-                remoteSystemService.sendNotice(zfiSupplierId, zfiId,title,"00","","03","0",supplierUserList,"");
+                remoteSystemService.sendNotice(zfiSupplierId, zfiId,title,"00","","03","0",supplierUserId.toString(),"");
             }
             //更新融信表状态
             wrapper.eq(ZcFinanceInf::getZfiId,zfiId);
@@ -448,7 +425,7 @@ public class  FlowableController extends BaseController
             // TODO 不管什么类型都给 融资企业经办人 最终结果【通过】消息通知
             //标题
             String title = "【审批通过】您提交于【"+coreName +"】的融信【"+zfiNumber+"】已审批通过,请进行下一步业务操作";
-            remoteSystemService.sendNotice(zfiSupplierId, zfiId,title,"01","02","","0",supplierUserList,"");
+            remoteSystemService.sendNotice(zfiSupplierId, zfiId,title,"01","02","","0",supplierUserId.toString(),"");
             if ("2".equals(zfiCreateType)){
                 Map map = new HashMap();
                 if (inf != null) {
@@ -573,13 +550,11 @@ public class  FlowableController extends BaseController
             //创建人名称
             SysUser sysUser = sysUserService.getById(user);
             String userName = sysUser.getNickName();
-            List list = new ArrayList();
-            list.add(user);
             String title = "【审批拒绝】由"+ userName +"于"+ createTime +"发起的:融信"+ number +"审批被拒绝,拒绝的理由为:"+ reason;
-            remoteSystemService.sendNotice(company,zfiId,title,"01","01","","0",list,"");
+            remoteSystemService.sendNotice(company,zfiId,title,"01","01","","0",user.toString(),"");
             //TODO 发起人生成待办
             title = "【内部审批】融信【"+number+"】资料待审批,审批发起人【" + userName +"】";
-            remoteSystemService.sendNotice(company,zfiId,title,"00","","01","0",list,"");
+            remoteSystemService.sendNotice(company,zfiId,title,"00","","01","0",user.toString(),"");
         }//融资企业融信开立拒绝
         else if("1000000001".equals(menuId)){
             LambdaQueryWrapper<ZcFinanceInf> lambdaQueryWrapper = new LambdaQueryWrapper<>();
@@ -615,7 +590,7 @@ public class  FlowableController extends BaseController
             List list = new ArrayList();
             list.add(user);
             String title = "【审批拒绝】由"+ userName +"于"+ createTime +"发起的:融信"+ number +"审批被拒绝,拒绝的理由为:"+reason;
-            remoteSystemService.sendNotice(company,zfiId,title,"01","01","","0",list,"");
+            remoteSystemService.sendNotice(company,zfiId,title,"01","01","","0",user.toString(),"");
         }//融资企业补充资料审批拒绝
         else if("1000000003".equals(menuId)){
             LambdaQueryWrapper<ZcFinanceInf> wrapper = new LambdaQueryWrapper<>();
@@ -678,7 +653,7 @@ public class  FlowableController extends BaseController
             String coreName = coreCompany.getScyName();
             //标题
             String title = "【审批拒绝】您提交于【"+coreName +"】的融信【"+zfiNumber+"】审批被拒绝,拒绝的理由为:【审批意见】";
-            remoteSystemService.sendNotice(zfiSupplierId, zfiId,title,"01","02","","0",supplierUserList,"");
+            remoteSystemService.sendNotice(zfiSupplierId, zfiId,title,"01","02","","0",supplierUserId.toString(),"");
         }//融资企业签收审批
         else if("1000000005".equals(menuId)){
             LambdaQueryWrapper<ZcFinanceInf> lambdaQueryWrapper = new LambdaQueryWrapper<>();

+ 10 - 30
sc-service/src/main/java/com/huyi/service/common/flowable/service/impl/ApprovalServiceImpl.java

@@ -121,24 +121,14 @@ public class ApprovalServiceImpl implements ApprovalService {
                 //是否经办人(1:是)
                 lambdaQueryWrapper.eq(SysUserCompanyRel::getSucrHandler,"1");
                 List<SysUserCompanyRel> listUser = iSysUserCompanyRelService.findSysUserCompanyRels(lambdaQueryWrapper);
-                //获取发送人
-                Long use = null;
-                List<Long> userIdList = new ArrayList<>();
-                if(listUser.size() > 0) {
-                    use = listUser.get(0).getSucrUserId();
-                    userIdList.add(use);
-                }
                 //发送盖章待办
                 remoteSystemService.sendNotice(zfiSupplierId, zfiId,
                         "核心企业开立审批由"+ scyName + "发起的融信编号为" + zfiNumber + "的资料待盖章",
-                        "00",null,"03","0", userIdList,null);
-                //获取发送人
-                List<Long> longUser = new ArrayList<>();
-                longUser.add(userId);
+                        "00",null,"03","0", listUser.get(0).getSucrUserId().toString(),null);
                 //向发起人发送最终结果【通过】消息通知
                 remoteSystemService.sendNotice(companyId, String.valueOf(userId),
                         "核心企业开立审批融信编号为" + zfiNumber + "的资料审批已通过",
-                        "01","01",null,"0", longUser, null);
+                        "01","01",null,"0", userId.toString(), null);
             }else if ("450".equals(resMap.get("code"))) {
                 throw new Exception("未配置审批流程");
             }else if (!"200".equals(resMap.get("code"))) {
@@ -204,8 +194,6 @@ public class ApprovalServiceImpl implements ApprovalService {
             if (companyList.size() > 0){
                 coreUserId = companyList.get(0).getSucrUserId();
             }
-            List coreUserList = new ArrayList();
-            coreUserList.add(coreUserId);
             /*----------查询供应商企业经办人----------*/
             //查询用户与企业关系表
             LambdaQueryWrapper<SysUserCompanyRel>userCompanyWrapper = new LambdaQueryWrapper<>();
@@ -219,8 +207,6 @@ public class ApprovalServiceImpl implements ApprovalService {
             if (userCompanyList.size() > 0){
                 supplierUserId = userCompanyList.get(0).getSucrUserId();
             }
-            List supplierUserList = new ArrayList();
-            supplierUserList.add(supplierUserId);
             /*--------查询核心企业名称-----------*/
             //查询企业表
             SysCompany coreCompany = iSysCompanyService.getById(zfiCoreId);
@@ -244,7 +230,7 @@ public class ApprovalServiceImpl implements ApprovalService {
                 zcFinanceInf.setZfiSignDate(DateUtils.getNowDate());
                 //TODO 融资企业经办人盖章代办
                 String title = "【合同签署】由【"+supplierName+"】发起的融信【"+zfiNumber+"】资料待签署合同";
-                remoteSystemService.sendNotice(zfiSupplierId, zfiId,title,"00","","03","0",supplierUserList,"");
+                remoteSystemService.sendNotice(zfiSupplierId, zfiId,title,"00","","03","0",supplierUserId.toString(),"");
                 //查询供应商授信额度表
             }else if ("0".equals(zfiCreateType)){
                 //融信状态(00:待确权 01:待签收 02:已生效 03:已失效 04:融资中 05:已融资 06:平台退回)
@@ -252,14 +238,14 @@ public class ApprovalServiceImpl implements ApprovalService {
                 //TODO 融资企业经办人 最终结果【通过】消息通知
                 //标题
                 String title = "【审批通过】您提交于【"+coreName +"】的融信【"+zfiNumber+"】已审批通过,请进行下一步业务操作";
-                remoteSystemService.sendNotice(zfiSupplierId, zfiId,title,"01","02","","0",supplierUserList,"");
+                remoteSystemService.sendNotice(zfiSupplierId, zfiId,title,"01","02","","0",supplierUserId.toString(),"");
                 // TODO 给核心企业经办人确权待办
                 String coreTitle = "【融信确权】由【"+supplierName+"】发起的融信【融信编号:"+zfiNumber+"】【融信金额:"+zfiAmount+"元】资料待确权";
-                remoteSystemService.sendNotice(zfiSupplierId, zfiId,coreTitle,"00","","02","0",coreUserList,"");
+                remoteSystemService.sendNotice(zfiSupplierId, zfiId,coreTitle,"00","","02","0",coreUserId.toString(),"");
             }else if ("2".equals(zfiCreateType)){
                 //TODO 融资企业开立时, 给融资企业经办人生成盖章待办
                 String title = "【合同签署】由【"+supplierName+"】发起的融信【"+zfiNumber+"】资料待签署合同";
-                remoteSystemService.sendNotice(zfiSupplierId, zfiId,title,"00","","03","0",supplierUserList,"");
+                remoteSystemService.sendNotice(zfiSupplierId, zfiId,title,"00","","03","0",supplierUserId.toString(),"");
             }
             zcFinanceInfService.updateById(zcFinanceInf);
         }else if (!"200".equals(resMap.get("code"))) {
@@ -296,12 +282,8 @@ public class ApprovalServiceImpl implements ApprovalService {
         userQuery.eq(SysUserCompanyRel::getSucrHandler,"1");
         List<SysUserCompanyRel> userList = iSysUserCompanyRelService.findSysUserCompanyRels(userQuery);
         //获取经办人Id
-        Long userId = null;
+        Long userId = userList.get(0).getSucrUserId();;
         List<Long> longUserList = new ArrayList<>();
-        if(userList.size() > 0) {
-            userId = userList.get(0).getSucrUserId();
-            longUserList.add(userId);
-        }
         flowParam.put("menuId", "1000000007");
         flowParam.put("companyId", zfiCoreId);
         //双主键
@@ -331,11 +313,11 @@ public class ApprovalServiceImpl implements ApprovalService {
                 longUser.add(user);
                 remoteSystemService.sendNotice(zfiCoreId, zfiId,
                         "确权审批融信编号为" + zfiNumber + "的资料审批已通过",
-                        "01","01",null,"0", longUser, null);
+                        "01","01",null,"0", user.toString(), null);
                 //向核心企业经办人发送盖章待办
                 remoteSystemService.sendNotice(zfiCoreId, zfiId,
                         "确权审批融信编号为" + zfiNumber + "的资料待盖章,审批发起人为" + userName,
-                        "00",null,"03","0", longUserList,null);
+                        "00",null,"03","0", userId.toString(),null);
                 //未配置审批流程
             }else if ("450".equals(resMap.get("code"))) {
                 throw new Exception("未配置审批流程");
@@ -531,8 +513,6 @@ public class ApprovalServiceImpl implements ApprovalService {
         if (userCompanyList.size() > 0){
             supplierUserId = userCompanyList.get(0).getSucrUserId();
         }
-        List supplierUserList = new ArrayList();
-        supplierUserList.add(supplierUserId);
         /*--------查询供应商企业名称-----------*/
         //查询企业表
         SysCompany supplierCompany = iSysCompanyService.getById(zfiSupplierId);
@@ -590,7 +570,7 @@ public class ApprovalServiceImpl implements ApprovalService {
                 zcFinanceInfService.updateById(financeInf);
                 //TODO 给融资企业经办人生成一条盖章待办
                 String title = "【合同签署】由【"+supplierName+"】发起的融信【"+zfiNumber+"】资料待签署合同";
-                remoteSystemService.sendNotice(zfiSupplierId, zfiId,title,"00","","03","0",supplierUserList,"");
+                remoteSystemService.sendNotice(zfiSupplierId, zfiId,title,"00","","03","0",supplierUserId.toString(),"");
             }
         }else if ("450".equals(resMap.get("code"))){
             throw new Exception("未配置审批流程!");