Browse Source

0402.1

master
zhangye 5 years ago
parent
commit
0d97f46aeb
  1. 10
      health/src/main/java/com/ccsens/health/service/ClockService.java
  2. 27
      health/src/main/java/com/ccsens/health/service/HealthService.java
  3. 15
      health/src/main/java/com/ccsens/health/service/JourneyService.java
  4. 4
      health/src/main/resources/application.yml
  5. 20
      health/src/main/resources/mapper_dao/HealthRecordDao.xml
  6. 1
      util/src/main/java/com/ccsens/util/CodeEnum.java

10
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<RealNameAuth> 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);

27
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<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";

15
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<RealNameAuth> 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、保存行程

4
health/src/main/resources/application.yml

@ -1,4 +1,4 @@
spring:
profiles:
active: test
include: common, util-test
active: dev
include: common, util-dev

20
health/src/main/resources/mapper_dao/HealthRecordDao.xml

@ -118,14 +118,26 @@
</select>
<select id="selectHealthTypeNumber" resultMap="resultMap_healthTypeNumber" parameterType="java.util.Map">
select
SELECT
if(t.independent = 1 , t.name , '其他') as name,
t.independent as independent,
count(*) as number
if(a.num is null ,0,a.num) as number
FROM
t_health_type t
left join
(
select
t.id as id,
count(r.id) as num
from
t_health_type t left join t_health_records r
on t.id = r.health_type_id
t_health_type t
left join t_health_records r on t.id = r.health_type_id
where
(r.time &lt;= #{endTime} or r.time is null)
and
(r.time &gt;= #{startTime} or r.time is null)
GROUP BY t.name
) a on t.id = a.id
</select>
<select id="getNotUpload" parameterType="java.util.Map" resultMap="resultMap_notUpload">

1
util/src/main/java/com/ccsens/util/CodeEnum.java

@ -106,6 +106,7 @@ public enum CodeEnum {
NO_IMPORT_DATA(88,"没有有效的数据,请检查您的导入文件。",true),
FILL_ERROR(89,"您的信息填写有误,请检查您的信息。",true),
ACCOUNT_BIND(90,"您的帐号已经绑定了,请重新进入小程序。",true),
NOT_REAL_AUTH(91,"您尚未认证,请认证后再试。",true),
;
public CodeEnum addMsg(String msg){

Loading…
Cancel
Save