|
|
|
@ -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,6 +42,7 @@ 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.stereotype.Service; |
|
|
|
@ -97,14 +99,25 @@ 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 ? "男" : "女"); |
|
|
|
} |
|
|
|
if(StringUtils.isBlank(entity.getIcResiUserId())){ |
|
|
|
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "icResiUserId为空,idCard:" + entity.getIdCard(), |
|
|
|
String.format("居民信息中不存在此居民【身份证号:%s】", entity.getIdCard())); |
|
|
|
} |
|
|
|
IcResiUserDTO icResiUserDTO = icResiUserService.get(entity.getIcResiUserId()); |
|
|
|
ResiInfoDTO resiInfoDTO = ConvertUtils.sourceToTarget(icResiUserDTO, ResiInfoDTO.class); |
|
|
|
resiInfoDTO.setGenderCn(resiInfoDTO.getGender().equals(NumConstant.ONE_STR) ? "男" : "女"); |
|
|
|
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); |
|
|
|
@ -145,7 +158,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 |
|
|
|
|