Browse Source

添加二维码测试

master
zhangye 6 years ago
parent
commit
ee791b38f0
  1. 15
      health/src/main/java/com/ccsens/health/api/DebugController.java
  2. 3
      health/src/main/java/com/ccsens/health/api/UserController.java
  3. 4
      health/src/main/java/com/ccsens/health/bean/dto/UserDto.java
  4. 20
      health/src/main/java/com/ccsens/health/bean/po/RealNameAuth.java
  5. 78
      health/src/main/java/com/ccsens/health/bean/po/RealNameAuthExample.java
  6. 9
      health/src/main/java/com/ccsens/health/bean/vo/HealthVo.java
  7. 17
      health/src/main/java/com/ccsens/health/bean/vo/UserVo.java
  8. 5
      health/src/main/java/com/ccsens/health/persist/dao/HealthRecordsDao.java
  9. 8
      health/src/main/java/com/ccsens/health/persist/dao/RealNameAuthDao.java
  10. 20
      health/src/main/java/com/ccsens/health/service/HealthService.java
  11. 3
      health/src/main/java/com/ccsens/health/service/IUserService.java
  12. 55
      health/src/main/java/com/ccsens/health/service/UserService.java
  13. 46
      health/src/main/resources/mapper_dao/HealthRecordDao.xml
  14. 40
      health/src/main/resources/mapper_raw/RealNameAuthMapper.xml
  15. 1
      util/home
  16. 8
      util/src/main/java/com/ccsens/util/wx/WxGzhUtil.java
  17. 29
      util/src/test/java/com/ccsens/util/Base64Test.java

15
health/src/main/java/com/ccsens/health/api/DebugController.java

@ -1,6 +1,8 @@
package com.ccsens.health.api; package com.ccsens.health.api;
import com.ccsens.util.JsonResponse; import com.ccsens.util.JsonResponse;
import com.ccsens.util.WebConstant;
import com.ccsens.util.wx.WxXcxUtil;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
@ -15,14 +17,23 @@ import javax.servlet.http.HttpServletRequest;
@RequestMapping("/debug") @RequestMapping("/debug")
public class DebugController { public class DebugController {
@ApiOperation(value = "/测试",notes = "") @ApiOperation(value = "/测试",notes = "")
@ApiImplicitParams({ @ApiImplicitParams({
}) })
@RequestMapping(value="",method = RequestMethod.GET,produces = {"application/json;charset=UTF-8"}) @RequestMapping(value="",method = RequestMethod.GET,produces = {"application/json;charset=UTF-8"})
public JsonResponse getSmsCode(HttpServletRequest request) throws Exception { public JsonResponse debug(HttpServletRequest request) throws Exception {
return JsonResponse.newInstance().ok("测试"); return JsonResponse.newInstance().ok("测试");
} }
@ApiOperation(value = "/测试二维码",notes = "")
@ApiImplicitParams({
})
@RequestMapping(value="qrcode",method = RequestMethod.GET,produces = {"application/json;charset=UTF-8"})
public JsonResponse qrcode(HttpServletRequest request) throws Exception {
WxXcxUtil.getWxCode("pages/sign/sign?siteId=1235756988936359936&scene=1011&siteName=TSG&type=in"
,"1011", WebConstant.UPLOAD_PATH_BASE);
return JsonResponse.newInstance().ok("完成");
}
} }

3
health/src/main/java/com/ccsens/health/api/UserController.java

@ -1,6 +1,7 @@
package com.ccsens.health.api; package com.ccsens.health.api;
import com.ccsens.cloudutil.annotation.MustLogin; import com.ccsens.cloudutil.annotation.MustLogin;
import com.ccsens.health.bean.dto.JourneyDto;
import com.ccsens.health.bean.dto.UserDto; import com.ccsens.health.bean.dto.UserDto;
import com.ccsens.health.bean.vo.UserVo; import com.ccsens.health.bean.vo.UserVo;
import com.ccsens.health.service.IUserService; import com.ccsens.health.service.IUserService;
@ -29,7 +30,7 @@ public class UserController {
@MustLogin @MustLogin
@ApiOperation(value = "查询个人信息", notes = "") @ApiOperation(value = "查询个人信息", notes = "")
@RequestMapping(value = "info", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) @RequestMapping(value = "info", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse<UserVo.UserInfo> getUserInfo(@ApiParam @Validated @RequestBody QueryDto params) throws Exception { public JsonResponse<UserVo.UserInfo> getUserInfo(@ApiParam @Validated @RequestBody QueryDto<JourneyDto.SelectDate> params) throws Exception {
log.info("查询个人信息:{}",params); log.info("查询个人信息:{}",params);
UserVo.UserInfo userInfo = userService.getUserInfo(params); UserVo.UserInfo userInfo = userService.getUserInfo(params);
return JsonResponse.newInstance().ok(userInfo); return JsonResponse.newInstance().ok(userInfo);

4
health/src/main/java/com/ccsens/health/bean/dto/UserDto.java

@ -13,11 +13,11 @@ public class UserDto {
@ApiModelProperty("姓名") @ApiModelProperty("姓名")
private String name; private String name;
@ApiModelProperty("身份证号") @ApiModelProperty("身份证号")
private String IDCard; private String idCard;
@ApiModelProperty("身份 0学生 1老师 2工作人员") @ApiModelProperty("身份 0学生 1老师 2工作人员")
private int post; private int post;
@ApiModelProperty("学号") @ApiModelProperty("学号")
private int no; private String no;
@ApiModelProperty("手机号") @ApiModelProperty("手机号")
private String phone; private String phone;
} }

20
health/src/main/java/com/ccsens/health/bean/po/RealNameAuth.java

@ -6,9 +6,9 @@ import java.util.Date;
public class RealNameAuth implements Serializable { public class RealNameAuth implements Serializable {
private Long id; private Long id;
private Long employeeId; private Long userId;
private Long idCard; private String idCard;
private String name; private String name;
@ -34,20 +34,20 @@ public class RealNameAuth implements Serializable {
this.id = id; this.id = id;
} }
public Long getEmployeeId() { public Long getUserId() {
return employeeId; return userId;
} }
public void setEmployeeId(Long employeeId) { public void setUserId(Long userId) {
this.employeeId = employeeId; this.userId = userId;
} }
public Long getIdCard() { public String getIdCard() {
return idCard; return idCard;
} }
public void setIdCard(Long idCard) { public void setIdCard(String idCard) {
this.idCard = idCard; this.idCard = idCard == null ? null : idCard.trim();
} }
public String getName() { public String getName() {
@ -113,7 +113,7 @@ public class RealNameAuth implements Serializable {
sb.append(" ["); sb.append(" [");
sb.append("Hash = ").append(hashCode()); sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id); sb.append(", id=").append(id);
sb.append(", employeeId=").append(employeeId); sb.append(", userId=").append(userId);
sb.append(", idCard=").append(idCard); sb.append(", idCard=").append(idCard);
sb.append(", name=").append(name); sb.append(", name=").append(name);
sb.append(", post=").append(post); sb.append(", post=").append(post);

78
health/src/main/java/com/ccsens/health/bean/po/RealNameAuthExample.java

@ -165,63 +165,63 @@ public class RealNameAuthExample {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andEmployeeIdIsNull() { public Criteria andUserIdIsNull() {
addCriterion("employee_id is null"); addCriterion("user_id is null");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andEmployeeIdIsNotNull() { public Criteria andUserIdIsNotNull() {
addCriterion("employee_id is not null"); addCriterion("user_id is not null");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andEmployeeIdEqualTo(Long value) { public Criteria andUserIdEqualTo(Long value) {
addCriterion("employee_id =", value, "employeeId"); addCriterion("user_id =", value, "userId");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andEmployeeIdNotEqualTo(Long value) { public Criteria andUserIdNotEqualTo(Long value) {
addCriterion("employee_id <>", value, "employeeId"); addCriterion("user_id <>", value, "userId");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andEmployeeIdGreaterThan(Long value) { public Criteria andUserIdGreaterThan(Long value) {
addCriterion("employee_id >", value, "employeeId"); addCriterion("user_id >", value, "userId");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andEmployeeIdGreaterThanOrEqualTo(Long value) { public Criteria andUserIdGreaterThanOrEqualTo(Long value) {
addCriterion("employee_id >=", value, "employeeId"); addCriterion("user_id >=", value, "userId");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andEmployeeIdLessThan(Long value) { public Criteria andUserIdLessThan(Long value) {
addCriterion("employee_id <", value, "employeeId"); addCriterion("user_id <", value, "userId");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andEmployeeIdLessThanOrEqualTo(Long value) { public Criteria andUserIdLessThanOrEqualTo(Long value) {
addCriterion("employee_id <=", value, "employeeId"); addCriterion("user_id <=", value, "userId");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andEmployeeIdIn(List<Long> values) { public Criteria andUserIdIn(List<Long> values) {
addCriterion("employee_id in", values, "employeeId"); addCriterion("user_id in", values, "userId");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andEmployeeIdNotIn(List<Long> values) { public Criteria andUserIdNotIn(List<Long> values) {
addCriterion("employee_id not in", values, "employeeId"); addCriterion("user_id not in", values, "userId");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andEmployeeIdBetween(Long value1, Long value2) { public Criteria andUserIdBetween(Long value1, Long value2) {
addCriterion("employee_id between", value1, value2, "employeeId"); addCriterion("user_id between", value1, value2, "userId");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andEmployeeIdNotBetween(Long value1, Long value2) { public Criteria andUserIdNotBetween(Long value1, Long value2) {
addCriterion("employee_id not between", value1, value2, "employeeId"); addCriterion("user_id not between", value1, value2, "userId");
return (Criteria) this; return (Criteria) this;
} }
@ -235,52 +235,62 @@ public class RealNameAuthExample {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andIdCardEqualTo(Long value) { public Criteria andIdCardEqualTo(String value) {
addCriterion("id_card =", value, "idCard"); addCriterion("id_card =", value, "idCard");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andIdCardNotEqualTo(Long value) { public Criteria andIdCardNotEqualTo(String value) {
addCriterion("id_card <>", value, "idCard"); addCriterion("id_card <>", value, "idCard");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andIdCardGreaterThan(Long value) { public Criteria andIdCardGreaterThan(String value) {
addCriterion("id_card >", value, "idCard"); addCriterion("id_card >", value, "idCard");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andIdCardGreaterThanOrEqualTo(Long value) { public Criteria andIdCardGreaterThanOrEqualTo(String value) {
addCriterion("id_card >=", value, "idCard"); addCriterion("id_card >=", value, "idCard");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andIdCardLessThan(Long value) { public Criteria andIdCardLessThan(String value) {
addCriterion("id_card <", value, "idCard"); addCriterion("id_card <", value, "idCard");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andIdCardLessThanOrEqualTo(Long value) { public Criteria andIdCardLessThanOrEqualTo(String value) {
addCriterion("id_card <=", value, "idCard"); addCriterion("id_card <=", value, "idCard");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andIdCardIn(List<Long> values) { public Criteria andIdCardLike(String value) {
addCriterion("id_card like", value, "idCard");
return (Criteria) this;
}
public Criteria andIdCardNotLike(String value) {
addCriterion("id_card not like", value, "idCard");
return (Criteria) this;
}
public Criteria andIdCardIn(List<String> values) {
addCriterion("id_card in", values, "idCard"); addCriterion("id_card in", values, "idCard");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andIdCardNotIn(List<Long> values) { public Criteria andIdCardNotIn(List<String> values) {
addCriterion("id_card not in", values, "idCard"); addCriterion("id_card not in", values, "idCard");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andIdCardBetween(Long value1, Long value2) { public Criteria andIdCardBetween(String value1, String value2) {
addCriterion("id_card between", value1, value2, "idCard"); addCriterion("id_card between", value1, value2, "idCard");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andIdCardNotBetween(Long value1, Long value2) { public Criteria andIdCardNotBetween(String value1, String value2) {
addCriterion("id_card not between", value1, value2, "idCard"); addCriterion("id_card not between", value1, value2, "idCard");
return (Criteria) this; return (Criteria) this;
} }

9
health/src/main/java/com/ccsens/health/bean/vo/HealthVo.java

@ -50,12 +50,17 @@ public class HealthVo {
@Data @Data
@ApiModel("健康状态") @ApiModel("健康状态")
public static class HealthTypeStatistics{ public static class HealthTypeStatistics{
@ApiModelProperty("id")
private Long id;
@ApiModelProperty("状态名") @ApiModelProperty("状态名")
private String name; private String name;
@ApiModelProperty("人数") @ApiModelProperty("人数")
private Integer number; private Integer number;
} }
@Data
public static class NotUpload{
//打卡次数不足的人数
private int number;
//已打卡次数
private int times;
}
} }

17
health/src/main/java/com/ccsens/health/bean/vo/UserVo.java

@ -4,6 +4,8 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import java.util.List;
@Data @Data
public class UserVo { public class UserVo {
@ -15,14 +17,25 @@ public class UserVo {
@ApiModelProperty("姓名") @ApiModelProperty("姓名")
private String name; private String name;
@ApiModelProperty("身份证号") @ApiModelProperty("身份证号")
private String IDCard; private String idCard;
@ApiModelProperty("身份 0学生 1老师 2工作人员") @ApiModelProperty("身份 0学生 1老师 2工作人员")
private int post; private int post;
@ApiModelProperty("学号") @ApiModelProperty("学号")
private int no; private String no;
@ApiModelProperty("手机号") @ApiModelProperty("手机号")
private String phone; private String phone;
@ApiModelProperty("健康码") @ApiModelProperty("健康码")
private List<HealthCode> healthCodeList;
}
@Data
@ApiModel("查询个人信息")
public static class HealthCode{
@ApiModelProperty("打卡时间")
private Long time;
@ApiModelProperty("健康码等级 0正常 1隔离中或疑似 2确诊")
private int healthLevel;
@ApiModelProperty("健康码")
private String healthCode; private String healthCode;
} }
} }

5
health/src/main/java/com/ccsens/health/persist/dao/HealthRecordsDao.java

@ -2,6 +2,7 @@ package com.ccsens.health.persist.dao;
import com.ccsens.health.bean.po.HealthRecords; import com.ccsens.health.bean.po.HealthRecords;
import com.ccsens.health.bean.vo.HealthVo; import com.ccsens.health.bean.vo.HealthVo;
import com.ccsens.health.bean.vo.UserVo;
import com.ccsens.health.persist.mapper.HealthRecordsMapper; import com.ccsens.health.persist.mapper.HealthRecordsMapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
@ -13,4 +14,8 @@ public interface HealthRecordsDao extends HealthRecordsMapper {
List<HealthVo.HealthInfo> selectHealthInfoByDate(@Param("employeeId")Long employeeId, @Param("startTime")Long startTime, @Param("endTime")Long endTime); List<HealthVo.HealthInfo> selectHealthInfoByDate(@Param("employeeId")Long employeeId, @Param("startTime")Long startTime, @Param("endTime")Long endTime);
int selectByTypeId(@Param("healthTypeId")Long healthTypeId, @Param("startTime")Long startTime, @Param("endTime")Long endTime); int selectByTypeId(@Param("healthTypeId")Long healthTypeId, @Param("startTime")Long startTime, @Param("endTime")Long endTime);
List<UserVo.HealthCode> getHealthQrCodeByEmployeeId(@Param("employeeId")Long employeeId, @Param("startTime")Long startTime, @Param("endTime")Long endTime);
HealthVo.NotUpload getNotUpload( @Param("days")Long days, @Param("startTime")Long startTime, @Param("endTime")Long endTime);
} }

8
health/src/main/java/com/ccsens/health/persist/dao/RealNameAuthDao.java

@ -0,0 +1,8 @@
package com.ccsens.health.persist.dao;
import com.ccsens.health.persist.mapper.RealNameAuthMapper;
import org.springframework.stereotype.Repository;
@Repository
public interface RealNameAuthDao extends RealNameAuthMapper {
}

20
health/src/main/java/com/ccsens/health/service/HealthService.java

@ -3,6 +3,7 @@ package com.ccsens.health.service;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.lang.Snowflake; import cn.hutool.core.lang.Snowflake;
import cn.hutool.core.util.ObjectUtil;
import com.ccsens.cloudutil.feign.TallFeignClient; import com.ccsens.cloudutil.feign.TallFeignClient;
import com.ccsens.health.bean.dto.HealthDto; import com.ccsens.health.bean.dto.HealthDto;
import com.ccsens.health.bean.dto.JourneyDto; import com.ccsens.health.bean.dto.JourneyDto;
@ -131,10 +132,6 @@ public class HealthService implements IHealthService{
JourneyDto.StatisticsDate statisticsDate = params.getParam(); JourneyDto.StatisticsDate statisticsDate = params.getParam();
Long startTime = statisticsDate.getStartTime() == null ? DateUtil.getZeroTime(new Date()) : statisticsDate.getStartTime(); Long startTime = statisticsDate.getStartTime() == null ? DateUtil.getZeroTime(new Date()) : statisticsDate.getStartTime();
Long endTime = statisticsDate.getEndTime() == null ? System.currentTimeMillis() : statisticsDate.getEndTime(); Long endTime = statisticsDate.getEndTime() == null ? System.currentTimeMillis() : statisticsDate.getEndTime();
// Map<String, Long> timeMap = new HashMap<>();
// timeMap = DateUtil.projectFormatDateTime(date);
// Long startMillisTime = timeMap.get("startMillisTime");
// Long endMillisTime = timeMap.get("endMillisTime");
//2、获取所有健康状态 //2、获取所有健康状态
int otherNumber = 0; int otherNumber = 0;
@ -161,6 +158,21 @@ public class HealthService implements IHealthService{
healthTypeStatistics.setName("其他"); healthTypeStatistics.setName("其他");
healthTypeStatistics.setNumber(otherNumber); healthTypeStatistics.setNumber(otherNumber);
healthTypeStatisticsList.add(healthTypeStatistics); healthTypeStatisticsList.add(healthTypeStatistics);
//获取查询的天数(正常应该一天打卡一次)
Long days = (endTime - startTime) / (3600 * 24 * 1000) + 1;
//未上报的次数
HealthVo.NotUpload notUpload = healthRecordsDao.getNotUpload(days,startTime,endTime);
HealthVo.HealthTypeStatistics notUploadStatistics = new HealthVo.HealthTypeStatistics();
notUploadStatistics.setName("未上报");
if(ObjectUtil.isNotNull(notUpload)){
notUploadStatistics.setNumber((int) (notUpload.getNumber() * days - notUpload.getTimes()));
}else {
notUploadStatistics.setNumber(0);
}
healthTypeStatisticsList.add(notUploadStatistics);
} }
return healthTypeStatisticsList; return healthTypeStatisticsList;
} }

3
health/src/main/java/com/ccsens/health/service/IUserService.java

@ -1,12 +1,13 @@
package com.ccsens.health.service; package com.ccsens.health.service;
import com.ccsens.health.bean.dto.JourneyDto;
import com.ccsens.health.bean.dto.UserDto; import com.ccsens.health.bean.dto.UserDto;
import com.ccsens.health.bean.po.Employee; import com.ccsens.health.bean.po.Employee;
import com.ccsens.health.bean.vo.UserVo; import com.ccsens.health.bean.vo.UserVo;
import com.ccsens.util.bean.dto.QueryDto; import com.ccsens.util.bean.dto.QueryDto;
public interface IUserService { public interface IUserService {
UserVo.UserInfo getUserInfo(QueryDto params); UserVo.UserInfo getUserInfo(QueryDto<JourneyDto.SelectDate> params) throws Exception;
UserVo.UserInfo addUserInfo(QueryDto<UserDto.UserInfo> params); UserVo.UserInfo addUserInfo(QueryDto<UserDto.UserInfo> params);

55
health/src/main/java/com/ccsens/health/service/UserService.java

@ -1,23 +1,43 @@
package com.ccsens.health.service; package com.ccsens.health.service;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.lang.Snowflake;
import com.ccsens.cloudutil.feign.TallFeignClient;
import com.ccsens.health.bean.dto.JourneyDto;
import com.ccsens.health.bean.dto.UserDto; import com.ccsens.health.bean.dto.UserDto;
import com.ccsens.health.bean.po.Employee; import com.ccsens.health.bean.po.Employee;
import com.ccsens.health.bean.po.EmployeeExample; import com.ccsens.health.bean.po.EmployeeExample;
import com.ccsens.health.bean.po.HealthQRCodeExample;
import com.ccsens.health.bean.po.RealNameAuth;
import com.ccsens.health.bean.vo.UserVo; import com.ccsens.health.bean.vo.UserVo;
import com.ccsens.health.persist.dao.EmployeeDao; import com.ccsens.health.persist.dao.EmployeeDao;
import com.ccsens.health.persist.dao.HealthRecordsDao;
import com.ccsens.health.persist.dao.RealNameAuthDao;
import com.ccsens.health.persist.mapper.HealthQRCodeMapper;
import com.ccsens.util.CodeEnum; import com.ccsens.util.CodeEnum;
import com.ccsens.util.DateUtil;
import com.ccsens.util.bean.dto.QueryDto; import com.ccsens.util.bean.dto.QueryDto;
import com.ccsens.util.exception.BaseException; import com.ccsens.util.exception.BaseException;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Date;
import java.util.List; import java.util.List;
@Service @Service
public class UserService implements IUserService{ public class UserService implements IUserService{
@Autowired @Autowired
private EmployeeDao employeeDao; private EmployeeDao employeeDao;
@Autowired
private Snowflake snowflake;
@Autowired
private RealNameAuthDao realNameAuthDao;
@Autowired
private TallFeignClient tallFeignClient;
@Autowired
private HealthRecordsDao healthRecordsDao;
/** /**
* 查询个人信息 * 查询个人信息
@ -25,9 +45,23 @@ public class UserService implements IUserService{
* @return * @return
*/ */
@Override @Override
public UserVo.UserInfo getUserInfo(QueryDto params) { public UserVo.UserInfo getUserInfo(QueryDto<JourneyDto.SelectDate> params) throws Exception {
//查询自己的信息 //1、获取查询时间和被查询成员的userId
return null; 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());
//查询信息
RealNameAuth realNameAuth = realNameAuthDao.selectByPrimaryKey(Long.valueOf(userId));
UserVo.UserInfo userInfoVo = new UserVo.UserInfo();
BeanUtil.copyProperties(realNameAuth,userInfoVo);
//查询健康码
Employee employee = getEmployeeByUserId(Long.valueOf(userId));
List<UserVo.HealthCode> healthCodeList = healthRecordsDao.getHealthQrCodeByEmployeeId(employee.getId(),startTime,endTime);
userInfoVo.setHealthCodeList(healthCodeList);
return userInfoVo;
} }
/** /**
@ -38,11 +72,22 @@ public class UserService implements IUserService{
@Override @Override
public UserVo.UserInfo addUserInfo(QueryDto<UserDto.UserInfo> params) { public UserVo.UserInfo addUserInfo(QueryDto<UserDto.UserInfo> params) {
//获取个人信息和tall的userId //获取个人信息和tall的userId
//查询对应的成员id UserDto.UserInfo userInfo = params.getParam();
Long userId = params.getUserId();
//实名认证,检查是否属于该学校的学生 //实名认证,检查是否属于该学校的学生
//保存信息 //保存信息
RealNameAuth realNameAuth = new RealNameAuth();
realNameAuth.setId(snowflake.nextId());
realNameAuth.setIdCard(userInfo.getIdCard());
realNameAuth.setName(userInfo.getName());
realNameAuth.setNo(userInfo.getNo());
realNameAuth.setPost((byte) userInfo.getPost());
realNameAuth.setPhone(userInfo.getPhone());
realNameAuthDao.insertSelective(realNameAuth);
//返回 //返回
return null; UserVo.UserInfo userInfoVo = new UserVo.UserInfo();
BeanUtil.copyProperties(realNameAuth,userInfoVo);
return userInfoVo;
} }

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

@ -15,6 +15,16 @@
<result column="hHealthCode" property="healthCode"/> <result column="hHealthCode" property="healthCode"/>
</resultMap> </resultMap>
<resultMap id="resultMap_healthCode" type="com.ccsens.health.bean.vo.UserVo$HealthCode">
<result column="hTime" property="time"/>
<result column="hHealthCode" property="healthCode"/>
</resultMap>
<resultMap id="resultMap_notUpload" type="com.ccsens.health.bean.vo.HealthVo$NotUpload">
<result column="number" property="number"/>
<result column="times" property="times"/>
</resultMap>
<select id="selectHealthInfoByDate" resultMap="resultMap_HealthInfo" parameterType="java.util.Map"> <select id="selectHealthInfoByDate" resultMap="resultMap_HealthInfo" parameterType="java.util.Map">
select select
h.id as hId, h.id as hId,
@ -57,4 +67,40 @@
h.time &gt;= #{startTime} h.time &gt;= #{startTime}
</select> </select>
<select id="getHealthQrCodeByEmployeeId" resultMap="resultMap_healthCode" parameterType="java.util.Map">
select
h.time as hTime,
q.qrcode_path as hHealthCode
from
t_health_records h join t_health_qrcode q on q.health_records_id = h.id
where
h.rec_status = 0
and
h.employee_id = #{employeeId}
and
h.time &lt;= #{endTime}
and
h.time &gt;= #{startTime}
ORDER By h.time DESC
</select>
<select id="getNotUpload" parameterType="java.util.Map" resultMap="resultMap_notUpload">
SELECT
count(*) as number,
a.times as times
FROM
(
SELECT
count(*) as times
FROM
t_employee e LEFT JOIN t_health_records r on e.id = r.employee_id
where
r.time &lt;= #{endTime}
and
r.time &gt;= #{startTime}
GROUP BY e.id
)a
WHERE
a.times &lt; #{days}
</select>
</mapper> </mapper>

40
health/src/main/resources/mapper_raw/RealNameAuthMapper.xml

@ -3,8 +3,8 @@
<mapper namespace="com.ccsens.health.persist.mapper.RealNameAuthMapper"> <mapper namespace="com.ccsens.health.persist.mapper.RealNameAuthMapper">
<resultMap id="BaseResultMap" type="com.ccsens.health.bean.po.RealNameAuth"> <resultMap id="BaseResultMap" type="com.ccsens.health.bean.po.RealNameAuth">
<id column="id" jdbcType="BIGINT" property="id" /> <id column="id" jdbcType="BIGINT" property="id" />
<result column="employee_id" jdbcType="BIGINT" property="employeeId" /> <result column="user_id" jdbcType="BIGINT" property="userId" />
<result column="id_card" jdbcType="BIGINT" property="idCard" /> <result column="id_card" jdbcType="VARCHAR" property="idCard" />
<result column="name" jdbcType="VARCHAR" property="name" /> <result column="name" jdbcType="VARCHAR" property="name" />
<result column="post" jdbcType="TINYINT" property="post" /> <result column="post" jdbcType="TINYINT" property="post" />
<result column="no" jdbcType="VARCHAR" property="no" /> <result column="no" jdbcType="VARCHAR" property="no" />
@ -72,7 +72,7 @@
</where> </where>
</sql> </sql>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, employee_id, id_card, name, post, no, phone, created_at, updated_at, rec_status id, user_id, id_card, name, post, no, phone, created_at, updated_at, rec_status
</sql> </sql>
<select id="selectByExample" parameterType="com.ccsens.health.bean.po.RealNameAuthExample" resultMap="BaseResultMap"> <select id="selectByExample" parameterType="com.ccsens.health.bean.po.RealNameAuthExample" resultMap="BaseResultMap">
select select
@ -105,11 +105,11 @@
</if> </if>
</delete> </delete>
<insert id="insert" parameterType="com.ccsens.health.bean.po.RealNameAuth"> <insert id="insert" parameterType="com.ccsens.health.bean.po.RealNameAuth">
insert into t_real_name_auth (id, employee_id, id_card, insert into t_real_name_auth (id, user_id, id_card,
name, post, no, phone, name, post, no, phone,
created_at, updated_at, rec_status created_at, updated_at, rec_status
) )
values (#{id,jdbcType=BIGINT}, #{employeeId,jdbcType=BIGINT}, #{idCard,jdbcType=BIGINT}, values (#{id,jdbcType=BIGINT}, #{userId,jdbcType=BIGINT}, #{idCard,jdbcType=VARCHAR},
#{name,jdbcType=VARCHAR}, #{post,jdbcType=TINYINT}, #{no,jdbcType=VARCHAR}, #{phone,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{post,jdbcType=TINYINT}, #{no,jdbcType=VARCHAR}, #{phone,jdbcType=VARCHAR},
#{createdAt,jdbcType=TIMESTAMP}, #{updatedAt,jdbcType=TIMESTAMP}, #{recStatus,jdbcType=TINYINT} #{createdAt,jdbcType=TIMESTAMP}, #{updatedAt,jdbcType=TIMESTAMP}, #{recStatus,jdbcType=TINYINT}
) )
@ -120,8 +120,8 @@
<if test="id != null"> <if test="id != null">
id, id,
</if> </if>
<if test="employeeId != null"> <if test="userId != null">
employee_id, user_id,
</if> </if>
<if test="idCard != null"> <if test="idCard != null">
id_card, id_card,
@ -152,11 +152,11 @@
<if test="id != null"> <if test="id != null">
#{id,jdbcType=BIGINT}, #{id,jdbcType=BIGINT},
</if> </if>
<if test="employeeId != null"> <if test="userId != null">
#{employeeId,jdbcType=BIGINT}, #{userId,jdbcType=BIGINT},
</if> </if>
<if test="idCard != null"> <if test="idCard != null">
#{idCard,jdbcType=BIGINT}, #{idCard,jdbcType=VARCHAR},
</if> </if>
<if test="name != null"> <if test="name != null">
#{name,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR},
@ -193,11 +193,11 @@
<if test="record.id != null"> <if test="record.id != null">
id = #{record.id,jdbcType=BIGINT}, id = #{record.id,jdbcType=BIGINT},
</if> </if>
<if test="record.employeeId != null"> <if test="record.userId != null">
employee_id = #{record.employeeId,jdbcType=BIGINT}, user_id = #{record.userId,jdbcType=BIGINT},
</if> </if>
<if test="record.idCard != null"> <if test="record.idCard != null">
id_card = #{record.idCard,jdbcType=BIGINT}, id_card = #{record.idCard,jdbcType=VARCHAR},
</if> </if>
<if test="record.name != null"> <if test="record.name != null">
name = #{record.name,jdbcType=VARCHAR}, name = #{record.name,jdbcType=VARCHAR},
@ -228,8 +228,8 @@
<update id="updateByExample" parameterType="map"> <update id="updateByExample" parameterType="map">
update t_real_name_auth update t_real_name_auth
set id = #{record.id,jdbcType=BIGINT}, set id = #{record.id,jdbcType=BIGINT},
employee_id = #{record.employeeId,jdbcType=BIGINT}, user_id = #{record.userId,jdbcType=BIGINT},
id_card = #{record.idCard,jdbcType=BIGINT}, id_card = #{record.idCard,jdbcType=VARCHAR},
name = #{record.name,jdbcType=VARCHAR}, name = #{record.name,jdbcType=VARCHAR},
post = #{record.post,jdbcType=TINYINT}, post = #{record.post,jdbcType=TINYINT},
no = #{record.no,jdbcType=VARCHAR}, no = #{record.no,jdbcType=VARCHAR},
@ -244,11 +244,11 @@
<update id="updateByPrimaryKeySelective" parameterType="com.ccsens.health.bean.po.RealNameAuth"> <update id="updateByPrimaryKeySelective" parameterType="com.ccsens.health.bean.po.RealNameAuth">
update t_real_name_auth update t_real_name_auth
<set> <set>
<if test="employeeId != null"> <if test="userId != null">
employee_id = #{employeeId,jdbcType=BIGINT}, user_id = #{userId,jdbcType=BIGINT},
</if> </if>
<if test="idCard != null"> <if test="idCard != null">
id_card = #{idCard,jdbcType=BIGINT}, id_card = #{idCard,jdbcType=VARCHAR},
</if> </if>
<if test="name != null"> <if test="name != null">
name = #{name,jdbcType=VARCHAR}, name = #{name,jdbcType=VARCHAR},
@ -276,8 +276,8 @@
</update> </update>
<update id="updateByPrimaryKey" parameterType="com.ccsens.health.bean.po.RealNameAuth"> <update id="updateByPrimaryKey" parameterType="com.ccsens.health.bean.po.RealNameAuth">
update t_real_name_auth update t_real_name_auth
set employee_id = #{employeeId,jdbcType=BIGINT}, set user_id = #{userId,jdbcType=BIGINT},
id_card = #{idCard,jdbcType=BIGINT}, id_card = #{idCard,jdbcType=VARCHAR},
name = #{name,jdbcType=VARCHAR}, name = #{name,jdbcType=VARCHAR},
post = #{post,jdbcType=TINYINT}, post = #{post,jdbcType=TINYINT},
no = #{no,jdbcType=VARCHAR}, no = #{no,jdbcType=VARCHAR},

1
util/home

@ -0,0 +1 @@
{"errcode":41030,"errmsg":"invalid page hint: [w6QriA03971531]"}

8
util/src/main/java/com/ccsens/util/wx/WxGzhUtil.java

@ -67,6 +67,10 @@ public class WxGzhUtil {
private static final String APPID_H5 = "wxd1842e073e0e6d91"; private static final String APPID_H5 = "wxd1842e073e0e6d91";
private static final String SECRET_H5 = "96d69b79039caf92a2abafa999880cad"; private static final String SECRET_H5 = "96d69b79039caf92a2abafa999880cad";
private static final String appid_health = "wx2f9ef33e08053bbf";
private static final String secret_health = "af90801c26bc177681b2c39a603605b9";
private static final String TOKEN = "nNzkL9KkZUOIS8uU"; private static final String TOKEN = "nNzkL9KkZUOIS8uU";
private static final String ENCODING_AES_KEY = "MQEXG7grhRNsARbUzem6OwnGr2ZW9o5jsauNqaQWOuu"; private static final String ENCODING_AES_KEY = "MQEXG7grhRNsARbUzem6OwnGr2ZW9o5jsauNqaQWOuu";
private static final String MCHID = ""; private static final String MCHID = "";
@ -77,7 +81,6 @@ public class WxGzhUtil {
case Wx_H5: case Wx_H5:
return APPID_H5; return APPID_H5;
case OAUTH2_Wx: case OAUTH2_Wx:
default: default:
return APPID; return APPID;
} }
@ -88,7 +91,6 @@ public class WxGzhUtil {
case Wx_H5: case Wx_H5:
return SECRET_H5; return SECRET_H5;
case OAUTH2_Wx: case OAUTH2_Wx:
default: default:
return SECRET; return SECRET;
} }
@ -163,7 +165,7 @@ public class WxGzhUtil {
globalWxAccessToken.getCreatedAt() + globalWxAccessToken.getExpiresIn() globalWxAccessToken.getCreatedAt() + globalWxAccessToken.getExpiresIn()
>= DateUtil.currentSeconds() - ACCESS_TOKEN_RESERVED_SECONDS){ >= DateUtil.currentSeconds() - ACCESS_TOKEN_RESERVED_SECONDS){
WxAccessToken wxAccessToken = null; WxAccessToken wxAccessToken = null;
String url = String.format(URL_GET_ACCESS_TOKEN,"client_credential",SECRET); String url = String.format(URL_GET_ACCESS_TOKEN,"client_credential",appid_health,secret_health);
String response = HttpRequest.get(url).execute().body(); String response = HttpRequest.get(url).execute().body();
Console.log("getAccessToken: {}",response); Console.log("getAccessToken: {}",response);
try { try {

29
util/src/test/java/com/ccsens/util/Base64Test.java

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save