Showing
1 changed file
with
51 additions
and
0 deletions
| @@ -3,8 +3,11 @@ package com.lframework.xingyun.sc.handlers; | @@ -3,8 +3,11 @@ package com.lframework.xingyun.sc.handlers; | ||
| 3 | import com.lframework.starter.bpm.dto.FlowInstanceExtDto; | 3 | import com.lframework.starter.bpm.dto.FlowInstanceExtDto; |
| 4 | import com.lframework.starter.bpm.enums.FlowInstanceStatus; | 4 | import com.lframework.starter.bpm.enums.FlowInstanceStatus; |
| 5 | import com.lframework.starter.bpm.service.BusinessDataHandlerService; | 5 | import com.lframework.starter.bpm.service.BusinessDataHandlerService; |
| 6 | +import com.lframework.starter.mq.core.service.MqProducerService; | ||
| 6 | import com.lframework.starter.web.core.components.redis.RedisHandler; | 7 | import com.lframework.starter.web.core.components.redis.RedisHandler; |
| 8 | +import com.lframework.starter.web.core.utils.IdUtil; | ||
| 7 | import com.lframework.starter.web.core.utils.JsonUtil; | 9 | import com.lframework.starter.web.core.utils.JsonUtil; |
| 10 | +import com.lframework.starter.web.inner.dto.message.SysSiteMessageDto; | ||
| 8 | import com.lframework.xingyun.sc.entity.CorePersonnelHistory; | 11 | import com.lframework.xingyun.sc.entity.CorePersonnelHistory; |
| 9 | import com.lframework.xingyun.sc.entity.PurchaseOrderLine; | 12 | import com.lframework.xingyun.sc.entity.PurchaseOrderLine; |
| 10 | import com.lframework.xingyun.sc.entity.PurchaseOrderRevoke; | 13 | import com.lframework.xingyun.sc.entity.PurchaseOrderRevoke; |
| @@ -62,6 +65,10 @@ public class BusinessDataHandlerServiceImpl implements BusinessDataHandlerServic | @@ -62,6 +65,10 @@ public class BusinessDataHandlerServiceImpl implements BusinessDataHandlerServic | ||
| 62 | private PurchaseOrderRevokeLineService purchaseOrderRevokeLineService; | 65 | private PurchaseOrderRevokeLineService purchaseOrderRevokeLineService; |
| 63 | @Resource | 66 | @Resource |
| 64 | private OrderSpecificationChangeRecordService orderSpecificationChangeRecordService; | 67 | private OrderSpecificationChangeRecordService orderSpecificationChangeRecordService; |
| 68 | + @Resource | ||
| 69 | + private MqProducerService mqProducerService; | ||
| 70 | + @Resource | ||
| 71 | + private TransactorHandler transactorHandler; | ||
| 65 | 72 | ||
| 66 | 73 | ||
| 67 | /** | 74 | /** |
| @@ -229,6 +236,50 @@ public class BusinessDataHandlerServiceImpl implements BusinessDataHandlerServic | @@ -229,6 +236,50 @@ public class BusinessDataHandlerServiceImpl implements BusinessDataHandlerServic | ||
| 229 | purchaseOrderInfoService.updateRevokeStatus(revoke.getPurchaseOrderId(), "PARTIAL"); | 236 | purchaseOrderInfoService.updateRevokeStatus(revoke.getPurchaseOrderId(), "PARTIAL"); |
| 230 | } | 237 | } |
| 231 | } | 238 | } |
| 239 | + //todo 消息通知(站内信) | ||
| 240 | + List<String> userIdList = new ArrayList<>(); | ||
| 241 | + //发起人 | ||
| 242 | + String createById = revoke.getCreateById(); | ||
| 243 | + userIdList.add(createById); | ||
| 244 | + //综合内勤 | ||
| 245 | + List<String> list1 = transactorHandler.listTransactorsByRoleCode("zhnq", createById); | ||
| 246 | + if (CollectionUtils.isNotEmpty(list1)) { | ||
| 247 | + userIdList.addAll(list1); | ||
| 248 | + } | ||
| 249 | + //办事处主管 | ||
| 250 | + List<String> list2 = transactorHandler.listTransactorsByRoleCode("bsczg", createById); | ||
| 251 | + if (CollectionUtils.isNotEmpty(list2)) { | ||
| 252 | + userIdList.addAll(list2); | ||
| 253 | + } | ||
| 254 | + //经营办计划员 | ||
| 255 | + List<String> list3 = transactorHandler.listTransactorsByRoleCode("jybjhy", createById); | ||
| 256 | + if (CollectionUtils.isNotEmpty(list3)) { | ||
| 257 | + userIdList.addAll(list3); | ||
| 258 | + } | ||
| 259 | + //经营办主管 | ||
| 260 | + List<String> list4 = transactorHandler.listTransactorsByRoleCode("jybzg", createById); | ||
| 261 | + if (CollectionUtils.isNotEmpty(list4)) { | ||
| 262 | + userIdList.addAll(list4); | ||
| 263 | + } | ||
| 264 | + //生产科计划员 | ||
| 265 | + List<String> list5 = transactorHandler.listTransactorsByRoleCode("sckjhy", createById); | ||
| 266 | + if (CollectionUtils.isNotEmpty(list5)) { | ||
| 267 | + userIdList.addAll(list5); | ||
| 268 | + } | ||
| 269 | + // | ||
| 270 | + //营销管理科统计员 | ||
| 271 | + List<String> list6 = transactorHandler.listTransactorsByRoleCode("yxglktjy", createById); | ||
| 272 | + if (CollectionUtils.isNotEmpty(list6)) { | ||
| 273 | + userIdList.addAll(list6); | ||
| 274 | + } | ||
| 275 | + SysSiteMessageDto messageDto = new SysSiteMessageDto(); | ||
| 276 | + messageDto.setUserIdList(userIdList); | ||
| 277 | + messageDto.setTitle("订货单撤销通过通知"); | ||
| 278 | + messageDto.setContent("订货单撤销审核流程已通过!"); | ||
| 279 | + messageDto.setBizKey(IdUtil.getId()); | ||
| 280 | + //如果是空表示由系统自动发起 | ||
| 281 | + messageDto.setCreateUserId(null); | ||
| 282 | + mqProducerService.createSysSiteMessage(messageDto); | ||
| 232 | } else if (FlowInstanceStatus.REVOKE.getCode().equals(flowStatus) | 283 | } else if (FlowInstanceStatus.REVOKE.getCode().equals(flowStatus) |
| 233 | || FlowInstanceStatus.REFUSE.getCode().equals(flowStatus) | 284 | || FlowInstanceStatus.REFUSE.getCode().equals(flowStatus) |
| 234 | || FlowInstanceStatus.TERMINATION.getCode().equals(flowStatus)) { | 285 | || FlowInstanceStatus.TERMINATION.getCode().equals(flowStatus)) { |