diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/CustomerStaffInfoCacheResult.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/CustomerStaffInfoCacheResult.java index 8359f4d020..ef027fc105 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/CustomerStaffInfoCacheResult.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/CustomerStaffInfoCacheResult.java @@ -26,6 +26,11 @@ public class CustomerStaffInfoCacheResult implements Serializable { */ private String agencyName; + /** + * 2级组织名称 根据添加的来源返回(xx组织-组织/网格/部门) + */ + private String twoOrgName; + /** * 工作人员ID */ @@ -51,6 +56,12 @@ public class CustomerStaffInfoCacheResult implements Serializable { */ private String headPhoto; + /** + * 工作人员是从哪中组织类型添加的 3个值:agency,grid,dept + * @see com.epmet.commons.tools.enums.OrgTypeEnum + */ + private String fromOrgType; + /** * 角色map key为角色key value 为角色名称 */ diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java index 8f669a3656..c3edf2dcbc 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java @@ -498,6 +498,6 @@ public class RedisKeys { * @return */ public static String getCustomerStaffInfoKey(String customerId, String staffId) { - return rootPrefix.concat(customerId).concat(StrConstant.COLON).concat(staffId); + return rootPrefix.concat("gov:staff").concat(customerId).concat(StrConstant.COLON).concat(staffId); } } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/CustomerStaffRedis.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/CustomerStaffRedis.java index 362294b66b..e8e491a302 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/CustomerStaffRedis.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/CustomerStaffRedis.java @@ -2,6 +2,7 @@ package com.epmet.commons.tools.redis.common; import cn.hutool.core.bean.BeanUtil; import com.alibaba.fastjson.JSON; +import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.feign.CommonAggFeignClient; import com.epmet.commons.tools.redis.RedisKeys; @@ -11,8 +12,8 @@ import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; +import org.jetbrains.annotations.Nullable; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; import org.springframework.util.CollectionUtils; import java.util.Map; @@ -24,17 +25,19 @@ import java.util.Map; * @since v1.0.0 2020-04-22 */ @Slf4j -@Component public class CustomerStaffRedis { @Autowired private RedisUtils redisUtils; @Autowired private CommonAggFeignClient commonAggFeignClient; + private static final String ROLE_MAP_KEY = "roleMap"; //@PostConstruct public void init() { - CustomerStaffInfoCache role = this.getStaffInfo("45687aa479955f9d06204d415238f7cc", "9e37adcce6472152e6508a19d3683e02"); + CustomerStaffInfoCacheResult role = this.getStaffInfo("45687aa479955f9d06204d415238f7cc", "9e37adcce6472152e6508a19d3683e02"); + role = this.getStaffInfo("45687aa479955f9d06204d415238f7cc", "7f694a66efe60a47c2114875f310248a"); System.out.println(JSON.toJSONString(role)); + System.out.println(JSON.toJSONString(this.getStaffRoleMap("45687aa479955f9d06204d415238f7cc", "7f694a66efe60a47c2114875f310248a"))); } /** @@ -47,25 +50,55 @@ public class CustomerStaffRedis { * @date 2021/8/19 10:29 下午 * @remark 此方法仅用于 获取某个工作人员的信息,不用于获取客户下所有工作人员信息 */ - public CustomerStaffInfoCache getStaffInfo(String customerId, String staffId) { + public CustomerStaffInfoCacheResult getStaffInfo(String customerId, String staffId) { String key = RedisKeys.getCustomerStaffInfoKey(customerId, staffId); Map roleMap = redisUtils.hGetAll(key); if (!CollectionUtils.isEmpty(roleMap)) { - return ConvertUtils.mapToEntity(roleMap, CustomerStaffInfoCache.class); + return ConvertUtils.mapToEntity(roleMap, CustomerStaffInfoCacheResult.class); } + CustomerStaffInfoCache resultData = reloadStaffCache(staffId, key); + if (resultData == null) return null; + + return ConvertUtils.sourceToTarget(resultData,CustomerStaffInfoCacheResult.class); + } + + @Nullable + private CustomerStaffInfoCache reloadStaffCache(String staffId, String key) { Result staffResult = commonAggFeignClient.getStaffInfo(staffId); if (staffResult == null || !staffResult.success()) { throw new RenException("获取工作人员信息失败"); } - if (staffResult.getData() == null) { + CustomerStaffInfoCache resultData = staffResult.getData(); + if (resultData == null) { log.warn("getStaffInfo staff is null,staffId:{}", staffId); return null; } - Map map = BeanUtil.beanToMap(staffResult.getData(), false, true); + + Map map = BeanUtil.beanToMap(resultData, false, true); redisUtils.hMSet(key, map); + return resultData; + } + + /** + * desc: 根据工作人员Id 获取某工作人员角色map信息 + * + * @param customerId + * @param staffId + * @return com.epmet.commons.tools.redis.common.bean.CustomerStaffInfoCache + * @author LiuJanJun + * @date 2021/8/19 10:29 下午 + * @remark 此方法仅用于 获取某个工作人员的信息,不用于获取客户下所有工作人员信息 + */ + public Map getStaffRoleMap(String customerId, String staffId) { + String key = RedisKeys.getCustomerStaffInfoKey(customerId, staffId); + Map roleMap = (Map) redisUtils.hGet(key,ROLE_MAP_KEY); + if (!CollectionUtils.isEmpty(roleMap)) { + return roleMap; + } - return staffResult.getData(); + reloadStaffCache(staffId, key); + return getStaffRoleMap(customerId,staffId); } /** diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/CustomerStaffInfoCache.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/CustomerStaffInfoCache.java index 4ea3abe7dc..577bdf3910 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/CustomerStaffInfoCache.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/CustomerStaffInfoCache.java @@ -8,6 +8,7 @@ import java.util.List; import java.util.Map; /** + * desc:客户工作人员缓存实体类 * @Author zxc * @DateTime 2021/6/15 10:00 上午 * @DESC @@ -15,7 +16,7 @@ import java.util.Map; @Data public class CustomerStaffInfoCache implements Serializable { - private static final long serialVersionUID = -4078910245000135305L; + private static final long serialVersionUID = 4627478063125903910L; /** * 工作人员所属组织ID */ @@ -26,6 +27,11 @@ public class CustomerStaffInfoCache implements Serializable { */ private String agencyName; + /** + * 2级组织名称 根据添加的来源返回(xx组织-组织/网格/部门) + */ + private String twoOrgName; + /** * 工作人员ID */ @@ -62,6 +68,11 @@ public class CustomerStaffInfoCache implements Serializable { */ private String fromOrgType; + /** + * 工作人员是从哪中组织添加的 组织Id + */ + private String fromOrgId; + /** * 所属组织的上级组织 */ diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/CustomerStaffResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/CustomerStaffResultDTO.java index b3281cbad7..b12ea53fec 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/CustomerStaffResultDTO.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/CustomerStaffResultDTO.java @@ -57,6 +57,11 @@ public class CustomerStaffResultDTO implements Serializable { */ private String fromOrgType; + /** + * 工作人员是从哪中组织添加的 组织Id + */ + private String fromOrgId; + /** * 角色map key为角色key value 为角色名称 */ @@ -77,4 +82,10 @@ public class CustomerStaffResultDTO implements Serializable { */ private List deptList; + //特殊处理的 属性 start ========== + /** + * 2级组织名称 根据添加的来源返回(xx组织-组织/网格/部门) + */ + private String twoOrgName; + } diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/RoleUsersResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/RoleUsersResultDTO.java index 250c4025bd..ab1b966ac0 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/RoleUsersResultDTO.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/RoleUsersResultDTO.java @@ -20,6 +20,6 @@ public class RoleUsersResultDTO implements Serializable { private String name; private String headPhoto; private String orgName; - private String gender; + private Integer gender; private List roles; } diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/ReceiverDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/ReceiverDTO.java index feff8e28a2..76bc2f957b 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/ReceiverDTO.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/ReceiverDTO.java @@ -35,5 +35,5 @@ public class ReceiverDTO implements Serializable { /** * 1男2女0未知 */ - private String gender; + private Integer gender; } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/CustomerStaffRedis.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/result/StaffOrgRelationResultDTO.java similarity index 58% rename from epmet-user/epmet-user-server/src/main/java/com/epmet/redis/CustomerStaffRedis.java rename to epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/result/StaffOrgRelationResultDTO.java index 0fb5b1b369..6ede0cb39e 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/CustomerStaffRedis.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/result/StaffOrgRelationResultDTO.java @@ -15,33 +15,37 @@ * along with this program. If not, see . */ -package com.epmet.redis; +package com.epmet.dataaggre.dto.govorg.result; + +import lombok.Data; + +import java.io.Serializable; -import com.epmet.commons.tools.redis.RedisUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; /** - * 政府工作人员表 + * 工作人员注册组织关系表 * * @author generator generator@elink-cn.com - * @since v1.0.0 2020-04-18 + * @since v1.0.0 2021-08-19 */ -@Component -public class CustomerStaffRedis { - @Autowired - private RedisUtils redisUtils; - - public void delete(Object[] ids) { +@Data +public class StaffOrgRelationResultDTO implements Serializable { - } + private static final long serialVersionUID = 1L; + /** + * 工作人员Id + */ + private String staffId; - public void set(){ + /** + * 工作人员添加入口Id(agencyId;deptId;gridId) + */ + private String orgId; - } + /** + * 工作人员添加入口类型(组织:agency;部门:dept;网格:gridId) + */ + private String orgType; - public String get(String id){ - return null; - } -} \ No newline at end of file +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/message/form/InfoRepliesFormDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/message/form/InfoRepliesFormDTO.java new file mode 100644 index 0000000000..2544e2ad63 --- /dev/null +++ b/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; +} + diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/message/result/InfoReplyDetail.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/message/result/InfoReplyDetail.java new file mode 100644 index 0000000000..2a4bde6fc2 --- /dev/null +++ b/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 attachmentList; +} + diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/message/result/InfoReplyResDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/message/result/InfoReplyResDTO.java new file mode 100644 index 0000000000..a30090acb1 --- /dev/null +++ b/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 dataList; +} + diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/InfoController.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/InfoController.java index 8df2d52213..35078415c2 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/InfoController.java +++ b/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().ok(epmetMessageService.queryGroupDetail(formDTO)); } + + /** + * 发送消息-消息详情-回复列表(分页查询) + * + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei + * @date 2021/8/20 2:09 下午 + */ + @PostMapping("replylist") + public Result queryInfoReplies(@LoginUser TokenDto tokenDto,@RequestBody InfoRepliesFormDTO formDTO){ + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setUserId(tokenDto.getUserId()); + ValidatorUtils.validateEntity(formDTO, PageFormDTO.AddUserInternalGroup.class); + return new Result().ok(epmetMessageService.queryInfoReplies(formDTO)); + } } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetmessage/InfoReceiversDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetmessage/InfoReceiversDao.java index 194410bce2..c0d8b4c86d 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetmessage/InfoReceiversDao.java +++ b/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 { List 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 + * @author yinzuomei + * @date 2021/8/20 2:20 下午 + */ + List selectListReply(String infoId); + + /** + * 回复附件 + * + * @param replyId + * @return java.util.List + * @author yinzuomei + * @date 2021/8/20 2:31 下午 + */ + List selectReplyAtt(String replyId); } \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerAgencyDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerAgencyDao.java index 5d343f2616..544f7387dd 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerAgencyDao.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerAgencyDao.java @@ -21,6 +21,7 @@ import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dataaggre.dto.govorg.result.AgencyGridResultDTO; import com.epmet.dataaggre.dto.govorg.result.StaffAgencyGridListResultDTO; import com.epmet.dataaggre.dto.govorg.result.StaffOrgNameResultDTO; +import com.epmet.dataaggre.dto.govorg.result.StaffOrgRelationResultDTO; import com.epmet.dataaggre.entity.govorg.CustomerAgencyEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -72,5 +73,5 @@ public interface CustomerAgencyDao extends BaseDao { * @param staffId * @return */ - String getStaffFromOrgType(@Param("staffId") String staffId); + StaffOrgRelationResultDTO getStaffFromOrgType(@Param("staffId") String staffId); } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerStaffAgencyDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerStaffAgencyDao.java index 941f080bf2..06869bcfdb 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerStaffAgencyDao.java +++ b/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; @@ -61,4 +62,13 @@ public interface CustomerStaffAgencyDao extends BaseDao selectStaffList(@Param("orgId") String orgId, @Param("orgType") String orgType); + /** + * @Description 获取下级组织列表 + * @Param agencyId + * @Return {@link List} + * @Author zhaoqifeng + * @Date 2021/8/20 14:08 + */ + List selectSubAgency(@Param("agencyId") String agencyId); + } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerStaffDepartmentDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerStaffDepartmentDao.java index f033ddede2..014c374aca 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerStaffDepartmentDao.java +++ b/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 getStaffDeptList(@Param("staffId") String staffId); + + /** + * @Description + * @Param agencyId + * @Return {@link List< OrgDTO>} + * @Author zhaoqifeng + * @Date 2021/8/20 14:29 + */ + List selectDepartmentList(@Param("agencyId") String agencyId); } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerStaffGridDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerStaffGridDao.java index a6757c8cca..9a4c01d8b6 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerStaffGridDao.java +++ b/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 { * @author sun */ List 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 selectGridList(@Param("agencyId") String agencyId); } \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetmessage/EpmetMessageService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetmessage/EpmetMessageService.java index 982cb862a3..cb48524cfd 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetmessage/EpmetMessageService.java +++ b/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); } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetmessage/impl/EpmetMessageServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetmessage/impl/EpmetMessageServiceImpl.java index c83e72ac5e..0e36e842bc 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetmessage/impl/EpmetMessageServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetmessage/impl/EpmetMessageServiceImpl.java @@ -6,19 +6,21 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 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.commons.tools.redis.common.bean.CustomerStaffInfoCache; import com.epmet.dataaggre.constant.DataSourceConstant; import com.epmet.dataaggre.dao.epmetmessage.InfoReceiversDao; 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; @@ -73,7 +75,11 @@ public class EpmetMessageServiceImpl implements EpmetMessageService { ReceiverDTO dto = new ReceiverDTO(); dto.setStaffId(item.getStaffId()); dto.setReadFlag(item.getReadFlag()); - //TODO redis获取用户信息 + CustomerStaffInfoCacheResult staffInfoCache = customerStaffRedis.getStaffInfo(item.getCustomerId(), item.getStaffId()); + dto.setStaffName(staffInfoCache.getRealName()); + dto.setGender(staffInfoCache.getGender()); + dto.setHeadPhoto(staffInfoCache.getHeadPhoto()); + dto.setOrgName(staffInfoCache.getTwoOrgName()); return dto; }).collect(Collectors.toList()); result.setDataList(dataList); @@ -91,6 +97,7 @@ public class EpmetMessageServiceImpl implements EpmetMessageService { */ @Override public List queryMyGroupList(String staffId, String customerId) { + // 按照小组的创建时间升序,新创建在后面, 显示的人员时按照info_group_receivers 群成员表的主键升序 List list = infoReceiversDao.selectMyGroupList(staffId, customerId,null); if (CollectionUtils.isNotEmpty(list)) { // 2、遍历每个群组,赋值工作人员姓名列表 @@ -98,7 +105,7 @@ public class EpmetMessageServiceImpl implements EpmetMessageService { List staffNameList = new ArrayList<>(); for (String userId : group.getStaffIdList()) { //查询每个工作人员的基本信息,获取姓名 - CustomerStaffInfoCache staffInfoCache = customerStaffRedis.getStaffInfo(customerId, userId); + CustomerStaffInfoCacheResult staffInfoCache = customerStaffRedis.getStaffInfo(customerId, userId); if (null != staffInfoCache) { staffNameList.add(staffInfoCache.getRealName()); } @@ -119,36 +126,57 @@ public class EpmetMessageServiceImpl implements EpmetMessageService { */ @Override public InfoGroupDetailResDTO queryGroupDetail(InfoGroupDetailFormDTO formDTO) { - List 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 staffList=new ArrayList<>(); - - for (String userId : group.getStaffIdList()) { - //查询每个工作人员的基本信息 - CustomerStaffInfoCache 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 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); + staffInfo.setOrgName(staffInfoCache.getTwoOrgName()); + 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 data = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()).doSelectPageInfo(() -> infoReceiversDao.selectListReply(formDTO.getInfoId())); + result.setTotal((int) data.getTotal()); + for (InfoReplyDetail detail : data.getList()) { + //查询每个工作人员的基本信息 + CustomerStaffInfoCacheResult 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); + detail.setOrgName(staffInfoCache.getTwoOrgName()); + } + result.setDataList(data.getList()); + return result; + } + + + } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java index 0aa32a6a8d..c743821b4e 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java @@ -3,7 +3,11 @@ package com.epmet.dataaggre.service.epmetuser.impl; 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.constant.StrConstant; import com.epmet.commons.tools.dto.form.IdAndNameDTO; +import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; +import com.epmet.commons.tools.enums.OrgTypeEnum; +import com.epmet.commons.tools.redis.common.CustomerStaffRedis; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.constant.BadgeConstant; @@ -21,6 +25,7 @@ import com.epmet.dataaggre.dto.govorg.form.OrgStaffListFormDTO; import com.epmet.dataaggre.dto.govorg.form.StaffDetailV2FormDTO; import com.epmet.dataaggre.dto.govorg.result.GridStaffResultDTO; import com.epmet.dataaggre.dto.govorg.result.StaffOrgNameResultDTO; +import com.epmet.dataaggre.dto.govorg.result.StaffOrgRelationResultDTO; import com.epmet.dataaggre.entity.epmetuser.CustomerStaffEntity; import com.epmet.dataaggre.entity.epmetuser.GovStaffRoleEntity; import com.epmet.dataaggre.entity.epmetuser.ResiUserBadgeEntity; @@ -71,6 +76,8 @@ public class EpmetUserServiceImpl implements EpmetUserService { private GovProjectService govProjectService; @Resource private GovStaffRoleDao govStaffRoleDao; + @Resource + private CustomerStaffRedis customerStaffRedis; /** * @Description 根据UserIds查询 @@ -479,7 +486,13 @@ public class EpmetUserServiceImpl implements EpmetUserService { return staffRoleList.stream().map(item -> { RoleUsersResultDTO dto = new RoleUsersResultDTO(); dto.setStaffId(item.getStaffId()); - //TODO 从redis获取用户信息 + //从redis获取用户信息 + CustomerStaffInfoCacheResult staffInfoCache = customerStaffRedis.getStaffInfo(item.getCustomerId(), item.getStaffId()); + dto.setGender(staffInfoCache.getGender()); + dto.setHeadPhoto(staffInfoCache.getHeadPhoto()); + dto.setName(staffInfoCache.getRealName()); + dto.setOrgName(staffInfoCache.getTwoOrgName()); + dto.setRoles(new ArrayList<>(staffInfoCache.getRoleMap().values())); return dto; }).collect(Collectors.toList()); } @@ -533,8 +546,26 @@ public class EpmetUserServiceImpl implements EpmetUserService { return null; } result.setAgencyName(agencyDTO.getOrganizationName()); - String fromOrgType = govOrgService.getStaffFromOrgType(staffId); + StaffOrgRelationResultDTO fromOrgTypeDto = govOrgService.getStaffFromOrgType(staffId); + String fromOrgType = OrgTypeEnum.AGENCY.getCode(); + if (fromOrgTypeDto != null){ + fromOrgType = fromOrgTypeDto.getOrgType(); + result.setFromOrgId(fromOrgTypeDto.getOrgId()); + } result.setFromOrgType(fromOrgType); + boolean isContinueMkName = true; + StringBuilder showNameBuilder = new StringBuilder(16); + if (OrgTypeEnum.AGENCY.getCode().equals(fromOrgType)){ + String allParentName = agencyDTO.getAllParentName(); + if (StringUtils.isNotBlank(allParentName)){ + showNameBuilder.append(allParentName.substring(allParentName.lastIndexOf(StrConstant.HYPHEN)+NumConstant.ONE)); + showNameBuilder.append(StrConstant.HYPHEN); + showNameBuilder.append(agencyDTO.getOrganizationName()); + isContinueMkName = false; + }else{ + showNameBuilder.append(agencyDTO.getOrganizationName()); + } + } List roleList = govStaffRoleDao.getStaffRoleList(staffId); Map roleMap = roleList.stream().collect(Collectors.toMap(StaffRoleResultDTO::getRoleKey, StaffRoleResultDTO::getRoleName)); @@ -545,6 +576,9 @@ public class EpmetUserServiceImpl implements EpmetUserService { List idAndNameList = new ArrayList<>(); for (CustomerGridDTO customerGridDTO : list) { IdAndNameDTO grid = new IdAndNameDTO(); + if (isContinueMkName && OrgTypeEnum.GRID.getCode().equals(fromOrgType)&&grid.getId().equals(result.getFromOrgId())){ + showNameBuilder.append(agencyDTO.getOrganizationName()).append(StrConstant.HYPHEN).append(grid.getName()); + } grid.setId(customerGridDTO.getId()); grid.setName(customerGridDTO.getGridName()); idAndNameList.add(grid); @@ -554,14 +588,17 @@ public class EpmetUserServiceImpl implements EpmetUserService { List deptList = govOrgService.getStaffDeptList(staffId); idAndNameList = new ArrayList<>(); for (CustomerDepartmentDTO org : deptList) { - IdAndNameDTO grid = new IdAndNameDTO(); - grid.setId(org.getId()); - grid.setName(org.getDepartmentName()); - idAndNameList.add(grid); + IdAndNameDTO dept = new IdAndNameDTO(); + if (isContinueMkName && OrgTypeEnum.GRID.getCode().equals(fromOrgType)&&dept.getId().equals(result.getFromOrgId())){ + showNameBuilder.append(agencyDTO.getOrganizationName()).append(StrConstant.HYPHEN).append(dept.getName()); + } + dept.setId(org.getId()); + dept.setName(org.getDepartmentName()); + idAndNameList.add(dept); } result.setDeptList(idAndNameList); - - + //特殊处理 显示的名字 + result.setTwoOrgName(showNameBuilder.toString()); return result; } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java index 68b1f2ddb8..a641be3095 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java @@ -134,5 +134,5 @@ public interface GovOrgService { * @param staffId * @return */ - String getStaffFromOrgType(String staffId); + StaffOrgRelationResultDTO getStaffFromOrgType(String staffId); } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java index 88afb38539..3eb77fe2dd 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java +++ b/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; @@ -10,6 +11,8 @@ 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; @@ -439,7 +442,17 @@ public class GovOrgServiceImpl implements GovOrgService { */ @Override public SubOrgResultDTO getSubOrg(SubOrgFormDTO formDTO) { - return null; + //下级组织列表 + List subAgencyList = customerStaffAgencyDao.selectSubAgency(formDTO.getAgencyId()); + //下级部门列表 + List departmentList = customerStaffDepartmentDao.selectDepartmentList(formDTO.getAgencyId()); + //下级网格列表 + List gridList = customerStaffGridDao.selectGridList(formDTO.getAgencyId()); + SubOrgResultDTO result = new SubOrgResultDTO(); + result.setSubAgencyList(subAgencyList); + result.setDepartmentList(departmentList); + result.setGridList(gridList); + return result; } /** @@ -463,7 +476,7 @@ public class GovOrgServiceImpl implements GovOrgService { } @Override - public String getStaffFromOrgType(String staffId) { + public StaffOrgRelationResultDTO getStaffFromOrgType(String staffId) { return customerAgencyDao.getStaffFromOrgType(staffId); } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetmessage/InfoReceiversDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetmessage/InfoReceiversDao.xml index 3c8d98b10a..179b3469fd 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetmessage/InfoReceiversDao.xml +++ b/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} and irg.id=#{receiverGroupId} - order by irg.CREATED_TIME asc + order by irg.CREATED_TIME asc,igr.id asc @@ -48,5 +48,60 @@ AND irg.id =#{receiverGroupId} + order by igr.id asc + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerAgencyDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerAgencyDao.xml index b96b990b81..ff6fd8e7c3 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerAgencyDao.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerAgencyDao.xml @@ -146,8 +146,8 @@ ) - + SELECT STAFF_ID,ORG_ID,ORG_TYPE FROM staff_org_relation WHERE del_flag = '0' AND staff_id = #{staffId} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerStaffAgencyDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerStaffAgencyDao.xml index b762c98242..d08de26805 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerStaffAgencyDao.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerStaffAgencyDao.xml @@ -90,4 +90,30 @@ + diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerStaffDepartmentDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerStaffDepartmentDao.xml index 1d54253076..3d217ce65e 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerStaffDepartmentDao.xml +++ b/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} + + diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerStaffGridDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerStaffGridDao.xml index 6c5cb0281d..1534bf1fab 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerStaffGridDao.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerStaffGridDao.xml @@ -35,4 +35,21 @@ AND ca.id = #{agencyId} + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenProjectServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenProjectServiceImpl.java index afd527d643..67e33d93be 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenProjectServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenProjectServiceImpl.java @@ -2,6 +2,7 @@ package com.epmet.datareport.service.evaluationindex.screen.impl; import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.redis.common.CustomerStaffRedis; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.constant.DataSourceConstant; @@ -10,7 +11,6 @@ import com.epmet.datareport.dao.evaluationindex.screen.ScreenEventImgDataDao; import com.epmet.datareport.dao.evaluationindex.screen.ScreenProjectCategoryOrgDailyDao; import com.epmet.datareport.dao.evaluationindex.screen.ScreenProjectDataDao; import com.epmet.datareport.service.evaluationindex.screen.ScreenProjectService; -import com.epmet.dto.CustomerAgencyUserRoleDTO; import com.epmet.dto.form.CustomerAgencyUserRoleFormDTO; import com.epmet.dto.form.screen.CategoryAnalysisFormDTO; import com.epmet.dto.form.screen.ColorProjectTotalFormDTO; @@ -56,7 +56,8 @@ public class ScreenProjectServiceImpl implements ScreenProjectService { private ScreenEventImgDataDao screenEventImgDataDao; @Autowired private ScreenProjectDataDao screenProjectDataDao; - + @Autowired + private CustomerStaffRedis staffRedis; @Autowired private ScreenProjectCategoryOrgDailyDao screenProjectCategoryOrgDailyDao; @Autowired @@ -117,14 +118,9 @@ public class ScreenProjectServiceImpl implements ScreenProjectService { CustomerAgencyUserRoleFormDTO userRoleFormDTO = new CustomerAgencyUserRoleFormDTO(); userRoleFormDTO.setCustomerId(formDTO.getCustomerId()); userRoleFormDTO.setStaffId(item.getReportUserId()); - - Result userRoles = userOpenFeignClient.getUserRoles(userRoleFormDTO); - if (userRoles != null && userRoles.success() && userRoles.getData() != null){ - Map roles = userRoles.getData().getRoles(); - - if (!CollectionUtils.isEmpty(roles)){ - item.setReportUserRoleSet(roles.keySet()); - } + Map staffRoleMap = staffRedis.getStaffRoleMap(formDTO.getCustomerId(), item.getReportUserId()); + if (!CollectionUtils.isEmpty(staffRoleMap)){ + item.setReportUserRoleSet(staffRoleMap.keySet()); } } 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 89c8a2ac36..da36b0d6bb 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 @@ -588,15 +588,6 @@ public interface EpmetUserOpenFeignClient { @PostMapping("/epmetuser/staffpatrol/patroltrack") Result> patrolTrack(@RequestBody PatrolTrackFormDTO formDTO); - /** - * @Description 查询角色 - * @Param formDTO - * @author zxc - * @date 2021/6/15 3:03 下午 - */ - @PostMapping("/epmetuser/staffrole/getroles") - Result getUserRoles(@RequestBody CustomerAgencyUserRoleFormDTO formDTO); - /** * 结束巡查 定时任务 * @author zhaoqifeng 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 01b2b63d57..b9f0264618 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 @@ -404,11 +404,6 @@ public class EpmetUserOpenFeignClientFallback implements EpmetUserOpenFeignClien return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "patrolTrack", formDTO); } - @Override - public Result getUserRoles(CustomerAgencyUserRoleFormDTO formDTO) { - return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getUserRoles", 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 949c104710..998c3eba7e 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 @@ -4,7 +4,6 @@ import cn.hutool.core.collection.CollectionUtil; import com.epmet.commons.mybatis.entity.DataScope; import com.epmet.commons.tools.utils.Result; 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.*; @@ -183,30 +182,6 @@ public class StaffRoleController { return new Result>().ok(staffRoleService.staffGridRole(forms)); } - /** - * @Description 补全缓存 工作人员角色 - * @Param - * @author zxc - * @date 2021/6/15 2:05 下午 - */ - @PostMapping("repairstaffrolecache") - public Result repairStaffRoleCache(){ - staffRoleService.repairStaffRoleCache(); - return new Result(); - } - - /** - * @Description 查询角色 - * @Param formDTO - * @author zxc - * @date 2021/6/15 3:03 下午 - */ - @PostMapping("getroles") - public Result getUserRoles(@RequestBody CustomerAgencyUserRoleFormDTO formDTO){ - ValidatorUtils.validateEntity(formDTO, CustomerAgencyUserRoleFormDTO.CustomerAgencyUserRoleForm.class); - return new Result().ok(staffRoleService.getUserRoles(formDTO)); - } - /** * 根据角色,查询里面的人,去重 * diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/GovStaffRoleRedis.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/GovStaffRoleRedis.java deleted file mode 100644 index 2ad77b306a..0000000000 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/GovStaffRoleRedis.java +++ /dev/null @@ -1,47 +0,0 @@ -/** - * Copyright 2018 人人开源 https://www.renren.io - *

- * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - *

- * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - *

- * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -package com.epmet.redis; - -import com.epmet.commons.tools.redis.RedisUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; - -/** - * 政府端角色表 - * - * @author generator generator@elink-cn.com - * @since v1.0.0 2020-04-22 - */ -@Component -public class GovStaffRoleRedis { - @Autowired - private RedisUtils redisUtils; - - public void delete(Object[] ids) { - - } - - public void set(){ - - } - - public String get(String id){ - return null; - } - -} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/GridLatestRedis.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/GridLatestRedis.java deleted file mode 100644 index 41bf0cfb49..0000000000 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/GridLatestRedis.java +++ /dev/null @@ -1,47 +0,0 @@ -/** - * Copyright 2018 人人开源 https://www.renren.io - *

- * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - *

- * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - *

- * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -package com.epmet.redis; - -import com.epmet.commons.tools.redis.RedisUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; - -/** - * 最近访问网格表 记录用户访问网格的最近一次记录,对同一网格只记录一条记录,同一网格每次只更新最近一次访问的时间 - * - * @author generator generator@elink-cn.com - * @since v1.0.0 2020-03-16 - */ -@Component -public class GridLatestRedis { - @Autowired - private RedisUtils redisUtils; - - public void delete(Object[] ids) { - - } - - public void set(){ - - } - - public String get(String id){ - return null; - } - -} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/GridVisitedRedis.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/GridVisitedRedis.java deleted file mode 100644 index 9316d6f3c7..0000000000 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/GridVisitedRedis.java +++ /dev/null @@ -1,47 +0,0 @@ -/** - * Copyright 2018 人人开源 https://www.renren.io - *

- * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - *

- * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - *

- * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -package com.epmet.redis; - -import com.epmet.commons.tools.redis.RedisUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; - -/** - * 网格访问记录表 用户对网格访问的一个记录,只有在访问网格首页时才存储数据,一个用户一天对一个网格的访问只有一条记录 - * - * @author generator generator@elink-cn.com - * @since v1.0.0 2020-03-16 - */ -@Component -public class GridVisitedRedis { - @Autowired - private RedisUtils redisUtils; - - public void delete(Object[] ids) { - - } - - public void set(){ - - } - - public String get(String id){ - return null; - } - -} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/OperUserRedis.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/OperUserRedis.java deleted file mode 100644 index ec0df3ca96..0000000000 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/OperUserRedis.java +++ /dev/null @@ -1,47 +0,0 @@ -/** - * Copyright 2018 人人开源 https://www.renren.io - *

- * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - *

- * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - *

- * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -package com.epmet.redis; - -import com.epmet.commons.tools.redis.RedisUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; - -/** - * 运营人员表 - * - * @author generator generator@elink-cn.com - * @since v1.0.0 2020-03-18 - */ -@Component -public class OperUserRedis { - @Autowired - private RedisUtils redisUtils; - - public void delete(Object[] ids) { - - } - - public void set(){ - - } - - public String get(String id){ - return null; - } - -} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/RegisterRelationRedis.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/RegisterRelationRedis.java deleted file mode 100644 index 5a9abca115..0000000000 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/RegisterRelationRedis.java +++ /dev/null @@ -1,47 +0,0 @@ -/** - * Copyright 2018 人人开源 https://www.renren.io - *

- * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - *

- * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - *

- * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -package com.epmet.redis; - -import com.epmet.commons.tools.redis.RedisUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; - -/** - * 注册关系表 用于统计客户网格的注册居民数 - * - * @author generator generator@elink-cn.com - * @since v1.0.0 2020-03-30 - */ -@Component -public class RegisterRelationRedis { - @Autowired - private RedisUtils redisUtils; - - public void delete(Object[] ids) { - - } - - public void set(){ - - } - - public String get(String id){ - return null; - } - -} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/RoleRedis.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/RoleRedis.java deleted file mode 100644 index 3af1f8f2ce..0000000000 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/RoleRedis.java +++ /dev/null @@ -1,47 +0,0 @@ -/** - * Copyright 2018 人人开源 https://www.renren.io - *

- * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - *

- * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - *

- * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -package com.epmet.redis; - -import com.epmet.commons.tools.redis.RedisUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; - -/** - * 角色表 - * - * @author generator generator@elink-cn.com - * @since v1.0.0 2020-03-30 - */ -@Component -public class RoleRedis { - @Autowired - private RedisUtils redisUtils; - - public void delete(Object[] ids) { - - } - - public void set(){ - - } - - public String get(String id){ - return null; - } - -} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/StaffInfoRedis.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/StaffInfoRedis.java deleted file mode 100644 index cf3ae77dda..0000000000 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/StaffInfoRedis.java +++ /dev/null @@ -1,75 +0,0 @@ -/** - * Copyright 2018 人人开源 https://www.renren.io - *

- * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - *

- * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - *

- * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -package com.epmet.redis; - -import cn.hutool.core.bean.BeanUtil; -import com.epmet.commons.tools.redis.RedisKeys; -import com.epmet.commons.tools.redis.RedisUtils; -import com.epmet.commons.tools.utils.ConvertUtils; -import com.epmet.dto.CustomerStaffInfoDTO; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; - -import java.util.Map; - -import static com.epmet.commons.tools.redis.RedisUtils.NOT_EXPIRE; - -/** - * 工作人员-角色关系表 - * - * @author generator generator@elink-cn.com - * @since v1.0.0 2020-04-22 - */ -@Component -public class StaffInfoRedis { - @Autowired - private RedisUtils redisUtils; - - /** - * @Description 查询工作人员的角色 - * @Param customerId - * @Param userId - * @author zxc - * @date 2021/6/15 3:20 下午 - */ - public CustomerStaffInfoDTO getRole(String customerId, String staffId){ - String key = RedisKeys.getCustomerStaffInfoKey(customerId,staffId); - Map roleMap = redisUtils.hGetAll(key); - boolean empty = roleMap.isEmpty(); - if (!empty){ - CustomerStaffInfoDTO result = ConvertUtils.mapToEntity(roleMap, CustomerStaffInfoDTO.class); - return result; - } - return null; - } - - /** - * @Description 放入缓存角色 - * @Param customerId - * @Param userId - * @Param dto - * @author zxc - * @date 2021/6/15 4:01 下午 - */ - public void setRole(String customerId,String staffId,CustomerStaffInfoDTO dto){ - String key = RedisKeys.getCustomerStaffInfoKey(customerId,staffId); - Map map = BeanUtil.beanToMap(dto, false, true); - redisUtils.hMSet(key, map,NOT_EXPIRE); - } - -} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/StaffRoleRedis.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/StaffRoleRedis.java deleted file mode 100644 index 2086c6c9e2..0000000000 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/StaffRoleRedis.java +++ /dev/null @@ -1,86 +0,0 @@ -/** - * Copyright 2018 人人开源 https://www.renren.io - *

- * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - *

- * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - *

- * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -package com.epmet.redis; - -import cn.hutool.core.bean.BeanUtil; -import com.epmet.commons.tools.redis.RedisUtils; -import com.epmet.commons.tools.utils.ConvertUtils; -import com.epmet.dto.CustomerAgencyUserRoleDTO; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; - -import java.util.Map; - -import static com.epmet.commons.tools.redis.RedisUtils.NOT_EXPIRE; - -/** - * 工作人员-角色关系表 - * - * @author generator generator@elink-cn.com - * @since v1.0.0 2020-04-22 - */ -@Component -public class StaffRoleRedis { - @Autowired - private RedisUtils redisUtils; - - public void delete(Object[] ids) { - - } - - public void set(){ - - } - - public String get(String id){ - return null; - } - - /** - * @Description 查询工作人员的角色 - * @Param customerId - * @Param userId - * @author zxc - * @date 2021/6/15 3:20 下午 - */ - public CustomerAgencyUserRoleDTO getRole(String customerId, String userId){ - String key = "epmet:staffrole:"+customerId+":"+userId; - Map roleMap = redisUtils.hGetAll(key); - boolean empty = roleMap.isEmpty(); - if (!empty){ - CustomerAgencyUserRoleDTO result = ConvertUtils.mapToEntity(roleMap, CustomerAgencyUserRoleDTO.class); - return result; - } - return null; - } - - /** - * @Description 放入缓存角色 - * @Param customerId - * @Param userId - * @Param dto - * @author zxc - * @date 2021/6/15 4:01 下午 - */ - public void setRole(String customerId,String userId,CustomerAgencyUserRoleDTO dto){ - String key = "epmet:staffrole:"+customerId+":"+userId; - Map map = BeanUtil.beanToMap(dto, false, true); - redisUtils.hMSet(key, map,NOT_EXPIRE); - } - -} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserAdviceImgRedis.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserAdviceImgRedis.java deleted file mode 100644 index 5c409ddb94..0000000000 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserAdviceImgRedis.java +++ /dev/null @@ -1,47 +0,0 @@ -/** - * Copyright 2018 人人开源 https://www.renren.io - *

- * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - *

- * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - *

- * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -package com.epmet.redis; - -import com.epmet.commons.tools.redis.RedisUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; - -/** - * 用户建议图片 - * - * @author qu qu@elink-cn.com - * @since v1.0.0 2020-11-04 - */ -@Component -public class UserAdviceImgRedis { - @Autowired - private RedisUtils redisUtils; - - public void delete(Object[] ids) { - - } - - public void set(){ - - } - - public String get(String id){ - return null; - } - -} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserAdviceRedis.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserAdviceRedis.java deleted file mode 100644 index d35e8427b9..0000000000 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserAdviceRedis.java +++ /dev/null @@ -1,47 +0,0 @@ -/** - * Copyright 2018 人人开源 https://www.renren.io - *

- * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - *

- * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - *

- * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -package com.epmet.redis; - -import com.epmet.commons.tools.redis.RedisUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; - -/** - * user_advice - * - * @author qu qu@elink-cn.com - * @since v1.0.0 2020-11-06 - */ -@Component -public class UserAdviceRedis { - @Autowired - private RedisUtils redisUtils; - - public void delete(Object[] ids) { - - } - - public void set(){ - - } - - public String get(String id){ - return null; - } - -} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserInvitationRedis.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserInvitationRedis.java deleted file mode 100644 index 766bac411a..0000000000 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserInvitationRedis.java +++ /dev/null @@ -1,47 +0,0 @@ -/** - * Copyright 2018 人人开源 https://www.renren.io - *

- * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - *

- * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - *

- * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -package com.epmet.redis; - -import com.epmet.commons.tools.redis.RedisUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; - -/** - * 人员邀请关系表 记录user之间的邀请关系 - * - * @author generator generator@elink-cn.com - * @since v1.0.0 2020-03-30 - */ -@Component -public class UserInvitationRedis { - @Autowired - private RedisUtils redisUtils; - - public void delete(Object[] ids) { - - } - - public void set(){ - - } - - public String get(String id){ - return null; - } - -} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserResiRegisterVisitRedis.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserResiRegisterVisitRedis.java deleted file mode 100644 index 59c492f966..0000000000 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserResiRegisterVisitRedis.java +++ /dev/null @@ -1,47 +0,0 @@ -/** - * Copyright 2018 人人开源 https://www.renren.io - *

- * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - *

- * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - *

- * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -package com.epmet.redis; - -import com.epmet.commons.tools.redis.RedisUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; - -/** - * 用户居民端注册访问记录表 - * - * @author generator generator@elink-cn.com - * @since v1.0.0 2020-03-30 - */ -@Component -public class UserResiRegisterVisitRedis { - @Autowired - private RedisUtils redisUtils; - - public void delete(Object[] ids) { - - } - - public void set(){ - - } - - public String get(String id){ - return null; - } - -} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserRoleRedis.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserRoleRedis.java deleted file mode 100644 index ff678b345d..0000000000 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserRoleRedis.java +++ /dev/null @@ -1,47 +0,0 @@ -/** - * Copyright 2018 人人开源 https://www.renren.io - *

- * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - *

- * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - *

- * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -package com.epmet.redis; - -import com.epmet.commons.tools.redis.RedisUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; - -/** - * 用户角色关系表 - * - * @author generator generator@elink-cn.com - * @since v1.0.0 2020-03-30 - */ -@Component -public class UserRoleRedis { - @Autowired - private RedisUtils redisUtils; - - public void delete(Object[] ids) { - - } - - public void set(){ - - } - - public String get(String id){ - return null; - } - -} \ No newline at end of file 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 00879f88a4..e8737d7a0c 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 @@ -21,9 +21,11 @@ import com.epmet.commons.mybatis.entity.DataScope; 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.CustomerAgencyUserRoleDTO; import com.epmet.dto.StaffRoleDTO; -import com.epmet.dto.form.*; +import com.epmet.dto.form.CommonUserFormDTO; +import com.epmet.dto.form.CustomerStaffRoleListFormDTO; +import com.epmet.dto.form.RoleStaffIdFormDTO; +import com.epmet.dto.form.RolesUsersListFormDTO; import com.epmet.dto.result.*; import com.epmet.entity.StaffRoleEntity; @@ -165,22 +167,6 @@ public interface StaffRoleService extends BaseService { */ List staffGridRole(List forms); - /** - * @Description 查询角色 - * @Param formDTO - * @author zxc - * @date 2021/6/15 3:03 下午 - */ - CustomerAgencyUserRoleDTO getUserRoles(CustomerAgencyUserRoleFormDTO formDTO); - - /** - * @Description 补全缓存 工作人员角色 - * @Param - * @author zxc - * @date 2021/6/15 2:05 下午 - */ - void repairStaffRoleCache(); - /** * 根据角色,查询里面的人,去重 * @@ -190,4 +176,4 @@ public interface StaffRoleService extends BaseService { * @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/CustomerStaffServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java index 70962eaaa7..0333550df2 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java @@ -18,7 +18,6 @@ package com.epmet.service.impl; import com.alibaba.fastjson.JSON; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.entity.DataScope; @@ -30,6 +29,7 @@ import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.ExceptionUtils; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.redis.common.CustomerStaffRedis; import com.epmet.commons.tools.security.password.PasswordUtils; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.CpUserDetailRedis; @@ -51,14 +51,11 @@ import com.epmet.entity.UserEntity; import com.epmet.feign.AuthFeignClient; import com.epmet.feign.GovOrgOpenFeignClient; import com.epmet.feign.OperCrmOpenFeignClient; -import com.epmet.redis.CustomerStaffRedis; -import com.epmet.redis.StaffRoleRedis; import com.epmet.service.CustomerStaffService; import com.epmet.service.GovStaffRoleService; import com.epmet.service.StaffRoleService; import com.epmet.service.UserService; import com.epmet.util.ModuleConstant; -import kotlin.jvm.internal.Lambda; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.apache.logging.log4j.LogManager; @@ -83,8 +80,6 @@ import java.util.stream.Collectors; public class CustomerStaffServiceImpl extends BaseServiceImpl implements CustomerStaffService { private Logger logger = LogManager.getLogger(getClass()); @Autowired - private CustomerStaffRedis customerStaffRedis; - @Autowired private GovStaffRoleService govStaffRoleService; @Autowired private UserService userService; @@ -105,7 +100,7 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl page(Map params) { @@ -348,7 +343,7 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl().ok(ConvertUtils.sourceToTarget(staffEntity, CustomerStaffDTO.class)); } @@ -421,7 +416,7 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl implements GridLatestService { - private Logger logger = LoggerFactory.getLogger(getClass()); - @Autowired - private GridLatestRedis gridLatestRedis; @Autowired private GridLatestDao gridLatestDao; @Autowired private UserBaseInfoRedis userBaseInfoRedis; @Autowired private UserWechatDao userWechatDao; - @Autowired - private EpmetHeartOpenFeignClient epmetHeartOpenFeignClient; @Override diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/OperUserServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/OperUserServiceImpl.java index 3d3e0c986e..aba125363b 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/OperUserServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/OperUserServiceImpl.java @@ -32,7 +32,6 @@ import com.epmet.dto.OperUserDTO; import com.epmet.entity.OperUserEntity; import com.epmet.entity.UserEntity; import com.epmet.feign.OperRoleUserFeignClient; -import com.epmet.redis.OperUserRedis; import com.epmet.service.OperUserService; import com.epmet.service.UserService; import org.apache.commons.lang3.StringUtils; @@ -53,8 +52,6 @@ import java.util.Map; @Service public class OperUserServiceImpl extends BaseServiceImpl implements OperUserService { - @Autowired - private OperUserRedis operUserRedis; @Autowired private OperUserDao operUserDao; @Autowired @@ -145,4 +142,4 @@ public class OperUserServiceImpl extends BaseServiceImpl implements RoleService { - - @Autowired - private RoleRedis roleRedis; @Autowired private UserRoleDao userRoleDao; @Autowired @@ -132,4 +128,4 @@ public class RoleServiceImpl extends BaseServiceImpl implem } return list; } -} \ 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 a574ba7b45..77ee68e7b5 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 @@ -24,16 +24,18 @@ 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.redis.common.CustomerStaffRedis; import com.epmet.commons.tools.utils.ConvertUtils; 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.*; +import com.epmet.dto.form.CommonUserFormDTO; +import com.epmet.dto.form.CustomerStaffRoleListFormDTO; +import com.epmet.dto.form.RoleStaffIdFormDTO; +import com.epmet.dto.form.RolesUsersListFormDTO; import com.epmet.dto.result.*; import com.epmet.entity.StaffRoleEntity; -import com.epmet.redis.StaffRoleRedis; import com.epmet.service.StaffRoleService; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -42,7 +44,6 @@ import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; import java.util.*; -import java.util.stream.Collectors; /** * 工作人员-角色关系表 @@ -54,7 +55,7 @@ import java.util.stream.Collectors; public class StaffRoleServiceImpl extends BaseServiceImpl implements StaffRoleService { @Autowired - private StaffRoleRedis staffRoleRedis; + private CustomerStaffRedis staffRedis; @Autowired private GovStaffRoleTemplateDao govStaffRoleTemplateDao; @@ -201,67 +202,6 @@ public class StaffRoleServiceImpl extends BaseServiceImpl rolesByDB = baseDao.getRolesByDB(staffId); - if (!CollectionUtils.isEmpty(rolesByDB)) { - CustomerAgencyUserRoleDTO dto = new CustomerAgencyUserRoleDTO(); - dto.setStaffId(rolesByDB.get(NumConstant.ZERO).getStaffId()); - dto.setCustomerId(customerId); - dto.setAgencyId(rolesByDB.get(NumConstant.ZERO).getOrgId()); - Map map = new HashMap(16); - rolesByDB.forEach(l -> { - map.put(l.getRoleKey(), l.getRoleName()); - }); - dto.setRoles(map); - staffRoleRedis.setRole(customerId, staffId, dto); - return dto; - } - } - return null; - } - - /** - * @Description 补全缓存 工作人员角色 - * @Param - * @author zxc - * @date 2021/6/15 2:05 下午 - */ - @Override - public void repairStaffRoleCache() { - // 查询所有工作人员的角色 - List allRoles = baseDao.selectAllUserRoles(); - if (!CollectionUtils.isEmpty(allRoles)){ - // 根据 userId分组【staffId】 - Map> groupByStaff = allRoles.stream().collect(Collectors.groupingBy(RepairStaffRoleCacheResultDTO::getStaffId)); - groupByStaff.forEach((userId,list) -> { - CustomerAgencyUserRoleDTO dto = new CustomerAgencyUserRoleDTO(); - String customerId = list.get(NumConstant.ZERO).getCustomerId(); - dto.setStaffId(list.get(NumConstant.ZERO).getStaffId()); - dto.setCustomerId(customerId); - dto.setAgencyId(list.get(NumConstant.ZERO).getOrgId()); - Map map = new HashMap(16); - list.forEach(l -> { - map.put(l.getRoleKey(), l.getRoleName()); - }); - dto.setRoles(map); - staffRoleRedis.setRole(customerId, userId, dto); - }); - } - } - /** * 根据角色,查询里面的人,去重 * @@ -278,4 +218,4 @@ public class StaffRoleServiceImpl extends BaseServiceImpl implements UserAdviceImgService { - @Autowired - private UserAdviceImgRedis userAdviceImgRedis; - @Override public PageData page(Map params) { IPage page = baseDao.selectPage( diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserAdviceServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserAdviceServiceImpl.java index 9fb3f13947..bdf908849f 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserAdviceServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserAdviceServiceImpl.java @@ -37,7 +37,6 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.ScanContentUtils; import com.epmet.constant.UserAdviceConstant; import com.epmet.dao.UserAdviceDao; -import com.epmet.dto.CustomerAgencyDTO; import com.epmet.dto.CustomerDTO; import com.epmet.dto.CustomerGridDTO; import com.epmet.dto.UserAdviceDTO; @@ -47,7 +46,6 @@ import com.epmet.entity.UserAdviceEntity; import com.epmet.entity.UserAdviceImgEntity; import com.epmet.feign.GovOrgOpenFeignClient; import com.epmet.feign.OperCrmOpenFeignClient; -import com.epmet.redis.UserAdviceRedis; import com.epmet.service.UserAdviceImgService; import com.epmet.service.UserAdviceService; import com.epmet.service.UserResiInfoService; @@ -61,8 +59,6 @@ import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import java.text.ParseException; -import java.text.SimpleDateFormat; import java.util.*; /** @@ -75,8 +71,6 @@ import java.util.*; public class UserAdviceServiceImpl extends BaseServiceImpl implements UserAdviceService { private Logger logger = LogManager.getLogger(UserAdviceServiceImpl.class); - @Autowired - private UserAdviceRedis userAdviceRedis; @Autowired private UserAdviceImgService userAdviceImgService; diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserInvitationServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserInvitationServiceImpl.java index 30e26b0a98..9655e7ab65 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserInvitationServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserInvitationServiceImpl.java @@ -20,18 +20,16 @@ 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.FieldConstant; 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.UserInvitationDao; import com.epmet.dto.UserInvitationDTO; import com.epmet.dto.form.UserInvitationFormDTO; import com.epmet.entity.UserInvitationEntity; -import com.epmet.redis.UserInvitationRedis; import com.epmet.service.UserInvitationService; 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 org.springframework.util.CollectionUtils; @@ -50,9 +48,6 @@ import java.util.Map; @Service public class UserInvitationServiceImpl extends BaseServiceImpl implements UserInvitationService { - @Autowired - private UserInvitationRedis userInvitationRedis; - @Override public PageData page(Map params) { IPage page = baseDao.selectPage( diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserResiRegisterVisitServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserResiRegisterVisitServiceImpl.java index 1182611384..ecab05eaf2 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserResiRegisterVisitServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserResiRegisterVisitServiceImpl.java @@ -19,11 +19,8 @@ package com.epmet.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.core.toolkit.IdWorker; 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.exception.EpmetErrorCode; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; @@ -34,9 +31,7 @@ import com.epmet.dto.UserResiRegisterVisitDTO; import com.epmet.dto.form.ResiRegisterFormDTO; import com.epmet.dto.form.VerificationCodeFormDTO; import com.epmet.dto.result.ResiRegisterResultDTO; -import com.epmet.entity.UserResiInfoEntity; import com.epmet.entity.UserResiRegisterVisitEntity; -import com.epmet.redis.UserResiRegisterVisitRedis; import com.epmet.service.UserResiRegisterVisitService; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; @@ -61,8 +56,6 @@ public class UserResiRegisterVisitServiceImpl extends BaseServiceImpl implements UserRoleService { - @Autowired - private UserRoleRedis userRoleRedis; @Autowired private RoleService roleService;