diff --git a/health/src/main/java/com/ccsens/health/service/ClockService.java b/health/src/main/java/com/ccsens/health/service/ClockService.java index 9534cde9..491d3ccd 100644 --- a/health/src/main/java/com/ccsens/health/service/ClockService.java +++ b/health/src/main/java/com/ccsens/health/service/ClockService.java @@ -12,6 +12,7 @@ import com.ccsens.health.bean.dto.JourneyDto; import com.ccsens.health.bean.po.*; import com.ccsens.health.bean.vo.ClockVo; import com.ccsens.health.bean.vo.HealthVo; +import com.ccsens.health.persist.dao.RealNameAuthDao; import com.ccsens.health.persist.dao.SiteClockInDao; import com.ccsens.health.persist.dao.SiteDao; import com.ccsens.health.persist.dao.SiteQrcodeDao; @@ -47,6 +48,8 @@ public class ClockService implements IClockService { @Autowired private SiteClockInDao siteClockInDao; @Autowired + private RealNameAuthDao realNameAuthDao; + @Autowired private IUserService userService; @Autowired private TallFeignClient tallFeignClient; @@ -61,6 +64,13 @@ public class ClockService implements IClockService { //1、获取打卡信息和userId ClockDto.SiteDto clickIn = params.getParam(); Long userId = params.getUserId(); + //检查用户是否已认证 + RealNameAuthExample realNameAuthExample = new RealNameAuthExample(); + realNameAuthExample.createCriteria().andUserIdEqualTo(userId); + List realNameAuthList = realNameAuthDao.selectByExample(realNameAuthExample); + if(CollectionUtil.isEmpty(realNameAuthList)){ + throw new BaseException(CodeEnum.NOT_REAL_AUTH); + } //获取场所ID SiteQrcode siteQrcode = siteQrcodeDao.selectByPrimaryKey(clickIn.getSiteId()); log.info("打卡二维码:{}", siteQrcode); diff --git a/health/src/main/java/com/ccsens/health/service/HealthService.java b/health/src/main/java/com/ccsens/health/service/HealthService.java index a15a1b35..b3dc69d9 100644 --- a/health/src/main/java/com/ccsens/health/service/HealthService.java +++ b/health/src/main/java/com/ccsens/health/service/HealthService.java @@ -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 realNameAuthList = realNameAuthDao.selectByExample(realNameAuthExample); + if(CollectionUtil.isEmpty(realNameAuthList)){ + throw new BaseException(CodeEnum.NOT_REAL_AUTH); + } HealthVo.HealthTypeRedis healthType = readHealthType(healthInfo.getHealthTypeId()); //健康码颜色(默认绿色) Future 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"; diff --git a/health/src/main/java/com/ccsens/health/service/JourneyService.java b/health/src/main/java/com/ccsens/health/service/JourneyService.java index 6c9d98b5..0b40aaba 100644 --- a/health/src/main/java/com/ccsens/health/service/JourneyService.java +++ b/health/src/main/java/com/ccsens/health/service/JourneyService.java @@ -7,15 +7,13 @@ import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.StrUtil; import com.ccsens.cloudutil.feign.TallFeignClient; import com.ccsens.health.bean.dto.JourneyDto; -import com.ccsens.health.bean.po.Employee; -import com.ccsens.health.bean.po.EmployeeExample; -import com.ccsens.health.bean.po.Journey; -import com.ccsens.health.bean.po.JourneyAbnormal; +import com.ccsens.health.bean.po.*; import com.ccsens.health.bean.vo.JourneyVo; import com.ccsens.health.bean.vo.UserVo; import com.ccsens.health.persist.dao.EmployeeDao; import com.ccsens.health.persist.dao.JourneyAbnormalDao; import com.ccsens.health.persist.dao.JourneyDao; +import com.ccsens.health.persist.dao.RealNameAuthDao; import com.ccsens.health.util.HealthConstant; import com.ccsens.util.CodeEnum; import com.ccsens.util.DateUtil; @@ -47,6 +45,8 @@ public class JourneyService implements IJourneyService{ private TallFeignClient tallFeignClient; @Resource private RedisUtil redisUtil; + @Autowired + private RealNameAuthDao realNameAuthDao; @Resource private IStudentService studentService; @Resource @@ -106,6 +106,13 @@ public class JourneyService implements IJourneyService{ //1、获取用户id和传入信息 JourneyDto.JourneyInfo journeyInfo = params.getParam(); Long userId = params.getUserId(); + //检查用户是否已认证 + RealNameAuthExample realNameAuthExample = new RealNameAuthExample(); + realNameAuthExample.createCriteria().andUserIdEqualTo(userId); + List realNameAuthList = realNameAuthDao.selectByExample(realNameAuthExample); + if(CollectionUtil.isEmpty(realNameAuthList)){ + throw new BaseException(CodeEnum.NOT_REAL_AUTH); + } // //2、通过tallId找到health里的成员id // Employee employee = userService.getEmployeeByUserId(userId); //3、保存行程 diff --git a/health/src/main/resources/application.yml b/health/src/main/resources/application.yml index c3b11fb6..2fb38e57 100644 --- a/health/src/main/resources/application.yml +++ b/health/src/main/resources/application.yml @@ -1,4 +1,4 @@ spring: profiles: - active: test - include: common, util-test + active: dev + include: common, util-dev diff --git a/health/src/main/resources/mapper_dao/HealthRecordDao.xml b/health/src/main/resources/mapper_dao/HealthRecordDao.xml index 3f78dfe1..d6bfcf89 100644 --- a/health/src/main/resources/mapper_dao/HealthRecordDao.xml +++ b/health/src/main/resources/mapper_dao/HealthRecordDao.xml @@ -118,14 +118,26 @@