|
@@ -34,6 +34,7 @@ import java.util.Date;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
import java.util.concurrent.TimeUnit;
|
|
|
+import java.util.concurrent.atomic.AtomicReference;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
@@ -84,31 +85,26 @@ public class RshyJkManagerImpl implements RshyJkManager {
|
|
|
}
|
|
|
|
|
|
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())));
|
|
|
- add(() -> resultDTO.setPersonIdentifyDTO(viidServer.personIdentify(rshyParam.getPhoto(), 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())));
|
|
|
- add(() -> resultDTO.setPersonIdentifyDTO(viidServer.personIdentify(rshyParam.getPhoto(), rshyParam.getTimeout())));
|
|
|
- }
|
|
|
- };
|
|
|
+
|
|
|
+ AtomicReference<RshyVo> quickRshyVo = new AtomicReference<>(new RshyVo());
|
|
|
+ List<Runnable> taskList = new ArrayList<Runnable>() {
|
|
|
+ {
|
|
|
+ add(() -> resultDTO.setPctymDataDTOS(itfwServer.getPctym(rshyParam.getSfzh(), rshyParam.getTimeout())));
|
|
|
+ add(() -> resultDTO.setPcthsResultDTO(itfwServer.getPcths(rshyParam.getSfzh(), rshyParam.getTimeout())));
|
|
|
+ add(() -> resultDTO.setPersonIdentifyDTO(viidServer.personIdentify(rshyParam.getPhoto(), rshyParam.getTimeout())));
|
|
|
+ add(() -> quickRshyVo.set(getQuickRyhyInfo(new RshyQuickParam().setPhoto(rshyParam.getPhoto()).setTimeout(rshyParam.getTimeout()))));
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+ if (barCodes == null || PassStatusEnum.GREEN_CODE.getDesc().equals(barCodes.getCOLOR_CODE_LABEL())) {
|
|
|
+ taskList.add(() -> resultDTO.setPctdfkDTO(itfwServer.getPctdfk(rshyParam.getSfzh(), "", rshyParam.getTimeout())));
|
|
|
+ taskList.add(() -> resultDTO.setPctjsryDTO(itfwServer.getPctjsry(rshyParam.getSfzh(), rshyParam.getTimeout())));
|
|
|
+ taskList.add(() -> resultDTO.setPctztDTO(itfwServer.getPctzt(rshyParam.getSfzh(), rshyParam.getTimeout())));
|
|
|
+ taskList.add(() -> resultDTO.setPctzfbaDTO(itfwServer.getPctzfba(rshyParam.getSfzh(), rshyParam.getTimeout())));
|
|
|
+ taskList.add(() -> resultDTO.setPctqkryDTO(itfwServer.getPctqkry(rshyParam.getSfzh(), rshyParam.getTimeout())));
|
|
|
+ taskList.add(() -> resultDTO.setPctxdryDTO(itfwServer.getPctxdry(rshyParam.getSfzh(), "", rshyParam.getTimeout())));
|
|
|
+ taskList.add(() -> resultDTO.setPctzdryDTO(itfwServer.getPctzdry(rshyParam.getSfzh(), rshyParam.getTimeout())));
|
|
|
+ taskList.add(() -> resultDTO.setPctrchlDTO(itfwServer.getPctrchl(rshyParam.getSfzh(), rshyParam.getTimeout())));
|
|
|
}
|
|
|
|
|
|
//异步流并发处理
|
|
@@ -135,7 +131,7 @@ public class RshyJkManagerImpl implements RshyJkManager {
|
|
|
hcjg = pctrchlDTO.getHcjg();
|
|
|
}
|
|
|
|
|
|
- if(resultDTO.getPersonIdentifyDTO() != null && !rshyParam.getSfzh().equals(resultDTO.getPersonIdentifyDTO().getIdNumber())){
|
|
|
+ if (resultDTO.getPersonIdentifyDTO() != null && !rshyParam.getSfzh().equals(resultDTO.getPersonIdentifyDTO().getIdNumber())) {
|
|
|
rshyVo.setPass(PassStatusEnum.NO_PASSING.getCode()).setTimes(times(rshyParam.getSfzh())).setTts(PassStatusEnum.NO_PASSING.getTts()).setDisplayMsg(PassStatusEnum.NO_PASSING.getDesc()).setWarning(PassStatusEnum.NO_PASSING.getDesc()).setKind("人证不一致");
|
|
|
} else 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.getTts()).setDisplayMsg(PassStatusEnum.RED_CODE.getDesc()).setWarning(PassStatusEnum.RED_CODE.getDesc()).setKind("健康码" + PassStatusEnum.RED_CODE.getDesc());
|
|
@@ -145,6 +141,9 @@ public class RshyJkManagerImpl implements RshyJkManager {
|
|
|
rshyVo.setPass(PassStatusEnum.NO_PASSING.getCode()).setTts(PassStatusEnum.NO_PASSING.getTts()).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.getTts());
|
|
|
+ } else if (quickRshyVo.get() != null && StrUtil.isNotEmpty(quickRshyVo.get().getSfzh())) {
|
|
|
+ //快速通行
|
|
|
+ rshyVo = quickRshyVo.get();
|
|
|
} else {
|
|
|
rshyVo.setPass(PassStatusEnum.RIGHT_WAY.getCode()).setKind(kind(resultDTO)).setWarning(warning(resultDTO)).setDisplayMsg(PassStatusEnum.RIGHT_WAY.getDesc()).setTts(PassStatusEnum.RIGHT_WAY.getTts());
|
|
|
}
|
|
@@ -157,18 +156,18 @@ public class RshyJkManagerImpl implements RshyJkManager {
|
|
|
return rshyVo;
|
|
|
}
|
|
|
|
|
|
- private NucleicAcidDTO nucleicAcid(PcthsResultDTO pcthsResultDTO){
|
|
|
+ private NucleicAcidDTO nucleicAcid(PcthsResultDTO pcthsResultDTO) {
|
|
|
NucleicAcidDTO nucleicAcidDTO = new NucleicAcidDTO();
|
|
|
- if(pcthsResultDTO == null){
|
|
|
+ if (pcthsResultDTO == null) {
|
|
|
nucleicAcidDTO.setStatus(NucleicAcidEnum.NOT_CONFORM.getCode()).setResults("48h内未采集");
|
|
|
return nucleicAcidDTO;
|
|
|
}
|
|
|
|
|
|
- if(pcthsResultDTO.getSHE_RQSJ() != null){
|
|
|
+ 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){
|
|
|
+ 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;
|
|
|
}
|
|
@@ -180,7 +179,7 @@ public class RshyJkManagerImpl implements RshyJkManager {
|
|
|
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){
|
|
|
+ if (betweenMs > 48 * 60 * 60 * 1000) {
|
|
|
nucleicAcidDTO.setStatus(NucleicAcidEnum.NOT_CONFORM.getCode()).setResults("48小时之外未出结果");
|
|
|
return nucleicAcidDTO;
|
|
|
}
|
|
@@ -191,14 +190,13 @@ public class RshyJkManagerImpl implements RshyJkManager {
|
|
|
|
|
|
@Override
|
|
|
public RshyVo getQuickRyhyInfo(RshyQuickParam rshyQuickParam) {
|
|
|
+ // timeout 转成毫秒
|
|
|
+ rshyQuickParam.setTimeout(rshyQuickParam.getTimeout() * 1000);
|
|
|
RshyVo rshyVo = new RshyVo();
|
|
|
RetrievaResultVO retrievaResultVO = faceRetrievaServer.retrieval(rshyQuickParam.getPhoto(), rshyQuickParam.getTimeout());
|
|
|
List<RetrievalRepositoryVO> voList = Convert.toList(RetrievalRepositoryVO.class, retrievaResultVO.getResults());
|
|
|
if (CollectionUtil.isEmpty(voList)) {
|
|
|
- rshyVo.setPass(PassStatusEnum.NORMAL_TRAFFIC.getCode());
|
|
|
- rshyVo.setDisplayMsg(PassStatusEnum.NORMAL_TRAFFIC.getDesc());
|
|
|
- rshyVo.setTts(PassStatusEnum.NORMAL_TRAFFIC.getDesc());
|
|
|
- return rshyVo;
|
|
|
+ return rshyVo.setPass(PassStatusEnum.NORMAL_TRAFFIC.getCode()).setDisplayMsg(PassStatusEnum.NORMAL_TRAFFIC.getDesc()).setTts(PassStatusEnum.NORMAL_TRAFFIC.getTts());
|
|
|
}
|
|
|
|
|
|
//查询人像库信息
|
|
@@ -208,7 +206,7 @@ public class RshyJkManagerImpl implements RshyJkManager {
|
|
|
RetrievalRepositoryVO repositoryVO = voList.stream().findFirst().get();
|
|
|
rshyVo.setPass(RepositoryEnum.COUNTRY_LARGE.getId().equals(repositoryVO.getRepository_id()) ? PassStatusEnum.NO_PASSING.getCode() : PassStatusEnum.RIGHT_WAY.getCode()).setKind(StrUtil.EMPTY)
|
|
|
.setWarning(stringMap.get(repositoryVO.getRepository_id())).setDisplayMsg(RepositoryEnum.COUNTRY_LARGE.getId().equals(repositoryVO.getRepository_id()) ? PassStatusEnum.NO_PASSING.getDesc() : PassStatusEnum.RIGHT_WAY.getDesc())
|
|
|
- .setTts(RepositoryEnum.COUNTRY_LARGE.getId().equals(repositoryVO.getRepository_id()) ? PassStatusEnum.NO_PASSING.getDesc() : PassStatusEnum.RIGHT_WAY.getDesc()).setHealthCode(StrUtil.EMPTY).setSfzh(repositoryVO.getPersonId())
|
|
|
+ .setTts(RepositoryEnum.COUNTRY_LARGE.getId().equals(repositoryVO.getRepository_id()) ? PassStatusEnum.NO_PASSING.getTts() : PassStatusEnum.RIGHT_WAY.getTts()).setHealthCode(StrUtil.EMPTY).setSfzh(repositoryVO.getPersonId())
|
|
|
.setXm(repositoryVO.getName()).setXb(SexEnum.codeOf(repositoryVO.getGender()).getDesc()).setMz(StrUtil.EMPTY).setPhone(StrUtil.EMPTY).setAddress(StrUtil.EMPTY).setPhoto(rshyQuickParam.getPhoto());
|
|
|
log.info("快速核验响应内容:{}", JSON.toJSONString(rshyVo));
|
|
|
return rshyVo;
|