Browse Source

等会再改

master
yinzuomei 2 years ago
parent
commit
d9a8ce711a
  1. 36
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserImportServiceImpl.java
  2. 41
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java

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

@ -2301,40 +2301,4 @@ 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);
}
}

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

@ -87,6 +87,7 @@ import org.apache.commons.lang3.StringUtils;
import org.jetbrains.annotations.NotNull;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -220,7 +221,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
SpringContextUtils.getBean(DataSyncRecordDeathService.class).deleteByIcResiUserId(formDTO.getIcResiUserId());
}
//灵山需求:如果放屋里的人,有党员中心户, 将ic_house.party_center_house_flag置为1,说明该房屋是党员中心户
icResiUserImportService.syncHousePartyCenterHouse(origin.getHomeId(),null);
syncHousePartyCenterHouse(origin.getHomeId(),null);
}
/**
@ -453,7 +454,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
//3.变更记录表和变更记录明细表新增数据
saveUserChangeRecord(tokenDto, map, resiUserId, name);
//灵山需求:如果放屋里的人,有党员中心户, 将ic_house.party_center_house_flag置为1,说明该房屋是党员中心户
icResiUserImportService.syncHousePartyCenterHouse(null,resiUserId);
syncHousePartyCenterHouse(null,resiUserId);
return resiUserId;
}
@ -793,7 +794,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
}
CustomerResiUserRedis.delIcResiUserInfo(resiUserId);
//灵山需求:如果放屋里的人,有党员中心户, 将ic_house.party_center_house_flag置为1,说明该房屋是党员中心户
icResiUserImportService.syncHousePartyCenterHouse(entity.getHomeId(),null);
syncHousePartyCenterHouse(entity.getHomeId(),null);
return resiUserId;
}
@ -3919,4 +3920,38 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
return fzBig.multiply(NumConstant.ONE_HUNDRED_DECIMAL).divide(totalBig, NumConstant.TWO, BigDecimal.ROUND_HALF_UP);
}
/**
* 灵山需求
* @param houseId 房屋id
*/
public void syncHousePartyCenterHouse(String houseId,String resiUserId) {
if(StringUtils.isBlank(houseId)){
IcResiUserEntity entity=baseDao.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 = baseDao.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);
}
}

Loading…
Cancel
Save