|
@@ -549,14 +549,16 @@ public class WmDaAgentServiceImpl extends ServiceImpl<WmDaAgentMapper, WmDaAgent
|
|
List<SysDeptRelation> newList2 = new ArrayList<>();
|
|
List<SysDeptRelation> newList2 = new ArrayList<>();
|
|
|
|
|
|
WmDaAgent wmDaAgent1 = wmDaAgentMapper.selectOne(Wrappers.query(query));
|
|
WmDaAgent wmDaAgent1 = wmDaAgentMapper.selectOne(Wrappers.query(query));
|
|
- for (String upId : ids) {
|
|
|
|
- WmRelation wmRelation = new WmRelation();
|
|
|
|
- wmRelation.setUpId(Integer.parseInt(upId));
|
|
|
|
- wmRelation.setDownId(Integer.parseInt(wmDaAgent1.getId()));
|
|
|
|
- newList.add(wmRelation);
|
|
|
|
- wmRelationMapper.deleteByPrimaryKey(Long.valueOf(wmRelation.getDownId()));
|
|
|
|
|
|
+ if (wmDaAgent1 != null) {
|
|
|
|
+ for (String upId : ids) {
|
|
|
|
+ WmRelation wmRelation = new WmRelation();
|
|
|
|
+ wmRelation.setUpId(Integer.parseInt(upId));
|
|
|
|
+ wmRelation.setDownId(Integer.parseInt(wmDaAgent1.getId()));
|
|
|
|
+ newList.add(wmRelation);
|
|
|
|
+ wmRelationMapper.deleteByPrimaryKey(Long.valueOf(wmRelation.getDownId()));
|
|
|
|
+ }
|
|
|
|
+ wmRelationService.saveBatch(newList);
|
|
}
|
|
}
|
|
- wmRelationService.saveBatch(newList);
|
|
|
|
|
|
|
|
for (String id : deptIds) {
|
|
for (String id : deptIds) {
|
|
SysDeptRelation sysDeptRelation = new SysDeptRelation();
|
|
SysDeptRelation sysDeptRelation = new SysDeptRelation();
|