Browse Source

ivs1800红外添加规则更新

master
王寅 7 months ago
parent
commit
b1dab54f5d
2 changed files with 43 additions and 0 deletions
  1. +1
    -0
      inspect-main/inspect-main-task/src/main/java/com/inspect/analysis/utils/ResultAnalysisUtils.java
  2. +42
    -0
      inspect-main/inspect-main-video/src/main/java/com/inspect/patrol/controller/PatrolPresetPosController.java

+ 1
- 0
inspect-main/inspect-main-task/src/main/java/com/inspect/analysis/utils/ResultAnalysisUtils.java View File

@ -121,6 +121,7 @@ public class ResultAnalysisUtils {
if(algType.equals("infrared")) {
device = messageUtils.get("红外");
} else if(algType.equals("infra_1800")) {
log.info("红外1800===============");
device = messageUtils.get("红外1800");
} else if(algType.equals("infra_yu3")) {
device = messageUtils.get("无人机红外");


+ 42
- 0
inspect-main/inspect-main-video/src/main/java/com/inspect/patrol/controller/PatrolPresetPosController.java View File

@ -58,6 +58,7 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.inspect.base.core.constant.Color;
import io.swagger.models.auth.In;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.dao.DuplicateKeyException;
import org.springframework.web.bind.annotation.*;
@ -91,6 +92,8 @@ public class PatrolPresetPosController extends BaseController {
IvsFeignService ivsFeignService;
@Value("${gwb.url}")
private String deviceUrl;
@Value("${liveSIPB.url}")
private String liveSIPBUrl;
@Value("${sftp.ip}")
private String ip;
@Value("${sftp.port}")
@ -99,6 +102,8 @@ public class PatrolPresetPosController extends BaseController {
private String username;
@Value("${sftp.password}")
private String password;
@Value("${ivs.version:3800}")
private String version;
private final String INSERT_PATROL_POINT_PURPOSE = "数据分析,在线监视";
private final String SELECT_PRESET_CODE_CLASS_BIND = "1";
private final String SELECT_PRESET_CODE_CLASS_STOP = "2";
@ -495,6 +500,42 @@ public class PatrolPresetPosController extends BaseController {
logger.info(Color.GREEN + "[PRESET] INSERT patrolPresetPos: {}" + Color.END, patrolPresetPos);
int insertResId = patrolPresetPosService.insertPatrolPresetPos(patrolPresetPos);
logger.info("[PRESET] insert insertResId: {}", insertResId);
logger.info("红外添加完成==》往1800中同步配置,version{}", version);
//往1800中写规则
if (version.equals("1800")) {
PatrolPresetParam patrolPresetParam = patrolPresetPos.getPresetParamList().get(0);
final String temperUrl = liveSIPBUrl + "/api/v1/device/setHwConfig";
logger.info("=========temperUrl====={}", temperUrl);
JSONObject temperParam = new JSONObject();
temperParam.put("presetId", patrolPresetPos.getPresetPosCode());
temperParam.put("name", patrolPresetParam.getMeasureName());
temperParam.put("cameraCode", patrolPresetPos.getChannelCode());
List<Map<String, Object>> polygonList = new ArrayList<>();
String[] split = patrolPresetParam.getCoordinate().split(StringUtils.COMMA);
if(split.length == 10){
Map<String, Object> point = new HashMap<>();
point.put("x", (int)((Double.parseDouble(split[0])/Double.parseDouble(split[8])) * 8190));
point.put("y", (int)((Double.parseDouble(split[1])/Double.parseDouble(split[9])) * 8190));
Map<String, Object> point1 = new HashMap<>();
point1.put("x", (int)((Double.parseDouble(split[2])/Double.parseDouble(split[8])) * 8190));
point1.put("y", (int)((Double.parseDouble(split[3])/Double.parseDouble(split[9])) * 8190));
Map<String, Object> point2 = new HashMap<>();
point2.put("x", (int)((Double.parseDouble(split[4])/Double.parseDouble(split[8])) * 8190));
point2.put("y", (int)((Double.parseDouble(split[5])/Double.parseDouble(split[9])) * 8190));
Map<String, Object> point3 = new HashMap<>();
point3.put("x", (int)((Double.parseDouble(split[6])/Double.parseDouble(split[8])) * 8190));
point3.put("y", (int)((Double.parseDouble(split[7])/Double.parseDouble(split[9])) * 8190));
polygonList.add(point);
polygonList.add(point1);
polygonList.add(point2);
polygonList.add(point3);
temperParam.put("polygonList", polygonList);
}
logger.info("=========temperParam{}", temperParam);
final String temperUrlRes = HttpClientUtils.sendPostAgain(temperUrl, temperParam.toString());
logger.info("[infra_1800] prePointExec temperUrlRes: {}", temperUrlRes);
}
}
} else {
logger.info("[PRESET] patrolPresetPos: {} already added!", patrolPresetPos1.getPatrolPointId());
@ -568,6 +609,7 @@ public class PatrolPresetPosController extends BaseController {
map.put("points", points.toJSONString());
map.put("coordinate", split[split.length - 2] + "*" + split[split.length - 1]);
this.remoteInvokeService.invoke("IR_SET", patrolPresetPos.getPatrolDeviceCode().split("#")[0], map);
} catch (Exception ignored) {
}


Loading…
Cancel
Save