|
|
@ -10,6 +10,7 @@ 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.constant.StrConstant; |
|
|
|
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; |
|
|
|
import com.epmet.commons.tools.enums.GenderEnum; |
|
|
|
import com.epmet.commons.tools.exception.EpmetErrorCode; |
|
|
@ -41,8 +42,10 @@ import com.github.pagehelper.PageHelper; |
|
|
|
import com.github.pagehelper.PageInfo; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.apache.commons.collections4.CollectionUtils; |
|
|
|
import org.apache.commons.collections4.MapUtils; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.scheduling.annotation.Async; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
@ -97,17 +100,30 @@ public class DataSyncRecordDisabilityServiceImpl extends BaseServiceImpl<DataSyn |
|
|
|
@Override |
|
|
|
public DataSyncRecordDisabilityDTO get(String id) { |
|
|
|
DataSyncRecordDisabilityEntity entity = baseDao.selectById(id); |
|
|
|
if (null == entity) { |
|
|
|
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "data_sync_record_disability记录不存在,id:" + id, "记录不存在"); |
|
|
|
} |
|
|
|
DataSyncRecordDisabilityDTO result = ConvertUtils.sourceToTarget(entity, DataSyncRecordDisabilityDTO.class); |
|
|
|
result.setGenderCn(GenderEnum.UN_KNOWN.getName()); |
|
|
|
if (null != result.getGender()){ |
|
|
|
result.setGenderCn(result.getGender() == NumConstant.ONE ? "男" : "女"); |
|
|
|
} |
|
|
|
IcResiUserDTO icResiUserDTO = icResiUserService.get(entity.getIcResiUserId()); |
|
|
|
ResiInfoDTO resiInfoDTO = ConvertUtils.sourceToTarget(icResiUserDTO, ResiInfoDTO.class); |
|
|
|
resiInfoDTO.setGenderCn(resiInfoDTO.getGender().equals(NumConstant.ONE_STR) ? "男" : "女"); |
|
|
|
resiInfoDTO.setCjzkCn(getCj(resiInfoDTO.getCjzk())); |
|
|
|
resiInfoDTO.setCjlbCn(getCjlb(resiInfoDTO.getCjlb(),entity.getCustomerId())); |
|
|
|
result.setResiInfo(resiInfoDTO); |
|
|
|
if (StringUtils.isNotBlank(entity.getIcResiUserId())) { |
|
|
|
IcResiUserDTO icResiUserDTO = icResiUserService.get(entity.getIcResiUserId()); |
|
|
|
if (null != icResiUserDTO) { |
|
|
|
ResiInfoDTO resiInfoDTO = ConvertUtils.sourceToTarget(icResiUserDTO, ResiInfoDTO.class); |
|
|
|
if (StringUtils.isNotBlank(resiInfoDTO.getGender())) { |
|
|
|
resiInfoDTO.setGenderCn(resiInfoDTO.getGender().equals(NumConstant.ONE_STR) ? "男" : "女"); |
|
|
|
} else { |
|
|
|
resiInfoDTO.setGenderCn(GenderEnum.UN_KNOWN.getName()); |
|
|
|
} |
|
|
|
resiInfoDTO.setCjzkCn(getCj(resiInfoDTO.getCjzk())); |
|
|
|
resiInfoDTO.setCjlbCn(getCjlb(resiInfoDTO.getCjlb(), entity.getCustomerId())); |
|
|
|
result.setResiInfo(resiInfoDTO); |
|
|
|
} else { |
|
|
|
log.warn(String.format("ic_resi_user is null icResiUserId:%s", entity.getIcResiUserId())); |
|
|
|
} |
|
|
|
} |
|
|
|
return result; |
|
|
|
} |
|
|
|
|
|
|
@ -145,7 +161,10 @@ public class DataSyncRecordDisabilityServiceImpl extends BaseServiceImpl<DataSyn |
|
|
|
throw new EpmetException("operCustomizeOpenFeignClient.getOptionsMap执行失败"); |
|
|
|
} |
|
|
|
Map<String, String> data = cjlbOptionsMap.getData(); |
|
|
|
return data.get(cjlb); |
|
|
|
if(MapUtils.isNotEmpty(data)&&data.containsKey(cjlb)){ |
|
|
|
return data.get(cjlb); |
|
|
|
} |
|
|
|
return StrConstant.EPMETY_STR; |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
@ -307,4 +326,14 @@ public class DataSyncRecordDisabilityServiceImpl extends BaseServiceImpl<DataSyn |
|
|
|
baseDao.batchUpdateDisability(entities); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 删除居民信息时,同时删除data_sync_record_disability |
|
|
|
* |
|
|
|
* @param icResiUserId |
|
|
|
*/ |
|
|
|
@Async |
|
|
|
@Override |
|
|
|
public void deleteByIcResiUserId(String icResiUserId) { |
|
|
|
baseDao.deleteByIcResiUserId(icResiUserId); |
|
|
|
} |
|
|
|
} |
|
|
|