用户viewer角色时添加品牌跟责任领域
This commit is contained in:
+29
@@ -0,0 +1,29 @@
|
||||
package com.jero.modules.system.controller;
|
||||
|
||||
|
||||
import com.jero.common.system.base.controller.JeroController;
|
||||
import com.jero.modules.system.entity.ProjectUserBrand;
|
||||
import com.jero.modules.system.service.IProjectUserBrandService;
|
||||
import io.swagger.annotations.Api;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 用户品牌表
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-11-15
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Api(tags="用户品牌表")
|
||||
@RestController
|
||||
@RequestMapping("/project/projectUserBrand")
|
||||
@Slf4j
|
||||
public class ProjectUserBrandController extends JeroController<ProjectUserBrand, IProjectUserBrandService> {
|
||||
@Autowired
|
||||
private IProjectUserBrandService projectUserBrandService;
|
||||
|
||||
|
||||
}
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
package com.jero.modules.system.controller;
|
||||
|
||||
|
||||
import com.jero.common.system.base.controller.JeroController;
|
||||
import com.jero.modules.system.entity.ProjectUserDutyTerritory;
|
||||
import com.jero.modules.system.service.IProjectUserDutyTerritoryService;
|
||||
import io.swagger.annotations.Api;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 用户责任领域
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-11-15
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Api(tags="用户责任领域")
|
||||
@RestController
|
||||
@RequestMapping("/project/projectUserDutyTerritory")
|
||||
@Slf4j
|
||||
public class ProjectUserDutyTerritoryController extends JeroController<ProjectUserDutyTerritory, IProjectUserDutyTerritoryService> {
|
||||
@Autowired
|
||||
private IProjectUserDutyTerritoryService projectUserDutyTerritoryService;
|
||||
|
||||
|
||||
}
|
||||
+22
-1
@@ -41,6 +41,7 @@ import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
||||
@@ -111,6 +112,12 @@ public class SysUserController {
|
||||
@Resource
|
||||
private BaseCommonService baseCommonService;
|
||||
|
||||
@Autowired
|
||||
private IProjectUserBrandService projectUserBrandService;
|
||||
|
||||
@Autowired
|
||||
private IProjectUserDutyTerritoryService projectUserDutyTerritoryService;
|
||||
|
||||
/**
|
||||
* 获取用户列表数据
|
||||
*
|
||||
@@ -227,6 +234,11 @@ public class SysUserController {
|
||||
Result<SysUser> result = new Result<SysUser>();
|
||||
try {
|
||||
String ids = jsonObject.getString("ids");
|
||||
String roles = jsonObject.getString("selectedroles");
|
||||
String dutyTerritories = jsonObject.getString("dutyTerritories");
|
||||
String brands = jsonObject.getString("brands");
|
||||
List<ProjectUserBrand> projectUserBrandList = new ArrayList<>();
|
||||
List<ProjectUserDutyTerritory> projectUserDutyTerritoryList = new ArrayList<>();
|
||||
List<String> idList = Arrays.asList(ids.split(","));
|
||||
for (String id : idList) {
|
||||
SysUser sysUser = sysUserService.getById(id);
|
||||
@@ -238,11 +250,20 @@ public class SysUserController {
|
||||
user.setId(id);
|
||||
user.setUpdateTime(new Date());
|
||||
|
||||
String roles = jsonObject.getString("selectedroles");
|
||||
sysUserService.editUserWithRole(user, roles);
|
||||
if (ObjectUtils.isNotEmpty(roles)) {
|
||||
//如果角色包含viewer,设置责任领域权限和品牌权限
|
||||
sysUserService.setBrandAndDutyTerritory(roles, dutyTerritories, brands, projectUserBrandList, projectUserDutyTerritoryList, id);
|
||||
}
|
||||
result.success("修改成功!");
|
||||
}
|
||||
}
|
||||
if (ObjectUtils.isNotEmpty(projectUserBrandList)) {
|
||||
projectUserBrandService.saveBatch(projectUserBrandList);
|
||||
}
|
||||
if (ObjectUtils.isNotEmpty(projectUserDutyTerritoryList)) {
|
||||
projectUserDutyTerritoryService.saveBatch(projectUserDutyTerritoryList);
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
|
||||
+51
@@ -0,0 +1,51 @@
|
||||
package com.jero.modules.system.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigDecimal;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import com.jero.common.aspect.annotation.Dict;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 用户品牌表
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-11-15
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("project_user_brand")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value="project_user_brand对象", description="用户品牌表")
|
||||
public class ProjectUserBrand implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**主键*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "主键")
|
||||
private String id;
|
||||
|
||||
/**用户id*/
|
||||
@Excel(name = "用户id", width = 15)
|
||||
@ApiModelProperty(value = "用户id")
|
||||
private String userId;
|
||||
|
||||
/**品牌类型*/
|
||||
@Excel(name = "品牌类型", width = 15)
|
||||
@ApiModelProperty(value = "品牌类型")
|
||||
@Dict(dicCode = "brand")
|
||||
private String brandType;
|
||||
|
||||
}
|
||||
+51
@@ -0,0 +1,51 @@
|
||||
package com.jero.modules.system.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigDecimal;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import com.jero.common.aspect.annotation.Dict;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 用户责任领域
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-11-15
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("project_user_duty_territory")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value="project_user_duty_territory对象", description="用户责任领域")
|
||||
public class ProjectUserDutyTerritory implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**主键*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "主键")
|
||||
private String id;
|
||||
|
||||
/**用户id*/
|
||||
@Excel(name = "用户id", width = 15)
|
||||
@ApiModelProperty(value = "用户id")
|
||||
private String userId;
|
||||
|
||||
/**责任领域*/
|
||||
@Excel(name = "责任领域", width = 15)
|
||||
@ApiModelProperty(value = "责任领域")
|
||||
@Dict(dicCode = "duty_territory")
|
||||
private String dutyTerritory;
|
||||
|
||||
}
|
||||
+1
@@ -10,6 +10,7 @@ public enum ProjectRoleEnum {
|
||||
REGULATI_AND_HOMOLOGATION_ENGINEER("法规工程师/认证工程师","4","Regulatory Engineer/Certification Engineer"),
|
||||
MANAGER("领导角色","11","R&H Manager"),
|
||||
ADMIN("系统管理员","12","admin"),
|
||||
VIEWER("Viewer","","Viewer"),
|
||||
;
|
||||
|
||||
String name;
|
||||
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
package com.jero.modules.system.mapper;
|
||||
|
||||
import com.jero.modules.system.entity.ProjectUserBrand;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @Description: 用户品牌表
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-11-15
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface ProjectUserBrandMapper extends BaseMapper<ProjectUserBrand> {
|
||||
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
package com.jero.modules.system.mapper;
|
||||
|
||||
import com.jero.modules.system.entity.ProjectUserDutyTerritory;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @Description: 用户责任领域
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-11-15
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface ProjectUserDutyTerritoryMapper extends BaseMapper<ProjectUserDutyTerritory> {
|
||||
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.jero.modules.system.mapper.ProjectUserBrandMapper">
|
||||
<resultMap id="ProjectUserBrandResultMap" type="com.jero.modules.system.entity.ProjectUserBrand">
|
||||
<id column="id" property="id" />
|
||||
<result column="user_id" property="userId" />
|
||||
<result column="brand_type" property="brandType" />
|
||||
</resultMap>
|
||||
</mapper>
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.jero.modules.system.mapper.ProjectUserDutyTerritoryMapper">
|
||||
<resultMap id="ProjectUserDutyTerritoryResultMap" type="com.jero.modules.system.entity.ProjectUserDutyTerritory">
|
||||
<id column="id" property="id" />
|
||||
<result column="user_id" property="userId" />
|
||||
<result column="duty_territory" property="dutyTerritory" />
|
||||
</resultMap>
|
||||
</mapper>
|
||||
+45
@@ -0,0 +1,45 @@
|
||||
package com.jero.modules.system.service;
|
||||
|
||||
import com.jero.modules.system.entity.ProjectUserBrand;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 用户品牌表
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-11-15
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface IProjectUserBrandService extends IService<ProjectUserBrand> {
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
void deleteById(String id);
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
void deleteByIds(List<String> ids);
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
ProjectUserBrand queryById(String id);
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
List<ProjectUserBrand> queryList();
|
||||
}
|
||||
+45
@@ -0,0 +1,45 @@
|
||||
package com.jero.modules.system.service;
|
||||
|
||||
import com.jero.modules.system.entity.ProjectUserDutyTerritory;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 用户责任领域
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-11-15
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface IProjectUserDutyTerritoryService extends IService<ProjectUserDutyTerritory> {
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
void deleteById(String id);
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
void deleteByIds(List<String> ids);
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
ProjectUserDutyTerritory queryById(String id);
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
List<ProjectUserDutyTerritory> queryList();
|
||||
}
|
||||
+3
-3
@@ -8,9 +8,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.system.vo.LoginUser;
|
||||
import com.jero.common.system.vo.SysUserCacheInfo;
|
||||
import com.jero.modules.system.entity.PPEmployee;
|
||||
import com.jero.modules.system.entity.SysRole;
|
||||
import com.jero.modules.system.entity.SysUser;
|
||||
import com.jero.modules.system.entity.*;
|
||||
import com.jero.modules.system.model.DepartIdModel;
|
||||
import com.jero.modules.system.model.SysUserSysDepartModel;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@@ -301,4 +299,6 @@ public interface ISysUserService extends IService<SysUser> {
|
||||
* @return
|
||||
*/
|
||||
boolean isRegulationOwner(LoginUser currentUser);
|
||||
|
||||
void setBrandAndDutyTerritory(String roles, String dutyTerritories, String brands, List<ProjectUserBrand> projectUserBrandList, List<ProjectUserDutyTerritory> projectUserDutyTerritoryList, String userId);
|
||||
}
|
||||
|
||||
+62
@@ -0,0 +1,62 @@
|
||||
package com.jero.modules.system.service.impl;
|
||||
|
||||
import com.jero.modules.system.entity.ProjectUserBrand;
|
||||
import com.jero.modules.system.mapper.ProjectUserBrandMapper;
|
||||
import com.jero.modules.system.service.IProjectUserBrandService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
/**
|
||||
* @Description: 用户品牌表
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-11-15
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class ProjectUserBrandServiceImpl extends ServiceImpl<ProjectUserBrandMapper, ProjectUserBrand> implements IProjectUserBrandService {
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void deleteById(String id) {
|
||||
removeById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void deleteByIds(List<String> ids) {
|
||||
removeByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public ProjectUserBrand queryById(String id) {
|
||||
return getById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<ProjectUserBrand> queryList() {
|
||||
return list();
|
||||
}
|
||||
}
|
||||
+62
@@ -0,0 +1,62 @@
|
||||
package com.jero.modules.system.service.impl;
|
||||
|
||||
import com.jero.modules.system.entity.ProjectUserDutyTerritory;
|
||||
import com.jero.modules.system.mapper.ProjectUserDutyTerritoryMapper;
|
||||
import com.jero.modules.system.service.IProjectUserDutyTerritoryService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
/**
|
||||
* @Description: 用户责任领域
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-11-15
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class ProjectUserDutyTerritoryServiceImpl extends ServiceImpl<ProjectUserDutyTerritoryMapper, ProjectUserDutyTerritory> implements IProjectUserDutyTerritoryService {
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void deleteById(String id) {
|
||||
removeById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void deleteByIds(List<String> ids) {
|
||||
removeByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public ProjectUserDutyTerritory queryById(String id) {
|
||||
return getById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<ProjectUserDutyTerritory> queryList() {
|
||||
return list();
|
||||
}
|
||||
}
|
||||
+45
-1
@@ -17,14 +17,19 @@ import com.jero.common.util.oConvertUtils;
|
||||
import com.jero.modules.base.service.BaseCommonService;
|
||||
import com.jero.modules.system.entity.*;
|
||||
import com.jero.modules.system.enums.PPSyncEnum;
|
||||
import com.jero.modules.system.enums.ProjectRoleEnum;
|
||||
import com.jero.modules.system.enums.RoleEnum;
|
||||
import com.jero.modules.system.mapper.*;
|
||||
import com.jero.modules.system.model.SysUserSysDepartModel;
|
||||
import com.jero.modules.system.service.IProjectUserBrandService;
|
||||
import com.jero.modules.system.service.IProjectUserDutyTerritoryService;
|
||||
import com.jero.modules.system.service.ISysRoleService;
|
||||
import com.jero.modules.system.service.ISysUserService;
|
||||
import com.jero.modules.system.vo.SysUserDepVo;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.cache.annotation.CacheEvict;
|
||||
@@ -67,8 +72,15 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
||||
private SysDepartRoleMapper sysDepartRoleMapper;
|
||||
@Resource
|
||||
private BaseCommonService baseCommonService;
|
||||
@Autowired
|
||||
private ISysRoleService sysRoleService;
|
||||
@Autowired
|
||||
private IProjectUserBrandService projectUserBrandService;
|
||||
@Autowired
|
||||
private IProjectUserDutyTerritoryService projectUserDutyTerritoryService;
|
||||
|
||||
@Override
|
||||
|
||||
@Override
|
||||
@CacheEvict(value = {CacheConstant.SYS_USERS_CACHE}, allEntries = true)
|
||||
public Result<?> resetPassword(String username, String oldpassword, String newpassword, String confirmpassword) {
|
||||
SysUser user = userMapper.getUserByName(username);
|
||||
@@ -698,4 +710,36 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBrandAndDutyTerritory(String roles, String dutyTerritories, String brands, List<ProjectUserBrand> projectUserBrandList, List<ProjectUserDutyTerritory> projectUserDutyTerritoryList, String userId) {
|
||||
List<String> roleCodes = sysRoleService.listByIds(Arrays.asList(roles.split(","))).stream().map(SysRole::getRoleCode).collect(Collectors.toList());
|
||||
if (roleCodes.contains(ProjectRoleEnum.VIEWER.getCode())) {
|
||||
//先删后加
|
||||
QueryWrapper<ProjectUserBrand> brandDelWrapper = new QueryWrapper<>();
|
||||
brandDelWrapper.eq("user_id", userId);
|
||||
projectUserBrandService.remove(brandDelWrapper);
|
||||
|
||||
QueryWrapper<ProjectUserDutyTerritory> dutyTerritoryDelWrapper = new QueryWrapper<>();
|
||||
dutyTerritoryDelWrapper.eq("user_id", userId);
|
||||
projectUserDutyTerritoryService.remove(dutyTerritoryDelWrapper);
|
||||
|
||||
if (ObjectUtils.isNotEmpty(dutyTerritories)) {
|
||||
for (String dutyTerritory : dutyTerritories.split(",")) {
|
||||
ProjectUserDutyTerritory projectUserDutyTerritory = new ProjectUserDutyTerritory();
|
||||
projectUserDutyTerritory.setUserId(userId);
|
||||
projectUserDutyTerritory.setDutyTerritory(dutyTerritory);
|
||||
projectUserDutyTerritoryList.add(projectUserDutyTerritory);
|
||||
}
|
||||
}
|
||||
if (ObjectUtils.isNotEmpty(brands)) {
|
||||
for (String brand : brands.split(",")) {
|
||||
ProjectUserBrand projectUserBrand = new ProjectUserBrand();
|
||||
projectUserBrand.setUserId(userId);
|
||||
projectUserBrand.setBrandType(brand);
|
||||
projectUserBrandList.add(projectUserBrand);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user