Browse Source

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

master
wangxianzhang 3 years ago
parent
commit
fd345407a4
  1. 34
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/CollectUrlEnum.java
  2. 1
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/DictTypeEnum.java
  3. 3
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/ResiCategoryEnum.java
  4. 7
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java
  5. 15
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/IcResiUserEntity.java
  6. 9
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java
  7. 2
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/IcResiServiceImpl.java
  8. 2
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java
  9. 18
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java
  10. 5
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/CoverageServiceImpl.java
  11. 1
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerGridDao.xml
  12. 5
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/user/IcResiUserEntity.java
  13. 14
      epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueProjectCategoryDictDao.xml
  14. 5
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerGridDTO.java
  15. 131
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcWorkLogDTO.java
  16. 89
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcWorkLogFileDTO.java
  17. 36
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/CollectHouseFormDTO.java
  18. 5
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditGridFormDTO.java
  19. 25
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/GetHouseInfoToCollectFormDTO.java
  20. 5
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GridDetailResultDTO.java
  21. 124
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/IcHouseInfoCollectResultDTO.java
  22. 6
      epmet-module/gov-org/gov-org-server/pom.xml
  23. 148
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java
  24. 2
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/GridController.java
  25. 28
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java
  26. 88
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcWorkLogController.java
  27. 82
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcWorkLogFileController.java
  28. 14
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/NeighborHoodController.java
  29. 8
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java
  30. 9
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcHouseDao.java
  31. 39
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcWorkLogDao.java
  32. 26
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcWorkLogFileDao.java
  33. 5
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcNeighborHoodEntity.java
  34. 79
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcWorkLogEntity.java
  35. 54
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcWorkLogFileEntity.java
  36. 45
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcWorkLogExcel.java
  37. 57
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcWorkLogFileExcel.java
  38. 30
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/IcWorkLogFileRedis.java
  39. 30
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/IcWorkLogRedis.java
  40. 18
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/HouseService.java
  41. 88
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcWorkLogFileService.java
  42. 88
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcWorkLogService.java
  43. 10
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/NeighborHoodService.java
  44. 2
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/BuildingServiceImpl.java
  45. 3
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java
  46. 90
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java
  47. 95
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcWorkLogFileServiceImpl.java
  48. 226
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcWorkLogServiceImpl.java
  49. 103
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/NeighborHoodServiceImpl.java
  50. 2
      epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.40__add_column.sql
  51. 1
      epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.41__ic_neighbor_hood_update.sql
  52. 67
      epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.42__add_work_log.sql
  53. 1
      epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.43__alter_work_log.sql
  54. BIN
      epmet-module/gov-org/gov-org-server/src/main/resources/excel/public_service_template.xlsx
  55. 15
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml
  56. 24
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml
  57. 8
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml
  58. 118
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcWorkLogDao.xml
  59. 30
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcWorkLogFileDao.xml
  60. 5
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/IcEventListFormDTO.java
  61. 5
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/OrgProjectListFormDTO.java
  62. 2
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/TransferFormDTO.java
  63. 26
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/IcEventProcessListResultDTO.java
  64. 2
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/OrgProjectListResultDTO.java
  65. 4
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/excel/IcEventExcel.java
  66. 7
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/excel/OrgProjectListExcel.java
  67. 17
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/IcEventServiceImpl.java
  68. 18
      epmet-module/gov-project/gov-project-server/src/main/resources/mapper/IcEventDao.xml
  69. 17
      epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectDao.xml
  70. 27
      epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/IcFormDataAnalysisDTO.java
  71. 2
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/IcFormItemDao.java
  72. 79
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/ResiCategoryStatsConfigServiceImpl.java
  73. 19
      epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcFormItemDao.xml
  74. 144
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcResiCollectVisitorDTO.java
  75. 15
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcResiUserDTO.java
  76. 122
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/SaveCollectVisitorFormDTO.java
  77. 20
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CollectDetailFormDTO.java
  78. 76
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CollectDetailResultDTO.java
  79. 20
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CollectPageFormDTO.java
  80. 65
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiCollectCheckFormDTO.java
  81. 28
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiCollectGetDetailFormDTO.java
  82. 93
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiCollectMemDetailDTO.java
  83. 11
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiCollectMemFormDTO.java
  84. 105
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/SaveCollectFormDTO.java
  85. 26
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/VisitListFormDTO.java
  86. 57
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CollectHouseInfoResultDTO.java
  87. 2
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CollectListMemberExcelResultDTO.java
  88. 23
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CollectListResultDTO.java
  89. 56
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CollectPageListDTO.java
  90. 82
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiCollectController.java
  91. 137
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiCollectVisitorController.java
  92. 21
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiCollectDao.java
  93. 38
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiCollectVisitorDao.java
  94. 11
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiMemberDao.java
  95. 10
      epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcResiCollectEntity.java
  96. 111
      epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcResiCollectVisitorEntity.java
  97. 10
      epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcResiMemberEntity.java
  98. 4
      epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcResiUserEntity.java
  99. 3
      epmet-user/epmet-user-server/src/main/java/com/epmet/enums/IcResiUserTableEnum.java
  100. 90
      epmet-user/epmet-user-server/src/main/java/com/epmet/excel/IcResiCollectVisitorExcel.java

34
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/CollectUrlEnum.java

@ -0,0 +1,34 @@
package com.epmet.commons.tools.enums;
public enum CollectUrlEnum {
URL_PRE("subpages/points/pages/fangyi/xinxi/create/index", "小程序码跳转地址"),
GET_CODE_URL("https://api.weixin.qq.com/wxa/getwxacode?access_token=", "获取二维码的url");
private String code;
private String name;
CollectUrlEnum(String code, String name) {
this.code = code;
this.name = name;
}
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;
}
}

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

@ -28,6 +28,7 @@ public enum DictTypeEnum {
IC_SERVICE_TYPE("ic_service_type","服务类别",20),
IC_DANGER_TYPE("ic_danger_type","危化品种类",24),
POLICY_LEVEL("policy_level","政策级别",25),
LOG_TYPE("log_type", "日志类型", 33),
;
private final String code;

3
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/ResiCategoryEnum.java

@ -18,7 +18,8 @@ public enum ResiCategoryEnum {
IS_CJ("IS_CJ", "残疾"),
IS_DB("IS_DB", "大病"),
IS_MB("IS_MB", "慢病"),
IS_SPECIAL("IS_SPECIAL", "特殊人群");
IS_SPECIAL("IS_SPECIAL", "特殊人群"),
IS_XJC("IS_XJC", "新阶层人士");
private String colName;
private String label;

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

@ -849,4 +849,11 @@ public class RedisKeys {
public static String getServiceOrgNameKey(String customerId,String serviceOrgType,String serviceOrgId){
return rootPrefix.concat("serviceOrgName:").concat(serviceOrgType).concat(":").concat(customerId).concat(":").concat(serviceOrgId);
}
public static String getUserBaseInfoKey(String userId) {
if (StringUtils.isBlank(userId)){
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"参数错误");
}
return rootPrefix.concat("staffbaseinfo:")+userId;
}
}

15
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/IcResiUserEntity.java

@ -215,6 +215,21 @@ public class IcResiUserEntity extends BaseEpmetEntity {
*/
private String isSpecial;
/**
* 是否租户:1 :0
*/
private String isTenant;
/**
* 是否流动人口:1 :0
*/
private String isFloating;
/**
* 是否新阶层人士:1 :0
*/
private String isXjc;
/**
* 文化程度字典表
*/

9
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java

@ -2011,10 +2011,15 @@ public class DataStatsServiceImpl implements DataStatsService, ResultDataResolve
}
//2.查询组织信息,判断查询下级组织还是网格数据
ScreenAgencyOrGridListDTO agencyGrid = indexService.getSubAgencyOrGridList(formDTO.getAgencyId(), formDTO.isExport());
//2022.8.17 屏蔽查询组织、网格逻辑,直接以org库的组织网格为准
ScreenAgencyOrGridListDTO agencyGrid = govOrgService.getSubAgencyOrGridList(formDTO.getCustomerId(), formDTO.getAgencyId(), formDTO.isExport());
if (null == agencyGrid) {
return new CustomerDataManageResultDTO();
}
/*ScreenAgencyOrGridListDTO agencyGrid = indexService.getSubAgencyOrGridList(formDTO.getAgencyId(), formDTO.isExport());
if (null == agencyGrid) {
return new CustomerDataManageResultDTO();
}*/
//组织或网格Id集合
List<String> idList = agencyGrid.getAgencyGridList().stream().map(ScreenAgencyOrGridListDTO.AgencyGrid::getOrgId).collect(Collectors.toList());
formDTO.setDataType(!OrgLevelEnum.COMMUNITY.getCode().equals(agencyGrid.getLevel()) ? OrgTypeEnum.AGENCY.getCode() : OrgTypeEnum.GRID.getCode());
@ -2329,7 +2334,7 @@ public class DataStatsServiceImpl implements DataStatsService, ResultDataResolve
}
//2.查询组织信息,判断要查询下级是组织还是网格数据
ScreenAgencyOrGridListDTO agencyGrid = govOrgService.getSubAgencyOrGridList(formDTO.getCustomerId(), formDTO.getAgencyId());
ScreenAgencyOrGridListDTO agencyGrid = govOrgService.getSubAgencyOrGridList(formDTO.getCustomerId(), formDTO.getAgencyId(), false);
if (null == agencyGrid) {
return new ArrayList<>();
}

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

@ -118,6 +118,8 @@ public class IcResiServiceImpl implements IcResiService {
query.eq(IcResiUserEntity::getIsMb, true);
} else if (ResiCategoryEnum.IS_SPECIAL.getColName().equals(categoryKey)) {
query.eq(IcResiUserEntity::getIsSpecial, true);
} else if(ResiCategoryEnum.IS_XJC.getColName().equals(categoryKey)){
query.eq(IcResiUserEntity::getIsXjc, true);
}
if (StringUtils.isNotBlank(search)) {

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

@ -290,6 +290,6 @@ public interface GovOrgService {
List<ResourceInfoResultDTO> getEnterpriseInfos(CoverageHomeSearchFormDTO formDTO);
Integer getEnterpriseInfosCount(CoverageHomeSearchFormDTO formDTO);
ScreenAgencyOrGridListDTO getSubAgencyOrGridList(String customerId, String agencyId);
ScreenAgencyOrGridListDTO getSubAgencyOrGridList(String customerId, String agencyId, Boolean isGetSubAllGrid);
}

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

@ -1473,7 +1473,7 @@ public class GovOrgServiceImpl implements GovOrgService {
}
@Override
public ScreenAgencyOrGridListDTO getSubAgencyOrGridList(String customerId, String agencyId) {
public ScreenAgencyOrGridListDTO getSubAgencyOrGridList(String customerId, String agencyId, Boolean isGetSubAllGrid) {
ScreenAgencyOrGridListDTO resultDTO = new ScreenAgencyOrGridListDTO();
List<ScreenAgencyOrGridListDTO.AgencyGrid> agencyGridList = new ArrayList<>();
//1.查询组织信息
@ -1485,10 +1485,22 @@ public class GovOrgServiceImpl implements GovOrgService {
//2.根据组织级别判断查询直属组织或网格列表
List<ScreenCustomerAgencyDTO> agencyList = new ArrayList<>();
List<ScreenCustomerGridDTO> gridList = new ArrayList<>();
//组织级别为街道的查询下级所有网格
if (isGetSubAllGrid && (OrgLevelEnum.STREET.getCode().equals(dto.getLevel()))) {
gridList = customerGridDao.getSubGridList(customerId, agencyId);
List<ScreenAgencyOrGridListDTO.AgencyGrid> allGridList = new ArrayList<>();
gridList.forEach(gr -> {
ScreenAgencyOrGridListDTO.AgencyGrid org = new ScreenAgencyOrGridListDTO.AgencyGrid();
org.setOrgId(gr.getGridId());
org.setOrgName(gr.getGridName());
allGridList.add(org);
});
resultDTO.setAllGridList(allGridList);
}
if (!"community".equals(dto.getLevel())) {
//2-1.直属下级组织列表
agencyList = customerAgencyDao.getSubAgencyListByAgency(customerId, agencyId);
agencyList.forEach(gr->{
agencyList.forEach(gr -> {
ScreenAgencyOrGridListDTO.AgencyGrid org = new ScreenAgencyOrGridListDTO.AgencyGrid();
org.setOrgId(gr.getAgencyId());
org.setOrgName(gr.getAgencyName());
@ -1497,7 +1509,7 @@ public class GovOrgServiceImpl implements GovOrgService {
} else {
//2-2.直属下级网格列表
gridList = customerGridDao.getSubGridList(customerId, agencyId);
gridList.forEach(gr->{
gridList.forEach(gr -> {
ScreenAgencyOrGridListDTO.AgencyGrid org = new ScreenAgencyOrGridListDTO.AgencyGrid();
org.setOrgId(gr.getGridId());
org.setOrgName(gr.getGridName());

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

@ -244,17 +244,18 @@ public class CoverageServiceImpl implements CoverageService {
if (CollectionUtils.isEmpty(customerMenuList)){
return result;
}
List<String> tables = new ArrayList<>();
List<String> tableMore = new ArrayList<>();
customerMenuList.forEach(cm -> {
resources.forEach(r -> {
if (cm.getUrl().equals(r)){
String tableName = MenusEnums.getValueByUrl(r);
if (StringUtils.isNotBlank(tableName)){
tables.add(tableName);
tableMore.add(tableName);
}
}
});
});
List<String> tables = tableMore.stream().distinct().collect(Collectors.toList());
if (CollectionUtils.isEmpty(tables)){
return result;
}

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

@ -194,6 +194,7 @@
del_flag = '0'
AND customer_id = #{customerId}
AND pid = #{agencyId}
ORDER BY pid, grid_name
</select>
</mapper>

5
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/user/IcResiUserEntity.java

@ -225,6 +225,11 @@ public class IcResiUserEntity extends BaseEpmetEntity {
*/
private String isFloating;
/**
* 是否新阶层人士:1 :0
*/
private String isXjc;
/**
* 文化程度字典表
*/

14
epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueProjectCategoryDictDao.xml

@ -61,15 +61,19 @@
<select id="selectCategoryList" resultType="com.epmet.dto.IssueProjectCategoryDictDTO">
SELECT
*
a.*,
b.CATEGORY_NAME as parentCategoryName
FROM
issue_project_category_dict
issue_project_category_dict a
LEFT JOIN issue_project_category_dict b ON a.PID = b.ID
AND b.del_flag = '0'
AND b.customer_id = #{customerId}
WHERE
del_flag = '0'
AND customer_id = #{customerId}
a.del_flag = '0'
AND a.customer_id = #{customerId}
<if test="cstegoryIdList != null and cstegoryIdList.size() > 0">
<foreach collection="cstegoryIdList" item="id" open="AND( " separator=" OR " index="index" close=")">
id = #{id}
a.id = #{id}
</foreach>
</if>
ORDER BY

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

@ -155,4 +155,9 @@ public class CustomerGridDTO implements Serializable {
* 弃用1正常使用0
*/
private Integer abandonFlag;
/**
* 网格排序
*/
private Integer sort;
}

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

@ -0,0 +1,131 @@
package com.epmet.dto;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import lombok.Data;
/**
* 网格员工作日志
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-08-05
*/
@Data
public class IcWorkLogDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 唯一标识
*/
private String id;
/**
* 客户Id
*/
private String customerId;
/**
* 组织Id
*/
private String agencyId;
/**
* 组织Id
*/
private String allAgencyName;
/**
* agency_id的所有上级
*/
private String pids;
/**
* 网格Id场所区域
*/
private String gridId;
/**
* 网格Id场所区域
*/
private String gridName;
/**
* 标题
*/
private String title;
/**
* 日志类型admin库sys_dict_data表value值
*/
private String logType;
/**
* 日志日期
*/
private String logDate;
/**
* 内容
*/
private String content;
/**
* 备注
*/
private String remark;
/**
* 手机
*/
private String mobile;
/**
* 删除标识0.未删除 1.已删除
*/
private Integer delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
/**
* 创建人名称
*/
private String createdUser;
/**
* url
*/
private String url;
/**
* 附件
*/
private List<IcWorkLogFileDTO> fileList;
}

89
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcWorkLogFileDTO.java

@ -0,0 +1,89 @@
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 2022-08-05
*/
@Data
public class IcWorkLogFileDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 唯一标识
*/
private String id;
/**
* 客户Id
*/
private String customerId;
/**
* 日志Id
*/
private String logId;
/**
* 地址
*/
private String url;
/**
* 文件名
*/
private String fileName;
/**
* 文件名
*/
private String name;
/**
* 文件类型0图片
*/
private String fileType;
/**
* 内容
*/
private Integer sort;
/**
* 删除标识0.未删除 1.已删除
*/
private Integer delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

36
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/CollectHouseFormDTO.java

@ -0,0 +1,36 @@
package com.epmet.dto.form;
import lombok.Data;
import java.io.Serializable;
/**
* @author wgf
* @date 2022/8/3 11:18
*/
@Data
public class CollectHouseFormDTO implements Serializable {
private static final long serialVersionUID = 2636608477324780974L;
private String id;
/**
* 房屋状态 1出租 0自住 2闲置 3未售出
*/
private Integer rentFlag;
/**
* 房主姓名
*/
private String ownerName;
/**
* 客户ID
*/
private String customerId;
/**
* 居住人数
*/
private Integer resiNumber;
}

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

@ -78,4 +78,9 @@ public class EditGridFormDTO implements Serializable {
* 中心点位位置
*/
private String centerAddress;
/**
* 网格排序
*/
private Integer sort;
}

25
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/GetHouseInfoToCollectFormDTO.java

@ -0,0 +1,25 @@
package com.epmet.dto.form;
import lombok.Data;
import java.io.Serializable;
/**
* @author wgf
* @date 2022/8/3 11:18
*/
@Data
public class GetHouseInfoToCollectFormDTO implements Serializable {
private static final long serialVersionUID = 2636608477324780974L;
/**
* 单元
*/
private String buildingUnitId;
/**
* 门牌号
*/
private String doorName;
}

5
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GridDetailResultDTO.java

@ -91,4 +91,9 @@ public class GridDetailResultDTO implements Serializable {
*/
private String mobile = "";
/**
* 网格排序
*/
private Integer gridSort = 0;
}

124
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/IcHouseInfoCollectResultDTO.java

@ -0,0 +1,124 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* desc:房屋列表结果类
*
* @author liujianjun
*/
@Data
public class IcHouseInfoCollectResultDTO implements Serializable {
private static final long serialVersionUID = 4963952996288796744L;
/**
* id
*/
private String id;
/**
* 客户id
*/
private String customerId;
/**
* 所属组织的PIDS包括agencygrid
*/
private String orgIdPath;
/**
* 小区id
*/
private String neighborHoodId;
/**
* 片区idneighbor_hood_part.id,可为空
*/
private String partId;
/**
* 所属楼栋id
*/
private String buildingId;
/**
* 所属单元id
*/
private String buildingUnitId;
/**
* 房屋名字后台插入时生成
*/
private String houseName;
/**
* 全名:小区楼栋单元房屋
*/
private String fullName;
/**
* 门牌号
*/
private String doorName;
/**
* 房屋类型这里存储字典value就可以
*/
private String houseType;
/**
* 存储字典value
*/
private String purpose;
/**
* 1出租 0自住 2闲置 3未出售
*/
private Integer rentFlag;
/**
* 房主姓名
*/
private String ownerName;
/**
* 房主电话
*/
private String ownerPhone;
/**
* 房主身份证号
*/
private String ownerIdCard;
/**
* 排序
*/
private BigDecimal sort;
/**
* 备注
*/
private String remark;
/**
* 房屋编码
*/
private String houseCode;
private String houseQrcodeUrl;
/**
* 居住人数
*/
private Integer resiNumber;
/**
* 房屋可编辑编码
*/
private String coding;
}

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

@ -147,6 +147,12 @@
<version>2.0.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.epmet</groupId>
<artifactId>epmet-third-client</artifactId>
<version>2.0.0</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>

148
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java

@ -17,31 +17,35 @@
package com.epmet.controller;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.epmet.commons.rocketmq.messages.OrgOrStaffMQMsg;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.annotation.RequirePermission;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.enums.EnvEnum;
import com.epmet.commons.tools.enums.CollectUrlEnum;
import com.epmet.commons.tools.enums.RequirePermissionEnum;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.BarcodeUtils;
import com.epmet.commons.tools.utils.HttpClientManager;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.constant.CustomerAgencyConstant;
import com.epmet.constant.OrgInfoConstant;
import com.epmet.dto.CustomerAgencyDTO;
import com.epmet.dto.IcNeighborHoodDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
import com.epmet.entity.CustomerAgencyEntity;
import com.epmet.feign.EpmetMessageOpenFeignClient;
import com.epmet.feign.OssFeignClient;
import com.epmet.resi.group.dto.QRCodeMultipartFileDTO;
import com.epmet.send.SendMqMsgUtil;
import com.epmet.service.AgencyService;
import com.epmet.service.CustomerAgencyService;
import com.epmet.service.IcNeighborHoodService;
import com.epmet.utils.ThirdUtils;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
@ -56,9 +60,9 @@ import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.URL;
import java.net.URLEncoder;
import java.time.LocalDateTime;
import java.time.ZoneOffset;
import java.nio.charset.StandardCharsets;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@ -82,6 +86,8 @@ public class AgencyController {
private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient;
@Autowired
private IcNeighborHoodService neighborHoodService;
@Autowired
private OssFeignClient ossFeignClient;
/**
* @param formDTO
@ -400,45 +406,60 @@ public class AgencyController {
public void createQrCode(@LoginUser TokenDto tokenDto, @RequestBody CreateQrCodeFormDTO formDTO, HttpServletResponse response) {
ValidatorUtils.validateEntity(formDTO, CreateQrCodeFormDTO.CreateQrCodeForm.class);
String id = formDTO.getId();
String type = formDTO.getType();
String name = "";
if(!formDTO.getType().equals(OrgInfoConstant.COMMUNITY)){
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "只可生成社区码");
}
try {
if (type.equals(OrgInfoConstant.COMMUNITY)) {
CustomerAgencyDTO customerAgencyDTO = customerAgencyService.get(id);
if (customerAgencyDTO == null) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "组织信息不存在");
}
name = customerAgencyDTO.getOrganizationName();
} else if (type.equals(OrgInfoConstant.NEIGHBOR_HOOD)) {
IcNeighborHoodDTO icNeighborHoodDTO = neighborHoodService.get(id);
if (icNeighborHoodDTO == null) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "小区信息不存在");
//获取AccessToken
String accessToken = ThirdUtils.getAccessToken(tokenDto.getCustomerId()).getResiToken();
if (org.apache.commons.lang3.StringUtils.isBlank(accessToken)) {
log.warn("获取accessToken失败,customerId:{}", tokenDto.getCustomerId());
throw new RenException("获取accessToken失败,customerId:{}", tokenDto.getCustomerId());
}
CustomerAgencyDTO customerAgencyDTO = customerAgencyService.get(id);
if (customerAgencyDTO == null) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "组织信息不存在");
}
name = customerAgencyDTO.getOrganizationName();
//url组成:信息采集地址?社区id
StringBuilder path = new StringBuilder(CollectUrlEnum.URL_PRE.getCode());
path.append("?agencyId=").append(formDTO.getId());
//需要发送的Json
JSONObject data = new JSONObject();
data.put("path", path.toString());
data.put("width", 400);
//发送
byte[] buffer = HttpClientManager.getInstance().getMediaByteArray(CollectUrlEnum.GET_CODE_URL.getCode() + accessToken, JSON.toJSONString(data)).getData();
if (buffer != null && buffer.length < 500) {
String wxResult = "";
wxResult = new String(buffer, StandardCharsets.UTF_8);
if (-1 != wxResult.indexOf("errcode")) {
log.error("获取二维码接口返回错误:{}", wxResult);
throw new RenException("获取二维码失败");
}
name = icNeighborHoodDTO.getNeighborHoodName();
}
//url组成:数字社区地址?小区id&用户id
//String url = "https://demo.tduckapp.com/s/7314b64b3a26455ab793fb8c640856b6?id="+id;
String url = EnvEnum.getCurrentEnv().getUrl()
.replace("cloud", "open")
.replace("api/", StrConstant.EPMETY_STR)
.concat("epmet-oper-gov/#/caiji/")
.concat(id).concat("?")
.concat("name=").concat(URLEncoder.encode(name, StrConstant.UTF_8)).concat(StrConstant.AND_MARK)
.concat("customerId=").concat(tokenDto.getCustomerId()).concat(StrConstant.AND_MARK)
.concat("type=").concat(type).concat(StrConstant.AND_MARK)
.concat("userId=").concat(tokenDto.getUserId())
.concat(StrConstant.AND_MARK).concat(String.valueOf(LocalDateTime.now().toInstant(ZoneOffset.of("+8")).toEpochMilli()));
BufferedImage image = BarcodeUtils.drawQRImage(name, url);
//BufferedImage 转 InputStream
//上传
QRCodeMultipartFileDTO qrCodeMultipartFile = new QRCodeMultipartFileDTO();
qrCodeMultipartFile.setBytes(buffer);
String originalFilename = name.concat(".jpg");
qrCodeMultipartFile.setOriginalFilename(originalFilename);
Result<UploadImgResultDTO> uploadResult = ossFeignClient.uploadQrCode(qrCodeMultipartFile);
if (!uploadResult.success()) {
throw new RenException("调用oss服务上传活动居民信息录入码失败");
}
URL url = new URL(uploadResult.getData().getUrl());
BufferedImage img = ImageIO.read(url);
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
ImageOutputStream imageOutput = ImageIO.createImageOutputStream(byteArrayOutputStream);
ImageIO.write(image, "png", imageOutput);
ImageIO.write(img, "png", imageOutput);
InputStream inputStream = new ByteArrayInputStream(byteArrayOutputStream.toByteArray());
long length = imageOutput.length();
String fileName = name + ".png";
response.setContentType("application/octet-stream");
response.setContentLength((int) length);
response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(fileName, StrConstant.UTF_8));
response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(originalFilename, StrConstant.UTF_8));
//输出流
byte[] bytes = new byte[1024];
@ -450,10 +471,69 @@ public class AgencyController {
outputStream.write(bytes, 0, len);
}
outputStream.flush();
} catch (Exception e) {
log.error("method exception", e);
}
}
// @PostMapping("create-qrcode")
// public void createQrCode(@LoginUser TokenDto tokenDto, @RequestBody CreateQrCodeFormDTO formDTO, HttpServletResponse response) {
// ValidatorUtils.validateEntity(formDTO, CreateQrCodeFormDTO.CreateQrCodeForm.class);
// String id = formDTO.getId();
// String type = formDTO.getType();
// String name = "";
// try {
// if (type.equals(OrgInfoConstant.COMMUNITY)) {
// CustomerAgencyDTO customerAgencyDTO = customerAgencyService.get(id);
// if (customerAgencyDTO == null) {
// throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "组织信息不存在");
// }
// name = customerAgencyDTO.getOrganizationName();
// } else if (type.equals(OrgInfoConstant.NEIGHBOR_HOOD)) {
// IcNeighborHoodDTO icNeighborHoodDTO = neighborHoodService.get(id);
// if (icNeighborHoodDTO == null) {
// throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "小区信息不存在");
// }
// name = icNeighborHoodDTO.getNeighborHoodName();
// }
// //url组成:数字社区地址?小区id&用户id
// //String url = "https://demo.tduckapp.com/s/7314b64b3a26455ab793fb8c640856b6?id="+id;
// String url = EnvEnum.getCurrentEnv().getUrl()
// .replace("cloud", "open")
// .replace("api/", StrConstant.EPMETY_STR)
// .concat("epmet-oper-gov/#/caiji/")
// .concat(id).concat("?")
// .concat("name=").concat(URLEncoder.encode(name, StrConstant.UTF_8)).concat(StrConstant.AND_MARK)
// .concat("customerId=").concat(tokenDto.getCustomerId()).concat(StrConstant.AND_MARK)
// .concat("type=").concat(type).concat(StrConstant.AND_MARK)
// .concat("userId=").concat(tokenDto.getUserId())
// .concat(StrConstant.AND_MARK).concat(String.valueOf(LocalDateTime.now().toInstant(ZoneOffset.of("+8")).toEpochMilli()));
// BufferedImage image = BarcodeUtils.drawQRImage(name, url);
// //BufferedImage 转 InputStream
// ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
// ImageOutputStream imageOutput = ImageIO.createImageOutputStream(byteArrayOutputStream);
// ImageIO.write(image, "png", imageOutput);
// InputStream inputStream = new ByteArrayInputStream(byteArrayOutputStream.toByteArray());
// long length = imageOutput.length();
// String fileName = name + ".png";
// response.setContentType("application/octet-stream");
// response.setContentLength((int) length);
// response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(fileName, StrConstant.UTF_8));
//
// //输出流
// byte[] bytes = new byte[1024];
// OutputStream outputStream = response.getOutputStream();
// long count = 0;
// while (count < length) {
// int len = inputStream.read(bytes, 0, 1024);
// count += len;
// outputStream.write(bytes, 0, len);
// }
// outputStream.flush();
// } catch (Exception e) {
// log.error("method exception", e);
// }
// }
/**
* Desc: 查询工作人员所属组织下的所有社区

2
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/GridController.java

@ -15,6 +15,7 @@ import com.epmet.feign.EpmetMessageOpenFeignClient;
import com.epmet.send.SendMqMsgUtil;
import com.epmet.service.CustomerGridService;
import com.epmet.service.CustomerStaffAgencyService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@ -26,6 +27,7 @@ import java.util.List;
*/
@RestController
@RequestMapping("grid")
@Slf4j
public class GridController {
@Autowired

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

@ -200,6 +200,34 @@ public class HouseController implements ResultDataResolver {
return new Result();
}
/**
* 信息登记更新房屋信息
*
* @param formDTO
* @return com.epmet.commons.tools.utils.Result
* @author wgf
* @date 2022/8/3 11:16
*/
@NoRepeatSubmit
@PostMapping("updateCollect")
public Result updateCollect(@RequestBody CollectHouseFormDTO formDTO) {
houseService.updateCollect(formDTO);
return new Result();
}
/**
* 获取房屋信息
*
* @param formDTO
* @return com.epmet.commons.tools.utils.Result
* @author wgf
* @date 2022/8/3 11:16
*/
@PostMapping("getHouseInfoToCollect")
public Result<IcHouseInfoCollectResultDTO> getHouseInfoToCollect(@RequestBody GetHouseInfoToCollectFormDTO formDTO) {
return houseService.getHouseInfoToCollect(formDTO);
}
/**
* lzh
*

88
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcWorkLogController.java

@ -0,0 +1,88 @@
package com.epmet.controller;
import com.alibaba.nacos.client.naming.utils.CollectionUtils;
import com.epmet.commons.tools.aop.NoRepeatSubmit;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ExcelUtils;
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.UpdateGroup;
import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.dto.IcWorkLogDTO;
import com.epmet.excel.IcWorkLogExcel;
import com.epmet.service.IcWorkLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
/**
* 网格员工作日志
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-08-05
*/
@RestController
@RequestMapping("icWorkLog")
public class IcWorkLogController {
@Autowired
private IcWorkLogService icWorkLogService;
@RequestMapping("page")
public Result<PageData<IcWorkLogDTO>> page(@RequestParam Map<String, Object> params){
PageData<IcWorkLogDTO> page = icWorkLogService.page(params);
return new Result<PageData<IcWorkLogDTO>>().ok(page);
}
@RequestMapping(value = "{id}", method = {RequestMethod.POST, RequestMethod.GET})
public Result<IcWorkLogDTO> get(@PathVariable("id") String id){
IcWorkLogDTO data = icWorkLogService.get(id);
return new Result<IcWorkLogDTO>().ok(data);
}
@NoRepeatSubmit
@PostMapping
public Result save(@RequestBody IcWorkLogDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
icWorkLogService.save(dto);
return new Result();
}
@NoRepeatSubmit
@PutMapping
public Result update(@RequestBody IcWorkLogDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
icWorkLogService.update(dto);
return new Result();
}
@RequestMapping(value = "delete", method = {RequestMethod.POST, RequestMethod.DELETE})
public Result delete(@RequestBody String[] ids){
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
icWorkLogService.delete(ids);
return new Result();
}
@GetMapping("export")
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
List<IcWorkLogDTO> list = icWorkLogService.list4Export(params);
if(CollectionUtils.isEmpty(list)){
IcWorkLogDTO dto = new IcWorkLogDTO();
dto.setId("");
list.add(dto);
}
ExcelUtils.exportExcelToTarget(response, null, list, IcWorkLogExcel.class);
}
}

82
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcWorkLogFileController.java

@ -0,0 +1,82 @@
package com.epmet.controller;
import com.epmet.commons.tools.aop.NoRepeatSubmit;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ExcelUtils;
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.UpdateGroup;
import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.dto.IcWorkLogFileDTO;
import com.epmet.excel.IcWorkLogFileExcel;
import com.epmet.service.IcWorkLogFileService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
/**
* 网格员工作日志附件
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-08-05
*/
@RestController
@RequestMapping("icWorkLogFile")
public class IcWorkLogFileController {
@Autowired
private IcWorkLogFileService icWorkLogFileService;
@RequestMapping("page")
public Result<PageData<IcWorkLogFileDTO>> page(@RequestParam Map<String, Object> params){
PageData<IcWorkLogFileDTO> page = icWorkLogFileService.page(params);
return new Result<PageData<IcWorkLogFileDTO>>().ok(page);
}
@RequestMapping(value = "{id}", method = {RequestMethod.POST, RequestMethod.GET})
public Result<IcWorkLogFileDTO> get(@PathVariable("id") String id){
IcWorkLogFileDTO data = icWorkLogFileService.get(id);
return new Result<IcWorkLogFileDTO>().ok(data);
}
@NoRepeatSubmit
@PostMapping("save")
public Result save(@RequestBody IcWorkLogFileDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
icWorkLogFileService.save(dto);
return new Result();
}
@NoRepeatSubmit
@PostMapping("update")
public Result update(@RequestBody IcWorkLogFileDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
icWorkLogFileService.update(dto);
return new Result();
}
@RequestMapping(value = "delete", method = {RequestMethod.POST, RequestMethod.DELETE})
public Result delete(@RequestBody String[] ids){
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
icWorkLogFileService.delete(ids);
return new Result();
}
@GetMapping("export")
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
List<IcWorkLogFileDTO> list = icWorkLogFileService.list(params);
ExcelUtils.exportExcelToTarget(response, null, list, IcWorkLogFileExcel.class);
}
}

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

@ -141,4 +141,18 @@ public class NeighborHoodController {
TemplateExportParams templatePath = new TemplateExportParams("excel/neighbor_template.xlsx");
ExcelPoiUtils.exportExcel(templatePath ,new HashMap<>(),"小区信息录入表",response);
}
/**
* @describe: 批量生成小区二维码
* @author wangtong
* @date 2022/8/4 15:15
* @params [loginUser]
* @return com.epmet.commons.tools.utils.Result
*/
@NoRepeatSubmit
@PostMapping("createBatchNeiQrUrl")
public Result createBatchNeiQrUrl(@LoginUser TokenDto loginUser) {
return neighborHoodService.createBatchNeiQrUrl(loginUser.getCustomerId());
}
}

8
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java

@ -376,5 +376,13 @@ public interface CustomerAgencyDao extends BaseDao<CustomerAgencyEntity> {
CustomerAgencyEntity getAreaRootAgency(@Param("customerId") String customerId);
/**
* @Description 根据人查询所在组织
* @Param userId
* @author zhy
* @date 2021/8/5 10:08 上午
*/
CustomerAgencyEntity getAgencyByUserId(@Param("userId") String userId, @Param("customerId") String customerId);
}

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

@ -2,6 +2,7 @@ package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.ImportGeneralDTO;
import com.epmet.dto.form.GetHouseInfoToCollectFormDTO;
import com.epmet.dto.form.IcHouseListFormDTO;
import com.epmet.dto.result.*;
import com.epmet.entity.CustomerOrgParameterEntity;
@ -192,4 +193,12 @@ public interface IcHouseDao extends BaseDao<IcHouseEntity> {
* @params [coding]
*/
IcHouseEntity selectByCoding(@Param("coding") String coding);
/**
* 获取房屋信息
* @param formDTO
* @return
*/
IcHouseInfoCollectResultDTO getHouseInfoToCollect(GetHouseInfoToCollectFormDTO formDTO);
}

39
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcWorkLogDao.java

@ -0,0 +1,39 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.IcWorkLogDTO;
import com.epmet.entity.IcWorkLogEntity;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
import java.util.Map;
/**
* 网格员工作日志
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-08-05
*/
@Mapper
public interface IcWorkLogDao extends BaseDao<IcWorkLogEntity> {
/**
* 分页列表
*
* @param params
* @return java.util.List<com.epmet.dto.IcWorkLogDTO>
* @author zhy
* @date 2022/8/9 17:23
*/
List<IcWorkLogDTO> listPage(Map<String, Object> params);
/**
* 导出列表
*
* @param params
* @return java.util.List<com.epmet.dto.IcWorkLogDTO>
* @author zhy
* @date 2022/8/9 17:23
*/
List<IcWorkLogDTO> list4Export(Map<String, Object> params);
}

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

@ -0,0 +1,26 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.IcWorkLogFileEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* 网格员工作日志附件
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-08-05
*/
@Mapper
public interface IcWorkLogFileDao extends BaseDao<IcWorkLogFileEntity> {
/**
* 删除
*
* @param logId
* @return void
* @author generator
* @date 2022-08-05
*/
void deleteByLogId(@Param("logId") String logId);
}

5
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcNeighborHoodEntity.java

@ -116,4 +116,9 @@ public class IcNeighborHoodEntity extends BaseEpmetEntity {
* 实有楼栋数
*/
private Integer realBuilding;
/**
* 二维码地址
*/
private String qrcodeUrl;
}

79
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcWorkLogEntity.java

@ -0,0 +1,79 @@
package com.epmet.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 网格员工作日志
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-08-05
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("ic_work_log")
public class IcWorkLogEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户Id
*/
private String customerId;
/**
* 组织Id
*/
private String agencyId;
/**
* agency_id的所有上级
*/
private String pids;
/**
* 网格Id场所区域
*/
private String gridId;
/**
* 标题
*/
private String title;
/**
* 日志类型admin库sys_dict_data表value值
*/
private String logType;
/**
* 日志日期
*/
private String logDate;
/**
* 内容
*/
private String content;
/**
* 备注
*/
private String remark;
/**
* 手机
*/
private String mobile;
/**
* 创建人名称
*/
private String createdUser;
}

54
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcWorkLogFileEntity.java

@ -0,0 +1,54 @@
package com.epmet.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 网格员工作日志附件
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-08-05
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("ic_work_log_file")
public class IcWorkLogFileEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户Id
*/
private String customerId;
/**
* 日志Id
*/
private String logId;
/**
* 地址
*/
private String url;
/**
* 文件名
*/
private String fileName;
/**
* 文件类型0图片
*/
private String fileType;
/**
* 内容
*/
private Integer sort;
}

45
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcWorkLogExcel.java

@ -0,0 +1,45 @@
package com.epmet.excel;
import cn.afterturn.easypoi.excel.annotation.Excel;
import lombok.Data;
/**
* 网格员工作日志
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-08-05
*/
@Data
public class IcWorkLogExcel {
@Excel(name = "网格员", width = 15)
private String createdUser;
@Excel(name = "联系电话", width = 20)
private String mobile;
@Excel(name = "所属镇街", width = 25)
private String allAgencyName;
@Excel(name = "所属网格", width = 25)
private String gridName;
@Excel(name = "标题", width = 25)
private String title;
@Excel(name = "日志时间", width = 15)
private String logDate;
@Excel(name = "日志类型", width = 15)
private String logType;
@Excel(name = "内容", width = 100)
private String content;
@Excel(name = "备注", width = 50)
private String remark;
@Excel(name = "照片", width = 50)
private String url;
}

57
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcWorkLogFileExcel.java

@ -0,0 +1,57 @@
package com.epmet.excel;
import cn.afterturn.easypoi.excel.annotation.Excel;
import lombok.Data;
import java.util.Date;
/**
* 网格员工作日志附件
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-08-05
*/
@Data
public class IcWorkLogFileExcel {
@Excel(name = "唯一标识")
private String id;
@Excel(name = "客户Id")
private String customerId;
@Excel(name = "日志Id")
private String logId;
@Excel(name = "地址")
private String url;
@Excel(name = "文件名")
private String fileName;
@Excel(name = "文件类型,0图片")
private String fileType;
@Excel(name = "内容")
private Integer sort;
@Excel(name = "删除标识:0.未删除 1.已删除")
private Integer delFlag;
@Excel(name = "乐观锁")
private Integer revision;
@Excel(name = "创建人")
private String createdBy;
@Excel(name = "创建时间")
private Date createdTime;
@Excel(name = "更新人")
private String updatedBy;
@Excel(name = "更新时间")
private Date updatedTime;
}

30
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/IcWorkLogFileRedis.java

@ -0,0 +1,30 @@
package com.epmet.redis;
import com.epmet.commons.tools.redis.RedisUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* 网格员工作日志附件
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-08-05
*/
@Component
public class IcWorkLogFileRedis {
@Autowired
private RedisUtils redisUtils;
public void delete(Object[] ids) {
}
public void set(){
}
public String get(String id){
return null;
}
}

30
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/IcWorkLogRedis.java

@ -0,0 +1,30 @@
package com.epmet.redis;
import com.epmet.commons.tools.redis.RedisUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* 网格员工作日志
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-08-05
*/
@Component
public class IcWorkLogRedis {
@Autowired
private RedisUtils redisUtils;
public void delete(Object[] ids) {
}
public void set(){
}
public String get(String id){
return null;
}
}

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

@ -43,6 +43,7 @@ public interface HouseService {
void updateHouse(String customerId, IcHouseAddFormDTO formDTO);
void updateCollect(CollectHouseFormDTO formDTO);
/**
* Desc: 房屋变更记录
@ -54,6 +55,16 @@ public interface HouseService {
*/
void houseChangeRecord(String houseId, String customerId, IcHouseDTO houseDTO);
/**
* Desc: 房屋变更记录(信息登记)
* @param houseId
* @param customerId
* @param houseDTO
* @author wgf
* @date 2022/5/10 10:57
*/
void houseChangeRecordCollect(String houseId, String customerId, IcHouseDTO houseDTO);
/**
* 小寨子社区-合同签订后变更成出租状态
*
@ -175,4 +186,11 @@ public interface HouseService {
Result getHomeInfoByHouseCode(HouseInfoFormDTO dto);
void orgIdPathInit();
/**
* 获取房屋信息
* @param formDTO
* @return
*/
Result<IcHouseInfoCollectResultDTO> getHouseInfoToCollect(GetHouseInfoToCollectFormDTO formDTO);
}

88
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcWorkLogFileService.java

@ -0,0 +1,88 @@
package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.IcWorkLogFileDTO;
import com.epmet.entity.IcWorkLogFileEntity;
import java.util.List;
import java.util.Map;
/**
* 网格员工作日志附件
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-08-05
*/
public interface IcWorkLogFileService extends BaseService<IcWorkLogFileEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<IcWorkLogFileDTO>
* @author generator
* @date 2022-08-05
*/
PageData<IcWorkLogFileDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<IcWorkLogFileDTO>
* @author generator
* @date 2022-08-05
*/
List<IcWorkLogFileDTO> list(Map<String, Object> params);
/**
* 单条查询
*
* @param id
* @return IcWorkLogFileDTO
* @author generator
* @date 2022-08-05
*/
IcWorkLogFileDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2022-08-05
*/
void save(IcWorkLogFileDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2022-08-05
*/
void update(IcWorkLogFileDTO dto);
/**
* 批量删除
*
* @param ids
* @return void
* @author generator
* @date 2022-08-05
*/
void delete(String[] ids);
/**
* 删除
*
* @param logId
* @return void
* @author generator
* @date 2022-08-05
*/
void deleteByLogId(String logId);
}

88
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcWorkLogService.java

@ -0,0 +1,88 @@
package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.IcWorkLogDTO;
import com.epmet.entity.IcWorkLogEntity;
import java.util.List;
import java.util.Map;
/**
* 网格员工作日志
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-08-05
*/
public interface IcWorkLogService extends BaseService<IcWorkLogEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<IcWorkLogDTO>
* @author generator
* @date 2022-08-05
*/
PageData<IcWorkLogDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<IcWorkLogDTO>
* @author generator
* @date 2022-08-05
*/
List<IcWorkLogDTO> list(Map<String, Object> params);
/**
* 查询
*
* @param params
* @return java.util.List<IcWorkLogDTO>
* @author generator
* @date 2022-08-05
*/
List<IcWorkLogDTO> list4Export(Map<String, Object> params);
/**
* 单条查询
*
* @param id
* @return IcWorkLogDTO
* @author generator
* @date 2022-08-05
*/
IcWorkLogDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2022-08-05
*/
void save(IcWorkLogDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2022-08-05
*/
void update(IcWorkLogDTO dto);
/**
* 批量删除
*
* @param ids
* @return void
* @author generator
* @date 2022-08-05
*/
void delete(String[] ids);
}

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

@ -18,6 +18,7 @@
package com.epmet.service;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.form.IcHouseListFormDTO;
import com.epmet.dto.form.IcNeighborHoodAddFormDTO;
import com.epmet.dto.form.IcNeighborHoodListFormDTO;
@ -51,4 +52,13 @@ public interface NeighborHoodService{
* @param response
*/
void exportNeighborhoodinfo(IcHouseListFormDTO formDTO, HttpServletResponse response) throws Exception ;
/**
* @describe: 批量生成小区二维码
* @author wangtong
* @date 2022/8/4 15:18
* @params [customerId]
* @return com.epmet.commons.tools.utils.Result
*/
Result createBatchNeiQrUrl(String customerId);
}

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

@ -202,7 +202,7 @@ public class BuildingServiceImpl implements BuildingService {
// agencyIdList.add(customerAgency.getId());
LambdaQueryWrapper<CustomerGridEntity> gridWrapper = new LambdaQueryWrapper<>();
gridWrapper.in(CustomerGridEntity::getPid, agencyIdList);
gridWrapper.last("ORDER BY CAST(GRID_NAME AS SIGNED),CONVERT(GRID_NAME using gbk)");
gridWrapper.last("ORDER BY sort,CAST(GRID_NAME AS SIGNED),CONVERT(GRID_NAME using gbk)");
List<CustomerGridEntity> customerGridList = customerGridDao.selectList(gridWrapper);
if (CollectionUtils.isEmpty(customerGridList)) {

3
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java

@ -343,6 +343,7 @@ public class CustomerGridServiceImpl extends BaseServiceImpl<CustomerGridDao, Cu
customerGridDTO.setGridType(editGridFormDTO.getGridType());
customerGridDTO.setContacts(editGridFormDTO.getContacts());
customerGridDTO.setMobile(editGridFormDTO.getMobile());
customerGridDTO.setSort(editGridFormDTO.getSort());
if(StringUtils.isNotBlank(editGridFormDTO.getLongitude())){
customerGridDTO.setLongitude(editGridFormDTO.getLongitude());
}
@ -940,7 +941,7 @@ public class CustomerGridServiceImpl extends BaseServiceImpl<CustomerGridDao, Cu
}
LambdaQueryWrapper<CustomerGridEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(CustomerGridEntity::getPid, agencyId);
wrapper.last("ORDER BY CONVERT ( GRID_NAME USING gbk ) ASC");
wrapper.last("ORDER BY sort,CONVERT ( GRID_NAME USING gbk ) desc");
List<CustomerGridEntity> list = baseDao.selectList(wrapper);
if (CollectionUtils.isEmpty(list)) {
return Collections.emptyList();

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

@ -244,6 +244,30 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver {
icHouseRedis.delHouseInfo(formDTO.getHouseId(), customerId);
}
/**
* 更新房屋信息登记
*
* @param
* @param formDTO
*/
@Override
@Transactional(rollbackFor = Exception.class)
public void updateCollect(CollectHouseFormDTO formDTO) {
IcHouseEntity entity = new IcHouseEntity();
entity.setId(formDTO.getId());
entity.setRentFlag(formDTO.getRentFlag());
entity.setOwnerName(formDTO.getOwnerName());
entity.setResiNumber(formDTO.getResiNumber());
// 更新变更记录
IcHouseDTO icHouseDTO = ConvertUtils.sourceToTarget(formDTO, IcHouseDTO.class);
houseChangeRecordCollect(formDTO.getId(), formDTO.getCustomerId(), icHouseDTO);
icHouseDao.updateById(entity);
//删除房屋缓存
icHouseRedis.delHouseInfo(formDTO.getId(), entity.getCustomerId());
}
/**
* Desc: 房屋变更记录
*
@ -337,6 +361,64 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver {
}
}
/**
* Desc: 房屋变更记录(信息登记)
*
* @param houseId
* @param customerId
* @param houseDTO
* @author wgf
* @date 2022/5/10 10:57
*/
@Transactional(rollbackFor = Exception.class)
@Override
public void houseChangeRecordCollect(String houseId, String customerId, IcHouseDTO houseDTO) {
IcHouseEntity entity = icHouseService.selectById(houseId);
entity.setOwnerName(null == entity.getOwnerName() ? "" : entity.getOwnerName());
entity.setOwnerPhone(null == entity.getOwnerPhone() ? "" : entity.getOwnerPhone());
entity.setOwnerIdCard(null == entity.getOwnerIdCard() ? "" : entity.getOwnerIdCard());
if (null == entity) {
throw new EpmetException("不存在此房屋...");
}
StringBuilder sbBefore = new StringBuilder();
StringBuilder sbAfter = new StringBuilder();
List<IcHouseChangeDetailEntity> entityList = new ArrayList<>();
if (!houseDTO.getRentFlag().equals(entity.getRentFlag())) {
sbAfter.append(HouseChangeEnums.RENT_FLAG.getColumnName()).append(":").append(null == houseDTO.getRentName() ? HouseRentFlagEnums.getTypeValue(houseDTO.getRentFlag()) : houseDTO.getRentName()).append(";");
sbBefore.append(HouseChangeEnums.RENT_FLAG.getColumnName()).append(":").append(HouseRentFlagEnums.getTypeValue(entity.getRentFlag())).append(";");
IcHouseChangeDetailEntity e = new IcHouseChangeDetailEntity();
e.setChangeCol(HouseChangeEnums.RENT_FLAG.getColumn());
e.setChangeAfter(null == houseDTO.getRentName() ? HouseRentFlagEnums.getTypeValue(houseDTO.getRentFlag()) : houseDTO.getRentName());
e.setChangeBefore(HouseRentFlagEnums.getTypeValue(entity.getRentFlag()));
entityList.add(e);
}
if (null != houseDTO.getOwnerName() && !houseDTO.getOwnerName().equals(entity.getOwnerName())) {
sbAfter.append(HouseChangeEnums.OWNER_NAME.getColumnName()).append(":").append(StringUtils.isNotBlank(houseDTO.getOwnerName()) ? houseDTO.getOwnerName() : "无").append(";");
sbBefore.append(HouseChangeEnums.OWNER_NAME.getColumnName()).append(":").append(StringUtils.isNotBlank(entity.getOwnerName()) ? entity.getOwnerName() : "无").append(";");
IcHouseChangeDetailEntity e = new IcHouseChangeDetailEntity();
e.setChangeCol(HouseChangeEnums.OWNER_NAME.getColumn());
e.setChangeAfter(StringUtils.isNotBlank(houseDTO.getOwnerName()) ? houseDTO.getOwnerName() : "无");
e.setChangeBefore(StringUtils.isNotBlank(entity.getOwnerName()) ? entity.getOwnerName() : "无");
entityList.add(e);
}
if (StringUtils.isNotBlank(sbAfter)) {
String before = sbBefore.substring(NumConstant.ZERO, sbBefore.length() - NumConstant.ONE);
String after = sbAfter.substring(NumConstant.ZERO, sbAfter.length() - NumConstant.ONE);
HouseAgencyInfoResultDTO houseAgencyInfo = icHouseDao.getHouseAgencyInfo(houseId);
IcHouseChangeRecordEntity recordEntity = ConvertUtils.sourceToTarget(houseAgencyInfo, IcHouseChangeRecordEntity.class);
recordEntity.setCustomerId(customerId);
recordEntity.setChangeBefore(before);
recordEntity.setChangeAfter(after);
changeRecordService.insert(recordEntity);
entityList.forEach(e -> {
e.setCustomerId(customerId);
e.setRecordId(recordEntity.getId());
});
changeDetailService.insertBatch(entityList);
}
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update2Rent(RentHouseFormDTO formDTO) {
@ -1220,4 +1302,12 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver {
}
recureAppendParentAgencyId(pid, result);
}
@Override
public Result<IcHouseInfoCollectResultDTO> getHouseInfoToCollect(GetHouseInfoToCollectFormDTO formDTO) {
IcHouseInfoCollectResultDTO icHouseInfoCollectResultDTO = icHouseDao.getHouseInfoToCollect(formDTO);
return new Result<IcHouseInfoCollectResultDTO>().ok(icHouseInfoCollectResultDTO);
}
}

95
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcWorkLogFileServiceImpl.java

@ -0,0 +1,95 @@
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.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.dao.IcWorkLogFileDao;
import com.epmet.dto.IcWorkLogFileDTO;
import com.epmet.entity.IcWorkLogFileEntity;
import com.epmet.redis.IcWorkLogFileRedis;
import com.epmet.service.IcWorkLogFileService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
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 2022-08-05
*/
@Service
public class IcWorkLogFileServiceImpl extends BaseServiceImpl<IcWorkLogFileDao, IcWorkLogFileEntity> implements IcWorkLogFileService {
@Autowired
private IcWorkLogFileRedis icWorkLogFileRedis;
@Override
public PageData<IcWorkLogFileDTO> page(Map<String, Object> params) {
IPage<IcWorkLogFileEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, IcWorkLogFileDTO.class);
}
@Override
public List<IcWorkLogFileDTO> list(Map<String, Object> params) {
List<IcWorkLogFileEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, IcWorkLogFileDTO.class);
}
private QueryWrapper<IcWorkLogFileEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
String logId = (String)params.get("logId");
QueryWrapper<IcWorkLogFileEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
wrapper.eq(StringUtils.isNotBlank(logId), "LOG_ID", logId);
return wrapper;
}
@Override
public IcWorkLogFileDTO get(String id) {
IcWorkLogFileEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, IcWorkLogFileDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(IcWorkLogFileDTO dto) {
IcWorkLogFileEntity entity = ConvertUtils.sourceToTarget(dto, IcWorkLogFileEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(IcWorkLogFileDTO dto) {
IcWorkLogFileEntity entity = ConvertUtils.sourceToTarget(dto, IcWorkLogFileEntity.class);
updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteBatchIds(Arrays.asList(ids));
}
@Override
@Transactional(rollbackFor = Exception.class)
public void deleteByLogId(String id) {
baseDao.deleteByLogId(id);
}
}

226
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcWorkLogServiceImpl.java

@ -0,0 +1,226 @@
package com.epmet.service.impl;
import com.alibaba.fastjson.JSON;
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.constant.NumConstant;
import com.epmet.commons.tools.enums.DictTypeEnum;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.user.LoginUserUtil;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dao.CustomerAgencyDao;
import com.epmet.dao.CustomerGridDao;
import com.epmet.dao.IcWorkLogDao;
import com.epmet.dto.CustomerStaffDTO;
import com.epmet.dto.IcWorkLogDTO;
import com.epmet.dto.IcWorkLogFileDTO;
import com.epmet.dto.form.CustomerGridFormDTO;
import com.epmet.dto.result.GridDetailResultDTO;
import com.epmet.entity.CustomerAgencyEntity;
import com.epmet.entity.CustomerGridEntity;
import com.epmet.entity.IcWorkLogEntity;
import com.epmet.entity.IcWorkLogFileEntity;
import com.epmet.feign.EpmetAdminOpenFeignClient;
import com.epmet.feign.EpmetUserFeignClient;
import com.epmet.redis.IcWorkLogRedis;
import com.epmet.service.IcWorkLogFileService;
import com.epmet.service.IcWorkLogService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 网格员工作日志
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-08-05
*/
@Service
public class IcWorkLogServiceImpl extends BaseServiceImpl<IcWorkLogDao, IcWorkLogEntity> implements IcWorkLogService {
@Autowired
private IcWorkLogRedis icWorkLogRedis;
@Autowired
private LoginUserUtil loginUserUtil;
@Autowired
private IcWorkLogFileService icWorkLogFileService;
@Autowired
private EpmetUserFeignClient epmetUserFeignClient;
@Autowired
private EpmetAdminOpenFeignClient epmetAdminOpenFeignClient;
@Resource
private CustomerGridDao customerGridDao;
@Resource
private CustomerAgencyDao customerAgencyDao;
@Override
public PageData<IcWorkLogDTO> page(Map<String, Object> params) {
params.put("customerId", loginUserUtil.getLoginUserCustomerId());
params.put("createdBy", loginUserUtil.getLoginUserId());
IPage<IcWorkLogDTO> page = getPage(params);
List<IcWorkLogDTO> list = baseDao.listPage(params);
return new PageData<>(list, page.getTotal());
}
@Override
public List<IcWorkLogDTO> list(Map<String, Object> params) {
List<IcWorkLogEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, IcWorkLogDTO.class);
}
@Override
public List<IcWorkLogDTO> list4Export(Map<String, Object> params) {
params.put("customerId", loginUserUtil.getLoginUserCustomerId());
params.put("createdBy", loginUserUtil.getLoginUserId());
List<IcWorkLogDTO> list = baseDao.list4Export(params);
Result<Map<String, String>> result = epmetAdminOpenFeignClient.dictMap(DictTypeEnum.LOG_TYPE.getCode());
if (!result.success() || null == result.getData()) {
throw new EpmetException("查询字典信息失败" + JSON.toJSONString(result));
} else {
Map<String, String> logTypeMap = result.getData();
list.forEach(item -> item.setLogType(logTypeMap.get(item.getLogType())));
}
return list;
}
private QueryWrapper<IcWorkLogEntity> getWrapper(Map<String, Object> params) {
String id = (String) params.get(FieldConstant.ID_HUMP);
QueryWrapper<IcWorkLogEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
return wrapper;
}
@Override
public IcWorkLogDTO get(String id) {
IcWorkLogEntity entity = baseDao.selectById(id);
IcWorkLogDTO dto = ConvertUtils.sourceToTarget(entity, IcWorkLogDTO.class);
if (StringUtils.isNotBlank(entity.getGridId())) {
CustomerGridEntity grid = customerGridDao.selectById(entity.getGridId());
dto.setGridName(grid.getGridName());
}
Map<String, Object> params = new HashMap<>(2);
params.put("logId", id);
List<IcWorkLogFileDTO> files = icWorkLogFileService.list(params);
files.forEach(item -> item.setName(item.getFileName()));
dto.setFileList(files);
return dto;
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(IcWorkLogDTO dto) {
dto.setCustomerId(loginUserUtil.getLoginUserCustomerId());
//查询当前申请用户的基本信息
CustomerStaffDTO customerStaffParam = new CustomerStaffDTO();
customerStaffParam.setUserId(loginUserUtil.getLoginUserId());
Result<CustomerStaffDTO> staffInfo = epmetUserFeignClient.getCustomerStaffInfoByUserId(customerStaffParam);
if (!staffInfo.success() || null == staffInfo.getData()) {
throw new EpmetException("查询用户信息失败" + JSON.toJSONString(customerStaffParam));
} else {
dto.setCreatedUser(staffInfo.getData().getRealName());
dto.setMobile(staffInfo.getData().getMobile());
}
// 组织机构处理
orgHandle(dto);
IcWorkLogEntity entity = ConvertUtils.sourceToTarget(dto, IcWorkLogEntity.class);
insert(entity);
// 处理附件
fileHandle(dto.getFileList(), entity.getId());
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(IcWorkLogDTO dto) {
// 组织机构处理
orgHandle(dto);
IcWorkLogEntity entity = ConvertUtils.sourceToTarget(dto, IcWorkLogEntity.class);
updateById(entity);
// 处理附件
icWorkLogFileService.deleteByLogId(entity.getId());
fileHandle(dto.getFileList(), entity.getId());
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteBatchIds(Arrays.asList(ids));
}
/**
* 附件处理
*
* @param fileList
* @param logId
* @return void
* @author zhy
* @date 2022/8/9 17:24
*/
private void fileHandle(List<IcWorkLogFileDTO> fileList, String logId) {
if (!fileList.isEmpty()) {
fileList.forEach(item -> {
item.setLogId(logId);
item.setCustomerId(loginUserUtil.getLoginUserCustomerId());
item.setFileType(NumConstant.ZERO_STR);
});
List<IcWorkLogFileEntity> fileEntityList = ConvertUtils.sourceToTarget(fileList, IcWorkLogFileEntity.class);
icWorkLogFileService.insertBatch(fileEntityList);
}
}
/**
* 组织机构处理
*
* @param dto
* @return
* @author zhy
* @date 2022/8/12 17:30
*/
private void orgHandle(IcWorkLogDTO dto) {
if (StringUtils.isNotBlank(dto.getGridId())) {
// 查询网格信息
CustomerGridFormDTO customerGridFormDTO = new CustomerGridFormDTO();
customerGridFormDTO.setGridId(dto.getGridId());
GridDetailResultDTO gridDetailResultDTO = customerGridDao.griddetail(customerGridFormDTO);
if (gridDetailResultDTO != null) {
dto.setAgencyId(gridDetailResultDTO.getAgencyId());
dto.setPids(gridDetailResultDTO.getPIds());
}
} else {
CustomerAgencyEntity agency = customerAgencyDao.getAgencyByUserId(loginUserUtil.getLoginUserId(), loginUserUtil.getLoginUserCustomerId());
if (agency != null) {
dto.setAgencyId(agency.getId());
dto.setPids(agency.getPids());
}
}
}
}

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

@ -1,20 +1,22 @@
package com.epmet.service.impl;
import cn.afterturn.easypoi.excel.entity.TemplateExportParams;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.enums.CollectUrlEnum;
import com.epmet.commons.tools.enums.OrgTypeEnum;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.HttpClientManager;
import com.epmet.commons.tools.utils.Result;
import com.epmet.constant.NeighborhoodConstant;
import com.epmet.dao.CustomerGridDao;
import com.epmet.dao.IcNeighborHoodDao;
import com.epmet.dao.IcNeighborHoodPropertyDao;
import com.epmet.dao.IcOrganizationCodeInfoDao;
import com.epmet.dao.*;
import com.epmet.dto.CustomerAgencyDTO;
import com.epmet.dto.IcNeighborHoodDTO;
import com.epmet.dto.IcNeighborHoodPropertyDTO;
@ -24,18 +26,19 @@ import com.epmet.dto.form.IcNeighborHoodListFormDTO;
import com.epmet.dto.form.IcUserBelongToChangedFormDTO;
import com.epmet.dto.result.IcNeighborHoodResultDTO;
import com.epmet.dto.result.OrganizationCommunityDTO;
import com.epmet.entity.IcHouseEntity;
import com.epmet.entity.IcNeighborHoodEntity;
import com.epmet.entity.IcNeighborHoodPropertyEntity;
import com.epmet.entity.IcOrganizationCodeInfoEntity;
import com.epmet.dto.result.UploadImgResultDTO;
import com.epmet.entity.*;
import com.epmet.enums.OrganizationTypeEnums;
import com.epmet.excel.IcNeighborHoodExcel;
import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.feign.GovOrgOpenFeignClient;
import com.epmet.feign.OssFeignClient;
import com.epmet.resi.group.dto.QRCodeMultipartFileDTO;
import com.epmet.service.IcNeighborHoodPropertyService;
import com.epmet.service.IcNeighborHoodService;
import com.epmet.service.NeighborHoodService;
import com.epmet.util.ExcelPoiUtils;
import com.epmet.utils.ThirdUtils;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import lombok.extern.slf4j.Slf4j;
@ -46,6 +49,7 @@ import org.springframework.util.StringUtils;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.nio.charset.StandardCharsets;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@ -73,6 +77,10 @@ public class NeighborHoodServiceImpl extends BaseServiceImpl<IcNeighborHoodDao,I
private IcOrganizationCodeInfoDao icOrganizationCodeInfoDao;
@Autowired
private IcOrganizationCodeInfoServiceImpl icOrganizationCodeInfoServiceImpl;
@Autowired
private OssFeignClient ossFeignClient;
@Autowired
private CustomerAgencyDao customerAgencyDao;
@Override
@ -113,6 +121,63 @@ public class NeighborHoodServiceImpl extends BaseServiceImpl<IcNeighborHoodDao,I
icNeighborHoodPropertyDTO.setPropertyId(propertyId);
icNeighborHoodPropertyService.save(icNeighborHoodPropertyDTO);
}
//生成小区码
IcNeighborHoodEntity neiEntity = new IcNeighborHoodEntity();
neiEntity.setId(entity.getId());
try {
neiEntity.setQrcodeUrl(createNeiQrcodeUrl(entity));
} catch (Exception e) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"二维码生成失败","二维码生成失败");
}
baseDao.updateById(neiEntity);
}
/**
* @describe: 生成小区二维码地址
* @author wangtong
* @date 2022/8/4 14:28
* @params [NeighborHood]
* @return java.lang.String
*/
private String createNeiQrcodeUrl(IcNeighborHoodEntity entity) throws Exception {
if (null == entity) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "小区不可为空", "小区不可为空");
}
//获取AccessToken
String accessToken = ThirdUtils.getAccessToken(entity.getCustomerId()).getResiToken();
if (org.apache.commons.lang3.StringUtils.isBlank(accessToken)) {
log.warn("获取accessToken失败,customerId:{}", entity.getCustomerId());
throw new RenException("获取accessToken失败,customerId:{}", entity.getCustomerId());
}
//跳转的页面
StringBuilder path = new StringBuilder(CollectUrlEnum.URL_PRE.getCode());
path.append("?neiId=").append(entity.getId())
.append("&agencyId=").append(entity.getAgencyId());
//需要发送的Json
JSONObject data = new JSONObject();
data.put("path", path.toString());
data.put("width", 400);
//发送
byte[] buffer = HttpClientManager.getInstance().getMediaByteArray(CollectUrlEnum.GET_CODE_URL.getCode() + accessToken, JSON.toJSONString(data)).getData();
if (buffer != null && buffer.length < 500) {
String wxResult = "";
wxResult = new String(buffer, StandardCharsets.UTF_8);
if (-1 != wxResult.indexOf("errcode")) {
log.error("获取二维码接口返回错误:{}", wxResult);
throw new RenException("获取二维码失败");
}
}
//上传
QRCodeMultipartFileDTO qrCodeMultipartFile = new QRCodeMultipartFileDTO();
qrCodeMultipartFile.setBytes(buffer);
String originalFilename = entity.getNeighborHoodName().concat(".jpg");
qrCodeMultipartFile.setOriginalFilename(originalFilename);
Result<UploadImgResultDTO> uploadResult = ossFeignClient.uploadQrCode(qrCodeMultipartFile);
if (!uploadResult.success()) {
throw new RenException("调用oss服务上传活动居民信息录入码失败");
}
return uploadResult.getData().getUrl();
}
/**
@ -271,6 +336,28 @@ public class NeighborHoodServiceImpl extends BaseServiceImpl<IcNeighborHoodDao,I
ExcelPoiUtils.exportExcel(templatePath ,map,"小区信息录入表",response);
}
@Override
public Result createBatchNeiQrUrl(String customerId) {
//查询该客户下没有二维码的小区
QueryWrapper<IcNeighborHoodEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().eq(IcNeighborHoodEntity::getCustomerId,customerId)
.eq(IcNeighborHoodEntity::getDelFlag, NumConstant.ZERO_STR);;
List<IcNeighborHoodEntity> neiList = baseDao.selectList(queryWrapper);
//保存二维码地址
neiList.forEach(nei->{
if(org.apache.commons.lang3.StringUtils.isBlank(nei.getQrcodeUrl())){
try {
nei.setQrcodeUrl(createNeiQrcodeUrl(nei));
} catch (Exception e) {
e.printStackTrace();
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"二维码生成失败<neiId>:"+nei.getId(),"二维码生成失败<neiId>:"+nei.getId());
}
}
baseDao.updateById(nei);
});
return new Result().ok("批量生成成功");
}
private List<IcNeighborHoodExcel> searchAllNeighborhood(IcHouseListFormDTO formDTO) {
IcNeighborHoodEntity neighbor = ConvertUtils.sourceToTarget(formDTO, IcNeighborHoodEntity.class);
neighbor.setDelFlag("0");

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

@ -0,0 +1,2 @@
ALTER TABLE `epmet_gov_org`.`customer_grid`
ADD COLUMN `sort` int(11) NULL COMMENT '网格排序' AFTER `MOBILE`;

1
epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.41__ic_neighbor_hood_update.sql

@ -0,0 +1 @@
alter table ic_neighbor_hood add COLUMN `QRCODE_URL` varchar(255) DEFAULT NULL COMMENT '二维码地址';

67
epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.42__add_work_log.sql

@ -0,0 +1,67 @@
/*
Navicat Premium Data Transfer
Source Server : epmet_cloud_dev_gov
Source Server Type : MySQL
Source Server Version : 50726
Source Host : 192.168.1.140:3306
Source Schema : epmet_gov_org
Target Server Type : MySQL
Target Server Version : 50726
File Encoding : 65001
Date: 09/08/2022 10:41:08
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for ic_work_log
-- ----------------------------
DROP TABLE IF EXISTS `ic_work_log`;
CREATE TABLE `ic_work_log` (
`ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '唯一标识',
`CUSTOMER_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '客户Id',
`AGENCY_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '组织Id',
`PIDS` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'agency_id的所有上级',
`GRID_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '网格Id【场所区域】',
`TITLE` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '标题',
`LOG_TYPE` char(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '日志类型【admin库sys_dict_data表value值】',
`LOG_DATE` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '日志日期',
`CONTENT` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '内容',
`REMARK` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注',
`MOBILE` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '手机',
`DEL_FLAG` int(11) NOT NULL COMMENT '删除标识:0.未删除 1.已删除',
`REVISION` int(11) NOT NULL COMMENT '乐观锁',
`CREATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '创建人',
`CREATED_TIME` datetime NOT NULL COMMENT '创建时间',
`UPDATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '更新人',
`UPDATED_TIME` datetime NOT NULL COMMENT '更新时间',
`CREATED_USER` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '创建人名称',
PRIMARY KEY (`ID`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '网格员工作日志' ROW_FORMAT = COMPACT;
-- ----------------------------
-- Table structure for ic_work_log_file
-- ----------------------------
DROP TABLE IF EXISTS `ic_work_log_file`;
CREATE TABLE `ic_work_log_file` (
`ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '唯一标识',
`CUSTOMER_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '客户Id',
`LOG_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '日志Id',
`URL` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '地址',
`FILE_NAME` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '文件名',
`FILE_TYPE` char(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '0' COMMENT '文件类型,0图片',
`SORT` int(11) NOT NULL DEFAULT 0 COMMENT '内容',
`DEL_FLAG` int(11) NOT NULL COMMENT '删除标识:0.未删除 1.已删除',
`REVISION` int(11) NOT NULL COMMENT '乐观锁',
`CREATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '创建人',
`CREATED_TIME` datetime NOT NULL COMMENT '创建时间',
`UPDATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '更新人',
`UPDATED_TIME` datetime NOT NULL COMMENT '更新时间',
PRIMARY KEY (`ID`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '网格员工作日志附件' ROW_FORMAT = COMPACT;
SET FOREIGN_KEY_CHECKS = 1;

1
epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.43__alter_work_log.sql

@ -0,0 +1 @@
ALTER TABLE epmet_gov_org.ic_work_log MODIFY COLUMN GRID_ID varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '网格Id【场所区域】';

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

Binary file not shown.

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

@ -371,6 +371,7 @@
WHERE
cg.DEL_FLAG = '0'
AND cg.PID =#{agencyId}
order by cg.sort
</select>
<select id="selectSubAgencyByPid" resultMap="treeMap">
@ -981,4 +982,18 @@
</if>
</select>
<!-- 根据人查询所在组织 -->
<select id="getAgencyByUserId" resultType="com.epmet.entity.CustomerAgencyEntity">
SELECT
a.*
FROM
customer_staff_agency sa
LEFT JOIN customer_agency a ON sa.AGENCY_ID = a.ID
WHERE
sa.del_flag = '0'
AND a.DEL_FLAG = '0'
AND sa.USER_ID = #{userId} AND sa.CUSTOMER_ID = #{customerId} AND a.CUSTOMER_ID = #{customerId}
LIMIT 1
</select>
</mapper>

24
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml

@ -196,7 +196,8 @@
`code` AS 'code',
grid_type AS 'gridType',
contacts AS 'contacts',
mobile AS 'mobile'
mobile AS 'mobile',
sort AS gridSort
FROM
customer_grid
WHERE
@ -256,6 +257,9 @@
<if test="centerAddress != null and centerAddress !=''">
CENTER_ADDRESS= #{centerAddress},
</if>
<if test="sort != null and sort != ''">
sort = #{sort},
</if>
UPDATED_TIME=NOW()
where
id = #{id}
@ -314,7 +318,7 @@
DEL_FLAG = '0'
AND ABANDON_FLAG='0'
AND PID = #{agencyId}
ORDER BY CREATED_TIME DESC
ORDER BY sort,grid_name,CREATED_TIME DESC
<if test="null != pageSize and pageSize > 0">
LIMIT #{pageSize}
</if>
@ -417,6 +421,8 @@
WHERE del_flag = '0'
and ABANDON_FLAG='0'
AND pid = #{agencyId}
order by
sort,grid_name
</select>
<select id="selectAgencyGridMsgList" resultType="com.epmet.dto.result.AgencyGridList">
@ -440,6 +446,8 @@
AND ca.del_flag = '0'
and cg.ABANDON_FLAG='0'
AND cg.pid = #{agencyId}
order by
cg.sort,cg.grid_name
</select>
<!-- 单客户-根据城市地区码前四位匹配到城市下所有网格 -->
@ -474,8 +482,10 @@
</if>
AND grid.customer_id = #{customerId}
ORDER BY
grid.customer_id,
CONVERT ( gridName USING gbk ) ASC
grid.sort,
CONVERT ( gridName USING gbk ) ASC,
grid.customer_id
LIMIT #{pageNo}, #{pageSize}
</select>
@ -488,7 +498,9 @@
SELECT
a.id AS grid_id,
a.customer_id,
concat( agency.fullname, '-', a.grid_name ) AS gridName
concat( agency.fullname, '-', a.grid_name ) AS gridName,
a.sort as sort,
agency.fullname as fullName
FROM
CUSTOMER_GRID a
LEFT JOIN (
@ -512,7 +524,7 @@
and a.ABANDON_FLAG='0'
AND a.customer_id = #{customerId}
) AS c
ORDER BY CONVERT ( gridName USING gbk ) ASC
ORDER BY fullName,c.sort,CONVERT ( gridName USING gbk ) ASC
LIMIT #{pageNo}, #{pageSize}
</select>

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

@ -541,5 +541,13 @@
and CODING=#{coding}
</select>
<select id="getHouseInfoToCollect" resultType="com.epmet.dto.result.IcHouseInfoCollectResultDTO">
select *
from ic_house
where del_flag = '0'
and BUILDING_UNIT_ID = #{buildingUnitId}
and DOOR_NAME = #{doorName}
</select>
</mapper>

118
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcWorkLogDao.xml

@ -0,0 +1,118 @@
<?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.IcWorkLogDao">
<resultMap type="com.epmet.entity.IcWorkLogEntity" id="icWorkLogMap">
<result property="id" column="ID"/>
<result property="customerId" column="CUSTOMER_ID"/>
<result property="agencyId" column="AGENCY_ID"/>
<result property="pids" column="PIDS"/>
<result property="gridId" column="GRID_ID"/>
<result property="title" column="TITLE"/>
<result property="logType" column="LOG_TYPE"/>
<result property="logDate" column="LOG_DATE"/>
<result property="content" column="CONTENT"/>
<result property="remark" column="REMARK"/>
<result property="mobile" column="MOBILE"/>
<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>
<select id="listPage" resultType="com.epmet.dto.IcWorkLogDTO">
SELECT
*
FROM
ic_work_log wl
WHERE
wl.DEL_FLAG = '0'
AND wl.CUSTOMER_ID = #{customerId}
<if test="logType != null and logType != '' ">
AND wl.LOG_TYPE = #{logType}
</if>
<if test="createdUser != null and createdUser != '' ">
AND wl.created_user = #{createdUser}
</if>
<if test="gridId != null and gridId != '' ">
AND wl.GRID_ID = #{gridId}
</if>
<if test="agencyId != null and agencyId != '' ">
AND (wl.AGENCY_ID = #{agencyId}
OR wl.PIDS LIKE concat('%',#{agencyId}, '%' ))
</if>
<if test="mobile != null and mobile != '' ">
AND wl.MOBILE = #{mobile}
</if>
<if test="isSelf != null and isSelf != ''">
<if test="isSelf == '1' or isSelf == 1">
AND wl.CREATED_BY = #{createdBy}
</if>
</if>
<if test="startTime != null and startTime != '' ">
AND DATE_FORMAT( wl.CREATED_TIME, '%Y-%m-%d' ) >= #{startTime}
</if>
<if test="endTime != null and endTime != '' ">
AND DATE_FORMAT( wl.CREATED_TIME, '%Y-%m-%d' ) &lt;= #{endTime}
</if>
ORDER BY wl.CREATED_TIME DESC
</select>
<select id="list4Export" resultType="com.epmet.dto.IcWorkLogDTO">
SELECT
wl.CREATED_USER,
wl.MOBILE,
IF
(
a.ALL_PARENT_NAME = '',
a.ORGANIZATION_NAME,
CONCAT( a.ALL_PARENT_NAME, '-', a.ORGANIZATION_NAME )) AS allAgencyName,
g.GRID_NAME,
wl.TITLE,
wl.LOG_DATE,
wl.LOG_TYPE,
wl.CONTENT,
wl.REMARK,
GROUP_CONCAT( f.URL ) AS url
FROM
ic_work_log wl
LEFT JOIN customer_grid g ON wl.GRID_ID = g.id
LEFT JOIN customer_agency a ON wl.AGENCY_ID = a.id
LEFT JOIN ic_work_log_file f ON f.LOG_ID = wl.id
WHERE
wl.DEL_FLAG = '0'
AND wl.CUSTOMER_ID = #{customerId}
<if test="logType != null and logType != '' ">
AND wl.LOG_TYPE = #{logType}
</if>
<if test="createdUser != null and createdUser != '' ">
AND wl.created_user = #{createdUser}
</if>
<if test="gridId != null and gridId != '' ">
AND wl.GRID_ID = #{gridId}
</if>
<if test="agencyId != null and agencyId != '' ">
AND (wl.AGENCY_ID = #{agencyId}
OR wl.PIDS LIKE concat('%',#{agencyId}, '%' ))
</if>
<if test="mobile != null and mobile != '' ">
AND wl.MOBILE = #{mobile}
</if>
<if test="isSelf != null and isSelf != '' and isSelf == '1' ">
AND wl.CREATED_BY = #{createdBy}
</if>
<if test="startTime != null and startTime != '' ">
AND DATE_FORMAT( wl.CREATED_TIME, '%Y-%m-%d' ) >= #{startTime}
</if>
<if test="endTime != null and endTime != '' ">
AND DATE_FORMAT( wl.CREATED_TIME, '%Y-%m-%d' ) &lt;= #{endTime}
</if>
GROUP BY
wl.id, wl.CREATED_TIME
ORDER BY wl.CREATED_TIME DESC
</select>
</mapper>

30
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcWorkLogFileDao.xml

@ -0,0 +1,30 @@
<?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.IcWorkLogFileDao">
<resultMap type="com.epmet.entity.IcWorkLogFileEntity" id="icWorkLogFileMap">
<result property="id" column="ID"/>
<result property="customerId" column="CUSTOMER_ID"/>
<result property="logId" column="LOG_ID"/>
<result property="url" column="URL"/>
<result property="fileName" column="FILE_NAME"/>
<result property="fileType" column="FILE_TYPE"/>
<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>
<delete id="deleteByLogId">
DELETE
FROM
ic_work_log_file
WHERE
LOG_ID = #{logId}
</delete>
</mapper>

5
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/IcEventListFormDTO.java

@ -84,5 +84,10 @@ public class IcEventListFormDTO implements Serializable {
* 操作类型 0:取消标记 1:标记
*/
private String type;
/**
* 事件分类 一类二类Id集合
*/
private List<String> firstIdList;
private List<String> secondIdList;
}

5
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/OrgProjectListFormDTO.java

@ -3,7 +3,6 @@ package com.epmet.dto.form;
import com.epmet.commons.tools.dto.form.PageFormDTO;
import lombok.Data;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.List;
@ -46,6 +45,10 @@ public class OrgProjectListFormDTO extends PageFormDTO implements Serializable {
* 事件状态 处理中 pending已结案 closed
*/
private String status;
/**
* 解决状态 已解决 resolved无需解决 unresolved
*/
private String closedStatus;
/**
* 起始上报时间 精确到秒
*/

2
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/TransferFormDTO.java

@ -22,7 +22,7 @@ public class TransferFormDTO implements Serializable {
@NotBlank(message = "项目人员关联Id不能为空")
private String projectStaffId;
@NotBlank(message = "公开答复不能为空")
// @NotBlank(message = "公开答复不能为空")
@Length(max=1000,message = "公开答复内容不能超过1000位")
private String publicReply;

26
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/IcEventProcessListResultDTO.java

@ -4,7 +4,6 @@ import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
/**
@ -16,6 +15,10 @@ public class IcEventProcessListResultDTO implements Serializable {
private static final long serialVersionUID = 5762152044573235897L;
/**
* 项目ID
*/
private String projectId;
/**
* 进展Id
*/
@ -39,6 +42,26 @@ public class IcEventProcessListResultDTO implements Serializable {
* 公开答复
*/
private String publicReply;
/**
* 是否发送到外部系统 0否 1是
*/
private Integer isSend;
/**
* 内部备注
*/
private String internalRemark;
/**
* 子节点
*/
private List<SubProcessDTO> subProcess;
/**
* 公开答复附件
*/
private List<PublicAndInternalFileResultDTO> publicFile;
/**
* 内部备注附件
*/
private List<PublicAndInternalFileResultDTO> internalFile;
/**
* 协办单位类型1社区自组织2联建单位
*/
@ -69,4 +92,5 @@ public class IcEventProcessListResultDTO implements Serializable {
*/
private String actualServiceTime;
}

2
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/OrgProjectListResultDTO.java

@ -98,6 +98,8 @@ public class OrgProjectListResultDTO implements Serializable {
*/
private String status;
private String statusValue;
private String closedStatus;
private String closedStatusValue;
/**
* 是否需要自己处理 true:需要 false:不需要
*/

4
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/excel/IcEventExcel.java

@ -20,6 +20,10 @@ public class IcEventExcel {
@ColumnWidth(20)
private String gridName;
@ExcelProperty(value = "事件分类")
@ColumnWidth(25)
private String categoryName;
@ExcelProperty(value = "事件内容")
@ColumnWidth(25)
private String eventContent;

7
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/excel/OrgProjectListExcel.java

@ -1,12 +1,9 @@
package com.epmet.excel;
import cn.afterturn.easypoi.excel.annotation.ExcelCollection;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import lombok.Data;
import java.util.List;
/**
* 事件管理表
*
@ -122,5 +119,9 @@ public class OrgProjectListExcel {
@ColumnWidth(20)
private String status;
@ExcelProperty(value = "解决状态")
@ColumnWidth(20)
private String closedStatus;
}

17
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/IcEventServiceImpl.java

@ -125,6 +125,15 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
Result<Map<String, String>> statusRes = adminOpenFeignClient.dictMap(DictTypeEnum.IC_EVENT_SOURCE_TYPE.getCode());
Map<String, String> statusMap = statusRes.success() && MapUtils.isNotEmpty(statusRes.getData()) ? statusRes.getData() : new HashMap<>();
//查询分类信息
IssueProjectCategoryDictListFormDTO dictFormDto = new IssueProjectCategoryDictListFormDTO();
dictFormDto.setCustomerId(formDTO.getCustomerId());
Result<List<IssueProjectCategoryDictDTO>> categoryRes = govIssueOpenFeignClient.getCategoryList(dictFormDto);
if (!categoryRes.success() || org.springframework.util.CollectionUtils.isEmpty(categoryRes.getData())) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取项目分类名称异常");
}
Map<String, IssueProjectCategoryDictDTO> categoryMap = categoryRes.getData().stream().collect(Collectors.toMap(IssueProjectCategoryDictDTO::getId, o -> o, (o1, o2) -> o1));
//封装数据
for (IcEventListResultDTO dto : list) {
if (gridInfoMap.containsKey(dto.getGridId())) {
@ -133,6 +142,14 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
if (StringUtils.isNotBlank(dto.getSourceType())) {
dto.setSourceTypeName(statusMap.get(dto.getSourceType()));
}
if (categoryMap.containsKey(dto.getCategoryId())) {
IssueProjectCategoryDictDTO category = categoryMap.get(dto.getCategoryId());
if (StringUtils.isNotBlank(category.getParentCategoryName())) {
dto.setCategoryName(category.getParentCategoryName().concat(StrConstant.HYPHEN).concat(category.getCategoryName()));
} else {
dto.setCategoryName(category.getCategoryName());
}
}
//每个事件对应的图片数据
if(!CollectionUtils.isEmpty(dto.getAttachmentList())){
List<String> imageList = new ArrayList<>();

18
epmet-module/gov-project/gov-project-server/src/main/resources/mapper/IcEventDao.xml

@ -218,6 +218,24 @@
<if test="status != null and status != '' ">
AND ie.`status` = #{status}
</if>
<if test="(firstIdList != null and firstIdList.size() > 0) and (secondIdList == null or secondIdList.size() == 0)"><!-- 一类查询条件 -->
<foreach collection="firstIdList" item="firstId" open="AND iec.CATEGORY_PIDS IN (" separator="," close=")">
#{firstId}
</foreach>
</if>
<if test="(secondIdList != null and secondIdList.size() > 0) and (firstIdList == null or firstIdList.size() == 0)"><!-- 二类查询条件 -->
<foreach collection="secondIdList" item="secondId" open="AND iec.CATEGORY_ID IN (" separator="," close=")">
#{secondId}
</foreach>
</if>
<if test="(secondIdList != null and secondIdList.size() > 0) and (firstIdList != null and firstIdList.size() > 0)"><!-- 二类查询条件 -->
<foreach collection="firstIdList" item="firstId" open="AND (iec.CATEGORY_PIDS IN (" separator="," close=")">
#{firstId}
</foreach>
<foreach collection="secondIdList" item="secondId" open="OR iec.CATEGORY_ID IN (" separator="," close="))">
#{secondId}
</foreach>
</if>
order by ie.created_time desc, ie.latest_operated_time desc
</select>

17
epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectDao.xml

@ -655,6 +655,8 @@
p.back_ground,
( CASE WHEN p.`STATUS` = 'pending' THEN '处理中' WHEN p.`STATUS` = 'closed' THEN '已结案' ELSE '' END ) AS status,
p.`status` AS statusValue,
( CASE WHEN p.CLOSED_STATUS = 'resolved' THEN '已解决' WHEN p.CLOSED_STATUS = 'unresolved' THEN '无需解决' ELSE '' END ) AS closedStatus,
p.CLOSED_STATUS AS closedStatusValue,
pc.category_pids,
pc.category_id,
pp.public_reply,
@ -671,16 +673,24 @@
group by project_id
ORDER BY created_time desc
)pc ON p.id = pc.project_id
<if test="firstIdList != null and firstIdList.size() > 0"><!-- 一类查询条件 -->
<if test="(firstIdList != null and firstIdList.size() > 0) and (secondIdList == null or secondIdList.size() == 0)"><!-- 一类查询条件 -->
<foreach collection="firstIdList" item="firstId" open="AND pc.category_pids IN (" separator="," close=")">
#{firstId}
</foreach>
</if>
<if test="secondIdList != null and secondIdList.size() > 0"><!-- 二类查询条件 -->
<if test="(secondIdList != null and secondIdList.size() > 0) and (firstIdList == null or firstIdList.size() == 0)"><!-- 二类查询条件 -->
<foreach collection="secondIdList" item="secondId" open="AND pc.category_id IN (" separator="," close=")">
#{secondId}
</foreach>
</if>
<if test="(secondIdList != null and secondIdList.size() > 0) and (firstIdList != null and firstIdList.size() > 0)"><!-- 二类查询条件 -->
<foreach collection="firstIdList" item="firstId" open="AND (pc.CATEGORY_PIDS IN (" separator="," close=")">
#{firstId}
</foreach>
<foreach collection="secondIdList" item="secondId" open="OR pc.CATEGORY_ID IN (" separator="," close="))">
#{secondId}
</foreach>
</if>
LEFT JOIN project_process pp ON p.id = pp.project_id AND pp.operation = 'close'
INNER JOIN project_process ppc ON p.id = ppc.project_id AND ppc.operation = 'created'
<if test="staffName != null and staffName != ''"><!-- 上报人姓名对应查询条件,上报人就是对应的创建节点的人 -->
@ -722,6 +732,9 @@
<if test="null != endTime and endTime != '' ">
AND p.created_time <![CDATA[ <= ]]> #{endTime}
</if>
<if test="closedStatus != null and closedStatus != ''">
AND p.CLOSED_STATUS = #{closedStatus}
</if>
</select>
<select id="getIndexExplainTreeByPid" resultType="com.epmet.dto.form.FileDTO"><!-- 项目创建节点的图片附件 -->
SELECT

27
epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/IcFormDataAnalysisDTO.java

@ -0,0 +1,27 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Description
* @Author yzm
* @Date 2022/8/11 13:35
*/
@Data
public class IcFormDataAnalysisDTO implements Serializable {
private String itemId;
private String label;
/**
* 分组ID,'默认0'
*/
private String itemGroupId;
private String tableName;
/**
* 列名
*/
private String columnName;
private Integer sort;
}

2
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/IcFormItemDao.java

@ -97,4 +97,6 @@ public interface IcFormItemDao extends BaseDao<IcFormItemEntity> {
*/
List<FormItemBaseResult> getItemListByGroupId(@Param("customerId") String customerId, @Param("groupId") String groupId);
List<FormItemBaseResult> getItemListByGroupIdV2(@Param("customerId") String customerId, @Param("groupId") String groupId,@Param("policyFlag")String policyFlag);
List<IcFormDataAnalysisDTO> selectDataAnalysisItem(String customerId);
}

79
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/ResiCategoryStatsConfigServiceImpl.java

@ -1,20 +1,15 @@
package com.epmet.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.constant.IcResiCategoryStatsConfigConstant;
import com.epmet.dao.IcFormItemDao;
import com.epmet.dao.IcFormItemGroupDao;
import com.epmet.dao.IcResiCategoryStatsConfigDao;
import com.epmet.dao.IcResiCategoryWarnConfigDao;
import com.epmet.dto.IcResiCategoryStatsConfigDTO;
import com.epmet.dto.form.IcResiCategoryStatsConfigFormDTO;
import com.epmet.dto.form.IcResiCategoryStatsConfigSortFormDTO;
import com.epmet.dto.form.ResiCategoryStatsConfigListFormDTO;
import com.epmet.dto.result.IcFormDataAnalysisDTO;
import com.epmet.dto.result.IcResiCategoryStatsConfigResultDTO;
import com.epmet.entity.IcFormItemEntity;
import com.epmet.entity.IcFormItemGroupEntity;
import com.epmet.entity.IcResiCategoryStatsConfigEntity;
import com.epmet.entity.IcResiCategoryWarnConfigEntity;
import com.epmet.service.IcResiCategoryStatsConfigService;
@ -28,7 +23,10 @@ import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import javax.annotation.Resource;
import java.util.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@Slf4j
@ -40,8 +38,6 @@ public class ResiCategoryStatsConfigServiceImpl implements ResiCategoryStatsConf
@Resource
private IcFormItemDao icFormItemDao;
@Resource
private IcFormItemGroupDao icFormItemGroupDao;
@Resource
private IcResiCategoryStatsConfigDao icResiCategoryStatsConfigDao;
@Resource
private IcResiCategoryWarnConfigDao icResiCategoryWarnConfigDao;
@ -52,60 +48,39 @@ public class ResiCategoryStatsConfigServiceImpl implements ResiCategoryStatsConf
@Transactional(rollbackFor = Exception.class)
public List<IcResiCategoryStatsConfigResultDTO> list(String customerId, ResiCategoryStatsConfigListFormDTO formDTO) {
//1.获取IC_FORM_ITEM 中 用于数据分析字段的 id 和label
List<IcFormItemEntity> icFormItemEntityList = icFormItemDao.selectList(new QueryWrapper<IcFormItemEntity>().lambda().eq(IcFormItemEntity::getCustomerId,customerId).eq(IcFormItemEntity::getDataAnalyse, 1));
if(CollectionUtils.isEmpty(icFormItemEntityList)){
return new ArrayList<>();
}
Set<String> groupIds = icFormItemEntityList.stream().filter(item-> !"0".equals(item.getItemGroupId())).map(IcFormItemEntity::getItemGroupId).collect(Collectors.toSet());
List<IcFormItemGroupEntity> icFormItemGroupEntityList = new ArrayList<>();
if(!CollectionUtils.isEmpty(groupIds)){
icFormItemGroupEntityList.addAll(icFormItemGroupDao.selectList(new QueryWrapper<IcFormItemGroupEntity>().lambda().eq(IcFormItemGroupEntity::getCustomerId,customerId).in(IcFormItemGroupEntity::getId, groupIds)));
}
//获取tableName和COLUMN_NAME
Map<String,IcFormItemEntity> tableColumnMap = new HashMap<>();
List<IcFormDataAnalysisDTO> dataItemList=icFormItemDao.selectDataAnalysisItem(customerId);
//key:tableName-columnName value: ic_form_item
Map<String,IcFormDataAnalysisDTO> tableColumnMap = new HashMap<>();
//key:ic_form_item.id value:对应的表名
Map<String,String> idTableMap = new HashMap<>();
icFormItemEntityList.forEach(item->{
Map<String,String> map = new HashMap<>();
item.setColumnName(item.getColumnName().concat(NumConstant.ZERO == item.getColumnNum() ? StrConstant.EPMETY_STR : item.getColumnNum().toString()));
if("0".equals(item.getItemGroupId())){
tableColumnMap.put(IcResiCategoryStatsConfigConstant.IC_RESI_USER+"-"+item.getColumnName(),item);
idTableMap.put(item.getId(),IcResiCategoryStatsConfigConstant.IC_RESI_USER);
}else{
List<IcFormItemGroupEntity> collect = icFormItemGroupEntityList.stream().filter(i -> item.getItemGroupId().equals(i.getId())).collect(Collectors.toList());
tableColumnMap.put(CollectionUtils.isEmpty(collect)?IcResiCategoryStatsConfigConstant.IC_RESI_USER:collect.get(0).getTableName()+"-"+item.getColumnName(),item);
idTableMap.put(item.getId(),CollectionUtils.isEmpty(collect)?IcResiCategoryStatsConfigConstant.IC_RESI_USER:collect.get(0).getTableName());
}
dataItemList.forEach(item->{
tableColumnMap.put(item.getTableName()+"-"+item.getColumnName(),item);
idTableMap.put(item.getItemId(),item.getTableName());
});
//2.获取ic_resi_category_stats_config 和 ic_resi_category_warn_config 表中的数据
//2.获取居民类别配置表ic_resi_category_stats_config 和 居民类别预警配置表ic_resi_category_warn_config 表中的数据
List<IcResiCategoryStatsConfigEntity> statsConfigEntityList = icResiCategoryStatsConfigDao.selectList(new QueryWrapper<IcResiCategoryStatsConfigEntity>().lambda().eq(IcResiCategoryStatsConfigEntity::getCustomerId,customerId));
if (!CollectionUtils.isEmpty(statsConfigEntityList)){
return icResiCategoryStatsConfigDao.listInfo(customerId,formDTO.getIsWarn(),formDTO.getLevel());
}
List<IcResiCategoryWarnConfigEntity> warnConfigEntityList = icResiCategoryWarnConfigDao.selectList(new QueryWrapper<IcResiCategoryWarnConfigEntity>().lambda().eq(IcResiCategoryWarnConfigEntity::getCustomerId,customerId));
//3.新增不存在的,删除不在tableColumnMap的
//获取居民类别配置表
Map<String,IcResiCategoryStatsConfigEntity> statsTableColumnMap = new HashMap<>();
statsConfigEntityList.forEach(item->{
statsTableColumnMap.put(item.getTableName()+"-"+item.getColumnName(),item);
});
Map<String,IcResiCategoryWarnConfigEntity> warnTableColumnMap = new HashMap<>();
warnConfigEntityList.forEach(item->{
warnTableColumnMap.put(item.getTableName()+"-"+item.getColumnName(),item);
});
//3.新增不存在的,删除不在tableColumnMap的
//差集
//新增
List<String> newStatsList = tableColumnMap.keySet().stream().filter(item -> !statsTableColumnMap.containsKey(item)).collect(Collectors.toList());
List<IcResiCategoryStatsConfigEntity> newStatsEntityList = new ArrayList<>();
newStatsList.forEach(item->{
IcFormItemEntity icFormItemEntity = tableColumnMap.get(item);
IcFormDataAnalysisDTO icFormItemEntity = tableColumnMap.get(item);
IcResiCategoryStatsConfigEntity entity = new IcResiCategoryStatsConfigEntity();
entity.setCustomerId(customerId);
entity.setLabel(icFormItemEntity.getLabel());
entity.setTableName(idTableMap.get(icFormItemEntity.getId()));
entity.setTableName(idTableMap.get(icFormItemEntity.getItemId()));
entity.setColumnName(icFormItemEntity.getColumnName());
entity.setManagementIcon("");
entity.setDataIcon("");
@ -115,16 +90,24 @@ public class ResiCategoryStatsConfigServiceImpl implements ResiCategoryStatsConf
newStatsEntityList.add(entity);
});
if(!CollectionUtils.isEmpty(newStatsEntityList)){
//新增居民类别配置表
icResiCategoryStatsConfigService.insertBatch(newStatsEntityList);
}
//4、新增居民类别预警配置表
Map<String,IcResiCategoryWarnConfigEntity> warnTableColumnMap = new HashMap<>();
warnConfigEntityList.forEach(item->{
warnTableColumnMap.put(item.getTableName()+"-"+item.getColumnName(),item);
});
List<String> newWarnList = tableColumnMap.keySet().stream().filter(item -> !warnTableColumnMap.containsKey(item)).collect(Collectors.toList());
List<IcResiCategoryWarnConfigEntity> newWarnEntityList = new ArrayList<>();
newWarnList.forEach(item->{
IcFormItemEntity icFormItemEntity = tableColumnMap.get(item);
IcFormDataAnalysisDTO icFormItemEntity = tableColumnMap.get(item);
IcResiCategoryWarnConfigEntity entity = new IcResiCategoryWarnConfigEntity();
entity.setCustomerId(customerId);
entity.setLabel(icFormItemEntity.getLabel());
entity.setTableName(idTableMap.get(icFormItemEntity.getId()));
entity.setTableName(idTableMap.get(icFormItemEntity.getItemId()));
entity.setColumnName(icFormItemEntity.getColumnName());
entity.setWarn("0");
entity.setSort(icFormItemEntity.getSort());
@ -133,6 +116,8 @@ public class ResiCategoryStatsConfigServiceImpl implements ResiCategoryStatsConf
if(!CollectionUtils.isEmpty(newWarnEntityList)){
icResiCategoryWarnConfigService.insertBatch(newWarnEntityList);
}
//5、原来用于数据分析,现在不用于数据分析的,要删除类别配置表和预警表
List<String> delStatsEntityIdList = new ArrayList<>();
List<String> delWarnEntityIdList = new ArrayList<>();
//需要删除的
@ -151,7 +136,7 @@ public class ResiCategoryStatsConfigServiceImpl implements ResiCategoryStatsConf
icResiCategoryWarnConfigService.deleteBatchIds(delWarnEntityIdList);
}
//4.返回数据
//6.返回数据
return icResiCategoryStatsConfigDao.listInfo(customerId,formDTO.getIsWarn(),formDTO.getLevel());
}

19
epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcFormItemDao.xml

@ -322,4 +322,23 @@
ORDER BY ifi.SORT
</select>
<select id="selectDataAnalysisItem" parameterType="java.lang.String" resultType="com.epmet.dto.result.IcFormDataAnalysisDTO">
SELECT
i.id,
i.LABEL,
i.COLUMN_NAME,
i.SORT,
i.ITEM_GROUP_ID,
g.TABLE_NAME
FROM
ic_form_item i
LEFT JOIN ic_form_item_group g ON ( i.ITEM_GROUP_ID = g.ID )
WHERE
i.DEL_FLAG = '0'
AND i.CUSTOMER_ID = #{customerId}
AND g.CUSTOMER_ID = #{customerId}
AND i.DATA_ANALYSE = '1'
ORDER BY
i.SORT ASC
</select>
</mapper>

144
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcResiCollectVisitorDTO.java

@ -0,0 +1,144 @@
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 2022-08-02
*/
@Data
public class IcResiCollectVisitorDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private String id;
/**
* 目的地
*/
private String address;
/**
* 客户Id customer.id
*/
private String customerId;
/**
* 网格ID
*/
private String gridId;
/**
* 组织Id
*/
private String agencyId;
/**
* 组织的pids
*/
private String pids;
/**
* 所属小区ID
*/
private String villageId;
/**
* 所属小区名称
*/
private String villageName;
/**
* 所属楼宇Id
*/
private String buildId;
/**
* 所属楼宇名称
*/
private String buildName;
/**
* 单元id
*/
private String unitId;
/**
* 单元名
*/
private String unitName;
/**
* 所属家庭Id
*/
private String homeId;
/**
* 房间名
*/
private String homeName;
/**
* 姓名
*/
private String name;
/**
* 手机号
*/
private String mobile;
/**
* 身份证号
*/
private String idCard;
/**
* 来访事由
*/
private String comeReason;
/**
* 人脸照片
*/
private String faceImg;
/**
* 删除标识 0.未删除 1.已删除
*/
private Integer delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

15
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcResiUserDTO.java

@ -219,6 +219,21 @@ public class IcResiUserDTO implements Serializable {
*/
private String isSpecial;
/**
* 是否租户:1 :0
*/
private String isTenant;
/**
* 是否是流动人口:1 :0
*/
private String isFloating;
/**
* 是否新阶层人士:1 :0
*/
private String isXjc;
/**
* 文化程度字典表
*/

122
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/SaveCollectVisitorFormDTO.java

@ -0,0 +1,122 @@
package com.epmet.dto;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* 居民信息采集-访客
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-08-02
*/
@Data
public class SaveCollectVisitorFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 客户Id customer.id
*/
private String customerId;
/**
* 网格ID
*/
private String gridId;
/**
* 组织Id
*/
private String agencyId;
/**
* 组织的pids
*/
private String pids;
/**
* 所属小区ID
*/
@NotBlank(message = "小区ID不能为空")
private String villageId;
/**
* 所属小区名称
*/
@NotBlank(message = "小区名称不能为空")
private String villageName;
/**
* 所属楼宇Id
*/
@NotBlank(message = "楼宇Id不能为空")
private String buildId;
/**
* 所属楼宇名称
*/
@NotBlank(message = "楼宇名称不能为空")
private String buildName;
/**
* 单元id
*/
@NotBlank(message = "单元id不能为空")
private String unitId;
/**
* 单元名
*/
@NotBlank(message = "单元名不能为空")
private String unitName;
/**
* 所属家庭Id
*/
@NotBlank(message = "家庭Id不能为空")
private String homeId;
/**
* 房间名
*/
@NotBlank(message = "房间名不能为空")
private String homeName;
/**
* 详细地址
*/
@NotBlank(message = "家庭地址不能为空")
private String address;
/**
* 姓名
*/
@NotBlank(message = "姓名不能为空")
private String name;
/**
* 手机号
*/
@NotBlank(message = "手机号不能为空")
private String mobile;
/**
* 身份证号
*/
private String idCard;
/**
* 来访事由
*/
private String comeReason;
/**
* 人脸照片
*/
private String faceImg;
}

20
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CollectDetailFormDTO.java

@ -0,0 +1,20 @@
package com.epmet.dto.form;
import com.epmet.commons.tools.dto.form.PageFormDTO;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @program: epmet-cloud
* @description:
* @author: wangtong
* @create: 2022-08-03 14:15
**/
@Data
public class CollectDetailFormDTO extends PageFormDTO implements Serializable {
@NotBlank(message = "id不可为空")
private String id;
}

76
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CollectDetailResultDTO.java

@ -0,0 +1,76 @@
package com.epmet.dto.form;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* 收集居民信息入参
*/
@Data
public class CollectDetailResultDTO implements Serializable {
private String id;
/**
* 组织Id
*/
private String agencyId;
/**
* 所属小区ID
*/
private String villageId;
private String villageName;
/**
* 所属楼宇Id
*/
private String buildId;
private String buildName;
/**
* 单元id
*/
private String unitId;
private String unitName;
/**
* 所属家庭Id
*/
private String homeId;
private String homeName;
/**
* 详细地址
*/
private String address;
/**
* 房屋状态
*/
private String houseType;
/**
* 户主姓名
*/
private String houseHolderName;
/**
* 居住成员人数
*/
private Integer totalResi;
/**
* 审核状态0待审核 1未通过 2已通过
*/
private String checkState;
/**
* 审核原因
*/
private String checkReason;
private List<IcResiCollectMemDetailDTO> memberList;
}

20
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CollectPageFormDTO.java

@ -0,0 +1,20 @@
package com.epmet.dto.form;
import com.epmet.commons.tools.dto.form.PageFormDTO;
import lombok.Data;
import java.io.Serializable;
/**
* @program: epmet-cloud
* @description:
* @author: wangtong
* @create: 2022-08-03 14:15
**/
@Data
public class CollectPageFormDTO extends PageFormDTO implements Serializable {
private String customerId;
private String userId;
}

65
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiCollectCheckFormDTO.java

@ -0,0 +1,65 @@
package com.epmet.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.Date;
/**
* 居民信息采集-审核入参
*
* @author wgf
* @since v1.0.0 2022-08-02
*/
@Data
public class IcResiCollectCheckFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
@NotBlank(message = "Id不能为空")
private String id;
/**
* 审核状态0待审核 1未通过 2已通过
*/
@NotBlank(message = "审核状态不能为空")
private String checkState;
/**
* 审核原因
*/
private String checkReason;
/**
* 单元号
*/
private String buildingUnitId;
/**
* 房间号
*/
private String doorName;
/**
* 客户ID(审核人)
*/
private String customerId;
/**
* 员工ID(审核人)
*/
private String userId;
/**
* 员工姓名(审核人)
*/
private String realName;
}

28
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiCollectGetDetailFormDTO.java

@ -0,0 +1,28 @@
package com.epmet.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* 居民信息采集-获取房屋信息
*
* @author wgf
* @since v1.0.0 2022-08-02
*/
@Data
public class IcResiCollectGetDetailFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
@NotBlank(message = "Id不能为空")
private String id;
}

93
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiCollectMemDetailDTO.java

@ -0,0 +1,93 @@
package com.epmet.dto.form;
import lombok.Data;
import java.io.Serializable;
/**
* 家庭成员信息
* 前端做校验
*/
@Data
public class IcResiCollectMemDetailDTO implements Serializable {
/**
* 居住成员1姓名
*/
// @NotBlank(message = "姓名不能为空", groups = {ResiCollectFormDTO.InternalShowGroup.class, IcResiCollectFormDTO.ExternalShowGroup.class})
private String name;
/**
* 居住成员1身份证号
*/
// @NotBlank(message = "身份证号不能为空", groups = {ResiCollectFormDTO.InternalShowGroup.class, IcResiCollectFormDTO.ExternalShowGroup.class})
private String idNum;
/**
* 居住成员1手机号
*/
// @NotBlank(message = "手机号不能为空", groups = {IcResiCollectFormDTO.InternalShowGroup.class, IcResiCollectFormDTO.ExternalShowGroup.class})
private String mobile;
/**
* 居住成员1是否参加几轮全员核算检测数字1-10
*/
// @NotBlank(message = "核算检测情况不能为空", groups = {IcResiCollectFormDTO.InternalShowGroup.class, IcResiCollectFormDTO.ExternalShowGroup.class})
private String heSuanCount;
/**
* 居住成员1新冠疫苗接种情况;1:已全程接种2未全程接种0未接种
*/
// @NotNull(message = "疫苗接种情况不能为空", groups = {IcResiCollectFormDTO.InternalShowGroup.class, IcResiCollectFormDTO.ExternalShowGroup.class})
private Integer ymjz;
/**
* 户籍所在地
*/
private String domicilePlace;
/**
* 户籍所在地行政地区编码
*/
private String domicilePlaceCode;
/**
* 户籍所在地行政地区编码全路径包含自己,英文逗号隔开例如37,3702,370203
*/
private String domicilePlaceCodePath;
/**
* 学校或公司
*/
private String workPlace;
/**
* 备注
*/
private String remark;
/**
* 社区居民信息登记-查询返参用
*/
private String id;
/**
* 与房主关系
*/
private String relationship;
/**
* 人脸头像
*/
private String faceImg;
/**
* 是否是党员
*/
private String isParty;
/**
* 客户ID
*/
private String customerId;
}

11
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiCollectMemFormDTO.java

@ -73,4 +73,15 @@ public class IcResiCollectMemFormDTO implements Serializable {
* 社区居民信息登记-查询返参用
*/
private String id;
/**
* 与房主关系
*/
private String relationship;
/**
* 人脸头像
*/
private String faceImg;
}

105
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/SaveCollectFormDTO.java

@ -0,0 +1,105 @@
package com.epmet.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.List;
/**
* 收集居民信息入参
*/
@Data
public class SaveCollectFormDTO implements Serializable {
/**
* id
*/
private String id;
/**
* 客户Id customer.id
*/
private String customerId;
/**
* 内部internal外部external
*/
private String origin;
/**
* 网格ID_后端接口赋值
*/
private String gridId;
/**
* 组织Id_后端接口赋值
*/
private String agencyId;
/**
* 组织的pid_后端接口赋值
*/
private String pids;
/**
* 所属小区ID
*/
@NotBlank(message = "小区不能为空")
private String villageId;
@NotBlank(message = "小区名不能为空")
private String villageName;
/**
* 所属楼宇Id
*/
@NotBlank(message = "楼栋不能为空")
private String buildId;
@NotBlank(message = "楼栋名不能为空")
private String buildName;
/**
* 单元id
*/
@NotBlank(message = "单元不能为空")
private String unitId;
@NotBlank(message = "单元名不能为空")
private String unitName;
/**
* 所属家庭Id
*/
private String homeId;
@NotBlank(message = "家庭名不能为空")
private String homeName;
/**
* 详细地址
*/
@NotBlank(message = "家庭地址不能为空")
private String address;
/**
* 1自有0租住
*/
@NotBlank(message = "房子属于自有还是租住?")
private String houseType;
/**
* 户主姓名
*/
@NotBlank(message = "户主姓名不能为空")
private String houseHolderName;
/**
* 居住成员人数
*/
@NotNull(message = "居住成员人数不能为空")
private Integer totalResi;
@NotEmpty(message = "成员信息不能为空")
private List<IcResiCollectMemFormDTO> memberList;
}

26
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/VisitListFormDTO.java

@ -0,0 +1,26 @@
package com.epmet.dto.form;
import com.epmet.commons.tools.dto.form.PageFormDTO;
import lombok.Data;
/**
* @Author wgf
* @DateTime 2022/8/5 8:00
* @DESC
*/
@Data
public class VisitListFormDTO extends PageFormDTO {
private static final long serialVersionUID = 2106773724057183577L;
private String startTime;
private String endTime;
private String userId;
private String customerId;
private String orgId;
}

57
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CollectHouseInfoResultDTO.java

@ -0,0 +1,57 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* @Author wgf
* @DateTime 2022/3/18 19:00
* @DESC
*/
@Data
public class CollectHouseInfoResultDTO implements Serializable {
private static final long serialVersionUID = -6692672375850864451L;
/**
* label
*/
private String label;
/**
* 所属小区id
*/
private String neighborHoodId;
/**
* 所属小区姓名
*/
private String neighborHoodName;
/**
* 所属楼栋id
*/
private String buildingId;
/**
* 所属楼栋名称
*/
private String buildName;
/**
* 所属单元id
*/
private String buildingUnitId;
/**
* 所属单元名称
*/
private String buildingUnitName;
/**
* 门牌号
*/
private String doorName;
/**
* 房主姓名
*/
private String ownerName;
}

2
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CollectListMemberExcelResultDTO.java

@ -54,7 +54,7 @@ public class CollectListMemberExcelResultDTO implements Serializable {
/**
* 学校或公司
*/
@Excel(name = "单位或学校", width = 60)
@Excel(name = "单位名称", width = 60)
private String workPlace;
/**

23
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CollectListResultDTO.java

@ -24,6 +24,9 @@ public class CollectListResultDTO implements Serializable {
// @JsonIgnore
private String id;
// 组织Id
private String agencyId;
/**
* 居住地址
*/
@ -39,6 +42,16 @@ public class CollectListResultDTO implements Serializable {
*/
private Integer totalResi;
/**
* 所属家庭Id
*/
private String homeId;
/**
* 审核状态0待审核 1审核不通过 2审核通过
*/
private String checkState;
private String domicilePlace;
private List<CollectListMemberResultDTO> list;
@ -95,5 +108,15 @@ public class CollectListResultDTO implements Serializable {
* 备注
*/
private String remark;
/**
* 与户主关系
*/
private String relationship;
/**
* 人脸照片
*/
private String faceImg;
}
}

56
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CollectPageListDTO.java

@ -0,0 +1,56 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2022/3/18 19:00
* @DESC
*/
@Data
public class CollectPageListDTO implements Serializable {
private static final long serialVersionUID = -6692672375850864451L;
private String id;
/**
* 居住地址
*/
private String address;
/**
* 居民resi 访客visitor
*/
private String type;
/**
* 居民登记/访客登记
*/
private String title;
/**
* 审核状态0待审核 1审核不通过 2审核通过
*/
private String checkState;
/**
* 审核状态名称
*/
private String checkStateName;
/**
* 审核原因
*/
private String checkReason;
/**
* 提交时间
*/
private String createTime;
}

82
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiCollectController.java

@ -10,14 +10,8 @@ import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.ExcelUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dto.form.CollectListFormDTO;
import com.epmet.dto.form.IcResiCollectFormDTO;
import com.epmet.dto.form.LatestSubmitCollectFormDTO;
import com.epmet.dto.form.ResiCollectFormDTO;
import com.epmet.dto.result.CollectListExcelResultDTO;
import com.epmet.dto.result.CollectListMemberExcelResultDTO;
import com.epmet.dto.result.CollectListResultDTO;
import com.epmet.dto.result.LatestCollectResDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
import com.epmet.service.IcResiCollectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
@ -156,4 +150,76 @@ public class IcResiCollectController {
ValidatorUtils.validateEntity(formDTO,LatestSubmitCollectFormDTO.AddUserInternalGroup.class);
return new Result<LatestCollectResDTO>().ok(icResiCollectService.latestSubmit(formDTO));
}
/**
* 信息采集-审核
* @param formDTO
* @param tokenDto
* @return
*/
@PostMapping("collectCheck")
public Result collectCheck(@RequestBody IcResiCollectCheckFormDTO formDTO, @LoginUser TokenDto tokenDto) {
formDTO.setUserId(tokenDto.getUserId());
formDTO.setCustomerId(tokenDto.getCustomerId());
icResiCollectService.collectCheck(formDTO,tokenDto);
return new Result();
}
/**
* @describe: 扫描社区/小区二维码进行居民信息登记
* @author wangtong
* @date 2022/8/2 16:01
* @params [formDTO]
* @return com.epmet.commons.tools.utils.Result
*/
@NoRepeatSubmit
@PostMapping("saveCollectInfo")
public Result saveCollectInfo(@RequestBody SaveCollectFormDTO formDTO) {
//效验数据
ValidatorUtils.validateEntity(formDTO);
formDTO.setOrigin("internal");//固定为内部
return icResiCollectService.saveCollectInfo(formDTO);
}
/**
* @describe: 我的登记列表
* @author wangtong
* @date 2022/8/3 13:59
* @params [dto]
* @return com.epmet.commons.tools.utils.Result<com.epmet.commons.tools.page.PageData<com.epmet.dto.result.CollectPageListDTO>>
*/
@PostMapping("getCollectPage")
public Result<PageData<CollectPageListDTO>> getCollectPage(@LoginUser TokenDto tokenDto,@RequestBody CollectPageFormDTO dto) {
dto.setUserId(tokenDto.getUserId());
dto.setCustomerId(tokenDto.getCustomerId());
PageData<CollectPageListDTO> page = icResiCollectService.getCollectPage(dto);
return new Result<PageData<CollectPageListDTO>>().ok(page);
}
/**
* 信息采集-审核通过-新增房屋-复显房屋信息
* @param formDTO
* @param tokenDto
* @return
*/
@PostMapping("getHouseDetailByCollect")
public Result<CollectHouseInfoResultDTO> getHouseDetailByCollect(@RequestBody IcResiCollectGetDetailFormDTO formDTO, @LoginUser TokenDto tokenDto) {
return new Result<CollectHouseInfoResultDTO>().ok(icResiCollectService.getHouseDetailByCollect(formDTO));
}
/**
* @describe: 查看居民采集信息详情
* @author wangtong
* @date 2022/8/3 15:05
* @params [dto]
* @return com.epmet.commons.tools.utils.Result
*/
@PostMapping("getCollectDetail")
public Result getCollectDetail(@RequestBody CollectDetailFormDTO dto) {
ValidatorUtils.validateEntity(dto);
return icResiCollectService.getCollectDetail(dto);
}
}

137
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiCollectVisitorController.java

@ -0,0 +1,137 @@
package com.epmet.controller;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.annotation.MaskResponse;
import com.epmet.commons.tools.aop.NoRepeatSubmit;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ExcelUtils;
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.IcResiCollectVisitorDTO;
import com.epmet.dto.SaveCollectVisitorFormDTO;
import com.epmet.dto.form.CollectDetailFormDTO;
import com.epmet.dto.form.CollectListFormDTO;
import com.epmet.dto.form.VisitListFormDTO;
import com.epmet.dto.result.CollectListResultDTO;
import com.epmet.excel.IcResiCollectVisitorExcel;
import com.epmet.service.IcResiCollectVisitorService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
/**
* 居民信息采集-访客
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-08-02
*/
@RestController
@RequestMapping("icResiCollectVisitor")
public class IcResiCollectVisitorController {
@Autowired
private IcResiCollectVisitorService icResiCollectVisitorService;
@RequestMapping("page")
public Result<PageData<IcResiCollectVisitorDTO>> page(@RequestParam Map<String, Object> params){
// PageData<IcResiCollectVisitorDTO> page = icResiCollectVisitorService.page(params);
PageData<IcResiCollectVisitorDTO> page = icResiCollectVisitorService.getPhrasePage(params);
return new Result<PageData<IcResiCollectVisitorDTO>>().ok(page);
}
/**
* Desc: 访客记录列表
* @param formDTO
* @param tokenDto
* @author wgf
* @date 2022/8/5 8:23
*/
@PostMapping("list")
// @MaskResponse(fieldNames = { "memberIdNum", "memberMobile" },
// fieldsMaskType = { MaskResponse.MASK_TYPE_ID_CARD, MaskResponse.MASK_TYPE_MOBILE })
public Result<PageData<IcResiCollectVisitorDTO>> getVisitorList(@RequestBody VisitListFormDTO formDTO, @LoginUser TokenDto tokenDto){
ValidatorUtils.validateEntity(formDTO,CollectListFormDTO.CollectListForm.class);
formDTO.setUserId(tokenDto.getUserId());
formDTO.setCustomerId(tokenDto.getCustomerId());
return new Result<PageData<IcResiCollectVisitorDTO>>().ok(icResiCollectVisitorService.getVisitorList(formDTO));
}
@RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET})
public Result<IcResiCollectVisitorDTO> get(@PathVariable("id") String id){
IcResiCollectVisitorDTO data = icResiCollectVisitorService.get(id);
return new Result<IcResiCollectVisitorDTO>().ok(data);
}
@NoRepeatSubmit
@PostMapping("save")
public Result save(@RequestBody IcResiCollectVisitorDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
icResiCollectVisitorService.save(dto);
return new Result();
}
@NoRepeatSubmit
@PostMapping("update")
public Result update(@RequestBody IcResiCollectVisitorDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
icResiCollectVisitorService.update(dto);
return new Result();
}
@PostMapping("delete")
public Result delete(@RequestBody String[] ids){
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
icResiCollectVisitorService.delete(ids);
return new Result();
}
@GetMapping("export")
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
List<IcResiCollectVisitorDTO> list = icResiCollectVisitorService.list(params);
ExcelUtils.exportExcelToTarget(response, null, list, IcResiCollectVisitorExcel.class);
}
/**
* @describe: 保存访客信息
* @author wangtong
* @date 2022/8/3 10:33
* @params [dto]
* @return com.epmet.commons.tools.utils.Result
*/
@NoRepeatSubmit
@PostMapping("saveInfo")
public Result saveInfo(@RequestBody SaveCollectVisitorFormDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto);
return icResiCollectVisitorService.saveInfo(dto);
}
/**
* @describe: 访客信息详情
* @author wangtong
* @date 2022/8/3 15:41
* @params [dto]
* @return com.epmet.commons.tools.utils.Result
*/
@PostMapping("getVisitorDetail")
public Result getVisitorDetail(@RequestBody CollectDetailFormDTO dto) {
ValidatorUtils.validateEntity(dto);
return icResiCollectVisitorService.getVisitorDetail(dto);
}
}

21
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiCollectDao.java

@ -2,7 +2,10 @@ package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.form.CollectListFormDTO;
import com.epmet.dto.form.IcResiCollectGetDetailFormDTO;
import com.epmet.dto.result.CollectHouseInfoResultDTO;
import com.epmet.dto.result.CollectListResultDTO;
import com.epmet.dto.result.CollectPageListDTO;
import com.epmet.entity.IcResiCollectEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -43,4 +46,20 @@ public interface IcResiCollectDao extends BaseDao<IcResiCollectEntity> {
* @return
*/
List<String> selectLastSubmitId(@Param("customerId") String customerId, @Param("userId") String userId);
}
/**
* @describe: 我的登记列表
* @author wangtong
* @date 2022/8/3 14:19
* @params [customerId]
* @return java.util.List<com.epmet.dto.result.CollectPageListDTO>
*/
List<CollectPageListDTO> getCollectPage(@Param("customerId") String customerId, @Param("userId") String userId);
/**
* 获取房屋信息
* @param formDTO
* @return
*/
CollectHouseInfoResultDTO getHouseDetailByCollect(IcResiCollectGetDetailFormDTO formDTO);
}

38
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiCollectVisitorDao.java

@ -0,0 +1,38 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.IcResiCollectVisitorDTO;
import com.epmet.dto.form.CollectListFormDTO;
import com.epmet.dto.form.VisitListFormDTO;
import com.epmet.dto.result.CollectListResultDTO;
import com.epmet.entity.IcResiCollectVisitorEntity;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
import java.util.Map;
/**
* 居民信息采集-访客
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-08-02
*/
@Mapper
public interface IcResiCollectVisitorDao extends BaseDao<IcResiCollectVisitorEntity> {
/**
* 条件查询
* @param params
* @return
*/
List<IcResiCollectVisitorDTO> getPhrasePage(Map<String, Object> params);
/**
* Desc: 查询访客信息
* @param formDTO
* @author wgf
* @date 2022/8/5 8:41
*/
List<IcResiCollectVisitorDTO> getCollectList(VisitListFormDTO formDTO);
}

11
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiMemberDao.java

@ -1,6 +1,7 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.form.IcResiCollectMemDetailDTO;
import com.epmet.dto.form.IcResiCollectMemFormDTO;
import com.epmet.entity.IcResiMemberEntity;
import org.apache.ibatis.annotations.Mapper;
@ -18,4 +19,12 @@ import java.util.List;
public interface IcResiMemberDao extends BaseDao<IcResiMemberEntity> {
List<IcResiCollectMemFormDTO> selectMySubmit(@Param("latestResiCollectId") String latestResiCollectId, @Param("userId")String userId);
}
/**
* 审核在用
* @param collectId
* @return
*/
List<IcResiCollectMemDetailDTO> selectListByCollectId(@Param("collectId") String collectId);
}

10
epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcResiCollectEntity.java

@ -86,4 +86,14 @@ public class IcResiCollectEntity extends BaseEpmetEntity {
private String buildName;
private String unitName;
private String homeName;
/**
* 审核状态0待审核 1未通过 2已通过
*/
private String checkState;
/**
* 审核原因
*/
private String checkReason;
}

111
epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcResiCollectVisitorEntity.java

@ -0,0 +1,111 @@
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 2022-08-02
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("ic_resi_collect_visitor")
public class IcResiCollectVisitorEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户Id customer.id
*/
private String customerId;
/**
* 网格ID
*/
private String gridId;
/**
* 组织Id
*/
private String agencyId;
/**
* 组织的pids
*/
private String pids;
/**
* 所属小区ID
*/
private String villageId;
/**
* 所属小区名称
*/
private String villageName;
/**
* 所属楼宇Id
*/
private String buildId;
/**
* 所属楼宇名称
*/
private String buildName;
/**
* 单元id
*/
private String unitId;
/**
* 单元名
*/
private String unitName;
/**
* 所属家庭Id
*/
private String homeId;
/**
* 房间名
*/
private String homeName;
/**
* 详细地址
*/
private String address;
/**
* 姓名
*/
private String name;
/**
* 手机号
*/
private String mobile;
/**
* 身份证号
*/
private String idCard;
/**
* 来访事由
*/
private String comeReason;
/**
* 人脸照片
*/
private String faceImg;
}

10
epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcResiMemberEntity.java

@ -77,4 +77,14 @@ public class IcResiMemberEntity extends BaseEpmetEntity {
* 备注
*/
private String remark;
/**
* 与房主关系
*/
private String relationship;
/**
* 人脸头像
*/
private String faceImg;
}

4
epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcResiUserEntity.java

@ -225,6 +225,10 @@ public class IcResiUserEntity extends BaseEpmetEntity {
*/
private String isFloating;
/**
* 是否新阶层人士:1 :0
*/
private String isXjc;
/**
* 文化程度字典表
*/

3
epmet-user/epmet-user-server/src/main/java/com/epmet/enums/IcResiUserTableEnum.java

@ -35,7 +35,8 @@ public enum IcResiUserTableEnum {
IC_DB("virtual_db","大病人员信息录入表", null, 2, "IS_DB", false),
IC_MB("virtual_mb","慢病人员信息录入表", null, 2, "IS_MB", false),
IC_TENANT("virtual_tenant","租户信息录入表", null, 2, "IS_TENANT", false),
IC_FLOATING("virtual_floating","流动人口信息录入表", null, 2, "IS_FLOATING", false);
IC_FLOATING("virtual_floating","流动人口信息录入表", null, 2, "IS_FLOATING", false),
IC_XJC("virtual_xjc","新阶层人士信息录入表", null, 2, "IS_XJC", false);
private String tableName;
/**

90
epmet-user/epmet-user-server/src/main/java/com/epmet/excel/IcResiCollectVisitorExcel.java

@ -0,0 +1,90 @@
package com.epmet.excel;
import cn.afterturn.easypoi.excel.annotation.Excel;
import lombok.Data;
import java.util.Date;
/**
* 居民信息采集-访客
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-08-02
*/
@Data
public class IcResiCollectVisitorExcel {
@Excel(name = "主键")
private String id;
@Excel(name = "客户Id customer.id")
private String customerId;
@Excel(name = "网格ID")
private String gridId;
@Excel(name = "组织Id")
private String agencyId;
@Excel(name = "组织的pids")
private String pids;
@Excel(name = "所属小区ID;")
private String villageId;
@Excel(name = "所属小区名称")
private String villageName;
@Excel(name = "所属楼宇Id")
private String buildId;
@Excel(name = "所属楼宇名称")
private String buildName;
@Excel(name = "单元id")
private String unitId;
@Excel(name = "单元名")
private String unitName;
@Excel(name = "所属家庭Id")
private String homeId;
@Excel(name = "房间名")
private String homeName;
@Excel(name = "姓名")
private String name;
@Excel(name = "手机号")
private String mobile;
@Excel(name = "身份证号")
private String idCard;
@Excel(name = "来访事由")
private String comeReason;
@Excel(name = "人脸照片")
private String faceImg;
@Excel(name = "删除标识 0.未删除 1.已删除")
private Integer delFlag;
@Excel(name = "乐观锁")
private Integer revision;
@Excel(name = "创建人")
private String createdBy;
@Excel(name = "创建时间")
private Date createdTime;
@Excel(name = "更新人")
private String updatedBy;
@Excel(name = "更新时间")
private Date updatedTime;
}

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

Loading…
Cancel
Save