|
@@ -11,16 +11,11 @@ import cn.hutool.core.util.StrUtil;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.rshy.project.hy.manager.RshyJkManager;
|
|
|
import com.rshy.project.hy.model.constant.ItfwConstant;
|
|
|
-import com.rshy.project.hy.model.enums.HyTypeEnum;
|
|
|
-import com.rshy.project.hy.model.enums.PassStatusEnum;
|
|
|
-import com.rshy.project.hy.model.enums.RepositoryEnum;
|
|
|
-import com.rshy.project.hy.model.enums.SexEnum;
|
|
|
+import com.rshy.project.hy.model.dto.NucleicAcidDTO;
|
|
|
+import com.rshy.project.hy.model.enums.*;
|
|
|
import com.rshy.project.hy.server.FaceRetrievaServer;
|
|
|
import com.rshy.project.hy.server.ItfwServer;
|
|
|
-import com.rshy.project.hy.server.dto.PctjkmInfoDTO;
|
|
|
-import com.rshy.project.hy.server.dto.PctrchlDTO;
|
|
|
-import com.rshy.project.hy.server.dto.RepositoryDTO;
|
|
|
-import com.rshy.project.hy.server.dto.ResultDTO;
|
|
|
+import com.rshy.project.hy.server.dto.*;
|
|
|
import com.rshy.project.hy.server.param.RshyParam;
|
|
|
import com.rshy.project.hy.server.param.RshyQuickParam;
|
|
|
import com.rshy.project.hy.server.vo.RetrievaResultVO;
|
|
@@ -62,9 +57,10 @@ public class RshyJkManagerImpl implements RshyJkManager {
|
|
|
log.info("普通核验接口请求参数:{}", JSON.toJSONString(rshyParam));
|
|
|
RshyVo rshyVo = new RshyVo();
|
|
|
ResultDTO resultDTO = new ResultDTO();
|
|
|
+ DateTime beginDate = DateTime.now();
|
|
|
+ PctjkmInfoDTO barCodes = null;
|
|
|
+
|
|
|
if (StringUtils.isNotBlank(rshyParam.getBarCode()) || StringUtils.isNotBlank(rshyParam.getSfzh())) {
|
|
|
- DateTime beginDate = DateTime.now();
|
|
|
- PctjkmInfoDTO barCodes = null;
|
|
|
try {
|
|
|
//查询健康码信息
|
|
|
barCodes = itfwServer.getPctjkm(rshyParam.getBarCode(), rshyParam.getSfzh(), rshyParam.getTimeout());
|
|
@@ -82,31 +78,35 @@ public class RshyJkManagerImpl implements RshyJkManager {
|
|
|
String codeLabel = barCodes.getCOLOR_CODE_LABEL();
|
|
|
String phone = barCodes.getPn();
|
|
|
rshyVo.setXm(rshyParam.getXm()).setSfzh(rshyParam.getSfzh()).setHealthCode(codeLabel).setPhone(phone);
|
|
|
-
|
|
|
- if (PassStatusEnum.RED_CODE.getDesc().equalsIgnoreCase(barCodes.getCOLOR_CODE_LABEL())) {
|
|
|
- rshyVo.setPass(PassStatusEnum.RED_CODE.getCode()).setTimes(times(rshyParam.getSfzh())).setTts(PassStatusEnum.RED_CODE.getDesc()).setDisplayMsg(PassStatusEnum.RED_CODE.getDesc()).setWarning(PassStatusEnum.RED_CODE.getDesc()).setKind("健康码" + PassStatusEnum.RED_CODE.getDesc());
|
|
|
- return rshyVo;
|
|
|
- } else if (PassStatusEnum.YELLOW_CODE.getDesc().equalsIgnoreCase(barCodes.getCOLOR_CODE_LABEL())) {
|
|
|
- rshyVo.setPass(PassStatusEnum.YELLOW_CODE.getCode()).setTimes(times(rshyParam.getSfzh())).setTts(PassStatusEnum.YELLOW_CODE.getDesc()).setDisplayMsg(PassStatusEnum.YELLOW_CODE.getDesc()).setWarning(PassStatusEnum.YELLOW_CODE.getDesc()).setKind("健康码" + PassStatusEnum.YELLOW_CODE.getDesc());
|
|
|
- return rshyVo;
|
|
|
- } else {
|
|
|
- rshyVo.setTts(barCodes.getCOLOR_CODE_LABEL());
|
|
|
- }
|
|
|
- rshyParam.setTimeout((int) (rshyParam.getTimeout() - DateUtil.between(beginDate, DateTime.now(), DateUnit.MS)));
|
|
|
}
|
|
|
|
|
|
- List<Runnable> taskList = new ArrayList<Runnable>() {
|
|
|
- {
|
|
|
- add(() -> resultDTO.setPctdfkDTO(itfwServer.getPctdfk(rshyParam.getSfzh(), "", rshyParam.getTimeout())));
|
|
|
- add(() -> resultDTO.setPctjsryDTO(itfwServer.getPctjsry(rshyParam.getSfzh(), rshyParam.getTimeout())));
|
|
|
- add(() -> resultDTO.setPctztDTO(itfwServer.getPctzt(rshyParam.getSfzh(), rshyParam.getTimeout())));
|
|
|
- add(() -> resultDTO.setPctzfbaDTO(itfwServer.getPctzfba(rshyParam.getSfzh(), rshyParam.getTimeout())));
|
|
|
- add(() -> resultDTO.setPctqkryDTO(itfwServer.getPctqkry(rshyParam.getSfzh(), rshyParam.getTimeout())));
|
|
|
- add(() -> resultDTO.setPctxdryDTO(itfwServer.getPctxdry(rshyParam.getSfzh(), "", rshyParam.getTimeout())));
|
|
|
- add(() -> resultDTO.setPctzdryDTO(itfwServer.getPctzdry(rshyParam.getSfzh(), rshyParam.getTimeout())));
|
|
|
- add(() -> resultDTO.setPctrchlDTO(itfwServer.getPctrchl(rshyParam.getSfzh(), rshyParam.getTimeout())));
|
|
|
- }
|
|
|
- };
|
|
|
+ rshyParam.setTimeout((int) (rshyParam.getTimeout() - DateUtil.between(beginDate, DateTime.now(), DateUnit.MS)));
|
|
|
+
|
|
|
+ List<Runnable> taskList = null;
|
|
|
+ if(barCodes == null || PassStatusEnum.GREEN_CODE.getDesc().equals(barCodes.getCOLOR_CODE_LABEL())) {
|
|
|
+ taskList = new ArrayList<Runnable>() {
|
|
|
+ {
|
|
|
+ add(() -> resultDTO.setPctdfkDTO(itfwServer.getPctdfk(rshyParam.getSfzh(), "", rshyParam.getTimeout())));
|
|
|
+ add(() -> resultDTO.setPctjsryDTO(itfwServer.getPctjsry(rshyParam.getSfzh(), rshyParam.getTimeout())));
|
|
|
+ add(() -> resultDTO.setPctztDTO(itfwServer.getPctzt(rshyParam.getSfzh(), rshyParam.getTimeout())));
|
|
|
+ add(() -> resultDTO.setPctzfbaDTO(itfwServer.getPctzfba(rshyParam.getSfzh(), rshyParam.getTimeout())));
|
|
|
+ add(() -> resultDTO.setPctqkryDTO(itfwServer.getPctqkry(rshyParam.getSfzh(), rshyParam.getTimeout())));
|
|
|
+ add(() -> resultDTO.setPctxdryDTO(itfwServer.getPctxdry(rshyParam.getSfzh(), "", rshyParam.getTimeout())));
|
|
|
+ add(() -> resultDTO.setPctzdryDTO(itfwServer.getPctzdry(rshyParam.getSfzh(), rshyParam.getTimeout())));
|
|
|
+ add(() -> resultDTO.setPctrchlDTO(itfwServer.getPctrchl(rshyParam.getSfzh(), rshyParam.getTimeout())));
|
|
|
+ add(() -> resultDTO.setPctymDataDTOS(itfwServer.getPctym(rshyParam.getSfzh(), rshyParam.getTimeout())));
|
|
|
+ add(() -> resultDTO.setPcthsResultDTO(itfwServer.getPcths(rshyParam.getSfzh(), rshyParam.getTimeout())));
|
|
|
+
|
|
|
+ }
|
|
|
+ };
|
|
|
+ }else{
|
|
|
+ taskList = new ArrayList<Runnable>() {
|
|
|
+ {
|
|
|
+ add(() -> resultDTO.setPctymDataDTOS(itfwServer.getPctym(rshyParam.getSfzh(), rshyParam.getTimeout())));
|
|
|
+ add(() -> resultDTO.setPcthsResultDTO(itfwServer.getPcths(rshyParam.getSfzh(), rshyParam.getTimeout())));
|
|
|
+ }
|
|
|
+ };
|
|
|
+ }
|
|
|
|
|
|
//异步流并发处理
|
|
|
taskList.parallelStream().forEach(v -> {
|
|
@@ -119,11 +119,13 @@ public class RshyJkManagerImpl implements RshyJkManager {
|
|
|
});
|
|
|
|
|
|
log.info("IT服务平台接口调用完成");
|
|
|
- rshyVo.setXm(rshyParam.getXm()).setSfzh(rshyParam.getSfzh()).setTimes(times(rshyParam.getSfzh()));
|
|
|
+ rshyVo.setXm(rshyParam.getXm()).setSfzh(rshyParam.getSfzh()).setTimes(times(rshyParam.getSfzh())).setVaccine(CollectionUtil.isEmpty(resultDTO.getPctymDataDTOS()) ? null : resultDTO.getPctymDataDTOS().size()).setTravel_card(0);
|
|
|
+ //核酸报告
|
|
|
+ rshyVo.setNucleic_acid(nucleicAcid(resultDTO.getPcthsResultDTO()));
|
|
|
rshyVo.setXb(SexEnum.codeOf(IdcardUtil.getGenderByIdCard(rshyParam.getSfzh())).getDesc());
|
|
|
Date date = DateUtil.parse(IdcardUtil.getBirthByIdCard(rshyParam.getSfzh()));
|
|
|
rshyVo.setBirthday(DateUtil.format(date, "yyyy-M-d"));
|
|
|
-
|
|
|
+ rshyVo.setTts(barCodes != null ? barCodes.getCOLOR_CODE_LABEL() : null);
|
|
|
PctrchlDTO pctrchlDTO = resultDTO.getPctrchlDTO();
|
|
|
resultDTO.setPctrchlDTO(null);
|
|
|
String hcjg = "";
|
|
@@ -131,13 +133,18 @@ public class RshyJkManagerImpl implements RshyJkManager {
|
|
|
hcjg = pctrchlDTO.getHcjg();
|
|
|
}
|
|
|
|
|
|
- if (resultDTO.getPctztDTO() != null || StrUtil.containsAnyIgnoreCase(hcjg, "抓捕")) {
|
|
|
+ if (barCodes != null && PassStatusEnum.RED_CODE.getDesc().equalsIgnoreCase(barCodes.getCOLOR_CODE_LABEL())) {
|
|
|
+ rshyVo.setPass(PassStatusEnum.RED_CODE.getCode()).setTimes(times(rshyParam.getSfzh())).setTts(PassStatusEnum.RED_CODE.getDesc()).setDisplayMsg(PassStatusEnum.RED_CODE.getDesc()).setWarning(PassStatusEnum.RED_CODE.getDesc()).setKind("健康码" + PassStatusEnum.RED_CODE.getDesc());
|
|
|
+ } else if (barCodes != null && PassStatusEnum.YELLOW_CODE.getDesc().equalsIgnoreCase(barCodes.getCOLOR_CODE_LABEL())) {
|
|
|
+ rshyVo.setPass(PassStatusEnum.YELLOW_CODE.getCode()).setTimes(times(rshyParam.getSfzh())).setTts(PassStatusEnum.YELLOW_CODE.getDesc()).setDisplayMsg(PassStatusEnum.YELLOW_CODE.getDesc()).setWarning(PassStatusEnum.YELLOW_CODE.getDesc()).setKind("健康码" + PassStatusEnum.YELLOW_CODE.getDesc());
|
|
|
+ } else if (resultDTO.getPctztDTO() != null || StrUtil.containsAnyIgnoreCase(hcjg, "抓捕")) {
|
|
|
rshyVo.setPass(PassStatusEnum.NO_PASSING.getCode()).setTts(PassStatusEnum.NO_PASSING.getDesc()).setDisplayMsg(PassStatusEnum.NO_PASSING.getDesc()).setWarning(new StringBuilder().append("在逃人员:").append(resultDTO.getPctztDTO().getJyaq()).toString()).setKind(resultDTO.getPctztDTO().getZtrylxmc());
|
|
|
} else if (ObjectUtils.allFieldIsNULL(resultDTO) || StrUtil.containsAnyIgnoreCase(hcjg, "通过")) {
|
|
|
rshyVo.setPass(PassStatusEnum.NORMAL_TRAFFIC.getCode()).setDisplayMsg(PassStatusEnum.NORMAL_TRAFFIC.getDesc()).setTts(PassStatusEnum.NORMAL_TRAFFIC.getDesc());
|
|
|
} else {
|
|
|
rshyVo.setPass(PassStatusEnum.RIGHT_WAY.getCode()).setKind(kind(resultDTO)).setWarning(warning(resultDTO)).setDisplayMsg(PassStatusEnum.RIGHT_WAY.getDesc()).setTts(PassStatusEnum.RIGHT_WAY.getDesc());
|
|
|
}
|
|
|
+
|
|
|
if (rshyVo.getHealthCode() != null) {
|
|
|
rshyVo.setTts(rshyVo.getHealthCode());
|
|
|
}
|
|
@@ -146,6 +153,38 @@ public class RshyJkManagerImpl implements RshyJkManager {
|
|
|
return rshyVo;
|
|
|
}
|
|
|
|
|
|
+ private NucleicAcidDTO nucleicAcid(PcthsResultDTO pcthsResultDTO){
|
|
|
+ NucleicAcidDTO nucleicAcidDTO = new NucleicAcidDTO();
|
|
|
+ if(pcthsResultDTO == null){
|
|
|
+ nucleicAcidDTO.setStatus(NucleicAcidEnum.NOT_CONFORM.getCode()).setResults("48h内未采集");
|
|
|
+ return nucleicAcidDTO;
|
|
|
+ }
|
|
|
+
|
|
|
+ if(pcthsResultDTO.getSHE_RQSJ() != null){
|
|
|
+ DateTime parse = DateUtil.parse(String.valueOf(Integer.valueOf(pcthsResultDTO.getSHE_RQSJ()) * 1000));
|
|
|
+ long betweenMs = DateUtil.betweenMs(parse, DateUtil.date());
|
|
|
+ //48h防疫规则
|
|
|
+ if(betweenMs > 48 * 60 * 60 * 1000){
|
|
|
+ nucleicAcidDTO.setStatus(NucleicAcidEnum.NOT_CONFORM.getCode()).setResults(new StringBuilder("48小时之外已出结果,结果").append(pcthsResultDTO.getJGU_MC()).toString()).setTime(DateUtil.format(parse, "MM-dd HH:mm"));
|
|
|
+ return nucleicAcidDTO;
|
|
|
+ }
|
|
|
+
|
|
|
+ nucleicAcidDTO.setStatus(NucleicAcidEnum.CONFORM.getCode()).setResults(new StringBuilder("48小时之内已出结果,结果").append(pcthsResultDTO.getJGU_MC()).toString()).setTime(DateUtil.format(parse, "MM-dd HH:mm"));
|
|
|
+ return nucleicAcidDTO;
|
|
|
+ }
|
|
|
+
|
|
|
+ DateTime parse = DateUtil.parse(String.valueOf(Integer.valueOf(pcthsResultDTO.getCJSJ()) * 1000));
|
|
|
+ long betweenMs = DateUtil.betweenMs(parse, DateUtil.date());
|
|
|
+ //48h防疫规则
|
|
|
+ if(betweenMs > 48 * 60 * 60 * 1000){
|
|
|
+ nucleicAcidDTO.setStatus(NucleicAcidEnum.NOT_CONFORM.getCode()).setResults("48小时之外未出结果");
|
|
|
+ return nucleicAcidDTO;
|
|
|
+ }
|
|
|
+
|
|
|
+ nucleicAcidDTO.setStatus(NucleicAcidEnum.CONFORM.getCode()).setResults("48小时之内未出结果");
|
|
|
+ return nucleicAcidDTO;
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public RshyVo getQuickRyhyInfo(RshyQuickParam rshyQuickParam) {
|
|
|
RshyVo rshyVo = new RshyVo();
|