wxz 2 years ago
parent
commit
b6501fdcea
  1. 9
      epmet-admin/epmet-admin-client/src/main/java/com/epmet/feign/EpmetAdminOpenFeignClient.java
  2. 12
      epmet-admin/epmet-admin-client/src/main/java/com/epmet/feign/fallback/EpmetAdminOpenFeignClientFallback.java
  3. 13
      epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysDictDataController.java
  4. 2
      epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/SysDictDataService.java
  5. 31
      epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/impl/SysDictDataServiceImpl.java
  6. 34
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/CustomerStaffDTO.java
  7. 34
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/form/StaffDetailV2FormDTO.java
  8. 10
      epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/constants/ImportTaskConstants.java
  9. 19
      epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/result/OrganizationMessageResultDTO.java
  10. 5
      epmet-module/epmet-message/epmet-message-server/pom.xml
  11. 5
      epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/controller/OrganizationMessageController.java
  12. 13
      epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/entity/OrganizationMessageEntity.java
  13. 5
      epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/OrganizationMessageService.java
  14. 111
      epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/OrganizationMessageServiceImpl.java
  15. 5
      epmet-module/epmet-message/epmet-message-server/src/main/resources/mapper/OrganizationMessageDao.xml
  16. 9
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcHouseDTO.java
  17. 16
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcNeighborHoodDTO.java
  18. 49
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcPropertyManagementDTO.java
  19. 26
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddAgencyV2FormDTO.java
  20. 31
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddStaffV2FromDTO.java
  21. 26
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditAgencyFormDTO.java
  22. 8
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcHouseAddFormDTO.java
  23. 17
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcNeighborHoodAddFormDTO.java
  24. 32
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcPropertyManagementFormDTO.java
  25. 26
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/StaffSubmitFromDTO.java
  26. 80
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/yt/CommunityBuildingManagerPageFormDTO.java
  27. 26
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencysResultDTO.java
  28. 110
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/CommunityBuildingManagerDTO.java
  29. 19
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/IcNeighborHoodDetailDTO.java
  30. 8
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/IcNeighborHoodResultDTO.java
  31. 26
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/StaffInitResultDTO.java
  32. 137
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/yt/CommunityBuildingManagerResultDTO.java
  33. 264
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CommunityBuildingManagerController.java
  34. 54
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java
  35. 15
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcNeighborHoodController.java
  36. 230
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/PropertyManagementController.java
  37. 38
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/StaffController.java
  38. 50
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CommunityBuildingManagerDao.java
  39. 13
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcNeighborHoodDao.java
  40. 12
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcNeighborHoodPropertyDao.java
  41. 6
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPropertyManagementDao.java
  42. 86
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CommunityBuildingManagerEntity.java
  43. 27
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerAgencyEntity.java
  44. 8
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcHouseEntity.java
  45. 17
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcNeighborHoodEntity.java
  46. 9
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcPropertyManagementEntity.java
  47. 120
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/handler/IcPropertyManagementImportListener.java
  48. 61
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/yt/IcPropertyManagementImportExcelData.java
  49. 69
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CommunityBuildingManagerService.java
  50. 7
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcNeighborHoodService.java
  51. 9
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPropertyManagementService.java
  52. 44
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/PropertyManagementService.java
  53. 6
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java
  54. 191
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CommunityBuildingManagerServiceImpl.java
  55. 20
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java
  56. 2
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java
  57. 38
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcNeighborHoodServiceImpl.java
  58. 7
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPropertyManagementServiceImpl.java
  59. 314
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/PropertyManagementServiceImpl.java
  60. BIN
      epmet-module/gov-org/gov-org-server/src/main/resources/excel/customer_staff_import_template.xlsx
  61. BIN
      epmet-module/gov-org/gov-org-server/src/main/resources/excel/yantai/community_building_manager_import_temp.xlsx
  62. BIN
      epmet-module/gov-org/gov-org-server/src/main/resources/excel/yantai/ic_property_management_temp.xlsx
  63. 100
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CommunityBuildingManagerDao.xml
  64. 28
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcNeighborHoodDao.xml
  65. 16
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcNeighborHoodPropertyDao.xml
  66. 10
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPropertyManagementDao.xml
  67. 26
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/CustomerStaffDTO.java
  68. 139
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcResiUserDTO.java
  69. 33
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/RegisterRelationPageFormDTO.java
  70. 8
      epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java
  71. 11
      epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java
  72. 18
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/RegisterRelationController.java
  73. 5
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/RegisterRelationDao.java
  74. 26
      epmet-user/epmet-user-server/src/main/java/com/epmet/entity/CustomerStaffEntity.java
  75. 140
      epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcResiUserEntity.java
  76. 4
      epmet-user/epmet-user-server/src/main/java/com/epmet/processor/YanTaiTripReportSyncProcessor.java
  77. 12
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/RegisterRelationService.java
  78. 40
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java
  79. 30
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserImportServiceImpl.java
  80. 8
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java
  81. 20
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/RegisterRelationServiceImpl.java
  82. BIN
      epmet-user/epmet-user-server/src/main/resources/excel/ic_resi_import_template.xls
  83. BIN
      epmet-user/epmet-user-server/src/main/resources/excel/ic_resi_import_template_bak0507.xls
  84. 17
      epmet-user/epmet-user-server/src/main/resources/mapper/RegisterRelationDao.xml

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

@ -105,4 +105,13 @@ public interface EpmetAdminOpenFeignClient {
@PostMapping("/sys/dict/data/dictDataList/{dictType}")
Result<List<SysDictDataDTO>> dictDataList(@PathVariable("dictType") String dictType);
/**
* 字典下拉框
* 根据dictType查询字典
* @param dictType
* @return
*/
@PostMapping("/sys/dict/data/dictOption/{dictType}")
public Result<List<OptionResultDTO>> getDictOption(@PathVariable("dictType")String dictType);
}

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

@ -65,4 +65,16 @@ public class EpmetAdminOpenFeignClientFallback implements EpmetAdminOpenFeignCli
public Result<List<SysDictDataDTO>> dictDataList(String dictType) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_ADMIN_SERVER, "dictDataList", dictType);
}
/**
* 字典下拉框
* 根据dictType查询字典
*
* @param dictType
* @return
*/
@Override
public Result<List<OptionResultDTO>> getDictOption(String dictType) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_ADMIN_SERVER, "getDictOption", dictType);
}
}

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

@ -20,6 +20,7 @@ import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.dto.SysDictDataDTO;
import com.epmet.service.SysDictDataService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@ -118,6 +119,18 @@ public class SysDictDataController {
return new Result<List<OptionResultDTO>>().ok(sysDictDataService.getNationOption());
}
/**
* 字典下拉框接口
* @param dictType
* @return
*/
@PostMapping("dictOption/{dictType}")
public Result<List<OptionResultDTO>> getDictOption(@PathVariable("dictType")String dictType) {
if(StringUtils.isBlank(dictType)){
return new Result<>();
}
return new Result<List<OptionResultDTO>>().ok(sysDictDataService.getDictOption(dictType));
}
/**
* @Description 人员关系
* @Param

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

@ -92,4 +92,6 @@ public interface SysDictDataService extends BaseService<SysDictDataEntity> {
List<DictTreeResultDTO> dictListTree(String dictType);
List<SysDictDataDTO> getDictDataList(String dictType);
List<OptionResultDTO> getDictOption(String dictType);
}

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

@ -19,13 +19,17 @@ import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.TreeUtils;
import com.epmet.dao.SysDictDataDao;
import com.epmet.dao.SysDictTypeDao;
import com.epmet.dto.SysDictDataDTO;
import com.epmet.entity.SysDictDataEntity;
import com.epmet.entity.SysDictTypeEntity;
import com.epmet.service.SysDictDataService;
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.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
@ -38,6 +42,9 @@ import java.util.stream.Collectors;
*/
@Service
public class SysDictDataServiceImpl extends BaseServiceImpl<SysDictDataDao, SysDictDataEntity> implements SysDictDataService {
@Autowired
private SysDictTypeDao sysDictTypeDao;
@Override
public PageData<SysDictDataDTO> page(Map<String, Object> params) {
@ -230,4 +237,28 @@ public class SysDictDataServiceImpl extends BaseServiceImpl<SysDictDataDao, SysD
return baseDao.selectDictDataList(dictType);
}
/**
* 传入dictType返回字典列表
* @param dictType
* @return
*/
@Override
public List<OptionResultDTO> getDictOption(String dictType) {
LambdaQueryWrapper<SysDictTypeEntity> queryWrapper=new LambdaQueryWrapper<>();
queryWrapper.eq(SysDictTypeEntity::getDictType,dictType);
SysDictTypeEntity sysDictTypeEntity=sysDictTypeDao.selectOne(queryWrapper);
if(null==sysDictTypeEntity){
return new ArrayList<>();
}
LambdaQueryWrapper<SysDictDataEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(SysDictDataEntity::getDictTypeId,sysDictTypeEntity.getId() );
wrapper.orderByAsc(SysDictDataEntity::getSort);
List<SysDictDataEntity> list = baseDao.selectList(wrapper);
return list.stream().map(item -> {
OptionResultDTO dto = new OptionResultDTO();
dto.setValue(item.getDictValue());
dto.setLabel(item.getDictLabel());
return dto;
}).collect(Collectors.toList());
}
}

34
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/CustomerStaffDTO.java

@ -134,8 +134,40 @@ public class CustomerStaffDTO implements Serializable {
*/
private String password;
private String idCard;
/**
* 烟台用当前登录用户
*/
private String currentUserId;
/**
* 烟台需求党组织职务
*/
private String partyPosition;
/**
* 烟台需求村居委员职务
*/
private String viliagePosition;
/**
* 烟台需求工作职责
*/
private String duty;
/**
* 烟台需求备注
*/
private String remark;
/**
* 文化程度
*/
private String culture;
/**
* 身份证
*/
private String idCard;
private Date birthday;
}

34
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/form/StaffDetailV2FormDTO.java

@ -49,13 +49,45 @@ public class StaffDetailV2FormDTO implements Serializable {
private List<String> szsqRoles;
private String customerId;
private String idCard;
/**
* 烟台用当前登录用户
*/
private String currentUserId;
/**
* 烟台需求党组织职务
*/
private String partyPosition;
/**
* 烟台需求村居委员职务
*/
private String viliagePosition;
/**
* 烟台需求工作职责
*/
private String duty;
/**
* 烟台需求备注
*/
private String remark;
@JsonFormat(pattern = "yyyy-MM-dd")
private Date birthday;
/**
* 文化程度
*/
private String culture;
/**
* 身份证
*/
private String idCard;
/**
* 居住地址
*/
private String address;
/**
* 文化程度中文
*/

10
epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/constants/ImportTaskConstants.java

@ -83,4 +83,14 @@ public interface ImportTaskConstants {
* 未做核酸比对
*/
String IC_NAT_COMPARE_RECORD="ic_nat_compare_record";
/**
* 物业表ic_property_management
*/
String IC_PROPERTY_MANAGEMENT="ic_property_management";
/**
* 楼长单元长
*/
String COMMUNITY_BUILDING_MANAGER="community_building_manager";
}

19
epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/result/OrganizationMessageResultDTO.java

@ -1,9 +1,11 @@
package com.epmet.dto.result;
import com.epmet.dto.OrganizationMessagePublishRangeDTO;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.util.Date;
import java.util.List;
/**
* @Description 烟台消息管理列表查询
@ -61,5 +63,22 @@ public class OrganizationMessageResultDTO {
* 发布人所属组织名称
*/
private String publishOrgName;
/**
* 发送结果
*/
private String sendMsgRes;
/**
* 共发送出多少条消息
*/
private Integer totalReceiver;
/**
* 发送完成时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date finishSendTime;
private List<OrganizationMessagePublishRangeDTO> rangeList;
}

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

@ -101,11 +101,6 @@
<artifactId>flyway-core</artifactId>
<!--<version>5.1.1</version>-->
</dependency>
<dependency>
<groupId>com.epmet</groupId>
<artifactId>epmet-user-client</artifactId>
<version>2.0.0</version>
</dependency>
<dependency>
<groupId>com.epmet</groupId>
<artifactId>epmet-third-client</artifactId>

5
epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/controller/OrganizationMessageController.java

@ -67,7 +67,10 @@ public class OrganizationMessageController {
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setPublishStaffId(tokenDto.getUserId());
ValidatorUtils.validateEntity(formDTO, OrganizationMessageFormDTO.AddShowGroup.class);
return new Result().ok(organizationMessageService.publish(formDTO));
String messageId=organizationMessageService.publish(formDTO);
// 发送消息 发布范围下有哪些网格,网格下所有的注册居民,每人发送一条消息
organizationMessageService.sendUserMsg(messageId,formDTO.getContent(),formDTO.getPublishStaffId(),formDTO.getRangeList(),formDTO.getCustomerId());
return new Result().ok(messageId);
}
}

13
epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/entity/OrganizationMessageEntity.java

@ -65,5 +65,18 @@ public class OrganizationMessageEntity extends BaseEpmetEntity {
* 发布时间
*/
private Date publishTime;
/**
* 发送结果
* sending发送中failed失败success成功
*/
private String sendMsgRes;
/**
* 共发送出多少条消息
*/
private Integer totalReceiver;
/**
* 发送完成时间
*/
private Date finishSendTime;
}

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

@ -3,9 +3,12 @@ package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.OrganizationMessageFormDTO;
import com.epmet.dto.OrganizationMessagePublishRangeDTO;
import com.epmet.dto.result.OrganizationMessageResultDTO;
import com.epmet.entity.OrganizationMessageEntity;
import java.util.List;
/**
* 组织发布消息烟台
*
@ -39,4 +42,6 @@ public interface OrganizationMessageService extends BaseService<OrganizationMess
* @return 返回消息id
*/
String publish(OrganizationMessageFormDTO formDTO);
void sendUserMsg(String messageId, String content, String publishStaffId, List<OrganizationMessagePublishRangeDTO> rangeList, String customerId);
}

111
epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/OrganizationMessageServiceImpl.java

@ -1,29 +1,42 @@
package com.epmet.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.AppClientConstant;
import com.epmet.commons.tools.constant.Constant;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
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.ExceptionUtils;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.redis.common.CustomerOrgRedis;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache;
import com.epmet.commons.tools.redis.common.bean.GridInfoCache;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.EpmetRequestHolder;
import com.epmet.commons.tools.utils.PidUtils;
import com.epmet.commons.tools.utils.*;
import com.epmet.dao.OrganizationMessageDao;
import com.epmet.dao.OrganizationMessagePublishRangeDao;
import com.epmet.dao.UserMessageDao;
import com.epmet.dto.OrganizationMessageFormDTO;
import com.epmet.dto.OrganizationMessagePublishRangeDTO;
import com.epmet.dto.RegisterRelationDTO;
import com.epmet.dto.form.RegisterRelationPageFormDTO;
import com.epmet.dto.result.OrganizationMessageResultDTO;
import com.epmet.entity.OrganizationMessageEntity;
import com.epmet.entity.OrganizationMessagePublishRangeEntity;
import com.epmet.entity.UserMessageEntity;
import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.service.OrganizationMessageService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -36,10 +49,16 @@ import java.util.List;
* @author generator generator@elink-cn.com
* @since v1.0.0 2023-05-04
*/
@Slf4j
@Service
public class OrganizationMessageServiceImpl extends BaseServiceImpl<OrganizationMessageDao, OrganizationMessageEntity> implements OrganizationMessageService {
@Autowired
private OrganizationMessagePublishRangeDao organizationMessagePublishRangeDao;
@Autowired
private UserMessageDao userMessageDao;
@Autowired
private EpmetUserOpenFeignClient epmetUserOpenFeignClient;
/**
* 分页列表
@ -55,11 +74,14 @@ public class OrganizationMessageServiceImpl extends BaseServiceImpl<Organization
@Override
public PageData<OrganizationMessageResultDTO> pageList(Integer pageNo, Integer pageSize, String publishDitch, String orgId, String startDate, String endDate) {
CustomerStaffInfoCacheResult staffInfoCacheResult = CustomerStaffRedis.getStaffInfo(EpmetRequestHolder.getLoginUserCustomerId(), EpmetRequestHolder.getLoginUserId());
if (null == staffInfoCacheResult) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "customerId:" + EpmetRequestHolder.getLoginUserCustomerId() + "staffId:" + EpmetRequestHolder.getLoginUserId(), "获取工作人员信息异常");
}
String staffOrgIdPath = PidUtils.convertPid2OrgIdPath(staffInfoCacheResult.getAgencyId(), staffInfoCacheResult.getAgencyPIds());
PageHelper.startPage(pageNo, pageSize);
List<OrganizationMessageResultDTO> list = baseDao.pageList(EpmetRequestHolder.getLoginUserCustomerId(),staffOrgIdPath, publishDitch, orgId, startDate, endDate,null);
PageInfo<OrganizationMessageResultDTO> pageInfo = new PageInfo<>(list);
return new PageData<>(list, pageInfo.getTotal());
return new PageData<>(list, pageInfo.getTotal(),pageSize);
}
/**
@ -72,7 +94,13 @@ public class OrganizationMessageServiceImpl extends BaseServiceImpl<Organization
public OrganizationMessageResultDTO getDetail(String messageId) {
List<OrganizationMessageResultDTO> list = baseDao.pageList(EpmetRequestHolder.getLoginUserCustomerId(),null, null, null, null, null,messageId);
if(CollectionUtils.isNotEmpty(list)){
return list.get(NumConstant.ZERO);
OrganizationMessageResultDTO resultDTO=list.get(NumConstant.ZERO);
LambdaQueryWrapper<OrganizationMessagePublishRangeEntity> queryWrapper=new LambdaQueryWrapper<>();
queryWrapper.eq(OrganizationMessagePublishRangeEntity::getMessageId,messageId)
.orderByAsc(OrganizationMessagePublishRangeEntity::getCreatedTime);
List<OrganizationMessagePublishRangeEntity> rangeList=organizationMessagePublishRangeDao.selectList(queryWrapper);
resultDTO.setRangeList(ConvertUtils.sourceToTarget(rangeList,OrganizationMessagePublishRangeDTO.class));
return resultDTO;
}
return null;
}
@ -93,6 +121,7 @@ public class OrganizationMessageServiceImpl extends BaseServiceImpl<Organization
messageEntity.setPublishOrgIdPath(PidUtils.convertPid2OrgIdPath(staffInfoCacheResult.getAgencyId(), staffInfoCacheResult.getAgencyPIds()));
messageEntity.setPublishOrgName(staffInfoCacheResult.getAgencyName());
messageEntity.setPublishTime(new Date());
messageEntity.setSendMsgRes("sending");
baseDao.insert(messageEntity);
for (OrganizationMessagePublishRangeDTO dto : formDTO.getRangeList()) {
OrganizationMessagePublishRangeEntity rangeEntity = new OrganizationMessagePublishRangeEntity();
@ -105,18 +134,86 @@ public class OrganizationMessageServiceImpl extends BaseServiceImpl<Organization
rangeEntity.setPid(gridInfoCache.getPid());
rangeEntity.setOrgIdPath(PidUtils.convertPid2OrgIdPath(dto.getOrgId(), gridInfoCache.getPids()));
rangeEntity.setOrgName(gridInfoCache.getGridNamePath());
} else if (OrgTypeEnum.AGENCY.getCode().equals(dto.getOrgType())) {
} else {
//if (OrgTypeEnum.AGENCY.getCode().equals(dto.getOrgType()))
AgencyInfoCache agencyInfoCache = CustomerOrgRedis.getAgencyInfo(dto.getOrgId());
rangeEntity.setPid(agencyInfoCache.getPid());
rangeEntity.setOrgIdPath(PidUtils.convertPid2OrgIdPath(dto.getOrgId(), agencyInfoCache.getPids()));
rangeEntity.setOrgName(agencyInfoCache.getOrganizationName());
}
dto.setPid(rangeEntity.getPid());
dto.setOrgIdPath(rangeEntity.getOrgIdPath());
organizationMessagePublishRangeDao.insert(rangeEntity);
}
String messageId = messageEntity.getId();
// todo 发送消息 发布范围下有哪些网格,网格下所有的注册居民,每人发送一条消息
return messageId;
}
@Async
@Override
public void sendUserMsg(String messageId, String content, String publishStaffId,List<OrganizationMessagePublishRangeDTO> rangeList, String customerId) {
String result = "success";
int totalMsg = NumConstant.ZERO;
try {
for (OrganizationMessagePublishRangeDTO rangeDto : rangeList) {
RegisterRelationPageFormDTO pageFormDTO=new RegisterRelationPageFormDTO();
pageFormDTO.setCustomerId(customerId);
pageFormDTO.setFirstRegister(NumConstant.ONE_STR);
pageFormDTO.setPageNo(NumConstant.ONE);
pageFormDTO.setPageSize(NumConstant.TWO);
// pageFormDTO.setPageSize(NumConstant.ONE_THOUSAND);
if (OrgTypeEnum.GRID.getCode().equals(rangeDto.getOrgType())) {
// 查询该网格下的注册居民
pageFormDTO.setGridId(rangeDto.getOrgId());
} else {
// 查询该组织下的注册居民
pageFormDTO.setAgencyIdPath(rangeDto.getOrgIdPath());
}
List<RegisterRelationDTO> list=null;
do {
Result<PageData<RegisterRelationDTO>> regRes = epmetUserOpenFeignClient.pageQueryRegisterUser(pageFormDTO);
list = regRes.getData().getList();
for (RegisterRelationDTO regUser : list) {
LambdaQueryWrapper<UserMessageEntity> queryWrapper=new LambdaQueryWrapper();
queryWrapper.eq(UserMessageEntity::getCustomerId,customerId)
.eq(UserMessageEntity::getTargetId,messageId)
.eq(UserMessageEntity::getUserId,regUser.getUserId());
UserMessageEntity origin=userMessageDao.selectOne(queryWrapper);
if(null==origin){
UserMessageEntity userMessageEntity = new UserMessageEntity();
userMessageEntity.setCustomerId(customerId);
userMessageEntity.setGridId(regUser.getGridId());
userMessageEntity.setUserId(regUser.getUserId());
userMessageEntity.setApp(AppClientConstant.APP_RESI);
userMessageEntity.setTitle("您有一条社区消息!");
userMessageEntity.setMessageContent(content);
userMessageEntity.setReadFlag(Constant.UNREAD);
userMessageEntity.setReferer(StrConstant.EPMETY_STR);
userMessageEntity.setMessageType("organization_message");
userMessageEntity.setTargetId(messageId);
userMessageEntity.setCreatedBy(publishStaffId);
userMessageEntity.setUpdatedBy(publishStaffId);
userMessageDao.insert(userMessageEntity);
totalMsg += 1;
}
}
pageFormDTO.setPageNo(pageFormDTO.getPageNo() + NumConstant.ONE);
} while (CollectionUtils.isNotEmpty(list) && list.size() == pageFormDTO.getPageSize());
}
} catch (Exception e) {
log.error(String.format("messageId:%s,发送消息异常:%s", messageId, ExceptionUtils.getErrorStackTrace(e)));
result = "failed";
} finally {
LambdaUpdateWrapper<OrganizationMessageEntity> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(OrganizationMessageEntity::getId, messageId)
.set(OrganizationMessageEntity::getSendMsgRes, result)
.set(OrganizationMessageEntity::getTotalReceiver, totalMsg)
.set(OrganizationMessageEntity::getFinishSendTime,new Date())
.set(OrganizationMessageEntity::getUpdatedTime,new Date());
baseDao.update(null, updateWrapper);
}
}
}

5
epmet-module/epmet-message/epmet-message-server/src/main/resources/mapper/OrganizationMessageDao.xml

@ -30,8 +30,12 @@
om.PUBLISH_TIME as publishTime,
om.PUBLISH_STAFF_ID as publishStaffId,
om.PUBLISH_ORG_ID as publishStaffName,
om.PUBLISH_ORG_ID as publishOrgId,
om.PUBLISH_ORG_ID_PATH as publishOrgIdPath,
OM.PUBLISH_ORG_NAME as publishOrgName,
om.SEND_MSG_RES as sendMsgRes,
om.TOTAL_RECEIVER as totalReceiver,
om.FINISH_SEND_TIME as finishSendTime,
GROUP_CONCAT(r.ORG_NAME) as publishRangeName
from organization_message om
left join organization_message_publish_range r
@ -56,6 +60,7 @@
<if test='messageId != null and messageId != "" '>
and om.id =#{messageId}
</if>
group by om.id
order by om.PUBLISH_TIME desc
</select>
</mapper>

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

@ -170,4 +170,13 @@ public class IcHouseDTO implements Serializable {
* 加密后的房主身份证
*/
private String showOwnerIdCard;
/**
* 所在楼层
*/
private String floor;
/**
* 面积
*/
private String area;
}

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

@ -165,4 +165,20 @@ public class IcNeighborHoodDTO implements Serializable {
*/
private String buildingName;
/**
* 烟台需求自然村/小区
*/
private String viliageType;
/**
* 烟台需求面积
*/
private String area;
/**
* 烟台需求开放类型
*/
private String openType;
/**
* 烟台需求建筑年代
*/
private String buildYear;
}

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

@ -17,10 +17,14 @@
package com.epmet.dto;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
@ -37,48 +41,85 @@ public class IcPropertyManagementDTO implements Serializable {
/**
* 物业id
*/
@ExcelIgnore
private String id;
/**
* 物业名称
*/
@ExcelProperty(value = "物业名称")
@ColumnWidth(30)
private String name;
/**
* 客户id
*/
@ExcelIgnore
private String customerId;
/**
* 烟台需求物业联系人姓名
*/
@ExcelProperty(value = "物业联系人")
@ColumnWidth(30)
private String contactName;
/**
* 烟台需求物业联系人电话
*/
@ExcelProperty(value = "联系电话")
@ColumnWidth(30)
private String contactMobile;
/**
* 关联的小区数量
*/
@ExcelIgnore
private Integer totalNeighborHood;
/**
* 导出时候用
* 该物业关联的小区
*/
@ExcelProperty(value = "关联小区")
@ColumnWidth(60)
private String neighborHoodNames;
@ExcelIgnore
List<IcNeighborHoodDTO> neighborHoodList;
/**
* 删除标识 0未删除1已删除
*/
@ExcelIgnore
private String delFlag;
/**
* 乐观锁
*/
@ExcelIgnore
private Integer revision;
/**
* 创建人
*/
@ExcelIgnore
private String createdBy;
/**
* 创建时间
*/
@ExcelIgnore
private Date createdTime;
/**
* 更新人
*/
@ExcelIgnore
private String updatedBy;
/**
* 更新时间
*/
@ExcelIgnore
private Date updatedTime;
/**
* 关联的小区数量
*/
private Integer totalNeighborHood;
}

26
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddAgencyV2FormDTO.java

@ -124,4 +124,30 @@ public class AddAgencyV2FormDTO implements Serializable {
*/
@Length(max = 500,message ="最多输入500字",groups =DefaultUserShowGroup.class )
private String remark;
/**
* 村居/社区书记姓名
*/
private String secretaryName;
/**
* 村居/社区书记电话
*/
private String secretaryMobile;
/**
* 值班电话
*/
private String dutyMobile;
/**
* 统一社会信用代码
*/
private String unifiedSocialCreditCode;
/**
* 统一社会信用代码证书图片附件
*/
private String unifiedSocialCreditCodeCertificate;
/**
* 详细地址
*/
private String fullAddress;
}

31
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddStaffV2FromDTO.java

@ -80,9 +80,36 @@ public class AddStaffV2FromDTO implements Serializable {
private String currentUserId;
/**
* 文化程度0小学及文盲,1初中,2高中,3大专,4本科,5硕士,6博士,7中专
* 烟台需求党组织职务
*/
private String culture;
private String partyPosition;
/**
* 烟台需求村居委员职务
*/
private String viliagePosition;
/**
* 烟台需求工作职责
*/
private String duty;
/**
* 烟台需求备注
*/
private String remark;
/**
* 文化程度
*/
private String culture;
/**
* 身份证
*/
private String idCard;
/**
* 居住地址
*/
private String address;
}

26
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditAgencyFormDTO.java

@ -113,4 +113,30 @@ public class EditAgencyFormDTO implements Serializable {
@Length(max = 500,message = "最多输入500字",groups =DefaultUserShowGroup.class )
private String remark;
/**
* 村居/社区书记姓名
*/
private String secretaryName;
/**
* 村居/社区书记电话
*/
private String secretaryMobile;
/**
* 值班电话
*/
private String dutyMobile;
/**
* 统一社会信用代码
*/
private String unifiedSocialCreditCode;
/**
* 统一社会信用代码证书图片附件
*/
private String unifiedSocialCreditCodeCertificate;
/**
* 详细地址
*/
private String fullAddress;
}

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

@ -112,5 +112,13 @@ public class IcHouseAddFormDTO implements Serializable {
* 房屋可编辑编码
*/
private String coding;
/**
* 所在楼层
*/
private String floor;
/**
* 面积
*/
private String area;
}

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

@ -113,6 +113,21 @@ public class IcNeighborHoodAddFormDTO extends PageFormDTO {
* 实有楼栋数
*/
private Integer realBuilding;
/**
* 烟台需求自然村/小区
*/
private String viliageType;
/**
* 烟台需求面积
*/
private String area;
/**
* 烟台需求开放类型
*/
private String openType;
/**
* 烟台需求建筑年代
*/
private String buildYear;
}

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

@ -17,17 +17,18 @@
package com.epmet.dto.form;
import com.epmet.commons.tools.dto.form.PageFormDTO;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.List;
@Data
public class IcPropertyManagementFormDTO implements Serializable {
public class IcPropertyManagementFormDTO extends PageFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
@ -40,8 +41,8 @@ public class IcPropertyManagementFormDTO implements Serializable {
public interface UpdateShowGroup extends CustomerClientShowGroup {
}
public interface PageGroup extends CustomerClientShowGroup {
}
// public interface PageGroup extends CustomerClientShowGroup {
// }
@NotBlank(message = "物业id不能为空", groups = {DeleteGroup.class, UpdateShowGroup.class})
private String id;
@ -52,11 +53,24 @@ public class IcPropertyManagementFormDTO implements Serializable {
@Length(max = 50, message = "物业名称不能超过50个字", groups = {AddShowGroup.class})
private String name;
private String customerId;
/**
* 烟台需求物业联系人姓名
*/
@Length(max = 30, message = "物业联系人不能超过30个字", groups = {AddShowGroup.class, UpdateShowGroup.class})
private String contactName;
/**
* 烟台需求物业联系人电话
*/
@Length(max = 30, message = "联系电话不能超过30个字",groups = {AddShowGroup.class, UpdateShowGroup.class})
private String contactMobile;
/**
* 管理小区id
*/
private List<String> neighborHoodIdList;
@NotNull(message = "pageNo不能为空", groups = PageGroup.class)
private Integer pageNo;
@NotNull(message = "pageSize不能为空", groups = PageGroup.class)
private Integer pageSize;
private String customerId;
}

26
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/StaffSubmitFromDTO.java

@ -76,8 +76,34 @@ public class StaffSubmitFromDTO implements Serializable {
*/
private String deptType;
/**
* 烟台需求党组织职务
*/
private String partyPosition;
/**
* 烟台需求村居委员职务
*/
private String viliagePosition;
/**
* 烟台需求工作职责
*/
private String duty;
/**
* 烟台需求备注
*/
private String remark;
/**
* 身份证
*/
private String idCard;
/**
* 居住地址
*/
private String address;
/**
* 文化程度0小学及文盲,1初中,2高中,3大专,4本科,5硕士,6博士,7中专
*/

80
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/yt/CommunityBuildingManagerPageFormDTO.java

@ -0,0 +1,80 @@
package com.epmet.dto.form.yt;
import com.epmet.commons.tools.dto.form.PageFormDTO;
import lombok.Data;
/**
* @Description
* @Author yzm
* @Date 2023/5/6 13:53
*/
@Data
public class CommunityBuildingManagerPageFormDTO extends PageFormDTO {
// start
private String customerId;
private String staffId;
/**
* 工作人员所属组织的org_id_path
* 列表数据应查询本组织及下级
* 网格的全路径包含网格id
*/
private String orgIdPath;
// end
/**
* 姓名
*/
private String name;
/**
* 联系电话
*/
private String phone;
/**
* 身份证号
*/
private String idCard;
/**
* 类型0楼长1单元长
*/
private String type;
/**
* 所属区县id取名字关联customer_agency
*/
private String districtId;
/**
* 所属街道id取名字关联customer_agency
*/
private String streetId;
/**
* 所属社区id取名字关联customer_agency
*/
private String communityId;
/**
* 所属网格id取名字关联customer_grid
*/
private String gridId;
/**
* 所属小区id
*/
private String viliageId;
/**
* 所属楼栋id
*/
private String buildingId;
/**
* 所属单元id; 单元长时必填此列
*/
private String unitId;
}

26
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencysResultDTO.java

@ -137,4 +137,30 @@ public class AgencysResultDTO implements Serializable {
private String remark;
private String coordinates;
/**
* 村居/社区书记姓名
*/
private String secretaryName;
/**
* 村居/社区书记电话
*/
private String secretaryMobile;
/**
* 值班电话
*/
private String dutyMobile;
/**
* 统一社会信用代码
*/
private String unifiedSocialCreditCode;
/**
* 统一社会信用代码证书图片附件
*/
private String unifiedSocialCreditCodeCertificate;
/**
* 详细地址
*/
private String fullAddress;
}

110
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/CommunityBuildingManagerDTO.java

@ -0,0 +1,110 @@
package com.epmet.dto.result;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* 楼长单元长信息表烟台
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2023-05-06
*/
@Data
public class CommunityBuildingManagerDTO implements Serializable {
private static final long serialVersionUID = -2526419541953300212L;
public interface AddShowGroup extends CustomerClientShowGroup {
}
public interface UpdateShowGroup extends CustomerClientShowGroup {
}
/**
* 主键烟台需求
*/
@NotBlank(message ="id不能为空" ,groups = {UpdateShowGroup.class})
private String id;
/**
* 客户Id customer.id
*/
private String customerId;
/**
* 姓名
*/
@Length(max = 50,message = "姓名最多输入50字",groups = {AddShowGroup.class,UpdateShowGroup.class})
@NotBlank(message ="姓名不能为空" ,groups = {AddShowGroup.class,UpdateShowGroup.class})
private String name;
/**
* 联系电话
*/
@Length(max = 50,message = "联系电话最多输入50字",groups = {AddShowGroup.class,UpdateShowGroup.class})
@NotBlank(message ="联系电话不能为空" ,groups = {AddShowGroup.class,UpdateShowGroup.class})
private String phone;
/**
* 身份证号
*/
@Length(max = 50,message = "身份证号最多输入50字",groups = {AddShowGroup.class,UpdateShowGroup.class})
@NotBlank(message ="身份证号不能为空" ,groups = {AddShowGroup.class,UpdateShowGroup.class})
private String idCard;
/**
* 类型0楼长1单元长
*/
@NotBlank(message ="类型不能为空" ,groups = {AddShowGroup.class,UpdateShowGroup.class})
private String type;
/**
* 所属区县id取名字关联customer_agency
*/
@NotBlank(message ="所属区县不能为空" ,groups = {AddShowGroup.class,UpdateShowGroup.class})
private String districtId;
/**
* 所属街道id取名字关联customer_agency
*/
@NotBlank(message ="所属街道不能为空" ,groups = {AddShowGroup.class,UpdateShowGroup.class})
private String streetId;
/**
* 所属社区id取名字关联customer_agency
*/
@NotBlank(message ="所属社区不能为空" ,groups = {AddShowGroup.class,UpdateShowGroup.class})
private String communityId;
/**
* 所属网格id取名字关联customer_grid
*/
@NotBlank(message ="所属网格不能为空" ,groups = {AddShowGroup.class,UpdateShowGroup.class})
private String gridId;
/**
* 网格的全路径包含网格id
*/
private String orgIdPath;
/**
* 所属小区id
*/
@NotBlank(message ="所属小区不能为空" ,groups = {AddShowGroup.class,UpdateShowGroup.class})
private String viliageId;
/**
* 所属楼栋id
*/
@NotBlank(message ="楼栋不能为空" ,groups = {AddShowGroup.class,UpdateShowGroup.class})
private String buildingId;
/**
* 所属单元id; 单元长时必填此列
*/
private String unitId;
}

19
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/IcNeighborHoodDetailDTO.java

@ -107,5 +107,24 @@ public class IcNeighborHoodDetailDTO {
* 二维码地址
*/
private String qrcodeUrl;
private String viliageTypeName;
private String area;
private String openTypeName;
private String buildYear;
/**
* 烟台需求自然村/小区
*/
private String viliageType;
/**
* 烟台需求开放类型
*/
private String openType;
}

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

@ -28,4 +28,12 @@ public class IcNeighborHoodResultDTO extends PageFormDTO {
private String propertyId;
private String agencyName;
private String longitude;
private String viliageTypeName;
private String area;
private String openTypeName;
private String buildYear;
}

26
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/StaffInitResultDTO.java

@ -58,8 +58,34 @@ public class StaffInitResultDTO implements Serializable {
*/
private String agencyName;
/**
* 烟台需求党组织职务
*/
private String partyPosition;
/**
* 烟台需求村居委员职务
*/
private String viliagePosition;
/**
* 烟台需求工作职责
*/
private String duty;
/**
* 烟台需求备注
*/
private String remark;
/**
* 文化程度
*/
private String culture;
private String address;
private String cultureDisplay;
@JsonFormat(pattern = "yyyy-MM-dd")
private Date birthday;

137
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/yt/CommunityBuildingManagerResultDTO.java

@ -0,0 +1,137 @@
package com.epmet.dto.result.yt;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import lombok.Data;
import java.io.Serializable;
/**
* 楼长单元长信息表烟台
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2023-05-06
*/
@Data
public class CommunityBuildingManagerResultDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键烟台需求
*/
@ExcelIgnore
private String id;
/**
* 客户Id customer.id
*/
@ExcelIgnore
private String customerId;
/**
* 姓名
*/
@ExcelProperty(value = "姓名")
@ColumnWidth(20)
private String name;
/**
* 联系电话
*/
@ExcelProperty(value = "联系电话")
@ColumnWidth(25)
private String phone;
/**
* 身份证号
*/
@ExcelProperty(value = "身份证号")
@ColumnWidth(30)
private String idCard;
/**
* 类型0楼长1单元长
*/
@ExcelIgnore
private String type;
@ExcelProperty(value = "类型")
@ColumnWidth(20)
private String typeName;
/**
* 所属区县id取名字关联customer_agency
*/
@ExcelIgnore
private String districtId;
@ExcelProperty(value = "所属区市")
@ColumnWidth(30)
private String districtName;
/**
* 所属街道id取名字关联customer_agency
*/
@ExcelIgnore
private String streetId;
@ExcelProperty(value = "所属镇街")
@ColumnWidth(30)
private String streetName;
/**
* 所属社区id取名字关联customer_agency
*/
@ExcelIgnore
private String communityId;
@ExcelProperty(value = "所属社区")
@ColumnWidth(30)
private String communityName;
/**
* 所属网格id取名字关联customer_grid
*/
@ExcelIgnore
private String gridId;
@ExcelProperty(value = "所属网格")
@ColumnWidth(30)
private String gridName;
/**
* 网格的全路径包含网格id
*/
@ExcelIgnore
private String orgIdPath;
/**
* 所属小区id
*/
@ExcelIgnore
private String viliageId;
@ExcelProperty(value = "所属小区")
@ColumnWidth(30)
private String viliageName;
/**
* 所属楼栋id
*/
@ExcelIgnore
private String buildingId;
@ExcelProperty(value = "楼栋")
@ColumnWidth(20)
private String buildingName;
/**
* 所属单元id; 单元长时必填此列
*/
@ExcelIgnore
private String unitId;
/**
* 所属单元id; 单元长时必填此列
*/
@ExcelProperty(value = "单元")
@ColumnWidth(20)
private String unitName;
}

264
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CommunityBuildingManagerController.java

@ -0,0 +1,264 @@
package com.epmet.controller;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.write.metadata.WriteSheet;
import com.alibaba.excel.write.metadata.style.WriteCellStyle;
import com.alibaba.excel.write.style.HorizontalCellStyleStrategy;
import com.alibaba.excel.write.style.column.LongestMatchColumnWidthStyleStrategy;
import com.alibaba.fastjson.JSON;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.aop.NoRepeatSubmit;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.feign.ResultDataResolver;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.commons.tools.utils.ExcelUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.utils.poi.excel.handler.FreezeAndFilter;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dto.form.yt.CommunityBuildingManagerPageFormDTO;
import com.epmet.dto.result.CommunityBuildingManagerDTO;
import com.epmet.dto.result.yt.CommunityBuildingManagerResultDTO;
import com.epmet.service.CommunityBuildingManagerService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.io.IOUtils;
import org.apache.poi.ss.usermodel.IndexedColors;
import org.apache.poi.ss.usermodel.VerticalAlignment;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpHeaders;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.net.URLEncoder;
import java.util.Date;
import java.util.List;
/**
* 楼长单元长信息表烟台
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2023-05-06
*/
@Slf4j
@RestController
@RequestMapping("communityBuildingManager")
public class CommunityBuildingManagerController implements ResultDataResolver {
@Autowired
private CommunityBuildingManagerService communityBuildingManagerService;
/**
* 列表分页查询
* @param formDTO
* @return
*/
@RequestMapping("page")
public Result<PageData<CommunityBuildingManagerResultDTO>> page(@LoginUser TokenDto tokenDto, @RequestBody CommunityBuildingManagerPageFormDTO formDTO){
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setStaffId(tokenDto.getUserId());
PageData<CommunityBuildingManagerResultDTO> page = communityBuildingManagerService.page(formDTO);
return new Result<PageData<CommunityBuildingManagerResultDTO>>().ok(page);
}
/**
* 查看详情
* @param id
* @return
*/
@RequestMapping(value = "detail/{id}",method = {RequestMethod.POST})
public Result<CommunityBuildingManagerResultDTO> get(@PathVariable("id") String id){
CommunityBuildingManagerResultDTO data = communityBuildingManagerService.get(id);
return new Result<CommunityBuildingManagerResultDTO>().ok(data);
}
/**
* 新增楼长/单元长
* todo: 同步到具体的楼栋
* @param dto
* @return
*/
@NoRepeatSubmit
@PostMapping("save")
public Result save(@LoginUser TokenDto tokenDto,@RequestBody CommunityBuildingManagerDTO dto){
dto.setCustomerId(tokenDto.getCustomerId());
ValidatorUtils.validateEntity(dto, CommunityBuildingManagerDTO.AddShowGroup.class);
/* //类型:0楼长;1单元长
if("1".equals(dto.getType())&& StringUtils.isBlank(dto.getUnitId())){
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"单元长必须选择所属单元","单元长必须选择所属单元");
}*/
communityBuildingManagerService.save(dto);
return new Result();
}
/**
* 编辑楼长/单元长
* todo: 同步到具体的楼栋
* @param dto
* @return
*/
@NoRepeatSubmit
@PostMapping("update")
public Result update(@RequestBody CommunityBuildingManagerDTO dto){
ValidatorUtils.validateEntity(dto, CommunityBuildingManagerDTO.UpdateShowGroup.class);
/* //类型:0楼长;1单元长
if("1".equals(dto.getType())&& StringUtils.isBlank(dto.getUnitId())){
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"单元长必须选择所属单元","单元长必须选择所属单元");
}*/
communityBuildingManagerService.update(dto);
return new Result();
}
/**
* 批量删除楼长/单元长
* todo: 同时清空楼栋表里的信息
* @param ids
* @return
*/
@PostMapping("delete")
public Result delete(@RequestBody List<String> ids){
if(!CollectionUtils.isEmpty(ids)){
communityBuildingManagerService.delete(ids);
}
return new Result();
}
/**
* 楼长单元长-下载导入模板
* @param response
* @throws IOException
*/
@RequestMapping(value = "download-tem", method = {RequestMethod.GET, RequestMethod.POST})
public void downloadTemplate(HttpServletResponse response) throws IOException {
response.setCharacterEncoding("UTF-8");
response.addHeader(HttpHeaders.ACCESS_CONTROL_EXPOSE_HEADERS, "Content-Disposition");
//response.setHeader(HttpHeaders.CONTENT_TYPE, "application/vnd.ms-excel");
response.setHeader(HttpHeaders.CONTENT_TYPE, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
response.setHeader(HttpHeaders.CONTENT_DISPOSITION, "attachment;filename=" + URLEncoder.encode("楼长单元长导入模版", "UTF-8") + ".xlsx");
InputStream is = this.getClass().getClassLoader().getResourceAsStream("excel/yantai/community_building_manager_import_temp.xlsx");
try {
ServletOutputStream os = response.getOutputStream();
IOUtils.copy(is, os);
} finally {
if (is != null) {
is.close();
}
}
}
/**
* 楼长单元长-列表导出
*
* @param tokenDto
* @param formDTO
* @param response
* @return
* @throws IOException
*/
@PostMapping("export")
public void exportCommunityBuildingManager(@LoginUser TokenDto tokenDto, @RequestBody CommunityBuildingManagerPageFormDTO formDTO, HttpServletResponse response) throws IOException {
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setStaffId(tokenDto.getUserId());
ExcelWriter excelWriter = null;
formDTO.setPageNo(NumConstant.ONE);
formDTO.setPageSize(NumConstant.TEN_THOUSAND);
try {
String fileName = "楼长单元长列表导出" + DateUtils.format(new Date()) + ".xlsx";
WriteCellStyle headWriteCellStyle = new WriteCellStyle();
headWriteCellStyle.setFillForegroundColor(IndexedColors.PALE_BLUE.getIndex());
WriteCellStyle contentWriteCellStyle = new WriteCellStyle();
contentWriteCellStyle.setVerticalAlignment(VerticalAlignment.CENTER);
HorizontalCellStyleStrategy horizontalCellStyleStrategy = new HorizontalCellStyleStrategy(headWriteCellStyle, contentWriteCellStyle);
FreezeAndFilter writeHandler = new FreezeAndFilter();
excelWriter = EasyExcel.write(ExcelUtils.getOutputStreamForExcel(fileName, response), CommunityBuildingManagerResultDTO.class)
.registerWriteHandler(horizontalCellStyleStrategy)
.registerWriteHandler(new LongestMatchColumnWidthStyleStrategy())
.registerWriteHandler(writeHandler).build();
WriteSheet writeSheet = EasyExcel.writerSheet("Sheet1").registerWriteHandler(new FreezeAndFilter()).build();
PageData<CommunityBuildingManagerResultDTO> data = null;
do {
data = communityBuildingManagerService.page(formDTO);
formDTO.setPageNo(formDTO.getPageNo() + NumConstant.ONE);
excelWriter.write(data.getList(), writeSheet);
} while (org.apache.commons.collections4.CollectionUtils.isNotEmpty(data.getList()) && data.getList().size() == formDTO.getPageSize());
} catch (EpmetException e) {
response.reset();
response.setCharacterEncoding("UTF-8");
response.setHeader("content-type", "application/json; charset=UTF-8");
PrintWriter printWriter = response.getWriter();
Result<Object> result = new Result<>().error(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), e.getMsg());
printWriter.write(JSON.toJSONString(result));
printWriter.close();
} catch (Exception e) {
log.error("楼长单元长导出异常export exception", e);
} finally {
if (excelWriter != null) {
excelWriter.finish();
}
}
}
/**
* 导入excel
*
* @return
*/
@PostMapping("import")
public Result importExcel(@RequestPart("file") MultipartFile file) {
return new Result();
/*// 1.暂存文件
String originalFilename = file.getOriginalFilename();
String extName = originalFilename.substring(originalFilename.lastIndexOf("."));
Path fileSavePath;
try {
Path importPath = FileUtils.getAndCreateDirUnderEpmetFilesDir(ImportTaskConstants.COMMUNITY_BUILDING_MANAGER, "import");
fileSavePath = importPath.resolve(UUID.randomUUID().toString().concat(extName));
} catch (IOException e) {
String errorMsg = ExceptionUtils.getErrorStackTrace(e);
log.error("【楼长单元长导入】创建临时存储文件失败:{}", errorMsg);
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "文件上传失败", "文件上传失败");
}
InputStream is = null;
FileOutputStream os = null;
try {
is = file.getInputStream();
os = new FileOutputStream(fileSavePath.toString());
IOUtils.copy(is, os);
} catch (Exception e) {
log.error(ImportTaskConstants.COMMUNITY_BUILDING_MANAGER + "表 importExcel exception", e);
} finally {
org.apache.poi.util.IOUtils.closeQuietly(is);
org.apache.poi.util.IOUtils.closeQuietly(os);
}
// 2.生成导入任务记录
ImportTaskCommonResultDTO rstData = getResultDataOrThrowsException(
ImportTaskUtils.createImportTask(originalFilename, ImportTaskConstants.COMMUNITY_BUILDING_MANAGER),
ServiceConstant.EPMET_COMMON_SERVICE,
EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),
"楼长单元长导入excel错误",
"楼长单元长导入excel错误");
// 3.执行导入
communityBuildingManagerService.execAsyncExcelImport(fileSavePath, rstData.getTaskId());
return new Result();*/
}
}

54
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java

@ -19,6 +19,9 @@ package com.epmet.controller;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.constant.AppClientConstant;
import com.epmet.commons.tools.enums.OrgLevelEnum;
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.security.dto.TokenDto;
@ -41,6 +44,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
@ -575,4 +579,54 @@ public class CustomerAgencyController {
return new Result<PageData<CommunityListByAgencyIdResultDTO>>().ok(customerAgencyService.getCommunityList(dto));
}
/**
* 返回区县列表
* @param tokenDto
* @return
*/
@PostMapping("districtList")
public Result<List<CustomerAgencyDTO>> districtList(@LoginUser TokenDto tokenDto){
Map<String, Object> params=new HashMap<>();
params.put("CUSTOMER_ID",tokenDto.getCustomerId());
params.put("LEVEL",OrgLevelEnum.DISTRICT.getCode());
params.put("PID",null);
return new Result<List<CustomerAgencyDTO>>().ok(customerAgencyService.list(params));
}
/**
* 返回街道列表必传区县
* @param tokenDto
* @param districtId
* @return
*/
@PostMapping("streetList/{districtId}")
public Result<List<CustomerAgencyDTO>> streetList(@LoginUser TokenDto tokenDto,@PathVariable("districtId")String districtId){
if(StringUtils.isBlank(districtId)){
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"districtId为空","请先选择区县");
}
Map<String, Object> params=new HashMap<>();
params.put("CUSTOMER_ID",tokenDto.getCustomerId());
params.put("LEVEL",OrgLevelEnum.STREET.getCode());
params.put("PID",districtId);
return new Result<List<CustomerAgencyDTO>>().ok(customerAgencyService.list(params));
}
/**
* 返回社区列表街道必传
* @param tokenDto
* @param streetId
* @return
*/
@PostMapping("communityList/{streetId}")
public Result<List<CustomerAgencyDTO>> communityList(@LoginUser TokenDto tokenDto,@PathVariable("streetId")String streetId){
if(StringUtils.isBlank(streetId)){
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"streetId为空","请先选择街道");
}
Map<String, Object> params=new HashMap<>();
params.put("CUSTOMER_ID",tokenDto.getCustomerId());
params.put("LEVEL",OrgLevelEnum.COMMUNITY.getCode());
params.put("PID",streetId);
return new Result<List<CustomerAgencyDTO>>().ok(customerAgencyService.list(params));
}
}

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

@ -174,6 +174,21 @@ public class IcNeighborHoodController {
return new Result<List<OptionResultDTO>>().ok(list);
}
/**
* 入参gridIdagencyId
* 返回当前组织及下级下的所有小区
* @param tokenDto
* @param formDTO
* @return
*/
@PostMapping("neighborhood-options-yantai")
public Result<List<OptionResultDTO>> queryNeighborHoodOptionsYanTai(@LoginUser TokenDto tokenDto, @RequestBody NeighborHoodOptionFormDTO formDTO) {
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setStaffId(tokenDto.getUserId());
List<OptionResultDTO> list=icNeighborHoodService.queryNeighborHoodOptionsYanTai(formDTO);
return new Result<List<OptionResultDTO>>().ok(list);
}
/**
* 获取用户组织下小区列表
*

230
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/PropertyManagementController.java

@ -17,24 +17,55 @@
package com.epmet.controller;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.write.metadata.WriteSheet;
import com.alibaba.excel.write.metadata.style.WriteCellStyle;
import com.alibaba.excel.write.style.HorizontalCellStyleStrategy;
import com.alibaba.excel.write.style.column.LongestMatchColumnWidthStyleStrategy;
import com.alibaba.fastjson.JSON;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.exception.ExceptionUtils;
import com.epmet.commons.tools.feign.ResultDataResolver;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.commons.tools.utils.ExcelUtils;
import com.epmet.commons.tools.utils.FileUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.utils.poi.excel.handler.FreezeAndFilter;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.constants.ImportTaskConstants;
import com.epmet.dto.IcPropertyManagementDTO;
import com.epmet.dto.form.IcPropertyManagementFormDTO;
import com.epmet.dto.result.IcPropertyManagementResultDTO;
import com.epmet.dto.result.ImportTaskCommonResultDTO;
import com.epmet.service.PropertyManagementService;
import com.epmet.utils.ImportTaskUtils;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.ss.usermodel.IndexedColors;
import org.apache.poi.ss.usermodel.VerticalAlignment;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.http.HttpHeaders;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.net.URLEncoder;
import java.nio.file.Path;
import java.util.*;
/**
@ -43,19 +74,21 @@ import java.util.Map;
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-10-25
*/
@Slf4j
@RestController
@RequestMapping("propertymanagement")
public class PropertyManagementController {
public class PropertyManagementController implements ResultDataResolver {
@Autowired
private PropertyManagementService propertyManagementService;
/**
* 分页查询物业列表
* 物业管理-分页查询物业列表
*/
@PostMapping("page")
public Result<PageData<IcPropertyManagementDTO>> page(@RequestBody IcPropertyManagementFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO,IcPropertyManagementFormDTO.PageGroup.class);
return new Result<PageData<IcPropertyManagementDTO>>().ok(propertyManagementService.page(formDTO.getPageNo(),formDTO.getPageSize(),formDTO.getName()));
return new Result<PageData<IcPropertyManagementDTO>>().ok(propertyManagementService.page(formDTO.getPageNo(),formDTO.getPageSize(),formDTO.getName(),
formDTO.getContactName(),formDTO.getContactMobile()));
}
/**
@ -68,7 +101,7 @@ public class PropertyManagementController {
}
/**
* 新增物业
* 物业管理-新增物业
* 新增小区页面添加小区也调用此接口
* @param tokenDTO
* @param formDTO
@ -84,6 +117,11 @@ public class PropertyManagementController {
return new Result().ok(map);
}
/**
* 物业管理-修改
* @param formDTO
* @return
*/
@PostMapping("update")
public Result update(@RequestBody IcPropertyManagementFormDTO formDTO){
//效验数据
@ -92,12 +130,178 @@ public class PropertyManagementController {
return new Result();
}
/**
* 物业管理-删除
* @param formDTO
* @return
*/
@PostMapping("delete")
public Result delete(@RequestBody IcPropertyManagementFormDTO formDTO){
//效验数据
ValidatorUtils.validateEntity(formDTO, IcPropertyManagementFormDTO.DeleteGroup.class);
propertyManagementService.delete(formDTO);
propertyManagementService.delete(formDTO.getId());
return new Result();
}
/**
* 物业管理-批量删除
*
* @param ids
* @return 返回失败的id列表
*/
@PostMapping("delete-batch")
public Result<List<String>> deleteBatch(@RequestBody List<String> ids) {
if (CollectionUtils.isNotEmpty(ids)) {
List<String> failedIdList = propertyManagementService.deleteBatch(ids);
if(CollectionUtils.isEmpty(failedIdList)){
return new Result<>();
}
Result result = new Result<List<String>>().ok(failedIdList);
result.setMsg("部门物业删除失败");
result.setCode(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode());
return result;
}
return new Result();
}
/**
* 物业管理-下载导入模板
* @param response
* @throws IOException
*/
@RequestMapping(value = "download-tem", method = {RequestMethod.GET, RequestMethod.POST})
public void downloadTemplate(HttpServletResponse response) throws IOException {
response.setCharacterEncoding("UTF-8");
response.addHeader(HttpHeaders.ACCESS_CONTROL_EXPOSE_HEADERS, "Content-Disposition");
//response.setHeader(HttpHeaders.CONTENT_TYPE, "application/vnd.ms-excel");
response.setHeader(HttpHeaders.CONTENT_TYPE, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
response.setHeader(HttpHeaders.CONTENT_DISPOSITION, "attachment;filename=" + URLEncoder.encode("物业管理导入模版", "UTF-8") + ".xlsx");
InputStream is = this.getClass().getClassLoader().getResourceAsStream("excel/yantai/ic_property_management_temp.xlsx");
try {
ServletOutputStream os = response.getOutputStream();
IOUtils.copy(is, os);
} finally {
if (is != null) {
is.close();
}
}
}
/**
* 物业管理-列表导出
*
* @param tokenDto
* @param formDTO
* @param response
* @return
* @throws IOException
*/
@PostMapping("export")
public void exportIcPropertyManagement(@LoginUser TokenDto tokenDto, @RequestBody IcPropertyManagementFormDTO formDTO, HttpServletResponse response) throws IOException {
formDTO.setCustomerId(tokenDto.getCustomerId());
ExcelWriter excelWriter = null;
formDTO.setPageNo(NumConstant.ONE);
formDTO.setPageSize(NumConstant.TEN_THOUSAND);
try {
String fileName = "物业管理" + DateUtils.format(new Date()) + ".xlsx";
WriteCellStyle headWriteCellStyle = new WriteCellStyle();
headWriteCellStyle.setFillForegroundColor(IndexedColors.PALE_BLUE.getIndex());
WriteCellStyle contentWriteCellStyle = new WriteCellStyle();
contentWriteCellStyle.setVerticalAlignment(VerticalAlignment.CENTER);
HorizontalCellStyleStrategy horizontalCellStyleStrategy = new HorizontalCellStyleStrategy(headWriteCellStyle, contentWriteCellStyle);
FreezeAndFilter writeHandler = new FreezeAndFilter();
excelWriter = EasyExcel.write(ExcelUtils.getOutputStreamForExcel(fileName, response), IcPropertyManagementDTO.class)
.registerWriteHandler(horizontalCellStyleStrategy)
.registerWriteHandler(new LongestMatchColumnWidthStyleStrategy())
.registerWriteHandler(writeHandler).build();
WriteSheet writeSheet = EasyExcel.writerSheet("Sheet1").registerWriteHandler(new FreezeAndFilter()).build();
PageData<IcPropertyManagementDTO> data = null;
do {
data = propertyManagementService.page(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getName(), formDTO.getContactName(), formDTO.getContactMobile());
formDTO.setPageNo(formDTO.getPageNo() + NumConstant.ONE);
excelWriter.write(data.getList(), writeSheet);
} while (CollectionUtils.isNotEmpty(data.getList()) && data.getList().size() == formDTO.getPageSize());
} catch (EpmetException e) {
response.reset();
response.setCharacterEncoding("UTF-8");
response.setHeader("content-type", "application/json; charset=UTF-8");
PrintWriter printWriter = response.getWriter();
Result<Object> result = new Result<>().error(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), e.getMsg());
printWriter.write(JSON.toJSONString(result));
printWriter.close();
} catch (Exception e) {
log.error("物业管理导出异常export exception", e);
} finally {
if (excelWriter != null) {
excelWriter.finish();
}
}
}
/**
* 获取物业详情
*
* @param id
* @return
*/
@PostMapping("detail/{id}")
public Result<IcPropertyManagementDTO> getDetail(@PathVariable("id") String id) {
if (StringUtils.isBlank(id)) {
return new Result<>();
}
return new Result<IcPropertyManagementDTO>().ok(propertyManagementService.getDetail(id));
}
/**
* 导入excel
*
* @return
*/
@PostMapping("import")
public Result importExcel(@RequestPart("file") MultipartFile file) {
// 1.暂存文件
String originalFilename = file.getOriginalFilename();
String extName = originalFilename.substring(originalFilename.lastIndexOf("."));
Path fileSavePath;
try {
Path importPath = FileUtils.getAndCreateDirUnderEpmetFilesDir(ImportTaskConstants.IC_PROPERTY_MANAGEMENT, "import");
fileSavePath = importPath.resolve(UUID.randomUUID().toString().concat(extName));
} catch (IOException e) {
String errorMsg = ExceptionUtils.getErrorStackTrace(e);
log.error("【物业管理导入】创建临时存储文件失败:{}", errorMsg);
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "文件上传失败", "文件上传失败");
}
InputStream is = null;
FileOutputStream os = null;
try {
is = file.getInputStream();
os = new FileOutputStream(fileSavePath.toString());
IOUtils.copy(is, os);
} catch (Exception e) {
log.error(ImportTaskConstants.IC_PROPERTY_MANAGEMENT + "表 importExcel exception", e);
} finally {
org.apache.poi.util.IOUtils.closeQuietly(is);
org.apache.poi.util.IOUtils.closeQuietly(os);
}
// 2.生成导入任务记录
ImportTaskCommonResultDTO rstData = getResultDataOrThrowsException(
ImportTaskUtils.createImportTask(originalFilename, ImportTaskConstants.IC_PROPERTY_MANAGEMENT),
ServiceConstant.EPMET_COMMON_SERVICE,
EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),
"物业管理导入excel错误",
"物业管理导入excel错误");
// 3.执行导入
propertyManagementService.execAsyncExcelImport(fileSavePath, rstData.getTaskId());
return new Result();
}
}

38
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/StaffController.java

@ -8,16 +8,23 @@ import com.epmet.commons.tools.constant.AppClientConstant;
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.ExceptionUtils;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
import com.epmet.service.StaffService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.io.InputStream;
import java.net.URLEncoder;
import java.util.List;
/**
@ -25,6 +32,7 @@ import java.util.List;
* @author zhaoqifeng
* @date 2020/4/23 17:59
*/
@Slf4j
@RestController
@RequestMapping("staff")
public class StaffController {
@ -251,4 +259,34 @@ public class StaffController {
return new Result<List<StaffOrgListResultDTO>>().ok(staffService.staffOrgList(tokenDto));
}
/**
* 下载工作人员导入excel模板
*
* @return
*/
@PostMapping("import/download-template")
public void downloadIcResiDownloadTemplate(HttpServletResponse response) {
InputStream is = null;
ServletOutputStream os = null;
try {
os = response.getOutputStream();
is = this.getClass().getClassLoader().getResourceAsStream("excel/customer_staff_import_template.xlsx");
response.setHeader("Access-Control-Expose-Headers", "Content-Disposition");
response.setHeader("content-Type", "application/vnd.ms-excel");
response.setHeader("Content-Disposition", "attachment;fileName=" + URLEncoder.encode("工作人员导入模板.xlsx", "UTF-8"));
IOUtils.copy(is, os);
} catch (Exception e) {
String errorStackTrace = ExceptionUtils.getErrorStackTrace(e);
log.error("下载工作人员导入模板失败:{}", errorStackTrace);
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "下载工作人员导入模板失败");
} finally {
org.apache.poi.util.IOUtils.closeQuietly(is);
org.apache.poi.util.IOUtils.closeQuietly(os);
}
}
}

50
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CommunityBuildingManagerDao.java

@ -0,0 +1,50 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.result.yt.CommunityBuildingManagerResultDTO;
import com.epmet.entity.CommunityBuildingManagerEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 楼长单元长信息表烟台
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2023-05-06
*/
@Mapper
public interface CommunityBuildingManagerDao extends BaseDao<CommunityBuildingManagerEntity> {
/**
* 楼长单元长分页列表查询
* @param customerId
* @param orgIdPath
* @param name
* @param phone
* @param idCard
* @param type
* @param districtId
* @param streetId
* @param communityId
* @param gridId
* @param viliageId
* @param buildingId
* @param unitId
* @return
*/
List<CommunityBuildingManagerResultDTO> pageList(@Param("customerId") String customerId,
@Param("orgIdPath")String orgIdPath,
@Param("name")String name,
@Param("phone")String phone,
@Param("idCard")String idCard,
@Param("type")String type,
@Param("districtId")String districtId,
@Param("streetId")String streetId,
@Param("communityId")String communityId,
@Param("gridId")String gridId,
@Param("viliageId")String viliageId,
@Param("buildingId")String buildingId,
@Param("unitId")String unitId,
@Param("id")String id);
}

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

@ -224,4 +224,17 @@ public interface IcNeighborHoodDao extends BaseDao<IcNeighborHoodEntity> {
IcNeighborHoodEntity getNeighborHoodInfoByName(CheckHouseInfoFormDTO formDTO);
List<OptionResultDTO> queryNeighborHoodOptions(NeighborHoodOptionFormDTO formDTO);
/**
* label: xxx网格-xxx小区
* @param customerId
* @param agencyId
* @param gridId
* @param neighborHoodName
* @return
*/
List<OptionResultDTO> queryNeighborHoodOptionsYanTai(@Param("customerId") String customerId,
@Param("agencyId") String agencyId,
@Param("gridId") String gridId,
@Param("neighborHoodName") String neighborHoodName);
}

12
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcNeighborHoodPropertyDao.java

@ -18,8 +18,12 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.IcNeighborHoodDTO;
import com.epmet.entity.IcNeighborHoodPropertyEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 小区物业关系表
@ -29,5 +33,11 @@ import org.apache.ibatis.annotations.Mapper;
*/
@Mapper
public interface IcNeighborHoodPropertyDao extends BaseDao<IcNeighborHoodPropertyEntity> {
/**
* 查询物业下的小区名称
* @param propertyId 物业id
* @param agencyId 组织id
* @return 当前物业在 当前组织及下级范围内管理的小区数量
*/
List<IcNeighborHoodDTO> getNeighborHoodList(@Param("propertyId") String propertyId, @Param("agencyId") String agencyId);
}

6
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPropertyManagementDao.java

@ -59,5 +59,9 @@ public interface IcPropertyManagementDao extends BaseDao<IcPropertyManagementEnt
*/
List<IcPropertyManagementDTO> selectPropertyNameList(String neighborhoodId);
List<IcPropertyManagementDTO> queryList(@Param("customerId") String customerId,@Param("name")String name);
List<IcPropertyManagementDTO> queryList(@Param("customerId") String customerId,
@Param("name")String name,
@Param("contactName") String contactName,
@Param("contactMobile") String contactMobile,
@Param("agencyId")String agencyId);
}

86
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CommunityBuildingManagerEntity.java

@ -0,0 +1,86 @@
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 2023-05-06
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("community_building_manager")
public class CommunityBuildingManagerEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户Id customer.id
*/
private String customerId;
/**
* 姓名
*/
private String name;
/**
* 联系电话
*/
private String phone;
/**
* 身份证号
*/
private String idCard;
/**
* 类型0楼长1单元长
*/
private String type;
/**
* 所属区县id取名字关联customer_agency
*/
private String districtId;
/**
* 所属街道id取名字关联customer_agency
*/
private String streetId;
/**
* 所属社区id取名字关联customer_agency
*/
private String communityId;
/**
* 所属网格id取名字关联customer_grid
*/
private String gridId;
/**
* 网格的全路径包含网格id
*/
private String orgIdPath;
/**
* 所属小区id
*/
private String viliageId;
/**
* 所属楼栋id
*/
private String buildingId;
/**
* 所属单元id; 单元长时必填此列
*/
private String unitId;
}

27
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerAgencyEntity.java

@ -149,4 +149,31 @@ public class CustomerAgencyEntity extends BaseEpmetEntity {
*/
private String remark;
/**
* 村居/社区书记姓名
*/
private String secretaryName;
/**
* 村居/社区书记电话
*/
private String secretaryMobile;
/**
* 值班电话
*/
private String dutyMobile;
/**
* 统一社会信用代码
*/
private String unifiedSocialCreditCode;
/**
* 统一社会信用代码证书图片附件
*/
private String unifiedSocialCreditCodeCertificate;
/**
* 详细地址
*/
private String fullAddress;
}

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

@ -136,4 +136,12 @@ public class IcHouseEntity extends BaseEpmetEntity {
* 房屋可编辑编码
*/
private String coding;
/**
* 所在楼层
*/
private String floor;
/**
* 面积
*/
private String area;
}

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

@ -121,4 +121,21 @@ public class IcNeighborHoodEntity extends BaseEpmetEntity {
* 二维码地址
*/
private String qrcodeUrl;
/**
* 烟台需求自然村/小区
*/
private String viliageType;
/**
* 烟台需求面积
*/
private String area;
/**
* 烟台需求开放类型
*/
private String openType;
/**
* 烟台需求建筑年代
*/
private String buildYear;
}

9
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcPropertyManagementEntity.java

@ -40,4 +40,13 @@ public class IcPropertyManagementEntity extends BaseEpmetEntity {
*/
private String name;
private String customerId;
/**
* 烟台需求物业联系人姓名
*/
private String contactName;
/**
* 烟台需求物业联系人电话
*/
private String contactMobile;
}

120
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/handler/IcPropertyManagementImportListener.java

@ -0,0 +1,120 @@
package com.epmet.excel.handler;
import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.read.listener.ReadListener;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.exception.ExceptionUtils;
import com.epmet.commons.tools.exception.ValidateException;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.ObjectUtil;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.entity.IcPropertyManagementEntity;
import com.epmet.excel.yt.IcPropertyManagementImportExcelData;
import com.epmet.service.impl.IcPropertyManagementServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import java.util.ArrayList;
import java.util.List;
/**
* @Description
* @Author yzm
* @Date 2023/5/8 14:23
*/
@Slf4j
public class IcPropertyManagementImportListener implements ReadListener<IcPropertyManagementImportExcelData> {
// 最大条数阈值
public static final int MAX_THRESHOLD = 200;
private String currentCustomerId;
private IcPropertyManagementServiceImpl propertyManagementService;
// 错误项列表
private List<IcPropertyManagementImportExcelData.ErrorRow> errorRows = new ArrayList<>();
// 要插入的数据
private List<IcPropertyManagementEntity> insertDatas = new ArrayList<>();
private List<IcPropertyManagementEntity> updateDatas = new ArrayList<>();
public IcPropertyManagementImportListener(String customerId, IcPropertyManagementServiceImpl propertyManagementService) {
this.currentCustomerId = customerId;
this.propertyManagementService = propertyManagementService;
}
@Override
public void invoke(IcPropertyManagementImportExcelData data, AnalysisContext analysisContext) {
try {
// log.warn("有数据吗?"+JSON.toJSONString(data));
// 不能为空先校验数据
ValidatorUtils.validateEntity(data);
// 去除空格
ObjectUtil.objectToTrim(data);
//物业名称唯一
IcPropertyManagementEntity origin=propertyManagementService.getByName(currentCustomerId, data.getName());
IcPropertyManagementEntity propertyManagementEntity = ConvertUtils.sourceToTarget(data, IcPropertyManagementEntity.class);
propertyManagementEntity.setCustomerId(currentCustomerId);
if (null != origin) {
origin.setContactMobile(data.getContactMobile());
origin.setContactName(data.getContactName());
updateDatas.add(origin);
} else {
insertDatas.add(propertyManagementEntity);
}
if (insertDatas.size() == MAX_THRESHOLD) {
execPersist();
}
if (updateDatas.size() == MAX_THRESHOLD) {
execPersist();
}
} catch (Exception e) {
String errorMsg = null;
if (e instanceof ValidateException) {
errorMsg = ((ValidateException) e).getMsg();
} else if (e instanceof EpmetException) {
errorMsg = ((EpmetException) e).getInternalMsg();
} else {
errorMsg = "未知错误";
log.error("【物业管理表ic_property_management导入】出错:{}", ExceptionUtils.getErrorStackTrace(e));
}
IcPropertyManagementImportExcelData.ErrorRow errorRow = ConvertUtils.sourceToTarget(data, IcPropertyManagementImportExcelData.ErrorRow.class);
errorRow.setErrorInfo(errorMsg);
errorRows.add(errorRow);
}
}
@Override
public void doAfterAllAnalysed(AnalysisContext analysisContext) {
// 最后几条达不到阈值,这里必须再调用一次
execPersist();
}
/**
* 执行持久化
*/
private void execPersist() {
try {
if (CollectionUtils.isNotEmpty(insertDatas)) {
propertyManagementService.insertBatch(insertDatas);
}
if (CollectionUtils.isNotEmpty(updateDatas)) {
propertyManagementService.updateBatchById(updateDatas);
}
} finally {
insertDatas.clear();
updateDatas.clear();
}
}
/**
* 获取错误行
*
* @return
*/
public List<IcPropertyManagementImportExcelData.ErrorRow> getErrorRows() {
return errorRows;
}
}

61
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/yt/IcPropertyManagementImportExcelData.java

@ -0,0 +1,61 @@
package com.epmet.excel.yt;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import lombok.Data;
import javax.validation.constraints.NotBlank;
/**
* @Description
* @Author yzm
* @Date 2023/5/8 14:24
*/
@Data
public class IcPropertyManagementImportExcelData {
/**
* 物业名称
*/
@NotBlank(message = "物业名称必填")
@ExcelProperty(value = "*物业名称")
private String name;
/**
* 烟台需求物业联系人姓名
*/
@ExcelProperty(value = "物业联系人")
private String contactName;
/**
* 烟台需求物业联系人电话
*/
@ExcelProperty(value = "联系电话")
private String contactMobile;
@Data
public static class ErrorRow {
/**
* 物业名称
*/
@ExcelProperty(value = "*物业名称")
private String name;
/**
* 烟台需求物业联系人姓名
*/
@ExcelProperty(value = "物业联系人")
private String contactName;
/**
* 烟台需求物业联系人电话
*/
@ExcelProperty(value = "联系电话")
private String contactMobile;
@ColumnWidth(60)
@ExcelProperty("错误信息")
private String errorInfo;
}
}

69
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CommunityBuildingManagerService.java

@ -0,0 +1,69 @@
package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.form.yt.CommunityBuildingManagerPageFormDTO;
import com.epmet.dto.result.CommunityBuildingManagerDTO;
import com.epmet.dto.result.yt.CommunityBuildingManagerResultDTO;
import com.epmet.entity.CommunityBuildingManagerEntity;
import java.nio.file.Path;
import java.util.List;
/**
* 楼长单元长信息表烟台
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2023-05-06
*/
public interface CommunityBuildingManagerService extends BaseService<CommunityBuildingManagerEntity> {
/**
* 默认分页
*
* @param formDTO
* @return PageData<CommunityBuildingManagerResultDTO>
* @author generator
* @date 2023-05-06
*/
PageData<CommunityBuildingManagerResultDTO> page(CommunityBuildingManagerPageFormDTO formDTO);
/**
* 查看详情
*
* @param id
* @return CommunityBuildingManagerResultDTO
* @author generator
* @date 2023-05-06
*/
CommunityBuildingManagerResultDTO get(String id);
/**
* 新增楼长/单元长
* todo: 同步到具体的楼栋表
*
* @param dto
* @return
*/
void save(CommunityBuildingManagerDTO dto);
/**
* 编辑楼长/单元长
* todo: 同步到具体的楼栋
*
* @param dto
* @return
*/
void update(CommunityBuildingManagerDTO dto);
/**
* 批量删除楼长/单元长
* todo: 同时清空楼栋表里的信息
*
* @param ids
* @return
*/
void delete(List<String> ids);
void execAsyncExcelImport(Path fileSavePath, String taskId);
}

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

@ -203,4 +203,11 @@ public interface IcNeighborHoodService extends BaseService<IcNeighborHoodEntity>
* @return
*/
List<OptionResultDTO> queryNeighborHoodOptions(NeighborHoodOptionFormDTO formDTO);
/**
* 小区下拉框小区名xxx网格-xxx小区
* @param formDTO
* @return
*/
List<OptionResultDTO> queryNeighborHoodOptionsYanTai(NeighborHoodOptionFormDTO formDTO);
}

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

@ -92,4 +92,13 @@ public interface IcPropertyManagementService extends BaseService<IcPropertyManag
* @date 2021-10-25
*/
void delete(String[] ids);
/**
* 物业名称客户下唯一
* 这里返回值是对象
* @param customerId
* @param name
* @return
*/
IcPropertyManagementEntity getByName(String customerId,String name);
}

44
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/PropertyManagementService.java

@ -22,6 +22,7 @@ import com.epmet.dto.IcPropertyManagementDTO;
import com.epmet.dto.form.IcPropertyManagementFormDTO;
import com.epmet.dto.result.IcPropertyManagementResultDTO;
import java.nio.file.Path;
import java.util.List;
/**
@ -37,7 +38,46 @@ public interface PropertyManagementService {
String add(IcPropertyManagementFormDTO formDTO);
void update(IcPropertyManagementFormDTO formDTO);
void delete(IcPropertyManagementFormDTO formDTO);
/**
* 物业管理批量删除
* @param id
*/
void delete(String id);
PageData<IcPropertyManagementDTO> page(Integer pageNo, Integer pageSize, String name);
/**
* 物业管理-列表查询
* @param pageNo
* @param pageSize
* @param name 物业名称
* @param contactName 物业联系人
* @param contactMobile 联系电话
* @return
*/
PageData<IcPropertyManagementDTO> page(Integer pageNo,
Integer pageSize,
String name,
String contactName,
String contactMobile);
/**
* 查看物业详情
* @param id
* @return
*/
IcPropertyManagementDTO getDetail(String id);
/**
*
* @param fileSavePath
* @param taskId
*/
void execAsyncExcelImport(Path fileSavePath, String taskId);
/**
* 物业管理批量删除
*
* @param ids
* @return 返回失败的id列表
*/
List<String> deleteBatch(List<String> ids);
}

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

@ -168,6 +168,12 @@ public class AgencyServiceImpl implements AgencyService {
originalEntity.setContacts(formDTO.getContacts());
originalEntity.setMobile(formDTO.getMobile());
originalEntity.setRemark(formDTO.getRemark());
originalEntity.setSecretaryName(formDTO.getSecretaryName());
originalEntity.setSecretaryMobile(formDTO.getSecretaryMobile());
originalEntity.setDutyMobile(formDTO.getDutyMobile());
originalEntity.setUnifiedSocialCreditCode(formDTO.getUnifiedSocialCreditCode());
originalEntity.setUnifiedSocialCreditCodeCertificate(formDTO.getUnifiedSocialCreditCodeCertificate());
originalEntity.setFullAddress(formDTO.getFullAddress());
//利用mybatis 拦截器填充值
originalEntity.setUpdatedTime(null);
originalEntity.setUpdatedBy(null);

191
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CommunityBuildingManagerServiceImpl.java

@ -0,0 +1,191 @@
package com.epmet.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.EpmetRequestHolder;
import com.epmet.commons.tools.utils.PidUtils;
import com.epmet.commons.tools.utils.SpringContextUtils;
import com.epmet.dao.CommunityBuildingManagerDao;
import com.epmet.dto.CustomerGridDTO;
import com.epmet.dto.form.yt.CommunityBuildingManagerPageFormDTO;
import com.epmet.dto.result.CommunityBuildingManagerDTO;
import com.epmet.dto.result.yt.CommunityBuildingManagerResultDTO;
import com.epmet.entity.CommunityBuildingManagerEntity;
import com.epmet.service.CommunityBuildingManagerService;
import com.epmet.service.CustomerGridService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import java.nio.file.Path;
import java.util.Date;
import java.util.List;
/**
* 楼长单元长信息表烟台
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2023-05-06
*/
@Slf4j
@Service
public class CommunityBuildingManagerServiceImpl extends BaseServiceImpl<CommunityBuildingManagerDao, CommunityBuildingManagerEntity> implements CommunityBuildingManagerService {
/**
* 列表分页查询
*
* @param formDTO
* @return
*/
@Override
public PageData<CommunityBuildingManagerResultDTO> page(CommunityBuildingManagerPageFormDTO formDTO) {
// 默认查询本组织及下级
CustomerStaffInfoCacheResult staffInfoCacheResult = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId());
if (null == staffInfoCacheResult) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "查询工作人员信息异常staffId:" + formDTO.getStaffId(), "查询工作人员信息异常");
}
formDTO.setOrgIdPath(PidUtils.convertPid2OrgIdPath(staffInfoCacheResult.getAgencyId(), staffInfoCacheResult.getAgencyPIds()));
PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize());
List<CommunityBuildingManagerResultDTO> resList = baseDao.pageList(formDTO.getCustomerId(),
formDTO.getOrgIdPath(),
formDTO.getName(),
formDTO.getPhone(),
formDTO.getIdCard(),
formDTO.getType(),
formDTO.getDistrictId(),
formDTO.getStreetId(),
formDTO.getCommunityId(),
formDTO.getGridId(),
formDTO.getViliageId(),
formDTO.getBuildingId(),
formDTO.getUnitId(), null);
PageInfo<CommunityBuildingManagerResultDTO> pageInfo = new PageInfo<>(resList);
return new PageData<>(resList, pageInfo.getTotal(), formDTO.getPageSize());
}
/**
* 查看详情
*
* @param id
* @return
*/
@Override
public CommunityBuildingManagerResultDTO get(String id) {
List<CommunityBuildingManagerResultDTO> resList = baseDao.pageList(EpmetRequestHolder.getLoginUserCustomerId(),
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null, id);
if (CollectionUtils.isEmpty(resList)) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "community_building_manager表记录不存在:id:" + id, "记录不存在");
}
return resList.get(NumConstant.ZERO);
}
/**
* 新增楼长/单元长
* todo: 同步到具体的楼栋表
*
* @param addFormDto
* @return
*/
@Override
@Transactional(rollbackFor = Exception.class)
public void save(CommunityBuildingManagerDTO addFormDto) {
// 唯一性判断,类型+楼栋id或者类型+单元id唯一
checkUnqiue(addFormDto.getType(), addFormDto.getBuildingId(), addFormDto.getUnitId(), null);
CommunityBuildingManagerEntity entity = ConvertUtils.sourceToTarget(addFormDto, CommunityBuildingManagerEntity.class);
CustomerGridDTO gridDTO = SpringContextUtils.getBean(CustomerGridService.class).get(addFormDto.getGridId());
entity.setOrgIdPath(PidUtils.convertPid2OrgIdPath(gridDTO.getId(), gridDTO.getPids()));
insert(entity);
}
private void checkUnqiue(String type, String buildingId, String unitId, String id) {
// 1号楼只允许有一个楼长
// 1号楼只允许有一个单元长
LambdaQueryWrapper<CommunityBuildingManagerEntity> countQuery = new LambdaQueryWrapper<>();
countQuery.eq(CommunityBuildingManagerEntity::getType, type)
.eq(CommunityBuildingManagerEntity::getBuildingId, buildingId)
.eq(StringUtils.isNotBlank(unitId), CommunityBuildingManagerEntity::getUnitId, unitId)
.ne(StringUtils.isNotBlank(id), CommunityBuildingManagerEntity::getId, id);
if (baseDao.selectCount(countQuery) > NumConstant.ZERO) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "所选楼栋(单元)已存在楼长(单元长)", "所选楼栋(单元)已存在楼长(单元长)");
}
}
/**
* 编辑楼长/单元长
* todo: 同步到具体的楼栋
*
* @param updateFormDto
* @return
*/
@Override
@Transactional(rollbackFor = Exception.class)
public void update(CommunityBuildingManagerDTO updateFormDto) {
checkUnqiue(updateFormDto.getType(), updateFormDto.getBuildingId(), updateFormDto.getUnitId(), updateFormDto.getId());
CommunityBuildingManagerEntity entity = ConvertUtils.sourceToTarget(updateFormDto, CommunityBuildingManagerEntity.class);
CustomerGridDTO gridDTO = SpringContextUtils.getBean(CustomerGridService.class).get(updateFormDto.getGridId());
entity.setOrgIdPath(PidUtils.convertPid2OrgIdPath(gridDTO.getId(), gridDTO.getPids()));
updateById(entity);
}
/**
* 批量删除楼长/单元长
* todo: 同时清空楼栋表里的信息
*
* @param ids
* @return
*/
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(List<String> ids) {
Date now=new Date();
ids.forEach(id->{
LambdaUpdateWrapper<CommunityBuildingManagerEntity> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(CommunityBuildingManagerEntity::getId, id)
.set(CommunityBuildingManagerEntity::getDelFlag, NumConstant.ONE_STR)
.set(CommunityBuildingManagerEntity::getUpdatedBy, EpmetRequestHolder.getLoginUserId())
.set(CommunityBuildingManagerEntity::getUpdatedTime, now);
baseDao.update(null, updateWrapper);
// todo
});
}
/**
* 执行Excel导入
*
* @param filePath
* @param importTaskId
*/
@Async
@Override
public void execAsyncExcelImport(Path filePath, String importTaskId) {
// todo
return;
}
}

20
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java

@ -18,7 +18,6 @@
package com.epmet.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
@ -45,7 +44,6 @@ import com.epmet.constant.CustomerGridConstant;
import com.epmet.dao.*;
import com.epmet.dto.*;
import com.epmet.dto.form.*;
import com.epmet.dto.region.LogOperationResultDTO;
import com.epmet.dto.result.*;
import com.epmet.entity.CustomerAgencyEntity;
import com.epmet.entity.CustomerDepartmentEntity;
@ -136,12 +134,16 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl<CustomerAgencyDao
return ConvertUtils.sourceToTarget(entityList, CustomerAgencyDTO.class);
}
private QueryWrapper<CustomerAgencyEntity> getWrapper(Map<String, Object> params) {
String id = (String) params.get(FieldConstant.ID_HUMP);
QueryWrapper<CustomerAgencyEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
private LambdaQueryWrapper<CustomerAgencyEntity> getWrapper(Map<String, Object> map) {
String id = map.containsKey(FieldConstant.ID_HUMP) ? (String) map.get(FieldConstant.ID_HUMP) : null;
String customerId = map.containsKey("CUSTOMER_ID") ? (String) map.get("CUSTOMER_ID") : null;
String level = map.containsKey("LEVEL") ? (String) map.get("LEVEL") : null;
String pid = map.containsKey("PID") ? (String) map.get("PID") : null;
LambdaQueryWrapper<CustomerAgencyEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), CustomerAgencyEntity::getId, id)
.eq(StringUtils.isNotBlank(customerId), CustomerAgencyEntity::getCustomerId, customerId)
.eq(StringUtils.isNotBlank(level), CustomerAgencyEntity::getLevel, level)
.eq(StringUtils.isNotBlank(pid), CustomerAgencyEntity::getPid, pid);
return wrapper;
}
@ -1265,7 +1267,7 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl<CustomerAgencyDao
/**
* 递归查询子节点
* @param root 根节点
* @param all 所有节点
* @param 所有节点
* @return 根节点信息
*/
private void convert2AgencyTreeResult(AgencyTreeResultDTO root, List<ExtStaffPermissionResultDTO> agencyList, List<ExtGridResultDTO> gridList) {

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

@ -243,6 +243,8 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver {
icHouseDTO.setHouseTypeName(HouseTypeEnums.getTypeValue(formDTO.getHouseType()));
icHouseDTO.setPurposeName(HousePurposeEnums.getTypeValue(formDTO.getPurpose()));
icHouseDTO.setRentName(HouseRentFlagEnums.getTypeValue(formDTO.getRentFlag()));
icHouseDTO.setFloor(formDTO.getFloor());
icHouseDTO.setArea(formDTO.getArea());
//设置
icHouseDTO.setHouseName(getHouseName(formDTO));
icHouseDTO.setFullName(icHouseService.getFullName(formDTO.getNeighborHoodId(), formDTO.getBuildingId(), formDTO.getBuildingUnitId(), formDTO.getDoorName()));

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

@ -835,6 +835,23 @@ public class IcNeighborHoodServiceImpl extends BaseServiceImpl<IcNeighborHoodDao
result.setGridName(gridInfoCache.getGridName());
}
result.setPropertyList(propertyManagementDao.selectPropertyNameList(neighborhoodId));
if (StringUtils.isNotBlank(result.getOpenType())){
if (result.getOpenType().equals("1")){
result.setOpenTypeName("封闭式");
}
if (result.getOpenType().equals("2")){
result.setOpenTypeName("开放式");
}
}
if (StringUtils.isNotBlank(result.getViliageType())){
if (result.getViliageType().equals("1")){
result.setViliageTypeName("住宅小区");
}
if (result.getViliageType().equals("2")){
result.setViliageTypeName("自然村");
}
}
return new Result<IcNeighborHoodDetailDTO>().ok(result);
}
@ -856,9 +873,20 @@ public class IcNeighborHoodServiceImpl extends BaseServiceImpl<IcNeighborHoodDao
}
/**
* 小区下拉框小区名xxx网格-xxx小区
*
* @param formDTO
* @return
*/
@Override
public List<OptionResultDTO> queryNeighborHoodOptionsYanTai(NeighborHoodOptionFormDTO formDTO) {
if (StringUtils.isBlank(formDTO.getGridId()) && StringUtils.isBlank(formDTO.getAgencyId())) {
// 默认查询当前工作人员所属组织及下级的
CustomerStaffInfoCacheResult staffInfoCacheResult = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId());
formDTO.setAgencyId(staffInfoCacheResult.getAgencyId());
}
List<OptionResultDTO> list = baseDao.queryNeighborHoodOptionsYanTai(formDTO.getCustomerId(),formDTO.getAgencyId(),formDTO.getGridId(),formDTO.getNeighborHoodName());
return list;
}
}

7
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPropertyManagementServiceImpl.java

@ -17,6 +17,7 @@
package com.epmet.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
@ -97,4 +98,10 @@ public class IcPropertyManagementServiceImpl extends BaseServiceImpl<IcPropertyM
baseDao.deleteBatchIds(Arrays.asList(ids));
}
@Override
public IcPropertyManagementEntity getByName(String customerId, String name) {
LambdaQueryWrapper<IcPropertyManagementEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(IcPropertyManagementEntity::getCustomerId,customerId).eq(IcPropertyManagementEntity::getName,name);
return baseDao.selectOne(wrapper);
}
}

314
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/PropertyManagementServiceImpl.java

@ -1,37 +1,75 @@
package com.epmet.service.impl;
import com.alibaba.excel.EasyExcel;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.exception.ExceptionUtils;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.EpmetRequestHolder;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.utils.*;
import com.epmet.constants.ImportTaskConstants;
import com.epmet.dao.IcNeighborHoodPropertyDao;
import com.epmet.dao.IcPropertyManagementDao;
import com.epmet.dto.IcNeighborHoodDTO;
import com.epmet.dto.IcPropertyManagementDTO;
import com.epmet.dto.form.IcPropertyManagementFormDTO;
import com.epmet.dto.form.ImportTaskCommonFormDTO;
import com.epmet.dto.result.IcPropertyManagementResultDTO;
import com.epmet.dto.result.UploadImgResultDTO;
import com.epmet.entity.IcNeighborHoodPropertyEntity;
import com.epmet.entity.IcPropertyManagementEntity;
import com.epmet.excel.handler.IcPropertyManagementImportListener;
import com.epmet.excel.yt.IcPropertyManagementImportExcelData;
import com.epmet.feign.EpmetCommonServiceOpenFeignClient;
import com.epmet.feign.OssFeignClient;
import com.epmet.service.PropertyManagementService;
import com.epmet.utils.ImportTaskUtils;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.fileupload.FileItem;
import org.apache.commons.fileupload.disk.DiskFileItemFactory;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.entity.ContentType;
import org.apache.poi.util.IOUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.commons.CommonsMultipartFile;
import javax.annotation.Resource;
import java.io.IOException;
import java.io.OutputStream;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.UUID;
import java.util.stream.Collectors;
@Slf4j
@Service
public class PropertyManagementServiceImpl implements PropertyManagementService {
/**
* 物业表
*/
@Resource
private IcPropertyManagementDao icPropertyManagementDao;
@Resource
private IcNeighborHoodPropertyDao icNeighborHoodPropertyDao;
@Autowired
private EpmetCommonServiceOpenFeignClient commonServiceOpenFeignClient;
@Autowired
private OssFeignClient ossFeignClient;
/**
* 查询当前客户下的物业
@ -55,55 +93,289 @@ public class PropertyManagementServiceImpl implements PropertyManagementService
/**
* 新增物业
* 名称客户下唯一
*
* @param formDTO
* @return
*/
@Override
@Transactional(rollbackFor = Exception.class)
public String add(IcPropertyManagementFormDTO formDTO) {
//物业名字平台内唯一
//如果输入的物业名字已经存在,直接返回物业id
// 物业名字平台内唯一
// 如果输入的物业名字已经存在,直接返回物业id
formDTO.setName(formDTO.getName().trim());
IcPropertyManagementEntity entity = icPropertyManagementDao.selectByName(formDTO.getCustomerId(),formDTO.getName(),null);
IcPropertyManagementEntity entity = icPropertyManagementDao.selectByName(formDTO.getCustomerId(), formDTO.getName(), null);
if (null != entity) {
return entity.getId();
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "物业名称已存在", "物业名称已存在");
}
IcPropertyManagementEntity icPropertyManagementEntity = ConvertUtils.sourceToTarget(formDTO, IcPropertyManagementEntity.class);
icPropertyManagementDao.insert(icPropertyManagementEntity);
if (CollectionUtils.isNotEmpty(formDTO.getNeighborHoodIdList())) {
formDTO.getNeighborHoodIdList().forEach(neighborHoodId -> {
// 插入小区物业关系表
IcNeighborHoodPropertyEntity neighborHoodPropertyEntity = new IcNeighborHoodPropertyEntity();
neighborHoodPropertyEntity.setPropertyId(icPropertyManagementEntity.getId());
neighborHoodPropertyEntity.setNeighborHoodId(neighborHoodId);
icNeighborHoodPropertyDao.insert(neighborHoodPropertyEntity);
});
}
return icPropertyManagementEntity.getId();
}
/**
* 物业管理-修改
*
* @param formDTO
*/
@Override
@Transactional(rollbackFor = Exception.class)
public void update(IcPropertyManagementFormDTO formDTO) {
IcPropertyManagementEntity entity = icPropertyManagementDao.selectByName(EpmetRequestHolder.getLoginUserCustomerId(),formDTO.getName(),formDTO.getId());
IcPropertyManagementEntity entity = icPropertyManagementDao.selectByName(EpmetRequestHolder.getLoginUserCustomerId(), formDTO.getName(), formDTO.getId());
if (null != entity) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"物业名称已存在","物业名称已存在");
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "物业名称已存在", "物业名称已存在");
}
LambdaUpdateWrapper<IcPropertyManagementEntity> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(IcPropertyManagementEntity::getId, formDTO.getId())
.set(IcPropertyManagementEntity::getName, formDTO.getName())
.set(IcPropertyManagementEntity::getContactName, formDTO.getContactName())
.set(IcPropertyManagementEntity::getContactMobile, formDTO.getContactMobile())
.set(IcPropertyManagementEntity::getUpdatedTime, new Date())
.set(IcPropertyManagementEntity::getUpdatedBy, EpmetRequestHolder.getLoginUserId());
icPropertyManagementDao.update(null, updateWrapper);
CustomerStaffInfoCacheResult staffInfoCacheResult= CustomerStaffRedis.getStaffInfo(EpmetRequestHolder.getLoginUserCustomerId(),EpmetRequestHolder.getLoginUserId());
// 查询当前物业,在本组织及下级范围内,管理的小区
List<IcNeighborHoodDTO> originNeighborHoodList = icNeighborHoodPropertyDao.getNeighborHoodList(formDTO.getId(), staffInfoCacheResult.getAgencyId());
// 原来存在关联的小区,现在取消勾选了,需要删除物业小区关系表
originNeighborHoodList.forEach(origin -> {
// 举例:原来管理A小区,现在取消勾选
if (!formDTO.getNeighborHoodIdList().contains(origin.getId())) {
LambdaUpdateWrapper<IcNeighborHoodPropertyEntity> updateWrapper1 = new LambdaUpdateWrapper<>();
updateWrapper1.eq(IcNeighborHoodPropertyEntity::getPropertyId, formDTO.getId())
.eq(IcNeighborHoodPropertyEntity::getNeighborHoodId, origin.getId())
.set(IcNeighborHoodPropertyEntity::getDelFlag, NumConstant.ONE_STR)
.set(IcNeighborHoodPropertyEntity::getUpdatedTime, new Date())
.set(IcNeighborHoodPropertyEntity::getUpdatedBy, EpmetRequestHolder.getLoginUserId());
icNeighborHoodPropertyDao.update(null, updateWrapper1);
}
});
if (CollectionUtils.isNotEmpty(formDTO.getNeighborHoodIdList())) {
formDTO.getNeighborHoodIdList().forEach(neighborHoodId -> {
LambdaQueryWrapper<IcNeighborHoodPropertyEntity> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(IcNeighborHoodPropertyEntity::getPropertyId, formDTO.getId())
.eq(IcNeighborHoodPropertyEntity::getNeighborHoodId, neighborHoodId);
if (icNeighborHoodPropertyDao.selectCount(queryWrapper) < NumConstant.ONE) {
// 插入小区物业关系表
IcNeighborHoodPropertyEntity neighborHoodPropertyEntity = new IcNeighborHoodPropertyEntity();
neighborHoodPropertyEntity.setPropertyId(formDTO.getId());
neighborHoodPropertyEntity.setNeighborHoodId(neighborHoodId);
icNeighborHoodPropertyDao.insert(neighborHoodPropertyEntity);
}
//原本已经存在小区和物业的关系,不用再插入
});
}
IcPropertyManagementEntity icPropertyManagementEntity = ConvertUtils.sourceToTarget(formDTO, IcPropertyManagementEntity.class);
icPropertyManagementDao.updateById(icPropertyManagementEntity);
}
/**
* 单个删除
* @param formDTO
*
* @param id
*/
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(IcPropertyManagementFormDTO formDTO) {
LambdaQueryWrapper<IcNeighborHoodPropertyEntity> queryWrapper=new LambdaQueryWrapper<>();
queryWrapper.eq(IcNeighborHoodPropertyEntity::getPropertyId,formDTO.getId());
if (icNeighborHoodPropertyDao.selectCount(queryWrapper) > 0) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"物业存在与小区关联,无法删除","已与小区关联,无法删除");
public void delete(String id) {
Date now = new Date();
// 删除物业与小区关联关系表
LambdaUpdateWrapper<IcNeighborHoodPropertyEntity> updateWrapper1 = new LambdaUpdateWrapper<>();
updateWrapper1.eq(IcNeighborHoodPropertyEntity::getPropertyId, id)
.set(IcNeighborHoodPropertyEntity::getDelFlag, NumConstant.ONE_STR)
.set(IcNeighborHoodPropertyEntity::getUpdatedTime, now)
.set(IcNeighborHoodPropertyEntity::getUpdatedBy, EpmetRequestHolder.getLoginUserId());
icNeighborHoodPropertyDao.update(null, updateWrapper1);
// 删除物业表
LambdaUpdateWrapper<IcPropertyManagementEntity> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(IcPropertyManagementEntity::getId, id)
.set(IcPropertyManagementEntity::getDelFlag, NumConstant.ONE_STR)
.set(IcPropertyManagementEntity::getUpdatedTime, now)
.set(IcPropertyManagementEntity::getUpdatedBy, EpmetRequestHolder.getLoginUserId());
icPropertyManagementDao.update(null, updateWrapper);
}
/**
* 物业管理批量删除
*
* @param ids
* @return 返回失败的id列表
*/
@Override
@Transactional(rollbackFor = Exception.class)
public List<String> deleteBatch(List<String> ids) {
if (CollectionUtils.isEmpty(ids)) {
return new ArrayList<>();
}
icPropertyManagementDao.deleteById(formDTO.getId());
List<String> failedIdList = new ArrayList<>();
for (String id : ids) {
Boolean res =true;
try{
//调用单挑删除方法
delete(id);
}catch(EpmetException e){
res=false;
}
if (!res) {
failedIdList.add(id);
}
}
return failedIdList;
}
/**
* 物业管理-列表查询
*
* @param pageNo
* @param pageSize
* @param name 物业名称
* @param contactName 物业联系人
* @param contactMobile 联系电话
* @return
*/
@Override
public PageData<IcPropertyManagementDTO> page(Integer pageNo, Integer pageSize, String name) {
PageHelper.startPage(pageNo,pageSize);
List<IcPropertyManagementDTO> list=icPropertyManagementDao.queryList(EpmetRequestHolder.getLoginUserCustomerId(),name);
public PageData<IcPropertyManagementDTO> page(Integer pageNo, Integer pageSize, String name, String contactName, String contactMobile) {
CustomerStaffInfoCacheResult staffInfoCacheResult = CustomerStaffRedis.getStaffInfo(EpmetRequestHolder.getLoginUserCustomerId(), EpmetRequestHolder.getLoginUserId());
PageHelper.startPage(pageNo, pageSize);
List<IcPropertyManagementDTO> list = icPropertyManagementDao.queryList(EpmetRequestHolder.getLoginUserCustomerId(), name, contactName, contactMobile, staffInfoCacheResult.getAgencyId());
PageInfo<IcPropertyManagementDTO> pageInfo = new PageInfo<>(list);
return new PageData<>(list, pageInfo.getTotal());
// 导出时需要导出关联的小区名称
pageInfo.getList().forEach(result -> {
List<IcNeighborHoodDTO> neighborHoodList = icNeighborHoodPropertyDao.getNeighborHoodList(result.getId(), staffInfoCacheResult.getAgencyId());
List<String> neighborHoodNames = neighborHoodList.stream()
.map(IcNeighborHoodDTO::getNeighborHoodName)
.distinct().collect(Collectors.toList());
result.setNeighborHoodNames(CollectionUtils.isNotEmpty(neighborHoodList) ? StringUtils.join(neighborHoodNames, StrConstant.COMMA_ZH) : StrConstant.EPMETY_STR);
result.setNeighborHoodList(neighborHoodList);
result.setTotalNeighborHood(CollectionUtils.isNotEmpty(neighborHoodList)?neighborHoodList.size():NumConstant.ZERO);
});
return new PageData<>(list, pageInfo.getTotal(), pageSize);
}
/**
* 查看物业详情
*
* @param id
* @return
*/
@Override
public IcPropertyManagementDTO getDetail(String id) {
CustomerStaffInfoCacheResult staffInfoCacheResult= CustomerStaffRedis.getStaffInfo(EpmetRequestHolder.getLoginUserCustomerId(),EpmetRequestHolder.getLoginUserId());
IcPropertyManagementEntity icPropertyManagementEntity = icPropertyManagementDao.selectById(id);
if (null == icPropertyManagementEntity) {
return null;
}
IcPropertyManagementDTO resultDto = ConvertUtils.sourceToTarget(icPropertyManagementEntity, IcPropertyManagementDTO.class);
List<IcNeighborHoodDTO> neighborHoodList = icNeighborHoodPropertyDao.getNeighborHoodList(id,staffInfoCacheResult.getAgencyId());
List<String> neighborHoodNames = neighborHoodList.stream()
.map(IcNeighborHoodDTO::getNeighborHoodName)
.distinct().collect(Collectors.toList());
resultDto.setNeighborHoodNames(CollectionUtils.isNotEmpty(neighborHoodList) ? StringUtils.join(neighborHoodNames, StrConstant.COMMA_ZH) : StrConstant.EPMETY_STR);
resultDto.setNeighborHoodList(neighborHoodList);
resultDto.setTotalNeighborHood(CollectionUtils.isNotEmpty(neighborHoodList)?neighborHoodList.size():NumConstant.ZERO);
return resultDto;
}
/**
* 执行Excel导入
*
* @param filePath
* @param importTaskId
*/
@Async
@Override
public void execAsyncExcelImport(Path filePath, String importTaskId) {
String userId = null;
try {
userId = EpmetRequestHolder.getLoginUserId();
String customerId = EpmetRequestHolder.getLoginUserCustomerId();
IcPropertyManagementImportListener listener = new IcPropertyManagementImportListener(customerId, SpringContextUtils.getBean(IcPropertyManagementServiceImpl.class));
EasyExcel.read(filePath.toFile(), IcPropertyManagementImportExcelData.class, listener).headRowNumber(1).sheet(0).doRead();
String errorDesFileUrl = null;
List<IcPropertyManagementImportExcelData.ErrorRow> errorRows = listener.getErrorRows();
boolean failed = errorRows.size() > 0;
// 合并到一起写入
// errorRows.addAll(otherRows);
// 生成并上传描述文件
OutputStream os = null;
FileItem fileItem = null;
if (errorRows.size() > 0) {
try {
// 文件生成
Path errorDescDir = FileUtils.getAndCreateDirUnderEpmetFilesDir(ImportTaskConstants.IC_PROPERTY_MANAGEMENT, "import", "error_des");
String fileName = UUID.randomUUID().toString().concat(".xlsx");
fileItem = new DiskFileItemFactory(DiskFileItemFactory.DEFAULT_SIZE_THRESHOLD, errorDescDir.toFile())
.createItem("file", ContentType.APPLICATION_OCTET_STREAM.toString(), false, fileName);
os = fileItem.getOutputStream();
EasyExcel.write(os, IcPropertyManagementImportExcelData.ErrorRow.class).sheet("信息列表").doWrite(errorRows);
// 文件上传oss
Result<UploadImgResultDTO> errorDesFileUploadResult = ossFeignClient.uploadImportTaskDescFile(new CommonsMultipartFile(fileItem));
if (errorDesFileUploadResult.success()) {
errorDesFileUrl = errorDesFileUploadResult.getData().getUrl();
}
} finally {
IOUtils.closeQuietly(os);
if (!fileItem.isInMemory()) {
try {
fileItem.delete();
} catch (Exception e) {
log.error("【物业管理表ic_property_management】删除错误描述临时文件失败:{}", ExceptionUtils.getErrorStackTrace(e));
}
}
}
}
Result result = ImportTaskUtils.finishImportTask(
importTaskId,
failed ? ImportTaskConstants.PROCESS_STATUS_FINISHED_FAIL : ImportTaskConstants.PROCESS_STATUS_FINISHED_SUCCESS,
errorDesFileUrl,
"");
if (!result.success()) {
log.error("【物业管理表ic_property_management】finishImportTask失败");
}
} catch (Exception e) {
String errorMsg = ExceptionUtils.getErrorStackTrace(e);
log.error("【物业管理表ic_property_management】出错:{}", errorMsg);
ImportTaskCommonFormDTO importFinishTaskForm = new ImportTaskCommonFormDTO();
importFinishTaskForm.setTaskId(importTaskId);
importFinishTaskForm.setProcessStatus(ImportTaskConstants.PROCESS_STATUS_FINISHED_FAIL);
importFinishTaskForm.setOperatorId(userId);
importFinishTaskForm.setResultDesc("城市管理图层导入失败:系统异常,请查看系统日志");
Result result = commonServiceOpenFeignClient.finishImportTask(importFinishTaskForm);
if (!result.success()) {
log.error("【物业管理表ic_property_management】导入记录状态修改为'完成'失败");
}
} finally {
// 删除临时文件
if (Files.exists(filePath)) {
try {
Files.delete(filePath);
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
}

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

100
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CommunityBuildingManagerDao.xml

@ -0,0 +1,100 @@
<?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.CommunityBuildingManagerDao">
<resultMap type="com.epmet.entity.CommunityBuildingManagerEntity" id="communityBuildingManagerMap">
<result property="id" column="ID"/>
<result property="customerId" column="CUSTOMER_ID"/>
<result property="name" column="NAME"/>
<result property="phone" column="PHONE"/>
<result property="idCard" column="ID_CARD"/>
<result property="type" column="TYPE"/>
<result property="districtId" column="DISTRICT_ID"/>
<result property="streetId" column="STREET_ID"/>
<result property="communityId" column="COMMUNITY_ID"/>
<result property="gridId" column="GRID_ID"/>
<result property="orgIdPath" column="ORG_ID_PATH"/>
<result property="viliageId" column="VILIAGE_ID"/>
<result property="buildingId" column="BUILDING_ID"/>
<result property="unitId" column="UNIT_ID"/>
<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="pageList" parameterType="map" resultType="com.epmet.dto.result.yt.CommunityBuildingManagerResultDTO">
SELECT
m.*,
(
case when m.type='0' then '楼长'
when m.type='1' then '单元长'
else '-'
end
)as typeName,
d.ORGANIZATION_NAME AS districtName,
s.ORGANIZATION_NAME AS streetName,
c.ORGANIZATION_NAME AS communityName,
cg.GRID_NAME AS gridName,
n.NEIGHBOR_HOOD_NAME AS viliageName,
b.BUILDING_NAME AS buildingName,
u.UNIT_NAME AS unitName
FROM
community_building_manager m
LEFT JOIN customer_agency d ON ( m.DISTRICT_ID = d.ID )
LEFT JOIN customer_agency s ON ( m.STREET_ID = s.ID )
LEFT JOIN customer_agency c ON ( m.COMMUNITY_ID = c.ID )
LEFT JOIN customer_grid cg ON ( m.GRID_ID = cg.ID )
LEFT JOIN ic_neighbor_hood n ON ( m.VILIAGE_ID = n.ID )
LEFT JOIN ic_building b ON ( m.BUILDING_ID = b.ID )
LEFT JOIN ic_building_unit u ON ( m.UNIT_ID = u.ID )
WHERE
m.DEL_FLAG = '0'
AND m.CUSTOMER_ID = #{customerId}
<if test="name != null and name != ''">
AND m.`NAME` LIKE concat( '%', #{name}, '%' )
</if>
<if test="phone != null and phone != ''">
AND m.PHONE LIKE concat( '%', #{phone}, '%' )
</if>
<if test="idCard != null and idCard != ''">
AND m.ID_CARD LIKE concat( '%', #{idCard}, '%' )
</if>
<if test="type != null and type != ''">
AND m.TYPE = #{type}
</if>
<if test="districtId != null and districtId != ''">
AND m.DISTRICT_ID = #{districtId}
</if>
<if test="streetId != null and streetId != ''">
AND m.STREET_ID = #{streetId}
</if>
<if test="communityId != null and communityId != ''">
AND m.COMMUNITY_ID = #{communityId}
</if>
<if test="gridId != null and gridId != ''">
AND m.GRID_ID = #{gridId}
</if>
<if test="viliageId != null and viliageId != ''">
AND m.VILIAGE_ID = #{viliageId}
</if>
<if test="buildingId != null and buildingId != ''">
AND m.BUILDING_ID = #{buildingId}
</if>
<if test="unitId != null and unitId != ''">
AND m.UNIT_ID = #{unitId}
</if>
<if test="orgIdPath != null and orgIdPath != ''">
AND m.ORG_ID_PATH LIKE concat( #{orgIdPath}, '%' )
</if>
<if test="id != null and id != ''">
AND m.id = #{id}
</if>
ORDER BY
m.ID ASC
</select>
</mapper>

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

@ -130,7 +130,11 @@
d.PROPERTY_ID as propertyId ,
a.LOCATION as location,
a.LONGITUDE as longitude,
a.LATITUDE as latitude
a.LATITUDE as latitude,
a.AREA as area,
a.BUILD_YEAR as buildYear,
if(a.VILIAGE_TYPE = 1,'住宅小区',if(a.VILIAGE_TYPE = 2,'自然村','')) as viliageTypeName,
if(a.OPEN_TYPE = 1,'封闭式',if(a.OPEN_TYPE = 2,'开放式','')) as openTypeName
from ic_neighbor_hood a
left join customer_agency b on a.AGENCY_ID = b.ID and b.DEL_FLAG='0'
@ -695,4 +699,26 @@
ORDER BY
h.NEIGHBOR_HOOD_NAME ASC
</select>
<select id="queryNeighborHoodOptionsYanTai" parameterType="map" resultType="com.epmet.commons.tools.dto.result.OptionResultDTO">
SELECT
concat(cg.grid_name,'-',h.NEIGHBOR_HOOD_NAME) as label,
h.ID as `value`
FROM
ic_neighbor_hood h
left join customer_grid cg on(h.grid_id=cg.id)
WHERE
h.DEL_FLAG = '0'
AND h.CUSTOMER_ID = #{customerId}
<if test=" null != agencyId and agencyId != ''">
AND ( h.AGENCY_ID = #{agencyId} OR h.AGENCY_PIDS LIKE concat( '%', #{agencyId}, '%' ) )
</if>
<if test=" null != neighborHoodName and neighborHoodName != ''">
and h.NEIGHBOR_HOOD_NAME like concat('%',#{neighborHoodName},'%')
</if>
<if test=" null != gridId and gridId != ''">
and h.GRID_ID=#{gridId}
</if>
ORDER BY h.NEIGHBOR_HOOD_NAME ASC
</select>
</mapper>

16
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcNeighborHoodPropertyDao.xml

@ -15,5 +15,19 @@
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
<!-- 当前物业在 当前组织及下级范围内,管理的小区数量 -->
<select id="getNeighborHoodList" parameterType="java.lang.String" resultType="com.epmet.dto.IcNeighborHoodDTO">
SELECT
p.NEIGHBOR_HOOD_ID as id,
h.NEIGHBOR_HOOD_NAME
FROM
ic_neighbor_hood_property p
INNER JOIN ic_neighbor_hood h ON ( p.NEIGHBOR_HOOD_ID = h.ID )
WHERE
p.PROPERTY_ID = #{propertyId}
AND (h.AGENCY_ID = #{agencyId} or h.AGENCY_PIDS like concat('%',#{agencyId},'%') )
AND p.DEL_FLAG = '0'
AND h.DEL_FLAG = '0'
order by h.CREATED_TIME asc
</select>
</mapper>

10
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPropertyManagementDao.xml

@ -71,15 +71,19 @@
</select>
<select id="queryList" parameterType="map" resultType="com.epmet.dto.IcPropertyManagementDTO">
select m.*,(
select count(pr.NEIGHBOR_HOOD_ID) from ic_neighbor_hood_property pr where pr.PROPERTY_ID=m.id and pr.del_flag='0'
)as totalNeighborHood
select m.*
from ic_property_management m
where m.del_flag='0'
and m.customer_id=#{customerId}
<if test="name != null and name != ''">
and m.name like concat('%',#{name},'%')
</if>
<if test="contactName != null and contactName != ''">
and m.CONTACT_NAME like concat('%',#{contactName},'%')
</if>
<if test="contactMobile != null and contactMobile != ''">
and m.CONTACT_MOBILE like concat('%',#{contactMobile},'%')
</if>
order by m.CREATED_TIME desc
</select>
</mapper>

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

@ -149,7 +149,31 @@ public class CustomerStaffDTO implements Serializable {
* 身份证号
*/
private String idCard;
private String culture;
private Date birthday;
/**
* 烟台需求党组织职务
*/
private String partyPosition;
/**
* 烟台需求村居委员职务
*/
private String viliagePosition;
/**
* 烟台需求工作职责
*/
private String duty;
/**
* 烟台需求备注
*/
private String remark;
/**
* 文化程度
*/
private String culture;
}

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

@ -105,6 +105,11 @@ public class IcResiUserDTO implements Serializable {
*/
private String idCard;
/**
* 证件类型烟台需求来源于字典表dict_type=yt_id_card_type;1身份证号2护照3港澳通行证4军人证5台胞证6其他
*/
private String idCardType;
/**
* 出生日期
*/
@ -125,6 +130,26 @@ public class IcResiUserDTO implements Serializable {
*/
private String contactsMobile;
/**
* 烟台需求重点人群名称对应字典表dict_type:yt_key_point_user_type
*/
private String keyPointUserType;
/**
* 烟台需求国籍
*/
private String nationality;
/**
* 烟台需求人口类型名称对应字典表dict_type:yt_population_type
*/
private String populationType;
/**
* 烟台需求政治面貌名称对应字典表dict_type:yt_politics_status
*/
private String politicsStatus;
/**
* 九小场所url
*/
@ -401,9 +426,9 @@ public class IcResiUserDTO implements Serializable {
private String jg;
/**
* 户籍所在地
* 户籍所在地;烟台需求对应户籍详细地址
*/
private String hjszd;
private String hjszd;
/**
* 现居住地
@ -415,6 +440,111 @@ public class IcResiUserDTO implements Serializable {
*/
private String rhzk;
/**
* 烟台需求是否现居住0否1是对应字典表dict_type:
*/
private String isNowLive;
/**
* 烟台需求居住省
*/
private String livingProvince;
/**
* 烟台需求居住市
*/
private String livingCity;
/**
* 烟台需求居住区
*/
private String livingArea;
/**
* 烟台需求居住街道
*/
private String livingStreet;
/**
* 烟台需求居住社区
*/
private String livingCommunity;
/**
* 烟台需求居住小区
*/
private String livingViliageName;
/**
* 烟台需求居住楼号
*/
private String livingBuildingNo;
/**
* 烟台需求居住单元号
*/
private String livingUnitNo;
/**
* 烟台需求居住房间号
*/
private String livingHouseNo;
/**
* 烟台需求户籍所在省
*/
private String registerProvince;
/**
* 烟台需求户籍所在市
*/
private String registerCity;
/**
* 烟台需求户籍所在区县
*/
private String registerArea;
/**
* 烟台需求户籍所在街道
*/
private String registerStreet;
/**
* 烟台需求户籍所在社区
*/
private String registerCommunity;
/**
* 烟台需求户籍所在小区名称
*/
private String registerViliageName;
/**
* 烟台需求户籍楼号
*/
private String registerBuildingNo;
/**
* 烟台需求户籍单元号
*/
private String registerUnitNo;
/**
* 烟台需求户籍房间号
*/
private String registerHouseNo;
/**
* 烟台需求户别对应字典表dict_type:yt_household_category
*/
private String householdCategory;
/**
* 烟台需求户号
*/
private String houseHoldId;
/**
* 居住信息备注
*/
@ -465,6 +595,11 @@ public class IcResiUserDTO implements Serializable {
*/
private String jtxxRemakes;
/**
* 烟台需求与户主关系60对应字典表dict_type:yt_Householder_relationship_type
*/
private String yt_yhzgx;
/**
* 用户状态0:正常;1:迁出;2:注销
*/

33
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/RegisterRelationPageFormDTO.java

@ -0,0 +1,33 @@
package com.epmet.dto.form;
import com.epmet.commons.tools.dto.form.PageFormDTO;
import lombok.Data;
/**
* @Description
* @Author yzm
* @Date 2023/5/5 9:47
*/
@Data
public class RegisterRelationPageFormDTO extends PageFormDTO {
/**
* 客户Id (customer.id)
*/
private String customerId;
/**
* agencyId的所有上级包含自己
*/
private String agencyIdPath;
/**
* 网格Id (customer_grid.id)
*/
private String gridId;
/**
* 首次注册用户 0表示不参与计数 1表示参与计数
*/
private String firstRegister;
}

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

@ -1033,4 +1033,12 @@ public interface EpmetUserOpenFeignClient {
*/
@PostMapping("/epmetuser/icNat/clearNatRecords")
Result clearNatRecords(@RequestBody Map<String, Object> map);
/**
* 分页查询注册居民
* @param pageFormDTO
* @return
*/
@PostMapping("/epmetuser/registerrelation/pageQueryRegisterUser")
Result<PageData<RegisterRelationDTO>> pageQueryRegisterUser(@RequestBody RegisterRelationPageFormDTO pageFormDTO);
}

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

@ -756,4 +756,15 @@ public class EpmetUserOpenFeignClientFallback implements EpmetUserOpenFeignClien
public Result clearNatRecords(Map<String, Object> map) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "clearNatRecords", map);
}
/**
* 分页查询注册居民
*
* @param pageFormDTO
* @return
*/
@Override
public Result<PageData<RegisterRelationDTO>> pageQueryRegisterUser(RegisterRelationPageFormDTO pageFormDTO) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "pageQueryRegisterUser", pageFormDTO);
}
}

18
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/RegisterRelationController.java

@ -28,6 +28,7 @@ import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.dto.RegisterRelationDTO;
import com.epmet.dto.form.AllResiByGridFormDTO;
import com.epmet.dto.form.EnterGridFormDTO;
import com.epmet.dto.form.RegisterRelationPageFormDTO;
import com.epmet.dto.result.UserInfoOnEnterGridResultDTO;
import com.epmet.excel.RegisterRelationExcel;
import com.epmet.service.RegisterRelationService;
@ -120,4 +121,21 @@ public class RegisterRelationController {
ValidatorUtils.validateEntity(formDTO, AllResiByGridFormDTO.AllResiByGridForm.class);
return new Result<Integer>().ok(registerRelationService.getAllResiByGrid(formDTO));
}
/**
* 分页查询注册居民信息
* @param pageFormDTO
* @return
*/
@PostMapping("pageQueryRegisterUser")
public Result<PageData<RegisterRelationDTO>> pageQueryRegisterUser(@RequestBody RegisterRelationPageFormDTO pageFormDTO){
return new Result<PageData<RegisterRelationDTO>>().ok(registerRelationService.pageQueryRegisterUser(pageFormDTO.getPageNo(),
pageFormDTO.getPageSize(),
pageFormDTO.getCustomerId(),
pageFormDTO.getGridId(),
pageFormDTO.getAgencyIdPath(),
pageFormDTO.getFirstRegister()));
}
}

5
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/RegisterRelationDao.java

@ -71,4 +71,9 @@ public interface RegisterRelationDao extends BaseDao<RegisterRelationEntity> {
* @date 2022/10/8 10:48
*/
Integer getAllResiByGrid(@Param("gridId")String gridId);
List<RegisterRelationDTO> pageQueryRegisterUser(@Param("customerId") String customerId,
@Param("gridId") String gridId,
@Param("agencyIdPath") String agencyIdPath,
@Param("firstRegister") String firstRegister);
}

26
epmet-user/epmet-user-server/src/main/java/com/epmet/entity/CustomerStaffEntity.java

@ -112,13 +112,33 @@ public class CustomerStaffEntity extends BaseEpmetEntity {
*/
private String idCard;
/**
* 出生日期
* 烟台需求党组织职务
*/
private Date birthday;
private String partyPosition;
/**
* 烟台需求村居委员职务
*/
private String viliagePosition;
/**
* 烟台需求工作职责
*/
private String duty;
/**
* 文化程度0小学及文盲,1初中,2高中,3大专,4本科,5硕士,6博士,7中专
* 烟台需求备注
*/
private String remark;
/**
* 文化程度
*/
private String culture;
/**
* 出生日期
*/
private Date birthday;
}

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

@ -107,7 +107,7 @@ public class IcResiUserEntity extends BaseEpmetEntity {
private String idCard;
/**
* 证件类型1身份证号2护照
* 证件类型烟台需求来源于字典表dict_type=yt_id_card_type;1身份证号2护照3港澳通行证4军人证5台胞证6其他
*/
private String idCardType;
@ -131,7 +131,27 @@ public class IcResiUserEntity extends BaseEpmetEntity {
*/
private String contactsMobile;
/**
/**
* 烟台需求重点人群名称对应字典表dict_type:yt_key_point_user_type
*/
private String keyPointUserType;
/**
* 烟台需求国籍
*/
private String nationality;
/**
* 烟台需求人口类型名称对应字典表dict_type:yt_population_type
*/
private String populationType;
/**
* 烟台需求政治面貌名称对应字典表dict_type:yt_politics_status
*/
private String politicsStatus;
/**
* 九小场所url
*/
private String ninePlace;
@ -400,9 +420,9 @@ public class IcResiUserEntity extends BaseEpmetEntity {
*/
private String jg;
/**
* 户籍所在地
*/
/**
* 户籍所在地;烟台需求对应户籍详细地址
*/
private String hjszd;
/**
@ -415,6 +435,111 @@ public class IcResiUserEntity extends BaseEpmetEntity {
*/
private String rhzk;
/**
* 烟台需求是否现居住0否1是对应字典表dict_type:
*/
private String isNowLive;
/**
* 烟台需求居住省
*/
private String livingProvince;
/**
* 烟台需求居住市
*/
private String livingCity;
/**
* 烟台需求居住区
*/
private String livingArea;
/**
* 烟台需求居住街道
*/
private String livingStreet;
/**
* 烟台需求居住社区
*/
private String livingCommunity;
/**
* 烟台需求居住小区
*/
private String livingViliageName;
/**
* 烟台需求居住楼号
*/
private String livingBuildingNo;
/**
* 烟台需求居住单元号
*/
private String livingUnitNo;
/**
* 烟台需求居住房间号
*/
private String livingHouseNo;
/**
* 烟台需求户籍所在省
*/
private String registerProvince;
/**
* 烟台需求户籍所在市
*/
private String registerCity;
/**
* 烟台需求户籍所在区县
*/
private String registerArea;
/**
* 烟台需求户籍所在街道
*/
private String registerStreet;
/**
* 烟台需求户籍所在社区
*/
private String registerCommunity;
/**
* 烟台需求户籍所在小区名称
*/
private String registerViliageName;
/**
* 烟台需求户籍楼号
*/
private String registerBuildingNo;
/**
* 烟台需求户籍单元号
*/
private String registerUnitNo;
/**
* 烟台需求户籍房间号
*/
private String registerHouseNo;
/**
* 烟台需求户别对应字典表dict_type:yt_household_category
*/
private String householdCategory;
/**
* 烟台需求户号
*/
private String houseHoldId;
/**
* 居住信息备注
*/
@ -465,6 +590,11 @@ public class IcResiUserEntity extends BaseEpmetEntity {
*/
private String jtxxRemakes;
/**
* 烟台需求与户主关系60对应字典表dict_type:yt_Householder_relationship_type
*/
private String yt_yhzgx;
/**
* 用户状态0:正常;1:迁出;2:注销
*/

4
epmet-user/epmet-user-server/src/main/java/com/epmet/processor/YanTaiTripReportSyncProcessor.java

@ -6,17 +6,15 @@ import com.epmet.service.DataSyncConfigService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import static com.epmet.constant.EpidemicConstant.JOB_TYPE_TRIP_REPORT;
import static com.epmet.constant.EpidemicConstant.JOB_TYPE_VACCINE;
/**
* @Description 烟台行程上报数据同步处理器
* @Author zxc
* @Date 2022/11/22 14:08
*/
@Component
// @Component
@Slf4j
public class YanTaiTripReportSyncProcessor extends AbstractDataSyncJobProcessor {

12
epmet-user/epmet-user-server/src/main/java/com/epmet/service/RegisterRelationService.java

@ -123,4 +123,16 @@ public interface RegisterRelationService extends BaseService<RegisterRelationEnt
* @date 2022/10/8 10:41
*/
Integer getAllResiByGrid(AllResiByGridFormDTO formDTO);
/**
* 分页查询注册居民信息
* @param pageNo
* @param pageSize
* @param customerId
* @param gridId
* @param agencyIdPath
* @param firstRegister
* @return
*/
PageData<RegisterRelationDTO> pageQueryRegisterUser(Integer pageNo, Integer pageSize, String customerId, String gridId, String agencyIdPath, String firstRegister);
}

40
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java

@ -308,6 +308,12 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl<CustomerStaffDao,
resultDTO.setWorkType(customerStaffDTO.getWorkType());
resultDTO.setIdCard(customerStaffDTO.getIdCard());
resultDTO.setCustomerId(customerStaffDTO.getCustomerId());
resultDTO.setCulture(customerStaffDTO.getCulture());
resultDTO.setDuty(customerStaffDTO.getDuty());
resultDTO.setPartyPosition(customerStaffDTO.getPartyPosition());
resultDTO.setViliagePosition(customerStaffDTO.getViliagePosition());
resultDTO.setRemark(customerStaffDTO.getRemark());
resultDTO.setAddress(customerStaffDTO.getAddress());
//获取角色列表
GovStaffRoleDTO govStaffRoleDTO = new GovStaffRoleDTO();
govStaffRoleDTO.setCustomerId(fromDTO.getCustomerId());
@ -388,14 +394,31 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl<CustomerStaffDao,
staffEntity.setWorkType(fromDTO.getWorkType());
staffEntity.setEnableFlag(CustomerStaffConstant.ENABLE);
staffEntity.setPassword(PasswordUtils.encode("12345678"));
staffEntity.setIdCard(fromDTO.getIdCard());
if (StringUtils.isNotBlank(fromDTO.getRemark())){
staffEntity.setRemark(fromDTO.getRemark());
}
if (StringUtils.isNotBlank(fromDTO.getAddress())){
staffEntity.setAddress(fromDTO.getAddress());
}
if (StringUtils.isNotBlank(fromDTO.getPartyPosition())){
staffEntity.setPartyPosition(fromDTO.getPartyPosition());
}
if (StringUtils.isNotBlank(fromDTO.getViliagePosition())){
staffEntity.setViliagePosition(fromDTO.getViliagePosition());
}
if (StringUtils.isNotBlank(fromDTO.getDuty())){
staffEntity.setDuty(fromDTO.getDuty());
}
if (StringUtils.isNotBlank(fromDTO.getIdCard())){
staffEntity.setIdCard(fromDTO.getIdCard());
}
if (StringUtils.isNotBlank(fromDTO.getCulture())){
staffEntity.setCulture(fromDTO.getCulture());
}
if (StringUtils.isNotBlank(fromDTO.getIdCard())) {
LocalDate birthday = IdCardRegexUtils.parse(fromDTO.getIdCard()).getParsedResult().getBirthday();
staffEntity.setBirthday(DateUtils.localDate2Date(birthday));
}
staffEntity.setCulture(fromDTO.getCulture());
baseDao.insert(staffEntity);
//工作人员角色关联表
@ -510,14 +533,17 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl<CustomerStaffDao,
staffEntity.setMobile(fromDTO.getMobile());
staffEntity.setGender(fromDTO.getGender());
staffEntity.setWorkType(fromDTO.getWorkType());
staffEntity.setCulture(fromDTO.getCulture());
staffEntity.setIdCard(fromDTO.getIdCard());
staffEntity.setCulture(fromDTO.getCulture());
staffEntity.setDuty(fromDTO.getDuty());
staffEntity.setPartyPosition(fromDTO.getPartyPosition());
staffEntity.setViliagePosition(fromDTO.getViliagePosition());
staffEntity.setRemark(fromDTO.getRemark());
staffEntity.setAddress(fromDTO.getAddress());
if (StringUtils.isNotBlank(fromDTO.getIdCard())) {
LocalDate birthday = IdCardRegexUtils.parse(fromDTO.getIdCard()).getParsedResult().getBirthday();
staffEntity.setBirthday(DateUtils.localDate2Date(birthday));
}
staffEntity.setCulture(fromDTO.getCulture());
baseDao.updateById(staffEntity);
//清空权限关联

30
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserImportServiceImpl.java

@ -6,7 +6,6 @@ import cn.afterturn.easypoi.excel.entity.ExportParams;
import cn.hutool.core.bean.BeanUtil;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.EasyExcelFactory;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import com.epmet.bean.ResiImportCategoryData;
@ -1457,11 +1456,38 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res
optionTypeName = "所属支部";
options = this.listBranchOptions();
break;
case "/sys/dict/data/dictOption/yt_Householder_relationship_type":
optionTypeName = "与户主关系";
options = getResultDataOrThrowsException(adminOpenFeignClient.getDictOption("yt_Householder_relationship_type"), ServiceConstant.EPMET_ADMIN_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), null, null);
break;
case "/sys/dict/data/dictOption/yt_id_card_type":
optionTypeName = "证件类型";
options = getResultDataOrThrowsException(adminOpenFeignClient.getDictOption("yt_id_card_type"), ServiceConstant.EPMET_ADMIN_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), null, null);
break;
case "/sys/dict/data/dictOption/yt_key_point_user_type":
optionTypeName = "重点人群";
options = getResultDataOrThrowsException(adminOpenFeignClient.getDictOption("yt_key_point_user_type"), ServiceConstant.EPMET_ADMIN_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), null, null);
break;
case "/sys/dict/data/dictOption/yt_population_type":
optionTypeName = "人口类型";
options = getResultDataOrThrowsException(adminOpenFeignClient.getDictOption("yt_population_type"), ServiceConstant.EPMET_ADMIN_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), null, null);
break;
case "/sys/dict/data/dictOption/yt_politics_status":
optionTypeName = "政治面貌";
options = getResultDataOrThrowsException(adminOpenFeignClient.getDictOption("yt_politics_status"), ServiceConstant.EPMET_ADMIN_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), null, null);
break;
case "/sys/dict/data/dictOption/yt_is_now_live":
optionTypeName = "是否现居住";
options = getResultDataOrThrowsException(adminOpenFeignClient.getDictOption("yt_is_now_live"), ServiceConstant.EPMET_ADMIN_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), null, null);
break;
case "/sys/dict/data/dictOption/yt_household_category":
optionTypeName = "户别";
options = getResultDataOrThrowsException(adminOpenFeignClient.getDictOption("yt_household_category"), ServiceConstant.EPMET_ADMIN_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), null, null);
break;
default:
log.warn("listRemoteOptions url is not supported");
}
if (options == null) {
return null;
}

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

@ -366,8 +366,8 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
if (regex == null) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "证件号解析错误", "证件号解析错误");
}
IdCardTypeEnum typeEnum = regex.getTypeEnum();
map.put("ID_CARD_TYPE", typeEnum.getType());
// IdCardTypeEnum typeEnum = regex.getTypeEnum();
// map.put("ID_CARD_TYPE", typeEnum.getType());
// 证件类型判断----end----
//新增主表数据
@ -729,8 +729,8 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
if (regex == null) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "证件号解析错误", "证件号解析错误");
}
IdCardTypeEnum typeEnum = regex.getTypeEnum();
map.put("ID_CARD_TYPE", typeEnum.getType());
// IdCardTypeEnum typeEnum = regex.getTypeEnum();
// map.put("ID_CARD_TYPE", typeEnum.getType());
// 证件类型判断----end----
}
baseDao.upTable("ic_resi_user", resiUserId, map);

20
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/RegisterRelationServiceImpl.java

@ -48,6 +48,8 @@ import com.epmet.feign.GovOrgOpenFeignClient;
import com.epmet.service.GridVisitedService;
import com.epmet.service.RegisterRelationService;
import com.epmet.util.ModuleConstant;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -389,4 +391,22 @@ public class RegisterRelationServiceImpl extends BaseServiceImpl<RegisterRelatio
return baseDao.getAllResiByGrid(formDTO.getGridId());
}
/**
* 分页查询注册居民信息
*
* @param pageNo
* @param pageSize
* @param customerId
* @param gridId
* @param agencyIdPath
* @param firstRegister
* @return
*/
@Override
public PageData<RegisterRelationDTO> pageQueryRegisterUser(Integer pageNo, Integer pageSize, String customerId, String gridId, String agencyIdPath, String firstRegister) {
PageHelper.startPage(pageNo,pageSize);
List<RegisterRelationDTO> resList=baseDao.pageQueryRegisterUser(customerId,gridId,agencyIdPath,firstRegister);
PageInfo<RegisterRelationDTO> pageInfo = new PageInfo<>(resList);
return new PageData<>(resList, pageInfo.getTotal());
}
}

BIN
epmet-user/epmet-user-server/src/main/resources/excel/ic_resi_import_template.xls

Binary file not shown.

BIN
epmet-user/epmet-user-server/src/main/resources/excel/ic_resi_import_template_bak0507.xls

Binary file not shown.

17
epmet-user/epmet-user-server/src/main/resources/mapper/RegisterRelationDao.xml

@ -97,5 +97,20 @@
AND grid_id = #{gridId}
</select>
<select id="pageQueryRegisterUser" parameterType="map" resultType="com.epmet.dto.RegisterRelationDTO">
select rr.*
from register_relation rr
where rr.CUSTOMER_ID=#{customerId}
and rr.DEL_FLAG='0'
<if test='firstRegister != null and firstRegister != "" '>
and rr.FIRST_REGISTER=#{firstRegister}
</if>
<if test='gridId != null and gridId != "" '>
and rr.GRID_ID=#{gridId}
</if>
<if test='agencyIdPath != null and agencyIdPath != "" '>
and rr.AGENCY_ID_PATH like concat(#{agencyIdPath},'%')
</if>
order by rr.ID asc
</select>
</mapper>

Loading…
Cancel
Save