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