Commit 3d35e092 authored by wangjinjing's avatar wangjinjing

修改bug

parent 7da059a0
...@@ -234,7 +234,7 @@ public class ExtController { ...@@ -234,7 +234,7 @@ public class ExtController {
Long recordid=Long.parseLong(String.valueOf(traffAlarmRecordService.inserTraffAlarmRecord(traffAlarmRecord))); Long recordid=Long.parseLong(String.valueOf(traffAlarmRecordService.inserTraffAlarmRecord(traffAlarmRecord)));
FileTransferManager.fetchUrlsFromRecord(traffAlarmRecord, transferRecordMap); FileTransferManager.fetchUrlsFromRecord(traffAlarmRecord, transferRecordMap);
List<TransferResult> results = FileTransferManager.transferFile(transferRecordMap, ftp, basepath); List<TransferResult> results = FileTransferManager.transferFile(transferRecordMap, ftp, basepath);
logger.info("缓存数据上传结果:" + results.toString()); // logger.info("缓存数据上传结果:" + results.toString());
TraffAlarmRecord recordBak = FileTransferManager.traffAlarmRecordUrlUpdate(results); TraffAlarmRecord recordBak = FileTransferManager.traffAlarmRecordUrlUpdate(results);
traffAlarmRecord.setImg1path(recordBak.getImg1path()); traffAlarmRecord.setImg1path(recordBak.getImg1path());
traffAlarmRecord.setImg2path(recordBak.getImg2path()); traffAlarmRecord.setImg2path(recordBak.getImg2path());
...@@ -294,6 +294,7 @@ public class ExtController { ...@@ -294,6 +294,7 @@ public class ExtController {
traffpictureParam.setChannelid(transferRecord.getChannelid()); traffpictureParam.setChannelid(transferRecord.getChannelid());
traffpictureParam.setRecordid(transferRecord.getRecordid()); traffpictureParam.setRecordid(transferRecord.getRecordid());
traffpictureParam.setRecordtype(String.valueOf(metadata.get("Type"))); traffpictureParam.setRecordtype(String.valueOf(metadata.get("Type")));
traffpictureParam.setProcessstatus("0");
//获得imgid 对应的 base64 //获得imgid 对应的 base64
String imgftpurl=traffPictureService.queryimgpath(traffpictureParam); String imgftpurl=traffPictureService.queryimgpath(traffpictureParam);
Ftp ftp = ftpService.reloadFtp(); Ftp ftp = ftpService.reloadFtp();
...@@ -313,8 +314,12 @@ public class ExtController { ...@@ -313,8 +314,12 @@ public class ExtController {
{ {
Pedestrian meta = JSON.toJavaObject(metadata, Pedestrian.class); Pedestrian meta = JSON.toJavaObject(metadata, Pedestrian.class);
meta.setId(traffpictureParam.getId()); meta.setId(traffpictureParam.getId());
//新增到人员详pedestrianService.insertpedestrian(meta); pedestrianService.insertpedestrian(meta);
//新增到事件详情表返回主键 //新增到事件详情表返回主键
traffpictureParam.setObjx(meta.getObjectBoundingBox().getX());
traffpictureParam.setObjy(meta.getObjectBoundingBox().getY());
traffpictureParam.setObjw(meta.getObjectBoundingBox().getW());
traffpictureParam.setObjh(meta.getObjectBoundingBox().getH());
} }
else if (null != metadata && metadata.get("Type").equals("2"))//车辆 else if (null != metadata && metadata.get("Type").equals("2"))//车辆
{ {
...@@ -322,21 +327,34 @@ public class ExtController { ...@@ -322,21 +327,34 @@ public class ExtController {
meta.setId(traffpictureParam.getId()); meta.setId(traffpictureParam.getId());
//新增到车辆详情表 //新增到车辆详情表
trafficService.insertTraffic(meta); trafficService.insertTraffic(meta);
traffpictureParam.setObjx(meta.getObjectBoundingBox().getX());
traffpictureParam.setObjy(meta.getObjectBoundingBox().getY());
traffpictureParam.setObjw(meta.getObjectBoundingBox().getW());
traffpictureParam.setObjh(meta.getObjectBoundingBox().getH());
} }
else if (null != metadata && metadata.get("Type").equals("3")) else if (null != metadata && metadata.get("Type").equals("3"))
{ {
Face meta = JSON.toJavaObject(metadata, Face.class); Face meta = JSON.toJavaObject(metadata, Face.class);
meta.setId(traffpictureParam.getId()); meta.setId(traffpictureParam.getId());
//新增到车辆详情表
faceService.insertFace(meta); faceService.insertFace(meta);
traffpictureParam.setObjx(meta.getFaceBoundingBox().getX());
traffpictureParam.setObjy(meta.getFaceBoundingBox().getY());
traffpictureParam.setObjw(meta.getFaceBoundingBox().getW());
traffpictureParam.setObjh(meta.getFaceBoundingBox().getH());
} }
else if (null != metadata && metadata.get("Type").equals("4"))//人骑车 else if (null != metadata && metadata.get("Type").equals("4"))//人骑车
{ {
PeopleRideBicyc meta = JSON.toJavaObject(metadata, PeopleRideBicyc.class); PeopleRideBicyc meta = JSON.toJavaObject(metadata, PeopleRideBicyc.class);
meta.setId(traffpictureParam.getId()); meta.setId(traffpictureParam.getId());
//新增到车辆详情表
peopleridebicycService.insertPeopleRideBicyc(meta); peopleridebicycService.insertPeopleRideBicyc(meta);
traffpictureParam.setObjx(meta.getObjectBoundingBox().getX());
traffpictureParam.setObjy(meta.getObjectBoundingBox().getY());
traffpictureParam.setObjw(meta.getObjectBoundingBox().getW());
traffpictureParam.setObjh(meta.getObjectBoundingBox().getH());
} }
//更新 traffpicture特征值
traffPictureService.updateTraffpicture(traffpictureParam);
} }
} }
......
...@@ -7,5 +7,6 @@ import org.apache.ibatis.annotations.Mapper; ...@@ -7,5 +7,6 @@ import org.apache.ibatis.annotations.Mapper;
public interface TraffPictureMapper { public interface TraffPictureMapper {
int inserTraffpicture(TraffpictureParam traffalarmrecord); int inserTraffpicture(TraffpictureParam traffalarmrecord);
int updateTraffpicture(TraffpictureParam traffalarmrecord);
String queryimgpath(TraffpictureParam traffpicture); String queryimgpath(TraffpictureParam traffpicture);
} }
\ No newline at end of file
...@@ -5,6 +5,7 @@ import com.cx.cn.cxquartz.vo.TraffpictureParam; ...@@ -5,6 +5,7 @@ import com.cx.cn.cxquartz.vo.TraffpictureParam;
public interface TraffPictureService { public interface TraffPictureService {
int inserTraffpicture( TraffpictureParam traffpicture); int inserTraffpicture( TraffpictureParam traffpicture);
int updateTraffpicture( TraffpictureParam traffpicture);
String queryimgpath(TraffpictureParam traffpicture); String queryimgpath(TraffpictureParam traffpicture);
} }
...@@ -24,6 +24,11 @@ public class TraffpictureServiceImpl implements TraffPictureService{ ...@@ -24,6 +24,11 @@ public class TraffpictureServiceImpl implements TraffPictureService{
return traffPictureMapper.inserTraffpicture(traffpicture); return traffPictureMapper.inserTraffpicture(traffpicture);
} }
@Override
public int updateTraffpicture(TraffpictureParam traffpicture) {
return traffPictureMapper.updateTraffpicture(traffpicture);
}
@Override @Override
public String queryimgpath(TraffpictureParam traffpicture) { public String queryimgpath(TraffpictureParam traffpicture) {
return traffPictureMapper.queryimgpath(traffpicture); return traffPictureMapper.queryimgpath(traffpicture);
......
...@@ -59,6 +59,47 @@ public class TraffpictureParam extends Traffpicture { ...@@ -59,6 +59,47 @@ public class TraffpictureParam extends Traffpicture {
@JsonIgnore @JsonIgnore
private String imagedata; private String imagedata;
@JsonIgnore
private Integer objx;
@JsonIgnore
private Integer objy;
@JsonIgnore
private Integer objw;
@JsonIgnore
private Integer objh;
public Integer getObjx() {
return objx;
}
public void setObjx(Integer objx) {
this.objx = objx;
}
public Integer getObjy() {
return objy;
}
public void setObjy(Integer objy) {
this.objy = objy;
}
public Integer getObjw() {
return objw;
}
public void setObjw(Integer objw) {
this.objw = objw;
}
public Integer getObjh() {
return objh;
}
public void setObjh(Integer objh) {
this.objh = objh;
}
public String getImagedata() { public String getImagedata() {
return imagedata; return imagedata;
} }
......
...@@ -11,10 +11,10 @@ mybatis: ...@@ -11,10 +11,10 @@ mybatis:
spring: spring:
datasource: datasource:
#url: jdbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=utf-8 #url: jdbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=utf-8&useSSL=false
#username: zn06 #username: zn06
#password: znznzn8 #password: znznzn8
url: jdbc:mysql://192.168.168.212:3306/imagepro?useUnicode=true&characterEncoding=utf-8 url: jdbc:mysql://192.168.168.212:3306/imagepro?useUnicode=true&characterEncoding=utf-8&useSSL=false
username: root username: root
password: 123456 password: 123456
driver-class-name: com.mysql.jdbc.Driver driver-class-name: com.mysql.jdbc.Driver
......
...@@ -65,6 +65,7 @@ ...@@ -65,6 +65,7 @@
<if test="faceimagedata != null">faceimagedata,</if> <if test="faceimagedata != null">faceimagedata,</if>
<if test="index != null">pindex,</if> <if test="index != null">pindex,</if>
<if test="imagedata != null">imagedata,</if> <if test="imagedata != null">imagedata,</if>
<if test="processstatus != null">processstatus,</if>
</trim> </trim>
<trim prefix="select" suffix="from dual" suffixOverrides=","> <trim prefix="select" suffix="from dual" suffixOverrides=",">
<if test="recordid != null">#{recordid},</if> <if test="recordid != null">#{recordid},</if>
...@@ -88,6 +89,7 @@ ...@@ -88,6 +89,7 @@
<if test="faceimagedata != null">#{faceimagedata},</if> <if test="faceimagedata != null">#{faceimagedata},</if>
<if test="index != null">#{index},</if> <if test="index != null">#{index},</if>
<if test="imagedata != null">#{imagedata},</if> <if test="imagedata != null">#{imagedata},</if>
<if test="processstatus != null">#{processstatus},</if>
</trim> </trim>
</insert> </insert>
...@@ -107,4 +109,10 @@ ...@@ -107,4 +109,10 @@
</select> </select>
<update id="updateTraffpicture">
update traffpicture set objx=#{objx},objy=#{objy},objw=#{objw},objh=#{objh} where id=#{id}
</update>
</mapper> </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