Browse Source

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

master
wangxianzhang 3 years ago
parent
commit
003fdeddaf
  1. 17
      epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.12__up_sys_dict_data.sql
  2. 6
      epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.13__up_sys_dict_data.sql
  3. 7
      epmet-auth-client/pom.xml
  4. 25
      epmet-auth-client/src/main/java/com/epmet/auth/dto/result/BlockChainStaffAuthResultDTO.java
  5. 1
      epmet-auth/src/main/java/com/epmet/controller/GovLoginController.java
  6. 20
      epmet-auth/src/main/java/com/epmet/controller/GovWebController.java
  7. 24
      epmet-auth/src/main/java/com/epmet/dto/form/BcStaffAuthenticationFormDTO.java
  8. 9
      epmet-auth/src/main/java/com/epmet/service/GovWebService.java
  9. 4
      epmet-auth/src/main/java/com/epmet/service/impl/GovLoginServiceImpl.java
  10. 41
      epmet-auth/src/main/java/com/epmet/service/impl/GovWebServiceImpl.java
  11. 15
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/PartyUnitTypeEnum.java
  12. 10
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/CommonAggFeignClient.java
  13. 6
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/fallback/CommonAggFeignClientFallback.java
  14. 28
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/AgencyInfoCache.java
  15. 6
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/CustomerAgencyDTO.java
  16. 8
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/GovOrgController.java
  17. 1
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerAgencyDao.java
  18. 3
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java
  19. 83
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java
  20. 1
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govproject/impl/GovProjectServiceImpl.java
  21. 5
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/AggreGridServiceImpl.java
  22. 2
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyUserRankDataDao.xml
  23. 2
      epmet-module/epmet-common-service/common-service-server/src/main/resources/mapper/AreaCodeDao.xml
  24. 5
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcCommunitySelfOrganizationDTO.java
  25. 3
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPartyActivityDTO.java
  26. 2
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/LatestActInfoDTO.java
  27. 5
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/AddCommunitySelfOrganizationFormDTO.java
  28. 2
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/CommunitySelfOrganizationListFormDTO.java
  29. 5
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/EditCommunitySelfOrganizationFormDTO.java
  30. 1
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/PartyActivityFormDTO.java
  31. 2
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/DraftActInfoFormDTO.java
  32. 2
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/PublishActInfoFormDTO.java
  33. 2
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/RePublishFormDTO.java
  34. 6
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/CommunitySelfOrganizationListDTO.java
  35. 3
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ActPreviewResultDTO.java
  36. 2
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/CanceledActDetailResultDTO.java
  37. 3
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/FinishedActDetailResultDTO.java
  38. 3
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/InProgressActDetailResultDTO.java
  39. 1
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/LatestDraftActInfoResultDTO.java
  40. 3
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ReEditActInfoResultDTO.java
  41. 11
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetHeartOpenFeignClient.java
  42. 14
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/fallback/EpmetHeartOpenFeignClientFallback.java
  43. 23
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceItemDictController.java
  44. 5
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcCommunitySelfOrganizationEntity.java
  45. 2
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcPartyActivityEntity.java
  46. 2
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/LatestActInfoEntity.java
  47. 3
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ExportCommunitySelfOrganizationExcel.java
  48. 3
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ImportCommunitySelfOrganization.java
  49. 10
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcResiDemandDictService.java
  50. 9
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceItemDictService.java
  51. 28
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java
  52. 29
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcResiDemandDictServiceImpl.java
  53. 30
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceItemDictServiceImpl.java
  54. 6
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/VolunteerInfoServiceImpl.java
  55. 57
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActDraftServiceImpl.java
  56. 35
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java
  57. 1
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.13__add_column_remark.sql
  58. 4
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.14__activity_add_grid.sql
  59. 7
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcCommunitySelfOrganizationDao.xml
  60. 5
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyActivityDao.xml
  61. 1
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LatestActInfoDao.xml
  62. BIN
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/templates/self_org_import_template.xlsx
  63. 6
      epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/BlockChainProcessProjectFormDTO.java
  64. 9
      epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/BlockChainProjectServiceImpl.java
  65. 29
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcBuildingListFormDTO.java
  66. 4
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcBulidingAddFormDTO.java
  67. 6
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcHouseAddFormDTO.java
  68. 69
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcHouseListFormDTO.java
  69. 2
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcNeighborHoodAddFormDTO.java
  70. 63
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcNeighborHoodListFormDTO.java
  71. 85
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/ListIcNeighborHoodFormDTO.java
  72. 17
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/HouseResultDTO.java
  73. 20
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/HousesNameResultDTO.java
  74. 35
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/IcBuildingListResultDTO.java
  75. 38
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/IcHouseListResultDTO.java
  76. 37
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/IcNeighborHoodResultDTO.java
  77. 8
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/enums/HouseRentFlagEnums.java
  78. 9
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java
  79. 5
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java
  80. 41
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/BuildingController.java
  81. 123
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java
  82. 12
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcHouseController.java
  83. 5
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcNeighborHoodController.java
  84. 32
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/NeighborHoodController.java
  85. 17
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcBuildingDao.java
  86. 32
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcHouseDao.java
  87. 10
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcNeighborHoodDao.java
  88. 8
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/CustomerAgencyRedis.java
  89. 17
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/BuildingService.java
  90. 26
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/HouseService.java
  91. 9
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcHouseService.java
  92. 4
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcNeighborHoodService.java
  93. 18
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/NeighborHoodService.java
  94. 50
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java
  95. 91
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/BuildingServiceImpl.java
  96. 81
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java
  97. 15
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcHouseServiceImpl.java
  98. 10
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcNeighborHoodServiceImpl.java
  99. 58
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/NeighborHoodServiceImpl.java
  100. 2
      epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.15__alter_ic_house.sql

17
epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.12__up_sys_dict_data.sql

@ -0,0 +1,17 @@
UPDATE `epmet_admin`.`sys_dict_data` SET `id` = '1000000000000000220', `dict_label` = '区域化党建单位--楼宇党建'
WHERE (`id` = '1000000000000000200');
UPDATE `epmet_admin`.`sys_dict_data` SET `id` = '1000000000000000221', `dict_label` = '区域化党建单位--两新组织'
WHERE (`id` = '1000000000000000201');
UPDATE `epmet_admin`.`sys_dict_data` SET `id` = '1000000000000000222', `dict_label` = '区域化党建单位--区域单位党建'
WHERE (`id` = '1000000000000000202');
UPDATE `epmet_admin`.`sys_dict_data` SET `id` = '1000000000000000223', `dict_label` = '区域化党建单位--机关直属部门'
WHERE (`id` = '1000000000000000203');
UPDATE `epmet_admin`.`sys_dict_data` SET `id` = '1000000000000000224', `dict_label` = '区域化党建单位--其他'
WHERE (`id` = '1000000000000000204');
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 ('1000000000000000225', '1000000000000000007', '社会组织--社会团体', '5', '0', '', '5', '0', '0', '', '2022-04-12 14:39:18', '', '2022-04-12 14:39:18');
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 ('1000000000000000226', '1000000000000000007', '社会组织--民办非企业单位', '6', '0', '', '6', '0', '0', '', '2022-04-12 14:39:18', '', '2022-04-12 14:39:18');
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 ('1000000000000000227', '1000000000000000007', '社会组织--基金会', '7', '0', '', '7', '0', '0', '', '2022-04-12 14:39:18', '', '2022-04-12 14:39:18');
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 ('1000000000000000228', '1000000000000000007', '社会组织--其他', '8', '0', '', '8', '0', '0', '', '2022-04-12 14:39:18', '', '2022-04-12 14:39:18');

6
epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.13__up_sys_dict_data.sql

@ -0,0 +1,6 @@
update sys_dict_data set dict_label='联建单位'
where dict_value='party_unit'
and DEL_FLAG='0'
and dict_type_id=(
select st.id from sys_dict_type st where st.dict_type='user_demand_service_type' and st.DEL_FLAG='0'
);

7
epmet-auth-client/pom.xml

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

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

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

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

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

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

@ -1,8 +1,10 @@
package com.epmet.controller;
import com.epmet.auth.dto.result.BlockChainStaffAuthResultDTO;
import com.epmet.commons.tools.utils.RSASignature;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dto.form.BcStaffAuthenticationFormDTO;
import com.epmet.dto.form.GovWebLoginFormDTO;
import com.epmet.dto.result.UserTokenResultDTO;
import com.epmet.service.GovWebService;
@ -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;
}
}

15
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/PartyUnitTypeEnum.java

@ -7,11 +7,16 @@ import com.epmet.commons.tools.exception.EpmetErrorCode;
*/
public enum PartyUnitTypeEnum {
//房屋类型,1楼房,2平房,3别墅
LOUYU("0", "楼宇党建"),
ZUZHI("1", "两新组织"),
DANWEI("2", "区域单位党建"),
JIGUAN("3", "机关直属部门"),
QITA("4", "其他");
LOUYU("0", "区域化党建单位--楼宇党建"),
ZUZHI("1", "区域化党建单位--两新组织"),
DANWEI("2", "区域化党建单位--区域单位党建"),
JIGUAN("3", "区域化党建单位--机关直属部门"),
QITA("4", "区域化党建单位--其他"),
SHZZ_SHTT("5", "社会组织--社会团体"),
SHZZ_MBFQYDW("6", "社会组织--民办非企业单位"),
SHZZ_JJH("7", "社会组织--基金会"),
SHZZ_QT("8", "社会组织--其他");
private String code;
private String name;

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);
}
/**
* 查询楼栋信息
*

28
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/AgencyInfoCache.java

@ -4,6 +4,7 @@ import lombok.Data;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
* @Author zxc
@ -59,6 +60,11 @@ public class AgencyInfoCache implements Serializable {
*/
private String areaCode;
/**
* 地区编码全路径例如37,3702,370203,370203005,370203005015
*/
private List<String> areaCodePath;
/**
* 删除标识
*/
@ -139,4 +145,26 @@ public class AgencyInfoCache implements Serializable {
* 中心位置纬度
*/
private String latitude;
/**
* 组织编码
*/
private String code;
/**
* 负责人姓名
*/
private String contacts;
/**
* 联系电话
*/
private String mobile;
//内部接口使用
/**
* open:当前客户新增组织需要选择areaCodeclosed: 无需选择区域编码
*/
private String areaCodeSwitch;
}

6
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/CustomerAgencyDTO.java

@ -21,6 +21,7 @@ import lombok.Data;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
@ -172,4 +173,9 @@ public class CustomerAgencyDTO implements Serializable {
* 联系电话
*/
private String mobile;
/**
* 地区编码全路径例如37,3702,370203,370203005,370203005015
*/
private List<String> areaCodePath;
}

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

@ -21,10 +21,10 @@ import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dataaggre.beans.GridMemberDataAnalysisExcelExportBean;
import com.epmet.dataaggre.dto.govorg.CustomerAgencyDTO;
import com.epmet.dataaggre.dto.govorg.CustomerGridDTO;
import com.epmet.dataaggre.dto.govorg.form.*;
import com.epmet.dataaggre.dto.govorg.result.*;
import com.epmet.dataaggre.entity.govorg.CustomerAgencyEntity;
import com.epmet.dataaggre.enums.GridMemberDataAnalysisEnums;
import com.epmet.dataaggre.service.AggreGridService;
import com.epmet.dataaggre.service.govorg.GovOrgService;
@ -242,8 +242,8 @@ public class GovOrgController {
* @date 2021/11/5 2:54 下午
*/
@PostMapping("agency")
public Result<CustomerAgencyEntity> getAgencyInfo(@RequestParam("agencyId")String agencyId){
return new Result<CustomerAgencyEntity>().ok(govOrgService.getAgencyInfo(agencyId));
public Result<CustomerAgencyDTO> getAgencyInfo(@RequestParam("agencyId")String agencyId){
return new Result<CustomerAgencyDTO>().ok(govOrgService.getAgencyInfo(agencyId));
}
/**
@ -305,7 +305,7 @@ public class GovOrgController {
CustomerGridDTO gridInfo = govOrgService.getGridInfo(orgId);
Optional.ofNullable(gridInfo).ifPresent((g) -> orgName.set(g.getGridName()));
} else if ("agency".equals(orgType)) {
CustomerAgencyEntity agencyInfo = govOrgService.getAgencyInfo(orgId);
CustomerAgencyDTO agencyInfo = govOrgService.getAgencyInfo(orgId);
Optional.ofNullable(agencyInfo).ifPresent((a) -> orgName.set(a.getOrganizationName()));
}

1
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerAgencyDao.java

@ -105,4 +105,5 @@ public interface CustomerAgencyDao extends BaseDao<CustomerAgencyEntity> {
* @author sun
*/
LinkedList<GridLivelyResultDTO> subAgencyListAndGridSumNum(@Param("agencyId") String agencyId);
}

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

@ -8,7 +8,6 @@ import com.epmet.dataaggre.dto.govorg.CustomerGridDTO;
import com.epmet.dataaggre.dto.govorg.form.*;
import com.epmet.dataaggre.dto.govorg.result.*;
import com.epmet.dataaggre.dto.resigroup.result.OrgInfoCommonDTO;
import com.epmet.dataaggre.entity.govorg.CustomerAgencyEntity;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
@ -162,7 +161,7 @@ public interface GovOrgService {
* @author zxc
* @date 2021/11/5 2:54 下午
*/
CustomerAgencyEntity getAgencyInfo(String agencyId);
CustomerAgencyDTO getAgencyInfo(String agencyId);
/**
* @Description 查询网格信息

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

@ -6,6 +6,7 @@ import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
import com.alibaba.fastjson.JSON;
import com.dingtalk.api.request.OapiRobotSendRequest;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.tools.constant.Constant;
import com.epmet.commons.tools.constant.DingDingRobotConstant;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
@ -23,6 +24,7 @@ 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.GridInfoCache;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.HttpClientManager;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dataaggre.constant.DataSourceConstant;
@ -96,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;
@ -250,41 +252,6 @@ public class GovOrgServiceImpl implements GovOrgService {
return result;
}
public static void main(String[] args) {
List<NextAreaCodeResultDTO> allList = new ArrayList<>();
NextAreaCodeResultDTO m1 = new NextAreaCodeResultDTO();
m1.setAreaCode("1");
m1.setAreaName("a");
allList.add(m1);
NextAreaCodeResultDTO m2 = new NextAreaCodeResultDTO();
m2.setAreaCode("2");
m2.setAreaName("b");
allList.add(m2);
NextAreaCodeResultDTO m3 = new NextAreaCodeResultDTO();
m3.setAreaCode("3");
m3.setAreaName("c");
allList.add(m3);
List<String> stringList = new ArrayList<>();
stringList.add("1");
stringList.add("2");
Iterator<NextAreaCodeResultDTO> iterator = allList.iterator();
while (iterator.hasNext()) {
NextAreaCodeResultDTO next = iterator.next();
for (String usedAreaCode : stringList) {
if (next.getAreaCode().equals(usedAreaCode)) {
iterator.remove();
}
}
}
System.out.println(JSON.toJSONString(allList, true));
}
/**
* @param staffId
* @Author sun
@ -642,8 +609,46 @@ public class GovOrgServiceImpl implements GovOrgService {
* @date 2021/11/5 2:54 下午
*/
@Override
public CustomerAgencyEntity getAgencyInfo(String agencyId) {
return customerAgencyDao.selectById(agencyId);
public CustomerAgencyDTO getAgencyInfo(String agencyId) {
CustomerAgencyEntity customerAgencyEntity=customerAgencyDao.selectById(agencyId);
CustomerAgencyDTO res= ConvertUtils.sourceToTarget(customerAgencyEntity,CustomerAgencyDTO.class);
//设置行政地区编码全路径
if (StringUtils.isNotBlank(res.getAreaCode()) && StringUtils.isNotBlank(res.getParentAreaCode())) {
res.setAreaCodePath(queryAreaCodePath(res));
}
return res;
}
private List<String> queryAreaCodePath(CustomerAgencyDTO customerAgencyEntity) {
List<String> areaCodePath = new ArrayList<>();
switch (customerAgencyEntity.getLevel()) {
case Constant.COMMUNITY:
areaCodePath.add(customerAgencyEntity.getAreaCode().substring(NumConstant.ZERO, NumConstant.TWO));
areaCodePath.add(customerAgencyEntity.getAreaCode().substring(NumConstant.ZERO, NumConstant.FOUR));
areaCodePath.add(customerAgencyEntity.getAreaCode().substring(NumConstant.ZERO, NumConstant.SIX));
areaCodePath.add(customerAgencyEntity.getParentAreaCode());
areaCodePath.add(customerAgencyEntity.getAreaCode());
break;
case Constant.STREET:
areaCodePath.add(customerAgencyEntity.getAreaCode().substring(NumConstant.ZERO, NumConstant.TWO));
areaCodePath.add(customerAgencyEntity.getAreaCode().substring(NumConstant.ZERO, NumConstant.FOUR));
areaCodePath.add(customerAgencyEntity.getParentAreaCode());
areaCodePath.add(customerAgencyEntity.getAreaCode());
break;
case Constant.DISTRICT:
areaCodePath.add(customerAgencyEntity.getAreaCode().substring(NumConstant.ZERO, NumConstant.TWO));
areaCodePath.add(customerAgencyEntity.getParentAreaCode());
areaCodePath.add(customerAgencyEntity.getAreaCode());
break;
case Constant.CITY:
areaCodePath.add(customerAgencyEntity.getParentAreaCode());
areaCodePath.add(customerAgencyEntity.getAreaCode());
break;
case Constant.PROVINCE:
areaCodePath.add(customerAgencyEntity.getAreaCode());
break;
}
return areaCodePath;
}
/**

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;

5
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/AggreGridServiceImpl.java

@ -8,10 +8,10 @@ import com.epmet.commons.tools.redis.common.CustomerOrgRedis;
import com.epmet.commons.tools.redis.common.bean.GridInfoCache;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.dataaggre.dto.epmetuser.result.StaffPatrolRecordDailyResultDTO;
import com.epmet.dataaggre.dto.govorg.CustomerAgencyDTO;
import com.epmet.dataaggre.dto.govorg.CustomerGridDTO;
import com.epmet.dataaggre.dto.govorg.result.GridMemberDataAnalysisResultDTO;
import com.epmet.dataaggre.entity.epmetuser.CustomerStaffEntity;
import com.epmet.dataaggre.entity.govorg.CustomerAgencyEntity;
import com.epmet.dataaggre.service.AggreGridService;
import com.epmet.dataaggre.service.datastats.DataStatsService;
import com.epmet.dataaggre.service.epmetuser.EpmetUserService;
@ -22,7 +22,6 @@ import com.google.common.collect.Lists;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import sun.rmi.runtime.Log;
import java.util.*;
@ -173,7 +172,7 @@ public class AggreGridServiceImpl implements AggreGridService {
* @return
*/
private String getPidsByAgencyId(String agencyId) {
CustomerAgencyEntity agencyInfo = govOrgService.getAgencyInfo(agencyId);
CustomerAgencyDTO agencyInfo = govOrgService.getAgencyInfo(agencyId);
if (agencyInfo == null) {
String errorMsg = "【网格员数据统计查询pcwork】查询组织信息返回为null";

2
epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyUserRankDataDao.xml

@ -163,6 +163,7 @@
WHERE
u.del_flag = '0'
AND PARTY_FLAG = 0
AND u.point_total > 0 <!-- 初心互助中公益达人,0分人员不显示在榜单上 -->
<if test="orgType != null and orgType !=''">
<if test="orgType == 'agency'">
AND u.all_parent_ids LIKE CONCAT('%',#{orgId},'%')
@ -207,6 +208,7 @@
WHERE
u.del_flag = '0'
AND party_flag = '1'<!-- 是否是党员标志:1是。0不是党员 -->
and u.point_total > 0 <!-- 初心互助中党员先锋排行,0分人员不显示在榜单上 -->
<if test="orgType != null and orgType !=''">
<if test="orgType == 'agency'">
AND u.all_parent_ids LIKE CONCAT('%',#{orgId},'%')

2
epmet-module/epmet-common-service/common-service-server/src/main/resources/mapper/AreaCodeDao.xml

@ -84,7 +84,6 @@
area_code_child ac
WHERE
ac.DEL_FLAG = '0'
AND ac.USER_DEFINED = '0'
<if test='null != pCode and "" != pCode'>
AND ac.p_code=#{pCode}
</if>
@ -101,7 +100,6 @@
area_code_child ac
WHERE
ac.DEL_FLAG = '0'
AND ac.USER_DEFINED = '0'
<if test='null != pCode and "" != pCode'>
AND ac.p_code=#{pCode}
</if>

5
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcCommunitySelfOrganizationDTO.java

@ -133,4 +133,9 @@ public class IcCommunitySelfOrganizationDTO implements Serializable {
*/
private Date updatedTime;
/**
* 备注
*/
private String remark;
}

3
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPartyActivityDTO.java

@ -57,7 +57,8 @@ public class IcPartyActivityDTO implements Serializable {
*/
@JsonIgnore
private String agencyId;
private String gridId;
private String gridName;
/**
* 组织的所有上级
*/

2
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/LatestActInfoDTO.java

@ -43,7 +43,7 @@ public class LatestActInfoDTO implements Serializable {
* 客户id
*/
private String customerId;
private String gridId;
/**
* 活动标题
*/

5
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/AddCommunitySelfOrganizationFormDTO.java

@ -56,6 +56,11 @@ public class AddCommunitySelfOrganizationFormDTO implements Serializable {
*/
private String organizationCreatedTime;
/**
* 备注
*/
private String remark;
/**
* 经度
*/

2
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/CommunitySelfOrganizationListFormDTO.java

@ -46,4 +46,6 @@ public class CommunitySelfOrganizationListFormDTO implements Serializable {
private String customerId;
private String agencyId;
private Integer ranking;
private String remark;
}

5
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/EditCommunitySelfOrganizationFormDTO.java

@ -68,6 +68,11 @@ public class EditCommunitySelfOrganizationFormDTO implements Serializable {
*/
private String latitude;
/**
* 备注
*/
private String remark;
/**
* 社区自组织ID
*/

1
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/PartyActivityFormDTO.java

@ -19,6 +19,7 @@ public class PartyActivityFormDTO implements Serializable {
private static final long serialVersionUID = -2510068555703677L;
@NotBlank(message = "组织Id不能为空" )
private String agencyId;
private String gridId;
private String unitId;
private String title;
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")

2
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/DraftActInfoFormDTO.java

@ -28,7 +28,7 @@ public class DraftActInfoFormDTO implements Serializable {
* 活动草稿id,如果是编辑之前的活动草稿此列是有值的
*/
private String actDraftId;
private String gridId;
/**
* 如果是重新发布活动此列是有值的

2
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/PublishActInfoFormDTO.java

@ -36,7 +36,7 @@ public class PublishActInfoFormDTO implements Serializable {
* 活动草稿id,如果是编辑之前的活动草稿此列是有值的
*/
private String actDraftId;
private String gridId;
/**
* 客户id
*/

2
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/RePublishFormDTO.java

@ -36,6 +36,8 @@ public class RePublishFormDTO implements Serializable {
*/
private String actDraftId;
private String gridId;
/**
* 活动id
*/

6
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/CommunitySelfOrganizationListDTO.java

@ -53,6 +53,11 @@ public class CommunitySelfOrganizationListDTO implements Serializable {
*/
private String organizationCreatedTime;
/**
* 备注
*/
private String remark;
/**
* 经度
*/
@ -87,6 +92,7 @@ public class CommunitySelfOrganizationListDTO implements Serializable {
this.longitude = "";
this.latitude = "";
this.orgId = "";
this.remark = "";
this.score = NumConstant.ZERO;
this.organizationPersonnel = new ArrayList<>();
}

3
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ActPreviewResultDTO.java

@ -101,6 +101,9 @@ public class ActPreviewResultDTO implements Serializable {
*/
private String actType;
private String gridId;
private String gridName;
/**
* 联建单位
*/

2
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/CanceledActDetailResultDTO.java

@ -153,6 +153,8 @@ public class CanceledActDetailResultDTO implements Serializable {
*/
private String actType;
private String gridId;
private String gridName;
/**
* 联建单位
*/

3
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/FinishedActDetailResultDTO.java

@ -142,6 +142,9 @@ public class FinishedActDetailResultDTO implements Serializable {
*/
private String actType;
private String gridId;
private String gridName;
/**
* 联建单位
*/

3
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/InProgressActDetailResultDTO.java

@ -137,6 +137,9 @@ public class InProgressActDetailResultDTO implements Serializable {
*/
private String actType;
private String gridId;
private String gridName;
/**
* 联建单位
*/

1
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/LatestDraftActInfoResultDTO.java

@ -21,6 +21,7 @@ public class LatestDraftActInfoResultDTO implements Serializable {
* 活动草稿id
*/
private String actDraftId;
private String gridId;
/**
* 客户id
*/

3
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ReEditActInfoResultDTO.java

@ -154,6 +154,9 @@ public class ReEditActInfoResultDTO implements Serializable {
*/
private String actType;
private String gridId;
private String gridName;
/**
* 联建单位
*/

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

@ -12,6 +12,7 @@ import com.epmet.dto.result.demand.IcResiDemandDictDTO;
import com.epmet.dto.result.resi.PageVolunteerInfoResultDTO;
import com.epmet.feign.fallback.EpmetHeartOpenFeignClientFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
@ -92,4 +93,14 @@ public interface EpmetHeartOpenFeignClient {
*/
@PostMapping("/heart/resi/volunteer/modifyVolunteerGrid")
Result modifyVolunteerGrid(@RequestBody VolunteerInfoDTO volunteerInfoDTO);
/**
* 客户初始化数据
* @Param customerId
* @Return {@link Result}
* @Author zhaoqifeng
* @Date 2022/4/14 14:50
*/
@GetMapping("/heart/serviceitem/initCustomer/{customerId}")
Result customerInit(@PathVariable(value = "customerId") String customerId);
}

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

@ -88,4 +88,18 @@ public class EpmetHeartOpenFeignClientFallback implements EpmetHeartOpenFeignCli
public Result modifyVolunteerGrid(VolunteerInfoDTO volunteerInfoDTO) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_HEART_SERVER, "modifyVolunteerGrid", volunteerInfoDTO);
}
/**
* 客户初始化数据
*
* @param customerId
* @Param customerId
* @Return {@link Result}
* @Author zhaoqifeng
* @Date 2022/4/14 14:50
*/
@Override
public Result customerInit(String customerId) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_HEART_SERVER, "customerInit", customerId);
}
}

23
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceItemDictController.java

@ -12,13 +12,12 @@ import com.epmet.dto.form.demand.ServiceItemSelectFormDTO;
import com.epmet.dto.form.demand.StatusFormDTO;
import com.epmet.dto.result.demand.OptionDTO;
import com.epmet.dto.result.demand.ServiceItemResultDTO;
import com.epmet.service.IcResiDemandDictService;
import com.epmet.service.IcServiceItemDictService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
/**
@ -33,6 +32,8 @@ public class IcServiceItemDictController {
@Autowired
private IcServiceItemDictService icServiceItemDictService;
@Resource
private IcResiDemandDictService icResiDemandDictService;
/**
@ -85,4 +86,18 @@ public class IcServiceItemDictController {
ValidatorUtils.validateEntity(formDTO,ServiceItemSelectFormDTO.AddUserInternalGroup.class);
return new Result<List<OptionDTO>>().ok(icServiceItemDictService.queryDictListForSelect(formDTO));
}
/**
* 客户初始化数据
* @Param customerId
* @Return {@link Result}
* @Author zhaoqifeng
* @Date 2022/4/14 14:50
*/
@GetMapping("initCustomer/{customerId}")
public Result customerInit(@PathVariable(value = "customerId") String customerId) {
icServiceItemDictService.customerInit(customerId);
icResiDemandDictService.customerInit(customerId);
return new Result();
}
}

5
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcCommunitySelfOrganizationEntity.java

@ -106,4 +106,9 @@ public class IcCommunitySelfOrganizationEntity extends BaseEpmetEntity {
*/
private String latitude;
/**
* 备注
*/
private String remark;
}

2
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcPartyActivityEntity.java

@ -47,7 +47,7 @@ public class IcPartyActivityEntity extends BaseEpmetEntity {
* 组织ID
*/
private String agencyId;
private String gridId;
/**
* 组织的所有上级
*/

2
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/LatestActInfoEntity.java

@ -43,7 +43,7 @@ public class LatestActInfoEntity extends BaseEpmetEntity {
* 客户id
*/
private String customerId;
private String gridId;
/**
* 活动标题
*/

3
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ExportCommunitySelfOrganizationExcel.java

@ -31,6 +31,9 @@ public class ExportCommunitySelfOrganizationExcel {
@Excel(name = "创建时间", width = 20, needMerge = true)
private String organizationCreatedTime;
@Excel(name = "备注", width = 60, needMerge = true)
private String remark;
@ExcelCollection(name = "组织成员")
private List<ImportCommunitySelfOrganizationSon> organizationPersonnel;

3
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ImportCommunitySelfOrganization.java

@ -40,6 +40,9 @@ public class ImportCommunitySelfOrganization extends ExcelVerifyInfo {
@Excel(name = "创建时间", needMerge = true)
private String organizationCreatedTime;
@Excel(name = "备注", needMerge = true)
private String remark;
@ExcelCollection(name = "组织成员")
private List<ImportCommunitySelfOrganizationSon> persons;

10
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcResiDemandDictService.java

@ -20,7 +20,6 @@ package com.epmet.service;
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.commons.tools.utils.Result;
import com.epmet.dto.form.demand.*;
import com.epmet.dto.result.demand.DemandCategoryResDTO;
import com.epmet.dto.result.demand.DemandPageResDTO;
@ -147,4 +146,13 @@ public interface IcResiDemandDictService extends BaseService<IcResiDemandDictEnt
* @return
*/
List<DemandCategoryResDTO> queryLatestOrder(String userId, String customerId);
/**
* 客户初始化
* @Param customerId
* @Return
* @Author zhaoqifeng
* @Date 2022/4/14 14:31
*/
void customerInit(String customerId);
}

9
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceItemDictService.java

@ -70,4 +70,13 @@ public interface IcServiceItemDictService extends BaseService<IcServiceItemDictE
* @return
*/
List<OptionDTO> queryDictListForSelect(ServiceItemSelectFormDTO formDTO);
/**
* 客户初始化
* @Param customerId
* @Return
* @Author zhaoqifeng
* @Date 2022/4/14 14:31
*/
void customerInit(String customerId);
}

28
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java

@ -28,7 +28,9 @@ import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.exception.ExceptionUtils;
import com.epmet.commons.tools.exception.RenException;
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.GridInfoCache;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.DateUtils;
@ -123,6 +125,12 @@ public class IcPartyActivityServiceImpl extends BaseServiceImpl<IcPartyActivityD
List<String> unitIds = Arrays.asList(dto.getUnitId().split(StrConstant.COMMA));
List<String> unitNames = unitIds.stream().map(option::get).collect(Collectors.toList());
dto.setUnitName(StringUtils.join(unitNames, StrConstant.COMMA));
if (StringUtils.isNotEmpty(dto.getGridId())) {
GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(dto.getGridId());
if (null != gridInfo) {
dto.setGridName(gridInfo.getGridName());
}
}
});
}
@ -150,6 +158,12 @@ public class IcPartyActivityServiceImpl extends BaseServiceImpl<IcPartyActivityD
List<String> unitIds = Arrays.asList(dto.getUnitId().split(StrConstant.COMMA));
List<String> unitNames = unitIds.stream().map(option::get).collect(Collectors.toList());
dto.setUnitName(StringUtils.join(unitNames, StrConstant.COMMA));
if (StringUtils.isNotEmpty(dto.getGridId())) {
GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(dto.getGridId());
if (null != gridInfo) {
dto.setGridName(gridInfo.getGridName());
}
}
});
}
@ -171,6 +185,12 @@ public class IcPartyActivityServiceImpl extends BaseServiceImpl<IcPartyActivityD
List<String> serviceNames = services.stream().map(categoryMap::get).collect(Collectors.toList());
dto.setServiceMatterList(services);
dto.setServiceMatterNameList(serviceNames);
if (StringUtils.isNotEmpty(dto.getGridId())) {
GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(dto.getGridId());
if (null != gridInfo) {
dto.setGridName(gridInfo.getGridName());
}
}
//获取单位
//获取组织下联建单位
@ -547,6 +567,14 @@ public class IcPartyActivityServiceImpl extends BaseServiceImpl<IcPartyActivityD
List<String> services = Arrays.asList(dto.getServiceMatter().split(StrConstant.COMMA));
List<String> serviceNames = services.stream().map(categoryMap::get).collect(Collectors.toList());
dto.setServiceMatterName(StringUtils.join(serviceNames, StrConstant.SEMICOLON));
if (StringUtils.isNotEmpty(dto.getGridId())) {
GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(dto.getGridId());
if (null != gridInfo) {
dto.setGridName(gridInfo.getGridName());
}
}
});
}
PageInfo<IcPartyActivityDTO> pageInfo = new PageInfo<>(dtoList);

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

@ -333,5 +333,34 @@ public class IcResiDemandDictServiceImpl extends BaseServiceImpl<IcResiDemandDic
return new ArrayList<>();
}
/**
* 客户初始化
*
* @param customerId
* @Param customerId
* @Return
* @Author zhaoqifeng
* @Date 2022/4/14 14:31
*/
@Override
public void customerInit(String customerId) {
String defaultCustomerId = "default";
LambdaQueryWrapper<IcResiDemandDictEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(IcResiDemandDictEntity::getCustomerId, defaultCustomerId);
List<IcResiDemandDictEntity> list = baseDao.selectList(wrapper);
if (CollectionUtils.isNotEmpty(list)) {
list.forEach(item -> {
String uuid = UUID.randomUUID().toString().replaceAll("-","");
item.setId(uuid);
item.setCustomerId(customerId);
item.setCreatedBy("init_user");
item.setCreatedTime(new Date());
item.setUpdatedBy("init_user");
item.setUpdatedTime(new Date());
baseDao.insert(item);
});
}
}
}

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

@ -42,6 +42,7 @@ import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.UUID;
/**
* 服务事项分类字典表
@ -171,5 +172,34 @@ public class IcServiceItemDictServiceImpl extends BaseServiceImpl<IcServiceItemD
return resultList;
}
/**
* 客户初始化
*
* @param customerId
* @Param customerId
* @Return
* @Author zhaoqifeng
* @Date 2022/4/14 14:31
*/
@Override
public void customerInit(String customerId) {
String defaultCustomerId = "default";
LambdaQueryWrapper<IcServiceItemDictEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(IcServiceItemDictEntity::getCustomerId, defaultCustomerId);
List<IcServiceItemDictEntity> list = baseDao.selectList(wrapper);
if (CollectionUtils.isNotEmpty(list)) {
list.forEach(item -> {
String uuid = UUID.randomUUID().toString().replaceAll("-","");
item.setId(uuid);
item.setCustomerId(customerId);
item.setCreatedBy("init_user");
item.setCreatedTime(new Date());
item.setUpdatedBy("init_user");
item.setUpdatedTime(new Date());
baseDao.insert(item);
});
}
}
}

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;

57
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActDraftServiceImpl.java

@ -2,6 +2,8 @@ package com.epmet.service.impl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.redis.common.CustomerOrgRedis;
import com.epmet.commons.tools.redis.common.bean.GridInfoCache;
import com.epmet.commons.tools.security.user.LoginUserUtil;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.constant.ActConstant;
@ -16,6 +18,7 @@ import com.epmet.dto.result.work.*;
import com.epmet.entity.LatestActServiceRelationEntity;
import com.epmet.entity.LatestActUnitRelationEntity;
import com.epmet.service.*;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@ -131,29 +134,32 @@ public class WorkActDraftServiceImpl implements WorkActDraftService {
//保存活动与服务关系
latestActServiceRelationService.deleteByAct(actDraftId);
AtomicInteger i = new AtomicInteger(NumConstant.ONE);
List<LatestActServiceRelationEntity> serviceList = formDTO.getServiceMatterList().stream().map(service -> {
LatestActServiceRelationEntity entity = new LatestActServiceRelationEntity();
entity.setCustomerId(formDTO.getCustomerId());
entity.setActId(actDraftId);
entity.setServiceMatter(service);
entity.setSort(i.getAndIncrement());
return entity;
}).collect(Collectors.toList());
latestActServiceRelationService.insertBatch(serviceList);
if (CollectionUtils.isNotEmpty(formDTO.getServiceMatterList())) {
AtomicInteger i = new AtomicInteger(NumConstant.ONE);
List<LatestActServiceRelationEntity> serviceList = formDTO.getServiceMatterList().stream().map(service -> {
LatestActServiceRelationEntity entity = new LatestActServiceRelationEntity();
entity.setCustomerId(formDTO.getCustomerId());
entity.setActId(actDraftId);
entity.setServiceMatter(service);
entity.setSort(i.getAndIncrement());
return entity;
}).collect(Collectors.toList());
latestActServiceRelationService.insertBatch(serviceList);
}
//保存活动与单位关系
latestActUnitRelationService.deleteByAct(actDraftId);
AtomicInteger j = new AtomicInteger(NumConstant.ONE);
List<LatestActUnitRelationEntity> unitList = formDTO.getUnitIdList().stream().map(unitId -> {
LatestActUnitRelationEntity entity = new LatestActUnitRelationEntity();
entity.setCustomerId(formDTO.getCustomerId());
entity.setActId(actDraftId);
entity.setUnitId(unitId);
entity.setSort(j.getAndIncrement());
return entity;
}).collect(Collectors.toList());
latestActUnitRelationService.insertBatch(unitList);
if (CollectionUtils.isNotEmpty(formDTO.getServiceMatterList())) {
AtomicInteger j = new AtomicInteger(NumConstant.ONE);
List<LatestActUnitRelationEntity> unitList = formDTO.getUnitIdList().stream().map(unitId -> {
LatestActUnitRelationEntity entity = new LatestActUnitRelationEntity();
entity.setCustomerId(formDTO.getCustomerId());
entity.setActId(actDraftId);
entity.setUnitId(unitId);
entity.setSort(j.getAndIncrement());
return entity;
}).collect(Collectors.toList());
latestActUnitRelationService.insertBatch(unitList);
}
return resultDTO;
}
@ -201,6 +207,13 @@ public class WorkActDraftServiceImpl implements WorkActDraftService {
List<String> unitNames = unitIds.stream().map(option::get).collect(Collectors.toList());
actPreviewResultDTO.setUnitIdList(unitIds);
actPreviewResultDTO.setUnitNameList(unitNames);
if (StringUtils.isNotEmpty(actPreviewResultDTO.getGridId())) {
GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(actPreviewResultDTO.getGridId());
if (null != gridInfo) {
actPreviewResultDTO.setGridName(gridInfo.getGridName());
}
}
}
}
return actPreviewResultDTO;
@ -337,7 +350,7 @@ public class WorkActDraftServiceImpl implements WorkActDraftService {
latestActInfoDTO.setActType(formDTO.getActType());
latestActInfoDTO.setTarget(formDTO.getTarget());
latestActInfoDTO.setGridId(formDTO.getGridId());
return latestActInfoDTO;
}

35
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java

@ -9,6 +9,8 @@ import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.dto.form.mq.eventmsg.BasePointEventMsg;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.redis.common.CustomerOrgRedis;
import com.epmet.commons.tools.redis.common.bean.GridInfoCache;
import com.epmet.commons.tools.scan.param.ImgScanParamDTO;
import com.epmet.commons.tools.scan.param.ImgTaskDTO;
import com.epmet.commons.tools.scan.param.TextScanParamDTO;
@ -832,6 +834,14 @@ public class WorkActServiceImpl implements WorkActService {
List<String> unitNames = unitIds.stream().map(option::get).collect(Collectors.toList());
canceledActDetailResultDTO.setUnitIdList(unitIds);
canceledActDetailResultDTO.setUnitNameList(unitNames);
if (StringUtils.isNotEmpty(dto.getGridId())) {
canceledActDetailResultDTO.setGridId(dto.getGridId());
GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(dto.getGridId());
if (null != gridInfo) {
canceledActDetailResultDTO.setGridName(gridInfo.getGridName());
}
}
}
}
}
@ -897,6 +907,14 @@ public class WorkActServiceImpl implements WorkActService {
List<String> unitNames = unitIds.stream().map(option::get).collect(Collectors.toList());
resultDTO.setUnitIdList(unitIds);
resultDTO.setUnitNameList(unitNames);
if (StringUtils.isNotEmpty(dto.getGridId())) {
resultDTO.setGridId(dto.getGridId());
GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(dto.getGridId());
if (null != gridInfo) {
resultDTO.setGridName(gridInfo.getGridName());
}
}
}
}
}
@ -986,6 +1004,14 @@ public class WorkActServiceImpl implements WorkActService {
List<String> unitNames = unitIds.stream().map(option::get).collect(Collectors.toList());
resultDTO.setUnitIdList(unitIds);
resultDTO.setUnitNameList(unitNames);
if (StringUtils.isNotEmpty(dto.getGridId())) {
resultDTO.setGridId(dto.getGridId());
GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(dto.getGridId());
if (null != gridInfo) {
resultDTO.setGridName(gridInfo.getGridName());
}
}
}
}
}
@ -1390,6 +1416,14 @@ public class WorkActServiceImpl implements WorkActService {
List<String> unitNames = unitIds.stream().map(option::get).collect(Collectors.toList());
resultDTO.setUnitIdList(unitIds);
resultDTO.setUnitNameList(unitNames);
if (StringUtils.isNotEmpty(dto.getGridId())) {
resultDTO.setGridId(dto.getGridId());
GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(dto.getGridId());
if (null != gridInfo) {
resultDTO.setGridName(gridInfo.getGridName());
}
}
}
}
@ -1563,6 +1597,7 @@ public class WorkActServiceImpl implements WorkActService {
}else{
logger.warn("根据agencyId查询组织信息失败,agencyId={}",formDTO.getSponsorId());
}
entity.setGridId(formDTO.getGridId());
entity.setActId(actInfoEntity.getId());
entity.setTitle(actInfoEntity.getTitle());
entity.setTarget(actInfoEntity.getTarget());

1
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.13__add_column_remark.sql

@ -0,0 +1 @@
alter table ic_community_self_organization add COLUMN REMARK VARCHAR(500) comment '备注' AFTER ORGANIZATION_CREATED_TIME;

4
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.14__activity_add_grid.sql

@ -0,0 +1,4 @@
ALTER TABLE `epmet_heart`.`ic_party_activity`
ADD COLUMN `GRID_ID` varchar(64) NULL COMMENT '网格ID' AFTER `AGENCY_ID`;
ALTER TABLE `epmet_heart`.`latest_act_info`
ADD COLUMN `GRID_ID` varchar(64) NULL COMMENT '网格ID' AFTER `CUSTOMER_ID`;

7
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcCommunitySelfOrganizationDao.xml

@ -14,6 +14,7 @@
LONGITUDE = #{longitude},
LATITUDE = #{latitude},
ORGANIZATION_CREATED_TIME = #{organizationCreatedTime},
REMARK = #{remark},
UPDATED_TIME = NOW(),
UPDATED_BY = #{updatedBy}
WHERE DEL_FLAG = 0
@ -52,7 +53,8 @@
so.SERVICE_ITEM AS serviceItem,
so.LONGITUDE AS longitude,
so.LATITUDE AS latitude,
so.ID as orgId
so.ID as orgId,
so.remark
FROM ic_community_self_organization so
WHERE so.DEL_FLAG = 0
AND so.ORG_ID = #{agencyId}
@ -60,6 +62,9 @@
<if test="null != organizationName and organizationName != '' ">
AND so.ORGANIZATION_NAME LIKE CONCAT('%',#{organizationName},'%')
</if>
<if test="null != remark and remark != '' ">
AND so.REMARK LIKE CONCAT('%',#{remark},'%')
</if>
<if test=" null != startTime and startTime != '' ">
AND so.ORGANIZATION_CREATED_TIME <![CDATA[ >= ]]> #{startTime}
</if>

5
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyActivityDao.xml

@ -49,6 +49,7 @@
<select id="selectActivityList" resultType="com.epmet.entity.IcPartyActivityEntity" parameterType = "com.epmet.dto.form.PartyActivityFormDTO">
SELECT
a.ID,
a.GRID_ID,
b.unitId,
c.serviceMatter,
TITLE,
@ -95,10 +96,14 @@
WHERE
a.DEL_FLAG = '0'
AND a.AGENCY_ID = #{agencyId}
<if test='null != gridId and "" != gridId'>
AND a.GRID_ID = #{gridId}
</if>
<if test='null != title and "" != title'>
AND TITLE LIKE concat('%', #{title}, '%')
</if>
AND ACTIVITY_TIME BETWEEN #{startTime} AND #{endTime}
ORDER BY ACTIVITY_TIME DESC
</select>

1
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LatestActInfoDao.xml

@ -102,6 +102,7 @@
<select id="previewActInfo" parameterType="java.lang.String" resultType="com.epmet.dto.result.work.ActPreviewResultDTO">
SELECT
lai.id AS actDraftId,
lai.GRID_ID AS gridId,
lai.title AS title,
lai.ACT_QUOTA AS actQuota,
lai.ACT_QUOTA_CATEGORY AS actQuotaCategory,

BIN
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/templates/self_org_import_template.xlsx

Binary file not shown.

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

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

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

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

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

@ -0,0 +1,29 @@
package com.epmet.dto.form;
import com.epmet.commons.tools.dto.form.PageFormDTO;
import lombok.Data;
/**
* desc: 楼宇列表查询条件
*
* @return
* @author LiuJanJun
* @date 2022/4/13 2:45 下午
*/
@Data
public class IcBuildingListFormDTO extends PageFormDTO {
private static final long serialVersionUID = -7536532648656861790L;
/**
* 小区ID
*/
private String neighborHoodId;
/**
* 房主姓名
*/
private String ownerName;
/**
* 房主电话
*/
private String ownerPhone;
}

4
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcBulidingFormDTO.java → epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcBulidingAddFormDTO.java

@ -27,7 +27,7 @@ import java.io.Serializable;
@Data
public class IcBulidingFormDTO implements Serializable {
public class IcBulidingAddFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
@ -126,4 +126,4 @@ public class IcBulidingFormDTO implements Serializable {
}
}

6
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcHouseFormDTO.java → epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcHouseAddFormDTO.java

@ -26,7 +26,7 @@ import java.io.Serializable;
@Data
public class IcHouseFormDTO implements Serializable {
public class IcHouseAddFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
@ -79,9 +79,9 @@ public class IcHouseFormDTO implements Serializable {
private String purpose;
/**
* 1出租0未出租
* 1出租 0自住 2闲置
*/
@NotNull(message = "是否出租不能为空", groups = {AddShowGroup.class, UpdateShowGroup.class})
@NotNull(message = "房屋状态不能为空", groups = {AddShowGroup.class, UpdateShowGroup.class})
private Integer rentFlag;
/**

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

@ -0,0 +1,69 @@
package com.epmet.dto.form;/**
* Created by 11 on 2020/3/19.
*/
import com.epmet.commons.tools.dto.form.PageFormDTO;
import lombok.Data;
/**
* @Description 小区房屋列表查询条件
* @ClassName ListCustomerGridFormDTO
* @Author wangc
* @date 2020.03.19 15:00
*/
@Data
public class IcHouseListFormDTO extends PageFormDTO {
private static final long serialVersionUID = -1L;
/**
* 组织类别
*/
private String level;
private String id;
/**
* 组织ID
*/
private String agencyId;
private String pids;
private String gridId;
/**
* 小区名字
*/
private String neighborHoodName;
/**
* 楼栋名字
*/
private String buildingName;
/**
* 房主姓名
*/
private String ownerName;
/**
* 房主电话
*/
private String ownerPhone;
/**
* 房屋状态 1出租 0自住 2闲置
*/
private String rentFlag;
/**
* 楼栋ID
*/
private String buildingId;
/**
* 小区ID
*/
private String neighborHoodId;
/**
* 搜索关键词社区查询搜索输入的关键词
*/
private String keyword;
}

2
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcNeighborHoodFormDTO.java → epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcNeighborHoodAddFormDTO.java

@ -27,7 +27,7 @@ import javax.validation.constraints.NotBlank;
@Data
public class IcNeighborHoodFormDTO extends PageFormDTO {
public class IcNeighborHoodAddFormDTO extends PageFormDTO {
private static final long serialVersionUID = 1L;

63
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcNeighborHoodListFormDTO.java

@ -0,0 +1,63 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dto.form;
import com.epmet.commons.tools.dto.form.PageFormDTO;
import lombok.Data;
import javax.validation.constraints.NotBlank;
@Data
public class IcNeighborHoodListFormDTO extends PageFormDTO {
private static final long serialVersionUID = 1L;
/**
* 组织类别
*/
@NotBlank(message = "组织类别不能为空")
private String level;
/**
* orgId 跟level配套使用
*/
@NotBlank(message = "组织Id不能为空")
private String id;
/**
* 组织ID
*/
private String agencyId;
private String pids;
private String gridId;
/**
* 房主姓名
*/
private String ownerName;
/**
* 房主电话
*/
private String ownerPhone;
}

85
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/ListIcNeighborHoodFormDTO.java

@ -1,85 +0,0 @@
package com.epmet.dto.form;/**
* Created by 11 on 2020/3/19.
*/
import lombok.Data;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import java.io.Serializable;
/**
* @Description 陌生人导览查询附近网格传参定义
* @ClassName ListCustomerGridFormDTO
* @Author wangc
* @date 2020.03.19 15:00
*/
@Data
public class ListIcNeighborHoodFormDTO implements Serializable{
private static final long serialVersionUID = -1L;
/**
* 当前页
* */
private Integer pageNo = 1;
/**
* 每页显示数量
* */
private Integer pageSize = 20;
/**
* 组织类别
*/
private String level ;
private String id;
/**
* 组织ID
*/
// private String agencyId;
/**
* 网格ID
*/
// private String gridId;
/**
* 小区名字
*/
// private String neighborHoodName;
/**
* 楼栋名字
*/
// private String buildingName;
/**
* 房主姓名
*/
private String ownerName;
/**
* 房主电话
*/
private String ownerPhone;
/**
* 数据类型小区neighbourHood楼栋building房屋house
*/
// @Pattern(regexp = "^(neighbourHood|building|house)?$",message = "数据类型选择错误")
// private String dataType;
/**
* 楼栋ID
*/
private String buildingId;
/**
* 小区ID
*/
private String neighborHoodId;
/**
* 搜索关键词社区查询搜索输入的关键词
*/
private String keyword;
}

17
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/HouseResultDTO.java

@ -1,17 +0,0 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Description
* @Author zhaoqifeng
* @Date 2021/10/25 16:58
*/
@Data
public class HouseResultDTO implements Serializable {
private static final long serialVersionUID = 8054109017922254586L;
private String houseId;
private String houseName;
}

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

@ -0,0 +1,20 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2022/4/12 16:40
* @DESC
*/
@Data
public class HousesNameResultDTO implements Serializable {
private static final long serialVersionUID = -8643628706377635279L;
private String idCard;
private String houseName;
}

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

@ -0,0 +1,35 @@
package com.epmet.dto.result;
import com.epmet.commons.tools.dto.form.PageFormDTO;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* desc:楼宇列表结果类
*
* @author: LiuJanJun
* @date: 2022/4/13 2:28 下午
* @version: 1.0
*/
@NoArgsConstructor
@Data
public class IcBuildingListResultDTO extends PageFormDTO {
private static final long serialVersionUID = -8277921228438123299L;
private String gridName;
private Integer totalHouseNum;
private String latitude;
private String agencyId;
private Integer sort;
private String agencyName;
private String buildingId;
private String buildingName;
private String buildingTypeKey;
private String neighborHoodId;
private String neighborHoodName;
private Integer totalFloorNum;
private String gridId;
private Integer totalUnitNum;
private String longitude;
private String buildingType;
}

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

@ -0,0 +1,38 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* desc:房屋列表结果类
* @author liujianjun
*/
@Data
public class IcHouseListResultDTO implements Serializable {
private static final long serialVersionUID = 4963952996288796744L;
private String houseId;
private String ownerPhone;
private String purpose;
private String doorName;
private String houseType;
private String unitNum;
private String agencyId;
private String buildingId;
private String houseName;
private String buildingName;
private String rentFlag;
private String ownerName;
private String neighborHoodId;
private String purposeKey;
private String neighborHoodName;
private String unitNumKey;
private String ownerIdCard;
private String gridId;
private String houseTypeKey;
private Integer rentFlagKey;
}

37
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/IcNeighborHoodResultDTO.java

@ -1,10 +1,8 @@
package com.epmet.dto.result;
import com.epmet.commons.tools.dto.form.PageFormDTO;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
import java.util.Map;
import lombok.NoArgsConstructor;
/**
* @Description 网格列表信息
@ -12,25 +10,22 @@ import java.util.Map;
* @Author wangc
* @date 2020.04.23 14:21
*/
@NoArgsConstructor
@Data
public class IcNeighborHoodResultDTO implements Serializable {
public class IcNeighborHoodResultDTO extends PageFormDTO {
private static final long serialVersionUID = 1L;
/**
* 总条数
* */
private Integer total;
// /**
// * 数据类型【小区:neighbourHood,楼栋:building,房屋:house】
// * */
// private String dataType;
/**
* 结果集
*/
private List<Map<String,Object>> list;
private String gridName;
private String address;
private String neighborHoodId;
private String neighborHoodName;
private String latitude;
private String remark;
private String agencyId;
private String location;
private String gridId;
private String propertyId;
private String agencyName;
private String longitude;
}

8
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/enums/HouseRentFlagEnums.java

@ -3,8 +3,12 @@ package com.epmet.enums;
import org.springframework.util.StringUtils;
public enum HouseRentFlagEnums {
YES(1,"是"),
NO(0,"否");
//原有的房屋出租状态是否改为房屋状态【1:出租 0:自住 2:闲置】
/*YES(1,"是"),
NO(0,"否");*/
HOUSE_ZZ(0,"自住"),
HOUSE_CZ(1,"出租"),
HOUSE_XZ(2,"闲置");

9
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java

@ -605,4 +605,13 @@ public interface GovOrgOpenFeignClient {
*/
@PostMapping("/gov/org/customerstaffgrid/getallstaffbygridid")
Result<List<String>> getAllStaffByGridId(@RequestParam("gridId")String gridId);
/**
* Desc: 根据身份证查询房屋名
* @param idCards
* @author zxc
* @date 2022/4/12 16:42
*/
@PostMapping("/gov/org/ichouse/houses-name")
Result<List<HousesNameResultDTO>> getHousesNameByIdCards(@RequestBody List<String> idCards);
}

5
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java

@ -393,4 +393,9 @@ public class GovOrgOpenFeignClientFallback implements GovOrgOpenFeignClient {
public Result<List<String>> getAllStaffByGridId(String gridId) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getAllStaffByGridId", gridId);
}
@Override
public Result<List<HousesNameResultDTO>> getHousesNameByIdCards(List<String> idCards) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getHousesNameByIdCards", idCards);
}
}

41
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/BuildingController.java

@ -26,6 +26,7 @@ import com.epmet.commons.tools.aop.NoRepeatSubmit;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
@ -33,10 +34,7 @@ import com.epmet.constants.ImportTaskConstants;
import com.epmet.dao.IcBuildingUnitDao;
import com.epmet.dto.BuildingTreeLevelDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.BuildingResultDTO;
import com.epmet.dto.result.BuildingResultPagedDTO;
import com.epmet.dto.result.IcNeighborHoodResultDTO;
import com.epmet.dto.result.ImportTaskCommonResultDTO;
import com.epmet.dto.result.*;
import com.epmet.entity.IcBuildingUnitEntity;
import com.epmet.excel.IcBuildingExcel;
import com.epmet.feign.EpmetCommonServiceOpenFeignClient;
@ -75,19 +73,17 @@ public class BuildingController {
@PostMapping("buildinglist")
public Result houseList(@RequestBody ListIcNeighborHoodFormDTO formDTO){
//效验数据
ValidatorUtils.validateEntity(formDTO);
IcNeighborHoodResultDTO icNeighborHoodResultDTO = buildingService.listBuilding(formDTO);
public Result<PageData<IcBuildingListResultDTO>> houseList(@RequestBody IcBuildingListFormDTO formDTO){
PageData<IcBuildingListResultDTO> icNeighborHoodResultDTO = buildingService.listBuilding(formDTO);
return new Result().ok(icNeighborHoodResultDTO);
}
@NoRepeatSubmit
@PostMapping("buildingadd")
public Result buildingAdd(@LoginUser TokenDto tokenDTO, @RequestBody IcBulidingFormDTO formDTO){
public Result buildingAdd(@LoginUser TokenDto tokenDTO, @RequestBody IcBulidingAddFormDTO formDTO){
//效验数据
ValidatorUtils.validateEntity(formDTO, IcBulidingFormDTO.AddShowGroup.class);
ValidatorUtils.validateEntity(formDTO, IcBulidingAddFormDTO.AddShowGroup.class);
String customerId = tokenDTO.getCustomerId();
buildingService.addBuilding(customerId,formDTO);
return new Result().ok("保存成功");
@ -95,9 +91,9 @@ public class BuildingController {
@NoRepeatSubmit
@PostMapping("buildingupdate")
public Result buildingUpdate(@LoginUser TokenDto tokenDTO, @RequestBody IcBulidingFormDTO formDTO){
public Result buildingUpdate(@LoginUser TokenDto tokenDTO, @RequestBody IcBulidingAddFormDTO formDTO){
//效验数据
ValidatorUtils.validateEntity(formDTO, IcBulidingFormDTO.UpdateShowGroup.class);
ValidatorUtils.validateEntity(formDTO, IcBulidingAddFormDTO.UpdateShowGroup.class);
String customerId = tokenDTO.getCustomerId();
// String customerId = "123123";
buildingService.updateBuilding(customerId,formDTO);
@ -105,9 +101,9 @@ public class BuildingController {
}
@PostMapping("buildingdel")
public Result buildingDel(@LoginUser TokenDto tokenDTO, @RequestBody IcBulidingFormDTO formDTO){
public Result buildingDel(@LoginUser TokenDto tokenDTO, @RequestBody IcBulidingAddFormDTO formDTO){
//效验数据
ValidatorUtils.validateEntity(formDTO, IcBulidingFormDTO.DeleteGroup.class);
ValidatorUtils.validateEntity(formDTO, IcBulidingAddFormDTO.DeleteGroup.class);
String buildingId = formDTO.getBuildingId();
buildingService.delBuilding(buildingId);
return new Result();
@ -118,6 +114,18 @@ public class BuildingController {
List<BuildingTreeLevelDTO> buildingTreeLevelDTOS =buildingService.treeList(tokenDTO.getCustomerId(), tokenDTO.getUserId());
return new Result().ok(buildingTreeLevelDTOS);
}
/**
* Desc: 根据前端方便新开接口只返回树的ID
* @param tokenDTO
* @author zxc
* @date 2022/4/12 15:20
*/
@PostMapping("tree-ids")
public Result treeIds(@LoginUser TokenDto tokenDTO){
List<String> ids =buildingService.treeIds(tokenDTO.getCustomerId(), tokenDTO.getUserId());
return new Result().ok(ids);
}
/**
* 导出模板
* @param response
@ -125,7 +133,6 @@ public class BuildingController {
*/
@PostMapping("exporttemplate")
public void exportTemplate( HttpServletResponse response) throws Exception {
TemplateExportParams templatePath = new TemplateExportParams("excel/building_template.xlsx");
Map<String,Object> map = new HashMap<>();
map.put("maplist",new ArrayList<IcBuildingExcel>());
@ -139,7 +146,7 @@ public class BuildingController {
* @throws Exception
*/
@RequestMapping("exportbuildinginfo")
public void exportbuildinginfo(@RequestBody ListIcNeighborHoodFormDTO formDTO, HttpServletResponse response) throws Exception {
public void exportbuildinginfo(@RequestBody IcHouseListFormDTO formDTO, HttpServletResponse response) throws Exception {
ValidatorUtils.validateEntity(formDTO);
buildingService.exportBuildinginfo(formDTO,response);
@ -153,7 +160,7 @@ public class BuildingController {
*/
@GetMapping("export")
public void export(HttpServletResponse response) throws Exception {
ListIcNeighborHoodFormDTO formDTO = new ListIcNeighborHoodFormDTO();
IcHouseListFormDTO formDTO = new IcHouseListFormDTO();
ValidatorUtils.validateEntity(formDTO);
buildingService.exportBuildinginfo(formDTO,response);

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

@ -26,6 +26,7 @@ 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.feign.ResultDataResolver;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
@ -33,7 +34,7 @@ import com.epmet.constants.ImportTaskConstants;
import com.epmet.dao.IcBuildingDao;
import com.epmet.dto.form.*;
import com.epmet.dto.result.HouseInfoDTO;
import com.epmet.dto.result.IcNeighborHoodResultDTO;
import com.epmet.dto.result.IcHouseListResultDTO;
import com.epmet.dto.result.ImportTaskCommonResultDTO;
import com.epmet.dto.result.LoginUserDetailsResultDTO;
import com.epmet.excel.IcHouseExcel;
@ -85,35 +86,25 @@ public class HouseController implements ResultDataResolver {
@PostMapping("houselist")
public Result houseList(@RequestBody ListIcNeighborHoodFormDTO formDTO){
public Result<PageData<IcHouseListResultDTO>> houseList(@RequestBody IcHouseListFormDTO formDTO) {
//效验数据
ValidatorUtils.validateEntity(formDTO);
String queryScene = "house_manage";
IcNeighborHoodResultDTO icNeighborHoodResultDTO = houseService.listNeighborhood(null, formDTO.getBuildingId(), formDTO.getOwnerName(),
formDTO.getOwnerPhone(), null,
null, queryScene,
formDTO.getPageNo(), formDTO.getPageSize());
return new Result().ok(icNeighborHoodResultDTO);
return new Result().ok(houseService.getHouseList(formDTO));
}
/**
*@Description 社区查询-搜索房屋
*@Author wangxianzhang
*@Date 2022/1/14 11:00 上午
*@Param
*@return
*/
* @return
* @Description 社区查询-搜索房屋
* @Author wangxianzhang
* @Date 2022/1/14 11:00 上午
* @Param
*/
@PostMapping("search")
public Result<IcNeighborHoodResultDTO> searchHouse(@RequestBody ListIcNeighborHoodFormDTO formDTO, @LoginUser TokenDto loginUser) {
public Result<PageData<IcHouseListResultDTO>> searchHouse(@RequestBody IcHouseListFormDTO formDTO, @LoginUser TokenDto loginUser) {
String keyword = formDTO.getKeyword();
if (StringUtils.isBlank(keyword)) {
IcNeighborHoodResultDTO r = new IcNeighborHoodResultDTO();
r.setTotal(0);
r.setList(new ArrayList<>());
return new Result<IcNeighborHoodResultDTO>().ok(r);
return new Result<PageData<IcHouseListResultDTO>>().ok(new PageData<>(new ArrayList<>(), NumConstant.ZERO));
}
keyword = keyword.trim();
@ -129,9 +120,6 @@ public class HouseController implements ResultDataResolver {
buildingName = null;
}
// 使用场景:社区查询
String scene = "community_search";
LoginUserDetailsFormDTO form = new LoginUserDetailsFormDTO();
form.setUserId(loginUser.getUserId());
form.setClient(loginUser.getClient());
@ -140,50 +128,52 @@ public class HouseController implements ResultDataResolver {
EpmetErrorCode.SERVER_ERROR.getCode(),
"【社区查询-查询房屋】查询当前staff所在组织信息失败",
null);
IcNeighborHoodResultDTO icNeighborHoodResultDTO = houseService.listNeighborhood(loginUserDetail.getAgencyId(),null, null, null,
neighborhoodName, buildingName, scene, formDTO.getPageNo(), formDTO.getPageSize());
return new Result<IcNeighborHoodResultDTO>().ok(icNeighborHoodResultDTO);
formDTO.setAgencyId(loginUserDetail.getAgencyId());
formDTO.setBuildingName(buildingName);
formDTO.setNeighborHoodName(neighborhoodName);
return new Result<PageData<IcHouseListResultDTO>>().ok(houseService.getHouseList(formDTO));
}
@NoRepeatSubmit
@PostMapping("houseadd")
public Result houseAdd(@LoginUser TokenDto tokenDTO, @RequestBody IcHouseFormDTO formDTO){
public Result houseAdd(@LoginUser TokenDto tokenDTO, @RequestBody IcHouseAddFormDTO formDTO) {
//效验数据
ValidatorUtils.validateEntity(formDTO, IcHouseFormDTO.AddShowGroup.class);
ValidatorUtils.validateEntity(formDTO, IcHouseAddFormDTO.AddShowGroup.class);
String customerId = tokenDTO.getCustomerId();
// String customerId = "123123";
houseService.addHouse(customerId,formDTO);
houseService.addHouse(customerId, formDTO);
return new Result();
}
@NoRepeatSubmit
@PostMapping("houseupdate")
public Result houseUpdate(@LoginUser TokenDto tokenDTO, @RequestBody IcHouseFormDTO formDTO){
public Result houseUpdate(@LoginUser TokenDto tokenDTO, @RequestBody IcHouseAddFormDTO formDTO) {
//效验数据
ValidatorUtils.validateEntity(formDTO, IcHouseFormDTO.UpdateShowGroup.class);
ValidatorUtils.validateEntity(formDTO, IcHouseAddFormDTO.UpdateShowGroup.class);
String customerId = tokenDTO.getCustomerId();
// String customerId = "123123";
houseService.updateHouse(customerId,formDTO);
houseService.updateHouse(customerId, formDTO);
return new Result();
}
/**
* lzh
*
* @param formDTO
* @return 单独删除房屋内部调用/gov/org/house/delete
*/
@PostMapping("housedel")
public Result houseDel(@RequestBody IcHouseFormDTO formDTO){
public Result houseDel(@RequestBody IcHouseAddFormDTO formDTO) {
//效验数据
ValidatorUtils.validateEntity(formDTO, IcNeighborHoodFormDTO.DeleteGroup.class);
ValidatorUtils.validateEntity(formDTO, IcNeighborHoodAddFormDTO.DeleteGroup.class);
houseService.delHouse(formDTO.getHouseId());
return new Result();
}
/**
* 导出模板
*
* @param response
* @throws Exception
*/
@ -191,26 +181,29 @@ public class HouseController implements ResultDataResolver {
public void exportTemplate(HttpServletResponse response) throws Exception {
// ValidatorUtils.validateEntity(ListIcNeighborHoodFormDTO.class);
TemplateExportParams templatePath = new TemplateExportParams("excel/house_template.xlsx");
Map<String,Object> map = new HashMap<>();
map.put("maplist",new ArrayList<IcHouseExcel>());
ExcelPoiUtils.exportExcel(templatePath ,map,"房屋信息录入表",response);
Map<String, Object> map = new HashMap<>();
map.put("maplist", new ArrayList<IcHouseExcel>());
ExcelPoiUtils.exportExcel(templatePath, map, "房屋信息录入表", response);
}
/**
* 导出
*
* @param formDTO
* @param response
* @throws Exception
*/
@RequestMapping("exporthouseinfo")
public void exporthouseinfo(@RequestBody ListIcNeighborHoodFormDTO formDTO, HttpServletResponse response) throws Exception {
public void exporthouseinfo(@RequestBody IcHouseListFormDTO formDTO, HttpServletResponse response) throws Exception {
ValidatorUtils.validateEntity(formDTO);
houseService.exportBuildinginfo(formDTO,response);
houseService.exportBuildinginfo(formDTO, response);
}
/**
* 导入数据
*
* @param file
* @return
* @throws IOException
@ -227,34 +220,34 @@ public class HouseController implements ResultDataResolver {
//存放错误数据行号
List<Integer> numList = new ArrayList<>();
if(!CollectionUtils.isEmpty(failList)){
for ( IcHouseExcel entity : failList) {
log.warn("第{}行,{}",entity.getRowNum(),entity.getErrorMsg());//打印失败的行 和失败的信息
if (!CollectionUtils.isEmpty(failList)) {
for (IcHouseExcel entity : failList) {
log.warn("第{}行,{}", entity.getRowNum(), entity.getErrorMsg());//打印失败的行 和失败的信息
numList.add(entity.getRowNum());
}
}
List<IcHouseExcel> result =importResult.getList();
List<IcHouseExcel> result = importResult.getList();
List<Integer> resultList = houseService.importExcel(customerId,result,tokenDTO.getUserId(),numList);
String str = String.format("共%s条,成功导入%s条。",numList.size()+result.size(),numList.size()+result.size()-resultList.size());
if(resultList.size()> NumConstant.ZERO){
List<Integer> resultList = houseService.importExcel(customerId, result, tokenDTO.getUserId(), numList);
String str = String.format("共%s条,成功导入%s条。", numList.size() + result.size(), numList.size() + result.size() - resultList.size());
if (resultList.size() > NumConstant.ZERO) {
Collections.sort(resultList);
String subList = resultList.stream().map(String::valueOf).collect(Collectors.joining("、"));
log.warn(str + "第" + subList + "行未成功!");
return new Result().error(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), str+"第"+subList+"行未成功!");
return new Result().error(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), str + "第" + subList + "行未成功!");
}
return new Result().ok(str);
}
@PostMapping( "queryListHouseInfo")
Result<List<HouseInfoDTO>> queryListHouseInfo(@RequestBody Set<String> houseIds, @RequestParam("customerId") String customerId){
return new Result<List<HouseInfoDTO>>().ok(houseService.queryListHouseInfo(houseIds,customerId));
@PostMapping("queryListHouseInfo")
Result<List<HouseInfoDTO>> queryListHouseInfo(@RequestBody Set<String> houseIds, @RequestParam("customerId") String customerId) {
return new Result<List<HouseInfoDTO>>().ok(houseService.queryListHouseInfo(houseIds, customerId));
}
@PostMapping("houseimport")
public Result houseImport(@LoginUser TokenDto tokenDTO, @RequestParam("file") MultipartFile file,
@RequestParam("orgId")String orgId,
@RequestParam("orgType")String orgType,HttpServletRequest multipartRequest){
@RequestParam("orgId") String orgId,
@RequestParam("orgType") String orgType, HttpServletRequest multipartRequest) {
ImportInfoFormDTO formDTO = new ImportInfoFormDTO();
formDTO.setCustomerId(tokenDTO.getCustomerId());
formDTO.setOrgType(orgType);
@ -265,32 +258,33 @@ public class HouseController implements ResultDataResolver {
importFormDTO.setOperatorId(formDTO.getUserId());
importFormDTO.setOriginFileName(file.getOriginalFilename());
Result<ImportTaskCommonResultDTO> importTask = epmetCommonServiceOpenFeignClient.createImportTask(importFormDTO);
if (!importTask.success()){
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"","存在进行中的导入");
if (!importTask.success()) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "", "存在进行中的导入");
}
InputStream inputStream = null;
try {
inputStream = file.getInputStream();
}catch (Exception e){
} catch (Exception e) {
ImportTaskCommonFormDTO input = new ImportTaskCommonFormDTO();
input.setOperatorId(formDTO.getUserId());
input.setTaskId(importTask.getData().getTaskId());
input.setProcessStatus(ImportTaskConstants.PROCESS_STATUS_FINISHED_FAIL);
epmetCommonServiceOpenFeignClient.finishImportTask(input);
log.error("读取文件失败",e);
log.error("读取文件失败", e);
}
houseService.dispose(inputStream,formDTO,importTask);
houseService.dispose(inputStream, formDTO, importTask);
return new Result<>();
}
/**
* Desc 小区管理中批量删除
*
* @param formDTO
* @author zxc
* @date 2022/3/1 4:57 下午
*/
@PostMapping("delete")
public Result allDelete(@RequestBody NeighborHoodManageDelFormDTO formDTO){
public Result allDelete(@RequestBody NeighborHoodManageDelFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, NeighborHoodManageDelFormDTO.NeighborHoodManageDelForm.class);
houseService.allDelete(formDTO);
return new Result();
@ -298,14 +292,15 @@ public class HouseController implements ResultDataResolver {
/**
* 获取房屋信息
*
* @param houseId
* @return
*/
@PostMapping("gethouseinfo/{houseId}")
public Result<HouseInfoDTO> getHouseInfo(@LoginUser TokenDto tokenDto,@PathVariable("houseId") String houseId){
if(StringUtils.isBlank(houseId)){
public Result<HouseInfoDTO> getHouseInfo(@LoginUser TokenDto tokenDto, @PathVariable("houseId") String houseId) {
if (StringUtils.isBlank(houseId)) {
return new Result<>();
}
return new Result<HouseInfoDTO>().ok(houseService.getHouseInfoDTO(tokenDto.getCustomerId(),houseId));
return new Result<HouseInfoDTO>().ok(houseService.getHouseInfoDTO(tokenDto.getCustomerId(), houseId));
}
}

12
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcHouseController.java

@ -30,6 +30,7 @@ import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.dto.IcHouseDTO;
import com.epmet.dto.form.HouseFormDTO;
import com.epmet.dto.result.HouseListResultDTO;
import com.epmet.dto.result.HousesNameResultDTO;
import com.epmet.service.IcHouseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@ -114,4 +115,15 @@ public class IcHouseController {
return new Result<List<HouseListResultDTO>>().ok(icHouseService.getHouseList(tokenDto, formDTO));
}
/**
* Desc: 根据身份证查询房屋名
* @param idCards
* @author zxc
* @date 2022/4/12 16:42
*/
@PostMapping("houses-name")
public Result<List<HousesNameResultDTO>> getHousesNameByIdCards(@RequestBody List<String> idCards){
return new Result<List<HousesNameResultDTO>>().ok(icHouseService.getHousesNameByIdCards(idCards));
}
}

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

@ -35,7 +35,7 @@ import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.constants.ImportTaskConstants;
import com.epmet.dto.IcNeighborHoodDTO;
import com.epmet.dto.form.IcNeighborHoodFormDTO;
import com.epmet.dto.form.IcNeighborHoodAddFormDTO;
import com.epmet.dto.form.ImportInfoFormDTO;
import com.epmet.dto.form.ImportTaskCommonFormDTO;
import com.epmet.dto.result.ImportTaskCommonResultDTO;
@ -43,6 +43,7 @@ import com.epmet.feign.EpmetCommonServiceOpenFeignClient;
import com.epmet.service.IcNeighborHoodService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
@ -79,7 +80,7 @@ public class IcNeighborHoodController {
}
@PostMapping("open/list")
public Result<PageData<IcNeighborHoodDTO>> openList(@RequestBody IcNeighborHoodFormDTO params){
public Result<PageData<IcNeighborHoodDTO>> openList(@RequestBody IcNeighborHoodAddFormDTO params){
PageData<IcNeighborHoodDTO> page = icNeighborHoodService.openPage(params);
return new Result<PageData<IcNeighborHoodDTO>>().ok(page);
}

32
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/NeighborHoodController.java

@ -28,8 +28,9 @@ import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dao.IcBuildingDao;
import com.epmet.dto.form.IcNeighborHoodFormDTO;
import com.epmet.dto.form.ListIcNeighborHoodFormDTO;
import com.epmet.dto.form.IcHouseListFormDTO;
import com.epmet.dto.form.IcNeighborHoodAddFormDTO;
import com.epmet.dto.form.IcNeighborHoodListFormDTO;
import com.epmet.dto.result.IcNeighborHoodResultDTO;
import com.epmet.entity.IcBuildingEntity;
import com.epmet.excel.IcNeighborHoodExcel;
@ -77,48 +78,45 @@ public class NeighborHoodController {
@PostMapping("neighborhoodlist")
public Result neighborhoodlist(@RequestBody ListIcNeighborHoodFormDTO formDTO){
public Result<IcNeighborHoodResultDTO> neighborhoodlist(@RequestBody IcNeighborHoodListFormDTO formDTO){
//效验数据
ValidatorUtils.validateEntity(formDTO);
IcNeighborHoodResultDTO icNeighborHoodResultDTO = neighborHoodService.listNeighborhood(formDTO);
return new Result().ok(icNeighborHoodResultDTO);
return new Result().ok(neighborHoodService.listNeighborhood(formDTO));
}
@NoRepeatSubmit
@PostMapping("neighborhoodadd")
public Result neighborhoodadd(@LoginUser TokenDto tokenDTO, @RequestBody IcNeighborHoodFormDTO formDTO){
public Result neighborhoodadd(@LoginUser TokenDto tokenDTO, @RequestBody IcNeighborHoodAddFormDTO formDTO){
//效验数据
ValidatorUtils.validateEntity(formDTO, IcNeighborHoodFormDTO.AddShowGroup.class);
ValidatorUtils.validateEntity(formDTO, IcNeighborHoodAddFormDTO.AddShowGroup.class);
String customerId = tokenDTO.getCustomerId();
// String customerId = "123123";
neighborHoodService.AddNeighborhood(customerId,formDTO);
neighborHoodService.addNeighborhood(customerId,formDTO);
return new Result();
}
@NoRepeatSubmit
@PostMapping("neighborhoodupdate")
public Result neighborhoodupdate(@LoginUser TokenDto tokenDTO, @RequestBody IcNeighborHoodFormDTO formDTO){
public Result neighborhoodupdate(@LoginUser TokenDto tokenDTO, @RequestBody IcNeighborHoodAddFormDTO formDTO){
//效验数据
ValidatorUtils.validateEntity(formDTO, IcNeighborHoodFormDTO.UpdateShowGroup.class);
ValidatorUtils.validateEntity(formDTO, IcNeighborHoodAddFormDTO.UpdateShowGroup.class);
String customerId = tokenDTO.getCustomerId();
// String customerId = "123123";
neighborHoodService.UpdateNeighborhood(customerId,formDTO);
neighborHoodService.updateNeighborhood(customerId,formDTO);
return new Result();
}
@PostMapping("neighborhooddel")
public Result neighborhooddel(@LoginUser TokenDto tokenDTO, @RequestBody IcNeighborHoodFormDTO formDTO){
public Result neighborhooddel(@LoginUser TokenDto tokenDTO, @RequestBody IcNeighborHoodAddFormDTO formDTO){
//效验数据
ValidatorUtils.validateEntity(formDTO, IcNeighborHoodFormDTO.DeleteGroup.class);
ValidatorUtils.validateEntity(formDTO, IcNeighborHoodAddFormDTO.DeleteGroup.class);
String neighborHoodId = formDTO.getNeighborHoodId();
//判断是否存在楼宇,如果存在不能删除
List<IcBuildingEntity> icBuildingEntities = icBuildingDao.selectList(new QueryWrapper<IcBuildingEntity>().lambda().eq(IcBuildingEntity::getNeighborHoodId, neighborHoodId));
if(!CollectionUtils.isEmpty(icBuildingEntities)){
return new Result().error(8001,"小区下已存在楼宇,无法删除");
}
neighborHoodService.DelNeighborhood(neighborHoodId);
neighborHoodService.delNeighborhood(neighborHoodId);
return new Result().ok("删除成功");
}
@ -130,7 +128,7 @@ public class NeighborHoodController {
* @throws Exception
*/
@PostMapping("exportneighborhoodinfo")
public void exportneighborhoodinfo(@RequestBody ListIcNeighborHoodFormDTO formDTO, HttpServletResponse response) throws Exception {
public void exportneighborhoodinfo(@RequestBody IcHouseListFormDTO formDTO, HttpServletResponse response) throws Exception {
ValidatorUtils.validateEntity(formDTO);
neighborHoodService.exportNeighborhoodinfo(formDTO,response);

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

@ -20,10 +20,8 @@ package com.epmet.dao;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.ImportGeneralDTO;
import com.epmet.dto.result.BaseInfoFamilyBuildingResultDTO;
import com.epmet.dto.result.BuildingResultDTO;
import com.epmet.dto.result.ExistHouseInfoResultDTO;
import com.epmet.dto.result.UpdateBuildingHouseNumResultDTO;
import com.epmet.dto.form.IcBuildingListFormDTO;
import com.epmet.dto.result.*;
import com.epmet.entity.CustomerAgencyEntity;
import com.epmet.entity.IcBuildingEntity;
import com.epmet.entity.IcHouseEntity;
@ -45,16 +43,9 @@ import java.util.Set;
@Mapper
public interface IcBuildingDao extends BaseDao<IcBuildingEntity> {
// IPage<Map<String, Object>> searchBuildingByPage(IPage<IcBuildingEntity> page,
// @Param("neighbor") IcNeighborHoodEntity neighbor,
// @Param("building")IcBuildingEntity building);
IPage<Map<String, Object>> searchBuildingByPage(IPage<IcBuildingEntity> page,
@Param("building")IcBuildingEntity building, @Param("house") IcHouseEntity house);
// List<IcBuildingExcel> searchAllBuilding(@Param(Constants.WRAPPER) QueryWrapper<IcNeighborHoodEntity> neighborHoodEntityQueryWrapper,
// @Param("ew1") QueryWrapper<IcBuildingEntity> buildingEntityQueryWrapper);
// List<IcBuildingExcel> searchAllBuilding(@Param("neighbor") IcNeighborHoodEntity neighbor,
// @Param("building")IcBuildingEntity building);
List<IcBuildingListResultDTO> searchBuildingByPage(IcBuildingListFormDTO formDTO);
List<IcBuildingExcel> searchAllBuilding(
@Param("building")IcBuildingEntity building, @Param("house")IcHouseEntity house);

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

@ -1,9 +1,11 @@
package com.epmet.dao;
import com.baomidou.mybatisplus.core.metadata.IPage;
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.entity.IcHouseEntity;
import com.epmet.excel.IcHouseExcel;
@ -11,7 +13,6 @@ import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
import java.util.Set;
/**
@ -23,22 +24,7 @@ import java.util.Set;
@Mapper
public interface IcHouseDao extends BaseDao<IcHouseEntity> {
// IPage<Map<String, Object>> searchHouseByPage(IPage<IcHouseEntity> page,
// @Param(Constants.WRAPPER) QueryWrapper<IcNeighborHoodEntity> neighborHoodEntityQueryWrapper,
// @Param("ew1") QueryWrapper<IcBuildingEntity> buildingEntityQueryWrapper,
// @Param("ew2") QueryWrapper<IcHouseEntity> houseEntityQueryWrapper);
// IPage<Map<String, Object>> searchHouseByPage(IPage<IcHouseEntity> page,
// @Param("neighbor") IcNeighborHoodEntity neighbor,
// @Param("building") IcBuildingEntity building,
// @Param("house") IcHouseEntity house);
IPage<Map<String, Object>> searchHouseByPage(IPage<IcHouseEntity> page,
@Param("pids") String pids,
@Param("buildingId") String buildingId,
@Param("ownerName") String ownerName,
@Param("ownerPhone") String ownerPhone,
@Param("neighborHoodName") String neighborHoodName,
@Param("buildingName") String buildingName,
@Param("queryScene") String queryScene);
List<IcHouseListResultDTO> searchHouseByPage(IcHouseListFormDTO formDTO);
List<IcHouseExcel> searchAllHouse(@Param("house") IcHouseEntity house);
@ -92,4 +78,12 @@ public interface IcHouseDao extends BaseDao<IcHouseEntity> {
*/
void houseUpdate(@Param("houses") List<ImportGeneralDTO> houses);
}
/**
* Desc: 根据身份证查询房屋名
* @param idCards
* @author zxc
* @date 2022/4/12 16:42
*/
List<HousesNameResultDTO> getHousesNameByIdCards(@Param("idCards") List<String> idCards);
}

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

@ -17,8 +17,9 @@
package com.epmet.dao;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.form.IcNeighborHoodListFormDTO;
import com.epmet.dto.result.IcNeighborHoodResultDTO;
import com.epmet.entity.IcHouseEntity;
import com.epmet.entity.IcNeighborHoodEntity;
import com.epmet.excel.IcNeighborHoodExcel;
@ -26,7 +27,6 @@ import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/**
* 小区表
@ -37,10 +37,8 @@ import java.util.Map;
@Mapper
public interface IcNeighborHoodDao extends BaseDao<IcNeighborHoodEntity> {
// IPage<Map<String, Object>> searchNeighborhoodByPage(IPage<IcNeighborHoodEntity> page,@Param(Constants.WRAPPER) QueryWrapper<IcNeighborHoodEntity> neighborHoodEntityQueryWrapper);
IPage<Map<String, Object>> searchNeighborhoodByPage(IPage<IcNeighborHoodEntity> page, @Param("neighbor") IcNeighborHoodEntity neighbor, @Param("house")IcHouseEntity house);
List<IcNeighborHoodResultDTO> searchNeighborhoodByPage(IcNeighborHoodListFormDTO formDTO);
// List<IcNeighborHoodExcel> searchAllNeighborhood(@Param(Constants.WRAPPER) QueryWrapper<IcNeighborHoodEntity> neighborHoodEntityQueryWrapper);
List<IcNeighborHoodExcel> searchAllNeighborhood(@Param("neighbor") IcNeighborHoodEntity neighbor, @Param("house")IcHouseEntity house);
List<IcNeighborHoodEntity> selectListByName(@Param("customerId") String customerId,
@ -61,4 +59,4 @@ public interface IcNeighborHoodDao extends BaseDao<IcNeighborHoodEntity> {
*/
List<String> selectNeighborhoodNameByNames(@Param("names")List<String> names,@Param("customerId") String customerId);
}
}

8
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/CustomerAgencyRedis.java

@ -20,7 +20,7 @@ package com.epmet.redis;
import cn.hutool.core.bean.BeanUtil;
import com.epmet.commons.tools.redis.RedisKeys;
import com.epmet.commons.tools.redis.RedisUtils;
import com.epmet.dto.CustomerAgencyDTO;
import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;
@ -44,19 +44,19 @@ public class CustomerAgencyRedis {
redisUtils.delete(key);
}
public void set(String agencyId, CustomerAgencyDTO value){
public void set(String agencyId, AgencyInfoCache value){
String key = RedisKeys.getAgencyByIdKey(agencyId);
Map<String, Object> map = BeanUtil.beanToMap(value, false, true);
redisUtils.hMSet(key, map);
}
public CustomerAgencyDTO get(String agencyId){
public AgencyInfoCache get(String agencyId){
String key = RedisKeys.getAgencyByIdKey(agencyId);
Map<String, Object> resultMap = redisUtils.hGetAll(key);
if (CollectionUtils.isEmpty(resultMap)) {
return null;
}
return BeanUtil.mapToBean(resultMap, CustomerAgencyDTO.class, true);
return BeanUtil.mapToBean(resultMap, AgencyInfoCache.class, true);
}
}

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

@ -17,14 +17,16 @@
package com.epmet.service;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.BuildingTreeLevelDTO;
import com.epmet.dto.form.IcBulidingFormDTO;
import com.epmet.dto.form.IcBuildingListFormDTO;
import com.epmet.dto.form.IcBulidingAddFormDTO;
import com.epmet.dto.form.IcHouseListFormDTO;
import com.epmet.dto.form.ImportInfoFormDTO;
import com.epmet.dto.form.ListIcNeighborHoodFormDTO;
import com.epmet.dto.result.BuildingResultDTO;
import com.epmet.dto.result.BuildingResultPagedDTO;
import com.epmet.dto.result.IcNeighborHoodResultDTO;
import com.epmet.dto.result.IcBuildingListResultDTO;
import com.epmet.dto.result.ImportTaskCommonResultDTO;
import com.epmet.excel.IcBuildingExcel;
@ -45,7 +47,7 @@ public interface BuildingService {
void updateBuilding(String customerId, IcBulidingFormDTO formDTO);
void updateBuilding(String customerId, IcBulidingAddFormDTO formDTO);
/**
* 删除小区
@ -54,15 +56,16 @@ public interface BuildingService {
void delBuilding(String buildingId);
void addBuilding(String customerId, IcBulidingFormDTO formDTO);
void addBuilding(String customerId, IcBulidingAddFormDTO formDTO);
List<BuildingTreeLevelDTO> treeList(String customerId, String staffId);
List<String> treeIds(String customerId, String staffId);
List<Integer> importExcel(String customerId, List<IcBuildingExcel> list, String staffId, List<Integer> numList);
IcNeighborHoodResultDTO listBuilding(ListIcNeighborHoodFormDTO formDTO);
PageData<IcBuildingListResultDTO> listBuilding(IcBuildingListFormDTO formDTO);
void exportBuildinginfo(ListIcNeighborHoodFormDTO formDTO, HttpServletResponse response) throws Exception ;
void exportBuildinginfo(IcHouseListFormDTO formDTO, HttpServletResponse response) throws Exception ;
List<BuildingResultDTO> buildingListByIds(List<String> buildingIdList);

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

@ -17,13 +17,14 @@
package com.epmet.service;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.form.IcHouseFormDTO;
import com.epmet.dto.form.IcHouseAddFormDTO;
import com.epmet.dto.form.ImportInfoFormDTO;
import com.epmet.dto.form.ListIcNeighborHoodFormDTO;
import com.epmet.dto.form.IcHouseListFormDTO;
import com.epmet.dto.form.NeighborHoodManageDelFormDTO;
import com.epmet.dto.result.HouseInfoDTO;
import com.epmet.dto.result.IcNeighborHoodResultDTO;
import com.epmet.dto.result.IcHouseListResultDTO;
import com.epmet.dto.result.ImportTaskCommonResultDTO;
import com.epmet.excel.IcHouseExcel;
@ -40,10 +41,10 @@ import java.util.Set;
*/
public interface HouseService {
void addHouse(String customerId, IcHouseFormDTO formDTO);
void addHouse(String customerId, IcHouseAddFormDTO formDTO);
void updateHouse(String customerId, IcHouseFormDTO formDTO);
void updateHouse(String customerId, IcHouseAddFormDTO formDTO);
/**
* 删除小区
@ -54,17 +55,9 @@ public interface HouseService {
List<Integer> importExcel(String customerId, List<IcHouseExcel> list, String staffId, List<Integer> numList);
IcNeighborHoodResultDTO listNeighborhood(String ancestorAgencyId,
String buildingId,
String ownerName,
String ownerPhone,
String neighborHoodName,
String buildingName,
String queryScene,
Integer pageNo,
Integer pageSize);
PageData<IcHouseListResultDTO> getHouseList(IcHouseListFormDTO formDTO);
void exportBuildinginfo(ListIcNeighborHoodFormDTO formDTO, HttpServletResponse response) throws Exception;
void exportBuildinginfo(IcHouseListFormDTO formDTO, HttpServletResponse response) throws Exception;
List<HouseInfoDTO> queryListHouseInfo(Set<String> houseIds, String customerId);
@ -78,5 +71,6 @@ public interface HouseService {
*/
void allDelete(NeighborHoodManageDelFormDTO formDTO);
HouseInfoDTO getHouseInfoDTO(String customerId,String houseId);
}
}

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

@ -8,6 +8,7 @@ import com.epmet.dto.IcHouseDTO;
import com.epmet.dto.ImportGeneralDTO;
import com.epmet.dto.form.HouseFormDTO;
import com.epmet.dto.result.HouseListResultDTO;
import com.epmet.dto.result.HousesNameResultDTO;
import com.epmet.entity.IcHouseEntity;
import java.util.List;
@ -116,4 +117,12 @@ public interface IcHouseService extends BaseService<IcHouseEntity> {
*/
void houseUpdate(List<ImportGeneralDTO> houses);
/**
* Desc: 根据身份证查询房屋名
* @param idCards
* @author zxc
* @date 2022/4/12 16:42
*/
List<HousesNameResultDTO> getHousesNameByIdCards(List<String> idCards);
}

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

@ -23,7 +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.form.IcNeighborHoodFormDTO;
import com.epmet.dto.form.IcNeighborHoodAddFormDTO;
import com.epmet.dto.form.ImportInfoFormDTO;
import com.epmet.dto.result.ImportTaskCommonResultDTO;
import com.epmet.entity.IcNeighborHoodEntity;
@ -154,5 +154,5 @@ public interface IcNeighborHoodService extends BaseService<IcNeighborHoodEntity>
* @param params
* @return
*/
PageData<IcNeighborHoodDTO> openPage(IcNeighborHoodFormDTO params);
PageData<IcNeighborHoodDTO> openPage(IcNeighborHoodAddFormDTO params);
}

18
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/NeighborHoodService.java

@ -17,8 +17,10 @@
package com.epmet.service;
import com.epmet.dto.form.IcNeighborHoodFormDTO;
import com.epmet.dto.form.ListIcNeighborHoodFormDTO;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.form.IcHouseListFormDTO;
import com.epmet.dto.form.IcNeighborHoodAddFormDTO;
import com.epmet.dto.form.IcNeighborHoodListFormDTO;
import com.epmet.dto.result.IcNeighborHoodResultDTO;
import com.epmet.excel.IcNeighborHoodExcel;
@ -33,24 +35,24 @@ import java.util.List;
*/
public interface NeighborHoodService{
void AddNeighborhood(String customerId, IcNeighborHoodFormDTO formDTO);
void addNeighborhood(String customerId, IcNeighborHoodAddFormDTO formDTO);
IcNeighborHoodResultDTO listNeighborhood(ListIcNeighborHoodFormDTO formDTO);
PageData<IcNeighborHoodResultDTO> listNeighborhood(IcNeighborHoodListFormDTO formDTO);
void UpdateNeighborhood(String customerId, IcNeighborHoodFormDTO formDTO);
void updateNeighborhood(String customerId, IcNeighborHoodAddFormDTO formDTO);
/**
* 删除小区
* @param neighborHoodId
*/
void DelNeighborhood(String neighborHoodId);
void delNeighborhood(String neighborHoodId);
/**
* 导出数据
* @param formDTO
* @param response
*/
void exportNeighborhoodinfo(ListIcNeighborHoodFormDTO formDTO, HttpServletResponse response) throws Exception ;
void exportNeighborhoodinfo(IcHouseListFormDTO formDTO, HttpServletResponse response) throws Exception ;
List<Integer> importExcel(String customerId, List<IcNeighborHoodExcel> list, String staffId, List<Integer> numList);
}
}

50
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java

@ -20,6 +20,7 @@ package com.epmet.service.impl;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.epmet.commons.tools.constant.Constant;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
@ -490,16 +491,53 @@ public class AgencyServiceImpl implements AgencyService {
@Override
public CustomerAgencyDTO getAgencyById(String agencyId) {
CustomerAgencyDTO cachedAgency = customerAgencyRedis.get(agencyId);
if (cachedAgency == null) {
cachedAgency = new CustomerAgencyDTO();
AgencyInfoCache agencyInfoCache = customerAgencyRedis.get(agencyId);
if (agencyInfoCache == null) {
agencyInfoCache = new AgencyInfoCache();
CustomerAgencyEntity agencyEntity = customerAgencyDao.selectById(agencyId);
if (agencyEntity != null) {
BeanUtils.copyProperties(agencyEntity, cachedAgency);
//设置行政地区编码全路径
if (StringUtils.isNotBlank(agencyEntity.getAreaCode()) && StringUtils.isNotBlank(agencyEntity.getParentAreaCode())) {
agencyInfoCache.setAreaCodePath(queryAreaCodePath(agencyEntity));
}
BeanUtils.copyProperties(agencyEntity, agencyInfoCache);
}
customerAgencyRedis.set(agencyId, cachedAgency);
customerAgencyRedis.set(agencyId, agencyInfoCache);
}
CustomerAgencyDTO customerAgencyDTO=ConvertUtils.sourceToTarget(agencyInfoCache,CustomerAgencyDTO.class);
return customerAgencyDTO;
}
private List<String> queryAreaCodePath(CustomerAgencyEntity customerAgencyEntity) {
List<String> areaCodePath = new ArrayList<>();
switch (customerAgencyEntity.getLevel()) {
case Constant.COMMUNITY:
areaCodePath.add(customerAgencyEntity.getAreaCode().substring(NumConstant.ZERO, NumConstant.TWO));
areaCodePath.add(customerAgencyEntity.getAreaCode().substring(NumConstant.ZERO, NumConstant.FOUR));
areaCodePath.add(customerAgencyEntity.getAreaCode().substring(NumConstant.ZERO, NumConstant.SIX));
areaCodePath.add(customerAgencyEntity.getParentAreaCode());
areaCodePath.add(customerAgencyEntity.getAreaCode());
break;
case Constant.STREET:
areaCodePath.add(customerAgencyEntity.getAreaCode().substring(NumConstant.ZERO, NumConstant.TWO));
areaCodePath.add(customerAgencyEntity.getAreaCode().substring(NumConstant.ZERO, NumConstant.FOUR));
areaCodePath.add(customerAgencyEntity.getParentAreaCode());
areaCodePath.add(customerAgencyEntity.getAreaCode());
break;
case Constant.DISTRICT:
areaCodePath.add(customerAgencyEntity.getAreaCode().substring(NumConstant.ZERO, NumConstant.TWO));
areaCodePath.add(customerAgencyEntity.getParentAreaCode());
areaCodePath.add(customerAgencyEntity.getAreaCode());
break;
case Constant.CITY:
areaCodePath.add(customerAgencyEntity.getParentAreaCode());
areaCodePath.add(customerAgencyEntity.getAreaCode());
break;
case Constant.PROVINCE:
areaCodePath.add(customerAgencyEntity.getAreaCode());
break;
}
return cachedAgency;
return areaCodePath;
}
@Override

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

@ -14,6 +14,7 @@ import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
@ -21,14 +22,8 @@ import com.epmet.constants.ImportTaskConstants;
import com.epmet.dao.*;
import com.epmet.dto.BuildingTreeLevelDTO;
import com.epmet.dto.IcBuildingDTO;
import com.epmet.dto.form.IcBulidingFormDTO;
import com.epmet.dto.form.ImportInfoFormDTO;
import com.epmet.dto.form.ImportTaskCommonFormDTO;
import com.epmet.dto.form.ListIcNeighborHoodFormDTO;
import com.epmet.dto.result.BuildingResultDTO;
import com.epmet.dto.result.BuildingResultPagedDTO;
import com.epmet.dto.result.IcNeighborHoodResultDTO;
import com.epmet.dto.result.ImportTaskCommonResultDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
import com.epmet.entity.*;
import com.epmet.enums.BuildingTypeEnums;
import com.epmet.excel.IcBuildingExcel;
@ -38,6 +33,8 @@ import com.epmet.model.ImportBuildingInfoListener;
import com.epmet.redis.IcHouseRedis;
import com.epmet.service.*;
import com.epmet.util.ExcelPoiUtils;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
@ -93,7 +90,7 @@ public class BuildingServiceImpl implements BuildingService {
@Override
@Transactional(rollbackFor = Exception.class)
public void addBuilding(String customerId, IcBulidingFormDTO formDTO) {
public void addBuilding(String customerId, IcBulidingAddFormDTO formDTO) {
//同一小区下不能存在楼栋名字一样的
Integer count = icBuildingDao.checkBuildName(formDTO.getNeighborHoodId(),formDTO.getBuildingName(),null);
if (null != count && count > 0) {
@ -261,6 +258,45 @@ public class BuildingServiceImpl implements BuildingService {
}
@Override
public List<String> treeIds(String customerId, String staffId) {
List<String> result = new ArrayList<>();
CustomerStaffInfoCacheResult agency = CustomerStaffRedis.getStaffInfo(customerId, staffId);
if(null == agency || StringUtils.isBlank(agency.getAgencyId())){
log.error("com.epmet.service.impl.BuildingServiceImpl.treeIds,没有找到工作人员所属的机关信息,用户Id:{}",staffId);
return new ArrayList<>();
}
//1.获取所在组织及下级组织
CustomerAgencyEntity customerAgency = customerAgencyDao.selectById(agency.getAgencyId());
List<CustomerAgencyEntity> customerAgencyList = icBuildingDao.selectAgencyChildrenList(agency.getAgencyId());
customerAgencyList.add(customerAgency);
if(CollectionUtils.isEmpty(customerAgencyList)){
return new ArrayList<>();
}
result.addAll(customerAgencyList.stream().map(m -> m.getId()).collect(Collectors.toList()));
List<BuildingTreeLevelDTO> agencyList = customerAgencyList.stream().map(item -> {
BuildingTreeLevelDTO buildingTreeLevelDTO = new BuildingTreeLevelDTO();
buildingTreeLevelDTO.setId(item.getId());
buildingTreeLevelDTO.setPId(item.getPid());
buildingTreeLevelDTO.setLabel(item.getOrganizationName());
buildingTreeLevelDTO.setLevel(item.getLevel());
buildingTreeLevelDTO.setLongitude(item.getLongitude());
buildingTreeLevelDTO.setLatitude(item.getLatitude());
buildingTreeLevelDTO.setChildren(new ArrayList<>());
//当前组织有几个下级组织
buildingTreeLevelDTO.setShowNum(StrConstant.EPMETY_STR);
return buildingTreeLevelDTO;
}).collect(Collectors.toList());
//2.获取组织所在网格
List<String> agencyIdList = customerAgencyList.stream().map(BaseEpmetEntity::getId).collect(Collectors.toList());
List<CustomerGridEntity> customerGridList = customerGridDao.selectList(new QueryWrapper<CustomerGridEntity>().lambda().in(CustomerGridEntity::getPid, agencyIdList));
if(CollectionUtils.isEmpty(customerGridList)){
return result;
}
result.addAll(customerGridList.stream().map(m -> m.getId()).collect(Collectors.toList()));
return result;
}
@Override
@Transactional(rollbackFor = Exception.class)
public List<Integer> importExcel(String customerId, List<IcBuildingExcel> list, String staffId, List<Integer> numList) {
@ -347,25 +383,19 @@ public class BuildingServiceImpl implements BuildingService {
//4.新增单元
icBuildingService.insertBatch(buildingEntityList);
icBuildingUnitService.insertBatch(icBuildingUnitEntityList);
/* if(!"".equals(str)){
return new Result().error(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), str.append("不存在").toString());
}*/
return numList;
}
@Override
public IcNeighborHoodResultDTO listBuilding(ListIcNeighborHoodFormDTO formDTO) {
IcNeighborHoodResultDTO result = new IcNeighborHoodResultDTO();
IPage<Map<String, Object>> resultMap = searchBuilding(formDTO);
result.setTotal(Long.valueOf(resultMap.getTotal()).intValue());
result.setList(resultMap.getRecords());
return result;
public PageData<IcBuildingListResultDTO> listBuilding(IcBuildingListFormDTO formDTO) {
PageInfo<IcBuildingListResultDTO> pageInfo = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage()).doSelectPageInfo(() -> icBuildingDao.searchBuildingByPage(formDTO));
List<IcBuildingListResultDTO> records = pageInfo.getList();
records.forEach(item-> item.setBuildingType( BuildingTypeEnums.getTypeValue(item.getBuildingTypeKey())));
return new PageData<>(pageInfo.getList(),pageInfo.getTotal());
}
@Override
public void exportBuildinginfo(ListIcNeighborHoodFormDTO formDTO, HttpServletResponse response) throws Exception {
public void exportBuildinginfo(IcHouseListFormDTO formDTO, HttpServletResponse response) throws Exception {
//如果类型是building 查楼栋
//导出楼栋
List<IcBuildingExcel> icBuildingExcels = searchAllBuilding(formDTO);
@ -428,7 +458,7 @@ public class BuildingServiceImpl implements BuildingService {
return new Result<>();
}
private List<IcBuildingExcel> searchAllBuilding(ListIcNeighborHoodFormDTO formDTO) {
private List<IcBuildingExcel> searchAllBuilding(IcHouseListFormDTO formDTO) {
// QueryWrapper<IcNeighborHoodEntity> neighborHoodEntityQueryWrapper = new QueryWrapper<>();
// neighborHoodEntityQueryWrapper.lambda()
@ -453,21 +483,6 @@ public class BuildingServiceImpl implements BuildingService {
return icBuildingExcels;
}
private IPage<Map<String, Object>> searchBuilding(ListIcNeighborHoodFormDTO formDTO) {
IPage<IcBuildingEntity> page = new Page<IcBuildingEntity>(formDTO.getPageNo(),formDTO.getPageSize());
IcBuildingEntity building = ConvertUtils.sourceToTarget(formDTO, IcBuildingEntity.class);
building.setDelFlag("0");
IcHouseEntity house = ConvertUtils.sourceToTarget(formDTO, IcHouseEntity.class);
IPage<Map<String, Object>> mapIPage = icBuildingDao.searchBuildingByPage(page, building, house);
List<Map<String, Object>> records = mapIPage.getRecords();
records.forEach(item->{
item.put("buildingType", BuildingTypeEnums.getTypeValue(item.get("buildingTypeKey")));
});
return mapIPage;
}
private List<BuildingTreeLevelDTO> covertToTree(CustomerAgencyEntity customerAgency,List<BuildingTreeLevelDTO> agencyList) {
BuildingTreeLevelDTO buildingTreeLevelDTO = new BuildingTreeLevelDTO();
@ -506,7 +521,7 @@ public class BuildingServiceImpl implements BuildingService {
*/
@Override
@Transactional(rollbackFor = Exception.class)
public void updateBuilding(String customerId, IcBulidingFormDTO formDTO) {
public void updateBuilding(String customerId, IcBulidingAddFormDTO formDTO) {
//同一小区下不能存在楼栋名字一样的
Integer count = icBuildingDao.checkBuildName(formDTO.getNeighborHoodId(),formDTO.getBuildingName(),formDTO.getBuildingId());
if (null != count && count > 0) {

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

@ -4,21 +4,23 @@ import cn.afterturn.easypoi.excel.entity.TemplateExportParams;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelReader;
import com.alibaba.excel.read.metadata.ReadSheet;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
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;
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.commons.tools.utils.Result;
import com.epmet.constant.CustomerGridConstant;
import com.epmet.constants.ImportTaskConstants;
import com.epmet.dao.IcBuildingDao;
import com.epmet.dao.IcBuildingUnitDao;
@ -30,7 +32,7 @@ import com.epmet.dto.IcBuildingUnitDTO;
import com.epmet.dto.IcHouseDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.HouseInfoDTO;
import com.epmet.dto.result.IcNeighborHoodResultDTO;
import com.epmet.dto.result.IcHouseListResultDTO;
import com.epmet.dto.result.ImportTaskCommonResultDTO;
import com.epmet.dto.result.NeighborHoodManageDelResultDTO;
import com.epmet.entity.IcHouseEntity;
@ -46,6 +48,8 @@ import com.epmet.model.ImportHouseInfoListener;
import com.epmet.redis.IcHouseRedis;
import com.epmet.service.*;
import com.epmet.util.ExcelPoiUtils;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
@ -99,7 +103,7 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver {
@Override
@Transactional(rollbackFor = Exception.class)
public void addHouse(String customerId, IcHouseFormDTO formDTO) {
public void addHouse(String customerId, IcHouseAddFormDTO formDTO) {
//同一楼栋,单元内,房屋名称唯一
Integer count = icHouseDao.checkDoorNameUq(formDTO.getNeighborHoodId(), formDTO.getBuildingId(), formDTO.getBuildingUnitId(), formDTO.getDoorName(),null);
if (null != count && count > 0) {
@ -113,7 +117,7 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver {
icHouseService.save(icHouseDTO);
}
private String getHouseName(IcHouseFormDTO formDTO){
private String getHouseName(IcHouseAddFormDTO formDTO){
//设置房间名 楼栋-单元号-门牌号
IcBuildingDTO icBuilding = icBuildingService.get(formDTO.getBuildingId());
IcBuildingUnitDTO icBuildingUnit = icBuildingUnitService.get(formDTO.getBuildingUnitId());
@ -130,7 +134,7 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver {
*/
@Override
@Transactional(rollbackFor = Exception.class)
public void updateHouse(String customerId, IcHouseFormDTO formDTO) {
public void updateHouse(String customerId, IcHouseAddFormDTO formDTO) {
//同一楼栋,单元内,房屋名称唯一
Integer count = icHouseDao.checkDoorNameUq(formDTO.getNeighborHoodId(), formDTO.getBuildingId(), formDTO.getBuildingUnitId(),formDTO.getDoorName(), formDTO.getHouseId());
if (null != count && count > 0) {
@ -248,52 +252,47 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver {
}
@Override
public IcNeighborHoodResultDTO listNeighborhood(String ancestorAgencyId,
String buildingId,
String ownerName,
String ownerPhone,
String neighborHoodName,
String buildingName,
String queryScene,
Integer pageNo,
Integer pageSize) {
IcNeighborHoodResultDTO result = new IcNeighborHoodResultDTO();
//如果类型是house 查房屋
//IPage<Map<String, Object>> resultMap = searchHouse(buildingId, ownerName, ownerPhone, neighborHoodName, buildingName, pageNo, pageSize);
public PageData<IcHouseListResultDTO> getHouseList(IcHouseListFormDTO formDTO) {
// 查询pids
String pids = null;
if (StringUtils.isNotBlank(ancestorAgencyId)) {
CustomerAgencyDTO agency = agencyservice.getAgencyById(ancestorAgencyId);
if (StringUtils.isNotBlank(formDTO.getAgencyId())) {
pids = getPids(formDTO.getAgencyId());
}
if (StringUtils.isNotBlank(formDTO.getLevel()) && OrgTypeEnum.AGENCY.getCode().equals(formDTO.getLevel())){
pids = getPids(formDTO.getAgencyId());
}
formDTO.setPids(pids);
if (agency == null) {
throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), "【社区查询-查询房屋列表】查询当前staff所属组织信息失败");
}
PageInfo<IcHouseListResultDTO> pageInfo = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(),formDTO.getIsPage()).doSelectPageInfo(() ->
icHouseDao.searchHouseByPage(formDTO));
List<IcHouseListResultDTO> records = pageInfo.getList();
records.forEach(item->{
item.setHouseType(HouseTypeEnums.getTypeValue(item.getHouseTypeKey()));
item.setPurpose(HousePurposeEnums.getTypeValue(item.getPurposeKey()));
});
return new PageData<>(records,pageInfo.getTotal());
}
public String getPids(String agencyId){
String pids = null;
CustomerAgencyDTO agency = agencyservice.getAgencyById(agencyId);
if (NumConstant.ZERO_STR.equals(agency.getPid())) {
pids = ancestorAgencyId;
} else {
pids = agency.getPids().concat(StrConstant.COLON).concat(ancestorAgencyId);
}
if (agency == null) {
throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), "【社区查询-查询房屋列表】查询当前staff所属组织信息失败");
}
IPage<IcHouseEntity> page = new Page<IcHouseEntity>(pageNo,pageSize);
IPage<Map<String, Object>> mapIPage = icHouseDao.searchHouseByPage(page, pids, buildingId, ownerName, ownerPhone, neighborHoodName, buildingName, queryScene);
List<Map<String, Object>> records = mapIPage.getRecords();
records.forEach(item->{
item.put("houseType", HouseTypeEnums.getTypeValue(item.get("houseTypeKey")));
item.put("purpose", HousePurposeEnums.getTypeValue(item.get("purposeKey")));
});
result.setTotal(Long.valueOf(mapIPage.getTotal()).intValue());
result.setList(records);
return result;
if (NumConstant.ZERO_STR.equals(agency.getPid())) {
pids = agencyId;
} else {
pids = agency.getPids().concat(StrConstant.COLON).concat(agencyId);
}
return pids;
}
@Override
public void exportBuildinginfo(ListIcNeighborHoodFormDTO formDTO, HttpServletResponse response) throws Exception {
public void exportBuildinginfo(IcHouseListFormDTO formDTO, HttpServletResponse response) throws Exception {
//如果类型是house 查房屋
//导出房屋
@ -305,7 +304,7 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver {
return ;
}
private List<IcHouseExcel> searchAllHouse(ListIcNeighborHoodFormDTO formDTO) {
private List<IcHouseExcel> searchAllHouse(IcHouseListFormDTO formDTO) {
//IcNeighborHoodEntity neighbor = ConvertUtils.sourceToTarget(formDTO, IcNeighborHoodEntity.class);
//

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

@ -19,6 +19,7 @@ import com.epmet.dto.IcResiUserDTO;
import com.epmet.dto.ImportGeneralDTO;
import com.epmet.dto.form.HouseFormDTO;
import com.epmet.dto.result.HouseListResultDTO;
import com.epmet.dto.result.HousesNameResultDTO;
import com.epmet.entity.IcHouseEntity;
import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.feign.OperCustomizeOpenFeignClient;
@ -231,4 +232,18 @@ public class IcHouseServiceImpl extends BaseServiceImpl<IcHouseDao, IcHouseEntit
baseDao.houseUpdate(houses);
}
/**
* Desc: 根据身份证查询房屋名
* @param idCards
* @author zxc
* @date 2022/4/12 16:42
*/
@Override
public List<HousesNameResultDTO> getHousesNameByIdCards(List<String> idCards) {
if (CollectionUtils.isEmpty(idCards)){
return new ArrayList<>();
}
return baseDao.getHousesNameByIdCards(idCards);
}
}

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

@ -48,7 +48,7 @@ import com.epmet.dao.IcBuildingDao;
import com.epmet.dao.IcNeighborHoodDao;
import com.epmet.dao.IcPropertyManagementDao;
import com.epmet.dto.*;
import com.epmet.dto.form.IcNeighborHoodFormDTO;
import com.epmet.dto.form.IcNeighborHoodAddFormDTO;
import com.epmet.dto.form.ImportInfoFormDTO;
import com.epmet.dto.form.ImportTaskCommonFormDTO;
import com.epmet.dto.result.ImportTaskCommonResultDTO;
@ -74,6 +74,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 +235,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 +262,7 @@ public class IcNeighborHoodServiceImpl extends BaseServiceImpl<IcNeighborHoodDao
}
}
log.info("neighborhoodImport thread end=====");
});
// });
return new Result<>();
}
@ -687,7 +689,7 @@ public class IcNeighborHoodServiceImpl extends BaseServiceImpl<IcNeighborHoodDao
}
@Override
public PageData<IcNeighborHoodDTO> openPage(IcNeighborHoodFormDTO params) {
public PageData<IcNeighborHoodDTO> openPage(IcNeighborHoodAddFormDTO params) {
LambdaQueryWrapper<IcNeighborHoodEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(IcNeighborHoodEntity::getAgencyId,params.getAgencyId());
PageData<IcNeighborHoodDTO> result = null;

58
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/NeighborHoodServiceImpl.java

@ -2,12 +2,11 @@ package com.epmet.service.impl;
import cn.afterturn.easypoi.excel.entity.TemplateExportParams;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
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.RenException;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
@ -16,8 +15,9 @@ import com.epmet.dao.*;
import com.epmet.dto.CustomerAgencyDTO;
import com.epmet.dto.IcNeighborHoodDTO;
import com.epmet.dto.IcNeighborHoodPropertyDTO;
import com.epmet.dto.form.IcNeighborHoodFormDTO;
import com.epmet.dto.form.ListIcNeighborHoodFormDTO;
import com.epmet.dto.form.IcHouseListFormDTO;
import com.epmet.dto.form.IcNeighborHoodAddFormDTO;
import com.epmet.dto.form.IcNeighborHoodListFormDTO;
import com.epmet.dto.result.IcNeighborHoodResultDTO;
import com.epmet.entity.*;
import com.epmet.excel.IcNeighborHoodExcel;
@ -26,6 +26,8 @@ import com.epmet.service.IcNeighborHoodPropertyService;
import com.epmet.service.IcNeighborHoodService;
import com.epmet.service.NeighborHoodService;
import com.epmet.util.ExcelPoiUtils;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -72,7 +74,7 @@ public class NeighborHoodServiceImpl implements NeighborHoodService {
@Override
@Transactional(rollbackFor = Exception.class)
public void AddNeighborhood(String customerId, IcNeighborHoodFormDTO formDTO) {
public void addNeighborhood(String customerId, IcNeighborHoodAddFormDTO formDTO) {
//同一网格下,小区名称唯一
Integer count = icNeighborHoodDao.checkNameUq(formDTO.getGridId(),formDTO.getNeighborHoodName(),null);
if (null != count && count > 0) {
@ -105,45 +107,19 @@ public class NeighborHoodServiceImpl implements NeighborHoodService {
/**
* 查询
* @param formDTO
* @return
*/
@Override
public IcNeighborHoodResultDTO listNeighborhood(ListIcNeighborHoodFormDTO formDTO) {
String level = formDTO.getLevel();
Integer pageNo = formDTO.getPageNo();
Integer pageSize = formDTO.getPageSize();
IcNeighborHoodResultDTO result = new IcNeighborHoodResultDTO();
IPage<Map<String, Object>> resultMap = searchNeighborhood(formDTO);
result.setTotal(Long.valueOf(resultMap.getTotal()).intValue());
result.setList(resultMap.getRecords());
return result;
}
private IPage<Map<String,Object>> searchNeighborhood(ListIcNeighborHoodFormDTO formDTO) {
IPage<IcNeighborHoodEntity> page = new Page<IcNeighborHoodEntity>(formDTO.getPageNo(),formDTO.getPageSize());
IcNeighborHoodEntity neighbor = ConvertUtils.sourceToTarget(formDTO, IcNeighborHoodEntity.class);
IcHouseEntity house = ConvertUtils.sourceToTarget(formDTO, IcHouseEntity.class);
neighbor.setDelFlag("0");
public PageData<IcNeighborHoodResultDTO> listNeighborhood(IcNeighborHoodListFormDTO formDTO) {
if(NeighborhoodConstant.GRID.equals(formDTO.getLevel())){
//根据网格过滤
neighbor.setGridId(formDTO.getId());
formDTO.setGridId(formDTO.getId());
}else{
//根据组织过滤
neighbor.setAgencyId(formDTO.getId());
formDTO.setAgencyId(formDTO.getId());
}
return icNeighborHoodDao.searchNeighborhoodByPage(page, neighbor,house);
PageInfo<IcNeighborHoodResultDTO> pageInfo = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage()).doSelectPageInfo(() -> icNeighborHoodDao.searchNeighborhoodByPage(formDTO));
return new PageData<>(pageInfo.getList(),pageInfo.getTotal());
}
/**
@ -153,7 +129,7 @@ public class NeighborHoodServiceImpl implements NeighborHoodService {
*/
@Override
@Transactional(rollbackFor = Exception.class)
public void UpdateNeighborhood(String customerId, IcNeighborHoodFormDTO formDTO) {
public void updateNeighborhood(String customerId, IcNeighborHoodAddFormDTO formDTO) {
//同一客户下,小区名称唯一
Integer count = icNeighborHoodDao.checkNameUq(formDTO.getGridId(),formDTO.getNeighborHoodName(),formDTO.getNeighborHoodId());
if (null != count && count > 0) {
@ -203,7 +179,7 @@ public class NeighborHoodServiceImpl implements NeighborHoodService {
*/
@Override
@Transactional(rollbackFor = Exception.class)
public void DelNeighborhood(String neighborHoodId) {
public void delNeighborhood(String neighborHoodId) {
//删除小区
icNeighborHoodService.deleteById(neighborHoodId);
//删除小区物业关联
@ -220,7 +196,7 @@ public class NeighborHoodServiceImpl implements NeighborHoodService {
* @param response
*/
@Override
public void exportNeighborhoodinfo(ListIcNeighborHoodFormDTO formDTO, HttpServletResponse response) throws Exception {
public void exportNeighborhoodinfo(IcHouseListFormDTO formDTO, HttpServletResponse response) throws Exception {
//导出小区
List<IcNeighborHoodExcel> icNeighborHoodExcels = searchAllNeighborhood(formDTO);
// ExcelUtils.exportExcelToTarget(response, "小区信息录入表", icNeighborHoodExcels, IcNeighborHoodExcel.class);
@ -336,7 +312,7 @@ public class NeighborHoodServiceImpl implements NeighborHoodService {
private List<IcNeighborHoodExcel> searchAllNeighborhood(ListIcNeighborHoodFormDTO formDTO) {
private List<IcNeighborHoodExcel> searchAllNeighborhood(IcHouseListFormDTO formDTO) {
// QueryWrapper<IcNeighborHoodEntity> neighborHoodEntityQueryWrapper = new QueryWrapper<>();
// neighborHoodEntityQueryWrapper.lambda()
// .eq(!StringUtils.isEmpty(formDTO.getAgencyId()),IcNeighborHoodEntity::getAgencyId,formDTO.getAgencyId())

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

@ -0,0 +1,2 @@
ALTER TABLE `ic_house`
MODIFY COLUMN `RENT_FLAG` tinyint(1) NOT NULL COMMENT '1:出租 0:自住 2:闲置' AFTER `PURPOSE`;

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

Loading…
Cancel
Save