Commit 4b7f57e1 authored by wangjinjing's avatar wangjinjing

bug 修复

parent 8203c618
package com.hzjt.controller; package com.hzjt.controller;
import cn.hutool.json.JSONUtil;
import com.hzjt.domain.Alarm; import com.hzjt.domain.Alarm;
import com.hzjt.domain.AlarmEvents; import com.hzjt.domain.AlarmEvents;
import com.hzjt.domain.Ftp; import com.hzjt.domain.Ftp;
...@@ -65,22 +66,22 @@ public class AlarmController { ...@@ -65,22 +66,22 @@ public class AlarmController {
Alarm alarm = TransHelper.transAlarmResult(alarmEvents); Alarm alarm = TransHelper.transAlarmResult(alarmEvents);
alarm.setDept(xzbh); alarm.setDept(xzbh);
Result result = new Result(); Result result = new Result();
Traffalarmrecord traffAlarmRecord = new Traffalarmrecord(); Traffalarmrecord traffAlarmRecord_init = new Traffalarmrecord();
traffAlarmRecord.setAreaid(Long.valueOf(xzbh)); traffAlarmRecord_init.setAreaid(Long.valueOf(xzbh));
traffAlarmRecord.setRecordtype(alarmEvents.getEventType().toLowerCase()); traffAlarmRecord_init.setRecordtype(alarmEvents.getEventType().toLowerCase());
if (alarmEvents.getStartTime() != null) { if (alarmEvents.getStartTime() != null) {
traffAlarmRecord.setRecordtime(DateUtils.getDateString(new Date(Long.valueOf(alarmEvents.getStartTime()) * 1000L))); traffAlarmRecord_init.setRecordtime(DateUtils.getDateString(new Date(Long.valueOf(alarmEvents.getStartTime()) * 1000L)));
} }
traffAlarmRecord.setFdid(alarmEvents.getDeviceId()); traffAlarmRecord_init.setFdid(alarmEvents.getDeviceId());
traffAlarmRecord.setChannelid(0); traffAlarmRecord_init.setChannelid(0);
traffAlarmRecord.setCreatetime(DateUtils.getDateString(new Date())); traffAlarmRecord_init.setCreatetime(DateUtils.getDateString(new Date()));
traffAlarmRecord.setObjlable(alarm.getObjLabel()); traffAlarmRecord_init.setObjlable(alarm.getObjLabel());
traffAlarmRecord.setPushstatus(9); traffAlarmRecord_init.setPushstatus(9);
traffAlarmRecord.setProcessstatus("0"); traffAlarmRecord_init.setProcessstatus("0");
traffAlarmRecord.setManualstatus(1); traffAlarmRecord_init.setManualstatus(1);
traffAlarmRecord.setChannelname(alarmEvents.getDeviceName()); traffAlarmRecord_init.setChannelname(alarmEvents.getDeviceName());
traffAlarmRecord.setObjlable(alarmEvents.getObjectType()); traffAlarmRecord_init.setObjlable(alarmEvents.getObjectType());
List<MediaList> imgBase64List = alarmEvents.getMediaList(); List<MediaList> imgBase64List = alarmEvents.getMediaList();
String imgEnumHead = "IMG"; String imgEnumHead = "IMG";
int i = 0; int i = 0;
...@@ -89,30 +90,31 @@ public class AlarmController { ...@@ -89,30 +90,31 @@ public class AlarmController {
while(var12.hasNext()) { while(var12.hasNext()) {
MediaList imgs = (MediaList)var12.next(); MediaList imgs = (MediaList)var12.next();
if (imgs.getType().contains("jpg")) { if (imgs.getType().contains("jpg")) {
TraffAlarmRecordFromImgEnum.valueOf(imgEnumHead + i).setImg(traffAlarmRecord, imgs.getSrc()); TraffAlarmRecordFromImgEnum.valueOf(imgEnumHead + i).setImg(traffAlarmRecord_init, imgs.getSrc());
++i; ++i;
} }
if (imgs.getType().contains("mp4")) { if (imgs.getType().contains("mp4")) {
traffAlarmRecord.setVideourlfrom(imgs.getSrc()); traffAlarmRecord_init.setVideourlfrom(imgs.getSrc());
} }
} }
if (StringEnum.ONE.getValue().equals(this.checkEnable)) { if (StringEnum.ONE.getValue().equals(this.checkEnable)) {
traffAlarmRecord.setCheckstatus(9); traffAlarmRecord_init.setCheckstatus(9);
} }
Map<Object, Object> map = new HashMap(); Map<Object, Object> map = new HashMap();
map.put("type", "alarm"); map.put("type", "alarm");
traffAlarmRecord.setEventid("66211" + UUIDUtils.createuuid()); traffAlarmRecord_init.setEventid("66211" + UUIDUtils.createuuid());
this.traffAlarmRecordMapper.inserTraffAlarmRecord(traffAlarmRecord); this.traffAlarmRecordMapper.inserTraffAlarmRecord(traffAlarmRecord_init);
map.put("data", alarm); map.put("data", alarm);
map.put("recordid", traffAlarmRecord.getRecordid()); map.put("recordid", traffAlarmRecord_init.getRecordid());
this.webSocket.GroupSending(JsonUtil.beanToString(map)); this.webSocket.GroupSending(JsonUtil.beanToString(map));
try { try {
Traffalarmrecord traffAlarmRecord = JSONUtil.toBean(JsonUtil.beanToString(traffAlarmRecord_init), Traffalarmrecord.class);
String basepath = traffAlarmRecord.getFdid() + (traffAlarmRecord.getChannelid() < 10 ? "0" + traffAlarmRecord.getChannelid() : traffAlarmRecord.getChannelid()) + "/" + DateUtils.formatCurrDayNoSign(); String basepath = traffAlarmRecord.getFdid() + (traffAlarmRecord.getChannelid() < 10 ? "0" + traffAlarmRecord.getChannelid() : traffAlarmRecord.getChannelid()) + "/" + DateUtils.formatCurrDayNoSign();
Map<String, Object> transferRecordMap = new HashMap(); Map<String, Object> transferRecordMap = new HashMap();
FileTransferManager.fetchUrlsFromRecord(traffAlarmRecord, transferRecordMap); FileTransferManager.fetchUrlsFromRecord(traffAlarmRecord, transferRecordMap);
...@@ -121,13 +123,6 @@ public class AlarmController { ...@@ -121,13 +123,6 @@ public class AlarmController {
Traffalarmrecord recordBak = FileTransferManager.traffAlarmRecordUrlUpdate(results); Traffalarmrecord recordBak = FileTransferManager.traffAlarmRecordUrlUpdate(results);
log.info("recordBak=={}",JsonUtil.beanToString(recordBak)); log.info("recordBak=={}",JsonUtil.beanToString(recordBak));
log.info("traffAlarmRecord=={}",traffAlarmRecord.getRecordid()); log.info("traffAlarmRecord=={}",traffAlarmRecord.getRecordid());
// traffAlarmRecord.setRecordid(recordBak.getRecordid());
// traffAlarmRecord.setImg1path(recordBak.getImg1path());
// traffAlarmRecord.setImg2path(recordBak.getImg2path());
// traffAlarmRecord.setImg3path(recordBak.getImg3path());
// traffAlarmRecord.setImg4path(recordBak.getImg4path());
// traffAlarmRecord.setImg5path(recordBak.getImg5path());
// traffAlarmRecord.setVideopath(recordBak.getVideopath());
this.traffAlarmRecordMapper.updateTraffAlarmRecordUrl(recordBak); this.traffAlarmRecordMapper.updateTraffAlarmRecordUrl(recordBak);
traffAlarmRecord.setPushdesc("success"); traffAlarmRecord.setPushdesc("success");
traffAlarmRecord.setPushstatus(0); traffAlarmRecord.setPushstatus(0);
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
package com.hzjt.controller; package com.hzjt.controller;
import cn.hutool.core.codec.Base64Encoder; import cn.hutool.core.codec.Base64Encoder;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.google.common.util.concurrent.RateLimiter; import com.google.common.util.concurrent.RateLimiter;
import com.hzjt.domain.Alarm; import com.hzjt.domain.Alarm;
...@@ -177,51 +178,52 @@ public class TraffController { ...@@ -177,51 +178,52 @@ public class TraffController {
} }
public void sendevent(Alarm trffClientMessage, Sbtdspsr spr) { public void sendevent(Alarm trffClientMessage, Sbtdspsr spr) {
Traffalarmrecord traffAlarmRecord = new Traffalarmrecord(); Traffalarmrecord traffAlarmRecord_init = new Traffalarmrecord();
traffAlarmRecord.setAreaid(Long.valueOf(trffClientMessage.getDept())); traffAlarmRecord_init.setAreaid(Long.valueOf(trffClientMessage.getDept()));
traffAlarmRecord.setRecordtype(trffClientMessage.getIncident_type().toLowerCase()); traffAlarmRecord_init.setRecordtype(trffClientMessage.getIncident_type().toLowerCase());
traffAlarmRecord.setRecordtime(DateUtils.getDateString(new Date(Long.valueOf(trffClientMessage.getTs())))); traffAlarmRecord_init.setRecordtime(DateUtils.getDateString(new Date(Long.valueOf(trffClientMessage.getTs()))));
traffAlarmRecord.setFdid(trffClientMessage.getVideo_id()); traffAlarmRecord_init.setFdid(trffClientMessage.getVideo_id());
traffAlarmRecord.setChannelid(0); traffAlarmRecord_init.setChannelid(0);
traffAlarmRecord.setVideourlfrom(trffClientMessage.getVideo_record_url()); traffAlarmRecord_init.setVideourlfrom(trffClientMessage.getVideo_record_url());
traffAlarmRecord.setCreatetime(DateUtils.getDateString(new Date())); traffAlarmRecord_init.setCreatetime(DateUtils.getDateString(new Date()));
traffAlarmRecord.setObjlable(trffClientMessage.getObjLabel()); traffAlarmRecord_init.setObjlable(trffClientMessage.getObjLabel());
traffAlarmRecord.setPushstatus(9); traffAlarmRecord_init.setPushstatus(9);
traffAlarmRecord.setProcessstatus("0"); traffAlarmRecord_init.setProcessstatus("0");
traffAlarmRecord.setManualstatus(1); traffAlarmRecord_init.setManualstatus(1);
traffAlarmRecord.setChannelname(spr.getTdmc()); traffAlarmRecord_init.setChannelname(spr.getTdmc());
List<String> imgBase64List = trffClientMessage.getImg_base64(); List<String> imgBase64List = trffClientMessage.getImg_base64();
String imgEnumHead = "IMG"; String imgEnumHead = "IMG";
Ftp ftp = this.ftpService.reloadFtp(); Ftp ftp = this.ftpService.reloadFtp();
String basepath; String basepath;
for (int i = 0; i < imgBase64List.size(); ++i) { for (int i = 0; i < imgBase64List.size(); ++i) {
String path = trffClientMessage.getVideo_id() + (traffAlarmRecord.getChannelid() < 10 ? "0" + traffAlarmRecord.getChannelid() : traffAlarmRecord.getChannelid()) + "/" + DateUtils.formatCurrDayNoSign(); String path = trffClientMessage.getVideo_id() + (traffAlarmRecord_init.getChannelid() < 10 ? "0" + traffAlarmRecord_init.getChannelid() : traffAlarmRecord_init.getChannelid()) + "/" + DateUtils.formatCurrDayNoSign();
basepath = UUIDUtils.createuuid() + ".jpg"; basepath = UUIDUtils.createuuid() + ".jpg";
if (FTPUtil.uploadFile(ftp, "gstraff/" + path, basepath, (String) imgBase64List.get(i))) { if (FTPUtil.uploadFile(ftp, "gstraff/" + path, basepath, (String) imgBase64List.get(i))) {
TraffAlarmRecordImgEnum.valueOf(imgEnumHead + i).setImg(traffAlarmRecord, path + "/" + basepath); TraffAlarmRecordImgEnum.valueOf(imgEnumHead + i).setImg(traffAlarmRecord_init, path + "/" + basepath);
} }
} }
List<String> imgUrls = trffClientMessage.getImg_urls(); List<String> imgUrls = trffClientMessage.getImg_urls();
for (int j = 0; j < imgUrls.size(); ++j) { for (int j = 0; j < imgUrls.size(); ++j) {
TraffAlarmRecordFromImgEnum.valueOf(imgEnumHead + j).setImg(traffAlarmRecord, (String) imgUrls.get(j)); TraffAlarmRecordFromImgEnum.valueOf(imgEnumHead + j).setImg(traffAlarmRecord_init, (String) imgUrls.get(j));
} }
if (StringEnum.ONE.getValue().equals(this.checkEnable)) { if (StringEnum.ONE.getValue().equals(this.checkEnable)) {
traffAlarmRecord.setCheckstatus(9); traffAlarmRecord_init.setCheckstatus(9);
} }
Map<Object, Object> map = new HashMap(); Map<Object, Object> map = new HashMap();
map.put("type", "alarm"); map.put("type", "alarm");
traffAlarmRecord.setEventid("66211" + UUIDUtils.createuuid()); traffAlarmRecord_init.setEventid("66211" + UUIDUtils.createuuid());
this.traffAlarmRecordMapper.inserTraffAlarmRecord(traffAlarmRecord); this.traffAlarmRecordMapper.inserTraffAlarmRecord(traffAlarmRecord_init);
map.put("data", trffClientMessage); map.put("data", trffClientMessage);
map.put("recordid", traffAlarmRecord.getRecordid()); map.put("recordid", traffAlarmRecord_init.getRecordid());
this.webSocket.GroupSending(JsonUtil.beanToString(map)); this.webSocket.GroupSending(JsonUtil.beanToString(map));
try { try {
Traffalarmrecord traffAlarmRecord = JSONUtil.toBean(JsonUtil.beanToString(traffAlarmRecord_init), Traffalarmrecord.class);
basepath = traffAlarmRecord.getFdid() + (traffAlarmRecord.getChannelid() < 10 ? "0" + traffAlarmRecord.getChannelid() : traffAlarmRecord.getChannelid()) + "/" + DateUtils.formatCurrDayNoSign(); basepath = traffAlarmRecord.getFdid() + (traffAlarmRecord.getChannelid() < 10 ? "0" + traffAlarmRecord.getChannelid() : traffAlarmRecord.getChannelid()) + "/" + DateUtils.formatCurrDayNoSign();
Map<String, Object> transferRecordMap = new HashMap(); Map<String, Object> transferRecordMap = new HashMap();
FileTransferManager.fetchUrlsFromRecord(traffAlarmRecord, transferRecordMap); FileTransferManager.fetchUrlsFromRecord(traffAlarmRecord, transferRecordMap);
...@@ -236,11 +238,10 @@ public class TraffController { ...@@ -236,11 +238,10 @@ public class TraffController {
Traffalarmrecord record = new Traffalarmrecord(); Traffalarmrecord record = new Traffalarmrecord();
record.setRecordid(recordBak.getRecordid()); record.setRecordid(recordBak.getRecordid());
String url = recordBak.getVideourlfrom(); String url = recordBak.getVideourlfrom();
record.setVideopath(recordBak.getVideopath());
log.info("url:{}", url);
String finalBasepath = recordBak.getVideopath(); log.info("bathpath:{}", recordBak.getVideopath());
this.schedulepool.schedule(() -> { this.schedulepool.schedule(() -> {
log.info("finalBasepath====={}", finalBasepath);
try { try {
HttpURLConnection connection = (HttpURLConnection) (new URL(url)).openConnection(); HttpURLConnection connection = (HttpURLConnection) (new URL(url)).openConnection();
connection.setReadTimeout(2000); connection.setReadTimeout(2000);
...@@ -248,14 +249,20 @@ public class TraffController { ...@@ -248,14 +249,20 @@ public class TraffController {
connection.setRequestMethod("GET"); connection.setRequestMethod("GET");
if (connection.getResponseCode() == 200) { if (connection.getResponseCode() == 200) {
InputStream inputStream = connection.getInputStream(); InputStream inputStream = connection.getInputStream();
log.info("url:{}", url); // log.info("url:{}", url);
String pname = DateUtils.formatCurrDayNoSign() + "_" + record.getRecordid() + "_0000_video"; String pname = DateUtils.formatCurrDayNoSign() + "_" + record.getRecordid() + "_0000_video";
String fileName = pname + ".mp4"; String fileName = pname + ".mp4";
String ftputl = finalBasepath + "/" + fileName; String ftputl = record.getVideopath() + "/" + fileName;
boolean r = FTPUtil.uploadFile(ftp, "gstraff/" + finalBasepath, fileName, inputStream); if (record.getVideopath().indexOf("/") > -1) {
if (r) { boolean r = FTPUtil.uploadFile(ftp, "gstraff/" + recordBak.getVideopath(), fileName, inputStream);
record.setVideopath(ftputl);
log.info("video:{} upload success:", ftputl); if (r) {
record.setVideopath(ftputl);
log.info("video:{} upload success:", ftputl);
} else {
log.info("video:{} upload fail:", url);
record.setVideopath("");
}
} }
} else { } else {
log.info("video:{} upload fail:", url); log.info("video:{} upload fail:", url);
......
package com.hzjt.handler; package com.hzjt.handler;
import cn.hutool.json.JSONUtil;
import com.hzjt.domain.Ftp; import com.hzjt.domain.Ftp;
import com.hzjt.domain.Traffalarmrecord; import com.hzjt.domain.Traffalarmrecord;
import com.hzjt.domain.TransferResult; import com.hzjt.domain.TransferResult;
import com.hzjt.util.DateUtils; import com.hzjt.util.DateUtils;
import com.hzjt.util.FTPUtil; import com.hzjt.util.FTPUtil;
import com.hzjt.util.JsonUtil;
import com.hzjt.util.ThreadPoolUtil; import com.hzjt.util.ThreadPoolUtil;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
...@@ -32,63 +34,135 @@ public class FileTransferManager { ...@@ -32,63 +34,135 @@ public class FileTransferManager {
* @throws Exception * @throws Exception
*/ */
public static List<TransferResult> transferFile(final Map<String, Object> transferRecord, final Ftp ftp, final String basePath) throws Exception { public static List<TransferResult> transferFile(final Map<String, Object> transferRecord, final Ftp ftp, final String basePath) throws Exception {
Integer ret = 0; Long recordid = Long.parseLong(transferRecord.get("recordid").toString());
final Long recordid = Long.parseLong(transferRecord.get("recordid").toString());
int count = 0; int count = 0;
for (String key : transferRecord.keySet()) { Iterator var5 = transferRecord.keySet().iterator();
if (key.equals("img1path") || key.equals("img2path") while (true) {
|| key.equals("img3path") || key.equals("img4path") String key;
|| key.equals("img5path") || key.equals("videopath")) { do {
final String url = transferRecord.get(key).toString(); if (!var5.hasNext()) {
count++; List<TransferResult> listret = new ArrayList();
completionService.submit(() -> {
TransferResult result = new TransferResult(recordid, key, url, "", false);
String filesuff = "videopath".equals(key) ? ".mp4" : ".jpg";
String pname = DateUtils.formatCurrDayNoSign() + "_" + recordid + "_0000_" + key.replace("path", "");
String fileName = pname + filesuff;
// String ftputl = FTPUtil.getFtpUrl(ftp) + basePath + "/" + fileName;
if (key.equals("videopath")) {
// 视频只存值,先不取值
log.info("videopath");
result.setImgpath(basePath);
result.setUrlfrom(url);
for (int i = 0; i < count; ++i) {
listret.add(completionService.poll(4L, TimeUnit.SECONDS).get());
} }
else {
try { return listret;
HttpURLConnection connection = (HttpURLConnection) new URL(url).openConnection(); }
//延迟连接
connection.setReadTimeout(2000); key = (String) var5.next();
connection.setConnectTimeout(3000); } while (!key.equals("img1path") && !key.equals("img2path") && !key.equals("img3path") && !key.equals("img4path") && !key.equals("img5path") && !key.equals("videopath"));
connection.setRequestMethod("GET");
if (connection.getResponseCode() == HttpURLConnection.HTTP_OK) { String url = transferRecord.get(key).toString();
InputStream inputStream = connection.getInputStream(); ++count;
String finalKey = key;
boolean r = FTPUtil.uploadFile(ftp, "gstraff/" + basePath, fileName, inputStream); completionService.submit(() -> {
result.setResult(r); log.info("recordid:{}", recordid);
if (r) { TransferResult result = new TransferResult(recordid, finalKey, url, "", false);
result.setImgpath(basePath + "/" + fileName); String pname = DateUtils.formatCurrDayNoSign() + "_" + recordid + "_0000_" + finalKey.replace("path", "");
} String filesuff = "videopath".equals(finalKey) ? ".mp4" : ".jpg";
// log.info("callable thread:" +result.toString()); String fileName = pname + filesuff;
String ftputl = basePath + "/" + fileName;
if ("videopath".equals(finalKey)) {
result.setUrlfrom(url);
result.setImgpath(ftputl);
} else {
try {
HttpURLConnection connection = (HttpURLConnection) (new URL(url)).openConnection();
connection.setReadTimeout(2000);
connection.setConnectTimeout(3000);
connection.setRequestMethod("GET");
if (connection.getResponseCode() == 200) {
InputStream inputStream = connection.getInputStream();
boolean r = FTPUtil.uploadFile(ftp, "gstraff/" + basePath, fileName, inputStream);
result.setResult(r);
if (r) {
result.setImgpath(ftputl);
log.info("imgpath or videopath success:{}", ftputl);
} else { } else {
log.error("connection code: " + connection.getResponseCode() + " ," + result.toString()); log.info("imgpath or videopath fail:{}", ftputl);
} }
} catch (IOException e) { } else {
System.out.println(e.toString()); log.error("imgpath or videopath connection error code:{}", connection.getResponseCode() + " ," + result.toString());
log.error(e.toString());
} }
} catch (IOException var13) {
log.error("imgpath or videopath error:{}", var13.toString());
} }
return result; }
});
} return result;
} });
List<TransferResult> listret = new ArrayList<>();
for (int i = 0; i < count; i++) {
listret.add(completionService.poll(10, TimeUnit.SECONDS).get());
} }
return listret;
} }
// /**
// * @param transferRecord
// * @param ftp
// * @param basePath
// * @return
// * @throws Exception
// */
// public static List<TransferResult> transferFile(final Map<String, Object> transferRecord, final Ftp ftp, final String basePath) throws Exception {
// Integer ret = 0;
// final Long recordid = Long.parseLong(transferRecord.get("recordid").toString());
// int count = 0;
// for (String key : transferRecord.keySet()) {
// if (key.equals("img1path") || key.equals("img2path")
// || key.equals("img3path") || key.equals("img4path")
// || key.equals("img5path") || key.equals("videopath")) {
// final String url = transferRecord.get(key).toString();
// count++;
// completionService.submit(() -> {
// TransferResult result = new TransferResult(recordid, key, url, "", false);
//
// String filesuff = "videopath".equals(key) ? ".mp4" : ".jpg";
// String pname = DateUtils.formatCurrDayNoSign() + "_" + recordid + "_0000_" + key.replace("path", "");
// String fileName = pname + filesuff;
//// String ftputl = FTPUtil.getFtpUrl(ftp) + basePath + "/" + fileName;
// if (key.equals("videopath")) {
// // 视频只存值,先不取值
// log.info("videopath");
// result.setImgpath(basePath);
// result.setUrlfrom(url);
//
// }
// else {
// try {
// HttpURLConnection connection = (HttpURLConnection) new URL(url).openConnection();
// //延迟连接
// connection.setReadTimeout(2000);
// connection.setConnectTimeout(3000);
// connection.setRequestMethod("GET");
// if (connection.getResponseCode() == HttpURLConnection.HTTP_OK) {
// InputStream inputStream = connection.getInputStream();
//
// boolean r = FTPUtil.uploadFile(ftp, "gstraff/" + basePath, fileName, inputStream);
// result.setResult(r);
// if (r) {
// result.setImgpath(basePath + "/" + fileName);
// }
//// log.info("callable thread:" +result.toString());
// } else {
// log.error("connection code: " + connection.getResponseCode() + " ," + result.toString());
// }
// } catch (IOException e) {
// System.out.println(e.toString());
// log.error(e.toString());
// }
// }
// return result;
// });
// }
// }
// List<TransferResult> listret = new ArrayList<>();
// for (int i = 0; i < count; i++) {
// listret.add(completionService.poll(3, TimeUnit.SECONDS).get());
// }
// return listret;
// }
public static void fetchUrlsFromRecord(Traffalarmrecord record, Map<String, Object> transferRecord) { public static void fetchUrlsFromRecord(Traffalarmrecord record, Map<String, Object> transferRecord) {
...@@ -178,7 +252,8 @@ public class FileTransferManager { ...@@ -178,7 +252,8 @@ public class FileTransferManager {
} }
} }
public static Traffalarmrecord traffAlarmRecordUrlUpdate(List<TransferResult> results) throws Exception { public static Traffalarmrecord traffAlarmRecordUrlUpdate( List<TransferResult> resultslist) throws Exception {
List<TransferResult> results= JSONUtil.toList(JSONUtil.parseArray(JSONUtil.toJsonStr(resultslist)),TransferResult.class);
Traffalarmrecord record = new Traffalarmrecord(); Traffalarmrecord record = new Traffalarmrecord();
for (TransferResult result : results) { for (TransferResult result : results) {
record.setRecordid(result.getRecordid()); record.setRecordid(result.getRecordid());
......
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