Browse Source

人房tong'ji'you'hua

master
lichao 2 years ago
parent
commit
395c0bd223
  1. 22
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java
  2. 18
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java
  3. 8
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java

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

@ -1066,4 +1066,26 @@ public class RedisKeys {
public static String getSdtAccessToken(String customerId) {
return rootPrefix.concat("thirdplatform:sdt:accesstoken:").concat(customerId);
};
/**
* @Description: 获取人房数据统计
* @param agencyId:
* @Return java.lang.String
* @Author: lichao
* @Date: 2023/11/1 13:58
*/
public static String getUserchart(String orgType,String agencyId) {
return rootPrefix.concat("resi:icresiuser:userchart:".concat(orgType).concat(StrConstant.COLON).concat(agencyId));
}
/**
* @Description: 获取人房数据统计
* @param agencyId:
* @Return java.lang.String
* @Author: lichao
* @Date: 2023/11/1 13:58
*/
public static String getHousechart(String orgType,String agencyId) {
return rootPrefix.concat("govorg:house:housechart:".concat(orgType).concat(StrConstant.COLON).concat(agencyId));
}
}

18
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java

@ -19,6 +19,8 @@ import com.epmet.commons.tools.exception.ExceptionUtils;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.feign.ResultDataResolver;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.redis.RedisKeys;
import com.epmet.commons.tools.redis.RedisUtils;
import com.epmet.commons.tools.redis.common.CustomerIcHouseRedis;
import com.epmet.commons.tools.redis.common.CustomerOrgRedis;
import com.epmet.commons.tools.redis.common.CustomerResiUserRedis;
@ -55,6 +57,7 @@ import org.apache.commons.lang3.StringUtils;
import org.apache.http.entity.ContentType;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
@ -136,6 +139,10 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver {
@Autowired
private EpmetUserRemoteService epmetUserRemoteService;
@Autowired
private RedisTemplate redisTemplate;
/**
* 房屋管理-新增房屋
*
@ -763,6 +770,13 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver {
formDTO.setOrgId(staffInfo.getAgencyId());
formDTO.setOrgType("agency");
}
// redis LC 新增24小时失效的
if (redisTemplate.opsForValue().get(RedisKeys.getHousechart(formDTO.getOrgType(),formDTO.getOrgId()))!=null){
return (HouseChartResultDTO)redisTemplate.opsForValue().get(RedisKeys.getHousechart(formDTO.getOrgType(),formDTO.getOrgId()));
}
//2.根据入参值查询对应的房屋统计数据
List<HouseChartResultDTO> list = icHouseDao.houseChart(formDTO.getOrgId(), formDTO.getOrgType());
//3.汇总数据
@ -798,6 +812,10 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver {
resultDTO.setCzHouseTotalJSY(resultDTO.getCzHouseTotal() - lastMonthUserHouseStats.getCzHouseTotal());
resultDTO.setXzHouseTotalJSY(resultDTO.getXzHouseTotal() - lastMonthUserHouseStats.getXzHouseTotal());
resultDTO.setZzHouseTotalJSY(resultDTO.getZzHouseTotal() - lastMonthUserHouseStats.getZzHouseTotal());*/
// 24小时过期
redisTemplate.opsForValue().set(RedisKeys.getHousechart(formDTO.getOrgType(),formDTO.getOrgId()), resultDTO, RedisUtils.DEFAULT_EXPIRE, TimeUnit.SECONDS);
return resultDTO;
}

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

@ -2212,6 +2212,12 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
formDTO.setOrgId(staffInfo.getAgencyId());
formDTO.setOrgType("agency");
}
// redis LC 新增24小时失效的
if (redisTemplate.opsForValue().get(RedisKeys.getUserchart(formDTO.getOrgType(),formDTO.getOrgId()))!=null){
return (UserChartResultDTO)redisTemplate.opsForValue().get(RedisKeys.getUserchart(formDTO.getOrgType(),formDTO.getOrgId()));
}
//获取无效组织网格Id列表
if("agency".equals(formDTO.getOrgType())){
//查询组织数据时排除掉当前组织及下级无效组织列表
@ -2255,6 +2261,8 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
resultDTO.setUserTotalJSY(resultDTO.getUserTotal() - lastMonthUserHouseStats.getUserTotal());
resultDTO.setCzUserTotalJSY(resultDTO.getCzUserTotal() - lastMonthUserHouseStats.getCzUserTotal());
resultDTO.setLdUserTotalJSY(resultDTO.getLdUserTotal() - lastMonthUserHouseStats.getLdUserTotal());*/
// 24小时过期
redisTemplate.opsForValue().set(RedisKeys.getUserchart(formDTO.getOrgType(),formDTO.getOrgId()), resultDTO, RedisUtils.DEFAULT_EXPIRE, TimeUnit.SECONDS);
return resultDTO;
}

Loading…
Cancel
Save