Browse Source

Merge remote-tracking branch 'origin/dev_staff_info' into dev_staff_info

# Conflicts:
#	epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetmessage/impl/EpmetMessageServiceImpl.java
dev_shibei_match
jianjun 4 years ago
parent
commit
3db33a1260
  1. 39
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/form/OrgStaffListFormDTO.java
  2. 12
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/result/OrgStaffListResultDTO.java
  3. 33
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/message/form/InfoRepliesFormDTO.java
  4. 28
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/message/result/InfoReplyDetail.java
  5. 18
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/message/result/InfoReplyResDTO.java
  6. 12
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/GovOrgController.java
  7. 18
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/InfoController.java
  8. 33
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetmessage/InfoReceiversDao.java
  9. 7
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/CustomerStaffDao.java
  10. 16
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerStaffAgencyDao.java
  11. 10
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerStaffDepartmentDao.java
  12. 10
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerStaffGridDao.java
  13. 12
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetmessage/EpmetMessageService.java
  14. 86
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetmessage/impl/EpmetMessageServiceImpl.java
  15. 7
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/EpmetUserService.java
  16. 14
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java
  17. 2
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java
  18. 39
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java
  19. 59
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetmessage/InfoReceiversDao.xml
  20. 59
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/CustomerStaffDao.xml
  21. 64
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerStaffAgencyDao.xml
  22. 19
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerStaffDepartmentDao.xml
  23. 17
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerStaffGridDao.xml

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

@ -1,9 +1,12 @@
package com.epmet.dataaggre.dto.govorg.form;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import lombok.Data;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.List;
/**
* @Description 通讯录组织/部门/网格下人员列表-接口入参
@ -12,20 +15,30 @@ import java.io.Serializable;
@Data
public class OrgStaffListFormDTO implements Serializable {
private static final long serialVersionUID = -1974456701949979946L;
@NotBlank(message = "parentAgencyId不能为空",groups = AddUserInternalGroup.class)
private String parentAgencyId;
private String areaCode;
/**
* 社区级community
* 街道:street,
* 区县级: district,
* 市级: city
* 省级:province
* 组织部门网格Id
*/
@NotBlank(message = "level不能为空",groups = AddUserInternalGroup.class)
private String level;
public interface AddUserInternalGroup {
}
@NotBlank(message = "类型Id不能为空", groups = OrgStaffListFormDTO.OrgStaff.class)
private String orgId;
/**
* 类型组织:agency 部门:dept 网格:grid
*/
@NotBlank(message = "类型不能为空", groups = OrgStaffListFormDTO.OrgStaff.class)
private String orgType;
/**
* 页码从1开始
*/
@Min(value = 1, message = "页码必须大于0", groups = OrgStaffListFormDTO.OrgStaff.class)
private Integer pageNo;
/**
* 页容量默认10页
*/
@Min(value = 1, message = "每页条数必须大于0", groups = OrgStaffListFormDTO.OrgStaff.class)
private Integer pageSize = 10;
//客户Id
private String customerId;
//工作人员id集合
private List<String> staffIds;
public interface OrgStaff extends CustomerClientShowGroup {}
}

12
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/result/OrgStaffListResultDTO.java

@ -17,9 +17,11 @@
package com.epmet.dataaggre.dto.govorg.result;
import com.epmet.dataaggre.dto.epmetuser.result.ListStaffResultDTO;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
@ -30,10 +32,14 @@ import java.io.Serializable;
public class OrgStaffListResultDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 树结构对象
* 人员总数
*/
private Integer staffCount;
/**
* 人员列表
*/
private AgencyGridResultDTO agencyGridList;
private List<ListStaffResultDTO> staffList;
}

33
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/message/form/InfoRepliesFormDTO.java

@ -0,0 +1,33 @@
package com.epmet.dataaggre.dto.message.form;
import com.epmet.commons.tools.dto.form.PageFormDTO;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @Description 发送消息详情页-回复列表
* @Author yinzuomei
* @Date 2021/8/20 1:42 下午
*/
@Data
public class InfoRepliesFormDTO extends PageFormDTO implements Serializable {
private static final long serialVersionUID = 8001971787502569463L;
@NotBlank(message = "消息id不能为空",groups = PageFormDTO.AddUserInternalGroup.class)
private String infoId;
//以下参数从token中获取
/**
* 当前用户id
*/
@NotBlank(message = "userId不能为空",groups =PageFormDTO.AddUserInternalGroup.class)
private String userId;
/**
* 当前客户id
*/
@NotBlank(message = "customerId不能为空",groups = PageFormDTO.AddUserInternalGroup.class)
private String customerId;
}

28
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/message/result/InfoReplyDetail.java

@ -0,0 +1,28 @@
package com.epmet.dataaggre.dto.message.result;
import com.epmet.commons.tools.dto.form.FileCommonDTO;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
* @Description 发送消息-回复详情
* @Author yinzuomei
* @Date 2021/8/20 2:01 下午
*/
@Data
public class InfoReplyDetail extends StaffInfoCommonDTO implements Serializable {
private static final long serialVersionUID = -9038141920493410767L;
private String replyId;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
private Date replyTime;
private String content;
/**
* 附件列表
*/
private List<FileCommonDTO> attachmentList;
}

18
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/message/result/InfoReplyResDTO.java

@ -0,0 +1,18 @@
package com.epmet.dataaggre.dto.message.result;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* @Description 发送消息-回复列表
* @Author yinzuomei
* @Date 2021/8/20 2:00 下午
*/
@Data
public class InfoReplyResDTO implements Serializable {
private Integer total;
private List<InfoReplyDetail> dataList;
}

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

@ -130,8 +130,13 @@ public class GovOrgController {
* @author sun
*/
@PostMapping("stafflist")
public Result<List<OrgStaffListResultDTO>> staffList(@LoginUser OrgStaffListFormDTO formDTO) {
return new Result<List<OrgStaffListResultDTO>>().ok(govOrgService.staffList(formDTO));
public Result<OrgStaffListResultDTO> staffList(@LoginUser TokenDto tokenDto, @RequestBody OrgStaffListFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, OrgStaffListFormDTO.OrgStaff.class);
if(!"agency".equals(formDTO.getOrgType())&&!"dept".equals(formDTO.getOrgType())&&!"grid".equals(formDTO.getOrgType())){
throw new RenException("参数类型错误");
}
formDTO.setCustomerId(tokenDto.getCustomerId());
return new Result<OrgStaffListResultDTO>().ok(govOrgService.staffList(formDTO));
}
/**
@ -140,7 +145,8 @@ public class GovOrgController {
* @author sun
*/
@PostMapping("staffdetailv2")
public Result<StaffDetailV2FormDTO> staffDetailV2(@LoginUser StaffDetailV2ResultDTO formDTO) {
public Result<StaffDetailV2FormDTO> staffDetailV2(@RequestBody StaffDetailV2ResultDTO formDTO) {
//ValidatorUtils.validateEntity(formDTO, StaffDetailV2ResultDTO.listGridMemberDatas.class);
return new Result<StaffDetailV2FormDTO>().ok(govOrgService.staffDetailV2(formDTO));
}

18
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/InfoController.java

@ -8,7 +8,9 @@ import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dataaggre.dto.govorg.form.ReceiversFormDTO;
import com.epmet.dataaggre.dto.govorg.result.ReceiversResultDTO;
import com.epmet.dataaggre.dto.message.form.InfoGroupDetailFormDTO;
import com.epmet.dataaggre.dto.message.form.InfoRepliesFormDTO;
import com.epmet.dataaggre.dto.message.result.InfoGroupDetailResDTO;
import com.epmet.dataaggre.dto.message.result.InfoReplyResDTO;
import com.epmet.dataaggre.dto.message.result.MyInfoGroupResultDTO;
import com.epmet.dataaggre.service.epmetmessage.EpmetMessageService;
import org.springframework.web.bind.annotation.PostMapping;
@ -74,4 +76,20 @@ public class InfoController {
ValidatorUtils.validateEntity(formDTO, PageFormDTO.AddUserInternalGroup.class);
return new Result<InfoGroupDetailResDTO>().ok(epmetMessageService.queryGroupDetail(formDTO));
}
/**
* 发送消息-消息详情-回复列表分页查询
*
* @param formDTO
* @return com.epmet.commons.tools.utils.Result<com.epmet.dataaggre.dto.message.result.InfoReplyResDTO>
* @author yinzuomei
* @date 2021/8/20 2:09 下午
*/
@PostMapping("replylist")
public Result<InfoReplyResDTO> queryInfoReplies(@LoginUser TokenDto tokenDto,@RequestBody InfoRepliesFormDTO formDTO){
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setUserId(tokenDto.getUserId());
ValidatorUtils.validateEntity(formDTO, PageFormDTO.AddUserInternalGroup.class);
return new Result<InfoReplyResDTO>().ok(epmetMessageService.queryInfoReplies(formDTO));
}
}

33
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetmessage/InfoReceiversDao.java

@ -18,6 +18,9 @@
package com.epmet.dataaggre.dao.epmetmessage;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.commons.tools.dto.form.FileCommonDTO;
import com.epmet.dataaggre.dto.message.result.InfoGroupDetailResDTO;
import com.epmet.dataaggre.dto.message.result.InfoReplyDetail;
import com.epmet.dataaggre.dto.message.result.MyInfoGroupResultDTO;
import com.epmet.dataaggre.entity.epmetmessage.InfoReceiversEntity;
import org.apache.ibatis.annotations.Mapper;
@ -57,4 +60,34 @@ public interface InfoReceiversDao extends BaseDao<InfoReceiversEntity> {
List<String> selectDistinctStaffIds(@Param("staffId") String staffId,
@Param("customerId") String customerId,
@Param("receiverGroupId")String receiverGroupId);
/**
* 根据小组id查询群组基本信息 (群组id, 群组名称)
*
* @param receiverGroupId
* @return com.epmet.dataaggre.dto.message.result.InfoGroupDetailResDTO
* @author yinzuomei
* @date 2021/8/20 2:19 下午
*/
InfoGroupDetailResDTO selectGroupInfo(String receiverGroupId);
/**
* 分页查询消息的回复列表
*
* @param infoId
* @return java.util.List<com.epmet.dataaggre.dto.message.result.InfoReplyDetail>
* @author yinzuomei
* @date 2021/8/20 2:20 下午
*/
List<InfoReplyDetail> selectListReply(String infoId);
/**
* 回复附件
*
* @param replyId
* @return java.util.List<com.epmet.commons.tools.dto.form.FileCommonDTO>
* @author yinzuomei
* @date 2021/8/20 2:31 下午
*/
List<FileCommonDTO> selectReplyAtt(String replyId);
}

7
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/CustomerStaffDao.java

@ -20,6 +20,7 @@ package com.epmet.dataaggre.dao.epmetuser;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dataaggre.dto.epmetuser.CustomerStaffDTO;
import com.epmet.dataaggre.dto.epmetuser.result.ListStaffResultDTO;
import com.epmet.dataaggre.dto.govorg.form.OrgStaffListFormDTO;
import com.epmet.dataaggre.entity.epmetuser.CustomerStaffEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -51,4 +52,10 @@ public interface CustomerStaffDao extends BaseDao<CustomerStaffEntity> {
* @author sun
*/
List<ListStaffResultDTO> selectByRealName(@Param("customerId") String customerId, @Param("realName") String realName);
/**
* @Description 分页查询工作人员基础信息角色信息组织人员单位领导角色人员在前部门人员部门领导角色人员在前网格人员网格长角色人员在前
* @author sun
*/
List<ListStaffResultDTO> selectStaffList(OrgStaffListFormDTO formDTO);
}

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

@ -21,6 +21,7 @@ import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dataaggre.dto.govorg.CustomerAgencyDTO;
import com.epmet.dataaggre.dto.govorg.CustomerGridDTO;
import com.epmet.dataaggre.dto.govorg.CustomerStaffAgencyDTO;
import com.epmet.dataaggre.dto.govorg.OrgDTO;
import com.epmet.dataaggre.entity.govorg.CustomerStaffAgencyEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -55,4 +56,19 @@ public interface CustomerStaffAgencyDao extends BaseDao<CustomerStaffAgencyEntit
*/
List<CustomerGridDTO> getStaffGridList(@Param("staffId") String staffId);
/**
* @Description 按类型查询组织部门网格下所有工作人员Id列表
* @author sun
*/
List<String> selectStaffList(String orgId, String orgType);
/**
* @Description 获取下级组织列表
* @Param agencyId
* @Return {@link List<OrgDTO>}
* @Author zhaoqifeng
* @Date 2021/8/20 14:08
*/
List<OrgDTO> selectSubAgency(@Param("agencyId") String agencyId);
}

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

@ -19,6 +19,7 @@ package com.epmet.dataaggre.dao.govorg;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dataaggre.dto.govorg.CustomerDepartmentDTO;
import com.epmet.dataaggre.dto.govorg.OrgDTO;
import com.epmet.dataaggre.entity.govorg.CustomerStaffDepartmentEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -41,4 +42,13 @@ public interface CustomerStaffDepartmentDao extends BaseDao<CustomerStaffDepartm
* @return
*/
List<CustomerDepartmentDTO> getStaffDeptList(@Param("staffId") String staffId);
/**
* @Description
* @Param agencyId
* @Return {@link List< OrgDTO>}
* @Author zhaoqifeng
* @Date 2021/8/20 14:29
*/
List<OrgDTO> selectDepartmentList(@Param("agencyId") String agencyId);
}

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

@ -18,6 +18,7 @@
package com.epmet.dataaggre.dao.govorg;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dataaggre.dto.govorg.OrgDTO;
import com.epmet.dataaggre.dto.govorg.result.GridStaffResultDTO;
import com.epmet.dataaggre.dto.govorg.result.StaffAgencyGridListResultDTO;
import com.epmet.dataaggre.entity.govorg.CustomerStaffGridEntity;
@ -46,4 +47,13 @@ public interface CustomerStaffGridDao extends BaseDao<CustomerStaffGridEntity> {
* @author sun
*/
List<StaffAgencyGridListResultDTO.GridResultDTO> getStaffGridList(@Param("agencyId") String agencyId, @Param("staffId") String staffId);
/**
* @Description 获取组织下的网格级网格人数
* @Param agencyId
* @Return {@link List< OrgDTO>}
* @Author zhaoqifeng
* @Date 2021/8/20 14:37
*/
List<OrgDTO> selectGridList(@Param("agencyId") String agencyId);
}

12
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetmessage/EpmetMessageService.java

@ -3,7 +3,9 @@ package com.epmet.dataaggre.service.epmetmessage;
import com.epmet.dataaggre.dto.govorg.form.ReceiversFormDTO;
import com.epmet.dataaggre.dto.govorg.result.ReceiversResultDTO;
import com.epmet.dataaggre.dto.message.form.InfoGroupDetailFormDTO;
import com.epmet.dataaggre.dto.message.form.InfoRepliesFormDTO;
import com.epmet.dataaggre.dto.message.result.InfoGroupDetailResDTO;
import com.epmet.dataaggre.dto.message.result.InfoReplyResDTO;
import com.epmet.dataaggre.dto.message.result.MyInfoGroupResultDTO;
import java.util.List;
@ -41,4 +43,14 @@ public interface EpmetMessageService {
* @date 2021/8/20 12:59 下午
*/
InfoGroupDetailResDTO queryGroupDetail(InfoGroupDetailFormDTO formDTO);
/**
* 发送消息-消息详情-回复列表分页查询
*
* @param formDTO
* @return com.epmet.dataaggre.dto.message.result.InfoReplyResDTO
* @author yinzuomei
* @date 2021/8/20 2:09 下午
*/
InfoReplyResDTO queryInfoReplies(InfoRepliesFormDTO formDTO);
}

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

@ -7,6 +7,7 @@ import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.dataaggre.constant.DataSourceConstant;
import com.epmet.dataaggre.dao.epmetmessage.InfoReceiversDao;
@ -14,11 +15,12 @@ import com.epmet.dataaggre.dto.govorg.ReceiverDTO;
import com.epmet.dataaggre.dto.govorg.form.ReceiversFormDTO;
import com.epmet.dataaggre.dto.govorg.result.ReceiversResultDTO;
import com.epmet.dataaggre.dto.message.form.InfoGroupDetailFormDTO;
import com.epmet.dataaggre.dto.message.result.InfoGroupDetailResDTO;
import com.epmet.dataaggre.dto.message.result.MyInfoGroupResultDTO;
import com.epmet.dataaggre.dto.message.result.StaffInfoCommonDTO;
import com.epmet.dataaggre.dto.message.form.InfoRepliesFormDTO;
import com.epmet.dataaggre.dto.message.result.*;
import com.epmet.dataaggre.entity.epmetmessage.InfoReceiversEntity;
import com.epmet.dataaggre.service.epmetmessage.EpmetMessageService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
@ -91,6 +93,7 @@ public class EpmetMessageServiceImpl implements EpmetMessageService {
*/
@Override
public List<MyInfoGroupResultDTO> queryMyGroupList(String staffId, String customerId) {
// 按照小组的创建时间升序,新创建在后面, 显示的人员时按照info_group_receivers 群成员表的主键升序
List<MyInfoGroupResultDTO> list = infoReceiversDao.selectMyGroupList(staffId, customerId,null);
if (CollectionUtils.isNotEmpty(list)) {
// 2、遍历每个群组,赋值工作人员姓名列表
@ -119,36 +122,59 @@ public class EpmetMessageServiceImpl implements EpmetMessageService {
*/
@Override
public InfoGroupDetailResDTO queryGroupDetail(InfoGroupDetailFormDTO formDTO) {
List<MyInfoGroupResultDTO> list = infoReceiversDao.selectMyGroupList(formDTO.getUserId(), formDTO.getCustomerId(),formDTO.getReceiverGroupId());
InfoGroupDetailResDTO resDTO = new InfoGroupDetailResDTO();
if (CollectionUtils.isNotEmpty(list)) {
// 2、遍历每个群组,赋值工作人员姓名列表
for (MyInfoGroupResultDTO group : list) {
resDTO.setReceiverGroupId(group.getReceiverGroupId());
resDTO.setName(group.getName());
List<StaffInfoCommonDTO> staffList=new ArrayList<>();
for (String userId : group.getStaffIdList()) {
//查询每个工作人员的基本信息
CustomerStaffInfoCacheResult staffInfoCache = customerStaffRedis.getStaffInfo(formDTO.getCustomerId(), userId);
if (null != staffInfoCache) {
StaffInfoCommonDTO staffInfo=new StaffInfoCommonDTO();
staffInfo.setStaffId(userId);
staffInfo.setStaffName(staffInfoCache.getRealName());
staffInfo.setGender(staffInfoCache.getGender().toString());
staffInfo.setHeadPhoto(StringUtils.isNotBlank(staffInfoCache.getHeadPhoto())?staffInfoCache.getHeadPhoto(): StrConstant.EPMETY_STR);
// 从网格添加的,显示 XXX-网格名
// 部门添加的,显示XXX-部门名
// 组织添加的,XXX组织名-XXX组织名
String showOrgName="todo";
//todo
staffInfo.setOrgName(showOrgName);
staffList.add(staffInfo);
}
InfoGroupDetailResDTO resDTO = infoReceiversDao.selectGroupInfo(formDTO.getReceiverGroupId());
if (null == resDTO) {
throw new RenException("info_receiver_group dosen't have record");
}
resDTO.setStaffList(new ArrayList<>());
//按照info_group_receivers 群成员表的主键升序
PageInfo<String> staffIds = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()).doSelectPageInfo(() -> infoReceiversDao.selectDistinctStaffIds(formDTO.getUserId(), formDTO.getCustomerId(), formDTO.getReceiverGroupId()));
if (CollectionUtils.isNotEmpty(staffIds.getList())) {
for (String userId : staffIds.getList()) {
//查询每个工作人员的基本信息
CustomerStaffInfoCacheResult staffInfoCache = customerStaffRedis.getStaffInfo(formDTO.getCustomerId(), userId);
if (null != staffInfoCache) {
StaffInfoCommonDTO staffInfo = new StaffInfoCommonDTO();
staffInfo.setStaffId(userId);
staffInfo.setStaffName(staffInfoCache.getRealName());
staffInfo.setGender(staffInfoCache.getGender().toString());
staffInfo.setHeadPhoto(StringUtils.isNotBlank(staffInfoCache.getHeadPhoto()) ? staffInfoCache.getHeadPhoto() : StrConstant.EPMETY_STR);
//todo
staffInfo.setOrgName("todo get");
resDTO.getStaffList().add(staffInfo);
}
resDTO.setStaffList(staffList);
}
}
return resDTO;
}
/**
* 发送消息-消息详情-回复列表分页查询
*
* @param formDTO
* @return com.epmet.dataaggre.dto.message.result.InfoReplyResDTO
* @author yinzuomei
* @date 2021/8/20 2:09 下午
*/
@Override
public InfoReplyResDTO queryInfoReplies(InfoRepliesFormDTO formDTO) {
InfoReplyResDTO result = new InfoReplyResDTO();
// 按照回复时间降序排列 ,新回复的在最上面
PageInfo<InfoReplyDetail> data = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()).doSelectPageInfo(() -> infoReceiversDao.selectListReply(formDTO.getInfoId()));
result.setTotal((int) data.getTotal());
for (InfoReplyDetail detail : data.getList()) {
//查询每个工作人员的基本信息
CustomerStaffInfoCache staffInfoCache = customerStaffRedis.getStaffInfo(formDTO.getCustomerId(), detail.getStaffId());
detail.setStaffName(staffInfoCache.getRealName());
detail.setGender(staffInfoCache.getGender().toString());
detail.setHeadPhoto(StringUtils.isNotBlank(staffInfoCache.getHeadPhoto()) ? staffInfoCache.getHeadPhoto() : StrConstant.EPMETY_STR);
//todo
detail.setOrgName("todo get");
}
result.setDataList(data.getList());
return result;
}
}

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

@ -2,6 +2,7 @@ package com.epmet.dataaggre.service.epmetuser;
import com.epmet.dataaggre.dto.epmetuser.form.*;
import com.epmet.dataaggre.dto.epmetuser.result.*;
import com.epmet.dataaggre.dto.govorg.form.OrgStaffListFormDTO;
import com.epmet.dataaggre.dto.govorg.result.GridStaffResultDTO;
import java.util.List;
@ -125,4 +126,10 @@ public interface EpmetUserService {
* @return
*/
CustomerStaffResultDTO getStaffInfo(String staffId);
/**
* @Description 分页查询工作人员基础信息角色信息组织人员单位领导角色人员在前部门人员部门领导角色人员在前网格人员网格长角色人员在前
* @author sun
*/
List<ListStaffResultDTO> getStaffInfoList(OrgStaffListFormDTO formDTO);
}

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

@ -19,6 +19,7 @@ import com.epmet.dataaggre.dto.epmetuser.result.*;
import com.epmet.dataaggre.dto.govorg.CustomerAgencyDTO;
import com.epmet.dataaggre.dto.govorg.CustomerDepartmentDTO;
import com.epmet.dataaggre.dto.govorg.CustomerGridDTO;
import com.epmet.dataaggre.dto.govorg.form.OrgStaffListFormDTO;
import com.epmet.dataaggre.dto.govorg.result.GridStaffResultDTO;
import com.epmet.dataaggre.dto.govorg.result.StaffOrgNameResultDTO;
import com.epmet.dataaggre.dto.govorg.result.StaffOrgRelationResultDTO;
@ -590,5 +591,18 @@ public class EpmetUserServiceImpl implements EpmetUserService {
return result;
}
/**
* @Description 分页查询工作人员基础信息角色信息组织人员单位领导角色人员在前部门人员部门领导角色人员在前网格人员网格长角色人员在前
* @author sun
*/
@Override
public List<ListStaffResultDTO> getStaffInfoList(OrgStaffListFormDTO formDTO) {
//分别查询不能类型下人员信息、角色信息,按需求排序
int pageIndex = (formDTO.getPageNo() - NumConstant.ONE) * formDTO.getPageSize();
formDTO.setPageNo(pageIndex);
List<ListStaffResultDTO> resultList = customerStaffDao.selectStaffList(formDTO);
return resultList;
}
}

2
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java

@ -90,7 +90,7 @@ public interface GovOrgService {
* @Description 通讯录组织/部门/网格下人员列表
* @author sun
*/
List<OrgStaffListResultDTO> staffList(OrgStaffListFormDTO formDTO);
OrgStaffListResultDTO staffList(OrgStaffListFormDTO formDTO);
/**
* @Param formDTO

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

@ -1,6 +1,7 @@
package com.epmet.dataaggre.service.govorg.impl;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.exception.EpmetErrorCode;
@ -8,12 +9,18 @@ import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.dataaggre.constant.DataSourceConstant;
import com.epmet.dataaggre.dao.govorg.*;
import com.epmet.dataaggre.dto.epmetuser.result.ListStaffResultDTO;
import com.epmet.dataaggre.dto.epmetuser.result.StaffRoleListResultDTO;
import com.epmet.dataaggre.dto.govorg.*;
import com.epmet.dataaggre.dto.govorg.form.*;
import com.epmet.dataaggre.dto.govorg.CustomerAgencyDTO;
import com.epmet.dataaggre.dto.govorg.CustomerDepartmentDTO;
import com.epmet.dataaggre.dto.govorg.CustomerGridDTO;
import com.epmet.dataaggre.dto.govorg.CustomerStaffAgencyDTO;
import com.epmet.dataaggre.dto.govorg.form.*;
import com.epmet.dataaggre.dto.govorg.form.NextAreaCodeFormDTO;
import com.epmet.dataaggre.dto.govorg.form.OrgStaffListFormDTO;
import com.epmet.dataaggre.dto.govorg.form.StaffDetailV2FormDTO;
import com.epmet.dataaggre.dto.govorg.form.SubOrgFormDTO;
import com.epmet.dataaggre.dto.govorg.result.*;
import com.epmet.dataaggre.dto.resigroup.result.OrgInfoCommonDTO;
import com.epmet.dataaggre.entity.govorg.CustomerAgencyEntity;
@ -378,8 +385,22 @@ public class GovOrgServiceImpl implements GovOrgService {
* @author sun
*/
@Override
public List<OrgStaffListResultDTO> staffList(OrgStaffListFormDTO formDTO) {
return null;
public OrgStaffListResultDTO staffList(OrgStaffListFormDTO formDTO) {
OrgStaffListResultDTO resultDTO = new OrgStaffListResultDTO();
//1.按类型查询组织、部门、网格下所有工作人员Id列表[需要按角色排序 所以这里不能分页]
List<String> staffIds = customerStaffAgencyDao.selectStaffList(formDTO.getOrgId(), formDTO.getOrgType());
if (org.springframework.util.CollectionUtils.isEmpty(staffIds)) {
return resultDTO;
}
formDTO.setStaffIds(staffIds);
//2.分页查询工作人员基础信息、角色信息【组织人员单位领导角色人员在前;部门人员部门领导角色人员在前;网格人员网格长角色人员在前】
List<ListStaffResultDTO> staffList = epmetUserService.getStaffInfoList(formDTO);
//3.封装数据并返回
resultDTO.setStaffCount(staffIds.size());
resultDTO.setStaffList((null == staffList ? new ArrayList<>() : staffList));
return resultDTO;
}
/**
@ -402,7 +423,17 @@ public class GovOrgServiceImpl implements GovOrgService {
*/
@Override
public SubOrgResultDTO getSubOrg(SubOrgFormDTO formDTO) {
return null;
//下级组织列表
List<OrgDTO> subAgencyList = customerStaffAgencyDao.selectSubAgency(formDTO.getAgencyId());
//下级部门列表
List<OrgDTO> departmentList = customerStaffDepartmentDao.selectDepartmentList(formDTO.getAgencyId());
//下级网格列表
List<OrgDTO> gridList = customerStaffGridDao.selectGridList(formDTO.getAgencyId());
SubOrgResultDTO result = new SubOrgResultDTO();
result.setSubAgencyList(subAgencyList);
result.setDepartmentList(departmentList);
result.setGridList(gridList);
return result;
}
/**

59
epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetmessage/InfoReceiversDao.xml

@ -23,13 +23,13 @@
left join info_group_receivers igr
on(irg.id=igr.info_receiver_group_id and igr.DEL_FLAG='0')
WHERE
irg.DEL_FLAG = '0'
AND irg.CREATE_STAFF_ID = #{staffId}
AND irg.CUSTOMER_ID = #{customerId}
<if test="null != receiverGroupId and receiverGroupId !=''">
and irg.id=#{receiverGroupId}
</if>
order by irg.CREATED_TIME asc
order by irg.CREATED_TIME asc,igr.id asc
</select>
<!-- 我创建的组内所有的人 -->
@ -48,5 +48,60 @@
<if test="null != receiverGroupId and receiverGroupId !=''">
AND irg.id =#{receiverGroupId}
</if>
order by igr.id asc
</select>
<!-- 根据小组id,查询群组基本信息 -->
<select id="selectGroupInfo" parameterType="java.lang.String" resultType="com.epmet.dataaggre.dto.message.result.InfoGroupDetailResDTO">
SELECT
irg.ID as receiverGroupId,
irg.`NAME` as name
FROM
info_receiver_group irg
where irg.id=#{receiverGroupId}
and irg.DEL_FLAG = '0'
</select>
<resultMap id="InfoReplyDetailMap" type="com.epmet.dataaggre.dto.message.result.InfoReplyDetail">
<result property="replyId" column="id"/>
<result property="replyTime" column="CREATED_TIME"/>
<result property="staffId" column="FROM_USER_ID"/>
<result property="content" column="content"></result>
<collection property="attachmentList" ofType="com.epmet.commons.tools.dto.form.FileCommonDTO" column="id" select="com.epmet.dataaggre.dao.epmetmessage.InfoReceiversDao.selectReplyAtt"/>
</resultMap>
<!-- 分页查询消息的回复列表 -->
<select id="selectListReply" parameterType="java.lang.String" resultMap="InfoReplyDetailMap">
SELECT
ir.id,
ir.CREATED_TIME,
ir.FROM_USER_ID,
( SELECT IFNULL( ipc.CONTENT, '' ) FROM info_reply_content ipc WHERE ipc.REPLY_TYPE = 'text' AND ipc.INFO_REPLY_ID = ir.id and ipc.DEL_FLAG='0') AS content
FROM
info_reply ir
WHERE
ir.DEL_FLAG = '0'
AND ir.INFO_ID = #{infoId}
ORDER BY
ir.CREATED_TIME DESC,
ir.id DESC
</select>
<select id="selectReplyAtt" parameterType="java.lang.String" resultType="com.epmet.commons.tools.dto.form.FileCommonDTO">
SELECT
m.ATTACHMENT_NAME as name,
m.ATTACHMENT_SIZE as size,
M.ATTACHMENT_FORMAT as format,
M.REPLY_TYPE as `type`,
m.CONTENT as url,
m.DURATION as duration
FROM
info_reply_content m
WHERE
m.DEL_FLAG = '0'
AND m.INFO_REPLY_ID = ''
AND m.REPLY_TYPE != 'text'
ORDER BY
m.SORT ASC
</select>
</mapper>

59
epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/CustomerStaffDao.xml

@ -51,4 +51,63 @@
AND real_name LIKE CONCAT('%', #{realName}, '%')
</select>
<select id="selectStaffList" resultMap="staffList">
SELECT
*
FROM
customer_staff
WHERE
del_flag = '0'
AND user_id IN (
<!-- 按人员Id列表查询,先查询每个人有的角色,然后把有单位领导角色的人排在前边,其他的在按创建时间降序 -->
SELECT
t.staff_id
FROM (
<!-- 里边的sql,尽管有去重,一个人有多个角色时,在里边sql查询出来的是一个人两条数据,is_first一个是0一个是1,所以外层需要在按人分组 -->
SELECT DISTINCT<!-- 没有这个去重会改变最终的结果顺序,至于为什么还不清楚 -->
sr.staff_id,
case when gsr.role_key =
<choose>
<when test="orgType != null orgType == 'agency' ">
'agency_leader'
</when>
<when test="orgType != null orgType == 'dept' ">
'dept_leader'
</when>
<otherwise>
'grid_manager'
</otherwise>
</choose>
then 1 else 0 end is_first<!-- 有单位领导角色的人赋值为1,没有的赋值为0 -->
FROM staff_role sr
INNER JOIN gov_staff_role gsr ON sr.role_id = gsr.id AND gsr.customer_id = #{customerId}
WHERE
sr.del_flag = '0'
AND sr.staff_id IN
(
<foreach collection="staffIds" item="staffId" separator=",">
#{staffId}
</foreach>
)
ORDER BY
gsr.role_key <![CDATA[<>]]>
<choose>
<when test="orgType != null orgType == 'agency' ">
'agency_leader'
</when>
<when test="orgType != null orgType == 'dept' ">
'dept_leader'
</when>
<otherwise>
'grid_manager'
</otherwise>
</choose>
, sr.created_time DESC<!-- 标注有点位领导角色的人不参与排序也就是默认拍在前边 -->
) t
GROUP BY t.staff_id
ORDER BY t.is_first <![CDATA[<>]]> 1
LIMIT #{pageNo}, #{pageSize}
)
</select>
</mapper>

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

@ -51,5 +51,69 @@
AND sg.USER_ID = #{staffId}
</select>
<select id="selectStaffList" resultType="java.lang.String">
<choose>
<when test="orgType != null orgType == 'dept' ">
SELECT
user_id
FROM
customer_staff_department
WHERE
del_flag = '0'
AND department_id = #{orgId}
ORDER BY
created_time ASC
</when>
<when test="orgType != null orgType == 'grid' ">
SELECT
user_id
FROM
customer_staff_grid
WHERE
del_flag = '0'
AND grid_id = #{orgId}
ORDER BY
created_time ASC
</when>
<otherwise>
SELECT
user_id
FROM
customer_staff_agency
WHERE
del_flag = '0'
AND agency_id = #{orgId}
ORDER BY
created_time ASC
</otherwise>
</choose>
</select>
<select id="selectSubAgency" resultType="com.epmet.dataaggre.dto.govorg.OrgDTO">
SELECT
ca.ID AS orgId,
ca.ORGANIZATION_NAME AS orgName,
"agency" AS orgType,
count( csa.USER_ID ) AS staffNum
FROM
customer_agency ca
LEFT JOIN (
SELECT
a.PIDS,
b.USER_ID
FROM
customer_agency a
INNER JOIN customer_staff_agency b ON b.AGENCY_ID = a.ID
AND b.DEL_FLAG = '0'
WHERE
a.DEL_FLAG = '0'
) csa ON csa.PIDS LIKE CONCAT( '%', ca.ID, '%' )
WHERE
ca.DEL_FLAG = '0'
AND ca.PID = #{agencyId}
GROUP BY
ca.ID
ORDER BY ca.CREATED_TIME ASC
</select>
</mapper>

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

@ -14,4 +14,23 @@
AND g.DEL_FLAG = '0'
AND sg.USER_ID = #{staffId}
</select>
<select id="selectDepartmentList" resultType="com.epmet.dataaggre.dto.govorg.OrgDTO">
SELECT
cd.ID AS orgId,
cd.DEPARTMENT_NAME AS orgName,
"dept" AS orgType,
count( csd.USER_ID ) AS staffNum
FROM
customer_department cd
LEFT JOIN customer_staff_department csd ON cd.ID = csd.DEPARTMENT_ID
AND csd.DEL_FLAG = '0'
WHERE
cd.DEL_FLAG = '0'
AND cd.AGENCY_ID = #{agencyId}
GROUP BY
cd.ID
ORDER BY
cd.CREATED_TIME ASC
</select>
</mapper>

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

@ -35,4 +35,21 @@
AND ca.id = #{agencyId}
</select>
<select id="selectGridList" resultType="com.epmet.dataaggre.dto.govorg.OrgDTO">
SELECT
cg.ID AS orgId,
cg.GRID_NAME AS orgName,
"grid" AS orgType,
count( csg.USER_ID ) AS staffNum
FROM
customer_grid cg
LEFT JOIN customer_staff_grid csg ON cg.ID = csg.GRID_ID
AND csg.DEL_FLAG = '0'
WHERE
cg.DEL_FLAG = 0
AND cg.PID = #{agencyId}
GROUP BY
cg.ID
ORDER BY cg.CREATED_TIME ASC
</select>
</mapper>
Loading…
Cancel
Save