任务BUG修改
This commit is contained in:
+8
-2
@@ -2022,6 +2022,10 @@ public class UserApplicationService {
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int deleteByIds(List<Long> ids) {
|
||||
// 检查ids是否为空
|
||||
if (ids == null || ids.isEmpty()) {
|
||||
throw new ServiceException("删除的用户ID列表不能为空");
|
||||
}
|
||||
//获取登录人信息
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
if (ObjectUtil.isNull(loginUser)) {
|
||||
@@ -2042,8 +2046,10 @@ public class UserApplicationService {
|
||||
userDomainService.updateUser(userDO);
|
||||
}
|
||||
}
|
||||
//同步删除网货的员工信息
|
||||
wlhyDomainService.deleteBatchPlatformUser(ids);
|
||||
//同步删除网货的员工信息(只有当ids不为空时才调用)
|
||||
if (!ids.isEmpty()) {
|
||||
wlhyDomainService.deleteBatchPlatformUser(ids);
|
||||
}
|
||||
return ids.size();
|
||||
}
|
||||
|
||||
|
||||
+4
@@ -609,6 +609,10 @@ public class UserWlhyDomainService {
|
||||
* @return boolean
|
||||
*/
|
||||
public boolean deleteBatchPlatformUser(List<Long> szwlUserIds){
|
||||
// 检查ids是否为空
|
||||
if (szwlUserIds == null || szwlUserIds.isEmpty()) {
|
||||
return true; // 如果列表为空,直接返回成功,避免SQL语法错误
|
||||
}
|
||||
//检查是否开启网货
|
||||
boolean flag = checkSwitch();
|
||||
if(!flag){
|
||||
|
||||
@@ -366,6 +366,10 @@ public class UserAPI extends BaseController {
|
||||
@Log(title = "用户中台管理-删除", description ="批量删除用户",businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/removeByIds/{ids}")
|
||||
public AjaxResult removeByIds(@PathVariable List<Long> ids) {
|
||||
// 检查ids是否为空
|
||||
if (ids == null || ids.isEmpty()) {
|
||||
return error("删除的用户ID列表不能为空");
|
||||
}
|
||||
return toAjax(userApplicationService.deleteByIds(ids));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user