diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/CommonAggFeignClient.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/CommonAggFeignClient.java index 7b87579a4d..d9ceb0f3a0 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/CommonAggFeignClient.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/CommonAggFeignClient.java @@ -13,7 +13,7 @@ import org.springframework.web.bind.annotation.PostMapping; * @Description * @Author sun */ -@FeignClient(name = ServiceConstant.DATA_AGGREGATOR_SERVER, fallbackFactory = CommonAggFeignClientFallBackFactory.class,url = "http://localhost:8114") +@FeignClient(name = ServiceConstant.DATA_AGGREGATOR_SERVER, fallbackFactory = CommonAggFeignClientFallBackFactory.class) public interface CommonAggFeignClient { /** 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 af2d09cc09..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 @@ -12,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; @@ -25,18 +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() { 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"))); } /** @@ -56,6 +57,14 @@ public class CustomerStaffRedis { 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("获取工作人员信息失败"); @@ -68,8 +77,28 @@ public class CustomerStaffRedis { Map map = BeanUtil.beanToMap(resultData, false, true); redisUtils.hMSet(key, map); + return resultData; + } - return ConvertUtils.sourceToTarget(resultData,CustomerStaffInfoCacheResult.class); + /** + * 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; + } + + reloadStaffCache(staffId, key); + return getStaffRoleMap(customerId,staffId); } /** 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-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/form/StaffDetailV2FormDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/form/StaffDetailV2FormDTO.java index d38739c346..d568099084 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/form/StaffDetailV2FormDTO.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/form/StaffDetailV2FormDTO.java @@ -4,6 +4,8 @@ import lombok.Data; import javax.validation.constraints.NotBlank; import java.io.Serializable; +import java.util.Date; +import java.util.List; /** * @Description 【通讯录】人员详情v2-接口返参 @@ -12,20 +14,32 @@ import java.io.Serializable; @Data public class StaffDetailV2FormDTO implements Serializable { private static final long serialVersionUID = -1974456701949979946L; - @NotBlank(message = "parentAgencyId不能为空",groups = AddUserInternalGroup.class) - private String parentAgencyId; - private String areaCode; - /** - * 社区级:community, - * 乡(镇、街道)级:street, - * 区县级: district, - * 市级: city - * 省级:province - */ - @NotBlank(message = "level不能为空",groups = AddUserInternalGroup.class) - private String level; - public interface AddUserInternalGroup { - } + //工作人员用户id + private String staffId = ""; + //工作人员姓名 + private String name = ""; + //性别 + private String gender = ""; + //手机号 + private String mobile = ""; + //头像 + private String headPhoto = ""; + //激活状态:inactive未激活,active已激活 + private String activeFlag = ""; + //激活时间 + private Date activeTime; + //未禁用enable,已禁用disabled + private String enableFlag = ""; + //fulltime专职parttime兼职 + private String workType = ""; + //人员新增所属组织名【组织-组织,组织-部门,组织-网格】 + private String orgName = ""; + //人员添加类型的Id + private String orgId = ""; + //人员添加时的类型【agency;dept;grid】 + private String orgType = ""; + //职责名称列表 + private List roles; } diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/result/StaffDetailV2ResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/result/StaffDetailV2ResultDTO.java index fda8f72636..0813592884 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/result/StaffDetailV2ResultDTO.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/result/StaffDetailV2ResultDTO.java @@ -17,8 +17,10 @@ package com.epmet.dataaggre.dto.govorg.result; +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; import lombok.Data; +import javax.validation.constraints.NotBlank; import java.io.Serializable; @@ -32,8 +34,10 @@ public class StaffDetailV2ResultDTO implements Serializable { private static final long serialVersionUID = 1L; /** - * 树结构对象 + * 工资人员Id */ - private AgencyGridResultDTO agencyGridList; + @NotBlank(message = "人员Id不能为空", groups = StaffDetailV2ResultDTO.Staff.class) + private String staffId; + public interface Staff extends CustomerClientShowGroup {} } \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/result/StaffOrgNameResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/result/StaffOrgNameResultDTO.java index 703f3be160..5ab2977494 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/result/StaffOrgNameResultDTO.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/result/StaffOrgNameResultDTO.java @@ -40,6 +40,6 @@ public class StaffOrgNameResultDTO implements Serializable { //工作人员添加入口Id(agencyId;deptId;gridId) private String orgId = ""; //工作人员添加入口类型(组织:agency;部门:dept;网格:gridId) - private String orgname = ""; + private String orgType = ""; } \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/message/result/InfoRedDotResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/message/result/InfoRedDotResultDTO.java new file mode 100644 index 0000000000..ce159b6a33 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/message/result/InfoRedDotResultDTO.java @@ -0,0 +1,26 @@ +package com.epmet.dataaggre.dto.message.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/8/20 3:22 下午 + * @DESC + */ +@Data +public class InfoRedDotResultDTO implements Serializable { + + private static final long serialVersionUID = 6417699657069808978L; + + /** + * 我发出的,新回复数量 + */ + private Integer sentNewReplyCount; + + /** + * 我收到的未读的消息数量 + */ + private Integer receivedUnReadCount; +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/GovOrgController.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/GovOrgController.java index 7895a8d5e7..3f3020c147 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/GovOrgController.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/GovOrgController.java @@ -146,7 +146,7 @@ public class GovOrgController { */ @PostMapping("staffdetailv2") public Result staffDetailV2(@RequestBody StaffDetailV2ResultDTO formDTO) { - //ValidatorUtils.validateEntity(formDTO, StaffDetailV2ResultDTO.listGridMemberDatas.class); + ValidatorUtils.validateEntity(formDTO, StaffDetailV2ResultDTO.Staff.class); return new Result().ok(govOrgService.staffDetailV2(formDTO)); } 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 35078415c2..0b9b807162 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 @@ -10,6 +10,7 @@ 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.InfoRedDotResultDTO; import com.epmet.dataaggre.dto.message.result.InfoReplyResDTO; import com.epmet.dataaggre.dto.message.result.MyInfoGroupResultDTO; import com.epmet.dataaggre.service.epmetmessage.EpmetMessageService; @@ -92,4 +93,16 @@ public class InfoController { ValidatorUtils.validateEntity(formDTO, PageFormDTO.AddUserInternalGroup.class); return new Result().ok(epmetMessageService.queryInfoReplies(formDTO)); } + + /** + * @Description 【发送消息】我收到、我发送红点 + * @Param userId + * @author zxc + * @date 2021/8/20 3:38 下午 + */ + @PostMapping("reddot") + public Result redDot(@LoginUser TokenDto tokenDto){ + return new Result().ok(epmetMessageService.redDot(tokenDto.getUserId())); + } + } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/CustomerStaffDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/CustomerStaffDao.java index f277da4ee1..e06011fe40 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/CustomerStaffDao.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/CustomerStaffDao.java @@ -58,4 +58,10 @@ public interface CustomerStaffDao extends BaseDao { * @author sun */ List selectStaffList(OrgStaffListFormDTO formDTO); + + /** + * @Description 查询工作人员基础信息 + * @author sun + */ + CustomerStaffDTO selectByStaffId(@Param("staffId") String staffId); } \ No newline at end of file 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 75734a058b..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 @@ -60,7 +60,7 @@ public interface CustomerStaffAgencyDao extends BaseDao selectStaffList(String orgId, String orgType); + List selectStaffList(@Param("orgId") String orgId, @Param("orgType") String orgType); /** * @Description 获取下级组织列表 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 cb48524cfd..43477866a3 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 @@ -5,6 +5,7 @@ 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.InfoRedDotResultDTO; import com.epmet.dataaggre.dto.message.result.InfoReplyResDTO; import com.epmet.dataaggre.dto.message.result.MyInfoGroupResultDTO; @@ -53,4 +54,12 @@ public interface EpmetMessageService { * @date 2021/8/20 2:09 下午 */ InfoReplyResDTO queryInfoReplies(InfoRepliesFormDTO formDTO); + + /** + * @Description 【发送消息】我收到、我发送红点 + * @Param userId + * @author zxc + * @date 2021/8/20 3:38 下午 + */ + InfoRedDotResultDTO redDot(String userId); } 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 49f53f0bfa..6d1c3ff183 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 @@ -75,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); @@ -173,6 +177,18 @@ public class EpmetMessageServiceImpl implements EpmetMessageService { return result; } + /** + * @Description 【发送消息】我收到、我发送红点 + * 我发出的查询info_profile限制住created_by=当前用户, sum未读的回复数 + * 我收到的info_receivers,并且未读的 count(distinct info_id) + * @Param userId + * @author zxc + * @date 2021/8/20 3:38 下午 + */ + @Override + public InfoRedDotResultDTO redDot(String userId) { + return null; + } } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/EpmetUserService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/EpmetUserService.java index 91cc70fefd..28820e015b 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/EpmetUserService.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/EpmetUserService.java @@ -1,8 +1,10 @@ package com.epmet.dataaggre.service.epmetuser; +import com.epmet.dataaggre.dto.epmetuser.CustomerStaffDTO; import com.epmet.dataaggre.dto.epmetuser.form.*; import com.epmet.dataaggre.dto.epmetuser.result.*; import com.epmet.dataaggre.dto.govorg.form.OrgStaffListFormDTO; +import com.epmet.dataaggre.dto.govorg.form.StaffDetailV2FormDTO; import com.epmet.dataaggre.dto.govorg.result.GridStaffResultDTO; import java.util.List; @@ -132,4 +134,10 @@ public interface EpmetUserService { * @author sun */ List getStaffInfoList(OrgStaffListFormDTO formDTO); + + /** + * @Description 查询工作人员基础信息、角色信息 + * @author sun + */ + StaffDetailV2FormDTO selectByStaffId(String staffId); } 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 2e3e0206b6..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 @@ -5,7 +5,9 @@ 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; @@ -20,6 +22,7 @@ import com.epmet.dataaggre.dto.govorg.CustomerAgencyDTO; import com.epmet.dataaggre.dto.govorg.CustomerDepartmentDTO; import com.epmet.dataaggre.dto.govorg.CustomerGridDTO; import com.epmet.dataaggre.dto.govorg.form.OrgStaffListFormDTO; +import com.epmet.dataaggre.dto.govorg.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; @@ -73,6 +76,8 @@ public class EpmetUserServiceImpl implements EpmetUserService { private GovProjectService govProjectService; @Resource private GovStaffRoleDao govStaffRoleDao; + @Resource + private CustomerStaffRedis customerStaffRedis; /** * @Description 根据UserIds查询 @@ -481,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()); } @@ -604,5 +615,27 @@ public class EpmetUserServiceImpl implements EpmetUserService { return resultList; } + /** + * @Description 查询工作人员基础信息、角色信息 + * @author sun + */ + @Override + public StaffDetailV2FormDTO selectByStaffId(String staffId) { + StaffDetailV2FormDTO result = new StaffDetailV2FormDTO(); + //基本信息 + CustomerStaffDTO dto = customerStaffDao.selectByStaffId(staffId); + if (null == dto) { + return result; + } + //角色信息 + List list = staffRoleDao.selectByStaffId(staffId); + //汇总数据 + result = ConvertUtils.sourceToTarget(dto, StaffDetailV2FormDTO.class); + result.setName(dto.getRealName()); + result.setRoles(list); + + return result; + } + } 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 4b1404e88b..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 @@ -410,7 +410,26 @@ public class GovOrgServiceImpl implements GovOrgService { */ @Override public StaffDetailV2FormDTO staffDetailV2(StaffDetailV2ResultDTO formDTO) { - return null; + //1.查询工作人员基本信息、角色信息 + StaffDetailV2FormDTO result = epmetUserService.selectByStaffId(formDTO.getStaffId()); + if (null == result) { + return new StaffDetailV2FormDTO(); + } + + //2.查询工作人员注册组织关系信息 + List staffIdList = new ArrayList<>(); + staffIdList.add(formDTO.getStaffId()); + List list = customerAgencyDao.selelctStaffOrg(staffIdList); + if (null == list || list.size() < NumConstant.ONE) { + throw new RenException("未查询到工作人员注册组织信息"); + } + + //3.封装数据并返回 + result.setOrgId(list.get(0).getOrgId()); + result.setOrgName(list.get(0).getOrgName()); + result.setOrgType(list.get(0).getOrgType()); + + return result; } /** diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/CustomerStaffDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/CustomerStaffDao.xml index 2783476730..6fea2678fe 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/CustomerStaffDao.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/CustomerStaffDao.xml @@ -110,4 +110,14 @@ ) + + \ 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 f9e133f945..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 @@ -76,7 +76,7 @@ ) )orgName, sor.org_id orgId, - 'agency' orgname + 'agency' orgType FROM staff_org_relation sor INNER JOIN customer_agency ca ON sor.org_id = ca.id @@ -103,7 +103,7 @@ ) )orgName, sor.org_id orgId, - 'dept' orgname + 'dept' orgType FROM staff_org_relation sor INNER JOIN customer_department cd ON sor.org_id = cd.id @@ -131,7 +131,7 @@ ) )orgName, sor.org_id orgId, - 'grid' orgname + 'grid' orgType FROM staff_org_relation sor INNER JOIN customer_grid cg ON sor.org_id = cg.id 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-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.6__add_staff_org_relation.sql b/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.6__add_staff_org_relation.sql index 10070cdb60..c9cb535ea7 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.6__add_staff_org_relation.sql +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.6__add_staff_org_relation.sql @@ -12,7 +12,7 @@ CREATE TABLE `staff_org_relation` ( `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', PRIMARY KEY (`ID`) USING BTREE, - UNIQUE KEY `staffid_orgid` (`STAFF_ID`,`ORG_ID`) USING BTREE COMMENT '联合主键' + KEY `staffid` (`STAFF_ID`) USING BTREE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='工作人员注册组织关系表'; INSERT INTO staff_org_relation SELECT 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/CustomerStaffRedis.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/CustomerStaffRedis.java deleted file mode 100644 index 0fb5b1b369..0000000000 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/CustomerStaffRedis.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-18 - */ -@Component -public class CustomerStaffRedis { - @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/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;