任务BUG修改

This commit is contained in:
秦鸿展
2026-02-09 16:53:46 +08:00
parent 9cdb5a8896
commit 308f79b804
10 changed files with 188 additions and 34 deletions
@@ -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();
}
@@ -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));
}