Commit 9bc4fd15 by 李辅翼

v14

parent ee8c6c29
......@@ -28,6 +28,11 @@
</repositories>
<dependencies>
<!--<dependency>-->
<!--<groupId>ch.qos.logback</groupId>-->
<!--<artifactId>logback-classic</artifactId>-->
<!--<version>1.2.3</version>-->
<!--</dependency>-->
<dependency>
<groupId>org.apache.hbase</groupId>
......
package com.hikcreate.drv_photo_pic.impl;
import com.alibaba.fastjson.JSONObject;
import com.github.tobato.fastdfs.domain.fdfs.StorePath;
import com.github.tobato.fastdfs.service.FastFileStorageClient;
import com.hikcreate.dao.DriverPhotoMapper;
......@@ -10,6 +9,7 @@ import com.hikcreate.entity.DriverPhoto;
import com.hikcreate.entity.PicResult;
import com.hikcreate.service.fdfs.service.FileService;
import com.hikcreate.utils.HbaseUtils;
import lombok.extern.slf4j.Slf4j;
import org.apache.hadoop.hbase.client.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
......@@ -19,6 +19,8 @@ import org.springframework.kafka.core.KafkaTemplate;
import org.springframework.stereotype.Service;
import java.io.ByteArrayInputStream;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import java.util.zip.CRC32;
......@@ -31,8 +33,8 @@ import java.util.zip.CRC32;
@Service("drvPhotoImpl")
public class DrvPhotoImpl implements DrvPhoto {
private static Logger logger = LoggerFactory.getLogger(VehicleImpl.class);
private static Logger logger = LoggerFactory.getLogger(DrvPhotoImpl.class);
@Value("${roundDay}")
private int roundDay;
@Autowired
......@@ -176,8 +178,6 @@ public class DrvPhotoImpl implements DrvPhoto {
}
Put put = new Put(rowkey.getBytes());
put.addColumn("info".getBytes(), "sfzmhm".getBytes(), driverPhoto.getSfzmhm().getBytes());
// byte[] bytes1 = sqlHelp.blobToBytes(driverPhoto.getZp());
//上传
int count = 0;
String picUrl = uploadFileStor(driverPhoto.getZp(), driverPhoto.getSfzmhm());
......@@ -206,12 +206,12 @@ public class DrvPhotoImpl implements DrvPhoto {
put.addColumn("info".getBytes(), "rksj".getBytes(), (driverPhoto.getRksj() == null ? "null" : driverPhoto.getRksj()).getBytes());
put.addColumn("info".getBytes(), "fzjg".getBytes(), (driverPhoto.getFzjg() == null ? "null" : driverPhoto.getFzjg()).getBytes());
driverPhototable.put(put);
JSONObject resultJson = new JSONObject();
resultJson.put("type","sfzmhm");
/* JSONObject resultJson = new JSONObject();
resultJson.put("type","drv");
resultJson.put("row",driverPhoto.getSfzmhm());
resultJson.put("picUrl","/" + picUrl);
resultJson.put("info",driverPhoto.getSfzmhm());
kafkaTemplate.send(picTopic,resultJson.toString());
kafkaTemplate.send(picTopic,resultJson.toString());*/
}
} catch (Exception e) {
e.printStackTrace();
......@@ -241,10 +241,6 @@ public class DrvPhotoImpl implements DrvPhoto {
}
public static void main(String[] args) {
String url = "ftp://vion6:vion6@52.1.113.218:21/193.2.117.66/kk/2019-07-06/18/2019070618541777800022598.jpg";
String[] arr = url.split("/");
System.out.println(arr[arr.length - 1].split("jpg")[0] + "jpg");
}
}
......@@ -67,7 +67,7 @@ public class SqlHelp {
}
if (colValue[0] == null) {
flag1 = 1;
} else if (colValue[0] != null && (gxsj.substring(0, 19).compareTo(colValue[1].substring(0, 19)) < 0)) {
} else if (colValue[0] != null && (gxsj.substring(0, 19).compareTo(colValue[1].substring(0, 19)) <= 0)) {
flag1 = 0;
} else {
flag1 = 2;
......
......@@ -291,14 +291,6 @@ public class VehicleImpl implements Vehicle {
put.addColumn("info".getBytes(), "picUrl".getBytes(), ("/"+picUrl).getBytes());
vehPicTable.put(put);
vehPicTable.close();
if (hphm!=null && hphm.length()>4){
JSONObject resultJson = new JSONObject();
resultJson.put("type","sfzmhm");
resultJson.put("row",xh);
resultJson.put("info",hphm+"#"+hpzl);
resultJson.put("picUrl","/" + picUrl);
kafkaTemplate.send(picTopic,resultJson.toString());
}
}
} catch (Exception e) {
e.printStackTrace();
......
......@@ -2,7 +2,7 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hikcreate.dao.DriverPhotoMapper">
<select id="getIncrePhoto" resultType="DriverPhoto">
select sfzmhm,zp,gxsj,xzqh,flag,xh,rksj,fzjg from GYJG.DRV_PHOTO where GXSJ between sysdate-3 and sysdate and ZP is not null and sfzmhm is not null;
select sfzmhm,zp,gxsj,xzqh,flag,xh,rksj,fzjg from GYJG.DRV_PHOTO where GXSJ between sysdate-5 and sysdate and ZP is not null and sfzmhm is not null
</select>
<select id="getIncrePhotoBySfzmhm" resultType="DriverPhoto">
......@@ -16,7 +16,7 @@
</select>
<select id="increDrvPicFzjgNull" resultType="DriverPhoto">
select sfzmhm,zp,gxsj,xzqh,flag,xh,rksj,fzjg from GYJG.DRV_PHOTO where ZP is not null and fzjg is null and sfzmhm is not null and to_char(GXSJ,'yyyy-mm-dd')<![CDATA[ >= ]]>#{start}
and to_char(GXSJ,'yyyy-mm-dd')<![CDATA[ < ]]>#{end}
select sfzmhm,zp,gxsj,xzqh,flag,xh,rksj,fzjg from (select * from GYJG.DRV_PHOTO where ZP is not null
and to_char(GXSJ,'yyyy-mm-dd')<![CDATA[ >= ]]>#{start} and to_char(GXSJ,'yyyy-mm-dd')<![CDATA[ < ]]>#{end})a where (a.fzjg!='贵A' or a.fzjg is null)
</select>
</mapper>
\ No newline at end of file
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