Browse Source

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

 Conflicts:
	epmet-user/epmet-user-server/pom.xml
dev
wangxianzhang 3 years ago
parent
commit
04ce5c521d
  1. 2
      epmet-admin/epmet-admin-server/pom.xml
  2. 9
      epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.15__add_item_typequery.sql
  3. 7
      epmet-auth-client/pom.xml
  4. 25
      epmet-auth-client/src/main/java/com/epmet/auth/dto/result/BlockChainStaffAuthResultDTO.java
  5. 2
      epmet-auth/pom.xml
  6. 1
      epmet-auth/src/main/java/com/epmet/controller/GovLoginController.java
  7. 20
      epmet-auth/src/main/java/com/epmet/controller/GovWebController.java
  8. 24
      epmet-auth/src/main/java/com/epmet/dto/form/BcStaffAuthenticationFormDTO.java
  9. 9
      epmet-auth/src/main/java/com/epmet/service/GovWebService.java
  10. 4
      epmet-auth/src/main/java/com/epmet/service/impl/GovLoginServiceImpl.java
  11. 41
      epmet-auth/src/main/java/com/epmet/service/impl/GovWebServiceImpl.java
  12. 44
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/annotation/MaskResponse.java
  13. 36
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aspect/MaskResponseAspect.java
  14. 78
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/IcExportItemListFormDTO.java
  15. 58
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/IcExportTemplateSaveFormDTO.java
  16. 20
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/OptionResultDTO.java
  17. 1
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/DictTypeEnum.java
  18. 10
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/CommonAggFeignClient.java
  19. 6
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/fallback/CommonAggFeignClientFallback.java
  20. 183
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/processor/MaskProcessor.java
  21. 389
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/AuthCodeUtil.java
  22. 2
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/poi/excel/EasyPoiExcelExportStylerImpl.java
  23. 96
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/poi/excel/handler/ColumnWidthStyleStrategy.java
  24. 121
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/poi/excel/handler/ExcelFillCellMergeStrategy.java
  25. 2
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/poi/excel/handler/FreezeAndFilter.java
  26. 19
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/validator/group/ExportGroup.java
  27. 7
      epmet-gateway/pom.xml
  28. 2
      epmet-module/data-aggregator/data-aggregator-server/pom.xml
  29. 4
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java
  30. 1
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govproject/impl/GovProjectServiceImpl.java
  31. 2
      epmet-module/data-report/data-report-server/pom.xml
  32. 2
      epmet-module/data-statistical/data-statistical-server/pom.xml
  33. 2
      epmet-module/epmet-common-service/common-service-server/pom.xml
  34. 2
      epmet-module/epmet-ext/epmet-ext-server/pom.xml
  35. 4
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetHeartOpenFeignClient.java
  36. 6
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/fallback/EpmetHeartOpenFeignClientFallback.java
  37. 2
      epmet-module/epmet-heart/epmet-heart-server/pom.xml
  38. 6
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/VolunteerInfoServiceImpl.java
  39. 2
      epmet-module/epmet-job/epmet-job-server/pom.xml
  40. 2
      epmet-module/epmet-message/epmet-message-server/pom.xml
  41. 2
      epmet-module/epmet-oss/epmet-oss-server/pom.xml
  42. 2
      epmet-module/epmet-point/epmet-point-server/pom.xml
  43. 6
      epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/BlockChainProcessProjectFormDTO.java
  44. 2
      epmet-module/epmet-third/epmet-third-server/pom.xml
  45. 9
      epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/BlockChainProjectServiceImpl.java
  46. 2
      epmet-module/gov-access/gov-access-server/pom.xml
  47. 2
      epmet-module/gov-grid/gov-grid-server/pom.xml
  48. 2
      epmet-module/gov-issue/gov-issue-server/pom.xml
  49. 2
      epmet-module/gov-mine/gov-mine-server/pom.xml
  50. 13
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcBuildingDTO.java
  51. 20
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcHouseDTO.java
  52. 21
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/ImportGeneralDTO.java
  53. 29
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/HouseChartFormDTO.java
  54. 5
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcBuildingListFormDTO.java
  55. 14
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcBulidingAddFormDTO.java
  56. 4
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcHouseAddFormDTO.java
  57. 4
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcHouseListFormDTO.java
  58. 32
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/UpdateSortFormDTO.java
  59. 57
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/HouseChartResultDTO.java
  60. 1
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/HouseListResultDTO.java
  61. 21
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/IcBuildingListResultDTO.java
  62. 2
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/IcHouseListResultDTO.java
  63. 74
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/SubUserHouseListResultDTO.java
  64. 2
      epmet-module/gov-org/gov-org-server/pom.xml
  65. 2
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/aspect/RequestLogAspect.java
  66. 1
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/constant/ImportErrorMsgConstants.java
  67. 49
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java
  68. 1
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcNeighborHoodController.java
  69. 16
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcBuildingDao.java
  70. 10
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcHouseDao.java
  71. 28
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcNeighborHoodDao.java
  72. 14
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcBuildingEntity.java
  73. 6
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcHouseEntity.java
  74. 6
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcBuildingExcel.java
  75. 11
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/BuildingInfoModel.java
  76. 5
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/HouseInfoModel.java
  77. 26
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/ImportBuildingInfoListener.java
  78. 17
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/ImportHouseInfoListener.java
  79. 53
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/ImportNeighborHoodInfoListener.java
  80. 25
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/HouseService.java
  81. 9
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcBuildingService.java
  82. 17
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcNeighborHoodService.java
  83. 12
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/BuildingServiceImpl.java
  84. 199
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java
  85. 13
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcBuildingServiceImpl.java
  86. 42
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcHouseServiceImpl.java
  87. 81
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcNeighborHoodServiceImpl.java
  88. 2
      epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.17__edit_building_and_house.sql
  89. 3
      epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.18__edit_building_and_house_sort.sql
  90. BIN
      epmet-module/gov-org/gov-org-server/src/main/resources/excel/building_export.xlsx
  91. BIN
      epmet-module/gov-org/gov-org-server/src/main/resources/excel/building_template.xlsx
  92. BIN
      epmet-module/gov-org/gov-org-server/src/main/resources/excel/house_template.xlsx
  93. 18
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml
  94. 36
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcBuildingDao.xml
  95. 48
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml
  96. 73
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcNeighborHoodDao.xml
  97. 2
      epmet-module/gov-project/gov-project-server/pom.xml
  98. 5
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/BlockChainUploadServiceImpl.java
  99. 4
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java
  100. 2
      epmet-module/gov-voice/gov-voice-server/pom.xml

2
epmet-admin/epmet-admin-server/pom.xml

@ -2,7 +2,7 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<version>0.3.32</version>
<version>0.3.35</version>
<parent>
<groupId>com.epmet</groupId>
<artifactId>epmet-admin</artifactId>

9
epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.15__add_item_typequery.sql

@ -0,0 +1,9 @@
INSERT INTO `epmet_admin`.`sys_dict_type` (`id`, `dict_type`, `dict_name`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1518396655261097986', 'item_type_query', '居民信息组件查询方式', '', 18, 0, 0, '1', '2022-04-25 09:09:08', '1', '2022-04-25 09:09:45');
INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1518420223504064513', 1518396655261097986, 'equal', 'cascader', '0', '级联组件', 8, 0, 0, '1', '2022-04-25 10:42:47', '1', '2022-04-25 10:42:47');
INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1518398370672713730', 1518396655261097986, 'list_equal', 'checkbox', '0', '多选框', 6, 0, 0, '1', '2022-04-25 09:15:57', '1', '2022-04-25 09:15:57');
INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1518397686728531969', 1518396655261097986, 'daterange', 'datepicker', '0', '日期', 3, 0, 0, '1', '2022-04-25 09:13:14', '1', '2022-04-25 09:13:14');
INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1518398756393492482', 1518396655261097986, 'daterange', 'daterange', '0', '时间范围组件eg:参战时间', 7, 0, 0, '1', '2022-04-25 09:17:29', '1', '2022-04-25 09:17:29');
INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1518397589986910209', 1518396655261097986, 'like', 'input', '0', '文本输入框', 2, 0, 0, '1', '2022-04-25 09:12:51', '1', '2022-04-25 09:12:51');
INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1518398274627346434', 1518396655261097986, 'equal', 'radio', '0', '单选框', 5, 0, 0, '1', '2022-04-25 09:15:34', '1', '2022-04-25 09:15:34');
INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1518397514623655938', 1518396655261097986, 'equal', 'select', '0', '下拉框', 1, 0, 0, '1', '2022-04-25 09:12:33', '1', '2022-04-25 09:12:33');
INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1518397787941281794', 1518396655261097986, 'like', 'textarea', '0', '文本域', 4, 0, 0, '1', '2022-04-25 09:13:38', '1', '2022-04-25 09:13:38');

7
epmet-auth-client/pom.xml

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

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

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

2
epmet-auth/pom.xml

@ -2,7 +2,7 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<version>0.3.98</version>
<version>0.3.100</version>
<parent>
<groupId>com.epmet</groupId>
<artifactId>epmet-cloud</artifactId>

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

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

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

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

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

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

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

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

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

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

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

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

44
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/annotation/MaskResponse.java

@ -0,0 +1,44 @@
package com.epmet.commons.tools.annotation;
import com.epmet.commons.tools.enums.RequirePermissionEnum;
import javassist.runtime.Inner;
import java.lang.annotation.*;
import java.util.function.Function;
/**
* 标记一个接口它的返回值中的某些字段需要打掩码
*/
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface MaskResponse {
/**
* 掩码类型
*/
String MASK_TYPE_ID_CARD = "ID_CARD";
String MASK_TYPE_MOBILE = "MOBILE";
///**
// * 默认的一些字段,如果没有手动指定,就会使用默认的。如果手动指定了,就不再使用默认的
// */
//String[] defaultFieldnames = {"idCard","mobile","phone"};
//
///**
// * 默认字段对应的掩码类型
// */
//String[] defaultFieldsMaskType = { MASK_TYPE_ID_CARD, MASK_TYPE_MOBILE, MASK_TYPE_MOBILE };
/**
* 要打码的字段列表会递归的着这些字段
* @return
*/
String[] fieldNames() default {"idCard","mobile","phone"};
/**
* 要打码的类型
* @return
*/
String[] fieldsMaskType() default { MASK_TYPE_ID_CARD, MASK_TYPE_MOBILE, MASK_TYPE_MOBILE };
}

36
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aspect/MaskResponseAspect.java

@ -0,0 +1,36 @@
package com.epmet.commons.tools.aspect;
import com.epmet.commons.tools.annotation.MaskResponse;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.processor.MaskProcessor;
import com.epmet.commons.tools.utils.Result;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.AfterReturning;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.reflect.MethodSignature;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
@Aspect
@Component
@Order(0)
public class MaskResponseAspect {
@AfterReturning(pointcut = "@annotation(com.epmet.commons.tools.annotation.MaskResponse)", returning = "result")
public Object proceed(JoinPoint point, Result result) throws Throwable {
MethodSignature signature = (MethodSignature) point.getSignature();
MaskResponse maskResponseAnno = signature.getMethod().getAnnotation(MaskResponse.class);
String[] fieldNames = maskResponseAnno.fieldNames();
String[] fieldsMaskType = maskResponseAnno.fieldsMaskType();
if (fieldNames.length != fieldsMaskType.length) {
String msg = "掩码配置错误";
throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), msg, msg);
}
new MaskProcessor(fieldNames, fieldsMaskType).mask(result);
return null;
}
}

78
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/IcExportItemListFormDTO.java

@ -0,0 +1,78 @@
package com.epmet.commons.tools.dto.form;
import com.epmet.commons.tools.validator.group.AddGroup;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import java.io.Serializable;
import java.util.List;
/**
* 自定义表单导出模板
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-04-21
*/
@Data
public class IcExportItemListFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
@NotEmpty(message = "请至少添加一个导出项")
private List<IcExportItemListFormDTO> children;
/**
* 父id
*/
private String pid;
/**
* ic_form_item.id
*/
@NotBlank(message = "itemId不能为空",groups = AddGroup.class)
private String itemId;
/**
* 表头宽度
*/
private Integer width;
/**
* 项标签
*/
@NotBlank(message = "名称不能为空",groups = AddGroup.class)
private String label;
/**
* 排序
*/
private Integer sort;
/**
* 表名
*/
private String tableName;
/**
* 列名
*/
private String columnName;
/**
* item选项
*/
private String optionSourceValue;
/**
* item选项 值获取方式
*/
private String optionSourceType;
/**
* 是否支持添加即多对一eg需求列表
*/
private boolean supportAdd;
}

58
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/IcExportTemplateSaveFormDTO.java

@ -0,0 +1,58 @@
package com.epmet.commons.tools.dto.form;
import com.epmet.commons.tools.validator.group.AddGroup;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import java.io.Serializable;
import java.util.List;
/**
* 自定义表单导出模板
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-04-21
*/
@Data
public class IcExportTemplateSaveFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 是否保存为模板 :true :false
*/
private Boolean isSaveTemp = false;
/**
* 表单CODE从字典获取
*/
@NotBlank(message = "表单CODE不能为空",groups = AddGroup.class)
private String formCode;
/**
* 模板名称
*/
@Length(max = 20, message = "模板名称最多为20个字", groups = { AddGroup.class })
private String name;
/**
* 0:动态1:文件
*/
private Integer type;
/**
* 排序
*/
private Integer sort;
/**
* 父id
*/
@NotEmpty(message = "请至少添加一个导出项")
private List<IcExportItemListFormDTO> itemList;
}

20
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/OptionResultDTO.java

@ -1,9 +1,11 @@
package com.epmet.commons.tools.dto.result;
import lombok.Data;
import org.apache.commons.collections4.CollectionUtils;
import java.io.Serializable;
import java.util.List;
import java.util.Map;
/**
* @Description
@ -21,4 +23,22 @@ public class OptionResultDTO implements Serializable {
private List<OptionResultDTO> children;
private Boolean usableFlag;
private String type;
/**
* desc:递归获取当前节点的 所有子节点
*
* @param option
* @param resultMap
*/
public void getCurrenNodeAllChild(OptionResultDTO option, Map<String, OptionResultDTO> resultMap) {
resultMap.put(option.getValue(), option);
if (CollectionUtils.isEmpty(option.getChildren())) {
return;
}
option.getChildren().forEach(o -> {
resultMap.put(o.getValue(), o);
getCurrenNodeAllChild(o, resultMap);
});
}
}

1
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/DictTypeEnum.java

@ -22,6 +22,7 @@ public enum DictTypeEnum {
AGE_GROUP("age_group", "年龄范围", 11),
PATROL_WORK_TYPE("patrol_work_type", "例行工作分类", 13),
GRID_TYPE("grid_type", "网格类型", 12),
ITEM_TYPE_QUERY("item_type_query","居民信息组件查询方式",14),
;
private final String code;

10
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/CommonAggFeignClient.java

@ -5,7 +5,6 @@ import com.epmet.commons.tools.feign.fallback.CommonAggFeignClientFallBackFactor
import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache;
import com.epmet.commons.tools.redis.common.bean.BuildingInfoCache;
import com.epmet.commons.tools.redis.common.bean.CustomerStaffInfoCache;
import com.epmet.commons.tools.redis.common.bean.GridInfoCache;
import com.epmet.commons.tools.utils.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
@ -39,15 +38,6 @@ public interface CommonAggFeignClient {
@PostMapping("/data/aggregator/org/agency")
Result<AgencyInfoCache> getAgencyInfo(@RequestParam("agencyId")String agencyId);
/**
* @Description 查询网格信息
* @param gridId
* @author zxc
* @date 2021/11/5 2:54 下午
*/
@PostMapping("/data/aggregator/org/grid")
Result<GridInfoCache> getGridInfo(@RequestParam("gridId")String gridId);
/**
* 查询楼栋信息
* @param buildingId

6
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/fallback/CommonAggFeignClientFallback.java

@ -5,7 +5,6 @@ import com.epmet.commons.tools.feign.CommonAggFeignClient;
import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache;
import com.epmet.commons.tools.redis.common.bean.BuildingInfoCache;
import com.epmet.commons.tools.redis.common.bean.CustomerStaffInfoCache;
import com.epmet.commons.tools.redis.common.bean.GridInfoCache;
import com.epmet.commons.tools.utils.ModuleUtils;
import com.epmet.commons.tools.utils.Result;
import org.springframework.stereotype.Component;
@ -29,11 +28,6 @@ public class CommonAggFeignClientFallback implements CommonAggFeignClient {
return ModuleUtils.feignConError(ServiceConstant.DATA_AGGREGATOR_SERVER, "getAgencyInfo", agencyId);
}
@Override
public Result<GridInfoCache> getGridInfo(String gridId) {
return ModuleUtils.feignConError(ServiceConstant.DATA_AGGREGATOR_SERVER, "getGridInfo", gridId);
}
/**
* 查询楼栋信息
*

183
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/processor/MaskProcessor.java

@ -0,0 +1,183 @@
package com.epmet.commons.tools.processor;
import cn.hutool.core.util.StrUtil;
import com.epmet.commons.tools.annotation.MaskResponse;
import com.epmet.commons.tools.exception.ExceptionUtils;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.Result;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.util.CollectionUtils;
import java.lang.reflect.Field;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.regex.Pattern;
@Slf4j
public class MaskProcessor {
public static final String EPMET_PACKAGE_PREFIX = "com.epmet";
private List<String> fieldNames;
private List<String> fieldsMaskType;
public MaskProcessor(String[] fields, String[] fieldsMaskType) {
if (fields != null && fields.length > 0) {
this.fieldNames = Arrays.asList(fields);
this.fieldsMaskType = Arrays.asList(fieldsMaskType);
}
}
/**
* 为dto中的属性打掩码
* @param object
*/
public void mask(Object object) {
if (object == null) {
return;
}
if (object instanceof Result) {
mask(((Result<?>) object).getData());
return;
} else if (object instanceof PageData) {
mask(((PageData<?>) object).getList());
return;
} else if (object instanceof List) {
((List)object).forEach(e -> mask(e));
return;
} else if (object instanceof Map) {
maskMap((Map) object);
return;
} else if (object.getClass().getName().startsWith(EPMET_PACKAGE_PREFIX)) {
// 自定义bean,走反射
maskEpmetBean(object);
return;
}
}
/**
* 为map打码只打value中的码
* - 如果value是epmet的dto那么去反射它
* - 如果value是字符串那么直接给他打码
* - 如果value是其他类型跳过
* @param map
*/
private void maskMap(Map<Object, Object> map) {
if (CollectionUtils.isEmpty(map)) {
return;
}
for (Map.Entry<Object, Object> entry : map.entrySet()) {
Object value = entry.getValue();
Object key = entry.getKey();
if (value != null && value.getClass().getName().startsWith(EPMET_PACKAGE_PREFIX)) {
// 是epmet的对象
maskEpmetBean(value);
continue;
} else if (value instanceof String) {
int index = fieldNames.indexOf(key);
if (index != -1) {
String maskResult = maskString((String) value, fieldsMaskType.get(index));
entry.setValue(maskResult);
}
continue;
}
}
}
/**
* 反射
* @param object
*/
private void maskEpmetBean(Object object) {
Field[] declaredFields = object.getClass().getDeclaredFields();
for (Field currentField : declaredFields) {
currentField.setAccessible(true);
try {
String fieldName = currentField.getName();
Object value = currentField.get(object);
// 是epmet的类,继续下钻
if (currentField.getClass().getName().startsWith(EPMET_PACKAGE_PREFIX)) {
maskEpmetBean(value);
continue;
}
// 是字符串
String fieldValue;
if (value instanceof String && StringUtils.isNotBlank(fieldValue = (String) value)) {
int fieldIndexInAnnoAttrs = fieldNames.indexOf(fieldName);
if (fieldIndexInAnnoAttrs != -1) {
String product = maskString(fieldValue, fieldsMaskType.get(fieldIndexInAnnoAttrs));
currentField.set(object, product);
}
continue;
}
// 非字符串,非epmet类的其他类型
mask(value);
} catch (IllegalAccessException e) {
log.error("【mask一些字段报错】{}", ExceptionUtils.getErrorStackTrace(e));
}
}
}
/**
* 把字符串变更为掩码
* @param originString
* @return
*/
public String maskString(String originString, String maskType) {
if (MaskResponse.MASK_TYPE_ID_CARD.equals(maskType)) {
return maskIdCard(originString);
} else if (MaskResponse.MASK_TYPE_MOBILE.equals(maskType)) {
return maskMobile(originString);
} else {
return originString;
}
}
/**
* 将明文字符串打码变为掩码保留前6后面打码
* @param originString
* @return
*/
private String maskIdCard(String originString) {
// 仅将6位之后的全都打码
int length = originString.length();
if (length <= 6) {
return originString;
}
String maskStr = StrUtil.repeatByLength("*", length - 6);
return originString.replaceAll("^(\\d{6})[a-zA-Z0-9]*$", new StringBuilder("$1").append(maskStr).toString());
}
/**
* 将明文字符串打码变为掩码保留前3后4中间打码
* 187****3461
* @param originString
* @return
*/
private String maskMobile(String originString) {
int length = originString.length();
if (length <= 7) {
return originString;
}
String maskStr = StrUtil.repeatByLength("*", length - 7);
return originString.replaceAll("^(1\\d{2})\\d*(\\d{4})$", new StringBuilder("$1").append(maskStr).append("$2").toString());
}
public static void main(String[] args) {
String[] idc = {"idCard"};
String[] idct = {MaskResponse.MASK_TYPE_ID_CARD};
String r = new MaskProcessor(idc, idct).maskString("333333333333333333", MaskResponse.MASK_TYPE_ID_CARD);
System.out.println(r);
}
}

389
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/AuthCodeUtil.java

@ -0,0 +1,389 @@
package com.epmet.commons.tools.utils;
import lombok.extern.slf4j.Slf4j;
import java.io.*;
import java.nio.charset.StandardCharsets;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.*;
/**
* desc: 市北大数据局的工具
*
* @return
* @author LiuJanJun
* @date 2022/4/22 5:19 下午
*/
@Slf4j
public class AuthCodeUtil {
public enum DiscuzAuthcodeMode {
Encode, Decode
}
/**
* <summary>
* 从字符串的指定位置截取指定长度的子字符串￿
* </summary>
* <param name="str">原字符串</param>
* <param name="startIndex">子字符串的起始位置</param>
* <param name="length">子字符串的长度</param>
* <returns>子字符串</returns>
*/
public static String CutString(String str, int startIndex, int length) {
if (startIndex >= 0) {
if (length < 0) {
length = length * -1;
if (startIndex - length < 0) {
length = startIndex;
startIndex = 0;
} else {
startIndex = startIndex - length;
}
}
if (startIndex > str.length()) {
return "";
}
} else {
if (length < 0) {
return "";
} else {
if (length + startIndex > 0) {
length = length + startIndex;
startIndex = 0;
} else {
return "";
}
}
}
if (str.length() - startIndex < length) {
length = str.length() - startIndex;
}
return str.substring(startIndex, startIndex + length);
}
/**
* <summary>
* 从字符串的指定位置开始截取到字符串结尾的了符串
* </summary>
* <param name="str">原字符串</param>
* <param name="startIndex">子字符串的起始位置</param>
* <returns>子字符串</returns>
*/
public static String CutString(String str, int startIndex) {
return CutString(str, startIndex, str.length());
}
/**
* <summary>
* 返回文件是否存在
* </summary>
* <param name="filename">文件名</param>
* <returns>是否存在</returns>
*/
public static boolean FileExists(String filename) {
File f = new File(filename);
return f.exists();
}
/**
* <summary>
* MD5函数
* </summary>
* <param name="str">原始字符串</param>
* <returns>MD5结果</returns>
*/
public static String MD5(String str) {
StringBuffer sb = new StringBuffer();
String part = null;
try {
MessageDigest md = MessageDigest.getInstance("MD5");
byte[] md5 = md.digest(str.getBytes());
for (int i = 0; i < md5.length; i++) {
part = Integer.toHexString(md5[i] & 0xFF);
if (part.length() == 1) {
part = "0" + part;
}
sb.append(part);
}
} catch (NoSuchAlgorithmException ex) {
}
return sb.toString();
}
/**
* <summary>
* 字段串是否为Null或为""()
* </summary>
* <param name="str"></param>
* <returns></returns>
*/
public static boolean StrIsNullOrEmpty(String str) {
// if NET1
if (str == null || str.trim().equals("")) {
return true;
}
return false;
}
/**
* <summary>
* 用于 RC4 处理密码
* </summary>
* <param name="pass">密码字串</param>
* <param name="kLen">密钥长度一般为 256</param>
* <returns></returns>
*/
static private byte[] GetKey(byte[] pass, int kLen) {
byte[] mBox = new byte[kLen];
for (int i = 0; i < kLen; i++) {
mBox[i] = (byte) i;
}
int j = 0;
for (int i = 0; i < kLen; i++) {
j = (j + (int) ((mBox[i] + 256) % 256) + pass[i % pass.length])
% kLen;
byte temp = mBox[i];
mBox[i] = mBox[j];
mBox[j] = temp;
}
return mBox;
}
/**
* <summary>
* 生成随机字符
* </summary>
* <param name="lens">随机字符长度</param>
* <returns>随机字符</returns>
*/
public static String RandomString(int lens) {
char[] CharArray = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'j', 'k',
'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w',
'x', 'y', 'z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'};
int clens = CharArray.length;
String sCode = "";
Random random = new Random();
for (int i = 0; i < lens; i++) {
sCode += CharArray[Math.abs(random.nextInt(clens))];
}
return sCode;
}
/**
* <summary>
* 使用 Discuz authcode 方法对字符串加密
* </summary>
* <param name="source">原始字符串</param>
* <param name="key">密钥</param>
* <param name="expiry">加密字串有效时间单位是秒</param>
* <returns>加密结果</returns>
*/
public static String authcodeEncode(String source, String key, int expiry) {
return authcode(source, key, DiscuzAuthcodeMode.Encode, expiry);
}
/**
* <summary>
* 使用 Discuz authcode 方法对字符串加密
* </summary>
* <param name="source">原始字符串</param>
* <param name="key">密钥</param>
* <returns>加密结果</returns>
*/
public static String authcodeEncode(String source, String key) {
return authcode(source, key, DiscuzAuthcodeMode.Encode, 0);
}
/**
* <summary>
* 使用 Discuz authcode 方法对字符串解密
* </summary>
* <param name="source">原始字符串</param>
* <param name="key">密钥</param>
* <returns>解密结果</returns>
*/
public static String authcodeDecode(String source, String key) {
return authcode(source, key, DiscuzAuthcodeMode.Decode, 0);
}
/**
* <summary>
* 使用 变形的 rc4 编码方法对字符串进行加密或者解密
* </summary>
* <param name="source">原始字符串</param>
* <param name="key">密钥</param>
* <param name="operation">操作 加密还是解密</param>
* <param name="expiry">加密字串过期时间</param>
* <returns>加密或者解密后的字符串</returns>
*/
private static String authcode(String source, String key,
DiscuzAuthcodeMode operation, int expiry) {
try {
if (source == null || key == null) {
return "";
}
int ckey_length = 4;
String keya, keyb, keyc, cryptkey, result;
key = MD5(key);
keya = MD5(CutString(key, 0, 16));
keyb = MD5(CutString(key, 16, 16));
keyc = ckey_length > 0 ? (operation == DiscuzAuthcodeMode.Decode ? CutString(
source, 0, ckey_length) : RandomString(ckey_length))
: "";
cryptkey = keya + MD5(keya + keyc);
if (operation == DiscuzAuthcodeMode.Decode) {
byte[] temp;
temp = Base64.getDecoder().decode(CutString(source, ckey_length));
result = new String(RC4(temp, cryptkey));
if (CutString(result, 10, 16).equals(
CutString(MD5(CutString(result, 26) + keyb), 0, 16))) {
return CutString(result, 26);
} else {
temp = Base64.getDecoder().decode(CutString(source + "=", ckey_length));
result = new String(RC4(temp, cryptkey));
if (CutString(result, 10, 16)
.equals(CutString(
MD5(CutString(result, 26) + keyb), 0, 16))) {
return CutString(result, 26);
} else {
temp = Base64.getDecoder().decode(CutString(source + "==",
ckey_length));
result = new String(RC4(temp, cryptkey));
if (CutString(result, 10, 16).equals(
CutString(MD5(CutString(result, 26) + keyb), 0,
16))) {
return CutString(result, 26);
} else {
return "2";
}
}
}
} else {
source = "0000000000" + CutString(MD5(source + keyb), 0, 16)
+ source;
byte[] temp = RC4(source.getBytes("GBK"), cryptkey);
return keyc + Base64.getEncoder().encode(temp);
}
} catch (Exception e) {
return "";
}
}
/**
* <summary>
* RC4 原始算法
* </summary>
* <param name="input">原始字串数组</param>
* <param name="pass">密钥</param>
* <returns>处理后的字串数组</returns>
*/
private static byte[] RC4(byte[] input, String pass) {
if (input == null || pass == null)
return null;
byte[] output = new byte[input.length];
byte[] mBox = GetKey(pass.getBytes(), 256);
// 加密
int i = 0;
int j = 0;
for (int offset = 0; offset < input.length; offset++) {
i = (i + 1) % mBox.length;
j = (j + (int) ((mBox[i] + 256) % 256)) % mBox.length;
byte temp = mBox[i];
mBox[i] = mBox[j];
mBox[j] = temp;
byte a = input[offset];
// byte b = mBox[(mBox[i] + mBox[j] % mBox.Length) % mBox.Length];
// mBox[j] 一定比 mBox.Length 小,不需要在取模
byte b = mBox[(toInt(mBox[i]) + toInt(mBox[j])) % mBox.length];
output[offset] = (byte) ((int) a ^ (int) toInt(b));
}
return output;
}
public static int toInt(byte b) {
return (int) ((b + 256) % 256);
}
public long getUnixTimestamp() {
Calendar cal = Calendar.getInstance();
return cal.getTimeInMillis() / 1000;
}
public static void main(String[] args) throws IOException {
getStr();
//readFile02("/Users/liujianjun/Downloads/abc.txt");
}
/**
* 读取一个文本 一行一行读取
*
* @param path
* @return
* @throws IOException
*/
private static void readFile02(String path) throws IOException {
// 使用一个字符串集合来存储文本中的路径 ,也可用String []数组
List<String> list = new ArrayList<String>();
FileInputStream fis = new FileInputStream(path);
// 防止路径乱码 如果utf-8 乱码 改GBK eclipse里创建的txt 用UTF-8,在电脑上自己创建的txt 用GBK
InputStreamReader isr = new InputStreamReader(fis, StandardCharsets.UTF_8);
BufferedReader br = new BufferedReader(isr);
String line = "";
String result = null;
while ((line = br.readLine()) != null) {
String key = "TvFwHe6tGA";
result = AuthCodeUtil.authcodeDecode(line, key);
System.out.println(result);
}
br.close();
isr.close();
fis.close();
System.out.println("==========end");
}
private static void getStr(){
String tel = "4fb1lYySlVqMUaf/LnlBEM1nDZgCKnX+Q52azUGgSLCV0hioBvLFFZoJS1Vu";
tel = "a1孙1增勤";
String result = AuthCodeUtil.authcodeDecode(tel, "TvFwHe6tGA");
System.out.println(result);
}
}

2
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/poi/excel/EasyPoiExcelExportStylerImpl.java

@ -50,7 +50,7 @@ public class EasyPoiExcelExportStylerImpl extends AbstractExcelExportStyler
titleStyle.setFont(font);
titleStyle.setAlignment(HorizontalAlignment.CENTER);
titleStyle.setVerticalAlignment(VerticalAlignment.CENTER);
return null;
return titleStyle;
}
/**

96
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/poi/excel/handler/ColumnWidthStyleStrategy.java

@ -0,0 +1,96 @@
package com.epmet.commons.tools.utils.poi.excel.handler;
/**
* desc:设置columnWith宽度
*
* @author: LiuJanJun
* @date: 2022/4/28 5:05 下午
* @version: 1.0
*/
import com.alibaba.excel.enums.CellDataTypeEnum;
import com.alibaba.excel.metadata.Head;
import com.alibaba.excel.metadata.data.WriteCellData;
import com.alibaba.excel.util.MapUtils;
import com.alibaba.excel.write.metadata.holder.WriteSheetHolder;
import com.alibaba.excel.write.style.column.AbstractColumnWidthStyleStrategy;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.poi.ss.usermodel.Cell;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* Take the width of the longest column as the width.
* <p>
* This is not very useful at the moment, for example if you have Numbers it will cause a newline.And the length is not
* exactly the same as the actual length.
*
* @author Jiaju Zhuang
*/
public class ColumnWidthStyleStrategy extends AbstractColumnWidthStyleStrategy {
private static final int MAX_COLUMN_WIDTH = 255;
/**
* 是否 根据内容设置宽度
*/
private boolean isSetContentWidth = false;
private final Map<Integer, Map<Integer, Integer>> cache = MapUtils.newHashMapWithExpectedSize(8);
@Override
protected void setColumnWidth(WriteSheetHolder writeSheetHolder, List<WriteCellData<?>> cellDataList, Cell cell,
Head head,
Integer relativeRowIndex, Boolean isHead) {
boolean needSetWidth = (isHead || isSetContentWidth) && CollectionUtils.isNotEmpty(cellDataList);
if (!needSetWidth) {
return;
}
Map<Integer, Integer> maxColumnWidthMap = cache.computeIfAbsent(writeSheetHolder.getSheetNo(), k -> new HashMap<>(16));
Integer columnWidth = dataLength(cellDataList, cell, isHead);
if (columnWidth < 0) {
return;
}
if (columnWidth > MAX_COLUMN_WIDTH) {
columnWidth = MAX_COLUMN_WIDTH;
}
Integer maxColumnWidth = maxColumnWidthMap.get(cell.getColumnIndex());
if (maxColumnWidth == null || columnWidth > maxColumnWidth) {
maxColumnWidthMap.put(cell.getColumnIndex(), columnWidth);
writeSheetHolder.getSheet().setColumnWidth(cell.getColumnIndex(), columnWidth * 256);
}
}
private Integer dataLength(List<WriteCellData<?>> cellDataList, Cell cell, Boolean isHead) {
if (isHead) {
return cell.getStringCellValue().getBytes().length+3;
}
WriteCellData<?> cellData = cellDataList.get(0);
CellDataTypeEnum type = cellData.getType();
if (type == null) {
return -1;
}
switch (type) {
case STRING:
return cellData.getStringValue().getBytes().length;
case BOOLEAN:
return cellData.getBooleanValue().toString().getBytes().length;
case NUMBER:
return cellData.getNumberValue().toString().getBytes().length;
default:
return -1;
}
}
public ColumnWidthStyleStrategy() {
}
public ColumnWidthStyleStrategy(boolean isSetContentWidth) {
this.isSetContentWidth = isSetContentWidth;
}
}

121
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/poi/excel/handler/ExcelFillCellMergeStrategy.java

@ -0,0 +1,121 @@
package com.epmet.commons.tools.utils.poi.excel.handler;
import com.alibaba.excel.metadata.Head;
import com.alibaba.excel.metadata.data.WriteCellData;
import com.alibaba.excel.write.handler.CellWriteHandler;
import com.alibaba.excel.write.metadata.holder.WriteSheetHolder;
import com.alibaba.excel.write.metadata.holder.WriteTableHolder;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.CellType;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.util.CellRangeAddress;
import java.util.List;
/**
* desc:单元格合并策略
*
* @author liujianjun
*/
public class ExcelFillCellMergeStrategy implements CellWriteHandler {
/**
* 需要合并的列 下标
*/
private int[] mergeColumnIndexArr;
/**
* 从下标n行开始合并
*/
private int mergeRowIndex;
public ExcelFillCellMergeStrategy() {
}
public ExcelFillCellMergeStrategy(int mergeRowIndex, int[] mergeColumnIndexArr) {
this.mergeRowIndex = mergeRowIndex;
this.mergeColumnIndexArr = mergeColumnIndexArr;
}
@Override
public void beforeCellCreate(WriteSheetHolder writeSheetHolder, WriteTableHolder writeTableHolder, Row row, Head head, Integer columnIndex, Integer relativeRowIndex, Boolean isHead) {
}
@Override
public void afterCellCreate(WriteSheetHolder writeSheetHolder, WriteTableHolder writeTableHolder, Cell cell, Head head, Integer relativeRowIndex, Boolean isHead) {
// 隐藏id列
writeSheetHolder.getSheet().setColumnHidden(0, true);
}
@Override
public void afterCellDispose(WriteSheetHolder writeSheetHolder, WriteTableHolder writeTableHolder, List<WriteCellData<?>> list, Cell cell, Head head, Integer integer, Boolean aBoolean) {
int curRowIndex = cell.getRowIndex();
int curColIndex = cell.getColumnIndex();
if (curRowIndex <= mergeRowIndex) {
return;
}
//如果不指定 合并的列则全部列进行 合并判断
if (mergeColumnIndexArr == null) {
mergeWithPrevRow(writeSheetHolder, cell, curRowIndex, curColIndex);
} else {
//合并指定的列号
for (int columnIndex : mergeColumnIndexArr) {
if (curColIndex == columnIndex) {
mergeWithPrevRow(writeSheetHolder, cell, curRowIndex, curColIndex);
}
}
}
}
/**
* 当前单元格向上合并
*
* @param writeSheetHolder
* @param cell 当前单元格
* @param curRowIndex 当前行
* @param curColIndex 当前列
*/
private void mergeWithPrevRow(WriteSheetHolder writeSheetHolder, Cell cell, int curRowIndex, int curColIndex) {
// 当前行的第一个Cell
Cell curFirstCell = cell.getSheet().getRow(curRowIndex).getCell(0);
Object curFirstData = curFirstCell.getCellType() == CellType.STRING ? curFirstCell.getStringCellValue() : curFirstCell.getNumericCellValue();
// 上一行的第一个Cell
Cell preFirstCell = cell.getSheet().getRow(curRowIndex - 1).getCell(0);
Object preFirstData = preFirstCell.getCellType() == CellType.STRING ? preFirstCell.getStringCellValue() : preFirstCell.getNumericCellValue();
if (curFirstData.equals(preFirstData)) {
Object curData = cell.getCellType() == CellType.STRING ? cell.getStringCellValue() : cell.getNumericCellValue();
Cell preCell = cell.getSheet().getRow(curRowIndex - 1).getCell(curColIndex);
Object preData = preCell.getCellType() == CellType.STRING ? preCell.getStringCellValue() : preCell.getNumericCellValue();
// 将当前单元格数据与上一个单元格数据比较
Boolean dataBool = preData.equals(curData);
//此处需要注意:因为我是按照序号确定是否需要合并的,所以获取每一行第一列数据和上一行第一列数据进行比较,如果相等合并
Boolean bool = cell.getRow().getCell(0).getStringCellValue().equals(cell.getSheet().getRow(curRowIndex - 1).getCell(0).getStringCellValue());
if (!dataBool || !bool) {
return;
}
Sheet sheet = writeSheetHolder.getSheet();
List<CellRangeAddress> mergeRegions = sheet.getMergedRegions();
boolean isMerged = false;
for (int i = 0; i < mergeRegions.size() && !isMerged; i++) {
CellRangeAddress cellRangeAddr = mergeRegions.get(i);
// 若上一个单元格已经被合并,则先移出原有的合并单元,再重新添加合并单元
if (cellRangeAddr.isInRange(curRowIndex - 1, curColIndex)) {
sheet.removeMergedRegion(i);
cellRangeAddr.setLastRow(curRowIndex);
sheet.addMergedRegion(cellRangeAddr);
isMerged = true;
}
}
// 若上一个单元格未被合并,则新增合并单元
if (!isMerged) {
CellRangeAddress cellRangeAddress = new CellRangeAddress(curRowIndex - 1, curRowIndex, curColIndex, curColIndex);
sheet.addMergedRegion(cellRangeAddress);
}
}
}
}

2
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/poi/excel/FreezeAndFilter.java → epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/poi/excel/handler/FreezeAndFilter.java

@ -1,4 +1,4 @@
package com.epmet.commons.tools.utils.poi.excel;
package com.epmet.commons.tools.utils.poi.excel.handler;
/**
* desc:easyExcel 冻结标题

19
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/validator/group/ExportGroup.java

@ -0,0 +1,19 @@
/**
* Copyright (c) 2018 人人开源 All rights reserved.
*
* https://www.renren.io
*
* 版权所有侵权必究
*/
package com.epmet.commons.tools.validator.group;
/**
* 导出 Group
*
* @author Mark sunlightcs@gmail.com
* @since 1.0.0
*/
public interface ExportGroup {
}

7
epmet-gateway/pom.xml

@ -2,7 +2,7 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<version>0.3.71</version>
<version>0.3.76</version>
<parent>
<groupId>com.epmet</groupId>
<artifactId>epmet-cloud</artifactId>
@ -233,6 +233,8 @@
<!--问卷服务-->
<gateway.routes.tduck-api.url>lb://tduck-api</gateway.routes.tduck-api.url>
<!--<gateway.routes.tduck-api.url>http://localhost:8116</gateway.routes.tduck-api.url>-->
<!-- 插件:数字底座动力主轴 -->
<gateway.routes.plugin.power-base-server.url>lb://pli-power-base-server</gateway.routes.plugin.power-base-server.url>
<!--钉钉 机器人地址-->
<dingTalk.robot.webHook>https://oapi.dingtalk.com/robot/send?access_token=e894e5690f9d6a527722974c71548ff6c0fe29bd956589a09e21b16442a35ed4</dingTalk.robot.webHook>
<dingTalk.robot.secret>SECfcc020bdc83bb17a2c00f39977b1fbc409ef4188c7beaea11c5caa90eeaf87fd</dingTalk.robot.secret>
@ -287,6 +289,7 @@
<gateway.routes.epmet-demo-server.uri>lb://epmet-demo-server</gateway.routes.epmet-demo-server.uri>
<!-- 10、运营端客户定制化服务 -->
<gateway.routes.oper-customize-server.uri>lb://oper-customize-server</gateway.routes.oper-customize-server.uri>
<!-- <gateway.routes.oper-customize-server.uri>http://localhost:8089</gateway.routes.oper-customize-server.uri>-->
<!-- 11、运营端客户定制化服务 -->
<gateway.routes.oper-crm-server.uri>lb://oper-crm-server</gateway.routes.oper-crm-server.uri>
<!--<gateway.routes.oper-crm-server.uri>http://localhost:8090</gateway.routes.oper-crm-server.uri>-->
@ -371,6 +374,8 @@
<!--宣传服务-->
<gateway.routes.epmet-openapi-adv-server.url>lb://epmet-openapi-adv-server</gateway.routes.epmet-openapi-adv-server.url>
<!--<gateway.routes.epmet-openapi-adv-server.url>http://localhost:8115</gateway.routes.epmet-openapi-adv-server.url>-->
<!-- 插件:数字底座动力主轴 -->
<gateway.routes.plugin.power-base-server.url>lb://pli-power-base-server</gateway.routes.plugin.power-base-server.url>
<!--问卷服务-->
<gateway.routes.tduck-api.url>lb://tduck-api</gateway.routes.tduck-api.url>
<!--<gateway.routes.tduck-api.url>http://localhost:8116</gateway.routes.tduck-api.url>-->

2
epmet-module/data-aggregator/data-aggregator-server/pom.xml

@ -2,7 +2,7 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<version>0.3.92</version>
<version>0.3.122</version>
<parent>
<artifactId>data-aggregator</artifactId>
<groupId>com.epmet</groupId>

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

@ -98,10 +98,10 @@ public class GovOrgServiceImpl implements GovOrgService {
@Autowired
private OssFeignClient ossFeignClient;
@Autowired
private EvaluationIndexService evaluationIndexService;
@Autowired
private IcBuildingDao icBuildingDao;
@Autowired
private EvaluationIndexService evaluationIndexService;
@Autowired
private RedisUtils redisUtils;
@Autowired
private ExecutorService executorService;

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

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

2
epmet-module/data-report/data-report-server/pom.xml

@ -3,7 +3,7 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<version>0.3.210</version>
<version>0.3.214</version>
<artifactId>data-report-server</artifactId>
<parent>

2
epmet-module/data-statistical/data-statistical-server/pom.xml

@ -2,7 +2,7 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<version>0.3.345</version>
<version>0.3.382</version>
<parent>
<artifactId>data-statistical</artifactId>
<groupId>com.epmet</groupId>

2
epmet-module/epmet-common-service/common-service-server/pom.xml

@ -2,7 +2,7 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<version>0.3.42</version>
<version>0.3.46</version>
<parent>
<groupId>com.epmet</groupId>
<artifactId>epmet-common-service</artifactId>

2
epmet-module/epmet-ext/epmet-ext-server/pom.xml

@ -2,7 +2,7 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<version>0.0.20</version>
<version>0.0.21</version>
<parent>
<groupId>com.epmet</groupId>

4
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetHeartOpenFeignClient.java

@ -1,6 +1,7 @@
package com.epmet.feign;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.dto.result.OptionResultDTO;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.ActInfoDTO;
import com.epmet.dto.VolunteerInfoDTO;
@ -103,4 +104,7 @@ public interface EpmetHeartOpenFeignClient {
*/
@GetMapping("/heart/serviceitem/initCustomer/{customerId}")
Result customerInit(@PathVariable(value = "customerId") String customerId);
@PostMapping("/heart/icresidemanddict/demandoption")
Result<List<OptionResultDTO>> getDemandOptions();
}

6
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/fallback/EpmetHeartOpenFeignClientFallback.java

@ -1,6 +1,7 @@
package com.epmet.feign.fallback;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.dto.result.OptionResultDTO;
import com.epmet.commons.tools.utils.ModuleUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.ActInfoDTO;
@ -102,4 +103,9 @@ public class EpmetHeartOpenFeignClientFallback implements EpmetHeartOpenFeignCli
public Result customerInit(String customerId) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_HEART_SERVER, "customerInit", customerId);
}
@Override
public Result<List<OptionResultDTO>> getDemandOptions() {
return ModuleUtils.feignConError(ServiceConstant.EPMET_HEART_SERVER, "getDemandOptions", null);
}
}

2
epmet-module/epmet-heart/epmet-heart-server/pom.xml

@ -2,7 +2,7 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<version>0.0.72</version>
<version>0.0.81</version>
<parent>
<groupId>com.epmet</groupId>
<artifactId>epmet-heart</artifactId>

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

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

2
epmet-module/epmet-job/epmet-job-server/pom.xml

@ -2,7 +2,7 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<version>0.3.47</version>
<version>0.3.54</version>
<parent>
<groupId>com.epmet</groupId>
<artifactId>epmet-job</artifactId>

2
epmet-module/epmet-message/epmet-message-server/pom.xml

@ -2,7 +2,7 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<version>0.3.57</version>
<version>0.3.58</version>
<parent>
<groupId>com.epmet</groupId>
<artifactId>epmet-message</artifactId>

2
epmet-module/epmet-oss/epmet-oss-server/pom.xml

@ -2,7 +2,7 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<version>0.3.40</version>
<version>0.3.42</version>
<parent>
<groupId>com.epmet</groupId>
<artifactId>epmet-oss</artifactId>

2
epmet-module/epmet-point/epmet-point-server/pom.xml

@ -3,7 +3,7 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<version>0.0.63</version>
<version>0.0.64</version>
<parent>
<artifactId>epmet-point</artifactId>
<groupId>com.epmet</groupId>

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

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

2
epmet-module/epmet-third/epmet-third-server/pom.xml

@ -2,7 +2,7 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<version>0.0.183</version>
<version>0.0.185</version>
<parent>
<groupId>com.epmet</groupId>

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

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

2
epmet-module/gov-access/gov-access-server/pom.xml

@ -2,7 +2,7 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<version>0.3.61</version>
<version>0.3.66</version>
<parent>
<artifactId>gov-access</artifactId>
<groupId>com.epmet</groupId>

2
epmet-module/gov-grid/gov-grid-server/pom.xml

@ -3,7 +3,7 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<version>0.3.49</version>
<version>0.3.50</version>
<parent>
<groupId>com.epmet</groupId>
<artifactId>gov-grid</artifactId>

2
epmet-module/gov-issue/gov-issue-server/pom.xml

@ -2,7 +2,7 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<version>0.3.100</version>
<version>0.3.104</version>
<parent>
<artifactId>gov-issue</artifactId>
<groupId>com.epmet</groupId>

2
epmet-module/gov-mine/gov-mine-server/pom.xml

@ -2,7 +2,7 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<version>0.3.47</version>
<version>0.3.48</version>
<parent>
<groupId>com.epmet</groupId>
<artifactId>gov-mine</artifactId>

13
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcBuildingDTO.java

@ -20,6 +20,7 @@ package com.epmet.dto;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
@ -68,7 +69,7 @@ public class IcBuildingDTO implements Serializable {
/**
* 排序
*/
private Integer sort;
private BigDecimal sort;
/**
* 总单元数
@ -85,6 +86,16 @@ public class IcBuildingDTO implements Serializable {
*/
private Integer totalHouseNum;
/**
* 楼长姓名
*/
private String buildingLeaderName;
/**
* 楼长电话
*/
private String buildingLeaderMobile;
/**
* 中心点位经度
*/

20
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcHouseDTO.java

@ -17,9 +17,11 @@
package com.epmet.dto;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import lombok.Data;
/**
@ -47,6 +49,7 @@ public class IcHouseDTO implements Serializable {
* 小区id
*/
private String neighborHoodId;
private String neighborHoodName;
/**
* 片区idneighbor_hood_part.id,可为空
@ -57,12 +60,12 @@ public class IcHouseDTO implements Serializable {
* 所属楼栋id
*/
private String buildingId;
private String buildingName;
/**
* 所属单元id
*/
private String buildingUnitId;
private String unitName;
/**
* 房屋名字后台插入时生成
*/
@ -77,17 +80,17 @@ public class IcHouseDTO implements Serializable {
* 房屋类型这里存储字典value就可以
*/
private String houseType;
private String houseTypeName;
/**
* 存储字典value
*/
private String purpose;
private String purposeName;
/**
* 1出租0未出租
*/
private Integer rentFlag;
private String rentName;
/**
* 房主姓名
*/
@ -103,6 +106,11 @@ public class IcHouseDTO implements Serializable {
*/
private String ownerIdCard;
/**
* 排序
*/
private BigDecimal sort;
/**
* 删除标识 0未删除1已删除
*/

21
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/ImportGeneralDTO.java

@ -4,6 +4,7 @@ import com.epmet.commons.tools.constant.NumConstant;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* @Author zxc
@ -45,6 +46,16 @@ public class ImportGeneralDTO implements Serializable {
private String buildingName;
private String buildingId;
/**
* 楼长姓名
*/
private String buildingLeaderName;
/**
* 楼长电话
*/
private String buildingLeaderMobile;
/**
* 房屋类型
*/
@ -148,8 +159,18 @@ public class ImportGeneralDTO implements Serializable {
*/
private Boolean buildingExistStatus = false;
/**
* 楼栋单元数小于当前值时为true
*/
private Boolean buildingUnitNumStatus = false;
/**
* 小区重复状态
*/
private Boolean neighborHoodExistStatus = false;
/**
* 排序
*/
private BigDecimal sort;
}

29
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/HouseChartFormDTO.java

@ -0,0 +1,29 @@
package com.epmet.dto.form;
import lombok.Data;
import java.io.Serializable;
/**
* @author sun
* @dscription 人房房屋总数饼图-接口入参
*/
@Data
public class HouseChartFormDTO implements Serializable {
private static final long serialVersionUID = 405799151478155056L;
/**
* 组织网格小区Id
*/
private String orgId;
/**
* 组织网格小区类型 agency grid village
*/
private String orgType;
//token这信息
private String customerId;
private String userId;
}

5
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcBuildingListFormDTO.java

@ -26,4 +26,9 @@ public class IcBuildingListFormDTO extends PageFormDTO {
* 房主电话
*/
private String ownerPhone;
/**
* asc正序desc倒序
*/
private String sortType;
}

14
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcBulidingAddFormDTO.java

@ -17,6 +17,7 @@
package com.epmet.dto.form;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
@ -24,6 +25,7 @@ import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
@Data
@ -85,7 +87,7 @@ public class IcBulidingAddFormDTO implements Serializable {
* 排序
*/
@NotNull(message = "排序不能为空", groups = {AddShowGroup.class, UpdateShowGroup.class})
private Integer sort = 0;
private BigDecimal sort = NumConstant.ZERO_DECIMAL;
/**
* 总单元数
@ -123,6 +125,16 @@ public class IcBulidingAddFormDTO implements Serializable {
private String latitude;
/**
* 楼长姓名
*/
private String buildingLeaderName;
/**
* 楼长电话
*/
private String buildingLeaderMobile;

4
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcHouseAddFormDTO.java

@ -17,12 +17,14 @@
package com.epmet.dto.form;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
@Data
@ -99,4 +101,6 @@ public class IcHouseAddFormDTO implements Serializable {
*/
private String ownerIdCard;
private BigDecimal sort = NumConstant.ZERO_DECIMAL;
}

4
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcHouseListFormDTO.java

@ -65,5 +65,9 @@ public class IcHouseListFormDTO extends PageFormDTO {
*/
private String keyword;
/**
* asc正序desc倒序
*/
private String sortType;
}

32
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/UpdateSortFormDTO.java

@ -0,0 +1,32 @@
package com.epmet.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* @Author zxc
* @DateTime 2022/5/5 17:40
* @DESC
*/
@Data
public class UpdateSortFormDTO implements Serializable {
private static final long serialVersionUID = 2348273552712227952L;
public interface UpdateSortForm{}
@NotBlank(message = "id不能为空",groups = UpdateSortForm.class)
private String id;
@NotNull(message = "sort不能为空",groups = UpdateSortForm.class)
private BigDecimal sort;
/**
* house房屋building楼栋
*/
@NotBlank(message = "type不能为空",groups = UpdateSortForm.class)
private String type;
}

57
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/HouseChartResultDTO.java

@ -0,0 +1,57 @@
package com.epmet.dto.result;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import java.io.Serializable;
/**
* @author sun
* @dscription 人房房屋总数饼图-接口返参
*/
@Data
public class HouseChartResultDTO implements Serializable {
/**
* 组织网格小区Id
*/
private String orgId;
/**
* 组织网格小区类型 agency grid village
*/
private String orgType;
/**
* 房屋总数
*/
private Integer houseTotal = 0;
/**
* 房屋自住总数
*/
private Integer zzHouseTotal = 0;
/**
* 房屋自住总数占比保留两位小数带百分号的
*/
private Double zzHouseRatio = 0.0;
/**
* 房屋常住总数
*/
private Integer czHouseTotal = 0;
/**
* 房屋常住总数占比保留两位小数带百分号的
*/
private Double czHouseRatio = 0.0;
/**
* 房屋闲置总数
*/
private Integer xzHouseTotal = 0;
/**
* 房屋闲置总数占比保留两位小数带百分号的
*/
private Double xzHouseRatio = 0.0;
@JsonIgnore
private Integer num;
//1:出租 0:自住 2:闲置
@JsonIgnore
private Integer rentFlag;
}

1
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/HouseListResultDTO.java

@ -18,6 +18,7 @@ public class HouseListResultDTO implements Serializable {
private static final long serialVersionUID = 2063032844842070847L;
private String houseId;
private String houseName;
private String rentFlag;
private List<CategoryListBean> categoryList;
@NoArgsConstructor

21
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/IcBuildingListResultDTO.java

@ -17,10 +17,19 @@ public class IcBuildingListResultDTO extends PageFormDTO {
private static final long serialVersionUID = -8277921228438123299L;
private String gridName;
/**
* 设计的房屋总数就是这个楼上实际有几个
*/
private Integer totalHouseNum;
/**
* 实际录入房屋总数
*/
private Integer realTotalHouseNum;
private String latitude;
private String agencyId;
private Integer sort;
private Double sort;
private String agencyName;
private String buildingId;
private String buildingName;
@ -32,4 +41,14 @@ public class IcBuildingListResultDTO extends PageFormDTO {
private Integer totalUnitNum;
private String longitude;
private String buildingType;
/**
* 楼长姓名
*/
private String buildingLeaderName;
/**
* 楼长电话
*/
private String buildingLeaderMobile;
}

2
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/IcHouseListResultDTO.java

@ -79,7 +79,7 @@ public class IcHouseListResultDTO implements Serializable {
*/
private String ownerIdCard;
private Double sort;
}

74
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/SubUserHouseListResultDTO.java

@ -0,0 +1,74 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* @author sun
* @dscription 人房下级人房概览列表-接口返参
*/
@Data
public class SubUserHouseListResultDTO implements Serializable {
/**
* 组织网格小区Id
*/
private String orgId;
/**
* 组织网格小区名称
*/
private String orgName;
/**
* 组织网格小区类型 agency grid village
*/
private String orgType;
/**
* 房屋总数
*/
private Integer houseTotal = 0;
/**
* 房屋自住总数
*/
private Integer zzHouseTotal = 0;
/**
* 房屋自住总数占比保留两位小数带百分号的
*/
private Double zzHouseRatio = 0.0;
/**
* 房屋常住总数
*/
private Integer czHouseTotal = 0;
/**
* 房屋常住总数占比保留两位小数带百分号的
*/
private Double czHouseRatio = 0.0;
/**
* 房屋闲置总数
*/
private Integer xzHouseTotal = 0;
/**
* 房屋闲置总数占比保留两位小数带百分号的
*/
private Double xzHouseRatio = 0.0;
/**
* 居民总数
*/
private Integer userTotal = 0;
/**
* 常住人口总数
*/
private Integer czUserTotal = 0;
/**
* 常住人口占比保留两位小数带百分号的
*/
private Double czUserRatio = 0.0;
/**
* 流动人口总数
*/
private Integer ldUserTotal = 0;
/**
* 流动人口占比保留两位小数带百分号的
*/
private Double ldUserRatio = 0.0;
}

2
epmet-module/gov-org/gov-org-server/pom.xml

@ -2,7 +2,7 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<version>0.3.156</version>
<version>0.3.186</version>
<parent>
<groupId>com.epmet</groupId>
<artifactId>gov-org</artifactId>

2
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/aspect/RequestLogAspect.java

@ -17,7 +17,7 @@ import javax.servlet.http.HttpServletRequest;
*/
@Aspect
@Component
@Order(0)
@Order(1)
public class RequestLogAspect extends BaseRequestLogAspect {
@Override

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

@ -8,6 +8,7 @@ package com.epmet.constant;
public interface ImportErrorMsgConstants {
String EXIST_ERROR = "数据已存在";
String UNIT_ERROR = "暂不支持单元数减小";
String DOCUMENT_EXIST_ERROR = "文件中存在重复数据";

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

@ -19,6 +19,7 @@ package com.epmet.controller;
import cn.afterturn.easypoi.excel.entity.TemplateExportParams;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.annotation.MaskResponse;
import com.epmet.commons.tools.aop.NoRepeatSubmit;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.ServiceConstant;
@ -31,10 +32,7 @@ import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.constants.ImportTaskConstants;
import com.epmet.dto.form.*;
import com.epmet.dto.result.HouseInfoDTO;
import com.epmet.dto.result.IcHouseListResultDTO;
import com.epmet.dto.result.ImportTaskCommonResultDTO;
import com.epmet.dto.result.LoginUserDetailsResultDTO;
import com.epmet.dto.result.*;
import com.epmet.feign.EpmetCommonServiceOpenFeignClient;
import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.service.HouseService;
@ -47,7 +45,10 @@ import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.io.InputStream;
import java.util.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Set;
/**
@ -69,8 +70,9 @@ public class HouseController implements ResultDataResolver {
@Autowired
private EpmetCommonServiceOpenFeignClient epmetCommonServiceOpenFeignClient;
@PostMapping("houselist")
@MaskResponse(fieldNames = {"ownerIdCard", "ownerPhone"},
fieldsMaskType = { MaskResponse.MASK_TYPE_ID_CARD, MaskResponse.MASK_TYPE_MOBILE })
public Result<PageData<IcHouseListResultDTO>> houseList(@LoginUser TokenDto loginUser, @RequestBody IcHouseListFormDTO formDTO) {
//效验数据
LoginUserDetailsResultDTO loginUserDetail = getLoginUserDetailsResultDTO(loginUser, "【查询房屋】查询当前staff所在组织信息失败");
@ -269,4 +271,39 @@ public class HouseController implements ResultDataResolver {
}
return new Result<HouseInfoDTO>().ok(houseService.getHouseInfoDTO(tokenDto.getCustomerId(), houseId));
}
/**
* @Author sun
* @Description 人房房屋总数饼图
**/
@PostMapping("housechart")
public Result<HouseChartResultDTO> houseChart(@LoginUser TokenDto tokenDto, @RequestBody HouseChartFormDTO formDTO) {
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setUserId(tokenDto.getUserId());
return new Result<HouseChartResultDTO>().ok(houseService.houseChart(formDTO));
}
/**
* @Author sun
* @Description 人房下级人房概览列表
**/
@PostMapping("subuserhouselist")
public Result<List<SubUserHouseListResultDTO>> subUserHouseList(@LoginUser TokenDto tokenDto, @RequestBody HouseChartFormDTO formDTO) {
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setUserId(tokenDto.getUserId());
return new Result<List<SubUserHouseListResultDTO>>().ok(houseService.subUserHouseList(formDTO));
}
/**
* Desc: 根据类型更新排序
* @param formDTO
* @author zxc
* @date 2022/5/6 08:50
*/
@PostMapping("update-sort")
public Result updateSort(@RequestBody UpdateSortFormDTO formDTO){
houseService.updateSort(formDTO);
return new Result();
}
}

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

@ -45,6 +45,7 @@ import com.epmet.service.IcNeighborHoodService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

16
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcBuildingDao.java

@ -180,4 +180,20 @@ public interface IcBuildingDao extends BaseDao<IcBuildingEntity> {
*/
void allUpdateHouseNum(@Param("nums") List<UpdateBuildingHouseNumResultDTO> nums);
/**
* Desc: 更新楼栋信息
* @param info
* @author zxc
* @date 2022/4/27 13:29
*/
void updateBuilding(ImportGeneralDTO info);
/**
* Desc: 查询楼栋下单元数
* @param buildingId
* @author zxc
* @date 2022/4/27 14:41
*/
Integer selectUnitCount(@Param("buildingId")String buildingId);
}

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

@ -3,10 +3,7 @@ package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.ImportGeneralDTO;
import com.epmet.dto.form.IcHouseListFormDTO;
import com.epmet.dto.result.HouseInfoDTO;
import com.epmet.dto.result.HousesNameResultDTO;
import com.epmet.dto.result.IcHouseListResultDTO;
import com.epmet.dto.result.NeighborHoodManageDelResultDTO;
import com.epmet.dto.result.*;
import com.epmet.entity.IcHouseEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -91,4 +88,9 @@ public interface IcHouseDao extends BaseDao<IcHouseEntity> {
*/
void houseUpdateHouseName(@Param("buildingId")String buildingId);
/**
* @Author sun
* @Description 人房房屋总数饼图
**/
List<HouseChartResultDTO> houseChart(@Param("orgId") String orgId, @Param("orgType") String orgType);
}

28
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcNeighborHoodDao.java

@ -18,6 +18,9 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.ImportGeneralDTO;
import com.epmet.dto.NeighborHoodAndManagementDTO;
import com.epmet.dto.IcNeighborHoodDTO;
import com.epmet.dto.form.IcNeighborHoodListFormDTO;
import com.epmet.dto.result.IcNeighborHoodResultDTO;
import com.epmet.entity.IcHouseEntity;
@ -59,4 +62,29 @@ public interface IcNeighborHoodDao extends BaseDao<IcNeighborHoodEntity> {
*/
List<String> selectNeighborhoodNameByNames(@Param("names")List<String> names,@Param("customerId") String customerId);
/**
* Desc: 更新小区详细地址和备注
* @param needUpdateList
* @author zxc
* @date 2022/4/27 09:59
*/
void updateNeighborHood(@Param("list") List<ImportGeneralDTO> needUpdateList);
/**
* Desc: 更新小区关系表
* @param updateNeighborHoodAndManagement
* @author zxc
* @date 2022/4/27 10:33
*/
void neighborHoodPropertyUpdate(@Param("list")List<NeighborHoodAndManagementDTO> updateNeighborHoodAndManagement);
List<IcNeighborHoodDTO> selectNeighborList(@Param("gridId")String gridId);
/**
* Desc: 删除物业关系
* @param neighborHoodIds
* @author zxc
* @date 2022/4/28 09:10
*/
void delProperty(@Param("neighborHoodIds")List<String> neighborHoodIds);
}

14
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcBuildingEntity.java

@ -22,6 +22,8 @@ import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.math.BigDecimal;
/**
* 楼栋信息
*
@ -63,7 +65,7 @@ public class IcBuildingEntity extends BaseEpmetEntity {
/**
* 排序
*/
private Integer sort;
private BigDecimal sort;
/**
* 总单元数
@ -80,6 +82,16 @@ public class IcBuildingEntity extends BaseEpmetEntity {
*/
private Integer totalHouseNum;
/**
* 楼长姓名
*/
private String buildingLeaderName;
/**
* 楼长电话
*/
private String buildingLeaderMobile;
/**
* 中心点位经度
*/

6
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcHouseEntity.java

@ -23,6 +23,7 @@ import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.math.BigDecimal;
import java.util.Date;
/**
@ -103,4 +104,9 @@ public class IcHouseEntity extends BaseEpmetEntity {
*/
private String ownerIdCard;
/**
* 排序
*/
private BigDecimal sort;
}

6
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcBuildingExcel.java

@ -124,4 +124,10 @@ public class IcBuildingExcel extends ExcelVerifyInfo implements Serializable {
@Excel(name = "户数")
@NotNull(message = "不能为空")
private Integer totalHouseNum;
@Excel(name = "楼长姓名")
private String buildingLeaderName;
@Excel(name = "楼长电话")
private String buildingLeaderMobile;
}

11
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/BuildingInfoModel.java

@ -4,6 +4,8 @@ import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import lombok.Data;
import java.math.BigDecimal;
/**
* @Author zxc
* @DateTime 2022/2/15 10:07 上午
@ -36,6 +38,15 @@ public class BuildingInfoModel {
@ExcelProperty(value = "户数")
private Integer totalHouseNum;
@ExcelProperty(value = "楼长姓名")
private String buildingLeaderName;
@ExcelProperty(value = "楼长电话")
private String buildingLeaderMobile;
@ExcelProperty(value = "排序")
private BigDecimal sort;
@ExcelIgnore
private Integer num;

5
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/HouseInfoModel.java

@ -5,6 +5,8 @@ import com.alibaba.excel.annotation.ExcelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import java.math.BigDecimal;
/**
* @Author zxc
* @DateTime 2022/2/13 1:26 下午
@ -50,6 +52,9 @@ public class HouseInfoModel {
@ExcelProperty(value = "房主身份证")
private String ownerIdCard;
@ExcelProperty(value = "排序")
private BigDecimal sort;
@ExcelIgnore
private Integer num;

26
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/ImportBuildingInfoListener.java

@ -24,6 +24,8 @@ import org.apache.commons.lang3.StringUtils;
import org.springframework.util.CollectionUtils;
import java.io.IOException;
import java.math.BigDecimal;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@ -117,6 +119,11 @@ public class ImportBuildingInfoListener extends AnalysisEventListener<BuildingIn
disposeErrorMsg(info,"单元数的值未填写");
return;
}
if (null == data.getSort()){
data.setSort(NumConstant.ZERO_DECIMAL);
}else {
data.setSort(getBigDecimal(data.getSort()));
}
// 应产品要求添加
if (StringUtils.isNotBlank(dto.getType()) && (!dto.getType().equals("商品房") && !dto.getType().equals("自建房")) && !dto.getType().equals("别墅")){
nums.add(num);
@ -137,6 +144,13 @@ public class ImportBuildingInfoListener extends AnalysisEventListener<BuildingIn
}
}
public BigDecimal getBigDecimal(BigDecimal d){
if (null == d){
return NumConstant.ZERO_DECIMAL;
}
return d.setScale(NumConstant.TWO,BigDecimal.ROUND_HALF_UP);
}
public void finalDispose(){
if (CollectionUtils.isEmpty(needDisposeList)){
return;
@ -165,14 +179,16 @@ public class ImportBuildingInfoListener extends AnalysisEventListener<BuildingIn
List<ImportGeneralDTO> importGeneralDTOS = groupByStatus.get(false);
if (!CollectionUtils.isEmpty(importGeneralDTOS)){
List<ImportGeneralDTO> importInfo = neighborHoodService.getImportInfo(formDTO, importGeneralDTOS);
Map<Boolean, List<ImportGeneralDTO>> groupByBuildingExistStatus = importInfo.stream().collect(Collectors.groupingBy(ImportGeneralDTO::getBuildingExistStatus));
List<ImportGeneralDTO> existList = groupByBuildingExistStatus.get(true);
if (!CollectionUtils.isEmpty(existList)){
existList.forEach(e -> {
/*Map<Boolean, List<ImportGeneralDTO>> groupByBuildingExistStatus = importInfo.stream().collect(Collectors.groupingBy(ImportGeneralDTO::getBuildingExistStatus));
List<ImportGeneralDTO> existList = groupByBuildingExistStatus.get(true);*/
Map<Boolean, List<ImportGeneralDTO>> collect = importInfo.stream().collect(Collectors.groupingBy(ImportGeneralDTO::getBuildingUnitNumStatus));
List<ImportGeneralDTO> unitNumList = collect.get(true);
if (!CollectionUtils.isEmpty(unitNumList)){
unitNumList.forEach(e -> {
if (!e.getAddStatus()){
nums.add(e.getNum());
BuildingInfoModel buildingInfoModel = ConvertUtils.sourceToTarget(e, BuildingInfoModel.class);
disposeErrorMsg(buildingInfoModel,ImportErrorMsgConstants.EXIST_ERROR);
disposeErrorMsg(buildingInfoModel,ImportErrorMsgConstants.UNIT_ERROR);
e.setAddStatus(true);
}
});

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

@ -30,10 +30,14 @@ import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import java.io.IOException;
import java.math.BigDecimal;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
import static com.epmet.constant.ImportErrorMsgConstants.*;
@ -170,7 +174,11 @@ public class ImportHouseInfoListener extends AnalysisEventListener<HouseInfoMode
}
}
dto.setHouseType(HouseTypeEnums.getKeyByValue(dto.getHouseType()));
if (null == data.getSort()){
data.setSort(NumConstant.ZERO_DECIMAL);
}else {
data.setSort(getBigDecimal(data.getSort()));
}
if (StringUtils.isNotBlank(dto.getPurpose()) && (!dto.getPurpose().equals("住宅") &&
!dto.getPurpose().equals("商业") &&
!dto.getPurpose().equals("办公") &&
@ -205,6 +213,13 @@ public class ImportHouseInfoListener extends AnalysisEventListener<HouseInfoMode
}
}
public BigDecimal getBigDecimal(BigDecimal d){
if (null == d){
return NumConstant.ZERO_DECIMAL;
}
return d.setScale(NumConstant.TWO,BigDecimal.ROUND_HALF_UP);
}
public void disposeErrorMsg(HouseInfoModel data,String msg){
HouseErrorInfoModel err = ConvertUtils.sourceToTarget(data, HouseErrorInfoModel.class);
err.setErrorMsg(msg);

53
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/ImportNeighborHoodInfoListener.java

@ -51,6 +51,7 @@ public class ImportNeighborHoodInfoListener extends AnalysisEventListener<Neighb
List<ImportGeneralDTO> needDisposeList = new ArrayList<>();
List<ImportGeneralDTO> needInsertList = new ArrayList<>();
List<ImportGeneralDTO> needUpdateList = new ArrayList<>();
String gridName = null;
String agencyName = null;
@ -128,7 +129,7 @@ public class ImportNeighborHoodInfoListener extends AnalysisEventListener<Neighb
}
public void finalDispose(){
if (CollectionUtils.isEmpty(needDisposeList)){
if (CollectionUtils.isEmpty(needDisposeList) && CollectionUtils.isEmpty(needUpdateList)){
return;
}
Map<String, Long> groupByAllName = needDisposeList.stream().collect(Collectors.groupingBy(
@ -151,8 +152,11 @@ public class ImportNeighborHoodInfoListener extends AnalysisEventListener<Neighb
});
Map<Boolean, List<ImportGeneralDTO>> groupByStatus = needDisposeList.stream().collect(Collectors.groupingBy(ImportGeneralDTO::getExistStatus));
List<ImportGeneralDTO> importGeneralDTOS = groupByStatus.get(false);
if (!CollectionUtils.isEmpty(importGeneralDTOS)){
List<ImportGeneralDTO> importInfo = neighborHoodService.getImportInfo(formDTO, importGeneralDTOS);
if (!CollectionUtils.isEmpty(importGeneralDTOS) || !CollectionUtils.isEmpty(needUpdateList)){
List<ImportGeneralDTO> importInfo = new ArrayList<>();
if (!CollectionUtils.isEmpty(importGeneralDTOS)){
importInfo = neighborHoodService.getImportInfo(formDTO, importGeneralDTOS);
}
Map<Boolean, List<ImportGeneralDTO>> groupByBuildingExistStatus = importInfo.stream().collect(Collectors.groupingBy(ImportGeneralDTO::getNeighborHoodExistStatus));
List<ImportGeneralDTO> existList = groupByBuildingExistStatus.get(true);
if (!CollectionUtils.isEmpty(existList)){
@ -165,7 +169,16 @@ public class ImportNeighborHoodInfoListener extends AnalysisEventListener<Neighb
}
});
}
List<ImportGeneralDTO> notExistList = groupByBuildingExistStatus.get(false);
List<ImportGeneralDTO> notExistList = new ArrayList<>();
List<ImportGeneralDTO> notExistListFalse = groupByBuildingExistStatus.get(false);
if (!CollectionUtils.isEmpty(notExistListFalse)){
notExistList.addAll(notExistListFalse);
}
if (!CollectionUtils.isEmpty(needUpdateList)){
notExistList.addAll(needUpdateList);
// 更新详细地址和备注
neighborHoodService.updateNeighborHood(needUpdateList);
}
if (!CollectionUtils.isEmpty(notExistList)){
// 物业表插入
List<String> propertyNames = notExistList.stream().filter(n -> StringUtils.isNotBlank(n.getPropertyName())).map(m -> m.getPropertyName()).distinct().collect(Collectors.toList());
@ -184,15 +197,26 @@ public class ImportNeighborHoodInfoListener extends AnalysisEventListener<Neighb
neighborHoodService.insertPropertyManagement(propertyManagementEntities);
// 小区物业关系表插入
List<NeighborHoodAndManagementDTO> neighborHoodAndManagementDTOS = ConvertUtils.sourceToTarget(notExistList, NeighborHoodAndManagementDTO.class);
List<NeighborHoodAndManagementDTO> neighborHoodAndManagementDTOS = ConvertUtils.sourceToTarget(notExistListFalse, NeighborHoodAndManagementDTO.class);
List<NeighborHoodAndManagementDTO> updateNeighborHoodAndManagement = ConvertUtils.sourceToTarget(needUpdateList, NeighborHoodAndManagementDTO.class);
List<IcPropertyManagementEntity> propertyManagementInfos = propertyManagementDao.selectIdByName(propertyNames);
neighborHoodAndManagementDTOS.forEach(n -> propertyManagementInfos.stream().filter(p -> p.getName().equals(n.getPropertyName()))
.forEach(p -> {
n.setPropertyId(p.getId());
n.setNeighborHoodId(n.getNeighborHoodId());
}));
if (!CollectionUtils.isEmpty(neighborHoodAndManagementDTOS)){
neighborHoodAndManagementDTOS.forEach(n -> propertyManagementInfos.stream().filter(p -> p.getName().equals(n.getPropertyName()))
.forEach(p -> {
n.setPropertyId(p.getId());
n.setNeighborHoodId(n.getNeighborHoodId());
}));
}
if (!CollectionUtils.isEmpty(updateNeighborHoodAndManagement)){
updateNeighborHoodAndManagement.forEach(n -> propertyManagementInfos.stream().filter(p -> p.getName().equals(n.getPropertyName()))
.forEach(p -> {
n.setPropertyId(p.getId());
n.setNeighborHoodId(n.getNeighborHoodId());
}));
}
List<IcNeighborHoodPropertyEntity> icNeighborHoodPropertyEntities = ConvertUtils.sourceToTarget(neighborHoodAndManagementDTOS, IcNeighborHoodPropertyEntity.class);
neighborHoodService.neighborHoodPropertyInsert(icNeighborHoodPropertyEntities);
neighborHoodService.neighborHoodPropertyUpdate(updateNeighborHoodAndManagement);
}
}
}
@ -200,6 +224,7 @@ public class ImportNeighborHoodInfoListener extends AnalysisEventListener<Neighb
// 清除
needDisposeList = new ArrayList<>();
needInsertList = new ArrayList<>();
needUpdateList = new ArrayList<>();
gridName = null;
agencyName = null;
gridInfos = null;
@ -297,9 +322,13 @@ public class ImportNeighborHoodInfoListener extends AnalysisEventListener<Neighb
// 赋值小区ID
dto.setNeighborHoodId(null == cacheNeighBorHood ? "" : cacheNeighBorHood.toString());
if (StringUtils.isNotBlank(dto.getNeighborHoodId())){
/**
* 2022-04-27 新增需求存在小区进行更改 更新物业详细地址备注信息
*/
// 小区已存在
nums.add(dto.getNum());
disposeErrorMsg(info,ImportErrorMsgConstants.EXIST_ERROR);
/*nums.add(dto.getNum());
disposeErrorMsg(info,ImportErrorMsgConstants.EXIST_ERROR);*/
needUpdateList.add(dto);
}else {
needDisposeList.add(dto);
}

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

@ -20,9 +20,7 @@ package com.epmet.service;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.form.*;
import com.epmet.dto.result.HouseInfoDTO;
import com.epmet.dto.result.IcHouseListResultDTO;
import com.epmet.dto.result.ImportTaskCommonResultDTO;
import com.epmet.dto.result.*;
import javax.servlet.http.HttpServletResponse;
import java.io.InputStream;
@ -74,5 +72,26 @@ public interface HouseService {
*/
void allDelete(NeighborHoodManageDelFormDTO formDTO);
HouseInfoDTO getHouseInfoDTO(String customerId,String houseId);
/**
* @Author sun
* @Description 人房房屋总数饼图
**/
HouseChartResultDTO houseChart(HouseChartFormDTO formDTO);
/**
* @Author sun
* @Description 人房下级人房概览列表
**/
List<SubUserHouseListResultDTO> subUserHouseList(HouseChartFormDTO formDTO);
/**
* Desc: 根据类型更新排序
* @param formDTO
* @author zxc
* @date 2022/5/6 08:50
*/
void updateSort(UpdateSortFormDTO formDTO);
}

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

@ -21,6 +21,7 @@ import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.dto.result.OptionResultDTO;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.IcBuildingDTO;
import com.epmet.dto.ImportGeneralDTO;
import com.epmet.entity.IcBuildingEntity;
import java.util.List;
@ -113,4 +114,12 @@ public interface IcBuildingService extends BaseService<IcBuildingEntity> {
* @Date 2022/2/14 15:19
*/
IcBuildingDTO getBuildingInfo(String neighborHoodId, String buildingName);
/**
* Desc: 更新楼栋信息
* @param info
* @author zxc
* @date 2022/4/27 13:29
*/
void updateBuilding(ImportGeneralDTO info);
}

17
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcNeighborHoodService.java

@ -23,6 +23,7 @@ import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.IcNeighborHoodDTO;
import com.epmet.dto.ImportGeneralDTO;
import com.epmet.dto.NeighborHoodAndManagementDTO;
import com.epmet.dto.form.IcNeighborHoodAddFormDTO;
import com.epmet.dto.form.ImportInfoFormDTO;
import com.epmet.dto.result.ImportTaskCommonResultDTO;
@ -155,4 +156,20 @@ public interface IcNeighborHoodService extends BaseService<IcNeighborHoodEntity>
* @return
*/
PageData<IcNeighborHoodDTO> openPage(IcNeighborHoodAddFormDTO params);
/**
* Desc: 更新小区
* @param needUpdateList
* @author zxc
* @date 2022/4/27 09:59
*/
void updateNeighborHood(List<ImportGeneralDTO> needUpdateList);
/**
* Desc: 更新小区关系表
* @param updateNeighborHoodAndManagement
* @author zxc
* @date 2022/4/27 10:33
*/
void neighborHoodPropertyUpdate(List<NeighborHoodAndManagementDTO> updateNeighborHoodAndManagement);
}

12
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/BuildingServiceImpl.java

@ -157,7 +157,10 @@ public class BuildingServiceImpl implements BuildingService {
//2.获取组织所在网格
List<String> agencyIdList = customerAgencyList.stream().map(BaseEpmetEntity::getId).collect(Collectors.toList());
// agencyIdList.add(customerAgency.getId());
List<CustomerGridEntity> customerGridList = customerGridDao.selectList(new QueryWrapper<CustomerGridEntity>().lambda().in(CustomerGridEntity::getPid, agencyIdList));
LambdaQueryWrapper<CustomerGridEntity> gridWrapper = new LambdaQueryWrapper<>();
gridWrapper.in(CustomerGridEntity::getPid, agencyIdList);
gridWrapper.last("ORDER BY CAST(GRID_NAME AS SIGNED),CONVERT(GRID_NAME using gbk)");
List<CustomerGridEntity> customerGridList = customerGridDao.selectList(gridWrapper);
if (CollectionUtils.isEmpty(customerGridList)) {
return covertToTree(customerAgency, agencyList);
@ -182,7 +185,7 @@ public class BuildingServiceImpl implements BuildingService {
List<String> gridIdList = customerGridList.stream().map(BaseEpmetEntity::getId).collect(Collectors.toList());
LambdaQueryWrapper<IcNeighborHoodEntity> queryWrapper = new QueryWrapper<IcNeighborHoodEntity>().lambda()
.in(IcNeighborHoodEntity::getGridId, gridIdList)
.orderByAsc(IcNeighborHoodEntity::getCreatedTime);
.last("ORDER BY CAST(NEIGHBOR_HOOD_NAME AS SIGNED),CONVERT(NEIGHBOR_HOOD_NAME using gbk)");
List<IcNeighborHoodEntity> icNeighborHoodList = icNeighborHoodDao.selectList(queryWrapper);
if (CollectionUtils.isEmpty(icNeighborHoodList)) {
agencyList.addAll(gridList);
@ -206,7 +209,7 @@ public class BuildingServiceImpl implements BuildingService {
List<String> neighborHoodIdList = icNeighborHoodList.stream().map(BaseEpmetEntity::getId).collect(Collectors.toList());
LambdaQueryWrapper<IcBuildingEntity> buildingQueryWrapper = new QueryWrapper<IcBuildingEntity>().lambda()
.in(IcBuildingEntity::getNeighborHoodId, neighborHoodIdList)
.orderByAsc(IcBuildingEntity::getCreatedTime, IcBuildingEntity::getBuildingName);
.last("ORDER BY SORT, CAST(BUILDING_NAME AS SIGNED),CONVERT(BUILDING_NAME USING gbk)");
List<IcBuildingEntity> icBuildingList = icBuildingDao.selectList(buildingQueryWrapper);
if (CollectionUtils.isEmpty(neighborHoodIdList)) {
@ -430,14 +433,11 @@ public class BuildingServiceImpl implements BuildingService {
if (null != count && count > 0) {
throw new RenException(EpmetErrorCode.BUILDING_NAME_EXITED.getCode(), EpmetErrorCode.BUILDING_NAME_EXITED.getMsg());
}
IcBuildingDTO icBuilding = icBuildingService.get(formDTO.getBuildingId());
if (!icBuilding.getNeighborHoodId().equals(formDTO.getNeighborHoodId())) {
//更新对应房屋小区id
List<IcHouseEntity> icHouseEntities = icHouseDao.selectList(new QueryWrapper<IcHouseEntity>().lambda().eq(IcHouseEntity::getBuildingId, formDTO.getBuildingId()));
if (!CollectionUtils.isEmpty(icHouseEntities)) {
//
throw new RenException(EpmetErrorCode.ORG_EDIT_FAILED.getCode(), "楼栋单元下存在房屋,无法更新");
}
}

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

@ -6,6 +6,7 @@ import com.alibaba.excel.ExcelReader;
import com.alibaba.excel.read.metadata.ReadSheet;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.enums.OrgTypeEnum;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
@ -13,24 +14,16 @@ import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.feign.ResultDataResolver;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.redis.common.CustomerOrgRedis;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.constant.CustomerGridConstant;
import com.epmet.constants.ImportTaskConstants;
import com.epmet.dao.IcBuildingDao;
import com.epmet.dao.IcBuildingUnitDao;
import com.epmet.dao.IcHouseDao;
import com.epmet.dao.IcNeighborHoodDao;
import com.epmet.dto.CustomerAgencyDTO;
import com.epmet.dto.IcBuildingDTO;
import com.epmet.dto.IcBuildingUnitDTO;
import com.epmet.dto.IcHouseDTO;
import com.epmet.dao.*;
import com.epmet.dto.*;
import com.epmet.dto.form.*;
import com.epmet.dto.result.HouseInfoDTO;
import com.epmet.dto.result.IcHouseListResultDTO;
import com.epmet.dto.result.ImportTaskCommonResultDTO;
import com.epmet.dto.result.NeighborHoodManageDelResultDTO;
import com.epmet.dto.result.*;
import com.epmet.entity.IcHouseEntity;
import com.epmet.enums.HousePurposeEnums;
import com.epmet.enums.HouseTypeEnums;
@ -54,8 +47,10 @@ import org.springframework.util.CollectionUtils;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.io.InputStream;
import java.text.NumberFormat;
import java.util.*;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Collectors;
@Slf4j
@ -90,9 +85,12 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver {
private EpmetCommonServiceOpenFeignClient epmetCommonServiceOpenFeignClient;
@Autowired
private ExecutorService executorService;
@Autowired
private EpmetUserOpenFeignClient epmetUserOpenFeignClient;
@Autowired
private CustomerAgencyDao customerAgencyDao;
@Autowired
private CustomerGridDao customerGridDao;
@Override
@ -139,6 +137,8 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver {
//设置
icHouseDTO.setHouseName(getHouseName(formDTO));
icHouseService.update(icHouseDTO);
//删除房屋缓存
icHouseRedis.delHouseInfo(formDTO.getHouseId(),customerId);
}
@Override
@ -356,4 +356,177 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver {
}
return houseInfo;
}
/**
* @Author sun
* @Description 人房房屋总数饼图
**/
@Override
public HouseChartResultDTO houseChart(HouseChartFormDTO formDTO) {
HouseChartResultDTO resultDTO = new HouseChartResultDTO();
//计算百分比使用,保留小数点后两位
NumberFormat numberFormat = NumberFormat.getInstance();
numberFormat.setMaximumFractionDigits(NumConstant.TWO);
//1.判断入参是否有值,没有值则赋值当前工作人员缓存中所属组织信息
if (StringUtils.isEmpty(formDTO.getOrgId())) {
//2.获取工作人员缓存信息
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getUserId());
if (null == staffInfo) {
throw new EpmetException(String.format("查询工作人员%s缓存信息失败...", formDTO.getUserId()));
}
formDTO.setOrgId(staffInfo.getAgencyId());
formDTO.setOrgType("agency");
}
//2.根据入参值查询对应的房屋统计数据
List<HouseChartResultDTO> list = icHouseDao.houseChart(formDTO.getOrgId(), formDTO.getOrgType());
//3.汇总数据
AtomicInteger houseTotal = new AtomicInteger();
list.forEach(l -> {
houseTotal.addAndGet(l.getNum());
if (l.getRentFlag() == 0) {
resultDTO.setZzHouseTotal(l.getNum());
} else if (l.getRentFlag() == 1) {
resultDTO.setCzHouseTotal(l.getNum());
} else {
resultDTO.setXzHouseTotal(l.getNum());
}
});
resultDTO.setHouseTotal(houseTotal.get());
resultDTO.setZzHouseRatio(Double.valueOf((resultDTO.getHouseTotal() == 0 || resultDTO.getZzHouseTotal() > resultDTO.getHouseTotal()) ? "0" : numberFormat.format(((float) resultDTO.getZzHouseTotal() / (float) resultDTO.getHouseTotal()) * 100)));
resultDTO.setCzHouseRatio(Double.valueOf((resultDTO.getHouseTotal() == 0 || resultDTO.getCzHouseTotal() > resultDTO.getHouseTotal()) ? "0" : numberFormat.format(((float) resultDTO.getCzHouseTotal() / (float) resultDTO.getHouseTotal()) * 100)));
resultDTO.setXzHouseRatio(Double.valueOf((resultDTO.getHouseTotal() == 0 || resultDTO.getXzHouseTotal() > resultDTO.getHouseTotal()) ? "0" : numberFormat.format(((float) resultDTO.getXzHouseTotal() / (float) resultDTO.getHouseTotal()) * 100)));
resultDTO.setOrgId(formDTO.getOrgId());
resultDTO.setOrgType(formDTO.getOrgType());
return resultDTO;
}
/**
* @Author sun
* @Description 人房下级人房概览列表
**/
@Override
public List<SubUserHouseListResultDTO> subUserHouseList(HouseChartFormDTO formDTO) {
List<SubUserHouseListResultDTO> resultList = new ArrayList<>();
//1.判断入参没值的赋值当前工作人员缓存所属组织信息
if (StringUtils.isEmpty(formDTO.getOrgId())) {
//获取工作人员缓存信息
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getUserId());
if (null == staffInfo) {
throw new EpmetException(String.format("查询工作人员%s缓存信息失败...", formDTO.getUserId()));
}
formDTO.setOrgId(staffInfo.getAgencyId());
formDTO.setOrgType("agency");
}
if ("village".equals(formDTO.getOrgType())) {
return new ArrayList<>();
}
//2.根据入参值查询直属下级列表(组织、网格、小区列表)
List<String> idList = new ArrayList<>();
Map<String, String> map = new HashMap<>();
String orgType = "";
if ("agency".equals(formDTO.getOrgType())) {
//获取组织缓存,判断组织级别
AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(formDTO.getOrgId());
if (null == agencyInfo) {
throw new RenException(String.format("查询组织信息失败%s", formDTO.getOrgId()));
}
//直属下级网格列表
if ("community".equals(agencyInfo.getLevel())) {
orgType = "grid";
List<GridListResultDTO> list = customerGridDao.selectGridList(formDTO.getOrgId());
idList = list.stream().map(GridListResultDTO::getGridId).collect(Collectors.toList());
map = list.stream().collect(Collectors.toMap(GridListResultDTO::getGridId, GridListResultDTO::getGridName, (k1, k2) -> k1));
} else {
//直属下级组织列表
orgType = "agency";
List<AgencyListResultDTO> list = customerAgencyDao.selectAgencyList(formDTO.getOrgId());
idList = list.stream().map(AgencyListResultDTO::getAgencyId).collect(Collectors.toList());
map = list.stream().collect(Collectors.toMap(AgencyListResultDTO::getAgencyId, AgencyListResultDTO::getAgencyName, (k1, k2) -> k1));
}
} else if ("grid".equals(formDTO.getOrgType())) {
//网格直属小区列表
orgType = "village";
List<IcNeighborHoodDTO> list = icNeighborHoodDao.selectNeighborList(formDTO.getOrgId());
idList = list.stream().map(IcNeighborHoodDTO::getId).collect(Collectors.toList());
map = list.stream().collect(Collectors.toMap(IcNeighborHoodDTO::getId, IcNeighborHoodDTO::getNeighborHoodName, (k1, k2) -> k1));
}
//3.分别查询直属下级列表的房屋、居民统计数据
resultList = houseUserChartList(idList, map, orgType);
return resultList;
}
/**
* Desc: 根据类型更新排序
* @param formDTO
* @author zxc
* @date 2022/5/6 08:50
*/
@Override
@Transactional(rollbackFor = Exception.class)
public void updateSort(UpdateSortFormDTO formDTO) {
if (formDTO.getType().equals(CustomerGridConstant.HOUSE)){
IcHouseDTO icHouseDTO = ConvertUtils.sourceToTarget(formDTO, IcHouseDTO.class);
icHouseService.update(icHouseDTO);
}else if(formDTO.getType().equals(CustomerGridConstant.BUILDING)){
IcBuildingDTO icBuildingDTO = ConvertUtils.sourceToTarget(formDTO, IcBuildingDTO.class);
icBuildingService.update(icBuildingDTO);
}
}
/**
* @Author sun
* @Description 人房房屋居民统计列表数据
**/
private List<SubUserHouseListResultDTO> houseUserChartList(List<String> idList, Map<String, String> map, String orgType) {
List<SubUserHouseListResultDTO> list = new ArrayList<>();
//1.直属下级列表的房屋数据
List<HouseChartResultDTO> houseList = new ArrayList<>();
HouseChartFormDTO houseDTO = new HouseChartFormDTO();
houseDTO.setOrgType(orgType);
for (String id : idList) {
houseDTO.setOrgId(id);
houseList.add(houseChart(houseDTO));
}
//2.直属下级列表的居民数据
UserChartFormDTO userDTO = new UserChartFormDTO();
userDTO.setOrgType(orgType);
userDTO.setIdList(idList);
Result<List<UserChartResultDTO>> userResult = epmetUserOpenFeignClient.userChartList(userDTO);
if (!userResult.success()) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取居民人房统计数据失败" + userResult.getInternalMsg(), userResult.getMsg());
}
//3.汇总封装数据
SubUserHouseListResultDTO dto = null;
for (String id : idList) {
dto = new SubUserHouseListResultDTO();
dto.setOrgId(id);
dto.setOrgName(map.get(id));
dto.setOrgType(orgType);
for (HouseChartResultDTO h : houseList) {
if (h.getOrgId().equals(id)) {
dto.setHouseTotal(h.getHouseTotal());
dto.setZzHouseTotal(h.getZzHouseTotal());
dto.setZzHouseRatio(h.getZzHouseRatio());
dto.setCzHouseTotal(h.getCzHouseTotal());
dto.setCzHouseRatio(h.getCzHouseRatio());
dto.setXzHouseTotal(h.getXzHouseTotal());
dto.setXzHouseRatio(h.getXzHouseRatio());
}
}
for (UserChartResultDTO u : userResult.getData()) {
if (u.getOrgId().equals(id)) {
dto.setUserTotal(u.getUserTotal());
dto.setCzUserTotal(u.getCzUserTotal());
dto.setCzUserRatio(u.getCzUserRatio());
dto.setLdUserTotal(u.getLdUserTotal());
dto.setLdUserRatio(u.getLdUserRatio());
}
}
list.add(dto);
}
return list;
}
}

13
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcBuildingServiceImpl.java

@ -27,6 +27,7 @@ import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.dao.IcBuildingDao;
import com.epmet.dto.IcBuildingDTO;
import com.epmet.dto.ImportGeneralDTO;
import com.epmet.entity.IcBuildingEntity;
import com.epmet.service.IcBuildingService;
import lombok.extern.slf4j.Slf4j;
@ -153,4 +154,16 @@ public class IcBuildingServiceImpl extends BaseServiceImpl<IcBuildingDao, IcBuil
return ConvertUtils.sourceToTarget(entity, IcBuildingDTO.class);
}
/**
* Desc: 更新楼栋信息
* @param info
* @author zxc
* @date 2022/4/27 13:29
*/
@Override
@Transactional(rollbackFor = Exception.class)
public void updateBuilding(ImportGeneralDTO info) {
baseDao.updateBuilding(info);
}
}

42
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcHouseServiceImpl.java

@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.dto.result.OptionResultDTO;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.page.PageData;
@ -18,11 +19,17 @@ import com.epmet.dto.IcResiCategoryStatsConfigDTO;
import com.epmet.dto.IcResiUserDTO;
import com.epmet.dto.ImportGeneralDTO;
import com.epmet.dto.form.HouseFormDTO;
import com.epmet.dto.result.HouseInfoDTO;
import com.epmet.dto.result.HouseListResultDTO;
import com.epmet.dto.result.HousesNameResultDTO;
import com.epmet.entity.IcHouseEntity;
import com.epmet.enums.HousePurposeEnums;
import com.epmet.enums.HouseRentFlagEnums;
import com.epmet.enums.HouseTypeEnums;
import com.epmet.feign.EpmetAdminOpenFeignClient;
import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.feign.OperCustomizeOpenFeignClient;
import com.epmet.redis.IcHouseRedis;
import com.epmet.service.IcHouseService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
@ -47,6 +54,10 @@ public class IcHouseServiceImpl extends BaseServiceImpl<IcHouseDao, IcHouseEntit
private OperCustomizeOpenFeignClient operCustomizeOpenFeignClient;
@Resource
private EpmetUserOpenFeignClient epmetUserOpenFeignClient;
@Resource
private EpmetAdminOpenFeignClient epmetAdminOpenFeignClient;
@Resource
private IcHouseRedis icHouseRedis;
@Override
@ -77,7 +88,23 @@ public class IcHouseServiceImpl extends BaseServiceImpl<IcHouseDao, IcHouseEntit
@Override
public IcHouseDTO get(String id) {
IcHouseEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, IcHouseDTO.class);
IcHouseDTO dto = ConvertUtils.sourceToTarget(entity, IcHouseDTO.class);
dto.setHouseTypeName(HouseTypeEnums.getTypeValue(dto.getHouseType()));
dto.setRentName(HouseRentFlagEnums.getTypeValue(dto.getRentFlag()));
dto.setPurposeName(HousePurposeEnums.getTypeValue(dto.getPurpose()));
HouseInfoDTO houseInfo = icHouseRedis.getHouseInfo(id, dto.getCustomerId());
if (null != houseInfo) {
dto.setNeighborHoodName(houseInfo.getNeighborHoodName());
dto.setBuildingName(houseInfo.getBuildingName());
dto.setUnitName(houseInfo.getUnitName());
} else {
dto.setNeighborHoodName(StrConstant.EPMETY_STR);
dto.setBuildingName(StrConstant.EPMETY_STR);
dto.setUnitName(StrConstant.EPMETY_STR);
}
return dto;
}
@Override
@ -188,6 +215,19 @@ public class IcHouseServiceImpl extends BaseServiceImpl<IcHouseDao, IcHouseEntit
HouseListResultDTO dto = new HouseListResultDTO();
dto.setHouseId(item.getId());
dto.setHouseName(item.getHouseName());
switch (item.getRentFlag()){
case NumConstant.ZERO:
dto.setRentFlag("自住");
break;
case NumConstant.ONE:
dto.setRentFlag("出租");
break;
case NumConstant.TWO:
dto.setRentFlag("闲置");
break;
default:
break;
}
List<HouseListResultDTO.CategoryListBean> categories = new ArrayList<>();
if (null != countMap && CollectionUtils.isNotEmpty(categoryList)) {
for (IcResiCategoryStatsConfigDTO category : categoryList) {

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

@ -26,6 +26,7 @@ import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.constant.NumConstant;
@ -74,6 +75,7 @@ import org.apache.commons.lang3.StringUtils;
import org.apache.http.entity.ContentType;
import org.apache.poi.ss.usermodel.Workbook;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;
@ -234,8 +236,9 @@ public class IcNeighborHoodServiceImpl extends BaseServiceImpl<IcNeighborHoodDao
* @date 2022/2/12 11:11 上午
*/
@Override
@Async
public Result neighborhoodImport(ImportInfoFormDTO formDTO, InputStream inputStream,Result<ImportTaskCommonResultDTO> importTask) {
executorService.submit(() -> {
// executorService.submit(() -> {
// importNeighbor(formDTO,file,importTask);
log.info("neighborhoodImport thread start=====");
ExcelReader excelReader = null;
@ -260,7 +263,7 @@ public class IcNeighborHoodServiceImpl extends BaseServiceImpl<IcNeighborHoodDao
}
}
log.info("neighborhoodImport thread end=====");
});
// });
return new Result<>();
}
@ -496,10 +499,12 @@ public class IcNeighborHoodServiceImpl extends BaseServiceImpl<IcNeighborHoodDao
@Override
@Transactional(rollbackFor = Exception.class)
public void neighborHoodPropertyInsert(List<IcNeighborHoodPropertyEntity> entities){
List<List<IcNeighborHoodPropertyEntity>> partition = ListUtils.partition(entities, NumConstant.ONE_HUNDRED);
partition.forEach(p -> {
neighborHoodPropertyService.insertBatch(p);
});
if (CollectionUtils.isNotEmpty(entities)){
List<List<IcNeighborHoodPropertyEntity>> partition = ListUtils.partition(entities, NumConstant.ONE_HUNDRED);
partition.forEach(p -> {
neighborHoodPropertyService.insertBatch(p);
});
}
}
/**
@ -521,7 +526,7 @@ public class IcNeighborHoodServiceImpl extends BaseServiceImpl<IcNeighborHoodDao
String neighborHoodId = getNeighborHoodId(formDTO.getCustomerId(), item);
item.setNeighborHoodId(neighborHoodId);
//2.获取楼栋ID,判断楼栋是否存在,不存在则添加楼栋,存在则直接获取楼栋ID
if (StringUtils.isEmpty(item.getBuildingId()) && StringUtils.isNotEmpty(item.getBuildingName())) {
if (StringUtils.isNotEmpty(item.getBuildingName())) {
String buildingId = getBuildingId(formDTO.getCustomerId(), item);
item.setBuildingId(buildingId);
}
@ -530,7 +535,7 @@ public class IcNeighborHoodServiceImpl extends BaseServiceImpl<IcNeighborHoodDao
String unitId = getUnitId(formDTO.getCustomerId(), item);
item.setBuildingUnitId(unitId);
}
} else if (StringUtils.isNotEmpty(item.getNeighborHoodId()) && StringUtils.isEmpty(item.getBuildingId())) {
} else if (StringUtils.isNotEmpty(item.getNeighborHoodId())) {
//获取楼栋ID,判断楼栋是否存在,不存在则添加楼栋,存在则直接获取楼栋ID
String buildingId = getBuildingId(formDTO.getCustomerId(), item);
item.setBuildingId(buildingId);
@ -590,6 +595,29 @@ public class IcNeighborHoodServiceImpl extends BaseServiceImpl<IcNeighborHoodDao
IcBuildingDTO building = icBuildingService.getBuildingInfo(info.getNeighborHoodId(), info.getBuildingName());
if (null != building) {
info.setBuildingExistStatus(true);
if (info.getTotalUnitNum() < building.getTotalUnitNum()){
info.setBuildingUnitNumStatus(true);
}else {
info.setBuildingId(building.getId());
icBuildingService.updateBuilding(info);
//新增单元
List<OptionResultDTO> units = icBuildingUnitService.getUnitOptions(building.getId());
Map<String, String> unitMap = units.stream().collect(Collectors.toMap(OptionResultDTO::getCode, OptionResultDTO::getLabel));
List<IcBuildingUnitEntity> unitList = new ArrayList<>();
for (int i = 1; i <= info.getTotalUnitNum(); i++) {
String unitNum = String.valueOf(i);
if (!unitMap.containsKey(unitNum)) {
IcBuildingUnitEntity icBuildingUnit = new IcBuildingUnitEntity();
icBuildingUnit.setId(IdWorker.getIdStr());
icBuildingUnit.setBuildingId(building.getId());
icBuildingUnit.setCustomerId(customerId);
icBuildingUnit.setUnitName(unitNum + "单元");
icBuildingUnit.setUnitNum(unitNum);
unitList.add(icBuildingUnit);
}
}
icBuildingUnitService.insertBatch(unitList, NumConstant.ONE_HUNDRED);
}
return building.getId();
}
IcBuildingEntity buildingEntity = new IcBuildingEntity();
@ -597,10 +625,12 @@ public class IcNeighborHoodServiceImpl extends BaseServiceImpl<IcNeighborHoodDao
buildingEntity.setNeighborHoodId(info.getNeighborHoodId());
buildingEntity.setBuildingName(info.getBuildingName());
buildingEntity.setType(null == info.getType()?NumConstant.ONE_STR:info.getType());
buildingEntity.setSort(NumConstant.ZERO);
buildingEntity.setSort(info.getSort());
buildingEntity.setTotalUnitNum(info.getTotalUnitNum());
buildingEntity.setTotalFloorNum(info.getTotalFloorNum());
buildingEntity.setTotalHouseNum(info.getTotalHouseNum());
buildingEntity.setBuildingLeaderName(info.getBuildingLeaderName());
buildingEntity.setBuildingLeaderMobile(info.getBuildingLeaderMobile());
icBuildingService.insert(buildingEntity);
if (null != info.getTotalUnitNum() && info.getTotalUnitNum() > NumConstant.ZERO) {
//设置楼宇单元
@ -708,4 +738,37 @@ public class IcNeighborHoodServiceImpl extends BaseServiceImpl<IcNeighborHoodDao
return result;
}
/**
* Desc: 更新小区
* @param needUpdateList
* @author zxc
* @date 2022/4/27 09:59
*/
@Override
@Transactional
public void updateNeighborHood(List<ImportGeneralDTO> needUpdateList) {
if (CollectionUtils.isNotEmpty(needUpdateList)){
baseDao.updateNeighborHood(needUpdateList);
}
}
/**
* Desc: 更新小区关系表
* @param updateNeighborHoodAndManagement
* @author zxc
* @date 2022/4/27 10:33
*/
@Override
@Transactional
public void neighborHoodPropertyUpdate(List<NeighborHoodAndManagementDTO> updateNeighborHoodAndManagement) {
if (CollectionUtils.isNotEmpty(updateNeighborHoodAndManagement)){
baseDao.delProperty(updateNeighborHoodAndManagement.stream().map(m -> m.getNeighborHoodId()).collect(Collectors.toList()));
List<IcNeighborHoodPropertyEntity> entities = ConvertUtils.sourceToTarget(updateNeighborHoodAndManagement, IcNeighborHoodPropertyEntity.class);
List<IcNeighborHoodPropertyEntity> collect = entities.stream().filter(e -> StringUtils.isNotBlank(e.getPropertyId())).collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(collect)){
neighborHoodPropertyService.insertBatch(collect);
}
}
}
}

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

@ -0,0 +1,2 @@
alter table ic_building add COLUMN BUILDING_LEADER_NAME VARCHAR(11) comment '楼长姓名' AFTER TOTAL_HOUSE_NUM;
alter table ic_building add COLUMN BUILDING_LEADER_MOBILE VARCHAR(11) comment '楼长电话' AFTER BUILDING_LEADER_NAME;

3
epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.18__edit_building_and_house_sort.sql

@ -0,0 +1,3 @@
ALTER TABLE ic_building DROP SORT;
alter table ic_building add COLUMN SORT DECIMAL(6,2) comment '排序' DEFAULT 0.00 AFTER BUILDING_LEADER_NAME;
alter table ic_house add COLUMN SORT DECIMAL(6,2) comment '排序' DEFAULT 0.00 AFTER OWNER_ID_CARD;

BIN
epmet-module/gov-org/gov-org-server/src/main/resources/excel/building_export.xlsx

Binary file not shown.

BIN
epmet-module/gov-org/gov-org-server/src/main/resources/excel/building_template.xlsx

Binary file not shown.

BIN
epmet-module/gov-org/gov-org-server/src/main/resources/excel/house_template.xlsx

Binary file not shown.

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

@ -709,15 +709,6 @@
agency.DEL_FLAG = '0'
AND agency.ID = #{agencyId}
</select>
<select id="getSonGridId" resultType="com.epmet.dto.result.SonOrgResultDTO">
SELECT
ID AS orgId,
pids
FROM customer_grid
WHERE
DEL_FLAG = '0'
AND PID = #{orgId}
</select>
<select id="getAgencyMobile" resultType="com.epmet.dto.result.OrgMobileResultDTO">
SELECT
@ -732,6 +723,15 @@
AND ca.del_flag = '0'
AND cg.id = #{gridId}
</select>
<select id="getSonGridId" resultType="com.epmet.dto.result.SonOrgResultDTO">
SELECT
ID AS orgId,
pids
FROM customer_grid
WHERE
DEL_FLAG = '0'
AND PID = #{orgId}
</select>
<!-- 查询组织下的社区 -->
<select id="getCommunityList" resultType="com.epmet.dto.result.CommunityListResultDTO">

36
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcBuildingDao.xml

@ -42,6 +42,19 @@
)
</update>
<!-- 更新楼栋信息 -->
<update id="updateBuilding">
UPDATE ic_building
SET TOTAL_UNIT_NUM = #{totalUnitNum},
TOTAL_FLOOR_NUM = #{totalFloorNum},
TOTAL_HOUSE_NUM = #{totalHouseNum},
BUILDING_LEADER_NAME = #{buildingLeaderName},
BUILDING_LEADER_MOBILE = #{buildingLeaderMobile},
SORT = #{sort},
UPDATED_TIME = NOW()
WHERE ID = #{buildingId}
</update>
<!--<select id="searchBuildingByPage" resultType="map">
select
a.ID as buildingId,
@ -81,9 +94,11 @@
a.SORT as sort,
a.LONGITUDE as longitude,
a.LATITUDE as latitude,
a.TYPE as buildingTypeKey
a.TYPE as buildingTypeKey,
(SELECT COUNT(1) FROM ic_house WHERE DEL_FLAG = '0' AND BUILDING_ID = a.ID) AS realTotalHouseNum,
a.BUILDING_LEADER_NAME,
a.BUILDING_LEADER_MOBILE
from ic_building a
LEFT JOIN ic_neighbor_hood b on a.NEIGHBOR_HOOD_ID = b.ID and b.DEL_FLAG='0'
left join customer_agency c on b.AGENCY_ID = c.ID and c.DEL_FLAG='0'
left join customer_grid d on b.GRID_ID = d.ID and d.DEL_FLAG='0'
@ -106,7 +121,12 @@
</if>
AND a.DEL_FLAG = '0'
</where>
order by a.CREATED_TIME, a.BUILDING_NAME
ORDER BY
<if test='sortType == null '>a.sort,</if>
<if test='sortType != null and sortType == "asc" '>a.sort,</if>
<if test='sortType != null and sortType == "desc" '>a.sort DESC,</if>
CAST(b.NEIGHBOR_HOOD_NAME AS SIGNED),CONVERT(b.NEIGHBOR_HOOD_NAME using gbk),
CAST(a.BUILDING_NAME AS SIGNED),CONVERT(a.BUILDING_NAME USING gbk)
</select>
<select id="searchAllBuilding" resultType="com.epmet.excel.IcBuildingExcel">
select
@ -118,7 +138,9 @@
a.TYPE as type,
b.NEIGHBOR_HOOD_NAME as neighborHoodName,
c.ORGANIZATION_NAME as agencyName,
d.GRID_NAME as gridName
d.GRID_NAME as gridName,
a.BUILDING_LEADER_NAME AS buildingLeaderName,
a.BUILDING_LEADER_MOBILE AS buildingLeaderMobile
from ic_building a
LEFT JOIN ic_neighbor_hood b on a.NEIGHBOR_HOOD_ID = b.ID and b.DEL_FLAG='0'
@ -164,6 +186,7 @@
ca.del_flag = '0'
and
CONCAT(':',ca.pids, ':') like CONCAT('%:',#{agencyId},':%')
ORDER BY CAST(organization_name AS SIGNED),CONVERT(organization_name using gbk)
</select>
<select id="selectListByName" resultType="map">
@ -365,4 +388,9 @@
BUILDING_ID
</select>
<!-- 查询楼栋下单元数 -->
<select id="selectUnitCount" resultType="java.lang.Integer">
SELECT COUNT(ID) FROM ic_building_unit WHERE BUILDING_ID = #{buildingId} AND DEL_FLAG = '0'
</select>
</mapper>

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

@ -60,6 +60,11 @@
when id = #{h.houseId} then #{h.ownerIdCard}
</foreach>
</trim>
<trim prefix="SORT =(case" suffix="end),">
<foreach collection="houses" item="h">
when id = #{h.houseId} then #{h.sort}
</foreach>
</trim>
UPDATED_TIME = NOW()
</trim>
WHERE DEL_FLAG = '0'
@ -106,7 +111,8 @@
c.AGENCY_ID as agencyId,
ag.ORGANIZATION_NAME agencyName,
c.GRID_ID as gridId,
gr.GRID_NAME
gr.GRID_NAME,
a.sort
from ic_house a
LEFT JOIN ic_building b on a.BUILDING_ID = b.ID and b.DEL_FLAG = '0'
LEFT JOIN ic_neighbor_hood c on a.NEIGHBOR_HOOD_ID = c.ID and c.DEL_FLAG = '0'
@ -152,7 +158,11 @@
and a.del_flag = '0'
</where>
#排序规则:根据小区、楼栋、单元、门牌号(分别按照数字和中文)分别升序排序
ORDER BY CONVERT(c.NEIGHBOR_HOOD_NAME using gbk),
ORDER BY
<if test='sortType == null '>a.sort,</if>
<if test='sortType != null and sortType == "asc" '>a.sort,</if>
<if test='sortType != null and sortType == "desc" '>a.sort DESC,</if>
CONVERT(c.NEIGHBOR_HOOD_NAME using gbk),
CONVERT(b.BUILDING_NAME USING gbk),
CONVERT(d.UNIT_NAME USING gbk),
CAST(a.DOOR_NAME AS SIGNED),
@ -300,4 +310,38 @@
)
GROUP BY h.OWNER_ID_CARD
</select>
<select id="houseChart" resultType="com.epmet.dto.result.HouseChartResultDTO">
SELECT
COUNT(id) num,
rent_flag rentFlag
FROM
ic_house
WHERE del_flag = '0'
<choose>
<when test='orgType == "agency"'>
AND neighbor_hood_id IN (
select id from ic_neighbor_hood
where del_flag = '0'
and (agency_id = #{orgId} OR agency_pids LIKE CONCAT('%', #{orgId}, '%'))
)
</when>
<when test='orgType == "grid"'>
AND neighbor_hood_id IN (
select id from ic_neighbor_hood
where del_flag = '0'
and grid_id = #{orgId}
)
</when>
<otherwise>
AND neighbor_hood_id IN (
select id from ic_neighbor_hood
where del_flag = '0'
and id = #{orgId}
)
</otherwise>
</choose>
GROUP BY rent_flag
</select>
</mapper>

73
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcNeighborHoodDao.xml

@ -25,6 +25,59 @@
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
<!-- 更新小区详细地址和备注 -->
<update id="updateNeighborHood">
update ic_neighbor_hood
<trim prefix="set" suffixOverrides=",">
<trim prefix="ADDRESS =(case" suffix="end),">
<foreach collection="list" item="l">
when id = #{l.neighborHoodId} then #{l.address}
</foreach>
</trim>
<trim prefix="REMARK =(case" suffix="end),">
<foreach collection="list" item="l">
when id = #{l.neighborHoodId} then #{l.remark}
</foreach>
</trim>
UPDATED_TIME = NOW()
</trim>
WHERE DEL_FLAG = '0'
AND ID IN (
<foreach collection="list" item="l" separator=",">
#{l.neighborHoodId}
</foreach>
)
</update>
<!-- 更新小区关系表 -->
<update id="neighborHoodPropertyUpdate">
update ic_neighbor_hood_property
<trim prefix="set" suffixOverrides=",">
<trim prefix="PROPERTY_ID =(case" suffix="end),">
<foreach collection="list" item="l">
when NEIGHBOR_HOOD_ID = #{l.neighborHoodId} then #{l.propertyId}
</foreach>
</trim>
UPDATED_TIME = NOW()
</trim>
WHERE DEL_FLAG = '0'
AND NEIGHBOR_HOOD_ID IN (
<foreach collection="list" item="l" separator=",">
#{l.neighborHoodId}
</foreach>
)
</update>
<!-- 删除物业关系 -->
<delete id="delProperty">
DELETE FROM ic_neighbor_hood_property
WHERE NEIGHBOR_HOOD_ID IN (
<foreach collection="neighborHoodIds" item="n" separator=",">
#{n}
</foreach>
)
</delete>
<!--<select id="searchNeighborhoodByPage" resultType="map">
select
a.id as neighborHoodId,
@ -100,7 +153,7 @@
AND a.DEL_FLAG = '0'
</where>
ORDER BY a.CREATED_TIME
ORDER BY CAST(a.NEIGHBOR_HOOD_NAME AS SIGNED),CONVERT(a.NEIGHBOR_HOOD_NAME using gbk)
</select>
<select id="searchAllNeighborhood" resultType="com.epmet.excel.IcNeighborHoodExcel">
select
@ -223,4 +276,22 @@
</foreach>
)
</select>
<select id="selectNeighborList" resultType="com.epmet.dto.IcNeighborHoodDTO">
SELECT
id,
customer_id,
neighbor_hood_name,
agency_id,
parent_agency_id,
agency_pids,
grid_id,
address,
remark
FROM
ic_neighbor_hood
WHERE
del_flag = '0'
AND grid_id = #{gridId}
</select>
</mapper>

2
epmet-module/gov-project/gov-project-server/pom.xml

@ -2,7 +2,7 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<version>0.3.96</version>
<version>0.3.107</version>
<parent>
<artifactId>gov-project</artifactId>
<groupId>com.epmet</groupId>

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

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

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

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

2
epmet-module/gov-voice/gov-voice-server/pom.xml

@ -3,7 +3,7 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<version>0.3.78</version>
<version>0.3.79</version>
<parent>
<artifactId>gov-voice</artifactId>
<groupId>com.epmet</groupId>

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save