[修改] 用户模板导入

This commit is contained in:
bupengxiang
2023-05-17 11:24:12 +08:00
parent 41f3aec37e
commit b5b48c16c2
4 changed files with 15 additions and 17 deletions
@@ -114,14 +114,15 @@ public class UserEOServiceImpl implements IUserEoService {
userRoleEO.setRoleId(c); userRoleEO.setRoleId(c);
userRoleEODao.insert(userRoleEO); userRoleEODao.insert(userRoleEO);
}); });
if (StringUtils.isNotEmpty(eo.getOrgId())){
String[] split = eo.getOrgId().split(","); String[] split = eo.getOrgId().split(",");
// 插入组织关联表 暂时用不上,页面不维护组织机构 // 插入组织关联表 暂时用不上,页面不维护组织机构
for (String s : split) { for (String s : split) {
UserOrgEO userOrgEO = new UserOrgEO(); UserOrgEO userOrgEO = new UserOrgEO();
userOrgEO.setUserId(eo.getUsid()); userOrgEO.setUserId(eo.getUsid());
userOrgEO.setOrgId(s); userOrgEO.setOrgId(s);
userOrgEODao.insert(userOrgEO); userOrgEODao.insert(userOrgEO);
}
} }
} }
@@ -387,9 +388,9 @@ public class UserEOServiceImpl implements IUserEoService {
if (StringUtils.isEmpty(userImportVO.getOperation())) { if (StringUtils.isEmpty(userImportVO.getOperation())) {
throw new AdcDaBaseException("第"+(i+1)+"行"+"操作(add添加、full覆盖角色)不能为空"); throw new AdcDaBaseException("第"+(i+1)+"行"+"操作(add添加、full覆盖角色)不能为空");
} }
if (StringUtils.isEmpty(userImportVO.getIsUse())) { // if (StringUtils.isEmpty(userImportVO.getIsUse())) {
throw new AdcDaBaseException("第"+(i+1)+"行"+"是否启用不能为空"); // throw new AdcDaBaseException("第"+(i+1)+"行"+"是否启用不能为空");
} // }
if (!roleEOMap.keySet().contains(userImportVO.getRoleName())) { if (!roleEOMap.keySet().contains(userImportVO.getRoleName())) {
throw new AdcDaBaseException("第"+(i+1)+"行"+"角色:" + userImportVO.getRoleName() + "不存在,请检查"); throw new AdcDaBaseException("第"+(i+1)+"行"+"角色:" + userImportVO.getRoleName() + "不存在,请检查");
} }
@@ -3,9 +3,6 @@ package com.adc.da.sys.vo;
import com.adc.da.excel.annotation.Excel; import com.adc.da.excel.annotation.Excel;
import lombok.Data; import lombok.Data;
import java.util.ArrayList;
import java.util.List;
@Data @Data
public class UserImportVO { public class UserImportVO {
@@ -51,9 +48,8 @@ public class UserImportVO {
private String updateTime; private String updateTime;
// @Excel(name = "是否启用(0禁用、1启用)", width = 20)
@Excel(name = "是否启用(0禁用、1启用)", width = 20) // private String isUse;
private String isUse;
@Excel(name = "姓名", width = 20) @Excel(name = "姓名", width = 20)
private String usname; private String usname;
@@ -266,6 +266,7 @@
#{item.id} #{item.id}
</foreach> </foreach>
and (u.level_id=5 or u.level_id=9) and u.employee_type_id = 1 and (u.level_id=5 or u.level_id=9) and u.employee_type_id = 1
and u.del_flag = 0
</where> </where>
</select> </select>