Browse Source

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

master
jianjun 3 years ago
parent
commit
a5145ffc78
  1. 16
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/GridInfoCache.java
  2. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactGridMemberStatisticsDailyServiceImpl.java
  3. 21
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/RentHouseFormDTO.java
  4. 1
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/BuildingController.java
  5. 15
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java
  6. 11
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcBuildingController.java
  7. 12
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcNeighborHoodController.java
  8. 8
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcHouseDao.java
  9. 15
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/HouseService.java
  10. 3
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/BuildingServiceImpl.java
  11. 8
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java
  12. 3
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcNeighborHoodServiceImpl.java
  13. 11
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml
  14. 148
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcResiUserAttachmentDTO.java
  15. 24
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/RentTenantDataFormDTO.java
  16. 89
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/RentTenantFormDTO.java
  17. 537
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/RentTenantDataResultDTO.java
  18. 22
      epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java
  19. 11
      epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java
  20. 94
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserAttachmentController.java
  21. 124
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java
  22. 45
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserAttachmentDao.java
  23. 2
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java
  24. 119
      epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcResiUserAttachmentEntity.java
  25. 101
      epmet-user/epmet-user-server/src/main/java/com/epmet/excel/ProjectProcessAttachmentExcel.java
  26. 13
      epmet-user/epmet-user-server/src/main/java/com/epmet/feign/GovOrgFeignClient.java
  27. 6
      epmet-user/epmet-user-server/src/main/java/com/epmet/feign/fallback/GovOrgFeignClientFallBack.java
  28. 95
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserAttachmentService.java
  29. 20
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java
  30. 99
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserAttachmentServiceImpl.java
  31. 343
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java
  32. 23
      epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserAttachmentDao.xml
  33. 14
      epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml

16
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/GridInfoCache.java

@ -118,4 +118,20 @@ public class GridInfoCache implements Serializable {
* 弃用标记
*/
private Integer abandonFlag;
/**
* 网格编码
*/
private String code;
/**
* 负责人姓名
*/
private String contacts;
/**
* 联系电话
*/
private String mobile;
}

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactGridMemberStatisticsDailyServiceImpl.java

@ -82,7 +82,7 @@ public class FactGridMemberStatisticsDailyServiceImpl extends BaseServiceImpl<Fa
return;
}
Map<String, StaffRoleInfoDTO> staffMap = staffInfoList.stream().collect(Collectors.toMap(StaffRoleInfoDTO :: getStaffId,
Function.identity()));
Function.identity(), (key1, key2) -> key2));
List<FactGridMemberStatisticsDailyEntity> list = staffGridList.stream().filter(p -> null != staffMap.get(p.getStaffId())).map(item -> {
StaffRoleInfoDTO staffInfo = staffMap.get(item.getStaffId());
return initEntity(customerId, dateId, item, staffInfo);

21
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/RentHouseFormDTO.java

@ -0,0 +1,21 @@
package com.epmet.dto.form;
import lombok.Data;
import java.io.Serializable;
/**
* @author zhy
* @date 2022/4/26 11:18
*/
@Data
public class RentHouseFormDTO implements Serializable {
private static final long serialVersionUID = 2636608477324780974L;
private String id;
/**
* 1出租0未出租
*/
private Integer rentFlag;
}

1
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/BuildingController.java

@ -96,7 +96,6 @@ public class BuildingController {
//效验数据
ValidatorUtils.validateEntity(formDTO, IcBulidingAddFormDTO.UpdateShowGroup.class);
String customerId = tokenDTO.getCustomerId();
// String customerId = "123123";
buildingService.updateBuilding(customerId,formDTO);
return new Result().ok("修改成功");
}

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

@ -148,6 +148,21 @@ public class HouseController implements ResultDataResolver {
return new Result();
}
/**
* 小寨子社区-合同签订后变更成出租状态
*
* @param formDTO
* @return com.epmet.commons.tools.utils.Result
* @author zhy
* @date 2022/4/26 11:16
*/
@NoRepeatSubmit
@PostMapping("update2rent")
public Result update2Rent(@RequestBody RentHouseFormDTO formDTO) {
houseService.update2Rent(formDTO);
return new Result();
}
/**
* lzh
*

11
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcBuildingController.java

@ -22,10 +22,7 @@ import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.IcBuildingDTO;
import com.epmet.service.IcBuildingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@ -54,4 +51,10 @@ public class IcBuildingController {
public Result<List<OptionResultDTO>> getBuildingOptions(@RequestBody IcBuildingDTO dto) {
return new Result<List<OptionResultDTO>>().ok(icBuildingService.getBuildingOptions(dto.getNeighborHoodId()));
}
@GetMapping("{id}")
public Result<IcBuildingDTO> get(@PathVariable("id") String id){
IcBuildingDTO data = icBuildingService.get(id);
return new Result<IcBuildingDTO>().ok(data);
}
}

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

@ -19,6 +19,7 @@ package com.epmet.controller;
import com.alibaba.fastjson.JSON;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.dto.result.OptionResultDTO;
import com.epmet.commons.tools.enums.EnvEnum;
@ -42,6 +43,7 @@ import com.epmet.dto.result.ImportTaskCommonResultDTO;
import com.epmet.feign.EpmetCommonServiceOpenFeignClient;
import com.epmet.service.IcNeighborHoodService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
@ -52,6 +54,7 @@ import javax.servlet.http.HttpServletResponse;
import java.awt.image.BufferedImage;
import java.io.*;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@ -78,8 +81,17 @@ public class IcNeighborHoodController {
return new Result<PageData<IcNeighborHoodDTO>>().ok(page);
}
/**
* 可根据agencyId或者gridId查询
* @param params
* @return
*/
@PostMapping("open/list")
public Result<PageData<IcNeighborHoodDTO>> openList(@RequestBody IcNeighborHoodAddFormDTO params){
if (StringUtils.isBlank(params.getAgencyId()) && StringUtils.isBlank(params.getGridId())) {
PageData<IcNeighborHoodDTO> result = new PageData<>(new ArrayList<>(), NumConstant.ZERO);
return new Result<PageData<IcNeighborHoodDTO>>().ok(result);
}
PageData<IcNeighborHoodDTO> page = icNeighborHoodService.openPage(params);
return new Result<PageData<IcNeighborHoodDTO>>().ok(page);
}

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

@ -83,4 +83,12 @@ public interface IcHouseDao extends BaseDao<IcHouseEntity> {
*/
List<HousesNameResultDTO> getHousesNameByIdCards(@Param("idCards") List<String> idCards);
/**
* Desc: 根据楼栋ID修改房屋名
* @param buildingId
* @author zxc
* @date 2022/4/26 13:49
*/
void houseUpdateHouseName(@Param("buildingId")String buildingId);
}

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

@ -19,10 +19,7 @@ package com.epmet.service;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.form.IcHouseAddFormDTO;
import com.epmet.dto.form.IcHouseListFormDTO;
import com.epmet.dto.form.ImportInfoFormDTO;
import com.epmet.dto.form.NeighborHoodManageDelFormDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.HouseInfoDTO;
import com.epmet.dto.result.IcHouseListResultDTO;
import com.epmet.dto.result.ImportTaskCommonResultDTO;
@ -45,6 +42,16 @@ public interface HouseService {
void updateHouse(String customerId, IcHouseAddFormDTO formDTO);
/**
* 小寨子社区-合同签订后变更成出租状态
*
* @param formDTO
* @return com.epmet.commons.tools.utils.Result
* @author zhy
* @date 2022/4/26 11:16
*/
void update2Rent(RentHouseFormDTO formDTO);
/**
* 删除小区
* @param houseId

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

@ -445,6 +445,9 @@ public class BuildingServiceImpl implements BuildingService {
icBuildingDTO.setId(formDTO.getBuildingId());
icBuildingDTO.setCustomerId(customerId);
icBuildingService.update(icBuildingDTO);
// 更新房屋名称
icHouseDao.houseUpdateHouseName(formDTO.getBuildingId());
//更新楼宇单元
//如果楼宇单元大于之前的楼宇单元,新增单元
Integer nowUnit = formDTO.getTotalUnitNum();

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

@ -31,6 +31,7 @@ import com.epmet.dto.result.HouseInfoDTO;
import com.epmet.dto.result.IcHouseListResultDTO;
import com.epmet.dto.result.ImportTaskCommonResultDTO;
import com.epmet.dto.result.NeighborHoodManageDelResultDTO;
import com.epmet.entity.IcHouseEntity;
import com.epmet.enums.HousePurposeEnums;
import com.epmet.enums.HouseTypeEnums;
import com.epmet.feign.EpmetCommonServiceOpenFeignClient;
@ -140,6 +141,13 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver {
icHouseService.update(icHouseDTO);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update2Rent(RentHouseFormDTO formDTO) {
IcHouseEntity entity = ConvertUtils.sourceToTarget(formDTO, IcHouseEntity.class);
icHouseService.updateById(entity);
}
/**
* 删除
* @param houseId

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

@ -689,7 +689,8 @@ public class IcNeighborHoodServiceImpl extends BaseServiceImpl<IcNeighborHoodDao
@Override
public PageData<IcNeighborHoodDTO> openPage(IcNeighborHoodAddFormDTO params) {
LambdaQueryWrapper<IcNeighborHoodEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(IcNeighborHoodEntity::getAgencyId,params.getAgencyId());
wrapper.eq(StringUtils.isNotBlank(params.getAgencyId()), IcNeighborHoodEntity::getAgencyId, params.getAgencyId())
.eq(StringUtils.isNotBlank(params.getGridId()), IcNeighborHoodEntity::getGridId, params.getGridId());
PageData<IcNeighborHoodDTO> result = null;
List<IcNeighborHoodDTO> list = null;
if (params.getIsPage()){

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

@ -70,6 +70,17 @@
)
</update>
<!-- 根据楼栋ID修改房屋名 -->
<update id="houseUpdateHouseName">
UPDATE ic_house h,ic_building b,ic_building_unit u
SET h.HOUSE_NAME = CONCAT(b.BUILDING_NAME,'-',u.UNIT_NAME,'-',h.DOOR_NAME),
h.UPDATED_TIME = NOW()
WHERE h.DEL_FLAG = '0'
AND h.BUILDING_ID = b.ID AND b.DEL_FLAG = '0'
AND h.BUILDING_UNIT_ID = u.ID AND u.DEL_FLAG = '0'
AND h.BUILDING_ID = #{buildingId}
</update>
<select id="searchHouseByPage" resultType="com.epmet.dto.result.IcHouseListResultDTO">
select
concat(b.BUILDING_NAME,'-',d.UNIT_NUM,'-',a.DOOR_NAME) as houseName,

148
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcResiUserAttachmentDTO.java

@ -0,0 +1,148 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dto;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 项目节点附件表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-12-21
*/
@Data
public class IcResiUserAttachmentDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 唯一标识
*/
private String id;
/**
* 客户ID
*/
private String customerId;
/**
* 用户ID
*/
private String userId;
/**
* 文件所属内容(内部备注: public 公开答复:internal)
*/
private String filePlace;
/**
* 文件名
*/
private String fileName;
/**
* 附件名uuid随机生成
*/
private String attachmentName;
/**
* 文件大小
*/
private Integer attachmentSize;
/**
* 文件格式JPGPNGJPEGBMPGIFPDFPPTPPTXDOCDOCXXLSXLSXMP3WMAM4AMP4AVIMOVRMVBRMWMV
*/
private String attachmentFormat;
/**
* 文件类型图片 - image 视频 - video 语音 - voice 文档 - doc
*/
private String attachmentType;
/**
* url地址
*/
private String attachmentUrl;
/**
* 排序(需求确定按上传顺序排序)
*/
private Integer sort;
/**
* 语音或视频时长
*/
private Integer duration;
/**
* 是否强制发布(0: 1:)
*/
private Integer isRelease;
/**
* 附件状态审核中auditing
* auto_passed: 自动通过
* review结果不确定需要人工审核
* block: 结果违规
* rejected人工审核驳回;
* approved人工审核通过
* 现在图片是同步审核的所以图片只有auto_passed一种状态
*/
private String status;
/**
* 附件审核结果描述
*/
private String reason;
/**
* 删除标识0.未删除 1.已删除
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

24
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/RentTenantDataFormDTO.java

@ -0,0 +1,24 @@
package com.epmet.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* 租客房东信息
*
* @author zhy
* @date 2022/4/26 10:54
*/
@Data
public class RentTenantDataFormDTO implements Serializable {
private static final long serialVersionUID = 9156247659994638103L;
@NotBlank(message = "userId不能为空",groups = PersonDataFormDTO.PersonDataForm.class)
private String userId;
@NotBlank(message = "tokenDto获取customerId不能为空",groups = PersonDataFormDTO.PersonDataForm.class)
private String customerId;
}

89
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/RentTenantFormDTO.java

@ -0,0 +1,89 @@
package com.epmet.dto.form;
import lombok.Data;
import java.io.Serializable;
import java.util.LinkedHashMap;
import java.util.List;
/**
* 租客房东信息
*
* @author zhy
* @date 2022/4/26 10:54
*/
@Data
public class RentTenantFormDTO implements Serializable {
private static final long serialVersionUID = 9156247659994638103L;
/**
* 头像
*/
private String img;
/**
* customerId
*/
private String customerId;
/**
* gridId
*/
private String gridId;
/**
*
*/
private String agencyId;
/**
*
*/
private String pids;
/**
* 所属小区ID
*/
private String villageId;
/**
* 所属楼宇Id
*/
private String buildId;
/**
* 单元id
*/
private String unitId;
/**
* 所属家庭Id
*/
private String homeId;
/**
* 是否本地户籍
*/
private String isBdhj;
/**
* 姓名
*/
private String name;
/**
* 手机号
*/
private String mobile;
/**
* 性别
*/
private String gender;
/**
* 身份证号
*/
private String idCard;
}

537
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/RentTenantDataResultDTO.java

@ -0,0 +1,537 @@
/**
* 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-10-26
*/
@Data
public class RentTenantDataResultDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private String id;
/**
* 客户Id customer.id
*/
private String customerId;
/**
*
*/
private String agencyId;
/**
*
*/
private String pids;
/**
* 网格ID
*/
private String gridId;
/**
* 所属小区ID
*/
private String villageId;
/**
* 所属楼宇Id
*/
private String buildId;
/**
* 单元id
*/
private String unitId;
/**
* 所属家庭Id
*/
private String homeId;
/**
* 是否本地户籍
*/
private String isBdhj;
/**
* 姓名
*/
private String name;
/**
* 手机号
*/
private String mobile;
/**
* 性别
*/
private String gender;
/**
* 身份证号
*/
private String idCard;
/**
* 出生日期
*/
private String birthday;
/**
* 备注
*/
private String remarks;
/**
* 联系人
*/
private String contacts;
/**
* 联系人电话
*/
private String contactsMobile;
/**
* 九小场所url
*/
private String ninePlace;
/**
* 是否党员
*/
private String isParty;
/**
* 是否低保户
*/
private String isDbh;
/**
* 是否保障房
*/
private String isEnsureHouse;
/**
* 是否失业
*/
private String isUnemployed;
/**
* 是否育龄妇女
*/
private String isYlfn;
/**
* 是否退役军人
*/
private String isVeterans;
/**
* 是否统战人员
*/
private String isUnitedFront;
/**
* 是否信访人员
*/
private String isXfry;
/**
* 是否志愿者
*/
private String isVolunteer;
/**
* 是否老年人
*/
private String isOldPeople;
/**
* 是否空巢
*/
private String isKc;
/**
* 是否失独
*/
private String isSd;
/**
* 是否失能
*/
private String isSn;
/**
* 是否失智
*/
private String isSz;
/**
* 是否残疾
*/
private String isCj;
/**
* 是否大病
*/
private String isDb;
/**
* 是否慢病
*/
private String isMb;
/**
* 是否特殊人群
*/
private String isSpecial;
/**
* 文化程度字典表
*/
private String culture;
/**
* 文化程度备注
*/
private String cultureRemakes;
/**
* 特长字典表
*/
private String specialSkill;
/**
* 兴趣爱好
*/
private String hobby;
/**
* 兴趣爱好备注
*/
private String hobbyRemakes;
/**
* 宗教信仰
*/
private String faith;
/**
* 宗教信仰备注
*/
private String faithRemakes;
/**
* 残疾类别字典表
*/
private String cjlb;
/**
* 残疾登记(状况)字典表
*/
private String cjzk;
/**
* 残疾证号
*/
private String cjzh;
/**
* 残疾说明
*/
private String cjsm;
/**
* 有无监护人yes no
*/
private String ynJdr;
/**
* 有无技能特长yes no
*/
private String ynJntc;
/**
* 有无劳动能力
*/
private String ynLdnl;
/**
* 有无非义务教育阶段助学yes no
*/
private String ynFywjyjdzx;
/**
* 所患大病
*/
private String shdb;
/**
* 患大病时间
*/
private String dbsj;
/**
* 所患慢性病
*/
private String shmxb;
/**
* 患慢性病时间
*/
private String mxbsj;
/**
* 是否参保
*/
private String isCb;
/**
* 自付金额
*/
private String zfje;
/**
* 救助金额
*/
private String jzje;
/**
* 救助时间[yyyy-MM-dd]
*/
private String jzsj;
/**
* 享受救助明细序号
*/
private String jzmxxh;
/**
* 健康信息备注
*/
private String healthRemakes;
/**
* 工作单位
*/
private String gzdw;
/**
* 职业
*/
private String zy;
/**
* 离退休时间
*/
private String ltxsj;
/**
* 工作信息备注
*/
private String workRemake;
/**
* 退休金额
*/
private String txje;
/**
* 月收入
*/
private String ysr;
/**
* 是否经济低保
*/
private String isJjdb;
/**
* 籍贯
*/
private String jg;
/**
* 户籍所在地
*/
private String hjszd;
/**
* 现居住地
*/
private String xjzd;
/**
* 人户情况
*/
private String rhzk;
/**
* 居住信息备注
*/
private String jzxxRemakes;
/**
* 民族字典表
*/
private String mz;
/**
* 与户主关系字典表
*/
private String yhzgx;
/**
* 居住情况字典表
*/
private String jzqk;
/**
* 婚姻状况字典表
*/
private String hyzk;
/**
* 配偶情况字典表
*/
private String poqk;
/**
* 有无赡养人
*/
private String ynSyr;
/**
* 与赡养人关系字典表
*/
private String ysyrgx;
/**
* 赡养人电话
*/
private String syrMobile;
/**
* 家庭信息备注
*/
private String jtxxRemakes;
/**
* 用户状态0:正常 1:转出
*/
private String status;
/**
* 删除标识 0.未删除 1.已删除
*/
private Integer delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
/**
* 预留字段1
*/
private String field1;
/**
* 预留字段2
*/
private String field2;
/**
* 预留字段3
*/
private String field3;
/**
* 预留字段4
*/
private String field4;
/**
* 预留字段5
*/
private String field5;
/**
* 预留字段6
*/
private String field6;
/**
* 预留字段7
*/
private String field7;
/**
* 预留字段8
*/
private String field8;
/**
* 预留字段9
*/
private String field9;
/**
* 预留字段10
*/
private String field10;
}

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

@ -721,4 +721,26 @@ public interface EpmetUserOpenFeignClient {
@PostMapping("/epmetuser/icresiuser/getexistuserbyhouseids")
Result<List<String>> getExistUserByHouseIds(@RequestBody List<String> ids);
/**
* 租客房东根据身份证更新头像
*
* @param formDTO
* @return com.epmet.commons.tools.utils.Result
* @author zhy
* @date 2022/4/26 10:48
*/
@PostMapping("/epmetuser/icresiuser/rent/rentUpdate")
Result rentUpdate(@RequestBody RentTenantFormDTO formDTO);
/**
* 租客房东根据身份证更新头像
*
* @param formDTO
* @return com.epmet.commons.tools.utils.Result
* @author zhy
* @date 2022/4/26 10:48
*/
@PostMapping("/epmetuser/icresiuser/rent/tenantData")
Result<RentTenantDataResultDTO> tenantData(@RequestBody RentTenantDataFormDTO formDTO);
}

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

@ -10,6 +10,7 @@ import com.epmet.dto.form.*;
import com.epmet.dto.form.patrol.PatrolQueryFormDTO;
import com.epmet.dto.result.*;
import com.epmet.feign.EpmetUserOpenFeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import java.util.List;
import java.util.Map;
@ -532,4 +533,14 @@ public class EpmetUserOpenFeignClientFallback implements EpmetUserOpenFeignClien
public Result<List<String>> getExistUserByHouseIds(List<String> ids) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getExistUserByHouseIds", ids);
}
@Override
public Result rentUpdate(@RequestBody RentTenantFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "rentUpdate", formDTO);
}
@Override
public Result<RentTenantDataResultDTO> tenantData(@RequestBody RentTenantDataFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "tenantData", formDTO);
}
}

94
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserAttachmentController.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.DefaultGroup;
import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.dto.IcResiUserAttachmentDTO;
import com.epmet.excel.ProjectProcessAttachmentExcel;
import com.epmet.service.IcResiUserAttachmentService;
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 2020-12-21
*/
@RestController
@RequestMapping("icresiuserattachment")
public class IcResiUserAttachmentController {
@Autowired
private IcResiUserAttachmentService icResiUserAttachmentService;
@GetMapping("page")
public Result<PageData<IcResiUserAttachmentDTO>> page(@RequestParam Map<String, Object> params){
PageData<IcResiUserAttachmentDTO> page = icResiUserAttachmentService.page(params);
return new Result<PageData<IcResiUserAttachmentDTO>>().ok(page);
}
@GetMapping("{id}")
public Result<IcResiUserAttachmentDTO> get(@PathVariable("id") String id){
IcResiUserAttachmentDTO data = icResiUserAttachmentService.get(id);
return new Result<IcResiUserAttachmentDTO>().ok(data);
}
@PostMapping
public Result save(@RequestBody IcResiUserAttachmentDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
icResiUserAttachmentService.save(dto);
return new Result();
}
@PutMapping
public Result update(@RequestBody IcResiUserAttachmentDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
icResiUserAttachmentService.update(dto);
return new Result();
}
@DeleteMapping
public Result delete(@RequestBody String[] ids){
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
icResiUserAttachmentService.delete(ids);
return new Result();
}
@GetMapping("export")
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
List<IcResiUserAttachmentDTO> list = icResiUserAttachmentService.list(params);
ExcelUtils.exportExcelToTarget(response, null, list, ProjectProcessAttachmentExcel.class);
}
}

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

@ -229,16 +229,51 @@ public class IcResiUserController implements ResultDataResolver {
@PostMapping("edit")
public Result edit(@LoginUser TokenDto tokenDto, @RequestBody List<IcResiUserFormDTO> formDTO) {
String resiUserId = icResiUserService.edit(tokenDto, formDTO);
//推送MQ事件
editResiMq(tokenDto.getCustomerId(), resiUserId);
return new Result();
}
/**
* 租客房东根据身份证更新头像
*
* @param formDTO
* @return com.epmet.commons.tools.utils.Result
* @author zhy
* @date 2022/4/26 10:48
*/
@PostMapping("rent/rentUpdate")
public Result rentUpdate(@RequestBody RentTenantFormDTO formDTO) {
String resiUserId = icResiUserService.rentUpdate(formDTO);
//推送MQ事件
editResiMq(formDTO.getCustomerId(), resiUserId);
return new Result();
}
private void editResiMq(String customerId, String userId) {
//推送MQ事件
IcResiUserAddMQMsg mqMsg = new IcResiUserAddMQMsg();
mqMsg.setCustomerId(tokenDto.getCustomerId());
log.info("customer id is {}",tokenDto.getCustomerId());
mqMsg.setIcResiUser(resiUserId);
mqMsg.setCustomerId(customerId);
log.info("customer id is {}", customerId);
mqMsg.setIcResiUser(userId);
SystemMsgFormDTO form = new SystemMsgFormDTO();
form.setMessageType(SystemMessageType.IC_RESI_USER_EDIT);
form.setContent(mqMsg);
epmetMessageOpenFeignClient.sendSystemMsgByMQ(form);
return new Result();
}
/**
* 租客房东黑名单查询个人数据
*
* @param formDTO
* @return com.epmet.commons.tools.utils.Result<com.epmet.dto.result.PersonDataResultDTO>
* @author zhy
* @date 2022/4/26 15:51
*/
@PostMapping("rent/tenantData")
public Result<RentTenantDataResultDTO> tenantData(@RequestBody RentTenantDataFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, RentTenantDataFormDTO.class);
return new Result<RentTenantDataResultDTO>().ok(icResiUserService.tenantData(formDTO));
}
/**
@ -255,12 +290,13 @@ public class IcResiUserController implements ResultDataResolver {
/**
* 根据ic_resi_user找家属
*
* @param icResiUserId
* @return
*/
@GetMapping("findfamilymem/{icResiUserId}")
public Result<IcResiUserBriefDTO> findFamilyMem(@PathVariable("icResiUserId") String icResiUserId){
if(StringUtils.isNotBlank(icResiUserId)){
public Result<IcResiUserBriefDTO> findFamilyMem(@PathVariable("icResiUserId") String icResiUserId) {
if (StringUtils.isNotBlank(icResiUserId)) {
return new Result<IcResiUserBriefDTO>().ok(icResiUserService.findFamilyMem(icResiUserId));
}
return new Result<>();
@ -272,7 +308,7 @@ public class IcResiUserController implements ResultDataResolver {
pageFormDTO.setCustomerId(tokenDto.getCustomerId());
pageFormDTO.setStaffId(tokenDto.getUserId());
ValidatorUtils.validateEntity(pageFormDTO, IcResiUserPageFormDTO.AddUserInternalGroup.class);
if(null==pageFormDTO.getConditions()){
if (null == pageFormDTO.getConditions()) {
pageFormDTO.setConditions(new ArrayList<>());
}
return new Result<PageData<Map<String, Object>>>().ok(icResiUserService.pageResiMap(pageFormDTO));
@ -304,12 +340,12 @@ public class IcResiUserController implements ResultDataResolver {
* @return void
* @author LiuJanJun
* @date 2021/11/19 4:24 下午
* @remark:分页批量导出 oss目录在 各个环境对应的前缀文件夹/file-template/resi-template/客户ID.xlsx,
* @remark:分页批量导出 oss目录在 各个环境对应的前缀文件夹/file-template/resi-template/客户ID.xlsx,
* 如果某个客户需要更新模版 则替换掉上面的模版文件然后 更新缓存里的值或者删除也行 再导出就会下载新的模版了
*/
@NoRepeatSubmit
@RequestMapping(value = "/exportExcel")
public void exportExcelByEasyExcel(@RequestHeader String customerId,@LoginUser TokenDto tokenDto, @RequestBody IcResiUserPageFormDTO pageFormDTO, HttpServletResponse response) throws Exception {
public void exportExcelByEasyExcel(@RequestHeader String customerId, @LoginUser TokenDto tokenDto, @RequestBody IcResiUserPageFormDTO pageFormDTO, HttpServletResponse response) throws Exception {
//tokenDto.setUserId("9e37adcce6472152e6508a19d3683e02");
long startM = System.currentTimeMillis();
CustomerStaffInfoCacheResult staffInfoCacheResult = CustomerStaffRedis.getStaffInfo(customerId, tokenDto.getUserId());
@ -335,23 +371,23 @@ public class IcResiUserController implements ResultDataResolver {
List<FormItemResult> resiFormAllItems = icResiUserService.listFormItems(customerId, IcFormCodeEnum.RESI_BASE_INFO.getCode());
Map<String, FormItemResult> allItemMap = resiFormAllItems.stream().collect(Collectors.toMap(FormItemResult::getItemId, o -> o));
Map<String, ExportResiUserItemDTO> map = new HashMap<>();
allItemMap.values().forEach(item->{
allItemMap.values().forEach(item -> {
String tableName = item.getTableName();
ExportResiUserItemDTO exportItem = map.getOrDefault(tableName, new ExportResiUserItemDTO());
map.putIfAbsent(tableName,exportItem);
map.putIfAbsent(tableName, exportItem);
String columnName = item.getColumnName().concat(item.getColumnNum() == NumConstant.ZERO ? StrConstant.EPMETY_STR : item.getColumnNum().toString());
exportItem.getItemMap().put(columnName,item);
if (Constant.OPITON_SOURCE_REMOTE.equals(item.getOptionSourceType())&&item.getOptionSourceValue().contains(StrConstant.QUESTION_MARK)){
exportItem.getItemMap().put(columnName, item);
if (Constant.OPITON_SOURCE_REMOTE.equals(item.getOptionSourceType()) && item.getOptionSourceValue().contains(StrConstant.QUESTION_MARK)) {
//多个参数
String[] paramArr = item.getOptionSourceValue().split(StrConstant.QUESTION_MARK_TRANSFER)[NumConstant.ONE].split(StrConstant.AND_MARK);
Arrays.stream(paramArr).forEach(o->{
Arrays.stream(paramArr).forEach(o -> {
FormItemResult value = allItemMap.get(o);
if (value == null){
if (value == null) {
return;
}
Set<FormItemResult> conditionSet = exportItem.getRemoteItemConditionMap().getOrDefault(item.getItemId(),new HashSet<>());
Set<FormItemResult> conditionSet = exportItem.getRemoteItemConditionMap().getOrDefault(item.getItemId(), new HashSet<>());
conditionSet.add(value);
exportItem.getRemoteItemConditionMap().putIfAbsent(item.getItemId(),conditionSet);
exportItem.getRemoteItemConditionMap().putIfAbsent(item.getItemId(), conditionSet);
});
}
});
@ -378,7 +414,7 @@ public class IcResiUserController implements ResultDataResolver {
stopSearchSet.add(tableName);
}
//如果没有 构建新的writeSheet
WriteSheet writeSheet = childTableWriteSheetMap.getOrDefault(tableName,EasyExcel.writerSheet(tableEnum.getSheetNo()).build());
WriteSheet writeSheet = childTableWriteSheetMap.getOrDefault(tableName, EasyExcel.writerSheet(tableEnum.getSheetNo()).build());
childTableWriteSheetMap.putIfAbsent(tableName, writeSheet);
//写入数据
excelWriter.fill(new FillWrapper("t" + (tableEnum.getSheetNo() + NumConstant.ONE), resiResultList), writeSheet);
@ -391,10 +427,10 @@ public class IcResiUserController implements ResultDataResolver {
}
} finally {
if (excelWriter != null){
if (excelWriter != null) {
excelWriter.finish();
}
log.info("exportExcelByEasyExcel resi info cost time:{}s",(System.currentTimeMillis()-startM)/NumConstant.ONE_THOUSAND);
log.info("exportExcelByEasyExcel resi info cost time:{}s", (System.currentTimeMillis() - startM) / NumConstant.ONE_THOUSAND);
}
}
@ -404,7 +440,7 @@ public class IcResiUserController implements ResultDataResolver {
* @param customerId
* @return
*/
private File getIcResiTemplateFile(String customerId, IcUserTemplateEnums template) throws Exception{
private File getIcResiTemplateFile(String customerId, IcUserTemplateEnums template) throws Exception {
String fileType = ".xlsx";
String fileName = customerId + fileType;
File file = new File(IC_RESI_DOWNLOAD_DIR.resolve(fileName).toString());
@ -422,11 +458,11 @@ public class IcResiUserController implements ResultDataResolver {
if (result == null || !result.success()) {
log.warn("获取居民模版失败,path:{},走默认模版", ossFilePath);
InputStream resourceAsStream = this.getClass().getClassLoader().getResourceAsStream(template.getPathInApp());
FileUtils.copyInputStreamToFile(resourceAsStream,file);
log.warn("getIcResiTemplateFile copy default file to template,customerId:{}",customerId);
FileUtils.copyInputStreamToFile(resourceAsStream, file);
log.warn("getIcResiTemplateFile copy default file to template,customerId:{}", customerId);
} else {
log.warn("getIcResiTemplateFile reload file form oss default file to template,customerId:{}",customerId);
FileUtils.writeByteArrayToFile(file,result.getData());
log.warn("getIcResiTemplateFile reload file form oss default file to template,customerId:{}", customerId);
FileUtils.writeByteArrayToFile(file, result.getData());
}
redisUtils.hSet(RedisKeys.getResiTempChangedKey(customerId), serverIp, NumConstant.ZERO_STR);
return file;
@ -441,7 +477,7 @@ public class IcResiUserController implements ResultDataResolver {
*/
@NoRepeatSubmit
@PostMapping("importExcel")
public Result importExcelByEasyExcel(@RequestHeader("customerId") String customerId,@RequestPart("file") MultipartFile file, HttpServletRequest multipartRequest, HttpServletResponse response) {
public Result importExcelByEasyExcel(@RequestHeader("customerId") String customerId, @RequestPart("file") MultipartFile file, HttpServletRequest multipartRequest, HttpServletResponse response) {
if (file.isEmpty()) {
throw new RenException("请上传文件");
}
@ -472,7 +508,7 @@ public class IcResiUserController implements ResultDataResolver {
executorService.execute(() -> {
boolean isAllSuccess = false;
try {
List<FormItemResult> formItemList = icResiUserService.listFormItems(customerId,IcFormCodeEnum.RESI_BASE_INFO.getCode());
List<FormItemResult> formItemList = icResiUserService.listFormItems(customerId, IcFormCodeEnum.RESI_BASE_INFO.getCode());
isAllSuccess = icResiUserImportService.importIcResiInfoFromExcel(importTaskId, formItemList, importTempFileSavePath.toString(), response, IC_RESI_UPLOAD_DIR);
} catch (Throwable e) {
String errorMsg = ExceptionUtils.getThrowableErrorStackTrace(e);
@ -490,7 +526,7 @@ public class IcResiUserController implements ResultDataResolver {
} finally {
try {
// 都导入成功了没问题,才删除
if (importTempFileSavePath != null){
if (importTempFileSavePath != null) {
if (isAllSuccess) {
Files.delete(importTempFileSavePath);
} else {
@ -522,9 +558,9 @@ public class IcResiUserController implements ResultDataResolver {
* @date 2021/11/3 9:21 上午
*/
@PostMapping("persondata")
public Result<PersonDataResultDTO> personData(@LoginUser TokenDto tokenDto,@RequestBody PersonDataFormDTO formDTO) {
public Result<PersonDataResultDTO> personData(@LoginUser TokenDto tokenDto, @RequestBody PersonDataFormDTO formDTO) {
formDTO.setCustomerId(tokenDto.getCustomerId());
ValidatorUtils.validateEntity(formDTO,PersonDataFormDTO.PersonDataForm.class);
ValidatorUtils.validateEntity(formDTO, PersonDataFormDTO.PersonDataForm.class);
return new Result<PersonDataResultDTO>().ok(icResiUserService.personData(formDTO));
}
@ -545,6 +581,7 @@ public class IcResiUserController implements ResultDataResolver {
/**
* 需求 http://zentao.elinkservice.cn/task-view-4193.html 第11条
*
* @param formDTO
* @param tokenDto
* @return 根据分类搜索
@ -594,10 +631,10 @@ public class IcResiUserController implements ResultDataResolver {
}
/**
* @LoginUser TokenDto tokenDto,
* 新增需求需求人列表展示当前工作人员所属组织+页面已选择所属网格 下的居民列表
* @param formDTO
* @return
* @LoginUser TokenDto tokenDto,
* 新增需求需求人列表展示当前工作人员所属组织+页面已选择所属网格 下的居民列表
*/
@PostMapping("demandusers")
public Result<List<DemandUserResDTO>> queryDemandUsers(@RequestBody DemandUserFormDTO formDTO) {
@ -607,6 +644,7 @@ public class IcResiUserController implements ResultDataResolver {
/**
* 下载ic居民信息导入excel模板
*
* @return
*/
@PostMapping("import/download-template")
@ -637,6 +675,7 @@ public class IcResiUserController implements ResultDataResolver {
/**
* 党员年龄范围统计
*
* @Param formDTO
* @Return {@link Result< List< OptionDataResultDTO >>}
* @Author zhaoqifeng
@ -650,6 +689,7 @@ public class IcResiUserController implements ResultDataResolver {
/**
* 党员年龄列表
*
* @Param formDTO
* @Return {@link Result< PageData< PartyMemberEducationResultDTO>>}
* @Author zhaoqifeng
@ -713,6 +753,7 @@ public class IcResiUserController implements ResultDataResolver {
/**
* 党员学历统计
*
* @Param formDTO
* @Return {@link Result< List< OptionDataResultDTO>>}
* @Author zhaoqifeng
@ -726,6 +767,7 @@ public class IcResiUserController implements ResultDataResolver {
/**
* 党员学历列表
*
* @Param formDTO
* @Return {@link Result< PageData< PartyMemberEducationResultDTO>>}
* @Author zhaoqifeng
@ -795,6 +837,7 @@ public class IcResiUserController implements ResultDataResolver {
/**
* 根据居民id查询居民信息简介
*
* @param resiUserId
* @return
*/
@ -807,12 +850,13 @@ public class IcResiUserController implements ResultDataResolver {
/**
* 获取ic_resi_user
*
* @param icResiUserId
* @return
*/
@PostMapping("geticresiuser/{icResiUserId}")
public Result<IcResiUserDTO> getIcResiUserDTO(@PathVariable("icResiUserId") String icResiUserId){
if(StringUtils.isNotBlank(icResiUserId)){
public Result<IcResiUserDTO> getIcResiUserDTO(@PathVariable("icResiUserId") String icResiUserId) {
if (StringUtils.isNotBlank(icResiUserId)) {
return new Result<IcResiUserDTO>().ok(icResiUserService.get(icResiUserId));
}
return new Result<>();
@ -820,6 +864,7 @@ public class IcResiUserController implements ResultDataResolver {
/**
* 社区查询搜索居民们
*
* @param input
* @return
*/
@ -848,33 +893,34 @@ public class IcResiUserController implements ResultDataResolver {
}
/**
* @Description 社区查询人员预警右侧列表
* @param formDTO
* @param tokenDto
* @Description 社区查询人员预警右侧列表
* @author zxc
* @date 2022/1/17 4:25 下午
*/
@PostMapping("personwarn/rightlist")
public Result<PersonWarnRightListResultDTO> personWarnRightList(@RequestBody PersonWarnRightListFormDTO formDTO,@LoginUser TokenDto tokenDto){
public Result<PersonWarnRightListResultDTO> personWarnRightList(@RequestBody PersonWarnRightListFormDTO formDTO, @LoginUser TokenDto tokenDto) {
ValidatorUtils.validateEntity(formDTO, PersonWarnRightListFormDTO.PersonWarnRightListForm.class);
return new Result<PersonWarnRightListResultDTO>().ok(icResiUserService.personWarnRightList(formDTO,tokenDto));
return new Result<PersonWarnRightListResultDTO>().ok(icResiUserService.personWarnRightList(formDTO, tokenDto));
}
/**
* Desc: 根据房屋IDs查询房屋下是否有存在居民的
*
* @param ids
* @author zxc
* @date 2022/3/2 10:32 上午
*/
@PostMapping("getexistuserbyhouseids")
public Result<List<String>> getExistUserByHouseIds(@RequestBody List<String> ids){
public Result<List<String>> getExistUserByHouseIds(@RequestBody List<String> ids) {
return new Result<List<String>>().ok(icResiUserService.getExistUserByHouseIds(ids));
}
// public static ThreadLocal tl = new ThreadLocal();
@PostMapping("test-async")
public Result testAsync(HttpServletRequest request){
public Result testAsync(HttpServletRequest request) {
// tl.set("wxz");
executorService.submit(() -> {
try {

45
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserAttachmentDao.java

@ -0,0 +1,45 @@
/**
* 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.dto.result.PublicAndInternalFileResultDTO;
import com.epmet.entity.IcResiUserAttachmentEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 项目节点附件表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-12-21
*/
@Mapper
public interface IcResiUserAttachmentDao extends BaseDao<IcResiUserAttachmentEntity> {
/**
* @Description 根据项目ID查询附件
* @Param projectId
* @author zxc
* @date 2020/12/21 下午4:33
*/
List<PublicAndInternalFileResultDTO> selectAttachByProjectId(@Param("projectId")String projectId);
}

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

@ -156,6 +156,8 @@ public interface IcResiUserDao extends BaseDao<IcResiUserEntity> {
**/
IcResiUserDTO getResiUser(IcResiUserDTO dto);
IcResiUserDTO getResiUserByIdCard(@Param("idCard") String idCard,@Param("customerId") String customerId);
/**
* @param agencyId
* @param gridId

119
epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcResiUserAttachmentEntity.java

@ -0,0 +1,119 @@
/**
* 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 2020-12-21
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("ic_resi_user_attachment")
public class IcResiUserAttachmentEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户ID
*/
private String customerId;
/**
* 项目ID
*/
private String projectId;
/**
* 项目进展表ID
*/
private String processId;
/**
* 文件所属内容(内部备注: public 公开答复:internal)
*/
private String filePlace;
/**
* 文件名
*/
private String fileName;
/**
* 附件名uuid随机生成
*/
private String attachmentName;
/**
* 文件大小
*/
private Integer attachmentSize;
/**
* 文件格式JPGPNGJPEGBMPGIFPDFPPTPPTXDOCDOCXXLSXLSXMP3WMAM4AMP4AVIMOVRMVBRMWMV
*/
private String attachmentFormat;
/**
* 文件类型图片 - image 视频 - video 语音 - voice 文档 - doc
*/
private String attachmentType;
/**
* url地址
*/
private String attachmentUrl;
/**
* 排序(需求确定按上传顺序排序)
*/
private Integer sort;
/**
* 语音或视频时长
*/
private Integer duration;
/**
* 是否强制发布(0: 1:)
*/
private Integer isRelease;
/**
* 附件状态审核中auditing
* auto_passed: 自动通过
* review结果不确定需要人工审核
* block: 结果违规
* rejected人工审核驳回;
* approved人工审核通过
* 现在图片是同步审核的所以图片只有auto_passed一种状态
*/
private String status;
/**
* 附件审核结果描述
*/
private String reason;
}

101
epmet-user/epmet-user-server/src/main/java/com/epmet/excel/ProjectProcessAttachmentExcel.java

@ -0,0 +1,101 @@
/**
* 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 2020-12-21
*/
@Data
public class ProjectProcessAttachmentExcel {
@Excel(name = "唯一标识")
private String id;
@Excel(name = "客户ID")
private String customerId;
@Excel(name = "项目ID")
private String projectId;
@Excel(name = "项目进展表ID")
private String processId;
@Excel(name = "文件所属内容(内部备注: public 公开答复:internal)")
private String filePlace;
@Excel(name = "文件名")
private String fileName;
@Excel(name = "附件名(uuid随机生成)")
private String attachmentName;
@Excel(name = "文件大小")
private Integer attachmentSize;
@Excel(name = "文件格式(JPG、PNG、JPEG、BMP、GIF、PDF、PPT、PPTX、DOC、DOCX、XLS、XLSX、MP3、WMA、M4A、MP4、AVI、MOV、RMVB、RM、WMV)")
private String attachmentFormat;
@Excel(name = "文件类型((图片 - image、 视频 - video、 语音 - voice、 文档 - doc))")
private String attachmentType;
@Excel(name = "url地址")
private String attachmentUrl;
@Excel(name = "排序(需求确定,按上传顺序排序)")
private Integer sort;
@Excel(name = "语音或视频时长,秒")
private Integer duration;
@Excel(name = "是否强制发布(0:否 1:是)")
private Integer isRelease;
@Excel(name = "附件审核状态")
private String status;
@Excel(name = "附件审核结果描述")
private String reason;
@Excel(name = "删除标识:0.未删除 1.已删除")
private String delFlag;
@Excel(name = "乐观锁")
private Integer revision;
@Excel(name = "创建人")
private String createdBy;
@Excel(name = "创建时间")
private Date createdTime;
@Excel(name = "更新人")
private String updatedBy;
@Excel(name = "更新时间")
private Date updatedTime;
}

13
epmet-user/epmet-user-server/src/main/java/com/epmet/feign/GovOrgFeignClient.java

@ -5,8 +5,11 @@ import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.CustomerGridDTO;
import com.epmet.dto.form.CommonGridIdFormDTO;
import com.epmet.dto.form.CustomerGridFormDTO;
import com.epmet.dto.result.GridInfoResultDTO;
import com.epmet.feign.fallback.GovOrgFeignClientFallBack;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
@ -29,6 +32,16 @@ public interface GovOrgFeignClient {
@PostMapping("/gov/org/customergrid/getcustomergridbygridid")
Result<CustomerGridDTO> getCustomerGridByGridId(CustomerGridFormDTO formDTO);
/**
* @param gridId
* @return com.epmet.commons.tools.utils.Result<com.epmet.dto.result.GridInfoResultDTO>
* @Author yinzuomei
* @Description 根据网格id查询所属组织信息
* @Date 2020/4/26 23:16
**/
@GetMapping("/gov/org/customergrid/getGridInfo/{gridId}")
Result<GridInfoResultDTO> queryGridInfo(@PathVariable("gridId") String gridId);
/**
* @Description 查询一个网格下的所有工作人员[copy wangc]
* @param gridIdFormDTO

6
epmet-user/epmet-user-server/src/main/java/com/epmet/feign/fallback/GovOrgFeignClientFallBack.java

@ -6,6 +6,7 @@ import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.CustomerGridDTO;
import com.epmet.dto.form.CommonGridIdFormDTO;
import com.epmet.dto.form.CustomerGridFormDTO;
import com.epmet.dto.result.GridInfoResultDTO;
import com.epmet.feign.GovOrgFeignClient;
import org.springframework.stereotype.Component;
@ -24,6 +25,11 @@ public class GovOrgFeignClientFallBack implements GovOrgFeignClient {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getcustomergridbygridid", formDTO);
}
@Override
public Result<GridInfoResultDTO> queryGridInfo(String gridId) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getGridInfo",gridId);
}
@Override
public Result<List<String>> getGridStaffs(CommonGridIdFormDTO gridIdFormDTO) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getGridStaffs", gridIdFormDTO);

95
epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserAttachmentService.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.IcResiUserAttachmentDTO;
import com.epmet.entity.IcResiUserAttachmentEntity;
import java.util.List;
import java.util.Map;
/**
* 项目节点附件表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-12-21
*/
public interface IcResiUserAttachmentService extends BaseService<IcResiUserAttachmentEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<IcResiUserAttachmentDTO>
* @author generator
* @date 2020-12-21
*/
PageData<IcResiUserAttachmentDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<IcResiUserAttachmentDTO>
* @author generator
* @date 2020-12-21
*/
List<IcResiUserAttachmentDTO> list(Map<String, Object> params);
/**
* 单条查询
*
* @param id
* @return IcResiUserAttachmentDTO
* @author generator
* @date 2020-12-21
*/
IcResiUserAttachmentDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2020-12-21
*/
void save(IcResiUserAttachmentDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2020-12-21
*/
void update(IcResiUserAttachmentDTO dto);
/**
* 批量删除
*
* @param ids
* @return void
* @author generator
* @date 2020-12-21
*/
void delete(String[] ids);
}

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

@ -58,6 +58,16 @@ public interface IcResiUserService extends BaseService<IcResiUserEntity> {
**/
String edit(TokenDto tokenDto, List<IcResiUserFormDTO> formDTO);
/**
* 租客房东根据身份证更新头像
*
* @param formDTO
* @return com.epmet.commons.tools.utils.Result
* @author zhy
* @date 2022/4/26 10:48
*/
String rentUpdate(RentTenantFormDTO formDTO);
/**
* @Description 获取房间内人员
* @Param homeId
@ -95,6 +105,16 @@ public interface IcResiUserService extends BaseService<IcResiUserEntity> {
*/
PersonDataResultDTO personData(PersonDataFormDTO formDTO);
/**
* 租客房东黑名单查询个人数据
*
* @param formDTO
* @return com.epmet.dto.result.RentTenantDataResultDTO
* @author zhy
* @date 2022/4/26 16:03
*/
RentTenantDataResultDTO tenantData(RentTenantDataFormDTO formDTO);
/**
* @Description 根据名字搜索
* @param formDTO

99
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserAttachmentServiceImpl.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.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.dao.IcResiUserAttachmentDao;
import com.epmet.dto.IcResiUserAttachmentDTO;
import com.epmet.entity.IcResiUserAttachmentEntity;
import com.epmet.service.IcResiUserAttachmentService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* 项目节点附件表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-12-21
*/
@Service
public class IcResiUserAttachmentServiceImpl extends BaseServiceImpl<IcResiUserAttachmentDao, IcResiUserAttachmentEntity> implements IcResiUserAttachmentService {
@Override
public PageData<IcResiUserAttachmentDTO> page(Map<String, Object> params) {
IPage<IcResiUserAttachmentEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, IcResiUserAttachmentDTO.class);
}
@Override
public List<IcResiUserAttachmentDTO> list(Map<String, Object> params) {
List<IcResiUserAttachmentEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, IcResiUserAttachmentDTO.class);
}
private QueryWrapper<IcResiUserAttachmentEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<IcResiUserAttachmentEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
return wrapper;
}
@Override
public IcResiUserAttachmentDTO get(String id) {
IcResiUserAttachmentEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, IcResiUserAttachmentDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(IcResiUserAttachmentDTO dto) {
IcResiUserAttachmentEntity entity = ConvertUtils.sourceToTarget(dto, IcResiUserAttachmentEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(IcResiUserAttachmentDTO dto) {
IcResiUserAttachmentEntity entity = ConvertUtils.sourceToTarget(dto, IcResiUserAttachmentEntity.class);
updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteBatchIds(Arrays.asList(ids));
}
}

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

@ -101,7 +101,8 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
private EpmetHeartOpenFeignClient heartOpenFeignClient;
@Autowired
private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient;
@Autowired
private IcResiUserAttachmentService icResiUserAttachmentService;
@Autowired
private IcResiUserImportServiceImpl icResiUserImportService;
@Autowired
@ -111,6 +112,8 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
@Autowired
private EpmetAdminOpenFeignClient epmetAdminOpenFeignClient;
@Autowired
private GovOrgFeignClient govOrgFeignClient;
@Autowired
private IcResiUserDao icResiUserDao;
@Autowired
private IcUserChangeRecordService icUserChangeRecordService;
@ -127,8 +130,8 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
@Resource
private IcTripReportRecordService icTripReportRecordService;
private QueryWrapper<IcResiUserEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
private QueryWrapper<IcResiUserEntity> getWrapper(Map<String, Object> params) {
String id = (String) params.get(FieldConstant.ID_HUMP);
QueryWrapper<IcResiUserEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
@ -172,7 +175,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
}
});
});
if (str.length() > NumConstant.ZERO ) {
if (str.length() > NumConstant.ZERO) {
String errorMsg = String.format("新增居民信息,必要字段值为空,%s值为空", str);
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), errorMsg, errorMsg);
}
@ -193,7 +196,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
map.put("customer_id", tokenDto.getCustomerId());
map.put("created_by", tokenDto.getUserId());
map.put("updated_by", tokenDto.getUserId());
if(!map.containsKey("AGENCY_ID")){
if (!map.containsKey("AGENCY_ID")) {
throw new RenException("新增居民信息--入参AGENCY_ID为空");
}
//2021.11.25 新增需求 客户下身份证号唯一 start
@ -396,6 +399,29 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
return resiUserId;
}
@Override
@Transactional(rollbackFor = Exception.class)
public String rentUpdate(RentTenantFormDTO formDTO) {
String resiUserId;
IcResiUserDTO userDTO = baseDao.getResiUserByIdCard(formDTO.getIdCard(), formDTO.getCustomerId());
if (null != userDTO && null != userDTO.getIdCard()) {
GridInfoResultDTO deptInfo = govOrgFeignClient.queryGridInfo(formDTO.getGridId()).getData();
// 没有该居民,新增一个居民
IcResiUserEntity entity = new IcResiUserEntity();
insert(entity);
resiUserId = entity.getId();
} else {
resiUserId = userDTO.getId();
}
// 插入附件头像
IcResiUserAttachmentDTO dto = new IcResiUserAttachmentDTO();
dto.setUserId(resiUserId);
dto.setAttachmentUrl(formDTO.getImg());
icResiUserAttachmentService.save(dto);
return resiUserId;
}
/**
* @Author sun
* @Description 居民信息修改--生成变更记录和变更明细
@ -425,7 +451,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
IcResiCategoryStatsConfigDTO sfdto = new IcResiCategoryStatsConfigDTO();
sfdto.setCustomerId(tokenDto.getCustomerId());
Result<List<IcResiCategoryStatsConfigDTO>> categoryListResult = operCustomizeOpenFeignClient.getCategoryList(sfdto);
if (!categoryListResult.success()){
if (!categoryListResult.success()) {
throw new RenException("居民信息修改,获取客户居民类别预警配置表数据失败");
}
//修改前数据库居民十八类信息值
@ -495,7 +521,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
*/
@Override
public List<HomeUserResultDTO> getPeopleByRoom(String homeId) {
if(StringUtils.isBlank(homeId)) {
if (StringUtils.isBlank(homeId)) {
return Collections.emptyList();
}
LambdaQueryWrapper<IcResiUserEntity> wrapper = new LambdaQueryWrapper<>();
@ -515,72 +541,70 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
}
@Override
public PageData<Map<String, Object>> pageResiMap(IcResiUserPageFormDTO formDTO) {
CustomerStaffInfoCacheResult staffInfoCacheResult=CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(),formDTO.getStaffId());
CustomerStaffInfoCacheResult staffInfoCacheResult = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId());
String staffOrgPath;
if(StringUtils.isNotBlank(staffInfoCacheResult.getAgencyPIds())&& !NumConstant.ZERO_STR.equals(staffInfoCacheResult.getAgencyPIds())){
staffOrgPath=staffInfoCacheResult.getAgencyPIds().concat(":").concat(staffInfoCacheResult.getAgencyId());
}else{
staffOrgPath=staffInfoCacheResult.getAgencyId();
if (StringUtils.isNotBlank(staffInfoCacheResult.getAgencyPIds()) && !NumConstant.ZERO_STR.equals(staffInfoCacheResult.getAgencyPIds())) {
staffOrgPath = staffInfoCacheResult.getAgencyPIds().concat(":").concat(staffInfoCacheResult.getAgencyId());
} else {
staffOrgPath = staffInfoCacheResult.getAgencyId();
}
// 查询列表展示项,如果没有,直接返回
CustomerFormQueryDTO queryDTO1=new CustomerFormQueryDTO();
CustomerFormQueryDTO queryDTO1 = new CustomerFormQueryDTO();
queryDTO1.setCustomerId(formDTO.getCustomerId());
queryDTO1.setFormCode(formDTO.getFormCode());
Result<List<IcFormResColumnDTO>> resultColumnRes=operCustomizeOpenFeignClient.queryConditions(queryDTO1);
Result<List<IcFormResColumnDTO>> resultColumnRes = operCustomizeOpenFeignClient.queryConditions(queryDTO1);
if (!resultColumnRes.success() || CollectionUtils.isEmpty(resultColumnRes.getData())) {
log.warn("没有配置列表展示列");
return new PageData(new ArrayList(), NumConstant.ZERO);
}
List<IcFormResColumnDTO> resultColumns = resultColumnRes.getData();
// 查询结果列对应的表:
Set<String> resultColumnTables=resultColumns.stream().map(IcFormResColumnDTO::getTableName).collect(Collectors.toSet());
Set<String> resultColumnTables = resultColumns.stream().map(IcFormResColumnDTO::getTableName).collect(Collectors.toSet());
// 查询列表展示项需要用到哪些子表
Result<List<SubTableJoinDTO>> subTablesRes=operCustomizeOpenFeignClient.querySubTables(queryDTO1);
List<SubTableJoinDTO> subTables =subTablesRes.getData();
Result<List<SubTableJoinDTO>> subTablesRes = operCustomizeOpenFeignClient.querySubTables(queryDTO1);
List<SubTableJoinDTO> subTables = subTablesRes.getData();
// log.info("1、所有的子表subTables:"+JSON.toJSONString(subTables,true));
//关联哪些子表:查询条件用到的表名+查询的列对应的表 并集去重
Set<String> whereConditionTables=formDTO.getConditions().stream().map(ResiUserQueryValueDTO::getTableName).collect(Collectors.toSet());
Set<String> tables=new HashSet<>();
Set<String> whereConditionTables = formDTO.getConditions().stream().map(ResiUserQueryValueDTO::getTableName).collect(Collectors.toSet());
Set<String> tables = new HashSet<>();
tables.addAll(whereConditionTables);
tables.addAll(resultColumnTables);
// log.info("2、查询条件+查询列对应的tables并集去重:"+ JSON.toJSONString(tables,true));
//最终关联的子表对应的sql:
List<String> finalSubTables =new ArrayList<>();
subTables.forEach(subTable->{
if(tables.contains(subTable.getTableName())){
List<String> finalSubTables = new ArrayList<>();
subTables.forEach(subTable -> {
if (tables.contains(subTable.getTableName())) {
finalSubTables.add(subTable.getJoinTableSql());
}
});
PageInfo<Map<String, Object>> pageInfo=new PageInfo<>();
if (null == formDTO.getPageFlag()||formDTO.getPageFlag()) {
PageInfo<Map<String, Object>> pageInfo = new PageInfo<>();
if (null == formDTO.getPageFlag() || formDTO.getPageFlag()) {
//分页
String finalStaffOrgPath = staffOrgPath;
pageInfo= PageHelper.startPage(formDTO.getPageNo(),
pageInfo = PageHelper.startPage(formDTO.getPageNo(),
formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.selectListResiMap(formDTO.getCustomerId(),
formDTO.getFormCode(),
formDTO.getConditions(),
resultColumns,
finalSubTables,
staffInfoCacheResult.getAgencyId(), finalStaffOrgPath,null, formDTO.getKeyword()));
}else{
List<Map<String,Object>> list=baseDao.selectListResiMap(formDTO.getCustomerId(),
staffInfoCacheResult.getAgencyId(), finalStaffOrgPath, null, formDTO.getKeyword()));
} else {
List<Map<String, Object>> list = baseDao.selectListResiMap(formDTO.getCustomerId(),
formDTO.getFormCode(),
formDTO.getConditions(),
resultColumns,
finalSubTables,
staffInfoCacheResult.getAgencyId(),
staffOrgPath,null,
staffOrgPath, null,
formDTO.getKeyword());
pageInfo.setTotal(CollectionUtils.isEmpty(list)?NumConstant.ZERO:list.size());
pageInfo.setTotal(CollectionUtils.isEmpty(list) ? NumConstant.ZERO : list.size());
pageInfo.setList(list);
}
@ -596,23 +620,23 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
houseIds.add(map.get(UserConstant.HOME_ID).toString());
}
}
Result<List<AllGridsByUserIdResultDTO>> gridInfoRes=govOrgOpenFeignClient.getGridListByGridIds(gridIds);
Result<List<AllGridsByUserIdResultDTO>> gridInfoRes = govOrgOpenFeignClient.getGridListByGridIds(gridIds);
List<AllGridsByUserIdResultDTO> gridInfoList = gridInfoRes.success() && !CollectionUtils.isEmpty(gridInfoRes.getData()) ? gridInfoRes.getData() : new ArrayList<>();
Map<String, AllGridsByUserIdResultDTO> gridInfoMap = gridInfoList.stream().collect(Collectors.toMap(AllGridsByUserIdResultDTO::getGridId, Function.identity()));
//查询房子名称
Result<List<HouseInfoDTO>> houseInfoRes=govOrgOpenFeignClient.queryListHouseInfo(houseIds,formDTO.getCustomerId());
Result<List<HouseInfoDTO>> houseInfoRes = govOrgOpenFeignClient.queryListHouseInfo(houseIds, formDTO.getCustomerId());
List<HouseInfoDTO> houseInfoDTOList = houseInfoRes.success() && !CollectionUtils.isEmpty(houseInfoRes.getData()) ? houseInfoRes.getData() : new ArrayList<>();
Map<String, HouseInfoDTO> houseInfoMap = houseInfoDTOList.stream().collect(Collectors.toMap(HouseInfoDTO::getHomeId, Function.identity()));
//查询需求分类字典
UserDemandNameQueryFormDTO userDemandNameQueryFormDTO=new UserDemandNameQueryFormDTO();
UserDemandNameQueryFormDTO userDemandNameQueryFormDTO = new UserDemandNameQueryFormDTO();
userDemandNameQueryFormDTO.setCustomerId(formDTO.getCustomerId());
Result<List<IcResiDemandDictDTO>> demandNameRes=heartOpenFeignClient.queryDemandNames(userDemandNameQueryFormDTO);
if(!demandNameRes.success()||CollectionUtils.isEmpty(demandNameRes.getData())){
throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(),"获取需求分类字典表数据异常",EpmetErrorCode.SERVER_ERROR.getMsg());
Result<List<IcResiDemandDictDTO>> demandNameRes = heartOpenFeignClient.queryDemandNames(userDemandNameQueryFormDTO);
if (!demandNameRes.success() || CollectionUtils.isEmpty(demandNameRes.getData())) {
throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), "获取需求分类字典表数据异常", EpmetErrorCode.SERVER_ERROR.getMsg());
}
Map<String,IcResiDemandDictDTO> demandDictMap=demandNameRes.getData().stream().collect(Collectors.toMap(IcResiDemandDictDTO::getCategoryCode,Function.identity()));
Map<String, IcResiDemandDictDTO> demandDictMap = demandNameRes.getData().stream().collect(Collectors.toMap(IcResiDemandDictDTO::getCategoryCode, Function.identity()));
for (Map<String, Object> resultMap : list) {
String gridIdValue = null != resultMap.get(UserConstant.GRID_ID) ? resultMap.get(UserConstant.GRID_ID).toString() : StrConstant.EPMETY_STR;
@ -650,7 +674,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
}
resultMap.put(UserConstant.HOME_ID, neighBorName.concat(buildName).concat(unitName).concat(doorName));
resultMap.put("CATEGORY_NAME",queryUserDemandName((String) resultMap.get("icResiUserId"),demandDictMap));
resultMap.put("CATEGORY_NAME", queryUserDemandName((String) resultMap.get("icResiUserId"), demandDictMap));
}
if (resultMap.containsKey(UserConstant.GENDER)) {
@ -668,31 +692,31 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
return new PageData<>(pageInfo.getList(), pageInfo.getTotal());
}
private String queryUserDemandName(String icResiUserId,Map<String,IcResiDemandDictDTO> demandDictMap) {
private String queryUserDemandName(String icResiUserId, Map<String, IcResiDemandDictDTO> demandDictMap) {
// epmet_user.ic_resi_demand.category_code存储的值为 分类编码的全路径,eg:
// 1003,10030002
// 1012,10120003
// 1016,10160003
Set<String> demandCodePath=baseDao.selectUserDemandCode(icResiUserId);
if(CollectionUtils.isEmpty(demandCodePath)){
Set<String> demandCodePath = baseDao.selectUserDemandCode(icResiUserId);
if (CollectionUtils.isEmpty(demandCodePath)) {
return StrConstant.EPMETY_STR;
}
List<String> nameList=new ArrayList<>();
for(String codePath:demandCodePath){
List<String> nameList = new ArrayList<>();
for (String codePath : demandCodePath) {
if (StringUtils.isNotBlank(codePath) && codePath.contains(StrConstant.COMMA)) {
String[] codeAtt=codePath.split(StrConstant.COMMA);
String code=codeAtt[codeAtt.length-1];
if(StringUtils.isNotBlank(code)&&demandDictMap.containsKey(code)){
String[] codeAtt = codePath.split(StrConstant.COMMA);
String code = codeAtt[codeAtt.length - 1];
if (StringUtils.isNotBlank(code) && demandDictMap.containsKey(code)) {
nameList.add(demandDictMap.get(code).getParentName());
}
}else{
if(StringUtils.isNotBlank(codePath)&&demandDictMap.containsKey(codePath)){
} else {
if (StringUtils.isNotBlank(codePath) && demandDictMap.containsKey(codePath)) {
nameList.add(demandDictMap.get(codePath).getParentName());
}
}
}
String demandName=String.join(StrConstant.COMMA_ZH,nameList);
return demandName;
String demandName = String.join(StrConstant.COMMA_ZH, nameList);
return demandName;
}
@ -708,17 +732,17 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
public Map queryIcResiDetail(IcResiDetailFormDTO pageFormDTO) {
Map resultMap = new HashMap();
// 先查询主表,主表没有记录,直接返回空
List<Map<String, Object>> icResiUserMapList = baseDao.selectListMapById(pageFormDTO.getCustomerId(),pageFormDTO.getIcResiUserId());
List<Map<String, Object>> icResiUserMapList = baseDao.selectListMapById(pageFormDTO.getCustomerId(), pageFormDTO.getIcResiUserId());
if (CollectionUtils.isEmpty(icResiUserMapList)) {
return new HashMap();
}
resultMap.put("ic_resi_user", icResiUserMapList);
CustomerFormQueryDTO queryDTO=ConvertUtils.sourceToTarget(pageFormDTO,CustomerFormQueryDTO.class);
CustomerFormQueryDTO queryDTO = ConvertUtils.sourceToTarget(pageFormDTO, CustomerFormQueryDTO.class);
//循环查询每个子表的记录
Result<Set<String>> subTableRes=operCustomizeOpenFeignClient.queryIcResiSubTables(queryDTO);
if(subTableRes.success()&&!CollectionUtils.isEmpty(subTableRes.getData())){
Result<Set<String>> subTableRes = operCustomizeOpenFeignClient.queryIcResiSubTables(queryDTO);
if (subTableRes.success() && !CollectionUtils.isEmpty(subTableRes.getData())) {
for (String subTalbeName : subTableRes.getData()) {
List<Map<String, Object>> list = baseDao.selectSubTableRecords(pageFormDTO.getCustomerId(),pageFormDTO.getIcResiUserId(), subTalbeName);
List<Map<String, Object>> list = baseDao.selectSubTableRecords(pageFormDTO.getCustomerId(), pageFormDTO.getIcResiUserId(), subTalbeName);
if (!CollectionUtils.isEmpty(list)) {
resultMap.put(subTalbeName, list);
}
@ -732,6 +756,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
/**
* desc:动态查询 某表的所有字段值
*
* @param customerId
* @param formCode
* @param resultTableName
@ -739,50 +764,50 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
* @return
*/
@Override
public List<Map<String,Object>> dynamicQuery(String customerId,
String formCode,
String resultTableName,
List<ResiUserQueryValueDTO> conditions,
String currentStaffAgencyId,
String staffOrgPath){
CustomerFormQueryDTO queryDTO=new CustomerFormQueryDTO();
public List<Map<String, Object>> dynamicQuery(String customerId,
String formCode,
String resultTableName,
List<ResiUserQueryValueDTO> conditions,
String currentStaffAgencyId,
String staffOrgPath) {
CustomerFormQueryDTO queryDTO = new CustomerFormQueryDTO();
queryDTO.setCustomerId(customerId);
queryDTO.setFormCode(formCode);
//所有的子表
Result<List<SubTableJoinDTO>> subTablesRes=operCustomizeOpenFeignClient.querySubTables(queryDTO);
Result<List<SubTableJoinDTO>> subTablesRes = operCustomizeOpenFeignClient.querySubTables(queryDTO);
/*List<String> subTablesBak=new ArrayList<>();
if(subTablesRes.success()&&CollectionUtils.isNotEmpty(subTablesRes.getData())){
subTablesBak =subTablesRes.getData().stream().map(SubTableJoinDTO::getJoinTableSql).collect(Collectors.toList());
}*/
List<SubTableJoinDTO> subTables =subTablesRes.getData();
List<SubTableJoinDTO> subTables = subTablesRes.getData();
// log.info("1、所有的子表subTables:"+JSON.toJSONString(subTables,true));
//关联哪些子表:查询条件用到的表名+查询的列对应的表 并集去重
Set<String> whereConditionTables=conditions.stream().map(ResiUserQueryValueDTO::getTableName).collect(Collectors.toSet());
Set<String> tables=new HashSet<>();
Set<String> whereConditionTables = conditions.stream().map(ResiUserQueryValueDTO::getTableName).collect(Collectors.toSet());
Set<String> tables = new HashSet<>();
tables.addAll(whereConditionTables);
tables.add(resultTableName);
// log.info("2、查询条件+查询列对应的tables并集去重:"+ JSON.toJSONString(tables,true));
//最终关联的子表对应的sql:
List<String> finalSubTables =new ArrayList<>();
subTables.forEach(subTable->{
if(tables.contains(subTable.getTableName())){
List<String> finalSubTables = new ArrayList<>();
subTables.forEach(subTable -> {
if (tables.contains(subTable.getTableName())) {
finalSubTables.add(subTable.getJoinTableSql());
}
});
return baseDao.dynamicQuery(customerId,resultTableName,conditions,finalSubTables,currentStaffAgencyId,staffOrgPath);
return baseDao.dynamicQuery(customerId, resultTableName, conditions, finalSubTables, currentStaffAgencyId, staffOrgPath);
}
/**
* @Description 查询个人数据
* @param formDTO
* @Description 查询个人数据
* @author zxc
* @date 2021/11/3 9:21 上午
*/
@Override
public PersonDataResultDTO personData(PersonDataFormDTO formDTO) {
PersonDataResultDTO personData = baseDao.personData(formDTO.getUserId());
if (null == personData){
if (null == personData) {
return new PersonDataResultDTO();
}
//新增以下2个返参
@ -796,16 +821,16 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
personData.setIcResiUserId(formDTO.getUserId());
// 房屋信息查询
Result<List<String>> listResult = govOrgOpenFeignClient.selectHouseInfoByIdCard(personData.getIdCard(),formDTO.getCustomerId());
if (!listResult.success()){
Result<List<String>> listResult = govOrgOpenFeignClient.selectHouseInfoByIdCard(personData.getIdCard(), formDTO.getCustomerId());
if (!listResult.success()) {
throw new RenException("查询房屋信息失败");
}
personData.setHouseInfo(listResult.getData());
// 志愿者处理
if (personData.getIsVolunteer().equals(NumConstant.ONE_STR)){
if (personData.getIsVolunteer().equals(NumConstant.ONE_STR)) {
List<String> volunteerList = baseDao.selectVolunteerByUserId(formDTO.getUserId());
if (!CollectionUtils.isEmpty(volunteerList)){
if (!CollectionUtils.isEmpty(volunteerList)) {
List<String> volunteers = new ArrayList<>();
List<String> finalVolunteers = volunteers;
volunteerList.forEach(v -> {
@ -815,7 +840,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
volunteers = volunteers.stream().distinct().collect(Collectors.toList());
// 去customize 查询志愿者类别
Result<List<String>> volunteerResult = operCustomizeOpenFeignClient.volunteerLabelByValues(volunteers, personData.getCustomerId());
if (!volunteerResult.success()){
if (!volunteerResult.success()) {
throw new RenException("查询志愿者类别失败...");
}
personData.setVolunteerCategory(volunteerResult.getData());
@ -823,7 +848,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
}
// 网格名
GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(personData.getGridId());
if (null != gridInfo){
if (null != gridInfo) {
personData.setGridName(gridInfo.getGridNamePath());
}
/**
@ -834,22 +859,22 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
IcResiCategoryStatsConfigDTO dto = new IcResiCategoryStatsConfigDTO();
dto.setCustomerId(personData.getCustomerId());
Result<List<IcResiCategoryStatsConfigDTO>> categoryListResult = operCustomizeOpenFeignClient.getCategoryList(dto);
if (!categoryListResult.success()){
if (!categoryListResult.success()) {
throw new RenException("查询客户下的人员类别失败...");
}
List<IcResiCategoryStatsConfigDTO> categoryData = categoryListResult.getData();
if (!CollectionUtils.isEmpty(categoryData)){
if (!CollectionUtils.isEmpty(categoryData)) {
Map<String, List<IcResiCategoryStatsConfigDTO>> groupByStatus = categoryData.stream().collect(Collectors.groupingBy(IcResiCategoryStatsConfigDTO::getStatus));
List<IcResiCategoryStatsConfigDTO> showList = groupByStatus.get(IcPlatformConstant.PERSON_CATEGORY_SHOW);
List<String> personCategoryList = new ArrayList<>();
if (!CollectionUtils.isEmpty(showList)){
if (!CollectionUtils.isEmpty(showList)) {
Map<String, List<IcResiCategoryStatsConfigDTO>> groupByTableName = showList.stream().collect(Collectors.groupingBy(IcResiCategoryStatsConfigDTO::getTableName));
groupByTableName.forEach((tableName,list) -> {
groupByTableName.forEach((tableName, list) -> {
List<String> columns = list.stream().map(IcResiCategoryStatsConfigDTO::getColumnName).collect(Collectors.toList());
Map<String, String> result = baseDao.selectPersonType(columns, personData.getCustomerId(), tableName,formDTO.getUserId());
Map<String, String> result = baseDao.selectPersonType(columns, personData.getCustomerId(), tableName, formDTO.getUserId());
list.forEach(l -> {
result.forEach((k,v) -> {
if (l.getColumnName().equals(k) && v.equals(NumConstant.ONE_STR)){
result.forEach((k, v) -> {
if (l.getColumnName().equals(k) && v.equals(NumConstant.ONE_STR)) {
personCategoryList.add(l.getLabel());
}
});
@ -861,9 +886,15 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
return personData;
}
@Override
public RentTenantDataResultDTO tenantData(RentTenantDataFormDTO formDTO) {
IcResiUserEntity entity = selectById(formDTO.getUserId());
return ConvertUtils.sourceToTarget(entity, RentTenantDataResultDTO.class);
}
/**
* @Description 根据名字搜索
* @param formDTO
* @Description 根据名字搜索
* @author zxc
* @date 2021/11/3 1:42 下午
*/
@ -871,29 +902,29 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
public PageData<SearchByNameResultDTO> searchByName(SearchByNameFormDTO formDTO) {
// 查询工作人员所属组织
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getUserId());
if (null == staffInfo){
if (null == staffInfo) {
throw new RenException("未查询到当前工作人员所属组织");
}
Integer no = (formDTO.getPageNo() - NumConstant.ONE) * formDTO.getPageSize();
PageInfo<SearchByNameResultDTO> pageInfo = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.searchByName(formDTO.getName(), formDTO.getColumnName(),staffInfo.getAgencyId(), no));
PageInfo<SearchByNameResultDTO> pageInfo = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.searchByName(formDTO.getName(), formDTO.getColumnName(), staffInfo.getAgencyId(), no));
List<SearchByNameResultDTO> result = pageInfo.getList();
if (CollectionUtils.isEmpty(result)){
if (CollectionUtils.isEmpty(result)) {
return new PageData<>(new ArrayList<>(), pageInfo.getTotal());
}
// 查询小区,楼号,网格
Result<List<AllGridsByUserIdResultDTO>> gridResult = govOrgOpenFeignClient.getGridListByGridIds(result.stream().map(SearchByNameResultDTO::getGridId).collect(Collectors.toList()));
if (!gridResult.success()) {
throw new RenException(gridResult.getCode(),gridResult.getMsg());
throw new RenException(gridResult.getCode(), gridResult.getMsg());
}
Map<String, String> gridMap = gridResult.getData().stream().collect(Collectors.toMap(AllGridsByUserIdResultDTO::getGridId, AllGridsByUserIdResultDTO::getGridName));
Result<List<IcNeighborHoodDTO>> neighborHoodResult = govOrgOpenFeignClient.getListByIds(result.stream().map(SearchByNameResultDTO::getNeighborHoodId).collect(Collectors.toList()));
if (!neighborHoodResult.success()) {
throw new RenException(neighborHoodResult.getCode(),neighborHoodResult.getMsg());
throw new RenException(neighborHoodResult.getCode(), neighborHoodResult.getMsg());
}
Map<String, String> neighborHoodMap = neighborHoodResult.getData().stream().collect(Collectors.toMap(IcNeighborHoodDTO::getId, IcNeighborHoodDTO::getNeighborHoodName));
Result<List<BuildingResultDTO>> buildResult = govOrgOpenFeignClient.buildingListByIds(result.stream().map(SearchByNameResultDTO::getBuildId).collect(Collectors.toList()));
if (!buildResult.success()) {
throw new RenException(buildResult.getCode(),buildResult.getMsg());
throw new RenException(buildResult.getCode(), buildResult.getMsg());
}
Map<String, String> buildMap = buildResult.getData().stream().collect(Collectors.toMap(BuildingResultDTO::getBuildingId, BuildingResultDTO::getBuildingName));
AtomicInteger i = new AtomicInteger(NumConstant.ONE);
@ -910,8 +941,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
/**
* desc:条件导出
*
*
* @param formItemMap key 表名 value formItem
* @param formItemMap key 表名 value formItem
* @param baseTableName
* @return
*/
@ -927,33 +957,33 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
//获取用户Id
if (IcResiUserConstant.IC_RESI_USER.equals(baseTableName)) {
resiId = (String) resiUser.get("ID");
}else {
} else {
resiId = (String) resiUser.get(UserConstant.IC_RESI_USER);
}
if (StringUtils.isBlank(resiId)){
log.error("getDataForExport error,resiId is net exist:{}",resiUser);
if (StringUtils.isBlank(resiId)) {
log.error("getDataForExport error,resiId is net exist:{}", resiUser);
return;
}
//遍历所有字段 格式化时间字段
resiUser.forEach((k,o) -> {
if (o instanceof java.sql.Date){
o = DateUtils.format(((Date) o),DateUtils.DATE_PATTERN);
}else if (o instanceof java.sql.Timestamp){
o = DateUtils.format(new Date(((Timestamp) o).getTime()),DateUtils.DATE_TIME_PATTERN);
resiUser.forEach((k, o) -> {
if (o instanceof java.sql.Date) {
o = DateUtils.format(((Date) o), DateUtils.DATE_PATTERN);
} else if (o instanceof java.sql.Timestamp) {
o = DateUtils.format(new Date(((Timestamp) o).getTime()), DateUtils.DATE_TIME_PATTERN);
}
resiUser.put(k,o);
resiUser.put(k, o);
});
//当前条数据原始的id值 resiUser
Map<String,Object> originalConditionMap = new ConcurrentHashMap<>();
formItemMap.getItemMap().values().parallelStream().forEach(e->{
Map<String, Object> originalConditionMap = new ConcurrentHashMap<>();
formItemMap.getItemMap().values().parallelStream().forEach(e -> {
String columnName = getColumnName(e);
Object temp = resiUser.get(columnName);
String vauleStr = temp == null ? StrConstant.EPMETY_STR : temp.toString();
originalConditionMap.putIfAbsent(columnName,vauleStr);
originalConditionMap.putIfAbsent(columnName, vauleStr);
if (Constant.OPITON_SOURCE_REMOTE.equals(e.getOptionSourceType()) && StringUtils.isNotBlank(vauleStr)) {
putRemoteValue(formItemMap.getRemoteItemConditionMap().get(e.getItemId()), currentStaffAgencyId, resiUser,originalConditionMap, e, columnName, vauleStr);
putRemoteValue(formItemMap.getRemoteItemConditionMap().get(e.getItemId()), currentStaffAgencyId, resiUser, originalConditionMap, e, columnName, vauleStr);
} else {
putOptionValue(resiUser, e, columnName, vauleStr);
}
@ -962,14 +992,14 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
if (IcResiUserConstant.IC_RESI_USER.equals(baseTableName)) {
//把人放入redis缓存 便于后面的sheet使用基础信息
ResiExportBaseInfoData infoData = ConvertUtils.mapToEntity(resiUser, ResiExportBaseInfoData.class);
redisTemplate.opsForValue().set(RedisKeys.getExportResiBaseInfoKey(resiId), infoData,RedisUtils.MINUTE_THIRTY_EXPIRE, TimeUnit.SECONDS);
redisTemplate.opsForValue().set(RedisKeys.getExportResiBaseInfoKey(resiId), infoData, RedisUtils.MINUTE_THIRTY_EXPIRE, TimeUnit.SECONDS);
} else {
ResiExportBaseInfoData temp = (ResiExportBaseInfoData) redisTemplate.opsForValue().get(RedisKeys.getExportResiBaseInfoKey(resiId));
if (temp != null){
if (temp != null) {
try {
resiUser.putAll(ConvertUtils.entityToMap(temp));
} catch (Exception e) {
log.error("entityToMap exception,temp:{}",temp);
} catch (Exception e) {
log.error("entityToMap exception,temp:{}", temp);
}
}
}
@ -981,15 +1011,16 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
/**
* key:itemId,value: key:columnName,中文
*/
private static Map<String,Cache<String,String>> remoteOptionCacheMap = new HashMap<>();
private static Map<String, Cache<String, String>> remoteOptionCacheMap = new HashMap<>();
private void putRemoteValue(Set<FormItemResult> conditionItemSet, String currentStaffAgencyId, Map<String, Object> map, Map<String, Object> originalConditionMap, FormItemResult e, String columnName, String vauleStr) {
try {
Map<String, IcResiUserImportServiceImpl.ColumnWrapper> columnWrappers = new HashMap<>();
if (e.getOptionSourceValue().contains(StrConstant.QUESTION_MARK)){
if (e.getOptionSourceValue().contains(StrConstant.QUESTION_MARK)) {
for (FormItemResult o : conditionItemSet) {
String column = getColumnName(o);
Object conditionValue = originalConditionMap.getOrDefault(column, map.get(column));
originalConditionMap.putIfAbsent(column,conditionValue.toString());
originalConditionMap.putIfAbsent(column, conditionValue.toString());
IcResiUserImportServiceImpl.ColumnWrapper value = new IcResiUserImportServiceImpl.ColumnWrapper();
value.setColValue(conditionValue.toString());
columnWrappers.put(o.getItemId(), value);
@ -1003,10 +1034,10 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
continue;
}*/
Cache<String, String> cache = remoteOptionCacheMap.getOrDefault(e.getItemId(), CacheBuilder.newBuilder().maximumSize(NumConstant.FIVE_HUNDRED).build());
remoteOptionCacheMap.putIfAbsent(e.getItemId(),cache);
remoteOptionCacheMap.putIfAbsent(e.getItemId(), cache);
String cacheValue = cache.getIfPresent(vauleStr);
if (StringUtils.isNotBlank(cacheValue)){
map.put(columnName,cacheValue);
if (StringUtils.isNotBlank(cacheValue)) {
map.put(columnName, cacheValue);
} else {
String[] parts = icResiUserImportService.splitOptionSourceUrl(e.getOptionSourceValue());
@ -1018,7 +1049,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
if (vauleStr.equals(value)) {
map.put(columnName, label);
}
cache.put(value,label);
cache.put(value, label);
});
}
}
@ -1048,7 +1079,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
}
private String getColumnName(FormItemResult e) {
return e.getColumnNum() == NumConstant.ZERO? e.getColumnName():e.getColumnName().concat(e.getColumnNum().toString());
return e.getColumnNum() == NumConstant.ZERO ? e.getColumnName() : e.getColumnName().concat(e.getColumnNum().toString());
}
/**
@ -1119,7 +1150,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
@Override
public List<DemandUserResDTO> queryDemandUsers(DemandUserFormDTO formDTO) {
return baseDao.selectDemandUsers(formDTO.getAgencyId(),formDTO.getGridId(),formDTO.getName());
return baseDao.selectDemandUsers(formDTO.getAgencyId(), formDTO.getGridId(), formDTO.getName());
}
/**
@ -1130,11 +1161,11 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
* @return
*/
@Override
public IcResiUserDTO getByIdCard(String customerId, String idNum,String icResiUserId) {
if(StringUtils.isBlank(idNum)&&StringUtils.isBlank(icResiUserId)){
public IcResiUserDTO getByIdCard(String customerId, String idNum, String icResiUserId) {
if (StringUtils.isBlank(idNum) && StringUtils.isBlank(icResiUserId)) {
return null;
}
return baseDao.selectIdByIdCard(customerId,idNum,icResiUserId);
return baseDao.selectIdByIdCard(customerId, idNum, icResiUserId);
}
@Override
@ -1193,40 +1224,40 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
@Override
public IcResiUserDTO get(String icResiUserId) {
IcResiUserEntity icResiUserEntity=baseDao.selectById(icResiUserId);
return ConvertUtils.sourceToTarget(icResiUserEntity,IcResiUserDTO.class);
IcResiUserEntity icResiUserEntity = baseDao.selectById(icResiUserId);
return ConvertUtils.sourceToTarget(icResiUserEntity, IcResiUserDTO.class);
}
/**
* @Description 社区查询人员预警右侧列表
* @param formDTO
* @param tokenDto
* @Description 社区查询人员预警右侧列表
* @author zxc
* @date 2022/1/17 4:25 下午
*/
@Override
public PersonWarnRightListResultDTO personWarnRightList(PersonWarnRightListFormDTO formDTO, TokenDto tokenDto) {
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId());
if (null == staffInfo){
throw new EpmetException(String.format("未查询到此工作人员信息%s",tokenDto.getUserId()));
if (null == staffInfo) {
throw new EpmetException(String.format("未查询到此工作人员信息%s", tokenDto.getUserId()));
}
Result<List<CustomerCategoryShowAndWarnListResultDTO>> configListResult = operCustomizeOpenFeignClient.getCustomerCategoryShowAndWarnList(tokenDto.getCustomerId());
if (!configListResult.success()){
if (!configListResult.success()) {
throw new EpmetException("查询居民分类配置失败...");
}
PersonWarnRightListResultDTO result = new PersonWarnRightListResultDTO();
if (CollectionUtils.isEmpty(configListResult.getData())){
if (CollectionUtils.isEmpty(configListResult.getData())) {
return result;
}
List<CustomerCategoryShowAndWarnListResultDTO> configListOrigin = configListResult.getData();
List<CustomerCategoryShowAndWarnListResultDTO> configList = new ArrayList<>();
if (StringUtils.isNotBlank(formDTO.getCategoryCode())){
if (StringUtils.isNotBlank(formDTO.getCategoryCode())) {
for (CustomerCategoryShowAndWarnListResultDTO c : configListOrigin) {
if (c.getColumnName().equals(formDTO.getCategoryCode())){
if (c.getColumnName().equals(formDTO.getCategoryCode())) {
configList.add(c);
}
}
}else {
} else {
configList = configListOrigin;
}
List<CustomerCategoryShowAndWarnListResultDTO> finalConfigList = configList;
@ -1237,8 +1268,8 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
}
result.setTotal(Integer.valueOf(String.valueOf(pageInfo.getTotal())));
List<PersonWarnRightListResultDTO.PersonWarnRightList> userList = disposeCategory(list, configList);
Result<List<HouseInfoDTO>> houseInfosResult = govOrgOpenFeignClient.queryListHouseInfo(userList.stream().distinct().map(m -> m.getHomeId()).collect(Collectors.toSet()),tokenDto.getCustomerId());
if (!houseInfosResult.success()){
Result<List<HouseInfoDTO>> houseInfosResult = govOrgOpenFeignClient.queryListHouseInfo(userList.stream().distinct().map(m -> m.getHomeId()).collect(Collectors.toSet()), tokenDto.getCustomerId());
if (!houseInfosResult.success()) {
throw new EpmetException("查询房屋信息失败...");
}
List<HouseInfoDTO> houseInfos = houseInfosResult.getData();
@ -1256,6 +1287,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
/**
* Desc: 根据房屋IDs查询房屋下是否有存在居民的
*
* @param ids
* @author zxc
* @date 2022/3/2 10:32 上午
@ -1294,7 +1326,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
Set<String> houseIds = new HashSet<>();
List<String> houseIdList = list.stream().map(EpidemicPreventionResultDTO::getHomeId).collect(Collectors.toList()).stream().distinct().collect(Collectors.toList());
houseIds.addAll(houseIdList);
Result<List<HouseInfoDTO>> houseInfoRes=govOrgOpenFeignClient.queryListHouseInfo(houseIds,formDTO.getCustomerId());
Result<List<HouseInfoDTO>> houseInfoRes = govOrgOpenFeignClient.queryListHouseInfo(houseIds, formDTO.getCustomerId());
List<HouseInfoDTO> houseInfoDTOList = houseInfoRes.success() && !CollectionUtils.isEmpty(houseInfoRes.getData()) ? houseInfoRes.getData() : new ArrayList<>();
Map<String, HouseInfoDTO> houseInfoMap = houseInfoDTOList.stream().collect(Collectors.toMap(HouseInfoDTO::getHomeId, Function.identity()));
list.forEach(item -> {
@ -1318,19 +1350,19 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
}
PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize());
List<EpidemicPreventionResultDTO> list = new ArrayList<>();
if (formDTO.getAttentionType().equals(NumConstant.TWO)){
if (formDTO.getAttentionType().equals(NumConstant.TWO)) {
list = baseDao.natList(formDTO);
}else if (formDTO.getAttentionType().equals(NumConstant.ONE)){
} else if (formDTO.getAttentionType().equals(NumConstant.ONE)) {
list = baseDao.vaccineList(formDTO);
}
Set<String> homeIds = list.stream().filter(m -> StringUtils.isNotBlank(m.getIdCard())).map(m -> m.getHomeId()).distinct().collect(Collectors.toSet());
if (CollectionUtils.isNotEmpty(homeIds)){
if (CollectionUtils.isNotEmpty(homeIds)) {
Result<List<HouseInfoDTO>> houseInfoRes = govOrgOpenFeignClient.queryListHouseInfo(homeIds, formDTO.getCustomerId());
if (!houseInfoRes.success()){
if (!houseInfoRes.success()) {
throw new EpmetException("查询居民所属房屋失败...");
}
if (CollectionUtils.isNotEmpty(houseInfoRes.getData())){
list.forEach(l -> houseInfoRes.getData().stream().filter( h -> h.getHomeId().equals(l.getHomeId())).forEach(h -> l.setHouseName(h.getAllName())));
if (CollectionUtils.isNotEmpty(houseInfoRes.getData())) {
list.forEach(l -> houseInfoRes.getData().stream().filter(h -> h.getHomeId().equals(l.getHomeId())).forEach(h -> l.setHouseName(h.getAllName())));
}
}
PageInfo<EpidemicPreventionResultDTO> pageInfo = new PageInfo<>(list);
@ -1402,31 +1434,31 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
}
/**
* @Description 居民分类 网格名 处理
* @param list
* @param configList
* @Description 居民分类 网格名 处理
* @author zxc
* @date 2022/1/18 3:22 下午
*/
public List<PersonWarnRightListResultDTO.PersonWarnRightList> disposeCategory(List<Map<String, Object>> list,List<CustomerCategoryShowAndWarnListResultDTO> configList){
public List<PersonWarnRightListResultDTO.PersonWarnRightList> disposeCategory(List<Map<String, Object>> list, List<CustomerCategoryShowAndWarnListResultDTO> configList) {
List<PersonWarnRightListResultDTO.PersonWarnRightList> userList = new ArrayList<>();
list.forEach(l -> {
PersonWarnRightListResultDTO.PersonWarnRightList dto = ConvertUtils.mapToEntity(l, PersonWarnRightListResultDTO.PersonWarnRightList.class);
// 分类名字
List<String> types = new ArrayList<>();
configList.forEach(c -> {
l.forEach((k,v) -> {
if (c.getColumnName().equals(k) && null != v && v.equals(NumConstant.ONE_STR)){
l.forEach((k, v) -> {
if (c.getColumnName().equals(k) && null != v && v.equals(NumConstant.ONE_STR)) {
types.add(c.getLabel());
}
});
});
// 只显示有类别的居民
if (CollectionUtils.isNotEmpty(types)){
if (CollectionUtils.isNotEmpty(types)) {
dto.setType(types);
GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(dto.getGridId());
if (null == gridInfo){
throw new EpmetException(String.format("查询网格信息失败%s",dto.getGridId()));
if (null == gridInfo) {
throw new EpmetException(String.format("查询网格信息失败%s", dto.getGridId()));
}
dto.setGridName(gridInfo.getGridNamePath());
userList.add(dto);
@ -1437,6 +1469,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
/**
* 查询志愿者类别options
*
* @param customerId
* @return
*/
@ -1485,7 +1518,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
OptionDataResultDTO dto = new OptionDataResultDTO();
dto.setCode(item.getValue());
dto.setLabel(item.getLabel());
dto.setValue(null == finalMap.get(item.getValue())?NumConstant.ZERO_STR:finalMap.get(item.getValue()));
dto.setValue(null == finalMap.get(item.getValue()) ? NumConstant.ZERO_STR : finalMap.get(item.getValue()));
BigDecimal radio = new BigDecimal("0.00");
if (NumConstant.ZERO != finalTotal) {
BigDecimal sum = new BigDecimal(finalTotal);
@ -1516,7 +1549,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
return new PageData<>(list, pageInfo.getTotal());
}
List<PartyMemberAgeResultDTO> list = baseDao.getPartyMemberAgeList(formDTO.getOrgType(), formDTO.getOrgId(), formDTO.getCode());
return new PageData<>(list, null == list?NumConstant.ZERO:list.size());
return new PageData<>(list, null == list ? NumConstant.ZERO : list.size());
}
/**
@ -1548,7 +1581,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
OptionDataResultDTO dto = new OptionDataResultDTO();
dto.setCode(item.getValue());
dto.setLabel(item.getLabel());
dto.setValue(null == finalMap.get(item.getValue())?NumConstant.ZERO_STR:finalMap.get(item.getValue()));
dto.setValue(null == finalMap.get(item.getValue()) ? NumConstant.ZERO_STR : finalMap.get(item.getValue()));
BigDecimal radio = new BigDecimal("0.00");
if (NumConstant.ZERO != finalTotal) {
BigDecimal sum = new BigDecimal(finalTotal);
@ -1591,7 +1624,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
item.setEducation(null == mapResult.getData().get(item.getEducation()) ? "" : mapResult.getData().get(item.getEducation()));
});
}
return new PageData<>(list, null == list?NumConstant.ZERO:list.size());
return new PageData<>(list, null == list ? NumConstant.ZERO : list.size());
}
}

23
epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserAttachmentDao.xml

@ -0,0 +1,23 @@
<?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.IcResiUserAttachmentDao">
<!-- 根据项目ID查询附件 -->
<select id="selectAttachByProjectId" resultType="com.epmet.dto.result.PublicAndInternalFileResultDTO">
SELECT
ID AS attachmentId,
FILE_NAME AS name,
ATTACHMENT_URL AS url,
ATTACHMENT_TYPE AS type,
ATTACHMENT_FORMAT AS format,
IFNULL(ATTACHMENT_SIZE,0) AS size,
IFNULL(DURATION,0) AS duration,
PROCESS_ID,
FILE_PLACE
FROM project_process_attachment
WHERE DEL_FLAG = '0'
AND PROJECT_ID = #{projectId}
order by sort
</select>
</mapper>

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

@ -307,7 +307,19 @@
AND customer_id = #{customerId}
AND id_card = #{idCard}
</select>
<select id="getResiUserByIdCard" resultType="com.epmet.dto.IcResiUserDTO">
SELECT
id,
`name`,
id_card,
mobile
FROM
ic_resi_user
WHERE
del_flag = '0'
AND customer_id = #{customerId}
AND id_card = #{idCard}
</select>
<select id="selectDemandUsers" parameterType="map" resultType="com.epmet.dto.result.DemandUserResDTO">
SELECT

Loading…
Cancel
Save