diff --git a/ca.txt b/ca.txt new file mode 100644 index 0000000..a713151 --- /dev/null +++ b/ca.txt @@ -0,0 +1,22 @@ +1002005 0 13 +1000166 1 8 +1000161 1 8 +1002026 2 12 +1002009 2 12 +1002012 2 8 +1001635 3 9 +1001638 3 14 +1002027 3 9 +1002028 3 14 +1002034 3 14 +1002033 3 9 +1001752 4 9 +1001753 4 14 +1002029 4 9 +1002038 4 9 +1002039 4 14 +1002005 4 14 +1002030 4 14 +1001755 4 14 +1001816 5 8 +1002019 6 13 diff --git a/web/src/main/java/com/zhehekeji/web/config/RestTemplateConfig.java b/web/src/main/java/com/zhehekeji/web/config/RestTemplateConfig.java index a00a829..b8682cc 100644 --- a/web/src/main/java/com/zhehekeji/web/config/RestTemplateConfig.java +++ b/web/src/main/java/com/zhehekeji/web/config/RestTemplateConfig.java @@ -13,7 +13,7 @@ public class RestTemplateConfig { // 设置连接超时时间(单位:毫秒) factory.setConnectTimeout(1000); // 设置读取数据超时时间(单位:毫秒) - factory.setReadTimeout(10); + factory.setReadTimeout(50000); return new RestTemplate(factory); } diff --git a/web/src/main/java/com/zhehekeji/web/controller/AppCenterController.java b/web/src/main/java/com/zhehekeji/web/controller/AppCenterController.java index c470d1f..4bad49f 100644 --- a/web/src/main/java/com/zhehekeji/web/controller/AppCenterController.java +++ b/web/src/main/java/com/zhehekeji/web/controller/AppCenterController.java @@ -4,15 +4,22 @@ import com.alibaba.fastjson.JSONObject; import com.zhehekeji.common.util.HttpUtil; import com.zhehekeji.core.pojo.Result; import com.zhehekeji.core.util.Assert; +import com.zhehekeji.web.entity.yolo.Calculate; import com.zhehekeji.web.pojo.IndexVO; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Value; +import org.springframework.core.ParameterizedTypeReference; +import org.springframework.http.HttpMethod; +import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.client.RestClientException; +import org.springframework.web.client.RestTemplate; +import javax.annotation.Resource; import java.io.IOException; @Api(value = "AppCenterController", tags = "用户中心") @@ -37,4 +44,36 @@ public class AppCenterController { } return result; } + + public static void main(String[] args) { + String url = "http://127.0.0.1:8094/industrialCamera/algorithm?path=D:\\WeChet\\WeChat Files\\wxid_ttkf0xgmyihv22\\FileStorage\\File\\2025-05\\新建文件夹\\古5(2)\\2025-05-19_14-36-28-246data.BMP"; + RestTemplate restTemplate = new RestTemplate(); + //String url = "http://127.0.0.1:8083"+"/visionCompute"; + ResponseEntity body = null; + + try { + // 使用 ParameterizedTypeReference 指定泛型类型 + ResponseEntity> response = restTemplate.exchange( + url, + HttpMethod.POST, + null, // 如果有请求体可以传入 HttpEntity + new ParameterizedTypeReference>() {} + ); + Calculate calculate = response.getBody().getData(); +// if(classIdMap.get(algorithmPojo.getGoodsType())==calculate.getType()){ +// algorithmPojo.setResult(1); +// +// algorithmPojo.setGoodsNumberResult( (calculate.getLayers()-1) * countLayersMap.get(algorithmPojo.getGoodsType())); +// }else { +// algorithmPojo.setResult(0); +// } + + System.out.println(calculate); + }catch (RestClientException e){ + log.error("未连接上堆垛机"+e); + //Assert.isTrue(false,"请求失败,视觉服务未连接"); + + + } + } } diff --git a/web/src/main/java/com/zhehekeji/web/controller/OrderController.java b/web/src/main/java/com/zhehekeji/web/controller/OrderController.java index b8f8bc0..21de35e 100644 --- a/web/src/main/java/com/zhehekeji/web/controller/OrderController.java +++ b/web/src/main/java/com/zhehekeji/web/controller/OrderController.java @@ -16,6 +16,7 @@ import com.zhehekeji.web.service.ksec.KsecInfos; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; +import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Value; import org.springframework.web.bind.annotation.*; @@ -26,6 +27,7 @@ import java.util.List; @Api(value = "OrderController",tags = "订单管理") @RestController(value = "OrderController") @RequestMapping("/order") +@Slf4j public class OrderController { @Resource @@ -80,6 +82,9 @@ public class OrderController { ksecDataInfo = plcService.orderDecoder(ksecInfo); }catch (Exception e){ ksecDataInfo =ksecInfo.getData(); + e.printStackTrace(); + log.error("解析异常:"+ksecInfo.toString(),e); + } ksecDataInfos.add(ksecDataInfo); } diff --git a/web/src/main/java/com/zhehekeji/web/entity/AlgorithmPojo.java b/web/src/main/java/com/zhehekeji/web/entity/AlgorithmPojo.java index 81a9b1d..23269ff 100644 --- a/web/src/main/java/com/zhehekeji/web/entity/AlgorithmPojo.java +++ b/web/src/main/java/com/zhehekeji/web/entity/AlgorithmPojo.java @@ -1,5 +1,6 @@ package com.zhehekeji.web.entity; +import com.zhehekeji.web.entity.yolo.Calculate; import com.zhehekeji.web.service.ksec.KsecDataInfo; import lombok.Data; @@ -17,6 +18,7 @@ public class AlgorithmPojo { private Integer result; private String goodsTypeResult; private int goodsNumberResult; + private Calculate calculate; public static AlgorithmPojo buildAlgorithmPojo(Street street, KsecDataInfo dataInfo) { AlgorithmPojo algorithmPojo = new AlgorithmPojo(); diff --git a/web/src/main/java/com/zhehekeji/web/entity/CheckLog.java b/web/src/main/java/com/zhehekeji/web/entity/CheckLog.java index 2d9bd70..4b27c98 100644 --- a/web/src/main/java/com/zhehekeji/web/entity/CheckLog.java +++ b/web/src/main/java/com/zhehekeji/web/entity/CheckLog.java @@ -55,6 +55,10 @@ public class CheckLog { private String checkNum; private String pic; + + private String preoperationPic; + + @TableField(exist = false) private String pic1; @TableField(exist = false) diff --git a/web/src/main/java/com/zhehekeji/web/entity/yolo/BoundingBox.java b/web/src/main/java/com/zhehekeji/web/entity/yolo/BoundingBox.java new file mode 100644 index 0000000..c5806ff --- /dev/null +++ b/web/src/main/java/com/zhehekeji/web/entity/yolo/BoundingBox.java @@ -0,0 +1,15 @@ +package com.zhehekeji.web.entity.yolo; + +import lombok.Data; + +@Data +public class BoundingBox { + private double x; + private double y; + private double w; + private double h; + private double confidence; + private int classId; + private String classProb; + +} diff --git a/web/src/main/java/com/zhehekeji/web/entity/yolo/Calculate.java b/web/src/main/java/com/zhehekeji/web/entity/yolo/Calculate.java new file mode 100644 index 0000000..b6d731a --- /dev/null +++ b/web/src/main/java/com/zhehekeji/web/entity/yolo/Calculate.java @@ -0,0 +1,18 @@ +package com.zhehekeji.web.entity.yolo; + +import lombok.Data; + +import java.util.List; + +@Data +public class Calculate { + List boxes; + String sn; + String path; + int type; + String savePath; + int layers; + + List fisheye; + List closeUp; +} diff --git a/web/src/main/java/com/zhehekeji/web/service/CheckLogService.java b/web/src/main/java/com/zhehekeji/web/service/CheckLogService.java index 11777d4..3d26e6f 100644 --- a/web/src/main/java/com/zhehekeji/web/service/CheckLogService.java +++ b/web/src/main/java/com/zhehekeji/web/service/CheckLogService.java @@ -51,19 +51,35 @@ public class CheckLogService { break; } } + if (checkLog.getPreoperationPic() != null && checkLog.getPreoperationPic().length() > 0) { + String[] pics = checkLog.getPreoperationPic().split(";"); - String ip ="http://"+ streetVOMap.get(checkLog.getStreetId()).getPlcIp()+":9009/pic/"+checkLog.getTaskId(); - ArrayList stock = new ArrayList<>(); - stock.add(String.format("%s_1.JPEG",ip)); - stock.add(String.format("%s_2.JPEG",ip)); - checkLog.setPic1(String.format("%s_1.JPEG",ip)); - checkLog.setPic2(String.format("%s_2.JPEG",ip)); - checkLog.setPic3(String.format("%s_3.JPEG",ip)); - checkLog.setPic4(String.format("%s_4.JPEG",ip)); - checkLog.setPic5(String.format("%s_5.JPEG",ip)); - checkLog.setPic6(String.format("%s_6.JPEG",ip)); - checkLog.setPics(stock); + String ip = "http://" + streetVOMap.get(checkLog.getStreetId()).getPlcIp() + ":9002/pic/"; + ArrayList stock = new ArrayList<>(); +// stock.add(String.format("%s_1.JPEG", ip)); +// stock.add(String.format("%s_2.JPEG", ip)); + if (pics.length > 0) + checkLog.setPic1(String.format("%s%s", ip, pics[0])); + if (pics.length > 1) + checkLog.setPic2(String.format("%s%s", ip, pics[1])); + if (pics.length > 2) + checkLog.setPic3(String.format("%s%s", ip, pics[2])); + if (pics.length > 3) + checkLog.setPic4(String.format("%s%s", ip, pics[3])); + if (pics.length > 4) + checkLog.setPic5(String.format("%s%s", ip, pics[4])); + if (pics.length > 5) + checkLog.setPic6(String.format("%s%s", ip, pics[5])); + checkLog.setPics(stock); + } } return new PageInfo<>(stockChecks); } + + public static void main(String[] args) { + String location = " industrialCamera/2025-05-22/DA1473287b6b944b9-4547-45d7-aaf5-3c69ad49295e.jpeg;industrialCamera/2025-05-22/DA1473294a2fcae9c-38a6-47a6-843c-a4d0e2736f59.jpeg;industrialCamera/2025-05-22/DA1473287b6b944b9-4547-45d7-aaf5-3c69ad49295e.jpeg;industrialCamera/2025-05-22/DA1473294a2fcae9c-38a6-47a6-843c-a4d0e2736f59.jpeg;industrialCamera/2025-05-22/DA116104055ca5932-edf1-4d33-8f70-7fa47cfe9ddf.jpeg" + ; + String[] split = location.split(";"); + System.out.println(split); + } } diff --git a/web/src/main/java/com/zhehekeji/web/service/PlcService.java b/web/src/main/java/com/zhehekeji/web/service/PlcService.java index 8f9fa1f..d364d9a 100644 --- a/web/src/main/java/com/zhehekeji/web/service/PlcService.java +++ b/web/src/main/java/com/zhehekeji/web/service/PlcService.java @@ -709,6 +709,7 @@ public class PlcService { OrderInfo orderInfo = new OrderInfo(street, plcCmdInfo, 1, cmdCode); Stock stock = stockMapper.getByStreetAndDirectionAndSideAndRowColumn(orderInfo.getStreetId(), plcCmdInfo.getFromDirection(), orderInfo.getSeparation(), orderInfo.getRow(), orderInfo.getColumn()); AlgorithmPojo algorithmPojo = algorithmService.getGoodResult(street, dataInfo); + String paths = String.join(";", algorithmPojo.getCalculate().getFisheye()) +";"+String.join(";",algorithmPojo.getCalculate().getCloseUp())+";"+algorithmPojo.getCalculate().getPath(); //货物使用球机扫码 @@ -745,6 +746,7 @@ public class PlcService { .column(orderInfo.getColumn()) .status(status) .checkPic(path) + .preoperationPic(paths) .exportTime(LocalDateTime.now()).build(); stockMapper.insert(stock); } else { @@ -753,7 +755,10 @@ public class PlcService { stock.setExportTime(LocalDateTime.now()); stock.setCount(algorithmPojo.getGoodsNumberResult()); stock.setCategory(algorithmPojo.getGoodsTypeResult()); + stock.setWmsCategory(algorithmPojo.getGoodsType()); + stock.setWmsCount(algorithmPojo.getGoodsNumber()); stock.setCheckPic(path); + stock.setPreoperationPic(paths); stock.setCheckNum(plcCmdInfo.getOrderNum()); stockMapper.updateById(stock); } @@ -785,6 +790,7 @@ public class PlcService { checkLog.setColumn(stock.getColumn()); checkLog.setCreateTime(LocalDateTime.now()); checkLog.setTrayCode(stock.getTrayCode()); + checkLog.setPreoperationPic(stock.getPreoperationPic()); checkLog.setWmsTrayCode(stock.getWmsTrayCode()); checkLog.setLotnum(stock.getLotnum()); checkLogMapper.insert(checkLog); @@ -952,11 +958,11 @@ public class PlcService { dataInfo.setGoodsNumberResult(algorithmPojo.getGoodsNumberResult()); log.info("盘点完成"); - if (configProperties.getOrderTest() == 1) { - checkTest(plcCmdInfo); - - - } +// if (configProperties.getOrderTest() == 1) { +// checkTest(plcCmdInfo); +// +// +// } } return dataInfo; diff --git a/web/src/main/java/com/zhehekeji/web/service/StockService.java b/web/src/main/java/com/zhehekeji/web/service/StockService.java index dbdec0e..e7d9b3c 100644 --- a/web/src/main/java/com/zhehekeji/web/service/StockService.java +++ b/web/src/main/java/com/zhehekeji/web/service/StockService.java @@ -32,6 +32,8 @@ import java.time.LocalDateTime; import java.util.*; import java.util.stream.Collectors; +import static com.zhehekeji.web.service.algorithm.AlgorithmService.countLayersMap; + @Service @Slf4j public class StockService { @@ -342,14 +344,14 @@ public class StockService { } //不再需要操作照片 List stockLogs = stockLogMapper.selectList(new QueryWrapper().eq("`row`",stockCheck.getRow()).eq("`column`",stockCheck.getColumn()).eq("street_id",stockCheck.getStreetId()).eq("direction",stockCheck.getDirection()).eq("side",stockCheck.getSide()).orderByDesc("create_time").last(" limit 2")); - if(stockLogs.size() == 1){ - stock.setOveroperationPic(stockLogs.get(0).getPic()); - }else if(stockLogs.size() == 2){ - stock.setOveroperationPic(stockLogs.get(0).getPic()); - stock.setPreoperationPic(stockLogs.get(1).getPic()); - } +// if(stockLogs.size() == 1){ +// stock.setOveroperationPic(stockLogs.get(0).getPic()); +// }else if(stockLogs.size() == 2){ +// stock.setOveroperationPic(stockLogs.get(0).getPic()); +// stock.setPreoperationPic(stockLogs.get(1).getPic()); +// } - String ip ="http://"+ street.getPlcIp()+":9009/pic/"+stock.getCheckNum(); + String ip ="http://"+ street.getPlcIp()+":9002/pic/"; //古井贡酒 /* @@ -360,12 +362,20 @@ public class StockService { * 侧02 #{task}_5 * 侧03 #{task}_6 * */ - stock.setSidePic1(String.format("%s_1.JPEG",ip)); - stock.setSidePic2(String.format("%s_6.JPEG",ip)); - stock.setSidePic3(String.format("%s_4.JPEG",ip)); - stock.setSidePic4(String.format("%s_5.JPEG",ip)); - stock.setTopPic1(String.format("%s_2.JPEG",ip)); - stock.setTopPic2(String.format("%s_3.JPEG",ip)); + if (stock.getPreoperationPic() != null&& stock.getPreoperationPic().length() > 0) { + String[] pics = stock.getPreoperationPic().split(";"); + if (pics.length>3) + stock.setSidePic1(String.format("%s%s", ip, pics[3])); + if (pics.length>2) + stock.setSidePic2(String.format("%s%s", ip, pics[2])); + if (pics.length>4) + stock.setSidePic3(String.format("%s%s", ip, pics[4])); + if (pics.length>5) + stock.setSidePic4(String.format("%s%s", ip, pics[5])); + stock.setTopPic1(String.format("%s%s", ip, pics[0])); + if (pics.length>1) + stock.setTopPic2(String.format("%s%s", ip, pics[1])); + } return stock; } @@ -374,13 +384,21 @@ public class StockService { Stock stock = stockMapper.getByStreetAndDirectionAndSideAndRowColumn(street.getId(),stockCheckSearch.getDirection(),stockCheckSearch.getSeparation(),stockCheckSearch.getRow(),stockCheckSearch.getColumn()); if(stock != null){ - String ip ="http://"+ street.getPlcIp()+":9009/pic/"+stock.getCheckNum(); - stock.setSidePic1(String.format("%s_1.JPEG",ip)); - stock.setSidePic2(String.format("%s_5.JPEG",ip)); - stock.setSidePic3(String.format("%s_6.JPEG",ip)); - stock.setSidePic4(String.format("%s_4.JPEG",ip)); - stock.setTopPic1(String.format("%s_2.JPEG",ip)); - stock.setTopPic2(String.format("%s_3.JPEG",ip)); + String ip ="http://"+ street.getPlcIp()+":9002/pic/"; + if (stock.getPreoperationPic() != null&& stock.getPreoperationPic().length() > 0) { + String[] pics = stock.getPreoperationPic().split(";"); + if (pics.length>3) + stock.setSidePic1(String.format("%s%s", ip, pics[3])); + if (pics.length>2) + stock.setSidePic2(String.format("%s%s", ip, pics[2])); + if (pics.length>4) + stock.setSidePic3(String.format("%s%s", ip, pics[4])); + if (pics.length>5) + stock.setSidePic4(String.format("%s%s", ip, pics[5])); + stock.setTopPic1(String.format("%s%s", ip, pics[0])); + if (pics.length>1) + stock.setTopPic2(String.format("%s%s", ip, pics[1])); + } } return stock; } @@ -416,8 +434,8 @@ public class StockService { } public static void main(String[] args) { - System.out.println(3%4 - ); + String[] a = "3630".split(""); + System.out.println(a.length); } @Resource @@ -486,13 +504,22 @@ public class StockService { stock.setPreoperationPic(stockLogs.get(1).getPic()); } - String ip ="http://"+ street.getPlcIp()+":9009/pic/"+stock.getCheckNum(); - stock.setSidePic1(String.format("%s_1.JPEG",ip)); - stock.setSidePic2(String.format("%s_5.JPEG",ip)); - stock.setSidePic3(String.format("%s_6.JPEG",ip)); - stock.setSidePic4(String.format("%s_4.JPEG",ip)); - stock.setTopPic1(String.format("%s_2.JPEG",ip)); - stock.setTopPic2(String.format("%s_3.JPEG",ip)); + String ip ="http://"+ street.getPlcIp()+":9002/pic/"; + if (stock.getPreoperationPic() != null&& stock.getPreoperationPic().length() > 0) { + String[] pics = stock.getPreoperationPic().split(";"); + if (pics.length>3) + stock.setSidePic1(String.format("%s%s", ip, pics[3])); + if (pics.length>2) + stock.setSidePic2(String.format("%s%s", ip, pics[2])); + if (pics.length>4) + stock.setSidePic3(String.format("%s%s", ip, pics[4])); + if (pics.length>5) + stock.setSidePic4(String.format("%s%s", ip, pics[5])); + stock.setTopPic1(String.format("%s%s", ip, pics[0])); + if (pics.length>1) + stock.setTopPic2(String.format("%s%s", ip, pics[1])); + + } } return stock; @@ -503,11 +530,8 @@ public class StockService { } public List getCategoryList() { - List list = new ArrayList<>(); - if(configProperties.getProductDoc() != null){ - list = FileUtil.readLinesToList(configProperties.getProductDoc()); - } - return list; + + return new ArrayList<>(countLayersMap.keySet()); } diff --git a/web/src/main/java/com/zhehekeji/web/service/algorithm/AlgorithmService.java b/web/src/main/java/com/zhehekeji/web/service/algorithm/AlgorithmService.java index 5ced20a..0e70db1 100644 --- a/web/src/main/java/com/zhehekeji/web/service/algorithm/AlgorithmService.java +++ b/web/src/main/java/com/zhehekeji/web/service/algorithm/AlgorithmService.java @@ -3,11 +3,15 @@ package com.zhehekeji.web.service.algorithm; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import com.google.gson.Gson; +import com.zhehekeji.core.pojo.Result; import com.zhehekeji.web.config.ConfigProperties; import com.zhehekeji.web.entity.AlgorithmPojo; import com.zhehekeji.web.entity.Street; +import com.zhehekeji.web.entity.yolo.Calculate; import com.zhehekeji.web.service.ksec.KsecDataInfo; import lombok.extern.slf4j.Slf4j; +import org.springframework.core.ParameterizedTypeReference; +import org.springframework.http.HttpMethod; import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Service; import org.springframework.web.client.ResourceAccessException; @@ -15,9 +19,9 @@ import org.springframework.web.client.RestClientException; import org.springframework.web.client.RestTemplate; import javax.annotation.Resource; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; +import java.io.*; +import java.util.*; +import java.util.concurrent.ConcurrentHashMap; import java.util.stream.Collectors; @Service @@ -30,24 +34,69 @@ public class AlgorithmService { public static void main(String[] args) { - AlgorithmPojo algorithmPojo= new AlgorithmPojo(); - algorithmPojo.setGoodsTypeResult("qqq"); - algorithmPojo.setIp("127.0.0.1"); - algorithmPojo.setPort(8001); - algorithmPojo.setTaskId("8001"); + System.out.println(null=="111"); + } - AlgorithmService algorithmService = new AlgorithmService(); - //algorithmService.getGoodResultTcp(algorithmPojo); + static Map classIdMap = new HashMap<>(); + public static Map countLayersMap = new HashMap<>(); + static { + String fileName = "ca.txt"; // 当前文件夹下的文件名 + + try (BufferedReader br = new BufferedReader(new FileReader(fileName))) { + String line; + while ((line = br.readLine()) != null) { + String[] parts = line.split(" "); + classIdMap.put(parts[0], Integer.parseInt(parts[1])); + countLayersMap.put(parts[0], Integer.parseInt(parts[2])); + } + } catch (IOException e) { + e.printStackTrace(); + } + } - AlgorithmClint clint = new AlgorithmClint(); - clint.clint(algorithmPojo.getIp(),8001,algorithmPojo,new ArrayList<>()); + public AlgorithmPojo getGoodResultHttp(AlgorithmPojo algorithmPojo) { - System.out.println(algorithmPojo); + String url = "http://"+algorithmPojo.getIp()+":8094/industrialCamera/panoramaAlgorithm"; + //String url = "http://127.0.0.1:8083"+"/visionCompute"; - System.out.println(algorithmPojo); - System.out.println("aaaaa"); - } + try { + System.out.println("1111111111111"+algorithmPojo.toString()); + // String jsonString = gson.toJson(algorithmPojo); + ResponseEntity> response = restTemplate.exchange( + url, + HttpMethod.POST, + null, // 如果有请求体可以传入 HttpEntity + new ParameterizedTypeReference>() {} + ); + Calculate calculate = response.getBody().getData(); +// System.out.println("2222222222"+calculate.toString()); + log.info("视觉服务返回结果:{}",calculate.toString()); +// 若没有找到,则赋值-2,以防和堆垛机返回的type匹配错误 + if (calculate.getLayers()<1){ + calculate.setLayers(1); + } + if(classIdMap.getOrDefault(algorithmPojo.getGoodsType(),-2)==calculate.getType()){ + algorithmPojo.setResult(1); + algorithmPojo.setGoodsTypeResult(algorithmPojo.getGoodsType()); + }else { + algorithmPojo.setResult(0); + } + if (countLayersMap.get(algorithmPojo.getGoodsType())!=null){ + algorithmPojo.setGoodsNumberResult( (calculate.getLayers()-1) * countLayersMap.get(algorithmPojo.getGoodsType())); + } + algorithmPojo.setCalculate(calculate); + System.out.println(calculate); + }catch (RestClientException e){ + log.error("未连接上堆垛机"+e); + //Assert.isTrue(false,"请求失败,视觉服务未连接"); + algorithmPojo.setResult(0); + return algorithmPojo; + }catch (Exception e){ + e.printStackTrace(); + } + return algorithmPojo; + } public AlgorithmPojo getGoodResultTcp(AlgorithmPojo algorithmPojo) { AlgorithmClint clint = new AlgorithmClint(); @@ -88,7 +137,7 @@ public class AlgorithmService { public AlgorithmPojo getGoodResult(Street street, KsecDataInfo dataInfo ) { AlgorithmPojo algorithmPojo = AlgorithmPojo.buildAlgorithmPojo(street, dataInfo); if(configProperties.getVisualSense().getAble()) { - algorithmPojo = getGoodResultTcp(algorithmPojo); + algorithmPojo = getGoodResultHttp(algorithmPojo); }else { algorithmPojo.setResult(1); algorithmPojo.setGoodsNumberResult(algorithmPojo.getGoodsNumber());