|
@@ -42,6 +42,8 @@ import org.springframework.stereotype.Service;
|
|
import java.time.LocalDateTime;
|
|
import java.time.LocalDateTime;
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
import java.util.Arrays;
|
|
import java.util.Arrays;
|
|
|
|
+import java.util.Collection;
|
|
|
|
+import java.util.Collections;
|
|
import java.util.HashMap;
|
|
import java.util.HashMap;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
@@ -70,6 +72,7 @@ public class WmDaAgentServiceImpl extends ServiceImpl<WmDaAgentMapper, WmDaAgent
|
|
private final WmTaskTypeEntRefMapper wmTaskTypeEntRefMapper;
|
|
private final WmTaskTypeEntRefMapper wmTaskTypeEntRefMapper;
|
|
private final SysDeptMapper sysDeptMapper;
|
|
private final SysDeptMapper sysDeptMapper;
|
|
private final SysDeptSubMapper sysDeptSubMapper;
|
|
private final SysDeptSubMapper sysDeptSubMapper;
|
|
|
|
+ private final WmTaskSubmissionRuleService taskSubmissionRuleService;
|
|
|
|
|
|
public String getDeptBuildName(String deptId) {
|
|
public String getDeptBuildName(String deptId) {
|
|
String buildName = "";
|
|
String buildName = "";
|
|
@@ -310,6 +313,7 @@ public class WmDaAgentServiceImpl extends ServiceImpl<WmDaAgentMapper, WmDaAgent
|
|
wmDaAgent.setPgqx(1 + "");
|
|
wmDaAgent.setPgqx(1 + "");
|
|
super.save(wmDaAgent);
|
|
super.save(wmDaAgent);
|
|
List<SysDept> list3 = sysDeptMapper.selectByName(wmDaAgent.getGsmc());
|
|
List<SysDept> list3 = sysDeptMapper.selectByName(wmDaAgent.getGsmc());
|
|
|
|
+ int deptId;
|
|
if (list3.size() == 0) {
|
|
if (list3.size() == 0) {
|
|
SysDept sysDept = new SysDept();/**
|
|
SysDept sysDept = new SysDept();/**
|
|
* @Modify: start
|
|
* @Modify: start
|
|
@@ -331,6 +335,7 @@ public class WmDaAgentServiceImpl extends ServiceImpl<WmDaAgentMapper, WmDaAgent
|
|
sysDeptService.save(sysDept);
|
|
sysDeptService.save(sysDept);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ deptId = sysDept.getDeptId();
|
|
// for (Map.Entry<String, Integer> entry : wmDaAgent.getSubjectTypeAndChannel().entrySet()){
|
|
// for (Map.Entry<String, Integer> entry : wmDaAgent.getSubjectTypeAndChannel().entrySet()){
|
|
// SysDeptSub deptSub = new SysDeptSub();
|
|
// SysDeptSub deptSub = new SysDeptSub();
|
|
// deptSub.setDeptId(sysDept.getDeptId());
|
|
// deptSub.setDeptId(sysDept.getDeptId());
|
|
@@ -375,7 +380,10 @@ public class WmDaAgentServiceImpl extends ServiceImpl<WmDaAgentMapper, WmDaAgent
|
|
newList2.add(sysDeptRelation);
|
|
newList2.add(sysDeptRelation);
|
|
sysDeptRelationService.saveBatch(newList2);
|
|
sysDeptRelationService.saveBatch(newList2);
|
|
} else {
|
|
} else {
|
|
- wmDaAgent.setDeptId(String.valueOf(list3.get(0).getDeptId()));
|
|
|
|
|
|
+
|
|
|
|
+ deptId = list3.get(0).getDeptId();
|
|
|
|
+ wmDaAgent.setDeptId(String.valueOf(deptId));
|
|
|
|
+
|
|
List<WmDaDrugEnt> newList1 = new ArrayList<>();
|
|
List<WmDaDrugEnt> newList1 = new ArrayList<>();
|
|
for (String id : ids) {
|
|
for (String id : ids) {
|
|
WmDaDrugEnt wmDaDrugEnt = new WmDaDrugEnt();
|
|
WmDaDrugEnt wmDaDrugEnt = new WmDaDrugEnt();
|
|
@@ -397,6 +405,10 @@ public class WmDaAgentServiceImpl extends ServiceImpl<WmDaAgentMapper, WmDaAgent
|
|
newList2.add(sysDeptRelation);
|
|
newList2.add(sysDeptRelation);
|
|
sysDeptRelationService.saveBatch(newList2);
|
|
sysDeptRelationService.saveBatch(newList2);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ // 初始化任务规则
|
|
|
|
+ taskSubmissionRuleService.initDeptTaskSubmissionRule(Collections.singleton(deptId));
|
|
|
|
+
|
|
this.updateById(wmDaAgent);
|
|
this.updateById(wmDaAgent);
|
|
List<WmRelation> newList = new ArrayList<>();
|
|
List<WmRelation> newList = new ArrayList<>();
|
|
for (String upId : ids) {
|
|
for (String upId : ids) {
|