Commit 1cbd9743 authored by yzm's avatar yzm

推送给智慧城市,ftp url暴露用户名密码的地址参数改为id

parent 92c53d38
...@@ -442,7 +442,7 @@ public String getnewRtspVlue(String devicecode ){ ...@@ -442,7 +442,7 @@ public String getnewRtspVlue(String devicecode ){
//获得返回结果,根据 Metadata.type 判断是人,车,人骑车,并将详细信息入对应的表 //获得返回结果,根据 Metadata.type 判断是人,车,人骑车,并将详细信息入对应的表
List<TraffpictureParam> objectList = (List<TraffpictureParam>) JSONArray.parseArray(String.valueOf(result.get("ObjectList")), TraffpictureParam.class); List<TraffpictureParam> objectList = (List<TraffpictureParam>) JSONArray.parseArray(String.valueOf(result.get("ObjectList")), TraffpictureParam.class);
//获得 type //获得 type
//更新 recordalarm 为分析 //更新 recordalarm 为分析
transferRecord.setProcessstatus("-1"); transferRecord.setProcessstatus("-1");
traffAlarmRecordService.updateTraffAlarmRecordProcess(transferRecord); traffAlarmRecordService.updateTraffAlarmRecordProcess(transferRecord);
if (objectList.size() < 1) { if (objectList.size() < 1) {
...@@ -531,7 +531,7 @@ public String getnewRtspVlue(String devicecode ){ ...@@ -531,7 +531,7 @@ public String getnewRtspVlue(String devicecode ){
} }
traffPictureService.updateTraffpicture(traffpictureParamresult); traffPictureService.updateTraffpicture(traffpictureParamresult);
//推送给第三方的base64 //推送给第三方的base64
sendtozhiui.setImagedata(publicpictureurl+"/fielagent?ftpPath="+traffpictureParamresult.getImagedata()); sendtozhiui.setImagedata(publicpictureurl+"/fielagent?ftpPath="+traffpictureParamresult.getId());
//赋值推送第三方数据 //赋值推送第三方数据
sendtozhiui.setRecordlevel(code.getAlarmlevel()); sendtozhiui.setRecordlevel(code.getAlarmlevel());
sendtozhiui.setTargetnum(code.getMaxnum()); sendtozhiui.setTargetnum(code.getMaxnum());
...@@ -980,7 +980,7 @@ public String getnewRtspVlue(String devicecode ){ ...@@ -980,7 +980,7 @@ public String getnewRtspVlue(String devicecode ){
traffpictureParam.setFdid(transferRecord.getFdid()); traffpictureParam.setFdid(transferRecord.getFdid());
traffpictureParam.setRecordid(transferRecord.getRecordid()); traffpictureParam.setRecordid(transferRecord.getRecordid());
traffpictureParam.setChannelid(transferRecord.getChannelid()); traffpictureParam.setChannelid(transferRecord.getChannelid());
traffpictureParam.setCreatetime(new Date()); traffpictureParam.setCreatetime(transferRecord.getCreatetime());
//获得imgid 对应的 base64 //获得imgid 对应的 base64
// String imgftpurl = traffPictureService.queryimgpath(traffpictureParam); // String imgftpurl = traffPictureService.queryimgpath(traffpictureParam);
// Ftp ftp = ftpService.reloadFtp(); // Ftp ftp = ftpService.reloadFtp();
......
...@@ -9,5 +9,6 @@ public interface TraffPictureMapper { ...@@ -9,5 +9,6 @@ public interface TraffPictureMapper {
int inserTraffpicture(TraffpictureParam traffalarmrecord); int inserTraffpicture(TraffpictureParam traffalarmrecord);
int updateTraffpicture(TraffpictureParam traffalarmrecord); int updateTraffpicture(TraffpictureParam traffalarmrecord);
String queryimgpath(TraffpictureParam traffpicture); String queryimgpath(TraffpictureParam traffpicture);
String queryimgdataByid(String id);
int updateTraffpicturePushStatus(TraffpictureParam traffpicture ); int updateTraffpicturePushStatus(TraffpictureParam traffpicture );
} }
\ No newline at end of file
...@@ -8,4 +8,7 @@ public interface TraffPictureService { ...@@ -8,4 +8,7 @@ public interface TraffPictureService {
int updateTraffpicture( TraffpictureParam traffpicture); int updateTraffpicture( TraffpictureParam traffpicture);
String queryimgpath(TraffpictureParam traffpicture); String queryimgpath(TraffpictureParam traffpicture);
String queryimgdataByid(String id);
} }
...@@ -18,6 +18,7 @@ import org.springframework.http.MediaType; ...@@ -18,6 +18,7 @@ import org.springframework.http.MediaType;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate; import org.springframework.web.client.RestTemplate;
import java.text.SimpleDateFormat;
import java.util.concurrent.*; import java.util.concurrent.*;
/** /**
...@@ -60,7 +61,8 @@ public class EventWriteService { ...@@ -60,7 +61,8 @@ public class EventWriteService {
sendtozhiui.setAlarmnum(traffpictureParamresult.getTargetnum()); sendtozhiui.setAlarmnum(traffpictureParamresult.getTargetnum());
sendtozhiui.setFdid(traffpictureParamresult.getFdid()); sendtozhiui.setFdid(traffpictureParamresult.getFdid());
sendtozhiui.setRecordtype(traffpictureParamresult.getRecordtype()); sendtozhiui.setRecordtype(traffpictureParamresult.getRecordtype());
sendtozhiui.setRecordtime( traffpictureParamresult.getCreatetime()==null?"": DateUtils.formatDate(traffpictureParamresult.getCreatetime())); SimpleDateFormat format=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
sendtozhiui.setRecordtime( traffpictureParamresult.getCreatetime()==null?"": format.format(traffpictureParamresult.getCreatetime()));
ResultObj resultObj; ResultObj resultObj;
try { try {
resultObj = sendMessage(sendtozhiui); resultObj = sendMessage(sendtozhiui);
......
...@@ -15,10 +15,11 @@ import org.springframework.stereotype.Service; ...@@ -15,10 +15,11 @@ import org.springframework.stereotype.Service;
* @since 2021-04-29 * @since 2021-04-29
*/ */
@Service @Service
public class TraffpictureServiceImpl implements TraffPictureService{ public class TraffpictureServiceImpl implements TraffPictureService {
@Autowired @Autowired
private TraffPictureMapper traffPictureMapper; private TraffPictureMapper traffPictureMapper;
@Override @Override
public int inserTraffpicture(TraffpictureParam traffpicture) { public int inserTraffpicture(TraffpictureParam traffpicture) {
return traffPictureMapper.inserTraffpicture(traffpicture); return traffPictureMapper.inserTraffpicture(traffpicture);
...@@ -31,7 +32,13 @@ public class TraffpictureServiceImpl implements TraffPictureService{ ...@@ -31,7 +32,13 @@ public class TraffpictureServiceImpl implements TraffPictureService{
@Override @Override
public String queryimgpath(TraffpictureParam traffpicture) { public String queryimgpath(TraffpictureParam traffpicture) {
return traffPictureMapper.queryimgpath(traffpicture); return traffPictureMapper.queryimgpath(traffpicture);
} }
@Override
public String queryimgdataByid(String id) {
return traffPictureMapper.queryimgdataByid(id);
}
} }
...@@ -117,5 +117,8 @@ ...@@ -117,5 +117,8 @@
<update id="updateTraffpicturePushStatus"> <update id="updateTraffpicturePushStatus">
update traffpicture set pushdesc=#{pushdesc} , pushstatus=#{pushstatus} where id=#{id} update traffpicture set pushdesc=#{pushdesc} , pushstatus=#{pushstatus} where id=#{id}
</update> </update>
<select id="queryimgdataByid" parameterType="java.lang.String" resultType="java.lang.String">
select imagedata from traffpicture where id=#{id}
</select>
</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