|
@@ -544,19 +544,23 @@ public class WmDaAgentServiceImpl extends ServiceImpl<WmDaAgentMapper, WmDaAgent
|
|
.eq(SysDeptSub::getDeptId,sysDept.getDeptId())
|
|
.eq(SysDeptSub::getDeptId,sysDept.getDeptId())
|
|
.set(SysDeptSub::getEnableFlag, SubjectTypeEnum.ENABLE_FLAG_FALSE.getCode()));
|
|
.set(SysDeptSub::getEnableFlag, SubjectTypeEnum.ENABLE_FLAG_FALSE.getCode()));
|
|
|
|
|
|
- for (String subType : wmDaAgent.getSubjectType()) {
|
|
|
|
|
|
+ for (Map.Entry<String, Integer> entry : wmDaAgent.getSubjectTypeAndChannel().entrySet()){
|
|
SysDeptSub condition = new SysDeptSub();
|
|
SysDeptSub condition = new SysDeptSub();
|
|
condition.setDeptId(sysDept.getDeptId());
|
|
condition.setDeptId(sysDept.getDeptId());
|
|
- condition.setSubjectType(subType);
|
|
|
|
|
|
+ condition.setSubjectType(entry.getKey());
|
|
|
|
+ condition.setSubjectChannel(entry.getValue());
|
|
SysDeptSub existSub = sysDeptSubMapper.selectOne(Wrappers.query(condition));
|
|
SysDeptSub existSub = sysDeptSubMapper.selectOne(Wrappers.query(condition));
|
|
if(null != existSub){
|
|
if(null != existSub){
|
|
existSub.setEnableFlag(SubjectTypeEnum.ENABLE_FLAG_TRUE.getCode());
|
|
existSub.setEnableFlag(SubjectTypeEnum.ENABLE_FLAG_TRUE.getCode());
|
|
|
|
+ existSub.setUpdateTime(LocalDateTime.now());
|
|
sysDeptSubMapper.updateById(existSub);
|
|
sysDeptSubMapper.updateById(existSub);
|
|
}else {
|
|
}else {
|
|
existSub = new SysDeptSub();
|
|
existSub = new SysDeptSub();
|
|
existSub.setEnableFlag(SubjectTypeEnum.ENABLE_FLAG_TRUE.getCode());
|
|
existSub.setEnableFlag(SubjectTypeEnum.ENABLE_FLAG_TRUE.getCode());
|
|
existSub.setDeptId(sysDept.getDeptId());
|
|
existSub.setDeptId(sysDept.getDeptId());
|
|
- existSub.setSubjectType(subType);
|
|
|
|
|
|
+ condition.setSubjectType(entry.getKey());
|
|
|
|
+ condition.setSubjectChannel(entry.getValue());
|
|
|
|
+ existSub.setUpdateTime(LocalDateTime.now());
|
|
sysDeptSubMapper.insert(existSub);
|
|
sysDeptSubMapper.insert(existSub);
|
|
}
|
|
}
|
|
}
|
|
}
|