|
...
|
...
|
@@ -3,6 +3,7 @@ package com.lframework.xingyun.sc.handlers; |
|
3
|
3
|
import com.lframework.starter.bpm.dto.FlowInstanceExtDto;
|
|
4
|
4
|
import com.lframework.starter.bpm.enums.FlowInstanceStatus;
|
|
5
|
5
|
import com.lframework.starter.bpm.service.BusinessDataHandlerService;
|
|
|
6
|
+import com.lframework.starter.common.exceptions.impl.DefaultClientException;
|
|
6
|
7
|
import com.lframework.starter.common.utils.CollectionUtil;
|
|
7
|
8
|
import com.lframework.starter.mq.core.service.MqProducerService;
|
|
8
|
9
|
import com.lframework.starter.web.core.components.redis.RedisHandler;
|
|
...
|
...
|
@@ -10,6 +11,8 @@ import com.lframework.starter.web.core.components.security.SecurityUtil; |
|
10
|
11
|
import com.lframework.starter.web.core.utils.IdUtil;
|
|
11
|
12
|
import com.lframework.starter.web.core.utils.JsonUtil;
|
|
12
|
13
|
import com.lframework.starter.web.inner.dto.message.SysSiteMessageDto;
|
|
|
14
|
+import com.lframework.xingyun.basedata.entity.Workshop;
|
|
|
15
|
+import com.lframework.xingyun.basedata.service.workshop.WorkshopService;
|
|
13
|
16
|
import com.lframework.xingyun.sc.entity.*;
|
|
14
|
17
|
import com.lframework.xingyun.sc.enums.CustomerDevelopStatus;
|
|
15
|
18
|
import com.lframework.xingyun.sc.service.contract.ContractDistributorStandardService;
|
|
...
|
...
|
@@ -94,7 +97,10 @@ public class BusinessDataHandlerServiceImpl implements BusinessDataHandlerServic |
|
94
|
97
|
private DelayedShipmentDetailService delayedShipmentDetailService;
|
|
95
|
98
|
@Resource
|
|
96
|
99
|
private CarRequestPlanService carRequestPlanService;
|
|
97
|
|
-
|
|
|
100
|
+ @Resource
|
|
|
101
|
+ private WorkshopService workshopService;
|
|
|
102
|
+ @Resource
|
|
|
103
|
+ private MessageHandler messageHandler;
|
|
98
|
104
|
|
|
99
|
105
|
|
|
100
|
106
|
/**
|
|
...
|
...
|
@@ -145,7 +151,7 @@ public class BusinessDataHandlerServiceImpl implements BusinessDataHandlerServic |
|
145
|
151
|
break;
|
|
146
|
152
|
case "SPEC_CHANGE_SUBMIT":
|
|
147
|
153
|
case "SPEC_CHANGE_CONFIRM":
|
|
148
|
|
- handleOrderSpecChangeData(flowStatus, businessId);
|
|
|
154
|
+ handleOrderSpecChangeData(flowStatus, businessId, businessType);
|
|
149
|
155
|
break;
|
|
150
|
156
|
case "SPEC_LOCK_DELAY":
|
|
151
|
157
|
handleSpecLockDelayAuditData(flowStatus, businessId);
|
|
...
|
...
|
@@ -429,10 +435,14 @@ public class BusinessDataHandlerServiceImpl implements BusinessDataHandlerServic |
|
429
|
435
|
* @param flowStatus 审核结果
|
|
430
|
436
|
* @param businessId 业务ID
|
|
431
|
437
|
*/
|
|
432
|
|
- private void handleOrderSpecChangeData(String flowStatus, String businessId) {
|
|
|
438
|
+ private void handleOrderSpecChangeData(String flowStatus, String businessId, String businessType) {
|
|
433
|
439
|
if (FlowInstanceStatus.APPROVE_PASS.getCode().equals(flowStatus)
|
|
434
|
440
|
|| FlowInstanceStatus.FINISH.getCode().equals(flowStatus)) {
|
|
435
|
441
|
orderChangeRecordService.reviewPass(businessId);
|
|
|
442
|
+ if ("SPEC_CHANGE_CONFIRM".equals(businessType)) {
|
|
|
443
|
+ // 通知生产科计划员
|
|
|
444
|
+ noticeProductDept(businessId, businessType);
|
|
|
445
|
+ }
|
|
436
|
446
|
} else if (FlowInstanceStatus.REVOKE.getCode().equals(flowStatus)
|
|
437
|
447
|
|| FlowInstanceStatus.REFUSE.getCode().equals(flowStatus)
|
|
438
|
448
|
|| FlowInstanceStatus.TERMINATION.getCode().equals(flowStatus)) {
|
|
...
|
...
|
@@ -557,4 +567,34 @@ public class BusinessDataHandlerServiceImpl implements BusinessDataHandlerServic |
|
557
|
567
|
delayedShipmentService.updateStatus(businessId, "REFUSE");
|
|
558
|
568
|
}
|
|
559
|
569
|
}
|
|
|
570
|
+
|
|
|
571
|
+
|
|
|
572
|
+ /**
|
|
|
573
|
+ * 通知生产科计划员
|
|
|
574
|
+ *
|
|
|
575
|
+ * @param businessId 业务数据ID
|
|
|
576
|
+ * @param businessType 业务数据类型
|
|
|
577
|
+ */
|
|
|
578
|
+ private void noticeProductDept(String businessId, String businessType) {
|
|
|
579
|
+ OrderInfoChangeRecord record = orderChangeRecordService.findById(businessId);
|
|
|
580
|
+ if (record == null) {
|
|
|
581
|
+ throw new DefaultClientException("订货单变更记录不存在!");
|
|
|
582
|
+ }
|
|
|
583
|
+ String workshopId = record.getWorkshopId();
|
|
|
584
|
+ Workshop workshop = workshopService.findById(workshopId);
|
|
|
585
|
+ if (workshop != null) {
|
|
|
586
|
+ log.info("===================== noticeProductDept 所属分厂编号:{}", workshop.getCode());
|
|
|
587
|
+ List<String> roleCodes = new ArrayList<>();
|
|
|
588
|
+ if ("yfc".equals(workshop.getCode())) {
|
|
|
589
|
+ roleCodes.add("yfcsckjhy");
|
|
|
590
|
+ } else if ("efc".equals(workshop.getCode())) {
|
|
|
591
|
+ roleCodes.add("efcsckjhy");
|
|
|
592
|
+ } else if ("sfc".equals(workshop.getCode())) {
|
|
|
593
|
+ roleCodes.add("sfcsckjhy");
|
|
|
594
|
+ } else if ("ztfc".equals(workshop.getCode())) {
|
|
|
595
|
+ roleCodes.add("ztfcsckjhy");
|
|
|
596
|
+ }
|
|
|
597
|
+ messageHandler.sendMsg(null, roleCodes, businessType, businessId, null);
|
|
|
598
|
+ }
|
|
|
599
|
+ }
|
|
560
|
600
|
} |
...
|
...
|
|