|
|
@ -10,6 +10,8 @@ import com.epmet.commons.tools.enums.IcResiUserSubStatusEnum; |
|
|
|
import com.epmet.commons.tools.exception.EpmetErrorCode; |
|
|
|
import com.epmet.commons.tools.exception.EpmetException; |
|
|
|
import com.epmet.commons.tools.page.PageData; |
|
|
|
import com.epmet.commons.tools.redis.common.CustomerIcHouseRedis; |
|
|
|
import com.epmet.commons.tools.redis.common.bean.HouseInfoCache; |
|
|
|
import com.epmet.commons.tools.security.user.LoginUserUtil; |
|
|
|
import com.epmet.commons.tools.utils.ConvertUtils; |
|
|
|
import com.epmet.commons.tools.utils.Result; |
|
|
@ -32,10 +34,7 @@ import com.epmet.entity.ChangeRelocationEntity; |
|
|
|
import com.epmet.entity.IcResiUserEntity; |
|
|
|
import com.epmet.feign.EpmetMessageOpenFeignClient; |
|
|
|
import com.epmet.redis.ChangeRelocationRedis; |
|
|
|
import com.epmet.service.ChangeRelocationService; |
|
|
|
import com.epmet.service.ChangeWelfareService; |
|
|
|
import com.epmet.service.IcResiUserService; |
|
|
|
import com.epmet.service.IcUserTransferRecordService; |
|
|
|
import com.epmet.service.*; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
@ -44,6 +43,7 @@ import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
import javax.annotation.Resource; |
|
|
|
import java.util.Arrays; |
|
|
|
import java.util.Date; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Map; |
|
|
|
|
|
|
@ -76,6 +76,8 @@ public class ChangeRelocationServiceImpl extends BaseServiceImpl<ChangeRelocatio |
|
|
|
private IcResiUserService icResiUserService; |
|
|
|
@Resource |
|
|
|
private IcUserTransferRecordService icUserTransferRecordService; |
|
|
|
@Resource |
|
|
|
private IcResiUserConfirmService icResiUserConfirmService; |
|
|
|
|
|
|
|
@Override |
|
|
|
public PageData<ChangeRelocationDTO> page(Map<String, Object> params) { |
|
|
@ -279,6 +281,67 @@ public class ChangeRelocationServiceImpl extends BaseServiceImpl<ChangeRelocatio |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 从家庭中移除 |
|
|
|
* |
|
|
|
* @param dto |
|
|
|
* @Param dto |
|
|
|
* @Return |
|
|
|
* @Author zhaoqifeng |
|
|
|
* @Date 2022/6/27 10:52 |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public void moveOutHomeConfirm(ChangeRelocationDTO dto) { |
|
|
|
if (NumConstant.ONE_STR.equals(dto.getIsMoveOut())) { |
|
|
|
//需要迁至其他房屋,走变更流程
|
|
|
|
//获取居民信息
|
|
|
|
IcResiUserDTO userInfo = icResiUserService.get(dto.getIcUserId()); |
|
|
|
if (null == userInfo) { |
|
|
|
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "居民信息不存在", "居民信息不存在"); |
|
|
|
} |
|
|
|
//组织内走变更流程
|
|
|
|
IcResiUserTransferFormDTO formDTO = new IcResiUserTransferFormDTO(); |
|
|
|
formDTO.setIcUserId(dto.getIcUserId()); |
|
|
|
formDTO.setType("in"); |
|
|
|
formDTO.setNewAgencyId(userInfo.getAgencyId()); |
|
|
|
formDTO.setNewGridId(dto.getGridId()); |
|
|
|
formDTO.setNewNeighborHoodId(dto.getVillageId()); |
|
|
|
formDTO.setNewBuildingId(dto.getBuildId()); |
|
|
|
formDTO.setNewBuildingUnitId(dto.getUnitId()); |
|
|
|
formDTO.setNewHouseId(dto.getHomeId()); |
|
|
|
formDTO.setTransferTime(dto.getTransferTime()); |
|
|
|
formDTO.setIdEdit(false); |
|
|
|
formDTO.setCustomerId(dto.getCustomerId()); |
|
|
|
formDTO.setStaffId(dto.getStaffId()); |
|
|
|
icUserTransferRecordService.add(formDTO); |
|
|
|
//更改房屋
|
|
|
|
IcResiUserEntity uerEntity = new IcResiUserEntity(); |
|
|
|
uerEntity.setId(dto.getIcUserId()); |
|
|
|
uerEntity.setGridId(dto.getGridId()); |
|
|
|
uerEntity.setVillageId(dto.getVillageId()); |
|
|
|
uerEntity.setBuildId(dto.getBuildId()); |
|
|
|
uerEntity.setUnitId(dto.getUnitId()); |
|
|
|
uerEntity.setHomeId(dto.getHomeId()); |
|
|
|
icResiUserService.updateById(uerEntity); |
|
|
|
} else { |
|
|
|
//不需要迁至其他房屋,直接变游离状态
|
|
|
|
IcResiUserEntity userEntity = icResiUserService.selectById(dto.getIcUserId()); |
|
|
|
//获取房屋信息
|
|
|
|
HouseInfoCache houseInfo = CustomerIcHouseRedis.getHouseInfo(dto.getCustomerId(), userEntity.getHomeId()); |
|
|
|
if (null == houseInfo) { |
|
|
|
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取房屋信息失败", "获取房屋信息失败"); |
|
|
|
} |
|
|
|
dto.setOldDept(houseInfo.getGridName()); |
|
|
|
dto.setOldAddress(houseInfo.getAllName()); |
|
|
|
dto.setOldHome(houseInfo.getDoorName()); |
|
|
|
dto.setType("out"); |
|
|
|
dto.setOutOfTime(new Date()); |
|
|
|
dto.setAddress("其他"); |
|
|
|
dto.setReason("移除"); |
|
|
|
this.saveOutOfInfo(dto); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public void editResiMq(String customerId, String userId) { |
|
|
|
//推送MQ事件
|
|
|
|
IcResiUserAddMQMsg mqMsg = new IcResiUserAddMQMsg(); |
|
|
|