Showing
5 changed files
with
63 additions
and
12 deletions
| @@ -97,7 +97,7 @@ public class BusinessDataHandlerServiceImpl implements BusinessDataHandlerServic | @@ -97,7 +97,7 @@ public class BusinessDataHandlerServiceImpl implements BusinessDataHandlerServic | ||
| 97 | // 更新业务数据 | 97 | // 更新业务数据 |
| 98 | switch (businessType) { | 98 | switch (businessType) { |
| 99 | case "CUSTOMER_DEVELOP": | 99 | case "CUSTOMER_DEVELOP": |
| 100 | - handleCustomerDevelopData(flowStatus, businessId); | 100 | + handleCustomerDevelopData(flowStatus, businessId, String.valueOf(instance.getId())); |
| 101 | break; | 101 | break; |
| 102 | case "CUSTOMER_CREDIT": | 102 | case "CUSTOMER_CREDIT": |
| 103 | handleCustomerCreditData(flowStatus, businessId); | 103 | handleCustomerCreditData(flowStatus, businessId); |
| @@ -155,12 +155,12 @@ public class BusinessDataHandlerServiceImpl implements BusinessDataHandlerServic | @@ -155,12 +155,12 @@ public class BusinessDataHandlerServiceImpl implements BusinessDataHandlerServic | ||
| 155 | * | 155 | * |
| 156 | * @param businessId 业务ID | 156 | * @param businessId 业务ID |
| 157 | */ | 157 | */ |
| 158 | - private void handleCustomerDevelopData(String flowStatus, String businessId) { | 158 | + private void handleCustomerDevelopData(String flowStatus, String businessId, String instanceId) { |
| 159 | if (FlowInstanceStatus.APPROVE_PASS.getCode().equals(flowStatus) | 159 | if (FlowInstanceStatus.APPROVE_PASS.getCode().equals(flowStatus) |
| 160 | || FlowInstanceStatus.FINISH.getCode().equals(flowStatus)) { | 160 | || FlowInstanceStatus.FINISH.getCode().equals(flowStatus)) { |
| 161 | customerDevelopPlanService.updateStatus(businessId, CustomerDevelopStatus.PASS); | 161 | customerDevelopPlanService.updateStatus(businessId, CustomerDevelopStatus.PASS); |
| 162 | // 消息通知 | 162 | // 消息通知 |
| 163 | - customerDevelopPlanService.sendMsg(businessId); | 163 | + customerDevelopPlanService.sendMsg(businessId, instanceId); |
| 164 | } else if (FlowInstanceStatus.REVOKE.getCode().equals(flowStatus) | 164 | } else if (FlowInstanceStatus.REVOKE.getCode().equals(flowStatus) |
| 165 | || FlowInstanceStatus.REFUSE.getCode().equals(flowStatus) | 165 | || FlowInstanceStatus.REFUSE.getCode().equals(flowStatus) |
| 166 | || FlowInstanceStatus.TERMINATION.getCode().equals(flowStatus)) { | 166 | || FlowInstanceStatus.TERMINATION.getCode().equals(flowStatus)) { |
| @@ -56,7 +56,7 @@ public class MessageHandler { | @@ -56,7 +56,7 @@ public class MessageHandler { | ||
| 56 | String bizKey = ""; | 56 | String bizKey = ""; |
| 57 | if ("SPEC_CHANGE_SUBMIT".equals(businessType)) { | 57 | if ("SPEC_CHANGE_SUBMIT".equals(businessType)) { |
| 58 | } | 58 | } |
| 59 | - sendMsg(receiveUserIds, title, content, bizKey, null); | 59 | + sendMsg(receiveUserIds, title, content, bizKey, sendUserId); |
| 60 | log.info("================== MessageHandler sendMsg invoke end!"); | 60 | log.info("================== MessageHandler sendMsg invoke end!"); |
| 61 | } | 61 | } |
| 62 | 62 |
| @@ -61,12 +61,13 @@ public class TransactorHandler { | @@ -61,12 +61,13 @@ public class TransactorHandler { | ||
| 61 | * 根据角色code和厂房类型来获取办理人数据 | 61 | * 根据角色code和厂房类型来获取办理人数据 |
| 62 | * 客户开发 | 62 | * 客户开发 |
| 63 | * | 63 | * |
| 64 | - * @param roleCode 角色编号 | 64 | + * @param roleCodes 角色编号集合 |
| 65 | * @param workshopType 厂房类型 | 65 | * @param workshopType 厂房类型 |
| 66 | * @return List<String> | 66 | * @return List<String> |
| 67 | */ | 67 | */ |
| 68 | - public List<String> listByRoleAndWorkshop(String roleCode, String workshopType, String workshopId) { | ||
| 69 | - log.info("================== listByRoleAndWorkshop invoke start, roleCode:{}, workshopType:{}, workshopId:{}", roleCode, workshopType, workshopId); | 68 | + public List<String> listByRoleAndWorkshop(List<String> roleCodes, String workshopType, String workshopId) { |
| 69 | + log.info("================== listByRoleAndWorkshop invoke start, roleCodes:{}, workshopType:{}, workshopId:{}", | ||
| 70 | + JsonUtil.toJsonString(roleCodes), workshopType, workshopId); | ||
| 70 | // 获取厂房数据 | 71 | // 获取厂房数据 |
| 71 | Workshop workshop = workshopService.findById(workshopId); | 72 | Workshop workshop = workshopService.findById(workshopId); |
| 72 | if (workshop == null) { | 73 | if (workshop == null) { |
| @@ -75,7 +76,7 @@ public class TransactorHandler { | @@ -75,7 +76,7 @@ public class TransactorHandler { | ||
| 75 | } | 76 | } |
| 76 | String workshopName = workshop.getName(); | 77 | String workshopName = workshop.getName(); |
| 77 | // 获取角色下人员 | 78 | // 获取角色下人员 |
| 78 | - List<String> userIdList = sysUserRoleService.listUserIdByRoleCodes(Collections.singletonList(roleCode)); | 79 | + List<String> userIdList = sysUserRoleService.listUserIdByRoleCodes(roleCodes); |
| 79 | if (CollectionUtils.isEmpty(userIdList)) { | 80 | if (CollectionUtils.isEmpty(userIdList)) { |
| 80 | return new ArrayList<>(); | 81 | return new ArrayList<>(); |
| 81 | } | 82 | } |
xingyun-sc/src/main/java/com/lframework/xingyun/sc/impl/customer/CustomerDevelopPlanServiceImpl.java
| @@ -9,6 +9,7 @@ import com.lframework.starter.bpm.service.FlowTaskWrapperService; | @@ -9,6 +9,7 @@ import com.lframework.starter.bpm.service.FlowTaskWrapperService; | ||
| 9 | import com.lframework.starter.web.core.components.security.SecurityUtil; | 9 | import com.lframework.starter.web.core.components.security.SecurityUtil; |
| 10 | import com.lframework.starter.web.core.utils.*; | 10 | import com.lframework.starter.web.core.utils.*; |
| 11 | import com.lframework.starter.web.inner.service.system.SysUserRoleService; | 11 | import com.lframework.starter.web.inner.service.system.SysUserRoleService; |
| 12 | +import com.lframework.xingyun.basedata.entity.Customer; | ||
| 12 | import com.lframework.xingyun.basedata.entity.Workshop; | 13 | import com.lframework.xingyun.basedata.entity.Workshop; |
| 13 | import com.lframework.xingyun.basedata.service.customer.CustomerService; | 14 | import com.lframework.xingyun.basedata.service.customer.CustomerService; |
| 14 | import com.lframework.xingyun.basedata.service.workshop.WorkshopService; | 15 | import com.lframework.xingyun.basedata.service.workshop.WorkshopService; |
| @@ -59,6 +60,8 @@ public class CustomerDevelopPlanServiceImpl extends BaseMpServiceImpl<CustomerDe | @@ -59,6 +60,8 @@ public class CustomerDevelopPlanServiceImpl extends BaseMpServiceImpl<CustomerDe | ||
| 59 | private MessageHandler messageHandler; | 60 | private MessageHandler messageHandler; |
| 60 | @Resource | 61 | @Resource |
| 61 | private SysUserRoleService sysUserRoleService; | 62 | private SysUserRoleService sysUserRoleService; |
| 63 | + @Resource | ||
| 64 | + private CustomerService customerService; | ||
| 62 | 65 | ||
| 63 | 66 | ||
| 64 | @Override | 67 | @Override |
| @@ -349,7 +352,7 @@ public class CustomerDevelopPlanServiceImpl extends BaseMpServiceImpl<CustomerDe | @@ -349,7 +352,7 @@ public class CustomerDevelopPlanServiceImpl extends BaseMpServiceImpl<CustomerDe | ||
| 349 | } | 352 | } |
| 350 | 353 | ||
| 351 | @Override | 354 | @Override |
| 352 | - public void sendMsg(String id) { | 355 | + public void sendMsg(String id, String bizKey) { |
| 353 | CustomerDevelopPlan plan = findById(id); | 356 | CustomerDevelopPlan plan = findById(id); |
| 354 | if (plan == null) { | 357 | if (plan == null) { |
| 355 | log.error("=================== customerDevelopApprovedNotice plan is null!"); | 358 | log.error("=================== customerDevelopApprovedNotice plan is null!"); |
| @@ -370,12 +373,59 @@ public class CustomerDevelopPlanServiceImpl extends BaseMpServiceImpl<CustomerDe | @@ -370,12 +373,59 @@ public class CustomerDevelopPlanServiceImpl extends BaseMpServiceImpl<CustomerDe | ||
| 370 | } | 373 | } |
| 371 | roleCodeList.clear(); | 374 | roleCodeList.clear(); |
| 372 | // 营销部分管 | 375 | // 营销部分管 |
| 373 | - roleCodeList.add("ssyxbfg"); | 376 | + roleCodeList.add("yxbfg"); |
| 374 | // 市场科统计员 | 377 | // 市场科统计员 |
| 375 | roleCodeList.add("scktjy"); | 378 | roleCodeList.add("scktjy"); |
| 376 | // 运作科主管 | 379 | // 运作科主管 |
| 377 | roleCodeList.add("yzkzg"); | 380 | roleCodeList.add("yzkzg"); |
| 381 | + // 获取厂房信息 | ||
| 382 | + Workshop workshop = workshopService.findById(plan.getWorkshopId()); | ||
| 383 | + String workshopName = workshop.getName(); | ||
| 384 | + if ("一分厂".equals(workshopName)) { | ||
| 385 | + // 市场科主管 | ||
| 386 | + roleCodeList.add("yfcsckzg"); | ||
| 387 | + // 经营办主管 | ||
| 388 | + roleCodeList.add("yfcjybzg"); | ||
| 389 | + // 生产经理 | ||
| 390 | + roleCodeList.add("yfcscjl"); | ||
| 391 | + // 品质经理 | ||
| 392 | + roleCodeList.add("yfcpzjl"); | ||
| 393 | + } else if ("二分厂".equals(workshopName)) { | ||
| 394 | + // 市场科主管 | ||
| 395 | + roleCodeList.add("efcsckzg"); | ||
| 396 | + // 经营办主管 | ||
| 397 | + roleCodeList.add("efcjybzg"); | ||
| 398 | + // 生产经理 | ||
| 399 | + roleCodeList.add("efcscjl"); | ||
| 400 | + // 品质经理 | ||
| 401 | + roleCodeList.add("efcpzjl"); | ||
| 402 | + } else if ("三分厂".equals(workshopName)) { | ||
| 403 | + // 市场科主管 | ||
| 404 | + roleCodeList.add("sfcsckzg"); | ||
| 405 | + // 经营办主管 | ||
| 406 | + roleCodeList.add("sfcjybzg"); | ||
| 407 | + // 生产经理 | ||
| 408 | + roleCodeList.add("sfcscjl"); | ||
| 409 | + // 品质经理 | ||
| 410 | + roleCodeList.add("sfcpzjl"); | ||
| 411 | + } else if ("四分厂".equals(workshopName) || "紫铜厂".equals(workshopName)) { | ||
| 412 | + // 市场科主管 | ||
| 413 | + roleCodeList.add("ztcsckzg"); | ||
| 414 | + // 经营办主管 | ||
| 415 | + roleCodeList.add("ztcjybzg"); | ||
| 416 | + // 生产经理 | ||
| 417 | + roleCodeList.add("ztcscjl"); | ||
| 418 | + // 品质经理 | ||
| 419 | + roleCodeList.add("ztcpzjl"); | ||
| 420 | + } | ||
| 421 | + userIds = sysUserRoleService.listUserIdByRoleCodes(roleCodeList); | ||
| 422 | + if (CollectionUtils.isNotEmpty(userIds)) { | ||
| 423 | + receiveUserIds.addAll(userIds); | ||
| 424 | + } | ||
| 425 | + // 获取客户信息 | ||
| 426 | + Customer customer = customerService.findById(plan.getCustomerId()); | ||
| 378 | 427 | ||
| 379 | - messageHandler.sendMsg(receiveUserIds, "", "", "", null); | 428 | + messageHandler.sendMsg(receiveUserIds, customer.getName() + "开发审核通过消息通知测试" |
| 429 | + , customer.getName() +"开发审核通过消息通知测试", bizKey, null); | ||
| 380 | } | 430 | } |
| 381 | } | 431 | } |
| @@ -98,5 +98,5 @@ public interface CustomerDevelopPlanService extends BaseMpService<CustomerDevelo | @@ -98,5 +98,5 @@ public interface CustomerDevelopPlanService extends BaseMpService<CustomerDevelo | ||
| 98 | * | 98 | * |
| 99 | * @param id 主键ID | 99 | * @param id 主键ID |
| 100 | */ | 100 | */ |
| 101 | - void sendMsg(String id); | 101 | + void sendMsg(String id, String bizKey); |
| 102 | } | 102 | } |