diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/broad/AllBroadHTMLController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/broad/AllBroadHTMLController.java index 8d7a2ec..7b814e8 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/broad/AllBroadHTMLController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/broad/AllBroadHTMLController.java @@ -38,10 +38,11 @@ public class AllBroadHTMLController { } //4 泡前库 @GetMapping("/beforeLibrary") - public String beforeLibrary() { + public String beForeLibrary() { return "broad/beforeLibrary"; } + //6 智能工厂二楼终检位置 @GetMapping("/finalAssemblyProductionData") public String finalAssemblyProduction() { return "broad/finalAssemblyProductionData"; diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/broad/FPBroadController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/broad/FPBroadController.java index 77bb9c1..82e6a3a 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/broad/FPBroadController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/broad/FPBroadController.java @@ -13,7 +13,11 @@ import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; +import java.io.IOException; +import java.util.HashMap; import java.util.List; +import java.util.Map; +import java.util.Set; /** * @author wanghao @@ -22,6 +26,7 @@ import java.util.List; @Controller @RequestMapping("/broad/fp") @ApiOperation("发泡") +@ResponseBody public class FPBroadController { @Autowired IBroadDataService service; @@ -30,14 +35,13 @@ public class FPBroadController { @PostMapping("/selectOrderExecution") @ApiOperation("订单执行、生产统计") - @ResponseBody + private String selectOrderExecution() { return JSONArray.toJSONString(service.fp_selectOrderExecution()); } @PostMapping("/selectOrderInfo") @ApiOperation("中间生产数量统计") - @ResponseBody private String selectProductionStatistics() { return JSONObject.toJSONString(service.selectplanCompletion("1005")); } @@ -48,11 +52,48 @@ public class FPBroadController { private String selectDeviceStation() { return JSONArray.toJSONString(service.fp_selectDeviceStation()); } + @PostMapping("/selectStationHourInfo") - @ResponseBody @ApiOperation("生产统计数据") private String fp_selectStationHourInfo() { return JSONArray.toJSONString(service.fp_selectStationHourInfo()); } + private Map map; + { + map=new HashMap<>(); + map.put("A1","10.10.60.176"); + map.put("A2","10.10.60.177"); + map.put("B1","10.10.60.178"); + map.put("B2","10.10.60.179"); + } + + @PostMapping("/selectDeviceState") + @ApiOperation("设备状态查询") + private String selectDeviceState(){ + + + Set strings = map.keySet(); + for (String key:strings) { + Process p = null; + + try { + p = Runtime.getRuntime().exec("/system/bin/ping -c 1 " + map.get(key)); + int status = p.waitFor(); + System.out.println(status); + + } catch (IOException e) { + e.printStackTrace(); + } catch (InterruptedException e) { + e.printStackTrace(); + } + + + } + String json=JSONObject.toJSONString(map); + + return json; + } + + } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/BroadDataMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/BroadDataMapper.java index 3c7d05e..5e79247 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/BroadDataMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/BroadDataMapper.java @@ -41,4 +41,10 @@ public interface BroadDataMapper { List fp_selectDeviceStation(); List fp_selectStationHourInfo(); + + + /////////////////////////////////////////////////////////////////////////// + // 6 + /////////////////////////////////////////////////////////////////////////// +// zz_() } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/IBroadDruidService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/IBroadDruidService.java new file mode 100644 index 0000000..82fc61e --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/IBroadDruidService.java @@ -0,0 +1,9 @@ +package com.ruoyi.system.service; + +/** + * @author wanghao + * @date 2022/7/18 15:24 + */ +public interface IBroadDruidService { + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/BroadDruidServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/BroadDruidServiceImpl.java new file mode 100644 index 0000000..c790e4b --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/BroadDruidServiceImpl.java @@ -0,0 +1,16 @@ +package com.ruoyi.system.service.impl; + +import com.ruoyi.system.mapper.BroadDataMapper; +import com.ruoyi.system.service.IBroadDruidService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +/** + * @author wanghao + * @date 2022/7/18 15:25 + */ +@Service +public class BroadDruidServiceImpl implements IBroadDruidService { + @Autowired + private BroadDataMapper mapper; +} diff --git a/ruoyi-system/src/main/resources/mapper/system/BroadDataMapper.xml b/ruoyi-system/src/main/resources/mapper/system/BroadDataMapper.xml index b5984cb..13e219d 100644 --- a/ruoyi-system/src/main/resources/mapper/system/BroadDataMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/BroadDataMapper.xml @@ -89,14 +89,28 @@ @@ -247,4 +261,36 @@ from IMOS_PR_FOAMING_MONITOR order by to_number(STATION_NO) + + + + \ No newline at end of file