Browse Source

入参添加是否包括本人

master
zhaoqifeng 4 years ago
parent
commit
e7278a2ef8
  1. 29
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/form/RoleListFormDTO.java
  2. 9
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/form/RoleUsersFormDTO.java
  3. 4
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/form/ReceiversFormDTO.java
  4. 9
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/form/SubOrgFormDTO.java
  5. 8
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/EpmetUserController.java
  6. 3
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/GovOrgController.java
  7. 4
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/StaffRoleDao.java
  8. 2
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerStaffAgencyDao.java
  9. 2
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerStaffDepartmentDao.java
  10. 2
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerStaffGridDao.java
  11. 2
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetmessage/impl/EpmetMessageServiceImpl.java
  12. 4
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/EpmetUserService.java
  13. 18
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java
  14. 10
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java
  15. 9
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/StaffRoleDao.xml
  16. 3
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerStaffAgencyDao.xml
  17. 3
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerStaffDepartmentDao.xml
  18. 3
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerStaffGridDao.xml

29
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/form/RoleListFormDTO.java

@ -0,0 +1,29 @@
package com.epmet.dataaggre.dto.epmetuser.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @Description
* @Author zhaoqifeng
* @Date 2021/8/27 10:40
*/
@Data
public class RoleListFormDTO implements Serializable {
private static final long serialVersionUID = -3331980620366027460L;
/**
* 客户ID
*/
private String customerId;
/**
* 是否包括我1 0
*/
@NotBlank(message = "是否包括我不能为空")
private String includeMe;
/**
* 用户ID
*/
private String userId;
}

9
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/form/RoleUsersFormDTO.java

@ -16,4 +16,13 @@ public class RoleUsersFormDTO implements Serializable {
@NotBlank(message = "角色ID不能为空")
private String roleId;
private String customerId;
/**
* 是否包括我1 0
*/
@NotBlank(message = "是否包括我不能为空")
private String includeMe;
/**
* 用户ID
*/
private String userId;
}

4
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/form/ReceiversFormDTO.java

@ -16,7 +16,9 @@ public class ReceiversFormDTO implements Serializable {
private String infoId;
private Integer pageNo = 1;
private Integer pageSize = 10;
/**
* 1: 已读0: 未读
*/
private String readFlag;
}

9
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/form/SubOrgFormDTO.java

@ -15,4 +15,13 @@ public class SubOrgFormDTO implements Serializable {
private static final long serialVersionUID = -3651225675593357002L;
@NotBlank(message = "组织ID不能为空")
private String agencyId;
/**
* 是否包括我1 0
*/
@NotBlank(message = "是否包括我不能为空")
private String includeMe;
/**
* 用户ID
*/
private String userId;
}

8
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/EpmetUserController.java

@ -229,6 +229,7 @@ public class EpmetUserController {
public Result<List<RoleUsersResultDTO>> roleUsers(@LoginUser TokenDto tokenDto, @RequestBody RoleUsersFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO);
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setUserId(tokenDto.getUserId());
return new Result<List<RoleUsersResultDTO>>().ok(epmetUserService.getRoleUsers(formDTO));
}
@ -241,8 +242,11 @@ public class EpmetUserController {
* @Date 2021/8/19 15:10
*/
@PostMapping("rolelist")
public Result<List<RoleListResultDTO>> roleList(@LoginUser TokenDto tokenDto) {
return new Result<List<RoleListResultDTO>>().ok(epmetUserService.getRoleList(tokenDto.getCustomerId()));
public Result<List<RoleListResultDTO>> roleList(@LoginUser TokenDto tokenDto, @RequestBody RoleListFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO);
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setUserId(tokenDto.getUserId());
return new Result<List<RoleListResultDTO>>().ok(epmetUserService.getRoleList(formDTO));
}

3
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/GovOrgController.java

@ -159,8 +159,9 @@ public class GovOrgController {
* @Date 2021/8/19 15:13
*/
@PostMapping("suborg")
public Result<SubOrgResultDTO> subOrg(@RequestBody SubOrgFormDTO formDTO) {
public Result<SubOrgResultDTO> subOrg(@LoginUser TokenDto tokenDto, @RequestBody SubOrgFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO);
formDTO.setUserId(tokenDto.getUserId());
return new Result<SubOrgResultDTO>().ok(govOrgService.getSubOrg(formDTO));
}

4
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/StaffRoleDao.java

@ -62,7 +62,7 @@ public interface StaffRoleDao extends BaseDao<StaffRoleEntity> {
* @Author zhaoqifeng
* @Date 2021/8/19 17:16
*/
List<RoleListResultDTO> getRoleCountList(@Param("customerId") String customerId);
List<RoleListResultDTO> getRoleCountList(@Param("customerId") String customerId, @Param("userId") String userId);
/**
* @Description 根据角色查询人员列表
@ -72,6 +72,6 @@ public interface StaffRoleDao extends BaseDao<StaffRoleEntity> {
* @Author zhaoqifeng
* @Date 2021/8/26 16:48
*/
List<StaffRoleEntity> selectStaffByRole(@Param("customerId") String customerId, @Param("roleId") String roleId);
List<StaffRoleEntity> selectStaffByRole(@Param("customerId") String customerId, @Param("roleId") String roleId, @Param("userId") String userId);
}

2
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerStaffAgencyDao.java

@ -69,6 +69,6 @@ public interface CustomerStaffAgencyDao extends BaseDao<CustomerStaffAgencyEntit
* @Author zhaoqifeng
* @Date 2021/8/20 14:08
*/
List<OrgDTO> selectSubAgency(@Param("agencyId") String agencyId);
List<OrgDTO> selectSubAgency(@Param("agencyId") String agencyId, @Param("userId") String userId);
}

2
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerStaffDepartmentDao.java

@ -50,5 +50,5 @@ public interface CustomerStaffDepartmentDao extends BaseDao<CustomerStaffDepartm
* @Author zhaoqifeng
* @Date 2021/8/20 14:29
*/
List<OrgDTO> selectDepartmentList(@Param("agencyId") String agencyId);
List<OrgDTO> selectDepartmentList(@Param("agencyId") String agencyId, @Param("userId") String userId);
}

2
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerStaffGridDao.java

@ -55,5 +55,5 @@ public interface CustomerStaffGridDao extends BaseDao<CustomerStaffGridEntity> {
* @Author zhaoqifeng
* @Date 2021/8/20 14:37
*/
List<OrgDTO> selectGridList(@Param("agencyId") String agencyId);
List<OrgDTO> selectGridList(@Param("agencyId") String agencyId, @Param("userId") String userId);
}

2
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetmessage/impl/EpmetMessageServiceImpl.java

@ -63,7 +63,7 @@ public class EpmetMessageServiceImpl implements EpmetMessageService {
//检索已读/未读人员列表,并分页
LambdaQueryWrapper<InfoReceiversEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(InfoReceiversEntity :: getInfoId, formDTO.getInfoId());
wrapper.eq(StringUtils.isNotBlank(formDTO.getReadFlag()), InfoReceiversEntity :: getReadFlag, NumConstant.ONE_STR.equals(formDTO.getReadFlag()));
wrapper.eq(StringUtils.isNotBlank(formDTO.getReadFlag()), InfoReceiversEntity :: getReadFlag, Integer.valueOf(formDTO.getReadFlag()));
Page<InfoReceiversEntity> page = new Page<>(formDTO.getPageNo(), formDTO.getPageSize());
IPage<InfoReceiversEntity> iPage = infoReceiversDao.selectPage(page, wrapper);
List<InfoReceiversEntity> list = iPage.getRecords();

4
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/EpmetUserService.java

@ -115,12 +115,12 @@ public interface EpmetUserService {
/**
* @Description 获取角色列表
* @Param customerId
* @Param formDTO
* @Return {@link List<RoleListResultDTO>}
* @Author zhaoqifeng
* @Date 2021/8/19 15:09
*/
List<RoleListResultDTO> getRoleList(String customerId);
List<RoleListResultDTO> getRoleList(RoleListFormDTO formDTO);
/**
* desc:根据工作人员Id 获取工作人员全部信息

18
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java

@ -474,7 +474,11 @@ public class EpmetUserServiceImpl implements EpmetUserService {
*/
@Override
public List<RoleUsersResultDTO> getRoleUsers(RoleUsersFormDTO formDTO) {
List<StaffRoleEntity> staffRoleList = staffRoleDao.selectStaffByRole(formDTO.getCustomerId(), formDTO.getRoleId());
String userId = null;
if (NumConstant.ZERO_STR.equals(formDTO.getIncludeMe())) {
userId = formDTO.getUserId();
}
List<StaffRoleEntity> staffRoleList = staffRoleDao.selectStaffByRole(formDTO.getCustomerId(), formDTO.getRoleId(), userId);
if (CollectionUtils.isEmpty(staffRoleList)) {
return Collections.emptyList();
}
@ -496,7 +500,7 @@ public class EpmetUserServiceImpl implements EpmetUserService {
}
/**
* @param customerId
* @param formDTO
* @Description 获取角色列表
* @Param customerId
* @Return {@link List<RoleListResultDTO>}
@ -504,14 +508,18 @@ public class EpmetUserServiceImpl implements EpmetUserService {
* @Date 2021/8/19 15:09
*/
@Override
public List<RoleListResultDTO> getRoleList(String customerId) {
public List<RoleListResultDTO> getRoleList(RoleListFormDTO formDTO) {
//获取角色列表
LambdaQueryWrapper<GovStaffRoleEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(GovStaffRoleEntity :: getCustomerId, customerId);
wrapper.eq(GovStaffRoleEntity :: getCustomerId, formDTO.getCustomerId());
wrapper.orderByAsc(GovStaffRoleEntity ::getSort);
List<GovStaffRoleEntity> list = govStaffRoleDao.selectList(wrapper);
//获取角色人数
List<RoleListResultDTO> countList = staffRoleDao.getRoleCountList(customerId);
String userId = null;
if (NumConstant.ZERO_STR.equals(formDTO.getIncludeMe())) {
userId = formDTO.getUserId();
}
List<RoleListResultDTO> countList = staffRoleDao.getRoleCountList(formDTO.getCustomerId(), userId);
Map<String, Integer> map = new HashMap<>();
if (CollectionUtils.isNotEmpty(countList)) {
map = countList.stream().collect(Collectors.toMap(RoleListResultDTO :: getRoleId, RoleListResultDTO :: getStaffNum));

10
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java

@ -446,12 +446,16 @@ public class GovOrgServiceImpl implements GovOrgService {
*/
@Override
public SubOrgResultDTO getSubOrg(SubOrgFormDTO formDTO) {
String userId = null;
if (NumConstant.ZERO_STR.equals(formDTO.getIncludeMe())) {
userId = formDTO.getUserId();
}
//下级组织列表
List<OrgDTO> subAgencyList = customerStaffAgencyDao.selectSubAgency(formDTO.getAgencyId());
List<OrgDTO> subAgencyList = customerStaffAgencyDao.selectSubAgency(formDTO.getAgencyId(), userId);
//下级部门列表
List<OrgDTO> departmentList = customerStaffDepartmentDao.selectDepartmentList(formDTO.getAgencyId());
List<OrgDTO> departmentList = customerStaffDepartmentDao.selectDepartmentList(formDTO.getAgencyId(), userId);
//下级网格列表
List<OrgDTO> gridList = customerStaffGridDao.selectGridList(formDTO.getAgencyId());
List<OrgDTO> gridList = customerStaffGridDao.selectGridList(formDTO.getAgencyId(), userId);
SubOrgResultDTO result = new SubOrgResultDTO();
result.setSubAgencyList(subAgencyList);
result.setDepartmentList(departmentList);

9
epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/StaffRoleDao.xml

@ -66,7 +66,11 @@
FROM
staff_role
WHERE
CUSTOMER_ID = #{customerId}
DEL_FLAG = '0'
AND CUSTOMER_ID = #{customerId}
<if test='null != userId and "" != userId'>
AND STAFF_ID != #{userId}
</if>
GROUP BY
ROLE_ID
</select>
@ -85,5 +89,8 @@
AND a.CUSTOMER_ID = #{customerId}
AND b.CUSTOMER_ID = #{customerId}
AND b.ROLE_ID = #{roleId}
<if test='null != userId and "" != userId'>
AND b.STAFF_ID != #{userId}
</if>
</select>
</mapper>

3
epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerStaffAgencyDao.xml

@ -108,6 +108,9 @@
AND b.DEL_FLAG = '0'
WHERE
a.DEL_FLAG = '0'
<if test='null != userId and "" != userId'>
AND b.USER_ID != #{userId}
</if>
) csa ON csa.PIDS LIKE CONCAT( '%', ca.ID, '%' )
WHERE
ca.DEL_FLAG = '0'

3
epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerStaffDepartmentDao.xml

@ -25,6 +25,9 @@
customer_department cd
LEFT JOIN customer_staff_department csd ON cd.ID = csd.DEPARTMENT_ID
AND csd.DEL_FLAG = '0'
<if test='null != userId and "" != userId'>
AND csd.USER_ID != #{userId}
</if>
WHERE
cd.DEL_FLAG = '0'
AND cd.AGENCY_ID = #{agencyId}

3
epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerStaffGridDao.xml

@ -45,6 +45,9 @@
customer_grid cg
LEFT JOIN customer_staff_grid csg ON cg.ID = csg.GRID_ID
AND csg.DEL_FLAG = '0'
<if test='null != userId and "" != userId'>
AND csg.USER_ID != #{userId}
</if>
WHERE
cg.DEL_FLAG = 0
AND cg.PID = #{agencyId}

Loading…
Cancel
Save