From 2622b1a00e49c9b0d69229d6572cdad46d38338c Mon Sep 17 00:00:00 2001 From: haungxing <1203316822@qq.com> Date: Tue, 8 Oct 2024 13:19:37 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=B8=9A=E5=8A=A1=E6=A8=A1=E5=9D=97?= =?UTF-8?q?=E8=B0=83=E7=94=A8=E5=A4=A7=E6=A8=A1=E5=9E=8B=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=BA=E5=8F=AF=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/ControlAnswerResolveServiceImpl.java | 16 ++++++++++++---- .../src/main/resources/template/template.yml | 3 +++ .../service/impl/WorkTicketInfoServiceImpl.java | 5 ++++- .../ticket/src/main/resources/template/template.yml | 3 +++ .../ticket/src/test/resources/application-test.yml | 3 +++ 5 files changed, 25 insertions(+), 5 deletions(-) diff --git a/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/interactive/service/impl/ControlAnswerResolveServiceImpl.java b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/interactive/service/impl/ControlAnswerResolveServiceImpl.java index 9ab80ef..4335f19 100644 --- a/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/interactive/service/impl/ControlAnswerResolveServiceImpl.java +++ b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/interactive/service/impl/ControlAnswerResolveServiceImpl.java @@ -8,9 +8,11 @@ import com.hnac.gglm.bigmodel.interactive.factory.AnswerResolveFactory; import com.hnac.gglm.bigmodel.interactive.service.IAnswerResolveService; import com.hnac.gglm.bigmodel.interactive.vo.AnswerVO; import com.hnac.gglm.bigmodel.interactive.vo.ExtraVO; +import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springblade.core.tool.utils.Func; import org.springblade.system.cache.ParamCache; +import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import com.hnac.gglm.bigmodel.interactive.constants.ParamKeyConstants; @@ -23,8 +25,14 @@ import java.util.Map; */ @Service(AnswerResolveFactory.CONTROL_DEVICE_SERVICE) @Slf4j +@RequiredArgsConstructor public class ControlAnswerResolveServiceImpl implements IAnswerResolveService { + @Value("${gglm.remote.initiateRobotPlan}") + private String initiateRobotPlanUrl; + @Value("${gglm.remote.initiateVideoTask}") + private String initiateVideoTaskUrl; + @Override public AnswerVO resolve(AnswerVO answer) { Object[] extraArray = this.extraStream(answer).map(this::getExtra).toArray(); @@ -38,14 +46,14 @@ public class ControlAnswerResolveServiceImpl implements IAnswerResolveService { JSONObject params = originExtra.getJSONObject("params"); if(Func.isNotEmpty(params) && Func.isNotEmpty(params.getString("itemId"))) { String itemId = ParamCache.getValue(ParamKeyConstants.VIDEO_INSPECTION_CODE); - String url = ParamCache.getValue(ParamKeyConstants.VIDEO_INSPECTION_URL); - if(Func.isNotEmpty(itemId) && Func.isNotEmpty(url) + //String url = ParamCache.getValue(ParamKeyConstants.VIDEO_INSPECTION_URL); + if(Func.isNotEmpty(itemId) && Func.isNotEmpty(initiateVideoTaskUrl) && itemId.equals(params.getString("itemId")) && Func.isNotEmpty(params.getString("stationId"))) { log.info("控制指令传参为:{}", JSON.toJSONString(originExtra)); String stationId = params.getString("stationId"); HashMap param = new HashMap<>(1); param.put("stationId",stationId); - String body = HttpRequest.post(url).body(JSON.toJSONString(param)).execute().body(); + String body = HttpRequest.post(initiateVideoTaskUrl).body(JSON.toJSONString(param)).execute().body(); params.put("data",body); log.info("识别结果为:{}", body); ExtraVO result = originExtra.toJavaObject(ExtraVO.class); @@ -55,7 +63,7 @@ public class ControlAnswerResolveServiceImpl implements IAnswerResolveService { HashMap param = new HashMap<>(1); param.put("itemName", params.getString("itemName")); log.info("机器人巡检传参为:{}", JSON.toJSONString(param)); - String body = HttpRequest.post("http://192.168.60.29:8080/api/hzinfo-inspect/plan/initiateRobotPlan").body(JSON.toJSONString(param)).execute().body(); + String body = HttpRequest.post(initiateRobotPlanUrl).body(JSON.toJSONString(param)).execute().body(); log.info("结果为:{}",body); ExtraVO result = originExtra.toJavaObject(ExtraVO.class); result.setType(FunctionConstants.TypeEnum.PARAMS.getType()); diff --git a/hzims-service/gglm-big-model/src/main/resources/template/template.yml b/hzims-service/gglm-big-model/src/main/resources/template/template.yml index 745470a..f8d2753 100644 --- a/hzims-service/gglm-big-model/src/main/resources/template/template.yml +++ b/hzims-service/gglm-big-model/src/main/resources/template/template.yml @@ -68,6 +68,9 @@ gglm: insertVectors: "/vector/insert_vectors" createTable: "/vector/create_table" deleteTable: "/vector/delete_table" + remote: + initiateRobotPlan: "http://${hzims.server.ip}/api/hzinfo-inspect/plan/initiateRobotPlan" + initiateVideoTask: "http://${hzims.server.ip}/api/hzinfo-inspect/feign/ai/analysisByStationId" swagger: base-packages: com.hnac.hzims.bigmodel diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/service/impl/WorkTicketInfoServiceImpl.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/service/impl/WorkTicketInfoServiceImpl.java index 2538182..f7ab13e 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/service/impl/WorkTicketInfoServiceImpl.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/service/impl/WorkTicketInfoServiceImpl.java @@ -121,6 +121,9 @@ public class WorkTicketInfoServiceImpl extends ServiceImpl