update 补充站点更换运营商逻辑

This commit is contained in:
2023-07-19 16:37:58 +08:00
parent 666de01edc
commit d8d4f78c91

View File

@@ -307,7 +307,7 @@ public class PileStationInfoServiceImpl implements IPileStationInfoService {
// 创建一个新的站点对应部门
SysDept dept = sysDeptService.createStationDept(Long.valueOf(merchantInfo.getDeptId()),
pileStationInfo.getStationName(), pileStationInfo.getStationAdminName(), pileStationInfo.getStationTel());
pileStationInfo.setDeptId(String.valueOf(dept.getDeptId()));
Long newDeptId = dept.getDeptId();
// 修改账号归属部门
SysUser user = new SysUser();
@@ -315,13 +315,16 @@ public class PileStationInfoServiceImpl implements IPileStationInfoService {
List<SysUser> userList = userService.selectUserList(user);
if (CollectionUtils.isNotEmpty(userList)) {
for (SysUser sysUser : userList) {
sysUser.setDeptId(dept.getDeptId());
sysUser.setDeptId(newDeptId);
userService.updateUser(sysUser);
}
}
// 逻辑删除老的部门
sysDeptService.deleteDeptById(Long.parseLong(pileStationInfo.getDeptId()));
// 设置新部门id
pileStationInfo.setDeptId(String.valueOf(newDeptId));
}
}