|
@@ -2,6 +2,7 @@ package org.springblade.manager.service.impl;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import lombok.AllArgsConstructor;
|
|
|
+import org.apache.commons.lang.StringUtils;
|
|
|
import org.springblade.core.log.exception.ServiceException;
|
|
|
import org.springblade.core.mp.base.BaseServiceImpl;
|
|
|
import org.springblade.core.tool.utils.Func;
|
|
@@ -17,6 +18,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|
|
import java.lang.reflect.Array;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
+import java.util.function.Function;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
@@ -113,11 +115,13 @@ public class SaveUserInfoByProjectServiceImpl
|
|
|
roleIdListAllOther.addAll(saveRoleIdListReally);
|
|
|
List<String> resultRoleIds = roleIdListAllOther.stream().distinct().collect(Collectors.toList());
|
|
|
|
|
|
- //删除关系表中对应的项目信息数据
|
|
|
- int row = baseMapper.delete(Wrappers.<SaveUserInfoByProjectDTO>update().lambda()
|
|
|
+ //逻辑删除 关系表中对应的项目信息数据
|
|
|
+ /*int row = baseMapper.delete(Wrappers.<SaveUserInfoByProjectDTO>update().lambda()
|
|
|
.eq(SaveUserInfoByProjectDTO::getProjectId, projectId)
|
|
|
.eq(SaveUserInfoByProjectDTO::getUserId, userId)
|
|
|
- );
|
|
|
+ );*/
|
|
|
+ //物理删除
|
|
|
+ int row = baseMapper.deleteByCondition(projectId,userId);
|
|
|
|
|
|
//删除用户roleId
|
|
|
boolean result = this.updateUserRoleIdFour(resultRoleIds, userId);
|
|
@@ -126,11 +130,7 @@ public class SaveUserInfoByProjectServiceImpl
|
|
|
}
|
|
|
|
|
|
private boolean updateUserRoleIdFour(List<String> saveRoleIdListReally, String userId) {
|
|
|
- StringBuilder stringBuilder = new StringBuilder();
|
|
|
- for (String s : saveRoleIdListReally) {
|
|
|
- stringBuilder.append(s).append(",");
|
|
|
- }
|
|
|
- String roleIds = stringBuilder.substring(0, stringBuilder.length() - 1);
|
|
|
+ String roleIds = StringUtils.join(saveRoleIdListReally, ",");
|
|
|
int row = baseMapper.updateUserRoleIdById(roleIds, userId);
|
|
|
return row > 0;
|
|
|
}
|