|
|
@ -5,6 +5,7 @@ import com.alibaba.excel.read.listener.ReadListener; |
|
|
|
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.dto.result.YtHscyResDTO; |
|
|
|
import com.epmet.commons.tools.dto.result.YtHsjcResDTO; |
|
|
|
import com.epmet.commons.tools.dto.result.YtHsjcResDetailDTO; |
|
|
|
import com.epmet.commons.tools.enums.EnvEnum; |
|
|
@ -84,10 +85,24 @@ public class IcNatCompareRecordExcelImportListener implements ReadListener<IcNat |
|
|
|
// 开发和测试没法测试,只能写死只有生产才去调用了 烟台客户id:1535072605621841922
|
|
|
|
EnvEnum currentEnv = EnvEnum.getCurrentEnv(); |
|
|
|
if (EnvEnum.PROD.getCode().equals(currentEnv.getCode()) && "1535072605621841922".equals(customerId)) { |
|
|
|
//先查询最后一次采样记录
|
|
|
|
YtHscyResDTO hscyResDTO=YtHsResUtils.hscy(data.getIdCard(),1,1); |
|
|
|
if(CollectionUtils.isNotEmpty(hscyResDTO.getData())){ |
|
|
|
//存在 最近一条采样记录
|
|
|
|
YtHscyResDTO.YtHscyResDetail cyDetail=hscyResDTO.getData().get(0); |
|
|
|
if (null != cyDetail) { |
|
|
|
if(StringUtils.isBlank(cyDetail.getCreate_time())){ |
|
|
|
compareRecordEntity.setInternalRemark("create_time is null"); |
|
|
|
}else{ |
|
|
|
//赋值采样时间
|
|
|
|
compareRecordEntity.setLatestCyTime(DateUtils.parse(cyDetail.getCreate_time(),DateUtils.DATE_TIME_PATTERN)); |
|
|
|
// 调用烟台api获取核酸检测结果
|
|
|
|
YtHsjcResDTO hsjcResDTO = YtHsResUtils.hsjc(data.getIdCard(), 1, 1); |
|
|
|
if (null != hsjcResDTO && CollectionUtils.isNotEmpty(hsjcResDTO.getData()) && null != hsjcResDTO.getData().get(0)) { |
|
|
|
YtHsjcResDetailDTO ytHsjcResDetailDTO = hsjcResDTO.getData().get(0); |
|
|
|
//最近一次采样时间,与最近一次检测结果的采样时间相比较
|
|
|
|
if(compareRecordEntity.getLatestCyTime().equals(ytHsjcResDetailDTO.getSample_time())){ |
|
|
|
// 一致说明出结果了
|
|
|
|
String testTime = ytHsjcResDetailDTO.getTest_time(); |
|
|
|
if (StringUtils.isNotBlank(testTime)) { |
|
|
|
// 赋值最近一次核酸时间
|
|
|
@ -105,6 +120,19 @@ public class IcNatCompareRecordExcelImportListener implements ReadListener<IcNat |
|
|
|
compareRecordEntity.setNatResult(NumConstant.ZERO_STR); |
|
|
|
} |
|
|
|
compareRecordEntity.setContactAddress(StringUtils.isNotBlank(ytHsjcResDetailDTO.getAddress()) ? ytHsjcResDetailDTO.getAddress() : StrConstant.EPMETY_STR); |
|
|
|
}else{ |
|
|
|
//采样时间不一致,说明未出结果
|
|
|
|
compareRecordEntity.setInternalRemark(String.format("采样时间不一致,采样接口返回的采样时间:%s,检测结果接口返回的采样时间:%s",compareRecordEntity.getLatestCyTime(),ytHsjcResDetailDTO.getSample_time())); |
|
|
|
} |
|
|
|
}else{ |
|
|
|
compareRecordEntity.setInternalRemark("检测结果查询接口为空"); |
|
|
|
} |
|
|
|
} |
|
|
|
}else{ |
|
|
|
compareRecordEntity.setInternalRemark("采样信息查询接口返回成功,data is null"); |
|
|
|
} |
|
|
|
}else{ |
|
|
|
compareRecordEntity.setInternalRemark("采样信息查询接口返回失败,data is empty"); |
|
|
|
} |
|
|
|
} |
|
|
|
datas.add(compareRecordEntity); |
|
|
|