Browse Source

Merge remote-tracking branch 'remotes/origin/dev_abandon_grid' into develop

dev
jianjun 3 years ago
parent
commit
0f4acf87a3
  1. 3
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/CustomerOrgRedis.java
  2. 4
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerGridDao.xml
  3. 5
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/org/result/CustomerGridDTO.java
  4. 8
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java
  5. 2
      epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.13__abandon_grid.sql
  6. 3
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml

3
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/CustomerOrgRedis.java

@ -1,6 +1,7 @@
package com.epmet.commons.tools.redis.common; package com.epmet.commons.tools.redis.common;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import com.alibaba.fastjson.JSON;
import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.feign.CommonAggFeignClient; import com.epmet.commons.tools.feign.CommonAggFeignClient;
import com.epmet.commons.tools.redis.RedisKeys; import com.epmet.commons.tools.redis.RedisKeys;
@ -51,6 +52,7 @@ public class CustomerOrgRedis {
public static GridInfoCache getGridInfo(String gridId){ public static GridInfoCache getGridInfo(String gridId){
String key = RedisKeys.getGridInfoKey(gridId); String key = RedisKeys.getGridInfoKey(gridId);
Map<String, Object> grid = customerOrgRedis.redisUtils.hGetAll(key); Map<String, Object> grid = customerOrgRedis.redisUtils.hGetAll(key);
log.info("grid is {}", JSON.toJSONString(grid));
if (!CollectionUtils.isEmpty(grid)) { if (!CollectionUtils.isEmpty(grid)) {
return ConvertUtils.mapToEntity(grid, GridInfoCache.class); return ConvertUtils.mapToEntity(grid, GridInfoCache.class);
} }
@ -62,6 +64,7 @@ public class CustomerOrgRedis {
//throw new RenException("没有此网格信息..."); //throw new RenException("没有此网格信息...");
return null; return null;
} }
log.info("select grid info is {}", JSON.toJSONString(gridInfoResult.getData()));
Map<String, Object> map = BeanUtil.beanToMap(gridInfoResult.getData(), false, true); Map<String, Object> map = BeanUtil.beanToMap(gridInfoResult.getData(), false, true);
customerOrgRedis.redisUtils.hMSet(key, map); customerOrgRedis.redisUtils.hMSet(key, map);
return gridInfoResult.getData(); return gridInfoResult.getData();

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

@ -174,8 +174,8 @@
cg.* cg.*
FROM customer_grid cg FROM customer_grid cg
LEFT JOIN customer_agency ca ON (ca.ID = cg.PID AND ca.DEL_FLAG = '0') LEFT JOIN customer_agency ca ON (ca.ID = cg.PID AND ca.DEL_FLAG = '0')
WHERE cg.DEL_FLAG = '0' WHERE cg.ID = #{gridId}
AND cg.ID = #{gridId} AND cg.DEL_FLAG = '0'
</select> </select>
</mapper> </mapper>

5
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/org/result/CustomerGridDTO.java

@ -131,4 +131,9 @@ public class CustomerGridDTO implements Serializable {
* 所有上级组织名 * 所有上级组织名
*/ */
private String allParentName; private String allParentName;
/**
* 弃用标记
*/
private Integer abandonFlag;
} }

8
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java

@ -822,14 +822,6 @@ public class CustomerGridServiceImpl extends BaseServiceImpl<CustomerGridDao, Cu
if (null != gridInfo) { if (null != gridInfo) {
redisUtils.hMSet(redisKey, BeanUtil.beanToMap(gridInfo)); redisUtils.hMSet(redisKey, BeanUtil.beanToMap(gridInfo));
} }
/*CustomerGridDTO gridInfo = ConvertUtils.sourceToTarget(baseDao.selectById(customerGridFormDTO.getGridId()), CustomerGridDTO.class);
if (null != gridInfo) {
CustomerAgencyEntity agency = customerAgencyService.selectById(gridInfo.getPid());
gridInfo.setAgencyName(null != agency ? agency.getOrganizationName() : "");
gridInfo.setGridNamePath(null != agency ? agency.getOrganizationName().concat("-").concat(gridInfo.getGridName()) : gridInfo.getGridName());
redisUtils.hMSet(redisKey, BeanUtil.beanToMap(gridInfo));
}*/
return gridInfo; return gridInfo;
} }

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

@ -1,3 +1,3 @@
alter table customer_grid alter table customer_grid
add column ABANDON_FLAG TINYINT(1) default '0' add column ABANDON_FLAG TINYINT(1) NOT NULL default '0'
comment '弃用:1;正常使用:0' after SYNC_FLAG; comment '弃用:1;正常使用:0' after SYNC_FLAG;

3
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml

@ -766,7 +766,8 @@
cg.mobile, cg.mobile,
<!-- 网格没有经纬度时获取客户根组织下的 --> <!-- 网格没有经纬度时获取客户根组织下的 -->
IFNULL(cg.longitude,ca.longitude) longitude, IFNULL(cg.longitude,ca.longitude) longitude,
IFNULL(cg.latitude,ca.latitude) latitude IFNULL(cg.latitude,ca.latitude) latitude,
cg.ABANDON_FLAG
FROM FROM
customer_grid cg customer_grid cg
INNER JOIN customer_agency ca ON ca.pid = '0' AND ca.customer_id = cg.customer_id INNER JOIN customer_agency ca ON ca.pid = '0' AND ca.customer_id = cg.customer_id

Loading…
Cancel
Save