|
|
@ -14,16 +14,20 @@ import com.epmet.commons.tools.redis.common.CustomerStaffRedis; |
|
|
|
import com.epmet.commons.tools.redis.common.bean.GridInfoCache; |
|
|
|
import com.epmet.commons.tools.utils.ConvertUtils; |
|
|
|
import com.epmet.commons.tools.utils.DateUtils; |
|
|
|
import com.epmet.commons.tools.utils.Result; |
|
|
|
import com.epmet.commons.tools.utils.SpringContextUtils; |
|
|
|
import com.epmet.dao.DataSyncRecordDeathDao; |
|
|
|
import com.epmet.dao.IcResiUserDao; |
|
|
|
import com.epmet.dto.ChangeDeathDTO; |
|
|
|
import com.epmet.dto.DataSyncRecordDeathDTO; |
|
|
|
import com.epmet.dto.form.dataSync.DataSyncRecordDeathPageFormDTO; |
|
|
|
import com.epmet.entity.DataSyncRecordDeathEntity; |
|
|
|
import com.epmet.entity.IcResiUserEntity; |
|
|
|
import com.epmet.service.DataSyncRecordDeathService; |
|
|
|
import com.github.pagehelper.PageHelper; |
|
|
|
import com.github.pagehelper.PageInfo; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
@ -38,6 +42,8 @@ import java.util.Map; |
|
|
|
*/ |
|
|
|
@Service |
|
|
|
public class DataSyncRecordDeathServiceImpl extends BaseServiceImpl<DataSyncRecordDeathDao, DataSyncRecordDeathEntity> implements DataSyncRecordDeathService { |
|
|
|
@Autowired |
|
|
|
private IcResiUserDao icResiUserDao; |
|
|
|
|
|
|
|
/** |
|
|
|
* 列表查询 |
|
|
@ -124,7 +130,24 @@ public class DataSyncRecordDeathServiceImpl extends BaseServiceImpl<DataSyncReco |
|
|
|
// 已处理的跳过
|
|
|
|
continue; |
|
|
|
} |
|
|
|
entity.setDealStatus(NumConstant.ONE); |
|
|
|
try { |
|
|
|
Boolean existedFlag=true; |
|
|
|
LambdaQueryWrapper<IcResiUserEntity> queryWrapper = new LambdaQueryWrapper<>(); |
|
|
|
queryWrapper.eq(IcResiUserEntity::getIdCard, entity.getIdCard()) |
|
|
|
.eq(IcResiUserEntity::getCustomerId, entity.getCustomerId()) |
|
|
|
.eq(IcResiUserEntity::getDelFlag, NumConstant.ZERO_STR) |
|
|
|
.select(IcResiUserEntity::getId); |
|
|
|
IcResiUserEntity icResiUserEntity = icResiUserDao.selectOne(queryWrapper); |
|
|
|
if (null == icResiUserEntity) { |
|
|
|
existedFlag = false; |
|
|
|
entity.setDealStatus(NumConstant.TWO); |
|
|
|
entity.setIcResiUserId(null); |
|
|
|
entity.setDealResult("居民信息表不存在此居民"); |
|
|
|
}else{ |
|
|
|
entity.setIcResiUserId(icResiUserEntity.getId()); |
|
|
|
} |
|
|
|
if(existedFlag){ |
|
|
|
ChangeDeathDTO changeDeathDTO = new ChangeDeathDTO(); |
|
|
|
changeDeathDTO.setStaffId(userId); |
|
|
|
changeDeathDTO.setUserId(entity.getIcResiUserId()); |
|
|
@ -135,16 +158,20 @@ public class DataSyncRecordDeathServiceImpl extends BaseServiceImpl<DataSyncReco |
|
|
|
changeDeathDTO.setMobile(StrConstant.EPMETY_STR); |
|
|
|
changeDeathDTO.setDeathDate(DateUtils.stringToDate(entity.getDeathDate(), "yyyy-MM-dd")); |
|
|
|
changeDeathDTO.setJoinReason("来源于数据比对-死亡人员数据"); |
|
|
|
SpringContextUtils.getBean(ChangeDeathServiceImpl.class).save(changeDeathDTO); |
|
|
|
entity.setDealStatus(NumConstant.ONE); |
|
|
|
Result result=SpringContextUtils.getBean(ChangeDeathServiceImpl.class).save(changeDeathDTO); |
|
|
|
if(!result.success()){ |
|
|
|
entity.setDealStatus(NumConstant.TWO); |
|
|
|
entity.setDealResult("同步死亡人员返回失败"); |
|
|
|
} |
|
|
|
} |
|
|
|
} catch (EpmetException epmetException) { |
|
|
|
|
|
|
|
//0:未处理;1:处理成功;2处理失败
|
|
|
|
entity.setDealStatus(NumConstant.TWO); |
|
|
|
entity.setDealResult("系统内部异常:" + epmetException.getMsg()); |
|
|
|
|
|
|
|
epmetException.printStackTrace(); |
|
|
|
} catch (Exception e) { |
|
|
|
|
|
|
|
//0:未处理;1:处理成功;2处理失败
|
|
|
|
entity.setDealStatus(NumConstant.TWO); |
|
|
|
entity.setDealResult("未知错误"); |
|
|
|
|
|
|
|