Browse Source

0323.1

master
zhangye 5 years ago
parent
commit
5fd5c49b73
  1. 2
      health/src/main/java/com/ccsens/health/api/HealthController.java
  2. 10
      health/src/main/java/com/ccsens/health/bean/vo/UserVo.java
  3. 16
      health/src/main/java/com/ccsens/health/service/UserService.java
  4. 2
      health/src/main/resources/mapper_dao/HealthRecordDao.xml
  5. 6
      health/src/main/resources/mapper_dao/RealNameAuthDao.xml
  6. 3
      health/src/main/resources/mapper_dao/SiteDao.xml
  7. 4
      util/src/main/java/com/ccsens/util/wx/WxGzhUtil.java
  8. 5
      util/src/test/java/com/ccsens/util/KeyTest.java

2
health/src/main/java/com/ccsens/health/api/HealthController.java

@ -70,7 +70,7 @@ public class HealthController {
} }
@MustLogin @MustLogin
@ApiOperation(value = "健康类型统计", notes = "") @ApiOperation(value = "健康信息统计", notes = "")
@PostMapping("list") @PostMapping("list")
public JsonResponse<PageInfo<HealthVo.HealthList>> list(@RequestBody QueryDto<HealthDto.QueryList> params){ public JsonResponse<PageInfo<HealthVo.HealthList>> list(@RequestBody QueryDto<HealthDto.QueryList> params){

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

@ -39,6 +39,8 @@ public class UserVo {
public static class HealthCode{ public static class HealthCode{
@ApiModelProperty("打卡时间") @ApiModelProperty("打卡时间")
private Long time; private Long time;
@JsonIgnore//健康状态id
private Long healthTypeId;
@ApiModelProperty("健康码等级 0正常 1隔离中或疑似 2确诊") @ApiModelProperty("健康码等级 0正常 1隔离中或疑似 2确诊")
private int healthLevel; private int healthLevel;
@ApiModelProperty("健康码") @ApiModelProperty("健康码")
@ -67,10 +69,12 @@ public class UserVo {
private Long id; private Long id;
@ApiModelProperty("场所名称") @ApiModelProperty("场所名称")
private String name; private String name;
@ApiModelProperty("打卡时间") @ApiModelProperty("进场打卡时间")
private Long time; private Long time;
@ApiModelProperty("打卡类型 0进 1出") @ApiModelProperty("出场打卡时间")
private int type; private Long outTime;
// @ApiModelProperty("打卡类型 0进 1出")
// private int type;
} }
} }

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

@ -44,6 +44,8 @@ public class UserService implements IUserService{
private TallFeignClient tallFeignClient; private TallFeignClient tallFeignClient;
@Autowired @Autowired
private HealthRecordsDao healthRecordsDao; private HealthRecordsDao healthRecordsDao;
@Autowired
private HealthTypeDao healthTypeDao;
@Resource @Resource
private MemberDao memberDao; private MemberDao memberDao;
@Resource @Resource
@ -94,7 +96,19 @@ public class UserService implements IUserService{
//查询健康码 //查询健康码
List<UserVo.HealthCode> healthCodeList = healthRecordsDao.getHealthQrCodeByEmployeeId(userId,startTime,endTime); List<UserVo.HealthCode> healthCodeList = healthRecordsDao.getHealthQrCodeByEmployeeId(userId,startTime,endTime);
if(CollectionUtil.isNotEmpty(healthCodeList)){
for(UserVo.HealthCode healthCode : healthCodeList){
healthCode.setHealthLevel(0);
//获取健康状态
HealthType healthType = healthTypeDao.selectByPrimaryKey(healthCode.getHealthTypeId());
if(ObjectUtil.isNotNull(healthType)){
//如果健康状态异常,健康码为橙色
if(healthType.getQuarantine() != 0){
healthCode.setHealthLevel(1);
}
}
}
}
userInfoVo.setHealthCodeList(healthCodeList); userInfoVo.setHealthCodeList(healthCodeList);
return userInfoVo; return userInfoVo;

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

@ -17,6 +17,7 @@
<resultMap id="resultMap_healthCode" type="com.ccsens.health.bean.vo.UserVo$HealthCode"> <resultMap id="resultMap_healthCode" type="com.ccsens.health.bean.vo.UserVo$HealthCode">
<result column="hTime" property="time"/> <result column="hTime" property="time"/>
<result column="hHealthTypeId" property="healthTypeId"/>
<result column="hHealthCode" property="healthCode"/> <result column="hHealthCode" property="healthCode"/>
</resultMap> </resultMap>
@ -69,6 +70,7 @@
<select id="getHealthQrCodeByEmployeeId" resultMap="resultMap_healthCode" parameterType="java.util.Map"> <select id="getHealthQrCodeByEmployeeId" resultMap="resultMap_healthCode" parameterType="java.util.Map">
select select
h.health_type_id as hHealthTypeId,
h.time as hTime, h.time as hTime,
q.qrcode_path as hHealthCode q.qrcode_path as hHealthCode
from from

6
health/src/main/resources/mapper_dao/RealNameAuthDao.xml

@ -10,6 +10,7 @@
<id column="cId" property="id"/> <id column="cId" property="id"/>
<result column="cName" property="name"/> <result column="cName" property="name"/>
<result column="cTime" property="time"/> <result column="cTime" property="time"/>
<result column="cOutTime" property="outTime"/>
<result column="cType" property="type"/> <result column="cType" property="type"/>
</collection> </collection>
</resultMap> </resultMap>
@ -21,10 +22,11 @@
m.wkno as wkno, m.wkno as wkno,
s.id as cId, s.id as cId,
s.site_name as cName, s.site_name as cName,
sc.time as cTime sc.time as cTime,
sc.out_time as cOutTime
from from
t_site s right JOIN t_site_qrcode sq on sq.site_id = s.id t_site s right JOIN t_site_qrcode sq on sq.site_id = s.id
right JOIN t_site_clock_in sc on sc.site_id = s.id right JOIN t_site_clock_in sc on sc.site_id = s.id
right JOIN t_real_name_auth r on sc.user_id = r.user_id right JOIN t_real_name_auth r on sc.user_id = r.user_id
join t_member m on r.no = m.wkno join t_member m on r.no = m.wkno
where where

3
health/src/main/resources/mapper_dao/SiteDao.xml

@ -7,8 +7,9 @@
select t.id, t.site_name as siteName, t.site_code as siteCode, t.longitude, t.latitude, t1.qrcode_path as inUrl, t2.qrcode_path as outUrl select t.id, t.site_name as siteName, t.site_code as siteCode, t.longitude, t.latitude, t1.qrcode_path as inUrl, t2.qrcode_path as outUrl
from from
(select * from t_site (select * from t_site
where rec_status = 0
<if test="parentCode != null and parentCode != ''"> <if test="parentCode != null and parentCode != ''">
where parent_code = #{parentCode, jdbcType=VARCHAR} and parent_code = #{parentCode, jdbcType=VARCHAR}
</if> </if>
) t ) t
left join left join

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

@ -31,9 +31,9 @@ public class WxGzhUtil {
*/ */
private static WxAccessToken globalWxAccessToken; private static WxAccessToken globalWxAccessToken;
/** /**
* accessToken 过期提前10分钟刷新 * accessToken 过期提前10分钟刷新(为防止过期改成提前一个小时刷新)
*/ */
private static final Integer ACCESS_TOKEN_RESERVED_SECONDS = 10 * 60; private static final Integer ACCESS_TOKEN_RESERVED_SECONDS = 60 * 60;
private static final String URL_LOGIN private static final String URL_LOGIN
= "https://api.weixin.qq.com/sns/jscode2session?appid=%1$s&secret=%2$s&js_code=%3$s&grant_type=%4$s"; = "https://api.weixin.qq.com/sns/jscode2session?appid=%1$s&secret=%2$s&js_code=%3$s&grant_type=%4$s";

5
util/src/test/java/com/ccsens/util/KeyTest.java

@ -21,9 +21,10 @@ public class KeyTest {
Console.log(Base64.encode(key)); Console.log(Base64.encode(key));
} }
/**加密*/ /**加密*/
// @Test @Test
public void test3(){ public void test3(){
String key = "a6RlI/GctLgENUvF6DOY7w=="; // String key = "a6RlI/GctLgENUvF6DOY7w==";
String key = "g9RlI/GctLgDFJvF6DOY7w==";
String string = "po3OynBO[M3579p6L7)o"; String string = "po3OynBO[M3579p6L7)o";
SymmetricCrypto aes = new SymmetricCrypto(SymmetricAlgorithm.AES, Base64.decode(key)); SymmetricCrypto aes = new SymmetricCrypto(SymmetricAlgorithm.AES, Base64.decode(key));
String encryptHex = aes.encryptHex(string); String encryptHex = aes.encryptHex(string);

Loading…
Cancel
Save