|
|
@ -5,8 +5,11 @@ import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
|
|
|
import com.epmet.commons.tools.constant.FieldConstant; |
|
|
|
import com.epmet.commons.tools.constant.NumConstant; |
|
|
|
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; |
|
|
|
import com.epmet.commons.tools.enums.IcResiUserSubStatusEnum; |
|
|
|
import com.epmet.commons.tools.page.PageData; |
|
|
|
import com.epmet.commons.tools.redis.common.CustomerStaffRedis; |
|
|
|
import com.epmet.commons.tools.security.dto.TokenDto; |
|
|
|
import com.epmet.commons.tools.security.user.LoginUserUtil; |
|
|
|
import com.epmet.commons.tools.utils.ConvertUtils; |
|
|
|
import com.epmet.commons.tools.utils.DateUtils; |
|
|
@ -17,18 +20,19 @@ import com.epmet.commons.tools.validator.group.DefaultGroup; |
|
|
|
import com.epmet.commons.tools.validator.group.UpdateGroup; |
|
|
|
import com.epmet.constant.IcResiUserConstant; |
|
|
|
import com.epmet.dao.ChangeDeathDao; |
|
|
|
import com.epmet.dao.IcResiUserDao; |
|
|
|
import com.epmet.dto.ChangeDeathDTO; |
|
|
|
import com.epmet.dto.ChangeWelfareDTO; |
|
|
|
import com.epmet.dto.form.IcResiUserTransferFormDTO; |
|
|
|
import com.epmet.dto.form.OnlyIdFormDTO; |
|
|
|
import com.epmet.dto.form.RentTenantDataFormDTO; |
|
|
|
import com.epmet.dto.result.RentTenantDataResultDTO; |
|
|
|
import com.epmet.entity.ChangeDeathEntity; |
|
|
|
import com.epmet.entity.ChangeRelocationEntity; |
|
|
|
import com.epmet.entity.IcResiUserEntity; |
|
|
|
import com.epmet.entity.IcUserChangeRecordEntity; |
|
|
|
import com.epmet.redis.ChangeDeathRedis; |
|
|
|
import com.epmet.service.ChangeDeathService; |
|
|
|
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; |
|
|
@ -65,6 +69,11 @@ public class ChangeDeathServiceImpl extends BaseServiceImpl<ChangeDeathDao, Chan |
|
|
|
@Autowired |
|
|
|
private ChangeRelocationServiceImpl changeRelocationServiceImpl; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private IcResiUserDao icResiUserDao; |
|
|
|
@Autowired |
|
|
|
private IcUserChangeRecordService icUserChangeRecordService; |
|
|
|
|
|
|
|
@Override |
|
|
|
public PageData<ChangeDeathDTO> page(Map<String, Object> params) { |
|
|
|
params.put("customerId", loginUserUtil.getLoginUserCustomerId()); |
|
|
@ -201,4 +210,34 @@ public class ChangeDeathServiceImpl extends BaseServiceImpl<ChangeDeathDao, Chan |
|
|
|
baseDao.deleteBatchIds(Arrays.asList(ids)); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public void recovery(TokenDto tokenDto, OnlyIdFormDTO dto) { |
|
|
|
|
|
|
|
// 更新用户基础信息用户状态信息
|
|
|
|
ChangeDeathEntity changeDeathEntity = baseDao.selectById(dto.getId()); |
|
|
|
IcResiUserEntity icResiUserEntity = icResiUserDao.selectById(changeDeathEntity.getUserId()); |
|
|
|
icResiUserEntity.setStatus("0"); |
|
|
|
icResiUserEntity.setSubStatus("52"); |
|
|
|
icResiUserDao.updateById(icResiUserEntity); |
|
|
|
|
|
|
|
// 添加迁出恢复记录
|
|
|
|
CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId()); |
|
|
|
IcUserChangeRecordEntity changeRecordEntity = new IcUserChangeRecordEntity(); |
|
|
|
changeRecordEntity.setCustomerId(tokenDto.getCustomerId()); |
|
|
|
changeRecordEntity.setOperatorId(tokenDto.getUserId()); |
|
|
|
changeRecordEntity.setIcUserId(icResiUserEntity.getId()); |
|
|
|
changeRecordEntity.setOperatorName(staffInfoCache.getRealName()); |
|
|
|
changeRecordEntity.setIcUserName(icResiUserEntity.getName()); |
|
|
|
changeRecordEntity.setType("recovery_death"); |
|
|
|
changeRecordEntity.setTypeName("恢复死亡"); |
|
|
|
changeRecordEntity.setBeforeChangeName("-"); |
|
|
|
changeRecordEntity.setAfterChangeName("-"); |
|
|
|
changeRecordEntity.setChangeTime(new java.util.Date()); |
|
|
|
icUserChangeRecordService.insert(changeRecordEntity); |
|
|
|
|
|
|
|
// 清除迁出表数据
|
|
|
|
baseDao.deleteById(dto.getId()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|