兴安优化
This commit is contained in:
@@ -362,6 +362,7 @@ public class SysFileController {
|
||||
*/
|
||||
private void checkPhoto(String imgBase64) {
|
||||
String token = redisService.getCacheObject("yf-Token");
|
||||
log.info("redis-token:{}", token);
|
||||
if (StringUtils.isBlank(token)) {
|
||||
try {
|
||||
long l = System.currentTimeMillis();
|
||||
@@ -375,10 +376,13 @@ public class SysFileController {
|
||||
.header("sign", sign)
|
||||
.form(map)
|
||||
.timeout(5000).execute().body();
|
||||
log.info("请求宇泛token-result:{}", result);
|
||||
JSONObject jsonObject1 = JSONObject.parseObject(result);
|
||||
if (jsonObject1.getInteger("result") == 1 && StringUtils.isNotBlank(jsonObject1.getString("data"))) {
|
||||
token = jsonObject1.getString("data");
|
||||
redisService.setCacheObject("yf-Token", token, 20 * 60 * 60L, TimeUnit.SECONDS);
|
||||
} else {
|
||||
throw new ServiceException("宇泛鉴权失败!");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
throw new ServiceException("宇泛鉴权失败!");
|
||||
@@ -404,8 +408,14 @@ public class SysFileController {
|
||||
log.info("请求宇泛人脸返回:{}", result);
|
||||
JSONObject jsonObject1 = JSONObject.parseObject(result);
|
||||
if (jsonObject1.getInteger("result") != 1 || !jsonObject1.getBoolean("success")) {
|
||||
//token失效
|
||||
if (StringUtils.equals("WO_EXP-1203", jsonObject1.getString("code"))) {
|
||||
redisService.deleteObject("yf-Token");
|
||||
this.checkPhoto(imgBase64);
|
||||
} else {
|
||||
throw new ServiceException("人脸检测失败,请重新上传");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.dcsoft.system.uniubi.controller;
|
||||
|
||||
import cn.hutool.http.HttpUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.dcsoft.common.core.constant.Constants;
|
||||
import com.dcsoft.common.core.domain.R;
|
||||
@@ -368,6 +369,19 @@ public class SysSdkController {
|
||||
//标准版本
|
||||
// String imgUrl=getImg(info.getPath(),info.getIp(),eqs.getPassword());
|
||||
// peopleRecord.setFilePath(imgUrl);
|
||||
} else {
|
||||
try {
|
||||
String urls = "http://" + eqs.getIp() + ":8090/person/find?pass=" + eqs.getPassword() + "&id=" + info.getPersonId();
|
||||
String body = HttpUtil.createGet(urls)
|
||||
.timeout(5000)
|
||||
.execute()
|
||||
.body();
|
||||
JSONObject jsonObject1 = JSONObject.parseObject(body);
|
||||
JSONObject data = (JSONObject) jsonObject1.getJSONArray("data").get(0);
|
||||
String name = data.getString("name");
|
||||
peopleRecord.setAdmitName(name);
|
||||
} catch (Exception e) {
|
||||
}
|
||||
}
|
||||
if(StringUtils.isNotEmpty(info.getPath())){//考勤版本
|
||||
String urls="http://"+eqs.getIp()+":8090/download/image?pass="+eqs.getPassword()+"&filename="+info.getPath();
|
||||
|
||||
@@ -55,7 +55,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
select spr.id, spr.people_id, spr.equipment_id, spr.device_ip, spr.admit_guid, spr.rec_mode, spr.file_path, spr.show_time, spr.show_date, spr.alive_type,
|
||||
spr.rec_score, spr.device_no, spr.device_version, spr.source, spr.type, spr.card_no, spr.device_name, spr.rec_type, spr.result, spr.permission_time_type,
|
||||
spr.pass_time_type, spr.rec_mode_type, spr.storage_id, spr.timestamp, spr.admit_name, spr.remark, spr.create_by, spr.create_time, spr.update_by, spr.update_time,
|
||||
e.name equipmentName,spr.flag,spr.group_id,p.name people_name,p.gh,spr.sign
|
||||
e.name equipmentName,spr.flag,spr.group_id,ifnull(p.name,spr.admit_name) people_name,p.gh,spr.sign
|
||||
from sys_people_record spr
|
||||
left join sys_equipment e on spr.equipment_id=e.id
|
||||
left join sys_people p on spr.people_id=p.id
|
||||
|
||||
Reference in New Issue
Block a user