Browse Source

/resi/mine/mygrid/latestgridinfo?appId=XX调整

feature/teamB_zz_wgh
yinzuomei 3 years ago
parent
commit
c6665639b1
  1. 2
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/GridInfoCache.java
  2. 16
      epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/grid/service/impl/ResiMineGridServiceImpl.java

2
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/GridInfoCache.java

@ -115,7 +115,7 @@ public class GridInfoCache implements Serializable {
private String coordinates;
/**
* 弃用标记
* 弃用标记 弃用1正常使用0
*/
private Integer abandonFlag;

16
epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/grid/service/impl/ResiMineGridServiceImpl.java

@ -3,6 +3,7 @@ package com.epmet.modules.grid.service.impl;
import com.alibaba.fastjson.JSON;
import com.epmet.commons.tools.constant.AppClientConstant;
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.RenException;
import com.epmet.commons.tools.redis.common.CustomerOrgRedis;
@ -107,7 +108,7 @@ public class ResiMineGridServiceImpl implements ResiMineGridService {
**/
@Override
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();
@ -160,6 +161,19 @@ public class ResiMineGridServiceImpl implements ResiMineGridService {
}
result.setGridId(StringUtils.isNotBlank(userResult.getData().getGridId()) ? userResult.getData().getGridId() : "");
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;
}

Loading…
Cancel
Save