From 1aaa3cbdd5647fb786c2273829de663dbf33128d Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 19 Aug 2021 14:54:06 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=91=E9=80=81=E6=B6=88=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../commons/tools/constant/NumConstant.java | 1 + .../java/com/epmet/dto/form/OrgCommonDTO.java | 17 ++ .../com/epmet/dto/form/SendInfoFormDTO.java | 68 ++++++ .../epmet/dto/result/SendInfoResultDTO.java | 17 ++ .../com/epmet/controller/InfoController.java | 26 +++ .../com/epmet/dao/InfoGroupReceiversDao.java | 13 +- .../com/epmet/entity/InfoProfileEntity.java | 5 +- .../com/epmet/entity/InfoReceiversEntity.java | 5 +- .../java/com/epmet/service/InfoService.java | 12 +- .../epmet/service/impl/InfoServiceImpl.java | 210 ++++++++++++++++++ .../mapper/InfoGroupReceiversDao.xml | 12 + .../com/epmet/dto/form/OrgStaffFormDTO.java | 28 +++ .../epmet/feign/GovOrgOpenFeignClient.java | 12 +- .../GovOrgOpenFeignClientFallback.java | 15 +- .../CustomerStaffAgencyController.java | 16 +- .../com/epmet/dao/CustomerStaffAgencyDao.java | 17 ++ .../service/CustomerStaffAgencyService.java | 16 +- .../impl/CustomerStaffAgencyServiceImpl.java | 24 +- .../mapper/CustomerStaffAgencyDao.xml | 50 +++++ .../epmet/dto/form/RoleStaffIdFormDTO.java | 24 ++ .../epmet/feign/EpmetUserOpenFeignClient.java | 12 + .../EpmetUserOpenFeignClientFallback.java | 15 +- .../epmet/controller/StaffRoleController.java | 26 ++- .../main/java/com/epmet/dao/StaffRoleDao.java | 13 +- .../com/epmet/service/StaffRoleService.java | 16 +- .../service/impl/StaffRoleServiceImpl.java | 25 ++- .../main/resources/mapper/StaffRoleDao.xml | 18 ++ 27 files changed, 669 insertions(+), 44 deletions(-) create mode 100644 epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/form/OrgCommonDTO.java create mode 100644 epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/form/SendInfoFormDTO.java create mode 100644 epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/result/SendInfoResultDTO.java create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/OrgStaffFormDTO.java create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/RoleStaffIdFormDTO.java diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/NumConstant.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/NumConstant.java index 2010b316d3..28a82836b1 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/NumConstant.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/NumConstant.java @@ -39,6 +39,7 @@ public interface NumConstant { int FIFTY = 50; int FIFTY_ONE = 51; int SIXTY = 60; + int NINETY_NINE=99; int ONE_HUNDRED = 100; int TWO_HUNDRED = 200; int FIVE_HUNDRED = 500; diff --git a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/form/OrgCommonDTO.java b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/form/OrgCommonDTO.java new file mode 100644 index 0000000000..612e02e8f4 --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/form/OrgCommonDTO.java @@ -0,0 +1,17 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 从架构通用dto + * @Author yinzuomei + * @Date 2021/8/19 10:00 上午 + */ +@Data +public class OrgCommonDTO implements Serializable { + private String orgId; + private String orgType; +} + diff --git a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/form/SendInfoFormDTO.java b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/form/SendInfoFormDTO.java new file mode 100644 index 0000000000..7fdbee71b8 --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/form/SendInfoFormDTO.java @@ -0,0 +1,68 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.dto.form.FileCommonDTO; +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; +import org.hibernate.validator.constraints.Length; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.List; +import java.util.Set; + +/** + * @Description 发送消息入参DTO + * @Author yinzuomei + * @Date 2021/8/19 9:52 上午 + */ +@Data +public class SendInfoFormDTO implements Serializable { + private static final long serialVersionUID = -3668230349576949684L; + + public interface AddUserInternalGroup { + } + + public interface AddUserShowGroup extends CustomerClientShowGroup { + } + + /** + * 消息内容,不能超过100,不可为空 + */ + @Length(min = 1, max = 1000, message = "消息内容不能为空", groups = AddUserShowGroup.class) + private String content; + /** + * 单独选择的人的userId集合 + */ + private Set staffIdList; + /** + * 按架构选择的,组织或者网格或者部门的集合 + */ + private Set orgList; + /** + * 按职责选择时,角色的id集合 + */ + private Set roleIdList; + /** + * 按群组选择时,群组的id集合 + */ + private Set groupIdList; + /** + * 附件列表 + */ + private List attachmentList; + + + //以下参数从token中获取 + /** + * 当前用户id + */ + @NotBlank(message = "userId不能为空",groups =AddUserInternalGroup.class) + private String userId; + + /** + * 当前客户id + */ + @NotBlank(message = "customerId不能为空",groups = AddUserInternalGroup.class) + private String customerId; +} + diff --git a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/result/SendInfoResultDTO.java b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/result/SendInfoResultDTO.java new file mode 100644 index 0000000000..70e0c0c371 --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/result/SendInfoResultDTO.java @@ -0,0 +1,17 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 发送消息返参DTO + * @Author yinzuomei + * @Date 2021/8/19 10:20 上午 + */ +@Data +public class SendInfoResultDTO implements Serializable { + private static final long serialVersionUID = 3339252317982375852L; + private String infoId; +} + diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/controller/InfoController.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/controller/InfoController.java index 7ef36643de..15ff4df649 100644 --- a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/controller/InfoController.java +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/controller/InfoController.java @@ -17,8 +17,16 @@ 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.SendInfoFormDTO; +import com.epmet.dto.result.SendInfoResultDTO; import com.epmet.service.InfoService; 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; @@ -37,5 +45,23 @@ public class InfoController { private InfoService infoService; + /** + * 发送消息 + * + * @param tokenDto + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei + * @date 2021/8/19 10:25 上午 + */ + @PostMapping("send") + public Result sendInfo(@LoginUser TokenDto tokenDto, @RequestBody SendInfoFormDTO formDTO) { + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setUserId(tokenDto.getUserId()); + ValidatorUtils.validateEntity(formDTO, SendInfoFormDTO.AddUserShowGroup.class, SendInfoFormDTO.AddUserInternalGroup.class); + return new Result().ok(infoService.sendInfo(formDTO)); + } + + } \ No newline at end of file diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/dao/InfoGroupReceiversDao.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/dao/InfoGroupReceiversDao.java index 17890976b6..5ddcf73e9c 100644 --- a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/dao/InfoGroupReceiversDao.java +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/dao/InfoGroupReceiversDao.java @@ -21,6 +21,8 @@ import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.entity.InfoGroupReceiversEntity; import org.apache.ibatis.annotations.Mapper; +import java.util.Set; + /** * 消息-群组成员关系表 * @@ -29,5 +31,14 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface InfoGroupReceiversDao extends BaseDao { - + + /** + * 群组里面的工作人员,去重 + * + * @param groupIdList + * @return java.util.Set + * @author yinzuomei + * @date 2021/8/19 10:51 上午 + */ + Set selectStaffIds(Set groupIdList); } \ No newline at end of file diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/entity/InfoProfileEntity.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/entity/InfoProfileEntity.java index 637ce6e125..74f662b523 100644 --- a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/entity/InfoProfileEntity.java +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/entity/InfoProfileEntity.java @@ -18,13 +18,10 @@ package com.epmet.entity; import com.baomidou.mybatisplus.annotation.TableName; - import com.epmet.commons.mybatis.entity.BaseEpmetEntity; import lombok.Data; import lombok.EqualsAndHashCode; -import java.util.Date; - /** * 消息概要表 * @@ -61,7 +58,7 @@ public class InfoProfileEntity extends BaseEpmetEntity { /** * 附件ID,第一个用于展示 */ - private String attId; + private String firstAttId; /** * 应读人数 diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/entity/InfoReceiversEntity.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/entity/InfoReceiversEntity.java index ea5275329e..ccf55c5dfb 100644 --- a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/entity/InfoReceiversEntity.java +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/entity/InfoReceiversEntity.java @@ -18,13 +18,10 @@ package com.epmet.entity; import com.baomidou.mybatisplus.annotation.TableName; - import com.epmet.commons.mybatis.entity.BaseEpmetEntity; import lombok.Data; import lombok.EqualsAndHashCode; -import java.util.Date; - /** * 消息接收人记录表 * @@ -56,6 +53,6 @@ public class InfoReceiversEntity extends BaseEpmetEntity { /** * 已读:1;未读:0 */ - private Integer readFlag; + private Boolean readFlag; } diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/InfoService.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/InfoService.java index 4fba1d245d..49395bb88f 100644 --- a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/InfoService.java +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/InfoService.java @@ -18,6 +18,8 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.dto.form.SendInfoFormDTO; +import com.epmet.dto.result.SendInfoResultDTO; import com.epmet.entity.InfoEntity; /** @@ -28,5 +30,13 @@ import com.epmet.entity.InfoEntity; */ public interface InfoService extends BaseService { - + /** + * 发送消息 + * + * @param formDTO + * @return com.epmet.dto.result.SendInfoResultDTO + * @author yinzuomei + * @date 2021/8/19 10:27 上午 + */ + SendInfoResultDTO sendInfo(SendInfoFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/InfoServiceImpl.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/InfoServiceImpl.java index 616ab65bac..7fc355d483 100644 --- a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/InfoServiceImpl.java +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/InfoServiceImpl.java @@ -17,13 +17,37 @@ package com.epmet.service.impl; +import com.alibaba.fastjson.JSON; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.constant.StrConstant; +import com.epmet.commons.tools.dto.form.FileCommonDTO; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.utils.Result; import com.epmet.dao.*; +import com.epmet.dto.form.OrgCommonDTO; +import com.epmet.dto.form.OrgStaffFormDTO; +import com.epmet.dto.form.RoleStaffIdFormDTO; +import com.epmet.dto.form.SendInfoFormDTO; +import com.epmet.dto.result.SendInfoResultDTO; +import com.epmet.entity.InfoAttEntity; import com.epmet.entity.InfoEntity; +import com.epmet.entity.InfoProfileEntity; +import com.epmet.entity.InfoReceiversEntity; +import com.epmet.feign.EpmetUserOpenFeignClient; +import com.epmet.feign.GovOrgOpenFeignClient; import com.epmet.service.InfoService; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Collections; +import java.util.LinkedHashSet; +import java.util.Set; /** * 消息主表 @@ -48,6 +72,192 @@ public class InfoServiceImpl extends BaseServiceImpl implem private InfoReplyDao infoReplyDao; @Autowired private InfoReplyContentDao infoReplyContentDao; + @Autowired + private EpmetUserOpenFeignClient epmetUserOpenFeignClient; + @Autowired + private GovOrgOpenFeignClient govOrgOpenFeignClient; + + /** + * 发送消息 + * + * @param formDTO + * @return com.epmet.dto.result.SendInfoResultDTO + * @author yinzuomei + * @date 2021/8/19 10:27 上午 + */ + @Transactional(rollbackFor = Exception.class) + @Override + public SendInfoResultDTO sendInfo(SendInfoFormDTO formDTO) { + //1、请先选择接收人 + if (CollectionUtils.isEmpty(formDTO.getStaffIdList()) && + CollectionUtils.isEmpty(formDTO.getOrgList()) && + CollectionUtils.isEmpty(formDTO.getRoleIdList()) + && CollectionUtils.isEmpty(formDTO.getGroupIdList())) { + throw new RenException(EpmetErrorCode.PLEASE_CHOOSE_RECEIVER.getCode(), EpmetErrorCode.PLEASE_CHOOSE_RECEIVER.getMsg()); + } + //2、选择的组织、角色、或者小组、是否有人呢?? + Set orgStaffIds=queryOrgStaffIds(formDTO.getCustomerId(),formDTO.getOrgList()); + Set roleStaffIds=queryRoleStaffIds(formDTO.getRoleIdList(),formDTO.getCustomerId()); + Set groupStaffIds = CollectionUtils.isNotEmpty(formDTO.getGroupIdList()) ? infoGroupReceiversDao.selectStaffIds(formDTO.getGroupIdList()) : Collections.EMPTY_SET; + log.info("群组选择的人:"+JSON.toJSONString(groupStaffIds,true)); + + //3、计算接收人: + Set totalReceiver=new LinkedHashSet();; + totalReceiver.addAll(formDTO.getStaffIdList()); + totalReceiver.addAll(orgStaffIds); + totalReceiver.addAll(roleStaffIds); + totalReceiver.addAll(groupStaffIds); + if(CollectionUtils.isEmpty(totalReceiver)){ + throw new RenException(EpmetErrorCode.PLEASE_CHOOSE_RECEIVER.getCode(), EpmetErrorCode.PLEASE_CHOOSE_RECEIVER.getMsg()); + } + + //4、插入主表 + InfoEntity infoEntity=constructInfoEntity(formDTO); + baseDao.insert(infoEntity); + //5、插入附件表 + String firstAttId= StrConstant.EPMETY_STR; + int sort=1; + for (FileCommonDTO att : formDTO.getAttachmentList()) { + InfoAttEntity infoAttEntity = new InfoAttEntity(); + infoAttEntity.setInfoId(infoEntity.getId()); + infoAttEntity.setCustomerId(formDTO.getCustomerId()); + infoAttEntity.setAttachmentFormat(att.getFormat()); + infoAttEntity.setAttachmentName(att.getName()); + infoAttEntity.setAttachmentType(att.getType()); + infoAttEntity.setAttachmentUrl(att.getUrl()); + infoAttEntity.setSort(sort); + infoAttDao.insert(infoAttEntity); + if(sort==1){ + firstAttId=infoAttEntity.getId(); + } + sort++; + } + //6、接收人 + totalReceiver.forEach(staffId->{ + InfoReceiversEntity infoReceiversEntity=new InfoReceiversEntity(); + infoReceiversEntity.setCustomerId(formDTO.getCustomerId()); + infoReceiversEntity.setInfoId(infoEntity.getId()); + infoReceiversEntity.setStaffId(staffId); + infoReceiversEntity.setReadFlag(false); + infoReceiversDao.insert(infoReceiversEntity); + + }); + //7、插入概要表 + InfoProfileEntity infoProfileEntity=new InfoProfileEntity(); + infoProfileEntity.setCustomerId(formDTO.getCustomerId()); + infoProfileEntity.setInfoId(infoEntity.getId()); + if(infoEntity.getContent().length()>NumConstant.ONE_HUNDRED){ + infoProfileEntity.setContent(StringUtils.substring(infoEntity.getContent(),NumConstant.NINETY_NINE)); + }else{ + infoProfileEntity.setContent(infoEntity.getContent()); + } + infoProfileEntity.setPublishStaffId(formDTO.getUserId()); + infoProfileEntity.setTotalReceiver(totalReceiver.size()); + infoProfileEntity.setFirstAttId(firstAttId); + infoProfileEntity.setReadTotal(NumConstant.ZERO); + infoProfileEntity.setUnReadReplyNum(NumConstant.ZERO); + infoProfileEntity.setCreatedTime(infoEntity.getCreatedTime()); + infoProfileEntity.setUpdatedTime(infoEntity.getUpdatedTime()); + infoProfileDao.insert(infoProfileEntity); + + //8、发送站内信 todo + SendInfoResultDTO resultDTO=new SendInfoResultDTO(); + return resultDTO; + } + + /** + * 查询架构里面的人 + * + * @param orgList + * @return java.util.Set + * @author yinzuomei + * @date 2021/8/19 11:34 上午 + */ + private Set queryOrgStaffIds(String customerId,Set orgList) { + if (CollectionUtils.isEmpty(orgList)) { + return Collections.EMPTY_SET; + } + //如果我选择的是 东阿镇,是发送给本级及下级所有工作人员 + OrgStaffFormDTO orgStaffFormDTO=new OrgStaffFormDTO(); + orgStaffFormDTO.setCustomerId(customerId); + for(OrgCommonDTO org:orgList){ + if("grid".equals(org.getOrgType())){ + orgStaffFormDTO.getGridIds().add(org.getOrgId()); + }else if("agency".equals(org.getOrgType())){ + orgStaffFormDTO.getAgencyIds().add(org.getOrgId()); + }else if("dept".equals(org.getOrgType())){ + orgStaffFormDTO.getDeptIds().add(org.getOrgId()); + } + } + Result> result=govOrgOpenFeignClient.queryOrgStaffs(orgStaffFormDTO); + if (!result.success()) { + throw new RenException("根据组织查询工作人员异常"); + } + if(CollectionUtils.isEmpty(result.getData())){ + log.info("已选择的架构里没有工作人员"); + return Collections.EMPTY_SET; + } + return result.getData(); + } + + /** + * 查询角色里面的人 + * + * @param roleIdList + * @param customerId + * @return java.util.Set + * @author yinzuomei + * @date 2021/8/19 11:34 上午 + */ + private Set queryRoleStaffIds(Set roleIdList, String customerId) { + if (CollectionUtils.isEmpty(roleIdList)) { + return Collections.EMPTY_SET; + } + RoleStaffIdFormDTO formDTO = new RoleStaffIdFormDTO(); + formDTO.setCustomerId(customerId); + formDTO.setRoleIds(roleIdList); + Result> result = epmetUserOpenFeignClient.queryRoleStaffIds(formDTO); + if (!result.success()) { + throw new RenException("根据角色查询工作人员异常"); + } + if(CollectionUtils.isEmpty(result.getData())){ + log.info("角色下没有工作人员"); + return Collections.EMPTY_SET; + } + return result.getData(); + } + + /** + * 构造主表 + * + * @param formDTO + * @return com.epmet.entity.InfoEntity + * @author yinzuomei + * @date 2021/8/19 10:38 上午 + */ + private InfoEntity constructInfoEntity(SendInfoFormDTO formDTO) { + InfoEntity infoEntity=new InfoEntity(); + infoEntity.setContent(formDTO.getContent()); + infoEntity.setPublishStaffId(formDTO.getUserId()); + infoEntity.setCustomerId(formDTO.getCustomerId()); + return infoEntity; + } + + + + + + + + + + + + + + + + } \ No newline at end of file diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/resources/mapper/InfoGroupReceiversDao.xml b/epmet-module/epmet-message/epmet-message-server/src/main/resources/mapper/InfoGroupReceiversDao.xml index 19cdf876fd..d8aefa0520 100644 --- a/epmet-module/epmet-message/epmet-message-server/src/main/resources/mapper/InfoGroupReceiversDao.xml +++ b/epmet-module/epmet-message/epmet-message-server/src/main/resources/mapper/InfoGroupReceiversDao.xml @@ -3,6 +3,18 @@ + + diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/OrgStaffFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/OrgStaffFormDTO.java new file mode 100644 index 0000000000..21755b9c43 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/OrgStaffFormDTO.java @@ -0,0 +1,28 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.constant.StrConstant; +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * @Description 按架构选择了那些人? 查询入参 + * @Author yinzuomei + * @Date 2021/8/19 1:37 下午 + */ +@Data +public class OrgStaffFormDTO implements Serializable { + private List agencyIds; + private List deptIds; + private List gridIds; + private String customerId; + public OrgStaffFormDTO(){ + this.agencyIds=new ArrayList<>(); + this.deptIds=new ArrayList<>(); + this.gridIds=new ArrayList<>(); + this.customerId= StrConstant.EPMETY_STR; + } +} + diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java index 7237abcc5b..e6af374fe2 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java @@ -7,13 +7,13 @@ import com.epmet.dto.CustomerGridDTO; import com.epmet.dto.CustomerPartyBranchDTO; import com.epmet.dto.form.*; import com.epmet.dto.result.*; -import com.epmet.feign.fallback.GovOrgOpenFeignClientFallback; import com.epmet.feign.fallback.GovOrgOpenFeignClientFallbackFactory; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.http.MediaType; import org.springframework.web.bind.annotation.*; import java.util.List; +import java.util.Set; /** * 本服务对外开放的API,其他服务通过引用此client调用该服务 @@ -407,4 +407,14 @@ public interface GovOrgOpenFeignClient { @PostMapping("/gov/org/customergrid/selectorgsbyuserid") Result> selectOrgsByUserId(@RequestParam("userId")String userId); + /** + * 架构里面的人 + * + * @param formDTO + * @return com.epmet.commons.tools.utils.Result> + * @author yinzuomei + * @date 2021/8/19 2:27 下午 + */ + @PostMapping("/gov/org/customerstaffagency/queryOrgStaffs") + Result> queryOrgStaffs(@RequestBody OrgStaffFormDTO formDTO); } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java index 91f9052c84..b517c20344 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java @@ -9,9 +9,9 @@ import com.epmet.dto.CustomerPartyBranchDTO; import com.epmet.dto.form.*; import com.epmet.dto.result.*; import com.epmet.feign.GovOrgOpenFeignClient; -import org.springframework.stereotype.Component; import java.util.List; +import java.util.Set; /** * 本服务对外开放的API,其他服务通过引用此client调用该服务 @@ -235,6 +235,19 @@ public class GovOrgOpenFeignClientFallback implements GovOrgOpenFeignClient { return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "selectOrgsByUserId", userId); } + /** + * 架构里面的人 + * + * @param formDTO + * @return com.epmet.commons.tools.utils.Result> + * @author yinzuomei + * @date 2021/8/19 2:27 下午 + */ + @Override + public Result> queryOrgStaffs(OrgStaffFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "queryOrgStaffs", formDTO); + } + @Override public Result selectPidsByGridId(String gridId) { return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "selectPidsByGridId", gridId); diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerStaffAgencyController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerStaffAgencyController.java index ad965efef7..0339163bf3 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerStaffAgencyController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerStaffAgencyController.java @@ -23,10 +23,11 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.AssertUtils; import com.epmet.commons.tools.validator.ValidatorUtils; 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.commons.tools.validator.group.UpdateGroup; import com.epmet.dto.CustomerStaffAgencyDTO; import com.epmet.dto.form.AgencyIdFormDTO; +import com.epmet.dto.form.OrgStaffFormDTO; import com.epmet.dto.result.LatestCustomerResultDTO; import com.epmet.excel.CustomerStaffAgencyExcel; import com.epmet.service.CustomerStaffAgencyService; @@ -36,6 +37,7 @@ import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletResponse; import java.util.List; import java.util.Map; +import java.util.Set; /** @@ -116,4 +118,16 @@ public class CustomerStaffAgencyController { return new Result>().ok(customerStaffAgencyService.getAgencyStaffs(agencyIdFormDTO)); } + /** + * 按组织架构选择发消息时, 查询出组织|部门|网格的人,去重 + * + * @param formDTO + * @return com.epmet.commons.tools.utils.Result> + * @author yinzuomei + * @date 2021/8/19 1:40 下午 + */ + @PostMapping("queryOrgStaffs") + public Result> queryOrgStaffs(@RequestBody OrgStaffFormDTO formDTO) { + return new Result>().ok(customerStaffAgencyService.queryOrgStaffs(formDTO)); + } } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffAgencyDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffAgencyDao.java index 864603ee07..c1a7f52efa 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffAgencyDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffAgencyDao.java @@ -27,6 +27,7 @@ import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import java.util.List; +import java.util.Set; /** * 人员-机关单位关系表 @@ -116,4 +117,20 @@ public interface CustomerStaffAgencyDao extends BaseDao + * @author yinzuomei + * @date 2021/8/19 2:01 下午 + */ + Set selectAgencyStaffs(@Param("customerId")String customerId, + @Param("agencyIds")List agencyIds); + + Set selectDeptStaffs(@Param("customerId")String customerId, @Param("deptIds")List deptIds); + + Set selectGridStaffs(@Param("customerId")String customerId, @Param("gridIds")List gridids); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerStaffAgencyService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerStaffAgencyService.java index 8f6f47dfdb..5ac6a78696 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerStaffAgencyService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerStaffAgencyService.java @@ -21,16 +21,14 @@ 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.AgencyIdFormDTO; -import com.epmet.dto.form.CommonDepartmentFormDTO; -import com.epmet.dto.form.StaffsInAgencyFromDTO; -import com.epmet.dto.form.CommonGridIdFormDTO; +import com.epmet.dto.form.*; import com.epmet.dto.result.CommonStaffInfoResultDTO; import com.epmet.dto.result.LatestCustomerResultDTO; import com.epmet.entity.CustomerStaffAgencyEntity; import java.util.List; import java.util.Map; +import java.util.Set; /** * 人员-机关单位关系表 @@ -151,4 +149,14 @@ public interface CustomerStaffAgencyService extends BaseService getAgencyStaffs(AgencyIdFormDTO agencyIdFormDTO); + + /** + * 按组织架构选择发消息时, 查询出组织|部门|网格的人,去重 + * + * @param formDTO + * @return java.util.Set + * @author yinzuomei + * @date 2021/8/19 1:41 下午 + */ + Set queryOrgStaffs(OrgStaffFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffAgencyServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffAgencyServiceImpl.java index 7b6a784a83..c30abd4025 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffAgencyServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffAgencyServiceImpl.java @@ -44,10 +44,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; +import java.util.*; /** * 人员-机关单位关系表 @@ -234,4 +231,23 @@ public class CustomerStaffAgencyServiceImpl extends BaseServiceImpl + * @author yinzuomei + * @date 2021/8/19 1:41 下午 + */ + @Override + public Set queryOrgStaffs(OrgStaffFormDTO formDTO) { + Set agencyUserIds=customerStaffAgencyDao.selectAgencyStaffs(formDTO.getCustomerId(),formDTO.getAgencyIds()); + Set deptUserIds=customerStaffAgencyDao.selectDeptStaffs(formDTO.getCustomerId(),formDTO.getDeptIds()); + Set gridUserIds=customerStaffAgencyDao.selectGridStaffs(formDTO.getCustomerId(),formDTO.getGridIds()); + Set result=new LinkedHashSet(); + result.addAll(agencyUserIds); + result.addAll(deptUserIds); + result.addAll(gridUserIds); + return result; + } } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffAgencyDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffAgencyDao.xml index b7559668a8..0235999cb4 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffAgencyDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffAgencyDao.xml @@ -162,4 +162,54 @@ WHERE sa.DEL_FLAG = 0 AND sa.USER_ID = #{staffId} + + + + + + + \ No newline at end of file diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/RoleStaffIdFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/RoleStaffIdFormDTO.java new file mode 100644 index 0000000000..7973e65bd1 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/RoleStaffIdFormDTO.java @@ -0,0 +1,24 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotEmpty; +import java.io.Serializable; +import java.util.Set; + +/** + * @Description 查询角色对应的工作人员集合 去重 + * @Author yinzuomei + * @Date 2021/8/19 11:19 上午 + */ +@Data +public class RoleStaffIdFormDTO implements Serializable { + public interface AddUserInternalGroup { + } + @NotBlank(message = "客户id不能为空",groups = AddUserInternalGroup.class) + private String customerId; + @NotEmpty(message = "角色id不能为空",groups = AddUserInternalGroup.class) + private Set roleIds; +} + diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java index 059ced9e35..89c8a2ac36 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java @@ -14,6 +14,7 @@ import org.springframework.web.bind.annotation.*; import java.util.List; import java.util.Map; +import java.util.Set; /** * 本服务对外开放的API,其他服务通过引用此client调用该服务 @@ -614,4 +615,15 @@ public interface EpmetUserOpenFeignClient { */ @PostMapping("/epmetuser/badge/list-users-by-badge") Result> listUsersByBadge(ListUserByBadgeFormDTO input); + + /** + * 根据角色,查询里面的人,去重 + * + * @param formDTO + * @return com.epmet.commons.tools.utils.Result> + * @author yinzuomei + * @date 2021/8/19 11:09 上午 + */ + @PostMapping("/epmetuser/staffrole/queryRoleStaffIds") + Result> queryRoleStaffIds(@RequestBody RoleStaffIdFormDTO formDTO); } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java index 31c82beb05..01b2b63d57 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java @@ -8,10 +8,10 @@ import com.epmet.dto.*; import com.epmet.dto.form.*; import com.epmet.dto.result.*; import com.epmet.feign.EpmetUserOpenFeignClient; -import org.springframework.stereotype.Component; import java.util.List; import java.util.Map; +import java.util.Set; /** * 本服务对外开放的API,其他服务通过引用此client调用该服务 @@ -432,4 +432,17 @@ public class EpmetUserOpenFeignClientFallback implements EpmetUserOpenFeignClien public Result> listUsersByBadge(ListUserByBadgeFormDTO input) { return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "listUsersByBadge", input); } + + /** + * 根据角色,查询里面的人,去重 + * + * @param formDTO + * @return com.epmet.commons.tools.utils.Result> + * @author yinzuomei + * @date 2021/8/19 11:09 上午 + */ + @Override + public Result> queryRoleStaffIds(RoleStaffIdFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "queryRoleStaffIds", formDTO); + } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffRoleController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffRoleController.java index 969eae7e66..949c104710 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffRoleController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffRoleController.java @@ -7,24 +7,16 @@ import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.CustomerAgencyUserRoleDTO; import com.epmet.dto.GovStaffRoleDTO; import com.epmet.dto.StaffRoleDTO; -import com.epmet.dto.form.CommonUserFormDTO; -import com.epmet.dto.form.CustomerRoleFormDTO; -import com.epmet.dto.form.RolesUsersListFormDTO; -import com.epmet.dto.form.StaffRoleFormDTO; -import com.epmet.dto.result.*; import com.epmet.dto.form.*; +import com.epmet.dto.result.*; import com.epmet.entity.GovStaffRoleEntity; import com.epmet.service.GovStaffRoleService; import com.epmet.service.StaffRoleService; -import oracle.jdbc.proxy.annotation.Post; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.util.*; /** * @return 工作人员相关api @@ -214,4 +206,18 @@ public class StaffRoleController { ValidatorUtils.validateEntity(formDTO, CustomerAgencyUserRoleFormDTO.CustomerAgencyUserRoleForm.class); return new Result().ok(staffRoleService.getUserRoles(formDTO)); } + + /** + * 根据角色,查询里面的人,去重 + * + * @param formDTO + * @return com.epmet.commons.tools.utils.Result> + * @author yinzuomei + * @date 2021/8/19 11:14 上午 + */ + @PostMapping("queryRoleStaffIds") + Result> queryRoleStaffIds(@RequestBody RoleStaffIdFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO,RoleStaffIdFormDTO.AddUserInternalGroup.class); + return new Result>().ok(staffRoleService.queryRoleStaffIds(formDTO)); + } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffRoleDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffRoleDao.java index da289c6308..876634717b 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffRoleDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffRoleDao.java @@ -17,7 +17,6 @@ package com.epmet.dao; -import com.epmet.commons.mybatis.annotation.DataFilter; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.commons.mybatis.entity.DataScope; import com.epmet.dto.StaffRoleDTO; @@ -30,6 +29,7 @@ import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import java.util.List; +import java.util.Set; /** * 工作人员-角色关系表 @@ -152,4 +152,15 @@ public interface StaffRoleDao extends BaseDao { * @date 2021/6/15 5:54 下午 */ List selectAllUserRoles(); + + /** + * 根据角色,查询里面的人,去重 + * + * @param roleIds + * @param customerId + * @return java.util.Set + * @author yinzuomei + * @date 2021/8/19 11:16 上午 + */ + Set selectRoleStaffIds(@Param("customerId") String customerId,@Param("roleIds") Set roleIds); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffRoleService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffRoleService.java index b34f90d294..00879f88a4 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffRoleService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffRoleService.java @@ -23,15 +23,13 @@ import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.CustomerAgencyUserRoleDTO; import com.epmet.dto.StaffRoleDTO; -import com.epmet.dto.form.CommonUserFormDTO; -import com.epmet.dto.form.CustomerAgencyUserRoleFormDTO; -import com.epmet.dto.form.CustomerStaffRoleListFormDTO; -import com.epmet.dto.form.RolesUsersListFormDTO; +import com.epmet.dto.form.*; import com.epmet.dto.result.*; import com.epmet.entity.StaffRoleEntity; import java.util.List; import java.util.Map; +import java.util.Set; /** * 工作人员-角色关系表 @@ -182,4 +180,14 @@ public interface StaffRoleService extends BaseService { * @date 2021/6/15 2:05 下午 */ void repairStaffRoleCache(); + + /** + * 根据角色,查询里面的人,去重 + * + * @param formDTO + * @return java.util.Set + * @author yinzuomei + * @date 2021/8/19 11:14 上午 + */ + Set queryRoleStaffIds(RoleStaffIdFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffRoleServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffRoleServiceImpl.java index 51f5e189b6..a574ba7b45 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffRoleServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffRoleServiceImpl.java @@ -17,25 +17,20 @@ package com.epmet.service.impl; -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.entity.DataScope; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; 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; import com.epmet.commons.tools.utils.Result; import com.epmet.dao.GovStaffRoleTemplateDao; import com.epmet.dao.StaffRoleDao; import com.epmet.dto.CustomerAgencyUserRoleDTO; import com.epmet.dto.StaffRoleDTO; -import com.epmet.dto.form.CommonUserFormDTO; -import com.epmet.dto.form.CustomerAgencyUserRoleFormDTO; -import com.epmet.dto.form.CustomerStaffRoleListFormDTO; -import com.epmet.dto.form.RolesUsersListFormDTO; +import com.epmet.dto.form.*; import com.epmet.dto.result.*; import com.epmet.entity.StaffRoleEntity; import com.epmet.redis.StaffRoleRedis; @@ -267,4 +262,20 @@ public class StaffRoleServiceImpl extends BaseServiceImpl + * @author yinzuomei + * @date 2021/8/19 11:14 上午 + */ + @Override + public Set queryRoleStaffIds(RoleStaffIdFormDTO formDTO) { + if(CollectionUtils.isEmpty(formDTO.getRoleIds())){ + return Collections.EMPTY_SET; + } + return baseDao.selectRoleStaffIds(formDTO.getCustomerId(),formDTO.getRoleIds()); + } + } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/StaffRoleDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/StaffRoleDao.xml index 98328339b5..05ce74c660 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/StaffRoleDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/StaffRoleDao.xml @@ -235,4 +235,22 @@ LEFT JOIN gov_staff_role gsr ON gsr.ID = sr.ROLE_ID AND gsr.DEL_FLAG = 0 WHERE sr.DEL_FLAG = 0 + + +