Browse Source

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

# Conflicts:
#	epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetmessage/impl/EpmetMessageServiceImpl.java
master
yinzuomei 4 years ago
parent
commit
9d2361e59f
  1. 2
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/filter/LogMsgSendFilter.java
  2. 2
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java
  3. 53
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/CustomerStaffRedis.java
  4. 5
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/message/result/InfoRedDotResultDTO.java
  5. 5
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/DemoController.java
  6. 16
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetmessage/InfoReceiversDao.java
  7. 15
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetmessage/impl/EpmetMessageServiceImpl.java
  8. 21
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java
  9. 21
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetmessage/InfoReceiversDao.xml
  10. 8
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/CustomerStaffDao.xml
  11. 4
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerStaffAgencyDao.xml
  12. 5
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenProjectServiceImpl.java
  13. 3
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java
  14. 4
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml
  15. 6
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java
  16. 9
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffRoleServiceImpl.java

2
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/filter/LogMsgSendFilter.java

@ -205,7 +205,7 @@ public class LogMsgSendFilter extends LevelFilter {
}
return slashMatcher.start();
} catch (Exception e) {
logger.warn("getCharacterPosition no matche", e);
logger.warn("getCharacterPosition no matche");
return string.length();
}
}

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("gov:staff").concat(customerId).concat(StrConstant.COLON).concat(staffId);
return rootPrefix.concat("gov:staff:").concat(customerId).concat(StrConstant.COLON).concat(staffId);
}
}

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

@ -17,6 +17,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;
import javax.annotation.PostConstruct;
import java.util.Map;
/**
@ -32,14 +33,24 @@ public class CustomerStaffRedis {
private RedisUtils redisUtils;
@Autowired
private CommonAggFeignClient commonAggFeignClient;
private static CustomerStaffRedis customerStaffRedis;
private static final String ROLE_MAP_KEY = "roleMap";
//@PostConstruct
@PostConstruct
public void init() {
CustomerStaffInfoCacheResult role = this.getStaffInfo("45687aa479955f9d06204d415238f7cc", "9e37adcce6472152e6508a19d3683e02");
role = this.getStaffInfo("45687aa479955f9d06204d415238f7cc", "7f694a66efe60a47c2114875f310248a");
customerStaffRedis = this;
customerStaffRedis.redisUtils = this.redisUtils;
customerStaffRedis.commonAggFeignClient = this.commonAggFeignClient;
}
public static void initTest() {
CustomerStaffInfoCacheResult role = getStaffInfo("45687aa479955f9d06204d415238f7cc", "9e37adcce6472152e6508a19d3683e02");
role = getStaffInfo("45687aa479955f9d06204d415238f7cc", "e08316376c972b5cb3f085bb39a3680f");
System.out.println(JSON.toJSONString(role));
System.out.println(JSON.toJSONString(this.getStaffRoleMap("45687aa479955f9d06204d415238f7cc", "7f694a66efe60a47c2114875f310248a")));
role = getStaffInfo("45687aa479955f9d06204d415238f7cc", "ec524bbbc41d0662cbb36236161005e9");
System.out.println(JSON.toJSONString(role));
System.out.println(JSON.toJSONString(getStaffRoleMap("45687aa479955f9d06204d415238f7cc", "7f694a66efe60a47c2114875f310248a")));
}
/**
@ -52,22 +63,24 @@ public class CustomerStaffRedis {
* @date 2021/8/19 10:29 下午
* @remark 此方法仅用于 获取某个工作人员的信息不用于获取客户下所有工作人员信息
*/
public CustomerStaffInfoCacheResult getStaffInfo(String customerId, String staffId) {
public static CustomerStaffInfoCacheResult getStaffInfo(String customerId, String staffId) {
String key = RedisKeys.getCustomerStaffInfoKey(customerId, staffId);
Map<String, Object> roleMap = redisUtils.hGetAll(key);
Map<String, Object> roleMap = customerStaffRedis.redisUtils.hGetAll(key);
if (!CollectionUtils.isEmpty(roleMap)) {
return ConvertUtils.mapToEntity(roleMap, CustomerStaffInfoCacheResult.class);
return ConvertUtils.mapToEntity(roleMap, CustomerStaffInfoCacheResult.class);
}
CustomerStaffInfoCache resultData = reloadStaffCache(staffId, key);
if (resultData == null) return null;
if (resultData == null) {
return null;
}
return ConvertUtils.sourceToTarget(resultData,CustomerStaffInfoCacheResult.class);
return ConvertUtils.sourceToTarget(resultData, CustomerStaffInfoCacheResult.class);
}
@Nullable
private CustomerStaffInfoCache reloadStaffCache(String staffId, String key) {
Result<CustomerStaffInfoCache> staffResult = commonAggFeignClient.getStaffInfo(staffId);
private static CustomerStaffInfoCache reloadStaffCache(String staffId, String key) {
Result<CustomerStaffInfoCache> staffResult = customerStaffRedis.commonAggFeignClient.getStaffInfo(staffId);
if (staffResult == null || !staffResult.success()) {
throw new RenException("获取工作人员信息失败");
}
@ -78,7 +91,7 @@ public class CustomerStaffRedis {
}
Map<String, Object> map = BeanUtil.beanToMap(resultData, false, true);
redisUtils.hMSet(key, map);
customerStaffRedis.redisUtils.hMSet(key, map);
return resultData;
}
@ -87,20 +100,16 @@ public class CustomerStaffRedis {
*
* @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) {
public static 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);
Map<String, String> roleMap = (Map<String, String>) customerStaffRedis.redisUtils.hGet(key, ROLE_MAP_KEY);
if (!CollectionUtils.isEmpty(roleMap)) {
return roleMap;
return roleMap;
}
reloadStaffCache(staffId, key);
return getStaffRoleMap(customerId,staffId);
return getStaffRoleMap(customerId, staffId);
}
/**
@ -112,13 +121,13 @@ public class CustomerStaffRedis {
* @author LiuJanJun
* @date 2021/8/19 10:39 下午
*/
public boolean delStaffInfoFormCache(String customerId, String staffId) {
public static Boolean delStaffInfoFormCache(String customerId, String staffId) {
if (StringUtils.isBlank(customerId) || StringUtils.isBlank(staffId)) {
log.warn("delStaffInfoFormCache param is blank,customerId:{},staffId:{}", customerId, staffId);
return false;
}
String key = RedisKeys.getCustomerStaffInfoKey(customerId, staffId);
return redisUtils.delete(key);
return customerStaffRedis.redisUtils.delete(key);
}
}

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

@ -1,5 +1,6 @@
package com.epmet.dataaggre.dto.message.result;
import com.epmet.commons.tools.constant.NumConstant;
import lombok.Data;
import java.io.Serializable;
@ -17,10 +18,10 @@ public class InfoRedDotResultDTO implements Serializable {
/**
* 我发出的新回复数量
*/
private Integer sentNewReplyCount;
private Integer sentNewReplyCount = NumConstant.ZERO;
/**
* 我收到的未读的消息数量
*/
private Integer receivedUnReadCount;
private Integer receivedUnReadCount = NumConstant.ZERO;
}

5
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/DemoController.java

@ -2,7 +2,6 @@ package com.epmet.dataaggre.controller;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.utils.SpringContextUtils;
import com.epmet.dataaggre.service.DemoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
@ -21,8 +20,8 @@ public class DemoController {
demoService.doIt();
CustomerStaffRedis bean = SpringContextUtils.getBean(CustomerStaffRedis.class);
bean.init();
//CustomerStaffRedis bean = SpringContextUtils.getBean(CustomerStaffRedis.class);
CustomerStaffRedis.initTest();
return new Result();
}

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

@ -90,4 +90,20 @@ public interface InfoReceiversDao extends BaseDao<InfoReceiversEntity> {
* @date 2021/8/20 2:31 下午
*/
List<FileCommonDTO> selectReplyAtt(String replyId);
/**
* @Description 查询我收到的未读的消息数量
* @Param userId
* @author zxc
* @date 2021/8/20 4:16 下午
*/
Integer selectUnReadCount(@Param("userId") String userId);
/**
* @Description 我发出的新回复数量
* @Param userId
* @author zxc
* @date 2021/8/20 4:20 下午
*/
Integer selectNewReplyCount(@Param("userId") String userId);
}

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

@ -46,8 +46,6 @@ public class EpmetMessageServiceImpl implements EpmetMessageService {
@Autowired
private InfoReceiversDao infoReceiversDao;
@Autowired
private CustomerStaffRedis customerStaffRedis;
@Autowired
private InfoProfileDao infoProfileDao;
/**
@ -79,7 +77,7 @@ public class EpmetMessageServiceImpl implements EpmetMessageService {
ReceiverDTO dto = new ReceiverDTO();
dto.setStaffId(item.getStaffId());
dto.setReadFlag(item.getReadFlag());
CustomerStaffInfoCacheResult staffInfoCache = customerStaffRedis.getStaffInfo(item.getCustomerId(), item.getStaffId());
CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(item.getCustomerId(), item.getStaffId());
dto.setStaffName(staffInfoCache.getRealName());
dto.setGender(staffInfoCache.getGender());
dto.setHeadPhoto(staffInfoCache.getHeadPhoto());
@ -109,7 +107,7 @@ public class EpmetMessageServiceImpl implements EpmetMessageService {
List<String> staffNameList = new ArrayList<>();
for (String userId : group.getStaffIdList()) {
//查询每个工作人员的基本信息,获取姓名
CustomerStaffInfoCacheResult staffInfoCache = customerStaffRedis.getStaffInfo(customerId, userId);
CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(customerId, userId);
if (null != staffInfoCache) {
staffNameList.add(staffInfoCache.getRealName());
}
@ -140,7 +138,7 @@ public class EpmetMessageServiceImpl implements EpmetMessageService {
if (CollectionUtils.isNotEmpty(staffIds.getList())) {
for (String userId : staffIds.getList()) {
//查询每个工作人员的基本信息
CustomerStaffInfoCacheResult staffInfoCache = customerStaffRedis.getStaffInfo(formDTO.getCustomerId(), userId);
CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), userId);
if (null != staffInfoCache) {
StaffInfoCommonDTO staffInfo = new StaffInfoCommonDTO();
staffInfo.setStaffId(userId);
@ -171,7 +169,7 @@ public class EpmetMessageServiceImpl implements EpmetMessageService {
result.setTotal((int) data.getTotal());
for (InfoReplyDetail detail : data.getList()) {
//查询每个工作人员的基本信息
CustomerStaffInfoCacheResult staffInfoCache = customerStaffRedis.getStaffInfo(formDTO.getCustomerId(), detail.getStaffId());
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);
@ -191,7 +189,10 @@ public class EpmetMessageServiceImpl implements EpmetMessageService {
*/
@Override
public InfoRedDotResultDTO redDot(String userId) {
return null;
InfoRedDotResultDTO result = new InfoRedDotResultDTO();
result.setReceivedUnReadCount(infoReceiversDao.selectUnReadCount(userId));
result.setSentNewReplyCount(infoReceiversDao.selectNewReplyCount(userId));
return result;
}
/**

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

@ -76,8 +76,6 @@ public class EpmetUserServiceImpl implements EpmetUserService {
private GovProjectService govProjectService;
@Resource
private GovStaffRoleDao govStaffRoleDao;
@Resource
private CustomerStaffRedis customerStaffRedis;
/**
* @Description 根据UserIds查询
@ -487,7 +485,7 @@ public class EpmetUserServiceImpl implements EpmetUserService {
RoleUsersResultDTO dto = new RoleUsersResultDTO();
dto.setStaffId(item.getStaffId());
//从redis获取用户信息
CustomerStaffInfoCacheResult staffInfoCache = customerStaffRedis.getStaffInfo(item.getCustomerId(), item.getStaffId());
CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(item.getCustomerId(), item.getStaffId());
dto.setGender(staffInfoCache.getGender());
dto.setHeadPhoto(staffInfoCache.getHeadPhoto());
dto.setName(staffInfoCache.getRealName());
@ -539,7 +537,7 @@ public class EpmetUserServiceImpl implements EpmetUserService {
CustomerStaffEntity staffEntity = customerStaffDao.selectOne(queryWrapper);
CustomerStaffResultDTO result = ConvertUtils.sourceToTarget(staffEntity, CustomerStaffResultDTO.class);
//2.查询工作人员所属组织信息
//查询工作人员所属组织信息
CustomerAgencyDTO agencyDTO = govOrgService.gridByAgencyId(null,staffId);
if (agencyDTO == null){
log.error("getStaffInfo have any agency staffId:{}",staffId);
@ -571,30 +569,31 @@ public class EpmetUserServiceImpl implements EpmetUserService {
Map<String, String> roleMap = roleList.stream().collect(Collectors.toMap(StaffRoleResultDTO::getRoleKey, StaffRoleResultDTO::getRoleName));
result.setRoleMap(roleMap);
//1.查询当前人员所在的网格列表
//1.查询工作人员所在的网格列表
List<CustomerGridDTO> list = govOrgService.getStaffGridList(staffId);
List<IdAndNameDTO> idAndNameList = new ArrayList<>();
for (CustomerGridDTO customerGridDTO : list) {
IdAndNameDTO grid = new IdAndNameDTO();
if (isContinueMkName && OrgTypeEnum.GRID.getCode().equals(fromOrgType)&&grid.getId().equals(result.getFromOrgId())){
showNameBuilder.append(agencyDTO.getOrganizationName()).append(StrConstant.HYPHEN).append(grid.getName());
}
grid.setId(customerGridDTO.getId());
grid.setName(customerGridDTO.getGridName());
idAndNameList.add(grid);
if (isContinueMkName && OrgTypeEnum.GRID.getCode().equals(fromOrgType)&&grid.getId().equals(result.getFromOrgId())){
showNameBuilder.append(agencyDTO.getOrganizationName()).append(StrConstant.HYPHEN).append(grid.getName());
}
}
result.setGridList(idAndNameList);
//查询工作人员所在的部门列表
List<CustomerDepartmentDTO> deptList = govOrgService.getStaffDeptList(staffId);
idAndNameList = new ArrayList<>();
for (CustomerDepartmentDTO org : deptList) {
IdAndNameDTO dept = new IdAndNameDTO();
if (isContinueMkName && OrgTypeEnum.GRID.getCode().equals(fromOrgType)&&dept.getId().equals(result.getFromOrgId())){
showNameBuilder.append(agencyDTO.getOrganizationName()).append(StrConstant.HYPHEN).append(dept.getName());
}
dept.setId(org.getId());
dept.setName(org.getDepartmentName());
idAndNameList.add(dept);
if (isContinueMkName && OrgTypeEnum.DEPT.getCode().equals(fromOrgType)&&dept.getId().equals(result.getFromOrgId())){
showNameBuilder.append(agencyDTO.getOrganizationName()).append(StrConstant.HYPHEN).append(dept.getName());
}
}
result.setDeptList(idAndNameList);
//特殊处理 显示的名字

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

@ -104,4 +104,25 @@
ORDER BY
m.SORT ASC
</select>
<!-- 查询我收到的未读的消息数量 -->
<select id="selectUnReadCount" resultType="java.lang.Integer">
SELECT
IFNULL(COUNT(INFO_ID),0)
FROM info_receivers
WHERE
DEL_FLAG = '0'
AND STAFF_ID = #{userId}
AND READ_FLAG = 0
</select>
<!-- 我发出的,新回复数量 -->
<select id="selectNewReplyCount" resultType="java.lang.Integer">
SELECT
IFNULL(SUM(UN_READ_REPLY_NUM) ,0)
FROM info_profile
WHERE
DEL_FLAG = '0'
AND CREATED_BY = #{userId}
</select>
</mapper>

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

@ -68,10 +68,10 @@
sr.staff_id,
case when gsr.role_key =
<choose>
<when test="orgType != null orgType == 'agency' ">
<when test="orgType != null and orgType == 'agency' ">
'agency_leader'
</when>
<when test="orgType != null orgType == 'dept' ">
<when test="orgType != null and orgType == 'dept' ">
'dept_leader'
</when>
<otherwise>
@ -92,10 +92,10 @@
ORDER BY
gsr.role_key <![CDATA[<>]]>
<choose>
<when test="orgType != null orgType == 'agency' ">
<when test="orgType != null and orgType == 'agency' ">
'agency_leader'
</when>
<when test="orgType != null orgType == 'dept' ">
<when test="orgType != null and orgType == 'dept' ">
'dept_leader'
</when>
<otherwise>

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

@ -53,7 +53,7 @@
<select id="selectStaffList" resultType="java.lang.String">
<choose>
<when test="orgType != null orgType == 'dept' ">
<when test="orgType != null and orgType == 'dept' ">
SELECT
user_id
FROM
@ -64,7 +64,7 @@
ORDER BY
created_time ASC
</when>
<when test="orgType != null orgType == 'grid' ">
<when test="orgType != null and orgType == 'grid' ">
SELECT
user_id
FROM

5
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenProjectServiceImpl.java

@ -56,8 +56,7 @@ public class ScreenProjectServiceImpl implements ScreenProjectService {
private ScreenEventImgDataDao screenEventImgDataDao;
@Autowired
private ScreenProjectDataDao screenProjectDataDao;
@Autowired
private CustomerStaffRedis staffRedis;
@Autowired
private ScreenProjectCategoryOrgDailyDao screenProjectCategoryOrgDailyDao;
@Autowired
@ -118,7 +117,7 @@ public class ScreenProjectServiceImpl implements ScreenProjectService {
CustomerAgencyUserRoleFormDTO userRoleFormDTO = new CustomerAgencyUserRoleFormDTO();
userRoleFormDTO.setCustomerId(formDTO.getCustomerId());
userRoleFormDTO.setStaffId(item.getReportUserId());
Map<String, String> staffRoleMap = staffRedis.getStaffRoleMap(formDTO.getCustomerId(), item.getReportUserId());
Map<String, String> staffRoleMap = CustomerStaffRedis.getStaffRoleMap(formDTO.getCustomerId(), item.getReportUserId());
if (!CollectionUtils.isEmpty(staffRoleMap)){
item.setReportUserRoleSet(staffRoleMap.keySet());
}

3
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java

@ -331,6 +331,7 @@ public class StaffServiceImpl implements StaffService {
//2.调用user服务,新增用户信息
StaffSubmitFromDTO submitDTO = ConvertUtils.sourceToTarget(fromDTO, StaffSubmitFromDTO.class);
submitDTO.setAgencyId(fromDTO.getOrgId());
Result<CustomerStaffDTO> result = epmetUserFeignClient.addStaff(submitDTO);
if (!result.success()) {
if (result.getCode() != EpmetErrorCode.SERVER_ERROR.getCode()) {
@ -380,7 +381,7 @@ public class StaffServiceImpl implements StaffService {
StaffOrgRelationEntity staffOrgRelationEntity = new StaffOrgRelationEntity();
staffOrgRelationEntity.setCustomerId(fromDTO.getCustomerId());
if("agency".equals(fromDTO.getOrgType())){
staffOrgRelationEntity.setPids(("".equals(orgDTO.getPids()) ? "" : orgDTO.getPids() + ":"));
staffOrgRelationEntity.setPids(("".equals(orgDTO.getPids()) ? "" : orgDTO.getPids()));
}else {
staffOrgRelationEntity.setPids(("".equals(orgDTO.getPids()) ? "" : orgDTO.getPids() + ":") + orgDTO.getAgencyId());
}

4
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml

@ -444,7 +444,7 @@
<select id="selectAgencyDetail" resultType="com.epmet.dto.result.OrgResultDTO">
<choose>
<when test="orgType != null orgType == 'dept' ">
<when test="orgType != null and orgType == 'dept' ">
SELECT
ca.customer_id,
ca.id AS "agencyId",
@ -464,7 +464,7 @@
AND ca.del_flag = '0'
AND cd.id = #{orgId}
</when>
<when test="orgType != null orgType == 'grid' ">
<when test="orgType != null and orgType == 'grid' ">
SELECT
ca.customer_id,
ca.id AS "agencyId",

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

@ -99,8 +99,6 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl<CustomerStaffDao,
private GovStaffRoleDao govStaffRoleDao;
@Autowired
private OperCrmOpenFeignClient operCrmOpenFeignClient;
@Autowired
private CustomerStaffRedis staffRedis;
@Override
public PageData<CustomerStaffDTO> page(Map<String, Object> params) {
@ -343,7 +341,7 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl<CustomerStaffDao,
m.put(r.getRoleKey(),r.getRoleName());
});
dto.setRoles(m);
staffRedis.delStaffInfoFormCache(dto.getCustomerId(), dto.getStaffId());
CustomerStaffRedis.delStaffInfoFormCache(dto.getCustomerId(), dto.getStaffId());
return new Result<CustomerStaffDTO>().ok(ConvertUtils.sourceToTarget(staffEntity, CustomerStaffDTO.class));
}
@ -416,7 +414,7 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl<CustomerStaffDao,
m.put(r.getRoleKey(),r.getRoleName());
});
dto.setRoles(m);
staffRedis.delStaffInfoFormCache(dto.getCustomerId(), dto.getStaffId());
CustomerStaffRedis.delStaffInfoFormCache(dto.getCustomerId(), dto.getStaffId());
return new Result();
}

9
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffRoleServiceImpl.java

@ -24,10 +24,8 @@ 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.StaffRoleDTO;
import com.epmet.dto.form.CommonUserFormDTO;
@ -38,7 +36,6 @@ import com.epmet.dto.result.*;
import com.epmet.entity.StaffRoleEntity;
import com.epmet.service.StaffRoleService;
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;
@ -54,12 +51,6 @@ import java.util.*;
@Service
public class StaffRoleServiceImpl extends BaseServiceImpl<StaffRoleDao, StaffRoleEntity> implements StaffRoleService {
@Autowired
private CustomerStaffRedis staffRedis;
@Autowired
private GovStaffRoleTemplateDao govStaffRoleTemplateDao;
@Override
public PageData<StaffRoleDTO> page(Map<String, Object> params) {
IPage<StaffRoleEntity> page = baseDao.selectPage(

Loading…
Cancel
Save