Browse Source

查询网格、部门可选人员列表,查询首页网格列表

master
wangchao 5 years ago
parent
commit
f21e3a5a92
  1. 29
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/CommonGridIdFormDTO.java
  2. 1
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/CustomerGridFormDTO.java
  3. 6
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerStaffAgencyController.java
  4. 39
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/GridController.java
  5. 13
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffAgencyDao.java
  6. 11
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/EpmetUserFeignClient.java
  7. 7
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallBack.java
  8. 11
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerStaffAgencyService.java
  9. 9
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerStaffGridService.java
  10. 25
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffAgencyServiceImpl.java
  11. 14
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffGridServiceImpl.java
  12. 36
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml
  13. 31
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffAgencyDao.xml
  14. 26
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CommonUserIdListFormList.java
  15. 11
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CommonStaffInfoResultDTO.java
  16. 15
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java
  17. 11
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java
  18. 11
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/CustomerStaffService.java
  19. 14
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java
  20. 18
      epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml

29
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/CommonGridIdFormDTO.java

@ -0,0 +1,29 @@
package com.epmet.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @Description
* @ClassName CommonGridIdFormDTO
* @Author wangc
* @date 2020.04.24 14:17
*/
@Data
public class CommonGridIdFormDTO implements Serializable {
private static final long serialVersionUID = 2496019865436084805L;
/**
* 网格Id
* */
@NotBlank(message = "网格Id不能为空")
private String gridId;
/**
* 用户Id
* */
@NotBlank(message = "用户Id不能为空")
private String userId;
}

1
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/CustomerGridFormDTO.java

@ -38,5 +38,4 @@ public class CustomerGridFormDTO implements Serializable {
@NotBlank(message = "网格ID不能为空")
private String gridId;
}

6
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerStaffAgencyController.java

@ -17,7 +17,9 @@
package com.epmet.controller;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ExcelUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.AssertUtils;
@ -26,6 +28,9 @@ import com.epmet.commons.tools.validator.group.AddGroup;
import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.dto.CustomerStaffAgencyDTO;
import com.epmet.dto.form.CommonGridIdFormDTO;
import com.epmet.dto.form.CustomerGridFormDTO;
import com.epmet.dto.result.CommonStaffInfoResultDTO;
import com.epmet.dto.result.LatestCustomerResultDTO;
import com.epmet.excel.CustomerStaffAgencyExcel;
import com.epmet.service.CustomerStaffAgencyService;
@ -103,5 +108,4 @@ public class CustomerStaffAgencyController {
public Result<LatestCustomerResultDTO> getLatestCustomer(@PathVariable("userId") String userId) {
return customerStaffAgencyService.getLatestCustomer(userId);
}
}

39
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/GridController.java

@ -1,15 +1,25 @@
package com.epmet.controller;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dto.form.CommonAgencyIdFormDTO;
import com.epmet.dto.form.CommonGridIdFormDTO;
import com.epmet.dto.form.CustomerGridFormDTO;
import com.epmet.dto.result.CommonStaffInfoResultDTO;
import com.epmet.dto.result.GridDetailResultDTO;
import com.epmet.dto.result.GridListInfoResultDTO;
import com.epmet.service.CustomerGridService;
import com.epmet.service.CustomerStaffAgencyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* @Auther zxc
* @Create 2020-04-23 9:50
@ -21,6 +31,8 @@ public class GridController {
@Autowired
private CustomerGridService customerGridService;
@Autowired
private CustomerStaffAgencyService customerStaffAgencyService;
@PostMapping("griddetail")
public Result<GridDetailResultDTO> griddetail(@RequestBody CustomerGridFormDTO customerGridFormDTO){
Result<GridDetailResultDTO> griddetail = customerGridService.griddetail(customerGridFormDTO);
@ -33,4 +45,31 @@ public class GridController {
@PostMapping("deletegrid")*/
/**
* @Description 查找指定机构下的网格列表
* @Param CommonAgencyIdFormDTO -> gridId
* @return Result<GridListInfoResultDTO>
* @Author wangc
* @Date 2020.04.23 14:45
**/
@PostMapping("gridlist")
public Result<GridListInfoResultDTO> gridList(@LoginUser TokenDto tokenDto,@RequestBody CommonAgencyIdFormDTO agencyFormDTO){
agencyFormDTO.setAgencyId(tokenDto.getUserId());
ValidatorUtils.validateEntity(agencyFormDTO);
return customerGridService.getGridListByAgency(agencyFormDTO);
}
/**
* @Description 在给网格添加工作人员时查询当前机关下没有加入到此网格下的工作人员禁用的也不能选不显示
* @Param CommonGridIdFormDTO
* @return Result<List<CommonStaffInfoResultDTO>>
* @Author wangc
* @Date 2020.04.24 14:14
**/
@PostMapping("selectablestaffs")
public Result<List<CommonStaffInfoResultDTO>> selectableStaffs(@LoginUser TokenDto tokenDto, @RequestBody CommonGridIdFormDTO gridIdFormDTO){
gridIdFormDTO.setUserId(tokenDto.getUserId());
ValidatorUtils.validateEntity(gridIdFormDTO);
return customerStaffAgencyService.getSelectableStaffs(gridIdFormDTO);
}
}

13
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffAgencyDao.java

@ -19,8 +19,12 @@ package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.CustomerStaffAgencyDTO;
import com.epmet.dto.form.CustomerGridFormDTO;
import com.epmet.entity.CustomerStaffAgencyEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 人员-机关单位关系表
@ -37,5 +41,14 @@ public interface CustomerStaffAgencyDao extends BaseDao<CustomerStaffAgencyEntit
* @return
*/
CustomerStaffAgencyDTO selectLatestCustomerByStaff(String userId);
/**
* @Description 返回给定网格Id所属的机构下未加入该网格的工作人员Id(禁用未知)
* @Param gridId (String)
* @return List<String> UserId列表
* @Author wangc
* @Date 2020.04.24 14:01
**/
List<String> getSelectableStaffsForGrid(@Param("gridId") String gridId);
}

11
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/EpmetUserFeignClient.java

@ -5,6 +5,8 @@ import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.CustomerStaffDTO;
import com.epmet.dto.CustomerStaffGridDTO;
import com.epmet.dto.StaffGridListDTO;
import com.epmet.dto.form.CommonUserIdListFormList;
import com.epmet.dto.result.CommonStaffInfoResultDTO;
import com.epmet.feign.fallback.EpmetUserFeignClientFallBack;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
@ -33,4 +35,13 @@ public interface EpmetUserFeignClient {
@PostMapping("/epmetuser/customerstaff/selectstaffgridlistbyuserid")
Result<List<StaffGridListDTO>> getStaffGridList(@RequestBody List<CustomerStaffGridDTO> customerStaffGridDTOS);
/**
* @Description 通过userId列表查询未被禁用的用户信息
* @Param CommonUserIdListFormList :: getUserIdList
* @return Result<List<CommonStaffInfoResultDTO>>
* @Author wangc
* @Date 2020.04.24 15:44
**/
@PostMapping("/epmetuser/customerstaff/enabestaffmsglist")
Result<List<CommonStaffInfoResultDTO>> enableStaffMsgList(CommonUserIdListFormList userIdList);
}

7
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallBack.java

@ -6,6 +6,8 @@ import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.CustomerStaffDTO;
import com.epmet.dto.CustomerStaffGridDTO;
import com.epmet.dto.StaffGridListDTO;
import com.epmet.dto.form.CommonUserIdListFormList;
import com.epmet.dto.result.CommonStaffInfoResultDTO;
import com.epmet.feign.EpmetUserFeignClient;
import org.springframework.stereotype.Component;
@ -25,4 +27,9 @@ public class EpmetUserFeignClientFallBack implements EpmetUserFeignClient {
public Result<List<StaffGridListDTO>> getStaffGridList(List<CustomerStaffGridDTO> customerStaffGridDTOS) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getStaffGridList", customerStaffGridDTOS);
}
@Override
public Result<List<CommonStaffInfoResultDTO>> enableStaffMsgList(CommonUserIdListFormList userIdList) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "enableStaffMsgList", userIdList);
}
}

11
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerStaffAgencyService.java

@ -21,6 +21,8 @@ import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.CustomerStaffAgencyDTO;
import com.epmet.dto.form.CommonGridIdFormDTO;
import com.epmet.dto.result.CommonStaffInfoResultDTO;
import com.epmet.dto.result.LatestCustomerResultDTO;
import com.epmet.entity.CustomerStaffAgencyEntity;
@ -102,4 +104,13 @@ public interface CustomerStaffAgencyService extends BaseService<CustomerStaffAge
* @return
*/
Result<LatestCustomerResultDTO> getLatestCustomer(String userId);
/**
* @Description 获取添加网格成员的可选人员列表
* @Param CommonGridIdFormDTO
* @return com.epmet.dto.result.CommonStaffInfoResultDTO[epmet-user-client]
* @Author wangc
* @Date 2020.04.23 16:15
**/
Result<List<CommonStaffInfoResultDTO>> getSelectableStaffs(CommonGridIdFormDTO gridIdFormDTO);
}

9
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerStaffGridService.java

@ -106,13 +106,4 @@ public interface CustomerStaffGridService extends BaseService<CustomerStaffGridE
* @Date 2020.04.23 09:11
**/
Result<CustomerGridByUserIdResultDTO> getStaffGridOrderByGridName(LatestGridFormDTO latestGridFormDTO);
/**
* @Description 获取添加网格成员的可选人员列表
* @Param CustomerGridFormDTO
* @return com.epmet.dto.result.CommonStaffInfoResultDTO[epmet-user-client]
* @Author wangc
* @Date 2020.04.23 16:15
**/
Result<List<CommonStaffInfoResultDTO>> getSelectableStaffs(CustomerGridFormDTO customerGridFormDTO);
}

25
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffAgencyServiceImpl.java

@ -20,6 +20,7 @@ package com.epmet.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.constant.FieldConstant;
@ -28,6 +29,9 @@ import com.epmet.dao.CustomerStaffAgencyDao;
import com.epmet.dto.CustomerDTO;
import com.epmet.dto.CustomerStaffAgencyDTO;
import com.epmet.dto.CustomerStaffDTO;
import com.epmet.dto.form.CommonGridIdFormDTO;
import com.epmet.dto.form.CommonUserIdListFormList;
import com.epmet.dto.result.CommonStaffInfoResultDTO;
import com.epmet.dto.result.LatestCustomerResultDTO;
import com.epmet.entity.CustomerStaffAgencyEntity;
import com.epmet.feign.EpmetUserFeignClient;
@ -39,6 +43,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
@ -133,4 +138,24 @@ public class CustomerStaffAgencyServiceImpl extends BaseServiceImpl<CustomerStaf
return new Result<LatestCustomerResultDTO>().ok(resultDTO);
}
/**
* @Description 获取添加网格成员的可选人员列表先在本服务下查询userId然后调用EpmetUserFeign校验账户是否被禁用使用EpmetUser服务的DTO作为返回参数
* @Param CustomerGridFormDTO -> gridId
* @return Result<List<CommonStaffInfoResultDTO>> -> CommonStaffInfoResultDTO [epmet-user-client]
* @Author wangc
* @Date 2020.04.23 16:28
**/
@Override
public Result<List<CommonStaffInfoResultDTO>> getSelectableStaffs(CommonGridIdFormDTO customerGridFormDTO) {
//1.去数据库查询是此网格所属机构且不在此网格下的工作人员,这里无法确认是否被禁用
List<String> userId = baseDao.getSelectableStaffsForGrid(customerGridFormDTO.getGridId());
//2.去用户服务下拿取用户基本信息,并校验工作人员身份是否被禁用
if(null != userId && userId.size() >= NumConstant.ONE){
//直接返回结果
return epmetUserFeignClient.enableStaffMsgList(new CommonUserIdListFormList(userId));
}
return new Result<List<CommonStaffInfoResultDTO>>().ok(new ArrayList<>());
}
}

14
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffGridServiceImpl.java

@ -127,18 +127,4 @@ public class CustomerStaffGridServiceImpl extends BaseServiceImpl<CustomerStaffG
result.setAgencyId(grid.getPid());
return new Result<CustomerGridByUserIdResultDTO>().ok(result);
}
/**
* @Description 获取添加网格成员的可选人员列表先在本服务下查询userId然后调用EpmetUserFeign校验账户是否被禁用使用EpmetUser服务的DTO作为返回参数
* @Param CustomerGridFormDTO -> gridId
* @return Result<List<CommonStaffInfoResultDTO>> -> CommonStaffInfoResultDTO [epmet-user-client]
* @Author wangc
* @Date 2020.04.23 16:28
**/
@Override
public Result<List<CommonStaffInfoResultDTO>> getSelectableStaffs(CustomerGridFormDTO customerGridFormDTO) {
return null;
}
}

36
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml

@ -141,27 +141,29 @@
<!-- 得到当前机构的网格总数 -->
<select id="selectGridCountByAgencyId" parameterType="string" resultType="int">
SELECT
COUNT( 0 )
FROM
CUSTOMER_GRID
WHERE
DEL_FLAG = '0'
AND
PID = #{agencyId}
SELECT
COUNT( 0 )
FROM
CUSTOMER_GRID
WHERE
DEL_FLAG = '0'
AND
PID = #{agencyId}
</select>
<!-- 得到当前机构的网格列表 -->
<select id="selectGridListByAgencyId" parameterType="string" resultType="com.epmet.dto.result.GridBaseInfoResultDTO">
SELECT
ID AS grdiId,
GRID_NAME,
TOTAL_USER
FROM
CUSTOMER_GRID
WHERE
DEL_FLAG = '0'
AND PID = #{agencyId}
SELECT
ID AS grdiId,
GRID_NAME,
TOTAL_USER
FROM
CUSTOMER_GRID
WHERE
DEL_FLAG = '0'
AND PID = #{agencyId}
ORDER BY CREATED_TIME DESC
LIMIT 10
</select>
</mapper>

31
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffAgencyDao.xml

@ -29,4 +29,35 @@
LIMIT 1
</select>
<!-- 查询当前网格所属机构下的不在此网格的工作人员Id -->
<select id="getSelectableStaffsForGrid" parameterType="string" resultType="string">
SELECT
agency.USER_ID
FROM
CUSTOMER_STAFF_AGENCY agency
WHERE
agency.DEL_FLAG = '0'
AND agency.AGENCY_ID = (
SELECT
PID
FROM
CUSTOMER_GRID
WHERE
DEL_FLAG = '0'
AND ID = #{gridId})
AND agency.USER_ID NOT IN (
SELECT
grid2.USER_ID
FROM
CUSTOMER_STAFF_GRID grid2
WHERE
grid2.DEL_FLAG = '0'
AND
grid2.GRID_ID = #{gridId} )
</select>
</mapper>

26
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CommonUserIdListFormList.java

@ -0,0 +1,26 @@
package com.epmet.dto.form;
import lombok.AllArgsConstructor;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.List;
/**
* @Description 通用用户Id列表参数DTO
* @ClassName CommonUserIdListFormList
* @Author wangc
* @date 2020.04.24 15:42
*/
@Data
@AllArgsConstructor
public class CommonUserIdListFormList implements Serializable{
private static final long serialVersionUID = -7045691156972928671L;
/**
* 用户列表
* */
@NotBlank(message = "用户列表不能为空")
private List<String> userIdList;
}

11
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CommonStaffInfoResultDTO.java

@ -17,15 +17,20 @@ public class CommonStaffInfoResultDTO implements Serializable {
/**
* 工作人员用户Id
* */
private String userId;
private String staffId;
/**
* 工作人员用户头像
* */
private String userHeadPhoto;
private String staffHeadPhoto;
/**
* 工作人员用户显示昵称
* */
private String userShowName;
private String staffName;
/**
* 性别 1男2女0未知
* */
private Integer gender;
}

15
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java

@ -28,8 +28,10 @@ import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.dto.CustomerStaffDTO;
import com.epmet.dto.CustomerStaffGridDTO;
import com.epmet.dto.StaffGridListDTO;
import com.epmet.dto.form.CommonUserIdListFormList;
import com.epmet.dto.form.CustomerGridFormDTO;
import com.epmet.dto.form.CustomerStaffFormDTO;
import com.epmet.dto.result.CommonStaffInfoResultDTO;
import com.epmet.excel.CustomerStaffExcel;
import com.epmet.service.CustomerStaffService;
import org.springframework.beans.factory.annotation.Autowired;
@ -143,4 +145,17 @@ public class CustomerStaffController {
public Result<CustomerStaffDTO> getCustomerStaffInfoByUserId(CustomerStaffDTO formDTO) {
return customerStaffService.getCustomerStaffInfoByUserId(formDTO);
}
/**
* @Description 通过userId列表查询未被禁用的用户信息
* @Param CommonUserIdListFormList :: getUserIdList
* @return Result<List<CommonStaffInfoResultDTO>>
* @Author wangc
* @Date 2020.04.24 15:44
**/
@PostMapping(value = "enabestaffmsglist")
public Result<List<CommonStaffInfoResultDTO>> enableStaffMsgList(@RequestBody CommonUserIdListFormList userIdList){
ValidatorUtils.validateEntity(userIdList);
return customerStaffService.getEnableStaffMsgList(userIdList);
}
}

11
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java

@ -22,8 +22,10 @@ import com.epmet.dto.CustomerStaffDTO;
import com.epmet.dto.CustomerStaffGridDTO;
import com.epmet.dto.StaffGridListDTO;
import com.epmet.dto.form.CustomerStaffFormDTO;
import com.epmet.dto.result.CommonStaffInfoResultDTO;
import com.epmet.entity.CustomerStaffEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@ -62,4 +64,13 @@ public interface CustomerStaffDao extends BaseDao<CustomerStaffEntity> {
* @return
*/
List<StaffGridListDTO> selectStaffGridListByUserId(List<CustomerStaffGridDTO> customerStaffGridDTOS);
/**
* @Description 根据UserId列表查询用信息过滤掉被禁用的包含未激活的
* @Param List<String>
* @return List<CommonStaffInfoResultDTO>
* @Author wangc
* @Date 2020.04.24 15:34
**/
List<CommonStaffInfoResultDTO> selectEnableStaffMsg(@Param("userIds") List<String> userIds);
}

11
epmet-user/epmet-user-server/src/main/java/com/epmet/service/CustomerStaffService.java

@ -23,8 +23,10 @@ import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.CustomerStaffDTO;
import com.epmet.dto.CustomerStaffGridDTO;
import com.epmet.dto.StaffGridListDTO;
import com.epmet.dto.form.CommonUserIdListFormList;
import com.epmet.dto.form.CustomerGridFormDTO;
import com.epmet.dto.form.CustomerStaffFormDTO;
import com.epmet.dto.result.CommonStaffInfoResultDTO;
import com.epmet.entity.CustomerStaffEntity;
import java.util.List;
@ -132,4 +134,13 @@ public interface CustomerStaffService extends BaseService<CustomerStaffEntity> {
* @return
*/
Result<List<StaffGridListDTO>> selectStaffGridListByUserId(List<CustomerStaffGridDTO> customerStaffGridDTOS);
/**
* @Description 通过userId列表查询未被禁用的用户信息
* @Param CommonUserIdListFormList :: getUserIdList
* @return Result<List<CommonStaffInfoResultDTO>>
* @Author wangc
* @Date 2020.04.24 15:44
**/
Result<List<CommonStaffInfoResultDTO>> getEnableStaffMsgList(CommonUserIdListFormList userIdList);
}

14
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java

@ -30,8 +30,10 @@ import com.epmet.dao.CustomerStaffDao;
import com.epmet.dto.CustomerStaffDTO;
import com.epmet.dto.CustomerStaffGridDTO;
import com.epmet.dto.StaffGridListDTO;
import com.epmet.dto.form.CommonUserIdListFormList;
import com.epmet.dto.form.CustomerGridFormDTO;
import com.epmet.dto.form.CustomerStaffFormDTO;
import com.epmet.dto.result.CommonStaffInfoResultDTO;
import com.epmet.entity.CustomerStaffEntity;
import com.epmet.redis.CustomerStaffRedis;
import com.epmet.service.CustomerStaffService;
@ -149,4 +151,16 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl<CustomerStaffDao,
return new Result<List<StaffGridListDTO>>().ok(staffGridListDTOS);
}
/**
* @Description 通过userId列表查询未被禁用的用户信息
* @Param CommonUserIdListFormList :: getUserIdList
* @return Result<List<CommonStaffInfoResultDTO>>
* @Author wangc
* @Date 2020.04.24 15:44
**/
@Override
public Result<List<CommonStaffInfoResultDTO>> getEnableStaffMsgList(CommonUserIdListFormList userIdList) {
return new Result<List<CommonStaffInfoResultDTO>>().ok(baseDao.selectEnableStaffMsg(userIdList.getUserIdList()));
}
}

18
epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml

@ -41,4 +41,22 @@
</foreach>
AND cs.del_flag = 0
</select>
<!-- 根据UserId列表查询用户Id、头像、昵称,过滤掉被禁用的,包含未激活的-->
<select id="selectEnableStaffMsg" resultType="com.epmet.dto.result.CommonStaffInfoResultDTO">
SELECT
USER_ID AS staffId,
REAL_NAME AS staffName,
HEAD_PHOTO AS staffHeadPhoto ,
GENDER
FROM
CUSTOMER_STAFF
WHERE
DEL_FLAG = '0'
AND
ENABLE_FLAG = 'enable'
<foreach collection="userIds" item="userId" open="AND USER_ID IN (" separator="," close=")">
#{userId}
</foreach>
</select>
</mapper>
Loading…
Cancel
Save