Browse Source

新增,编辑,删除居民,更新房屋是否是党员中心户

master
yinzuomei 2 years ago
parent
commit
547f9da83d
  1. 18
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/lingshan/ConfigPartyCenterHouseFormDTO.java
  2. 10
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java
  3. 12
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java
  4. 10
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcHouseController.java
  5. 7
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcHouseService.java
  6. 19
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcHouseServiceImpl.java
  7. 40
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserImportServiceImpl.java
  8. 27
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java

18
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/lingshan/ConfigPartyCenterHouseFormDTO.java

@ -0,0 +1,18 @@
package com.epmet.dto.result.lingshan;
import lombok.Data;
/**
* @Description
* @Author yzm
* @Date 2023/5/17 12:45
*/
@Data
public class ConfigPartyCenterHouseFormDTO {
private String houseId;
/**
* 灵山项目是否党员中心户1是0不是
*/
private String partyCenterHouseFlag;
}

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

@ -6,6 +6,7 @@ import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.*;
import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
import com.epmet.dto.result.lingshan.ConfigPartyCenterHouseFormDTO;
import com.epmet.feign.fallback.GovOrgOpenFeignClientFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
@ -782,4 +783,13 @@ public interface GovOrgOpenFeignClient {
Result<List<LingShanScreenPartyObjectByTypeRstDTO>> lingshanPartyServiceCenterList(
@RequestParam(value = "objType", required = false) String objType,
@RequestParam(value = "orgId", required = false) String orgId);
/**
* 灵山项目新增居民/修改居民/删除居民/导入居民时重新更新房屋是否是党员中心户
*
* @param formDTO
* @return
*/
@PostMapping("/gov/org/ichouse/updatePartyCenterHouse")
Result updatePartyCenterHouse(@RequestBody ConfigPartyCenterHouseFormDTO formDTO);
}

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

@ -7,6 +7,7 @@ import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.*;
import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
import com.epmet.dto.result.lingshan.ConfigPartyCenterHouseFormDTO;
import com.epmet.feign.GovOrgOpenFeignClient;
import java.util.List;
@ -483,4 +484,15 @@ public class GovOrgOpenFeignClientFallback implements GovOrgOpenFeignClient {
public Result<List<LingShanScreenPartyObjectByTypeRstDTO>> lingshanPartyServiceCenterList(String objType, String orgId) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "lingshanPartyServiceCenterList", objType, orgId);
}
/**
* 灵山项目新增居民/修改居民/删除居民/导入居民时重新更新房屋是否是党员中心户
*
* @param formDTO
* @return
*/
@Override
public Result updatePartyCenterHouse(ConfigPartyCenterHouseFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "updatePartyCenterHouse", formDTO);
}
}

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

@ -218,4 +218,14 @@ public class IcHouseController {
return new Result<List<HouseTreeDTO>>().ok(icHouseService.getOrgTreeData(formDTO.getGridId()));
}
/**
* 灵山项目新增居民/修改居民/删除居民/导入居民时重新更新房屋是否是党员中心户
* @param formDTO
* @return
*/
@PostMapping("updatePartyCenterHouse")
public Result updatePartyCenterHouse(@RequestBody ConfigPartyCenterHouseFormDTO formDTO){
icHouseService.updatePartyCenterHouse(formDTO.getHouseId(),formDTO.getPartyCenterHouseFlag());
return new Result();
}
}

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

@ -176,4 +176,11 @@ public interface IcHouseService extends BaseService<IcHouseEntity> {
* @return
*/
List<HouseTreeDTO> getOrgTreeData(String gridId);
/**
* 更新房屋是否是党员中心户
* @param houseId
* @param partyCenterHouseFlag
*/
void updatePartyCenterHouse(String houseId, String partyCenterHouseFlag);
}

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

@ -1,6 +1,7 @@
package com.epmet.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.NumConstant;
@ -452,8 +453,6 @@ public class IcHouseServiceImpl extends BaseServiceImpl<IcHouseDao, IcHouseEntit
String gridIdPath=PidUtils.convertPid2OrgIdPath(gridDTO.getId(), gridDTO.getPids());
// 先删除
LambdaQueryWrapper<LingshanPartyCenterHouseLianhuEntity> queryWrapper=new LambdaQueryWrapper<>();
queryWrapper.eq(LingshanPartyCenterHouseLianhuEntity::getPartyCenterHouseId,partyCenterHouseId);
partyCenterHouseLianhuDao.deleteByPartyCenterHouseId(partyCenterHouseId);
// 后插入
lianHuHouseList.forEach(lianHuHouse->{
@ -534,6 +533,22 @@ public class IcHouseServiceImpl extends BaseServiceImpl<IcHouseDao, IcHouseEntit
return resultList;
}
/**
* 更新房屋是否是党员中心户
*
* @param houseId
* @param partyCenterHouseFlag:是否党员中心户1是0不是
*/
@Override
public void updatePartyCenterHouse(String houseId, String partyCenterHouseFlag) {
LambdaUpdateWrapper<IcHouseEntity> update = new LambdaUpdateWrapper<>();
update.set(IcHouseEntity::getPartyCenterHouseFlag, partyCenterHouseFlag).eq(IcHouseEntity::getId, houseId);
baseDao.update(null, update);
if(NumConstant.ZERO_STR.equals(partyCenterHouseFlag)){
//房屋如果不是党员中心户,自动删除绑定的联户
partyCenterHouseLianhuDao.deleteByPartyCenterHouseId(houseId);
}
}
}

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

@ -6,7 +6,6 @@ import cn.afterturn.easypoi.excel.entity.ExportParams;
import cn.hutool.core.bean.BeanUtil;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.EasyExcelFactory;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import com.epmet.bean.ResiImportCategoryData;
@ -14,6 +13,7 @@ import com.epmet.bean.ResiImportChangedData;
import com.epmet.bean.ResiImportResiCategoryChangedCache;
import com.epmet.commons.rocketmq.messages.PartymemberSyncMQMsg;
import com.epmet.commons.tools.constant.AppClientConstant;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
@ -41,6 +41,7 @@ import com.epmet.dto.form.HouseFormDTO;
import com.epmet.dto.form.IcResiUserOrgMsgFormDTO;
import com.epmet.dto.form.ImportTaskCommonFormDTO;
import com.epmet.dto.result.*;
import com.epmet.dto.result.lingshan.ConfigPartyCenterHouseFormDTO;
import com.epmet.entity.*;
import com.epmet.enums.IcResiUserTableEnum;
import com.epmet.excel.handler.IcResiImportDynamicExcelListener;
@ -61,6 +62,7 @@ import org.apache.commons.lang3.StringUtils;
import org.apache.http.entity.ContentType;
import org.apache.poi.ss.usermodel.Workbook;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.commons.CommonsMultipartFile;
@ -2299,4 +2301,40 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res
importTaskId, processStatus, operatorId, resultDesc, resultDescPath);
}
}
/**
* 灵山需求
* @param houseId 房屋id
*/
@Async
public void syncHousePartyCenterHouse(String houseId,String resiUserId) {
if(StringUtils.isBlank(houseId)){
IcResiUserEntity entity=icResiUserDao.selectById(resiUserId);
houseId=entity.getHomeId();
}
// 查询房屋里的所有人
LambdaQueryWrapper<IcResiUserEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(IcResiUserEntity::getHomeId, houseId)
.eq(IcResiUserEntity::getStatus, NumConstant.ZERO_STR)
.select(IcResiUserEntity::getId);
List<IcResiUserEntity> resiList = icResiUserDao.selectList(wrapper);
//默认该房屋不是党员中心户
ConfigPartyCenterHouseFormDTO configPartyCenterHouseFormDTO=new ConfigPartyCenterHouseFormDTO();
configPartyCenterHouseFormDTO.setHouseId(houseId);
configPartyCenterHouseFormDTO.setPartyCenterHouseFlag(NumConstant.ZERO_STR);
if(CollectionUtils.isNotEmpty(resiList)){
List<String> resiIds = resiList.stream().map(IcResiUserEntity::getId).collect(Collectors.toList());
// 是否有党员中心户
LambdaQueryWrapper<IcPartyMemberEntity> queryWrapper = new LambdaQueryWrapper();
queryWrapper.in(IcPartyMemberEntity::getIcResiUser, resiIds)
.eq(IcPartyMemberEntity::getIsDyzxh, NumConstant.ONE_STR);
List<IcPartyMemberEntity> dyzxhList = icPartyMemberDao.selectList(queryWrapper);
if (CollectionUtils.isNotEmpty(dyzxhList)) {
configPartyCenterHouseFormDTO.setPartyCenterHouseFlag(NumConstant.ONE_STR);
}
}
govOrgOpenFeignClient.updatePartyCenterHouse(configPartyCenterHouseFormDTO);
}
}

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

@ -61,6 +61,7 @@ import com.epmet.dto.form.demand.UserDemandNameQueryFormDTO;
import com.epmet.dto.result.*;
import com.epmet.dto.result.demand.IcResiDemandDictDTO;
import com.epmet.dto.result.demand.OptionDTO;
import com.epmet.dto.result.lingshan.ConfigPartyCenterHouseFormDTO;
import com.epmet.dto.result.resi.IcResiNonDynamicResultDTO;
import com.epmet.entity.*;
import com.epmet.enums.RenHuConditionEnum;
@ -132,8 +133,8 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
private UserService userService;
@Autowired
private EpmetAdminOpenFeignClient epmetAdminOpenFeignClient;
@Autowired
private IcResiUserDao icResiUserDao;
// @Autowired
// private IcResiUserDao icResiUserDao;
@Autowired
private IcUserChangeRecordService icUserChangeRecordService;
@Autowired
@ -169,8 +170,8 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
@Resource
private IcUserChangeDetailedDao icUserChangeDetailedDao;
@Autowired
private DataReportOpenFeignClient dataReportOpenFeignClient;
// @Autowired
// private DataReportOpenFeignClient dataReportOpenFeignClient;
@Autowired
private IcResiRentContractInfoDao icResiRentContractInfoDao;
@ -200,6 +201,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(DelIcResiUserFormDTO formDTO) {
IcResiUserEntity origin=baseDao.selectById(formDTO.getIcResiUserId());
baseDao.updateToDel(formDTO.getIcResiUserId(),formDTO.getCurrentStaffId());
CustomerFormQueryDTO queryDTO = ConvertUtils.sourceToTarget(formDTO, CustomerFormQueryDTO.class);
Result<Set<String>> subTableRes = operCustomizeOpenFeignClient.queryIcResiSubTables(queryDTO);
@ -217,6 +219,8 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
SpringContextUtils.getBean(DataSyncRecordDisabilityService.class).deleteByIcResiUserId(formDTO.getIcResiUserId());
SpringContextUtils.getBean(DataSyncRecordDeathService.class).deleteByIcResiUserId(formDTO.getIcResiUserId());
}
//灵山需求:如果放屋里的人,有党员中心户, 将ic_house.party_center_house_flag置为1,说明该房屋是党员中心户
icResiUserImportService.syncHousePartyCenterHouse(origin.getHomeId(),null);
}
/**
@ -232,7 +236,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
LambdaQueryWrapper<IcResiUserEntity> resiWrapper=new LambdaQueryWrapper<>();
resiWrapper.eq(IcResiUserEntity::getAgencyId,formDTO.getAgencyId());
resiWrapper.select(IcResiUserEntity::getId);
List<IcResiUserEntity> resiIds=icResiUserDao.selectList(resiWrapper);
List<IcResiUserEntity> resiIds=baseDao.selectList(resiWrapper);
for(IcResiUserEntity entity:resiIds){
baseDao.updateToDel(entity.getId(),formDTO.getCurrentStaffId());
CustomerFormQueryDTO queryDTO = ConvertUtils.sourceToTarget(formDTO, CustomerFormQueryDTO.class);
@ -448,7 +452,8 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
}
//3.变更记录表和变更记录明细表新增数据
saveUserChangeRecord(tokenDto, map, resiUserId, name);
//灵山需求:如果放屋里的人,有党员中心户, 将ic_house.party_center_house_flag置为1,说明该房屋是党员中心户
icResiUserImportService.syncHousePartyCenterHouse(null,resiUserId);
return resiUserId;
}
@ -787,6 +792,8 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
}
}
CustomerResiUserRedis.delIcResiUserInfo(resiUserId);
//灵山需求:如果放屋里的人,有党员中心户, 将ic_house.party_center_house_flag置为1,说明该房屋是党员中心户
icResiUserImportService.syncHousePartyCenterHouse(entity.getHomeId(),null);
return resiUserId;
}
@ -831,7 +838,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
}
//修改前数据库居民十八类信息值
List<String> columns = categoryListResult.getData().stream().map(IcResiCategoryStatsConfigDTO::getColumnName).collect(Collectors.toList());
Map<String, String> hash = icResiUserDao.getCategoryListMap(columns, entity.getId());
Map<String, String> hash = baseDao.getCategoryListMap(columns, entity.getId());
//封装变更记录和变更明细数据
//变更记录
IcUserChangeRecordEntity changeRecordEntity = new IcUserChangeRecordEntity();
@ -1685,7 +1692,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
r.setVillageName(neighborHood.getNeighborHoodName());
// 2.志愿者类型填充
List<String> volunteers = icResiUserDao.selectVolunteerByUserId(resiEntity.getId());
List<String> volunteers = baseDao.selectVolunteerByUserId(resiEntity.getId());
if (CollectionUtils.isNotEmpty(volunteers)) {
String[] vCategories = volunteers.get(0).split(",");
@ -1702,7 +1709,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
ArrayList<String> resiCategoryNames = new ArrayList<>();
Map<String, String> categories = icResiUserDao.getCategoryListMap(resiCategoryColumns, resiUserId);
Map<String, String> categories = baseDao.getCategoryListMap(resiCategoryColumns, resiUserId);
categories.forEach((k, v) -> {
if (NumConstant.ONE_STR.equals(v)) {
ResiCategoryEnum enumObject = ResiCategoryEnum.getEnum(k);
@ -2832,7 +2839,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
@Override
public Result editMember(IcResiUserConfirmSubmitDTO dto) {
IcResiUserEntity user = icResiUserDao.selectById(dto.getIcResiUserId());
IcResiUserEntity user = baseDao.selectById(dto.getIcResiUserId());
LambdaQueryWrapper<IcResiUserEntity> userWrapper = new LambdaQueryWrapper<>();
userWrapper.ne(IcResiUserEntity::getId, dto.getIcResiUserId());

Loading…
Cancel
Save