|
|
@ -53,6 +53,8 @@ public class HealthService implements IHealthService { |
|
|
|
@Autowired |
|
|
|
private HealthAbnormalDao healthAbnormalDao; |
|
|
|
@Autowired |
|
|
|
private RealNameAuthDao realNameAuthDao; |
|
|
|
@Autowired |
|
|
|
private RedisUtil redisUtil; |
|
|
|
@Autowired |
|
|
|
private IAsyncService asyncService; |
|
|
@ -93,20 +95,27 @@ public class HealthService implements IHealthService { |
|
|
|
//1、获取健康信息和userId
|
|
|
|
HealthDto.healthInfo healthInfo = params.getParam(); |
|
|
|
Long userId = params.getUserId(); |
|
|
|
//检查用户是否已认证
|
|
|
|
RealNameAuthExample realNameAuthExample = new RealNameAuthExample(); |
|
|
|
realNameAuthExample.createCriteria().andUserIdEqualTo(userId); |
|
|
|
List<RealNameAuth> realNameAuthList = realNameAuthDao.selectByExample(realNameAuthExample); |
|
|
|
if(CollectionUtil.isEmpty(realNameAuthList)){ |
|
|
|
throw new BaseException(CodeEnum.NOT_REAL_AUTH); |
|
|
|
} |
|
|
|
|
|
|
|
HealthVo.HealthTypeRedis healthType = readHealthType(healthInfo.getHealthTypeId()); |
|
|
|
//健康码颜色(默认绿色)
|
|
|
|
Future<String> future = null; |
|
|
|
if ("prod".equals(active)) { |
|
|
|
// if ("prod".equals(active)) {
|
|
|
|
//检查上报人员是否是已确诊
|
|
|
|
Boolean flag = isAbnormal(userId); |
|
|
|
|
|
|
|
WxXcxUtil.LineColor color = getLineColor(healthType,flag); |
|
|
|
WxXcxUtil.LineColor color = getLineColor(healthType,healthInfo,flag); |
|
|
|
future = asyncService.generateQRCode("d=" + userId, color); |
|
|
|
log.info("调用微信生成二维码"); |
|
|
|
} else { |
|
|
|
log.info("测试环境,不调用生成二维码"); |
|
|
|
} |
|
|
|
// } else {
|
|
|
|
// log.info("测试环境,不调用生成二维码");
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
//3、保存健康信息
|
|
|
@ -195,7 +204,7 @@ public class HealthService implements IHealthService { |
|
|
|
return false; |
|
|
|
} |
|
|
|
|
|
|
|
private WxXcxUtil.LineColor getLineColor(HealthVo.HealthTypeRedis healthType,Boolean flag) { |
|
|
|
private WxXcxUtil.LineColor getLineColor(HealthVo.HealthTypeRedis healthType, HealthDto.healthInfo healthInfo ,Boolean flag) { |
|
|
|
WxXcxUtil.LineColor color = new WxXcxUtil.LineColor(); |
|
|
|
if(flag){ |
|
|
|
color.r = "226"; |
|
|
@ -203,6 +212,12 @@ public class HealthService implements IHealthService { |
|
|
|
color.b = "24"; |
|
|
|
return color; |
|
|
|
} |
|
|
|
if(healthInfo.getTouchHubei() == 1 || healthInfo.getTouchOverseas() == 1 || healthInfo.getTouchSick() == 1){ |
|
|
|
color.r = "243"; |
|
|
|
color.g = "139"; |
|
|
|
color.b = "0"; |
|
|
|
return color; |
|
|
|
} |
|
|
|
if(healthType.getQuarantine() != 0) { |
|
|
|
color.r = "243"; |
|
|
|
color.g = "139"; |
|
|
|