Browse Source

Merge branch 'dev_ic_diaodong' of http://git.elinkit.com.cn:7070/r/epmet-cloud into dev_ic_diaodong

master
wangxianzhang 4 years ago
parent
commit
a0d6c4214d
  1. 2
      epmet-commons/epmet-commons-mybatis/pom.xml
  2. 10
      epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/config/MybatisPlusConfig.java
  3. 2
      epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/entity/BaseEpmetEntity.java
  4. 14
      epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/service/impl/BaseServiceImpl.java
  5. 1
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/NumConstant.java
  6. 46
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/IcFormCodeEnum.java
  7. 3
      epmet-module/data-aggregator/data-aggregator-client/pom.xml
  8. 18
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/GovOrgController.java
  9. 2
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/CustomerStaffDao.java
  10. 2
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/UserBaseInfoDao.java
  11. 2
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/EpmetUserService.java
  12. 15
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java
  13. 2
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java
  14. 35
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java
  15. 15
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/UserBaseInfoDao.xml
  16. 1
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govproject/ProjectDao.xml
  17. 34
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/OrgRankDataShibeiResultDTO.java
  18. 13
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/IndexController.java
  19. 42
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenOrgRankDataShibeiDao.java
  20. 10
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/IndexService.java
  21. 20
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/IndexServiceImpl.java
  22. 29
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenOrgRankDataShibeiDao.xml
  23. 12
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.java
  24. 5
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBack.java
  25. 106
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ShiBeiICJobController.java
  26. 8
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/crm/CustomerEntity.java
  27. 3
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenPartyUserRankDataServiceImpl.java
  28. 11
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java
  29. 15
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsProjectServiceImpl.java
  30. 1
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerGridServiceImpl.java
  31. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactGroupAgencyDailyService.java
  32. 13
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGroupAgencyDailyServiceImpl.java
  33. 2
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcServiceItemDictDao.java
  34. 5
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcResiDemandDictServiceImpl.java
  35. 7
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceItemDictServiceImpl.java
  36. 49
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.10__update_service_item.sql
  37. 4
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcResiDemandDictDao.xml
  38. 13
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceItemDictDao.xml
  39. 33
      epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/ic/IcPrivateDeploySupportProjectTask.java
  40. 33
      epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/ic/IcPrivateDeploySupportUserPointTask.java
  41. 1
      epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/DailyStatisticalVoteJobResultDTO.java
  42. 2
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueVoteStatisticalDailyServiceImpl.java
  43. 1
      epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueVoteDetailDao.xml
  44. 4
      epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueVoteStatisticalDailyDao.xml
  45. 1
      epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ResiEventDao.xml
  46. 5
      epmet-module/open-data-worker/open-data-worker-server/src/main/resources/bootstrap.yml
  47. 9
      epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/entity/CustomerEntity.java
  48. 3
      epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/CustomerFormQueryDTO.java
  49. 43
      epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/IndividualCategoryAllListResultDTO.java
  50. 3
      epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/IndividualCategoryListResultDTO.java
  51. 12
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcIndividualCategoryManageController.java
  52. 2
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/IcFormQueryBuilderEntity.java
  53. 9
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcIndividualCategoryManageService.java
  54. 64
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcIndividualCategoryManageServiceImpl.java
  55. 4
      epmet-module/resi-hall/resi-hall-server/src/main/resources/bootstrap.yml
  56. 4
      epmet-module/resi-home/resi-home-server/src/main/resources/bootstrap.yml
  57. 3
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/DelIcResiUserFormDTO.java
  58. 3
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/DynamicQueryFormDTO.java
  59. 2
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/StatsResiListFormDTO.java
  60. 8
      epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java
  61. 5
      epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java
  62. 24
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java
  63. 15
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StatsResiWarnController.java
  64. 3
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/StatsResiWarnService.java
  65. 8
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java
  66. 6
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StatsResiWarnServiceImpl.java
  67. 6
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/VolunteerServiceImpl.java
  68. 2
      epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.24__alter_change_detailed.sql
  69. 3
      epmet-user/epmet-user-server/src/test/java/com/epmet/epmetuser/test/IcResiUserControllerTest.java

2
epmet-commons/epmet-commons-mybatis/pom.xml

@ -13,7 +13,7 @@
<packaging>jar</packaging> <packaging>jar</packaging>
<properties> <properties>
<mybatisplus.version>3.2.0</mybatisplus.version> <mybatisplus.version>3.4.2</mybatisplus.version>
<druid.version>1.1.14</druid.version> <druid.version>1.1.14</druid.version>
<sqlserver.version>4.0</sqlserver.version> <sqlserver.version>4.0</sqlserver.version>
<oracle.version>11.2.0.3</oracle.version> <oracle.version>11.2.0.3</oracle.version>

10
epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/config/MybatisPlusConfig.java

@ -8,7 +8,9 @@
package com.epmet.commons.mybatis.config; package com.epmet.commons.mybatis.config;
import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor; import com.baomidou.mybatisplus.annotation.DbType;
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import com.epmet.commons.mybatis.interceptor.DataFilterInterceptor; import com.epmet.commons.mybatis.interceptor.DataFilterInterceptor;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
@ -37,8 +39,10 @@ public class MybatisPlusConfig {
*/ */
@Bean @Bean
@Order(0) @Order(0)
public PaginationInterceptor paginationInterceptor() { public MybatisPlusInterceptor mybatisPlusInterceptor() {
return new PaginationInterceptor(); MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL));
return interceptor;
} }
} }

2
epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/entity/BaseEpmetEntity.java

@ -26,7 +26,7 @@ public abstract class BaseEpmetEntity implements Serializable {
/** /**
* id * id
*/ */
@TableId(type = IdType.UUID) @TableId(type = IdType.ASSIGN_ID)
private String id; private String id;
/** /**

14
epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/service/impl/BaseServiceImpl.java

@ -57,7 +57,7 @@ public abstract class BaseServiceImpl<M extends BaseMapper<T>, T> implements Bas
Page<T> page = initPage(params); Page<T> page = initPage(params);
//默认排序 //默认排序
if (StringUtils.isNotEmpty(defaultOrderField)) { if (StringUtils.isNotBlank(defaultOrderField)) {
if (isAsc) { if (isAsc) {
page.addOrder(OrderItem.asc(defaultOrderField)); page.addOrder(OrderItem.asc(defaultOrderField));
} else { } else {
@ -111,7 +111,7 @@ public abstract class BaseServiceImpl<M extends BaseMapper<T>, T> implements Bas
String order = (String) params.get(Constant.ORDER); String order = (String) params.get(Constant.ORDER);
//前端字段排序 //前端字段排序
if (StringUtils.isNotEmpty(orderField) && StringUtils.isNotEmpty(order)) { if (StringUtils.isNotBlank(orderField) && StringUtils.isNotBlank(order)) {
if (Constant.ASC.equalsIgnoreCase(order)) { if (Constant.ASC.equalsIgnoreCase(order)) {
return page.addOrder(OrderItem.asc(orderField)); return page.addOrder(OrderItem.asc(orderField));
} else { } else {
@ -135,7 +135,7 @@ public abstract class BaseServiceImpl<M extends BaseMapper<T>, T> implements Bas
protected Map<String, Object> paramsToLike(Map<String, Object> params, String... likes) { protected Map<String, Object> paramsToLike(Map<String, Object> params, String... likes) {
for (String like : likes) { for (String like : likes) {
String val = (String) params.get(like); String val = (String) params.get(like);
if (StringUtils.isNotEmpty(val)) { if (StringUtils.isNotBlank(val)) {
params.put(like, "%" + val + "%"); params.put(like, "%" + val + "%");
} else { } else {
params.put(like, null); params.put(like, null);
@ -294,12 +294,12 @@ public abstract class BaseServiceImpl<M extends BaseMapper<T>, T> implements Bas
@Override @Override
public boolean deleteById(Serializable id) { public boolean deleteById(Serializable id) {
return SqlHelper.delBool(baseDao.deleteById(id)); return SqlHelper.retBool(baseDao.deleteById(id));
} }
@Override @Override
public boolean deleteBatchIds(Collection<? extends Serializable> idList) { public boolean deleteBatchIds(Collection<? extends Serializable> idList) {
return SqlHelper.delBool(baseDao.deleteBatchIds(idList)); return SqlHelper.retBool(baseDao.deleteBatchIds(idList));
} }
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
@ -311,7 +311,7 @@ public abstract class BaseServiceImpl<M extends BaseMapper<T>, T> implements Bas
Assert.notNull(tableInfo, "error: can not execute. because can not find cache of TableInfo for entity!"); Assert.notNull(tableInfo, "error: can not execute. because can not find cache of TableInfo for entity!");
String keyProperty = tableInfo.getKeyProperty(); String keyProperty = tableInfo.getKeyProperty();
Assert.notEmpty(keyProperty, "error: can not execute. because can not find column for id from entity!"); Assert.notEmpty(keyProperty, "error: can not execute. because can not find column for id from entity!");
Object idVal = ReflectionKit.getMethodValue(cls, entity, tableInfo.getKeyProperty()); Object idVal = ReflectionKit.getFieldValue( entity, tableInfo.getKeyProperty());
return StringUtils.checkValNull(idVal) || Objects.isNull(selectById((Serializable) idVal)) ? insert(entity) : updateById(entity); return StringUtils.checkValNull(idVal) || Objects.isNull(selectById((Serializable) idVal)) ? insert(entity) : updateById(entity);
} }
return false; return false;
@ -335,7 +335,7 @@ public abstract class BaseServiceImpl<M extends BaseMapper<T>, T> implements Bas
try (SqlSession batchSqlSession = sqlSessionBatch()) { try (SqlSession batchSqlSession = sqlSessionBatch()) {
int i = 0; int i = 0;
for (T entity : entityList) { for (T entity : entityList) {
Object idVal = ReflectionKit.getMethodValue(cls, entity, keyProperty); Object idVal = ReflectionKit.getFieldValue(entity, keyProperty);
if (StringUtils.checkValNull(idVal) || Objects.isNull(selectById((Serializable) idVal))) { if (StringUtils.checkValNull(idVal) || Objects.isNull(selectById((Serializable) idVal))) {
batchSqlSession.insert(sqlStatement(SqlMethod.INSERT_ONE), entity); batchSqlSession.insert(sqlStatement(SqlMethod.INSERT_ONE), entity);
} else { } else {

1
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/NumConstant.java

@ -47,6 +47,7 @@ public interface NumConstant {
BigDecimal ONE_HUNDRED_DECIMAL = new BigDecimal(100); BigDecimal ONE_HUNDRED_DECIMAL = new BigDecimal(100);
BigDecimal ZERO_DECIMAL = new BigDecimal(0); BigDecimal ZERO_DECIMAL = new BigDecimal(0);
int ONE_THOUSAND = 1000; int ONE_THOUSAND = 1000;
int TEN_THOUSAND = 10000;
int MAX = 99999999; int MAX = 99999999;
int EIGHTY_EIGHT = 88; int EIGHTY_EIGHT = 88;
int EIGHTY = 80; int EIGHTY = 80;

46
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/IcFormCodeEnum.java

@ -0,0 +1,46 @@
package com.epmet.commons.tools.enums;
/**
* desc数字社区平台-表单配置枚举类
*
* @author jianjun liu
* @date 2020-07-03 11:14
**/
public enum IcFormCodeEnum {
/**
* 表单code枚举
*/
RESI_BASE_INFO("resi_base_info", "居民信息"),
;
private String code;
private String name;
IcFormCodeEnum(String code, String name) {
this.code = code;
this.name = name;
}
public static IcFormCodeEnum getEnum(String code) {
IcFormCodeEnum[] values = IcFormCodeEnum.values();
for (IcFormCodeEnum value : values) {
if (value.getCode().equals(code)) {
return value;
}
}
return null;
}
public String getCode() {
return code;
}
public String getName() {
return name;
}
}

3
epmet-module/data-aggregator/data-aggregator-client/pom.xml

@ -20,8 +20,7 @@
<dependency> <dependency>
<groupId>com.baomidou</groupId> <groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-annotation</artifactId> <artifactId>mybatis-plus-annotation</artifactId>
<version>3.2.0</version> <version>3.4.2</version>
<scope>compile</scope>
</dependency> </dependency>
</dependencies> </dependencies>

18
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/GovOrgController.java

@ -177,6 +177,24 @@ public class GovOrgController {
return new Result<OrgStaffListResultDTO>().ok(govOrgService.staffList(formDTO)); return new Result<OrgStaffListResultDTO>().ok(govOrgService.staffList(formDTO));
} }
/**
* @Param formDTO
* @Description 获取当前组织下的组织添加的工作人员 组织/部门/网格下人员列表
* @author sun
*/
@PostMapping("currentOrgStafflist")
public Result<OrgStaffListResultDTO> getCurrentOrgStafflist(@LoginUser TokenDto tokenDto, @RequestBody OrgStaffListFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, OrgStaffListFormDTO.OrgStaff.class);
if(!"agency".equals(formDTO.getOrgType())&&!"dept".equals(formDTO.getOrgType())&&!"grid".equals(formDTO.getOrgType())){
throw new RenException("参数类型错误");
}
//formDTO.setCustomerId("45687aa479955f9d06204d415238f7cc");
//formDTO.setStaffId("73ae6280e46a6653a5605d51d5462725");
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setStaffId(tokenDto.getUserId());
return new Result<OrgStaffListResultDTO>().ok(govOrgService.getCurrentOrgStafflist(formDTO));
}
/** /**
* @Param formDTO * @Param formDTO
* @Description 通讯录人员详情v2 * @Description 通讯录人员详情v2

2
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/CustomerStaffDao.java

@ -64,7 +64,7 @@ public interface CustomerStaffDao extends BaseDao<CustomerStaffEntity> {
* @Description 分页查询工作人员基础信息角色信息组织人员单位领导角色人员在前部门人员部门领导角色人员在前网格人员网格长角色人员在前 * @Description 分页查询工作人员基础信息角色信息组织人员单位领导角色人员在前部门人员部门领导角色人员在前网格人员网格长角色人员在前
* @author sun * @author sun
*/ */
List<ListStaffResultDTO> selectStaffList(@Param("staffIds") LinkedList<String> staffIds); List<ListStaffResultDTO> selectStaffList(@Param("staffIds") List<String> staffIds);
/** /**
* @Description 查询工作人员基础信息 * @Description 查询工作人员基础信息

2
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/UserBaseInfoDao.java

@ -55,5 +55,5 @@ public interface UserBaseInfoDao extends BaseDao<UserBaseInfoEntity> {
* @Description 查询userId的身份证号在小程序用户中存在的多个userId值 * @Description 查询userId的身份证号在小程序用户中存在的多个userId值
* @author sun * @author sun
*/ */
List<UserBaseInfoDTO> getUserBaseList(@Param("userId") String userId, @Param("customerId") String customerId); List<UserBaseInfoDTO> getUserBaseList(@Param("customerId") String customerId, @Param("userId") String userId, @Param("idCard") String idCard);
} }

2
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/EpmetUserService.java

@ -176,6 +176,8 @@ public interface EpmetUserService {
*/ */
List<CustomerStaffEntity> listStaffsByIds(List<String> userIdsPart); List<CustomerStaffEntity> listStaffsByIds(List<String> userIdsPart);
List<ListStaffResultDTO> selectStaffList(List<String> staffIds);
/** /**
* 人员类别分析-各类别人数 * 人员类别分析-各类别人数
* @param formDTO * @param formDTO

15
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java

@ -35,6 +35,8 @@ import com.epmet.dataaggre.entity.epmetuser.ResiUserBadgeEntity;
import com.epmet.dataaggre.entity.epmetuser.StaffRoleEntity; import com.epmet.dataaggre.entity.epmetuser.StaffRoleEntity;
import com.epmet.dataaggre.entity.govorg.CustomerAgencyEntity; import com.epmet.dataaggre.entity.govorg.CustomerAgencyEntity;
import com.epmet.dataaggre.service.datastats.DataStatsService; import com.epmet.dataaggre.service.datastats.DataStatsService;
import com.epmet.dataaggre.entity.epmetuser.*;
import com.epmet.dataaggre.service.datastats.DataStatsService;
import com.epmet.dataaggre.service.epmetuser.EpmetUserService; import com.epmet.dataaggre.service.epmetuser.EpmetUserService;
import com.epmet.dataaggre.service.epmetuser.StaffPatrolDetailService; import com.epmet.dataaggre.service.epmetuser.StaffPatrolDetailService;
import com.epmet.dataaggre.service.epmetuser.StaffPatrolRecordService; import com.epmet.dataaggre.service.epmetuser.StaffPatrolRecordService;
@ -721,7 +723,13 @@ public class EpmetUserServiceImpl implements EpmetUserService {
*/ */
@Override @Override
public List<UserBaseInfoDTO> getUserBaseList(String userId, String customerId) { public List<UserBaseInfoDTO> getUserBaseList(String userId, String customerId) {
return userBaseInfoDao.getUserBaseList(userId, customerId); List<UserBaseInfoDTO> resultList = new ArrayList<>();
List<UserBaseInfoDTO> list = userBaseInfoDao.getUserBaseList(customerId, userId, null);
if (!CollectionUtils.isEmpty(list) && StringUtils.isNotBlank(list.get(0).getIdNum())) {
return userBaseInfoDao.getUserBaseList(customerId, null, list.get(0).getIdNum());
}
resultList.addAll(list);
return resultList;
} }
/** /**
@ -750,6 +758,11 @@ public class EpmetUserServiceImpl implements EpmetUserService {
return customerStaffDao.selectList(query); return customerStaffDao.selectList(query);
} }
@Override
public List<ListStaffResultDTO> selectStaffList(List<String> staffIds) {
return customerStaffDao.selectStaffList(staffIds);
}
/** /**
* 人员类别分析-各类别人数 * 人员类别分析-各类别人数
* *

2
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java

@ -11,7 +11,6 @@ import com.epmet.dataaggre.dto.govorg.form.SubOrgFormDTO;
import com.epmet.dataaggre.dto.govorg.result.*; import com.epmet.dataaggre.dto.govorg.result.*;
import com.epmet.dataaggre.dto.resigroup.result.OrgInfoCommonDTO; import com.epmet.dataaggre.dto.resigroup.result.OrgInfoCommonDTO;
import com.epmet.dataaggre.entity.govorg.CustomerAgencyEntity; import com.epmet.dataaggre.entity.govorg.CustomerAgencyEntity;
import com.epmet.dataaggre.entity.govorg.CustomerGridEntity;
import java.util.List; import java.util.List;
@ -93,6 +92,7 @@ public interface GovOrgService {
* @author sun * @author sun
*/ */
OrgStaffListResultDTO staffList(OrgStaffListFormDTO formDTO); OrgStaffListResultDTO staffList(OrgStaffListFormDTO formDTO);
OrgStaffListResultDTO getCurrentOrgStafflist(OrgStaffListFormDTO formDTO);
/** /**
* @Param formDTO * @Param formDTO

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

@ -416,6 +416,41 @@ public class GovOrgServiceImpl implements GovOrgService {
return resultDTO; return resultDTO;
} }
/**
* @Param formDTO
* @Description 通讯录组织/部门/网格下人员列表
* @author sun
*/
@Override
public OrgStaffListResultDTO getCurrentOrgStafflist(OrgStaffListFormDTO formDTO) {
OrgStaffListResultDTO resultDTO = new OrgStaffListResultDTO();
//1.按类型查询组织、部门、网格下所有工作人员Id列表[需要按角色排序 所以这里不能分页]
List<String> staffIds = customerStaffAgencyDao.selectStaffList(formDTO.getOrgId(), formDTO.getOrgType());
if (org.springframework.util.CollectionUtils.isEmpty(staffIds)) {
return resultDTO;
}
formDTO.setStaffIds(staffIds);
//是否包含自己
if("0".equals(formDTO.getIncludeMe())){
staffIds.removeIf(s->s.equals(formDTO.getStaffId()));
}
//2.分页查询工作人员基础信息、角色信息【组织人员单位领导角色人员在前;部门人员部门领导角色人员在前;网格人员网格长角色人员在前】
List<ListStaffResultDTO> staffList = epmetUserService.selectStaffList(staffIds);
//3.查询工作人员注册组织关系信息
List<String> staffIdList = staffList.stream().map(ListStaffResultDTO::getStaffId).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(staffIdList)){
List<StaffOrgNameResultDTO> list = customerAgencyDao.selelctStaffOrg(staffIdList);
staffList.forEach(re -> list.stream().filter(l -> re.getStaffId().equals(l.getStaffId())).forEach(s -> re.setOrgType(s.getOrgType())));
}
//3.封装数据并返回
resultDTO.setStaffCount(staffIds.size());
resultDTO.setStaffList((null == staffList ? new ArrayList<>() : staffList));
return resultDTO;
}
/** /**
* @Param formDTO * @Param formDTO
* @Description 通讯录人员详情v2 * @Description 通讯录人员详情v2

15
epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/UserBaseInfoDao.xml

@ -41,13 +41,24 @@
<select id="getUserBaseList" resultType="com.epmet.dto.UserBaseInfoDTO"> <select id="getUserBaseList" resultType="com.epmet.dto.UserBaseInfoDTO">
SELECT SELECT
* customer_id,
user_id,
mobile,
real_name,
id_num,
gender,
head_img_url
FROM FROM
user_base_info user_base_info
WHERE WHERE
del_flag = '0' del_flag = '0'
AND id_num = ( SELECT id_num FROM user_base_info WHERE user_id = #{userId})
AND customer_id = #{customerId} AND customer_id = #{customerId}
<if test='userId != "" and userId != null'>
AND user_id = #{userId}
</if>
<if test='idCard != "" and idCard != null'>
AND id_num = #{idCard}
</if>
</select> </select>
</mapper> </mapper>

1
epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govproject/ProjectDao.xml

@ -29,7 +29,6 @@
WHERE WHERE
p.DEL_FLAG = '0' p.DEL_FLAG = '0'
AND p.CUSTOMER_ID = #{customerId} AND p.CUSTOMER_ID = #{customerId}
AND p.ORG_ID_PATH LIKE concat('%', #{agencyId}, '%')
<if test="projectStatus != null and projectStatus != ''"> <if test="projectStatus != null and projectStatus != ''">
AND p.`STATUS` = #{projectStatus} AND p.`STATUS` = #{projectStatus}
</if> </if>

34
epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/OrgRankDataShibeiResultDTO.java

@ -0,0 +1,34 @@
package com.epmet.evaluationindex.screen.dto.result;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* @Description 市北数字社区-组织先进排行榜 查询结果dto
* @ClassName OrgRankDataResultDTO
* @Auth wangc
* @Date 2020-08-21 11:16
*/
@Data
public class OrgRankDataShibeiResultDTO implements Serializable {
private static final long serialVersionUID = -7874641768141936572L;
private String orgId;
/**
* 名称 XXXX社区党委
* */
private String name;
/**
* 党员数
* */
private BigDecimal score;
/**
* 数据所属月份
*/
private String monthId;
}

13
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/IndexController.java

@ -154,6 +154,19 @@ public class IndexController {
return new Result<List<IndexAdvanceBranchRankResultDTO>>().ok(indexService.advancedBranchRank(formDTO)); return new Result<List<IndexAdvanceBranchRankResultDTO>>().ok(indexService.advancedBranchRank(formDTO));
} }
/**
* @param formDTO
* @Description 数字社区数据分析-动力网格
* @author sun
*/
@PostMapping("advancedbranchrank-shibei")
Result<List<OrgRankDataShibeiResultDTO>> advancedBranchRankShibei(@RequestBody AdvancedBranchRankFormDTO formDTO, @LoginUser TokenDto loginUser){
ValidatorUtils.validateEntity(formDTO, AdvancedBranchRankFormDTO.AddUserInternalGroup.class);
formDTO.setCustomerId(loginUser.getCustomerId());
//formDTO.setCustomerId("45687aa479955f9d06204d415238f7cc");
return new Result<List<OrgRankDataShibeiResultDTO>>().ok(indexService.advancedBranchRankShibei(formDTO));
}
/** /**
* @param formDTO * @param formDTO
* @author yinzuomei * @author yinzuomei

42
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenOrgRankDataShibeiDao.java

@ -0,0 +1,42 @@
/**
* 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.datareport.dao.evaluationindex.screen;
import com.epmet.evaluationindex.screen.dto.form.AdvancedBranchRankFormDTO;
import com.epmet.evaluationindex.screen.dto.result.OrgRankDataShibeiResultDTO;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* 党建引领-组织排行榜
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-08-18
*/
@Mapper
public interface ScreenOrgRankDataShibeiDao {
/**
* @return
* @Description 查询指定机关的所有直属网格月度数据
* @author wangc
* @date 2020.08.21 13:58
**/
List<OrgRankDataShibeiResultDTO> selectGridRankList(AdvancedBranchRankFormDTO formDTO);
}

10
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/IndexService.java

@ -94,4 +94,14 @@ public interface IndexService {
* @Date 2021/2/28 14:33 * @Date 2021/2/28 14:33
**/ **/
List<SubAgencyIndexRankResultDTO> subAgencyIndexRankPy(SubAgencyIndexRankPyFormDTO formDTO); List<SubAgencyIndexRankResultDTO> subAgencyIndexRankPy(SubAgencyIndexRankPyFormDTO formDTO);
/**
* desc: 市北数字社区特供接口 网格排行
*
* @param formDTO
* @return java.util.List<com.epmet.evaluationindex.screen.dto.result.IndexAdvanceBranchRankResultDTO>
* @author LiuJanJun
* @date 2022/1/14 4:57 下午
*/
List<OrgRankDataShibeiResultDTO> advancedBranchRankShibei(AdvancedBranchRankFormDTO formDTO);
} }

20
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/IndexServiceImpl.java

@ -9,6 +9,7 @@ import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.constant.DataSourceConstant; import com.epmet.constant.DataSourceConstant;
import com.epmet.datareport.dao.evaluationindex.screen.ScreenIndexDataMonthlyDao; import com.epmet.datareport.dao.evaluationindex.screen.ScreenIndexDataMonthlyDao;
import com.epmet.datareport.dao.evaluationindex.screen.ScreenIndexDataYearlyDao; import com.epmet.datareport.dao.evaluationindex.screen.ScreenIndexDataYearlyDao;
import com.epmet.datareport.dao.evaluationindex.screen.ScreenOrgRankDataShibeiDao;
import com.epmet.datareport.service.evaluationindex.screen.IndexService; import com.epmet.datareport.service.evaluationindex.screen.IndexService;
import com.epmet.evaluationindex.screen.constant.ScreenConstant; import com.epmet.evaluationindex.screen.constant.ScreenConstant;
import com.epmet.evaluationindex.screen.dto.form.*; import com.epmet.evaluationindex.screen.dto.form.*;
@ -43,6 +44,8 @@ public class IndexServiceImpl implements IndexService {
@Autowired @Autowired
private ScreenIndexDataMonthlyDao screenIndexDataMonthlyDao; private ScreenIndexDataMonthlyDao screenIndexDataMonthlyDao;
@Autowired @Autowired
private ScreenOrgRankDataShibeiDao screenOrgRankDataShibeiDao;
@Autowired
private PartyMemberLeadServiceImpl partyMemberLeadServiceImpl; private PartyMemberLeadServiceImpl partyMemberLeadServiceImpl;
@Autowired @Autowired
private com.epmet.datareport.utils.DateUtils dateUtils; private com.epmet.datareport.utils.DateUtils dateUtils;
@ -412,6 +415,23 @@ public class IndexServiceImpl implements IndexService {
return list; return list;
} }
/**
* @param formDTO
* @Description 先进排行-先进支部排行
* @author sun
* @return
*/
@Override
@DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true)
public List<OrgRankDataShibeiResultDTO> advancedBranchRankShibei(AdvancedBranchRankFormDTO formDTO) {
//根据当前所选组织,查询screen_index_data_monthly中类型为网格的按照总指数倒序,关联screen_org_rank_data表取其他数据
//1.级联查询组织下所有网格的先进支部排行数据,按总指数降序
if (StringUtils.isBlank(formDTO.getMonthId())) {
formDTO.setMonthId(DateUtils.getBeforeNMonth(1));
}
return screenOrgRankDataShibeiDao.selectGridRankList(formDTO);
}
@Override @Override
@DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true)
public List<PeerComparisonResultDTO> getSubSingleIndexRank(SubSingleIndexRankFormDTO formDTO) { public List<PeerComparisonResultDTO> getSubSingleIndexRank(SubSingleIndexRankFormDTO formDTO) {

29
epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenOrgRankDataShibeiDao.xml

@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.datareport.dao.evaluationindex.screen.ScreenOrgRankDataShibeiDao">
<!-- 查询指定机关的直属网格月度数据 -->
<select id="selectGridRankList" resultType="com.epmet.evaluationindex.screen.dto.result.OrgRankDataShibeiResultDTO">
SELECT
rankData.ORG_NAME AS NAME,
round(rankData.SCORE,1) score,
rankData.ORG_ID as orgId,
rankData.MONTH_ID
FROM
screen_org_rank_data_shibei rankData
LEFT JOIN screen_customer_agency agency
ON rankData.PARENT_ID = agency.AGENCY_ID AND agency.DEL_FLAG = 0
WHERE
rankData.DEL_FLAG = '0'
AND rankData.ORG_TYPE = 'grid'
AND rankData.ALL_PARENT_IDS LIKE CONCAT('%',#{agencyId},'%')
AND rankData.MONTH_ID = #{monthId}
AND rankData.CUSTOMER_ID = #{customerId}
ORDER BY
rankData.SCORE DESC
LIMIT #{topNum}
</select>
</mapper>

12
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.java

@ -20,6 +20,7 @@ import com.epmet.dto.user.result.MidPatrolDetailResult;
import com.epmet.dto.user.result.MidPatrolRecordResult; import com.epmet.dto.user.result.MidPatrolRecordResult;
import com.epmet.feign.impl.DataStatisticalOpenFeignClientFallBackFactory; import com.epmet.feign.impl.DataStatisticalOpenFeignClientFallBackFactory;
import org.springframework.cloud.openfeign.FeignClient; import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
@ -351,6 +352,17 @@ public interface DataStatisticalOpenFeignClient {
@PostMapping("/data/stats/demand/volunteer/daily") @PostMapping("/data/stats/demand/volunteer/daily")
Result statsVolunteerDemandServicesDaily(@RequestParam(value = "customer-id", required = false) String customerId); Result statsVolunteerDemandServicesDaily(@RequestParam(value = "customer-id", required = false) String customerId);
/**
* desc: 市北私有化部署需要 支持的任务之一
*
* @param formDTO
* @return com.epmet.commons.tools.utils.Result
* @author LiuJanJun
* @date 2022/1/18 4:37 下午
*/
@PostMapping("/data/stats/shibeiICJob/userPointAndProjectStatus/{bizType}")
Result userPointAndProjectStatus(@PathVariable("bizType") String biztype,@RequestBody ExtractOriginFormDTO formDTO);
@PostMapping("/data/stats/ic/user/category-analysis-daily") @PostMapping("/data/stats/ic/user/category-analysis-daily")
Result statUserCategoryDaily(@RequestBody IcUserCategoryAnalysisDailyFormDTO formDTO); Result statUserCategoryDaily(@RequestBody IcUserCategoryAnalysisDailyFormDTO formDTO);
} }

5
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBack.java

@ -337,6 +337,11 @@ public class DataStatisticalOpenFeignClientFallBack implements DataStatisticalOp
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "statsVolunteerDemandServicesDaily", customerId); return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "statsVolunteerDemandServicesDaily", customerId);
} }
@Override
public Result userPointAndProjectStatus(String biztype,ExtractOriginFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "userPointAndProjectStatus", biztype,formDTO);
}
@Override @Override
public Result statUserCategoryDaily(IcUserCategoryAnalysisDailyFormDTO formDTO) { public Result statUserCategoryDaily(IcUserCategoryAnalysisDailyFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "statUserCategoryDaily", formDTO); return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "statUserCategoryDaily", formDTO);

106
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ShiBeiICJobController.java

@ -0,0 +1,106 @@
package com.epmet.controller;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.enums.BizTypeEnum;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.redis.RedisKeys;
import com.epmet.commons.tools.redis.RedisUtils;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.StatsFormDTO;
import com.epmet.dto.extract.form.ExtractOriginFormDTO;
import com.epmet.dto.screen.form.ScreenCentralZoneDataFormDTO;
import com.epmet.service.StatsProjectService;
import com.epmet.service.evaluationindex.extract.toscreen.ScreenGrassrootsGovernDataAbsorptionService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;
/**
* desc市北数字社区 单独部署 job入口 用户积分排名及项目状态数据
*/
@RequestMapping("shibeiICJob")
@RestController
@Slf4j
public class ShiBeiICJobController {
@Autowired
private ScreenGrassrootsGovernDataAbsorptionService screenGrassrootsGovernDataAbsorptionService;
@Autowired
private StatsProjectService statsProjectService;
@Autowired
private RedisUtils redisUtils;
@PostMapping("userPointAndProjectStatus/{bizType}")
public Result<String> userPointAndProjectStatus(@PathVariable("bizType") String bizType, @RequestBody ExtractOriginFormDTO formDTO) {
if (StringUtils.isBlank(formDTO.getCustomerId())){
return new Result<String>().error(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"参数错误cid不能为空");
}
long start = System.currentTimeMillis();
Set<String> result = new LinkedHashSet<>();
if (StringUtils.isNotBlank(formDTO.getStartDate()) && StringUtils.isNotBlank(formDTO.getEndDate())) {
List<String> daysBetween = DateUtils.getDaysBetween(formDTO.getStartDate(), formDTO.getEndDate());
daysBetween.forEach(d -> {
executeMethod(bizType, formDTO.getCustomerId(), d);
result.add(d);
redisUtils.hSet(RedisKeys.getBackDoorbizExcuteResult("userPointAndProjectStatus-"+bizType), formDTO.getCustomerId(), result, 3 * 24 * 60 * 60L);
});
} else {
if (StringUtils.isBlank(formDTO.getDateId())){
formDTO.setDateId(DateUtils.getBeforeNDay(NumConstant.ONE));
}
executeMethod(bizType, formDTO.getCustomerId(), formDTO.getDateId());
result.add(formDTO.getDateId());
redisUtils.hSet(RedisKeys.getBackDoorbizExcuteResult("userPointAndProjectStatus-"+bizType), formDTO.getCustomerId(), result, 3 * 24 * 60 * 60L);
}
long end = System.currentTimeMillis();
long l = (end - start) / 1000;
return new Result<String>().ok("userPointAndProjectStatus耗时-"+bizType + l + "s");
}
private void executeMethod(String bizType, String customerId, String d) {
if (bizType.equals(BizTypeEnum.USER.getType())){
this.extractUserPointData(customerId, d);
}
if (bizType.equals(BizTypeEnum.PROJECT.getType())) {
this.agencyProjectStats(customerId, d);
}
}
/**
* @Author sun
* @Description 数据-项目-机关日()统计
**/
private void agencyProjectStats(String customerId, String dateId) {
try {
if (StringUtils.isNotBlank(dateId)) {
dateId = DateUtils.format(DateUtils.parseDate(dateId, DateUtils.DATE_PATTERN_YYYYMMDD));
}
StatsFormDTO formDTO = new StatsFormDTO();
formDTO.setCustomerId(customerId);
formDTO.setDate(dateId);
statsProjectService.agencyProjectStats(formDTO);
} catch (Exception e) {
log.error("市北-项目状态数据写入失败,参数为:{}" + customerId + StrConstant.HYPHEN + dateId, e);
}
new Result();
}
private void extractUserPointData(String customerId, String dateId) {
try {
//基层治理 - 热心市民 screen_party_user_rank_data
ScreenCentralZoneDataFormDTO param = new ScreenCentralZoneDataFormDTO();
param.setCustomerId(customerId);
param.setDateId(dateId);
screenGrassrootsGovernDataAbsorptionService.userScoreDataHub(param);
} catch (Exception e) {
log.error("市北-热心市民/党员得分数据写入失败,参数为:{}" + customerId + StrConstant.HYPHEN + dateId, e);
}
}
}

8
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/crm/CustomerEntity.java

@ -17,9 +17,10 @@
package com.epmet.entity.crm; package com.epmet.entity.crm;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
@ -39,6 +40,11 @@ public class CustomerEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/**
* id
*/
@TableId(type = IdType.ASSIGN_UUID)
private String id;
/** /**
* 客户名称 * 客户名称
*/ */

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

@ -25,6 +25,7 @@ import com.epmet.constant.DataSourceConstant;
import com.epmet.dao.evaluationindex.screen.ScreenPartyUserRankDataDao; import com.epmet.dao.evaluationindex.screen.ScreenPartyUserRankDataDao;
import com.epmet.entity.evaluationindex.screen.ScreenPartyUserRankDataEntity; import com.epmet.entity.evaluationindex.screen.ScreenPartyUserRankDataEntity;
import com.epmet.service.evaluationindex.screen.ScreenPartyUserRankDataService; import com.epmet.service.evaluationindex.screen.ScreenPartyUserRankDataService;
import org.apache.commons.collections4.ListUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -61,7 +62,7 @@ public class ScreenPartyUserRankDataServiceImpl extends BaseServiceImpl<ScreenPa
do { do {
affectedRows = baseDao.deletePartyUserRankData(customerId); affectedRows = baseDao.deletePartyUserRankData(customerId);
} while (affectedRows > NumConstant.ZERO); } while (affectedRows > NumConstant.ZERO);
baseDao.insertBatch(dataList); ListUtils.partition(dataList,NumConstant.ONE_THOUSAND).forEach(part->baseDao.insertBatch(part));
} }
} }
} }

11
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java

@ -135,15 +135,10 @@ public class StatsGroupServiceImpl implements StatsGroupService {
if (customerIds.size() != NumConstant.ZERO) { if (customerIds.size() != NumConstant.ZERO) {
DimIdGenerator.DimIdBean dimIdBean = this.getDimIdBean(formDTO); DimIdGenerator.DimIdBean dimIdBean = this.getDimIdBean(formDTO);
customerIds.forEach(customerId -> { customerIds.forEach(customerId -> {
Boolean status = true;
try { try {
List<DimAgencyDTO> customerAgencyInfos = dimAgencyService.getAgencyInfoByCustomerId(customerId); List<DimAgencyDTO> customerAgencyInfos = dimAgencyService.getAgencyInfoByCustomerId(customerId);
List<List<DimAgencyDTO>> partition = ListUtils.partition(customerAgencyInfos, NumConstant.ONE_HUNDRED); List<AgencyGroupDailyResultDTO> agencyGroupDaily = this.getAgencyGroupDaily(customerAgencyInfos, dimIdBean, customerId);
for (List<DimAgencyDTO> p : partition) { factGroupAgencyDailyService.insertGroupAgencyDaily(agencyGroupDaily, customerId);
List<AgencyGroupDailyResultDTO> agencyGroupDaily = this.getAgencyGroupDaily(p, dimIdBean, customerId);
factGroupAgencyDailyService.insertGroupAgencyDaily(agencyGroupDaily, customerId,status);
status = false;
}
} catch (Exception e) { } catch (Exception e) {
log.error(String.format(GroupConstant.STATS_FAILED_AGENCY_DAILY, customerId, LocalDate.now(), e)); log.error(String.format(GroupConstant.STATS_FAILED_AGENCY_DAILY, customerId, LocalDate.now(), e));
} }
@ -180,7 +175,7 @@ public class StatsGroupServiceImpl implements StatsGroupService {
} }
/** /**
* @param customerAgencyInfos * @param agencyList
* @param timeDim * @param timeDim
* @param customerId * @param customerId
* @Description 网格小组 机关- 数据统计处理 * @Description 网格小组 机关- 数据统计处理

15
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsProjectServiceImpl.java

@ -1,6 +1,5 @@
package com.epmet.service.impl; package com.epmet.service.impl;
import cn.hutool.core.collection.CollectionUtil;
import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.utils.DateUtils; import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.constant.ProjectConstant; import com.epmet.constant.ProjectConstant;
@ -80,8 +79,8 @@ public class StatsProjectServiceImpl implements StatsProjectService {
if (null != formDTO && StringUtils.isNotBlank(formDTO.getCustomerId())) { if (null != formDTO && StringUtils.isNotBlank(formDTO.getCustomerId())) {
customerAgencyStats(formDTO.getCustomerId(), date); customerAgencyStats(formDTO.getCustomerId(), date);
} else { } else {
int pageNo = 1; int pageNo = NumConstant.ONE;
int pageSize = 100; int pageSize = NumConstant.ONE_HUNDRED;
List<String> customerIdList = null; List<String> customerIdList = null;
do { do {
customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize); customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize);
@ -185,10 +184,10 @@ public class StatsProjectServiceImpl implements StatsProjectService {
projectEntity.setCustomerId(customerId); projectEntity.setCustomerId(customerId);
projectEntity.setCreatedTime(date); projectEntity.setCreatedTime(date);
projectEntity.setStatus(ProjectConstant.CLOSED); projectEntity.setStatus(ProjectConstant.CLOSED);
projectEntity.setPageSize(NumConstant.ONE_THOUSAND); projectEntity.setPageSize(NumConstant.TEN_THOUSAND);
int pageNo = NumConstant.ONE; int pageNo = NumConstant.ONE;
int size = NumConstant.ZERO; int size;
List<ProjectProcessEntity> processList = new ArrayList<>(); List<ProjectProcessEntity> processList = null;
do { do {
//1.一千条一循环查询节点数据,封装每个组织对应数据 //1.一千条一循环查询节点数据,封装每个组织对应数据
projectEntity.setPageNo(pageNo); projectEntity.setPageNo(pageNo);
@ -278,7 +277,7 @@ public class StatsProjectServiceImpl implements StatsProjectService {
} }
mapList.put(agency.getId(), entity); mapList.put(agency.getId(), entity);
} }
} while (size == NumConstant.ONE_THOUSAND); } while (size == projectEntity.getPageSize());
//二、再分页查询项目表数据,封装每个组织的已结案已解决总数、已结案未解决总数;日增量中已结案已解决总数、已结案未解决总数 //二、再分页查询项目表数据,封装每个组织的已结案已解决总数、已结案未解决总数;日增量中已结案已解决总数、已结案未解决总数
int num = NumConstant.ONE; int num = NumConstant.ONE;
@ -374,7 +373,7 @@ public class StatsProjectServiceImpl implements StatsProjectService {
} }
mapList.put(agency.getId(), entity); mapList.put(agency.getId(), entity);
} }
} while (size == NumConstant.ONE_THOUSAND); } while (size == projectEntity.getPageSize());
List<FactAgencyProjectDailyEntity> projectDateEntityList = new ArrayList<>(mapList.values()); List<FactAgencyProjectDailyEntity> projectDateEntityList = new ArrayList<>(mapList.values());
//三、批量保存数据,先删后增 //三、批量保存数据,先删后增

1
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerGridServiceImpl.java

@ -81,6 +81,7 @@ public class CustomerGridServiceImpl extends BaseServiceImpl<CustomerGridDao, Cu
* @param gridId * @param gridId
* @return * @return
*/ */
@Override
public GridInfoDTO queryGridInfoDTO(String gridId){ public GridInfoDTO queryGridInfoDTO(String gridId){
return baseDao.selectGridInfo(gridId); return baseDao.selectGridInfo(gridId);
} }

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactGroupAgencyDailyService.java

@ -101,7 +101,7 @@ public interface FactGroupAgencyDailyService extends BaseService<FactGroupAgency
* @param agencyList * @param agencyList
* @author zxc * @author zxc
*/ */
void insertGroupAgencyDaily(List<AgencyGroupDailyResultDTO> agencyList,String customerId,Boolean status); void insertGroupAgencyDaily(List<AgencyGroupDailyResultDTO> agencyList,String customerId);
/** /**
* @param * @param

13
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGroupAgencyDailyServiceImpl.java

@ -113,15 +113,12 @@ public class FactGroupAgencyDailyServiceImpl extends BaseServiceImpl<FactGroupAg
*/ */
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void insertGroupAgencyDaily(List<AgencyGroupDailyResultDTO> agencyList,String customerId,Boolean status) { public void insertGroupAgencyDaily(List<AgencyGroupDailyResultDTO> agencyList,String customerId) {
if (!CollectionUtils.isEmpty(agencyList)){ if (!CollectionUtils.isEmpty(agencyList)){
// true 为当前客户第一回进入,需要删除历史数据 Integer delNum;
if (status){ do {
Integer delNum; delNum = baseDao.deleteInsertAgencyDailyByDateId(agencyList.get(NumConstant.ZERO).getDateId(),customerId);
do { }while (delNum > NumConstant.ZERO && delNum == NumConstant.ONE_THOUSAND);
delNum = baseDao.deleteInsertAgencyDailyByDateId(agencyList.get(NumConstant.ZERO).getDateId(),customerId);
}while (delNum > NumConstant.ZERO && delNum == NumConstant.ONE_THOUSAND);
}
List<List<AgencyGroupDailyResultDTO>> partition = ListUtils.partition(agencyList, NumConstant.ONE_HUNDRED); List<List<AgencyGroupDailyResultDTO>> partition = ListUtils.partition(agencyList, NumConstant.ONE_HUNDRED);
partition.forEach(p -> { partition.forEach(p -> {
baseDao.insertGroupAgencyDaily(p); baseDao.insertGroupAgencyDaily(p);

2
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcServiceItemDictDao.java

@ -34,4 +34,6 @@ import java.util.List;
public interface IcServiceItemDictDao extends BaseDao<IcServiceItemDictEntity> { public interface IcServiceItemDictDao extends BaseDao<IcServiceItemDictEntity> {
List<ServiceItemResultDTO> pageList(String customerId); List<ServiceItemResultDTO> pageList(String customerId);
IcServiceItemDictEntity selectMax(String customerId);
} }

5
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcResiDemandDictServiceImpl.java

@ -81,6 +81,7 @@ public class IcResiDemandDictServiceImpl extends BaseServiceImpl<IcResiDemandDic
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void addFirstCategory(AddFirstCategoryFormDTO formDTO) { public void addFirstCategory(AddFirstCategoryFormDTO formDTO) {
formDTO.setCategoryName(formDTO.getCategoryName().trim());
if (checkCategoryName(formDTO.getCustomerId(), formDTO.getCategoryName(), NumConstant.ONE, NumConstant.ZERO_STR,null) > NumConstant.ZERO) { if (checkCategoryName(formDTO.getCustomerId(), formDTO.getCategoryName(), NumConstant.ONE, NumConstant.ZERO_STR,null) > NumConstant.ZERO) {
// 名称唯一 // 名称唯一
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), String.format("【%s】已存在", formDTO.getCategoryName()), "分类名称已存在"); throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), String.format("【%s】已存在", formDTO.getCategoryName()), "分类名称已存在");
@ -105,6 +106,7 @@ public class IcResiDemandDictServiceImpl extends BaseServiceImpl<IcResiDemandDic
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
@Override @Override
public void addChild(AddCategoryFormDTO formDTO) { public void addChild(AddCategoryFormDTO formDTO) {
formDTO.setCategoryName(formDTO.getCategoryName().trim());
if(NumConstant.ZERO_STR.equals(formDTO.getParentCategoryCode())){ if(NumConstant.ZERO_STR.equals(formDTO.getParentCategoryCode())){
throw new RenException("添加一级分类,调用接口/heart/icresidemanddict/addfirst"); throw new RenException("添加一级分类,调用接口/heart/icresidemanddict/addfirst");
} }
@ -160,8 +162,9 @@ public class IcResiDemandDictServiceImpl extends BaseServiceImpl<IcResiDemandDic
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void update(UpdateFormDTO formDTO) { public void update(UpdateFormDTO formDTO) {
formDTO.setCategoryName(formDTO.getCategoryName().trim());
IcResiDemandDictEntity origin = baseDao.selectById(formDTO.getCategoryId()); IcResiDemandDictEntity origin = baseDao.selectById(formDTO.getCategoryId());
if (checkCategoryName(formDTO.getCustomerId(), formDTO.getCategoryName(), NumConstant.TWO, origin.getParentCode(), formDTO.getCategoryId()) > NumConstant.ZERO) { if (checkCategoryName(formDTO.getCustomerId(), formDTO.getCategoryName(), formDTO.getLevel(), origin.getParentCode(), formDTO.getCategoryId()) > NumConstant.ZERO) {
// 名称唯一 // 名称唯一
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), String.format("【%s】已存在", formDTO.getCategoryName()), "分类名称已存在"); throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), String.format("【%s】已存在", formDTO.getCategoryName()), "分类名称已存在");
} }

7
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceItemDictServiceImpl.java

@ -74,6 +74,7 @@ public class IcServiceItemDictServiceImpl extends BaseServiceImpl<IcServiceItemD
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
@Override @Override
public void addOrUpdate(ServiceItemAddFormDTO formDTO) { public void addOrUpdate(ServiceItemAddFormDTO formDTO) {
formDTO.setCategoryName(formDTO.getCategoryName().trim());
//分类名称是否唯一 //分类名称是否唯一
LambdaQueryWrapper<IcServiceItemDictEntity> nameQuery = new LambdaQueryWrapper<>(); LambdaQueryWrapper<IcServiceItemDictEntity> nameQuery = new LambdaQueryWrapper<>();
nameQuery.eq(IcServiceItemDictEntity::getCustomerId, formDTO.getCustomerId()) nameQuery.eq(IcServiceItemDictEntity::getCustomerId, formDTO.getCustomerId())
@ -90,10 +91,8 @@ public class IcServiceItemDictServiceImpl extends BaseServiceImpl<IcServiceItemD
baseDao.update(null, update); baseDao.update(null, update);
return; return;
} }
LambdaQueryWrapper<IcServiceItemDictEntity> maxQuery = new LambdaQueryWrapper<>(); //如果说当前查询的编码是1022,但是库里面1023已经存在且del_flag='0'。这个时候新增的编码为1023就会报错。
maxQuery.eq(IcServiceItemDictEntity::getCustomerId, formDTO.getCustomerId()) IcServiceItemDictEntity max = baseDao.selectMax(formDTO.getCustomerId());
.orderByDesc(IcServiceItemDictEntity::getCategoryCode).last("limit 1");
IcServiceItemDictEntity max = baseDao.selectOne(maxQuery);
// 获取编码 // 获取编码
IcServiceItemDictEntity insert = new IcServiceItemDictEntity(); IcServiceItemDictEntity insert = new IcServiceItemDictEntity();
insert.setCustomerId(formDTO.getCustomerId()); insert.setCustomerId(formDTO.getCustomerId());

49
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.10__update_service_item.sql

@ -0,0 +1,49 @@
-- 服务事项从需求分类字典表中抽离出来了,对应历史数据修改如下
-- 1、联建单位的服务事项置空
update ic_party_unit set SERVICE_MATTER ='';
-- 2、联建活动的服务事项修改为新的编码
update ic_party_activity set SERVICE_MATTER='1006' where SERVICE_MATTER = '10100006';
update ic_party_activity set SERVICE_MATTER='1008' where SERVICE_MATTER = '10100008';
update ic_party_activity set SERVICE_MATTER='1002' where SERVICE_MATTER = '10100002';
update ic_party_activity set SERVICE_MATTER='1009' where SERVICE_MATTER = '10100009';
update ic_party_activity set SERVICE_MATTER='1017' where SERVICE_MATTER = '10100017';
update ic_party_activity set SERVICE_MATTER='1021' where SERVICE_MATTER = '10100021';
update ic_party_activity set SERVICE_MATTER='1015' where SERVICE_MATTER = '10100015';
update ic_party_activity set SERVICE_MATTER='1011' where SERVICE_MATTER = '10100011';
update ic_party_activity set SERVICE_MATTER='1018' where SERVICE_MATTER = '10100018';
update ic_party_activity set SERVICE_MATTER='1005' where SERVICE_MATTER = '10100005';
update ic_party_activity set SERVICE_MATTER='1010' where SERVICE_MATTER = '10100010';
update ic_party_activity set SERVICE_MATTER='1003' where SERVICE_MATTER = '10100003';
update ic_party_activity set SERVICE_MATTER='1020' where SERVICE_MATTER = '10100020';
update ic_party_activity set SERVICE_MATTER='1022' where SERVICE_MATTER = '10100022';
update ic_party_activity set SERVICE_MATTER='1014' where SERVICE_MATTER = '10100014';
update ic_party_activity set SERVICE_MATTER='1007' where SERVICE_MATTER = '10100007';
update ic_party_activity set SERVICE_MATTER='1001' where SERVICE_MATTER = '10100001';
update ic_party_activity set SERVICE_MATTER='1004' where SERVICE_MATTER = '10100004';
update ic_party_activity set SERVICE_MATTER='1016' where SERVICE_MATTER = '10100016';
update ic_party_activity set SERVICE_MATTER='1013' where SERVICE_MATTER = '10100013';
update ic_party_activity set SERVICE_MATTER='1012' where SERVICE_MATTER = '10100012';
update ic_party_activity set SERVICE_MATTER='1019' where SERVICE_MATTER = '10100019';
-- 3、爱心互助-活动类型为联建活动,对应的服务事项编码改为新的
update act_info set SERVICE_MATTER='1006' where ACT_TYPE='party' and SERVICE_MATTER='10100006' ;
update act_info set SERVICE_MATTER='1008' where ACT_TYPE='party' and SERVICE_MATTER='10100008' ;
update act_info set SERVICE_MATTER='1002' where ACT_TYPE='party' and SERVICE_MATTER='10100002' ;
update act_info set SERVICE_MATTER='1009' where ACT_TYPE='party' and SERVICE_MATTER='10100009' ;
update act_info set SERVICE_MATTER='1017' where ACT_TYPE='party' and SERVICE_MATTER='10100017' ;
update act_info set SERVICE_MATTER='1021' where ACT_TYPE='party' and SERVICE_MATTER='10100021' ;
update act_info set SERVICE_MATTER='1015' where ACT_TYPE='party' and SERVICE_MATTER='10100015' ;
update act_info set SERVICE_MATTER='1011' where ACT_TYPE='party' and SERVICE_MATTER='10100011' ;
update act_info set SERVICE_MATTER='1018' where ACT_TYPE='party' and SERVICE_MATTER='10100018' ;
update act_info set SERVICE_MATTER='1005' where ACT_TYPE='party' and SERVICE_MATTER='10100005' ;
update act_info set SERVICE_MATTER='1010' where ACT_TYPE='party' and SERVICE_MATTER='10100010' ;
update act_info set SERVICE_MATTER='1003' where ACT_TYPE='party' and SERVICE_MATTER='10100003' ;
update act_info set SERVICE_MATTER='1020' where ACT_TYPE='party' and SERVICE_MATTER='10100020' ;
update act_info set SERVICE_MATTER='1022' where ACT_TYPE='party' and SERVICE_MATTER='10100022' ;
update act_info set SERVICE_MATTER='1014' where ACT_TYPE='party' and SERVICE_MATTER='10100014' ;
update act_info set SERVICE_MATTER='1007' where ACT_TYPE='party' and SERVICE_MATTER='10100007' ;
update act_info set SERVICE_MATTER='1001' where ACT_TYPE='party' and SERVICE_MATTER='10100001' ;
update act_info set SERVICE_MATTER='1004' where ACT_TYPE='party' and SERVICE_MATTER='10100004' ;
update act_info set SERVICE_MATTER='1016' where ACT_TYPE='party' and SERVICE_MATTER='10100016' ;
update act_info set SERVICE_MATTER='1013' where ACT_TYPE='party' and SERVICE_MATTER='10100013' ;
update act_info set SERVICE_MATTER='1012' where ACT_TYPE='party' and SERVICE_MATTER='10100012' ;
update act_info set SERVICE_MATTER='1019' where ACT_TYPE='party' and SERVICE_MATTER='10100019' ;

4
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcResiDemandDictDao.xml

@ -192,9 +192,7 @@
CONVERT ( m.CATEGORY_CODE, UNSIGNED )) AS maxFirstCategoryCode CONVERT ( m.CATEGORY_CODE, UNSIGNED )) AS maxFirstCategoryCode
FROM FROM
ic_resi_demand_dict m ic_resi_demand_dict m
WHERE WHERE m.CUSTOMER_ID = #{customerId}
m.DEL_FLAG = '0'
AND m.CUSTOMER_ID = #{customerId}
AND m.`LEVEL` = #{level} AND m.`LEVEL` = #{level}
and m.parent_code=#{parentCode} and m.parent_code=#{parentCode}
</select> </select>

13
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceItemDictDao.xml

@ -18,4 +18,17 @@
d.SORT DESC d.SORT DESC
</select> </select>
<select id="selectMax" parameterType="java.lang.String" resultType="com.epmet.entity.IcServiceItemDictEntity">
SELECT
d.ID,
d.CATEGORY_CODE,
d.SORT
FROM
ic_service_item_dict d
WHERE
d.DEL_FLAG = '0'
AND d.CUSTOMER_ID = #{customerId}
order by CATEGORY_CODE desc
limit 1
</select>
</mapper> </mapper>

33
epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/ic/IcPrivateDeploySupportProjectTask.java

@ -0,0 +1,33 @@
package com.epmet.task.ic;
import com.alibaba.fastjson.JSON;
import com.epmet.commons.tools.enums.BizTypeEnum;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.extract.form.ExtractOriginFormDTO;
import com.epmet.feign.DataStatisticalOpenFeignClient;
import com.epmet.task.ITask;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* desc数字社区私有化部署 任务之一还有autoEvaluateDemandTaskstatsDemandTaskdailyStatisticalVoteTask,IcPrivateDeploySupportUserPointTask
*/
@Slf4j
@Component("icPrivateDeploySupportProjectTask")
public class IcPrivateDeploySupportProjectTask implements ITask {
@Autowired
private DataStatisticalOpenFeignClient dataStatisticalOpenFeignClient;
@Override
public void run(String params) {
ExtractOriginFormDTO formDTO = new ExtractOriginFormDTO();
if (StringUtils.isNotBlank(params)) {
formDTO = JSON.parseObject(params, ExtractOriginFormDTO.class);
}
Result result = dataStatisticalOpenFeignClient.userPointAndProjectStatus(BizTypeEnum.PROJECT.getType(), formDTO);
log.info("icPrivateDeploySupportProjectTask excute end,param:{},result:{}",params,result);
}
}

33
epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/ic/IcPrivateDeploySupportUserPointTask.java

@ -0,0 +1,33 @@
package com.epmet.task.ic;
import com.alibaba.fastjson.JSON;
import com.epmet.commons.tools.enums.BizTypeEnum;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.extract.form.ExtractOriginFormDTO;
import com.epmet.feign.DataStatisticalOpenFeignClient;
import com.epmet.task.ITask;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* desc数字社区私有化部署 任务之一还有autoEvaluateDemandTaskstatsDemandTaskdailyStatisticalVoteTask,icPrivateDeploySupportProjectTask
*/
@Slf4j
@Component("icPrivateDeploySupportUserPointTask")
public class IcPrivateDeploySupportUserPointTask implements ITask {
@Autowired
private DataStatisticalOpenFeignClient dataStatisticalOpenFeignClient;
@Override
public void run(String params) {
ExtractOriginFormDTO formDTO = new ExtractOriginFormDTO();
if (StringUtils.isNotBlank(params)) {
formDTO = JSON.parseObject(params, ExtractOriginFormDTO.class);
}
Result result = dataStatisticalOpenFeignClient.userPointAndProjectStatus(BizTypeEnum.USER.getType(), formDTO);
log.info("icPrivateDeploySupportUserPointTask excute end,param:{},result:{}",params,result);
}
}

1
epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/DailyStatisticalVoteJobResultDTO.java

@ -17,6 +17,7 @@ public class DailyStatisticalVoteJobResultDTO implements Serializable {
private static final long serialVersionUID = 5266996778036448163L; private static final long serialVersionUID = 5266996778036448163L;
private String issueId; private String issueId;
private String customerId;
/** /**
* 统计日期 * 统计日期

2
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueVoteStatisticalDailyServiceImpl.java

@ -390,7 +390,7 @@ public class IssueVoteStatisticalDailyServiceImpl extends BaseServiceImpl<IssueV
Integer delNum; Integer delNum;
do { do {
delNum = baseDao.delHistoryData(customerId, dateId); delNum = baseDao.delHistoryData(customerId, dateId);
} while (delNum != null && delNum > NumConstant.ZERO); } while (delNum > NumConstant.ZERO);
List<List<IssueVoteStatisticalDailyEntity>> partition = ListUtils.partition(needInsert, NumConstant.ONE_HUNDRED); List<List<IssueVoteStatisticalDailyEntity>> partition = ListUtils.partition(needInsert, NumConstant.ONE_HUNDRED);
partition.forEach(p -> { partition.forEach(p -> {
baseDao.insertBatch(p); baseDao.insertBatch(p);

1
epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueVoteDetailDao.xml

@ -195,6 +195,7 @@
t.* FROM t.* FROM
(SELECT (SELECT
vd.ISSUE_ID, vd.ISSUE_ID,
vd.CUSTOMER_ID AS customerId,
COUNT(CASE WHEN vd.ATTITUDE = 'opposition' THEN 1 END) AS oppositionCount, COUNT(CASE WHEN vd.ATTITUDE = 'opposition' THEN 1 END) AS oppositionCount,
COUNT(CASE WHEN vd.ATTITUDE = 'opposition' THEN 1 END) AS oppositionIncrement, COUNT(CASE WHEN vd.ATTITUDE = 'opposition' THEN 1 END) AS oppositionIncrement,
COUNT(CASE WHEN vd.ATTITUDE = 'support' THEN 1 END) AS supportCount, COUNT(CASE WHEN vd.ATTITUDE = 'support' THEN 1 END) AS supportCount,

4
epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueVoteStatisticalDailyDao.xml

@ -147,7 +147,7 @@
votable_count, votable_count,
customer_id,
created_by, created_by,
@ -180,7 +180,7 @@
#{item.votableCount}, #{item.votableCount},
#{item.customerId},
#{item.createdBy}, #{item.createdBy},

1
epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ResiEventDao.xml

@ -242,6 +242,7 @@
<foreach item="epmetUserId" collection="epmetUserIdList" open="AND (" separator="or" close=")" index=""> <foreach item="epmetUserId" collection="epmetUserIdList" open="AND (" separator="or" close=")" index="">
re.REPORT_USER_ID = #{epmetUserId} re.REPORT_USER_ID = #{epmetUserId}
</foreach> </foreach>
order by re.CREATED_TIME desc
</select> </select>
<resultMap id="resiEventListResultMap" type="com.epmet.dto.result.ResiEventListResultDTO"> <resultMap id="resiEventListResultMap" type="com.epmet.dto.result.ResiEventListResultDTO">

5
epmet-module/open-data-worker/open-data-worker-server/src/main/resources/bootstrap.yml

@ -112,11 +112,6 @@ hystrix:
isolation: isolation:
thread: thread:
timeoutInMilliseconds: 60000 #缺省为1000 timeoutInMilliseconds: 60000 #缺省为1000
threadpool:
default:
coreSize: 10
maxQueueSize: 500
queueSizeRejectionThreshold: 500
ribbon: ribbon:
ReadTimeout: 300000 ReadTimeout: 300000

9
epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/entity/CustomerEntity.java

@ -17,8 +17,9 @@
package com.epmet.entity; package com.epmet.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
@ -38,6 +39,12 @@ public class CustomerEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/**
* id
*/
@TableId(type = IdType.ASSIGN_UUID)
private String id;
/** /**
* 客户名称 * 客户名称
*/ */

3
epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/CustomerFormQueryDTO.java

@ -16,6 +16,9 @@ public class CustomerFormQueryDTO implements Serializable {
// 获取表单相关信息 // 获取表单相关信息
public interface GetFormInfoGroup {} public interface GetFormInfoGroup {}
/**
* @see com.epmet.commons.tools.enums.IcFormCodeEnum
*/
@NotBlank(message = "formCode不能为空,居民信息默认传:resi_base_info",groups = { AddUserInternalGroup.class, GetFormInfoGroup.class} ) @NotBlank(message = "formCode不能为空,居民信息默认传:resi_base_info",groups = { AddUserInternalGroup.class, GetFormInfoGroup.class} )
private String formCode; private String formCode;

43
epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/IndividualCategoryAllListResultDTO.java

@ -0,0 +1,43 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2022/1/17 10:52 上午
* @DESC
*/
@Data
public class IndividualCategoryAllListResultDTO implements Serializable {
private static final long serialVersionUID = -3294223041221531203L;
/**
* 标签
*/
private String label;
/**
* 图片
*/
private String managementIcon;
/**
* 字段名
*/
private String columnName;
/**
* 排序
*/
private Integer sort;
private String id;
/**
* 是否选中 truefalse
*/
private boolean isSelected = false;
}

3
epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/IndividualCategoryListResultDTO.java

@ -1,5 +1,6 @@
package com.epmet.dto.result; package com.epmet.dto.result;
import com.epmet.commons.tools.constant.NumConstant;
import lombok.Data; import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
@ -35,4 +36,6 @@ public class IndividualCategoryListResultDTO implements Serializable {
private Integer sort; private Integer sort;
private String id; private String id;
private Integer count = NumConstant.ZERO;
} }

12
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcIndividualCategoryManageController.java

@ -10,6 +10,7 @@ import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.dto.IcIndividualCategoryManageDTO; import com.epmet.dto.IcIndividualCategoryManageDTO;
import com.epmet.dto.form.EditIndividualCategoryFormDTO; import com.epmet.dto.form.EditIndividualCategoryFormDTO;
import com.epmet.dto.form.PackageEditIndividualCategoryFormDTO; import com.epmet.dto.form.PackageEditIndividualCategoryFormDTO;
import com.epmet.dto.result.IndividualCategoryAllListResultDTO;
import com.epmet.dto.result.IndividualCategoryListResultDTO; import com.epmet.dto.result.IndividualCategoryListResultDTO;
import com.epmet.service.IcIndividualCategoryManageService; import com.epmet.service.IcIndividualCategoryManageService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -56,4 +57,15 @@ public class IcIndividualCategoryManageController {
return new Result(); return new Result();
} }
/**
* @Description 查询客户下人员分类并且赋值本人选中的
* @param tokenDto
* @author zxc
* @date 2022/1/20 10:44 上午
*/
@PostMapping("individualcategoryalllist")
public Result<List<IndividualCategoryAllListResultDTO>> individualCategoryAllList(@LoginUser TokenDto tokenDto){
return new Result<List<IndividualCategoryAllListResultDTO>>().ok(icIndividualCategoryManageService.individualCategoryAllList(tokenDto));
}
} }

2
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/IcFormQueryBuilderEntity.java

@ -47,6 +47,8 @@ public class IcFormQueryBuilderEntity extends BaseEpmetEntity {
/** /**
* ic_form.form_code举例resi_base_info * ic_form.form_code举例resi_base_info
* @see com.epmet.commons.tools.enums.IcFormCodeEnum
*
*/ */
private String formCode; private String formCode;

9
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcIndividualCategoryManageService.java

@ -5,6 +5,7 @@ import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.dto.IcIndividualCategoryManageDTO; import com.epmet.dto.IcIndividualCategoryManageDTO;
import com.epmet.dto.form.EditIndividualCategoryFormDTO; import com.epmet.dto.form.EditIndividualCategoryFormDTO;
import com.epmet.dto.result.IndividualCategoryAllListResultDTO;
import com.epmet.dto.result.IndividualCategoryListResultDTO; import com.epmet.dto.result.IndividualCategoryListResultDTO;
import com.epmet.entity.IcIndividualCategoryManageEntity; import com.epmet.entity.IcIndividualCategoryManageEntity;
@ -36,4 +37,12 @@ public interface IcIndividualCategoryManageService extends BaseService<IcIndivid
*/ */
void editIndividualCategory(List<EditIndividualCategoryFormDTO> formDTOS, TokenDto tokenDto); void editIndividualCategory(List<EditIndividualCategoryFormDTO> formDTOS, TokenDto tokenDto);
/**
* @Description 查询客户下人员分类并且赋值本人选中的
* @param tokenDto
* @author zxc
* @date 2022/1/20 10:44 上午
*/
List<IndividualCategoryAllListResultDTO> individualCategoryAllList(TokenDto tokenDto);
} }

64
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcIndividualCategoryManageServiceImpl.java

@ -1,14 +1,27 @@
package com.epmet.service.impl; package com.epmet.service.impl;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dao.IcIndividualCategoryManageDao; import com.epmet.dao.IcIndividualCategoryManageDao;
import com.epmet.dto.IcResiCategoryStatsConfigDTO;
import com.epmet.dto.form.EditIndividualCategoryFormDTO; import com.epmet.dto.form.EditIndividualCategoryFormDTO;
import com.epmet.dto.form.IcResiCategoryStatsConfigFormDTO;
import com.epmet.dto.form.StatsResiListFormDTO;
import com.epmet.dto.result.IcStatsResiResultDTO;
import com.epmet.dto.result.IcStatsResiWarnBuildingResultDTO;
import com.epmet.dto.result.IndividualCategoryAllListResultDTO;
import com.epmet.dto.result.IndividualCategoryListResultDTO; import com.epmet.dto.result.IndividualCategoryListResultDTO;
import com.epmet.entity.IcIndividualCategoryManageEntity; import com.epmet.entity.IcIndividualCategoryManageEntity;
import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.feign.OperCustomizeOpenFeignClient;
import com.epmet.service.IcIndividualCategoryManageService; import com.epmet.service.IcIndividualCategoryManageService;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -24,6 +37,11 @@ import java.util.List;
@Service @Service
public class IcIndividualCategoryManageServiceImpl extends BaseServiceImpl<IcIndividualCategoryManageDao, IcIndividualCategoryManageEntity> implements IcIndividualCategoryManageService { public class IcIndividualCategoryManageServiceImpl extends BaseServiceImpl<IcIndividualCategoryManageDao, IcIndividualCategoryManageEntity> implements IcIndividualCategoryManageService {
@Autowired
private OperCustomizeOpenFeignClient operCustomizeOpenFeignClient;
@Autowired
private EpmetUserOpenFeignClient userOpenFeignClient;
/** /**
* @Description 人员分类管理查询个人分类列表 * @Description 人员分类管理查询个人分类列表
* @param tokenDto * @param tokenDto
@ -32,10 +50,30 @@ public class IcIndividualCategoryManageServiceImpl extends BaseServiceImpl<IcInd
*/ */
@Override @Override
public List<IndividualCategoryListResultDTO> individualCategoryList(TokenDto tokenDto) { public List<IndividualCategoryListResultDTO> individualCategoryList(TokenDto tokenDto) {
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId());
if (null == staffInfo){
throw new EpmetException(String.format("查询工作人员%s信息失败...",tokenDto.getUserId()));
}
StatsResiListFormDTO formDTO = new StatsResiListFormDTO();
formDTO.setId(staffInfo.getAgencyId());
formDTO.setLevel("agency");
formDTO.setCustomerId(tokenDto.getCustomerId());
Result<List<IcStatsResiResultDTO>> list = userOpenFeignClient.getPersonCategoryList(formDTO);
if (!list.success()){
throw new EpmetException("查询人员分类下人数失败...");
}
List<IcStatsResiResultDTO> datas = list.getData();
List<IndividualCategoryListResultDTO> result = baseDao.individualCategoryList(tokenDto.getUserId()); List<IndividualCategoryListResultDTO> result = baseDao.individualCategoryList(tokenDto.getUserId());
if (CollectionUtils.isNotEmpty(result)){ if (CollectionUtils.isNotEmpty(datas) && CollectionUtils.isNotEmpty(result)){
result.forEach( r -> datas.stream().filter( d -> d.getId().equals(r.getId())).forEach(d -> r.setCount(d.getCount())));
return result;
}
if (CollectionUtils.isEmpty(datas) && CollectionUtils.isNotEmpty(result)){
return result; return result;
} }
if (CollectionUtils.isEmpty(result)){
return new ArrayList<>();
}
return new ArrayList<>(); return new ArrayList<>();
} }
@ -59,4 +97,28 @@ public class IcIndividualCategoryManageServiceImpl extends BaseServiceImpl<IcInd
insertBatch(entities); insertBatch(entities);
} }
} }
/**
* @Description 查询客户下人员分类并且赋值本人选中的
* @param tokenDto
* @author zxc
* @date 2022/1/20 10:44 上午
*/
@Override
public List<IndividualCategoryAllListResultDTO> individualCategoryAllList(TokenDto tokenDto) {
IcResiCategoryStatsConfigFormDTO formDTO = new IcResiCategoryStatsConfigFormDTO();
Result<List<IcResiCategoryStatsConfigDTO>> listResult = operCustomizeOpenFeignClient.resiCategoryStatsListShowd(formDTO);
if (!listResult.success()){
throw new EpmetException("查询客户下的人员类别失败...");
}
if (CollectionUtils.isEmpty(listResult.getData())){
return new ArrayList<>();
}
List<IndividualCategoryAllListResultDTO> result = ConvertUtils.sourceToTarget(listResult.getData(), IndividualCategoryAllListResultDTO.class);
List<IndividualCategoryListResultDTO> configs = baseDao.individualCategoryList(tokenDto.getUserId());
if (CollectionUtils.isNotEmpty(configs)){
result.forEach(r -> configs.stream().filter(c -> c.getColumnName().equals(r.getColumnName())).forEach(c -> r.setSelected(true)));
}
return result;
}
} }

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

@ -69,6 +69,10 @@ hystrix:
isolation: isolation:
thread: thread:
timeoutInMilliseconds: 60000 #缺省为1000 timeoutInMilliseconds: 60000 #缺省为1000
threadpool:
default:
# hystric最大线程个数,默认10,改为20
maximumSize: 20
ribbon: ribbon:
ReadTimeout: 300000 ReadTimeout: 300000

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

@ -68,6 +68,10 @@ hystrix:
isolation: isolation:
thread: thread:
timeoutInMilliseconds: 60000 #缺省为1000 timeoutInMilliseconds: 60000 #缺省为1000
threadpool:
default:
# hystric最大线程个数,默认10,改为20
maximumSize: 20
ribbon: ribbon:
ReadTimeout: 300000 ReadTimeout: 300000

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

@ -1,5 +1,6 @@
package com.epmet.dto.form; package com.epmet.dto.form;
import com.epmet.commons.tools.enums.IcFormCodeEnum;
import lombok.Data; import lombok.Data;
import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotBlank;
@ -21,6 +22,6 @@ public class DelIcResiUserFormDTO implements Serializable {
private String icResiUserId; private String icResiUserId;
@NotBlank(message = "token获取的customerId不能为空", groups = IdGroup.class) @NotBlank(message = "token获取的customerId不能为空", groups = IdGroup.class)
private String customerId; private String customerId;
private String formCode="resi_base_info"; private String formCode= IcFormCodeEnum.RESI_BASE_INFO.getCode();
} }

3
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/DynamicQueryFormDTO.java

@ -1,5 +1,6 @@
package com.epmet.dto.form; package com.epmet.dto.form;
import com.epmet.commons.tools.enums.IcFormCodeEnum;
import lombok.Data; import lombok.Data;
import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotBlank;
@ -14,7 +15,7 @@ import java.util.List;
@Data @Data
public class DynamicQueryFormDTO implements Serializable { public class DynamicQueryFormDTO implements Serializable {
private String customerId; private String customerId;
private String formCode="resi_base_info"; private String formCode= IcFormCodeEnum.RESI_BASE_INFO.getCode();
@NotBlank(message = "resultTableName不能为空") @NotBlank(message = "resultTableName不能为空")
private String resultTableName; private String resultTableName;
private List<ResiUserQueryValueDTO> conditions; private List<ResiUserQueryValueDTO> conditions;

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

@ -43,4 +43,6 @@ public class StatsResiListFormDTO implements Serializable {
@NotBlank(message = "level不能为空") @NotBlank(message = "level不能为空")
private String level; private String level;
private String customerId;
} }

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

@ -1,6 +1,7 @@
package com.epmet.feign; package com.epmet.feign;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.dto.result.OptionResultDTO; import com.epmet.commons.tools.dto.result.OptionResultDTO;
import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.security.dto.TokenDto;
@ -24,8 +25,8 @@ import java.util.Set;
* @author yinzuomei@elink-cn.com * @author yinzuomei@elink-cn.com
* @date 2020/6/4 13:09 * @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) //@FeignClient(name = ServiceConstant.EPMET_USER_SERVER, fallbackFactory = EpmetUserOpenFeignClientFallbackFactory.class)
public interface EpmetUserOpenFeignClient { public interface EpmetUserOpenFeignClient {
/** /**
@ -708,4 +709,7 @@ public interface EpmetUserOpenFeignClient {
@PostMapping("/epmetuser/userbaseinfo/resirelationinfo") @PostMapping("/epmetuser/userbaseinfo/resirelationinfo")
Result<RegisterRelationDTO> resiRelationInfo(@RequestParam("userId")String userId); Result<RegisterRelationDTO> resiRelationInfo(@RequestParam("userId")String userId);
@PostMapping("/epmetuser/statsresiwarn/list2")
Result<List<IcStatsResiResultDTO>> getPersonCategoryList(@RequestBody StatsResiListFormDTO formDTO);
} }

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

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

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

@ -28,6 +28,7 @@ import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.dto.result.OptionDataResultDTO; import com.epmet.commons.tools.dto.result.OptionDataResultDTO;
import com.epmet.commons.tools.enums.IcFormCodeEnum;
import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.exception.ExceptionUtils; import com.epmet.commons.tools.exception.ExceptionUtils;
@ -91,9 +92,6 @@ import java.util.stream.Collectors;
@RequestMapping("icresiuser") @RequestMapping("icresiuser")
public class IcResiUserController { public class IcResiUserController {
//todo 枚举吧
private static final String IC_RESI_FORM_CODE = "resi_base_info";
/** /**
* 居民上传临时目录 * 居民上传临时目录
*/ */
@ -312,7 +310,7 @@ public class IcResiUserController {
Set<String> stopSearchSet = new HashSet<>(); Set<String> stopSearchSet = new HashSet<>();
//获取表单项 //获取表单项
List<FormItemResult> resiFormAllItems = icResiUserService.listFormItems(customerId, IC_RESI_FORM_CODE); List<FormItemResult> resiFormAllItems = icResiUserService.listFormItems(customerId, IcFormCodeEnum.RESI_BASE_INFO.getCode());
Map<String, FormItemResult> allItemMap = resiFormAllItems.stream().collect(Collectors.toMap(FormItemResult::getItemId, o -> o)); Map<String, FormItemResult> allItemMap = resiFormAllItems.stream().collect(Collectors.toMap(FormItemResult::getItemId, o -> o));
Map<String, ExportResiUserItemDTO> map = new HashMap<>(); Map<String, ExportResiUserItemDTO> map = new HashMap<>();
allItemMap.values().forEach(item->{ allItemMap.values().forEach(item->{
@ -345,7 +343,7 @@ public class IcResiUserController {
.collect(Collectors.toList()); .collect(Collectors.toList());
List<Map<String, Object>> resiResultList = null; List<Map<String, Object>> resiResultList = null;
pageFormDTO.setPageSize(NumConstant.FIVE_HUNDRED); pageFormDTO.setPageSize(NumConstant.TEN_THOUSAND);
for (IcResiUserTableEnum tableEnum : resiTableList) { for (IcResiUserTableEnum tableEnum : resiTableList) {
String tableName = tableEnum.getTableName(); String tableName = tableEnum.getTableName();
pageFormDTO.setPageNo(NumConstant.ONE); pageFormDTO.setPageNo(NumConstant.ONE);
@ -436,7 +434,7 @@ public class IcResiUserController {
savePath = IC_RESI_UPLOAD_DIR.resolve(fileName); savePath = IC_RESI_UPLOAD_DIR.resolve(fileName);
IOUtils.copy(file.getInputStream(), new FileOutputStream(savePath.toString())); IOUtils.copy(file.getInputStream(), new FileOutputStream(savePath.toString()));
List<FormItemResult> formItemList = icResiUserService.listFormItems(customerId,IC_RESI_FORM_CODE); List<FormItemResult> formItemList = icResiUserService.listFormItems(customerId,IcFormCodeEnum.RESI_BASE_INFO.getCode());
icResiUserImportService.importIcResiInfoFromExcel(formItemList, savePath.toString(), response); icResiUserImportService.importIcResiInfoFromExcel(formItemList, savePath.toString(), response);
} catch (IOException e) { } catch (IOException e) {
String errorMsg = ExceptionUtils.getErrorStackTrace(e); String errorMsg = ExceptionUtils.getErrorStackTrace(e);
@ -444,7 +442,9 @@ public class IcResiUserController {
throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode());
} finally { } finally {
try { try {
Files.delete(savePath); if (savePath != null){
Files.delete(savePath);
}
} catch (IOException e) { } catch (IOException e) {
log.error("【导入居民信息失败】清理上传的文件失败:{}", ExceptionUtils.getErrorStackTrace(e)); log.error("【导入居民信息失败】清理上传的文件失败:{}", ExceptionUtils.getErrorStackTrace(e));
} }
@ -491,7 +491,7 @@ public class IcResiUserController {
@NotNull @NotNull
private CustomerFormResultDTO getResiFormAddItems(String customerId) { private CustomerFormResultDTO getResiFormAddItems(String customerId) {
CustomerFormQueryDTO queryDTO = new CustomerFormQueryDTO(); CustomerFormQueryDTO queryDTO = new CustomerFormQueryDTO();
queryDTO.setFormCode("resi_base_info"); queryDTO.setFormCode(IcFormCodeEnum.RESI_BASE_INFO.getCode());
queryDTO.setCustomerId(customerId); queryDTO.setCustomerId(customerId);
Result<CustomerFormResultDTO> resultForm = operCustomizeOpenFeignClient.getCustomerForm(queryDTO); Result<CustomerFormResultDTO> resultForm = operCustomizeOpenFeignClient.getCustomerForm(queryDTO);
if (resultForm == null || !resultForm.success() || resultForm.getData() == null) { if (resultForm == null || !resultForm.success() || resultForm.getData() == null) {
@ -649,20 +649,20 @@ public class IcResiUserController {
@PostMapping("search") @PostMapping("search")
public Result<PageData<Map<String, Object>>> searchResi(@RequestBody IcResiUserPageFormDTO input, @LoginUser TokenDto loginUser) { public Result<PageData<Map<String, Object>>> searchResi(@RequestBody IcResiUserPageFormDTO input, @LoginUser TokenDto loginUser) {
if (StringUtils.isBlank(input.getKeyword())) { if (StringUtils.isBlank(input.getKeyword())) {
PageData<Map<String, Object>> r = new PageData<Map<String, Object>>(new ArrayList<>(), 0); PageData<Map<String, Object>> r = new PageData<Map<String, Object>>(new ArrayList<>(), NumConstant.ZERO_L);
return new Result<PageData<Map<String, Object>>>().ok(r); return new Result<PageData<Map<String, Object>>>().ok(r);
} }
input.setKeyword(input.getKeyword().trim()); input.setKeyword(input.getKeyword().trim());
input.setCustomerId(loginUser.getCustomerId()); input.setCustomerId(loginUser.getCustomerId());
input.setStaffId(loginUser.getUserId()); input.setStaffId(loginUser.getUserId());
input.setFormCode("resi_base_info"); input.setFormCode(IcFormCodeEnum.RESI_BASE_INFO.getCode());
if (input.getPageNo() == null) { if (input.getPageNo() == null) {
input.setPageNo(1); input.setPageNo(NumConstant.ONE);
} }
if (input.getPageSize() == null) { if (input.getPageSize() == null) {
input.setPageSize(20); input.setPageSize(NumConstant.TWENTY);
} }
PageData<Map<String, Object>> r = icResiUserService.pageResiMap(input); PageData<Map<String, Object>> r = icResiUserService.pageResiMap(input);

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

@ -60,12 +60,23 @@ public class StatsResiWarnController {
private StatsResiWarnService statsResiWarnService; private StatsResiWarnService statsResiWarnService;
@PostMapping("list") @PostMapping("list")
public Result list(@LoginUser TokenDto tokenDto,@RequestBody StatsResiListFormDTO formDTO){ public Result<List<IcStatsResiResultDTO>> list(@LoginUser TokenDto tokenDto,@RequestBody StatsResiListFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO); ValidatorUtils.validateEntity(formDTO);
String customerId = tokenDto.getCustomerId(); String customerId = tokenDto.getCustomerId();
List<IcStatsResiResultDTO> icStatsResiResultDTOList = statsResiWarnService.list(customerId,formDTO.getId(),formDTO.getLevel()); List<IcStatsResiResultDTO> icStatsResiResultDTOList = statsResiWarnService.list(customerId,formDTO.getId(),formDTO.getLevel());
return new Result().ok(icStatsResiResultDTOList); return new Result<List<IcStatsResiResultDTO>>().ok(icStatsResiResultDTOList);
}
/**
* @Description 内部调了list
* @param formDTO
* @author zxc
* @date 2022/1/20 2:11 下午
*/
@PostMapping("list2")
public Result<List<IcStatsResiResultDTO>> list2(@RequestBody StatsResiListFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO);
return new Result<List<IcStatsResiResultDTO>>().ok(statsResiWarnService.list2(formDTO));
} }
@PostMapping("buildingwarnlist") @PostMapping("buildingwarnlist")

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

@ -17,6 +17,7 @@
package com.epmet.service; package com.epmet.service;
import com.epmet.dto.form.StatsResiListFormDTO;
import com.epmet.dto.result.IcStatsResiResultDTO; import com.epmet.dto.result.IcStatsResiResultDTO;
import com.epmet.dto.result.IcStatsResiWarnBuildingResultDTO; import com.epmet.dto.result.IcStatsResiWarnBuildingResultDTO;
import com.epmet.dto.result.IcStatsResiWarnUserResultDTO; import com.epmet.dto.result.IcStatsResiWarnUserResultDTO;
@ -38,6 +39,8 @@ public interface StatsResiWarnService{
List<IcStatsResiResultDTO> list(String customerId,String id, String level); List<IcStatsResiResultDTO> list(String customerId,String id, String level);
List<IcStatsResiResultDTO> list2(StatsResiListFormDTO formDTO);
void resiWarn(String customerId); void resiWarn(String customerId);
void resiWarnByOne(String customerId,String userId); void resiWarnByOne(String customerId,String userId);

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

@ -476,7 +476,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
@Override @Override
public PageData<Map<String, Object>> pageResiMap(IcResiUserPageFormDTO formDTO) { public PageData<Map<String, Object>> pageResiMap(IcResiUserPageFormDTO formDTO) {
CustomerStaffInfoCacheResult staffInfoCacheResult=CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(),formDTO.getStaffId()); CustomerStaffInfoCacheResult staffInfoCacheResult=CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(),formDTO.getStaffId());
String staffOrgPath=StrConstant.EPMETY_STR; String staffOrgPath;
if(StringUtils.isNotBlank(staffInfoCacheResult.getAgencyPIds())&& !NumConstant.ZERO_STR.equals(staffInfoCacheResult.getAgencyPIds())){ if(StringUtils.isNotBlank(staffInfoCacheResult.getAgencyPIds())&& !NumConstant.ZERO_STR.equals(staffInfoCacheResult.getAgencyPIds())){
staffOrgPath=staffInfoCacheResult.getAgencyPIds().concat(":").concat(staffInfoCacheResult.getAgencyId()); staffOrgPath=staffInfoCacheResult.getAgencyPIds().concat(":").concat(staffInfoCacheResult.getAgencyId());
}else{ }else{
@ -542,14 +542,14 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
for (Map<String, Object> resultMap : list) { for (Map<String, Object> resultMap : list) {
String gridIdValue = null != resultMap.get(UserConstant.GRID_ID) ? resultMap.get(UserConstant.GRID_ID).toString() : StrConstant.EPMETY_STR; String gridIdValue = null != resultMap.get(UserConstant.GRID_ID) ? resultMap.get(UserConstant.GRID_ID).toString() : StrConstant.EPMETY_STR;
resultMap.put("GRID_ID_VALUE", gridIdValue); resultMap.put("GRID_ID_VALUE", gridIdValue);
if (null != gridInfoMap && gridInfoMap.containsKey(gridIdValue) && null != gridInfoMap.get(gridIdValue)) { if (gridInfoMap.containsKey(gridIdValue) && null != gridInfoMap.get(gridIdValue)) {
//GRID_NAME //GRID_NAME
resultMap.put(UserConstant.GRID_ID, gridInfoMap.get(gridIdValue).getGridName()); resultMap.put(UserConstant.GRID_ID, gridInfoMap.get(gridIdValue).getGridName());
} }
String homeId = null != resultMap.get(UserConstant.HOME_ID) ? resultMap.get(UserConstant.HOME_ID).toString() : StrConstant.EPMETY_STR; String homeId = null != resultMap.get(UserConstant.HOME_ID) ? resultMap.get(UserConstant.HOME_ID).toString() : StrConstant.EPMETY_STR;
resultMap.put("HOME_ID_VALUE", homeId); resultMap.put("HOME_ID_VALUE", homeId);
if (null != houseInfoMap && houseInfoMap.containsKey(homeId) && null != houseInfoMap.get(homeId)) { if (houseInfoMap.containsKey(homeId) && null != houseInfoMap.get(homeId)) {
HouseInfoDTO houseInfoDTO = houseInfoMap.get(homeId); HouseInfoDTO houseInfoDTO = houseInfoMap.get(homeId);
String buildName = StringUtils.isNotBlank(houseInfoDTO.getBuildingName()) ? houseInfoDTO.getBuildingName() : StrConstant.EPMETY_STR; String buildName = StringUtils.isNotBlank(houseInfoDTO.getBuildingName()) ? houseInfoDTO.getBuildingName() : StrConstant.EPMETY_STR;
resultMap.put("BUILD_NAME", buildName); resultMap.put("BUILD_NAME", buildName);
@ -1181,7 +1181,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
private Map<String, String> getVolunteerCategoryOptions(String customerId) { private Map<String, String> getVolunteerCategoryOptions(String customerId) {
IcFormOptionsQueryFormDTO optionsQuery = new IcFormOptionsQueryFormDTO(); IcFormOptionsQueryFormDTO optionsQuery = new IcFormOptionsQueryFormDTO();
optionsQuery.setCustomerId(customerId); optionsQuery.setCustomerId(customerId);
optionsQuery.setFormCode("resi_base_info"); optionsQuery.setFormCode(IcFormCodeEnum.RESI_BASE_INFO.getCode());
optionsQuery.setLabel("志愿者类别"); optionsQuery.setLabel("志愿者类别");
List<IcFormItemOptionsDTO> categorieDtos = getResultDataOrThrowsException(operCustomizeOpenFeignClient.listOptionsByItemConditions(optionsQuery), List<IcFormItemOptionsDTO> categorieDtos = getResultDataOrThrowsException(operCustomizeOpenFeignClient.listOptionsByItemConditions(optionsQuery),
ServiceConstant.OPER_CUSTOMIZE_SERVER, ServiceConstant.OPER_CUSTOMIZE_SERVER,

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

@ -10,6 +10,7 @@ import com.epmet.dao.IcStatsResiWarnDao;
import com.epmet.dto.IcResiCategoryStatsConfigDTO; import com.epmet.dto.IcResiCategoryStatsConfigDTO;
import com.epmet.dto.IcResiCategoryWarnConfigDTO; import com.epmet.dto.IcResiCategoryWarnConfigDTO;
import com.epmet.dto.form.IcResiCategoryStatsConfigFormDTO; import com.epmet.dto.form.IcResiCategoryStatsConfigFormDTO;
import com.epmet.dto.form.StatsResiListFormDTO;
import com.epmet.dto.result.*; import com.epmet.dto.result.*;
import com.epmet.entity.IcResiUserEntity; import com.epmet.entity.IcResiUserEntity;
import com.epmet.entity.IcStatsResiWarnEntity; import com.epmet.entity.IcStatsResiWarnEntity;
@ -193,6 +194,11 @@ public class StatsResiWarnServiceImpl implements StatsResiWarnService {
return result; return result;
} }
@Override
public List<IcStatsResiResultDTO> list2(StatsResiListFormDTO formDTO) {
return this.list(formDTO.getCustomerId(), formDTO.getId(), formDTO.getLevel());
}
/** /**
* 统计 * 统计
*/ */

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

@ -1,6 +1,7 @@
package com.epmet.service.impl; package com.epmet.service.impl;
import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.enums.IcFormCodeEnum;
import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.ExceptionUtils; import com.epmet.commons.tools.exception.ExceptionUtils;
import com.epmet.commons.tools.feign.ResultDataResolver; import com.epmet.commons.tools.feign.ResultDataResolver;
@ -16,13 +17,12 @@ import com.epmet.feign.EpmetHeartOpenFeignClient;
import com.epmet.feign.GovOrgOpenFeignClient; import com.epmet.feign.GovOrgOpenFeignClient;
import com.epmet.feign.OperCustomizeOpenFeignClient; import com.epmet.feign.OperCustomizeOpenFeignClient;
import com.epmet.service.VolunteerService; import com.epmet.service.VolunteerService;
import com.google.common.collect.Lists;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.google.common.collect.Lists;
import java.util.*; import java.util.*;
import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutionException;
@ -68,7 +68,7 @@ public class VolunteerServiceImpl implements VolunteerService, ResultDataResolve
// 2.补充图例 // 2.补充图例
IcFormOptionsQueryFormDTO optionsForm = new IcFormOptionsQueryFormDTO(); IcFormOptionsQueryFormDTO optionsForm = new IcFormOptionsQueryFormDTO();
optionsForm.setCustomerId(customerId); optionsForm.setCustomerId(customerId);
optionsForm.setFormCode("resi_base_info"); optionsForm.setFormCode(IcFormCodeEnum.RESI_BASE_INFO.getCode());
optionsForm.setLabel("志愿者类别"); optionsForm.setLabel("志愿者类别");
String errorMsg = "【志愿者分布】查询志愿者图例失败"; String errorMsg = "【志愿者分布】查询志愿者图例失败";

2
epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.24__alter_change_detailed.sql

@ -1,3 +1,3 @@
ALTER TABLE `ic_user_change_detailed` ALTER TABLE `ic_user_change_detailed`
ADD COLUMN `PIDS` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT ''Id'' AFTER `IC_USER_CHANGE_RECORD_ID`; ADD COLUMN `PIDS` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '组织的所有上级Id' AFTER `IC_USER_CHANGE_RECORD_ID`;

3
epmet-user/epmet-user-server/src/test/java/com/epmet/epmetuser/test/IcResiUserControllerTest.java

@ -5,6 +5,7 @@ import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
import cn.afterturn.easypoi.excel.export.ExcelExportService; import cn.afterturn.easypoi.excel.export.ExcelExportService;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.epmet.commons.tools.enums.IcFormCodeEnum;
import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
@ -61,7 +62,7 @@ public class IcResiUserControllerTest {
@NotNull @NotNull
private CustomerFormResultDTO getResiFormItems(String customerId) { private CustomerFormResultDTO getResiFormItems(String customerId) {
CustomerFormQueryDTO queryDTO = new CustomerFormQueryDTO(); CustomerFormQueryDTO queryDTO = new CustomerFormQueryDTO();
queryDTO.setFormCode("resi_base_info"); queryDTO.setFormCode(IcFormCodeEnum.RESI_BASE_INFO.getCode());
queryDTO.setCustomerId(customerId); queryDTO.setCustomerId(customerId);
Result<CustomerFormResultDTO> resultForm = operCustomizeOpenFeignClient.getCustomerForm(queryDTO); Result<CustomerFormResultDTO> resultForm = operCustomizeOpenFeignClient.getCustomerForm(queryDTO);
if (resultForm == null || !resultForm.success() ||resultForm.getData() == null){ if (resultForm == null || !resultForm.success() ||resultForm.getData() == null){

Loading…
Cancel
Save