|
|
|
@ -231,11 +231,11 @@ public class PatrolTaskController extends BaseController { |
|
|
|
// }).findFirst().get()).getAlgSubtypeName()); |
|
|
|
item.setAlgName( |
|
|
|
algInfos.stream().anyMatch((alg) -> { |
|
|
|
return alg.getAlgSubtypeCode().equals(item.getAlgType()); |
|
|
|
}) ? |
|
|
|
return alg.getAlgSubtypeCode().equals(item.getAlgType()); |
|
|
|
}) ? |
|
|
|
algInfos.stream().filter((alg) -> { |
|
|
|
return alg.getAlgSubtypeCode().equals(item.getAlgType()); |
|
|
|
}).findFirst().get().getAlgSubtypeName() : "" |
|
|
|
return alg.getAlgSubtypeCode().equals(item.getAlgType()); |
|
|
|
}).findFirst().get().getAlgSubtypeName() : "" |
|
|
|
); |
|
|
|
if ("0".equals(item.getFilter())) { |
|
|
|
List<PatrolData> filterDatas = filterList.stream().filter((data) -> { |
|
|
|
@ -249,7 +249,7 @@ public class PatrolTaskController extends BaseController { |
|
|
|
} |
|
|
|
|
|
|
|
AlgValue algValue = new AlgValue(); |
|
|
|
if(item.getResValue() != null) { |
|
|
|
if (item.getResValue() != null) { |
|
|
|
String str = algValue.formatValue(item.getResValue()); |
|
|
|
if ("meter".equals(item.getAlgType())) { |
|
|
|
if (str.equals("-1")) { |
|
|
|
@ -268,7 +268,7 @@ public class PatrolTaskController extends BaseController { |
|
|
|
}).findFirst().get().getAlgSubtypeName() : "" |
|
|
|
); |
|
|
|
AlgValue algValue = new AlgValue(); |
|
|
|
if(item.getResValue() != null) { |
|
|
|
if (item.getResValue() != null) { |
|
|
|
String str = algValue.formatValue(item.getResValue()); |
|
|
|
if ("meter".equals(item.getAlgType())) { |
|
|
|
if (str.equals("-1")) { |
|
|
|
@ -777,11 +777,11 @@ public class PatrolTaskController extends BaseController { |
|
|
|
List<String> infoListFull = map.get("listFull"); |
|
|
|
logger.info("[TASK] taskId1: {}, infoList1: {}, infoListFull1: {}", patrolTask.getTaskId(), infoList, infoListFull); |
|
|
|
if (!infoList.isEmpty()) { |
|
|
|
if(receiveCode.startsWith("areaPatrolServer")) { |
|
|
|
if (receiveCode.startsWith("areaPatrolServer")) { |
|
|
|
List areaPatrolDevList = new ArrayList(); |
|
|
|
for (int i = 0; i < infoListFull.size(); i++) { |
|
|
|
String dev = infoListFull.get(i); |
|
|
|
if(dev.startsWith("areaPatrolServer")) { |
|
|
|
if (dev.startsWith("areaPatrolServer")) { |
|
|
|
areaPatrolDevList.add(infoList.get(i)); |
|
|
|
} |
|
|
|
} |
|
|
|
@ -790,7 +790,7 @@ public class PatrolTaskController extends BaseController { |
|
|
|
List otherDevList = new ArrayList(); |
|
|
|
for (int i = 0; i < infoListFull.size(); i++) { |
|
|
|
String dev = infoListFull.get(i); |
|
|
|
if(!dev.startsWith("areaPatrolServer")) { |
|
|
|
if (!dev.startsWith("areaPatrolServer")) { |
|
|
|
otherDevList.add(infoList.get(i)); |
|
|
|
} |
|
|
|
} |
|
|
|
@ -980,11 +980,11 @@ public class PatrolTaskController extends BaseController { |
|
|
|
List<String> infoListFull = map.get("listFull"); |
|
|
|
logger.info("[TASK] taskId2: {}, infoList2: {}, infoListFull2: {}", patrolTask.getTaskId(), infoList, infoListFull); |
|
|
|
if (!infoList.isEmpty()) { |
|
|
|
if(receiveCode.startsWith("areaPatrolServer")) { |
|
|
|
if (receiveCode.startsWith("areaPatrolServer")) { |
|
|
|
List areaPatrolDevList = new ArrayList(); |
|
|
|
for (int i = 0; i < infoListFull.size(); i++) { |
|
|
|
String dev = infoListFull.get(i); |
|
|
|
if(dev.startsWith("areaPatrolServer")) { |
|
|
|
if (dev.startsWith("areaPatrolServer")) { |
|
|
|
areaPatrolDevList.add(infoList.get(i)); |
|
|
|
} |
|
|
|
} |
|
|
|
@ -993,7 +993,7 @@ public class PatrolTaskController extends BaseController { |
|
|
|
List otherDevList = new ArrayList(); |
|
|
|
for (int i = 0; i < infoListFull.size(); i++) { |
|
|
|
String dev = infoListFull.get(i); |
|
|
|
if(!dev.startsWith("areaPatrolServer")) { |
|
|
|
if (!dev.startsWith("areaPatrolServer")) { |
|
|
|
otherDevList.add(infoList.get(i)); |
|
|
|
} |
|
|
|
} |
|
|
|
@ -2390,7 +2390,7 @@ public class PatrolTaskController extends BaseController { |
|
|
|
} |
|
|
|
|
|
|
|
AlgValue algValue = new AlgValue(); |
|
|
|
if(item.getResValue() != null) { |
|
|
|
if (item.getResValue() != null) { |
|
|
|
String str = algValue.formatValue(item.getResValue()); |
|
|
|
if ("meter".equals(item.getAlgType())) { |
|
|
|
if (str.equals("-1")) { |
|
|
|
@ -2409,7 +2409,7 @@ public class PatrolTaskController extends BaseController { |
|
|
|
}).findFirst().get().getAlgSubtypeName() : "" |
|
|
|
); |
|
|
|
AlgValue algValue = new AlgValue(); |
|
|
|
if(item.getResValue() != null) { |
|
|
|
if (item.getResValue() != null) { |
|
|
|
String str = algValue.formatValue(item.getResValue()); |
|
|
|
if ("meter".equals(item.getAlgType())) { |
|
|
|
if (str.equals("-1")) { |
|
|
|
@ -2420,15 +2420,15 @@ public class PatrolTaskController extends BaseController { |
|
|
|
} |
|
|
|
newList.addAll(filterList); |
|
|
|
|
|
|
|
if(StringUtils.isNotEmpty(resultAnalysis.getAlgName())) { |
|
|
|
if (StringUtils.isNotEmpty(resultAnalysis.getAlgName())) { |
|
|
|
newList = newList.stream().filter((element) -> element.getAlgName().equals(resultAnalysis.getAlgName())).collect(Collectors.toList()); |
|
|
|
} |
|
|
|
|
|
|
|
if(StringUtils.isNotEmpty(resultAnalysis.getFilterDesc())) { |
|
|
|
if (StringUtils.isNotEmpty(resultAnalysis.getFilterDesc())) { |
|
|
|
newList = newList.stream().filter((element) -> element.getFilterDesc().equals(resultAnalysis.getFilterDesc())).collect(Collectors.toList()); |
|
|
|
} |
|
|
|
|
|
|
|
if(newList.size() > maxNum) { |
|
|
|
if (newList.size() > maxNum) { |
|
|
|
return ResponseEntity.ok("超过最大导出数量:" + maxNum + "条,请结合查询条件减少导出的数量!"); |
|
|
|
} else { |
|
|
|
exportExcel(response, newList); |
|
|
|
@ -2466,9 +2466,15 @@ public class PatrolTaskController extends BaseController { |
|
|
|
Cell cell10 = row.createCell(10); |
|
|
|
cell10.setCellValue(MessageUtils.get("分析图片")); |
|
|
|
Cell cell11 = row.createCell(11); |
|
|
|
<<<<<<< Updated upstream |
|
|
|
cell11.setCellValue(MessageUtils.get("分析结果")); |
|
|
|
HSSFPatriarch patriarch = (HSSFPatriarch)sheet.createDrawingPatriarch(); |
|
|
|
for(int i = 0; i < newList.size(); ++i) { |
|
|
|
======= |
|
|
|
cell11.setCellValue("分析结果"); |
|
|
|
HSSFPatriarch patriarch = (HSSFPatriarch) sheet.createDrawingPatriarch(); |
|
|
|
for (int i = 0; i < newList.size(); ++i) { |
|
|
|
>>>>>>> Stashed changes |
|
|
|
Row row1 = sheet.createRow(i + 1); |
|
|
|
Cell cell12 = row1.createCell(0); |
|
|
|
cell12.setCellValue(i + 1); |
|
|
|
@ -2516,7 +2522,7 @@ public class PatrolTaskController extends BaseController { |
|
|
|
int y1 = 0; |
|
|
|
int x2 = 45; |
|
|
|
int y2 = 0; |
|
|
|
HSSFClientAnchor anchor = new HSSFClientAnchor(x1, y1, x2, y2, (short)cell, row, (short)cell1, row); |
|
|
|
HSSFClientAnchor anchor = new HSSFClientAnchor(x1, y1, x2, y2, (short) cell, row, (short) cell1, row); |
|
|
|
pa.createPicture(anchor, wb.addPicture(data, 5)).resize(1.0D); |
|
|
|
} |
|
|
|
|
|
|
|
@ -2529,7 +2535,7 @@ public class PatrolTaskController extends BaseController { |
|
|
|
try { |
|
|
|
byte[] b = new byte[10240]; |
|
|
|
int n; |
|
|
|
while((n = inputStream.read(b)) != -1) { |
|
|
|
while ((n = inputStream.read(b)) != -1) { |
|
|
|
outputStream.write(b, 0, n); |
|
|
|
} |
|
|
|
} catch (Exception e) { |
|
|
|
@ -2586,6 +2592,113 @@ public class PatrolTaskController extends BaseController { |
|
|
|
return rspData; |
|
|
|
} |
|
|
|
|
|
|
|
@GetMapping({"/getPatrolPointName"}) |
|
|
|
public AjaxResult getPatrolPointName(PatrolTaskStatus patrolTaskStatus) { |
|
|
|
PatrolTaskStatus patro = patrolTaskStatusService.selectPatrolTaskStatusByLineId(patrolTaskStatus.getLineId()); |
|
|
|
ResultAnalysis resultAnalysis = new ResultAnalysis(); |
|
|
|
resultAnalysis.setTaskPatrolId(patro.getTaskPatrolledId()); |
|
|
|
resultAnalysis.setResult("0"); |
|
|
|
resultAnalysis.setDeviceName(patrolTaskStatus.getDeviceName()); |
|
|
|
resultAnalysis.setPointName(patrolTaskStatus.getPointName()); |
|
|
|
resultAnalysis.setChannelName(patrolTaskStatus.getChannelName()); |
|
|
|
resultAnalysis.setDeviceSource(patrolTaskStatus.getDeviceSource()); |
|
|
|
resultAnalysis.setPointStatus(patrolTaskStatus.getPointStatus()); |
|
|
|
resultAnalysis.setAlgName(patrolTaskStatus.getAlgName()); |
|
|
|
resultAnalysis.setFilterDesc(patrolTaskStatus.getFilterDesc()); |
|
|
|
resultAnalysis.setDesc(patrolTaskStatus.getDesc()); |
|
|
|
resultAnalysis.setAbnormal(patrolTaskStatus.getAbnormal()); |
|
|
|
resultAnalysis.setPosType(patrolTaskStatus.getPosType()); |
|
|
|
resultAnalysis.setResultType(patrolTaskStatus.getResultType()); |
|
|
|
List<PatrolData> filterList = patrolResultService.selectPatrolDataResultByTaskCodeV2(resultAnalysis); |
|
|
|
resultAnalysis.setResult("1"); |
|
|
|
List<PatrolData> newList = patrolResultService.selectPatrolDataResultByTaskCodeV2(resultAnalysis); |
|
|
|
List<AlgInfo> algInfos = patrolResultService.selectAlgInfo(new PatrolResult()); |
|
|
|
Map<String, Object> map = new HashMap<>(); |
|
|
|
List<String> listPointName = new ArrayList<>(); |
|
|
|
List<String> listPointStatus = new ArrayList<>(); |
|
|
|
List<String> listDeviceSource = new ArrayList<>(); |
|
|
|
List<String> listChannelName = new ArrayList<>(); |
|
|
|
List<String> listDeviceName = new ArrayList<>(); |
|
|
|
List<String> listDesc = new ArrayList<>(); |
|
|
|
List<String> listFilterDesc = new ArrayList<>(); |
|
|
|
List<String> listAlgName = new ArrayList<>(); |
|
|
|
List<Map<String, String>> mapList = new ArrayList<>(); |
|
|
|
for (PatrolData item : newList) { |
|
|
|
item.setAlgName(algInfos.stream().filter( |
|
|
|
(alg) -> alg.getAlgSubtypeCode().equals(item.getAlgType())).findFirst().get().getAlgSubtypeName() |
|
|
|
); |
|
|
|
if ("0".equals(item.getFilter())) { |
|
|
|
List<PatrolData> filterDatas = filterList |
|
|
|
.stream() |
|
|
|
.filter((data) -> data.getObjectId().equals(item.getObjectId()) && data.getAlgType().equals(item.getAlgType())) |
|
|
|
.collect(Collectors.toList()); |
|
|
|
if (!filterDatas.isEmpty()) { |
|
|
|
item.setImg(filterDatas.get(0).getImgAnalyse()); |
|
|
|
item.setFilterDesc(filterDatas.get(0).getDesc()); |
|
|
|
} else { |
|
|
|
item.setImg(""); |
|
|
|
} |
|
|
|
} else { |
|
|
|
item.setImg(item.getImgAnalyse()); |
|
|
|
item.setImgAnalyse(""); |
|
|
|
item.setFilterDesc(item.getDesc()); |
|
|
|
item.setDesc(""); |
|
|
|
} |
|
|
|
|
|
|
|
if (!listPointName.contains(item.getPointName())) { |
|
|
|
listPointName.add(item.getPointName()); |
|
|
|
} |
|
|
|
|
|
|
|
Map<String, String> map1 = new HashMap<>(); |
|
|
|
if (!listPointStatus.contains(item.getPointStatus())) { |
|
|
|
if (item.getPointStatus().equals("1")) { |
|
|
|
map1.put("value", "1"); |
|
|
|
map1.put("label", "正常"); |
|
|
|
} |
|
|
|
|
|
|
|
if (item.getPointStatus().equals("0")) { |
|
|
|
map1.put("value", "0"); |
|
|
|
map1.put("label", "异常"); |
|
|
|
} |
|
|
|
|
|
|
|
listPointStatus.add(item.getPointStatus()); |
|
|
|
mapList.add(map1); |
|
|
|
} |
|
|
|
|
|
|
|
if (!listDeviceSource.contains(item.getDeviceSource())) { |
|
|
|
listDeviceSource.add(item.getDeviceSource()); |
|
|
|
} |
|
|
|
if (!listChannelName.contains(item.getChannelName())) { |
|
|
|
listChannelName.add(item.getChannelName()); |
|
|
|
} |
|
|
|
|
|
|
|
if (!listDeviceName.contains(item.getDeviceName())) { |
|
|
|
listDeviceName.add(item.getDeviceName()); |
|
|
|
} |
|
|
|
|
|
|
|
if (!listDesc.contains(item.getDesc()) && StringUtils.isNotEmpty(item.getDesc())) { |
|
|
|
listDesc.add(item.getDesc()); |
|
|
|
} |
|
|
|
|
|
|
|
if (!listFilterDesc.contains(item.getFilterDesc()) && !"".equals(item.getFilterDesc())) { |
|
|
|
listFilterDesc.add(item.getFilterDesc()); |
|
|
|
} |
|
|
|
|
|
|
|
if (!listAlgName.contains(item.getAlgName())) { |
|
|
|
listAlgName.add(item.getAlgName()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
map.put("listPointName", listPointName); |
|
|
|
map.put("listPointStatus", mapList); |
|
|
|
map.put("listDeviceSource", listDeviceSource); |
|
|
|
map.put("listChannelName", listChannelName); |
|
|
|
map.put("listDeviceName", listDeviceName); |
|
|
|
map.put("listDesc", listDesc); |
|
|
|
map.put("listFilterDesc", listFilterDesc); |
|
|
|
map.put("listAlgName", listAlgName); |
|
|
|
return AjaxResult.success(map); |
|
|
|
} |
|
|
|
|
|
|
|
public static void main(String[] args) { |
|
|
|
} |
|
|
|
|