Browse Source

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

dev_shibei_match
sunyuchao 5 years ago
parent
commit
59cd4ab394
  1. 11
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/CustomerStaffInfoCacheResult.java
  2. 2
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java
  3. 49
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/CustomerStaffRedis.java
  4. 13
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/CustomerStaffInfoCache.java
  5. 11
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/CustomerStaffResultDTO.java
  6. 2
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/RoleUsersResultDTO.java
  7. 2
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/ReceiverDTO.java
  8. 42
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/result/StaffOrgRelationResultDTO.java
  9. 33
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/message/form/InfoRepliesFormDTO.java
  10. 28
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/message/result/InfoReplyDetail.java
  11. 18
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/message/result/InfoReplyResDTO.java
  12. 18
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/InfoController.java
  13. 33
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetmessage/InfoReceiversDao.java
  14. 3
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerAgencyDao.java
  15. 10
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerStaffAgencyDao.java
  16. 10
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerStaffDepartmentDao.java
  17. 10
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerStaffGridDao.java
  18. 12
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetmessage/EpmetMessageService.java
  19. 94
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetmessage/impl/EpmetMessageServiceImpl.java
  20. 53
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java
  21. 2
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java
  22. 17
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java
  23. 59
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetmessage/InfoReceiversDao.xml
  24. 4
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerAgencyDao.xml
  25. 26
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerStaffAgencyDao.xml
  26. 19
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerStaffDepartmentDao.xml
  27. 17
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerStaffGridDao.xml
  28. 16
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenProjectServiceImpl.java
  29. 9
      epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java
  30. 5
      epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java
  31. 25
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffRoleController.java
  32. 47
      epmet-user/epmet-user-server/src/main/java/com/epmet/redis/GovStaffRoleRedis.java
  33. 47
      epmet-user/epmet-user-server/src/main/java/com/epmet/redis/GridLatestRedis.java
  34. 47
      epmet-user/epmet-user-server/src/main/java/com/epmet/redis/GridVisitedRedis.java
  35. 47
      epmet-user/epmet-user-server/src/main/java/com/epmet/redis/OperUserRedis.java
  36. 47
      epmet-user/epmet-user-server/src/main/java/com/epmet/redis/RegisterRelationRedis.java
  37. 47
      epmet-user/epmet-user-server/src/main/java/com/epmet/redis/RoleRedis.java
  38. 75
      epmet-user/epmet-user-server/src/main/java/com/epmet/redis/StaffInfoRedis.java
  39. 86
      epmet-user/epmet-user-server/src/main/java/com/epmet/redis/StaffRoleRedis.java
  40. 47
      epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserAdviceImgRedis.java
  41. 47
      epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserAdviceRedis.java
  42. 47
      epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserInvitationRedis.java
  43. 47
      epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserResiRegisterVisitRedis.java
  44. 47
      epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserRoleRedis.java
  45. 24
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffRoleService.java
  46. 13
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java
  47. 8
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/GovStaffRoleServiceImpl.java
  48. 10
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/GridLatestServiceImpl.java
  49. 5
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/OperUserServiceImpl.java
  50. 8
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/RoleServiceImpl.java
  51. 74
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffRoleServiceImpl.java
  52. 7
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserAdviceImgServiceImpl.java
  53. 6
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserAdviceServiceImpl.java
  54. 7
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserInvitationServiceImpl.java
  55. 9
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserResiRegisterVisitServiceImpl.java
  56. 3
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserRoleServiceImpl.java

11
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; private String agencyName;
/**
* 2级组织名称 根据添加的来源返回xx组织-组织/网格/部门
*/
private String twoOrgName;
/** /**
* 工作人员ID * 工作人员ID
*/ */
@ -51,6 +56,12 @@ public class CustomerStaffInfoCacheResult implements Serializable {
*/ */
private String headPhoto; private String headPhoto;
/**
* 工作人员是从哪中组织类型添加的 3个值agencygriddept
* @see com.epmet.commons.tools.enums.OrgTypeEnum
*/
private String fromOrgType;
/** /**
* 角色map key为角色key value 为角色名称 * 角色map key为角色key value 为角色名称
*/ */

2
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java

@ -498,6 +498,6 @@ public class RedisKeys {
* @return * @return
*/ */
public static String getCustomerStaffInfoKey(String customerId, String staffId) { 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);
} }
} }

49
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 cn.hutool.core.bean.BeanUtil;
import com.alibaba.fastjson.JSON; 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.exception.RenException;
import com.epmet.commons.tools.feign.CommonAggFeignClient; import com.epmet.commons.tools.feign.CommonAggFeignClient;
import com.epmet.commons.tools.redis.RedisKeys; 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 com.epmet.commons.tools.utils.Result;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.jetbrains.annotations.Nullable;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import java.util.Map; import java.util.Map;
@ -24,17 +25,19 @@ import java.util.Map;
* @since v1.0.0 2020-04-22 * @since v1.0.0 2020-04-22
*/ */
@Slf4j @Slf4j
@Component
public class CustomerStaffRedis { public class CustomerStaffRedis {
@Autowired @Autowired
private RedisUtils redisUtils; private RedisUtils redisUtils;
@Autowired @Autowired
private CommonAggFeignClient commonAggFeignClient; private CommonAggFeignClient commonAggFeignClient;
private static final String ROLE_MAP_KEY = "roleMap";
//@PostConstruct //@PostConstruct
public void init() { 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(role));
System.out.println(JSON.toJSONString(this.getStaffRoleMap("45687aa479955f9d06204d415238f7cc", "7f694a66efe60a47c2114875f310248a")));
} }
/** /**
@ -47,25 +50,55 @@ public class CustomerStaffRedis {
* @date 2021/8/19 10:29 下午 * @date 2021/8/19 10:29 下午
* @remark 此方法仅用于 获取某个工作人员的信息不用于获取客户下所有工作人员信息 * @remark 此方法仅用于 获取某个工作人员的信息不用于获取客户下所有工作人员信息
*/ */
public CustomerStaffInfoCache getStaffInfo(String customerId, String staffId) { public CustomerStaffInfoCacheResult getStaffInfo(String customerId, String staffId) {
String key = RedisKeys.getCustomerStaffInfoKey(customerId, staffId); String key = RedisKeys.getCustomerStaffInfoKey(customerId, staffId);
Map<String, Object> roleMap = redisUtils.hGetAll(key); Map<String, Object> roleMap = redisUtils.hGetAll(key);
if (!CollectionUtils.isEmpty(roleMap)) { 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<CustomerStaffInfoCache> staffResult = commonAggFeignClient.getStaffInfo(staffId); Result<CustomerStaffInfoCache> staffResult = commonAggFeignClient.getStaffInfo(staffId);
if (staffResult == null || !staffResult.success()) { if (staffResult == null || !staffResult.success()) {
throw new RenException("获取工作人员信息失败"); throw new RenException("获取工作人员信息失败");
} }
if (staffResult.getData() == null) { CustomerStaffInfoCache resultData = staffResult.getData();
if (resultData == null) {
log.warn("getStaffInfo staff is null,staffId:{}", staffId); log.warn("getStaffInfo staff is null,staffId:{}", staffId);
return null; return null;
} }
Map<String, Object> map = BeanUtil.beanToMap(staffResult.getData(), false, true);
Map<String, Object> map = BeanUtil.beanToMap(resultData, false, true);
redisUtils.hMSet(key, map); 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<String,String> getStaffRoleMap(String customerId, String staffId) {
String key = RedisKeys.getCustomerStaffInfoKey(customerId, staffId);
Map<String, String> roleMap = (Map<String, String>) redisUtils.hGet(key,ROLE_MAP_KEY);
if (!CollectionUtils.isEmpty(roleMap)) {
return roleMap;
}
return staffResult.getData(); reloadStaffCache(staffId, key);
return getStaffRoleMap(customerId,staffId);
} }
/** /**

13
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; import java.util.Map;
/** /**
* desc:客户工作人员缓存实体类
* @Author zxc * @Author zxc
* @DateTime 2021/6/15 10:00 上午 * @DateTime 2021/6/15 10:00 上午
* @DESC * @DESC
@ -15,7 +16,7 @@ import java.util.Map;
@Data @Data
public class CustomerStaffInfoCache implements Serializable { public class CustomerStaffInfoCache implements Serializable {
private static final long serialVersionUID = -4078910245000135305L; private static final long serialVersionUID = 4627478063125903910L;
/** /**
* 工作人员所属组织ID * 工作人员所属组织ID
*/ */
@ -26,6 +27,11 @@ public class CustomerStaffInfoCache implements Serializable {
*/ */
private String agencyName; private String agencyName;
/**
* 2级组织名称 根据添加的来源返回xx组织-组织/网格/部门
*/
private String twoOrgName;
/** /**
* 工作人员ID * 工作人员ID
*/ */
@ -62,6 +68,11 @@ public class CustomerStaffInfoCache implements Serializable {
*/ */
private String fromOrgType; private String fromOrgType;
/**
* 工作人员是从哪中组织添加的 组织Id
*/
private String fromOrgId;
/** /**
* 所属组织的上级组织 * 所属组织的上级组织
*/ */

11
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; private String fromOrgType;
/**
* 工作人员是从哪中组织添加的 组织Id
*/
private String fromOrgId;
/** /**
* 角色map key为角色key value 为角色名称 * 角色map key为角色key value 为角色名称
*/ */
@ -77,4 +82,10 @@ public class CustomerStaffResultDTO implements Serializable {
*/ */
private List<IdAndNameDTO> deptList; private List<IdAndNameDTO> deptList;
//特殊处理的 属性 start ==========
/**
* 2级组织名称 根据添加的来源返回xx组织-组织/网格/部门
*/
private String twoOrgName;
} }

2
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 name;
private String headPhoto; private String headPhoto;
private String orgName; private String orgName;
private String gender; private Integer gender;
private List<String> roles; private List<String> roles;
} }

2
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未知 * 1男2女0未知
*/ */
private String gender; private Integer gender;
} }

42
epmet-user/epmet-user-server/src/main/java/com/epmet/redis/CustomerStaffRedis.java → 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 <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
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 * @author generator generator@elink-cn.com
* @since v1.0.0 2020-04-18 * @since v1.0.0 2021-08-19
*/ */
@Component @Data
public class CustomerStaffRedis { public class StaffOrgRelationResultDTO implements Serializable {
@Autowired
private RedisUtils redisUtils;
public void delete(Object[] ids) {
} 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;
}
} }

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

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

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

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

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

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

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

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

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

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

3
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.AgencyGridResultDTO;
import com.epmet.dataaggre.dto.govorg.result.StaffAgencyGridListResultDTO; import com.epmet.dataaggre.dto.govorg.result.StaffAgencyGridListResultDTO;
import com.epmet.dataaggre.dto.govorg.result.StaffOrgNameResultDTO; import com.epmet.dataaggre.dto.govorg.result.StaffOrgNameResultDTO;
import com.epmet.dataaggre.dto.govorg.result.StaffOrgRelationResultDTO;
import com.epmet.dataaggre.entity.govorg.CustomerAgencyEntity; import com.epmet.dataaggre.entity.govorg.CustomerAgencyEntity;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
@ -72,5 +73,5 @@ public interface CustomerAgencyDao extends BaseDao<CustomerAgencyEntity> {
* @param staffId * @param staffId
* @return * @return
*/ */
String getStaffFromOrgType(@Param("staffId") String staffId); StaffOrgRelationResultDTO getStaffFromOrgType(@Param("staffId") String staffId);
} }

10
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.CustomerAgencyDTO;
import com.epmet.dataaggre.dto.govorg.CustomerGridDTO; import com.epmet.dataaggre.dto.govorg.CustomerGridDTO;
import com.epmet.dataaggre.dto.govorg.CustomerStaffAgencyDTO; import com.epmet.dataaggre.dto.govorg.CustomerStaffAgencyDTO;
import com.epmet.dataaggre.dto.govorg.OrgDTO;
import com.epmet.dataaggre.entity.govorg.CustomerStaffAgencyEntity; import com.epmet.dataaggre.entity.govorg.CustomerStaffAgencyEntity;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
@ -61,4 +62,13 @@ public interface CustomerStaffAgencyDao extends BaseDao<CustomerStaffAgencyEntit
*/ */
List<String> selectStaffList(@Param("orgId") String orgId, @Param("orgType") String orgType); List<String> selectStaffList(@Param("orgId") String orgId, @Param("orgType") String orgType);
/**
* @Description 获取下级组织列表
* @Param agencyId
* @Return {@link List<OrgDTO>}
* @Author zhaoqifeng
* @Date 2021/8/20 14:08
*/
List<OrgDTO> selectSubAgency(@Param("agencyId") String agencyId);
} }

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

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

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

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

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

@ -3,7 +3,9 @@ package com.epmet.dataaggre.service.epmetmessage;
import com.epmet.dataaggre.dto.govorg.form.ReceiversFormDTO; import com.epmet.dataaggre.dto.govorg.form.ReceiversFormDTO;
import com.epmet.dataaggre.dto.govorg.result.ReceiversResultDTO; import com.epmet.dataaggre.dto.govorg.result.ReceiversResultDTO;
import com.epmet.dataaggre.dto.message.form.InfoGroupDetailFormDTO; 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.InfoGroupDetailResDTO;
import com.epmet.dataaggre.dto.message.result.InfoReplyResDTO;
import com.epmet.dataaggre.dto.message.result.MyInfoGroupResultDTO; import com.epmet.dataaggre.dto.message.result.MyInfoGroupResultDTO;
import java.util.List; import java.util.List;
@ -41,4 +43,14 @@ public interface EpmetMessageService {
* @date 2021/8/20 12:59 下午 * @date 2021/8/20 12:59 下午
*/ */
InfoGroupDetailResDTO queryGroupDetail(InfoGroupDetailFormDTO formDTO); 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);
} }

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

53
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.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.tools.constant.NumConstant; 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.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.ConvertUtils;
import com.epmet.commons.tools.utils.DateUtils; import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.constant.BadgeConstant; 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.form.StaffDetailV2FormDTO;
import com.epmet.dataaggre.dto.govorg.result.GridStaffResultDTO; import com.epmet.dataaggre.dto.govorg.result.GridStaffResultDTO;
import com.epmet.dataaggre.dto.govorg.result.StaffOrgNameResultDTO; 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.CustomerStaffEntity;
import com.epmet.dataaggre.entity.epmetuser.GovStaffRoleEntity; import com.epmet.dataaggre.entity.epmetuser.GovStaffRoleEntity;
import com.epmet.dataaggre.entity.epmetuser.ResiUserBadgeEntity; import com.epmet.dataaggre.entity.epmetuser.ResiUserBadgeEntity;
@ -71,6 +76,8 @@ public class EpmetUserServiceImpl implements EpmetUserService {
private GovProjectService govProjectService; private GovProjectService govProjectService;
@Resource @Resource
private GovStaffRoleDao govStaffRoleDao; private GovStaffRoleDao govStaffRoleDao;
@Resource
private CustomerStaffRedis customerStaffRedis;
/** /**
* @Description 根据UserIds查询 * @Description 根据UserIds查询
@ -479,7 +486,13 @@ public class EpmetUserServiceImpl implements EpmetUserService {
return staffRoleList.stream().map(item -> { return staffRoleList.stream().map(item -> {
RoleUsersResultDTO dto = new RoleUsersResultDTO(); RoleUsersResultDTO dto = new RoleUsersResultDTO();
dto.setStaffId(item.getStaffId()); 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; return dto;
}).collect(Collectors.toList()); }).collect(Collectors.toList());
} }
@ -533,8 +546,26 @@ public class EpmetUserServiceImpl implements EpmetUserService {
return null; return null;
} }
result.setAgencyName(agencyDTO.getOrganizationName()); 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); 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<StaffRoleResultDTO> roleList = govStaffRoleDao.getStaffRoleList(staffId); List<StaffRoleResultDTO> roleList = govStaffRoleDao.getStaffRoleList(staffId);
Map<String, String> roleMap = roleList.stream().collect(Collectors.toMap(StaffRoleResultDTO::getRoleKey, StaffRoleResultDTO::getRoleName)); Map<String, String> roleMap = roleList.stream().collect(Collectors.toMap(StaffRoleResultDTO::getRoleKey, StaffRoleResultDTO::getRoleName));
@ -545,6 +576,9 @@ public class EpmetUserServiceImpl implements EpmetUserService {
List<IdAndNameDTO> idAndNameList = new ArrayList<>(); List<IdAndNameDTO> idAndNameList = new ArrayList<>();
for (CustomerGridDTO customerGridDTO : list) { for (CustomerGridDTO customerGridDTO : list) {
IdAndNameDTO grid = new IdAndNameDTO(); 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.setId(customerGridDTO.getId());
grid.setName(customerGridDTO.getGridName()); grid.setName(customerGridDTO.getGridName());
idAndNameList.add(grid); idAndNameList.add(grid);
@ -554,14 +588,17 @@ public class EpmetUserServiceImpl implements EpmetUserService {
List<CustomerDepartmentDTO> deptList = govOrgService.getStaffDeptList(staffId); List<CustomerDepartmentDTO> deptList = govOrgService.getStaffDeptList(staffId);
idAndNameList = new ArrayList<>(); idAndNameList = new ArrayList<>();
for (CustomerDepartmentDTO org : deptList) { for (CustomerDepartmentDTO org : deptList) {
IdAndNameDTO grid = new IdAndNameDTO(); IdAndNameDTO dept = new IdAndNameDTO();
grid.setId(org.getId()); if (isContinueMkName && OrgTypeEnum.GRID.getCode().equals(fromOrgType)&&dept.getId().equals(result.getFromOrgId())){
grid.setName(org.getDepartmentName()); showNameBuilder.append(agencyDTO.getOrganizationName()).append(StrConstant.HYPHEN).append(dept.getName());
idAndNameList.add(grid); }
dept.setId(org.getId());
dept.setName(org.getDepartmentName());
idAndNameList.add(dept);
} }
result.setDeptList(idAndNameList); result.setDeptList(idAndNameList);
//特殊处理 显示的名字
result.setTwoOrgName(showNameBuilder.toString());
return result; return result;
} }

2
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 * @param staffId
* @return * @return
*/ */
String getStaffFromOrgType(String staffId); StaffOrgRelationResultDTO getStaffFromOrgType(String staffId);
} }

17
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; package com.epmet.dataaggre.service.govorg.impl;
import com.alibaba.fastjson.JSON; 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.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.exception.EpmetErrorCode; 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.dao.govorg.*;
import com.epmet.dataaggre.dto.epmetuser.result.ListStaffResultDTO; import com.epmet.dataaggre.dto.epmetuser.result.ListStaffResultDTO;
import com.epmet.dataaggre.dto.epmetuser.result.StaffRoleListResultDTO; 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.CustomerAgencyDTO;
import com.epmet.dataaggre.dto.govorg.CustomerDepartmentDTO; import com.epmet.dataaggre.dto.govorg.CustomerDepartmentDTO;
import com.epmet.dataaggre.dto.govorg.CustomerGridDTO; import com.epmet.dataaggre.dto.govorg.CustomerGridDTO;
@ -439,7 +442,17 @@ public class GovOrgServiceImpl implements GovOrgService {
*/ */
@Override @Override
public SubOrgResultDTO getSubOrg(SubOrgFormDTO formDTO) { public SubOrgResultDTO getSubOrg(SubOrgFormDTO formDTO) {
return null; //下级组织列表
List<OrgDTO> subAgencyList = customerStaffAgencyDao.selectSubAgency(formDTO.getAgencyId());
//下级部门列表
List<OrgDTO> departmentList = customerStaffDepartmentDao.selectDepartmentList(formDTO.getAgencyId());
//下级网格列表
List<OrgDTO> gridList = customerStaffGridDao.selectGridList(formDTO.getAgencyId());
SubOrgResultDTO result = new SubOrgResultDTO();
result.setSubAgencyList(subAgencyList);
result.setDepartmentList(departmentList);
result.setGridList(gridList);
return result;
} }
/** /**
@ -463,7 +476,7 @@ public class GovOrgServiceImpl implements GovOrgService {
} }
@Override @Override
public String getStaffFromOrgType(String staffId) { public StaffOrgRelationResultDTO getStaffFromOrgType(String staffId) {
return customerAgencyDao.getStaffFromOrgType(staffId); return customerAgencyDao.getStaffFromOrgType(staffId);
} }

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

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

4
epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerAgencyDao.xml

@ -146,8 +146,8 @@
) )
</if> </if>
</select> </select>
<select id="getStaffFromOrgType" resultType="java.lang.String"> <select id="getStaffFromOrgType" resultType="com.epmet.dataaggre.dto.govorg.result.StaffOrgRelationResultDTO">
SELECT ORG_TYPE FROM staff_org_relation WHERE del_flag = '0' AND staff_id = #{staffId} SELECT STAFF_ID,ORG_ID,ORG_TYPE FROM staff_org_relation WHERE del_flag = '0' AND staff_id = #{staffId}
</select> </select>
</mapper> </mapper>

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

@ -90,4 +90,30 @@
</select> </select>
<select id="selectSubAgency" resultType="com.epmet.dataaggre.dto.govorg.OrgDTO">
SELECT
ca.ID AS orgId,
ca.ORGANIZATION_NAME AS orgName,
"agency" AS orgType,
count( csa.USER_ID ) AS staffNum
FROM
customer_agency ca
LEFT JOIN (
SELECT
a.PIDS,
b.USER_ID
FROM
customer_agency a
INNER JOIN customer_staff_agency b ON b.AGENCY_ID = a.ID
AND b.DEL_FLAG = '0'
WHERE
a.DEL_FLAG = '0'
) csa ON csa.PIDS LIKE CONCAT( '%', ca.ID, '%' )
WHERE
ca.DEL_FLAG = '0'
AND ca.PID = #{agencyId}
GROUP BY
ca.ID
ORDER BY ca.CREATED_TIME ASC
</select>
</mapper> </mapper>

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

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

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

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

16
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.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.tools.constant.NumConstant; 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.ConvertUtils;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
import com.epmet.constant.DataSourceConstant; 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.ScreenProjectCategoryOrgDailyDao;
import com.epmet.datareport.dao.evaluationindex.screen.ScreenProjectDataDao; import com.epmet.datareport.dao.evaluationindex.screen.ScreenProjectDataDao;
import com.epmet.datareport.service.evaluationindex.screen.ScreenProjectService; import com.epmet.datareport.service.evaluationindex.screen.ScreenProjectService;
import com.epmet.dto.CustomerAgencyUserRoleDTO;
import com.epmet.dto.form.CustomerAgencyUserRoleFormDTO; import com.epmet.dto.form.CustomerAgencyUserRoleFormDTO;
import com.epmet.dto.form.screen.CategoryAnalysisFormDTO; import com.epmet.dto.form.screen.CategoryAnalysisFormDTO;
import com.epmet.dto.form.screen.ColorProjectTotalFormDTO; import com.epmet.dto.form.screen.ColorProjectTotalFormDTO;
@ -56,7 +56,8 @@ public class ScreenProjectServiceImpl implements ScreenProjectService {
private ScreenEventImgDataDao screenEventImgDataDao; private ScreenEventImgDataDao screenEventImgDataDao;
@Autowired @Autowired
private ScreenProjectDataDao screenProjectDataDao; private ScreenProjectDataDao screenProjectDataDao;
@Autowired
private CustomerStaffRedis staffRedis;
@Autowired @Autowired
private ScreenProjectCategoryOrgDailyDao screenProjectCategoryOrgDailyDao; private ScreenProjectCategoryOrgDailyDao screenProjectCategoryOrgDailyDao;
@Autowired @Autowired
@ -117,14 +118,9 @@ public class ScreenProjectServiceImpl implements ScreenProjectService {
CustomerAgencyUserRoleFormDTO userRoleFormDTO = new CustomerAgencyUserRoleFormDTO(); CustomerAgencyUserRoleFormDTO userRoleFormDTO = new CustomerAgencyUserRoleFormDTO();
userRoleFormDTO.setCustomerId(formDTO.getCustomerId()); userRoleFormDTO.setCustomerId(formDTO.getCustomerId());
userRoleFormDTO.setStaffId(item.getReportUserId()); userRoleFormDTO.setStaffId(item.getReportUserId());
Map<String, String> staffRoleMap = staffRedis.getStaffRoleMap(formDTO.getCustomerId(), item.getReportUserId());
Result<CustomerAgencyUserRoleDTO> userRoles = userOpenFeignClient.getUserRoles(userRoleFormDTO); if (!CollectionUtils.isEmpty(staffRoleMap)){
if (userRoles != null && userRoles.success() && userRoles.getData() != null){ item.setReportUserRoleSet(staffRoleMap.keySet());
Map<String,String> roles = userRoles.getData().getRoles();
if (!CollectionUtils.isEmpty(roles)){
item.setReportUserRoleSet(roles.keySet());
}
} }
} }

9
epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java

@ -588,15 +588,6 @@ public interface EpmetUserOpenFeignClient {
@PostMapping("/epmetuser/staffpatrol/patroltrack") @PostMapping("/epmetuser/staffpatrol/patroltrack")
Result<List<PatrolTrackResultDTO>> patrolTrack(@RequestBody PatrolTrackFormDTO formDTO); Result<List<PatrolTrackResultDTO>> patrolTrack(@RequestBody PatrolTrackFormDTO formDTO);
/**
* @Description 查询角色
* @Param formDTO
* @author zxc
* @date 2021/6/15 3:03 下午
*/
@PostMapping("/epmetuser/staffrole/getroles")
Result<CustomerAgencyUserRoleDTO> getUserRoles(@RequestBody CustomerAgencyUserRoleFormDTO formDTO);
/** /**
* 结束巡查 定时任务 * 结束巡查 定时任务
* @author zhaoqifeng * @author zhaoqifeng

5
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); return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "patrolTrack", formDTO);
} }
@Override
public Result<CustomerAgencyUserRoleDTO> getUserRoles(CustomerAgencyUserRoleFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getUserRoles", formDTO);
}
/** /**
* 结束巡查 定时任务 * 结束巡查 定时任务
* *

25
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.mybatis.entity.DataScope;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dto.CustomerAgencyUserRoleDTO;
import com.epmet.dto.GovStaffRoleDTO; import com.epmet.dto.GovStaffRoleDTO;
import com.epmet.dto.StaffRoleDTO; import com.epmet.dto.StaffRoleDTO;
import com.epmet.dto.form.*; import com.epmet.dto.form.*;
@ -183,30 +182,6 @@ public class StaffRoleController {
return new Result<List<GridStaffResultDTO>>().ok(staffRoleService.staffGridRole(forms)); return new Result<List<GridStaffResultDTO>>().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<CustomerAgencyUserRoleDTO> getUserRoles(@RequestBody CustomerAgencyUserRoleFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO, CustomerAgencyUserRoleFormDTO.CustomerAgencyUserRoleForm.class);
return new Result<CustomerAgencyUserRoleDTO>().ok(staffRoleService.getUserRoles(formDTO));
}
/** /**
* 根据角色查询里面的人去重 * 根据角色查询里面的人去重
* *

47
epmet-user/epmet-user-server/src/main/java/com/epmet/redis/GovStaffRoleRedis.java

@ -1,47 +0,0 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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;
}
}

47
epmet-user/epmet-user-server/src/main/java/com/epmet/redis/GridLatestRedis.java

@ -1,47 +0,0 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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;
}
}

47
epmet-user/epmet-user-server/src/main/java/com/epmet/redis/GridVisitedRedis.java

@ -1,47 +0,0 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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;
}
}

47
epmet-user/epmet-user-server/src/main/java/com/epmet/redis/OperUserRedis.java

@ -1,47 +0,0 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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;
}
}

47
epmet-user/epmet-user-server/src/main/java/com/epmet/redis/RegisterRelationRedis.java

@ -1,47 +0,0 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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;
}
}

47
epmet-user/epmet-user-server/src/main/java/com/epmet/redis/RoleRedis.java

@ -1,47 +0,0 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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;
}
}

75
epmet-user/epmet-user-server/src/main/java/com/epmet/redis/StaffInfoRedis.java

@ -1,75 +0,0 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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<String, Object> 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<String, Object> map = BeanUtil.beanToMap(dto, false, true);
redisUtils.hMSet(key, map,NOT_EXPIRE);
}
}

86
epmet-user/epmet-user-server/src/main/java/com/epmet/redis/StaffRoleRedis.java

@ -1,86 +0,0 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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<String, Object> 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<String, Object> map = BeanUtil.beanToMap(dto, false, true);
redisUtils.hMSet(key, map,NOT_EXPIRE);
}
}

47
epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserAdviceImgRedis.java

@ -1,47 +0,0 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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;
}
}

47
epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserAdviceRedis.java

@ -1,47 +0,0 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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;
}
}

47
epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserInvitationRedis.java

@ -1,47 +0,0 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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;
}
}

47
epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserResiRegisterVisitRedis.java

@ -1,47 +0,0 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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;
}
}

47
epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserRoleRedis.java

@ -1,47 +0,0 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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;
}
}

24
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.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.CustomerAgencyUserRoleDTO;
import com.epmet.dto.StaffRoleDTO; 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.dto.result.*;
import com.epmet.entity.StaffRoleEntity; import com.epmet.entity.StaffRoleEntity;
@ -165,22 +167,6 @@ public interface StaffRoleService extends BaseService<StaffRoleEntity> {
*/ */
List<GridStaffResultDTO> staffGridRole(List<GridStaffResultDTO> forms); List<GridStaffResultDTO> staffGridRole(List<GridStaffResultDTO> 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<StaffRoleEntity> {
* @date 2021/8/19 11:14 上午 * @date 2021/8/19 11:14 上午
*/ */
Set<String> queryRoleStaffIds(RoleStaffIdFormDTO formDTO); Set<String> queryRoleStaffIds(RoleStaffIdFormDTO formDTO);
} }

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

@ -18,7 +18,6 @@
package com.epmet.service.impl; package com.epmet.service.impl;
import com.alibaba.fastjson.JSON; 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.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.entity.DataScope; 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.ExceptionUtils;
import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.page.PageData; 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.security.password.PasswordUtils;
import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.CpUserDetailRedis; 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.AuthFeignClient;
import com.epmet.feign.GovOrgOpenFeignClient; import com.epmet.feign.GovOrgOpenFeignClient;
import com.epmet.feign.OperCrmOpenFeignClient; import com.epmet.feign.OperCrmOpenFeignClient;
import com.epmet.redis.CustomerStaffRedis;
import com.epmet.redis.StaffRoleRedis;
import com.epmet.service.CustomerStaffService; import com.epmet.service.CustomerStaffService;
import com.epmet.service.GovStaffRoleService; import com.epmet.service.GovStaffRoleService;
import com.epmet.service.StaffRoleService; import com.epmet.service.StaffRoleService;
import com.epmet.service.UserService; import com.epmet.service.UserService;
import com.epmet.util.ModuleConstant; import com.epmet.util.ModuleConstant;
import kotlin.jvm.internal.Lambda;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
@ -83,8 +80,6 @@ import java.util.stream.Collectors;
public class CustomerStaffServiceImpl extends BaseServiceImpl<CustomerStaffDao, CustomerStaffEntity> implements CustomerStaffService { public class CustomerStaffServiceImpl extends BaseServiceImpl<CustomerStaffDao, CustomerStaffEntity> implements CustomerStaffService {
private Logger logger = LogManager.getLogger(getClass()); private Logger logger = LogManager.getLogger(getClass());
@Autowired @Autowired
private CustomerStaffRedis customerStaffRedis;
@Autowired
private GovStaffRoleService govStaffRoleService; private GovStaffRoleService govStaffRoleService;
@Autowired @Autowired
private UserService userService; private UserService userService;
@ -105,7 +100,7 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl<CustomerStaffDao,
@Autowired @Autowired
private OperCrmOpenFeignClient operCrmOpenFeignClient; private OperCrmOpenFeignClient operCrmOpenFeignClient;
@Autowired @Autowired
private StaffRoleRedis staffRoleRedis; private CustomerStaffRedis staffRedis;
@Override @Override
public PageData<CustomerStaffDTO> page(Map<String, Object> params) { public PageData<CustomerStaffDTO> page(Map<String, Object> params) {
@ -348,7 +343,7 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl<CustomerStaffDao,
m.put(r.getRoleKey(),r.getRoleName()); m.put(r.getRoleKey(),r.getRoleName());
}); });
dto.setRoles(m); dto.setRoles(m);
staffRoleRedis.setRole(dto.getCustomerId(), dto.getStaffId(),dto); staffRedis.delStaffInfoFormCache(dto.getCustomerId(), dto.getStaffId());
return new Result<CustomerStaffDTO>().ok(ConvertUtils.sourceToTarget(staffEntity, CustomerStaffDTO.class)); return new Result<CustomerStaffDTO>().ok(ConvertUtils.sourceToTarget(staffEntity, CustomerStaffDTO.class));
} }
@ -421,7 +416,7 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl<CustomerStaffDao,
m.put(r.getRoleKey(),r.getRoleName()); m.put(r.getRoleKey(),r.getRoleName());
}); });
dto.setRoles(m); dto.setRoles(m);
staffRoleRedis.setRole(dto.getCustomerId(), dto.getStaffId(),dto); staffRedis.delStaffInfoFormCache(dto.getCustomerId(), dto.getStaffId());
return new Result(); return new Result();
} }

8
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/GovStaffRoleServiceImpl.java

@ -35,7 +35,6 @@ import com.epmet.dto.form.UpGovRoleFormDTO;
import com.epmet.dto.result.*; import com.epmet.dto.result.*;
import com.epmet.entity.GovStaffRoleEntity; import com.epmet.entity.GovStaffRoleEntity;
import com.epmet.feign.GovAccessFeignClient; import com.epmet.feign.GovAccessFeignClient;
import com.epmet.redis.GovStaffRoleRedis;
import com.epmet.service.GovStaffRoleService; import com.epmet.service.GovStaffRoleService;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
@ -45,8 +44,6 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.util.*; import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
import java.util.function.Function;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
@ -60,9 +57,6 @@ public class GovStaffRoleServiceImpl extends BaseServiceImpl<GovStaffRoleDao, Go
private Logger logger = LoggerFactory.getLogger(getClass()); private Logger logger = LoggerFactory.getLogger(getClass());
@Autowired
private GovStaffRoleRedis govStaffRoleRedis;
@Autowired @Autowired
private GovStaffRoleTemplateDao govStaffRoleTemplateDao; private GovStaffRoleTemplateDao govStaffRoleTemplateDao;
@ -345,4 +339,4 @@ public class GovStaffRoleServiceImpl extends BaseServiceImpl<GovStaffRoleDao, Go
} }
} }
} }

10
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/GridLatestServiceImpl.java

@ -29,7 +29,6 @@ import com.epmet.dao.GridLatestDao;
import com.epmet.dao.UserWechatDao; import com.epmet.dao.UserWechatDao;
import com.epmet.dto.CustomerGridDTO; import com.epmet.dto.CustomerGridDTO;
import com.epmet.dto.GridLatestDTO; import com.epmet.dto.GridLatestDTO;
import com.epmet.dto.form.CommonCustomerFormDTO;
import com.epmet.dto.form.CustomerUserFormDTO; import com.epmet.dto.form.CustomerUserFormDTO;
import com.epmet.dto.form.LatestGridInfoFormDTO; import com.epmet.dto.form.LatestGridInfoFormDTO;
import com.epmet.dto.form.VisitedFormDTO; import com.epmet.dto.form.VisitedFormDTO;
@ -38,21 +37,17 @@ import com.epmet.dto.result.LatestGridInfoResultDTO;
import com.epmet.dto.result.UserBaseInfoResultDTO; import com.epmet.dto.result.UserBaseInfoResultDTO;
import com.epmet.entity.GridLatestEntity; import com.epmet.entity.GridLatestEntity;
import com.epmet.feign.EpmetHeartOpenFeignClient; import com.epmet.feign.EpmetHeartOpenFeignClient;
import com.epmet.redis.GridLatestRedis;
import com.epmet.redis.UserBaseInfoRedis; import com.epmet.redis.UserBaseInfoRedis;
import com.epmet.service.GridLatestService; import com.epmet.service.GridLatestService;
import com.epmet.util.ModuleConstant; import com.epmet.util.ModuleConstant;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import java.util.*; import java.util.*;
import java.util.stream.Collectors;
/** /**
* 最近访问网格表 记录用户访问网格的最近一次记录对同一网格只记录一条记录同一网格每次只更新最近一次访问的时间 * 最近访问网格表 记录用户访问网格的最近一次记录对同一网格只记录一条记录同一网格每次只更新最近一次访问的时间
@ -62,17 +57,12 @@ import java.util.stream.Collectors;
*/ */
@Service @Service
public class GridLatestServiceImpl extends BaseServiceImpl<GridLatestDao, GridLatestEntity> implements GridLatestService { public class GridLatestServiceImpl extends BaseServiceImpl<GridLatestDao, GridLatestEntity> implements GridLatestService {
private Logger logger = LoggerFactory.getLogger(getClass());
@Autowired
private GridLatestRedis gridLatestRedis;
@Autowired @Autowired
private GridLatestDao gridLatestDao; private GridLatestDao gridLatestDao;
@Autowired @Autowired
private UserBaseInfoRedis userBaseInfoRedis; private UserBaseInfoRedis userBaseInfoRedis;
@Autowired @Autowired
private UserWechatDao userWechatDao; private UserWechatDao userWechatDao;
@Autowired
private EpmetHeartOpenFeignClient epmetHeartOpenFeignClient;
@Override @Override

5
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.OperUserEntity;
import com.epmet.entity.UserEntity; import com.epmet.entity.UserEntity;
import com.epmet.feign.OperRoleUserFeignClient; import com.epmet.feign.OperRoleUserFeignClient;
import com.epmet.redis.OperUserRedis;
import com.epmet.service.OperUserService; import com.epmet.service.OperUserService;
import com.epmet.service.UserService; import com.epmet.service.UserService;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
@ -53,8 +52,6 @@ import java.util.Map;
@Service @Service
public class OperUserServiceImpl extends BaseServiceImpl<OperUserDao, OperUserEntity> implements OperUserService { public class OperUserServiceImpl extends BaseServiceImpl<OperUserDao, OperUserEntity> implements OperUserService {
@Autowired
private OperUserRedis operUserRedis;
@Autowired @Autowired
private OperUserDao operUserDao; private OperUserDao operUserDao;
@Autowired @Autowired
@ -145,4 +142,4 @@ public class OperUserServiceImpl extends BaseServiceImpl<OperUserDao, OperUserEn
return operUserDao.selectOperUserInfoById(id); return operUserDao.selectOperUserInfoById(id);
} }
} }

8
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/RoleServiceImpl.java

@ -30,7 +30,6 @@ import com.epmet.dao.UserRoleDao;
import com.epmet.dto.RoleDTO; import com.epmet.dto.RoleDTO;
import com.epmet.dto.form.GetRoleKeyListFormDTO; import com.epmet.dto.form.GetRoleKeyListFormDTO;
import com.epmet.entity.RoleEntity; import com.epmet.entity.RoleEntity;
import com.epmet.redis.RoleRedis;
import com.epmet.service.RoleService; import com.epmet.service.RoleService;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -43,16 +42,13 @@ import java.util.List;
import java.util.Map; import java.util.Map;
/** /**
* 角色表 * 角色表
* *
* @author generator generator@elink-cn.com * @author generator generator@elink-cn.com
* @since v1.0.0 2020-03-30 * @since v1.0.0 2020-03-30
*/ */
@Service @Service
public class RoleServiceImpl extends BaseServiceImpl<RoleDao, RoleEntity> implements RoleService { public class RoleServiceImpl extends BaseServiceImpl<RoleDao, RoleEntity> implements RoleService {
@Autowired
private RoleRedis roleRedis;
@Autowired @Autowired
private UserRoleDao userRoleDao; private UserRoleDao userRoleDao;
@Autowired @Autowired
@ -132,4 +128,4 @@ public class RoleServiceImpl extends BaseServiceImpl<RoleDao, RoleEntity> implem
} }
return list; return list;
} }
} }

74
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.FieldConstant;
import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.page.PageData; 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.ConvertUtils;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
import com.epmet.dao.GovStaffRoleTemplateDao; import com.epmet.dao.GovStaffRoleTemplateDao;
import com.epmet.dao.StaffRoleDao; import com.epmet.dao.StaffRoleDao;
import com.epmet.dto.CustomerAgencyUserRoleDTO;
import com.epmet.dto.StaffRoleDTO; 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.dto.result.*;
import com.epmet.entity.StaffRoleEntity; import com.epmet.entity.StaffRoleEntity;
import com.epmet.redis.StaffRoleRedis;
import com.epmet.service.StaffRoleService; import com.epmet.service.StaffRoleService;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -42,7 +44,6 @@ import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import java.util.*; import java.util.*;
import java.util.stream.Collectors;
/** /**
* 工作人员-角色关系表 * 工作人员-角色关系表
@ -54,7 +55,7 @@ import java.util.stream.Collectors;
public class StaffRoleServiceImpl extends BaseServiceImpl<StaffRoleDao, StaffRoleEntity> implements StaffRoleService { public class StaffRoleServiceImpl extends BaseServiceImpl<StaffRoleDao, StaffRoleEntity> implements StaffRoleService {
@Autowired @Autowired
private StaffRoleRedis staffRoleRedis; private CustomerStaffRedis staffRedis;
@Autowired @Autowired
private GovStaffRoleTemplateDao govStaffRoleTemplateDao; private GovStaffRoleTemplateDao govStaffRoleTemplateDao;
@ -201,67 +202,6 @@ public class StaffRoleServiceImpl extends BaseServiceImpl<StaffRoleDao, StaffRol
return result; return result;
} }
/**
* @Description 查询角色
* @Param formDTO
* @author zxc
* @date 2021/6/15 3:03 下午
*/
@Override
public CustomerAgencyUserRoleDTO getUserRoles(CustomerAgencyUserRoleFormDTO formDTO) {
String staffId = formDTO.getStaffId();
String customerId = formDTO.getCustomerId();
CustomerAgencyUserRoleDTO role = staffRoleRedis.getRole(customerId, staffId);
if (null != role){
return role;
}else {
List<RoleKeyValueResultDTO> 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<RepairStaffRoleCacheResultDTO> allRoles = baseDao.selectAllUserRoles();
if (!CollectionUtils.isEmpty(allRoles)){
// 根据 userId分组【staffId】
Map<String, List<RepairStaffRoleCacheResultDTO>> 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<StaffRoleDao, StaffRol
return baseDao.selectRoleStaffIds(formDTO.getCustomerId(),formDTO.getRoleIds()); return baseDao.selectRoleStaffIds(formDTO.getCustomerId(),formDTO.getRoleIds());
} }
} }

7
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserAdviceImgServiceImpl.java

@ -20,16 +20,14 @@ package com.epmet.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; 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.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.dao.UserAdviceImgDao; import com.epmet.dao.UserAdviceImgDao;
import com.epmet.dto.UserAdviceImgDTO; import com.epmet.dto.UserAdviceImgDTO;
import com.epmet.entity.UserAdviceImgEntity; import com.epmet.entity.UserAdviceImgEntity;
import com.epmet.redis.UserAdviceImgRedis;
import com.epmet.service.UserAdviceImgService; import com.epmet.service.UserAdviceImgService;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -46,9 +44,6 @@ import java.util.Map;
@Service @Service
public class UserAdviceImgServiceImpl extends BaseServiceImpl<UserAdviceImgDao, UserAdviceImgEntity> implements UserAdviceImgService { public class UserAdviceImgServiceImpl extends BaseServiceImpl<UserAdviceImgDao, UserAdviceImgEntity> implements UserAdviceImgService {
@Autowired
private UserAdviceImgRedis userAdviceImgRedis;
@Override @Override
public PageData<UserAdviceImgDTO> page(Map<String, Object> params) { public PageData<UserAdviceImgDTO> page(Map<String, Object> params) {
IPage<UserAdviceImgEntity> page = baseDao.selectPage( IPage<UserAdviceImgEntity> page = baseDao.selectPage(

6
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.commons.tools.utils.ScanContentUtils;
import com.epmet.constant.UserAdviceConstant; import com.epmet.constant.UserAdviceConstant;
import com.epmet.dao.UserAdviceDao; import com.epmet.dao.UserAdviceDao;
import com.epmet.dto.CustomerAgencyDTO;
import com.epmet.dto.CustomerDTO; import com.epmet.dto.CustomerDTO;
import com.epmet.dto.CustomerGridDTO; import com.epmet.dto.CustomerGridDTO;
import com.epmet.dto.UserAdviceDTO; import com.epmet.dto.UserAdviceDTO;
@ -47,7 +46,6 @@ import com.epmet.entity.UserAdviceEntity;
import com.epmet.entity.UserAdviceImgEntity; import com.epmet.entity.UserAdviceImgEntity;
import com.epmet.feign.GovOrgOpenFeignClient; import com.epmet.feign.GovOrgOpenFeignClient;
import com.epmet.feign.OperCrmOpenFeignClient; import com.epmet.feign.OperCrmOpenFeignClient;
import com.epmet.redis.UserAdviceRedis;
import com.epmet.service.UserAdviceImgService; import com.epmet.service.UserAdviceImgService;
import com.epmet.service.UserAdviceService; import com.epmet.service.UserAdviceService;
import com.epmet.service.UserResiInfoService; import com.epmet.service.UserResiInfoService;
@ -61,8 +59,6 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
/** /**
@ -75,8 +71,6 @@ import java.util.*;
public class UserAdviceServiceImpl extends BaseServiceImpl<UserAdviceDao, UserAdviceEntity> implements UserAdviceService { public class UserAdviceServiceImpl extends BaseServiceImpl<UserAdviceDao, UserAdviceEntity> implements UserAdviceService {
private Logger logger = LogManager.getLogger(UserAdviceServiceImpl.class); private Logger logger = LogManager.getLogger(UserAdviceServiceImpl.class);
@Autowired
private UserAdviceRedis userAdviceRedis;
@Autowired @Autowired
private UserAdviceImgService userAdviceImgService; private UserAdviceImgService userAdviceImgService;

7
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.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; 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.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
import com.epmet.dao.UserInvitationDao; import com.epmet.dao.UserInvitationDao;
import com.epmet.dto.UserInvitationDTO; import com.epmet.dto.UserInvitationDTO;
import com.epmet.dto.form.UserInvitationFormDTO; import com.epmet.dto.form.UserInvitationFormDTO;
import com.epmet.entity.UserInvitationEntity; import com.epmet.entity.UserInvitationEntity;
import com.epmet.redis.UserInvitationRedis;
import com.epmet.service.UserInvitationService; import com.epmet.service.UserInvitationService;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
@ -50,9 +48,6 @@ import java.util.Map;
@Service @Service
public class UserInvitationServiceImpl extends BaseServiceImpl<UserInvitationDao, UserInvitationEntity> implements UserInvitationService { public class UserInvitationServiceImpl extends BaseServiceImpl<UserInvitationDao, UserInvitationEntity> implements UserInvitationService {
@Autowired
private UserInvitationRedis userInvitationRedis;
@Override @Override
public PageData<UserInvitationDTO> page(Map<String, Object> params) { public PageData<UserInvitationDTO> page(Map<String, Object> params) {
IPage<UserInvitationEntity> page = baseDao.selectPage( IPage<UserInvitationEntity> page = baseDao.selectPage(

9
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.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; 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.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.FieldConstant; 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.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result; 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.ResiRegisterFormDTO;
import com.epmet.dto.form.VerificationCodeFormDTO; import com.epmet.dto.form.VerificationCodeFormDTO;
import com.epmet.dto.result.ResiRegisterResultDTO; import com.epmet.dto.result.ResiRegisterResultDTO;
import com.epmet.entity.UserResiInfoEntity;
import com.epmet.entity.UserResiRegisterVisitEntity; import com.epmet.entity.UserResiRegisterVisitEntity;
import com.epmet.redis.UserResiRegisterVisitRedis;
import com.epmet.service.UserResiRegisterVisitService; import com.epmet.service.UserResiRegisterVisitService;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
@ -61,8 +56,6 @@ public class UserResiRegisterVisitServiceImpl extends BaseServiceImpl<UserResiRe
private static final Logger log = LoggerFactory.getLogger(UserResiRegisterVisitServiceImpl.class); private static final Logger log = LoggerFactory.getLogger(UserResiRegisterVisitServiceImpl.class);
@Autowired @Autowired
private UserResiRegisterVisitRedis userResiRegisterVisitRedis;
@Autowired
private UserResiRegisterVisitDao userResiRegisterVisitDao; private UserResiRegisterVisitDao userResiRegisterVisitDao;
@Override @Override
@ -175,4 +168,4 @@ public class UserResiRegisterVisitServiceImpl extends BaseServiceImpl<UserResiRe
} }
} }
} }

3
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserRoleServiceImpl.java

@ -31,7 +31,6 @@ import com.epmet.dto.UserRoleDTO;
import com.epmet.dto.form.UserRoleFormDTO; import com.epmet.dto.form.UserRoleFormDTO;
import com.epmet.dto.result.UserRoleResultDTO; import com.epmet.dto.result.UserRoleResultDTO;
import com.epmet.entity.UserRoleEntity; import com.epmet.entity.UserRoleEntity;
import com.epmet.redis.UserRoleRedis;
import com.epmet.service.RoleService; import com.epmet.service.RoleService;
import com.epmet.service.UserRoleService; import com.epmet.service.UserRoleService;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
@ -52,8 +51,6 @@ import java.util.Map;
@Service @Service
public class UserRoleServiceImpl extends BaseServiceImpl<UserRoleDao, UserRoleEntity> implements UserRoleService { public class UserRoleServiceImpl extends BaseServiceImpl<UserRoleDao, UserRoleEntity> implements UserRoleService {
@Autowired
private UserRoleRedis userRoleRedis;
@Autowired @Autowired
private RoleService roleService; private RoleService roleService;

Loading…
Cancel
Save