Browse Source

Merge remote-tracking branch 'remotes/origin/dev' into 市北生产

feature/teamB_zz_wgh
jianjun 4 years ago
parent
commit
e5c78ff0b3
  1. 2
      epmet-admin/epmet-admin-server/src/main/java/com/epmet/config/NacosServiceListListenerRegisterer.java
  2. 2
      epmet-auth/src/main/java/com/epmet/config/NacosServiceListListenerRegisterer.java
  3. 14
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java
  4. 2
      epmet-gateway/src/main/java/com/epmet/config/NacosServiceListListenerRegisterer.java
  5. 2
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/config/NacosServiceListListenerRegisterer.java
  6. 2
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/config/NacosServiceListListenerRegisterer.java
  7. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/config/NacosServiceListListenerRegisterer.java
  8. 2
      epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/config/NacosServiceListListenerRegisterer.java
  9. 2
      epmet-module/epmet-demo/epmet-demo-server/src/main/java/com/epmet/config/NacosServiceListListenerRegisterer.java
  10. 2
      epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/config/NacosServiceListListenerRegisterer.java
  11. 2
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/config/NacosServiceListListenerRegisterer.java
  12. 2
      epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/config/NacosServiceListListenerRegisterer.java
  13. 2
      epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/config/NacosServiceListListenerRegisterer.java
  14. 2
      epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/config/NacosServiceListListenerRegisterer.java
  15. 2
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/config/NacosServiceListListenerRegisterer.java
  16. 2
      epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/config/NacosServiceListListenerRegisterer.java
  17. 2
      epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/config/NacosServiceListListenerRegisterer.java
  18. 4
      epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/GovCustomerMenuRedis.java
  19. 2
      epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/config/NacosServiceListListenerRegisterer.java
  20. 2
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/config/NacosServiceListListenerRegisterer.java
  21. 2
      epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/config/NacosServiceListListenerRegisterer.java
  22. 2
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/config/NacosServiceListListenerRegisterer.java
  23. 1
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/ImportHouseInfoListener.java
  24. 2
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/config/NacosServiceListListenerRegisterer.java
  25. 2
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/config/NacosServiceListListenerRegisterer.java
  26. 3
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/OpenDataApplication.java
  27. 2
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/config/NacosServiceListListenerRegisterer.java
  28. 33
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/dao/GriderOnlineNumDao.java
  29. 61
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/GriderOnlineNumEntity.java
  30. 38
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/GriderOnlineNumService.java
  31. 69
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/GriderOnlineNumServiceImpl.java
  32. 73
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/task/ExtractBizDataToOpenData.java
  33. 13
      epmet-module/open-data-worker/open-data-worker-server/src/main/resources/db/migration/V0.0.1__add_grider_online_num.sql
  34. 6
      epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/GriderOnlineNumDao.xml
  35. 2
      epmet-module/oper-access/oper-access-server/src/main/java/com/epmet/config/NacosServiceListListenerRegisterer.java
  36. 2
      epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/config/NacosServiceListListenerRegisterer.java
  37. 2
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/config/NacosServiceListListenerRegisterer.java
  38. 2
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/config/NacosServiceListListenerRegisterer.java
  39. 2
      epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/config/NacosServiceListListenerRegisterer.java
  40. 2
      epmet-module/resi-hall/resi-hall-server/src/main/java/com/epmet/config/NacosServiceListListenerRegisterer.java
  41. 2
      epmet-module/resi-home/resi-home-server/src/main/java/com/epmet/config/NacosServiceListListenerRegisterer.java
  42. 2
      epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/config/NacosServiceListListenerRegisterer.java
  43. 2
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/config/NacosServiceListListenerRegisterer.java
  44. 2
      epmet-module/resi-voice/resi-voice-server/src/main/java/com/epmet/config/NacosServiceListListenerRegisterer.java
  45. 2
      epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/config/NacosServiceListListenerRegisterer.java
  46. 3
      epmet-openapi/epmet-openapi-scan/src/main/resources/logback-spring.xml
  47. 2
      epmet-user/epmet-user-server/src/main/java/com/epmet/config/NacosServiceListListenerRegisterer.java
  48. 47
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java
  49. 2
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserImportService.java
  50. 22
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserImportServiceImpl.java
  51. 0
      epmet-user/epmet-user-server/src/main/resources/excel/ic_resi_import_template.xls

2
epmet-admin/epmet-admin-server/src/main/java/com/epmet/config/NacosServiceListListenerRegisterer.java

@ -105,7 +105,7 @@ public class NacosServiceListListenerRegisterer {
public void onEvent(Event event) {
if (event instanceof NamingEvent) {
NamingEvent namingEvent = (NamingEvent) event;
log.info("【Nacos服务列表刷新监听】收到事件:{}:[{}]", namingEvent.getServiceName(), namingEvent.getInstances());
log.debug("【Nacos服务列表刷新监听】收到事件:{}:[{}]", namingEvent.getServiceName(), namingEvent.getInstances());
doRefreshServerList(service);
}
}

2
epmet-auth/src/main/java/com/epmet/config/NacosServiceListListenerRegisterer.java

@ -105,7 +105,7 @@ public class NacosServiceListListenerRegisterer {
public void onEvent(Event event) {
if (event instanceof NamingEvent) {
NamingEvent namingEvent = (NamingEvent) event;
log.info("【Nacos服务列表刷新监听】收到事件:{}:[{}]", namingEvent.getServiceName(), namingEvent.getInstances());
log.debug("【Nacos服务列表刷新监听】收到事件:{}:[{}]", namingEvent.getServiceName(), namingEvent.getInstances());
doRefreshServerList(service);
}
}

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

@ -10,6 +10,8 @@ package com.epmet.commons.tools.redis;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.utils.DateUtils;
import org.apache.commons.lang3.StringUtils;
@ -774,4 +776,16 @@ public class RedisKeys {
public static String getNextAreaCodeKey(String areaCode) {
return rootPrefix.concat("areaCode:parentCode:").concat(areaCode);
}
/**
* desc:获取分布式锁key
* @param methodName
* @return
*/
public static String getLockByMethodName(String methodName) {
if (StringUtils.isBlank(methodName)){
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"参数错误");
}
return rootPrefix.concat("lock:").concat(methodName);
}
}

2
epmet-gateway/src/main/java/com/epmet/config/NacosServiceListListenerRegisterer.java

@ -105,7 +105,7 @@ public class NacosServiceListListenerRegisterer {
public void onEvent(Event event) {
if (event instanceof NamingEvent) {
NamingEvent namingEvent = (NamingEvent) event;
log.info("【Nacos服务列表刷新监听】收到事件:{}:[{}]", namingEvent.getServiceName(), namingEvent.getInstances());
log.debug("【Nacos服务列表刷新监听】收到事件:{}:[{}]", namingEvent.getServiceName(), namingEvent.getInstances());
doRefreshServerList(service);
}
}

2
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/config/NacosServiceListListenerRegisterer.java

@ -105,7 +105,7 @@ public class NacosServiceListListenerRegisterer {
public void onEvent(Event event) {
if (event instanceof NamingEvent) {
NamingEvent namingEvent = (NamingEvent) event;
log.info("【Nacos服务列表刷新监听】收到事件:{}:[{}]", namingEvent.getServiceName(), namingEvent.getInstances());
log.debug("【Nacos服务列表刷新监听】收到事件:{}:[{}]", namingEvent.getServiceName(), namingEvent.getInstances());
doRefreshServerList(service);
}
}

2
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/config/NacosServiceListListenerRegisterer.java

@ -105,7 +105,7 @@ public class NacosServiceListListenerRegisterer {
public void onEvent(Event event) {
if (event instanceof NamingEvent) {
NamingEvent namingEvent = (NamingEvent) event;
log.info("【Nacos服务列表刷新监听】收到事件:{}:[{}]", namingEvent.getServiceName(), namingEvent.getInstances());
log.debug("【Nacos服务列表刷新监听】收到事件:{}:[{}]", namingEvent.getServiceName(), namingEvent.getInstances());
doRefreshServerList(service);
}
}

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/config/NacosServiceListListenerRegisterer.java

@ -105,7 +105,7 @@ public class NacosServiceListListenerRegisterer {
public void onEvent(Event event) {
if (event instanceof NamingEvent) {
NamingEvent namingEvent = (NamingEvent) event;
log.info("【Nacos服务列表刷新监听】收到事件:{}:[{}]", namingEvent.getServiceName(), namingEvent.getInstances());
log.debug("【Nacos服务列表刷新监听】收到事件:{}:[{}]", namingEvent.getServiceName(), namingEvent.getInstances());
doRefreshServerList(service);
}
}

2
epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/config/NacosServiceListListenerRegisterer.java

@ -105,7 +105,7 @@ public class NacosServiceListListenerRegisterer {
public void onEvent(Event event) {
if (event instanceof NamingEvent) {
NamingEvent namingEvent = (NamingEvent) event;
log.info("【Nacos服务列表刷新监听】收到事件:{}:[{}]", namingEvent.getServiceName(), namingEvent.getInstances());
log.debug("【Nacos服务列表刷新监听】收到事件:{}:[{}]", namingEvent.getServiceName(), namingEvent.getInstances());
doRefreshServerList(service);
}
}

2
epmet-module/epmet-demo/epmet-demo-server/src/main/java/com/epmet/config/NacosServiceListListenerRegisterer.java

@ -105,7 +105,7 @@ public class NacosServiceListListenerRegisterer {
public void onEvent(Event event) {
if (event instanceof NamingEvent) {
NamingEvent namingEvent = (NamingEvent) event;
log.info("【Nacos服务列表刷新监听】收到事件:{}:[{}]", namingEvent.getServiceName(), namingEvent.getInstances());
log.debug("【Nacos服务列表刷新监听】收到事件:{}:[{}]", namingEvent.getServiceName(), namingEvent.getInstances());
doRefreshServerList(service);
}
}

2
epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/config/NacosServiceListListenerRegisterer.java

@ -105,7 +105,7 @@ public class NacosServiceListListenerRegisterer {
public void onEvent(Event event) {
if (event instanceof NamingEvent) {
NamingEvent namingEvent = (NamingEvent) event;
log.info("【Nacos服务列表刷新监听】收到事件:{}:[{}]", namingEvent.getServiceName(), namingEvent.getInstances());
log.debug("【Nacos服务列表刷新监听】收到事件:{}:[{}]", namingEvent.getServiceName(), namingEvent.getInstances());
doRefreshServerList(service);
}
}

2
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/config/NacosServiceListListenerRegisterer.java

@ -105,7 +105,7 @@ public class NacosServiceListListenerRegisterer {
public void onEvent(Event event) {
if (event instanceof NamingEvent) {
NamingEvent namingEvent = (NamingEvent) event;
log.info("【Nacos服务列表刷新监听】收到事件:{}:[{}]", namingEvent.getServiceName(), namingEvent.getInstances());
log.debug("【Nacos服务列表刷新监听】收到事件:{}:[{}]", namingEvent.getServiceName(), namingEvent.getInstances());
doRefreshServerList(service);
}
}

2
epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/config/NacosServiceListListenerRegisterer.java

@ -105,7 +105,7 @@ public class NacosServiceListListenerRegisterer {
public void onEvent(Event event) {
if (event instanceof NamingEvent) {
NamingEvent namingEvent = (NamingEvent) event;
log.info("【Nacos服务列表刷新监听】收到事件:{}:[{}]", namingEvent.getServiceName(), namingEvent.getInstances());
log.debug("【Nacos服务列表刷新监听】收到事件:{}:[{}]", namingEvent.getServiceName(), namingEvent.getInstances());
doRefreshServerList(service);
}
}

2
epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/config/NacosServiceListListenerRegisterer.java

@ -105,7 +105,7 @@ public class NacosServiceListListenerRegisterer {
public void onEvent(Event event) {
if (event instanceof NamingEvent) {
NamingEvent namingEvent = (NamingEvent) event;
log.info("【Nacos服务列表刷新监听】收到事件:{}:[{}]", namingEvent.getServiceName(), namingEvent.getInstances());
log.debug("【Nacos服务列表刷新监听】收到事件:{}:[{}]", namingEvent.getServiceName(), namingEvent.getInstances());
doRefreshServerList(service);
}
}

2
epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/config/NacosServiceListListenerRegisterer.java

@ -105,7 +105,7 @@ public class NacosServiceListListenerRegisterer {
public void onEvent(Event event) {
if (event instanceof NamingEvent) {
NamingEvent namingEvent = (NamingEvent) event;
log.info("【Nacos服务列表刷新监听】收到事件:{}:[{}]", namingEvent.getServiceName(), namingEvent.getInstances());
log.debug("【Nacos服务列表刷新监听】收到事件:{}:[{}]", namingEvent.getServiceName(), namingEvent.getInstances());
doRefreshServerList(service);
}
}

2
epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/config/NacosServiceListListenerRegisterer.java

@ -105,7 +105,7 @@ public class NacosServiceListListenerRegisterer {
public void onEvent(Event event) {
if (event instanceof NamingEvent) {
NamingEvent namingEvent = (NamingEvent) event;
log.info("【Nacos服务列表刷新监听】收到事件:{}:[{}]", namingEvent.getServiceName(), namingEvent.getInstances());
log.debug("【Nacos服务列表刷新监听】收到事件:{}:[{}]", namingEvent.getServiceName(), namingEvent.getInstances());
doRefreshServerList(service);
}
}

2
epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/config/NacosServiceListListenerRegisterer.java

@ -105,7 +105,7 @@ public class NacosServiceListListenerRegisterer {
public void onEvent(Event event) {
if (event instanceof NamingEvent) {
NamingEvent namingEvent = (NamingEvent) event;
log.info("【Nacos服务列表刷新监听】收到事件:{}:[{}]", namingEvent.getServiceName(), namingEvent.getInstances());
log.debug("【Nacos服务列表刷新监听】收到事件:{}:[{}]", namingEvent.getServiceName(), namingEvent.getInstances());
doRefreshServerList(service);
}
}

2
epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/config/NacosServiceListListenerRegisterer.java

@ -105,7 +105,7 @@ public class NacosServiceListListenerRegisterer {
public void onEvent(Event event) {
if (event instanceof NamingEvent) {
NamingEvent namingEvent = (NamingEvent) event;
log.info("【Nacos服务列表刷新监听】收到事件:{}:[{}]", namingEvent.getServiceName(), namingEvent.getInstances());
log.debug("【Nacos服务列表刷新监听】收到事件:{}:[{}]", namingEvent.getServiceName(), namingEvent.getInstances());
doRefreshServerList(service);
}
}

4
epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/GovCustomerMenuRedis.java

@ -17,6 +17,7 @@
package com.epmet.redis;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.redis.RedisKeys;
import com.epmet.commons.tools.redis.RedisUtils;
@ -25,6 +26,7 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;
import java.util.List;
@ -46,7 +48,7 @@ public class GovCustomerMenuRedis {
* @see com.epmet.enums.MenuTypeEnum
*/
public void setCustomerMenuList(String customerId, Integer type, List<GovMenuDTO> govMenuDTOS) {
if (checkParam(customerId, type)) {
if (checkParam(customerId, type) && !CollectionUtils.isEmpty(govMenuDTOS) && StringUtils.isNotBlank(govMenuDTOS.get(NumConstant.ZERO).getName())) {
String key = RedisKeys.getCustomerMenuList(customerId, type);
redisUtils.set(key, govMenuDTOS, RedisUtils.DEFAULT_EXPIRE);
}

2
epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/config/NacosServiceListListenerRegisterer.java

@ -105,7 +105,7 @@ public class NacosServiceListListenerRegisterer {
public void onEvent(Event event) {
if (event instanceof NamingEvent) {
NamingEvent namingEvent = (NamingEvent) event;
log.info("【Nacos服务列表刷新监听】收到事件:{}:[{}]", namingEvent.getServiceName(), namingEvent.getInstances());
log.debug("【Nacos服务列表刷新监听】收到事件:{}:[{}]", namingEvent.getServiceName(), namingEvent.getInstances());
doRefreshServerList(service);
}
}

2
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/config/NacosServiceListListenerRegisterer.java

@ -105,7 +105,7 @@ public class NacosServiceListListenerRegisterer {
public void onEvent(Event event) {
if (event instanceof NamingEvent) {
NamingEvent namingEvent = (NamingEvent) event;
log.info("【Nacos服务列表刷新监听】收到事件:{}:[{}]", namingEvent.getServiceName(), namingEvent.getInstances());
log.debug("【Nacos服务列表刷新监听】收到事件:{}:[{}]", namingEvent.getServiceName(), namingEvent.getInstances());
doRefreshServerList(service);
}
}

2
epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/config/NacosServiceListListenerRegisterer.java

@ -105,7 +105,7 @@ public class NacosServiceListListenerRegisterer {
public void onEvent(Event event) {
if (event instanceof NamingEvent) {
NamingEvent namingEvent = (NamingEvent) event;
log.info("【Nacos服务列表刷新监听】收到事件:{}:[{}]", namingEvent.getServiceName(), namingEvent.getInstances());
log.debug("【Nacos服务列表刷新监听】收到事件:{}:[{}]", namingEvent.getServiceName(), namingEvent.getInstances());
doRefreshServerList(service);
}
}

2
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/config/NacosServiceListListenerRegisterer.java

@ -105,7 +105,7 @@ public class NacosServiceListListenerRegisterer {
public void onEvent(Event event) {
if (event instanceof NamingEvent) {
NamingEvent namingEvent = (NamingEvent) event;
log.info("【Nacos服务列表刷新监听】收到事件:{}:[{}]", namingEvent.getServiceName(), namingEvent.getInstances());
log.debug("【Nacos服务列表刷新监听】收到事件:{}:[{}]", namingEvent.getServiceName(), namingEvent.getInstances());
doRefreshServerList(service);
}
}

1
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/ImportHouseInfoListener.java

@ -228,6 +228,7 @@ public class ImportHouseInfoListener extends AnalysisEventListener<HouseInfoMode
// 集合里重复的
if (!r.getAddStatus()){
nums.add(r.getNum());
info = ConvertUtils.sourceToTarget(r,HouseInfoModel.class);
disposeErrorMsg(info,"文件中存在重复数据");
r.setExistStatus(true);
r.setAddStatus(true);

2
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/config/NacosServiceListListenerRegisterer.java

@ -105,7 +105,7 @@ public class NacosServiceListListenerRegisterer {
public void onEvent(Event event) {
if (event instanceof NamingEvent) {
NamingEvent namingEvent = (NamingEvent) event;
log.info("【Nacos服务列表刷新监听】收到事件:{}:[{}]", namingEvent.getServiceName(), namingEvent.getInstances());
log.debug("【Nacos服务列表刷新监听】收到事件:{}:[{}]", namingEvent.getServiceName(), namingEvent.getInstances());
doRefreshServerList(service);
}
}

2
epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/config/NacosServiceListListenerRegisterer.java

@ -105,7 +105,7 @@ public class NacosServiceListListenerRegisterer {
public void onEvent(Event event) {
if (event instanceof NamingEvent) {
NamingEvent namingEvent = (NamingEvent) event;
log.info("【Nacos服务列表刷新监听】收到事件:{}:[{}]", namingEvent.getServiceName(), namingEvent.getInstances());
log.debug("【Nacos服务列表刷新监听】收到事件:{}:[{}]", namingEvent.getServiceName(), namingEvent.getInstances());
doRefreshServerList(service);
}
}

3
epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/OpenDataApplication.java

@ -5,7 +5,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.scheduling.annotation.EnableScheduling;
/**
* @Description OpenData服务启动类
@ -14,6 +14,7 @@ import org.springframework.context.annotation.ComponentScan;
* @author wxz
* @date 2021.10.13 15:16:05
*/
@EnableScheduling
@SpringBootApplication
@EnableDiscoveryClient
@EnableFeignClients

2
epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/config/NacosServiceListListenerRegisterer.java

@ -105,7 +105,7 @@ public class NacosServiceListListenerRegisterer {
public void onEvent(Event event) {
if (event instanceof NamingEvent) {
NamingEvent namingEvent = (NamingEvent) event;
log.info("【Nacos服务列表刷新监听】收到事件:{}:[{}]", namingEvent.getServiceName(), namingEvent.getInstances());
log.debug("【Nacos服务列表刷新监听】收到事件:{}:[{}]", namingEvent.getServiceName(), namingEvent.getInstances());
doRefreshServerList(service);
}
}

33
epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/dao/GriderOnlineNumDao.java

@ -0,0 +1,33 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.opendata.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.opendata.entity.GriderOnlineNumEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 在线网格员人数
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-10-14
*/
@Mapper
public interface GriderOnlineNumDao extends BaseDao<GriderOnlineNumEntity> {
}

61
epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/GriderOnlineNumEntity.java

@ -0,0 +1,61 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.opendata.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 用户巡查主记录
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-10-14
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("grider_online_num")
public class GriderOnlineNumEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户Id
*/
private String customerId;
private String qxGridId;
/**
* 推送时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date pushTime;
/**
* 在线数
*/
private Integer onlineNum;
}

38
epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/GriderOnlineNumService.java

@ -0,0 +1,38 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.opendata.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.opendata.entity.GriderOnlineNumEntity;
/**
* 用户巡查主记录
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-10-14
*/
public interface GriderOnlineNumService extends BaseService<GriderOnlineNumEntity> {
/**
* desc:插入巡查中的网格员数据
* @return boolean
*/
Boolean insertData(String agencyId);
}

69
epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/GriderOnlineNumServiceImpl.java

@ -0,0 +1,69 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.opendata.service.impl;
import com.alibaba.fastjson.JSON;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.form.PatrolCountFormDTO;
import com.epmet.dto.result.PatrolCountResultDTO;
import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.opendata.dao.GriderOnlineNumDao;
import com.epmet.opendata.entity.GriderOnlineNumEntity;
import com.epmet.opendata.service.GriderOnlineNumService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
/**
* 用户巡查主记录
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-10-14
*/
@Slf4j
@Service
public class GriderOnlineNumServiceImpl extends BaseServiceImpl<GriderOnlineNumDao, GriderOnlineNumEntity> implements GriderOnlineNumService {
@Autowired
private EpmetUserOpenFeignClient epmetUserOpenFeignClient;
@Override
public Boolean insertData(String agencyId) {
PatrolCountFormDTO param = new PatrolCountFormDTO();
param.setAgencyId(agencyId);
Result<PatrolCountResultDTO> patrolCountResult = epmetUserOpenFeignClient.patrolCount(param);
log.debug("insertData patrolCountResult return:{}", JSON.toJSONString(patrolCountResult));
if (patrolCountResult == null || !patrolCountResult.success()) {
log.warn("insertData patrolCount fail,return null");
return false;
}
PatrolCountResultDTO data = patrolCountResult.getData();
int count = data.getPatrollingCount() == null ? NumConstant.ZERO : data.getPatrollingCount();
GriderOnlineNumEntity entity = new GriderOnlineNumEntity();
entity.setCustomerId(StrConstant.PY_CUSTOMER);
entity.setPushTime(new Date());
entity.setOnlineNum(count);
baseDao.insert(entity);
return true;
}
}

73
epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/task/ExtractBizDataToOpenData.java

@ -0,0 +1,73 @@
package com.epmet.opendata.task;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.distributedlock.DistributedLock;
import com.epmet.commons.tools.redis.RedisKeys;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.opendata.service.GriderOnlineNumService;
import lombok.extern.slf4j.Slf4j;
import org.redisson.api.RLock;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import java.util.Date;
/**
* desc:
*
* @author: LiuJanJun
* @date: 2022/4/12 4:21 下午
* @version: 1.0
*/
@Slf4j
@Component
public class ExtractBizDataToOpenData {
@Autowired
private DistributedLock distributedLock;
@Autowired
private GriderOnlineNumService griderOnlineNumService;
@Scheduled(cron = "0 30 */2 * * *")
//@Scheduled(cron = "0/15 * * * * *")
public void extractGridMemberPatrollingCount() {
String currentTime = DateUtils.format(new Date(), DateUtils.DATE_TIME_PATTERN);
log.info("extractGridMemberPatrollingCount start,date:{}", currentTime);
RLock rLock = null;
try {
rLock = distributedLock.tryLock(RedisKeys.getLockByMethodName("extractGridMemberPatrollingCount"));
if (rLock == null || !rLock.isLocked()) {
log.warn("tryLock method extractGridMemberPatrollingCount fail");
return;
}
boolean patrolCountResult;
int retryTime = NumConstant.THREE;
do {
//StrConstant.PY_ROOT_AGENCY
patrolCountResult = griderOnlineNumService.insertData(StrConstant.PY_ROOT_AGENCY);
//如果成功 则跳出循环
if (patrolCountResult) {
break;
}
//如果失败 待重试次数剩为1时 就让歇个 5分钟
if (retryTime == 1) {
Thread.sleep(NumConstant.FIVE * NumConstant.SIXTY * NumConstant.ONE_THOUSAND);
}
} while (retryTime-- > 0);
if (!patrolCountResult) {
log.error("插入网格员在线人数失败,请检查原因,时间:{}", currentTime);
}
//休眠10s
Thread.sleep( NumConstant.TEN * NumConstant.ONE_THOUSAND);
} catch (Exception e) {
log.warn("tryLock method extractGridMemberPatrollingCount fail");
} finally {
distributedLock.unLock(rLock);
}
log.info("extractGridMemberPatrollingCount end");
}
}

13
epmet-module/open-data-worker/open-data-worker-server/src/main/resources/db/migration/V0.0.1__add_grider_online_num.sql

@ -0,0 +1,13 @@
CREATE TABLE `grider_online_num` (
`ID` varchar(64) NOT NULL COMMENT '主键',
`CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id',
`ONLINE_NUM` int(11) NOT NULL COMMENT '在线人数',
`PUSH_TIME` datetime NOT NULL COMMENT '推送时间',
`DEL_FLAG` bigint(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0.未删除 1.已删除',
`REVISION` int(11) NOT NULL COMMENT '乐观锁',
`CREATED_BY` varchar(64) NOT NULL COMMENT '创建人',
`CREATED_TIME` datetime NOT NULL COMMENT '创建时间',
`UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人',
`UPDATED_TIME` datetime NOT NULL COMMENT '更新时间',
PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='网格员在线人数';

6
epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/GriderOnlineNumDao.xml

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.opendata.dao.GriderOnlineNumDao">
</mapper>

2
epmet-module/oper-access/oper-access-server/src/main/java/com/epmet/config/NacosServiceListListenerRegisterer.java

@ -105,7 +105,7 @@ public class NacosServiceListListenerRegisterer {
public void onEvent(Event event) {
if (event instanceof NamingEvent) {
NamingEvent namingEvent = (NamingEvent) event;
log.info("【Nacos服务列表刷新监听】收到事件:{}:[{}]", namingEvent.getServiceName(), namingEvent.getInstances());
log.debug("【Nacos服务列表刷新监听】收到事件:{}:[{}]", namingEvent.getServiceName(), namingEvent.getInstances());
doRefreshServerList(service);
}
}

2
epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/config/NacosServiceListListenerRegisterer.java

@ -105,7 +105,7 @@ public class NacosServiceListListenerRegisterer {
public void onEvent(Event event) {
if (event instanceof NamingEvent) {
NamingEvent namingEvent = (NamingEvent) event;
log.info("【Nacos服务列表刷新监听】收到事件:{}:[{}]", namingEvent.getServiceName(), namingEvent.getInstances());
log.debug("【Nacos服务列表刷新监听】收到事件:{}:[{}]", namingEvent.getServiceName(), namingEvent.getInstances());
doRefreshServerList(service);
}
}

2
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/config/NacosServiceListListenerRegisterer.java

@ -105,7 +105,7 @@ public class NacosServiceListListenerRegisterer {
public void onEvent(Event event) {
if (event instanceof NamingEvent) {
NamingEvent namingEvent = (NamingEvent) event;
log.info("【Nacos服务列表刷新监听】收到事件:{}:[{}]", namingEvent.getServiceName(), namingEvent.getInstances());
log.debug("【Nacos服务列表刷新监听】收到事件:{}:[{}]", namingEvent.getServiceName(), namingEvent.getInstances());
doRefreshServerList(service);
}
}

2
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/config/NacosServiceListListenerRegisterer.java

@ -105,7 +105,7 @@ public class NacosServiceListListenerRegisterer {
public void onEvent(Event event) {
if (event instanceof NamingEvent) {
NamingEvent namingEvent = (NamingEvent) event;
log.info("【Nacos服务列表刷新监听】收到事件:{}:[{}]", namingEvent.getServiceName(), namingEvent.getInstances());
log.debug("【Nacos服务列表刷新监听】收到事件:{}:[{}]", namingEvent.getServiceName(), namingEvent.getInstances());
doRefreshServerList(service);
}
}

2
epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/config/NacosServiceListListenerRegisterer.java

@ -105,7 +105,7 @@ public class NacosServiceListListenerRegisterer {
public void onEvent(Event event) {
if (event instanceof NamingEvent) {
NamingEvent namingEvent = (NamingEvent) event;
log.info("【Nacos服务列表刷新监听】收到事件:{}:[{}]", namingEvent.getServiceName(), namingEvent.getInstances());
log.debug("【Nacos服务列表刷新监听】收到事件:{}:[{}]", namingEvent.getServiceName(), namingEvent.getInstances());
doRefreshServerList(service);
}
}

2
epmet-module/resi-hall/resi-hall-server/src/main/java/com/epmet/config/NacosServiceListListenerRegisterer.java

@ -105,7 +105,7 @@ public class NacosServiceListListenerRegisterer {
public void onEvent(Event event) {
if (event instanceof NamingEvent) {
NamingEvent namingEvent = (NamingEvent) event;
log.info("【Nacos服务列表刷新监听】收到事件:{}:[{}]", namingEvent.getServiceName(), namingEvent.getInstances());
log.debug("【Nacos服务列表刷新监听】收到事件:{}:[{}]", namingEvent.getServiceName(), namingEvent.getInstances());
doRefreshServerList(service);
}
}

2
epmet-module/resi-home/resi-home-server/src/main/java/com/epmet/config/NacosServiceListListenerRegisterer.java

@ -105,7 +105,7 @@ public class NacosServiceListListenerRegisterer {
public void onEvent(Event event) {
if (event instanceof NamingEvent) {
NamingEvent namingEvent = (NamingEvent) event;
log.info("【Nacos服务列表刷新监听】收到事件:{}:[{}]", namingEvent.getServiceName(), namingEvent.getInstances());
log.debug("【Nacos服务列表刷新监听】收到事件:{}:[{}]", namingEvent.getServiceName(), namingEvent.getInstances());
doRefreshServerList(service);
}
}

2
epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/config/NacosServiceListListenerRegisterer.java

@ -105,7 +105,7 @@ public class NacosServiceListListenerRegisterer {
public void onEvent(Event event) {
if (event instanceof NamingEvent) {
NamingEvent namingEvent = (NamingEvent) event;
log.info("【Nacos服务列表刷新监听】收到事件:{}:[{}]", namingEvent.getServiceName(), namingEvent.getInstances());
log.debug("【Nacos服务列表刷新监听】收到事件:{}:[{}]", namingEvent.getServiceName(), namingEvent.getInstances());
doRefreshServerList(service);
}
}

2
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/config/NacosServiceListListenerRegisterer.java

@ -105,7 +105,7 @@ public class NacosServiceListListenerRegisterer {
public void onEvent(Event event) {
if (event instanceof NamingEvent) {
NamingEvent namingEvent = (NamingEvent) event;
log.info("【Nacos服务列表刷新监听】收到事件:{}:[{}]", namingEvent.getServiceName(), namingEvent.getInstances());
log.debug("【Nacos服务列表刷新监听】收到事件:{}:[{}]", namingEvent.getServiceName(), namingEvent.getInstances());
doRefreshServerList(service);
}
}

2
epmet-module/resi-voice/resi-voice-server/src/main/java/com/epmet/config/NacosServiceListListenerRegisterer.java

@ -105,7 +105,7 @@ public class NacosServiceListListenerRegisterer {
public void onEvent(Event event) {
if (event instanceof NamingEvent) {
NamingEvent namingEvent = (NamingEvent) event;
log.info("【Nacos服务列表刷新监听】收到事件:{}:[{}]", namingEvent.getServiceName(), namingEvent.getInstances());
log.debug("【Nacos服务列表刷新监听】收到事件:{}:[{}]", namingEvent.getServiceName(), namingEvent.getInstances());
doRefreshServerList(service);
}
}

2
epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/config/NacosServiceListListenerRegisterer.java

@ -105,7 +105,7 @@ public class NacosServiceListListenerRegisterer {
public void onEvent(Event event) {
if (event instanceof NamingEvent) {
NamingEvent namingEvent = (NamingEvent) event;
log.info("【Nacos服务列表刷新监听】收到事件:{}:[{}]", namingEvent.getServiceName(), namingEvent.getInstances());
log.debug("【Nacos服务列表刷新监听】收到事件:{}:[{}]", namingEvent.getServiceName(), namingEvent.getInstances());
doRefreshServerList(service);
}
}

3
epmet-openapi/epmet-openapi-scan/src/main/resources/logback-spring.xml

@ -142,9 +142,8 @@
<springProfile name="dev,test">
<logger name="org.springframework.web" level="INFO"/>
<logger name="org.springboot.sample" level="INFO"/>
<logger name="com.epmet.dao" level="INFO"/>
<logger name="com.epmet.dao" level="DEBUG"/>
<root level="INFO">
<root level="DEBUG">
<appender-ref ref="DEBUG_FILE"/>
<appender-ref ref="INFO_FILE"/>
<appender-ref ref="WARN_FILE"/>

2
epmet-user/epmet-user-server/src/main/java/com/epmet/config/NacosServiceListListenerRegisterer.java

@ -105,7 +105,7 @@ public class NacosServiceListListenerRegisterer {
public void onEvent(Event event) {
if (event instanceof NamingEvent) {
NamingEvent namingEvent = (NamingEvent) event;
log.info("【Nacos服务列表刷新监听】收到事件:{}:[{}]", namingEvent.getServiceName(), namingEvent.getInstances());
log.debug("【Nacos服务列表刷新监听】收到事件:{}:[{}]", namingEvent.getServiceName(), namingEvent.getInstances());
doRefreshServerList(service);
}
}

47
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java

@ -72,6 +72,7 @@ import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
@ -135,7 +136,7 @@ public class IcResiUserController implements ResultDataResolver {
* 模板枚举
*/
public enum IcUserTemplateEnums {
IC_RESI_IMPORT_TEMPLATE("excel/ic_resi_info_import_cid_for_easy_excel.xls", "居民信息导入模板.xls"),
IC_RESI_IMPORT_TEMPLATE("excel/ic_resi_import_template.xls", "居民信息导入模板.xls"),
IC_RESI_EXPORT_TEMPLATE("excel/ic_resi_info_cid_for_easy_excel.xlsx", "居民信息导出模板.xlsx");
private String pathInApp;
@ -157,18 +158,13 @@ public class IcResiUserController implements ResultDataResolver {
{
// 初始化上传目录
String home = System.getProperty("user.home");
Path importDir = Paths.get(home, "epmet_files", "ic_user_import");
if (Files.notExists(importDir)) {
try {
Files.createDirectories(importDir);
IC_RESI_UPLOAD_DIR = com.epmet.commons.tools.utils.FileUtils.getAndCreateDirUnderEpmetFilesDir("ic_user_import");
} catch (IOException e) {
log.error("创建数字赋能平台上传目录失败");
log.error("初始化居民信息上传目录失败:{}", ExceptionUtils.getErrorStackTrace(e));
}
}
IC_RESI_UPLOAD_DIR = importDir;
Path exportDir = Paths.get(home, "epmet_files", "ic_user_export");
Path exportDir = Paths.get(System.getProperty("user.home"), "epmet_files", "ic_user_export");
if (Files.notExists(exportDir)) {
try {
Files.createDirectories(exportDir);
@ -469,10 +465,10 @@ public class IcResiUserController implements ResultDataResolver {
// 三.异步执行导入
executorService.execute(() -> {
boolean isAllSuccess = false;
try {
List<FormItemResult> formItemList = icResiUserService.listFormItems(customerId,IcFormCodeEnum.RESI_BASE_INFO.getCode());
icResiUserImportService.importIcResiInfoFromExcel(importTaskId, formItemList, importTempFileSavePath.toString(), response, IC_RESI_UPLOAD_DIR);
isAllSuccess = icResiUserImportService.importIcResiInfoFromExcel(importTaskId, formItemList, importTempFileSavePath.toString(), response, IC_RESI_UPLOAD_DIR);
} catch (Throwable e) {
String errorMsg = ExceptionUtils.getThrowableErrorStackTrace(e);
log.error("【导入居民信息失败】导入失败:{}", errorMsg);
@ -488,8 +484,13 @@ public class IcResiUserController implements ResultDataResolver {
icResiUserImportService.finishImportTask(importTaskId, operatorId, ImportTaskConstants.PROCESS_STATUS_FINISHED_FAIL, resultDesc, null);
} finally {
try {
// 都导入成功了没问题,才删除
if (importTempFileSavePath != null){
if (isAllSuccess) {
Files.delete(importTempFileSavePath);
} else {
log.error("【导入居民信息】未完全成功,上传文件:{}", importTempFileSavePath);
}
}
} catch (IOException e) {
log.error("【导入居民信息失败】清理上传的文件失败:{}", ExceptionUtils.getErrorStackTrace(e));
@ -585,28 +586,30 @@ public class IcResiUserController implements ResultDataResolver {
/**
* 下载ic居民信息导入excel模板
* @param loginUserInfo
* @return
*/
@PostMapping("import/download-template")
public ResponseEntity<byte[]> downloadIcResiDownloadTemplate(@LoginUser TokenDto loginUserInfo) {
String customerId = loginUserInfo.getCustomerId();
public void downloadIcResiDownloadTemplate(HttpServletResponse response) {
InputStream is = null;
ServletOutputStream os = null;
try {
File icResiImportTemplateFile = getIcResiTemplateFile(customerId, IcUserTemplateEnums.IC_RESI_IMPORT_TEMPLATE);
os = response.getOutputStream();
is = this.getClass().getClassLoader().getResourceAsStream(IcUserTemplateEnums.IC_RESI_IMPORT_TEMPLATE.getPathInApp());
HttpHeaders headers = new HttpHeaders();
headers.add("Access-Control-Expose-Headers", "Content-Disposition");
headers.add("content-Type", "application/vnd.ms-excel");
headers.add("Content-Disposition", "attachment;fileName=" + URLEncoder.encode(IcUserTemplateEnums.IC_RESI_IMPORT_TEMPLATE.getTemplateName(), "UTF-8"));
response.setHeader("Access-Control-Expose-Headers", "Content-Disposition");
response.setHeader("content-Type", "application/vnd.ms-excel");
response.setHeader("Content-Disposition", "attachment;fileName=" + URLEncoder.encode(IcUserTemplateEnums.IC_RESI_IMPORT_TEMPLATE.getTemplateName(), "UTF-8"));
return new ResponseEntity<>(FileUtil.readBytes(icResiImportTemplateFile), headers, HttpStatus.OK);
IOUtils.copy(is, os);
} catch (Exception e) {
String errorStackTrace = ExceptionUtils.getErrorStackTrace(e);
log.error("下载IC居民信息导入模板失败:{}", errorStackTrace);
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "下载IC居民信息导入模板失败");
} finally {
org.apache.poi.util.IOUtils.closeQuietly(is);
org.apache.poi.util.IOUtils.closeQuietly(os);
}
}

2
epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserImportService.java

@ -13,7 +13,7 @@ import java.util.List;
*/
public interface IcResiUserImportService {
void importIcResiInfoFromExcel(String importTaskId, List<FormItemResult> formItemList, String excelPathName, HttpServletResponse response, Path importTempPath);
boolean importIcResiInfoFromExcel(String importTaskId, List<FormItemResult> formItemList, String excelPathName, HttpServletResponse response, Path importTempPath);
/**
* 创建导入任务

22
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserImportServiceImpl.java

@ -13,7 +13,6 @@ import com.epmet.bean.ResiImportChangedData;
import com.epmet.commons.tools.constant.AppClientConstant;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.constant.ThreadLocalConstant;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.dto.result.OptionResultDTO;
import com.epmet.commons.tools.exception.EpmetErrorCode;
@ -24,7 +23,6 @@ import com.epmet.commons.tools.feign.ResultDataResolver;
import com.epmet.commons.tools.redis.RedisKeys;
import com.epmet.commons.tools.redis.RedisUtils;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.security.user.LoginUserUtil;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.EpmetRequestHolder;
import com.epmet.commons.tools.utils.Result;
@ -211,9 +209,11 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res
* @param formItemList item列表
* @param excelPathName excel缓存路径
* @param response 响应对象
* @return
*/
@Override
public void importIcResiInfoFromExcel(String importTaskId, List<FormItemResult> formItemList, String excelPathName, HttpServletResponse response, Path importTempPath) {
public boolean importIcResiInfoFromExcel(String importTaskId, List<FormItemResult> formItemList, String excelPathName, HttpServletResponse response, Path importTempPath) {
boolean isAllSuccess = false;
String app = EpmetRequestHolder.getHeader(AppClientConstant.APP);
String client = EpmetRequestHolder.getHeader(AppClientConstant.CLIENT);
@ -276,6 +276,7 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res
}
finishImportTask(importTaskId, loginUserId, ImportTaskConstants.PROCESS_STATUS_FINISHED_FAIL,null, resultDescFilePath);
} else {
isAllSuccess = true;
finishImportTask(importTaskId, loginUserId, ImportTaskConstants.PROCESS_STATUS_FINISHED_SUCCESS,null, null);
}
@ -298,6 +299,8 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res
resiCategoryColumnNameAndLabel.remove();
itemIdAndOptionsCache.invalidateAll();
}
return isAllSuccess;
}
/**
@ -536,10 +539,18 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res
private void specifiedCheck(LinkedHashMap<String, String> columnAndValues) {
String idCard = columnAndValues.get("ID_CARD");
String mobile = columnAndValues.get("MOBILE");
String name = columnAndValues.get("NAME");
List<String> errors = new ArrayList<>();
if (StringUtils.isNotBlank(idCard) && idCard.length() > 18) {
if (StringUtils.isBlank(idCard)) {
log.debug("【居民信息导入】specifiedCheck身份证号为空的:{},{}", mobile, name);
String errorMsg = "身份证号不能为空";
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), errorMsg, errorMsg);
}
if (idCard.length() > 18) {
// 身份证号超长了哦,不可以的
errors.add("身份证号过长");
}
@ -570,9 +581,6 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res
LinkedHashMap<String, String> columnAndValues = new LinkedHashMap<>();
String loginUserApp = EpmetRequestHolder.getHeader(AppClientConstant.APP);
String loginUserClient = EpmetRequestHolder.getHeader(AppClientConstant.CLIENT);
String loginUserId = EpmetRequestHolder.getHeader(AppClientConstant.USER_ID.toLowerCase());
String loginUserCustomerId = EpmetRequestHolder.getHeader(AppClientConstant.CUSTOMER_ID.toLowerCase());
// 遍历每一行,将行内容转化为

0
epmet-user/epmet-user-server/src/main/resources/excel/ic_resi_info_import_cid_for_easy_excel.xls → epmet-user/epmet-user-server/src/main/resources/excel/ic_resi_import_template.xls

Loading…
Cancel
Save