|
|
@ -3,6 +3,7 @@ package com.ccsens.health.service; |
|
|
|
import cn.hutool.core.bean.BeanUtil; |
|
|
|
import cn.hutool.core.collection.CollectionUtil; |
|
|
|
import cn.hutool.core.lang.Snowflake; |
|
|
|
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; |
|
|
@ -43,19 +44,28 @@ public class UserService implements IUserService{ |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public UserVo.UserInfo getUserInfo(QueryDto<JourneyDto.SelectDate> params) throws Exception { |
|
|
|
public UserVo.UserInfo getUserInfo(QueryDto<JourneyDto.SelectUser> params) throws Exception { |
|
|
|
//1、获取查询时间和被查询成员的userId
|
|
|
|
JourneyDto.SelectDate selectDate = params.getParam(); |
|
|
|
Long startTime = selectDate.getStartTime() == null ? DateUtil.getZeroTime(new Date()) : selectDate.getStartTime(); |
|
|
|
Long endTime = selectDate.getEndTime() == null ? System.currentTimeMillis() : selectDate.getEndTime(); |
|
|
|
String userId = tallFeignClient.getUserId(selectDate.getToken()); |
|
|
|
if(StrUtil.isEmpty(userId)){ |
|
|
|
throw new BaseException(CodeEnum.NOT_LOGIN); |
|
|
|
JourneyDto.SelectUser selectUser = params.getParam(); |
|
|
|
Long startTime = selectUser.getStartTime() == null ? DateUtil.getZeroTime(new Date()) : selectUser.getStartTime(); |
|
|
|
Long endTime = selectUser.getEndTime() == null ? System.currentTimeMillis() : selectUser.getEndTime(); |
|
|
|
Long userId = null; |
|
|
|
if(ObjectUtil.isNotNull(selectUser.getUserId())){ |
|
|
|
userId = selectUser.getUserId(); |
|
|
|
}else { |
|
|
|
String id = tallFeignClient.getUserId(selectUser.getToken()); |
|
|
|
if(StrUtil.isNotEmpty(id)){ |
|
|
|
userId = Long.valueOf(id); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if(ObjectUtil.isNull(userId)){ |
|
|
|
throw new BaseException(CodeEnum.NOT_EMPLOYEE); |
|
|
|
} |
|
|
|
//查询信息
|
|
|
|
UserVo.UserInfo userInfoVo = new UserVo.UserInfo(); |
|
|
|
RealNameAuthExample realNameAuthExample = new RealNameAuthExample(); |
|
|
|
realNameAuthExample.createCriteria().andUserIdEqualTo(Long.valueOf(userId)); |
|
|
|
realNameAuthExample.createCriteria().andUserIdEqualTo(userId); |
|
|
|
List<RealNameAuth> realNameAuthList = realNameAuthDao.selectByExample(realNameAuthExample); |
|
|
|
if(CollectionUtil.isNotEmpty(realNameAuthList)){ |
|
|
|
userInfoVo = new UserVo.UserInfo(); |
|
|
@ -63,7 +73,7 @@ public class UserService implements IUserService{ |
|
|
|
} |
|
|
|
|
|
|
|
//查询健康码
|
|
|
|
List<UserVo.HealthCode> healthCodeList = healthRecordsDao.getHealthQrCodeByEmployeeId(Long.valueOf(userId),startTime,endTime); |
|
|
|
List<UserVo.HealthCode> healthCodeList = healthRecordsDao.getHealthQrCodeByEmployeeId(userId,startTime,endTime); |
|
|
|
|
|
|
|
userInfoVo.setHealthCodeList(healthCodeList); |
|
|
|
|
|
|
|