|
@@ -5,8 +5,6 @@ import cn.hutool.core.date.DateUnit;
|
|
|
import cn.hutool.core.date.DateUtil;
|
|
|
import cn.hutool.core.lang.UUID;
|
|
|
import cn.hutool.core.util.DesensitizedUtil;
|
|
|
-import cn.hutool.core.util.NumberUtil;
|
|
|
-import cn.hutool.core.util.RandomUtil;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
import cn.hutool.http.HttpUtil;
|
|
|
import com.alibaba.excel.util.CollectionUtils;
|
|
@@ -21,34 +19,43 @@ import com.yixin.ms.boot.uitls.DESUtil;
|
|
|
import com.yixin.ms.boot.uitls.OkHttpUtils;
|
|
|
import com.yixin.ms.boot.uitls.RedisUtil;
|
|
|
import com.yixin.ms.boot.uitls.SMSOrIdCardUtils;
|
|
|
+import com.yixin.ms.model.dto.HealthCodeConfigDTO;
|
|
|
import com.yixin.ms.model.dto.HealthCodeDTO;
|
|
|
-import com.yixin.ms.model.dto.HealthMockDTO;
|
|
|
import com.yixin.ms.model.dto.ShortTermDTO;
|
|
|
import com.yixin.ms.model.enums.*;
|
|
|
import com.yixin.ms.model.vo.HealtCodeNucleinVO;
|
|
|
import com.yixin.ms.model.vo.HealtCodeTypeVO;
|
|
|
import com.yixin.ms.model.vo.HealtCodeUserVO;
|
|
|
import com.yixin.ms.server.HealthCodeServer;
|
|
|
-import com.yixin.ms.server.HealthServer;
|
|
|
import com.yixin.ms.server.PlaceHealthCodeServer;
|
|
|
-import com.yixin.ms.server.ScenicServer;
|
|
|
-import com.yixin.ms.server.dto.*;
|
|
|
-import com.yixin.ms.server.vo.*;
|
|
|
+import com.yixin.ms.server.dto.DeviceScanCodeDTO;
|
|
|
+import com.yixin.ms.server.dto.DeviceScanIdCardDTO;
|
|
|
+import com.yixin.ms.server.vo.DeviceScanIdCardVO;
|
|
|
+import com.yixin.ms.server.vo.HealthCodeVO;
|
|
|
+import com.yixin.ms.server.vo.HealthResultVO;
|
|
|
+import com.yixin.ms.server.vo.PlaceInfoVO;
|
|
|
import com.yixin.ms.service.HealthCodeService;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.data.redis.core.RedisTemplate;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.nio.charset.Charset;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
import java.util.concurrent.Executor;
|
|
|
+import java.util.concurrent.TimeUnit;
|
|
|
|
|
|
|
|
|
@Slf4j
|
|
|
@Service
|
|
|
public class HealthCodeServiceImpl implements HealthCodeService {
|
|
|
+ /**
|
|
|
+ * 设备限制访问标识
|
|
|
+ */
|
|
|
+ private static final String LIMIT_REQUEST_NUMBER = "health:limit:number:";
|
|
|
+
|
|
|
@Autowired
|
|
|
private RedisUtil redisUtil;
|
|
|
@Autowired
|
|
@@ -56,34 +63,7 @@ public class HealthCodeServiceImpl implements HealthCodeService {
|
|
|
@Autowired
|
|
|
private HealthCodeServer healthCodeServer;
|
|
|
@Autowired
|
|
|
- private HealthServer healthServer;
|
|
|
- @Autowired
|
|
|
- private ScenicServer scenicServer;
|
|
|
- @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 RedisTemplate redisTemplate;
|
|
|
|
|
|
@Override
|
|
|
public HealtCodeUserVO getShortTermCertificate(ShortTermDTO shortTermDTO) {
|
|
@@ -126,16 +106,24 @@ public class HealthCodeServiceImpl implements HealthCodeService {
|
|
|
@Override
|
|
|
public RestResult getShortTerm(ShortTermDTO shortTermDTO) {
|
|
|
log.info("健康码查询入参信息:{}", JSON.toJSONString(shortTermDTO));
|
|
|
+ if (StringUtils.isBlank(shortTermDTO.getToken())) {
|
|
|
+ throw new ServiceException(700, "token为空哦");
|
|
|
+ }
|
|
|
+
|
|
|
+ if(TokenEnum.codeOf(shortTermDTO.getToken()) == null){
|
|
|
+ throw new ServiceException(700, "token有误,请检查");
|
|
|
+ }
|
|
|
+
|
|
|
+ if (StrUtil.isEmpty(shortTermDTO.getSn())) {
|
|
|
+ throw new ServiceException("设备编码必传,请检查入参信息");
|
|
|
+ }
|
|
|
+
|
|
|
if (StrUtil.isEmpty(shortTermDTO.getHealthCode())) {
|
|
|
if (StringUtils.isBlank(shortTermDTO.getIdNumber()) && StringUtils.isBlank(shortTermDTO.getName())) {
|
|
|
throw new ServiceException(701, "身份证和姓名为空哦");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if (StringUtils.isBlank(shortTermDTO.getToken())) {
|
|
|
- throw new ServiceException(700, "token为空哦");
|
|
|
- }
|
|
|
-
|
|
|
/**
|
|
|
* \\000026https://h5.dingtalk.com/healthAct/index.html?stateCouncilBarCode=ffd631d12c5ee80fe77fe0fb4347b4e8&flag=1#/result
|
|
|
* 扫码参数兼容问题处理
|
|
@@ -162,105 +150,68 @@ public class HealthCodeServiceImpl implements HealthCodeService {
|
|
|
HealtCodeUserVO userVO = null;
|
|
|
//核酸有效期时间,默认0不限制
|
|
|
Integer nucleicExpirationTime = 0;
|
|
|
- PlaceInfoVO placeInfoVO = null;
|
|
|
- if (StringUtils.isNotEmpty(shortTermDTO.getSn())) {
|
|
|
- RestResult<PlaceInfoVO> placeInfoResult = placeHealthCodeServer.queryPlaceInfoBySn(shortTermDTO.getSn());
|
|
|
- if (placeInfoResult != null && placeInfoResult.getData() != null) {
|
|
|
- nucleicExpirationTime = placeInfoResult.getData().getNucleicExpirationTime();
|
|
|
- }
|
|
|
-
|
|
|
- if (placeInfoResult != null && placeInfoResult.getData() != null && StrUtil.isEmpty(placeInfoResult.getData().getAddressCode()) && RestCode.SUCCESS.getCode() == placeInfoResult.getCode() && StrUtil.isNotEmpty(shortTermDTO.getHealthCode())) {
|
|
|
- throw new ServiceException("设备扫码未绑定场所码,请联系管理员");
|
|
|
- }
|
|
|
-
|
|
|
- if (placeInfoResult != null && placeInfoResult.getData() != null && StrUtil.isNotEmpty(placeInfoResult.getData().getAddressCode()) && RestCode.SUCCESS.getCode() == placeInfoResult.getCode()) {
|
|
|
- placeInfoVO = placeInfoResult.getData();
|
|
|
- HealthResultVO<DeviceScanIdCardVO> scanIdCardResult = null;
|
|
|
- if (StrUtil.isNotEmpty(shortTermDTO.getHealthCode())) {
|
|
|
- //非景区预约,通用健康码查询
|
|
|
- if (!placeInfoVO.getScenicFlag()) {
|
|
|
- scanIdCardResult = this.deviceScanCode(shortTermDTO);
|
|
|
- }
|
|
|
+ RestResult<PlaceInfoVO> placeInfoResult = placeHealthCodeServer.queryOpenPlaceInfoBySn(shortTermDTO.getSn());
|
|
|
+ if(placeInfoResult == null){
|
|
|
+ throw new ServiceException("浙江服务平台异常,请稍后");
|
|
|
+ }
|
|
|
|
|
|
- //景区预约,走预约码查询
|
|
|
- if (placeInfoVO.getScenicFlag() && NumberUtil.isNumber(shortTermDTO.getHealthCode())) {
|
|
|
- ScenicVerifyVO verifyVO = scenicServer.verify(new ScenicVerifyDTO().setReservationCode(shortTermDTO.getHealthCode()), placeInfoVO.getAdminId());
|
|
|
- if (!verifyVO.getReleaseStatus()) {
|
|
|
- throw new ServiceException(verifyVO.getMessage());
|
|
|
- } else {
|
|
|
- shortTermDTO.setName(verifyVO.getUserName()).setIdNumber(verifyVO.getIdNumber());
|
|
|
- scanIdCardResult = this.deviceScanIdCardEncrypt(shortTermDTO);
|
|
|
- }
|
|
|
- }
|
|
|
+ if(placeInfoResult.getData() == null){
|
|
|
+ throw new ServiceException("设备暂无调用权限,请联系管理员");
|
|
|
+ }
|
|
|
|
|
|
- //景区预约,走健康码查询
|
|
|
- if (placeInfoVO.getScenicFlag() && !NumberUtil.isNumber(shortTermDTO.getHealthCode())) {
|
|
|
- RestResult<HealthCodeVO> restResult = healthServer.queryInfoByBarCode(shortTermDTO.getHealthCode());
|
|
|
- HealthCodeVO healthCodeVO = null;
|
|
|
+ if (placeInfoResult != null && placeInfoResult.getData() != null){
|
|
|
+ if(placeInfoResult.getData().getRequestNumber().equals(0)){
|
|
|
+ throw new ServiceException("设备每秒请求次数限制,请联系管理员");
|
|
|
+ }
|
|
|
|
|
|
- if (restResult.getCode() == RestCode.SUCCESS.getCode()) {
|
|
|
- healthCodeVO = restResult.getData();
|
|
|
- }
|
|
|
+ String cacheKey = new StringBuilder().append(LIMIT_REQUEST_NUMBER).append(shortTermDTO.getSn()).toString();
|
|
|
+ int times = 1;
|
|
|
+ Object timesStr = redisTemplate.opsForValue().get(cacheKey);
|
|
|
+ if (timesStr == null) {
|
|
|
+ //设备限制单位时间访问次数
|
|
|
+ redisTemplate.opsForValue().set(cacheKey, times, 1, TimeUnit.SECONDS);
|
|
|
+ } else {
|
|
|
+ redisTemplate.opsForValue().increment(cacheKey);
|
|
|
+ if(Integer.valueOf(timesStr.toString()) > placeInfoResult.getData().getRequestNumber()){
|
|
|
+ throw new ServiceException("设备每秒请求次数限制,请联系管理员");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
- if (healthCodeVO != null) {
|
|
|
- ScenicVerifyVO verifyVO = scenicServer.verify(new ScenicVerifyDTO().setIdNumber(healthCodeVO.getIdNum()), placeInfoVO.getAdminId());
|
|
|
- if (!verifyVO.getReleaseStatus()) {
|
|
|
- throw new ServiceException(verifyVO.getMessage());
|
|
|
- }
|
|
|
+ if (placeInfoResult != null && placeInfoResult.getData() != null && !placeInfoResult.getData().getEnableStatus() && StrUtil.isNotEmpty(shortTermDTO.getHealthCode())) {
|
|
|
+ throw new ServiceException("设备扫码未绑定场所码,请联系管理员");
|
|
|
+ }
|
|
|
|
|
|
- shortTermDTO.setName(verifyVO.getUserName()).setIdNumber(verifyVO.getIdNumber());
|
|
|
- }
|
|
|
+ if (placeInfoResult != null && placeInfoResult.getData() != null && placeInfoResult.getData().getEnableStatus()) {
|
|
|
+ HealthResultVO<DeviceScanIdCardVO> scanIdCardResult = null;
|
|
|
+ if (StrUtil.isNotEmpty(shortTermDTO.getHealthCode())) {
|
|
|
+ scanIdCardResult = this.deviceScanCode(shortTermDTO);
|
|
|
+ } else {
|
|
|
+ scanIdCardResult = this.deviceScanIdCardEncrypt(shortTermDTO);
|
|
|
+ }
|
|
|
|
|
|
- scanIdCardResult = this.deviceScanCode(shortTermDTO);
|
|
|
- }
|
|
|
+ if (scanIdCardResult == null || !scanIdCardResult.getCode().equals(Integer.valueOf(RestCode.SUCCESS.getCode()))) {
|
|
|
+ //场所码查询若不成功走之前的
|
|
|
+ userVO = this.getShortTermCertificate(shortTermDTO);
|
|
|
+ } else {
|
|
|
+ DeviceScanIdCardVO scanIdCardVO = scanIdCardResult.getData();
|
|
|
+ userVO = new HealtCodeUserVO();
|
|
|
+ //疫苗接种数量
|
|
|
+ userVO.setVaccineNum(scanIdCardVO.getVaccinated());
|
|
|
+ if (StrUtil.isNotEmpty(scanIdCardVO.getCheckTime())) {
|
|
|
+ //核酸记录
|
|
|
+ userVO.setNuclein(Lists.newArrayList(new HealtCodeNucleinVO().setChecktime(DateUtil.parseDateTime(scanIdCardVO.getCheckTime())).setReportTime(StrUtil.isEmpty(scanIdCardVO.getReportTime()) ? null : DateUtil.parseDateTime(scanIdCardVO.getReportTime())).setResult(scanIdCardVO.getCheckResult())));
|
|
|
} else {
|
|
|
- if (placeInfoVO.getScenicFlag()) {
|
|
|
- ScenicVerifyVO verifyVO = scenicServer.verify(new ScenicVerifyDTO().setIdNumber(shortTermDTO.getIdNumber()), placeInfoVO.getAdminId());
|
|
|
- if (!verifyVO.getReleaseStatus()) {
|
|
|
- throw new ServiceException(verifyVO.getMessage());
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- scanIdCardResult = this.deviceScanIdCardEncrypt(shortTermDTO);
|
|
|
+ userVO.setNuclein(Lists.newArrayList());
|
|
|
}
|
|
|
|
|
|
- if (scanIdCardResult == null || !scanIdCardResult.getCode().equals(Integer.valueOf(RestCode.SUCCESS.getCode()))) {
|
|
|
- //场所码查询若不成功走之前的
|
|
|
- userVO = this.getShortTermCertificate(shortTermDTO);
|
|
|
- } else {
|
|
|
- DeviceScanIdCardVO scanIdCardVO = scanIdCardResult.getData();
|
|
|
- userVO = new HealtCodeUserVO();
|
|
|
- //疫苗接种数量
|
|
|
- userVO.setVaccineNum(scanIdCardVO.getVaccinated());
|
|
|
- if (StrUtil.isNotEmpty(scanIdCardVO.getCheckTime())) {
|
|
|
- //核酸记录
|
|
|
- userVO.setNuclein(Lists.newArrayList(new HealtCodeNucleinVO().setChecktime(DateUtil.parseDateTime(scanIdCardVO.getCheckTime())).setReportTime(StrUtil.isEmpty(scanIdCardVO.getReportTime()) ? null : DateUtil.parseDateTime(scanIdCardVO.getReportTime())).setResult(scanIdCardVO.getCheckResult())));
|
|
|
- } else {
|
|
|
- userVO.setNuclein(Lists.newArrayList());
|
|
|
- }
|
|
|
-
|
|
|
- userVO.setData(Lists.newArrayList(new HealtCodeTypeVO().setMzt(HealthCodeLevelEnum.codeOf(scanIdCardVO.getLevel()).getDesc())));
|
|
|
- //行程信息
|
|
|
- userVO.setTravelValidation(scanIdCardVO.getTravelValidation());
|
|
|
- userVO.setUsername(StrUtil.isEmpty(shortTermDTO.getName()) ? scanIdCardVO.getUsername() : shortTermDTO.getName());
|
|
|
- PlaceRecordDTO placeRecordDTO = new PlaceRecordDTO().setName(StrUtil.isEmpty(shortTermDTO.getName()) ? scanIdCardVO.getUsername() : shortTermDTO.getName()).setIdNumber(shortTermDTO.getIdNumber()).setLevel(HealthCodeLevelEnum.codeOf(scanIdCardVO.getLevel()).getDesc())
|
|
|
- //检测时间
|
|
|
- .setCheckTime(scanIdCardVO.getCheckTime() == null ? null : DateUtil.parseDateTime(scanIdCardVO.getCheckTime()))
|
|
|
- //报告时间
|
|
|
- .setReportTime(scanIdCardVO.getReportTime() == null ? null : DateUtil.parseDateTime(scanIdCardVO.getReportTime()))
|
|
|
- //检测结果
|
|
|
- .setCheckResult(scanIdCardVO.getCheckResult()).setTravelValidation(scanIdCardVO.getTravelValidation()).setVaccinated(scanIdCardVO.getVaccinated()).setAddressCode(placeInfoVO.getAddressCode()).setUnitName(placeInfoVO.getUnitName()).setUnitAddress(placeInfoVO.getUnitAddress()).setManagerHealthCode(placeInfoVO.getManagerHealthCode()).setHealthCode(shortTermDTO.getHealthCode()).setAdminId(placeInfoVO.getAdminId()).setCreateTime(DateUtil.date());
|
|
|
- executor.execute(() -> {
|
|
|
- //保存场所记录
|
|
|
- placeHealthCodeServer.savePlaceRecord(placeRecordDTO);
|
|
|
- });
|
|
|
- }
|
|
|
- } else {
|
|
|
- //之前的健康码查询
|
|
|
- userVO = this.getShortTermCertificate(shortTermDTO);
|
|
|
+ userVO.setData(Lists.newArrayList(new HealtCodeTypeVO().setMzt(HealthCodeLevelEnum.codeOf(scanIdCardVO.getLevel()).getDesc())));
|
|
|
+ //行程信息
|
|
|
+ userVO.setTravelValidation(scanIdCardVO.getTravelValidation());
|
|
|
+ userVO.setUsername(StrUtil.isEmpty(shortTermDTO.getName()) ? scanIdCardVO.getUsername() : shortTermDTO.getName());
|
|
|
}
|
|
|
} else {
|
|
|
- //设备sn为空默认走之前的健康码查询
|
|
|
+ //之前的健康码查询
|
|
|
userVO = this.getShortTermCertificate(shortTermDTO);
|
|
|
}
|
|
|
|
|
@@ -296,16 +247,6 @@ 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;
|
|
|
-// }
|
|
|
- //TODO MOCK 测试 end
|
|
|
-
|
|
|
//用户核酸信息
|
|
|
List<HealtCodeNucleinVO> nucleinList = userVO.getNuclein();
|
|
|
if (CollectionUtil.isNotEmpty(nucleinList)) {
|
|
@@ -344,18 +285,13 @@ public class HealthCodeServiceImpl implements HealthCodeService {
|
|
|
}
|
|
|
userVO.setOpenMsg(openMsg).setOpenVoiceMsg(openMsg);
|
|
|
} else {
|
|
|
- if (placeInfoVO != null && placeInfoVO.getScenicFlag()){
|
|
|
- userVO.setIsOpen(HealthOpenEnum.RELEASE.getCode()).setOpenMsg("绿码,欢迎入园").setOpenVoiceMsg("绿码,欢迎入园");
|
|
|
- }else{
|
|
|
- userVO.setIsOpen(HealthOpenEnum.RELEASE.getCode()).setOpenMsg("绿码,请通行").setOpenVoiceMsg("绿码,请通行");
|
|
|
- }
|
|
|
+ userVO.setIsOpen(HealthOpenEnum.RELEASE.getCode()).setOpenMsg("绿码,请通行").setOpenVoiceMsg("绿码,请通行");
|
|
|
}
|
|
|
|
|
|
if (CollectionUtil.isNotEmpty(nucleinList)) {
|
|
|
HealtCodeNucleinVO nucleinVO = nucleinList.stream().findFirst().get();
|
|
|
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());
|
|
|
nucleinVO.setContent(new StringBuilder().append("结果未出").toString());
|
|
|
} else {
|
|
|
long betweenHour = DateUtil.between(nucleinVO.getShowTime(), DateUtil.date(), DateUnit.HOUR);
|
|
@@ -378,13 +314,6 @@ public class HealthCodeServiceImpl implements HealthCodeService {
|
|
|
.setVaccineIcoTitle("新冠疫苗").setVaccineIconUrl(HealthVaccineNumEnum.numOf(userVO.getVaccineNum()).getUrl()).setVaccineNumColor(ColorEnum.GREEN.getValue())
|
|
|
//行程信息
|
|
|
.setTravelValidationDesc(TravelValidationEnum.codeOf(userVO.getTravelValidation()).getDesc()).setTravelValidationTitle("动态行程卡").setTravelValidationIconUrl(TravelValidationEnum.codeOf(userVO.getTravelValidation()).getUrl());
|
|
|
- final PlaceInfoVO finalPlaceInfoVO = placeInfoVO;
|
|
|
- final HealtCodeUserVO finalUserVO = userVO;
|
|
|
- executor.execute(() -> {
|
|
|
- if (finalPlaceInfoVO != null && finalPlaceInfoVO.getScenicFlag() && finalUserVO.getIsOpen().equals(HealthOpenEnum.RELEASE.getCode())) {
|
|
|
- scenicServer.consume(new ScenicConsumeDTO().setIdNumber(shortTermDTO.getIdNumber()).setReservationCode(NumberUtil.isNumber(shortTermDTO.getHealthCode()) ? shortTermDTO.getHealthCode() : StrUtil.EMPTY), finalPlaceInfoVO.getAdminId());
|
|
|
- }
|
|
|
- });
|
|
|
return RestResponse.ok(userVO);
|
|
|
}
|
|
|
|
|
@@ -462,6 +391,15 @@ public class HealthCodeServiceImpl implements HealthCodeService {
|
|
|
return healthCodeServer.queryInfoByBarCode(healthCodeDTO.getBarCode());
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public RestResult saveHealthCodeConfig(HealthCodeConfigDTO configDTO) {
|
|
|
+ if(TokenEnum.codeOf(configDTO.getToken()) == null){
|
|
|
+ throw new ServiceException(700, "token有误,请检查");
|
|
|
+ }
|
|
|
+
|
|
|
+ return placeHealthCodeServer.saveHealthCodeConfig(configDTO);
|
|
|
+ }
|
|
|
+
|
|
|
public HealtCodeUserVO getShortTermUser(String sfzh, String name) throws Exception {
|
|
|
log.info("江干分局健康码传参,身份证{} 姓名 {}", sfzh, name);
|
|
|
JSONObject jsonObject = new JSONObject();
|