|
|
|
@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON; |
|
|
|
import com.alibaba.fastjson.JSONArray; |
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
import com.inspect.access.base.model.InfraredModel; |
|
|
|
import com.inspect.base.core.constant.AlgConstants; |
|
|
|
import com.inspect.base.core.constant.RedisConst; |
|
|
|
import com.inspect.base.core.domain.FtpResult; |
|
|
|
import com.inspect.base.core.domain.Response; |
|
|
|
@ -29,13 +30,8 @@ import com.inspect.base.core.domain.maintain.MaintainRegion; |
|
|
|
import com.inspect.job.util.HttpClientUtil; |
|
|
|
import com.inspect.system.base.domain.SysDictData; |
|
|
|
|
|
|
|
import java.io.*; |
|
|
|
import java.net.HttpURLConnection; |
|
|
|
import java.net.URL; |
|
|
|
import java.net.URLConnection; |
|
|
|
import java.text.DecimalFormat; |
|
|
|
import java.text.NumberFormat; |
|
|
|
import java.text.ParseException; |
|
|
|
import java.text.SimpleDateFormat; |
|
|
|
import java.util.*; |
|
|
|
import java.util.concurrent.*; |
|
|
|
@ -471,20 +467,59 @@ public class JobMainTask { |
|
|
|
filePaths.append("/" + ftpResult.getFilepath()); |
|
|
|
} |
|
|
|
} else if ("ir".equals(chanType)) { |
|
|
|
InfraredModel infraredModel = new InfraredModel(); |
|
|
|
infraredModel.setChannelSerial(presetPos.getChannelCode()); |
|
|
|
infraredModel.setPresetId(Integer.parseInt(presetPos.getPresetPosCode())); |
|
|
|
EqpBook eqpbook = new EqpBook(); |
|
|
|
eqpbook.setPatrolDeviceCode(presetPos.getPatrolDeviceCode()); |
|
|
|
List<EqpBook> eqpBookListList = taskExecClient.selectBasedataEqpBookList(eqpbook); |
|
|
|
if (!eqpBookListList.isEmpty()) { |
|
|
|
Response ir_gen = remoteInvokeService.invoke("IR_GEN", presetPos.getPatrolDeviceCode().split("#")[0], new HashMap<>()); |
|
|
|
log.info("ir_gen: {}", JSONObject.toJSONString(ir_gen)); |
|
|
|
Object data = ir_gen.getData(); |
|
|
|
String path = JSONObject.parseObject(JSONObject.toJSONString(data)).getString("filePath"); |
|
|
|
path = path.split("33333")[1]; |
|
|
|
filePaths.append(path).append(","); |
|
|
|
log.info("INFRA:{}", taskExecRecord.getTaskName() + " path : " + path); |
|
|
|
log.info("[JOB] 红外处理流程, chanType: {}, patrolPointId: {}", chanType, presetPos.getPatrolPointId()); |
|
|
|
Map<String, String> algSubtypeIdMap = taskExecClient.getAlgTypeListByPatrolPointId(String.valueOf(presetPos.getPatrolPointId())); |
|
|
|
log.info("prePointExec algorithmTypeMap: {}", algSubtypeIdMap); |
|
|
|
final String algSubtypeCode = algSubtypeIdMap == null ? StringUtils.EMPTY : |
|
|
|
algSubtypeIdMap.getOrDefault(AlgConstants.ALG_SUBTYPE_CODE, StringUtils.EMPTY); |
|
|
|
if(algSubtypeCode.contains(AlgConstants.INFRA_1800) |
|
|
|
|| algSubtypeCode.contains(AlgConstants.INFRA_YU3) |
|
|
|
|| algSubtypeCode.contains(AlgConstants.INFRA_CAMERA) |
|
|
|
|| algSubtypeCode.contains(AlgConstants.INFRA_CAMERA_REVERSE)) { |
|
|
|
log.info("[infra_1800] 红外处理新流程: prePointExec algSubtypeCode: {}", algSubtypeCode); |
|
|
|
String paramFileName; |
|
|
|
if(algSubtypeCode.contains(AlgConstants.INFRA_1800)) { |
|
|
|
final String temperUrl = liveIVS_URL + "/api/v1/device/temper"; |
|
|
|
JSONObject temperParam = new JSONObject(); |
|
|
|
temperParam.put("presetId", 0); |
|
|
|
temperParam.put("cameraCode", presetPos.getChannelCode()); |
|
|
|
final String temperUrlRes = HttpClientUtils.sendPostAgain(temperUrl, temperParam.toString()); |
|
|
|
log.info("[infra_1800] prePointExec temperUrlRes: {}", temperUrlRes); |
|
|
|
paramFileName = taskPatrolId.split(StringUtils.UNDERLINE)[1] + StringUtils.UNDERLINE |
|
|
|
+ taskPatrolId.split(StringUtils.UNDERLINE)[2] + StringUtils.UNDERLINE |
|
|
|
+ presetPos.getPatrolPointId() + StringUtils.UNDERLINE |
|
|
|
+ taskExecRecord.getDevNo() + "_" + temperUrlRes + ".jpg"; |
|
|
|
} else { |
|
|
|
paramFileName = taskPatrolId.split(StringUtils.UNDERLINE)[1] + StringUtils.UNDERLINE |
|
|
|
+ taskPatrolId.split(StringUtils.UNDERLINE)[2] + StringUtils.UNDERLINE |
|
|
|
+ presetPos.getPatrolPointId() + StringUtils.UNDERLINE |
|
|
|
+ taskExecRecord.getDevNo() + ".jpg"; |
|
|
|
} |
|
|
|
String paramUrl = liveIVS_URL + "/api/v1/device/channelsnap?serial=" + presetPos.getVideoNvrCode() + "&realtime=true&code=" + presetPos.getChannelCode(); |
|
|
|
String paramFileDir = basePath + "CCD"; |
|
|
|
log.info("红外处理新流程: paramUrl: {}, paramFileName: {}, paramFileDir: {}", paramUrl, paramFileName, paramFileDir); |
|
|
|
FtpResult ftpResult = saveFile(paramUrl, paramFileName, paramFileDir); |
|
|
|
if (ftpResult != null && StringUtils.isNotEmpty(ftpResult.getFilepath())) { |
|
|
|
log.info("红外处理新流程: filePath: {}", ftpResult.getFilepath()); |
|
|
|
bOk = ftpResult.isOk(); |
|
|
|
filePaths.append("/" + ftpResult.getFilepath()); |
|
|
|
} |
|
|
|
} else { // 古老的红外处理流程,保留勿删除 |
|
|
|
InfraredModel infraredModel = new InfraredModel(); |
|
|
|
infraredModel.setChannelSerial(presetPos.getChannelCode()); |
|
|
|
infraredModel.setPresetId(Integer.parseInt(presetPos.getPresetPosCode())); |
|
|
|
EqpBook eqpbook = new EqpBook(); |
|
|
|
eqpbook.setPatrolDeviceCode(presetPos.getPatrolDeviceCode()); |
|
|
|
List<EqpBook> eqpBookListList = taskExecClient.selectBasedataEqpBookList(eqpbook); |
|
|
|
if (!eqpBookListList.isEmpty()) { |
|
|
|
Response ir_gen = remoteInvokeService.invoke("IR_GEN", presetPos.getPatrolDeviceCode().split("#")[0], new HashMap<>()); |
|
|
|
log.info("ir_gen: {}", JSONObject.toJSONString(ir_gen)); |
|
|
|
Object data = ir_gen.getData(); |
|
|
|
String path = JSONObject.parseObject(JSONObject.toJSONString(data)).getString("filePath"); |
|
|
|
path = path.split("33333")[1]; |
|
|
|
filePaths.append(path).append(","); |
|
|
|
log.info("INFRA:{}", taskExecRecord.getTaskName() + " path : " + path); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} catch (Exception e) { |
|
|
|
|