|
|
|
@ -13,7 +13,11 @@ import org.springframework.web.bind.annotation.PostMapping;
|
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import java.io.IOException;
|
|
|
|
|
|
|
|
import java.util.HashMap;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
import java.util.Set;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* @author wanghao
|
|
|
|
* @author wanghao
|
|
|
|
@ -22,6 +26,7 @@ import java.util.List;
|
|
|
|
@Controller
|
|
|
|
@Controller
|
|
|
|
@RequestMapping("/broad/fp")
|
|
|
|
@RequestMapping("/broad/fp")
|
|
|
|
@ApiOperation("发泡")
|
|
|
|
@ApiOperation("发泡")
|
|
|
|
|
|
|
|
@ResponseBody
|
|
|
|
public class FPBroadController {
|
|
|
|
public class FPBroadController {
|
|
|
|
@Autowired
|
|
|
|
@Autowired
|
|
|
|
IBroadDataService service;
|
|
|
|
IBroadDataService service;
|
|
|
|
@ -30,14 +35,13 @@ public class FPBroadController {
|
|
|
|
|
|
|
|
|
|
|
|
@PostMapping("/selectOrderExecution")
|
|
|
|
@PostMapping("/selectOrderExecution")
|
|
|
|
@ApiOperation("订单执行、生产统计")
|
|
|
|
@ApiOperation("订单执行、生产统计")
|
|
|
|
@ResponseBody
|
|
|
|
|
|
|
|
private String selectOrderExecution() {
|
|
|
|
private String selectOrderExecution() {
|
|
|
|
return JSONArray.toJSONString(service.fp_selectOrderExecution());
|
|
|
|
return JSONArray.toJSONString(service.fp_selectOrderExecution());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@PostMapping("/selectOrderInfo")
|
|
|
|
@PostMapping("/selectOrderInfo")
|
|
|
|
@ApiOperation("中间生产数量统计")
|
|
|
|
@ApiOperation("中间生产数量统计")
|
|
|
|
@ResponseBody
|
|
|
|
|
|
|
|
private String selectProductionStatistics() {
|
|
|
|
private String selectProductionStatistics() {
|
|
|
|
return JSONObject.toJSONString(service.selectplanCompletion("1005"));
|
|
|
|
return JSONObject.toJSONString(service.selectplanCompletion("1005"));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -48,11 +52,48 @@ public class FPBroadController {
|
|
|
|
private String selectDeviceStation() {
|
|
|
|
private String selectDeviceStation() {
|
|
|
|
return JSONArray.toJSONString(service.fp_selectDeviceStation());
|
|
|
|
return JSONArray.toJSONString(service.fp_selectDeviceStation());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@PostMapping("/selectStationHourInfo")
|
|
|
|
@PostMapping("/selectStationHourInfo")
|
|
|
|
@ResponseBody
|
|
|
|
|
|
|
|
@ApiOperation("生产统计数据")
|
|
|
|
@ApiOperation("生产统计数据")
|
|
|
|
private String fp_selectStationHourInfo() {
|
|
|
|
private String fp_selectStationHourInfo() {
|
|
|
|
return JSONArray.toJSONString(service.fp_selectStationHourInfo());
|
|
|
|
return JSONArray.toJSONString(service.fp_selectStationHourInfo());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
private Map<String,String> 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<String> 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;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|