Browse Source

Merge remote-tracking branch 'origin/dev_ic_diaodong' into develop

# Conflicts:
#	epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java
#	epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java
dev
zxc 4 years ago
parent
commit
1e47168050
  1. 5
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/IcResiUserEntity.java
  2. 6
      epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/form/AddOftenUseFunctionFormDTO.java
  3. 27
      epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/form/PackageAddOftenUseFunctionFormDTO.java
  4. 3
      epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/IcOftenUseFunctionController.java
  5. 44
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcResiUserOrgMsgFormDTO.java
  6. 60
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/IcResiUserOrgMsgResultDTO.java
  7. 7
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java
  8. 12
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java
  9. 10
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java
  10. 7
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java
  11. 32
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java
  12. 6
      epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/EditIndividualCategoryFormDTO.java
  13. 27
      epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/PackageEditIndividualCategoryFormDTO.java
  14. 54
      epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/CustomerCategoryShowAndWarnListResultDTO.java
  15. 16
      epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/OperCustomizeOpenFeignClient.java
  16. 12
      epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/fallback/OperCustomizeOpenFeignClientFallback.java
  17. 3
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcIndividualCategoryManageController.java
  18. 9
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcResiCategoryWarnConfigController.java
  19. 11
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/ResiCategoryStatsConfigController.java
  20. 9
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/IcResiCategoryStatsConfigDao.java
  21. 10
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcResiCategoryStatsConfigService.java
  22. 6
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcResiCategoryWarnConfigService.java
  23. 22
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcResiCategoryStatsConfigServiceImpl.java
  24. 14
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcResiCategoryWarnConfigServiceImpl.java
  25. 21
      epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcResiCategoryStatsConfigDao.xml
  26. 5
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcResiUserDTO.java
  27. 2
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcUserChangeDetailedDTO.java
  28. 4
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcUserChangeRecordDTO.java
  29. 26
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/PersonWarnLeftPieDTO.java
  30. 32
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiUserChangeRecordFormDTO.java
  31. 69
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiUserTransferFormDTO.java
  32. 25
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/PersonWarnRightListFormDTO.java
  33. 20
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/IcUserChangeRecordResultDTO.java
  34. 48
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/PersonWarnLeftPieResultDTO.java
  35. 68
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/PersonWarnRightListResultDTO.java
  36. 13
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java
  37. 14
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcStatsResiWarnController.java
  38. 16
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcUserChangeRecordController.java
  39. 23
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcUserTransferRecordController.java
  40. 2
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java
  41. 10
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcStatsResiWarnDao.java
  42. 11
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcUserChangeRecordDao.java
  43. 5
      epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcResiUserEntity.java
  44. 2
      epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcUserChangeDetailedEntity.java
  45. 4
      epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcUserChangeRecordEntity.java
  46. 10
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java
  47. 10
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcStatsResiWarnService.java
  48. 7
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcUserChangeRecordService.java
  49. 7
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcUserTransferRecordService.java
  50. 96
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java
  51. 53
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcStatsResiWarnServiceImpl.java
  52. 22
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserChangeRecordServiceImpl.java
  53. 229
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserTransferRecordServiceImpl.java
  54. 28
      epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml
  55. 16
      epmet-user/epmet-user-server/src/main/resources/mapper/IcStatsResiWarnDao.xml
  56. 22
      epmet-user/epmet-user-server/src/main/resources/mapper/IcUserChangeRecordDao.xml

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

@ -440,6 +440,11 @@ public class IcResiUserEntity extends BaseEpmetEntity {
*/
private String jtxxRemakes;
/**
* 用户状态0:正常 1:转出
*/
private String status;
/**
* 预留字段1
*/

6
epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/form/AddOftenUseFunctionFormDTO.java

@ -16,11 +16,9 @@ public class AddOftenUseFunctionFormDTO implements Serializable {
private static final long serialVersionUID = -8044386389656626183L;
public interface AddOftenUseFunctionForm{}
@NotBlank(message = "menuId不能为空", groups = AddOftenUseFunctionForm.class)
@NotBlank(message = "menuId不能为空",groups = PackageAddOftenUseFunctionFormDTO.PackageAddOftenUseFunctionForm.class)
private String menuId;
@NotNull(message = "sort不能为空", groups = AddOftenUseFunctionForm.class)
@NotNull(message = "sort不能为空",groups = PackageAddOftenUseFunctionFormDTO.PackageAddOftenUseFunctionForm.class)
private Integer sort;
}

27
epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/form/PackageAddOftenUseFunctionFormDTO.java

@ -0,0 +1,27 @@
package com.epmet.dto.form;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.List;
/**
* @Author zxc
* @DateTime 2022/1/17 5:20 下午
* @DESC
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class PackageAddOftenUseFunctionFormDTO implements Serializable {
public interface PackageAddOftenUseFunctionForm{}
@Valid
public List<AddOftenUseFunctionFormDTO> list;
}

3
epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/IcOftenUseFunctionController.java

@ -9,6 +9,7 @@ import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.dto.IcOftenUseFunctionDTO;
import com.epmet.dto.form.AddOftenUseFunctionFormDTO;
import com.epmet.dto.form.PackageAddOftenUseFunctionFormDTO;
import com.epmet.dto.result.OftenUseFunctionListResultDTO;
import com.epmet.service.IcOftenUseFunctionService;
import org.springframework.beans.factory.annotation.Autowired;
@ -49,6 +50,8 @@ public class IcOftenUseFunctionController {
*/
@PostMapping("addoftenusefunction")
public Result addOftenUseFunction(@RequestBody List<AddOftenUseFunctionFormDTO> formDTOS, @LoginUser TokenDto tokenDto){
PackageAddOftenUseFunctionFormDTO fo = new PackageAddOftenUseFunctionFormDTO(formDTOS);
ValidatorUtils.validateEntity(fo, PackageAddOftenUseFunctionFormDTO.PackageAddOftenUseFunctionForm.class);
icOftenUseFunctionService.addOftenUseFunction(formDTOS, tokenDto);
return new Result();
}

44
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcResiUserOrgMsgFormDTO.java

@ -0,0 +1,44 @@
package com.epmet.dto.form;
import lombok.Data;
import java.io.Serializable;
/**
* 查询组织网格小区楼栋单元房屋信息
*/
@Data
public class IcResiUserOrgMsgFormDTO implements Serializable {
/**
* 客户ID
*/
private String customerId;
/**
* 组织Id
*/
private String agencyId;
/**
* 网格Id
*/
private String gridId;
/**
* 小区Id
*/
private String neighborHoodId;
/**
* 楼宇Id
*/
private String buildingId;
/**
* 单元Id
*/
private String buildingUnitId;
/**
* 房屋Id
*/
private String houseId;
}

60
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/IcResiUserOrgMsgResultDTO.java

@ -0,0 +1,60 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dto.result;
import com.epmet.dto.*;
import lombok.Data;
import java.io.Serializable;
/**
* 查询组织网格小区楼栋单元房屋信息
*
* @author sun
*/
@Data
public class IcResiUserOrgMsgResultDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 组织信息
*/
private CustomerAgencyDTO agencyDTO;
/**
* 组织信息
*/
private CustomerGridDTO gridDTO;
/**
* 组织信息
*/
private IcNeighborHoodDTO neighborHoodDTO;
/**
* 组织信息
*/
private IcBuildingDTO buildingDTO;
/**
* 组织信息
*/
private IcBuildingUnitDTO buildingUnitDTO;
/**
* 组织信息
*/
private IcHouseDTO houseDTO;
}

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

@ -577,6 +577,13 @@ public interface GovOrgOpenFeignClient {
@PostMapping("/gov/org/customeragency/configcustomerareacode")
Result configCustomerAreaCode(@RequestBody CustomerAreaCodeFormDTO formDTO);
/**
* @Author sun
* @Description 查询组织网格小区楼栋单元房屋信息
**/
@PostMapping(value = "/gov/org/customeragency/icresiuserorgmsg")
Result<IcResiUserOrgMsgResultDTO> icResiUserOrgMsg(@RequestBody IcResiUserOrgMsgFormDTO formDTO);
@PostMapping("/gov/org/customergrid/getstaffgridlist")
Result<List<CustomerStaffGridResultDTO>> getStaffGridList(@RequestParam("orgId")String orgId, @RequestParam("orgType")String orgType);
}

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

@ -362,7 +362,7 @@ public class GovOrgOpenFeignClientFallback implements GovOrgOpenFeignClient {
/**
* 运营端-客户管理修改客户信息调用gov-org服务修改组织区划开关修改根组织areaCode入参
*
* @param areaCodeFormDTO
* @param formDTO
* @return
*/
@Override
@ -370,6 +370,16 @@ public class GovOrgOpenFeignClientFallback implements GovOrgOpenFeignClient {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "configCustomerAreaCode", formDTO);
}
/**
* @Author sun
* @Description 查询组织网格小区楼栋单元房屋信息
**/
@Override
public Result<IcResiUserOrgMsgResultDTO> icResiUserOrgMsg(IcResiUserOrgMsgFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "icResiUserOrgMsg", formDTO);
}
@Override
public Result<List<CustomerStaffGridResultDTO>> getStaffGridList(String orgId, String orgType) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getStaffGridList", orgId, orgType);

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

@ -395,4 +395,14 @@ public class CustomerAgencyController {
customerAgencyService.configCustomerAreaCode(formDTO);
return new Result();
}
/**
* @Author sun
* @Description 查询组织网格小区楼栋单元房屋信息
**/
@PostMapping(value = "icresiuserorgmsg")
Result<IcResiUserOrgMsgResultDTO> icResiUserOrgMsg(@RequestBody IcResiUserOrgMsgFormDTO formDTO) {
return new Result<IcResiUserOrgMsgResultDTO>().ok(customerAgencyService.icResiUserOrgMsg(formDTO));
}
}

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

@ -276,4 +276,11 @@ public interface CustomerAgencyService extends BaseService<CustomerAgencyEntity>
* @return
*/
void configCustomerAreaCode(CustomerAreaCodeFormDTO formDTO);
/**
* @Author sun
* @Description 查询组织网格小区楼栋单元房屋信息
**/
IcResiUserOrgMsgResultDTO icResiUserOrgMsg(IcResiUserOrgMsgFormDTO formDTO);
}

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

@ -98,6 +98,14 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl<CustomerAgencyDao
private CustomerOrgParameterDao customerOrgParameterDao;
@Autowired
private EpmetCommonServiceOpenFeignClient epmetCommonServiceOpenFeignClient;
@Autowired
private IcNeighborHoodDao icNeighborHoodDao;
@Autowired
private IcBuildingDao icBuildingDao;
@Autowired
private IcBuildingUnitDao icBuildingUnitDao;
@Autowired
private IcHouseDao icHouseDao;
@Override
@ -1369,4 +1377,28 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl<CustomerAgencyDao
}
return newAreaCode;
}
/**
* @Author sun
* @Description 查询组织网格小区楼栋单元房屋信息
**/
@Override
public IcResiUserOrgMsgResultDTO icResiUserOrgMsg(IcResiUserOrgMsgFormDTO formDTO) {
IcResiUserOrgMsgResultDTO resultDTO = new IcResiUserOrgMsgResultDTO();
CustomerAgencyDTO agencyDTO = ConvertUtils.sourceToTarget(baseDao.selectById(formDTO.getAgencyId()), CustomerAgencyDTO.class);
CustomerGridDTO gridDTO = ConvertUtils.sourceToTarget(customerGridDao.selectById(formDTO.getGridId()), CustomerGridDTO.class);
IcNeighborHoodDTO neighborHoodDTO = ConvertUtils.sourceToTarget(icNeighborHoodDao.selectById(formDTO.getGridId()), IcNeighborHoodDTO.class);
IcBuildingDTO buildingDTO = ConvertUtils.sourceToTarget(icBuildingDao.selectById(formDTO.getGridId()), IcBuildingDTO.class);
IcBuildingUnitDTO buildingUnitDTO = ConvertUtils.sourceToTarget(icBuildingUnitDao.selectById(formDTO.getGridId()), IcBuildingUnitDTO.class);
IcHouseDTO houseDTO = ConvertUtils.sourceToTarget(icHouseDao.selectById(formDTO.getGridId()), IcHouseDTO.class);
resultDTO.setAgencyDTO(agencyDTO);
resultDTO.setGridDTO(gridDTO);
resultDTO.setNeighborHoodDTO(neighborHoodDTO);
resultDTO.setBuildingDTO(buildingDTO);
resultDTO.setBuildingUnitDTO(buildingUnitDTO);
resultDTO.setHouseDTO(houseDTO);
return resultDTO;
}
}

6
epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/EditIndividualCategoryFormDTO.java

@ -16,11 +16,9 @@ public class EditIndividualCategoryFormDTO implements Serializable {
private static final long serialVersionUID = -3492393795553841513L;
public interface EditIndividualCategoryForm{}
@NotBlank(message = "columnId不能为空",groups = EditIndividualCategoryForm.class)
@NotBlank(message = "columnId不能为空",groups = PackageEditIndividualCategoryFormDTO.PackageEditIndividualCategoryForm.class)
private String columnId;
@NotNull(message = "sort不能为空",groups = EditIndividualCategoryForm.class)
@NotNull(message = "sort不能为空",groups = PackageEditIndividualCategoryFormDTO.PackageEditIndividualCategoryForm.class)
private Integer sort;
}

27
epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/PackageEditIndividualCategoryFormDTO.java

@ -0,0 +1,27 @@
package com.epmet.dto.form;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.validation.Valid;
import java.io.Serializable;
import java.util.List;
/**
* @Author zxc
* @DateTime 2022/1/17 5:49 下午
* @DESC
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class PackageEditIndividualCategoryFormDTO implements Serializable {
private static final long serialVersionUID = -6112833952805305270L;
public interface PackageEditIndividualCategoryForm{}
@Valid
private List<EditIndividualCategoryFormDTO> list;
}

54
epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/CustomerCategoryShowAndWarnListResultDTO.java

@ -0,0 +1,54 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2022/1/18 10:04 上午
* @DESC
*/
@Data
public class CustomerCategoryShowAndWarnListResultDTO implements Serializable {
/**
* 居民类别配置表ID
*/
private String statsConfigId;
/**
* 居民类别预警配置表ID
*/
private String warnConfigId;
/**
* 字段名
*/
private String columnName;
/**
* 标签
*/
private String label;
/**
* 管理平台分类图标
*/
private String managementIcon;
/**
* 数据平台分类图标
*/
private String dataIcon;
/**
* 房屋显示分类图标
*/
private String houseShowIcon;
private Integer level1;
private Integer level2;
private Integer level3;
}

16
epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/OperCustomizeOpenFeignClient.java

@ -109,6 +109,15 @@ public interface OperCustomizeOpenFeignClient {
@PostMapping("/oper/customize/resicategorystatsconfig/resicategorywarnlist")
Result<List<IcResiCategoryWarnConfigDTO>> resiCategoryWarnList(@RequestParam String customerId);
/**
* @Description 获取客户下人员分类配置显示的预警配置的
* @param customerId
* @author zxc
* @date 2022/1/18 10:07 上午
*/
@PostMapping("/oper/customize/resicategorystatsconfig/getcustomercategoryshowandwarnlist")
Result<List<CustomerCategoryShowAndWarnListResultDTO>> getCustomerCategoryShowAndWarnList(@RequestParam("customerId")String customerId);
@PostMapping("/oper/customize/resicategorystatsconfig/resicategorywarninfobyid")
Result<IcResiCategoryWarnConfigDTO> resiCategoryWarnInfoById(@RequestBody IcResiCategoryWarnConfigDTO dto);
@ -129,4 +138,11 @@ public interface OperCustomizeOpenFeignClient {
@PostMapping("/oper/customize/icformitemoptions/list-by-item-conditions")
Result<List<IcFormItemOptionsDTO>> listOptionsByItemConditions(@RequestBody IcFormOptionsQueryFormDTO input);
/**
* @author sun
* @Description 获取客户居民类别预警配置表数据
*/
@PostMapping("/oper/customize/icresicategorywarnconfig/categorywarnconfiglist/{customerId}")
Result<List<IcResiCategoryWarnConfigDTO>> categoryWarnConfigList(@PathVariable String customerId);
}

12
epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/fallback/OperCustomizeOpenFeignClientFallback.java

@ -95,7 +95,12 @@ public class OperCustomizeOpenFeignClientFallback implements OperCustomizeOpenFe
return ModuleUtils.feignConError(ServiceConstant.OPER_CUSTOMIZE_SERVER, "resiCategoryWarnList",customerId);
}
@Override
@Override
public Result<List<CustomerCategoryShowAndWarnListResultDTO>> getCustomerCategoryShowAndWarnList(String customerId) {
return ModuleUtils.feignConError(ServiceConstant.OPER_CUSTOMIZE_SERVER, "getCustomerCategoryShowAndWarnList",customerId);
}
@Override
public Result<IcResiCategoryWarnConfigDTO> resiCategoryWarnInfoById(IcResiCategoryWarnConfigDTO dto) {
return ModuleUtils.feignConError(ServiceConstant.OPER_CUSTOMIZE_SERVER, "resiCategoryWarnInfoById",dto);
}
@ -109,4 +114,9 @@ public class OperCustomizeOpenFeignClientFallback implements OperCustomizeOpenFe
public Result<List<IcFormItemOptionsDTO>> listOptionsByItemConditions(IcFormOptionsQueryFormDTO input) {
return ModuleUtils.feignConError(ServiceConstant.OPER_CUSTOMIZE_SERVER, "listOptionsByItemConditions", input);
}
@Override
public Result<List<IcResiCategoryWarnConfigDTO>> categoryWarnConfigList(String customerId) {
return ModuleUtils.feignConError(ServiceConstant.OPER_CUSTOMIZE_SERVER, "categoryWarnConfigList", customerId);
}
}

3
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcIndividualCategoryManageController.java

@ -9,6 +9,7 @@ import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.dto.IcIndividualCategoryManageDTO;
import com.epmet.dto.form.EditIndividualCategoryFormDTO;
import com.epmet.dto.form.PackageEditIndividualCategoryFormDTO;
import com.epmet.dto.result.IndividualCategoryListResultDTO;
import com.epmet.service.IcIndividualCategoryManageService;
import org.springframework.beans.factory.annotation.Autowired;
@ -49,6 +50,8 @@ public class IcIndividualCategoryManageController {
*/
@PostMapping("editindividualcategory")
public Result editIndividualCategory(@RequestBody List<EditIndividualCategoryFormDTO> formDTOS,@LoginUser TokenDto tokenDto){
PackageEditIndividualCategoryFormDTO formDTO = new PackageEditIndividualCategoryFormDTO(formDTOS);
ValidatorUtils.validateEntity(formDTO,PackageEditIndividualCategoryFormDTO.PackageEditIndividualCategoryForm.class);
icIndividualCategoryManageService.editIndividualCategory(formDTOS,tokenDto);
return new Result();
}

9
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcResiCategoryWarnConfigController.java

@ -91,4 +91,13 @@ public class IcResiCategoryWarnConfigController {
ExcelUtils.exportExcelToTarget(response, null, list, IcResiCategoryWarnConfigExcel.class);
}
/**
* @author sun
* @Description 获取客户居民类别预警配置表数据
*/
@PostMapping("categorywarnconfiglist/{customerId}")
Result<List<IcResiCategoryWarnConfigDTO>> categoryWarnConfigList(@PathVariable String customerId) {
return new Result<List<IcResiCategoryWarnConfigDTO>>().ok(icResiCategoryWarnConfigService.categoryWarnConfigList(customerId));
}
}

11
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/ResiCategoryStatsConfigController.java

@ -34,6 +34,7 @@ import com.epmet.dto.IcResiCategoryWarnConfigDTO;
import com.epmet.dto.form.IcResiCategoryStatsConfigFormDTO;
import com.epmet.dto.form.IcResiCategoryStatsConfigSortFormDTO;
import com.epmet.dto.form.ResiCategoryStatsConfigListFormDTO;
import com.epmet.dto.result.CustomerCategoryShowAndWarnListResultDTO;
import com.epmet.dto.result.IcResiCategoryStatsConfigResultDTO;
import com.epmet.entity.IcResiCategoryStatsConfigEntity;
import com.epmet.entity.IcResiCategoryWarnConfigEntity;
@ -164,5 +165,15 @@ public class ResiCategoryStatsConfigController {
return new Result<IcResiCategoryWarnConfigDTO>().ok(ConvertUtils.sourceToTarget(icResiCategoryWarnConfigDao.selectById(dto.getId()),IcResiCategoryWarnConfigDTO.class));
}
/**
* @Description 获取客户下人员分类配置显示的预警配置的
* @param customerId
* @author zxc
* @date 2022/1/18 10:07 上午
*/
@PostMapping("getcustomercategoryshowandwarnlist")
public Result<List<CustomerCategoryShowAndWarnListResultDTO>> getCustomerCategoryShowAndWarnList(@RequestParam("customerId")String customerId){
return new Result<List<CustomerCategoryShowAndWarnListResultDTO>>().ok(icResiCategoryStatsConfigService.getCustomerCategoryShowAndWarnList(customerId));
}
}

9
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/IcResiCategoryStatsConfigDao.java

@ -18,6 +18,7 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.result.CustomerCategoryShowAndWarnListResultDTO;
import com.epmet.dto.result.IcResiCategoryStatsConfigResultDTO;
import com.epmet.entity.IcResiCategoryStatsConfigEntity;
import org.apache.ibatis.annotations.Mapper;
@ -43,4 +44,12 @@ public interface IcResiCategoryStatsConfigDao extends BaseDao<IcResiCategoryStat
List<IcResiCategoryStatsConfigResultDTO> listInfo(@Param("customerId") String customerId, @Param("isWarn") Integer isWarn, @Param("level") Integer level);
IcResiCategoryStatsConfigResultDTO info(@Param("id") String id,@Param("customerId") String customerId);
/**
* @Description 获取客户下人员分类配置显示的预警配置的
* @param customerId
* @author zxc
* @date 2022/1/18 10:09 上午
*/
List<CustomerCategoryShowAndWarnListResultDTO> getCustomerCategoryShowAndWarnList(@Param("customerId")String customerId);
}

10
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcResiCategoryStatsConfigService.java

@ -20,6 +20,7 @@ package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.IcResiCategoryStatsConfigDTO;
import com.epmet.dto.result.CustomerCategoryShowAndWarnListResultDTO;
import com.epmet.entity.IcResiCategoryStatsConfigEntity;
import java.util.List;
@ -101,4 +102,13 @@ public interface IcResiCategoryStatsConfigService extends BaseService<IcResiCate
* @Date 2021/11/5 15:43
*/
List<IcResiCategoryStatsConfigDTO> getCategoryList(IcResiCategoryStatsConfigDTO dto);
/**
* @Description 获取客户下人员分类配置显示的预警配置的
* @param customerId
* @author zxc
* @date 2022/1/18 10:07 上午
*/
List<CustomerCategoryShowAndWarnListResultDTO> getCustomerCategoryShowAndWarnList(String customerId);
}

6
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcResiCategoryWarnConfigService.java

@ -92,4 +92,10 @@ public interface IcResiCategoryWarnConfigService extends BaseService<IcResiCateg
* @date 2021-11-04
*/
void delete(String[] ids);
/**
* @author sun
* @Description 获取客户居民类别预警配置表数据
*/
List<IcResiCategoryWarnConfigDTO> categoryWarnConfigList(String customerId);
}

22
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcResiCategoryStatsConfigServiceImpl.java

@ -26,18 +26,17 @@ import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.dao.IcResiCategoryStatsConfigDao;
import com.epmet.dto.IcResiCategoryStatsConfigDTO;
import com.epmet.dto.result.CustomerCategoryShowAndWarnListResultDTO;
import com.epmet.entity.IcResiCategoryStatsConfigEntity;
import com.epmet.redis.IcResiCategoryStatsConfigRedis;
import com.epmet.service.IcResiCategoryStatsConfigService;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.*;
/**
* 居民类别配置表
@ -123,4 +122,19 @@ public class IcResiCategoryStatsConfigServiceImpl extends BaseServiceImpl<IcResi
return ConvertUtils.sourceToTarget(list, IcResiCategoryStatsConfigDTO.class);
}
/**
* @Description 获取客户下人员分类配置显示的预警配置的
* @param customerId
* @author zxc
* @date 2022/1/18 10:07 上午
*/
@Override
public List<CustomerCategoryShowAndWarnListResultDTO> getCustomerCategoryShowAndWarnList(String customerId) {
List<CustomerCategoryShowAndWarnListResultDTO> result = baseDao.getCustomerCategoryShowAndWarnList(customerId);
if (CollectionUtils.isNotEmpty(result)){
return result;
}
return new ArrayList<>();
}
}

14
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcResiCategoryWarnConfigServiceImpl.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;
@ -101,4 +102,17 @@ public class IcResiCategoryWarnConfigServiceImpl extends BaseServiceImpl<IcResiC
baseDao.deleteBatchIds(Arrays.asList(ids));
}
/**
* @author sun
* @Description 获取客户居民类别预警配置表数据
*/
@Override
public List<IcResiCategoryWarnConfigDTO> categoryWarnConfigList(String customerId) {
LambdaQueryWrapper<IcResiCategoryWarnConfigEntity> wrapperWarn = new LambdaQueryWrapper<>();
wrapperWarn.eq(IcResiCategoryWarnConfigEntity::getCustomerId, customerId);
wrapperWarn.orderByAsc(IcResiCategoryWarnConfigEntity::getSort);
List<IcResiCategoryWarnConfigEntity> entityList = baseDao.selectList(wrapperWarn);
return ConvertUtils.sourceToTarget(entityList, IcResiCategoryWarnConfigDTO.class);
}
}

21
epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcResiCategoryStatsConfigDao.xml

@ -71,5 +71,26 @@
and a.id = #{id}
</select>
<!-- 获取客户下人员分类配置显示的,预警配置的 -->
<select id="getCustomerCategoryShowAndWarnList" resultType="com.epmet.dto.result.CustomerCategoryShowAndWarnListResultDTO">
SELECT
sc.ID AS statsConfigId,
sc.COLUMN_NAME,
sc.LABEL,
sc.MANAGEMENT_ICON,
sc.DATA_ICON,
sc.HOUSE_SHOW_ICON,
wc.ID AS warnConfigId,
wc.LEVEL_1 AS level1,
wc.LEVEL_2 AS level2,
wc.LEVEL_3 AS level3
FROM ic_resi_category_stats_config sc
INNER JOIN ic_resi_category_warn_config wc ON (wc.CUSTOMER_ID = sc.CUSTOMER_ID AND wc.COLUMN_NAME = sc.COLUMN_NAME AND wc.WARN = 1)
WHERE sc.DEL_FLAG = '0'
AND sc.`STATUS` = 'show'
AND sc.CUSTOMER_ID = #{customerId}
ORDER BY sc.SORT
</select>
</mapper>

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

@ -448,6 +448,11 @@ public class IcResiUserDTO implements Serializable {
*/
private String jtxxRemakes;
/**
* 用户状态0:正常 1:转出
*/
private String status;
/**
* 删除标识 0.未删除 1.已删除
*/

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

@ -45,7 +45,7 @@ public class IcUserChangeDetailedDTO implements Serializable {
private String customerId;
/**
* 字段名18类对应的ic_resi_user表字段名
* 变更记录表主键ic_user_change_record.id
*/
private String icUserChangeRecordId;

4
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcUserChangeRecordDTO.java

@ -69,12 +69,12 @@ public class IcUserChangeRecordDTO implements Serializable {
private String icUserName;
/**
* 操作类型add:新增 category:类别变动 transfer
* 操作类型add:新增 category:类别 transfer:调动
*/
private String type;
/**
* 操作类型名称add:新增 category:类别变动 transfer:迁出
* 操作类型名称add:新增 category:类别 transfer:调动
*/
private String typeName;

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

@ -0,0 +1,26 @@
package com.epmet.dto;
import com.epmet.commons.tools.constant.NumConstant;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2022/1/17 3:27 下午
* @DESC
*/
@Data
public class PersonWarnLeftPieDTO implements Serializable {
private static final long serialVersionUID = 337571869959815613L;
private Integer count;
private String configId;
public PersonWarnLeftPieDTO() {
this.count = NumConstant.ZERO;
this.configId = "";
}
}

32
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiUserChangeRecordFormDTO.java

@ -0,0 +1,32 @@
package com.epmet.dto.form;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @Description 基础信息变更记录
* @Author sun
*/
@Data
public class IcResiUserChangeRecordFormDTO implements Serializable {
private static final long serialVersionUID = 9156247659994638103L;
public interface ChangeRecord extends CustomerClientShowGroup {}
/**
* 字段对应表名
*/
@NotBlank(message = "人员Id不能为空" , groups = ChangeRecord.class)
private String icUserId;
/**
* 页码
*/
private Integer pageNo = 1;
/**
* 每页显示数量
*/
private Integer pageSize = 20;
}

69
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiUserTransferFormDTO.java

@ -0,0 +1,69 @@
package com.epmet.dto.form;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;
/**
* @Description 基础信息人员调动
* @Author sun
*/
@Data
public class IcResiUserTransferFormDTO implements Serializable {
private static final long serialVersionUID = 9156247659994638103L;
public interface TransferAdd extends CustomerClientShowGroup {}
/**
* 被调动人ID
*/
@NotBlank(message = "被调动人Id不能为空" , groups = TransferAdd.class)
private String icUserId;
/**
* 操作类型客户外out,客户内in
*/
@NotBlank(message = "操作类型不能为空" , groups = TransferAdd.class)
private String type;
/**
* 调动到的组织Id
*/
private String newAgencyId;
/**
* 调动到的网格Id
*/
private String newGridId;
/**
* 调动到的小区ID
*/
private String newNeighborHoodId;
/**
* 调动到的楼宇Id
*/
private String newBuildingId;
/**
* 调动到的单元Id
*/
private String newBuildingUnitId;
/**
* 调动到的房屋Id
*/
private String newHouseId;
/**
* 调动时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@NotNull(message = "调动时间不能为空" , groups = TransferAdd.class)
private Date transferTime;
/**
* 备注
*/
private String remark;
//token中信息
private String customerId;
private String staffId;
}

25
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/PersonWarnRightListFormDTO.java

@ -0,0 +1,25 @@
package com.epmet.dto.form;
import lombok.Data;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2022/1/17 4:13 下午
* @DESC
*/
@Data
public class PersonWarnRightListFormDTO implements Serializable {
private static final long serialVersionUID = -3561699479212127370L;
public interface PersonWarnRightListForm{}
@NotNull(message = "pageNo不能为空",groups = PersonWarnRightListForm.class)
private Integer pageNo;
@NotNull(message = "pageSize不能为空",groups = PersonWarnRightListForm.class)
private Integer pageSize;
}

20
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/IcUserChangeRecordResultDTO.java

@ -0,0 +1,20 @@
package com.epmet.dto.result;
import com.epmet.dto.IcUserChangeRecordDTO;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* @Description 基础信息变更记录
* @Author sun
*/
@Data
public class IcUserChangeRecordResultDTO implements Serializable {
private static final long serialVersionUID = 1L;
//集合总条数
private Integer total = 0;
//变更记录
private List<IcUserChangeRecordDTO> list;
}

48
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/PersonWarnLeftPieResultDTO.java

@ -0,0 +1,48 @@
package com.epmet.dto.result;
import com.epmet.commons.tools.constant.NumConstant;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
/**
* @Author zxc
* @DateTime 2022/1/17 2:33 下午
* @DESC
*/
@Data
public class PersonWarnLeftPieResultDTO implements Serializable {
private static final long serialVersionUID = -111604873581992490L;
private Integer total;
private List<PersonWarnLeftPie> list;
public PersonWarnLeftPieResultDTO() {
this.total = NumConstant.ZERO;
this.list = new ArrayList<>();
}
@Data
public static class PersonWarnLeftPie{
@JsonIgnore
private String configId;
private String typeName;
private String typeCode;
private Integer typeCount;
public PersonWarnLeftPie() {
this.typeName = "";
this.typeCode = "";
this.typeCount = NumConstant.ZERO;
}
}
}

68
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/PersonWarnRightListResultDTO.java

@ -0,0 +1,68 @@
package com.epmet.dto.result;
import com.epmet.commons.tools.constant.NumConstant;
import lombok.Data;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
/**
* @Author zxc
* @DateTime 2022/1/17 4:16 下午
* @DESC
*/
@Data
public class PersonWarnRightListResultDTO implements Serializable {
private static final long serialVersionUID = -9181230625228226662L;
private Integer total;
private List<PersonWarnRightList> list;
public PersonWarnRightListResultDTO() {
this.total = NumConstant.ZERO;
this.list = new ArrayList<>();
}
@Data
public static class PersonWarnRightList{
/**
* 类型
*/
private List<String> type;
/**
* 所属网格
*/
private String gridName;
/**
* 姓名
*/
private String name;
/**
* 所属家庭
*/
private String family;
/**
* 电话
*/
private String mobile;
private String userId;
public PersonWarnRightList() {
this.type = new ArrayList<>();
this.gridName = "";
this.name = "";
this.family = "";
this.mobile = "";
this.userId = "";
}
}
}

13
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java

@ -668,4 +668,17 @@ public class IcResiUserController {
PageData<Map<String, Object>> r = icResiUserService.pageResiMap(input);
return new Result<PageData<Map<String, Object>>>().ok(r);
}
/**
* @Description 社区查询人员预警右侧列表
* @param formDTO
* @param tokenDto
* @author zxc
* @date 2022/1/17 4:25 下午
*/
@PostMapping("personwarn/rightlist")
public Result<PersonWarnRightListResultDTO> personWarnRightList(@RequestBody PersonWarnRightListFormDTO formDTO,@LoginUser TokenDto tokenDto){
ValidatorUtils.validateEntity(formDTO, PersonWarnRightListFormDTO.PersonWarnRightListForm.class);
return new Result<PersonWarnRightListResultDTO>().ok(icResiUserService.personWarnRightList(formDTO,tokenDto));
}
}

14
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcStatsResiWarnController.java

@ -17,7 +17,9 @@
package com.epmet.controller;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ExcelUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.AssertUtils;
@ -26,6 +28,7 @@ import com.epmet.commons.tools.validator.group.AddGroup;
import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.dto.IcStatsResiWarnDTO;
import com.epmet.dto.result.PersonWarnLeftPieResultDTO;
import com.epmet.excel.IcStatsResiWarnExcel;
import com.epmet.service.IcStatsResiWarnService;
import org.springframework.beans.factory.annotation.Autowired;
@ -91,4 +94,15 @@ public class IcStatsResiWarnController {
ExcelUtils.exportExcelToTarget(response, null, list, IcStatsResiWarnExcel.class);
}
/**
* @Description 社区查询人员预警饼图
* @param tokenDto
* @author zxc
* @date 2022/1/17 2:39 下午
*/
@PostMapping("personwarn/leftpie")
public Result<PersonWarnLeftPieResultDTO> personWarnLeftPie(@LoginUser TokenDto tokenDto){
return new Result<PersonWarnLeftPieResultDTO>().ok(icStatsResiWarnService.personWarnLeftPie(tokenDto));
}
}

16
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcUserChangeRecordController.java

@ -17,8 +17,15 @@
package com.epmet.controller;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dto.form.IcResiUserChangeRecordFormDTO;
import com.epmet.dto.form.IcResiUserTransferFormDTO;
import com.epmet.dto.result.IcUserChangeRecordResultDTO;
import com.epmet.service.IcUserChangeRecordService;
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;
@ -36,5 +43,14 @@ public class IcUserChangeRecordController {
@Autowired
private IcUserChangeRecordService icUserChangeRecordService;
/**
* @Author sun
* @Description 基础信息变更记录
**/
@PostMapping("list")
public Result<IcUserChangeRecordResultDTO> list(@RequestBody IcResiUserChangeRecordFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, IcResiUserTransferFormDTO.TransferAdd.class);
return new Result<IcUserChangeRecordResultDTO>().ok(icUserChangeRecordService.list(formDTO));
}
}

23
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcUserTransferRecordController.java

@ -17,8 +17,16 @@
package com.epmet.controller;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.aop.NoRepeatSubmit;
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.IcResiUserTransferFormDTO;
import com.epmet.service.IcUserTransferRecordService;
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;
@ -37,4 +45,19 @@ public class IcUserTransferRecordController {
private IcUserTransferRecordService icUserTransferRecordService;
/**
* @Author sun
* @Description 基础信息人员调动
**/
@NoRepeatSubmit
@PostMapping("add")
public Result add(@LoginUser TokenDto tokenDto, @RequestBody IcResiUserTransferFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, IcResiUserTransferFormDTO.TransferAdd.class);
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setStaffId(tokenDto.getUserId());
icUserTransferRecordService.add(formDTO);
return new Result();
}
}

2
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java

@ -229,4 +229,6 @@ public interface IcResiUserDao extends BaseDao<IcResiUserEntity> {
@Param("code") String code);
List<VolunteerDistributionResultDTO.Distribution> listIcResiInfosByUserIds(@Param("userIds") List<String> userIds);
Map<String, String> getCategoryListMap(@Param("icUserId") String icUserId);
}

10
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcStatsResiWarnDao.java

@ -19,6 +19,7 @@ package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.IcResiCategoryStatsConfigDTO;
import com.epmet.dto.PersonWarnLeftPieDTO;
import com.epmet.entity.IcStatsResiWarnEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -58,4 +59,13 @@ public interface IcStatsResiWarnDao extends BaseDao<IcStatsResiWarnEntity> {
@Param("columnName") String columnName,
@Param("icStatsResiWarn") IcStatsResiWarnEntity icStatsResiWarn);
/**
* @Description 查询分类下的人数
* @param configIds
* @param agencyId
* @author zxc
* @date 2022/1/17 3:30 下午
*/
List<PersonWarnLeftPieDTO> selectCategoryCount(@Param("configIds") List<String> configIds,@Param("agencyId")String agencyId);
}

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

@ -18,8 +18,12 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.IcUserChangeRecordDTO;
import com.epmet.entity.IcUserChangeRecordEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 居民变更记录表
@ -29,5 +33,10 @@ import org.apache.ibatis.annotations.Mapper;
*/
@Mapper
public interface IcUserChangeRecordDao extends BaseDao<IcUserChangeRecordEntity> {
/**
* @Author sun
* @Description 查询居民变更记录
**/
List<IcUserChangeRecordDTO> getList(@Param("icUserId") String icUserId);
}

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

@ -440,6 +440,11 @@ public class IcResiUserEntity extends BaseEpmetEntity {
*/
private String jtxxRemakes;
/**
* 用户状态0:正常 1:转出
*/
private String status;
/**
* 预留字段1
*/

2
epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcUserChangeDetailedEntity.java

@ -42,7 +42,7 @@ public class IcUserChangeDetailedEntity extends BaseEpmetEntity {
private String customerId;
/**
* 字段名18类对应的ic_resi_user表字段名
* 变更记录表主键ic_user_change_record.id
*/
private String icUserChangeRecordId;

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

@ -68,12 +68,12 @@ public class IcUserChangeRecordEntity extends BaseEpmetEntity {
private String icUserName;
/**
* 操作类型add:新增 category:类别变动 transfer
* 操作类型add:新增 category:类别 transfer:调动
*/
private String type;
/**
* 操作类型名称add:新增 category:类别变动 transfer:迁出
* 操作类型名称add:新增 category:类别 transfer:调动
*/
private String typeName;

10
epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java

@ -199,4 +199,14 @@ public interface IcResiUserService extends BaseService<IcResiUserEntity> {
* @return
*/
IcResiUserDTO get(String icResiUserId);
/**
* @Description 社区查询人员预警右侧列表
* @param formDTO
* @param tokenDto
* @author zxc
* @date 2022/1/17 4:25 下午
*/
PersonWarnRightListResultDTO personWarnRightList(PersonWarnRightListFormDTO formDTO, TokenDto tokenDto);
}

10
epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcStatsResiWarnService.java

@ -19,7 +19,9 @@ package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.dto.IcStatsResiWarnDTO;
import com.epmet.dto.result.PersonWarnLeftPieResultDTO;
import com.epmet.entity.IcStatsResiWarnEntity;
import java.util.List;
@ -92,4 +94,12 @@ public interface IcStatsResiWarnService extends BaseService<IcStatsResiWarnEntit
* @date 2021-11-04
*/
void delete(String[] ids);
/**
* @Description 社区查询人员预警饼图
* @param tokenDto
* @author zxc
* @date 2022/1/17 2:39 下午
*/
PersonWarnLeftPieResultDTO personWarnLeftPie(TokenDto tokenDto);
}

7
epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcUserChangeRecordService.java

@ -18,6 +18,8 @@
package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.dto.form.IcResiUserChangeRecordFormDTO;
import com.epmet.dto.result.IcUserChangeRecordResultDTO;
import com.epmet.entity.IcUserChangeRecordEntity;
/**
@ -28,4 +30,9 @@ import com.epmet.entity.IcUserChangeRecordEntity;
*/
public interface IcUserChangeRecordService extends BaseService<IcUserChangeRecordEntity> {
/**
* @Author sun
* @Description 基础信息变更记录
**/
IcUserChangeRecordResultDTO list(IcResiUserChangeRecordFormDTO formDTO);
}

7
epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcUserTransferRecordService.java

@ -18,6 +18,7 @@
package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.dto.form.IcResiUserTransferFormDTO;
import com.epmet.entity.IcUserTransferRecordEntity;
/**
@ -28,4 +29,10 @@ import com.epmet.entity.IcUserTransferRecordEntity;
*/
public interface IcUserTransferRecordService extends BaseService<IcUserTransferRecordEntity> {
/**
* @Author sun
* @Description 基础信息人员调动
**/
void add(IcResiUserTransferFormDTO formDTO);
}

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

@ -54,9 +54,13 @@ import com.epmet.dto.form.*;
import com.epmet.dto.form.demand.UserDemandNameQueryFormDTO;
import com.epmet.dto.result.*;
import com.epmet.entity.IcResiUserEntity;
import com.epmet.entity.IcUserChangeDetailedEntity;
import com.epmet.entity.IcUserChangeRecordEntity;
import com.epmet.excel.support.ExportResiUserItemDTO;
import com.epmet.feign.*;
import com.epmet.service.IcResiUserService;
import com.epmet.service.IcUserChangeDetailedService;
import com.epmet.service.IcUserChangeRecordService;
import com.epmet.service.UserService;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
@ -106,6 +110,10 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
private EpmetAdminOpenFeignClient epmetAdminOpenFeignClient;
@Autowired
private IcResiUserDao icResiUserDao;
@Autowired
private IcUserChangeRecordService icUserChangeRecordService;
@Autowired
private IcUserChangeDetailedService icUserChangeDetailedService;
private QueryWrapper<IcResiUserEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
@ -162,9 +170,12 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
//1.先往主表新增数据
//主表Id
String resiUserId = UUID.randomUUID().toString().replaceAll("-", "");
formDTO.forEach(d -> {
String name = "";
LinkedHashMap<String, String> map = new LinkedHashMap<>();
for (IcResiUserFormDTO d : formDTO) {
if ("ic_resi_user".equals(d.getTableName())) {
LinkedHashMap<String, String> map = d.getList().get(0);
map = d.getList().get(0);
name = map.get("NAME");
map.put("id", resiUserId);
map.put("customer_id", tokenDto.getCustomerId());
map.put("created_by", tokenDto.getUserId());
@ -195,26 +206,79 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
//新增主表数据
baseDao.add(d.getTableName(), map);
}
});
}
//2.循环字表新增数据
formDTO.forEach(d -> {
if (!"ic_resi_user".equals(d.getTableName())) {
for (LinkedHashMap<String, String> map : d.getList()) {
map.put("id", UUID.randomUUID().toString().replaceAll("-", ""));
map.put("ic_resi_user", resiUserId);
map.put("customer_id", tokenDto.getCustomerId());
map.put("created_by", tokenDto.getUserId());
map.put("updated_by", tokenDto.getUserId());
for (LinkedHashMap<String, String> hash : d.getList()) {
hash.put("id", UUID.randomUUID().toString().replaceAll("-", ""));
hash.put("ic_resi_user", resiUserId);
hash.put("customer_id", tokenDto.getCustomerId());
hash.put("created_by", tokenDto.getUserId());
hash.put("updated_by", tokenDto.getUserId());
//字表新增数据
baseDao.add(d.getTableName(), map);
baseDao.add(d.getTableName(), hash);
}
}
});
//3.变更记录表和变更记录明细表新增数据
CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId());
//3-1.变更记录表
IcUserChangeRecordEntity changeRecordEntity = new IcUserChangeRecordEntity();
changeRecordEntity.setCustomerId(tokenDto.getCustomerId());
changeRecordEntity.setOperatorId(tokenDto.getUserId());
changeRecordEntity.setIcUserId(resiUserId);
changeRecordEntity.setOperatorName(staffInfoCache.getRealName());
changeRecordEntity.setIcUserName(name);
changeRecordEntity.setType("add");
changeRecordEntity.setTypeName("新增");
changeRecordEntity.setBeforeChangeName("-");
changeRecordEntity.setAfterChangeName("-");
changeRecordEntity.setChangeTime(new java.util.Date());
icUserChangeRecordService.insert(changeRecordEntity);
//3-2.变更明细表
List<IcUserChangeDetailedEntity> changeDetailedEntityList = saveChangeRecord(tokenDto, map, resiUserId, changeRecordEntity.getId());
icUserChangeDetailedService.insertBatch(changeDetailedEntityList);
return resiUserId;
}
/**
* @Author sun
* @Description 变更明细表
**/
private List<IcUserChangeDetailedEntity> saveChangeRecord(TokenDto tokenDto, LinkedHashMap<String, String> map, String icUserId, String icUserChangeRecordId) {
List<IcUserChangeDetailedEntity> list = new ArrayList<>();
Result<List<IcResiCategoryWarnConfigDTO>> resultList = operCustomizeOpenFeignClient.categoryWarnConfigList(tokenDto.getCustomerId());
if (!resultList.success()) {
throw new RuntimeException("人员新增,获取客户居民类别预警配置表数据失败");
}
IcUserChangeDetailedEntity outEntity = null;
for (IcResiCategoryWarnConfigDTO cf : resultList.getData()) {
if (map.containsKey(cf.getColumnName()) && "1".equals(map.get(cf.getColumnName()))) {
//新增
outEntity = new IcUserChangeDetailedEntity();
outEntity.setCustomerId(tokenDto.getCustomerId());
outEntity.setIcUserChangeRecordId(icUserChangeRecordId);
outEntity.setAgencyId(map.get("AGENCY_ID"));
outEntity.setGridId(map.get("GRID_ID"));
outEntity.setNeighborHoodId(map.get("VILLAGE_ID"));
outEntity.setBuildingId(map.get("BUILD_ID"));
outEntity.setBuildingUnitId(map.get("UNIT_ID"));
outEntity.setHouseId(map.get("HOME_ID"));
outEntity.setIcUserId(icUserId);
outEntity.setType("add");
outEntity.setTypeName("新增");
outEntity.setFieldName(cf.getColumnName());
outEntity.setValue(1);
list.add(outEntity);
}
}
return list;
}
/**
* @Author sun
* @Description 党建互联平台--修改居民信息
@ -942,6 +1006,18 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
return ConvertUtils.sourceToTarget(icResiUserEntity,IcResiUserDTO.class);
}
/**
* @Description 社区查询人员预警右侧列表
* @param formDTO
* @param tokenDto
* @author zxc
* @date 2022/1/17 4:25 下午
*/
@Override
public PersonWarnRightListResultDTO personWarnRightList(PersonWarnRightListFormDTO formDTO, TokenDto tokenDto) {
return null;
}
/**
* 查询志愿者类别options
* @param customerId

53
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcStatsResiWarnServiceImpl.java

@ -20,22 +20,34 @@ package com.epmet.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
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.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dao.IcStatsResiWarnDao;
import com.epmet.dto.IcResiCategoryWarnConfigDTO;
import com.epmet.dto.IcStatsResiWarnDTO;
import com.epmet.dto.PersonWarnLeftPieDTO;
import com.epmet.dto.result.PersonWarnLeftPieResultDTO;
import com.epmet.entity.IcStatsResiWarnEntity;
import com.epmet.feign.OperCustomizeOpenFeignClient;
import com.epmet.redis.IcStatsResiWarnRedis;
import com.epmet.service.IcStatsResiWarnService;
import org.apache.commons.collections4.CollectionUtils;
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;
import java.util.stream.Collectors;
/**
* 预警统计表
@ -47,7 +59,7 @@ import java.util.Map;
public class IcStatsResiWarnServiceImpl extends BaseServiceImpl<IcStatsResiWarnDao, IcStatsResiWarnEntity> implements IcStatsResiWarnService {
@Autowired
private IcStatsResiWarnRedis icStatsResiWarnRedis;
private OperCustomizeOpenFeignClient operCustomizeOpenFeignClient;
@Override
public PageData<IcStatsResiWarnDTO> page(Map<String, Object> params) {
@ -101,4 +113,43 @@ public class IcStatsResiWarnServiceImpl extends BaseServiceImpl<IcStatsResiWarnD
baseDao.deleteBatchIds(Arrays.asList(ids));
}
/**
* @Description 社区查询人员预警饼图
* @param tokenDto
* @author zxc
* @date 2022/1/17 2:39 下午
*/
@Override
public PersonWarnLeftPieResultDTO personWarnLeftPie(TokenDto tokenDto) {
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId());
if (null == staffInfo){
throw new EpmetException(String.format("未查询到此工作人员%s",tokenDto.getUserId()));
}
// 查询设置预警的分类
Result<List<IcResiCategoryWarnConfigDTO>> listResult = operCustomizeOpenFeignClient.resiCategoryWarnList(tokenDto.getCustomerId());
if (!listResult.success()){
throw new EpmetException("查询设置预警的分类失败...");
}
PersonWarnLeftPieResultDTO result = new PersonWarnLeftPieResultDTO();
if (CollectionUtils.isEmpty(listResult.getData())){
return result;
}
List<IcResiCategoryWarnConfigDTO> configList = listResult.getData();
List<PersonWarnLeftPieResultDTO.PersonWarnLeftPie> list = new ArrayList<>();
configList.forEach(c -> {
PersonWarnLeftPieResultDTO.PersonWarnLeftPie p = new PersonWarnLeftPieResultDTO.PersonWarnLeftPie();
p.setTypeName(c.getLabel());
p.setTypeCode(c.getColumnName());
p.setConfigId(c.getId());
list.add(p);
});
List<PersonWarnLeftPieDTO> dtos = baseDao.selectCategoryCount(configList.stream().map(m -> m.getId()).collect(Collectors.toList()), staffInfo.getAgencyId());
if (CollectionUtils.isNotEmpty(dtos)){
list.forEach(l -> dtos.stream().filter(d -> d.getConfigId().equals(l.getConfigId())).forEach(d -> l.setTypeCount(d.getCount())));
}
result.setTotal(list.stream().collect(Collectors.summingInt(PersonWarnLeftPieResultDTO.PersonWarnLeftPie::getTypeCount)));
result.setList(list);
return result;
}
}

22
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserChangeRecordServiceImpl.java

@ -19,9 +19,15 @@ package com.epmet.service.impl;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.dao.IcUserChangeRecordDao;
import com.epmet.dto.IcUserChangeRecordDTO;
import com.epmet.dto.form.IcResiUserChangeRecordFormDTO;
import com.epmet.dto.result.IcUserChangeRecordResultDTO;
import com.epmet.entity.IcUserChangeRecordEntity;
import com.epmet.service.IcUserChangeRecordService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
/**
* 居民变更记录表
@ -32,5 +38,21 @@ import org.springframework.stereotype.Service;
@Service
public class IcUserChangeRecordServiceImpl extends BaseServiceImpl<IcUserChangeRecordDao, IcUserChangeRecordEntity> implements IcUserChangeRecordService {
/**
* @Author sun
* @Description 基础信息变更记录
**/
@Override
public IcUserChangeRecordResultDTO list(IcResiUserChangeRecordFormDTO formDTO) {
IcUserChangeRecordResultDTO resultDTO = new IcUserChangeRecordResultDTO();
PageInfo<IcUserChangeRecordDTO> result =
PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.getList(formDTO.getIcUserId()));
if (CollectionUtils.isEmpty(result.getList())) {
return resultDTO;
}
resultDTO.setTotal((int) result.getTotal());
resultDTO.setList(result.getList());
return resultDTO;
}
}

229
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserTransferRecordServiceImpl.java

@ -18,11 +18,35 @@
package com.epmet.service.impl;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dao.IcResiUserDao;
import com.epmet.dao.IcUserTransferRecordDao;
import com.epmet.dto.IcResiCategoryWarnConfigDTO;
import com.epmet.dto.IcResiUserDTO;
import com.epmet.dto.form.IcResiUserOrgMsgFormDTO;
import com.epmet.dto.form.IcResiUserTransferFormDTO;
import com.epmet.dto.result.IcResiUserOrgMsgResultDTO;
import com.epmet.entity.IcResiUserEntity;
import com.epmet.entity.IcUserChangeDetailedEntity;
import com.epmet.entity.IcUserChangeRecordEntity;
import com.epmet.entity.IcUserTransferRecordEntity;
import com.epmet.feign.GovOrgOpenFeignClient;
import com.epmet.feign.OperCustomizeOpenFeignClient;
import com.epmet.service.IcUserChangeDetailedService;
import com.epmet.service.IcUserChangeRecordService;
import com.epmet.service.IcUserTransferRecordService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/**
* 居民调动记录表
*
@ -31,6 +55,211 @@ import org.springframework.stereotype.Service;
*/
@Service
public class IcUserTransferRecordServiceImpl extends BaseServiceImpl<IcUserTransferRecordDao, IcUserTransferRecordEntity> implements IcUserTransferRecordService {
private Logger log = LoggerFactory.getLogger(IcUserTransferRecordServiceImpl.class);
@Autowired
private IcResiUserDao icResiUserDao;
@Autowired
private GovOrgOpenFeignClient govOrgOpenFeignClient;
@Autowired
private IcUserChangeRecordService icUserChangeRecordService;
@Autowired
private OperCustomizeOpenFeignClient operCustomizeOpenFeignClient;
@Autowired
private IcUserChangeDetailedService icUserChangeDetailedService;
/**
* @Author sun
* @Description 基础信息人员调动
**/
@Override
public void add(IcResiUserTransferFormDTO formDTO) {
//1.判断被调动人员是否有效
IcResiUserDTO resiUserDTO = icResiUserDao.selectIdByIdCard(formDTO.getCustomerId(), null, formDTO.getIcUserId());
if (null == resiUserDTO) {
throw new RenException("9000", "人员调动失败,被调动人不存在!");
}
//2.查询人员调动前的组织、网格、小区、楼栋、单元、房屋信息
IcResiUserOrgMsgFormDTO orgMsgFormDTO1 = new IcResiUserOrgMsgFormDTO();
orgMsgFormDTO1.setCustomerId(resiUserDTO.getCustomerId());
orgMsgFormDTO1.setAgencyId(resiUserDTO.getAgencyId());
orgMsgFormDTO1.setGridId(resiUserDTO.getGridId());
orgMsgFormDTO1.setNeighborHoodId(resiUserDTO.getVillageId());
orgMsgFormDTO1.setBuildingId(resiUserDTO.getBuildId());
orgMsgFormDTO1.setBuildingUnitId(resiUserDTO.getUnitId());
orgMsgFormDTO1.setHouseId(resiUserDTO.getHomeId());
Result<IcResiUserOrgMsgResultDTO> result1 = govOrgOpenFeignClient.icResiUserOrgMsg(orgMsgFormDTO1);
if (!result1.success() || null == result1.getData().getAgencyDTO() || null == result1.getData().getGridDTO() || null == result1.getData().getNeighborHoodDTO()
|| null == result1.getData().getBuildingDTO() || null == result1.getData().getBuildingUnitDTO() || null == result1.getData().getHouseDTO()) {
log.warn("查找被调动人调动前的组织、网格、小区、楼栋、单元、房屋信息失败");
throw new RenException("9000", "获取被调动人基础信息失败");
}
//3.查询人员调动后的组织、网格、小区、楼栋、单元、房屋信息
IcResiUserOrgMsgFormDTO orgMsgFormDTO2 = new IcResiUserOrgMsgFormDTO();
orgMsgFormDTO2.setCustomerId(formDTO.getCustomerId());
orgMsgFormDTO2.setAgencyId(formDTO.getNewAgencyId());
orgMsgFormDTO2.setGridId(formDTO.getNewGridId());
orgMsgFormDTO2.setNeighborHoodId(formDTO.getNewNeighborHoodId());
orgMsgFormDTO2.setBuildingId(formDTO.getNewBuildingId());
orgMsgFormDTO2.setBuildingUnitId(formDTO.getNewBuildingUnitId());
orgMsgFormDTO2.setHouseId(formDTO.getNewHouseId());
Result<IcResiUserOrgMsgResultDTO> result2 = govOrgOpenFeignClient.icResiUserOrgMsg(orgMsgFormDTO2);
if (!result2.success() || null == result2.getData().getAgencyDTO() || null == result2.getData().getGridDTO() || null == result2.getData().getNeighborHoodDTO()
|| null == result2.getData().getBuildingDTO() || null == result2.getData().getBuildingUnitDTO() || null == result2.getData().getHouseDTO()) {
log.warn("查找被调动人调动后的组织、网格、小区、楼栋、单元、房屋信息失败");
throw new RenException("9000", "获取被调动人基础信息失败");
}
//4.修改被调动人所属各维度信息或人员状态信息
IcResiUserEntity userEntity = new IcResiUserEntity();
userEntity.setId(formDTO.getIcUserId());
if ("out".equals(formDTO.getType())) {
//4-1.转到客户外修改基础信息表人员信息状态
userEntity.setStatus("1");
} else {
//4-2.客户内部流转修改所属各维度信息
userEntity.setAgencyId(formDTO.getNewAgencyId());
userEntity.setGridId(formDTO.getNewGridId());
userEntity.setVillageId(formDTO.getNewNeighborHoodId());
userEntity.setBuildId(formDTO.getNewBuildingId());
userEntity.setUnitId(formDTO.getNewBuildingUnitId());
userEntity.setHomeId(formDTO.getNewHouseId());
}
icResiUserDao.updateById(userEntity);
//5.生成调动记录
CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId());
IcUserTransferRecordEntity recordEntity = saveTransferRecord(staffInfoCache, formDTO, resiUserDTO, result1.getData(), result2.getData());
insert(recordEntity);
//6.生成调动前后的变更记录、变更明细
//6-1.变更记录
IcUserChangeRecordEntity changeRecordEntity = new IcUserChangeRecordEntity();
changeRecordEntity.setIcUserTransferRecordId(recordEntity.getId());
if ("in".equals(formDTO.getType())) {
changeRecordEntity.setCustomerId(resiUserDTO.getCustomerId());
}
changeRecordEntity.setOperatorId(formDTO.getStaffId());
changeRecordEntity.setIcUserId(formDTO.getIcUserId());
changeRecordEntity.setOperatorName(staffInfoCache.getRealName());
changeRecordEntity.setIcUserName(resiUserDTO.getName());
changeRecordEntity.setType("transfer");
changeRecordEntity.setTypeName("调动");
StringBuffer beforeName = new StringBuffer();
beforeName.append(result1.getData().getAgencyDTO().getOrganizationName()).append("-").append(result1.getData().getGridDTO().getGridName()).append("-")
.append(result1.getData().getNeighborHoodDTO().getNeighborHoodName()).append("-").append(result1.getData().getBuildingDTO().getBuildingName()).append("-")
.append(result1.getData().getBuildingUnitDTO().getUnitName()).append("-").append(result1.getData().getHouseDTO().getHouseName());
changeRecordEntity.setBeforeChangeName(beforeName.toString());
StringBuffer afterName = new StringBuffer();
afterName.append(result2.getData().getAgencyDTO().getOrganizationName()).append("-").append(result2.getData().getGridDTO().getGridName()).append("-")
.append(result2.getData().getNeighborHoodDTO().getNeighborHoodName()).append("-").append(result2.getData().getBuildingDTO().getBuildingName()).append("-")
.append(result2.getData().getBuildingUnitDTO().getUnitName()).append("-").append(result2.getData().getHouseDTO().getHouseName());
changeRecordEntity.setAfterChangeName(afterName.toString());
changeRecordEntity.setChangeTime(formDTO.getTransferTime());
changeRecordEntity.setRemark(formDTO.getRemark());
icUserChangeRecordService.insert(changeRecordEntity);
//6-2.变更明细【类别明细迁出组织的-1,迁入组织的1】
Result<List<IcResiCategoryWarnConfigDTO>> resultList = operCustomizeOpenFeignClient.categoryWarnConfigList(formDTO.getCustomerId());
if (!resultList.success()) {
throw new RuntimeException("人员调动,获取客户居民类别预警配置表数据失败");
}
Map<String, String> map = icResiUserDao.getCategoryListMap(formDTO.getIcUserId());
List<IcUserChangeDetailedEntity> changeDetailedEntityList = saveChangeDetailed(resultList.getData(), map, changeRecordEntity.getId(), formDTO, resiUserDTO);
icUserChangeDetailedService.insertBatch(changeDetailedEntityList);
}
/**
* @Author sun
* @Description 调动记录
**/
private IcUserTransferRecordEntity saveTransferRecord(CustomerStaffInfoCacheResult staffInfoCache, IcResiUserTransferFormDTO formDTO, IcResiUserDTO resiUserDTO, IcResiUserOrgMsgResultDTO result1, IcResiUserOrgMsgResultDTO result2) {
IcUserTransferRecordEntity recordEntity = new IcUserTransferRecordEntity();
recordEntity.setIcUserId(formDTO.getIcUserId());
recordEntity.setOperatorId(formDTO.getStaffId());
recordEntity.setIcUserName(resiUserDTO.getName());
recordEntity.setOperatorName(null == staffInfoCache ? "" : staffInfoCache.getRealName());
recordEntity.setOldCustomerId(formDTO.getCustomerId());
if ("in".equals(formDTO.getType())) {
recordEntity.setNewCustomerId(resiUserDTO.getCustomerId());
}
recordEntity.setOldAgencyId(resiUserDTO.getAgencyId());
recordEntity.setNewAgencyId(formDTO.getNewAgencyId());
recordEntity.setOldAgencyName(result1.getAgencyDTO().getOrganizationName());
recordEntity.setNewAgencyName(result2.getAgencyDTO().getOrganizationName());
recordEntity.setOldGridId(resiUserDTO.getGridId());
recordEntity.setNewGridId(formDTO.getNewGridId());
recordEntity.setOldGridName(result1.getGridDTO().getGridName());
recordEntity.setNewGridName(result2.getGridDTO().getGridName());
recordEntity.setOldNeighborHoodId(resiUserDTO.getVillageId());
recordEntity.setNewNeighborHoodId(formDTO.getNewNeighborHoodId());
recordEntity.setOldNeighborHoodName(result1.getNeighborHoodDTO().getNeighborHoodName());
recordEntity.setNewNeighborHoodName(result2.getNeighborHoodDTO().getNeighborHoodName());
recordEntity.setOldBuildingId(resiUserDTO.getBuildId());
recordEntity.setNewBuildingId(formDTO.getNewBuildingId());
recordEntity.setOldBuildingName(result1.getBuildingDTO().getBuildingName());
recordEntity.setNewBuildingName(result2.getBuildingDTO().getBuildingName());
recordEntity.setOldBuildingUnitId(resiUserDTO.getUnitId());
recordEntity.setNewBuildingUnitId(formDTO.getNewBuildingUnitId());
recordEntity.setOldBuildingUnitName(result1.getBuildingUnitDTO().getUnitName());
recordEntity.setNewBuildingUnitName(result2.getBuildingUnitDTO().getUnitName());
recordEntity.setOldHouseId(resiUserDTO.getHomeId());
recordEntity.setNewHouseId(formDTO.getNewHouseId());
recordEntity.setOldHouseName(result1.getHouseDTO().getHouseName());
recordEntity.setNewHouseName(result2.getHouseDTO().getHouseName());
recordEntity.setTransferTime(formDTO.getTransferTime());
recordEntity.setRemark(formDTO.getRemark());
return recordEntity;
}
/**
* @Author sun
* @Description 变更明细
**/
private List<IcUserChangeDetailedEntity> saveChangeDetailed(List<IcResiCategoryWarnConfigDTO> configList, Map<String, String> map, String icUserChangeRecordId, IcResiUserTransferFormDTO formDTO, IcResiUserDTO resiUserDTO) {
List<IcUserChangeDetailedEntity> list = new ArrayList<>();
IcUserChangeDetailedEntity outEntity = null;
IcUserChangeDetailedEntity inEntity = null;
for (IcResiCategoryWarnConfigDTO cf : configList) {
if ("1".equals(map.get(cf.getColumnName()))) {
//迁出
outEntity = new IcUserChangeDetailedEntity();
outEntity.setCustomerId(formDTO.getCustomerId());
outEntity.setIcUserChangeRecordId(icUserChangeRecordId);
outEntity.setAgencyId(resiUserDTO.getAgencyId());
outEntity.setGridId(resiUserDTO.getGridId());
outEntity.setNeighborHoodId(resiUserDTO.getVillageId());
outEntity.setBuildingId(resiUserDTO.getBuildId());
outEntity.setBuildingUnitId(resiUserDTO.getUnitId());
outEntity.setHouseId(resiUserDTO.getHomeId());
outEntity.setIcUserId(formDTO.getIcUserId());
outEntity.setType("out");
outEntity.setTypeName("迁出");
outEntity.setFieldName(cf.getColumnName());
outEntity.setValue(-1);
list.add(outEntity);
//迁入
if ("in".equals(formDTO.getType())) {
inEntity = new IcUserChangeDetailedEntity();
inEntity.setCustomerId(formDTO.getCustomerId());
inEntity.setIcUserChangeRecordId(icUserChangeRecordId);
inEntity.setAgencyId(formDTO.getNewAgencyId());
inEntity.setGridId(formDTO.getNewGridId());
inEntity.setNeighborHoodId(formDTO.getNewNeighborHoodId());
inEntity.setBuildingId(formDTO.getNewBuildingId());
inEntity.setBuildingUnitId(formDTO.getNewBuildingUnitId());
inEntity.setHouseId(formDTO.getNewHouseId());
inEntity.setIcUserId(formDTO.getIcUserId());
inEntity.setType("in");
inEntity.setTypeName("迁入");
inEntity.setFieldName(cf.getColumnName());
inEntity.setValue(1);
list.add(inEntity);
}
}
}
return list;
}
}

28
epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml

@ -513,4 +513,32 @@
#{userId}
</foreach>
</select>
<select id="getCategoryListMap" resultType="java.util.Map">
SELECT
IFNULL(is_kc,'0') IS_KC,
IFNULL(is_cj,'0') IS_CJ,
IFNULL(is_ylfn,'0') IS_YLFN,
IFNULL(is_sn,'0') IS_SN,
IFNULL(is_special,'0') IS_SPECIAL,
IFNULL(is_volunteer,'0') IS_VOLUNTEER,
IFNULL(is_unemployed,'0') IS_UNEMPLOYED,
IFNULL(is_mb,'0') IS_MB,
IFNULL(is_sz,'0') IS_SZ,
IFNULL(is_sd,'0') IS_SD,
IFNULL(is_veterans,'0') IS_VETERANS,
IFNULL(is_ensure_house,'0') IS_ENSURE_HOUSE,
IFNULL(is_party,'0') IS_PARTY,
IFNULL(is_old_people,'0') IS_OLD_PEOPLE,
IFNULL(is_xfry,'0')IS_XFRY,
IFNULL(is_united_front,'0') IS_UNITED_FRONT,
IFNULL(is_db,'0') IS_DB,
IFNULL(is_dbh,'0') IS_DBH
FROM
ic_resi_user
WHERE
del_flag = '0'
AND id = #{icUserId}
</select>
</mapper>

16
epmet-user/epmet-user-server/src/main/resources/mapper/IcStatsResiWarnDao.xml

@ -131,4 +131,20 @@
and AGENCY_ID = #{icStatsResiWarn.agencyId} and GRID_ID =#{icStatsResiWarn.gridId} and VILLAGE_ID=#{icStatsResiWarn.neighborHoodId} and BUILD_ID=#{icStatsResiWarn.buildingId}
group by AGENCY_ID,GRID_ID,VILLAGE_ID,BUILD_ID
</select>
<!-- 查询分类下的人数 -->
<select id="selectCategoryCount" resultType="com.epmet.dto.PersonWarnLeftPieDTO">
SELECT
CONFIG_ID,
COUNT(COUNT) AS count
FROM ic_stats_resi_warn
WHERE DEL_FLAG = '0'
AND CONCAT(AGENCY_PIDS,':',AGENCY_ID) LIKE CONCAT('%',#{agencyId},'%')
AND CONFIG_ID IN (
<foreach collection="configIds" item="c" separator=",">
#{c}
</foreach>
)
GROUP BY CONFIG_ID
</select>
</mapper>

22
epmet-user/epmet-user-server/src/main/resources/mapper/IcUserChangeRecordDao.xml

@ -3,5 +3,27 @@
<mapper namespace="com.epmet.dao.IcUserChangeRecordDao">
<select id="getList" resultType="com.epmet.dto.IcUserChangeRecordDTO">
SELECT
id,
ic_user_transfer_record_id,
customer_id,
operator_id,
ic_user_id,
operator_name,
ic_user_name,
type,
type_name,
before_change_name,
after_change_name,
change_time,
remark
FROM
ic_user_change_record
WHERE
del_flag = '0'
AND ic_user_id = #{icUserId}
ORDER BY change_time DESC, type ASC
</select>
</mapper>
Loading…
Cancel
Save