|
@ -3,6 +3,7 @@ package com.epmet.modules.grid.service.impl; |
|
|
import com.alibaba.fastjson.JSON; |
|
|
import com.alibaba.fastjson.JSON; |
|
|
import com.epmet.commons.tools.constant.AppClientConstant; |
|
|
import com.epmet.commons.tools.constant.AppClientConstant; |
|
|
import com.epmet.commons.tools.constant.NumConstant; |
|
|
import com.epmet.commons.tools.constant.NumConstant; |
|
|
|
|
|
import com.epmet.commons.tools.constant.StrConstant; |
|
|
import com.epmet.commons.tools.exception.EpmetException; |
|
|
import com.epmet.commons.tools.exception.EpmetException; |
|
|
import com.epmet.commons.tools.exception.RenException; |
|
|
import com.epmet.commons.tools.exception.RenException; |
|
|
import com.epmet.commons.tools.redis.common.CustomerOrgRedis; |
|
|
import com.epmet.commons.tools.redis.common.CustomerOrgRedis; |
|
@ -107,7 +108,7 @@ public class ResiMineGridServiceImpl implements ResiMineGridService { |
|
|
**/ |
|
|
**/ |
|
|
@Override |
|
|
@Override |
|
|
public LatestGridInfoResultDTO latestGridInfo(LatestGridInfoFormDTO formDTO) { |
|
|
public LatestGridInfoResultDTO latestGridInfo(LatestGridInfoFormDTO formDTO) { |
|
|
logger.info(String.format("居民端获取用户最近访问网格入参%s", JSON.toJSONString(formDTO))); |
|
|
// logger.info(String.format("居民端获取用户最近访问网格入参%s", JSON.toJSONString(formDTO)));
|
|
|
|
|
|
|
|
|
// 查询注册网格的弃用状态
|
|
|
// 查询注册网格的弃用状态
|
|
|
LatestGridInfoResultDTO result = new LatestGridInfoResultDTO(); |
|
|
LatestGridInfoResultDTO result = new LatestGridInfoResultDTO(); |
|
@ -160,6 +161,19 @@ public class ResiMineGridServiceImpl implements ResiMineGridService { |
|
|
} |
|
|
} |
|
|
result.setGridId(StringUtils.isNotBlank(userResult.getData().getGridId()) ? userResult.getData().getGridId() : ""); |
|
|
result.setGridId(StringUtils.isNotBlank(userResult.getData().getGridId()) ? userResult.getData().getGridId() : ""); |
|
|
result.setCustomerId(StringUtils.isNotBlank(userResult.getData().getCustomerId()) ? userResult.getData().getCustomerId() : ""); |
|
|
result.setCustomerId(StringUtils.isNotBlank(userResult.getData().getCustomerId()) ? userResult.getData().getCustomerId() : ""); |
|
|
|
|
|
//判断下最后一次访问的网格是否已经被删除或者被弃用
|
|
|
|
|
|
if (StringUtils.isNotBlank(userResult.getData().getGridId())) { |
|
|
|
|
|
GridInfoCache gridInfoCache=CustomerOrgRedis.getGridInfo(result.getGridId()); |
|
|
|
|
|
if (null == gridInfoCache || (null != gridInfoCache.getAbandonFlag() && NumConstant.ONE == gridInfoCache.getAbandonFlag())) { |
|
|
|
|
|
result.setGridId(StrConstant.EPMETY_STR); |
|
|
|
|
|
result.setCustomerId(StrConstant.EPMETY_STR); |
|
|
|
|
|
logger.error(String.format("获取用户最近访问网格异常,网格可能被删除或者被弃用,参数%s",JSON.toJSONString(formDTO))); |
|
|
|
|
|
return result; |
|
|
|
|
|
} |
|
|
|
|
|
result.setGridId(userResult.getData().getGridId()); |
|
|
|
|
|
} else { |
|
|
|
|
|
result.setGridId(StrConstant.EPMETY_STR); |
|
|
|
|
|
} |
|
|
return result; |
|
|
return result; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|