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. 4
      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
@ApiOperation(value = "健康类型统计", notes = "")
@ApiOperation(value = "健康信息统计", notes = "")
@PostMapping("list")
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{
@ApiModelProperty("打卡时间")
private Long time;
@JsonIgnore//健康状态id
private Long healthTypeId;
@ApiModelProperty("健康码等级 0正常 1隔离中或疑似 2确诊")
private int healthLevel;
@ApiModelProperty("健康码")
@ -67,10 +69,12 @@ public class UserVo {
private Long id;
@ApiModelProperty("场所名称")
private String name;
@ApiModelProperty("打卡时间")
@ApiModelProperty("进场打卡时间")
private Long time;
@ApiModelProperty("打卡类型 0进 1出")
private int type;
@ApiModelProperty("出场打卡时间")
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;
@Autowired
private HealthRecordsDao healthRecordsDao;
@Autowired
private HealthTypeDao healthTypeDao;
@Resource
private MemberDao memberDao;
@Resource
@ -94,7 +96,19 @@ public class UserService implements IUserService{
//查询健康码
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);
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">
<result column="hTime" property="time"/>
<result column="hHealthTypeId" property="healthTypeId"/>
<result column="hHealthCode" property="healthCode"/>
</resultMap>
@ -69,6 +70,7 @@
<select id="getHealthQrCodeByEmployeeId" resultMap="resultMap_healthCode" parameterType="java.util.Map">
select
h.health_type_id as hHealthTypeId,
h.time as hTime,
q.qrcode_path as hHealthCode
from

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

@ -10,6 +10,7 @@
<id column="cId" property="id"/>
<result column="cName" property="name"/>
<result column="cTime" property="time"/>
<result column="cOutTime" property="outTime"/>
<result column="cType" property="type"/>
</collection>
</resultMap>
@ -21,7 +22,8 @@
m.wkno as wkno,
s.id as cId,
s.site_name as cName,
sc.time as cTime
sc.time as cTime,
sc.out_time as cOutTime
from
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

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
from
(select * from t_site
where rec_status = 0
<if test="parentCode != null and parentCode != ''">
where parent_code = #{parentCode, jdbcType=VARCHAR}
and parent_code = #{parentCode, jdbcType=VARCHAR}
</if>
) t
left join

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

@ -31,9 +31,9 @@ public class WxGzhUtil {
*/
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
= "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));
}
/**加密*/
// @Test
@Test
public void test3(){
String key = "a6RlI/GctLgENUvF6DOY7w==";
// String key = "a6RlI/GctLgENUvF6DOY7w==";
String key = "g9RlI/GctLgDFJvF6DOY7w==";
String string = "po3OynBO[M3579p6L7)o";
SymmetricCrypto aes = new SymmetricCrypto(SymmetricAlgorithm.AES, Base64.decode(key));
String encryptHex = aes.encryptHex(string);

Loading…
Cancel
Save