Commit 308c72fd by Leslie1w

足迹升级

parent 45b51d09
......@@ -785,7 +785,7 @@ private static Log log = LogFactory.getLog(IRycjtjServiceImpl.class);
sg.setHmcjs(gzd2.get(0).getHmcjs());
sg.setHmsjycs(gzd2.get(0).getHmsjycs());
sg.setHmwcjs(gzd2.get(0).getHmwcjs());
gzd.add(s);
gzd.add(sg);
gzd.get(0).setCode(nuitCodes.get(0).getCode().substring(0, 4) + "00GB0000");
gzd.get(0).setName("高支队");
......
......@@ -886,7 +886,7 @@
<select id="queryZlccFirstPageCount" resultType="int" parameterType="map">
select count(*) from AFIS_QUALITY_CK A,TB_RY_RYCJ B,SYS_PARAM_DATE S,AFIS_QUALITY_CC cc where 1=1
and A.R_RYBH=B.RYBH and A.R_RYBH=cc.R_RYBH(+) AND A.CCBS=#{entity.ccbh , jdbcType=VARCHAR } and S.BH='1000' AND (A.SCBZ = '0' or A.SCBZ is null) AND B.SZZWBH is not null AND (B.IFHB='0' OR B.IFHB IS NULL)
and A.R_RYBH=B.RYBH and A.R_RYBH=cc.R_RYBH(+) AND A.CCBS=#{entity.ccbh , jdbcType=VARCHAR } and S.BH='1000' AND B.SZZWBH is not null AND (B.IFHB='0' OR B.IFHB IS NULL)
<if test="entity.RCjdw != null and entity.RCjdw != ''">AND A.R_CJDW like #{entity.RCjdw , jdbcType=VARCHAR }||'%'</if>
<if test="entity.fRCjsjStr != null and entity.fRCjsjStr != ''"> AND B.LRSJ <![CDATA[>=]]> to_date(#{entity.fRCjsjStr , jdbcType=VARCHAR },'yyyy-mm-dd') </if>
<if test="entity.eRCjsjStr != null and entity.eRCjsjStr != ''"> AND B.LRSJ <![CDATA[<]]> to_date(#{entity.eRCjsjStr , jdbcType=VARCHAR },'yyyy-mm-dd')+1 </if>
......@@ -923,7 +923,7 @@
B.GMSFHM as gmsfhm,
S.ZW_SX as zwsx
from AFIS_QUALITY_CK A,TB_RY_RYCJ B,SYS_PARAM_DATE S,AFIS_QUALITY_CC cc where 1=1
AND A.R_RYBH=B.RYBH and A.R_RYBH=cc.R_RYBH(+) AND A.CCBS=#{entity.ccbh , jdbcType=VARCHAR } AND S.BH='1000' AND (A.SCBZ = '0' or A.SCBZ is null) AND B.SZZWBH is not null AND (B.IFHB='0' OR B.IFHB IS NULL)
AND A.R_RYBH=B.RYBH and A.R_RYBH=cc.R_RYBH(+) AND A.CCBS=#{entity.ccbh , jdbcType=VARCHAR } AND S.BH='1000' AND B.SZZWBH is not null AND (B.IFHB='0' OR B.IFHB IS NULL)
<if test="entity.RCjdw != null and entity.RCjdw != ''">AND A.R_CJDW like #{entity.RCjdw , jdbcType=VARCHAR }||'%'</if>
<if test="entity.fRCjsjStr != null and entity.fRCjsjStr != ''"> AND B.LRSJ <![CDATA[>=]]> to_date(#{entity.fRCjsjStr , jdbcType=VARCHAR },'yyyy-mm-dd') </if>
<if test="entity.eRCjsjStr != null and entity.eRCjsjStr != ''"> AND B.LRSJ <![CDATA[<]]> to_date(#{entity.eRCjsjStr , jdbcType=VARCHAR },'yyyy-mm-dd')+1 </if>
......
......@@ -2226,16 +2226,16 @@
"&hjdz="+$("#hjdzDzmc").val()+"&jzdz="+$("#xzzDzmc").val()+"&zjzpsrc=&sjhm="+ $("#lxdm").val()+
"&cjbz=&hxjk=http://65.26.10.49&token=hnxtbaxt";
winOpens=window.open(encodeURI(url));
//设置定时器
timerss=window.setInterval(function IfWindowClosed() {
//alert("状态====="+winOpens.closed)
if (winOpens.closed == true) {
hmcx("10.5.47.33");
//清空定时器
window.clearInterval(timerss);
}
},2000);
// //设置定时器
// timerss=window.setInterval(function IfWindowClosed() {
// //alert("状态====="+winOpens.closed)
// if (winOpens.closed == true) {
// hmcx("10.5.47.33");
// //清空定时器
// window.clearInterval(timerss);
// }
// },2000);
// // }
//alert(url);
}
......
......@@ -361,8 +361,13 @@
//正常结束,data.Context 可获取最后一张图原图base64
if (data.IsSole == 0) {
if (data.Code < 0) {
if("启动采集错误,鞋面采集中" == data.Context){
ws.send("{\"isSole\":1,\"isPreview\":0}");
console.log("提示","鞋面摄像头已关闭,请点击鞋底或赤足进行采集!!");
}else {
alert(data.Context+",请重新采集!");
}
}
//采集发生错误
else if (data.Code == 0) {
var context = "data:img/jpg;base64," + data.Context;
......@@ -437,7 +442,8 @@
//xxts_xm(numtemp,context);
$.messager.alert("提示", "采集成功!");
} else if (data.Code == -2) {
console.log("提示","鞋面采集中,请关闭摄像头后采集鞋底!");
ws.send("{\"isSole\":1,\"isPreview\":0}");
console.log("提示","鞋面摄像头已关闭,请点击鞋底或赤足进行采集!!");
} else {
//$("#context"+numtemp).attr('src', data.context);
alert(data.Context+",请重新采集!");
......@@ -447,7 +453,7 @@
}
}
$("#run").click(function () {
$("#run").click(function () {debugger
var options = $("#camera option:selected");
ws.send("{\"isSole\":1,\"isPreview\":1,\"cameraName\":\"" + options.text() + "\"}");
var context = "/static/zjcj/Layer/" + type + ".png";
......
......@@ -1465,9 +1465,34 @@ public class ZjController {
/**
* 足迹为推送成功的数据定时推送
*/
@Scheduled(cron = "0 0/30 * * * ?")
// @RequestMapping("/Tsjgtest")
public void Dsts() {
List<ZjcjDto> zJxxBySfts = zjbzxxService.getZJxxBySfts();
if (zJxxBySfts.size() > 0) {
zJxxBySfts.stream().forEach(p -> {
List<ZjcjDto> zjTswcg = zjbzxxService.getZjTswcg(p.getRybh());
ZjTimedPush zjTimedPush = new ZjTimedPush(zjTswcg);
// zjTimedPush.run();
ThreadPoolContainer threadPoolContainer = new ThreadPoolContainer(1, 1, 1);
threadPoolContainer.addRunnableTask(zjTimedPush);
try {
Thread.sleep(5000);
} catch (InterruptedException e) {
e.printStackTrace();
}
});
} else {
log.info("截止到" + DateFormatUtils.dateToStrSFM(new Date()) + "时间推送全部成功");
}
}
/**
* 足迹为推送成功的数据定时推送
*/
// @Scheduled(cron = "0 0/30 * * * ?")
@RequestMapping("/Tsjgtest")
public void Dsts() {
public void Dsts1() {
List<ZjcjDto> zJxxBySfts = zjbzxxService.getZJxxBySfts();
if (zJxxBySfts.size() > 0) {
zJxxBySfts.stream().forEach(p -> {
......
......@@ -9,6 +9,7 @@ import lombok.SneakyThrows;
import org.apache.commons.httpclient.HttpStatus;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.http.HttpException;
import org.apache.http.NameValuePair;
import org.apache.http.client.config.RequestConfig;
import org.apache.http.client.entity.UrlEncodedFormEntity;
......@@ -434,6 +435,9 @@ public class FileUtils {
RequestConfig requestConfig = RequestConfig.custom()
.setSocketTimeout(30000).setConnectTimeout(30000).build();
httpPost.setConfig(requestConfig);
// 重试3次
int retry = 0;
try {
if (null != jsonParam) {
// 解决中文乱码问题
......@@ -448,27 +452,38 @@ public class FileUtils {
try {
//读取服务器返回过来的json字符串数据
String str = EntityUtils.toString(result.getEntity(), "utf-8");
log.info("推送返回字符串为:"+str);
log.info("推送返回字符串为:" + str);
//把json字符串转换成json对象
jsonResult = JSONObject.parseObject(str,JSONObject.class);
log.info("转成JSON对象后的值为:"+jsonResult.toJSONString());
jsonResult = JSONObject.parseObject(str, JSONObject.class);
log.info("转成JSON对象后的值为:" + jsonResult.toJSONString());
} catch (Exception e) {
log.error("456发送错误!虹膜采集编号为:"+res.get("cjbh"));
log.error("456发送错误!虹膜采集编号为:" + res.get("cjbh"));
e.printStackTrace();
}
}else {
log.info("返回结果为:"+JSONObject.toJSONString(result));
} else {
log.info("返回结果为:" + JSONObject.toJSONString(result));
}
} catch (IOException e) {
httpPost.abort();
retry++;
log.info("IO错误,进行重发", e);
} catch (Exception e) {
log.error("发送错误!虹膜采集编号为:"+res.get("cjbh"));
log.error("问题位置为464 :问题描述为:"+e.getMessage());
log.error("连接错误,进行重连中");
httpPost.abort();//进行重连
retry++;
log.error("发送错误!虹膜采集编号为:" + res.get("cjbh"));
log.error("问题位置为464 :问题描述为:" + e.getMessage());
// e.printStackTrace();
jsonResult.put("status_code","9999");
jsonResult.put("message","该人员:"+res.get("bcjr_zjhm")+",虹膜推送发送请求超时!===="+e.getMessage());
jsonResult.put("result",null);
e.printStackTrace();
} finally {
httpPost.releaseConnection();
}
if (retry>10){
jsonResult.put("status_code", "9999");
jsonResult.put("message", "该人员:" + res.get("bcjr_zjhm") + "虹膜推送已重试十次,请稍后再试");
jsonResult.put("result", null);
}
return jsonResult;
}
......
package com.founder.utils;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.founder.model.Sjcjl;
import lombok.extern.log4j.Log4j;
import okhttp3.*;
import java.io.IOException;
import java.util.Map;
import java.util.concurrent.TimeUnit;
/**
......@@ -62,6 +64,39 @@ public class OkHttpUtils {
}
public static JSONObject post(String url, Map<String, Object> res) {
JSONObject jsonParam = JSONObject.parseObject(JSON.toJSONString(res));
//增加代理
OkHttpClient.Builder builder = new OkHttpClient.Builder();
RequestBody body = RequestBody.create(MediaType.parse("application/json; charset=utf-8"), String.valueOf(jsonParam));
Request request = new Request.Builder()
.url(url)
.post(body)
.build();
Response response =null;
JSONObject jsonResult = new JSONObject();
builder.connectTimeout(20,TimeUnit.SECONDS);
builder.writeTimeout(20,TimeUnit.SECONDS);
builder.readTimeout( 20,TimeUnit.SECONDS);
// builder.addInterceptor( 20,TimeUnit.SECONDS);
try {
response = builder.build().newCall(request).execute();
jsonResult = JSONObject.parseObject(response.body().string(),JSONObject.class);
} catch (IOException e) {
log.error("发送错误!虹膜采集编号为:"+res.get("cjbh"));
log.error("问题位置为464 :问题描述为:"+e.getMessage());
// e.printStackTrace();
jsonResult.put("status_code","9999");
jsonResult.put("message","该人员:"+res.get("bcjr_zjhm")+",虹膜推送发送请求超时!===="+e.getMessage());
jsonResult.put("result",null);
e.printStackTrace();
}
return jsonResult;
}
public static String get(String url) throws IOException {
OkHttpClient.Builder builder = new OkHttpClient.Builder();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment