|
|
|
@ -2,10 +2,12 @@ package com.inspect.partrolresult.controller; |
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSONArray; |
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
import com.inspect.analysis.constant.AnalyseConstants; |
|
|
|
import com.inspect.analysis.domain.ResultAnalysis; |
|
|
|
import com.inspect.analysis.domain.resultList; |
|
|
|
import com.inspect.analysis.domain.results; |
|
|
|
import com.inspect.analysis.service.IResultAnalysisService; |
|
|
|
import com.inspect.base.core.constant.AlgConstants; |
|
|
|
import com.inspect.base.core.constant.Color; |
|
|
|
import com.inspect.base.core.constant.RedisConst; |
|
|
|
import com.inspect.base.core.domain.DataMsg; |
|
|
|
@ -709,9 +711,9 @@ public class PatrolResultController extends BaseController { |
|
|
|
|
|
|
|
String ids = ""; |
|
|
|
for (PatrolResult patrolResult : patrolResultList) { |
|
|
|
List<AnalyseReqItem> filterList = new ArrayList<>(); //初筛算法列表 |
|
|
|
List<AnalyseReqItem> bigModelList = new ArrayList<>(); //大模型算法列表 |
|
|
|
List<AnalyseReqItem> infraredList = new ArrayList<>();//红外摄像机算法列表 根据最新做法,红外要归到大模型里面,由大模型来调用(需要调整如下逻辑)-20250423 |
|
|
|
List<AnalyseReqItem> filterList = new ArrayList<>(); //初筛 |
|
|
|
List<AnalyseReqItem> bigModelList = new ArrayList<>(); //大模型 |
|
|
|
List<AnalyseReqItem> infraredList = new ArrayList<>();//古老的红外逻辑; 最新的红外逻辑另辟蹊径增加新的算法类型并且归入初筛逻辑-20250423 |
|
|
|
String image = patrolResult.getFilePath().replace(ftp.getFtpPath() + "/", StringUtils.EMPTY); |
|
|
|
String imageType = patrolResult.getFileType(); |
|
|
|
AnalyseReqItem analyseReqItem = new AnalyseReqItem(); |
|
|
|
@ -753,12 +755,9 @@ public class PatrolResultController extends BaseController { |
|
|
|
String[] strings = new String[1]; |
|
|
|
String type; |
|
|
|
if (!algInfoList.isEmpty()) { |
|
|
|
// 处理红外请求,目前讨论的结果以及方案要归到大模型逻辑,本接口这部分处理后续要废掉 |
|
|
|
List<AlgInfo> infraredAlgInfoList = algInfoList.stream().filter((item) -> { |
|
|
|
return "infrared".equals(item.getAlgSubtypeCode()); |
|
|
|
}).collect(Collectors.toList()); |
|
|
|
// 最古老处理红外请求,暂且保留 |
|
|
|
List<AlgInfo> infraredAlgInfoList = algInfoList.stream().filter((item) -> "infrared".equals(item.getAlgSubtypeCode())).collect(Collectors.toList()); |
|
|
|
logger.info("callRemoteAlgorithm infraredList: {}", infraredAlgInfoList); |
|
|
|
String[] typeArr; |
|
|
|
if (!infraredAlgInfoList.isEmpty() && "true".equals(pictureFrame)) { |
|
|
|
Map<String, Object> device = resultAnalysisService.selectEqInfoByCode(patrolResult.getPatrolDeviceCode()); |
|
|
|
if (device != null && device.get("type") != null) { |
|
|
|
@ -770,15 +769,15 @@ public class PatrolResultController extends BaseController { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
typeArr = new String[1]; |
|
|
|
String[] imageUrlArr = new String[1]; |
|
|
|
if (image.contains(StringUtils.COMMA)) { |
|
|
|
typeArr[0] = image.split(StringUtils.COMMA)[0]; |
|
|
|
imageUrlArr[0] = image.split(StringUtils.COMMA)[0]; |
|
|
|
} else { |
|
|
|
typeArr[0] = image; |
|
|
|
imageUrlArr[0] = image; |
|
|
|
} |
|
|
|
|
|
|
|
ids = patrolResult.getLineId() + ""; |
|
|
|
analyseReqItem.setImageUrlList(typeArr); |
|
|
|
analyseReqItem.setImageUrlList(imageUrlArr); |
|
|
|
analyseReqItem.setTypeList(strings); |
|
|
|
infraredList.add(analyseReqItem.clone()); |
|
|
|
} |
|
|
|
@ -786,10 +785,10 @@ public class PatrolResultController extends BaseController { |
|
|
|
algInfoList.removeAll(infraredAlgInfoList); |
|
|
|
List<String> imagelist = new ArrayList<>(); |
|
|
|
if (image.contains(StringUtils.COMMA)) { |
|
|
|
typeArr = imageType.split(StringUtils.COMMA); |
|
|
|
String[] imageTypeArr = imageType.split(StringUtils.COMMA); |
|
|
|
String[] imageArr = image.split(StringUtils.COMMA); |
|
|
|
for (int i = 0; i < typeArr.length; ++i) { |
|
|
|
if ("2".equals(typeArr[i]) || "4".equals(typeArr[i])) { |
|
|
|
for (int i = 0; i < imageTypeArr.length; ++i) { |
|
|
|
if ("2".equals(imageTypeArr[i]) || "4".equals(imageTypeArr[i])) { |
|
|
|
imagelist.add(imageArr[i]); |
|
|
|
} |
|
|
|
} |
|
|
|
@ -806,10 +805,11 @@ public class PatrolResultController extends BaseController { |
|
|
|
filePanpath = judgeMap.get("dis_ref_picture_path"); |
|
|
|
} |
|
|
|
|
|
|
|
analyseReqItem.setImageNormalUrlPath(filePanpath);//总是为空 |
|
|
|
List<AlgInfo> judgeList = algInfoList.stream().filter((item) -> { |
|
|
|
return item.getAlgName().contains("判别"); |
|
|
|
}).collect(Collectors.toList()); |
|
|
|
analyseReqItem.setImageNormalUrlPath(filePanpath); |
|
|
|
List<AlgInfo> judgeList = algInfoList.stream().filter( |
|
|
|
(item) -> item.getAlgName().contains("判别") |
|
|
|
).collect(Collectors.toList()); |
|
|
|
|
|
|
|
if (!judgeList.isEmpty()) { |
|
|
|
analyseReqItem.setTypeList(judgeList.stream().map(AlgInfo::getAlgSubtypeCode).toArray(String[]::new)); |
|
|
|
String[] images; |
|
|
|
@ -824,19 +824,23 @@ public class PatrolResultController extends BaseController { |
|
|
|
bigModelList.add(analyseReqItem.clone()); |
|
|
|
} |
|
|
|
|
|
|
|
algInfoList.removeAll(judgeList); |
|
|
|
List<AlgInfo> meterList = (algInfoList).stream().filter((item) -> { |
|
|
|
return "meter".equals(item.getAlgSubtypeCode()); |
|
|
|
}).collect(Collectors.toList()); |
|
|
|
algInfoList.removeAll(judgeList);//将已经加入bigModelList中的记录删除(算法名称为缺陷判别) |
|
|
|
List<AlgInfo> meterList = |
|
|
|
(algInfoList).stream().filter((item) -> |
|
|
|
AlgConstants.METER.equals(item.getAlgSubtypeCode()) |
|
|
|
|| AlgConstants.XB.equals(item.getAlgSubtypeCode()) |
|
|
|
|| AlgConstants.INFRA_1800.equals(item.getAlgSubtypeCode()) |
|
|
|
|| AlgConstants.INFRA_YU3.equals(item.getAlgSubtypeCode()) |
|
|
|
|| AlgConstants.INFRA_CAMERA.equals(item.getAlgSubtypeCode()) |
|
|
|
|| AlgConstants.INFRA_CAMERA_REVERSE.equals(item.getAlgSubtypeCode()) |
|
|
|
).collect(Collectors.toList()); |
|
|
|
if (!meterList.isEmpty()) { |
|
|
|
analyseReqItem.setTypeList(meterList.stream().map(AlgInfo::getAlgSubtypeCode).toArray(String[]::new)); |
|
|
|
filterList.add(analyseReqItem.clone()); |
|
|
|
} |
|
|
|
|
|
|
|
algInfoList.removeAll(meterList); |
|
|
|
List<AlgInfo> defectList = algInfoList.stream().filter((item) -> { |
|
|
|
return "缺陷识别".equals(item.getAlgName()); |
|
|
|
}).collect(Collectors.toList()); |
|
|
|
algInfoList.removeAll(meterList);//将已经加入filterList中的记录删除(算法编码为meter的记录) |
|
|
|
List<AlgInfo> defectList = algInfoList.stream().filter((item) -> "缺陷识别".equals(item.getAlgName())).collect(Collectors.toList()); |
|
|
|
if (!defectList.isEmpty()) { |
|
|
|
analyseReqItem.setTypeList(defectList.stream().map(AlgInfo::getAlgSubtypeCode).toArray(String[]::new)); |
|
|
|
bigModelList.add(analyseReqItem.clone()); |
|
|
|
@ -847,103 +851,104 @@ public class PatrolResultController extends BaseController { |
|
|
|
analyseReqItem.setTypeList(algInfoList.stream().map(AlgInfo::getAlgSubtypeCode).toArray(String[]::new)); |
|
|
|
bigModelList.add(analyseReqItem.clone()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
logger.info("callRemoteAlgorithm infraredList.isEmpty(): {}", infraredList.isEmpty());//永远为true |
|
|
|
if (!infraredList.isEmpty() && "true".equals(pictureFrame)) { |
|
|
|
String uuid = UUID.randomUUID().toString().trim().replaceAll(StringUtils.DASH, StringUtils.EMPTY); |
|
|
|
redisService.setCacheObject(RedisConst.REQUEST_UUID + uuid, patrolResultList.get(0).getTaskPatrolledId(), 1L, TimeUnit.DAYS); |
|
|
|
AnalyseRequest sendData = new AnalyseRequest(); |
|
|
|
sendData.setObjectList(infraredList); |
|
|
|
sendData.setRequestHostIp(MAJOR_URL); |
|
|
|
sendData.setRequestHostPort(TASK_PORT); |
|
|
|
sendData.setRequestId(uuid); |
|
|
|
type = JSONObject.toJSONString(sendData); |
|
|
|
// 古老的红外逻辑处理 |
|
|
|
logger.info("callRemoteAlgorithm infraredList.isEmpty(): {}", infraredList.isEmpty()); |
|
|
|
if (!infraredList.isEmpty() && "true".equals(pictureFrame)) { |
|
|
|
String uuid = UUID.randomUUID().toString().trim().replaceAll(StringUtils.DASH, StringUtils.EMPTY); |
|
|
|
redisService.setCacheObject(RedisConst.REQUEST_UUID + uuid, patrolResultList.get(0).getTaskPatrolledId(), 1L, TimeUnit.DAYS); |
|
|
|
AnalyseRequest sendData = new AnalyseRequest(); |
|
|
|
sendData.setObjectList(infraredList); |
|
|
|
sendData.setRequestHostIp(MAJOR_URL); |
|
|
|
sendData.setRequestHostPort(TASK_PORT); |
|
|
|
sendData.setRequestId(uuid); |
|
|
|
type = JSONObject.toJSONString(sendData); |
|
|
|
|
|
|
|
try { |
|
|
|
logger.info("callRemoteAlgorithm infraredRequest: {}", type); |
|
|
|
InfraredRequestParam infraredRequestParam = JSONObject.parseObject(type, InfraredRequestParam.class); |
|
|
|
InfraredResponse infraredResponse = infraredImageParser.parse(infraredRequestParam); |
|
|
|
logger.info("callRemoteAlgorithm infraredResponse: {}", infraredResponse); |
|
|
|
if (infraredResponse != null) { |
|
|
|
ResultAnalysis resultAnalysis = new ResultAnalysis(); |
|
|
|
if (infraredResponse.getResultList() != null && !infraredResponse.getResultList().isEmpty()) { |
|
|
|
if (infraredResponse.getResultList().get(0).getResults() != null && !infraredResponse.getResultList().get(0).getResults().isEmpty()) { |
|
|
|
String ww; |
|
|
|
if (StringUtils.isNotEmpty(infraredResponse.getResultList().get(0).getResults().get(0).getValue()) && infraredResponse.getResultList().get(0).getResults().get(0).getValue().equals("1")) { |
|
|
|
resultAnalysis.setBusinessId(ids); |
|
|
|
ww = JSONObject.toJSONString(infraredResponse); |
|
|
|
resultAnalysis.setResultContent(ww); |
|
|
|
if (StringUtils.isNotEmpty(infraredResponse.getResultList().get(0).getObjectId())) { |
|
|
|
resultAnalysis.setObjectId(infraredResponse.getResultList().get(0).getObjectId()); |
|
|
|
} |
|
|
|
try { |
|
|
|
logger.info("callRemoteAlgorithm infraredRequest: {}", type); |
|
|
|
InfraredRequestParam infraredRequestParam = JSONObject.parseObject(type, InfraredRequestParam.class); |
|
|
|
InfraredResponse infraredResponse = infraredImageParser.parse(infraredRequestParam); |
|
|
|
logger.info("callRemoteAlgorithm infraredResponse: {}", infraredResponse); |
|
|
|
if (infraredResponse != null) { |
|
|
|
ResultAnalysis resultAnalysis = new ResultAnalysis(); |
|
|
|
if (infraredResponse.getResultList() != null && !infraredResponse.getResultList().isEmpty()) { |
|
|
|
if (infraredResponse.getResultList().get(0).getResults() != null && !infraredResponse.getResultList().get(0).getResults().isEmpty()) { |
|
|
|
String ww; |
|
|
|
if (StringUtils.isNotEmpty(infraredResponse.getResultList().get(0).getResults().get(0).getValue()) && infraredResponse.getResultList().get(0).getResults().get(0).getValue().equals("1")) { |
|
|
|
resultAnalysis.setBusinessId(ids); |
|
|
|
ww = JSONObject.toJSONString(infraredResponse); |
|
|
|
resultAnalysis.setResultContent(ww); |
|
|
|
if (StringUtils.isNotEmpty(infraredResponse.getResultList().get(0).getObjectId())) { |
|
|
|
resultAnalysis.setObjectId(infraredResponse.getResultList().get(0).getObjectId()); |
|
|
|
} |
|
|
|
|
|
|
|
resultAnalysis.setDescription(infraredResponse.getResultList().get(0).getResults().get(0).getDesc()); |
|
|
|
resultAnalysis.setCreateTime(new Date()); |
|
|
|
resultAnalysis.setResStatus("0"); |
|
|
|
resultAnalysis.setPointStatus("0"); |
|
|
|
resultAnalysis.setResultType("0"); |
|
|
|
resultAnalysisService.insertResultAnalysis(resultAnalysis); |
|
|
|
JSONObject websocketParam = new JSONObject(); |
|
|
|
websocketParam.put("event", "task_statistics_notify"); |
|
|
|
websocketParam.put("data", (new JSONObject()).fluentPut("taskName", "红外任务").fluentPut("msg", "高温告警")); |
|
|
|
//websocketService.parseMessage(websocketParam.toString()); |
|
|
|
} else { |
|
|
|
resultAnalysis.setBusinessId(ids); |
|
|
|
ww = JSONObject.toJSONString(infraredResponse); |
|
|
|
resultAnalysis.setResultContent(ww); |
|
|
|
resultAnalysis.setResultType("1"); |
|
|
|
if (StringUtils.isNotEmpty(infraredResponse.getResultList().get(0).getObjectId())) { |
|
|
|
resultAnalysis.setObjectId(infraredResponse.getResultList().get(0).getObjectId()); |
|
|
|
} |
|
|
|
resultAnalysis.setDescription(infraredResponse.getResultList().get(0).getResults().get(0).getDesc()); |
|
|
|
resultAnalysis.setCreateTime(new Date()); |
|
|
|
resultAnalysis.setResStatus("0"); |
|
|
|
resultAnalysis.setPointStatus("0"); |
|
|
|
resultAnalysis.setResultType("0"); |
|
|
|
resultAnalysisService.insertResultAnalysis(resultAnalysis); |
|
|
|
JSONObject websocketParam = new JSONObject(); |
|
|
|
websocketParam.put("event", "task_statistics_notify"); |
|
|
|
websocketParam.put("data", (new JSONObject()).fluentPut("taskName", "红外任务").fluentPut("msg", "高温告警")); |
|
|
|
//websocketService.parseMessage(websocketParam.toString()); |
|
|
|
} else { |
|
|
|
resultAnalysis.setBusinessId(ids); |
|
|
|
ww = JSONObject.toJSONString(infraredResponse); |
|
|
|
resultAnalysis.setResultContent(ww); |
|
|
|
resultAnalysis.setResultType("1"); |
|
|
|
if (StringUtils.isNotEmpty(infraredResponse.getResultList().get(0).getObjectId())) { |
|
|
|
resultAnalysis.setObjectId(infraredResponse.getResultList().get(0).getObjectId()); |
|
|
|
} |
|
|
|
|
|
|
|
resultAnalysis.setDescription(infraredResponse.getResultList().get(0).getResults().get(0).getDesc()); |
|
|
|
resultAnalysis.setCreateTime(new Date()); |
|
|
|
resultAnalysis.setResStatus("1"); |
|
|
|
resultAnalysis.setPointStatus("1"); |
|
|
|
resultAnalysis.setResultType("1"); |
|
|
|
resultAnalysisService.insertResultAnalysis(resultAnalysis); |
|
|
|
resultAnalysis.setDescription(infraredResponse.getResultList().get(0).getResults().get(0).getDesc()); |
|
|
|
resultAnalysis.setCreateTime(new Date()); |
|
|
|
resultAnalysis.setResStatus("1"); |
|
|
|
resultAnalysis.setPointStatus("1"); |
|
|
|
resultAnalysis.setResultType("1"); |
|
|
|
resultAnalysisService.insertResultAnalysis(resultAnalysis); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
double maxT = infraredResponse.getResultList().get(0).getResults().get(0).getInfraredT().getMaxT(); |
|
|
|
PatrolResult patrolResultAsd = patrolResultService.selectPatrolResultByLineId(Long.valueOf(ids)); |
|
|
|
patrolResultAsd.setValue(maxT + ""); |
|
|
|
patrolResultAsd.setRecognitionType("4"); |
|
|
|
patrolResultService.updatePatrolResult(patrolResultAsd); |
|
|
|
double maxT = infraredResponse.getResultList().get(0).getResults().get(0).getInfraredT().getMaxT(); |
|
|
|
PatrolResult patrolResultAsd = patrolResultService.selectPatrolResultByLineId(Long.valueOf(ids)); |
|
|
|
patrolResultAsd.setValue(maxT + ""); |
|
|
|
patrolResultAsd.setRecognitionType("4"); |
|
|
|
patrolResultService.updatePatrolResult(patrolResultAsd); |
|
|
|
} |
|
|
|
} |
|
|
|
} catch (Exception exception) { |
|
|
|
exception.printStackTrace(); |
|
|
|
} |
|
|
|
} catch (Exception exception) { |
|
|
|
exception.printStackTrace(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
logger.info("callRemoteAlgorithm algInfoList2: {}", algInfoList); |
|
|
|
logger.info("callRemoteAlgorithm filterList: {}", filterList); |
|
|
|
logger.info("callRemoteAlgorithm bigModelList: {}", bigModelList); |
|
|
|
AnalyseRequest analyseReq; |
|
|
|
//qinyl 初筛 |
|
|
|
if (!filterList.isEmpty()) { |
|
|
|
analyseReq = new AnalyseRequest(); |
|
|
|
analyseReq.setTaskPatrolId(patrolResultList.get(0).getTaskPatrolledId()); |
|
|
|
analyseReq.setObjectList(filterList); |
|
|
|
analyseReq.setRequestHostIp(MAJOR_URL); |
|
|
|
analyseReq.setRequestHostPort(TASK_PORT); |
|
|
|
if (filterList.get(0).getImageUrlList() != null && filterList.get(0).getImageUrlList().length > 0) { |
|
|
|
String meterFilter = patrolTaskService.selectConfigByKey("ANALYSE_IS_METER_FILTER"); |
|
|
|
analyseRemoteService.sendRequest(analyseReq, filterList.get(0).getTypeList(), "1".equals(meterFilter)); |
|
|
|
logger.info("callRemoteAlgorithm algInfoList2: {}", algInfoList); |
|
|
|
logger.info("callRemoteAlgorithm filterList: {}", filterList); |
|
|
|
logger.info("callRemoteAlgorithm bigModelList: {}", bigModelList); |
|
|
|
|
|
|
|
//qinyl 初筛逻辑处理 |
|
|
|
if (!filterList.isEmpty()) { |
|
|
|
AnalyseRequest analyseReq = new AnalyseRequest(); |
|
|
|
analyseReq.setTaskPatrolId(patrolResultList.get(0).getTaskPatrolledId()); |
|
|
|
analyseReq.setObjectList(filterList); |
|
|
|
analyseReq.setRequestHostIp(MAJOR_URL); |
|
|
|
analyseReq.setRequestHostPort(TASK_PORT); |
|
|
|
if (filterList.get(0).getImageUrlList() != null && filterList.get(0).getImageUrlList().length > 0) { |
|
|
|
String meterFilter = patrolTaskService.selectConfigByKey(AnalyseConstants.ANALYSE_IS_METER_FILTER); |
|
|
|
analyseRemoteService.sendRequest(analyseReq, filterList.get(0).getTypeList(), "1".equals(meterFilter)); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
//qinyl 大模型 |
|
|
|
if (!bigModelList.isEmpty()) { |
|
|
|
analyseReq = new AnalyseRequest(); |
|
|
|
analyseReq.setTaskPatrolId(patrolResultList.get(0).getTaskPatrolledId()); |
|
|
|
analyseReq.setObjectList(bigModelList); |
|
|
|
analyseReq.setRequestHostIp(MAJOR_URL); |
|
|
|
analyseReq.setRequestHostPort(TASK_PORT); |
|
|
|
if (bigModelList.get(0).getImageUrlList() != null && bigModelList.get(0).getImageUrlList().length > 0) { |
|
|
|
analyseRemoteService.sendRequest(analyseReq, bigModelList.get(0).getTypeList(), true); |
|
|
|
//qinyl 大模型 |
|
|
|
if (!bigModelList.isEmpty()) { |
|
|
|
AnalyseRequest analyseReq = new AnalyseRequest(); |
|
|
|
analyseReq.setTaskPatrolId(patrolResultList.get(0).getTaskPatrolledId()); |
|
|
|
analyseReq.setObjectList(bigModelList); |
|
|
|
analyseReq.setRequestHostIp(MAJOR_URL); |
|
|
|
analyseReq.setRequestHostPort(TASK_PORT); |
|
|
|
if (bigModelList.get(0).getImageUrlList() != null && bigModelList.get(0).getImageUrlList().length > 0) { |
|
|
|
analyseRemoteService.sendRequest(analyseReq, bigModelList.get(0).getTypeList(), true); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
@ -1058,7 +1063,7 @@ public class PatrolResultController extends BaseController { |
|
|
|
logger.info(Color.CYAN + "###### RECEIVE DATA TO ANALYSIS [41] start ######" + Color.END); |
|
|
|
try { |
|
|
|
JSONObject parseObject = JSONObject.parseObject(messageBody); |
|
|
|
String sendCode = (String)parseObject.get("SendCode"); |
|
|
|
String sendCode = (String) parseObject.get("SendCode"); |
|
|
|
|
|
|
|
Object jsonArray = parseObject.get("taskStateList"); |
|
|
|
if (jsonArray == null) { |
|
|
|
@ -1107,7 +1112,7 @@ public class PatrolResultController extends BaseController { |
|
|
|
if (!listEqpBook.isEmpty()) { |
|
|
|
item.setLineId(((PatrolTaskStatus) listEqpBook.get(0)).getLineId()); |
|
|
|
|
|
|
|
if(item.getTaskName().contains("联合") && !item.getTaskName().startsWith(sendCode)) { |
|
|
|
if (item.getTaskName().contains("联合") && !item.getTaskName().startsWith(sendCode)) { |
|
|
|
item.setTaskName(sendCode + "-" + item.getTaskName()); |
|
|
|
} |
|
|
|
i = iPatrolTaskStatusService.updatePatrolTaskStatus(item); |
|
|
|
@ -1120,7 +1125,7 @@ public class PatrolResultController extends BaseController { |
|
|
|
item.setPosType(str); |
|
|
|
item.setCreateTime(new Date()); |
|
|
|
item.setStartTime(new Date()); |
|
|
|
if(item.getTaskName().contains("联合") && !item.getTaskName().startsWith(sendCode)) { |
|
|
|
if (item.getTaskName().contains("联合") && !item.getTaskName().startsWith(sendCode)) { |
|
|
|
item.setTaskName(sendCode + "-" + item.getTaskName()); |
|
|
|
} |
|
|
|
i = iPatrolTaskStatusService.insertPatrolTaskStatus(item); |
|
|
|
@ -1233,12 +1238,12 @@ public class PatrolResultController extends BaseController { |
|
|
|
patrolTaskResultMain.setFileStatus("0"); |
|
|
|
patrolTaskResultMain.setTaskPatrolledId(patrolResultList.get(0).getTaskPatrolledId()); |
|
|
|
int devCount = tasks.get(0).getDevNo().split(StringUtils.COMMA).length; |
|
|
|
if(devCount > 1) { |
|
|
|
if (devCount > 1) { |
|
|
|
PatrolTaskResultMain resultMainQuery = new PatrolTaskResultMain(); |
|
|
|
resultMainQuery.setTaskId(String.valueOf(tasks.get(0).getTaskId())); |
|
|
|
//select unified_task_patrolled_id from patrol_task_result_main where task_id = #{taskId} and file_status = 0 and (now() - create_time) <= 120 ORDER BY line_id desc limit 1 |
|
|
|
String unifiedTaskPatrolledId = iPatrolTaskResultMainService.selectUnifiedTaskPatrolledId(resultMainQuery); |
|
|
|
if(unifiedTaskPatrolledId != null) { |
|
|
|
if (unifiedTaskPatrolledId != null) { |
|
|
|
patrolTaskResultMain.setUnifiedTaskPatrolledId(unifiedTaskPatrolledId); |
|
|
|
} else { |
|
|
|
patrolTaskResultMain.setUnifiedTaskPatrolledId(taskResultMain.getTaskId() + "_" + new SimpleDateFormat("yyyyMMddHHmmss").format(new Date())); |
|
|
|
|