|
|
@ -4,18 +4,27 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
|
|
|
import com.epmet.commons.tools.constant.NumConstant; |
|
|
|
import com.epmet.commons.tools.constant.StrConstant; |
|
|
|
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; |
|
|
|
import com.epmet.commons.tools.exception.EpmetException; |
|
|
|
import com.epmet.commons.tools.page.PageData; |
|
|
|
import com.epmet.commons.tools.redis.common.CustomerStaffRedis; |
|
|
|
import com.epmet.commons.tools.utils.ConvertUtils; |
|
|
|
import com.epmet.commons.tools.constant.FieldConstant; |
|
|
|
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.DataSyncRecordMaritalDao; |
|
|
|
import com.epmet.dao.IcResiUserDao; |
|
|
|
import com.epmet.dto.ChangeDeathDTO; |
|
|
|
import com.epmet.dto.DataSyncRecordDeathDTO; |
|
|
|
import com.epmet.dto.DataSyncRecordMaritalDTO; |
|
|
|
import com.epmet.dto.form.dataSync.DataSyncRecordMaritalPageFormDTO; |
|
|
|
import com.epmet.dto.result.DataSyncRecordMaritalPageResultDTO; |
|
|
|
import com.epmet.entity.DataSyncRecordDeathEntity; |
|
|
|
import com.epmet.entity.DataSyncRecordMaritalEntity; |
|
|
|
import com.epmet.entity.IcResiUserEntity; |
|
|
|
import com.epmet.service.DataSyncRecordMaritalService; |
|
|
|
import com.github.pagehelper.PageHelper; |
|
|
|
import com.github.pagehelper.PageInfo; |
|
|
@ -38,6 +47,9 @@ import java.util.Map; |
|
|
|
@Service |
|
|
|
public class DataSyncRecordMaritalServiceImpl extends BaseServiceImpl<DataSyncRecordMaritalDao, DataSyncRecordMaritalEntity> implements DataSyncRecordMaritalService { |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private IcResiUserDao icResiUserDao; |
|
|
|
|
|
|
|
@Override |
|
|
|
public PageData<DataSyncRecordMaritalPageResultDTO> page(DataSyncRecordMaritalPageFormDTO formDTO) { |
|
|
|
|
|
|
@ -100,5 +112,59 @@ public class DataSyncRecordMaritalServiceImpl extends BaseServiceImpl<DataSyncRe |
|
|
|
return ConvertUtils.sourceToTarget(entity, DataSyncRecordMaritalDTO.class); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public void batchUpdate(String userId, String customerId, List<String> ids) { |
|
|
|
for (String id : ids) { |
|
|
|
DataSyncRecordMaritalEntity entity = baseDao.selectById(id); |
|
|
|
if (NumConstant.ONE == entity.getDealStatus() || StringUtils.isBlank(entity.getIcResiUserId())) { |
|
|
|
// 已处理的跳过
|
|
|
|
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){ |
|
|
|
//IA:结婚','结婚',if(d.MARITAL_STATUS_NAME = 'IB:离婚
|
|
|
|
if (entity.getMaritalStatusName().equals("IA:结婚")){ |
|
|
|
icResiUserEntity.setHyzk("chuhun"); |
|
|
|
}else if (entity.getMaritalStatusName().equals("IB:离婚")){ |
|
|
|
icResiUserEntity.setHyzk("lihun"); |
|
|
|
}else{ |
|
|
|
icResiUserEntity.setHyzk("weihun"); |
|
|
|
} |
|
|
|
icResiUserDao.updateById(icResiUserEntity); |
|
|
|
} |
|
|
|
} 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("未知错误"); |
|
|
|
|
|
|
|
e.printStackTrace(); |
|
|
|
} finally { |
|
|
|
baseDao.updateById(entity); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |