Browse Source

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

dev_shibei_match
yinzuomei 4 years ago
parent
commit
5df83046a9
  1. 2
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/CommonAggFeignClient.java
  2. 2
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java
  3. 35
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/CustomerStaffRedis.java
  4. 2
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/RoleUsersResultDTO.java
  5. 2
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/ReceiverDTO.java
  6. 42
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/form/StaffDetailV2FormDTO.java
  7. 8
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/result/StaffDetailV2ResultDTO.java
  8. 2
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/result/StaffOrgNameResultDTO.java
  9. 26
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/message/result/InfoRedDotResultDTO.java
  10. 2
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/GovOrgController.java
  11. 13
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/InfoController.java
  12. 6
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/CustomerStaffDao.java
  13. 2
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerStaffAgencyDao.java
  14. 9
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetmessage/EpmetMessageService.java
  15. 18
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetmessage/impl/EpmetMessageServiceImpl.java
  16. 8
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/EpmetUserService.java
  17. 35
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java
  18. 21
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java
  19. 10
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/CustomerStaffDao.xml
  20. 6
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerAgencyDao.xml
  21. 16
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenProjectServiceImpl.java
  22. 2
      epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.6__add_staff_org_relation.sql
  23. 9
      epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java
  24. 5
      epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java
  25. 25
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffRoleController.java
  26. 47
      epmet-user/epmet-user-server/src/main/java/com/epmet/redis/CustomerStaffRedis.java
  27. 47
      epmet-user/epmet-user-server/src/main/java/com/epmet/redis/GovStaffRoleRedis.java
  28. 47
      epmet-user/epmet-user-server/src/main/java/com/epmet/redis/GridLatestRedis.java
  29. 47
      epmet-user/epmet-user-server/src/main/java/com/epmet/redis/GridVisitedRedis.java
  30. 47
      epmet-user/epmet-user-server/src/main/java/com/epmet/redis/OperUserRedis.java
  31. 47
      epmet-user/epmet-user-server/src/main/java/com/epmet/redis/RegisterRelationRedis.java
  32. 47
      epmet-user/epmet-user-server/src/main/java/com/epmet/redis/RoleRedis.java
  33. 75
      epmet-user/epmet-user-server/src/main/java/com/epmet/redis/StaffInfoRedis.java
  34. 86
      epmet-user/epmet-user-server/src/main/java/com/epmet/redis/StaffRoleRedis.java
  35. 47
      epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserAdviceImgRedis.java
  36. 47
      epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserAdviceRedis.java
  37. 47
      epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserInvitationRedis.java
  38. 47
      epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserResiRegisterVisitRedis.java
  39. 47
      epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserRoleRedis.java
  40. 24
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffRoleService.java
  41. 13
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java
  42. 8
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/GovStaffRoleServiceImpl.java
  43. 10
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/GridLatestServiceImpl.java
  44. 5
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/OperUserServiceImpl.java
  45. 8
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/RoleServiceImpl.java
  46. 74
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffRoleServiceImpl.java
  47. 7
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserAdviceImgServiceImpl.java
  48. 6
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserAdviceServiceImpl.java
  49. 7
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserInvitationServiceImpl.java
  50. 9
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserResiRegisterVisitServiceImpl.java
  51. 3
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserRoleServiceImpl.java

2
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/CommonAggFeignClient.java

@ -13,7 +13,7 @@ import org.springframework.web.bind.annotation.PostMapping;
* @Description
* @Author sun
*/
@FeignClient(name = ServiceConstant.DATA_AGGREGATOR_SERVER, fallbackFactory = CommonAggFeignClientFallBackFactory.class,url = "http://localhost:8114")
@FeignClient(name = ServiceConstant.DATA_AGGREGATOR_SERVER, fallbackFactory = CommonAggFeignClientFallBackFactory.class)
public interface CommonAggFeignClient {
/**

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

@ -498,6 +498,6 @@ public class RedisKeys {
* @return
*/
public static String getCustomerStaffInfoKey(String customerId, String staffId) {
return rootPrefix.concat(customerId).concat(StrConstant.COLON).concat(staffId);
return rootPrefix.concat("gov:staff").concat(customerId).concat(StrConstant.COLON).concat(staffId);
}
}

35
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/CustomerStaffRedis.java

@ -12,8 +12,8 @@ import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.jetbrains.annotations.Nullable;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;
import java.util.Map;
@ -25,18 +25,19 @@ import java.util.Map;
* @since v1.0.0 2020-04-22
*/
@Slf4j
@Component
public class CustomerStaffRedis {
@Autowired
private RedisUtils redisUtils;
@Autowired
private CommonAggFeignClient commonAggFeignClient;
private static final String ROLE_MAP_KEY = "roleMap";
//@PostConstruct
public void init() {
CustomerStaffInfoCacheResult role = this.getStaffInfo("45687aa479955f9d06204d415238f7cc", "9e37adcce6472152e6508a19d3683e02");
role = this.getStaffInfo("45687aa479955f9d06204d415238f7cc", "7f694a66efe60a47c2114875f310248a");
System.out.println(JSON.toJSONString(role));
System.out.println(JSON.toJSONString(this.getStaffRoleMap("45687aa479955f9d06204d415238f7cc", "7f694a66efe60a47c2114875f310248a")));
}
/**
@ -56,6 +57,14 @@ public class CustomerStaffRedis {
return ConvertUtils.mapToEntity(roleMap, CustomerStaffInfoCacheResult.class);
}
CustomerStaffInfoCache resultData = reloadStaffCache(staffId, key);
if (resultData == null) return null;
return ConvertUtils.sourceToTarget(resultData,CustomerStaffInfoCacheResult.class);
}
@Nullable
private CustomerStaffInfoCache reloadStaffCache(String staffId, String key) {
Result<CustomerStaffInfoCache> staffResult = commonAggFeignClient.getStaffInfo(staffId);
if (staffResult == null || !staffResult.success()) {
throw new RenException("获取工作人员信息失败");
@ -68,8 +77,28 @@ public class CustomerStaffRedis {
Map<String, Object> map = BeanUtil.beanToMap(resultData, false, true);
redisUtils.hMSet(key, map);
return resultData;
}
return ConvertUtils.sourceToTarget(resultData,CustomerStaffInfoCacheResult.class);
/**
* desc: 根据工作人员Id 获取某工作人员角色map信息
*
* @param customerId
* @param staffId
* @return com.epmet.commons.tools.redis.common.bean.CustomerStaffInfoCache
* @author LiuJanJun
* @date 2021/8/19 10:29 下午
* @remark 此方法仅用于 获取某个工作人员的信息不用于获取客户下所有工作人员信息
*/
public Map<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;
}
reloadStaffCache(staffId, key);
return getStaffRoleMap(customerId,staffId);
}
/**

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 headPhoto;
private String orgName;
private String gender;
private Integer gender;
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未知
*/
private String gender;
private Integer gender;
}

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

@ -4,6 +4,8 @@ import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
* @Description 通讯录人员详情v2-接口返参
@ -12,20 +14,32 @@ import java.io.Serializable;
@Data
public class StaffDetailV2FormDTO implements Serializable {
private static final long serialVersionUID = -1974456701949979946L;
@NotBlank(message = "parentAgencyId不能为空",groups = AddUserInternalGroup.class)
private String parentAgencyId;
private String areaCode;
/**
* 社区级community
* 街道:street,
* 区县级: district,
* 市级: city
* 省级:province
*/
@NotBlank(message = "level不能为空",groups = AddUserInternalGroup.class)
private String level;
public interface AddUserInternalGroup {
}
//工作人员用户id
private String staffId = "";
//工作人员姓名
private String name = "";
//性别
private String gender = "";
//手机号
private String mobile = "";
//头像
private String headPhoto = "";
//激活状态:inactive未激活,active已激活
private String activeFlag = "";
//激活时间
private Date activeTime;
//未禁用enable,已禁用disabled
private String enableFlag = "";
//fulltime专职parttime兼职
private String workType = "";
//人员新增所属组织名【组织-组织,组织-部门,组织-网格】
private String orgName = "";
//人员添加类型的Id
private String orgId = "";
//人员添加时的类型【agency;dept;grid】
private String orgType = "";
//职责名称列表
private List<String> roles;
}

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

@ -17,8 +17,10 @@
package com.epmet.dataaggre.dto.govorg.result;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
@ -32,8 +34,10 @@ public class StaffDetailV2ResultDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 树结构对象
* 工资人员Id
*/
private AgencyGridResultDTO agencyGridList;
@NotBlank(message = "人员Id不能为空", groups = StaffDetailV2ResultDTO.Staff.class)
private String staffId;
public interface Staff extends CustomerClientShowGroup {}
}

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

@ -40,6 +40,6 @@ public class StaffOrgNameResultDTO implements Serializable {
//工作人员添加入口Id(agencyId;deptId;gridId)
private String orgId = "";
//工作人员添加入口类型(组织:agency;部门:dept;网格:gridId)
private String orgname = "";
private String orgType = "";
}

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

@ -0,0 +1,26 @@
package com.epmet.dataaggre.dto.message.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2021/8/20 3:22 下午
* @DESC
*/
@Data
public class InfoRedDotResultDTO implements Serializable {
private static final long serialVersionUID = 6417699657069808978L;
/**
* 我发出的新回复数量
*/
private Integer sentNewReplyCount;
/**
* 我收到的未读的消息数量
*/
private Integer receivedUnReadCount;
}

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

@ -146,7 +146,7 @@ public class GovOrgController {
*/
@PostMapping("staffdetailv2")
public Result<StaffDetailV2FormDTO> staffDetailV2(@RequestBody StaffDetailV2ResultDTO formDTO) {
//ValidatorUtils.validateEntity(formDTO, StaffDetailV2ResultDTO.listGridMemberDatas.class);
ValidatorUtils.validateEntity(formDTO, StaffDetailV2ResultDTO.Staff.class);
return new Result<StaffDetailV2FormDTO>().ok(govOrgService.staffDetailV2(formDTO));
}

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

@ -10,6 +10,7 @@ import com.epmet.dataaggre.dto.govorg.result.ReceiversResultDTO;
import com.epmet.dataaggre.dto.message.form.InfoGroupDetailFormDTO;
import com.epmet.dataaggre.dto.message.form.InfoRepliesFormDTO;
import com.epmet.dataaggre.dto.message.result.InfoGroupDetailResDTO;
import com.epmet.dataaggre.dto.message.result.InfoRedDotResultDTO;
import com.epmet.dataaggre.dto.message.result.InfoReplyResDTO;
import com.epmet.dataaggre.dto.message.result.MyInfoGroupResultDTO;
import com.epmet.dataaggre.service.epmetmessage.EpmetMessageService;
@ -92,4 +93,16 @@ public class InfoController {
ValidatorUtils.validateEntity(formDTO, PageFormDTO.AddUserInternalGroup.class);
return new Result<InfoReplyResDTO>().ok(epmetMessageService.queryInfoReplies(formDTO));
}
/**
* @Description 发送消息我收到我发送红点
* @Param userId
* @author zxc
* @date 2021/8/20 3:38 下午
*/
@PostMapping("reddot")
public Result<InfoRedDotResultDTO> redDot(@LoginUser TokenDto tokenDto){
return new Result<InfoRedDotResultDTO>().ok(epmetMessageService.redDot(tokenDto.getUserId()));
}
}

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

@ -58,4 +58,10 @@ public interface CustomerStaffDao extends BaseDao<CustomerStaffEntity> {
* @author sun
*/
List<ListStaffResultDTO> selectStaffList(OrgStaffListFormDTO formDTO);
/**
* @Description 查询工作人员基础信息
* @author sun
*/
CustomerStaffDTO selectByStaffId(@Param("staffId") String staffId);
}

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

@ -60,7 +60,7 @@ public interface CustomerStaffAgencyDao extends BaseDao<CustomerStaffAgencyEntit
* @Description 按类型查询组织部门网格下所有工作人员Id列表
* @author sun
*/
List<String> selectStaffList(String orgId, String orgType);
List<String> selectStaffList(@Param("orgId") String orgId, @Param("orgType") String orgType);
/**
* @Description 获取下级组织列表

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

@ -5,6 +5,7 @@ import com.epmet.dataaggre.dto.govorg.result.ReceiversResultDTO;
import com.epmet.dataaggre.dto.message.form.InfoGroupDetailFormDTO;
import com.epmet.dataaggre.dto.message.form.InfoRepliesFormDTO;
import com.epmet.dataaggre.dto.message.result.InfoGroupDetailResDTO;
import com.epmet.dataaggre.dto.message.result.InfoRedDotResultDTO;
import com.epmet.dataaggre.dto.message.result.InfoReplyResDTO;
import com.epmet.dataaggre.dto.message.result.MyInfoGroupResultDTO;
@ -53,4 +54,12 @@ public interface EpmetMessageService {
* @date 2021/8/20 2:09 下午
*/
InfoReplyResDTO queryInfoReplies(InfoRepliesFormDTO formDTO);
/**
* @Description 发送消息我收到我发送红点
* @Param userId
* @author zxc
* @date 2021/8/20 3:38 下午
*/
InfoRedDotResultDTO redDot(String userId);
}

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

@ -75,7 +75,11 @@ public class EpmetMessageServiceImpl implements EpmetMessageService {
ReceiverDTO dto = new ReceiverDTO();
dto.setStaffId(item.getStaffId());
dto.setReadFlag(item.getReadFlag());
//TODO redis获取用户信息
CustomerStaffInfoCacheResult staffInfoCache = customerStaffRedis.getStaffInfo(item.getCustomerId(), item.getStaffId());
dto.setStaffName(staffInfoCache.getRealName());
dto.setGender(staffInfoCache.getGender());
dto.setHeadPhoto(staffInfoCache.getHeadPhoto());
dto.setOrgName(staffInfoCache.getTwoOrgName());
return dto;
}).collect(Collectors.toList());
result.setDataList(dataList);
@ -173,6 +177,18 @@ public class EpmetMessageServiceImpl implements EpmetMessageService {
return result;
}
/**
* @Description 发送消息我收到我发送红点
* 我发出的查询info_profile限制住created_by=当前用户 sum未读的回复数
* 我收到的info_receivers并且未读的 count(distinct info_id)
* @Param userId
* @author zxc
* @date 2021/8/20 3:38 下午
*/
@Override
public InfoRedDotResultDTO redDot(String userId) {
return null;
}
}

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

@ -1,8 +1,10 @@
package com.epmet.dataaggre.service.epmetuser;
import com.epmet.dataaggre.dto.epmetuser.CustomerStaffDTO;
import com.epmet.dataaggre.dto.epmetuser.form.*;
import com.epmet.dataaggre.dto.epmetuser.result.*;
import com.epmet.dataaggre.dto.govorg.form.OrgStaffListFormDTO;
import com.epmet.dataaggre.dto.govorg.form.StaffDetailV2FormDTO;
import com.epmet.dataaggre.dto.govorg.result.GridStaffResultDTO;
import java.util.List;
@ -132,4 +134,10 @@ public interface EpmetUserService {
* @author sun
*/
List<ListStaffResultDTO> getStaffInfoList(OrgStaffListFormDTO formDTO);
/**
* @Description 查询工作人员基础信息角色信息
* @author sun
*/
StaffDetailV2FormDTO selectByStaffId(String staffId);
}

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

@ -5,7 +5,9 @@ import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.dto.form.IdAndNameDTO;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.enums.OrgTypeEnum;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.constant.BadgeConstant;
@ -20,6 +22,7 @@ import com.epmet.dataaggre.dto.govorg.CustomerAgencyDTO;
import com.epmet.dataaggre.dto.govorg.CustomerDepartmentDTO;
import com.epmet.dataaggre.dto.govorg.CustomerGridDTO;
import com.epmet.dataaggre.dto.govorg.form.OrgStaffListFormDTO;
import com.epmet.dataaggre.dto.govorg.form.StaffDetailV2FormDTO;
import com.epmet.dataaggre.dto.govorg.result.GridStaffResultDTO;
import com.epmet.dataaggre.dto.govorg.result.StaffOrgNameResultDTO;
import com.epmet.dataaggre.dto.govorg.result.StaffOrgRelationResultDTO;
@ -73,6 +76,8 @@ public class EpmetUserServiceImpl implements EpmetUserService {
private GovProjectService govProjectService;
@Resource
private GovStaffRoleDao govStaffRoleDao;
@Resource
private CustomerStaffRedis customerStaffRedis;
/**
* @Description 根据UserIds查询
@ -481,7 +486,13 @@ public class EpmetUserServiceImpl implements EpmetUserService {
return staffRoleList.stream().map(item -> {
RoleUsersResultDTO dto = new RoleUsersResultDTO();
dto.setStaffId(item.getStaffId());
//TODO 从redis获取用户信息
//从redis获取用户信息
CustomerStaffInfoCacheResult staffInfoCache = customerStaffRedis.getStaffInfo(item.getCustomerId(), item.getStaffId());
dto.setGender(staffInfoCache.getGender());
dto.setHeadPhoto(staffInfoCache.getHeadPhoto());
dto.setName(staffInfoCache.getRealName());
dto.setOrgName(staffInfoCache.getTwoOrgName());
dto.setRoles(new ArrayList<>(staffInfoCache.getRoleMap().values()));
return dto;
}).collect(Collectors.toList());
}
@ -604,5 +615,27 @@ public class EpmetUserServiceImpl implements EpmetUserService {
return resultList;
}
/**
* @Description 查询工作人员基础信息角色信息
* @author sun
*/
@Override
public StaffDetailV2FormDTO selectByStaffId(String staffId) {
StaffDetailV2FormDTO result = new StaffDetailV2FormDTO();
//基本信息
CustomerStaffDTO dto = customerStaffDao.selectByStaffId(staffId);
if (null == dto) {
return result;
}
//角色信息
List<String> list = staffRoleDao.selectByStaffId(staffId);
//汇总数据
result = ConvertUtils.sourceToTarget(dto, StaffDetailV2FormDTO.class);
result.setName(dto.getRealName());
result.setRoles(list);
return result;
}
}

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

@ -410,7 +410,26 @@ public class GovOrgServiceImpl implements GovOrgService {
*/
@Override
public StaffDetailV2FormDTO staffDetailV2(StaffDetailV2ResultDTO formDTO) {
return null;
//1.查询工作人员基本信息、角色信息
StaffDetailV2FormDTO result = epmetUserService.selectByStaffId(formDTO.getStaffId());
if (null == result) {
return new StaffDetailV2FormDTO();
}
//2.查询工作人员注册组织关系信息
List<String> staffIdList = new ArrayList<>();
staffIdList.add(formDTO.getStaffId());
List<StaffOrgNameResultDTO> list = customerAgencyDao.selelctStaffOrg(staffIdList);
if (null == list || list.size() < NumConstant.ONE) {
throw new RenException("未查询到工作人员注册组织信息");
}
//3.封装数据并返回
result.setOrgId(list.get(0).getOrgId());
result.setOrgName(list.get(0).getOrgName());
result.setOrgType(list.get(0).getOrgType());
return result;
}
/**

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

@ -110,4 +110,14 @@
)
</select>
<select id="selectByStaffId" resultType="com.epmet.dataaggre.dto.epmetuser.CustomerStaffDTO">
SELECT
*
FROM
customer_staff
WHERE
del_flag = '0'
AND USER_ID = #{staffId}
</select>
</mapper>

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

@ -76,7 +76,7 @@
)
)orgName,
sor.org_id orgId,
'agency' orgname
'agency' orgType
FROM
staff_org_relation sor
INNER JOIN customer_agency ca ON sor.org_id = ca.id
@ -103,7 +103,7 @@
)
)orgName,
sor.org_id orgId,
'dept' orgname
'dept' orgType
FROM
staff_org_relation sor
INNER JOIN customer_department cd ON sor.org_id = cd.id
@ -131,7 +131,7 @@
)
)orgName,
sor.org_id orgId,
'grid' orgname
'grid' orgType
FROM
staff_org_relation sor
INNER JOIN customer_grid cg ON sor.org_id = cg.id

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

2
epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.6__add_staff_org_relation.sql

@ -12,7 +12,7 @@ CREATE TABLE `staff_org_relation` (
`UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人',
`UPDATED_TIME` datetime NOT NULL COMMENT '更新时间',
PRIMARY KEY (`ID`) USING BTREE,
UNIQUE KEY `staffid_orgid` (`STAFF_ID`,`ORG_ID`) USING BTREE COMMENT '联合主键'
KEY `staffid` (`STAFF_ID`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='工作人员注册组织关系表';
INSERT INTO staff_org_relation SELECT

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")
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

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);
}
@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.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dto.CustomerAgencyUserRoleDTO;
import com.epmet.dto.GovStaffRoleDTO;
import com.epmet.dto.StaffRoleDTO;
import com.epmet.dto.form.*;
@ -183,30 +182,6 @@ public class StaffRoleController {
return new Result<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/CustomerStaffRedis.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-18
*/
@Component
public class CustomerStaffRedis {
@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/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.tools.page.PageData;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.CustomerAgencyUserRoleDTO;
import com.epmet.dto.StaffRoleDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.form.CommonUserFormDTO;
import com.epmet.dto.form.CustomerStaffRoleListFormDTO;
import com.epmet.dto.form.RoleStaffIdFormDTO;
import com.epmet.dto.form.RolesUsersListFormDTO;
import com.epmet.dto.result.*;
import com.epmet.entity.StaffRoleEntity;
@ -165,22 +167,6 @@ public interface StaffRoleService extends BaseService<StaffRoleEntity> {
*/
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 上午
*/
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;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.entity.DataScope;
@ -30,6 +29,7 @@ import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.ExceptionUtils;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.security.password.PasswordUtils;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.CpUserDetailRedis;
@ -51,14 +51,11 @@ import com.epmet.entity.UserEntity;
import com.epmet.feign.AuthFeignClient;
import com.epmet.feign.GovOrgOpenFeignClient;
import com.epmet.feign.OperCrmOpenFeignClient;
import com.epmet.redis.CustomerStaffRedis;
import com.epmet.redis.StaffRoleRedis;
import com.epmet.service.CustomerStaffService;
import com.epmet.service.GovStaffRoleService;
import com.epmet.service.StaffRoleService;
import com.epmet.service.UserService;
import com.epmet.util.ModuleConstant;
import kotlin.jvm.internal.Lambda;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager;
@ -83,8 +80,6 @@ import java.util.stream.Collectors;
public class CustomerStaffServiceImpl extends BaseServiceImpl<CustomerStaffDao, CustomerStaffEntity> implements CustomerStaffService {
private Logger logger = LogManager.getLogger(getClass());
@Autowired
private CustomerStaffRedis customerStaffRedis;
@Autowired
private GovStaffRoleService govStaffRoleService;
@Autowired
private UserService userService;
@ -105,7 +100,7 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl<CustomerStaffDao,
@Autowired
private OperCrmOpenFeignClient operCrmOpenFeignClient;
@Autowired
private StaffRoleRedis staffRoleRedis;
private CustomerStaffRedis staffRedis;
@Override
public PageData<CustomerStaffDTO> page(Map<String, Object> params) {
@ -348,7 +343,7 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl<CustomerStaffDao,
m.put(r.getRoleKey(),r.getRoleName());
});
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));
}
@ -421,7 +416,7 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl<CustomerStaffDao,
m.put(r.getRoleKey(),r.getRoleName());
});
dto.setRoles(m);
staffRoleRedis.setRole(dto.getCustomerId(), dto.getStaffId(),dto);
staffRedis.delStaffInfoFormCache(dto.getCustomerId(), dto.getStaffId());
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.entity.GovStaffRoleEntity;
import com.epmet.feign.GovAccessFeignClient;
import com.epmet.redis.GovStaffRoleRedis;
import com.epmet.service.GovStaffRoleService;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
@ -45,8 +44,6 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
import java.util.function.Function;
import java.util.stream.Collectors;
/**
@ -60,9 +57,6 @@ public class GovStaffRoleServiceImpl extends BaseServiceImpl<GovStaffRoleDao, Go
private Logger logger = LoggerFactory.getLogger(getClass());
@Autowired
private GovStaffRoleRedis govStaffRoleRedis;
@Autowired
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.dto.CustomerGridDTO;
import com.epmet.dto.GridLatestDTO;
import com.epmet.dto.form.CommonCustomerFormDTO;
import com.epmet.dto.form.CustomerUserFormDTO;
import com.epmet.dto.form.LatestGridInfoFormDTO;
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.entity.GridLatestEntity;
import com.epmet.feign.EpmetHeartOpenFeignClient;
import com.epmet.redis.GridLatestRedis;
import com.epmet.redis.UserBaseInfoRedis;
import com.epmet.service.GridLatestService;
import com.epmet.util.ModuleConstant;
import com.github.pagehelper.PageHelper;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import java.util.*;
import java.util.stream.Collectors;
/**
* 最近访问网格表 记录用户访问网格的最近一次记录对同一网格只记录一条记录同一网格每次只更新最近一次访问的时间
@ -62,17 +57,12 @@ import java.util.stream.Collectors;
*/
@Service
public class GridLatestServiceImpl extends BaseServiceImpl<GridLatestDao, GridLatestEntity> implements GridLatestService {
private Logger logger = LoggerFactory.getLogger(getClass());
@Autowired
private GridLatestRedis gridLatestRedis;
@Autowired
private GridLatestDao gridLatestDao;
@Autowired
private UserBaseInfoRedis userBaseInfoRedis;
@Autowired
private UserWechatDao userWechatDao;
@Autowired
private EpmetHeartOpenFeignClient epmetHeartOpenFeignClient;
@Override

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.UserEntity;
import com.epmet.feign.OperRoleUserFeignClient;
import com.epmet.redis.OperUserRedis;
import com.epmet.service.OperUserService;
import com.epmet.service.UserService;
import org.apache.commons.lang3.StringUtils;
@ -53,8 +52,6 @@ import java.util.Map;
@Service
public class OperUserServiceImpl extends BaseServiceImpl<OperUserDao, OperUserEntity> implements OperUserService {
@Autowired
private OperUserRedis operUserRedis;
@Autowired
private OperUserDao operUserDao;
@Autowired
@ -145,4 +142,4 @@ public class OperUserServiceImpl extends BaseServiceImpl<OperUserDao, OperUserEn
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.form.GetRoleKeyListFormDTO;
import com.epmet.entity.RoleEntity;
import com.epmet.redis.RoleRedis;
import com.epmet.service.RoleService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
@ -43,16 +42,13 @@ import java.util.List;
import java.util.Map;
/**
* 角色表
* 角色表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-03-30
*/
@Service
public class RoleServiceImpl extends BaseServiceImpl<RoleDao, RoleEntity> implements RoleService {
@Autowired
private RoleRedis roleRedis;
@Autowired
private UserRoleDao userRoleDao;
@Autowired
@ -132,4 +128,4 @@ public class RoleServiceImpl extends BaseServiceImpl<RoleDao, RoleEntity> implem
}
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.NumConstant;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dao.GovStaffRoleTemplateDao;
import com.epmet.dao.StaffRoleDao;
import com.epmet.dto.CustomerAgencyUserRoleDTO;
import com.epmet.dto.StaffRoleDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.form.CommonUserFormDTO;
import com.epmet.dto.form.CustomerStaffRoleListFormDTO;
import com.epmet.dto.form.RoleStaffIdFormDTO;
import com.epmet.dto.form.RolesUsersListFormDTO;
import com.epmet.dto.result.*;
import com.epmet.entity.StaffRoleEntity;
import com.epmet.redis.StaffRoleRedis;
import com.epmet.service.StaffRoleService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
@ -42,7 +44,6 @@ import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import java.util.*;
import java.util.stream.Collectors;
/**
* 工作人员-角色关系表
@ -54,7 +55,7 @@ import java.util.stream.Collectors;
public class StaffRoleServiceImpl extends BaseServiceImpl<StaffRoleDao, StaffRoleEntity> implements StaffRoleService {
@Autowired
private StaffRoleRedis staffRoleRedis;
private CustomerStaffRedis staffRedis;
@Autowired
private GovStaffRoleTemplateDao govStaffRoleTemplateDao;
@ -201,67 +202,6 @@ public class StaffRoleServiceImpl extends BaseServiceImpl<StaffRoleDao, StaffRol
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());
}
}
}

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.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.dao.UserAdviceImgDao;
import com.epmet.dto.UserAdviceImgDTO;
import com.epmet.entity.UserAdviceImgEntity;
import com.epmet.redis.UserAdviceImgRedis;
import com.epmet.service.UserAdviceImgService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -46,9 +44,6 @@ import java.util.Map;
@Service
public class UserAdviceImgServiceImpl extends BaseServiceImpl<UserAdviceImgDao, UserAdviceImgEntity> implements UserAdviceImgService {
@Autowired
private UserAdviceImgRedis userAdviceImgRedis;
@Override
public PageData<UserAdviceImgDTO> page(Map<String, Object> params) {
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.constant.UserAdviceConstant;
import com.epmet.dao.UserAdviceDao;
import com.epmet.dto.CustomerAgencyDTO;
import com.epmet.dto.CustomerDTO;
import com.epmet.dto.CustomerGridDTO;
import com.epmet.dto.UserAdviceDTO;
@ -47,7 +46,6 @@ import com.epmet.entity.UserAdviceEntity;
import com.epmet.entity.UserAdviceImgEntity;
import com.epmet.feign.GovOrgOpenFeignClient;
import com.epmet.feign.OperCrmOpenFeignClient;
import com.epmet.redis.UserAdviceRedis;
import com.epmet.service.UserAdviceImgService;
import com.epmet.service.UserAdviceService;
import com.epmet.service.UserResiInfoService;
@ -61,8 +59,6 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
/**
@ -75,8 +71,6 @@ import java.util.*;
public class UserAdviceServiceImpl extends BaseServiceImpl<UserAdviceDao, UserAdviceEntity> implements UserAdviceService {
private Logger logger = LogManager.getLogger(UserAdviceServiceImpl.class);
@Autowired
private UserAdviceRedis userAdviceRedis;
@Autowired
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.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dao.UserInvitationDao;
import com.epmet.dto.UserInvitationDTO;
import com.epmet.dto.form.UserInvitationFormDTO;
import com.epmet.entity.UserInvitationEntity;
import com.epmet.redis.UserInvitationRedis;
import com.epmet.service.UserInvitationService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
@ -50,9 +48,6 @@ import java.util.Map;
@Service
public class UserInvitationServiceImpl extends BaseServiceImpl<UserInvitationDao, UserInvitationEntity> implements UserInvitationService {
@Autowired
private UserInvitationRedis userInvitationRedis;
@Override
public PageData<UserInvitationDTO> page(Map<String, Object> params) {
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.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
@ -34,9 +31,7 @@ import com.epmet.dto.UserResiRegisterVisitDTO;
import com.epmet.dto.form.ResiRegisterFormDTO;
import com.epmet.dto.form.VerificationCodeFormDTO;
import com.epmet.dto.result.ResiRegisterResultDTO;
import com.epmet.entity.UserResiInfoEntity;
import com.epmet.entity.UserResiRegisterVisitEntity;
import com.epmet.redis.UserResiRegisterVisitRedis;
import com.epmet.service.UserResiRegisterVisitService;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
@ -61,8 +56,6 @@ public class UserResiRegisterVisitServiceImpl extends BaseServiceImpl<UserResiRe
private static final Logger log = LoggerFactory.getLogger(UserResiRegisterVisitServiceImpl.class);
@Autowired
private UserResiRegisterVisitRedis userResiRegisterVisitRedis;
@Autowired
private UserResiRegisterVisitDao userResiRegisterVisitDao;
@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.result.UserRoleResultDTO;
import com.epmet.entity.UserRoleEntity;
import com.epmet.redis.UserRoleRedis;
import com.epmet.service.RoleService;
import com.epmet.service.UserRoleService;
import org.apache.commons.lang3.StringUtils;
@ -52,8 +51,6 @@ import java.util.Map;
@Service
public class UserRoleServiceImpl extends BaseServiceImpl<UserRoleDao, UserRoleEntity> implements UserRoleService {
@Autowired
private UserRoleRedis userRoleRedis;
@Autowired
private RoleService roleService;

Loading…
Cancel
Save