|
@@ -62,28 +62,28 @@ public class HealthCodeServiceImpl implements HealthCodeService {
|
|
|
@Autowired
|
|
|
private Executor executor;
|
|
|
//顺序
|
|
|
- private static Integer index = 0;
|
|
|
- private static List<HealthMockDTO> mockDTOList = Lists.newArrayList();
|
|
|
-
|
|
|
- static {
|
|
|
- if (CollectionUtil.isEmpty(mockDTOList)) {
|
|
|
- mockDTOList.add(new HealthMockDTO().setIndex(0).setMzt("绿码").setNucleicExpirationTime(0));
|
|
|
- mockDTOList.add(new HealthMockDTO().setIndex(1).setMzt("绿码").setNucleicExpirationTime(24));
|
|
|
- mockDTOList.add(new HealthMockDTO().setIndex(2).setMzt("绿码").setNucleicExpirationTime(48));
|
|
|
- mockDTOList.add(new HealthMockDTO().setIndex(3).setMzt("绿码").setNucleicExpirationTime(72));
|
|
|
- mockDTOList.add(new HealthMockDTO().setIndex(4).setMzt("绿码").setNucleicExpirationTime(168));
|
|
|
- mockDTOList.add(new HealthMockDTO().setIndex(5).setMzt("黄码").setNucleicExpirationTime(0));
|
|
|
- mockDTOList.add(new HealthMockDTO().setIndex(6).setMzt("黄码").setNucleicExpirationTime(24));
|
|
|
- mockDTOList.add(new HealthMockDTO().setIndex(7).setMzt("黄码").setNucleicExpirationTime(48));
|
|
|
- mockDTOList.add(new HealthMockDTO().setIndex(8).setMzt("黄码").setNucleicExpirationTime(72));
|
|
|
- mockDTOList.add(new HealthMockDTO().setIndex(9).setMzt("黄码").setNucleicExpirationTime(168));
|
|
|
- mockDTOList.add(new HealthMockDTO().setIndex(10).setMzt("红码").setNucleicExpirationTime(0));
|
|
|
- mockDTOList.add(new HealthMockDTO().setIndex(11).setMzt("红码").setNucleicExpirationTime(24));
|
|
|
- mockDTOList.add(new HealthMockDTO().setIndex(12).setMzt("红码").setNucleicExpirationTime(48));
|
|
|
- mockDTOList.add(new HealthMockDTO().setIndex(13).setMzt("红码").setNucleicExpirationTime(72));
|
|
|
- mockDTOList.add(new HealthMockDTO().setIndex(14).setMzt("红码").setNucleicExpirationTime(168));
|
|
|
- }
|
|
|
- }
|
|
|
+// private static Integer index = 0;
|
|
|
+// private static List<HealthMockDTO> mockDTOList = Lists.newArrayList();
|
|
|
+
|
|
|
+// static {
|
|
|
+// if (CollectionUtil.isEmpty(mockDTOList)) {
|
|
|
+// mockDTOList.add(new HealthMockDTO().setIndex(0).setMzt("绿码").setNucleicExpirationTime(0));
|
|
|
+// mockDTOList.add(new HealthMockDTO().setIndex(1).setMzt("绿码").setNucleicExpirationTime(24));
|
|
|
+// mockDTOList.add(new HealthMockDTO().setIndex(2).setMzt("绿码").setNucleicExpirationTime(48));
|
|
|
+// mockDTOList.add(new HealthMockDTO().setIndex(3).setMzt("绿码").setNucleicExpirationTime(72));
|
|
|
+// mockDTOList.add(new HealthMockDTO().setIndex(4).setMzt("绿码").setNucleicExpirationTime(168));
|
|
|
+// mockDTOList.add(new HealthMockDTO().setIndex(5).setMzt("黄码").setNucleicExpirationTime(0));
|
|
|
+// mockDTOList.add(new HealthMockDTO().setIndex(6).setMzt("黄码").setNucleicExpirationTime(24));
|
|
|
+// mockDTOList.add(new HealthMockDTO().setIndex(7).setMzt("黄码").setNucleicExpirationTime(48));
|
|
|
+// mockDTOList.add(new HealthMockDTO().setIndex(8).setMzt("黄码").setNucleicExpirationTime(72));
|
|
|
+// mockDTOList.add(new HealthMockDTO().setIndex(9).setMzt("黄码").setNucleicExpirationTime(168));
|
|
|
+// mockDTOList.add(new HealthMockDTO().setIndex(10).setMzt("红码").setNucleicExpirationTime(0));
|
|
|
+// mockDTOList.add(new HealthMockDTO().setIndex(11).setMzt("红码").setNucleicExpirationTime(24));
|
|
|
+// mockDTOList.add(new HealthMockDTO().setIndex(12).setMzt("红码").setNucleicExpirationTime(48));
|
|
|
+// mockDTOList.add(new HealthMockDTO().setIndex(13).setMzt("红码").setNucleicExpirationTime(72));
|
|
|
+// mockDTOList.add(new HealthMockDTO().setIndex(14).setMzt("红码").setNucleicExpirationTime(168));
|
|
|
+// }
|
|
|
+// }
|
|
|
|
|
|
@Override
|
|
|
public HealtCodeUserVO getShortTermCertificate(ShortTermDTO shortTermDTO) {
|
|
@@ -125,6 +125,7 @@ public class HealthCodeServiceImpl implements HealthCodeService {
|
|
|
|
|
|
@Override
|
|
|
public RestResult getShortTerm(ShortTermDTO shortTermDTO) {
|
|
|
+ log.info("");
|
|
|
if (StrUtil.isEmpty(shortTermDTO.getHealthCode())) {
|
|
|
if (StringUtils.isBlank(shortTermDTO.getIdNumber()) && StringUtils.isBlank(shortTermDTO.getName())) {
|
|
|
throw new ServiceException(701, "身份证和姓名为空哦");
|
|
@@ -176,6 +177,12 @@ public class HealthCodeServiceImpl implements HealthCodeService {
|
|
|
placeInfoVO = placeInfoResult.getData();
|
|
|
HealthResultVO<DeviceScanIdCardVO> scanIdCardResult = null;
|
|
|
if (StrUtil.isNotEmpty(shortTermDTO.getHealthCode())) {
|
|
|
+ //非景区预约,通用健康码查询
|
|
|
+ if (!placeInfoVO.getScenicFlag()) {
|
|
|
+ scanIdCardResult = this.deviceScanCode(shortTermDTO);
|
|
|
+ }
|
|
|
+
|
|
|
+ //景区预约,走预约码查询
|
|
|
if (placeInfoVO.getScenicFlag() && NumberUtil.isNumber(shortTermDTO.getHealthCode())) {
|
|
|
ScenicVerifyVO verifyVO = scenicServer.verify(new ScenicVerifyDTO().setReservationCode(shortTermDTO.getHealthCode()), placeInfoVO.getAdminId());
|
|
|
if (!verifyVO.getReleaseStatus()) {
|
|
@@ -184,7 +191,10 @@ public class HealthCodeServiceImpl implements HealthCodeService {
|
|
|
shortTermDTO.setName(verifyVO.getUserName()).setIdNumber(verifyVO.getIdNumber());
|
|
|
scanIdCardResult = this.deviceScanIdCardEncrypt(shortTermDTO);
|
|
|
}
|
|
|
- } else {
|
|
|
+ }
|
|
|
+
|
|
|
+ //景区预约,走健康码查询
|
|
|
+ if (placeInfoVO.getScenicFlag() && !NumberUtil.isNumber(shortTermDTO.getHealthCode())) {
|
|
|
RestResult<HealthCodeVO> restResult = healthServer.queryInfoByBarCode(shortTermDTO.getHealthCode());
|
|
|
HealthCodeVO healthCodeVO = null;
|
|
|
|
|
@@ -287,13 +297,13 @@ public class HealthCodeServiceImpl implements HealthCodeService {
|
|
|
//用户健康码信息
|
|
|
HealtCodeTypeVO codeTypeVO = userVO.getData().stream().findFirst().get();
|
|
|
//TODO MOCK 测试 start
|
|
|
- HealthMockDTO mockDTO = mockDTOList.get(index);
|
|
|
- codeTypeVO.setMzt(mockDTO.getMzt());
|
|
|
- nucleicExpirationTime = mockDTO.getNucleicExpirationTime();
|
|
|
- index++;
|
|
|
- if(index > 14){
|
|
|
- index = 0;
|
|
|
- }
|
|
|
+// HealthMockDTO mockDTO = mockDTOList.get(index);
|
|
|
+// codeTypeVO.setMzt(mockDTO.getMzt());
|
|
|
+// nucleicExpirationTime = mockDTO.getNucleicExpirationTime();
|
|
|
+// index++;
|
|
|
+// if (index > 14) {
|
|
|
+// index = 0;
|
|
|
+// }
|
|
|
//TODO MOCK 测试 end
|
|
|
|
|
|
//用户核酸信息
|
|
@@ -307,6 +317,8 @@ public class HealthCodeServiceImpl implements HealthCodeService {
|
|
|
userVO.setBackgroundColor(ColorEnum.GREEN.getValue());
|
|
|
}
|
|
|
|
|
|
+ //核酸过期标识
|
|
|
+ boolean nucleicExpirationFlag = false;
|
|
|
/**
|
|
|
* 开门规则判定校验:红黄码,核酸有效期
|
|
|
*/
|
|
@@ -322,12 +334,13 @@ public class HealthCodeServiceImpl implements HealthCodeService {
|
|
|
userVO.setBackgroundColor(ColorEnum.YELLOW.getValue());
|
|
|
}
|
|
|
} else if (nucleicExpirationTime != null && !nucleicExpirationTime.equals(0) && (CollectionUtils.isEmpty(nucleinList) || DateUtil.betweenMs(nucleinList.stream().findFirst().get().getShowTime(), DateUtil.date()) > nucleicExpirationTime * 60 * 60 * 1000)) {
|
|
|
+ nucleicExpirationFlag = true;
|
|
|
userVO.setIsOpen(HealthOpenEnum.NO_THOROUGHFARE.getCode());
|
|
|
String openMsg;
|
|
|
if (nucleicExpirationTime <= NucleicRuleEnum.SEVENTY_TWO.getValue()) {
|
|
|
openMsg = new StringBuilder().append(nucleicExpirationTime).append("小时内无有效核酸阴性记录,禁止通行").toString();
|
|
|
} else {
|
|
|
- openMsg = new StringBuilder().append(nucleicExpirationTime).append("天内无有效核酸阴性记录,禁止通行").toString();
|
|
|
+ openMsg = new StringBuilder().append((nucleicExpirationTime / 24) + 1).append("天内无有效核酸阴性记录,禁止通行").toString();
|
|
|
}
|
|
|
userVO.setOpenMsg(openMsg).setOpenVoiceMsg(openMsg);
|
|
|
} else {
|
|
@@ -336,7 +349,7 @@ public class HealthCodeServiceImpl implements HealthCodeService {
|
|
|
|
|
|
if (CollectionUtil.isNotEmpty(nucleinList)) {
|
|
|
HealtCodeNucleinVO nucleinVO = nucleinList.stream().findFirst().get();
|
|
|
- nucleinVO.setTitle("核酸检测").setContentColor(ColorEnum.GREEN.getValue()).setIconUrl(NucleicStatusEnum.NEGATIVE.getUrl());
|
|
|
+ nucleinVO.setTitle("核酸检测").setContentColor(nucleicExpirationFlag ? ColorEnum.YELLOW.getValue() : ColorEnum.GREEN.getValue()).setIconUrl(nucleicExpirationFlag ? NucleicStatusEnum.NOT_AVAILABLE.getUrl() : NucleicStatusEnum.NEGATIVE.getUrl());
|
|
|
if (nucleinVO.getReportTime() != null && DateUtil.compare(nucleinVO.getChecktime(), nucleinVO.getReportTime()) > 0) {
|
|
|
nucleinVO.setContent(new StringBuilder().append(NucleicRuleEnum.TWENTY_FOUR.getValue()).append("H").append(" 结果未出").toString());
|
|
|
} else {
|
|
@@ -348,7 +361,7 @@ public class HealthCodeServiceImpl implements HealthCodeService {
|
|
|
} else if (betweenHour < NucleicRuleEnum.SEVENTY_TWO.getValue()) {
|
|
|
nucleinVO.setContent(new StringBuilder().append(NucleicRuleEnum.SEVENTY_TWO.getValue()).append(" ").append(nucleinVO.getResult()).toString());
|
|
|
} else {
|
|
|
- nucleinVO.setContent(new StringBuilder().append(DateUtil.betweenDay(nucleinVO.getShowTime(), DateUtil.date(), true)).append("天 ").append(nucleinVO.getResult()).toString());
|
|
|
+ nucleinVO.setContent(new StringBuilder().append(DateUtil.betweenDay(nucleinVO.getShowTime(), DateUtil.date(), false) + 1).append("天 ").append(nucleinVO.getResult()).toString());
|
|
|
}
|
|
|
}
|
|
|
} else {
|