Browse Source

Merge branches 'dev_bugfix_ljj' and 'develop' of http://git.elinkit.com.cn:7070/r/epmet-cloud into develop

dev
jianjun 4 years ago
parent
commit
73936eb564
  1. 7
      epmet-auth-client/pom.xml
  2. 25
      epmet-auth-client/src/main/java/com/epmet/auth/dto/result/BlockChainStaffAuthResultDTO.java
  3. 1
      epmet-auth/src/main/java/com/epmet/controller/GovLoginController.java
  4. 20
      epmet-auth/src/main/java/com/epmet/controller/GovWebController.java
  5. 24
      epmet-auth/src/main/java/com/epmet/dto/form/BcStaffAuthenticationFormDTO.java
  6. 9
      epmet-auth/src/main/java/com/epmet/service/GovWebService.java
  7. 4
      epmet-auth/src/main/java/com/epmet/service/impl/GovLoginServiceImpl.java
  8. 41
      epmet-auth/src/main/java/com/epmet/service/impl/GovWebServiceImpl.java
  9. 5
      epmet-commons/epmet-commons-tools/pom.xml
  10. 3
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/config/AsyncConfig.java
  11. 3
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/DingDingRobotConstant.java
  12. 4
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/ThreadLocalConstant.java
  13. 1
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java
  14. 16
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/EpmetBaseRequestInterceptor.java
  15. 104
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/FeignHystrixConcurrencyStrategy.java
  16. 53
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/filter/GlobalFilter.java
  17. 67
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/EpmetRequestHolder.java
  18. 1
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/result/GridInfoResultDTO.java
  19. 81
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/excel/GridLivelyDetailExcel.java
  20. 4
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/excel/GridLivelyExcel.java
  21. 226
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java
  22. 1
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govproject/impl/GovProjectServiceImpl.java
  23. 16
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml
  24. 4
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerGridDao.xml
  25. 6
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/DataCheckDTO.java
  26. 31
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ProjectDataServiceImpl.java
  27. 43
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectDataDao.xml
  28. 6
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/VolunteerInfoServiceImpl.java
  29. 6
      epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/BlockChainProcessProjectFormDTO.java
  30. 9
      epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/BlockChainProjectServiceImpl.java
  31. 30
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/NeighborHoodManageDelFormDTO.java
  32. 22
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/NeighborHoodManageDelResultDTO.java
  33. 1
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/constant/CustomerGridConstant.java
  34. 13
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java
  35. 1
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcNeighborHoodController.java
  36. 26
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcHouseDao.java
  37. 9
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/HouseService.java
  38. 87
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java
  39. 6
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcNeighborHoodServiceImpl.java
  40. 18
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml
  41. 43
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml
  42. 5
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/BlockChainUploadServiceImpl.java
  43. 4
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java
  44. 11
      epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/OperCustomizeOpenFeignClient.java
  45. 11
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/ResiCategoryStatsConfigController.java
  46. 36
      epmet-module/resi-guide/resi-guide-server/pom.xml
  47. 11
      epmet-module/resi-guide/resi-guide-server/src/main/resources/bootstrap.yml
  48. 36
      epmet-module/resi-hall/resi-hall-server/pom.xml
  49. 11
      epmet-module/resi-hall/resi-hall-server/src/main/resources/bootstrap.yml
  50. 36
      epmet-module/resi-home/resi-home-server/pom.xml
  51. 11
      epmet-module/resi-home/resi-home-server/src/main/resources/bootstrap.yml
  52. 36
      epmet-module/resi-mine/resi-mine-server/pom.xml
  53. 11
      epmet-module/resi-mine/resi-mine-server/src/main/resources/bootstrap.yml
  54. 42
      epmet-module/resi-partymember/resi-partymember-server/pom.xml
  55. 11
      epmet-module/resi-partymember/resi-partymember-server/src/main/resources/bootstrap.yml
  56. 34
      epmet-module/resi-voice/resi-voice-server/pom.xml
  57. 11
      epmet-module/resi-voice/resi-voice-server/src/main/resources/bootstrap.yml
  58. 8
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/DelIcResiUserFormDTO.java
  59. 2
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/PersonWarnRightListFormDTO.java
  60. 32
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/IcStatsResiWarnBuildingResultDTO.java
  61. 3
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/PersonWarnRightListResultDTO.java
  62. 11
      epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java
  63. 5
      epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java
  64. 2
      epmet-user/epmet-user-server/deploy/docker-compose-dev.yml
  65. 90
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java
  66. 17
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StatsResiWarnController.java
  67. 12
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java
  68. 2
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserImportService.java
  69. 7
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java
  70. 18
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/StatsResiWarnService.java
  71. 57
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserImportServiceImpl.java
  72. 35
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java
  73. 4
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/PatrolRoutineWorkServiceImpl.java
  74. 6
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StatsResiWarnServiceImpl.java
  75. 13
      epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml

7
epmet-auth-client/pom.xml

@ -11,4 +11,11 @@
<artifactId>epmet-auth-client</artifactId>
<dependencies>
<dependency>
<groupId>com.epmet</groupId>
<artifactId>epmet-commons-tools</artifactId>
<version>2.0.0</version>
</dependency>
</dependencies>
</project>

25
epmet-auth-client/src/main/java/com/epmet/auth/dto/result/BlockChainStaffAuthResultDTO.java

@ -0,0 +1,25 @@
package com.epmet.auth.dto.result;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @ClassName BlockChainStaffAuthResultDTO
* @Description 区块链用户认证结果
* @Author wangxianzhang
* @Date 2022/1/20 10:41 上午
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class BlockChainStaffAuthResultDTO {
private String userId;
private String realName;
private String phone;
private String headUrl;
private String agencyId;
private String agencyName;
}

1
epmet-auth/src/main/java/com/epmet/controller/GovLoginController.java

@ -14,6 +14,7 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.HashMap;
import java.util.List;
/**

20
epmet-auth/src/main/java/com/epmet/controller/GovWebController.java

@ -1,8 +1,10 @@
package com.epmet.controller;
import com.epmet.auth.dto.result.BlockChainStaffAuthResultDTO;
import com.epmet.commons.tools.utils.RSASignature;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dto.form.BcStaffAuthenticationFormDTO;
import com.epmet.dto.form.GovWebLoginFormDTO;
import com.epmet.dto.result.UserTokenResultDTO;
import com.epmet.service.GovWebService;
@ -13,6 +15,8 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.HashMap;
/**
* @author sun
@ -63,5 +67,21 @@ public class GovWebController {
return new Result().ok(publicKey);
}
/**
* 区块链web 系统身份认证
* @param input
* @return
*/
@PostMapping("/blockchain/authentication")
public Result blockChainGetStaffInfoByPwd(@RequestBody BcStaffAuthenticationFormDTO input) {
ValidatorUtils.validateEntity(input);
String customerId = input.getCustomerId();
String mobile = input.getMobile();
String password = input.getPassword();
BlockChainStaffAuthResultDTO r = govWebService.blockChainStaffAuthenticationByPwd(customerId, mobile, password);
return new Result().ok(r);
}
}

24
epmet-auth/src/main/java/com/epmet/dto/form/BcStaffAuthenticationFormDTO.java

@ -0,0 +1,24 @@
package com.epmet.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
/**
* @ClassName BcAdminLoginFormDTO
* @Description 区块链管理系统staff身份认证
* @Author wangxianzhang
* @Date 2022/1/17 10:11 下午
*/
@Data
public class BcStaffAuthenticationFormDTO {
@NotBlank(message = "客户ID必填")
private String customerId;
@NotBlank(message = "手机号必填")
private String mobile;
@NotBlank(message = "密码必填")
private String password;
}

9
epmet-auth/src/main/java/com/epmet/service/GovWebService.java

@ -1,5 +1,6 @@
package com.epmet.service;
import com.epmet.auth.dto.result.BlockChainStaffAuthResultDTO;
import com.epmet.dto.form.GovWebLoginFormDTO;
import com.epmet.dto.result.UserTokenResultDTO;
@ -16,4 +17,12 @@ public interface GovWebService {
* @Description PC工作端-工作人员登录
**/
UserTokenResultDTO login(GovWebLoginFormDTO formDTO);
/**
* 区块链系统通过用户密码认证身份
* @param mobile
* @param password
* @return
*/
BlockChainStaffAuthResultDTO blockChainStaffAuthenticationByPwd(String customerId, String mobile, String password);
}

4
epmet-auth/src/main/java/com/epmet/service/impl/GovLoginServiceImpl.java

@ -5,8 +5,10 @@ import com.epmet.common.token.constant.LoginConstant;
import com.epmet.commons.tools.constant.AppClientConstant;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
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.security.dto.GovTokenDto;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.security.password.PasswordUtils;
@ -46,7 +48,7 @@ import java.util.stream.Collectors;
* @Date 2020/4/20 10:56
*/
@Service
public class GovLoginServiceImpl implements GovLoginService {
public class GovLoginServiceImpl implements GovLoginService, ResultDataResolver {
private static final Logger logger = LoggerFactory.getLogger(GovLoginServiceImpl.class);
private static final String SEND_SMS_CODE_ERROR = "发送短信验证码异常,手机号[%s],code[%s],msg[%s]";
@Autowired

41
epmet-auth/src/main/java/com/epmet/service/impl/GovWebServiceImpl.java

@ -1,13 +1,21 @@
package com.epmet.service.impl;
import com.epmet.auth.dto.result.BlockChainStaffAuthResultDTO;
import com.epmet.common.token.constant.LoginConstant;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.feign.ResultDataResolver;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.security.dto.GovTokenDto;
import com.epmet.commons.tools.security.password.PasswordUtils;
import com.epmet.commons.tools.utils.CpUserDetailRedis;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.CustomerStaffDTO;
import com.epmet.dto.form.CustomerStaffFormDTO;
import com.epmet.dto.form.GovWebLoginFormDTO;
import com.epmet.dto.form.GovWebOperLoginFormDTO;
import com.epmet.dto.result.GovWebOperLoginResultDTO;
@ -32,7 +40,7 @@ import java.util.Map;
*/
@Slf4j
@Service
public class GovWebServiceImpl implements GovWebService {
public class GovWebServiceImpl implements GovWebService, ResultDataResolver {
private static final Logger logger = LoggerFactory.getLogger(GovWebServiceImpl.class);
@Autowired
@ -131,5 +139,36 @@ public class GovWebServiceImpl implements GovWebService {
return token;
}
@Override
public BlockChainStaffAuthResultDTO blockChainStaffAuthenticationByPwd(String customerId, String mobile, String password) {
GovWebOperLoginFormDTO form = new GovWebOperLoginFormDTO();
form.setCustomerId(customerId);
form.setMobile(mobile);
// 用户认证
GovWebOperLoginResultDTO staff = getResultDataOrThrowsException(epmetUserFeignClient.getStaffIdAndPwd(form), ServiceConstant.EPMET_USER_SERVER,
EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),
String.format("【区块链用户认证】根据手机号%s和指定客户ID:%s认证用户失败", mobile, customerId),
"认证失败");
if (staff == null) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),
String.format("【区块链用户认证】根据手机号%s和指定客户ID:%s认证用户失败", mobile, customerId));
}
if (!PasswordUtils.matches(password, staff.getPassWord())) {
// 密码不匹配
throw new EpmetException(EpmetErrorCode.ERR10004.getCode(), String.format("【区块链用户认证】密码不匹配,手机号:%s", mobile));
}
// 用户基础信息
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(customerId, staff.getUserId());
BlockChainStaffAuthResultDTO r = new BlockChainStaffAuthResultDTO(staff.getUserId(), staffInfo.getRealName(),
staffInfo.getMobile(), staffInfo.getHeadPhoto(), staffInfo.getAgencyId(), staffInfo.getAgencyName());
return r;
}
}

5
epmet-commons/epmet-commons-tools/pom.xml

@ -161,6 +161,11 @@
<version>2.6.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>transmittable-thread-local</artifactId>
<version>2.12.4</version>
</dependency>
</dependencies>
<build>

3
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/config/AsyncConfig.java

@ -1,5 +1,6 @@
package com.epmet.commons.tools.config;
import com.alibaba.ttl.threadpool.TtlExecutors;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
@ -69,7 +70,7 @@ public class AsyncConfig {
@Bean
public ExecutorService executorService() {
ThreadPoolTaskExecutor executor = (ThreadPoolTaskExecutor) executor();
return executor.getThreadPoolExecutor();
return TtlExecutors.getTtlExecutorService(executor.getThreadPoolExecutor());
}
/**

3
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/DingDingRobotConstant.java

@ -22,4 +22,7 @@ public interface DingDingRobotConstant {
* 开发测试-报警群的服务监控助理机器人
*/
String DEPLOY_ROBOT="https://oapi.dingtalk.com/robot/send?access_token=5dfbde0c814a43d72e3e7f02385db87df1fc8231cff30728d8df1d1b58a00998";
String SELF_ROBOT_URL="https://oapi.dingtalk.com/robot/send?access_token=ffd7c972b0525e249283df1a16b65a8b9d0012601f3a458dfc588c2eac497bb5";
String SELF_ROBOT_SECRET=null;
}

4
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/ThreadLocalConstant.java

@ -22,8 +22,4 @@ public class ThreadLocalConstant {
*/
public static final ThreadLocal<String> requestParam = new ThreadLocal();
/**
* 可被子线程继承的追加的request headers
*/
public static final InheritableThreadLocal<Map<String, String>> inheritableAdditionalHeaders = new InheritableThreadLocal<>();
}

1
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java

@ -250,6 +250,7 @@ public enum EpmetErrorCode {
ORG_ADD_FAILED(8919,"添加失败"),
ORG_EDIT_FAILED(8920,"编辑失败"),
ORG_DEL_FAILED(8921,"删除失败"),
NEIGHBORHOOD_DEL_FAILED(8922,""),
//通用错误码 start

16
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/EpmetBaseRequestInterceptor.java

@ -1,6 +1,6 @@
package com.epmet.commons.tools.feign;
import com.epmet.commons.tools.constant.ThreadLocalConstant;
import com.epmet.commons.tools.utils.EpmetRequestHolder;
import feign.RequestInterceptor;
import feign.RequestTemplate;
import org.slf4j.Logger;
@ -21,23 +21,17 @@ public class EpmetBaseRequestInterceptor implements RequestInterceptor {
@Override
public void apply(RequestTemplate template) {
// 自定义追加的request header,可被子线程继承拷贝
Map<String, String> inheritableAdditionalHeaders = FeignHystrixConcurrencyStrategy.hystrixAdditionHeaders.get();
Map<String, String> requestHeaders = getHeadersFromRequest();
Map<String, String> requestHeaders = EpmetRequestHolder.getAllHeaders();
log.info("EpmetBaseRequestInterceptor#apply#inheritableAdditionalHeaders:"+inheritableAdditionalHeaders);
// Map<String, String> requestHeaders = getHeadersFromRequest();
log.info("EpmetBaseRequestInterceptor#apply#inheritableAdditionalHeaders:" + requestHeaders);
if (requestHeaders != null && requestHeaders.size() > 0) {
for (Map.Entry<String, String> kv : requestHeaders.entrySet()) {
template.header(kv.getKey(), kv.getValue());
}
}
if (inheritableAdditionalHeaders != null && inheritableAdditionalHeaders.size() > 0) {
for (Map.Entry<String, String> kv : inheritableAdditionalHeaders.entrySet()) {
template.header(kv.getKey(), kv.getValue());
}
}
}
/**

104
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/FeignHystrixConcurrencyStrategy.java

@ -1,6 +1,6 @@
package com.epmet.commons.tools.feign;
import com.epmet.commons.tools.constant.ThreadLocalConstant;
import com.alibaba.ttl.TtlRunnable;
import com.netflix.hystrix.HystrixThreadPoolKey;
import com.netflix.hystrix.HystrixThreadPoolProperties;
import com.netflix.hystrix.strategy.HystrixPlugins;
@ -12,17 +12,15 @@ import com.netflix.hystrix.strategy.executionhook.HystrixCommandExecutionHook;
import com.netflix.hystrix.strategy.metrics.HystrixMetricsPublisher;
import com.netflix.hystrix.strategy.properties.HystrixPropertiesStrategy;
import com.netflix.hystrix.strategy.properties.HystrixProperty;
import com.netflix.hystrix.util.PlatformSpecific;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
import org.springframework.web.context.request.RequestAttributes;
import org.springframework.web.context.request.RequestContextHolder;
import java.util.Map;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.Callable;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.*;
import java.util.concurrent.atomic.AtomicInteger;
/**
* 自定义Feign的隔离策略
@ -37,7 +35,6 @@ import java.util.concurrent.TimeUnit;
@Component
public class FeignHystrixConcurrencyStrategy extends HystrixConcurrencyStrategy {
public static final ThreadLocal<Map<String, String>> hystrixAdditionHeaders = new ThreadLocal<>();
private static final Logger log = LoggerFactory.getLogger(FeignHystrixConcurrencyStrategy.class);
private HystrixConcurrencyStrategy delegate;
@ -77,23 +74,57 @@ public class FeignHystrixConcurrencyStrategy extends HystrixConcurrencyStrategy
@Override
public <T> Callable<T> wrapCallable(Callable<T> callable) {
Map<String, String> inheritableAdditionalHeaders = ThreadLocalConstant.inheritableAdditionalHeaders.get();
RequestAttributes requestAttributes = RequestContextHolder.getRequestAttributes();
return new WrappedCallable<>(callable, requestAttributes, inheritableAdditionalHeaders);
return new WrappedCallable<>(callable, requestAttributes);
}
@Override
public ThreadPoolExecutor getThreadPool(HystrixThreadPoolKey threadPoolKey,
HystrixProperty<Integer> corePoolSize, HystrixProperty<Integer> maximumPoolSize,
HystrixProperty<Integer> keepAliveTime, TimeUnit unit, BlockingQueue<Runnable> workQueue) {
return this.delegate.getThreadPool(threadPoolKey, corePoolSize, maximumPoolSize, keepAliveTime,
unit, workQueue);
// return this.delegate.getThreadPool(threadPoolKey, corePoolSize, maximumPoolSize, keepAliveTime, unit, workQueue);
final ThreadFactory threadFactory = getThreadFactory(threadPoolKey);
final int dynamicCoreSize = corePoolSize.get();
final int dynamicMaximumSize = maximumPoolSize.get();
if (dynamicCoreSize > dynamicMaximumSize) {
log.error("Epmet Hystrix ThreadPool configuration at startup for : " + threadPoolKey.name() + " is trying to set coreSize = " +
dynamicCoreSize + " and maximumSize = " + dynamicMaximumSize + ". Maximum size will be set to " +
dynamicCoreSize + ", the coreSize value, since it must be equal to or greater than the coreSize value");
return new WrappedThreadPoolExecutor(dynamicCoreSize, dynamicCoreSize, keepAliveTime.get(), unit, workQueue, threadFactory);
} else {
return new WrappedThreadPoolExecutor(dynamicCoreSize, dynamicMaximumSize, keepAliveTime.get(), unit, workQueue, threadFactory);
}
}
@Override
public ThreadPoolExecutor getThreadPool(HystrixThreadPoolKey threadPoolKey,
HystrixThreadPoolProperties threadPoolProperties) {
return this.delegate.getThreadPool(threadPoolKey, threadPoolProperties);
// return this.delegate.getThreadPool(threadPoolKey, threadPoolProperties);
final ThreadFactory threadFactory = getThreadFactory(threadPoolKey);
final boolean allowMaximumSizeToDivergeFromCoreSize = threadPoolProperties.getAllowMaximumSizeToDivergeFromCoreSize().get();
final int dynamicCoreSize = threadPoolProperties.coreSize().get();
final int keepAliveTime = threadPoolProperties.keepAliveTimeMinutes().get();
final int maxQueueSize = threadPoolProperties.maxQueueSize().get();
final BlockingQueue<Runnable> workQueue = getBlockingQueue(maxQueueSize);
if (allowMaximumSizeToDivergeFromCoreSize) {
final int dynamicMaximumSize = threadPoolProperties.maximumSize().get();
if (dynamicCoreSize > dynamicMaximumSize) {
log.error("Epmet Hystrix ThreadPool configuration at startup for : " + threadPoolKey.name() + " is trying to set coreSize = " +
dynamicCoreSize + " and maximumSize = " + dynamicMaximumSize + ". Maximum size will be set to " +
dynamicCoreSize + ", the coreSize value, since it must be equal to or greater than the coreSize value");
return new WrappedThreadPoolExecutor(dynamicCoreSize, dynamicCoreSize, keepAliveTime, TimeUnit.MINUTES, workQueue, threadFactory);
} else {
return new WrappedThreadPoolExecutor(dynamicCoreSize, dynamicMaximumSize, keepAliveTime, TimeUnit.MINUTES, workQueue, threadFactory);
}
} else {
return new WrappedThreadPoolExecutor(dynamicCoreSize, dynamicCoreSize, keepAliveTime, TimeUnit.MINUTES, workQueue, threadFactory);
}
}
@Override
@ -106,21 +137,41 @@ public class FeignHystrixConcurrencyStrategy extends HystrixConcurrencyStrategy
return this.delegate.getRequestVariable(rv);
}
/**
* 从父类复制过来的
* @param threadPoolKey
* @return
*/
private ThreadFactory getThreadFactory(final HystrixThreadPoolKey threadPoolKey) {
if (!PlatformSpecific.isAppEngineStandardEnvironment()) {
return new ThreadFactory() {
private final AtomicInteger threadNumber = new AtomicInteger(0);
@Override
public Thread newThread(Runnable r) {
Thread thread = new Thread(r, "hystrix-" + threadPoolKey.name() + "-" + threadNumber.incrementAndGet());
thread.setDaemon(true);
return thread;
}
};
} else {
return PlatformSpecific.getAppEngineThreadFactory();
}
}
static class WrappedCallable<T> implements Callable<T> {
private final Callable<T> target;
private final RequestAttributes requestAttributes;
private final Map<String, String> inheritableAdditionalHeaders;
public WrappedCallable(Callable<T> target, RequestAttributes requestAttributes, Map<String, String> inheritableAdditionalHeaders) {
public WrappedCallable(Callable<T> target, RequestAttributes requestAttributes) {
this.target = target;
this.requestAttributes = requestAttributes;
this.inheritableAdditionalHeaders = inheritableAdditionalHeaders;
}
@Override
public T call() throws Exception {
try {
hystrixAdditionHeaders.set(inheritableAdditionalHeaders);
RequestContextHolder.setRequestAttributes(requestAttributes);
return target.call();
} finally {
@ -128,4 +179,25 @@ public class FeignHystrixConcurrencyStrategy extends HystrixConcurrencyStrategy
}
}
}
/**
* 自定义线程池类使用Ttl包装过解决异步环境下线程上下文透传问题
*/
static class WrappedThreadPoolExecutor extends ThreadPoolExecutor {
private static final RejectedExecutionHandler defaultHandler = new AbortPolicy();
public WrappedThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit,
BlockingQueue<Runnable> workQueue) {
super(corePoolSize, maximumPoolSize, keepAliveTime, unit, workQueue);
}
public WrappedThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit,
BlockingQueue<Runnable> workQueue, ThreadFactory threadFactory) {
super(corePoolSize, maximumPoolSize, keepAliveTime, unit, workQueue, threadFactory, defaultHandler);
}
@Override
public void execute(Runnable command) {
super.execute(TtlRunnable.get(command));
}
}
}

53
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/filter/GlobalFilter.java

@ -1,10 +1,16 @@
package com.epmet.commons.tools.filter;
import com.epmet.commons.tools.constant.ThreadLocalConstant;
import com.epmet.commons.tools.exception.ExceptionUtils;
import com.epmet.commons.tools.utils.EpmetRequestHolder;
import lombok.extern.slf4j.Slf4j;
import javax.servlet.*;
import javax.servlet.annotation.WebFilter;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.util.Enumeration;
import java.util.HashMap;
/**
* @Description 全局过滤器可在请求结束的时候清除线程变量残留
@ -12,20 +18,59 @@ import java.io.IOException;
* @date 2021.07.19 10:19:24
*/
@WebFilter(value = "/*")
@Slf4j
public class GlobalFilter implements Filter {
@Override
public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
try {
// 获取request中的header,放入RequestHeaderHolder,用于异步环境下的上下文透传
HashMap<String, String> headerMap = getHeadersFromRequest((HttpServletRequest) servletRequest);
EpmetRequestHolder.addHeaders(headerMap);
filterChain.doFilter(servletRequest, servletResponse);
} catch (Throwable e) {
throw e;
} finally {
// 清除线程变量残留
ThreadLocalConstant.sqlFilter.remove();
ThreadLocalConstant.requirePermissionTl.remove();
ThreadLocalConstant.requestParam.remove();
ThreadLocalConstant.inheritableAdditionalHeaders.remove();
clear(ThreadLocalConstant.sqlFilter, "sqlFilter");
clear(ThreadLocalConstant.requirePermissionTl, "requirePermissionTl");
clear(ThreadLocalConstant.requestParam, "requestParam");
EpmetRequestHolder.clearAllHeaders();
System.out.println("清理完成");
}
}
/**
* 从header里面获取headers
*/
public HashMap<String, String> getHeadersFromRequest(HttpServletRequest request) {
HashMap<String, String> headers = new HashMap<>();
Enumeration<String> headerNames = request.getHeaderNames();
if (headerNames != null) {
while (headerNames.hasMoreElements()) {
String name = headerNames.nextElement();
Enumeration<String> values = request.getHeaders(name);
while (values.hasMoreElements()) {
String value = values.nextElement();
headers.put(name, value);
}
}
}
return headers;
}
/**
* 清空threadlocal
* @param tl
* @param tag
*/
public void clear(ThreadLocal tl, String tag) {
try {
tl.remove();
} catch (Throwable t) {
String errorMsg = ExceptionUtils.getThrowableErrorStackTrace(t);
log.error("【GlobalFilter】清空ThreadLocal失败,{}, {}", tag, errorMsg);
}
}
}

67
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/EpmetRequestHolder.java

@ -0,0 +1,67 @@
package com.epmet.commons.tools.utils;
import com.alibaba.ttl.TransmittableThreadLocal;
import org.apache.commons.lang3.StringUtils;
import java.util.HashMap;
import java.util.Map;
/**
* 请求header holder可用于异步环境下request header的透传详情结合 alibaba transmitable-thread-local
*/
public class EpmetRequestHolder {
public static final TransmittableThreadLocal<Map<String, String>> requestHeaderTtl = new TransmittableThreadLocal<>();
/**
* 存储
* @param headerName
* @param headerValue
*/
public static void addHeader(String headerName, String headerValue) {
if (StringUtils.isBlank(headerName)) {
return;
}
before();
requestHeaderTtl.get().put(headerName, headerValue);
}
public static void addHeaders(Map<String, String> headers) {
if (headers == null) {
return;
}
before();
requestHeaderTtl.get().putAll(headers);
}
private static void before() {
if (requestHeaderTtl.get() == null) {
requestHeaderTtl.set(new HashMap<>());
}
}
/**
* 获取
* @param headerName
* @return
*/
public static String getHeader(String headerName) {
return requestHeaderTtl.get().get(headerName);
}
/**
* 获取所有
* @return
*/
public static Map<String, String> getAllHeaders() {
return requestHeaderTtl.get();
}
/**
* 清空内容
*/
public static void clearAllHeaders() {
requestHeaderTtl.remove();
}
}

1
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/result/GridInfoResultDTO.java

@ -37,5 +37,6 @@ public class GridInfoResultDTO implements Serializable {
*/
private String gridId = "";
private String gridName = "";
private String pids = "";
}

81
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/excel/GridLivelyDetailExcel.java

@ -0,0 +1,81 @@
/**
* 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.dataaggre.excel;
import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.ExcelIgnore;
import lombok.Data;
import java.util.LinkedList;
import java.util.List;
/**
* @Description 网格活跃度文件导出-活跃网格sheet-接口返参
* @Author sun
*/
@Data
public class GridLivelyDetailExcel {
LinkedList<GridLivelyExcel> livelyExcelList;
List<GridLivelyDetailExcel.LivelyGrid> livelyGrid;
List<GridLivelyDetailExcel.OrdinaryGrid> ordinaryGrid;
List<GridLivelyDetailExcel.LazyGrid> lazyGrid;
//活跃网格
@Data
public static class LivelyGrid {
@ExcelIgnore
private String agencyId;
@Excel(name = "所属组织", width = 20, mergeVertical = true)
private String agencyName;
@ExcelIgnore
private String gridId;
@Excel(name = "活跃网格名称",width = 20)
private String gridName;
@Excel(name = "活跃天数",width = 20)
private Integer datyNum;
}
//正常网格
@Data
public static class OrdinaryGrid {
@ExcelIgnore
private String agencyId;
@Excel(name = "所属组织", width = 20, mergeVertical = true)
private String agencyName;
@ExcelIgnore
private String gridId;
@Excel(name = "正常运行网格名称", width = 20)
private String gridName;
@Excel(name = "活跃天数", width = 20)
private Integer datyNum;
}
//僵尸网格
@Data
public static class LazyGrid {
@ExcelIgnore
private String agencyId;
@Excel(name = "所属组织", width = 20, mergeVertical = true)
private String agencyName;
@ExcelIgnore
private String gridId;
@Excel(name = "僵尸网格名称",width = 20)
private String gridName;
@Excel(name = "活跃天数",width = 20)
private Integer datyNum;
}
}

4
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/excel/GridLivelyExcel.java

@ -18,7 +18,7 @@
package com.epmet.dataaggre.excel;
import cn.afterturn.easypoi.excel.annotation.Excel;
import com.alibaba.excel.annotation.ExcelIgnore;
import cn.afterturn.easypoi.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import lombok.Data;
@ -66,7 +66,7 @@ public class GridLivelyExcel {
//正常运行网格数占比
@Excel(name = "正常运行网格数占比",width = 15)
@Excel(name = "正常运行网格数占比",width = 20)
@ExcelProperty("正常运行网格数占比")
@ColumnWidth(15)
private String gridOrdinaryRatio;

226
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java

@ -2,9 +2,7 @@ package com.epmet.dataaggre.service.govorg.impl;
import cn.afterturn.easypoi.excel.ExcelExportUtil;
import cn.afterturn.easypoi.excel.entity.ExportParams;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.write.metadata.WriteSheet;
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
import com.alibaba.fastjson.JSON;
import com.dingtalk.api.request.OapiRobotSendRequest;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
@ -16,10 +14,10 @@ import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.ExceptionUtils;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.redis.common.CustomerOrgRedis;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.ExcelUtils;
import com.epmet.commons.tools.utils.HttpClientManager;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dataaggre.constant.DataSourceConstant;
@ -31,6 +29,7 @@ import com.epmet.dataaggre.dto.govorg.form.*;
import com.epmet.dataaggre.dto.govorg.result.*;
import com.epmet.dataaggre.dto.resigroup.result.OrgInfoCommonDTO;
import com.epmet.dataaggre.entity.govorg.CustomerAgencyEntity;
import com.epmet.dataaggre.excel.GridLivelyDetailExcel;
import com.epmet.dataaggre.excel.GridLivelyExcel;
import com.epmet.dataaggre.service.commonservice.AreaCodeService;
import com.epmet.dataaggre.service.datastats.DataStatsService;
@ -51,6 +50,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.commons.CommonsMultipartFile;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.OutputStream;
@ -677,13 +677,131 @@ public class GovOrgServiceImpl implements GovOrgService {
return subList;
}
private GridLivelyDetailExcel gridActiveList(GridLivelyFormDTO formDTO) {
GridLivelyDetailExcel result = new GridLivelyDetailExcel();
LinkedList<GridLivelyExcel> livelyExcelList = new LinkedList<>();
List<GridLivelyDetailExcel.LivelyGrid> livelyGrid = new ArrayList<>();
List<GridLivelyDetailExcel.OrdinaryGrid> ordinaryGrid = new ArrayList<>();
List<GridLivelyDetailExcel.LazyGrid> lazyGrid = new ArrayList<>();
//用于存放存在例行工作或上报事件的网格Id,供后边寻找活跃度为0的僵尸网格使用
Set<String> gridSet = new HashSet<>();
//0.查询当前组织的直属下级组织列表及组织下的网格总数
LinkedList<GridLivelyResultDTO> subList = customerAgencyDao.subAgencyListAndGridSumNum(formDTO.getAgencyId());
//1.查询当前组织下所有网格列表
List<GridInfoResultDTO> gridList = customerGridDao.selectAgencyGridList(formDTO.getAgencyId());
Map<String, GridInfoResultDTO> gridMap = gridList.stream().collect(Collectors.toMap(GridInfoResultDTO :: getGridId, v -> v, (v1, v2) -> v1));
//2.查询直属下级组织下网格在查询时间段内存在例行工作次数的网格,一天一条
List<GridDateIdResultDTO> workList = epmetUserService.getGridDateRoutineWorkList(formDTO);
//3.查询直属下级组织下网格在查询时间段内存在上报事件(直接立项)数的网格,一天一条
List<GridDateIdResultDTO> projectList = dataStatsService.getGridDateProjectIncrList(formDTO);
//4.汇总数据,一个网格一天只记录一条数据,这条数据可能是例行工作的也可能是上报事件的,也可能某一天两个数都有,但只记录一条
Set<String> map = workList.stream().map(o -> o.getGridId() + o.getDateId()).collect(Collectors.toSet());
projectList.stream().filter(pro -> !map.contains(pro.getGridId() + pro.getDateId())).forEach(p -> workList.add(p));
//5.按组织封装数据
//计算百分比使用,保留小数点后两位
NumberFormat numberFormat = NumberFormat.getInstance();
numberFormat.setMaximumFractionDigits(NumConstant.TWO);
subList.forEach(sub -> {
//5-1.组装存在活跃度的数据【网格活跃天数大于0的】
Map<String, Integer> hash = new HashMap<>();
workList.forEach(w -> {
if (w.getPids().contains(sub.getAgencyId())) {
if (hash.containsKey(w.getGridId())) {
hash.put(w.getGridId(), hash.get(w.getGridId()) + NumConstant.ONE);
} else {
hash.put(w.getGridId(), NumConstant.ONE);
}
}
});
//活跃网格数、普通网格数、僵尸网格数
int gridLivelyNum = 0;
int gridOrdinaryNum = 0;
for (Map.Entry<String, Integer> ma : hash.entrySet()){
gridSet.add(ma.getKey());
if (ma.getValue() >= NumConstant.FIVE) {//活跃网格
gridLivelyNum++;
GridLivelyDetailExcel.LivelyGrid lively = new GridLivelyDetailExcel.LivelyGrid();
lively.setAgencyId(sub.getAgencyId());
lively.setAgencyName(sub.getAgencyName());
lively.setGridId(ma.getKey());
lively.setGridName(null!=gridMap.get(ma.getKey())?gridMap.get(ma.getKey()).getGridName():"");
lively.setDatyNum(ma.getValue());
livelyGrid.add(lively);
} else if (ma.getValue() >= NumConstant.TWO && ma.getValue() < NumConstant.FIVE) {//正常网格
gridOrdinaryNum++;
GridLivelyDetailExcel.OrdinaryGrid ordinary = new GridLivelyDetailExcel.OrdinaryGrid();
ordinary.setAgencyId(sub.getAgencyId());
ordinary.setAgencyName(sub.getAgencyName());
ordinary.setGridId(ma.getKey());
ordinary.setGridName(null!=gridMap.get(ma.getKey())?gridMap.get(ma.getKey()).getGridName():"");
ordinary.setDatyNum(ma.getValue());
ordinaryGrid.add(ordinary);
}else if (ma.getValue() < NumConstant.TWO) {//部分僵尸网格[这是活跃天数为1的,还有部分活跃天数为0的]
GridLivelyDetailExcel.LazyGrid lazy = new GridLivelyDetailExcel.LazyGrid();
lazy.setAgencyId(sub.getAgencyId());
lazy.setAgencyName(sub.getAgencyName());
lazy.setGridId(ma.getKey());
lazy.setGridName(null!=gridMap.get(ma.getKey())?gridMap.get(ma.getKey()).getGridName():"");
lazy.setDatyNum(ma.getValue());
lazyGrid.add(lazy);
}
}
GridLivelyExcel gridLively = new GridLivelyExcel();
gridLively.setAgencyId(sub.getAgencyId());
gridLively.setAgencyName(sub.getAgencyName());
gridLively.setGridSumNum(sub.getGridSumNum());
gridLively.setGridLivelyNum(gridLivelyNum);
gridLively.setGridLivelyRatio((sub.getGridSumNum() == 0 || gridLivelyNum > sub.getGridSumNum()) ? "0%" : numberFormat.format(((float) gridLivelyNum / (float) sub.getGridSumNum()) * 100) + "%");
gridLively.setGridOrdinaryNum(gridOrdinaryNum);
gridLively.setGridOrdinaryRatio((sub.getGridSumNum() == 0 || gridOrdinaryNum > sub.getGridSumNum()) ? "0%" : numberFormat.format(((float) gridOrdinaryNum / (float) sub.getGridSumNum()) * 100) + "%");
int gridLazyNum = sub.getGridSumNum() - gridLivelyNum - gridOrdinaryNum;
gridLively.setGridLazyNum(gridLazyNum < 0 ? 0 : gridLazyNum);
gridLively.setGridLazyRatio((sub.getGridSumNum() == 0 || gridLazyNum < 0) ? "0%" : numberFormat.format(((float) gridLazyNum / (float) sub.getGridSumNum()) * 100) + "%");
livelyExcelList.add(gridLively);
//5-2.组装不存在活跃度的数据【网格活跃天数为0的】
gridList.forEach(g->{
if(g.getPids().contains(sub.getAgencyId())&&!gridSet.contains(g.getGridId())){
GridLivelyDetailExcel.LazyGrid lazy = new GridLivelyDetailExcel.LazyGrid();
lazy.setAgencyId(sub.getAgencyId());
lazy.setAgencyName(sub.getAgencyName());
lazy.setGridId(g.getGridId());
lazy.setGridName(null!=gridMap.get(g.getGridId())?gridMap.get(g.getGridId()).getGridName():"");
lazy.setDatyNum(NumConstant.ZERO);
lazyGrid.add(lazy);
}
});
});
//5-3.网格运行情况合计
if (!CollectionUtils.isEmpty(livelyExcelList)){
GridLivelyExcel gridLively = new GridLivelyExcel();
gridLively.setAgencyName("合计");
gridLively.setGridSumNum(livelyExcelList.stream().mapToInt(GridLivelyExcel::getGridSumNum).sum());
gridLively.setGridLivelyNum(livelyExcelList.stream().mapToInt(GridLivelyExcel::getGridLivelyNum).sum());
gridLively.setGridLivelyRatio((gridLively.getGridSumNum() == 0 || gridLively.getGridLivelyNum() > gridLively.getGridSumNum()) ? "0%" : numberFormat.format(((float) gridLively.getGridLivelyNum() / (float) gridLively.getGridSumNum()) * 100) + "%");
gridLively.setGridOrdinaryNum(livelyExcelList.stream().mapToInt(GridLivelyExcel::getGridOrdinaryNum).sum());
gridLively.setGridOrdinaryRatio((gridLively.getGridSumNum() == 0 || gridLively.getGridOrdinaryNum() > gridLively.getGridSumNum()) ? "0%" : numberFormat.format(((float) gridLively.getGridOrdinaryNum() / (float) gridLively.getGridSumNum()) * 100) + "%");
gridLively.setGridLazyNum(livelyExcelList.stream().mapToInt(GridLivelyExcel::getGridLazyNum).sum());
gridLively.setGridLazyRatio((gridLively.getGridSumNum() == 0 || gridLively.getGridLazyNum() > gridLively.getGridSumNum()) ? "0%" : numberFormat.format(((float) gridLively.getGridLazyNum() / (float) gridLively.getGridSumNum()) * 100) + "%");
livelyExcelList.add(gridLively);
}
//6.封装并返回
result.setLivelyExcelList(livelyExcelList);
result.setLivelyGrid(livelyGrid);
result.setOrdinaryGrid(ordinaryGrid);
result.setLazyGrid(lazyGrid);
return result;
}
/**
* @Author sun
* @Description 查询组织的直属下级组织下网格活跃度统计--文件导出
**/
@Override
public void grdiLivelyExport(HttpServletResponse response, GridLivelyFormDTO formDTO) {
ExcelWriter excelWriter = null;
//easyExcel导出
/*ExcelWriter excelWriter = null;
try {
excelWriter = EasyExcel.write(ExcelUtils.getOutputStreamForExcel("网格活跃度统计表.xlsx", response)).build();
WriteSheet writeSheet = EasyExcel.writerSheet(excelSheetName(formDTO)).build();
@ -696,9 +814,81 @@ public class GovOrgServiceImpl implements GovOrgService {
if (excelWriter != null) {
excelWriter.finish();
}
}*/
//easyPoi导出
//1.获取当前组织缓存信息
AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(formDTO.getAgencyId());
if (null == agencyInfo) {
throw new RenException(String.format("获取组织缓存信息失败%s", formDTO.getAgencyId()));
}
//2.查询网格活跃度数据
GridLivelyDetailExcel resultDTO = gridActiveList(formDTO);
if(null==resultDTO||CollectionUtils.isEmpty(resultDTO.getLivelyExcelList())){
log.warn(String.format("网格员活跃度统计数据为空,入参【%s】", JSON.toJSONString(formDTO)));
return;
}
//3.生成多sheet页excel文件并写入数据导出文件
List<Map<String,Object>> headerList = getHeaderList(formDTO,agencyInfo,resultDTO);
try {
Workbook workbook = ExcelExportUtil.exportExcel(headerList, ExcelType.XSSF);
response.setCharacterEncoding("UTF-8");
response.setHeader("content-Type", "application/vnd.ms-excel");
String fileName = excelTitleName(formDTO.getStartTime(), formDTO.getEndTime(), agencyInfo.getOrganizationName()+"网格活跃度统计.xls");
response.setHeader("Content-Disposition", "attachment;filename=" +fileName);
ServletOutputStream out = response.getOutputStream();
workbook.write(out);
out.flush();
out.close();
} catch (IOException e) {
log.error("网格活跃度导出失败", e);
}
}
private List<Map<String, Object>> getHeaderList(GridLivelyFormDTO formDTO, AgencyInfoCache agencyInfo,GridLivelyDetailExcel resultDTO) {
List<Map<String,Object>> headerList = new ArrayList<>();
String titleName = excelTitleName(formDTO.getStartTime(), formDTO.getEndTime(), agencyInfo.getOrganizationName()+"网格活跃度统计表");
headerList.add(getHaderMap(resultDTO.getLivelyExcelList(), titleName, "各街镇网格运行情况", GridLivelyExcel.class));
titleName = excelTitleName(formDTO.getStartTime(), formDTO.getEndTime(), agencyInfo.getOrganizationName()+"活跃网格明细");
headerList.add(getHaderMap(resultDTO.getLivelyGrid(), titleName, "活跃网格统计", GridLivelyDetailExcel.LivelyGrid.class));
titleName = excelTitleName(formDTO.getStartTime(), formDTO.getEndTime(), agencyInfo.getOrganizationName()+"正常运行网格明细");
headerList.add(getHaderMap(resultDTO.getOrdinaryGrid(), titleName, "正常运行网格统计", GridLivelyDetailExcel.OrdinaryGrid.class));
titleName = excelTitleName(formDTO.getStartTime(), formDTO.getEndTime(), agencyInfo.getOrganizationName()+"僵尸网格明细");
headerList.add(getHaderMap(resultDTO.getLazyGrid(), titleName, "僵尸网格统计", GridLivelyDetailExcel.LazyGrid.class));
return headerList;
}
/**
* @Author sun
* data 业务数据集合
* title sheet页主标题
* name sheet页名称
* cl sheet页列头对应实体类
* @Description 生成多sheet页excel文件模板数据
**/
private Map<String, Object> getHaderMap(Collection<?> data, String title, String name, Class<?> cl){
Map<String,Object> map = new HashMap<>();
map.put("data",data);
ExportParams param1 = new ExportParams(title, name);
map.put("title", param1);
map.put("entity", cl);
return map;
}
/**
* @Author sun
* @Description excel文件sheet页主标题拼接
**/
private String excelTitleName(String startTime, String endTime, String name){
StringBuilder titleName = new StringBuilder();
SimpleDateFormat format1 = new SimpleDateFormat("yyyyMMdd");
SimpleDateFormat format2 = new SimpleDateFormat("yyyy年MM月dd日");
try{
titleName.append("(").append(format2.format(format1.parse(startTime))).append("至").append(format2.format(format1.parse(endTime))).append(")").append(name);
} catch (Exception e) {
e.printStackTrace();
}
return titleName.toString();
}
private String excelSheetName(GridLivelyFormDTO formDTO){
StringBuilder name = new StringBuilder();
SimpleDateFormat format1 = new SimpleDateFormat("yyyyMMdd");
@ -717,25 +907,38 @@ public class GovOrgServiceImpl implements GovOrgService {
**/
@Override
public void pcworkRecordListExportSendMsg(GridLivelyFormDTO formDTO) {
List<GridLivelyExcel> data = ConvertUtils.sourceToTarget(grdiLively(formDTO), GridLivelyExcel.class);
/*List<GridLivelyExcel> data = ConvertUtils.sourceToTarget(grdiLively(formDTO), GridLivelyExcel.class);
if(CollectionUtils.isEmpty(data)){
log.warn(String.format("网格员活跃度统计数据查询为空,入参【%s】", JSON.toJSONString(formDTO)));
return;
}
ExportParams exportParams = new ExportParams();
String sheetName = excelSheetName(formDTO);
exportParams.setSheetName(sheetName);
Workbook workbook = ExcelExportUtil.exportExcel(exportParams,
GridLivelyExcel.class, data);
GridLivelyExcel.class, data);*/
//1.获取当前组织缓存信息
AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(formDTO.getAgencyId());
if (null == agencyInfo) {
throw new RenException(String.format("获取组织缓存信息失败%s", formDTO.getAgencyId()));
}
//2.查询网格活跃度数据
GridLivelyDetailExcel resultDTO = gridActiveList(formDTO);
if (null == resultDTO || CollectionUtils.isEmpty(resultDTO.getLivelyExcelList())) {
log.warn(String.format("网格员活跃度统计数据为空,入参【%s】", JSON.toJSONString(formDTO)));
return;
}
//3.生成多sheet页excel文件并写入数据导出文件
List<Map<String,Object>> headerList = getHeaderList(formDTO,agencyInfo,resultDTO);
// 文件名
String resultDescFileName = sheetName.concat(".xls");
String sheetName = excelSheetName(formDTO);
String resultDescFileName = sheetName.concat(".xlsx");
FileItemFactory factory = new DiskFileItemFactory(16, null);
FileItem fileItem = factory.createItem("file", ContentType.APPLICATION_OCTET_STREAM.toString(), true, resultDescFileName);
OutputStream os = null;
Result<UploadImgResultDTO> uploadResult = null;
try {
Workbook workbook = ExcelExportUtil.exportExcel(headerList, ExcelType.XSSF);
os = fileItem.getOutputStream();
workbook.write(os);
uploadResult = ossFeignClient.uploadImportTaskDescFile(new CommonsMultipartFile(fileItem));
@ -772,6 +975,7 @@ public class GovOrgServiceImpl implements GovOrgService {
//小雷哥手机号:18660295251,
OapiRobotSendRequest.At at = new OapiRobotSendRequest.At();
at.setAtMobiles(Arrays.asList("18660295251"));
// at.setAtMobiles(Arrays.asList("15764229697"));
at.setIsAtAll(false);
dingTalkTextMsg.setAt(at);

1
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govproject/impl/GovProjectServiceImpl.java

@ -11,6 +11,7 @@ import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.redis.common.CustomerOrgRedis;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache;
import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache;
import com.epmet.commons.tools.redis.common.bean.GridInfoCache;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ConvertUtils;

16
epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml

@ -1033,7 +1033,13 @@
<if test='endTime != "" and endTime != null '>
AND date_id <![CDATA[<=]]> #{endTime}
</if>
GROUP BY date_id, agency_id
<!-- 平阴的三个街道的数据在表里同一天会存在两条,一条是上报的一条是小程序统计的,所以查询时需要sum,此处就得分组 -->
<if test='dataType == "agency"'>
GROUP BY date_id, agency_id
</if>
<if test='dataType == "grid"'>
GROUP BY date_id, grid_id
</if>
ORDER BY date_id ASC
</if>
<if test='sourceType != "" and sourceType == "end" and endTime != "" and endTime != null '>
@ -1041,7 +1047,13 @@
AND date_id <![CDATA[>=]]> #{startTime}
</if>
AND date_id <![CDATA[<=]]> #{endTime}
GROUP BY date_id, agency_id
<!-- 平阴的三个街道的数据在表里同一天会存在两条,一条是上报的一条是小程序统计的,所以查询时需要sum,此处就得分组 -->
<if test='dataType == "agency"'>
GROUP BY date_id, agency_id
</if>
<if test='dataType == "grid"'>
GROUP BY date_id, grid_id
</if>
ORDER BY date_id DESC
</if>
<choose>

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

@ -6,12 +6,14 @@
<select id="selectAgencyGridList" resultType="com.epmet.dataaggre.dto.govorg.result.GridInfoResultDTO">
SELECT
id AS "gridId",
grid_name AS "gridName"
grid_name AS "gridName",
pids AS "pids"
FROM
customer_grid
WHERE
del_flag = '0'
AND pids like concat('%', #{agencyId}, '%')
ORDER BY pid
</select>
<select id="selectGridByIds" resultType="com.epmet.dataaggre.dto.govorg.result.GridsInfoListResultDTO">

6
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/DataCheckDTO.java

@ -16,10 +16,14 @@ public class DataCheckDTO implements Serializable {
* 客户ID
*/
private String customerId;
/**
* 客户ID
*/
private String agencyId;
/**
* 客户名
*/
private String customerName;
private String agencyName;
/**
* 日期
*/

31
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ProjectDataServiceImpl.java

@ -18,12 +18,14 @@
package com.epmet.service.evaluationindex.screen.impl;
import com.alibaba.fastjson.JSON;
import com.dingtalk.api.DefaultDingTalkClient;
import com.dingtalk.api.DingTalkClient;
import com.dingtalk.api.request.OapiRobotSendRequest;
import com.dingtalk.api.response.OapiRobotSendResponse;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.DingDingRobotConstant;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.commons.tools.utils.HttpClientManager;
import com.epmet.constant.DataSourceConstant;
import com.epmet.dao.evaluationindex.screen.ScreenProjectDataDao;
import com.epmet.dto.extract.form.ExtractOriginFormDTO;
@ -31,6 +33,7 @@ import com.epmet.dto.screen.result.DataCheckDTO;
import com.epmet.entity.evaluationindex.screen.ScreenProjectDataEntity;
import com.epmet.service.evaluationindex.screen.ProjectDataService;
import com.epmet.util.DimIdGenerator;
import com.taobao.api.ApiException;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
@ -69,25 +72,31 @@ public class ProjectDataServiceImpl extends BaseServiceImpl<ScreenProjectDataDao
}
}
List<DataCheckDTO> list = baseDao.getCheckResult(formDTO);
//群机器人
String url = DingDingRobotConstant.SELF_ROBOT_URL;
DingTalkClient client = new DefaultDingTalkClient(url);
if (CollectionUtils.isNotEmpty(list)) {
//发送钉钉消息
//EPMETV3群机器人
String secret = DingDingRobotConstant.V3_ROBOT_SECRET;
String url = DingDingRobotConstant.V3_ROBOT_URL;
for (DataCheckDTO dto : list) {
OapiRobotSendRequest request = new OapiRobotSendRequest();
request.setMsgtype("markdown");
OapiRobotSendRequest.Markdown markdown = new OapiRobotSendRequest.Markdown();
markdown.setTitle("平阴三个街道项目日统计数据上报比对结果");
markdown.setText("客户ID:" + dto.getCustomerId() +"\n\n"+
"> 客户名称:" + dto.getCustomerName() +"\n\n"+
"> 日期:" + dto.getDateId() + "\n\n"+
"> 上报项目数:" + dto.getReportCount() + "\n\n"+
markdown.setTitle("数据异常");
markdown.setText("数据异常:" + "\n\n" +
"> 所属客户ID:" + dto.getCustomerId() + "\n\n" +
"> 组织ID:" + dto.getAgencyId() + "\n\n" +
"> 组织名称:" + dto.getAgencyName() + "\n\n" +
"> 日期:" + dto.getDateId() + "\n\n" +
"> 上报项目数:" + dto.getReportCount() + "\n\n" +
"> 表中项目数:" + dto.getCount());
request.setMarkdown(markdown);
log.info("robot需要发送的内容为:"+markdown.getText());
HttpClientManager.getInstance().sendDingMsg(JSON.toJSONString(request),url,secret);
try {
OapiRobotSendResponse execute = client.execute(request);
log.info("=====通知结果===>" + JSON.toJSONString(execute));
} catch (ApiException e) {
log.error("sendDingMarkDownMsg exception", e);
}
}
}
}

43
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectDataDao.xml

@ -395,16 +395,28 @@
</select>
<select id="getCheckResult" resultType="com.epmet.dto.screen.result.DataCheckDTO">
SELECT
CUSTOMER_ID AS customerId,
CUSTOMER_ID,
AGENCY_ID AS agencyId,
CASE
CUSTOMER_ID
WHEN '46c55cb862d6d5e6d05d2ab61a1cc07e' THEN
AGENCY_ID
WHEN '1258587398679126017' THEN
'榆山'
WHEN '44876154d10d7cb7affd92000f84f833' THEN
WHEN '1215437824174608386' THEN
'锦水'
WHEN '6f203e30de1a65aab7e69c058826cd80' THEN
'平阴' ELSE '孔村'
END AS customerName,
WHEN '1234085031077498881' THEN
'孔村'
WHEN 'f8d4a6af53b3fc5991ab1434b6ad39b8' THEN
'东阿镇'
WHEN 'f279343a67653fc20d8333c6b2e4dbee' THEN
'孝直镇'
WHEN 'ea78a8e9252f567517c4a8d60250c714' THEN
'安城镇'
WHEN 'c259c3b1d27f960b9b379fb2886179ba' THEN
'洪范池镇'
WHEN 'd20a7488eedf5bcfd5231c3771bc0e3d' THEN
'玫瑰镇'
ELSE '未知'
END AS agencyName,
PROJECT_TOTAL AS reportCount,
DATE_ID,
(
@ -414,21 +426,22 @@
screen_project_data
WHERE
1 = 1
AND customer_id = a.CUSTOMER_ID
AND CUSTOMER_ID = a.CUSTOMER_ID
AND ALL_PARENT_IDS LIKE CONCAT( '%', a.AGENCY_ID, '%' )
AND DEL_FLAG = '0'
AND DATE_FORMAT( PROJECT_CREATE_TIME, '%Y%m%d' ) &lt;= DATE_ID
GROUP BY
CUSTOMER_ID
AGENCY_ID
ORDER BY
CUSTOMER_ID
AGENCY_ID
) AS count
FROM
epmet_data_statistical.fact_agency_project_daily a
WHERE
1 = 1
AND del_flag = '0'
AND customer_id IN ( '2fe0065f70ca0e23ce4c26fca5f1d933', '44876154d10d7cb7affd92000f84f833', '46c55cb862d6d5e6d05d2ab61a1cc07e' )
AND AGENCY_ID IN ( '1234085031077498881', '1215437824174608386', '1258587398679126017' )
AND customer_id IN ( '2fe0065f70ca0e23ce4c26fca5f1d933', '44876154d10d7cb7affd92000f84f833', '46c55cb862d6d5e6d05d2ab61a1cc07e', '6f203e30de1a65aab7e69c058826cd80' )
AND AGENCY_ID IN ( '1234085031077498881', '1215437824174608386', '1258587398679126017', 'c259c3b1d27f960b9b379fb2886179ba', 'd20a7488eedf5bcfd5231c3771bc0e3d', 'ea78a8e9252f567517c4a8d60250c714', 'f279343a67653fc20d8333c6b2e4dbee', 'f8d4a6af53b3fc5991ab1434b6ad39b8' )
<if test='null != dateId and "" != dateId'>
AND DATE_ID = #{dateId}
</if>
@ -436,13 +449,13 @@
AND DATE_ID BETWEEN #{startDate} AND #{endDate}
</if>
GROUP BY
CUSTOMER_ID,
AGENCY_ID,
DATE_ID
HAVING
1 = 1
AND reportCount != count
ORDER BY
CUSTOMER_ID,
DATE_ID DESC
AGENCY_ID,
DATE_ID DESC
</select>
</mapper>

6
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/VolunteerInfoServiceImpl.java

@ -67,6 +67,12 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.Set;
import java.util.Optional;
import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;

6
epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/BlockChainProcessProjectFormDTO.java

@ -13,6 +13,12 @@ import java.util.List;
public class BlockChainProcessProjectFormDTO implements Serializable {
private static final long serialVersionUID = -7316616101790749793L;
/**
* 项目基础信息
*/
private BlockChainProjectFormDTO project;
@NotNull(message = "处理进展信息不能为空")
private BlockChainProjectProcessFormDTO process;

9
epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/BlockChainProjectServiceImpl.java

@ -182,15 +182,20 @@ public class BlockChainProjectServiceImpl implements BlockChainProjectService, R
@Override
public void blockChainProcessProject(BlockChainProcessProjectFormDTO input) {
BlockChainProjectFormDTO project = input.getProject();
BlockChainProjectProcessFormDTO process = input.getProcess();
List<BlockChainProjectProcessAssignedStaffFormDTO> assignedStaffs = input.getAssignedStaffs();
BlockChainProjectProcessAssignedStaffFormDTO handledStaff = input.getHandledStaff();
fill(null, process, assignedStaffs, handledStaff);
fill(project, process, assignedStaffs, handledStaff);
String processString = JSON.toJSONString(process);
blockChainProducer.sendMsg(BlockChainProducer.TOPIC_PROJECT, BlockChainProducer.TAG_SEND_PROCESS, processString);
if (project != null) {
blockChainProducer.sendMsg(BlockChainProducer.TOPIC_PROJECT, BlockChainProducer.TAG_SEND_PROJECT, JSON.toJSONString(project));
}
if (assignedStaffs != null && assignedStaffs.size() > 0) {
String assignedStaffsString = JSON.toJSONString(assignedStaffs);
blockChainProducer.sendMsg(BlockChainProducer.TOPIC_PROJECT, BlockChainProducer.TAG_SEND_ASSIGNED_STAFFS, assignedStaffsString);

30
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/NeighborHoodManageDelFormDTO.java

@ -0,0 +1,30 @@
package com.epmet.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.List;
/**
* @Author zxc
* @DateTime 2022/3/1 4:35 下午
* @DESC
*/
@Data
public class NeighborHoodManageDelFormDTO implements Serializable {
private static final long serialVersionUID = 405799151478155056L;
public interface NeighborHoodManageDelForm{}
@NotNull(message = "ids不能为空" , groups = NeighborHoodManageDelForm.class)
private List<String> ids;
/**
* 小区neighborHood楼栋building房屋house
*/
@NotBlank(message = "type不能为空" , groups = NeighborHoodManageDelForm.class)
private String type;
}

22
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/NeighborHoodManageDelResultDTO.java

@ -0,0 +1,22 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2022/3/2 10:05 上午
* @DESC
*/
@Data
public class NeighborHoodManageDelResultDTO implements Serializable {
private static final long serialVersionUID = -4248802585738319974L;
private String neighborHoodId;
private String buildingId;
private String houseId;
private String name;
}

1
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/constant/CustomerGridConstant.java

@ -19,4 +19,5 @@ public interface CustomerGridConstant {
String NEIGHBORHOOD = "neighborHood";
String BUILDING = "building";
String HOUSE = "house";
}

13
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java

@ -289,4 +289,17 @@ public class HouseController implements ResultDataResolver {
return new Result<>();
}
/**
* Desc 小区管理中批量删除
* @param formDTO
* @author zxc
* @date 2022/3/1 4:57 下午
*/
@PostMapping("delete")
public Result allDelete(@RequestBody NeighborHoodManageDelFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO, NeighborHoodManageDelFormDTO.NeighborHoodManageDelForm.class);
houseService.allDelete(formDTO);
return new Result();
}
}

1
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcNeighborHoodController.java

@ -40,6 +40,7 @@ import com.epmet.feign.EpmetCommonServiceOpenFeignClient;
import com.epmet.service.IcNeighborHoodService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

26
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcHouseDao.java

@ -20,6 +20,7 @@ package com.epmet.dao;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.result.HouseInfoDTO;
import com.epmet.dto.result.NeighborHoodManageDelResultDTO;
import com.epmet.entity.IcHouseEntity;
import com.epmet.excel.IcHouseExcel;
import org.apache.ibatis.annotations.Mapper;
@ -74,4 +75,29 @@ public interface IcHouseDao extends BaseDao<IcHouseEntity> {
@Param("buildingUnitId")String buildingUnitId,
@Param("doorName")String doorName,
@Param("houseId")String houseId);
/**
* Desc: 根据小区IDs查询小区下是否有存在楼栋的
* @param ids
* @author zxc
* @date 2022/3/2 9:51 上午
*/
List<NeighborHoodManageDelResultDTO> selectExistBuildingByNeighborHoodIds(@Param("ids")List<String> ids);
/**
* Desc: 根据楼栋IDs查询楼栋下是否有存在房屋的
* @param ids
* @author zxc
* @date 2022/3/2 9:53 上午
*/
List<NeighborHoodManageDelResultDTO> selectExistHouseByBuildingIds(@Param("ids")List<String> ids);
/**
* Desc: 根据房屋ID查询名字
* @param ids
* @author zxc
* @date 2022/3/2 11:00 上午
*/
List<String> selectHouseNames(@Param("ids")List<String> ids);
}

9
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/HouseService.java

@ -21,6 +21,7 @@ import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.form.IcHouseFormDTO;
import com.epmet.dto.form.ImportInfoFormDTO;
import com.epmet.dto.form.ListIcNeighborHoodFormDTO;
import com.epmet.dto.form.NeighborHoodManageDelFormDTO;
import com.epmet.dto.result.HouseInfoDTO;
import com.epmet.dto.result.IcNeighborHoodResultDTO;
import com.epmet.dto.result.ImportTaskCommonResultDTO;
@ -68,5 +69,13 @@ public interface HouseService {
List<HouseInfoDTO> queryListHouseInfo(Set<String> houseIds, String customerId);
/**
* Desc 小区管理中批量删除
* @param formDTO
* @author zxc
* @date 2022/3/1 4:57 下午
*/
void allDelete(NeighborHoodManageDelFormDTO formDTO);
Result dispose(InputStream inputStream, ImportInfoFormDTO formDTO, Result<ImportTaskCommonResultDTO> importTask);
}

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

@ -18,6 +18,8 @@ import com.epmet.commons.tools.feign.ResultDataResolver;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.constant.CustomerGridConstant;
import com.epmet.commons.tools.utils.Result;
import com.epmet.constants.ImportTaskConstants;
import com.epmet.dao.IcBuildingDao;
import com.epmet.dao.IcBuildingUnitDao;
@ -31,15 +33,18 @@ import com.epmet.dto.form.IcHouseFormDTO;
import com.epmet.dto.form.ImportInfoFormDTO;
import com.epmet.dto.form.ImportTaskCommonFormDTO;
import com.epmet.dto.form.ListIcNeighborHoodFormDTO;
import com.epmet.dto.form.NeighborHoodManageDelFormDTO;
import com.epmet.dto.result.HouseInfoDTO;
import com.epmet.dto.result.IcNeighborHoodResultDTO;
import com.epmet.dto.result.ImportTaskCommonResultDTO;
import com.epmet.dto.result.NeighborHoodManageDelResultDTO;
import com.epmet.entity.IcHouseEntity;
import com.epmet.enums.HousePurposeEnums;
import com.epmet.enums.HouseRentFlagEnums;
import com.epmet.enums.HouseTypeEnums;
import com.epmet.excel.IcHouseExcel;
import com.epmet.feign.EpmetCommonServiceOpenFeignClient;
import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.feign.GovOrgOpenFeignClient;
import com.epmet.model.HouseInfoModel;
import com.epmet.model.ImportHouseInfoListener;
@ -101,6 +106,8 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver {
@Autowired
private ExecutorService executorService;
@Autowired
private EpmetUserOpenFeignClient epmetUserOpenFeignClient;
@Override
@ -382,4 +389,84 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver {
});
return new Result();
}
/**
* Desc 小区管理中批量删除
* @param formDTO
* @author zxc
* @date 2022/3/1 4:57 下午
*/
@Override
public void allDelete(NeighborHoodManageDelFormDTO formDTO) {
if (CollectionUtils.isEmpty(formDTO.getIds())){
return;
}
List<String> ids = formDTO.getIds();
if (formDTO.getType().equals(CustomerGridConstant.NEIGHBORHOOD)){
List<NeighborHoodManageDelResultDTO> exists = icHouseDao.selectExistBuildingByNeighborHoodIds(ids);
if (!CollectionUtils.isEmpty(exists)){
exists.forEach(e -> {
for (int i = NumConstant.ZERO; i < ids.size(); i++) {
if (ids.get(i).equals(e.getNeighborHoodId())){
ids.remove(i);
continue;
}
}
});
}
if (!CollectionUtils.isEmpty(ids)){
icNeighborHoodDao.deleteBatchIds(ids);
}
if (!CollectionUtils.isEmpty(exists)){
String collect = exists.stream().map(m -> m.getName()).collect(Collectors.joining(","));
EpmetErrorCode.NEIGHBORHOOD_DEL_FAILED.setMsg(String.format("%s内包含楼宇信息,暂无法删除",collect));
throw new EpmetException(EpmetErrorCode.NEIGHBORHOOD_DEL_FAILED.getCode());
}
}else if (formDTO.getType().equals(CustomerGridConstant.BUILDING)){
List<NeighborHoodManageDelResultDTO> exists = icHouseDao.selectExistHouseByBuildingIds(ids);
if (!CollectionUtils.isEmpty(exists)){
exists.forEach(e -> {
for (int i = NumConstant.ZERO; i < ids.size(); i++) {
if (ids.get(i).equals(e.getBuildingId())){
ids.remove(i);
continue;
}
}
});
}
if (!CollectionUtils.isEmpty(ids)){
icBuildingDao.deleteBatchIds(ids);
}
if (!CollectionUtils.isEmpty(exists)){
String collect = exists.stream().map(m -> m.getName()).collect(Collectors.joining(","));
EpmetErrorCode.NEIGHBORHOOD_DEL_FAILED.setMsg(String.format("%s内包含房屋信息,暂无法删除",collect));
throw new EpmetException(EpmetErrorCode.NEIGHBORHOOD_DEL_FAILED.getCode());
}
}else if (formDTO.getType().equals(CustomerGridConstant.HOUSE)){
Result<List<String>> existUsers = epmetUserOpenFeignClient.getExistUserByHouseIds(ids);
if (!existUsers.success()){
throw new EpmetException("根据房屋IDs查询房屋下是否有存在居民失败...");
}
List<String> exists = existUsers.getData();
if (!CollectionUtils.isEmpty(exists)){
exists.forEach(e -> {
for (int i = NumConstant.ZERO; i < ids.size(); i++) {
if (ids.get(i).equals(e)){
ids.remove(i);
continue;
}
}
});
}
if (!CollectionUtils.isEmpty(ids)){
icHouseDao.deleteBatchIds(ids);
}
if (!CollectionUtils.isEmpty(exists)){
List<String> list = icHouseDao.selectHouseNames(exists);
String collect = list.stream().collect(Collectors.joining(","));
EpmetErrorCode.NEIGHBORHOOD_DEL_FAILED.setMsg(String.format("%s内包含居民信息,暂无法删除",collect));
throw new EpmetException(EpmetErrorCode.NEIGHBORHOOD_DEL_FAILED.getCode());
}
}
}
}

6
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcNeighborHoodServiceImpl.java

@ -71,6 +71,7 @@ import org.apache.commons.lang3.StringUtils;
import org.apache.http.entity.ContentType;
import org.apache.poi.ss.usermodel.Workbook;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;
@ -231,8 +232,9 @@ public class IcNeighborHoodServiceImpl extends BaseServiceImpl<IcNeighborHoodDao
* @date 2022/2/12 11:11 上午
*/
@Override
@Async
public Result neighborhoodImport(ImportInfoFormDTO formDTO, InputStream inputStream,Result<ImportTaskCommonResultDTO> importTask) {
executorService.submit(() -> {
// executorService.submit(() -> {
// importNeighbor(formDTO,file,importTask);
log.info("neighborhoodImport thread start=====");
ExcelReader excelReader = null;
@ -257,7 +259,7 @@ public class IcNeighborHoodServiceImpl extends BaseServiceImpl<IcNeighborHoodDao
}
}
log.info("neighborhoodImport thread end=====");
});
// });
return new Result<>();
}

18
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml

@ -709,15 +709,6 @@
agency.DEL_FLAG = '0'
AND agency.ID = #{agencyId}
</select>
<select id="getSonGridId" resultType="com.epmet.dto.result.SonOrgResultDTO">
SELECT
ID AS orgId,
pids
FROM customer_grid
WHERE
DEL_FLAG = '0'
AND PID = #{orgId}
</select>
<select id="getAgencyMobile" resultType="com.epmet.dto.result.OrgMobileResultDTO">
SELECT
@ -732,6 +723,15 @@
AND ca.del_flag = '0'
AND cg.id = #{gridId}
</select>
<select id="getSonGridId" resultType="com.epmet.dto.result.SonOrgResultDTO">
SELECT
ID AS orgId,
pids
FROM customer_grid
WHERE
DEL_FLAG = '0'
AND PID = #{orgId}
</select>
<update id="updateSubAgencyAreaCodeById" parameterType="map">
UPDATE customer_agency

43
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml

@ -333,4 +333,47 @@
ih.DEL_FLAG = '0'
AND ih.ID = #{houseId}
</select>
<!-- 根据小区IDs查询小区下是否有存在楼栋的 -->
<select id="selectExistBuildingByNeighborHoodIds" resultType="com.epmet.dto.result.NeighborHoodManageDelResultDTO">
SELECT
nh.ID AS neighborHoodId,
nh.NEIGHBOR_HOOD_NAME AS name
FROM ic_neighbor_hood nh
INNER JOIN ic_building b ON (nh.id = b.NEIGHBOR_HOOD_ID AND b.DEL_FLAG = '0')
WHERE nh.DEL_FLAG = '0'
AND nh.ID IN (
<foreach collection="ids" item="id" separator=",">
#{id}
</foreach>
)
GROUP BY nh.id
</select>
<!-- 根据楼栋IDs查询楼栋下是否有存在房屋的 -->
<select id="selectExistHouseByBuildingIds" resultType="com.epmet.dto.result.NeighborHoodManageDelResultDTO">
SELECT
b.ID AS buildingId,
b.BUILDING_NAME AS name
FROM ic_building b
INNER JOIN ic_house h ON (h.BUILDING_ID = b.ID AND h.DEL_FLAG = '0')
WHERE b.DEL_FLAG = '0'
AND b.ID IN (
<foreach collection="ids" item="id" separator=",">
#{id}
</foreach>
)
GROUP BY b.id
</select>
<!-- 根据房屋ID查询名字 -->
<select id="selectHouseNames" resultType="java.lang.String">
SELECT HOUSE_NAME FROM ic_house
WHERE DEL_FLAG = '0'
AND id IN (
<foreach collection="ids" item="id" separator=",">
#{id}
</foreach>
)
</select>
</mapper>

5
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/BlockChainUploadServiceImpl.java

@ -134,9 +134,10 @@ public class BlockChainUploadServiceImpl implements BlockChainUploadService {
}
Result result;
if (project == null) {
// 处理
if (!"created".equals(processEntity.getOperation())) {
// 处理。如果是结案,则会有project对象,因为要传递结案状态给区块链,其他状态则project==null
BlockChainProcessProjectFormDTO processForm = new BlockChainProcessProjectFormDTO();
processForm.setProject(project);
processForm.setProcess(process);
processForm.setAssignedStaffs(assignedStaffs);
processForm.setHandledStaff(handledStaff);

4
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java

@ -599,7 +599,7 @@ public class ProjectServiceImpl extends BaseServiceImpl<ProjectDao, ProjectEntit
// 数据上链
try {
blockChainUploadService.send2BlockChain(null, projectProcessEntity, null, fromDTO.getProjectStaffId());
blockChainUploadService.send2BlockChain(projectEntity, projectProcessEntity, null, fromDTO.getProjectStaffId());
} catch (Exception e) {
String errorMsg = ExceptionUtils.getThrowableErrorStackTrace(e);
log.error("【项目流转】上链失败,错误信息:{}", errorMsg);
@ -827,7 +827,7 @@ public class ProjectServiceImpl extends BaseServiceImpl<ProjectDao, ProjectEntit
// 数据上链
try {
blockChainUploadService.send2BlockChain(null, projectProcessEntity, null, fromDTO.getProjectStaffId());
blockChainUploadService.send2BlockChain(projectEntity, projectProcessEntity, null, fromDTO.getProjectStaffId());
} catch (Exception e) {
String errorMsg = ExceptionUtils.getThrowableErrorStackTrace(e);
log.error("【项目流转】上链失败,错误信息:{}", errorMsg);

11
epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/OperCustomizeOpenFeignClient.java

@ -102,10 +102,19 @@ public interface OperCustomizeOpenFeignClient {
Result<List<IcResiCategoryStatsConfigDTO>> getCategoryList(@RequestBody IcResiCategoryStatsConfigDTO dto);
/**
* 获取居民类别配置表ic_resi_category_stats_config根据token里的客户id查询可根据状态筛选显示show隐藏hidden
* @param formDTO
* @return
*/
@PostMapping("/oper/customize/resicategorystatsconfig/resicategorystatslistshowd")
Result<List<IcResiCategoryStatsConfigDTO>> resiCategoryStatsListShowd(@RequestBody IcResiCategoryStatsConfigFormDTO formDTO);
/**
* 查询ic_resi_category_warn_config,返回预警的类别
* @param customerId
* @return
*/
@PostMapping("/oper/customize/resicategorystatsconfig/resicategorywarnlist")
Result<List<IcResiCategoryWarnConfigDTO>> resiCategoryWarnList(@RequestParam String customerId);

11
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/ResiCategoryStatsConfigController.java

@ -128,6 +128,12 @@ public class ResiCategoryStatsConfigController {
return new Result<IcResiCategoryStatsConfigResultDTO>().ok(resiCategoryStatsConfigService.info(formDTO.getId(),tokenDTO.getCustomerId()));
}
/**
* 获取居民类别配置表ic_resi_category_stats_config根据token里的客户id查询可根据状态筛选显示show隐藏hidden
* @param tokenDTO
* @param formDTO
* @return
*/
@PostMapping("resicategorystatslistshowd")
public Result<List<IcResiCategoryStatsConfigDTO>> resiCategoryStatsListShowd(@LoginUser TokenDto tokenDTO,@RequestBody IcResiCategoryStatsConfigFormDTO formDTO){
//获取预警配置列表
@ -145,6 +151,11 @@ public class ResiCategoryStatsConfigController {
return new Result<List<IcResiCategoryStatsConfigDTO>>().ok(ConvertUtils.sourceToTarget(statsConfigEntityList, IcResiCategoryStatsConfigDTO.class));
}
/**
* 查询ic_resi_category_warn_config,返回预警的类别
* @param customerId
* @return
*/
@PostMapping("resicategorywarnlist")
public Result<List<IcResiCategoryWarnConfigDTO>> resiCategoryWarnList(@RequestParam String customerId){
//获取预警配置列表

36
epmet-module/resi-guide/resi-guide-server/pom.xml

@ -141,6 +141,15 @@
<!--是否开启服务列表变更监听-->
<nacos.service-list-changed-listening.enable>true</nacos.service-list-changed-listening.enable>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>10</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>resi-guide-</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
<spring.flyway.enabled>false</spring.flyway.enabled>
<!--钉钉 机器人地址-->
<dingTalk.robot.webHook>
@ -181,6 +190,15 @@
<!--是否开启服务列表变更监听-->
<nacos.service-list-changed-listening.enable>false</nacos.service-list-changed-listening.enable>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>10</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>epmet-guide-</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
<spring.flyway.enabled>false</spring.flyway.enabled>
<!--钉钉 机器人地址-->
<dingTalk.robot.webHook>
@ -221,6 +239,15 @@
<!--是否开启服务列表变更监听-->
<nacos.service-list-changed-listening.enable>true</nacos.service-list-changed-listening.enable>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>10</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>epmet-guide-</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
<spring.flyway.enabled>true</spring.flyway.enabled>
<!--测试钉钉 机器人地址-->
<dingTalk.robot.webHook>
@ -259,6 +286,15 @@
<!--是否开启服务列表变更监听-->
<nacos.service-list-changed-listening.enable>true</nacos.service-list-changed-listening.enable>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>10</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>epmet-guide-</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
<spring.flyway.enabled>true</spring.flyway.enabled>
<!--生产钉钉 机器人地址-->

11
epmet-module/resi-guide/resi-guide-server/src/main/resources/bootstrap.yml

@ -133,3 +133,14 @@ shutdown:
graceful:
enable: true #是否开启优雅停机
waitTimeSecs: 30 # 优雅停机等待时间,超过30秒,发出告警
thread:
# 线程池配置
threadPool:
enableCustomize: @thread.threadPool.enable-customize@
corePoolSize: @thread.threadPool.core-pool-size@
maxPoolSize: @thread.threadPool.max-pool-size@
queueCapacity: @thread.threadPool.queue-capacity@
keepAliveSeconds: @thread.threadPool.keep-alive-seconds@
threadNamePrefix: @thread.threadPool.thread-name-prefix@
rejectedExecutionHandler: @thread.threadPool.rejected-execution-handler@

36
epmet-module/resi-hall/resi-hall-server/pom.xml

@ -105,6 +105,15 @@
<!--是否开启服务列表变更监听-->
<nacos.service-list-changed-listening.enable>true</nacos.service-list-changed-listening.enable>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>10</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>resi-hall</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
<spring.flyway.enabled>false</spring.flyway.enabled>
<!--钉钉 机器人地址-->
<dingTalk.robot.webHook>
@ -139,6 +148,15 @@
<!--是否开启服务列表变更监听-->
<nacos.service-list-changed-listening.enable>false</nacos.service-list-changed-listening.enable>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>10</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>resi-hall</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
<spring.flyway.enabled>false</spring.flyway.enabled>
<!--钉钉 机器人地址-->
<dingTalk.robot.webHook>
@ -173,6 +191,15 @@
<!--是否开启服务列表变更监听-->
<nacos.service-list-changed-listening.enable>true</nacos.service-list-changed-listening.enable>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>10</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>resi-hall</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
<spring.flyway.enabled>true</spring.flyway.enabled>
<!--测试钉钉 机器人地址-->
<dingTalk.robot.webHook>
@ -204,6 +231,15 @@
<!--是否开启服务列表变更监听-->
<nacos.service-list-changed-listening.enable>true</nacos.service-list-changed-listening.enable>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>10</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>resi-hall</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
<spring.flyway.enabled>true</spring.flyway.enabled>
<!--生产钉钉 机器人地址-->

11
epmet-module/resi-hall/resi-hall-server/src/main/resources/bootstrap.yml

@ -88,3 +88,14 @@ shutdown:
graceful:
enable: true #是否开启优雅停机
waitTimeSecs: 30 # 优雅停机等待时间,超过30秒,发出告警
thread:
# 线程池配置
threadPool:
enableCustomize: @thread.threadPool.enable-customize@
corePoolSize: @thread.threadPool.core-pool-size@
maxPoolSize: @thread.threadPool.max-pool-size@
queueCapacity: @thread.threadPool.queue-capacity@
keepAliveSeconds: @thread.threadPool.keep-alive-seconds@
threadNamePrefix: @thread.threadPool.thread-name-prefix@
rejectedExecutionHandler: @thread.threadPool.rejected-execution-handler@

36
epmet-module/resi-home/resi-home-server/pom.xml

@ -129,6 +129,15 @@
<!--是否开启服务列表变更监听-->
<nacos.service-list-changed-listening.enable>true</nacos.service-list-changed-listening.enable>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>10</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>resi-home</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
<!--钉钉 机器人地址-->
<dingTalk.robot.webHook>
https://oapi.dingtalk.com/robot/send?access_token=e894e5690f9d6a527722974c71548ff6c0fe29bd956589a09e21b16442a35ed4
@ -162,6 +171,15 @@
<!--是否开启服务列表变更监听-->
<nacos.service-list-changed-listening.enable>false</nacos.service-list-changed-listening.enable>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>10</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>resi-home</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
<!--钉钉 机器人地址-->
<dingTalk.robot.webHook>
https://oapi.dingtalk.com/robot/send?access_token=e894e5690f9d6a527722974c71548ff6c0fe29bd956589a09e21b16442a35ed4
@ -195,6 +213,15 @@
<!--是否开启服务列表变更监听-->
<nacos.service-list-changed-listening.enable>true</nacos.service-list-changed-listening.enable>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>10</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>resi-home</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
<!--测试钉钉 机器人地址-->
<dingTalk.robot.webHook>
https://oapi.dingtalk.com/robot/send?access_token=e894e5690f9d6a527722974c71548ff6c0fe29bd956589a09e21b16442a35ed4
@ -226,6 +253,15 @@
<!--是否开启服务列表变更监听-->
<nacos.service-list-changed-listening.enable>true</nacos.service-list-changed-listening.enable>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>10</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>resi-home</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
<!--生产钉钉 机器人地址-->
<dingTalk.robot.webHook>
https://oapi.dingtalk.com/robot/send?access_token=a5f66c3374b1642fe2142dbf56d5997e280172d4e8f2b546c9423a68c82ece6c

11
epmet-module/resi-home/resi-home-server/src/main/resources/bootstrap.yml

@ -87,3 +87,14 @@ shutdown:
graceful:
enable: true #是否开启优雅停机
waitTimeSecs: 30 # 优雅停机等待时间,超过30秒,发出告警
thread:
# 线程池配置
threadPool:
enableCustomize: @thread.threadPool.enable-customize@
corePoolSize: @thread.threadPool.core-pool-size@
maxPoolSize: @thread.threadPool.max-pool-size@
queueCapacity: @thread.threadPool.queue-capacity@
keepAliveSeconds: @thread.threadPool.keep-alive-seconds@
threadNamePrefix: @thread.threadPool.thread-name-prefix@
rejectedExecutionHandler: @thread.threadPool.rejected-execution-handler@

36
epmet-module/resi-mine/resi-mine-server/pom.xml

@ -148,6 +148,15 @@
<!--是否开启服务列表变更监听-->
<nacos.service-list-changed-listening.enable>true</nacos.service-list-changed-listening.enable>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>10</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>resi-mine</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
<!--钉钉 机器人地址-->
<dingTalk.robot.webHook>
https://oapi.dingtalk.com/robot/send?access_token=e894e5690f9d6a527722974c71548ff6c0fe29bd956589a09e21b16442a35ed4
@ -180,6 +189,15 @@
<!--是否开启服务列表变更监听-->
<nacos.service-list-changed-listening.enable>false</nacos.service-list-changed-listening.enable>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>10</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>resi-mine</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
<!--钉钉 机器人地址-->
<dingTalk.robot.webHook>
https://oapi.dingtalk.com/robot/send?access_token=e894e5690f9d6a527722974c71548ff6c0fe29bd956589a09e21b16442a35ed4
@ -212,6 +230,15 @@
<!--是否开启服务列表变更监听-->
<nacos.service-list-changed-listening.enable>true</nacos.service-list-changed-listening.enable>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>10</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>resi-mine</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
<!--测试钉钉 机器人地址-->
<dingTalk.robot.webHook>
https://oapi.dingtalk.com/robot/send?access_token=e894e5690f9d6a527722974c71548ff6c0fe29bd956589a09e21b16442a35ed4
@ -242,6 +269,15 @@
<!--是否开启服务列表变更监听-->
<nacos.service-list-changed-listening.enable>true</nacos.service-list-changed-listening.enable>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>10</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>resi-mine</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
<!--生产钉钉 机器人地址-->
<dingTalk.robot.webHook>
https://oapi.dingtalk.com/robot/send?access_token=a5f66c3374b1642fe2142dbf56d5997e280172d4e8f2b546c9423a68c82ece6c

11
epmet-module/resi-mine/resi-mine-server/src/main/resources/bootstrap.yml

@ -111,3 +111,14 @@ shutdown:
graceful:
enable: true #是否开启优雅停机
waitTimeSecs: 30 # 优雅停机等待时间,超过30秒,发出告警
thread:
# 线程池配置
threadPool:
enableCustomize: @thread.threadPool.enable-customize@
corePoolSize: @thread.threadPool.core-pool-size@
maxPoolSize: @thread.threadPool.max-pool-size@
queueCapacity: @thread.threadPool.queue-capacity@
keepAliveSeconds: @thread.threadPool.keep-alive-seconds@
threadNamePrefix: @thread.threadPool.thread-name-prefix@
rejectedExecutionHandler: @thread.threadPool.rejected-execution-handler@

42
epmet-module/resi-partymember/resi-partymember-server/pom.xml

@ -69,12 +69,6 @@
<version>2.0.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.epmet</groupId>
<artifactId>epmet-user-client</artifactId>
<version>2.0.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>info.debatty</groupId>
<artifactId>java-string-similarity</artifactId>
@ -164,6 +158,15 @@
<!--是否开启服务列表变更监听-->
<nacos.service-list-changed-listening.enable>true</nacos.service-list-changed-listening.enable>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>10</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>resi-partymember-</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
<spring.flyway.enabled>false</spring.flyway.enabled>
<!--钉钉 机器人地址-->
@ -205,6 +208,15 @@
<!--是否开启服务列表变更监听-->
<nacos.service-list-changed-listening.enable>false</nacos.service-list-changed-listening.enable>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>10</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>resi-partymember-</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
<spring.flyway.enabled>false</spring.flyway.enabled>
<!--钉钉 机器人地址-->
@ -246,6 +258,15 @@
<!--是否开启服务列表变更监听-->
<nacos.service-list-changed-listening.enable>true</nacos.service-list-changed-listening.enable>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>10</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>resi-partymember-</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
<spring.flyway.enabled>true</spring.flyway.enabled>
<!--测试钉钉 机器人地址-->
@ -285,6 +306,15 @@
<!--是否开启服务列表变更监听-->
<nacos.service-list-changed-listening.enable>true</nacos.service-list-changed-listening.enable>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>10</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>resi-partymember-</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
<spring.flyway.enabled>true</spring.flyway.enabled>

11
epmet-module/resi-partymember/resi-partymember-server/src/main/resources/bootstrap.yml

@ -132,3 +132,14 @@ shutdown:
graceful:
enable: true #是否开启优雅停机
waitTimeSecs: 30 # 优雅停机等待时间,超过30秒,发出告警
thread:
# 线程池配置
threadPool:
enableCustomize: @thread.threadPool.enable-customize@
corePoolSize: @thread.threadPool.core-pool-size@
maxPoolSize: @thread.threadPool.max-pool-size@
queueCapacity: @thread.threadPool.queue-capacity@
keepAliveSeconds: @thread.threadPool.keep-alive-seconds@
threadNamePrefix: @thread.threadPool.thread-name-prefix@
rejectedExecutionHandler: @thread.threadPool.rejected-execution-handler@

34
epmet-module/resi-voice/resi-voice-server/pom.xml

@ -105,6 +105,14 @@
<!--是否开启服务列表变更监听-->
<nacos.service-list-changed-listening.enable>true</nacos.service-list-changed-listening.enable>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>10</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>resi-voice</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
<!--钉钉 机器人地址-->
<dingTalk.robot.webHook>
@ -139,6 +147,15 @@
<!--是否开启服务列表变更监听-->
<nacos.service-list-changed-listening.enable>false</nacos.service-list-changed-listening.enable>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>10</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>resi-voice</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
<!--钉钉 机器人地址-->
<dingTalk.robot.webHook>
https://oapi.dingtalk.com/robot/send?access_token=e894e5690f9d6a527722974c71548ff6c0fe29bd956589a09e21b16442a35ed4
@ -172,6 +189,15 @@
<!--是否开启服务列表变更监听-->
<nacos.service-list-changed-listening.enable>true</nacos.service-list-changed-listening.enable>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>10</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>resi-voice</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
<!--测试钉钉 机器人地址-->
<dingTalk.robot.webHook>
https://oapi.dingtalk.com/robot/send?access_token=e894e5690f9d6a527722974c71548ff6c0fe29bd956589a09e21b16442a35ed4
@ -206,6 +232,14 @@
<!--是否开启服务列表变更监听-->
<nacos.service-list-changed-listening.enable>true</nacos.service-list-changed-listening.enable>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>10</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>resi-voice</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
<!--生产钉钉 机器人地址-->
<dingTalk.robot.webHook>

11
epmet-module/resi-voice/resi-voice-server/src/main/resources/bootstrap.yml

@ -79,3 +79,14 @@ shutdown:
graceful:
enable: true #是否开启优雅停机
waitTimeSecs: 30 # 优雅停机等待时间,超过30秒,发出告警
thread:
# 线程池配置
threadPool:
enableCustomize: @thread.threadPool.enable-customize@
corePoolSize: @thread.threadPool.core-pool-size@
maxPoolSize: @thread.threadPool.max-pool-size@
queueCapacity: @thread.threadPool.queue-capacity@
keepAliveSeconds: @thread.threadPool.keep-alive-seconds@
threadNamePrefix: @thread.threadPool.thread-name-prefix@
rejectedExecutionHandler: @thread.threadPool.rejected-execution-handler@

8
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/DelIcResiUserFormDTO.java

@ -4,7 +4,9 @@ import com.epmet.commons.tools.enums.IcFormCodeEnum;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.List;
/**
* @Description 删除居民
@ -18,10 +20,14 @@ public class DelIcResiUserFormDTO implements Serializable {
public interface IdGroup {
}
@NotBlank(message = "icResiUserId不能为空", groups = IdGroup.class)
private String icResiUserId;
@NotNull(message = "userIds不能为空", groups = IdGroup.class)
private List<String> userIds;
@NotBlank(message = "token获取的customerId不能为空", groups = IdGroup.class)
private String customerId;
private String formCode= IcFormCodeEnum.RESI_BASE_INFO.getCode();
}

2
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/PersonWarnRightListFormDTO.java

@ -22,4 +22,6 @@ public class PersonWarnRightListFormDTO implements Serializable {
@NotNull(message = "pageSize不能为空",groups = PersonWarnRightListForm.class)
private Integer pageSize;
private String categoryCode;
}

32
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/IcStatsResiWarnBuildingResultDTO.java

@ -20,7 +20,6 @@ package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
@ -38,21 +37,52 @@ public class IcStatsResiWarnBuildingResultDTO implements Serializable {
/**
* 预警配置ID
* ic_resi_category_warn_config.id
*/
private String configId;
/**
* ic_resi_category_warn_config.label
* 类别名
*/
private String label;
/**
* 排序
*/
private Integer sort;
/**
* 等级1阈值
*/
private Integer level1;
private Integer levelCount1;
/**
* 等级2阈值
*/
private Integer level2;
private Integer levelCount2;
/**
* 等级3阈值
*/
private Integer level3;
private Integer levelCount3;
/**
* 管理平台分类图标
*/
private String managementIcon;
/**
* 数据平台分类图标
*/
private String dataIcon;
/**
* 房屋显示分类图标
*/
private String houseShowIcon;
private Integer count;

3
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/PersonWarnRightListResultDTO.java

@ -35,6 +35,9 @@ public class PersonWarnRightListResultDTO implements Serializable {
*/
private List<String> type;
@JsonIgnore
private String sortString;
/**
* 所属网格
*/

11
epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java

@ -25,7 +25,7 @@ import java.util.Set;
* @author yinzuomei@elink-cn.com
* @date 2020/6/4 13:09
*/
// @FeignClient(name = ServiceConstant.EPMET_USER_SERVER, fallbackFactory = EpmetUserOpenFeignClientFallbackFactory.class, url = "localhost:8087")
// @FeignClient(name = ServiceConstant.EPMET_USER_SERVER, fallbackFactory = EpmetUserOpenFeignClientFallbackFactory.class, url = "localhost:8087")
@FeignClient(name = ServiceConstant.EPMET_USER_SERVER, fallbackFactory = EpmetUserOpenFeignClientFallbackFactory.class)
public interface EpmetUserOpenFeignClient {
@ -712,4 +712,13 @@ public interface EpmetUserOpenFeignClient {
@PostMapping("/epmetuser/statsresiwarn/list2")
Result<List<IcStatsResiResultDTO>> getPersonCategoryList(@RequestBody StatsResiListFormDTO formDTO);
/**
* Desc: 根据房屋IDs查询房屋下是否有存在居民的
* @param ids
* @author zxc
* @date 2022/3/2 10:32 上午
*/
@PostMapping("/epmetuser/icresiuser/getexistuserbyhouseids")
Result<List<String>> getExistUserByHouseIds(@RequestBody List<String> ids);
}

5
epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java

@ -527,4 +527,9 @@ public class EpmetUserOpenFeignClientFallback implements EpmetUserOpenFeignClien
public Result<List<IcStatsResiResultDTO>> getPersonCategoryList(StatsResiListFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getPersonCategoryList", formDTO);
}
@Override
public Result<List<String>> getExistUserByHouseIds(List<String> ids) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getExistUserByHouseIds", ids);
}
}

2
epmet-user/epmet-user-server/deploy/docker-compose-dev.yml

@ -9,7 +9,7 @@ services:
volumes:
- "/opt/epmet-cloud-logs/dev:/logs"
environment:
RUN_INSTRUCT: "java -Xms32m -Xmx512m -jar ./epmet-user.jar"
RUN_INSTRUCT: "java -Xms256m -Xmx512m -jar ./epmet-user.jar"
restart: "unless-stopped"
deploy:
resources:

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

@ -35,7 +35,6 @@ import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.exception.ExceptionUtils;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.feign.EpmetBaseRequestInterceptor;
import com.epmet.commons.tools.feign.ResultDataResolver;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.redis.RedisKeys;
@ -43,10 +42,7 @@ import com.epmet.commons.tools.redis.RedisUtils;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.security.user.LoginUserUtil;
import com.epmet.commons.tools.utils.ExcelUtils;
import com.epmet.commons.tools.utils.HttpClientManager;
import com.epmet.commons.tools.utils.IpUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.utils.*;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.constant.SystemMessageType;
import com.epmet.constants.ImportTaskConstants;
@ -67,7 +63,6 @@ import org.apache.commons.io.FileUtils;
import org.apache.commons.io.FilenameUtils;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.tomcat.util.http.MimeHeaders;
import org.jetbrains.annotations.NotNull;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpHeaders;
@ -75,7 +70,6 @@ import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.support.StandardMultipartHttpServletRequest;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@ -83,13 +77,11 @@ import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.lang.reflect.Field;
import java.net.URLEncoder;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.*;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutorService;
import java.util.stream.Collectors;
@ -135,6 +127,8 @@ public class IcResiUserController implements ResultDataResolver {
private LoginUserUtil loginUserUtil;
@Autowired
private RequestInterceptor requestInterceptor;
@Autowired
private ExecutorService executorService;
/**
* 模板枚举
@ -189,15 +183,19 @@ public class IcResiUserController implements ResultDataResolver {
public Result delete(@LoginUser TokenDto tokenDto, @RequestBody DelIcResiUserFormDTO formDTO) {
formDTO.setCustomerId(tokenDto.getCustomerId());
ValidatorUtils.validateEntity(formDTO, DelIcResiUserFormDTO.IdGroup.class);
icResiUserService.delete(formDTO);
//推送MQ事件
IcResiUserAddMQMsg mqMsg = new IcResiUserAddMQMsg();
mqMsg.setCustomerId(tokenDto.getCustomerId());
mqMsg.setIcResiUser(formDTO.getIcResiUserId());
SystemMsgFormDTO form = new SystemMsgFormDTO();
form.setMessageType(SystemMessageType.IC_RESI_USER_DEL);
form.setContent(mqMsg);
epmetMessageOpenFeignClient.sendSystemMsgByMQ(form);
formDTO.getUserIds().forEach(userId -> {
formDTO.setIcResiUserId(userId);
icResiUserService.delete(formDTO);
//推送MQ事件
IcResiUserAddMQMsg mqMsg = new IcResiUserAddMQMsg();
mqMsg.setCustomerId(tokenDto.getCustomerId());
mqMsg.setIcResiUser(userId);
SystemMsgFormDTO form = new SystemMsgFormDTO();
form.setMessageType(SystemMessageType.IC_RESI_USER_DEL);
form.setContent(mqMsg);
epmetMessageOpenFeignClient.sendSystemMsgByMQ(form);
});
return new Result();
}
@ -468,12 +466,8 @@ public class IcResiUserController implements ResultDataResolver {
throw new RenException("上传失败");
}
HashMap<String, String> headers = ((EpmetBaseRequestInterceptor) requestInterceptor).getHeadersFromRequest();
ThreadLocalConstant.inheritableAdditionalHeaders.set(headers);
// 三.异步执行导入
new Thread(() -> {
executorService.execute(() -> {
try {
List<FormItemResult> formItemList = icResiUserService.listFormItems(customerId,IcFormCodeEnum.RESI_BASE_INFO.getCode());
@ -492,31 +486,12 @@ public class IcResiUserController implements ResultDataResolver {
} catch (IOException e) {
log.error("【导入居民信息失败】清理上传的文件失败:{}", ExceptionUtils.getErrorStackTrace(e));
}
// 清理tl对象
ThreadLocalConstant.inheritableAdditionalHeaders.remove();
}
}).start();
});
return new Result();
}
// private HashMap<String, String> getHeadersFromRequest(HttpServletRequest request) {
// HashMap<String, String> headers = new HashMap<>();
// Enumeration<String> headerNames = request.getHeaderNames();
// if (headerNames != null) {
// while (headerNames.hasMoreElements()) {
// String name = headerNames.nextElement();
// Enumeration<String> values = request.getHeaders(name);
// while (values.hasMoreElements()) {
// String value = values.nextElement();
// headers.put(name, value);
// }
// }
// }
// return headers;
// }
@PostMapping("test")
public Result<List<Map<String, Object>>> test(@LoginUser TokenDto tokenDto, @RequestBody DynamicQueryFormDTO formDTO) {
formDTO.setCustomerId("45687aa479955f9d06204d415238f7cc");
@ -748,4 +723,33 @@ public class IcResiUserController implements ResultDataResolver {
ValidatorUtils.validateEntity(formDTO, PersonWarnRightListFormDTO.PersonWarnRightListForm.class);
return new Result<PersonWarnRightListResultDTO>().ok(icResiUserService.personWarnRightList(formDTO,tokenDto));
}
/**
* Desc: 根据房屋IDs查询房屋下是否有存在居民的
* @param ids
* @author zxc
* @date 2022/3/2 10:32 上午
*/
@PostMapping("getexistuserbyhouseids")
public Result<List<String>> getExistUserByHouseIds(@RequestBody List<String> ids){
return new Result<List<String>>().ok(icResiUserService.getExistUserByHouseIds(ids));
}
// public static ThreadLocal tl = new ThreadLocal();
@PostMapping("test-async")
public Result testAsync(HttpServletRequest request){
// tl.set("wxz");
executorService.submit(() -> {
try {
Thread.sleep(500l);
System.out.println("["+Thread.currentThread().getId() + "]:" + EpmetRequestHolder.getHeader("app"));
System.out.println("---");
} catch (InterruptedException e) {
e.printStackTrace();
}
// icResiUserImportService.testAsync();
});
return new Result();
}
}

17
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StatsResiWarnController.java

@ -17,19 +17,15 @@
package com.epmet.controller;
import com.epmet.common.token.annotation.Login;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dto.form.CategoryCountListFormDTO;
import com.epmet.dto.form.StatsResiListFormDTO;
import com.epmet.dto.form.StatsResiWarnCountFormDTO;
import com.epmet.dto.form.StatsResiWarnFormDTO;
import com.epmet.dto.result.CategoryCountListResultDTO;
import com.epmet.dto.result.IcStatsResiResultDTO;
import com.epmet.dto.result.IcStatsResiWarnBuildingResultDTO;
import com.epmet.dto.result.IcStatsResiWarnUserResultDTO;
import com.epmet.service.IcStatsResiWarnService;
import com.epmet.service.StatsResiWarnService;
import org.springframework.beans.factory.annotation.Autowired;
@ -80,6 +76,12 @@ public class StatsResiWarnController {
return new Result<List<IcStatsResiResultDTO>>().ok(statsResiWarnService.list2(formDTO));
}
/**
* 可视化分析-人员预警各类别楼栋数量展示
* @param tokenDto
* @param formDTO 只有agencyId
* @return
*/
@PostMapping("buildingwarnlist")
public Result buildingWarnList(@LoginUser TokenDto tokenDto,@RequestBody StatsResiWarnFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO, StatsResiWarnFormDTO.ListSelectedBuilding.class);
@ -89,6 +91,13 @@ public class StatsResiWarnController {
return new Result().ok(icStatsResiWarnBuildingResultDTOS);
}
/**
* 可视化分析-人员预警楼栋列表展示
* @param tokenDto
* @param formDTO
* @return
*/
@PostMapping("userwarnlist")
public Result userWarnList(@LoginUser TokenDto tokenDto,@RequestBody StatsResiWarnFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO, StatsResiWarnFormDTO.ListSelectedUser.class);

12
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java

@ -245,7 +245,7 @@ public interface IcResiUserDao extends BaseDao<IcResiUserEntity> {
List<String> icUserCustomerIds();
List<Map<String, String>> getIcUserList(@Param("customerId") String customerId, @Param("columns")List<String> columns);
List<Map<String, String>> getIcUserList(@Param("customerId") String customerId);
/**
* desc: 获取数据分析列中的 各类居民数据
@ -261,4 +261,14 @@ public interface IcResiUserDao extends BaseDao<IcResiUserEntity> {
*/
Map<String, BigDecimal> getDataAnalyseCount(@Param("customerId") String customerId, @Param("tableName") String tableName,
@Param("columnList") List<String> columnList, @Param("id") String id, @Param("level") String level);
List<Map<String, String>> getIcUserList(@Param("customerId") String customerId, @Param("columns")List<String> columns);
/**
* Desc: 根据房屋IDs查询房屋下是否有存在居民的
* @param ids
* @author zxc
* @date 2022/3/2 10:32 上午
*/
List<String> getExistUserByHouseIds(@Param("ids") List<String> ids);
}

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

@ -32,4 +32,6 @@ public interface IcResiUserImportService {
* @param resultDescPath 结果描述文件excel等文件有错误的话需要传入成功则不需要
*/
void finishImportTask(String importTaskId, String operatorId, String processStatus, String resultDesc, String resultDescPath);
Object testAsync();
}

7
epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java

@ -209,4 +209,11 @@ public interface IcResiUserService extends BaseService<IcResiUserEntity> {
*/
PersonWarnRightListResultDTO personWarnRightList(PersonWarnRightListFormDTO formDTO, TokenDto tokenDto);
/**
* Desc: 根据房屋IDs查询房屋下是否有存在居民的
* @param ids
* @author zxc
* @date 2022/3/2 10:32 上午
*/
List<String> getExistUserByHouseIds(List<String> ids);
}

18
epmet-user/epmet-user-server/src/main/java/com/epmet/service/StatsResiWarnService.java

@ -17,12 +17,9 @@
package com.epmet.service;
import com.epmet.dto.form.CategoryCountListFormDTO;
import com.epmet.dto.form.StatsResiListFormDTO;
import com.epmet.dto.result.CategoryCountListResultDTO;
import com.epmet.dto.result.IcStatsResiResultDTO;
import com.epmet.dto.result.IcStatsResiWarnBuildingResultDTO;
import com.epmet.dto.result.IcStatsResiWarnUserResultDTO;
import java.util.List;
import java.util.Map;
@ -35,8 +32,23 @@ import java.util.Map;
*/
public interface StatsResiWarnService{
/**
* 可视化分析-人员预警各类别楼栋数量展示
* @param customerId
* @param agencyID
* @return
*/
List<IcStatsResiWarnBuildingResultDTO> buildingwWarnList(String customerId,String agencyID);
/**
* 可视化分析-人员预警楼栋列表展示
* @param customerId
* @param configId
* @param buildingIdList
* @param pageNo
* @param pageSize
* @return
*/
Map<String,Object> userWarnList(String customerId, String configId, List<String> buildingIdList, Integer pageNo, Integer pageSize);
List<IcStatsResiResultDTO> list(String customerId,String id, String level);

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

@ -24,7 +24,9 @@ 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;
import com.epmet.constants.ImportTaskConstants;
import com.epmet.dao.IcResiUserDao;
@ -213,9 +215,9 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res
@Override
public void importIcResiInfoFromExcel(String importTaskId, List<FormItemResult> formItemList, String excelPathName, HttpServletResponse response, Path importTempPath) {
String app = ThreadLocalConstant.inheritableAdditionalHeaders.get().get(AppClientConstant.APP);
String client = ThreadLocalConstant.inheritableAdditionalHeaders.get().get(AppClientConstant.CLIENT);
String loginUserId = ThreadLocalConstant.inheritableAdditionalHeaders.get().get(AppClientConstant.USER_ID.toLowerCase());
String app = EpmetRequestHolder.getHeader(AppClientConstant.APP);
String client = EpmetRequestHolder.getHeader(AppClientConstant.CLIENT);
String loginUserId = EpmetRequestHolder.getHeader(AppClientConstant.USER_ID.toLowerCase());
String currUserAgencyId = userService.getLoginUserDetails(app, client, loginUserId).getAgencyId();
@ -316,7 +318,7 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res
*/
private void initImportThreadLocal(String customerId) {
// 生成importTag,用于标记唯一一次导入操作,导入完成之后,用来删除redis里面临时的key
String operatorId = ThreadLocalConstant.inheritableAdditionalHeaders.get().get(AppClientConstant.USER_ID.toLowerCase());
String operatorId = EpmetRequestHolder.getHeader(AppClientConstant.USER_ID.toLowerCase());
String importTag = operatorId + System.currentTimeMillis();
// 错误信息
@ -356,10 +358,10 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res
private void importIcResiBaseInfoFromExcel(List<FormItemResult> formItemList, String excelPathName, int sheetNo, int headRowNumber, String currUserAgencyId, String currUserAgencyPids, String currentUserId,
String tableName, String customerId) {
String loginUserApp = ThreadLocalConstant.inheritableAdditionalHeaders.get().get(AppClientConstant.APP);
String loginUserClient = ThreadLocalConstant.inheritableAdditionalHeaders.get().get(AppClientConstant.CLIENT);
String loginUserId = ThreadLocalConstant.inheritableAdditionalHeaders.get().get(AppClientConstant.USER_ID.toLowerCase());
String loginUserCustomerId = ThreadLocalConstant.inheritableAdditionalHeaders.get().get(AppClientConstant.CUSTOMER_ID.toLowerCase());
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());
log.info("importIcResiBaseInfoFromExcel:: userId:{}, app:{}, client:{}, customerId:{}", loginUserId, loginUserApp, loginUserClient, loginUserCustomerId);
@ -472,7 +474,7 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res
columnAndValues.put("AGENCY_ID", currUserAgencyId);
columnAndValues.put("PIDS", currUserAgencyPids);
columnAndValues.put("CUSTOMER_ID", ThreadLocalConstant.inheritableAdditionalHeaders.get().get(AppClientConstant.CUSTOMER_ID.toLowerCase()));
columnAndValues.put("CUSTOMER_ID", EpmetRequestHolder.getHeader(AppClientConstant.CUSTOMER_ID.toLowerCase()));
columnAndValues.put("UPDATED_BY", currentUserId);
@ -542,10 +544,10 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res
LinkedHashMap<String, String> columnAndValues = new LinkedHashMap<>();
String loginUserApp = ThreadLocalConstant.inheritableAdditionalHeaders.get().get(AppClientConstant.APP);
String loginUserClient = ThreadLocalConstant.inheritableAdditionalHeaders.get().get(AppClientConstant.CLIENT);
String loginUserId = ThreadLocalConstant.inheritableAdditionalHeaders.get().get(AppClientConstant.USER_ID.toLowerCase());
String loginUserCustomerId = ThreadLocalConstant.inheritableAdditionalHeaders.get().get(AppClientConstant.CUSTOMER_ID.toLowerCase());
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());
log.info("persistIcResiExtraInfo:: userId:{}, app:{}, client:{}, customerId:{}", loginUserId, loginUserApp, loginUserClient, loginUserCustomerId);
@ -1281,8 +1283,8 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res
Date now = new Date();
String customerId = ThreadLocalConstant.inheritableAdditionalHeaders.get().get(AppClientConstant.CUSTOMER_ID.toLowerCase());
String userId = ThreadLocalConstant.inheritableAdditionalHeaders.get().get(AppClientConstant.USER_ID.toLowerCase());
String userId = EpmetRequestHolder.getHeader(AppClientConstant.USER_ID.toLowerCase());
String customerId = EpmetRequestHolder.getHeader(AppClientConstant.CUSTOMER_ID.toLowerCase());
CustomerStaffInfoCacheResult operator = CustomerStaffRedis.getStaffInfo(customerId, userId);
@ -1378,8 +1380,8 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res
Set<String> newResiKeys = redisUtils.keys(RedisKeys.icResiImportTypeKey(newlyOrChangedResi.get().getImportTag(), "add").concat("*"));
String customerId = ThreadLocalConstant.inheritableAdditionalHeaders.get().get(AppClientConstant.CUSTOMER_ID.toLowerCase());
String userId = ThreadLocalConstant.inheritableAdditionalHeaders.get().get(AppClientConstant.USER_ID.toLowerCase());
String userId = EpmetRequestHolder.getHeader(AppClientConstant.USER_ID.toLowerCase());
String customerId = EpmetRequestHolder.getHeader(AppClientConstant.CUSTOMER_ID.toLowerCase());
CustomerStaffInfoCacheResult operator = CustomerStaffRedis.getStaffInfo(customerId, userId);
@ -1416,8 +1418,10 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res
*/
public void saveTransferedResiRecord(Map<String, ResiImportChangedData> transferedResis) {
Date now = new Date();
String loginUserId = ThreadLocalConstant.inheritableAdditionalHeaders.get().get(AppClientConstant.USER_ID.toLowerCase());
String loginUserCustomerId = ThreadLocalConstant.inheritableAdditionalHeaders.get().get(AppClientConstant.CUSTOMER_ID.toLowerCase());
String loginUserId = EpmetRequestHolder.getHeader(AppClientConstant.USER_ID.toLowerCase());
String loginUserCustomerId = EpmetRequestHolder.getHeader(AppClientConstant.CUSTOMER_ID.toLowerCase());
CustomerStaffInfoCacheResult operator = CustomerStaffRedis.getStaffInfo(loginUserCustomerId, loginUserId);
for (Map.Entry<String, ResiImportChangedData> resi : transferedResis.entrySet()) {
@ -1831,11 +1835,18 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res
}
public void printLog(String positionPrefix) {
String app = ThreadLocalConstant.inheritableAdditionalHeaders.get().get(AppClientConstant.APP);
String client = ThreadLocalConstant.inheritableAdditionalHeaders.get().get(AppClientConstant.CLIENT);
String loginUserId = ThreadLocalConstant.inheritableAdditionalHeaders.get().get(AppClientConstant.USER_ID.toLowerCase());
String loginUserCustomerId = ThreadLocalConstant.inheritableAdditionalHeaders.get().get(AppClientConstant.CUSTOMER_ID.toLowerCase());
String app = EpmetRequestHolder.getHeader(AppClientConstant.APP);
String client = EpmetRequestHolder.getHeader(AppClientConstant.CLIENT);
String loginUserId = EpmetRequestHolder.getHeader(AppClientConstant.USER_ID.toLowerCase());
String loginUserCustomerId = EpmetRequestHolder.getHeader(AppClientConstant.CUSTOMER_ID.toLowerCase());
log.info("{}:: userId:{}, app:{}, client:{}, customerId:{}", positionPrefix, loginUserId, app, client, loginUserCustomerId);
}
@Override
public Object testAsync() {
IcNeighborHoodDTO nform = new IcNeighborHoodDTO();
govOrgOpenFeignClient.getNeighborHoodOptions(nform);
return null;
}
}

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

@ -1183,8 +1183,19 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
if (CollectionUtils.isEmpty(configListResult.getData())){
return result;
}
List<CustomerCategoryShowAndWarnListResultDTO> configList = configListResult.getData();
PageInfo<Map<String, Object>> pageInfo = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.selectResiUsers(configList.stream().map(m -> m.getColumnName()).collect(Collectors.toList()), staffInfo.getAgencyId()));
List<CustomerCategoryShowAndWarnListResultDTO> configListOrigin = configListResult.getData();
List<CustomerCategoryShowAndWarnListResultDTO> configList = new ArrayList<>();
if (StringUtils.isNotBlank(formDTO.getCategoryCode())){
for (CustomerCategoryShowAndWarnListResultDTO c : configListOrigin) {
if (c.getColumnName().equals(formDTO.getCategoryCode())){
configList.add(c);
}
}
}else {
configList = configListOrigin;
}
List<CustomerCategoryShowAndWarnListResultDTO> finalConfigList = configList;
PageInfo<Map<String, Object>> pageInfo = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.selectResiUsers(finalConfigList.stream().map(m -> m.getColumnName()).collect(Collectors.toList()), staffInfo.getAgencyId()));
List<Map<String, Object>> list = pageInfo.getList();
if (CollectionUtils.isEmpty(list)) {
return result;
@ -1197,10 +1208,28 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
}
List<HouseInfoDTO> houseInfos = houseInfosResult.getData();
userList.forEach(u -> houseInfos.stream().filter(h -> h.getHomeId().equals(u.getHomeId())).forEach(h -> u.setFamily(h.getAllName())));
result.setList(userList);
// 类型+网格+家庭 排序
userList.forEach(u -> {
String types = u.getType().stream().map(String::valueOf).collect(Collectors.joining("、"));
String s = types + u.getGridName() + u.getFamily();
u.setSortString(s);
});
List<PersonWarnRightListResultDTO.PersonWarnRightList> finalResult = userList.stream().sorted(Comparator.comparing(PersonWarnRightListResultDTO.PersonWarnRightList::getSortString)).collect(Collectors.toList());
result.setList(finalResult);
return result;
}
/**
* Desc: 根据房屋IDs查询房屋下是否有存在居民的
* @param ids
* @author zxc
* @date 2022/3/2 10:32 上午
*/
@Override
public List<String> getExistUserByHouseIds(List<String> ids) {
return baseDao.getExistUserByHouseIds(ids);
}
/**
* @Description 居民分类 网格名 处理
* @param list

4
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/PatrolRoutineWorkServiceImpl.java

@ -97,9 +97,9 @@ public class PatrolRoutineWorkServiceImpl extends BaseServiceImpl<PatrolRoutineW
@Autowired
private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient;
@Autowired
private YuShanSysApiService yuShanSysApiService;
@Autowired
private StatsStaffPatrolRecordDailyDao statsStaffPatrolRecordDailyDao;
@Autowired
private YuShanSysApiService yuShanSysApiService;
/**
* @param formDTO

6
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StatsResiWarnServiceImpl.java

@ -50,6 +50,12 @@ public class StatsResiWarnServiceImpl implements StatsResiWarnService {
@Resource
private IcResiUserDao icResiUserDao;
/**
* 可视化分析-人员预警各类别楼栋数量展示
* @param customerId
* @param agencyID
* @return
*/
@Override
public List<IcStatsResiWarnBuildingResultDTO> buildingwWarnList(String customerId,String agencyID) {
List<IcStatsResiWarnBuildingResultDTO> result = new ArrayList<>();

13
epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml

@ -628,4 +628,17 @@
)
</if>
</select>
<!-- 根据房屋IDs查询房屋下是否有存在居民的 -->
<select id="getExistUserByHouseIds" resultType="java.lang.String">
SELECT
DISTINCT home_id
FROM ic_resi_user
WHERE DEL_FLAG = '0'
AND home_id IN (
<foreach collection="ids" item="id" separator=",">
#{id}
</foreach>
)
</select>
</mapper>

Loading…
Cancel
Save