Browse Source

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

master
wangxianzhang 4 years ago
parent
commit
4411631649
  1. 2
      epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/IcResiUserAddMQMsg.java
  2. 58
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/RelationshipEnum.java
  3. 8
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java
  4. 30
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/HouseListResultDTO.java
  5. 3
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java
  6. 5
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java
  7. 6
      epmet-module/gov-org/gov-org-server/pom.xml
  8. 15
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcHouseController.java
  9. 12
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcHouseService.java
  10. 77
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcHouseServiceImpl.java
  11. 116
      epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/IcResiCategoryStatsConfigDTO.java
  12. 111
      epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/IcResiCategoryWarnConfigDTO.java
  13. 80
      epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/IcResiCategoryStatsConfigFormDTO.java
  14. 51
      epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/IcResiCategoryStatsConfigSortFormDTO.java
  15. 88
      epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/IcResiCategoryStatsConfigResultDTO.java
  16. 4
      epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/OperCustomizeOpenFeignClient.java
  17. 6
      epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/fallback/OperCustomizeOpenFeignClientFallback.java
  18. 26
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/constant/IcResiCategoryStatsConfigConstant.java
  19. 99
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcResiCategoryStatsConfigController.java
  20. 94
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcResiCategoryWarnConfigController.java
  21. 107
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/ResiCategoryStatsConfigController.java
  22. 33
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/IcResiCategoryStatsConfigDao.java
  23. 33
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/IcResiCategoryWarnConfigDao.java
  24. 83
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/IcResiCategoryStatsConfigEntity.java
  25. 81
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/IcResiCategoryWarnConfigEntity.java
  26. 83
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/excel/IcResiCategoryStatsConfigExcel.java
  27. 80
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/excel/IcResiCategoryWarnConfigExcel.java
  28. 24
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/redis/CustomerFootBarRedis.java
  29. 47
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/redis/IcResiCategoryStatsConfigRedis.java
  30. 47
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/redis/IcResiCategoryWarnConfigRedis.java
  31. 104
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcResiCategoryStatsConfigService.java
  32. 95
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcResiCategoryWarnConfigService.java
  33. 48
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/ResiCategoryStatsConfigService.java
  34. 4
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcFormServiceImpl.java
  35. 126
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcResiCategoryStatsConfigServiceImpl.java
  36. 104
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcResiCategoryWarnConfigServiceImpl.java
  37. 264
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/ResiCategoryStatsConfigServiceImpl.java
  38. 26
      epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcResiCategoryStatsConfigDao.xml
  39. 25
      epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcResiCategoryWarnConfigDao.xml
  40. 29
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/OwnerRelationResultDTO.java
  41. 6
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/PersonDataResultDTO.java
  42. 3
      epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java
  43. 5
      epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java
  44. 38
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java
  45. 14
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java
  46. 4
      epmet-user/epmet-user-server/src/main/java/com/epmet/mq/listener/ICWarnStatsEventListener.java
  47. 30
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java
  48. 101
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java
  49. 31
      epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml

2
epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/IcWarnStatsMQMsg.java → epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/IcResiUserAddMQMsg.java

@ -9,7 +9,7 @@ import java.io.Serializable;
* @author sun
*/
@Data
public class IcWarnStatsMQMsg implements Serializable {
public class IcResiUserAddMQMsg implements Serializable {
//客户Id
private String customerId;

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

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

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

@ -586,7 +586,11 @@ public class RedisKeys {
* @param customerId
* @return
*/
public static String getIcFormKey(String formCode,String customerId) {
return rootPrefix.concat("icform:").concat(formCode).concat(":").concat(customerId);
public static String getIcFormKeyForAdd(String formCode,String customerId) {
return rootPrefix.concat("icform:").concat(formCode).concat(":add:").concat(customerId);
}
public static String getIcFormKeyForExport(String formCode,String customerId) {
return rootPrefix.concat("icform:").concat(formCode).concat(":export:").concat(customerId);
}
}

30
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/HouseListResultDTO.java

@ -0,0 +1,30 @@
package com.epmet.dto.result;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.List;
/**
* @Description
* @Author zhaoqifeng
* @Date 2021/11/5 15:59
*/
@NoArgsConstructor
@Data
public class HouseListResultDTO implements Serializable {
private static final long serialVersionUID = 2063032844842070847L;
private String houseId;
private String houseName;
private List<CategoryListBean> categoryList;
@NoArgsConstructor
@Data
public static class CategoryListBean {
private String name;
private String iconUrl;
private String isSpecial;
}
}

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

@ -516,4 +516,7 @@ public interface GovOrgOpenFeignClient {
*/
@PostMapping("/gov/org/ichouse/selecthouseinfobyidcard")
Result<List<String>> selectHouseInfoByIdCard(@RequestParam("idCard")String idCard);
@GetMapping("/gov/org/ichouse/{id}")
Result<IcHouseDTO> get(@PathVariable("id") String id);
}

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

@ -310,6 +310,11 @@ public class GovOrgOpenFeignClientFallback implements GovOrgOpenFeignClient {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "selectHouseInfoByIdCard", idCard);
}
@Override
public Result<IcHouseDTO> get(String id) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "get", id);
}
@Override
public Result<String> selectPidsByGridId(String gridId) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "selectPidsByGridId", gridId);

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

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

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

@ -17,8 +17,10 @@
package com.epmet.controller;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.dto.result.OptionResultDTO;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.AssertUtils;
import com.epmet.commons.tools.validator.ValidatorUtils;
@ -27,6 +29,7 @@ import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.dto.IcHouseDTO;
import com.epmet.dto.form.HouseFormDTO;
import com.epmet.dto.result.HouseListResultDTO;
import com.epmet.service.IcHouseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@ -99,4 +102,16 @@ public class IcHouseController {
return new Result<List<String>>().ok(icHouseService.selectHouseInfoByIdCard(idCard));
}
/**
* @Description 房屋查询
* @Param formDTO
* @Return {@link Result< List< HouseListResultDTO>>}
* @Author zhaoqifeng
* @Date 2021/11/5 16:01
*/
@PostMapping("houselist")
public Result<List<HouseListResultDTO>> getHouseList(@LoginUser TokenDto tokenDto, @RequestBody HouseFormDTO formDTO){
return new Result<List<HouseListResultDTO>>().ok(icHouseService.getHouseList(tokenDto, formDTO));
}
}

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

@ -20,8 +20,10 @@ package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.dto.result.OptionResultDTO;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.dto.IcHouseDTO;
import com.epmet.dto.form.HouseFormDTO;
import com.epmet.dto.result.HouseListResultDTO;
import com.epmet.entity.IcHouseEntity;
import java.util.List;
@ -112,4 +114,14 @@ public interface IcHouseService extends BaseService<IcHouseEntity> {
*/
List<String> selectHouseInfoByIdCard(String idCard);
/**
* @Description 楼栋下房屋列表
* @Param tokenDto
* @Param formDTO
* @Return {@link List< HouseListResultDTO>}
* @Author zhaoqifeng
* @Date 2021/11/5 16:01
*/
List<HouseListResultDTO> getHouseList(TokenDto tokenDto, HouseFormDTO formDTO);
}

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

@ -22,13 +22,22 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.dto.result.OptionResultDTO;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dao.IcHouseDao;
import com.epmet.dto.IcHouseDTO;
import com.epmet.dto.IcResiCategoryStatsConfigDTO;
import com.epmet.dto.IcResiUserDTO;
import com.epmet.dto.form.HouseFormDTO;
import com.epmet.dto.result.HouseListResultDTO;
import com.epmet.entity.IcHouseEntity;
import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.feign.OperCustomizeOpenFeignClient;
import com.epmet.service.IcHouseService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
@ -36,6 +45,7 @@ import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.*;
import java.util.stream.Collectors;
@ -48,6 +58,10 @@ import java.util.stream.Collectors;
@Slf4j
@Service
public class IcHouseServiceImpl extends BaseServiceImpl<IcHouseDao, IcHouseEntity> implements IcHouseService {
@Resource
private OperCustomizeOpenFeignClient operCustomizeOpenFeignClient;
@Resource
private EpmetUserOpenFeignClient epmetUserOpenFeignClient;
@Override
@ -147,4 +161,67 @@ public class IcHouseServiceImpl extends BaseServiceImpl<IcHouseDao, IcHouseEntit
return result;
}
/**
* @param formDTO
* @Description 楼栋下房屋列表
* @Param tokenDto
* @Param formDTO
* @Return {@link List< HouseListResultDTO >}
* @Author zhaoqifeng
* @Date 2021/11/5 16:01
*/
@Override
public List<HouseListResultDTO> getHouseList(TokenDto tokenDto, HouseFormDTO formDTO) {
//查询楼栋下房屋列表
LambdaQueryWrapper<IcHouseEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(IcHouseEntity::getBuildingId, formDTO.getBuildingId());
wrapper.last("ORDER BY CONVERT ( HOUSE_NAME USING gbk ) ASC");
List<IcHouseEntity> list = baseDao.selectList(wrapper);
if(CollectionUtils.isEmpty(list)) {
return Collections.emptyList();
}
//获取居民分类列表
IcResiCategoryStatsConfigDTO categoryDto = new IcResiCategoryStatsConfigDTO();
categoryDto.setCustomerId(tokenDto.getCustomerId());
Result<List<IcResiCategoryStatsConfigDTO>> categoryResult = operCustomizeOpenFeignClient.getCategoryList(categoryDto);
if (!categoryResult.success()) {
throw new RenException(categoryResult.getCode(), categoryResult.getMsg());
}
List<IcResiCategoryStatsConfigDTO> categoryList = categoryResult.getData();
//获取居民分类数量统计
IcResiUserDTO userDTO = new IcResiUserDTO();
userDTO.setBuildId(formDTO.getBuildingId());
Result<Map<String, Map<String, Integer>>> resultMap = epmetUserOpenFeignClient.getHomeUserCategoryCount(userDTO);
if (!resultMap.success()) {
throw new RenException(resultMap.getCode(), resultMap.getMsg());
}
Map<String, Map<String, Integer>> map = resultMap.getData();
return list.stream().map(item -> {
Map<String, Integer> countMap = map.get(item.getId());
HouseListResultDTO dto = new HouseListResultDTO();
dto.setHouseId(item.getId());
dto.setHouseName(item.getHouseName());
List<HouseListResultDTO.CategoryListBean> categories = new ArrayList<>();
if (null != countMap && CollectionUtils.isNotEmpty(categoryList)) {
for (IcResiCategoryStatsConfigDTO category : categoryList) {
if (null == countMap.get(category.getColumnName()) || countMap.get(category.getColumnName()) == NumConstant.ZERO) {
continue;
}
HouseListResultDTO.CategoryListBean bean = new HouseListResultDTO.CategoryListBean();
bean.setName(category.getLabel());
bean.setIconUrl(category.getHouseShowIcon());
if ("党员".equals(category.getLabel())) {
bean.setIsSpecial(NumConstant.ONE_STR);
} else {
bean.setIsSpecial(NumConstant.ZERO_STR);
}
categories.add(bean);
}
}
dto.setCategoryList(categories);
return dto;
}).collect(Collectors.toList());
}
}

116
epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/IcResiCategoryStatsConfigDTO.java

@ -0,0 +1,116 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dto;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 居民类别配置表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-11-04
*/
@Data
public class IcResiCategoryStatsConfigDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* id
*/
private String id;
/**
* 客户id
*/
private String customerId;
/**
* 项标签
*/
private String label;
/**
* 表名
*/
private String tableName;
/**
* 列名
*/
private String columnName;
/**
* 管理平台分类图标
*/
private String managementIcon;
/**
* 数据平台分类图标
*/
private String dataIcon;
/**
* 房屋显示分类图标
*/
private String houseShowIcon;
/**
* 状态 显示show隐藏hidden
*/
private String status;
/**
* 排序
*/
private Integer sort;
/**
* 删除标识:0.未删除 1.已删除
*/
private String delFlag;
/**
* 乐观锁
*/
private String revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private String createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

111
epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/IcResiCategoryWarnConfigDTO.java

@ -0,0 +1,111 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dto;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 居民类别预警配置表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-11-04
*/
@Data
public class IcResiCategoryWarnConfigDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* id
*/
private String id;
/**
* 客户id
*/
private String customerId;
/**
* 项标签
*/
private String label;
/**
* 表名
*/
private String tableName;
/**
* 列名
*/
private String columnName;
/**
* 排序
*/
private Integer sort;
/**
* 等级1阈值
*/
private Integer level1;
/**
* 等级2阈值
*/
private Integer level2;
/**
* 等级3阈值
*/
private Integer level3;
/**
* 删除标识:0.未删除 1.已删除
*/
private String delFlag;
/**
* 乐观锁
*/
private String revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private String createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

80
epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/IcResiCategoryStatsConfigFormDTO.java

@ -0,0 +1,80 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dto.form;
import com.epmet.commons.tools.validator.group.UpdateGroup;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.Date;
/**
* 居民类别配置表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-11-04
*/
@Data
public class IcResiCategoryStatsConfigFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
public interface UpdateStatusGroup {}
public interface SelectGroup {}
/**
* id
*/
@NotBlank(message = "配置项id不能为空",groups = {UpdateGroup.class,UpdateStatusGroup.class,SelectGroup.class})
private String id;
/**
* 管理平台分类图标
*/
@NotBlank(message = "管理平台分类图标不能为空",groups = {UpdateGroup.class})
private String managementIcon;
/**
* 数据平台分类图标
*/
@NotBlank(message = "管理平台分类图标不能为空",groups = {UpdateGroup.class})
private String dataIcon;
/**
* 房屋显示分类图标
*/
@NotBlank(message = "管理平台分类图标不能为空",groups = {UpdateGroup.class})
private String houseShowIcon;
/**
* 状态 显示show隐藏hidden
*/
@NotBlank(message = "状态不能为空",groups = {UpdateStatusGroup.class})
private String status;
@NotBlank(message = "是否预警",groups = {UpdateGroup.class})
private String warn;
private Integer level1;
private Integer level2;
private Integer level3;
}

51
epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/IcResiCategoryStatsConfigSortFormDTO.java

@ -0,0 +1,51 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dto.form;
import com.epmet.commons.tools.validator.group.UpdateGroup;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* 居民类别配置表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-11-04
*/
@Data
public class IcResiCategoryStatsConfigSortFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* id
*/
@NotBlank(message = "配置项id不能为空")
private String id;
/**
* 排序
*/
@NotBlank(message = "排序不能为空")
private Integer sort;
}

88
epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/IcResiCategoryStatsConfigResultDTO.java

@ -0,0 +1,88 @@
/**
* 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 lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 居民类别配置表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-11-04
*/
@Data
public class IcResiCategoryStatsConfigResultDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* id
*/
private String id;
/**
* 项标签
*/
private String label;
/**
* 管理平台分类图标
*/
private String managementIcon;
/**
* 数据平台分类图标
*/
private String dataIcon;
/**
* 房屋显示分类图标
*/
private String houseShowIcon;
/**
* 状态 显示show隐藏hidden
*/
private String status;
/**
* 排序
*/
private Integer sort;
private String warn;
/**
* 等级1阈值
*/
private Integer level1;
/**
* 等级2阈值
*/
private Integer level2;
/**
* 等级3阈值
*/
private Integer level3;
}

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

@ -3,6 +3,7 @@ package com.epmet.feign;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.CustomerFootBarDTO;
import com.epmet.dto.IcResiCategoryStatsConfigDTO;
import com.epmet.dto.form.CheckFloatFootBarFormDTO;
import com.epmet.dto.form.CustomerFootBarFormDTO;
import com.epmet.dto.form.CustomerFormQueryDTO;
@ -97,4 +98,7 @@ public interface OperCustomizeOpenFeignClient {
@PostMapping("/oper/customize/icformitem/getmustcolumn/{customerId}")
Result<List<ColumnTableNameResultDTO>> getMustColumn(@PathVariable("customerId") String customerId);
@PostMapping("/oper/customize/icresicategorystatsconfig/categorylist")
Result<List<IcResiCategoryStatsConfigDTO>> getCategoryList(@RequestBody IcResiCategoryStatsConfigDTO dto);
}

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

@ -4,6 +4,7 @@ import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.utils.ModuleUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.CustomerFootBarDTO;
import com.epmet.dto.IcResiCategoryStatsConfigDTO;
import com.epmet.dto.form.CheckFloatFootBarFormDTO;
import com.epmet.dto.form.CustomerFootBarFormDTO;
import com.epmet.dto.form.CustomerFormQueryDTO;
@ -79,4 +80,9 @@ public class OperCustomizeOpenFeignClientFallback implements OperCustomizeOpenFe
public Result<List<ColumnTableNameResultDTO>> getMustColumn(String customerId) {
return ModuleUtils.feignConError(ServiceConstant.OPER_CUSTOMIZE_SERVER, "getMustColumn", customerId);
}
@Override
public Result<List<IcResiCategoryStatsConfigDTO>> getCategoryList(IcResiCategoryStatsConfigDTO dto) {
return ModuleUtils.feignConError(ServiceConstant.OPER_CUSTOMIZE_SERVER, "getCategoryList", dto);
}
}

26
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/constant/IcResiCategoryStatsConfigConstant.java

@ -0,0 +1,26 @@
/**
* Copyright (c) 2018 人人开源 All rights reserved.
* <p>
* https://www.renren.io
* <p>
* 版权所有侵权必究
*/
package com.epmet.constant;
/**
* 常量
* @author sun
* @since 1.0.0
*/
public interface IcResiCategoryStatsConfigConstant {
/**
* 是否需要预警
*/
String WARN_YES = "1";
String WARN_NO = "0";
String IC_RESI_USER = "ic_resi_user";
}

99
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcResiCategoryStatsConfigController.java

@ -0,0 +1,99 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.controller;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ExcelUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.AssertUtils;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.commons.tools.validator.group.AddGroup;
import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.dto.IcResiCategoryStatsConfigDTO;
import com.epmet.excel.IcResiCategoryStatsConfigExcel;
import com.epmet.service.IcResiCategoryStatsConfigService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
/**
* 居民类别配置表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-11-04
*/
@RestController
@RequestMapping("icresicategorystatsconfig")
public class IcResiCategoryStatsConfigController {
@Autowired
private IcResiCategoryStatsConfigService icResiCategoryStatsConfigService;
@GetMapping("page")
public Result<PageData<IcResiCategoryStatsConfigDTO>> page(@RequestParam Map<String, Object> params){
PageData<IcResiCategoryStatsConfigDTO> page = icResiCategoryStatsConfigService.page(params);
return new Result<PageData<IcResiCategoryStatsConfigDTO>>().ok(page);
}
@GetMapping("{id}")
public Result<IcResiCategoryStatsConfigDTO> get(@PathVariable("id") String id){
IcResiCategoryStatsConfigDTO data = icResiCategoryStatsConfigService.get(id);
return new Result<IcResiCategoryStatsConfigDTO>().ok(data);
}
@PostMapping
public Result save(@RequestBody IcResiCategoryStatsConfigDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
icResiCategoryStatsConfigService.save(dto);
return new Result();
}
@PutMapping
public Result update(@RequestBody IcResiCategoryStatsConfigDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
icResiCategoryStatsConfigService.update(dto);
return new Result();
}
@DeleteMapping
public Result delete(@RequestBody String[] ids){
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
icResiCategoryStatsConfigService.delete(ids);
return new Result();
}
@GetMapping("export")
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
List<IcResiCategoryStatsConfigDTO> list = icResiCategoryStatsConfigService.list(params);
ExcelUtils.exportExcelToTarget(response, null, list, IcResiCategoryStatsConfigExcel.class);
}
@PostMapping("categorylist")
public Result<List<IcResiCategoryStatsConfigDTO>> getCategoryList(@RequestBody IcResiCategoryStatsConfigDTO dto) {
return new Result<List<IcResiCategoryStatsConfigDTO>>().ok(icResiCategoryStatsConfigService.getCategoryList(dto));
}
}

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

@ -0,0 +1,94 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.controller;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ExcelUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.AssertUtils;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.commons.tools.validator.group.AddGroup;
import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.dto.IcResiCategoryWarnConfigDTO;
import com.epmet.excel.IcResiCategoryWarnConfigExcel;
import com.epmet.service.IcResiCategoryWarnConfigService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
/**
* 居民类别预警配置表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-11-04
*/
@RestController
@RequestMapping("icresicategorywarnconfig")
public class IcResiCategoryWarnConfigController {
@Autowired
private IcResiCategoryWarnConfigService icResiCategoryWarnConfigService;
@GetMapping("page")
public Result<PageData<IcResiCategoryWarnConfigDTO>> page(@RequestParam Map<String, Object> params){
PageData<IcResiCategoryWarnConfigDTO> page = icResiCategoryWarnConfigService.page(params);
return new Result<PageData<IcResiCategoryWarnConfigDTO>>().ok(page);
}
@GetMapping("{id}")
public Result<IcResiCategoryWarnConfigDTO> get(@PathVariable("id") String id){
IcResiCategoryWarnConfigDTO data = icResiCategoryWarnConfigService.get(id);
return new Result<IcResiCategoryWarnConfigDTO>().ok(data);
}
@PostMapping
public Result save(@RequestBody IcResiCategoryWarnConfigDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
icResiCategoryWarnConfigService.save(dto);
return new Result();
}
@PutMapping
public Result update(@RequestBody IcResiCategoryWarnConfigDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
icResiCategoryWarnConfigService.update(dto);
return new Result();
}
@DeleteMapping
public Result delete(@RequestBody String[] ids){
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
icResiCategoryWarnConfigService.delete(ids);
return new Result();
}
@GetMapping("export")
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
List<IcResiCategoryWarnConfigDTO> list = icResiCategoryWarnConfigService.list(params);
ExcelUtils.exportExcelToTarget(response, null, list, IcResiCategoryWarnConfigExcel.class);
}
}

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

@ -0,0 +1,107 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.controller;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ExcelUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.AssertUtils;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.commons.tools.validator.group.AddGroup;
import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.dto.IcResiCategoryStatsConfigDTO;
import com.epmet.dto.form.IcResiCategoryStatsConfigFormDTO;
import com.epmet.dto.form.IcResiCategoryStatsConfigSortFormDTO;
import com.epmet.dto.form.UpGovRoleFormDTO;
import com.epmet.dto.result.IcResiCategoryStatsConfigResultDTO;
import com.epmet.excel.IcResiCategoryStatsConfigExcel;
import com.epmet.service.IcResiCategoryStatsConfigService;
import com.epmet.service.ResiCategoryStatsConfigService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
/**
* 居民类别配置表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-11-04
*/
@RestController
@RequestMapping("resicategorystatsconfig")
public class ResiCategoryStatsConfigController {
@Autowired
private IcResiCategoryStatsConfigService icResiCategoryStatsConfigService;
@Autowired
private ResiCategoryStatsConfigService resiCategoryStatsConfigService;
/**
* 居民类别配置列表
* @return
*/
@PostMapping("list")
public Result<List<IcResiCategoryStatsConfigResultDTO>> list(@LoginUser TokenDto tokenDTO){
String customerId = tokenDTO.getCustomerId();
// String customerId = "123123";
return new Result<List<IcResiCategoryStatsConfigResultDTO>>().ok(resiCategoryStatsConfigService.list(customerId));
}
@PostMapping("update")
public Result update(@LoginUser TokenDto tokenDTO,@RequestBody IcResiCategoryStatsConfigFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO, UpdateGroup.class);
String customerId = tokenDTO.getCustomerId();
// String customerId = "123123";
resiCategoryStatsConfigService.update(customerId,formDTO);
return new Result();
}
@PostMapping("updatestatus")
public Result updateStatus(@LoginUser TokenDto tokenDTO,@RequestBody IcResiCategoryStatsConfigFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO, IcResiCategoryStatsConfigFormDTO.UpdateStatusGroup.class);
String customerId = tokenDTO.getCustomerId();
// String customerId = "123123";
resiCategoryStatsConfigService.updateStatus(customerId,formDTO);
return new Result();
}
@PostMapping("updatesort")
public Result updateSort(@LoginUser TokenDto tokenDTO,@RequestBody List<IcResiCategoryStatsConfigSortFormDTO> formDTOs){
for(IcResiCategoryStatsConfigSortFormDTO dto : formDTOs){
ValidatorUtils.validateEntity(dto);
}
String customerId = tokenDTO.getCustomerId();
// String customerId = "123123";
resiCategoryStatsConfigService.updateSort(customerId,formDTOs);
return new Result();
}
@PostMapping("info")
public Result<IcResiCategoryStatsConfigResultDTO> info(@LoginUser TokenDto tokenDTO,@RequestBody IcResiCategoryStatsConfigFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO, IcResiCategoryStatsConfigFormDTO.SelectGroup.class);
return new Result<IcResiCategoryStatsConfigResultDTO>().ok(resiCategoryStatsConfigService.info(formDTO.getId()));
}
}

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

@ -0,0 +1,33 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.IcResiCategoryStatsConfigEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 居民类别配置表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-11-04
*/
@Mapper
public interface IcResiCategoryStatsConfigDao extends BaseDao<IcResiCategoryStatsConfigEntity> {
}

33
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/IcResiCategoryWarnConfigDao.java

@ -0,0 +1,33 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.IcResiCategoryWarnConfigEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 居民类别预警配置表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-11-04
*/
@Mapper
public interface IcResiCategoryWarnConfigDao extends BaseDao<IcResiCategoryWarnConfigEntity> {
}

83
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/IcResiCategoryStatsConfigEntity.java

@ -0,0 +1,83 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 居民类别配置表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-11-04
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("ic_resi_category_stats_config")
public class IcResiCategoryStatsConfigEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户id
*/
private String customerId;
/**
* 项标签
*/
private String label;
/**
* 表名
*/
private String tableName;
/**
* 列名
*/
private String columnName;
/**
* 管理平台分类图标
*/
private String managementIcon;
/**
* 数据平台分类图标
*/
private String dataIcon;
/**
* 房屋显示分类图标
*/
private String houseShowIcon;
/**
* 状态 显示show隐藏hidden
*/
private String status;
/**
* 排序
*/
private Integer sort;
}

81
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/IcResiCategoryWarnConfigEntity.java

@ -0,0 +1,81 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 居民类别预警配置表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-11-04
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("ic_resi_category_warn_config")
public class IcResiCategoryWarnConfigEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户id
*/
private String customerId;
/**
* 项标签
*/
private String label;
/**
* 表名
*/
private String tableName;
/**
* 列名
*/
private String columnName;
/**
* 排序
*/
private Integer sort;
/**
* 等级1阈值
*/
private Integer level1;
/**
* 等级2阈值
*/
private Integer level2;
/**
* 等级3阈值
*/
private Integer level3;
}

83
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/excel/IcResiCategoryStatsConfigExcel.java

@ -0,0 +1,83 @@
/**
* 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.excel;
import cn.afterturn.easypoi.excel.annotation.Excel;
import lombok.Data;
import java.util.Date;
/**
* 居民类别配置表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-11-04
*/
@Data
public class IcResiCategoryStatsConfigExcel {
@Excel(name = "id")
private String id;
@Excel(name = "客户id")
private String customerId;
@Excel(name = "项标签")
private String label;
@Excel(name = "表名")
private String tableName;
@Excel(name = "列名")
private String columnName;
@Excel(name = "管理平台分类图标")
private String managementIcon;
@Excel(name = "数据平台分类图标")
private String dataIcon;
@Excel(name = "房屋显示分类图标")
private String houseShowIcon;
@Excel(name = "状态 显示:show;隐藏:hidden")
private String status;
@Excel(name = "排序")
private Integer sort;
@Excel(name = "删除标识:0.未删除 1.已删除")
private String delFlag;
@Excel(name = "乐观锁")
private String revision;
@Excel(name = "创建人")
private String createdBy;
@Excel(name = "创建时间")
private String createdTime;
@Excel(name = "更新人")
private String updatedBy;
@Excel(name = "更新时间")
private Date updatedTime;
}

80
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/excel/IcResiCategoryWarnConfigExcel.java

@ -0,0 +1,80 @@
/**
* 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.excel;
import cn.afterturn.easypoi.excel.annotation.Excel;
import lombok.Data;
import java.util.Date;
/**
* 居民类别预警配置表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-11-04
*/
@Data
public class IcResiCategoryWarnConfigExcel {
@Excel(name = "id")
private String id;
@Excel(name = "客户id")
private String customerId;
@Excel(name = "项标签")
private String label;
@Excel(name = "表名")
private String tableName;
@Excel(name = "列名")
private String columnName;
@Excel(name = "排序")
private Integer sort;
@Excel(name = "等级1阈值")
private Integer level1;
@Excel(name = "等级2阈值")
private Integer level2;
@Excel(name = "等级3阈值")
private Integer level3;
@Excel(name = "删除标识:0.未删除 1.已删除")
private String delFlag;
@Excel(name = "乐观锁")
private String revision;
@Excel(name = "创建人")
private String createdBy;
@Excel(name = "创建时间")
private String createdTime;
@Excel(name = "更新人")
private String updatedBy;
@Excel(name = "更新时间")
private Date updatedTime;
}

24
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/redis/CustomerFootBarRedis.java

@ -51,18 +51,32 @@ public class CustomerFootBarRedis {
}
public void deleteIcForm(String formCode,String customerId) {
String key = RedisKeys.getIcFormKey(formCode,customerId);
String key = RedisKeys.getIcFormKeyForAdd(formCode,customerId);
redisUtils.delete(key);
}
public void setCustomerFormResultDTO(String formCode,String customerId, CustomerFormResultDTO value){
String key = RedisKeys.getIcFormKey(formCode,customerId);
public void setCustomerFormResultDTO(String formCode,String customerId, CustomerFormResultDTO value,Boolean dynamic){
String key="";
if (null != dynamic && dynamic) {
//新增表单
key = RedisKeys.getIcFormKeyForAdd(formCode,customerId);
}else{
//导出
key = RedisKeys.getIcFormKeyForExport(formCode,customerId);
}
Map<String, Object> map = BeanUtil.beanToMap(value, false, true);
redisUtils.hMSet(key, map);
}
public CustomerFormResultDTO getCustomerFormResultDTO(String formCode,String customerId){
String key = RedisKeys.getIcFormKey(formCode,customerId);
public CustomerFormResultDTO getCustomerFormResultDTO(String formCode,String customerId,Boolean dynamic){
String key="";
if (null != dynamic && dynamic) {
//新增表单
key = RedisKeys.getIcFormKeyForAdd(formCode,customerId);
}else{
//导出
key = RedisKeys.getIcFormKeyForExport(formCode,customerId);
}
Map<String, Object> resultMap = redisUtils.hGetAll(key);
if (CollectionUtils.isEmpty(resultMap)) {
return null;

47
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/redis/IcResiCategoryStatsConfigRedis.java

@ -0,0 +1,47 @@
/**
* 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.redis;
import com.epmet.commons.tools.redis.RedisUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* 居民类别配置表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-11-04
*/
@Component
public class IcResiCategoryStatsConfigRedis {
@Autowired
private RedisUtils redisUtils;
public void delete(Object[] ids) {
}
public void set(){
}
public String get(String id){
return null;
}
}

47
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/redis/IcResiCategoryWarnConfigRedis.java

@ -0,0 +1,47 @@
/**
* 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.redis;
import com.epmet.commons.tools.redis.RedisUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* 居民类别预警配置表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-11-04
*/
@Component
public class IcResiCategoryWarnConfigRedis {
@Autowired
private RedisUtils redisUtils;
public void delete(Object[] ids) {
}
public void set(){
}
public String get(String id){
return null;
}
}

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

@ -0,0 +1,104 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.IcResiCategoryStatsConfigDTO;
import com.epmet.entity.IcResiCategoryStatsConfigEntity;
import java.util.List;
import java.util.Map;
/**
* 居民类别配置表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-11-04
*/
public interface IcResiCategoryStatsConfigService extends BaseService<IcResiCategoryStatsConfigEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<IcResiCategoryStatsConfigDTO>
* @author generator
* @date 2021-11-04
*/
PageData<IcResiCategoryStatsConfigDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<IcResiCategoryStatsConfigDTO>
* @author generator
* @date 2021-11-04
*/
List<IcResiCategoryStatsConfigDTO> list(Map<String, Object> params);
/**
* 单条查询
*
* @param id
* @return IcResiCategoryStatsConfigDTO
* @author generator
* @date 2021-11-04
*/
IcResiCategoryStatsConfigDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2021-11-04
*/
void save(IcResiCategoryStatsConfigDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2021-11-04
*/
void update(IcResiCategoryStatsConfigDTO dto);
/**
* 批量删除
*
* @param ids
* @return void
* @author generator
* @date 2021-11-04
*/
void delete(String[] ids);
/**
* @Description 获取居民类别
* @Param dto
* @Return {@link List< IcResiCategoryStatsConfigDTO>}
* @Author zhaoqifeng
* @Date 2021/11/5 15:43
*/
List<IcResiCategoryStatsConfigDTO> getCategoryList(IcResiCategoryStatsConfigDTO dto);
}

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

@ -0,0 +1,95 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.IcResiCategoryWarnConfigDTO;
import com.epmet.entity.IcResiCategoryWarnConfigEntity;
import java.util.List;
import java.util.Map;
/**
* 居民类别预警配置表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-11-04
*/
public interface IcResiCategoryWarnConfigService extends BaseService<IcResiCategoryWarnConfigEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<IcResiCategoryWarnConfigDTO>
* @author generator
* @date 2021-11-04
*/
PageData<IcResiCategoryWarnConfigDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<IcResiCategoryWarnConfigDTO>
* @author generator
* @date 2021-11-04
*/
List<IcResiCategoryWarnConfigDTO> list(Map<String, Object> params);
/**
* 单条查询
*
* @param id
* @return IcResiCategoryWarnConfigDTO
* @author generator
* @date 2021-11-04
*/
IcResiCategoryWarnConfigDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2021-11-04
*/
void save(IcResiCategoryWarnConfigDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2021-11-04
*/
void update(IcResiCategoryWarnConfigDTO dto);
/**
* 批量删除
*
* @param ids
* @return void
* @author generator
* @date 2021-11-04
*/
void delete(String[] ids);
}

48
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/ResiCategoryStatsConfigService.java

@ -0,0 +1,48 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.IcResiCategoryStatsConfigDTO;
import com.epmet.dto.form.IcResiCategoryStatsConfigFormDTO;
import com.epmet.dto.form.IcResiCategoryStatsConfigSortFormDTO;
import com.epmet.dto.result.IcResiCategoryStatsConfigResultDTO;
import com.epmet.entity.IcResiCategoryStatsConfigEntity;
import java.util.List;
import java.util.Map;
/**
* 居民类别配置表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-11-04
*/
public interface ResiCategoryStatsConfigService {
List<IcResiCategoryStatsConfigResultDTO> list(String customerId);
IcResiCategoryStatsConfigResultDTO info(String id);
void update(String customerId,IcResiCategoryStatsConfigFormDTO formDTO);
void updateStatus(String customerId,IcResiCategoryStatsConfigFormDTO formDTO);
void updateSort(String customerId,List<IcResiCategoryStatsConfigSortFormDTO> formDTOs);
}

4
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcFormServiceImpl.java

@ -116,7 +116,7 @@ public class IcFormServiceImpl extends BaseServiceImpl<IcFormDao, IcFormEntity>
*/
@Override
public CustomerFormResultDTO getCustomerForm(CustomerFormQueryDTO formDto) {
CustomerFormResultDTO customerFormResultDTO = customerFootBarRedis.getCustomerFormResultDTO(formDto.getFormCode(), formDto.getCustomerId());
CustomerFormResultDTO customerFormResultDTO = customerFootBarRedis.getCustomerFormResultDTO(formDto.getFormCode(), formDto.getCustomerId(),formDto.getDynamic());
if (null != customerFormResultDTO) {
return customerFormResultDTO;
}
@ -128,7 +128,7 @@ public class IcFormServiceImpl extends BaseServiceImpl<IcFormDao, IcFormEntity>
List<FormGroupDTO> groupList=baseDao.selectListGroup(resultDTO.getFormId());
resultDTO.setItemList(itemList);
resultDTO.setGroupList(groupList);
customerFootBarRedis.setCustomerFormResultDTO(formDto.getFormCode(),formDto.getCustomerId(),resultDTO);
customerFootBarRedis.setCustomerFormResultDTO(formDto.getFormCode(),formDto.getCustomerId(),resultDTO,formDto.getDynamic());
return resultDTO;
}

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

@ -0,0 +1,126 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.FieldConstant;
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.entity.IcResiCategoryStatsConfigEntity;
import com.epmet.redis.IcResiCategoryStatsConfigRedis;
import com.epmet.service.IcResiCategoryStatsConfigService;
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;
/**
* 居民类别配置表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-11-04
*/
@Service
public class IcResiCategoryStatsConfigServiceImpl extends BaseServiceImpl<IcResiCategoryStatsConfigDao, IcResiCategoryStatsConfigEntity> implements IcResiCategoryStatsConfigService {
@Autowired
private IcResiCategoryStatsConfigRedis icResiCategoryStatsConfigRedis;
@Override
public PageData<IcResiCategoryStatsConfigDTO> page(Map<String, Object> params) {
IPage<IcResiCategoryStatsConfigEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, IcResiCategoryStatsConfigDTO.class);
}
@Override
public List<IcResiCategoryStatsConfigDTO> list(Map<String, Object> params) {
List<IcResiCategoryStatsConfigEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, IcResiCategoryStatsConfigDTO.class);
}
private QueryWrapper<IcResiCategoryStatsConfigEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<IcResiCategoryStatsConfigEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
return wrapper;
}
@Override
public IcResiCategoryStatsConfigDTO get(String id) {
IcResiCategoryStatsConfigEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, IcResiCategoryStatsConfigDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(IcResiCategoryStatsConfigDTO dto) {
IcResiCategoryStatsConfigEntity entity = ConvertUtils.sourceToTarget(dto, IcResiCategoryStatsConfigEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(IcResiCategoryStatsConfigDTO dto) {
IcResiCategoryStatsConfigEntity entity = ConvertUtils.sourceToTarget(dto, IcResiCategoryStatsConfigEntity.class);
updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteBatchIds(Arrays.asList(ids));
}
/**
* @param dto
* @Description 获取居民类别
* @Param dto
* @Return {@link List< IcResiCategoryStatsConfigDTO>}
* @Author zhaoqifeng
* @Date 2021/11/5 15:43
*/
@Override
public List<IcResiCategoryStatsConfigDTO> getCategoryList(IcResiCategoryStatsConfigDTO dto) {
if(StringUtils.isBlank(dto.getCustomerId())) {
return Collections.emptyList();
}
LambdaQueryWrapper<IcResiCategoryStatsConfigEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(IcResiCategoryStatsConfigEntity::getCustomerId, dto.getCustomerId());
wrapper.orderByAsc(IcResiCategoryStatsConfigEntity::getSort);
List<IcResiCategoryStatsConfigEntity> list = baseDao.selectList(wrapper);
return ConvertUtils.sourceToTarget(list, IcResiCategoryStatsConfigDTO.class);
}
}

104
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcResiCategoryWarnConfigServiceImpl.java

@ -0,0 +1,104 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.dao.IcResiCategoryWarnConfigDao;
import com.epmet.dto.IcResiCategoryWarnConfigDTO;
import com.epmet.entity.IcResiCategoryWarnConfigEntity;
import com.epmet.redis.IcResiCategoryWarnConfigRedis;
import com.epmet.service.IcResiCategoryWarnConfigService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* 居民类别预警配置表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-11-04
*/
@Service
public class IcResiCategoryWarnConfigServiceImpl extends BaseServiceImpl<IcResiCategoryWarnConfigDao, IcResiCategoryWarnConfigEntity> implements IcResiCategoryWarnConfigService {
@Autowired
private IcResiCategoryWarnConfigRedis icResiCategoryWarnConfigRedis;
@Override
public PageData<IcResiCategoryWarnConfigDTO> page(Map<String, Object> params) {
IPage<IcResiCategoryWarnConfigEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, IcResiCategoryWarnConfigDTO.class);
}
@Override
public List<IcResiCategoryWarnConfigDTO> list(Map<String, Object> params) {
List<IcResiCategoryWarnConfigEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, IcResiCategoryWarnConfigDTO.class);
}
private QueryWrapper<IcResiCategoryWarnConfigEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<IcResiCategoryWarnConfigEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
return wrapper;
}
@Override
public IcResiCategoryWarnConfigDTO get(String id) {
IcResiCategoryWarnConfigEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, IcResiCategoryWarnConfigDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(IcResiCategoryWarnConfigDTO dto) {
IcResiCategoryWarnConfigEntity entity = ConvertUtils.sourceToTarget(dto, IcResiCategoryWarnConfigEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(IcResiCategoryWarnConfigDTO dto) {
IcResiCategoryWarnConfigEntity entity = ConvertUtils.sourceToTarget(dto, IcResiCategoryWarnConfigEntity.class);
updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteBatchIds(Arrays.asList(ids));
}
}

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

@ -0,0 +1,264 @@
package com.epmet.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.epmet.constant.IcResiCategoryStatsConfigConstant;
import com.epmet.dao.IcFormItemDao;
import com.epmet.dao.IcFormItemGroupDao;
import com.epmet.dao.IcResiCategoryStatsConfigDao;
import com.epmet.dao.IcResiCategoryWarnConfigDao;
import com.epmet.dto.IcResiCategoryStatsConfigDTO;
import com.epmet.dto.form.IcResiCategoryStatsConfigFormDTO;
import com.epmet.dto.form.IcResiCategoryStatsConfigSortFormDTO;
import com.epmet.dto.result.IcResiCategoryStatsConfigResultDTO;
import com.epmet.entity.IcFormItemEntity;
import com.epmet.entity.IcFormItemGroupEntity;
import com.epmet.entity.IcResiCategoryStatsConfigEntity;
import com.epmet.entity.IcResiCategoryWarnConfigEntity;
import com.epmet.service.IcResiCategoryStatsConfigService;
import com.epmet.service.IcResiCategoryWarnConfigService;
import com.epmet.service.ResiCategoryStatsConfigService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import javax.annotation.Resource;
import java.util.*;
import java.util.stream.Collectors;
@Slf4j
@Service
public class ResiCategoryStatsConfigServiceImpl implements ResiCategoryStatsConfigService {
@Autowired
private IcResiCategoryStatsConfigService icResiCategoryStatsConfigService;
@Resource
private IcFormItemDao icFormItemDao;
@Resource
private IcFormItemGroupDao icFormItemGroupDao;
@Resource
private IcResiCategoryStatsConfigDao icResiCategoryStatsConfigDao;
@Resource
private IcResiCategoryWarnConfigDao icResiCategoryWarnConfigDao;
@Autowired
private IcResiCategoryWarnConfigService icResiCategoryWarnConfigService;
@Override
@Transactional(rollbackFor = Exception.class)
public List<IcResiCategoryStatsConfigResultDTO> list(String customerId) {
//1.获取IC_FORM_ITEM 中 用于数据分析字段的 id 和label
List<IcFormItemEntity> icFormItemEntityList = icFormItemDao.selectList(new QueryWrapper<IcFormItemEntity>().lambda().eq(IcFormItemEntity::getDataAnalyse, 1));
if(CollectionUtils.isEmpty(icFormItemEntityList)){
return new ArrayList<>();
}
Set<String> groupIds = icFormItemEntityList.stream().filter(item-> !"0".equals(item.getItemGroupId())).map(item->item.getItemGroupId()).collect(Collectors.toSet());
List<IcFormItemGroupEntity> icFormItemGroupEntityList = icFormItemGroupDao.selectList(new QueryWrapper<IcFormItemGroupEntity>().lambda().in(IcFormItemGroupEntity::getId, groupIds));
//获取tableName和COLUMN_NAME
Map<String,IcFormItemEntity> tableColumnMap = new HashMap<>();
Map<String,String> idTableMap = new HashMap<>();
icFormItemEntityList.forEach(item->{
Map<String,String> map = new HashMap<>();
if("0".equals(item.getItemGroupId())){
tableColumnMap.put(IcResiCategoryStatsConfigConstant.IC_RESI_USER+"-"+item.getColumnName(),item);
idTableMap.put(item.getId(),IcResiCategoryStatsConfigConstant.IC_RESI_USER);
}else{
List<IcFormItemGroupEntity> collect = icFormItemGroupEntityList.stream().filter(i -> item.getItemGroupId().equals(i.getId())).collect(Collectors.toList());
tableColumnMap.put(CollectionUtils.isEmpty(collect)?IcResiCategoryStatsConfigConstant.IC_RESI_USER:collect.get(0).getTableName()+"-"+item.getColumnName(),item);
idTableMap.put(item.getId(),CollectionUtils.isEmpty(collect)?IcResiCategoryStatsConfigConstant.IC_RESI_USER:collect.get(0).getTableName());
}
});
//2.获取ic_resi_category_stats_config 和 ic_resi_category_warn_config 表中的数据
List<IcResiCategoryStatsConfigEntity> statsConfigEntityList = icResiCategoryStatsConfigDao.selectList(null);
List<IcResiCategoryWarnConfigEntity> warnConfigEntityList = icResiCategoryWarnConfigDao.selectList(null);
//3.新增不存在的,删除不在tableColumnMap的
Map<String,IcResiCategoryStatsConfigEntity> statsTableColumnMap = new HashMap<>();
statsConfigEntityList.stream().forEach(item->{
statsTableColumnMap.put(item.getTableName()+"-"+item.getColumnName(),item);
});
Map<String,IcResiCategoryWarnConfigEntity> warnTableColumnMap = new HashMap<>();
warnConfigEntityList.stream().forEach(item->{
warnTableColumnMap.put(item.getTableName()+"-"+item.getColumnName(),item);
});
//差集
//新增
List<String> newStatsList = tableColumnMap.keySet().stream().filter(item -> !statsTableColumnMap.keySet().contains(item)).collect(Collectors.toList());
List<IcResiCategoryStatsConfigEntity> newStatsEntityList = new ArrayList<>();
newStatsList.forEach(item->{
IcFormItemEntity icFormItemEntity = tableColumnMap.get(item);
IcResiCategoryStatsConfigEntity entity = new IcResiCategoryStatsConfigEntity();
entity.setCustomerId(customerId);
entity.setLabel(icFormItemEntity.getLabel());
entity.setTableName(idTableMap.get(icFormItemEntity.getId()));
entity.setColumnName(icFormItemEntity.getColumnName());
entity.setManagementIcon("");
entity.setDataIcon("");
entity.setHouseShowIcon("");
entity.setStatus("show");
entity.setSort(0);
newStatsEntityList.add(entity);
});
if(!CollectionUtils.isEmpty(newStatsEntityList)){
icResiCategoryStatsConfigService.insertBatch(newStatsEntityList);
}
List<String> delStatsEntityIdList = new ArrayList<>();
List<String> delWarnEntityIdList = new ArrayList<>();
//需要删除的
List<String> delStatsList = statsTableColumnMap.keySet().stream().filter(item -> !tableColumnMap.keySet().contains(item)).collect(Collectors.toList());
List<String> delWarnList = warnTableColumnMap.keySet().stream().filter(item -> !tableColumnMap.keySet().contains(item)).collect(Collectors.toList());
delStatsList.forEach(item->{
delStatsEntityIdList.add(statsTableColumnMap.get(item).getId());
});
delWarnList.forEach(item->{
delWarnEntityIdList.add(warnTableColumnMap.get(item).getId());
});
if(!CollectionUtils.isEmpty(delStatsEntityIdList)){
icResiCategoryStatsConfigService.deleteBatchIds(delStatsEntityIdList);
}
if(!CollectionUtils.isEmpty(delWarnEntityIdList)){
icResiCategoryWarnConfigService.deleteBatchIds(delWarnEntityIdList);
}
//4.返回数据
List<IcResiCategoryStatsConfigEntity> statsConfigList = icResiCategoryStatsConfigDao.selectList(new QueryWrapper<IcResiCategoryStatsConfigEntity>().lambda().orderByAsc(IcResiCategoryStatsConfigEntity::getSort));
List<IcResiCategoryWarnConfigEntity> warnConfigList = icResiCategoryWarnConfigDao.selectList(null);
Map<String,IcResiCategoryWarnConfigEntity> warnMap =new HashMap<>();
warnConfigList.forEach(item->{
warnMap.put(item.getTableName()+"-"+item.getColumnName(),item);
});
List<IcResiCategoryStatsConfigResultDTO> result = new ArrayList<>();
statsConfigList.forEach(item->{
IcResiCategoryStatsConfigResultDTO icResiCategoryStatsConfigResultDTO = new IcResiCategoryStatsConfigResultDTO();
icResiCategoryStatsConfigResultDTO.setId(item.getId());
icResiCategoryStatsConfigResultDTO.setLabel(item.getLabel());
icResiCategoryStatsConfigResultDTO.setManagementIcon(item.getManagementIcon());
icResiCategoryStatsConfigResultDTO.setDataIcon(item.getDataIcon());
icResiCategoryStatsConfigResultDTO.setHouseShowIcon(item.getHouseShowIcon());
icResiCategoryStatsConfigResultDTO.setStatus(item.getStatus());
icResiCategoryStatsConfigResultDTO.setSort(item.getSort());
IcResiCategoryWarnConfigEntity warnConfigEntity = warnMap.get(item.getTableName() + "-" + item.getColumnName());
if(warnConfigEntity==null){
icResiCategoryStatsConfigResultDTO.setWarn(IcResiCategoryStatsConfigConstant.WARN_NO);
}else{
icResiCategoryStatsConfigResultDTO.setWarn(IcResiCategoryStatsConfigConstant.WARN_YES);
icResiCategoryStatsConfigResultDTO.setLevel1(warnConfigEntity.getLevel1());
icResiCategoryStatsConfigResultDTO.setLevel2(warnConfigEntity.getLevel2());
icResiCategoryStatsConfigResultDTO.setLevel3(warnConfigEntity.getLevel3());
}
result.add(icResiCategoryStatsConfigResultDTO);
});
return result;
}
@Override
@Transactional(rollbackFor = Exception.class)
public IcResiCategoryStatsConfigResultDTO info(String id) {
IcResiCategoryStatsConfigResultDTO result =new IcResiCategoryStatsConfigResultDTO();
IcResiCategoryStatsConfigDTO icResiCategoryStatsConfigDTO = icResiCategoryStatsConfigService.get(id);
if(null == icResiCategoryStatsConfigDTO){
return result;
}
IcResiCategoryWarnConfigEntity icResiCategoryWarnConfigEntity = icResiCategoryWarnConfigDao.selectOne(new QueryWrapper<IcResiCategoryWarnConfigEntity>().lambda()
.eq(IcResiCategoryWarnConfigEntity::getTableName, icResiCategoryStatsConfigDTO.getTableName())
.eq(IcResiCategoryWarnConfigEntity::getColumnName, icResiCategoryStatsConfigDTO.getColumnName()));
// IcResiCategoryWarnConfigEntity icResiCategoryWarnConfigEntity = Optional.ofNullable(entity).orElse(new IcResiCategoryWarnConfigEntity());
result.setId(icResiCategoryStatsConfigDTO.getId());
result.setLabel(icResiCategoryStatsConfigDTO.getLabel());
result.setManagementIcon(icResiCategoryStatsConfigDTO.getManagementIcon());
result.setDataIcon(icResiCategoryStatsConfigDTO.getDataIcon());
result.setHouseShowIcon(icResiCategoryStatsConfigDTO.getHouseShowIcon());
result.setStatus(icResiCategoryStatsConfigDTO.getStatus());
result.setSort(icResiCategoryStatsConfigDTO.getSort());
result.setWarn(null==icResiCategoryWarnConfigEntity?IcResiCategoryStatsConfigConstant.WARN_NO:IcResiCategoryStatsConfigConstant.WARN_YES);
if(null!=icResiCategoryWarnConfigEntity){
result.setLevel1(icResiCategoryWarnConfigEntity.getLevel1());
result.setLevel2(icResiCategoryWarnConfigEntity.getLevel2());
result.setLevel3(icResiCategoryWarnConfigEntity.getLevel3());
}
return result;
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(String customerId,IcResiCategoryStatsConfigFormDTO formDTO) {
IcResiCategoryStatsConfigDTO icResiCategoryStatsConfigDTO = icResiCategoryStatsConfigService.get(formDTO.getId());
if(null == icResiCategoryStatsConfigDTO){
return ;
}
//更新配置类别
IcResiCategoryStatsConfigEntity icResiCategoryStatsConfigEntity = new IcResiCategoryStatsConfigEntity();
BeanUtils.copyProperties(formDTO,icResiCategoryStatsConfigEntity);
icResiCategoryStatsConfigEntity.setCustomerId(customerId);
icResiCategoryStatsConfigDao.updateById(icResiCategoryStatsConfigEntity);
//更新配置预警
if(IcResiCategoryStatsConfigConstant.WARN_YES.equals(formDTO.getWarn())){
//更新
IcResiCategoryWarnConfigEntity icResiCategoryWarnConfigEntity = icResiCategoryWarnConfigDao.selectOne(new QueryWrapper<IcResiCategoryWarnConfigEntity>().lambda()
.eq(IcResiCategoryWarnConfigEntity::getTableName, icResiCategoryStatsConfigDTO.getTableName())
.eq(IcResiCategoryWarnConfigEntity::getColumnName, icResiCategoryStatsConfigDTO.getColumnName()));
if(null == icResiCategoryWarnConfigEntity){
icResiCategoryWarnConfigEntity = new IcResiCategoryWarnConfigEntity();
icResiCategoryWarnConfigEntity.setCustomerId(customerId);
icResiCategoryWarnConfigEntity.setLabel(icResiCategoryStatsConfigDTO.getLabel());
icResiCategoryWarnConfigEntity.setTableName(icResiCategoryStatsConfigDTO.getTableName());
icResiCategoryWarnConfigEntity.setColumnName(icResiCategoryStatsConfigDTO.getColumnName());
icResiCategoryWarnConfigEntity.setLevel1(formDTO.getLevel1());
icResiCategoryWarnConfigEntity.setLevel2(formDTO.getLevel2());
icResiCategoryWarnConfigEntity.setLevel3(formDTO.getLevel3());
icResiCategoryWarnConfigEntity.setSort(icResiCategoryStatsConfigDTO.getSort());
icResiCategoryWarnConfigDao.insert(icResiCategoryWarnConfigEntity);
}else{
icResiCategoryWarnConfigEntity.setCustomerId(customerId);
icResiCategoryWarnConfigEntity.setLabel(icResiCategoryStatsConfigDTO.getLabel());
icResiCategoryWarnConfigEntity.setTableName(icResiCategoryStatsConfigDTO.getTableName());
icResiCategoryWarnConfigEntity.setColumnName(icResiCategoryStatsConfigDTO.getColumnName());
icResiCategoryWarnConfigEntity.setLevel1(formDTO.getLevel1());
icResiCategoryWarnConfigEntity.setLevel2(formDTO.getLevel2());
icResiCategoryWarnConfigEntity.setLevel3(formDTO.getLevel3());
icResiCategoryWarnConfigEntity.setSort(icResiCategoryStatsConfigDTO.getSort());
icResiCategoryWarnConfigDao.updateById(icResiCategoryWarnConfigEntity);
}
}else if(IcResiCategoryStatsConfigConstant.WARN_NO.equals(formDTO.getWarn())){
//删除
icResiCategoryWarnConfigDao.delete(new QueryWrapper<IcResiCategoryWarnConfigEntity>().lambda()
.eq(IcResiCategoryWarnConfigEntity::getTableName,icResiCategoryStatsConfigDTO.getTableName())
.eq(IcResiCategoryWarnConfigEntity::getColumnName,icResiCategoryStatsConfigDTO.getColumnName()));
}
}
@Override
@Transactional(rollbackFor = Exception.class)
public void updateStatus(String customerId,IcResiCategoryStatsConfigFormDTO formDTO) {
//更新配置类别
IcResiCategoryStatsConfigEntity icResiCategoryStatsConfigEntity = new IcResiCategoryStatsConfigEntity();
BeanUtils.copyProperties(formDTO,icResiCategoryStatsConfigEntity);
icResiCategoryStatsConfigEntity.setCustomerId(customerId);
icResiCategoryStatsConfigDao.updateById(icResiCategoryStatsConfigEntity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void updateSort(String customerId,List<IcResiCategoryStatsConfigSortFormDTO> formDTOs) {
List<IcResiCategoryStatsConfigEntity > entityList = new ArrayList<>();
for (IcResiCategoryStatsConfigSortFormDTO formDTO : formDTOs) {
IcResiCategoryStatsConfigEntity icResiCategoryStatsConfigEntity = new IcResiCategoryStatsConfigEntity();
icResiCategoryStatsConfigEntity.setId(formDTO.getId());
icResiCategoryStatsConfigEntity.setCustomerId(customerId);
icResiCategoryStatsConfigEntity.setSort(formDTO.getSort());
entityList.add(icResiCategoryStatsConfigEntity);
}
icResiCategoryStatsConfigService.updateBatchById(entityList);
}
}

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

@ -0,0 +1,26 @@
<?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.IcResiCategoryStatsConfigDao">
<resultMap type="com.epmet.entity.IcResiCategoryStatsConfigEntity" id="icResiCategoryStatsConfigMap">
<result property="id" column="ID"/>
<result property="customerId" column="CUSTOMER_ID"/>
<result property="label" column="LABEL"/>
<result property="tableName" column="TABLE_NAME"/>
<result property="columnName" column="COLUMN_NAME"/>
<result property="managementIcon" column="MANAGEMENT_ICON"/>
<result property="dataIcon" column="DATA_ICON"/>
<result property="houseShowIcon" column="HOUSE_SHOW_ICON"/>
<result property="status" column="STATUS"/>
<result property="sort" column="SORT"/>
<result property="delFlag" column="DEL_FLAG"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
</mapper>

25
epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcResiCategoryWarnConfigDao.xml

@ -0,0 +1,25 @@
<?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.IcResiCategoryWarnConfigDao">
<resultMap type="com.epmet.entity.IcResiCategoryWarnConfigEntity" id="icResiCategoryWarnConfigMap">
<result property="id" column="ID"/>
<result property="customerId" column="CUSTOMER_ID"/>
<result property="label" column="LABEL"/>
<result property="tableName" column="TABLE_NAME"/>
<result property="columnName" column="COLUMN_NAME"/>
<result property="sort" column="SORT"/>
<result property="level1" column="LEVEL_1"/>
<result property="level2" column="LEVEL_2"/>
<result property="level3" column="LEVEL_3"/>
<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>
</mapper>

29
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/OwnerRelationResultDTO.java

@ -0,0 +1,29 @@
package com.epmet.dto.result;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.List;
/**
* @Author zhaoqifeng
* @DateTime 2020/11/18 下午1:47
*/
@NoArgsConstructor
@Data
public class OwnerRelationResultDTO implements Serializable {
private static final long serialVersionUID = 2876258704168954941L;
private String ownerName;
private List<UserListBean> userList;
@NoArgsConstructor
@Data
public static class UserListBean {
private String userId;
private String userName;
private String isSelf;
private String relation;
}
}

6
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/PersonDataResultDTO.java

@ -72,4 +72,10 @@ public class PersonDataResultDTO implements Serializable {
*/
@JsonIgnore
private String idCard;
/**
* 是否是志愿者 1是0否
*/
@JsonIgnore
private String isVolunteer;
}

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

@ -650,4 +650,7 @@ public interface EpmetUserOpenFeignClient {
@PostMapping("/epmetuser/icresidemanddict/demandoption/demandoption")
Result<List<OptionResultDTO>> getDemandOptions();
@PostMapping("/epmetuser/icresiuser/categorycount")
Result<Map<String, Map<String, Integer>>> getHomeUserCategoryCount(@RequestBody IcResiUserDTO formDTO);
}

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

@ -469,4 +469,9 @@ public class EpmetUserOpenFeignClientFallback implements EpmetUserOpenFeignClien
public Result<List<OptionResultDTO>> getDemandOptions() {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getDemandOptions", null);
}
@Override
public Result<Map<String, Map<String, Integer>>> getHomeUserCategoryCount(IcResiUserDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getHomeUserCategoryCount", formDTO);
}
}

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

@ -31,7 +31,6 @@ import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dto.IcResiUserDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.feign.OperCustomizeOpenFeignClient;
import com.epmet.service.IcResiUserImportService;
import com.epmet.service.IcResiUserService;
@ -70,6 +69,15 @@ public class IcResiUserController {
@Autowired
private IcResiUserImportService icResiUserImportService;
@PostMapping("delete")
public Result delete(@LoginUser TokenDto tokenDto,@RequestBody DelIcResiUserFormDTO formDTO){
formDTO.setCustomerId(tokenDto.getCustomerId());
ValidatorUtils.validateEntity(formDTO,DelIcResiUserFormDTO.IdGroup.class);
icResiUserService.delete(formDTO);
return new Result();
}
/**
* @Author sun
* @Description 党建互联平台--保存居民信息
@ -154,7 +162,7 @@ public class IcResiUserController {
continue;
}
if (item2.getItemType().equals("checkbox") || item2.getItemType().equals("select") || item2.getItemType().equals("radio")) {
if ("checkbox".equals(item2.getItemType()) || "select".equals(item2.getItemType()) || "radio".equals(item2.getItemType())) {
itemMap.put(item2.getColumnName().concat(item2.getColumnNum() == 0 ? "" : item2.getColumnNum().toString()), ConvertUtils.sourceToTarget(item2, FormItem.class));
}
}
@ -173,7 +181,7 @@ public class IcResiUserController {
if (StringUtils.isBlank(formItem2.getColumnName())) {
continue;
}
if (formItem2.getItemType().equals("checkbox") || formItem2.getItemType().equals("select") || formItem2.getItemType().equals("radio")) {
if ("checkbox".equals(formItem2.getItemType()) || "select".equals(formItem2.getItemType()) || "radio".equals(formItem2.getItemType())) {
itemMap.put(formItem2.getColumnName().concat(formItem2.getColumnNum() == 0 ? "" : formItem2.getColumnNum().toString()), ConvertUtils.sourceToTarget(formItem2, FormItem.class));
}
}
@ -272,4 +280,28 @@ public class IcResiUserController {
return resultForm.getData();
}
/**
* @Description 个人信息-家庭关系
* @Param formDTO
* @Return {@link Result< OwnerRelationResultDTO>}
* @Author zhaoqifeng
* @Date 2021/11/5 11:13
*/
@PostMapping("ownerrelation")
public Result<OwnerRelationResultDTO> getOwnerRelation(@RequestBody PersonDataFormDTO formDTO) {
return new Result<OwnerRelationResultDTO>().ok(icResiUserService.getOwnerRelation(formDTO.getUserId()));
}
/**
* @Description 获取一栋楼每个房间人员分类的数量
* @Param formDTO
* @Return {@link Result< Map< String, Map< String, Integer>>>}
* @Author zhaoqifeng
* @Date 2021/11/5 15:10
*/
@PostMapping("categorycount")
public Result<Map<String, Map<String, Integer>>> getHomeUserCategoryCount(@RequestBody IcResiUserDTO formDTO) {
return new Result<Map<String, Map<String, Integer>>>().ok(icResiUserService.getHomeUserCategoryCount(formDTO.getBuildId()));
}
}

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

@ -23,6 +23,7 @@ import com.epmet.dto.result.IcFormResColumnDTO;
import com.epmet.dto.result.PersonDataResultDTO;
import com.epmet.dto.result.SearchByNameResultDTO;
import com.epmet.entity.IcResiUserEntity;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -119,6 +120,17 @@ public interface IcResiUserDao extends BaseDao<IcResiUserEntity> {
List<SearchByNameResultDTO> searchByName(@Param("name")String name, @Param("agencyId")String agencyId,@Param("pageNo")Integer pageNo);
Set<String> selectUserDemandCode(String icResiUserId);
String selectCategoryNames(@Param("customerId") String customerId,@Param("codeSet") Set<String> codeSet);
@MapKey("HOME_ID")
Map<String, Map<String, Integer>> getHomeUserCategoryCount(@Param("buildId") String buildId);
/**
* @Description 根据userId查询志愿者
* @param userId
* @author zxc
* @date 2021/11/5 5:44 下午
*/
List<String> selectVolunteerByUserId(@Param("userId")String userId);
}

4
epmet-user/epmet-user-server/src/main/java/com/epmet/mq/listener/ICWarnStatsEventListener.java

@ -2,7 +2,7 @@ package com.epmet.mq.listener;
import com.alibaba.fastjson.JSON;
import com.epmet.commons.rocketmq.constants.MQUserPropertys;
import com.epmet.commons.rocketmq.messages.IcWarnStatsMQMsg;
import com.epmet.commons.rocketmq.messages.IcResiUserAddMQMsg;
import com.epmet.commons.tools.distributedlock.DistributedLock;
import com.epmet.commons.tools.exception.ExceptionUtils;
import com.epmet.commons.tools.exception.RenException;
@ -57,7 +57,7 @@ public class ICWarnStatsEventListener implements MessageListenerConcurrently {
String pendingMsgLabel = messageExt.getUserProperty(MQUserPropertys.BLOCKED_MSG_LABEL);
logger.info("【开放数据事件监听器】-居民信息变动-收到消息内容:{},操作:{}", msg, tags);
IcWarnStatsMQMsg obj = JSON.parseObject(msg, IcWarnStatsMQMsg.class);
IcResiUserAddMQMsg obj = JSON.parseObject(msg, IcResiUserAddMQMsg.class);
DistributedLock distributedLock = null;
RLock lock = null;

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

@ -21,10 +21,7 @@ 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.form.*;
import com.epmet.dto.result.FormItem;
import com.epmet.dto.result.HomeUserResultDTO;
import com.epmet.dto.result.PersonDataResultDTO;
import com.epmet.dto.result.SearchByNameResultDTO;
import com.epmet.dto.result.*;
import com.epmet.entity.IcResiUserEntity;
import java.util.List;
@ -37,6 +34,14 @@ import java.util.Map;
* @since v1.0.0 2021-10-26
*/
public interface IcResiUserService extends BaseService<IcResiUserEntity> {
/**
* 单个删除
*
* @return void
* @author generator
* @date 2021-10-26
*/
void delete(DelIcResiUserFormDTO formDTO);
/**
* @Author sun
@ -107,4 +112,21 @@ public interface IcResiUserService extends BaseService<IcResiUserEntity> {
*/
Map<String, Map<String, Object>> getDataForExport(Map<String, FormItem> itemList, String customerId, String formCode, String baseTableName, List<ResiUserQueryValueDTO> conditions);
/**
* @Description 家庭关系
* @Param userId
* @Return {@link OwnerRelationResultDTO}
* @Author zhaoqifeng
* @Date 2021/11/5 10:28
*/
OwnerRelationResultDTO getOwnerRelation(String userId);
/**
* @Description 获取一栋楼每个房间人员分类的数量
* @Param buildId
* @Return {@link Map< String, Map< String, Integer>>}
* @Author zhaoqifeng
* @Date 2021/11/5 14:40
*/
Map<String, Map<String, Integer>> getHomeUserCategoryCount(String buildId);
}

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

@ -17,44 +17,39 @@
package com.epmet.service.impl;
import com.alibaba.excel.EasyExcelFactory;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.rocketmq.messages.IcWarnStatsMQMsg;
import com.epmet.commons.rocketmq.messages.IcResiUserAddMQMsg;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.dto.result.OptionResultDTO;
import com.epmet.commons.tools.enums.GenderEnum;
import com.epmet.commons.tools.enums.HouseTypeEnum;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.enums.RelationshipEnum;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.feign.ResultDataResolver;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.security.user.LoginUserUtil;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.constant.SystemMessageType;
import com.epmet.constant.UserConstant;
import com.epmet.dao.IcResiUserDao;
import com.epmet.dto.*;
import com.epmet.dto.CustomerAgencyDTO;
import com.epmet.dto.CustomerGridDTO;
import com.epmet.dto.IcHouseDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
import com.epmet.entity.IcPartyMemberEntity;
import com.epmet.entity.IcResiUserEntity;
import com.epmet.excel.handler.DynamicEasyExcelListener;
import com.epmet.feign.*;
import com.epmet.service.IcResiUserImportService;
import com.epmet.feign.EpmetMessageOpenFeignClient;
import com.epmet.feign.GovOrgOpenFeignClient;
import com.epmet.feign.OperCustomizeOpenFeignClient;
import com.epmet.service.IcResiUserService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
@ -62,11 +57,9 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.io.File;
import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;
/**
* 用户基础信息
@ -97,6 +90,19 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
return wrapper;
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(DelIcResiUserFormDTO formDTO) {
baseDao.updateToDel(formDTO.getIcResiUserId());
CustomerFormQueryDTO queryDTO = ConvertUtils.sourceToTarget(formDTO, CustomerFormQueryDTO.class);
Result<Set<String>> subTableRes = operCustomizeOpenFeignClient.queryIcResiSubTables(queryDTO);
if (subTableRes.success() && !CollectionUtils.isEmpty(subTableRes.getData())) {
for (String subTalbeName : subTableRes.getData()) {
baseDao.updateSubTableToDel(subTalbeName, formDTO.getIcResiUserId());
}
}
}
/**
* @Author sun
* @Description 党建互联平台--保存居民信息
@ -168,7 +174,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
});
//推送MQ事件
IcWarnStatsMQMsg mqMsg = new IcWarnStatsMQMsg();
IcResiUserAddMQMsg mqMsg = new IcResiUserAddMQMsg();
mqMsg.setCustomerId(tokenDto.getCustomerId());
mqMsg.setIcResiUser(resiUserId);
SystemMsgFormDTO form = new SystemMsgFormDTO();
@ -232,7 +238,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
});
//推送MQ事件
IcWarnStatsMQMsg mqMsg = new IcWarnStatsMQMsg();
IcResiUserAddMQMsg mqMsg = new IcResiUserAddMQMsg();
mqMsg.setCustomerId(tokenDto.getCustomerId());
mqMsg.setIcResiUser(resiUserId);
SystemMsgFormDTO form = new SystemMsgFormDTO();
@ -487,6 +493,14 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
throw new RenException("查询房屋信息失败");
}
personData.setHouseInfo(listResult.getData());
// 志愿者处理
if (personData.getIsVolunteer().equals(NumConstant.ONE_STR)){
List<String> volunteers = baseDao.selectVolunteerByUserId(formDTO.getUserId());
volunteers.forEach(v -> {
});
}
// TODO
return personData;
}
@ -612,4 +626,57 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
});
return result;
}
/**
* @param userId
* @Description 家庭关系
* @Param userId
* @Return {@link OwnerRelationResultDTO}
* @Author zhaoqifeng
* @Date 2021/11/5 10:28
*/
@Override
public OwnerRelationResultDTO getOwnerRelation(String userId) {
OwnerRelationResultDTO result = new OwnerRelationResultDTO();
//获取用户信息
IcResiUserEntity user = baseDao.selectById(userId);
//获取用户所在家庭的户主
Result<IcHouseDTO> houseResult = govOrgOpenFeignClient.get(user.getHomeId());
if (!houseResult.success()) {
throw new RenException(houseResult.getCode(),houseResult.getMsg());
}
result.setOwnerName(houseResult.getData().getOwnerName());
//获取用户所在家庭里所有人员信息
LambdaQueryWrapper<IcResiUserEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(IcResiUserEntity::getHomeId, user.getHomeId());
wrapper.orderByAsc(IcResiUserEntity::getYhzgx);
List<IcResiUserEntity> resiUserList = baseDao.selectList(wrapper);
List<OwnerRelationResultDTO.UserListBean> userList = resiUserList.stream().map(item -> {
OwnerRelationResultDTO.UserListBean bean = new OwnerRelationResultDTO.UserListBean();
bean.setUserId(item.getId());
bean.setUserName(item.getName());
bean.setRelation(RelationshipEnum.getEnum(item.getYhzgx()).getName());
if (userId.equals(item.getId())) {
bean.setIsSelf(NumConstant.ONE_STR);
}
return bean;
}).collect(Collectors.toList());
result.setUserList(userList);
return result;
}
/**
* @param buildId
* @Description 获取一栋楼每个房间人员分类的数量
* @Param buildId
* @Return {@link Map<String,Map<String,Integer>>}
* @Author zhaoqifeng
* @Date 2021/11/5 14:40
*/
@Override
public Map<String, Map<String, Integer>> getHomeUserCategoryCount(String buildId) {
return baseDao.getHomeUserCategoryCount(buildId);
}
}

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

@ -214,4 +214,35 @@
</foreach>
</if>
</select>
<select id="getHomeUserCategoryCount" resultType="java.util.Map">
SELECT
HOME_ID,
SUM(IF('1' = IS_PARTY, 1, 0)) AS IS_PARTY,
SUM(IF('1' = IS_DBH, 1, 0)) AS IS_DBH,
SUM(IF('1' = IS_ENSURE_HOUSE, 1, 0)) AS IS_ENSURE_HOUSE,
SUM(IF('1' = IS_UNEMPLOYED, 1, 0)) AS IS_UNEMPLOYED,
SUM(IF('1' = IS_YLFN, 1, 0)) AS IS_YLFN,
SUM(IF('1' = IS_VETERANS, 1, 0)) AS IS_VETERANS,
SUM(IF('1' = IS_UNITED_FRONT, 1, 0)) AS IS_UNITED_FRONT,
SUM(IF('1' = IS_XFRY, 1, 0)) AS IS_XFRY,
SUM(IF('1' = IS_VOLUNTEER, 1, 0)) AS IS_VOLUNTEER,
SUM(IF('1' = IS_OLD_PEOPLE, 1, 0)) AS IS_OLD_PEOPLE,
SUM(IF('1' = IS_KC, 1, 0)) AS IS_KC,
SUM(IF('1' = IS_SD, 1, 0)) AS IS_SD,
SUM(IF('1' = IS_SN, 1, 0)) AS IS_SN,
SUM(IF('1' = IS_SZ, 1, 0)) AS IS_SZ,
SUM(IF('1' = IS_CJ, 1, 0)) AS IS_CJ,
SUM(IF('1' = IS_DB, 1, 0)) AS IS_DB,
SUM(IF('1' = IS_MB, 1, 0)) AS IS_MB,
SUM(IF('1' = IS_SPECIAL, 1, 0)) AS IS_SPECIAL
FROM ic_resi_user
WHERE DEL_FLAG = 0
AND BUILD_ID = #{buildId}
GROUP BY HOME_ID
</select>
<!-- 根据userId查询志愿者 -->
<select id="selectVolunteerByUserId" resultType="java.lang.String">
SELECT VOLUNTEER_CATEGORY FROM ic_volunteer WHERE DEL_FLAG = '0' AND ic_resi_user = #{userId}
</select>
</mapper>
Loading…
Cancel
Save