Browse Source

Merge remote-tracking branch 'remotes/origin/dev'

dev
jianjun 4 years ago
parent
commit
bcc1ec34b7
  1. 51
      epmet-admin/epmet-admin-client/src/main/java/com/epmet/feign/EpmetAdminOpenFeignClient.java
  2. 26
      epmet-admin/epmet-admin-client/src/main/java/com/epmet/feign/fallback/EpmetAdminOpenFeignClientFallback.java
  3. 78
      epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysDictDataController.java
  4. 3
      epmet-admin/epmet-admin-server/src/main/java/com/epmet/dao/SysDictDataDao.java
  5. 2
      epmet-admin/epmet-admin-server/src/main/java/com/epmet/mq/listener/bean/log/LogOperationHelper.java
  6. 55
      epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/SysDictDataService.java
  7. 6
      epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/impl/LogOperationServiceImpl.java
  8. 127
      epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/impl/SysDictDataServiceImpl.java
  9. 13
      epmet-admin/epmet-admin-server/src/main/resources/mapper/SysDictDataDao.xml
  10. 162
      epmet-auth/src/main/java/com/epmet/controller/IcLoinController.java
  11. 24
      epmet-auth/src/main/java/com/epmet/controller/LoginController.java
  12. 32
      epmet-auth/src/main/java/com/epmet/dto/form/LoginByPassWordFormDTO.java
  13. 25
      epmet-auth/src/main/java/com/epmet/redis/CaptchaRedis.java
  14. 9
      epmet-auth/src/main/java/com/epmet/redis/IcLoginTicketCacheBean.java
  15. 10
      epmet-auth/src/main/java/com/epmet/service/CaptchaService.java
  16. 9
      epmet-auth/src/main/java/com/epmet/service/IcLoginService.java
  17. 12
      epmet-auth/src/main/java/com/epmet/service/impl/CaptchaServiceImpl.java
  18. 16
      epmet-auth/src/main/java/com/epmet/service/impl/GovWebServiceImpl.java
  19. 177
      epmet-auth/src/main/java/com/epmet/service/impl/IcLoginServiceImpl.java
  20. 2
      epmet-commons/epmet-commons-extapp-auth/pom.xml
  21. 5
      epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/ConsomerGroupConstants.java
  22. 5
      epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/TopicConstants.java
  23. 20
      epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/IcResiUserAddMQMsg.java
  24. 4
      epmet-commons/epmet-commons-tools/pom.xml
  25. 6
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/AppClientConstant.java
  26. 4
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/StrConstant.java
  27. 20
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/DictListFormDTO.java
  28. 17
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/DictListResultDTO.java
  29. 20
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/OptionResultDTO.java
  30. 53
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/FormItemTypeEnum.java
  31. 44
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/GenderEnum.java
  32. 45
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/HouseTypeEnum.java
  33. 58
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/RelationshipEnum.java
  34. 10
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java
  35. 7
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/ResultDataResolver.java
  36. 62
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java
  37. 81
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/security/dto/IcTokenDto.java
  38. 13
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/security/user/LoginUserUtil.java
  39. 11
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/IpUtils.java
  40. 2
      epmet-gateway/src/main/java/com/epmet/config/CorsConfig.java
  41. 3
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/constant/OrgConstant.java
  42. 16
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/IcFormResColumnDTO.java
  43. 2
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerAgencyDao.java
  44. 3
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/opercustomize/CustomerFootBarDao.java
  45. 1
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java
  46. 1
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java
  47. 2
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/QuestionnaireServiceImpl.java
  48. 1
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/opercustomize/CustomerFootBarService.java
  49. 2
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/opercustomize/impl/CustomerFootBarServiceImpl.java
  50. 1
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/opercustomize/CustomerFootBarDao.xml
  51. 16
      epmet-module/data-statistical/data-statistical-server/pom.xml
  52. 15
      epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/read/CustomStringStringConverter.java
  53. 19
      epmet-module/epmet-demo/epmet-demo-server/pom.xml
  54. 58
      epmet-module/epmet-demo/epmet-demo-server/src/main/java/com/epmet/utils/ExcelPaseTest.java
  55. 20
      epmet-module/epmet-demo/epmet-demo-server/src/main/java/com/epmet/utils/IndexOrNameData.java
  56. 82
      epmet-module/epmet-demo/epmet-demo-server/src/main/java/com/epmet/utils/TempDynamicEasyExcelListener.java
  57. 21
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/UserDemandNameQueryFormDTO.java
  58. 5
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetHeartOpenFeignClient.java
  59. 7
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/fallback/EpmetHeartOpenFeignClientFallback.java
  60. 105
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcResiDemandDictController.java
  61. 41
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcResiDemandDictDao.java
  62. 73
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcResiDemandDictEntity.java
  63. 114
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcResiDemandDictService.java
  64. 120
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcResiDemandDictServiceImpl.java
  65. 77
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcResiDemandDictDao.xml
  66. 15
      epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/SystemMessageType.java
  67. 5
      epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/SystemMessageServiceImpl.java
  68. 11
      epmet-module/epmet-oss/epmet-oss-client/src/main/java/com/epmet/feign/OssFeignClient.java
  69. 6
      epmet-module/epmet-oss/epmet-oss-client/src/main/java/com/epmet/feign/fallback/OssFeignClientFallback.java
  70. 16
      epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AbstractCloudStorageService.java
  71. 9
      epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AliyunCloudStorageService.java
  72. 24
      epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/FastDFSCloudStorageService.java
  73. 24
      epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/LocalCloudStorageService.java
  74. 24
      epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/QcloudCloudStorageService.java
  75. 24
      epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/QiniuCloudStorageService.java
  76. 5
      epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java
  77. 7
      epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/OssService.java
  78. 18
      epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/impl/OssServiceImpl.java
  79. 8
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/BizPointTotalDetailServiceImpl.java
  80. 4
      epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/apiservice/impl/PingyinPrivateEpmetApiService.java
  81. 15
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/constant/NeighborhoodConstant.java
  82. 4
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/constant/OrgInfoConstant.java
  83. 55
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/BuildingTreeLevelDTO.java
  84. 15
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerAgencyDTO.java
  85. 133
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcBuildingDTO.java
  86. 91
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcBuildingUnitDTO.java
  87. 136
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcHouseDTO.java
  88. 131
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcNeighborHoodDTO.java
  89. 86
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcNeighborHoodPartDTO.java
  90. 81
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcNeighborHoodPropertyDTO.java
  91. 76
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcPropertyManagementDTO.java
  92. 2
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AgencyIdFormDTO.java
  93. 22
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/BaseInfoFamilyBuildingFormDTO.java
  94. 24
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/GridOptionFormDTO.java
  95. 17
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/HouseFormDTO.java
  96. 129
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcBulidingFormDTO.java
  97. 42
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcBulidingUnitFormDTO.java
  98. 105
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcHouseFormDTO.java
  99. 105
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcNeighborHoodFormDTO.java
  100. 53
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcPropertyManagementFormDTO.java

51
epmet-admin/epmet-admin-client/src/main/java/com/epmet/feign/EpmetAdminOpenFeignClient.java

@ -1,6 +1,7 @@
package com.epmet.feign;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.dto.result.OptionResultDTO;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.result.CorsConfigResultDTO;
import com.epmet.feign.fallback.EpmetAdminOpenFeignClientFallbackFactory;
@ -21,4 +22,54 @@ public interface EpmetAdminOpenFeignClient {
*/
@PostMapping("/sys/cors-config/list")
Result<List<CorsConfigResultDTO>> list();
/**
* @Description 文化程度
* @Param
* @Return {@link Result<List< OptionResultDTO >>}
* @Author zhaoqifeng
* @Date 2021/10/26 17:27
*/
@PostMapping("/sys/dict/data/education")
Result<List<OptionResultDTO>> getEducationOption();
/**
* @Description 住房性质
* @Param
* @Return {@link Result<List<OptionResultDTO>>}
* @Author zhaoqifeng
* @Date 2021/10/26 17:27
*/
@PostMapping("/sys/dict/data/house")
Result<List<OptionResultDTO>> getHouseOption();
/**
* @Description 民族
* @Param
* @Return {@link Result<List<OptionResultDTO>>}
* @Author zhaoqifeng
* @Date 2021/10/26 17:27
*/
@PostMapping("/sys/dict/data/nation")
Result<List<OptionResultDTO>> getNationOption();
/**
* @Description 九小场所
* @Param
* @Return {@link Result<List<OptionResultDTO>>}
* @Author zhaoqifeng
* @Date 2021/10/26 17:27
*/
@PostMapping("/sys/dict/data/ninesmallplaces")
Result<List<OptionResultDTO>> getNineSmallPlacesOption();
/**
* @Description 人员关系
* @Param
* @Return {@link Result<List<OptionResultDTO>>}
* @Author zhaoqifeng
* @Date 2021/10/26 17:27
*/
@PostMapping("/sys/dict/data/relationship")
Result<List<OptionResultDTO>> getRelationshipOption();
}

26
epmet-admin/epmet-admin-client/src/main/java/com/epmet/feign/fallback/EpmetAdminOpenFeignClientFallback.java

@ -1,6 +1,7 @@
package com.epmet.feign.fallback;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.dto.result.OptionResultDTO;
import com.epmet.commons.tools.utils.ModuleUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.result.CorsConfigResultDTO;
@ -15,4 +16,29 @@ public class EpmetAdminOpenFeignClientFallback implements EpmetAdminOpenFeignCli
public Result<List<CorsConfigResultDTO>> list() {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "list", null);
}
@Override
public Result<List<OptionResultDTO>> getEducationOption() {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getEducationOption", null);
}
@Override
public Result<List<OptionResultDTO>> getHouseOption() {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getHouseOption", null);
}
@Override
public Result<List<OptionResultDTO>> getNationOption() {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getNationOption", null);
}
@Override
public Result<List<OptionResultDTO>> getNineSmallPlacesOption() {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getNineSmallPlacesOption", null);
}
@Override
public Result<List<OptionResultDTO>> getRelationshipOption() {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getRelationshipOption", null);
}
}

78
epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysDictDataController.java

@ -8,18 +8,21 @@
package com.epmet.controller;
import com.epmet.dto.SysDictDataDTO;
import com.epmet.service.SysDictDataService;
import com.epmet.commons.tools.constant.Constant;
import com.epmet.commons.tools.dto.form.DictListFormDTO;
import com.epmet.commons.tools.dto.result.DictListResultDTO;
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.commons.tools.validator.AssertUtils;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.dto.SysDictDataDTO;
import com.epmet.service.SysDictDataService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
/**
@ -78,4 +81,73 @@ public class SysDictDataController {
return new Result();
}
/**
* @Description 九小场所
* @Param
* @Return {@link Result<List<OptionResultDTO>>}
* @Author zhaoqifeng
* @Date 2021/10/26 17:27
*/
@PostMapping("ninesmallplaces")
public Result<List<OptionResultDTO>> getNineSmallPlacesOption() {
return new Result<List<OptionResultDTO>>().ok(sysDictDataService.getNineSmallPlacesOption());
}
/**
* @Description 文化程度
* @Param
* @Return {@link Result<List<OptionResultDTO>>}
* @Author zhaoqifeng
* @Date 2021/10/26 17:27
*/
@PostMapping("education")
public Result<List<OptionResultDTO>> getEducationOption() {
return new Result<List<OptionResultDTO>>().ok(sysDictDataService.getEducationOption());
}
/**
* @Description 民族
* @Param
* @Return {@link Result<List<OptionResultDTO>>}
* @Author zhaoqifeng
* @Date 2021/10/26 17:27
*/
@PostMapping("nation")
public Result<List<OptionResultDTO>> getNationOption() {
return new Result<List<OptionResultDTO>>().ok(sysDictDataService.getNationOption());
}
/**
* @Description 人员关系
* @Param
* @Return {@link Result<List<OptionResultDTO>>}
* @Author zhaoqifeng
* @Date 2021/10/26 17:27
*/
@PostMapping("relationship")
public Result<List<OptionResultDTO>> getRelationshipOption() {
return new Result<List<OptionResultDTO>>().ok(sysDictDataService.getRelationshipOption());
}
/**
* @Description 住房性质
* @Param
* @Return {@link Result<List<OptionResultDTO>>}
* @Author zhaoqifeng
* @Date 2021/10/26 17:27
*/
@PostMapping("house")
public Result<List<OptionResultDTO>> getHouseOption() {
return new Result<List<OptionResultDTO>>().ok(sysDictDataService.getHouseOption());
}
/**
* @Description 字典数据查询通用接口
* @Author sun
*/
@PostMapping("dictlist")
public Result<List<DictListResultDTO>> dictList(@RequestBody DictListFormDTO formDTO) {
return new Result<List<DictListResultDTO>>().ok(sysDictDataService.dictList(formDTO.getDictType()));
}
}

3
epmet-admin/epmet-admin-server/src/main/java/com/epmet/dao/SysDictDataDao.java

@ -9,6 +9,7 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.commons.tools.dto.result.DictListResultDTO;
import com.epmet.entity.DictData;
import com.epmet.entity.SysDictDataEntity;
import org.apache.ibatis.annotations.Mapper;
@ -27,4 +28,6 @@ public interface SysDictDataDao extends BaseDao<SysDictDataEntity> {
* 字典数据列表
*/
List<DictData> getDictDataList();
List<DictListResultDTO> selectDictList(String dictType);
}

2
epmet-admin/epmet-admin-server/src/main/java/com/epmet/mq/listener/bean/log/LogOperationHelper.java

@ -57,7 +57,7 @@ public class LogOperationHelper implements ResultDataResolver {
form.setUserId(userId);
Result<CustomerStaffDTO> result = userOpenFeignClient.getCustomerStaffInfoByUserId(form);
CustomerStaffDTO staffInfo = getResultDataOrThrowsException(result, ServiceConstant.EPMET_ADMIN_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(),
"调用epmet-user服务获取staff信息发生异常");
"调用epmet-user服务获取staff信息发生异常", null);
return new OperatorInfo(staffInfo.getCustomerId(), staffInfo.getMobile(), staffInfo.getRealName());
}
}

55
epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/SysDictDataService.java

@ -8,11 +8,15 @@
package com.epmet.service;
import com.epmet.dto.SysDictDataDTO;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.dto.form.DictListFormDTO;
import com.epmet.commons.tools.dto.result.DictListResultDTO;
import com.epmet.commons.tools.dto.result.OptionResultDTO;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.SysDictDataDTO;
import com.epmet.entity.SysDictDataEntity;
import java.util.List;
import java.util.Map;
/**
@ -31,5 +35,54 @@ public interface SysDictDataService extends BaseService<SysDictDataEntity> {
void update(SysDictDataDTO dto);
void delete(Long[] ids);
/**
* 九小场所
* @Param
* @Return {@link List<OptionResultDTO>}
* @Author zhaoqifeng
* @Date 2021/10/26 17:11
*/
List<OptionResultDTO> getNineSmallPlacesOption();
/**
* 文化程度
* @Param
* @Return {@link List<OptionResultDTO>}
* @Author zhaoqifeng
* @Date 2021/10/26 17:12
*/
List<OptionResultDTO> getEducationOption();
/**
* 民族
* @Param
* @Return {@link List<OptionResultDTO>}
* @Author zhaoqifeng
* @Date 2021/10/26 17:12
*/
List<OptionResultDTO> getNationOption();
/**
* 人员关系
* @Param
* @Return {@link List<OptionResultDTO>}
* @Author zhaoqifeng
* @Date 2021/10/26 17:12
*/
List<OptionResultDTO> getRelationshipOption();
/**
* 住房性质
* @Param
* @Return {@link List<OptionResultDTO>}
* @Author zhaoqifeng
* @Date 2021/10/26 17:12
*/
List<OptionResultDTO> getHouseOption();
/**
* @Description 字典数据查询通用接口
* @Author sun
*/
List<DictListResultDTO> dictList(String dictType);
}

6
epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/impl/LogOperationServiceImpl.java

@ -82,7 +82,7 @@ public class LogOperationServiceImpl implements LogOperationService, ResultDataR
CustomerStaffFormDTO form = new CustomerStaffFormDTO();
form.setUserIds(new ArrayList<>(userIds));
Result<List<CustomerStaffDTO>> result = userOpenFeignClient.list(form);
List<CustomerStaffDTO> staffs = getResultDataOrThrowsException(result, ServiceConstant.EPMET_USER_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "调用user服务发生异常");
List<CustomerStaffDTO> staffs = getResultDataOrThrowsException(result, ServiceConstant.EPMET_USER_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "调用user服务发生异常", null);
HashMap<String, CustomerStaffDTO> staffMap = new HashMap<>();
staffs.forEach(s -> {
@ -103,7 +103,7 @@ public class LogOperationServiceImpl implements LogOperationService, ResultDataR
form.setCustomerId(customerId);
form.setMobile(operatorMobile);
Result<List<CustomerStaffDTO>> result = userOpenFeignClient.list(form);
List<CustomerStaffDTO> staffs = getResultDataOrThrowsException(result, ServiceConstant.EPMET_USER_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "调用user服务发生异常");
List<CustomerStaffDTO> staffs = getResultDataOrThrowsException(result, ServiceConstant.EPMET_USER_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "调用user服务发生异常", null);
if (staffs.size() == 0) {
return null;
@ -134,7 +134,7 @@ public class LogOperationServiceImpl implements LogOperationService, ResultDataR
CustomerStaffFormDTO form = new CustomerStaffFormDTO();
form.setRealName(operatorName);
Result<List<CustomerStaffDTO>> result = userOpenFeignClient.list(form);
List<CustomerStaffDTO> staffs = getResultDataOrThrowsException(result, ServiceConstant.EPMET_USER_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "调用user服务查询工作人员信息发生异常");
List<CustomerStaffDTO> staffs = getResultDataOrThrowsException(result, ServiceConstant.EPMET_USER_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "调用user服务查询工作人员信息发生异常", null);
List<String> userIds = new ArrayList<>();
HashMap<String, CustomerStaffDTO> staffMap = new HashMap<String, CustomerStaffDTO>();

127
epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/impl/SysDictDataServiceImpl.java

@ -8,9 +8,13 @@
package com.epmet.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.dto.form.DictListFormDTO;
import com.epmet.commons.tools.dto.result.DictListResultDTO;
import com.epmet.commons.tools.dto.result.OptionResultDTO;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.dao.SysDictDataDao;
@ -22,7 +26,9 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* 字典类型
@ -85,4 +91,125 @@ public class SysDictDataServiceImpl extends BaseServiceImpl<SysDictDataDao, SysD
deleteBatchIds(Arrays.asList(ids));
}
/**
* 九小场所
*
* @Param
* @Return {@link List < OptionResultDTO >}
* @Author zhaoqifeng
* @Date 2021/10/26 17:11
*/
@Override
public List<OptionResultDTO> getNineSmallPlacesOption() {
LambdaQueryWrapper<SysDictDataEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(SysDictDataEntity::getDictTypeId, 1000000000000000001L);
wrapper.orderByAsc(SysDictDataEntity::getSort);
List<SysDictDataEntity> list = baseDao.selectList(wrapper);
return list.stream().map(item -> {
OptionResultDTO dto = new OptionResultDTO();
dto.setValue(item.getDictValue());
dto.setLabel(item.getDictLabel());
dto.setSysDictDataId(item.getId().toString());
return dto;
}).collect(Collectors.toList());
}
/**
* 文化程度
*
* @Param
* @Return {@link List<OptionResultDTO>}
* @Author zhaoqifeng
* @Date 2021/10/26 17:12
*/
@Override
public List<OptionResultDTO> getEducationOption() {
LambdaQueryWrapper<SysDictDataEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(SysDictDataEntity::getDictTypeId, 1000000000000000002L);
wrapper.orderByAsc(SysDictDataEntity::getSort);
List<SysDictDataEntity> list = baseDao.selectList(wrapper);
return list.stream().map(item -> {
OptionResultDTO dto = new OptionResultDTO();
dto.setValue(item.getDictValue());
dto.setLabel(item.getDictLabel());
return dto;
}).collect(Collectors.toList());
}
/**
* 民族
*
* @Param
* @Return {@link List<OptionResultDTO>}
* @Author zhaoqifeng
* @Date 2021/10/26 17:12
*/
@Override
public List<OptionResultDTO> getNationOption() {
LambdaQueryWrapper<SysDictDataEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(SysDictDataEntity::getDictTypeId, 1000000000000000003L);
wrapper.orderByAsc(SysDictDataEntity::getSort);
List<SysDictDataEntity> list = baseDao.selectList(wrapper);
return list.stream().map(item -> {
OptionResultDTO dto = new OptionResultDTO();
dto.setValue(item.getDictValue());
dto.setLabel(item.getDictLabel());
return dto;
}).collect(Collectors.toList());
}
/**
* 人员关系
*
* @Param
* @Return {@link List<OptionResultDTO>}
* @Author zhaoqifeng
* @Date 2021/10/26 17:12
*/
@Override
public List<OptionResultDTO> getRelationshipOption() {
LambdaQueryWrapper<SysDictDataEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(SysDictDataEntity::getDictTypeId, 1000000000000000004L);
wrapper.orderByAsc(SysDictDataEntity::getSort);
List<SysDictDataEntity> list = baseDao.selectList(wrapper);
return list.stream().map(item -> {
OptionResultDTO dto = new OptionResultDTO();
dto.setValue(item.getDictValue());
dto.setLabel(item.getDictLabel());
return dto;
}).collect(Collectors.toList());
}
/**
* 住房性质
*
* @Param
* @Return {@link List<OptionResultDTO>}
* @Author zhaoqifeng
* @Date 2021/10/26 17:12
*/
@Override
public List<OptionResultDTO> getHouseOption() {
LambdaQueryWrapper<SysDictDataEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(SysDictDataEntity::getDictTypeId, 1000000000000000005L);
wrapper.orderByAsc(SysDictDataEntity::getSort);
List<SysDictDataEntity> list = baseDao.selectList(wrapper);
return list.stream().map(item -> {
OptionResultDTO dto = new OptionResultDTO();
dto.setValue(item.getDictValue());
dto.setLabel(item.getDictLabel());
return dto;
}).collect(Collectors.toList());
}
/**
* @Description 字典数据查询通用接口
* @Author sun
*/
@Override
public List<DictListResultDTO> dictList(String dictType) {
List<DictListResultDTO> resultDTOList = baseDao.selectDictList(dictType);
return resultDTOList;
}
}

13
epmet-admin/epmet-admin-server/src/main/resources/mapper/SysDictDataDao.xml

@ -7,4 +7,17 @@
select dict_type_id, dict_label, dict_value from sys_dict_data order by dict_type_id, sort
</select>
<select id="selectDictList" resultType="com.epmet.commons.tools.dto.result.DictListResultDTO">
SELECT
a.dict_label label,
a.dict_value `value`
FROM
sys_dict_data a
INNER JOIN sys_dict_type b ON a.dict_type_id = b.id
WHERE
b.dict_type = #{dictType}
ORDER BY
a.sort ASC
</select>
</mapper>

162
epmet-auth/src/main/java/com/epmet/controller/IcLoinController.java

@ -0,0 +1,162 @@
package com.epmet.controller;
import cn.hutool.core.bean.BeanUtil;
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.RenException;
import com.epmet.commons.tools.feign.ResultDataResolver;
import com.epmet.commons.tools.redis.RedisKeys;
import com.epmet.commons.tools.redis.RedisUtils;
import com.epmet.commons.tools.security.password.PasswordUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dto.CustomerStaffDTO;
import com.epmet.dto.form.LoginByPassWordFormDTO;
import com.epmet.dto.form.RootOrgListByStaffIdFormDTO;
import com.epmet.dto.result.StaffOrgsResultDTO;
import com.epmet.dto.result.UserTokenResultDTO;
import com.epmet.feign.EpmetUserFeignClient;
import com.epmet.feign.GovOrgOpenFeignClient;
import com.epmet.redis.CaptchaRedis;
import com.epmet.redis.IcLoginTicketCacheBean;
import com.epmet.service.IcLoginService;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
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 java.util.*;
@RestController
@RequestMapping("ic")
public class IcLoinController implements ResultDataResolver {
public static final long IC_LOGIN_TICKET_EXPIRE_SECONDS = 2 * 60l;
@Autowired
private EpmetUserFeignClient epmetUserFeignClient;
@Autowired
private GovOrgOpenFeignClient govOrgOpenFeignClient;
@Autowired
private CaptchaRedis captchaRedis;
@Autowired
private IcLoginService icLoginService;
@Autowired
private RedisUtils redisUtils;
/**
* @description 基层治理赋能平台-根据手机号密码获取组织列表
*
* @param input
* @return
* @author wxz
* @date 2021.10.25 09:56:33
*/
@PostMapping("getmyorgsbypassword")
public Result<HashMap<String, Object>> getMyOrgsByPassword(@RequestBody LoginByPassWordFormDTO input) {
ValidatorUtils.validateEntity(input, LoginByPassWordFormDTO.IcGetOrgsByPwdGroup.class);
String captcha = input.getCaptcha();
String mobile = input.getMobile();
String password = input.getPassword();
String uuid = input.getUuid();
// 图片验证码
String captchaInCache = captchaRedis.getIcLoginCaptcha(uuid);
if (StringUtils.isBlank(captchaInCache) || !captcha.equals(captchaInCache)) {
throw new RenException(EpmetErrorCode.ERR10019.getCode());
}
// 获取用户信息
Result<List<CustomerStaffDTO>> staffResult = epmetUserFeignClient.checkCustomerStaff(mobile);
List<CustomerStaffDTO> staffList = getResultDataOrThrowsException(staffResult, ServiceConstant.EPMET_USER_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "【基层治理平台登录】获取用户信息失败", null);
if (CollectionUtils.isEmpty(staffList)) {
throw new RenException(EpmetErrorCode.ERR10003.getCode());
}
CustomerStaffDTO staffInfo = staffList.get(0);
if (!PasswordUtils.matches(password, staffInfo.getPassword())) {
throw new RenException(EpmetErrorCode.ERR10004.getCode());
}
String staffId = staffInfo.getUserId();
// 查询跟组织列表
RootOrgListByStaffIdFormDTO orgListForm = new RootOrgListByStaffIdFormDTO();
orgListForm.setStaffId(staffId);
Result<List<StaffOrgsResultDTO>> orgListResult = govOrgOpenFeignClient.getStaffOrgListByStaffId(orgListForm);
List<StaffOrgsResultDTO> orgs = getResultDataOrThrowsException(orgListResult, ServiceConstant.GOV_ORG_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "【基层治理平台登录】根据staffId查询所属客户跟组织列表失败", null);
// 生成登录票据
String ticket = UUID.randomUUID().toString().replace("-", "");
IcLoginTicketCacheBean ticketCacheBean = new IcLoginTicketCacheBean();
ticketCacheBean.setMobile(mobile);
ticketCacheBean.setStaffId(staffId);
cacheTicket(ticket, ticketCacheBean);
HashMap<String, Object> resultMap = new HashMap<>();
resultMap.put("staffId", staffId);
resultMap.put("ticket", ticket);
resultMap.put("orgs", orgs);
return new Result<HashMap<String, Object>>().ok(resultMap);
}
/**
* @description IC登录
*
* @param input
* @return
* @author wxz
* @date 2021.10.25 21:14:22
*/
@PostMapping("login")
public Result<UserTokenResultDTO> login(@RequestBody LoginByPassWordFormDTO input) {
ValidatorUtils.validateEntity(input, LoginByPassWordFormDTO.IcLoginGroup.class);
String ticket = input.getTicket();
String orgId = input.getRootAgencyId();
String staffId = input.getStaffId();
// ticket校验
IcLoginTicketCacheBean ticketCache = getTicketCache(ticket);
if (ticketCache == null || !ticketCache.getStaffId().equals(staffId)) {
// ticket&userId不对应
throw new RenException(EpmetErrorCode.ERR10008.getCode());
}
UserTokenResultDTO tokenInfo = icLoginService.login(staffId, orgId);
return new Result<UserTokenResultDTO>().ok(tokenInfo);
}
private void cacheTicket(String ticket, IcLoginTicketCacheBean cacheBean) {
Map<String, Object> stringObjectMap = BeanUtil.beanToMap(cacheBean, false, true);
redisUtils.hMSet(RedisKeys.loginTicket(AppClientConstant.APP_IC, ticket), stringObjectMap, IC_LOGIN_TICKET_EXPIRE_SECONDS);
}
/**
* @description 从缓存中取出ticket并删除
*
* @param ticket
* @return
* @author wxz
* @date 2021.10.26 08:58:27
*/
private IcLoginTicketCacheBean getTicketCache(String ticket) {
String key = RedisKeys.loginTicket(AppClientConstant.APP_IC, ticket);
Map<String, Object> map = redisUtils.hGetAll(key);
if (CollectionUtils.sizeIsEmpty(map)) {
return null;
}
redisUtils.expire(key, 0);
return BeanUtil.mapToBean(map, IcLoginTicketCacheBean.class, false);
}
}

24
epmet-auth/src/main/java/com/epmet/controller/LoginController.java

@ -65,6 +65,30 @@ public class LoginController {
}
}
/**
* @description 基层治理平台登录验证码
*
* @param response
* @return
* @author wxz
* @date 2021.10.25 14:19:40
*/
@GetMapping("ic-login-captcha")
public void icLoginCaptcha(HttpServletResponse response, String uuid) throws IOException {
try {
//生成图片验证码
BufferedImage image = captchaService.createIcLoginCaptcha(uuid);
response.reset();
response.setHeader("Cache-Control", "no-store, no-cache");
response.setContentType("image/jpeg");
ServletOutputStream out = response.getOutputStream();
ImageIO.write(image, "jpg", out);
out.close();
} catch (IOException e) {
log.error("获取登陆验证码异常", e);
}
}
/**
* @param formDTO
* @return com.epmet.commons.tools.utils.Result<java.lang.String>

32
epmet-auth/src/main/java/com/epmet/dto/form/LoginByPassWordFormDTO.java

@ -14,27 +14,53 @@ import java.io.Serializable;
public class LoginByPassWordFormDTO extends LoginCommonFormDTO implements Serializable {
private static final long serialVersionUID = -7507437651048051183L;
// 基层治理平台账号密码获取组织列表分组
public interface IcGetOrgsByPwdGroup {}
// 基层治理平台登录分组
public interface IcLoginGroup {}
/**
* 手机号
*/
@NotBlank(message = "手机号不能为空",groups = {AddUserShowGroup.class})
private String phone;
@NotBlank(message = "手机号不能为空",groups = {IcGetOrgsByPwdGroup.class})
private String mobile;
/**
* 密码
*/
@NotBlank(message = "密码不能为空",groups = {AddUserShowGroup.class})
@NotBlank(message = "密码不能为空",groups = {AddUserShowGroup.class, IcGetOrgsByPwdGroup.class})
private String password;
/**
* 验证码
*/
@NotBlank(message="验证码不能为空",groups = {AddUserShowGroup.class})
@NotBlank(message="验证码不能为空",groups = {AddUserShowGroup.class, IcGetOrgsByPwdGroup.class})
private String captcha;
/**
* 唯一标识
*/
@NotBlank(message="唯一标识不能为空",groups = {AddUserInternalGroup.class})
@NotBlank(message="唯一标识不能为空",groups = {AddUserInternalGroup.class, IcGetOrgsByPwdGroup.class})
private String uuid;
/**
* 登录票据目前ic基层治理平台用到了
*/
@NotBlank(message="登录票据ticket不能为空", groups = {IcLoginGroup.class})
private String ticket;
/**
* 所选的要登录的组织id
*/
@NotBlank(message = "要登录的orgId不能为空", groups = { IcLoginGroup.class })
private String rootAgencyId;
/**
* 工作人员id
*/
@NotBlank(message = "人员Id不能为空", groups = { IcLoginGroup.class })
private String staffId;
}

25
epmet-auth/src/main/java/com/epmet/redis/CaptchaRedis.java

@ -45,6 +45,12 @@ public class CaptchaRedis {
redisUtils.set(key, captcha, EXPIRE);
}
public void setIcLoginCaptcha(String uuid, String captcha) {
String key = RedisKeys.getIcLoginCaptchaKey(uuid);
logger.info("保存验证码key=["+key+"]");
redisUtils.set(key, captcha, EXPIRE);
}
public String get(String uuid){
String key = RedisKeys.getLoginCaptchaKey(uuid);
String captcha = (String)redisUtils.get(key);
@ -57,6 +63,25 @@ public class CaptchaRedis {
return captcha;
}
/**
* @description 基层治理平台登录验证码查询
*
* @param uuid
* @return
* @author wxz
* @date 2021.10.25 14:28:28
*/
public String getIcLoginCaptcha(String uuid) {
String key = RedisKeys.getIcLoginCaptchaKey(uuid);
String captcha = (String)redisUtils.get(key);
//删除验证码
if(captcha != null){
redisUtils.delete(key);
}
return captcha;
}
/**
* @param sendSmsCodeFormDTO appclientphone
* @param smsCode 验证码

9
epmet-auth/src/main/java/com/epmet/redis/IcLoginTicketCacheBean.java

@ -0,0 +1,9 @@
package com.epmet.redis;
import lombok.Data;
@Data
public class IcLoginTicketCacheBean {
private String staffId;
private String mobile;
}

10
epmet-auth/src/main/java/com/epmet/service/CaptchaService.java

@ -23,6 +23,16 @@ public interface CaptchaService {
*/
BufferedImage create(String uuid);
/**
* @description 基层治理平台登录验证码
*
* @param
* @return
* @author wxz
* @date 2021.10.25 14:15:30
*/
BufferedImage createIcLoginCaptcha(String uuid);
/**
* 验证码效验
* @param uuid uuid

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

@ -0,0 +1,9 @@
package com.epmet.service;
import com.epmet.dto.result.UserTokenResultDTO;
public interface IcLoginService {
UserTokenResultDTO login(String staffId, String orgId);
}

12
epmet-auth/src/main/java/com/epmet/service/impl/CaptchaServiceImpl.java

@ -17,6 +17,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.awt.image.BufferedImage;
import java.util.UUID;
/**
* 验证码
@ -43,6 +44,17 @@ public class CaptchaServiceImpl implements CaptchaService {
return producer.createImage(captcha);
}
@Override
public BufferedImage createIcLoginCaptcha(String uuid) {
//生成验证码
String captchaText = producer.createText();
//logger.info("uuid:"+uuid+",生成的验证码:"+captcha);
//保存验证码
captchaRedis.setIcLoginCaptcha(uuid, captchaText);
return producer.createImage(captchaText);
}
@Override
public boolean validate(String uuid, String code) {
String captcha = captchaRedis.get(uuid);

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

@ -3,6 +3,7 @@ package com.epmet.service.impl;
import com.epmet.common.token.constant.LoginConstant;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.security.dto.GovTokenDto;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.security.password.PasswordUtils;
import com.epmet.commons.tools.utils.CpUserDetailRedis;
@ -45,6 +46,8 @@ public class GovWebServiceImpl implements GovWebService {
private CpUserDetailRedis cpUserDetailRedis;
@Autowired
private EpmetUserFeignClient epmetUserFeignClient;
@Autowired
private ThirdLoginServiceImpl thirdLoginService;
/**
* @param formDTO
@ -105,7 +108,11 @@ public class GovWebServiceImpl implements GovWebService {
String token = jwtTokenUtils.createToken(map);
logger.info("app:" + formDTO.getApp() + ";client:" + formDTO.getClient() + ";userId:" + userId + ";生成token[" + token + "]");
int expire = jwtTokenProperties.getExpire();
TokenDto tokenDto = new TokenDto();
String orgIdPath = thirdLoginService.getOrgIdPath(userId);
String[] orgIdPathParts = orgIdPath.split(":");
GovTokenDto tokenDto = new GovTokenDto();
tokenDto.setCustomerId(formDTO.getCustomerId());
tokenDto.setApp(formDTO.getApp());
tokenDto.setClient(formDTO.getClient());
@ -113,6 +120,13 @@ public class GovWebServiceImpl implements GovWebService {
tokenDto.setToken(token);
tokenDto.setUpdateTime(System.currentTimeMillis());
tokenDto.setExpireTime(jwtTokenUtils.getExpiration(token).getTime());
tokenDto.setAgencyId(orgIdPathParts[orgIdPathParts.length - 1]);
tokenDto.setRootAgencyId(orgIdPathParts[0]);
tokenDto.setDeptIdList(thirdLoginService.getDeptartmentIdList(userId));
tokenDto.setGridIdList(thirdLoginService.getGridIdList(userId));
tokenDto.setRoleList(thirdLoginService.queryGovStaffRoles(userId, orgIdPathParts[orgIdPathParts.length - 1]));
tokenDto.setOrgIdPath(orgIdPath);
cpUserDetailRedis.set(tokenDto, expire);
logger.info("截止时间:" + DateUtils.format(jwtTokenUtils.getExpiration(token), "yyyy-MM-dd HH:mm:ss"));
return token;

177
epmet-auth/src/main/java/com/epmet/service/impl/IcLoginServiceImpl.java

@ -0,0 +1,177 @@
package com.epmet.service.impl;
import cn.hutool.core.bean.BeanUtil;
import com.epmet.auth.constants.AuthOperationConstants;
import com.epmet.commons.rocketmq.messages.LoginMQMsg;
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.RenException;
import com.epmet.commons.tools.feign.ResultDataResolver;
import com.epmet.commons.tools.redis.RedisKeys;
import com.epmet.commons.tools.redis.RedisUtils;
import com.epmet.commons.tools.security.dto.IcTokenDto;
import com.epmet.commons.tools.utils.CpUserDetailRedis;
import com.epmet.commons.tools.utils.IpUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.CustomerAgencyDTO;
import com.epmet.dto.form.SystemMsgFormDTO;
import com.epmet.dto.result.UserTokenResultDTO;
import com.epmet.feign.EpmetMessageOpenFeignClient;
import com.epmet.feign.GovOrgOpenFeignClient;
import com.epmet.jwt.JwtTokenProperties;
import com.epmet.jwt.JwtTokenUtils;
import com.epmet.service.IcLoginService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest;
import java.util.*;
@Service
@Slf4j
public class IcLoginServiceImpl implements IcLoginService, ResultDataResolver {
@Autowired
private JwtTokenUtils jwtTokenUtils;
@Autowired
private RedisUtils redisUtils;
@Autowired
private CpUserDetailRedis cpUserDetailRedis;
@Autowired
private JwtTokenProperties jwtTokenProperties;
@Autowired
private EpmetMessageOpenFeignClient messageOpenFeignClient;
@Autowired
private GovOrgOpenFeignClient govOrgOpenFeignClient;
@Autowired
private ThirdLoginServiceImpl thirdLoginService;
@Override
public UserTokenResultDTO login(String staffId, String orgId) {
String app = AppClientConstant.APP_IC;
String client = AppClientConstant.CLIENT_WEB;
// 1.获取用户token
String token = this.generateIcToken(staffId, app, client);
Result<CustomerAgencyDTO> agencyResult = govOrgOpenFeignClient.getAgencyById(orgId);
CustomerAgencyDTO agencyInfo = getResultDataOrThrowsException(agencyResult, ServiceConstant.GOV_ORG_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "【IC平台登录】获取组织信息失败", null);
// 2.缓存token
cacheToken(app, client, staffId, token, orgId, agencyInfo.getCustomerId());
UserTokenResultDTO userTokenResultDTO = new UserTokenResultDTO();
userTokenResultDTO.setToken(token);
userTokenResultDTO.setCustomerId(agencyInfo.getCustomerId());
//7.发送登录事件
try {
sendLoginEvent(staffId, app, client);
} catch (RenException e) {
log.error(e.getInternalMsg());
} catch (Exception e) {
log.error("【工作端workLogin登录】发送登录事件失败,程序继续执行。");
}
return userTokenResultDTO;
}
/**
* @param staffId
* @return
* @description 生成Ic平台的Token
* @author wxz
* @date 2021.10.26 13:42:36
*/
private String generateIcToken(String staffId, String app, String client) {
Map<String, Object> map = new HashMap<>();
map.put("app", app);
map.put("client", client);
map.put("userId", staffId);
String token = jwtTokenUtils.createToken(map);
return token;
}
/**
* @param userId
* @param fromApp
* @param fromClient
* @return
* @description 发布登录时间
* @author wxz
* @date 2021.10.26 13:45:59
*/
private void sendLoginEvent(String userId, String fromApp, String fromClient) {
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
LoginMQMsg loginMQMsg = new LoginMQMsg();
loginMQMsg.setUserId(userId);
loginMQMsg.setLoginTime(new Date());
loginMQMsg.setIp(IpUtils.getIpAddr(request));
loginMQMsg.setFromApp(fromApp);
loginMQMsg.setFromClient(fromClient);
SystemMsgFormDTO form = new SystemMsgFormDTO();
form.setMessageType(AuthOperationConstants.LOGIN);
form.setContent(loginMQMsg);
messageOpenFeignClient.sendSystemMsgByMQ(form);
}
/**
* @description 缓存token到redis
*
* @param app
* @param client
* @param userId
* @param token
* @param rootAgencyId
* @return
* @author wxz
* @date 2021.10.26 14:19:07
*/
private void cacheToken(String app,
String client,
String userId,
String token,
String rootAgencyId,
String customerId) {
IcTokenDto tokenDto = new IcTokenDto();
int expire = jwtTokenProperties.getExpire();
long expireTime = jwtTokenUtils.getExpiration(token).getTime();
tokenDto.setApp(app);
tokenDto.setClient(client);
tokenDto.setUserId(userId);
tokenDto.setToken(token);
tokenDto.setExpireTime(expireTime);
tokenDto.setRootAgencyId(rootAgencyId);
tokenDto.setCustomerId(customerId);
//设置部门,网格,角色列表
tokenDto.setDeptIdList(thirdLoginService.getDeptartmentIdList(userId));
tokenDto.setGridIdList(thirdLoginService.getGridIdList(userId));
CustomerAgencyDTO agency = thirdLoginService.getAgencyByStaffId(userId);
if (agency != null) {
tokenDto.setAgencyId(agency.getId());
tokenDto.setRoleList(thirdLoginService.queryGovStaffRoles(userId, agency.getId()));
}
tokenDto.setOrgIdPath(thirdLoginService.getOrgIdPath(userId));
String key = RedisKeys.getCpUserKey(app, client, userId);
Map<String, Object> map = BeanUtil.beanToMap(tokenDto, false, true);
redisUtils.hMSet(key, map, expire);
}
}

2
epmet-commons/epmet-commons-extapp-auth/pom.xml

@ -18,7 +18,7 @@
<commons.fileupload.version>1.3.3</commons.fileupload.version>
<commons.io.version>2.6</commons.io.version>
<hutool.version>4.6.1</hutool.version>
<easypoi.version>4.1.0</easypoi.version>
<easypoi.version>4.4.0</easypoi.version>
<joda.time.version>2.9.9</joda.time.version>
<fastjson.version>1.2.60</fastjson.version>
<gson.version>2.8.6</gson.version>

5
epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/ConsomerGroupConstants.java

@ -65,4 +65,9 @@ public interface ConsomerGroupConstants {
*/
String OPEN_DATA_PROJECT_CHANGE_EVENT_LISTENER_GROUP = "open_data_project_change_event_listener_group";
/**
* 开放的人员信息变更预警统计
*/
String IC_WARN_STATS_EVENT_LISTENER_GROUP = "ic_warn_stats_event_listener_group";
}

5
epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/TopicConstants.java

@ -48,4 +48,9 @@ public interface TopicConstants {
* 项目
*/
String PROJECT = "project";
/**
* 项目
*/
String IC_RESI_USER = "ic_resi_user";
}

20
epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/IcResiUserAddMQMsg.java

@ -0,0 +1,20 @@
package com.epmet.commons.rocketmq.messages;
import lombok.Data;
import java.io.Serializable;
/**
* 居民信息新增修改推送MQ
* @author sun
*/
@Data
public class IcResiUserAddMQMsg implements Serializable {
//客户Id
private String customerId;
//居民ID
private String icResiUser;
}

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

@ -18,7 +18,7 @@
<commons.fileupload.version>1.3.3</commons.fileupload.version>
<commons.io.version>2.6</commons.io.version>
<hutool.version>4.6.1</hutool.version>
<easypoi.version>4.1.3</easypoi.version>
<easypoi.version>4.4.0</easypoi.version>
<joda.time.version>2.9.9</joda.time.version>
<fastjson.version>1.2.60</fastjson.version>
<gson.version>2.8.6</gson.version>
@ -89,6 +89,8 @@
<groupId>cn.afterturn</groupId>
<artifactId>easypoi-base</artifactId>
<version>${easypoi.version}</version>
<!--<scope>system</scope>
<systemPath>${project.basedir}/src/main/resources/jar/easypoi-base-4.4.0.jar</systemPath>-->
</dependency>
<dependency>
<groupId>cn.afterturn</groupId>

6
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/AppClientConstant.java

@ -17,6 +17,12 @@ public interface AppClientConstant {
* app类型-运营端
*/
String APP_OPER = "oper";
/**
* 基层治理平台端
*/
String APP_IC = "ic";
/**
* PC端:web
*/

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

@ -74,6 +74,10 @@ public interface StrConstant {
*/
String STAR="*";
String QUESTION_MARK="?";
String QUESTION_MARK_TRANSFER="\\?";
String AND_MARK="&";
/**
* 空字符串
*/

20
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/DictListFormDTO.java

@ -0,0 +1,20 @@
package com.epmet.commons.tools.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
/**
* @Description 字典数据查询-接口入参
* @Author sun
*/
@Data
public class DictListFormDTO {
/**
* 字典类型
*/
@NotBlank(message = "字典类型不能为空")
private String dictType;
}

17
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/DictListResultDTO.java

@ -0,0 +1,17 @@
package com.epmet.commons.tools.dto.result;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* @Description 字典数据查询-接口返参
* @Author sun
*/
@Data
public class DictListResultDTO implements Serializable {
private static final long serialVersionUID = 8618231166600518980L;
private String label;
private String value;
}

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

@ -0,0 +1,20 @@
package com.epmet.commons.tools.dto.result;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* @Description
* @Author zhaoqifeng
* @Date 2021/10/26 13:53
*/
@Data
public class OptionResultDTO implements Serializable {
private static final long serialVersionUID = 8618231166600518980L;
private String label;
private String value;
private String sysDictDataId;
private List<OptionResultDTO> children;
}

53
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/FormItemTypeEnum.java

@ -0,0 +1,53 @@
/**
* Copyright (c) 2018 人人开源 All rights reserved.
*
* https://www.renren.io
*
* 版权所有侵权必究
*/
package com.epmet.commons.tools.enums;
/**
* form表单 配置item类型 枚举
*
* @author Mark sunlightcs@gmail.com
* @since 1.0.0
*/
public enum FormItemTypeEnum {
//枚举类型
INPUT("input", "输入框"),
RADIO("radio", "单选框"),
CHECKBOX("checkbox", "复选框"),
SELECT("select", "下拉框"),
TEXTAREA("textarea", "文本域"),
CASCADER("cascader", "及联"),
DATE_PICKER("datepicker", "组织"),
UN_KNOWN("un_known", "不支持的类型");
private String code;
private String desc;
FormItemTypeEnum(String value,String name) {
this.code = value;
this.desc = name;
}
public static FormItemTypeEnum getEnum(String code) {
FormItemTypeEnum[] values = FormItemTypeEnum.values();
for (FormItemTypeEnum value : values) {
if (value.getCode().equals(code)) {
return value;
}
}
return UN_KNOWN;
}
public String getCode() {
return code;
}
public String getDesc() {
return desc;
}
}

44
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/GenderEnum.java

@ -0,0 +1,44 @@
package com.epmet.commons.tools.enums;
import com.epmet.commons.tools.exception.EpmetErrorCode;
public enum GenderEnum {
MAN("1", "男"),
WOMAN("2", "女"),
UN_KNOWN("0", "未知");
private String code;
private String name;
GenderEnum(String code, String name) {
this.code = code;
this.name = name;
}
public static String getName(String code) {
GenderEnum[] genderEnums = values();
for (GenderEnum genderEnum : genderEnums) {
if (genderEnum.getCode() == code) {
return genderEnum.getName();
}
}
return EpmetErrorCode.SERVER_ERROR.getMsg();
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}

45
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/HouseTypeEnum.java

@ -0,0 +1,45 @@
package com.epmet.commons.tools.enums;
import com.epmet.commons.tools.exception.EpmetErrorCode;
public enum HouseTypeEnum {
//房屋类型,1楼房,2平房,3别墅
LOUFANG("1", "楼房"),
PINGFANG("2", "平房"),
BIESHU("3", "别墅");
private String code;
private String name;
HouseTypeEnum(String code, String name) {
this.code = code;
this.name = name;
}
public static String getName(String code) {
HouseTypeEnum[] houseTypeEnums = values();
for (HouseTypeEnum houseTypeEnum : houseTypeEnums) {
if (houseTypeEnum.getCode() == code) {
return houseTypeEnum.getName();
}
}
return EpmetErrorCode.SERVER_ERROR.getMsg();
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}

58
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/RelationshipEnum.java

@ -0,0 +1,58 @@
package com.epmet.commons.tools.enums;
/**
* @author Administrator
*/
public enum RelationshipEnum {
/**
* 环境变量枚举
*/
UN_KNOWN("0", "暂不清楚", 0),
SELF("1", "本人", 1),
spouse("2", "配偶", 2),
CHILD("3", "子女", 3),
PARENT("4", "父母", 4),
PARENT_IN_LAW("5", "岳父母或公婆", 5),
GRANDPARENT_IN_LAW("6", "祖父母", 6),
CHILD_IN_LAW("7", "媳婿", 7),
GRANDCHILD("8", "孙子女", 8),
BROTHER_AND_SISTER("9", "兄弟姐妹", 9),
OTHER("10", "其他", 10),
;
private final String code;
private final String name;
private final Integer sort;
RelationshipEnum(String code, String name, Integer sort) {
this.code = code;
this.name = name;
this.sort = sort;
}
public static RelationshipEnum getEnum(String code) {
RelationshipEnum[] values = RelationshipEnum.values();
for (RelationshipEnum value : values) {
if (value.getCode().equals(code)) {
return value;
}
}
return RelationshipEnum.UN_KNOWN;
}
public String getCode() {
return code;
}
public String getName() {
return name;
}
public Integer getSort(){
return sort;
}
}

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

@ -22,6 +22,7 @@ public enum EpmetErrorCode {
ERR10005(10005, "token不能为空"),
ERR10006(10006, "登录超时,请重新登录"),
ERR10007(10007, "当前帐号已在别处登录"),
ERR10008(10008, "Ticket错误"),
ERR10019(10019, "验证码不正确"),
SYSTEM_MQ_MSG_SEND_FAIL(10020, "MQ消息发送失败"),
ERR401(401, "未授权"),
@ -79,6 +80,11 @@ public enum EpmetErrorCode {
SET_PARENT_AREA_CODE(8210,"请先设置上级组织区划"),
HAVE_GUIDE_CANNOT_DEL(8211,"当前分类已经存在办事指南,不允许删除"),
GUIDE_CATEGORY_NAME_EXITS(8212,"分类已存在"),
CUSTOMER_FORM_NOT_EXITS(8213,"客户未配置表单"),
RESI_NOT_FOUND(8214,"居民信息找不到"),
BUILDING_NAME_EXITED(8215,"楼栋名称已存在"),
DOOR_NAME_EXITED(8216,"门牌号已存在"),
NEIGHBOOR_NAME_EXITED(8217,"小区名称已存在"),
REQUIRE_PERMISSION(8301, "您没有足够的操作权限"),
THIRD_PLAT_REQUEST_ERROR(8302, "请求第三方平台错误"),
@ -217,6 +223,10 @@ public enum EpmetErrorCode {
UP_LIMIT_POINT(8917,"积分上限需为单位积分倍数,请重新调整保存"),
BADGE_CHECK(8918,""),
ORG_ADD_FAILED(8919,"添加失败"),
ORG_EDIT_FAILED(8920,"编辑失败"),
ORG_DEL_FAILED(8921,"删除失败"),
//通用错误码 start
//通用的 错误消息自己定义返回

7
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/ResultDataResolver.java

@ -34,18 +34,19 @@ public interface ResultDataResolver {
* @return
* @param targetServiceName 目标service名称
* @param errorCode 错误码可以为空为空则使用上游服务抛出的错误码
* @param errorInternalMsg 错误信息可以为空为空则使用上游服务抛出的异常信息
* @param errorInternalMsg 内部错误信息可以为空为空则使用上游服务抛出的异常信息
* @param showMsg 展示给前端程序的错误信息可以为空为空则根据errorCode给定错误msg信息
* @author wxz
* @date 2021.06.07 22:45
*/
default <R> R getResultDataOrThrowsException(Result<R> result, String targetServiceName, Integer errorCode, String errorInternalMsg) {
default <R> R getResultDataOrThrowsException(Result<R> result, String targetServiceName, Integer errorCode, String errorInternalMsg, String showMsg) {
if (result == null) {
throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode(), "调用{}服务发生错误,返回Result为null", targetServiceName);
}
if (!result.success()) {
Integer finalErrorCode = errorCode == null ? result.getCode() : errorCode;
String finalErrorInternalMsg = StringUtils.isBlank(errorInternalMsg) ? result.getInternalMsg() : errorInternalMsg;
throw new RenException(finalErrorCode, finalErrorInternalMsg);
throw new RenException(finalErrorCode, finalErrorInternalMsg, showMsg, RenException.MessageMode.CODE_INTERNAL_EXTERNAL);
}
return result.getData();
}

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

@ -39,6 +39,13 @@ public class RedisKeys {
return rootPrefix.concat("sys:captcha:").concat(uuid);
}
/**
* 登录验证码Key
*/
public static String getIcLoginCaptchaKey(String uuid) {
return rootPrefix.concat("sys:captcha:iclogin:").concat(uuid);
}
/**
* 登录用户Key
*/
@ -561,6 +568,61 @@ public class RedisKeys {
return rootPrefix.concat("message:mq:blocked:").concat(blockedMsgLabel);
}
/**
* @description 登录票据目前只有IC基层治理平台用到
*
* @param app
* @param ticket
* @return
* @author wxz
* @date 2021.10.25 17:49:43
*/
public static String loginTicket(String app, String ticket) {
return rootPrefix.concat("sys:security:ticket:").concat(app).concat(":").concat(ticket);
}
/**
* 政府端机关单位缓存Key
* @param formCode
* @param customerId
* @return
*/
public static String getIcFormKeyForAdd(String formCode,String customerId) {
return rootPrefix.concat("icform:").concat(formCode).concat(":add:").concat(customerId);
}
public static String getIcFormKeyForExport(String formCode,String customerId) {
return rootPrefix.concat("icform:").concat(formCode).concat(":export:").concat(customerId);
}
/**
* icd form items key
* @param customerId
* @param formCode
* @return
*/
public static String getIcFormItemsKey(String customerId, String formCode) {
return rootPrefix.concat("icform:").concat(formCode).concat(":items:").concat(customerId);
}
/**
* desc导出居民信息时 临时存储居民信息 便于其他sheet复用信息
* @param resiId
* @return
*/
public static String getExportResiBaseInfoKey(String resiId) {
return rootPrefix.concat("resi:").concat("export").concat(":temp:").concat(resiId);
}
/**
* desc:获取客户的居民下载模版是否变更的key 1表示变更 0没有变更
* @param customerId
* @return
*/
public static String getResiTempChangedKey(String customerId) {
return rootPrefix.concat("resi:").concat("export").concat(":template:changed").concat(customerId);
}
/**
* desc:获取执行完毕的 业务 参数结果key
* @param bizMethod

81
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/security/dto/IcTokenDto.java

@ -0,0 +1,81 @@
package com.epmet.commons.tools.security.dto;
import com.alibaba.fastjson.JSON;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.List;
import java.util.Set;
/**
* @Description ic平台token
* @author wxz
* @date 2021.10.26 13:58:03
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class IcTokenDto extends BaseTokenDto {
/**
* 当前登录的组织id(顶级)
*/
private String rootAgencyId;
/**
* 当前用户所属的机关单位id
*/
private String agencyId;
/**
* 当前网格对应的组织结构id的全路径用:隔开
*/
private String orgIdPath;
/**
* 当前所在网格id
*/
private String gridId;
/***
* 所在网格列表
*/
private Set<String> gridIdList;
/**
* 部门id列表
*/
private Set<String> deptIdList;
/**
* 功能权限列表实际上是gov_staff => staff_role => role_operation查询到的operationKey
*/
private Set<String> permissions;
/**
* 角色ID列表
*/
private List<GovTokenDto.Role> roleList;
/**
* 过期时间戳
*/
private Long expireTime;
@Data
public static class Role {
private String id;
private String roleKey;
private String roleName;
public Role() {
}
}
@Override
public String toString() {
return JSON.toJSONString(this);
}
}

13
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/security/user/LoginUserUtil.java

@ -6,7 +6,6 @@ import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Component;
import javax.servlet.http.HttpServletRequest;
import java.util.Enumeration;
import java.util.List;
/**
@ -35,18 +34,6 @@ public class LoginUserUtil {
return userId;
}
/**
* 查询登录用户的客户Id
* @return
*/
public String getCurrentCustomerId() {
HttpServletRequest request = HttpContextUtils.getHttpServletRequest();
if (request == null) {
return null;
}
return request.getHeader(AppClientConstant.CUSTOMER_ID);
}
/**
* 登录用户的App头信息
* @return

11
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/IpUtils.java

@ -12,6 +12,7 @@ import com.epmet.commons.tools.constant.StrConstant;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.commons.util.InetUtils;
import org.springframework.http.HttpHeaders;
import org.springframework.http.server.reactive.ServerHttpRequest;
@ -127,12 +128,12 @@ public class IpUtils {
* 遍历本地网卡的方式在云平台虚拟机取不到真正的ip
* @return
*/
InetAddress localAddress = InetAddress.getLocalHost();
if (isValidAddress(localAddress)) {
return localAddress.getHostAddress();
InetUtils inetUtils = SpringContextUtils.getBean(InetUtils.class);
if (inetUtils == null || inetUtils.findFirstNonLoopbackHostInfo() == null) {
logger.warn("Could not get local host ip address");
} else {
SERVER_IP = inetUtils.findFirstNonLoopbackHostInfo().getIpAddress();
}
logger.warn("Could not get local host ip address");
return null;
} catch (Exception e) {
logger.error("IpUtils getServerIp exception ", e);
}

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

@ -117,7 +117,7 @@ class EpmetWebFilter implements WebFilter, ResultDataResolver {
adminOpenFeignClient.list(),
ServiceConstant.EPMET_ADMIN_SERVER,
EpmetErrorCode.SERVER_ERROR.getCode(),
"调用Admin服务查询Cors配置失败");
"调用Admin服务查询Cors配置失败", null);
} catch (Exception e) {
logger.error("调用Admin服务查询Cors配置失败");
}

3
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/constant/OrgConstant.java

@ -11,4 +11,7 @@ public interface OrgConstant {
String CITY = "city";
String DISTRICT = "district";
String GRID_ID="GRID_ID";
String GENDER="GENDER";
String HOUSE_TYPE_KEY="HOUSE_TYPE";
}

16
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/IcFormResColumnDTO.java

@ -0,0 +1,16 @@
package com.epmet.dataaggre.dto.epmetuser;
import lombok.Data;
/**
* @Description TODO
* @Author yinzuomei
* @Date 2021/10/27 4:26 下午
*/
@Data
public class IcFormResColumnDTO {
private String tableName;
private String columnName;
private String label;
}

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

@ -24,6 +24,7 @@ import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Set;
/**
* 机关单位信息表
@ -98,4 +99,5 @@ public interface CustomerAgencyDao extends BaseDao<CustomerAgencyEntity> {
* @Date 2021/9/23 10:16
*/
List<String> getOrgList(@Param("staffId") String staffId);
}

3
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/opercustomize/CustomerFootBarDao.java

@ -19,11 +19,13 @@ package com.epmet.dataaggre.dao.opercustomize;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dataaggre.dto.app.result.CustomerFootBarDTO;
import com.epmet.dataaggre.dto.epmetuser.IcFormResColumnDTO;
import com.epmet.dataaggre.entity.opercustomize.CustomerFootBarEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Set;
/**
* APP底部菜单栏信息
@ -56,4 +58,5 @@ public interface CustomerFootBarDao extends BaseDao<CustomerFootBarEntity> {
* @date 2021/7/28 10:56
*/
CustomerFootBarEntity selectDefaultIcon(@Param("customerId") String customerId, @Param("appType")String appType, @Param("barKey")String barKey);
}

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

@ -172,4 +172,5 @@ public interface GovOrgService {
* @date 2021/11/5 2:57 下午
*/
CustomerGridDTO getGridInfo(String gridId);
}

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

@ -555,4 +555,5 @@ public class GovOrgServiceImpl implements GovOrgService {
return customerGridDao.getGridInfo(gridId);
}
}

2
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/QuestionnaireServiceImpl.java

@ -73,7 +73,7 @@ public class QuestionnaireServiceImpl implements QuestionnaireService, ResultDat
CustomerGridFormDTO form = new CustomerGridFormDTO();
form.setGridId(gridId);
Result<CustomerGridDTO> gridInfoResult = govOrgOpenFeignClient.getGridBaseInfoByGridId(form);
CustomerGridDTO gridInfo = getResultDataOrThrowsException(gridInfoResult, ServiceConstant.GOV_ORG_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "【调查问卷】校验访问权限,查询网格信息失败");
CustomerGridDTO gridInfo = getResultDataOrThrowsException(gridInfoResult, ServiceConstant.GOV_ORG_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "【调查问卷】校验访问权限,查询网格信息失败", null);
// 网格父级ID列表:网格ID(拼接起来,冒号分割)
String gridIdPath = gridInfo.getPids().concat(":").concat(gridInfo.getId());
List<PrPublishRangeEntity> publishRangeEntity = prPublishRangeService.getPublishRangeEntity(projectKey);

1
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/opercustomize/CustomerFootBarService.java

@ -39,4 +39,5 @@ public interface CustomerFootBarService extends BaseService<CustomerFootBarEntit
* @date 2021/7/27 18:59
*/
AppFootBarResultDTO queryAppFootBars(AppFootBarFormDTO footBarFormDTO);
}

2
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/opercustomize/impl/CustomerFootBarServiceImpl.java

@ -27,6 +27,7 @@ import com.epmet.dataaggre.dao.opercustomize.CustomerFootBarDao;
import com.epmet.dataaggre.dto.app.form.AppFootBarFormDTO;
import com.epmet.dataaggre.dto.app.result.AppFootBarResultDTO;
import com.epmet.dataaggre.dto.app.result.CustomerFootBarDTO;
import com.epmet.dataaggre.dto.epmetuser.IcFormResColumnDTO;
import com.epmet.dataaggre.entity.opercrm.CustomerParameterEntity;
import com.epmet.dataaggre.entity.opercustomize.CustomerFootBarEntity;
import com.epmet.dataaggre.service.opercrm.CustomerParameterService;
@ -38,6 +39,7 @@ import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.util.List;
import java.util.Set;
/**

1
epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/opercustomize/CustomerFootBarDao.xml

@ -38,4 +38,5 @@
and c.BAR_KEY=#{barKey}
AND C.DISPLAY='1'
</select>
</mapper>

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

@ -97,7 +97,21 @@
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>easyexcel</artifactId>
<version>2.2.6</version>
<version>3.0.3</version>
<exclusions>
<exclusion>
<artifactId>poi</artifactId>
<groupId>org.apache.poi</groupId>
</exclusion>
<exclusion>
<artifactId>poi-ooxml</artifactId>
<groupId>org.apache.poi</groupId>
</exclusion>
<exclusion>
<artifactId>poi-ooxml-schemas</artifactId>
<groupId>org.apache.poi</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>io.github.wnjustdoit</groupId>

15
epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/read/CustomStringStringConverter.java

@ -2,8 +2,9 @@ package com.epmet.stats.test.read;
import com.alibaba.excel.converters.Converter;
import com.alibaba.excel.enums.CellDataTypeEnum;
import com.alibaba.excel.metadata.CellData;
import com.alibaba.excel.metadata.GlobalConfiguration;
import com.alibaba.excel.metadata.data.ReadCellData;
import com.alibaba.excel.metadata.data.WriteCellData;
import com.alibaba.excel.metadata.property.ExcelContentProperty;
/**
@ -13,7 +14,7 @@ import com.alibaba.excel.metadata.property.ExcelContentProperty;
*/
public class CustomStringStringConverter implements Converter<String> {
@Override
public Class supportJavaTypeKey() {
public Class<?> supportJavaTypeKey() {
return String.class;
}
@ -34,8 +35,8 @@ public class CustomStringStringConverter implements Converter<String> {
* @return
*/
@Override
public String convertToJavaData(CellData cellData, ExcelContentProperty contentProperty,
GlobalConfiguration globalConfiguration) {
public String convertToJavaData(ReadCellData<?> cellData, ExcelContentProperty contentProperty,
GlobalConfiguration globalConfiguration) {
return "自定义:" + cellData.getStringValue();
}
@ -51,9 +52,9 @@ public class CustomStringStringConverter implements Converter<String> {
* @return
*/
@Override
public CellData convertToExcelData(String value, ExcelContentProperty contentProperty,
GlobalConfiguration globalConfiguration) {
return new CellData(value);
public WriteCellData<?> convertToExcelData(String value, ExcelContentProperty contentProperty,
GlobalConfiguration globalConfiguration) {
return new WriteCellData<>(value);
}
}

19
epmet-module/epmet-demo/epmet-demo-server/pom.xml

@ -13,6 +13,25 @@
<packaging>jar</packaging>
<dependencies>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>easyexcel</artifactId>
<version>3.0.3</version>
<exclusions>
<exclusion>
<artifactId>poi</artifactId>
<groupId>org.apache.poi</groupId>
</exclusion>
<exclusion>
<artifactId>poi-ooxml</artifactId>
<groupId>org.apache.poi</groupId>
</exclusion>
<exclusion>
<artifactId>poi-ooxml-schemas</artifactId>
<groupId>org.apache.poi</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.epmet</groupId>
<artifactId>epmet-commons-tools</artifactId>

58
epmet-module/epmet-demo/epmet-demo-server/src/main/java/com/epmet/utils/ExcelPaseTest.java

@ -0,0 +1,58 @@
package com.epmet.utils;
import com.alibaba.excel.EasyExcelFactory;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/**
* @description excel解析
*
* @return
* @author wxz
* @date 2021.10.28 13:36:26
*/
public class ExcelPaseTest {
public static void main(String[] args) {
new ExcelPaseTest().sqlizeGridNameAndCodeFromExcel();
}
/**
* @description 读取excel生成根据网格name更新网格code的sql
*
* @param
* @return
* @author wxz
* @date 2021.10.28 13:34:31
*/
public void sqlizeGridNameAndCodeFromExcel() {
TempDynamicEasyExcelListener readListener = new TempDynamicEasyExcelListener();
EasyExcelFactory.read(new File("/Users/wangxianzhang/Documents/1027平阴县网格编码及人员统计表.xls"), IndexOrNameData.class, readListener).headRowNumber(4).sheet(0).doRead();
List<Map<Integer, String>> headList = readListener.getHeadList();
List<IndexOrNameData> dataList = readListener.getDataList();
List<String> exceptList = new ArrayList<>();
for (IndexOrNameData data : dataList) {
String content = data.getColumn();
int startIndex = content.indexOf("370");
if (startIndex == -1) {
exceptList.add(content);
} else {
String gridName = content.substring(0, startIndex).trim();
String gridCode = content.substring(startIndex);
String sqlPattern = String.format("update customer_grid set CODE='%s' where GRID_NAME='%s';", gridCode, gridName);
System.out.println(sqlPattern);
}
}
System.err.println("========异常行=======");
for (String s : exceptList) {
System.err.println(s);
}
}
}

20
epmet-module/epmet-demo/epmet-demo-server/src/main/java/com/epmet/utils/IndexOrNameData.java

@ -0,0 +1,20 @@
package com.epmet.utils;
import com.alibaba.excel.annotation.ExcelProperty;
import lombok.Data;
@Data
public class IndexOrNameData {
/**
* 强制读取第三个 这里不建议 index name 同时用要么一个对象只用index要么一个对象只用name去匹配
*/
@ExcelProperty(index = 3)
private String column;
///**
// * 用名字去匹配,这里需要注意,如果名字重复,会导致只有一个字段读取到数据
// */
//@ExcelProperty("字符串标题")
//private String string;
//@ExcelProperty("日期标题")
//private Date date;
}

82
epmet-module/epmet-demo/epmet-demo-server/src/main/java/com/epmet/utils/TempDynamicEasyExcelListener.java

@ -0,0 +1,82 @@
package com.epmet.utils;
import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import com.alibaba.fastjson.JSON;
import lombok.extern.slf4j.Slf4j;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/**
* 创建一个监听器
*/
@Slf4j
public class TempDynamicEasyExcelListener extends AnalysisEventListener<IndexOrNameData> {
/**
* 表头数据存储所有的表头数据
*/
private List<Map<Integer, String>> headList = new ArrayList<>();
/**
* 数据体
*/
private List<IndexOrNameData> dataList = new ArrayList<>();
/**
* 这里会一行行的返回头
*
* @param headMap
* @param context
*/
//@Override
//public void invokeHeadMap(IcResiUserController.IndexOrNameData headMap, AnalysisContext context) {
// log.info("解析到一条头数据:{}", JSON.toJSONString(headMap));
// //存储全部表头数据
// headList.add(headMap);
//}
@Override
public void invokeHeadMap(Map<Integer, String> headMap, AnalysisContext context) {
log.info("解析到一条头数据:{}", JSON.toJSONString(headMap));
//存储全部表头数据
headList.add(headMap);
}
/**
* 这个每一条数据解析都会来调用
*
* @param data
* one row value. Is is same as {@link AnalysisContext#readRowHolder()}
* @param context
*/
@Override
public void invoke(IndexOrNameData data, AnalysisContext context) {
//log.info("解析到一条数据:{}", JSON.toJSONString(data));
if (data.getColumn() != null) {
dataList.add(data);
}
}
/**
* 所有数据解析完成了 都会来调用
*
* @param context
*/
@Override
public void doAfterAllAnalysed(AnalysisContext context) {
// 这里也要保存数据,确保最后遗留的数据也存储到数据库
log.info("所有数据解析完成!");
}
public List<Map<Integer, String>> getHeadList() {
return headList;
}
public List<IndexOrNameData> getDataList() {
return dataList;
}
}

21
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/UserDemandNameQueryFormDTO.java

@ -0,0 +1,21 @@
package com.epmet.dto.form.demand;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import java.io.Serializable;
import java.util.Set;
@Data
public class UserDemandNameQueryFormDTO implements Serializable {
private static final long serialVersionUID = 1562457999313501989L;
public interface AddUserInternalGroup {}
@NotBlank(message = "客户idbu不能为空",groups =AddUserInternalGroup.class)
private String customerId;
@NotEmpty(message = "分类编码不能为空",groups =AddUserInternalGroup.class)
private Set<String> codeSet;
}

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

@ -5,7 +5,7 @@ import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.ActInfoDTO;
import com.epmet.dto.VolunteerInfoDTO;
import com.epmet.dto.form.CommonCustomerFormDTO;
import com.epmet.feign.fallback.EpmetHeartOpenFeignClientFallback;
import com.epmet.dto.form.demand.UserDemandNameQueryFormDTO;
import com.epmet.feign.fallback.EpmetHeartOpenFeignClientFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
@ -53,4 +53,7 @@ public interface EpmetHeartOpenFeignClient {
**/
@PostMapping("/heart/resi/volunteer/queryuservolunteerinfo/{userId}")
Result<VolunteerInfoDTO> queryUserVolunteerInfo(@PathVariable("userId") String userId);
@PostMapping("/heart/icresidemanddict/demangnames")
Result<String> queryDemandNames(@RequestBody UserDemandNameQueryFormDTO formDTO);
}

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

@ -6,8 +6,8 @@ import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.ActInfoDTO;
import com.epmet.dto.VolunteerInfoDTO;
import com.epmet.dto.form.CommonCustomerFormDTO;
import com.epmet.dto.form.demand.UserDemandNameQueryFormDTO;
import com.epmet.feign.EpmetHeartOpenFeignClient;
import org.springframework.stereotype.Component;
import java.util.List;
@ -48,4 +48,9 @@ public class EpmetHeartOpenFeignClientFallback implements EpmetHeartOpenFeignCli
public Result<VolunteerInfoDTO> queryUserVolunteerInfo(String userId) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_HEART_SERVER, "queryUserVolunteerInfo", userId);
}
@Override
public Result<String> queryDemandNames(UserDemandNameQueryFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_HEART_SERVER, "queryDemandNames", formDTO);
}
}

105
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcResiDemandDictController.java

@ -0,0 +1,105 @@
/**
* 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.controller;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.dto.result.OptionResultDTO;
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.AssertUtils;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.commons.tools.validator.group.AddGroup;
import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.dto.IcResiDemandDictDTO;
import com.epmet.dto.form.demand.UserDemandNameQueryFormDTO;
import com.epmet.service.IcResiDemandDictService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
/**
* 居民需求字典表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-10-27
*/
@RestController
@RequestMapping("icresidemanddict")
public class IcResiDemandDictController {
@Autowired
private IcResiDemandDictService icResiDemandDictService;
@GetMapping("page")
public Result<PageData<IcResiDemandDictDTO>> page(@RequestParam Map<String, Object> params){
PageData<IcResiDemandDictDTO> page = icResiDemandDictService.page(params);
return new Result<PageData<IcResiDemandDictDTO>>().ok(page);
}
@GetMapping("{id}")
public Result<IcResiDemandDictDTO> get(@PathVariable("id") String id){
IcResiDemandDictDTO data = icResiDemandDictService.get(id);
return new Result<IcResiDemandDictDTO>().ok(data);
}
@PostMapping
public Result save(@RequestBody IcResiDemandDictDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
icResiDemandDictService.save(dto);
return new Result();
}
@PutMapping
public Result update(@RequestBody IcResiDemandDictDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
icResiDemandDictService.update(dto);
return new Result();
}
@DeleteMapping
public Result delete(@RequestBody String[] ids){
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
icResiDemandDictService.delete(ids);
return new Result();
}
@PostMapping("demandoption")
public Result<List<OptionResultDTO>> getDemandOptions(@LoginUser TokenDto tokenDto) {
return new Result<List<OptionResultDTO>>().ok(icResiDemandDictService.getDemandOptions(tokenDto.getCustomerId()));
}
/**
* 居民信息列表需要展示分类名称单独开出来这个接口供user查询
* @param formDTO
* @return
*/
@PostMapping("demangnames")
public Result<String> queryDemandNames(@RequestBody UserDemandNameQueryFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO,UserDemandNameQueryFormDTO.AddUserInternalGroup.class);
return icResiDemandDictService.queryDemandNames(formDTO);
}
}

41
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcResiDemandDictDao.java

@ -0,0 +1,41 @@
/**
* 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.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.commons.tools.dto.result.OptionResultDTO;
import com.epmet.entity.IcResiDemandDictEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Set;
/**
* 居民需求字典表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-10-27
*/
@Mapper
public interface IcResiDemandDictDao extends BaseDao<IcResiDemandDictEntity> {
List<OptionResultDTO> selectDemandOptions(@Param("customerId") String customerId);
List<OptionResultDTO> selectChildDemands(@Param("customerId")String customerId, @Param("parentCode") String parentCode);
String selectCategoryNames(@Param("customerId") String customerId,@Param("codeSet") Set<String> codeSet);
}

73
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcResiDemandDictEntity.java

@ -0,0 +1,73 @@
/**
* 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.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 居民需求字典表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-10-27
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("ic_resi_demand_dict")
public class IcResiDemandDictEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户Id customer.id
*/
private String customerId;
/**
* 父级
*/
private String parentCode;
/**
* 字典值
*/
private String categoryCode;
/**
* 字典描述
*/
private String categoryName;
/**
* 级别
*/
private String level;
/**
* 备注
*/
private String remark;
/**
* 排序
*/
private Integer sort;
}

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

@ -0,0 +1,114 @@
/**
* 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.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.IcResiDemandDictDTO;
import com.epmet.dto.form.demand.UserDemandNameQueryFormDTO;
import com.epmet.entity.IcResiDemandDictEntity;
import java.util.List;
import java.util.Map;
/**
* 居民需求字典表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-10-27
*/
public interface IcResiDemandDictService extends BaseService<IcResiDemandDictEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<IcResiDemandDictDTO>
* @author generator
* @date 2021-10-27
*/
PageData<IcResiDemandDictDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<IcResiDemandDictDTO>
* @author generator
* @date 2021-10-27
*/
List<IcResiDemandDictDTO> list(Map<String, Object> params);
/**
* 单条查询
*
* @param id
* @return IcResiDemandDictDTO
* @author generator
* @date 2021-10-27
*/
IcResiDemandDictDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2021-10-27
*/
void save(IcResiDemandDictDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2021-10-27
*/
void update(IcResiDemandDictDTO dto);
/**
* 批量删除
*
* @param ids
* @return void
* @author generator
* @date 2021-10-27
*/
void delete(String[] ids);
/**
* @Description 获取居民需求
* @Param customerId
* @Return {@link List< OptionResultDTO>}
* @Author zhaoqifeng
* @Date 2021/10/27 17:57
*/
List<OptionResultDTO> getDemandOptions(String customerId);
/**
* 居民信息列表需要展示分类名称单独开出来这个接口供user查询
* @param formDTO
* @return
*/
Result<String> queryDemandNames(UserDemandNameQueryFormDTO formDTO);
}

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

@ -0,0 +1,120 @@
/**
* 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.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.dto.result.OptionResultDTO;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dao.IcResiDemandDictDao;
import com.epmet.dto.IcResiDemandDictDTO;
import com.epmet.dto.form.demand.UserDemandNameQueryFormDTO;
import com.epmet.entity.IcResiDemandDictEntity;
import com.epmet.service.IcResiDemandDictService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* 居民需求字典表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-10-27
*/
@Service
public class IcResiDemandDictServiceImpl extends BaseServiceImpl<IcResiDemandDictDao, IcResiDemandDictEntity> implements IcResiDemandDictService {
@Override
public PageData<IcResiDemandDictDTO> page(Map<String, Object> params) {
IPage<IcResiDemandDictEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, IcResiDemandDictDTO.class);
}
@Override
public List<IcResiDemandDictDTO> list(Map<String, Object> params) {
List<IcResiDemandDictEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, IcResiDemandDictDTO.class);
}
private QueryWrapper<IcResiDemandDictEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<IcResiDemandDictEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
return wrapper;
}
@Override
public IcResiDemandDictDTO get(String id) {
IcResiDemandDictEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, IcResiDemandDictDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(IcResiDemandDictDTO dto) {
IcResiDemandDictEntity entity = ConvertUtils.sourceToTarget(dto, IcResiDemandDictEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(IcResiDemandDictDTO dto) {
IcResiDemandDictEntity entity = ConvertUtils.sourceToTarget(dto, IcResiDemandDictEntity.class);
updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteBatchIds(Arrays.asList(ids));
}
/**
* @param customerId
* @Description 获取居民需求
* @Param customerId
* @Return {@link List< OptionResultDTO >}
* @Author zhaoqifeng
* @Date 2021/10/27 17:57
*/
@Override
public List<OptionResultDTO> getDemandOptions(String customerId) {
return baseDao.selectDemandOptions(customerId);
}
@Override
public Result<String> queryDemandNames(UserDemandNameQueryFormDTO formDTO) {
return new Result<String>().ok(baseDao.selectCategoryNames(formDTO.getCustomerId(),formDTO.getCodeSet()));
}
}

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

@ -0,0 +1,77 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.dao.IcResiDemandDictDao">
<resultMap type="com.epmet.entity.IcResiDemandDictEntity" id="icResiDemandDictMap">
<result property="id" column="ID"/>
<result property="customerId" column="CUSTOMER_ID"/>
<result property="parentCode" column="PARENT_CODE"/>
<result property="categoryCode" column="CATEGORY_CODE"/>
<result property="categoryName" column="CATEGORY_NAME"/>
<result property="level" column="LEVEL"/>
<result property="remark" column="REMARK"/>
<result property="sort" column="SORT"/>
<result property="delFlag" column="DEL_FLAG"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
<resultMap id="DemandResult" type="com.epmet.commons.tools.dto.result.OptionResultDTO">
<result column="customerId"/>
<result column="value" property="value"/>
<result column="label" property="label"/>
<collection property="children" ofType="com.epmet.commons.tools.dto.result.OptionResultDTO"
select="selectChildDemands" column="customerId=customerId,parentCode=value">
</collection>
</resultMap>
<select id="selectDemandOptions" resultMap="DemandResult">
SELECT
CUSTOMER_ID AS customerId,
CATEGORY_CODE AS "value",
CATEGORY_NAME AS "label"
FROM
ic_resi_demand_dict
WHERE
DEL_FLAG = 0
AND LEVEL = 1
AND CUSTOMER_ID = #{customerId}
ORDER BY
SORT ASC
</select>
<select id="selectChildDemands" resultMap="DemandResult">
SELECT
CUSTOMER_ID AS customerId,
CATEGORY_CODE AS "value",
CATEGORY_NAME AS "label"
FROM
ic_resi_demand_dict
WHERE
DEL_FLAG = 0
AND LEVEL = 2
AND CUSTOMER_ID = #{customerId}
AND PARENT_CODE = #{parentCode}
ORDER BY
SORT ASC
</select>
<select id="selectCategoryNames" parameterType="map" resultType="java.lang.String">
SELECT
GROUP_CONCAT(m.CATEGORY_NAME)
FROM
ic_resi_demand_dict m
WHERE
m.DEL_FLAG = '0'
AND m.CUSTOMER_ID = #{customerId}
<if test="null != codeSet and codeSet.size() > 0">
AND m.CATEGORY_CODE IN
<foreach item="code" collection="codeSet" open="(" separator="," close=")">
#{code}
</foreach>
</if>
</select>
</mapper>

15
epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/SystemMessageType.java

@ -85,4 +85,19 @@ public interface SystemMessageType {
*/
String PROJECT_EDIT = "project_edit";
/**
* 居民信息添加
*/
String IC_RESI_USER_ADD = "ic_resi_user_add";
/**
* 居民信息修改
*/
String IC_RESI_USER_EDIT = "ic_resi_user_edit";
/**
* 居民信息删除
*/
String IC_RESI_USER_DEL = "ic_resi_user_del";
}

5
epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/SystemMessageServiceImpl.java

@ -187,6 +187,11 @@ public class SystemMessageServiceImpl implements SystemMessageService {
case SystemMessageType.PROJECT_EDIT:
topic = TopicConstants.PROJECT;
break;
case SystemMessageType.IC_RESI_USER_ADD:
case SystemMessageType.IC_RESI_USER_EDIT:
case SystemMessageType.IC_RESI_USER_DEL:
topic = TopicConstants.IC_RESI_USER;
break;
}
return topic;
}

11
epmet-module/epmet-oss/epmet-oss-client/src/main/java/com/epmet/feign/OssFeignClient.java

@ -11,13 +11,13 @@ package com.epmet.feign;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.result.UploadImgResultDTO;
import com.epmet.feign.fallback.OssFeignClientFallback;
import com.epmet.feign.fallback.OssFeignClientFallbackFactory;
import feign.codec.Encoder;
import feign.form.spring.SpringFormEncoder;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.context.annotation.Bean;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RequestPart;
@ -55,6 +55,15 @@ public interface OssFeignClient {
@PostMapping(value ="oss/file/uploadqrcodeV2", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
Result<UploadImgResultDTO> uploadQrCodeV2(@RequestPart(value = "file") MultipartFile file, @RequestParam("customerId") String customerId);
/**
* desc:通过文件路径获取文件地址
* @param filePath 文件路径 eg:epmet
* @param privacy 内部 外部
* @return
*/
@GetMapping(value = "oss/file/getOssFileUrl")
Result<String> getOssFileUrl(@RequestParam String filePath, @RequestParam String privacy);
//@Configuration
class MultipartSupportConfig {

6
epmet-module/epmet-oss/epmet-oss-client/src/main/java/com/epmet/feign/fallback/OssFeignClientFallback.java

@ -13,7 +13,6 @@ import com.epmet.commons.tools.utils.ModuleUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.result.UploadImgResultDTO;
import com.epmet.feign.OssFeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.multipart.MultipartFile;
/**
@ -40,4 +39,9 @@ public class OssFeignClientFallback implements OssFeignClient {
return ModuleUtils.feignConError(ServiceConstant.EPMET_OSS_SERVER, "uploadQrCodeV2", file, customerId);
}
@Override
public Result<String> getOssFileUrl(String filePath, String privacy) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_OSS_SERVER, "download", filePath,privacy);
}
}

16
epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AbstractCloudStorageService.java

@ -25,17 +25,23 @@ import java.util.UUID;
public abstract class AbstractCloudStorageService {
/** 云存储配置信息 */
CloudStorageConfig config;
/**
* desc: 获取oss域名
*
* @param privacy
* @return java.lang.String
* @author LiuJanJun
* @date 2021/3/30 10:05 上午
* @author LiuJanJu * @date 2021/3/30 10:05 上午
*/
public abstract String getOssDomain(String privacy);
/**
* desc: 获取oss前缀
*
* @param privacy
* @return java.lang.String
* @author LiuJanJu * @date 2021/3/30 10:05 上午
*/
public String getOssDomain(String privacy){
return null;
};
public abstract String getOssPrefix(String privacy);
/**
* 文件路径
* @param prefix 前缀

9
epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AliyunCloudStorageService.java

@ -90,6 +90,15 @@ public class AliyunCloudStorageService extends AbstractCloudStorageService {
}
}
@Override
public String getOssPrefix(String privacy) {
if (PrivacyType.INTERNAL.equalsIgnoreCase(privacy)) {
return config.getAliyun().getInternal().getAliyunPrefix();
} else {
return config.getAliyun().getExternal().getAliyunPrefix();
}
}
@Override
public String upload(byte[] data, String path, String privacyType) {
return upload(new ByteArrayInputStream(data), path, privacyType);

24
epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/FastDFSCloudStorageService.java

@ -34,6 +34,30 @@ public class FastDFSCloudStorageService extends AbstractCloudStorageService {
this.config = config;
}
/**
* desc: 获取oss域名
*
* @param privacy
* @return java.lang.String
* @author LiuJanJu * @date 2021/3/30 10:05 上午
*/
@Override
public String getOssDomain(String privacy) {
return config.getFastdfsDomain();
}
/**
* desc: 获取oss前缀
*
* @param privacy
* @return java.lang.String
* @author LiuJanJu * @date 2021/3/30 10:05 上午
*/
@Override
public String getOssPrefix(String privacy) {
return null;
}
@Override
public String upload(byte[] data, String path, String privacyType) {
return upload(new ByteArrayInputStream(data), path, privacyType);

24
epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/LocalCloudStorageService.java

@ -28,6 +28,30 @@ public class LocalCloudStorageService extends AbstractCloudStorageService {
this.config = config;
}
/**
* desc: 获取oss域名
*
* @param privacy
* @return java.lang.String
* @author LiuJanJu * @date 2021/3/30 10:05 上午
*/
@Override
public String getOssDomain(String privacy) {
return config.getLocalDomain();
}
/**
* desc: 获取oss前缀
*
* @param privacy
* @return java.lang.String
* @author LiuJanJu * @date 2021/3/30 10:05 上午
*/
@Override
public String getOssPrefix(String privacy) {
return config.getLocalPrefix();
}
@Override
public String upload(byte[] data, String path, String privacyType) {
return upload(new ByteArrayInputStream(data), path, privacyType);

24
epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/QcloudCloudStorageService.java

@ -47,6 +47,30 @@ public class QcloudCloudStorageService extends AbstractCloudStorageService {
clientConfig = new ClientConfig(new Region(config.getQcloudRegion()));
}
/**
* desc: 获取oss域名
*
* @param privacy
* @return java.lang.String
* @author LiuJanJu * @date 2021/3/30 10:05 上午
*/
@Override
public String getOssDomain(String privacy) {
return config.getQcloudDomain();
}
/**
* desc: 获取oss前缀
*
* @param privacy
* @return java.lang.String
* @author LiuJanJu * @date 2021/3/30 10:05 上午
*/
@Override
public String getOssPrefix(String privacy) {
return config.getQcloudPrefix();
}
@Override
public String upload(byte[] data, String path, String privacyType) {
return upload(new ByteArrayInputStream(data), path, privacyType);

24
epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/QiniuCloudStorageService.java

@ -44,6 +44,30 @@ public class QiniuCloudStorageService extends AbstractCloudStorageService {
}
/**
* desc: 获取oss域名
*
* @param privacy
* @return java.lang.String
* @author LiuJanJu * @date 2021/3/30 10:05 上午
*/
@Override
public String getOssDomain(String privacy) {
return config.getQiniuDomain();
}
/**
* desc: 获取oss前缀
*
* @param privacy
* @return java.lang.String
* @author LiuJanJu * @date 2021/3/30 10:05 上午
*/
@Override
public String getOssPrefix(String privacy) {
return config.getQiniuPrefix();
}
@Override
public String upload(byte[] data, String path, String privacyType) {
try {

5
epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java

@ -423,4 +423,9 @@ public class OssController {
return ossService.uploadImgV2(file, PrivacyType.EXTERNAL, customerId);
}
@GetMapping("getOssFileUrl")
public Result<String> download(@RequestParam(required = false) String filePath,@RequestParam(required = false) String privacy){
return new Result<String>().ok(ossService.getOssFileUrl(filePath,privacy));
}
}

7
epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/OssService.java

@ -53,4 +53,11 @@ public interface OssService extends BaseService<OssEntity> {
* @author sun
*/
Result<UploadImgResultDTO> uploadImgV2(MultipartFile file, String privacy, String customerId);
/**
* desc:通过文件路径获取下载 全路径 不传文件路径则为服务域名
* @param filePath
* @return
*/
String getOssFileUrl(String filePath,String privacy);
}

18
epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/impl/OssServiceImpl.java

@ -36,6 +36,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
import java.io.File;
import java.io.IOException;
import java.util.Map;
@ -242,5 +243,22 @@ public class OssServiceImpl extends BaseServiceImpl<OssDao, OssEntity> implement
return new Result<UploadImgResultDTO>().ok(dto);
}
@Override
public String getOssFileUrl(String filePath,String privacy) {
if (StringUtils.isBlank(filePath)){
filePath = StrConstant.EPMETY_STR;
}
AbstractCloudStorageService storageService = OssFactory.build();
String ossDomain = storageService.getOssDomain(privacy);
String ossPrefix = storageService.getOssPrefix(privacy);
if (StringUtils.isBlank(ossDomain)){
throw new RenException("oss配置错误");
}
if (StringUtils.isBlank(ossPrefix)){
ossPrefix = StrConstant.EPMETY_STR;
}
return ossDomain.concat(File.separator).concat(ossPrefix).concat(File.separator).concat(filePath);
}
}

8
epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/BizPointTotalDetailServiceImpl.java

@ -380,7 +380,7 @@ public class BizPointTotalDetailServiceImpl extends BaseServiceImpl<BizPointTota
form.setSearchScopeObjectId(searchScopeObjectId);
Result<List<GroupDetailResultDTO>> result = resiGroupOpenFeignClient.listGroupDetailsExcludeGroupIds(form);
List<GroupDetailResultDTO> groups = getResultDataOrThrowsException(result, ServiceConstant.RESI_GROUP_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "【小组排名】查询积分为0的小组列表失败");
List<GroupDetailResultDTO> groups = getResultDataOrThrowsException(result, ServiceConstant.RESI_GROUP_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "【小组排名】查询积分为0的小组列表失败", null);
if (CollectionUtils.isEmpty(groups)) {
return new ArrayList<>();
}
@ -412,7 +412,7 @@ public class BizPointTotalDetailServiceImpl extends BaseServiceImpl<BizPointTota
// 查询这些小组的基本信息
Result<List<GroupDetailResultDTO>> listResult = resiGroupOpenFeignClient.listGroupDetailsByGroupIds(groupIds);
List<GroupDetailResultDTO> groupInfos = getResultDataOrThrowsException(listResult, ServiceConstant.RESI_GROUP_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "【小组排行】批量查询小组信息出错");
List<GroupDetailResultDTO> groupInfos = getResultDataOrThrowsException(listResult, ServiceConstant.RESI_GROUP_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "【小组排行】批量查询小组信息出错", null);
// 将小组基本信息转化为map
HashMap<String, GroupDetailResultDTO> groupMap = new HashMap<>();
@ -454,7 +454,7 @@ public class BizPointTotalDetailServiceImpl extends BaseServiceImpl<BizPointTota
CustomerGridFormDTO form = new CustomerGridFormDTO();
form.setGridId(gridId);
Result<CustomerGridDTO> result = govOrgOpenFeignClient.getGridBaseInfoByGridId(form);
return getResultDataOrThrowsException(result, ServiceConstant.GOV_ORG_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "【小组排名】查询网格信息失败");
return getResultDataOrThrowsException(result, ServiceConstant.GOV_ORG_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "【小组排名】查询网格信息失败", null);
}
@Override
@ -464,7 +464,7 @@ public class BizPointTotalDetailServiceImpl extends BaseServiceImpl<BizPointTota
form.setGridId(gridId);
form.setUserId(userId);
List<GroupDetailResultDTO> groupList = getResultDataOrThrowsException(resiGroupOpenFeignClient.listGroupsByMember(form),
ServiceConstant.RESI_GROUP_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "【我所在的小组排名】查询组列表失败");
ServiceConstant.RESI_GROUP_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "【我所在的小组排名】查询组列表失败", null);
if (CollectionUtils.isEmpty(groupList)) {
return new ArrayList();

4
epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/apiservice/impl/PingyinPrivateEpmetApiService.java

@ -55,7 +55,7 @@ public class PingyinPrivateEpmetApiService extends ApiService<Result> implements
String urlParams = super.convertQueryParams2String(constructCommonUrlParamsMap(platformKey, authType, uuid, currentTimeMillis, sign));
String requestUrl = baseUrl.concat(apiUrl).concat(urlParams);
Result<String> stringResult = HttpClientManager.getInstance().sendPostByHttps(requestUrl, "{}");
String remoteResultString = getResultDataOrThrowsException(stringResult, "【调用平阴私有化平台获取AccessToken】", EpmetErrorCode.SERVER_ERROR.getCode(), null);
String remoteResultString = getResultDataOrThrowsException(stringResult, "【调用平阴私有化平台获取AccessToken】", EpmetErrorCode.SERVER_ERROR.getCode(), null, null);
Result<GetAccessTokenResultDTO> remoteResult = parsePlatformResponseResult(remoteResultString, GetAccessTokenResultDTO.class);
log.info("【调用平阴私有化平台获取AccessToken】结果:{}", remoteResultString);
accessTokenFromCache = remoteResult.getData().getAccessToken();
@ -159,7 +159,7 @@ public class PingyinPrivateEpmetApiService extends ApiService<Result> implements
String jsonString = JSON.toJSONString(form);
Result result = super.sendPostRequest(platformId, ThirdPlatformActions.PUSH_COMPONENT_ACCESS_TOKEN, jsonString, null, urlParams);
getResultDataOrThrowsException(result, "【平阴私有化平台】推送ComponentAccessToken", EpmetErrorCode.SERVER_ERROR.getCode(), null);
getResultDataOrThrowsException(result, "【平阴私有化平台】推送ComponentAccessToken", EpmetErrorCode.SERVER_ERROR.getCode(), null, null);
}
@Override

15
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/constant/NeighborhoodConstant.java

@ -0,0 +1,15 @@
package com.epmet.constant;
/**
* @Author zxc
* @DateTime 2020/11/10 5:18 下午
*/
public interface NeighborhoodConstant {
String GRID = "grid";
String NEIGHBOR_HOOD= "neighbourHood";
String BUILDING = "building";
String HOUSE = "house";
}

4
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/constant/OrgInfoConstant.java

@ -12,4 +12,8 @@ public interface OrgInfoConstant {
String DEPT = "dept";
String NEIGHBOR_HOOD = "neighborHood";
String COMMUNITY = "community";
}

55
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/BuildingTreeLevelDTO.java

@ -0,0 +1,55 @@
/**
* 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;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
* 楼栋信息
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-10-25
*/
@Data
public class BuildingTreeLevelDTO implements Serializable {
private static final long serialVersionUID = 1L;
private String id;
private String pId;
private String label;
private String level;
private List<BuildingTreeLevelDTO> children;
private String longitude;
private String latitude;
}

15
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerAgencyDTO.java

@ -142,4 +142,19 @@ public class CustomerAgencyDTO implements Serializable {
* 社区
*/
private String community;
/**
* 坐标
*/
private String coordinates;
/**
* 中心位置经度
*/
private String longitude;
/**
* 中心位置纬度
*/
private String latitude;
}

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

@ -0,0 +1,133 @@
/**
* 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;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 楼栋信息
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-10-25
*/
@Data
public class IcBuildingDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 楼栋主键
*/
private String id;
/**
* 客户id
*/
private String customerId;
/**
* 小区id
*/
private String neighborHoodId;
/**
* 片区idneighbor_hood_part.id,可为空
*/
private String partId;
/**
* 楼栋名称
*/
private String buildingName;
/**
* 楼栋类型这里存储字典编码就可以
*/
private String type;
/**
* 排序
*/
private Integer sort;
/**
* 总单元数
*/
private Integer totalUnitNum;
/**
* 总楼层总数
*/
private Integer totalFloorNum;
/**
* 总户数
*/
private Integer totalHouseNum;
/**
* 中心点位经度
*/
private String longitude;
/**
* 中心点位纬度
*/
private String latitude;
/**
* 坐标位置
*/
private String coordinatePosition;
/**
* 删除标识 0未删除1已删除
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

91
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcBuildingUnitDTO.java

@ -0,0 +1,91 @@
/**
* 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;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 楼栋单元信息
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-10-25
*/
@Data
public class IcBuildingUnitDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 单元主键
*/
private String id;
/**
* 客户id
*/
private String customerId;
/**
* 楼宇id
*/
private String buildingId;
/**
* 单元号123??
*/
private String unitNum;
/**
* 单元名
*/
private String unitName;
/**
* 删除标识 0未删除1已删除
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

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

@ -0,0 +1,136 @@
/**
* 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;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 房屋信息
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-10-25
*/
@Data
public class IcHouseDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 房屋主键
*/
private String id;
/**
* 客户id
*/
private String customerId;
/**
* 小区id
*/
private String neighborHoodId;
/**
* 片区idneighbor_hood_part.id,可为空
*/
private String partId;
/**
* 所属楼栋id
*/
private String buildingId;
/**
* 所属单元id
*/
private String buildingUnitId;
/**
* 房屋名字后台插入时生成
*/
private String houseName;
/**
* 门牌号
*/
private String doorName;
/**
* 房屋类型这里存储字典value就可以
*/
private String houseType;
/**
* 存储字典value
*/
private String purpose;
/**
* 1出租0未出租
*/
private Integer rentFlag;
/**
* 房主姓名
*/
private String ownerName;
/**
* 房主电话
*/
private String ownerPhone;
/**
* 房主身份证号
*/
private String ownerIdCard;
/**
* 删除标识 0未删除1已删除
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

131
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcNeighborHoodDTO.java

@ -0,0 +1,131 @@
/**
* 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;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 小区表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-10-25
*/
@Data
public class IcNeighborHoodDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 小区主键
*/
private String id;
/**
* 客户id
*/
private String customerId;
/**
* 小区名称
*/
private String neighborHoodName;
/**
* 组织id
*/
private String agencyId;
/**
* 上级组织id
*/
private String parentAgencyId;
/**
* 组织的所有上级组织id
*/
private String agencyPids;
/**
* 网格id
*/
private String gridId;
/**
* 详细地址
*/
private String address;
/**
* 备注
*/
private String remark;
/**
* 中心点位经度
*/
private String longitude;
/**
* 中心点位纬度
*/
private String latitude;
/**
* 坐标区域
*/
private String coordinates;
/**
* 坐标位置
*/
private String location;
/**
* 删除标识 0未删除1已删除
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

86
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcNeighborHoodPartDTO.java

@ -0,0 +1,86 @@
/**
* 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;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 小区-分区表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-10-25
*/
@Data
public class IcNeighborHoodPartDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键,片区id
*/
private String id;
/**
* 客户id
*/
private String customerId;
/**
* 小区id
*/
private String neighborHoodId;
/**
* 名称比如北区南区
*/
private String name;
/**
* 删除标识 0未删除1已删除
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

81
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcNeighborHoodPropertyDTO.java

@ -0,0 +1,81 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dto;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 小区物业关系表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-10-25
*/
@Data
public class IcNeighborHoodPropertyDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 小区物业关系表
*/
private String id;
/**
* 物业id
*/
private String propertyId;
/**
* 小区id
*/
private String neighborHoodId;
/**
* 删除标识 0未删除1已删除
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

76
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcPropertyManagementDTO.java

@ -0,0 +1,76 @@
/**
* 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;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 物业表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-10-25
*/
@Data
public class IcPropertyManagementDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 物业id
*/
private String id;
/**
* 物业名称
*/
private String name;
/**
* 删除标识 0未删除1已删除
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

2
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AgencyIdFormDTO.java

@ -2,6 +2,7 @@ package com.epmet.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
@ -16,5 +17,6 @@ public class AgencyIdFormDTO implements Serializable {
/**
* 部门Id
*/
@NotBlank(message = "组织机构ID不能为空")
private String agencyId;
}

22
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/BaseInfoFamilyBuildingFormDTO.java

@ -0,0 +1,22 @@
package com.epmet.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2021/11/2 9:13 上午
* @DESC
*/
@Data
public class BaseInfoFamilyBuildingFormDTO implements Serializable {
private static final long serialVersionUID = 2009866136409462441L;
public interface BaseInfoFamilyBuildingForm{}
@NotBlank(message = "neighborHoodId不能为空",groups = BaseInfoFamilyBuildingForm.class)
private String neighborHoodId;
}

24
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/GridOptionFormDTO.java

@ -0,0 +1,24 @@
package com.epmet.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @Description /gov/org/customergrid/gridoption
* @Author yinzuomei
* @Date 2021/11/12 10:54 上午
*/
@Data
public class GridOptionFormDTO implements Serializable {
/**
* 部门Id
*/
@NotBlank(message = "组织机构ID不能为空")
private String agencyId;
//等着杨林改完,我再限制必填吧
//@NotBlank(message = "查询条件和查看居民详情:query;新增或修改居民信息:addorupdate")
private String purpose;
}

17
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/HouseFormDTO.java

@ -0,0 +1,17 @@
package com.epmet.dto.form;
import lombok.Data;
import java.io.Serializable;
/**
* @Description
* @Author zhaoqifeng
* @Date 2021/10/25 17:03
*/
@Data
public class HouseFormDTO implements Serializable {
private static final long serialVersionUID = 2636608477324780974L;
private String buildingId;
private String unitId;
}

129
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcBulidingFormDTO.java

@ -0,0 +1,129 @@
/**
* 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.validator.group.CustomerClientShowGroup;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
@Data
public class IcBulidingFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
public interface DeleteGroup extends CustomerClientShowGroup {
}
public interface AddShowGroup extends CustomerClientShowGroup {
}
public interface UpdateShowGroup extends CustomerClientShowGroup {
}
@NotBlank(message = "楼栋ID不能为空", groups = { UpdateShowGroup.class,DeleteGroup.class})
private String buildingId;
/**
* 组织id
*/
@NotBlank(message = "组织id不能为空", groups = {AddShowGroup.class, UpdateShowGroup.class})
private String agencyId;
/**
* 网格id
*/
@NotBlank(message = "网格不能为空", groups = {AddShowGroup.class, UpdateShowGroup.class})
private String gridId;
/**
* 小区id
*/
@NotBlank(message = "小区id不能为空", groups = {AddShowGroup.class, UpdateShowGroup.class})
private String neighborHoodId;
/**
* 楼栋名称
*/
@NotBlank(message = "楼栋名称不能为空", groups = {AddShowGroup.class, UpdateShowGroup.class})
@Length(max=10,message = "楼栋名称不能超过10个字", groups = {AddShowGroup.class, UpdateShowGroup.class})
private String buildingName;
/**
* 楼栋类型
*/
@NotBlank(message = "楼栋类型不能为空", groups = {AddShowGroup.class, UpdateShowGroup.class})
private String type="";
/**
* 客户id
*/
/* @NotBlank(message = "客户id不能为空", groups = {AddShowGroup.class, UpdateShowGroup.class})
private String customerId;*/
/**
* 排序
*/
@NotNull(message = "排序不能为空", groups = {AddShowGroup.class, UpdateShowGroup.class})
private Integer sort = 0;
/**
* 总单元数
*/
@NotNull(message = "总单元数不能为空", groups = {AddShowGroup.class, UpdateShowGroup.class})
private Integer totalUnitNum=1;
/**
* 总楼层总数
*/
//@NotNull(message = "总楼层总数不能为空", groups = {AddShowGroup.class, UpdateShowGroup.class})
private Integer totalFloorNum;
/**
* 总户数
*/
//@NotNull(message = "总户数不能为空", groups = {AddShowGroup.class, UpdateShowGroup.class})
private Integer totalHouseNum;
/**
* 坐标位置
*/
private String location;
/**
* 中心点位经度
*/
private String longitude;
/**
* 中心点位纬度
*/
private String latitude;
}

42
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcBulidingUnitFormDTO.java

@ -0,0 +1,42 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dto.form;
import com.epmet.commons.tools.validator.group.AddGroup;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import com.epmet.commons.tools.validator.group.UpdateGroup;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
@Data
public class IcBulidingUnitFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
@NotBlank(message = "楼栋ID不能为空")
private String buildingId;
}

105
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcHouseFormDTO.java

@ -0,0 +1,105 @@
/**
* 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.validator.group.CustomerClientShowGroup;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
@Data
public class IcHouseFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
public interface DeleteGroup extends CustomerClientShowGroup {
}
public interface AddShowGroup extends CustomerClientShowGroup {
}
public interface UpdateShowGroup extends CustomerClientShowGroup {
}
@NotBlank(message = "房屋ID不能为空", groups = { UpdateShowGroup.class,DeleteGroup.class})
private String houseId;
/**
* 小区id
*/
@NotBlank(message = "小区id不能为空", groups = {AddShowGroup.class, UpdateShowGroup.class})
private String neighborHoodId;
@NotBlank(message = "所属楼栋ID不能为空", groups = {AddShowGroup.class, UpdateShowGroup.class})
private String buildingId;
/**
* 所属单元id
*/
@NotBlank(message = "所属单元id不能为空", groups = {AddShowGroup.class, UpdateShowGroup.class})
private String buildingUnitId;
/**
* 门牌号
*/
@NotBlank(message = "门牌号不能为空", groups = {AddShowGroup.class, UpdateShowGroup.class})
private String doorName;
/**
* 房屋类型这里存储字典value就可以
*/
@NotBlank(message = "房屋类型不能为空", groups = {AddShowGroup.class, UpdateShowGroup.class})
private String houseType;
/**
* 存储字典value
*/
@NotBlank(message = "房屋用途不能为空", groups = {AddShowGroup.class, UpdateShowGroup.class})
private String purpose;
/**
* 1出租0未出租
*/
@NotNull(message = "是否出租不能为空", groups = {AddShowGroup.class, UpdateShowGroup.class})
private Integer rentFlag;
/**
* 房主姓名
*/
@NotBlank(message = "房主姓名不能为空", groups = {AddShowGroup.class, UpdateShowGroup.class})
private String ownerName;
/**
* 房主电话
*/
@NotBlank(message = "房主电话不能为空", groups = {AddShowGroup.class, UpdateShowGroup.class})
private String ownerPhone;
/**
* 房主身份证号
*/
@NotBlank(message = "房主身份证号不能为空", groups = {AddShowGroup.class, UpdateShowGroup.class})
private String ownerIdCard;
}

105
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcNeighborHoodFormDTO.java

@ -0,0 +1,105 @@
/**
* 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.validator.group.CustomerClientShowGroup;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
@Data
public class IcNeighborHoodFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
public interface DeleteGroup extends CustomerClientShowGroup {
}
public interface AddShowGroup extends CustomerClientShowGroup {
}
public interface UpdateShowGroup extends CustomerClientShowGroup {
}
/**
* 小区id
*/
@NotBlank(message = "小区id不能为空", groups = {UpdateShowGroup.class,DeleteGroup.class})
private String neighborHoodId;
/**
* 小区名称
*/
@NotBlank(message = "小区名称不能为空", groups = {AddShowGroup.class, UpdateShowGroup.class})
@Length(max=50,message = "小区名称不能超过50个字", groups = {AddShowGroup.class, UpdateShowGroup.class})
private String neighborHoodName;
/**
* 组织id
*/
@NotBlank(message = "组织id不能为空", groups = {AddShowGroup.class, UpdateShowGroup.class})
private String agencyId;
/**
* 网格id
*/
@NotBlank(message = "网格id不能为空", groups = {AddShowGroup.class, UpdateShowGroup.class})
private String gridId;
/**
* 关联物业id
*/
//@NotBlank(message = "关联物业ID不能为空", groups = {AddShowGroup.class,UpdateShowGroup.class})
private String propertyId;
/**
* 详细地址
*/
@NotBlank(message = "详细地址不能为空", groups = {AddShowGroup.class, UpdateShowGroup.class})
private String address;
/**
* 备注
*/
@Length(max=500,message = "备注不能超过500个字", groups = {AddShowGroup.class, UpdateShowGroup.class})
private String remark;
/**
* 坐标位置
*/
private String location;
/**
* 中心点位经度
*/
private String longitude;
/**
* 中心点位纬度
*/
private String latitude;
}

53
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcPropertyManagementFormDTO.java

@ -0,0 +1,53 @@
/**
* 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.validator.group.CustomerClientShowGroup;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
@Data
public class IcPropertyManagementFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
public interface DeleteGroup extends CustomerClientShowGroup {
}
public interface AddShowGroup extends CustomerClientShowGroup {
}
public interface UpdateShowGroup extends CustomerClientShowGroup {
}
@NotBlank(message = "物业id不能为空", groups = {DeleteGroup.class, UpdateShowGroup.class})
private String id;
/**
* 物业名称
*/
@NotBlank(message = "物业名称不能为空", groups = {AddShowGroup.class, UpdateShowGroup.class})
@Length(max = 50, message = "物业名称不能超过50个字", groups = {AddShowGroup.class})
private String name;
}

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

Loading…
Cancel
Save