|
|
@ -0,0 +1,239 @@
|
|
|
|
|
|
|
|
package com.productionboard.controller;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
|
|
|
|
|
import com.productionboard.entity.MesProduction.MesHourProdutionStatistics;
|
|
|
|
|
|
|
|
import com.productionboard.entity.MesProduction.MesMaterialProductionStatistics;
|
|
|
|
|
|
|
|
import com.productionboard.entity.MesProduction.MesMaterialStoreStatistics;
|
|
|
|
|
|
|
|
import com.productionboard.entity.MesProduction.MesTeamStatistics;
|
|
|
|
|
|
|
|
import com.productionboard.service.IFoamBoxDeviceInfoService;
|
|
|
|
|
|
|
|
import com.productionboard.service.IMesProductionDataService;
|
|
|
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
|
|
|
import org.springframework.stereotype.Controller;
|
|
|
|
|
|
|
|
import org.springframework.ui.ModelMap;
|
|
|
|
|
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
|
|
|
|
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* 箱体发泡
|
|
|
|
|
|
|
|
* @author WenJY
|
|
|
|
|
|
|
|
* @date 2022年04月20日 11:03
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
@Controller
|
|
|
|
|
|
|
|
@RequestMapping("/foamBox2")
|
|
|
|
|
|
|
|
public class FoamBoxController2 {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
|
|
|
private IMesProductionDataService iMesProductionDataService;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
|
|
|
private IFoamBoxDeviceInfoService ifamBoxDeviceInfoService;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private String prefix = "foamBox/index2";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* id:0-南线;1-北线
|
|
|
|
|
|
|
|
* @author WenJY
|
|
|
|
|
|
|
|
* @date 2022-06-10 13:57
|
|
|
|
|
|
|
|
* @param id
|
|
|
|
|
|
|
|
* @param mmap
|
|
|
|
|
|
|
|
* @return java.lang.String
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
@GetMapping()
|
|
|
|
|
|
|
|
public String index(@RequestParam("id") int id,ModelMap mmap)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
switch (id) {
|
|
|
|
|
|
|
|
case 0:
|
|
|
|
|
|
|
|
mmap.put("positionId",0);
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 1:
|
|
|
|
|
|
|
|
mmap.put("positionId",1);
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return prefix;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* 班组统计
|
|
|
|
|
|
|
|
* @author WenJY
|
|
|
|
|
|
|
|
* @date 2022-06-09 16:38
|
|
|
|
|
|
|
|
* @return java.lang.String
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
@GetMapping("/getTeamStatisticsJson")
|
|
|
|
|
|
|
|
@ResponseBody
|
|
|
|
|
|
|
|
public String getTeamStatisticsJson(String ids){
|
|
|
|
|
|
|
|
String type=(ids.equals("0"))?"1029":"1012";
|
|
|
|
|
|
|
|
// List<MesTeamStatistics> mesTeamStatisticsList = iMesProductionDataService.getMesTeamStatisticsList(type);
|
|
|
|
|
|
|
|
List<MesTeamStatistics> mesTeamStatisticsList = iMesProductionDataService.getMesTeamStatisticsList("1010");
|
|
|
|
|
|
|
|
if(mesTeamStatisticsList.size()>0){
|
|
|
|
|
|
|
|
return JSONArray.toJSONString(mesTeamStatisticsList.get(0));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return JSONArray.toJSONString(new MesTeamStatistics());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* 获取发泡线、发泡机状态
|
|
|
|
|
|
|
|
* @author WenJY
|
|
|
|
|
|
|
|
* @date 2022-06-10 14:57
|
|
|
|
|
|
|
|
* @param ids
|
|
|
|
|
|
|
|
* @return java.lang.String
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
@GetMapping("/getRunStatusJson")
|
|
|
|
|
|
|
|
@ResponseBody
|
|
|
|
|
|
|
|
public String getRunStatusJson(String ids){
|
|
|
|
|
|
|
|
System.out.println("发泡机状态"+ids);
|
|
|
|
|
|
|
|
String runStatus = ifamBoxDeviceInfoService.getRunStatus(ids);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return runStatus;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* 获取发泡机ISO、POL温度
|
|
|
|
|
|
|
|
* @author WenJY
|
|
|
|
|
|
|
|
* @date 2022-06-10 14:58
|
|
|
|
|
|
|
|
* @param ids
|
|
|
|
|
|
|
|
* @return java.lang.String
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
@GetMapping("/getParamTemperature")
|
|
|
|
|
|
|
|
@ResponseBody
|
|
|
|
|
|
|
|
public String getParamTemperature(String ids){
|
|
|
|
|
|
|
|
String s = ifamBoxDeviceInfoService.getParamTemperature(ids);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return s;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* 获取模具温度
|
|
|
|
|
|
|
|
* @author WenJY
|
|
|
|
|
|
|
|
* @date 2022-06-10 17:08
|
|
|
|
|
|
|
|
* @param ids
|
|
|
|
|
|
|
|
* @return java.lang.String
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
@GetMapping("/getMouldTemperature")
|
|
|
|
|
|
|
|
@ResponseBody
|
|
|
|
|
|
|
|
public String getMouldTemperature(String ids){
|
|
|
|
|
|
|
|
String s = ifamBoxDeviceInfoService.getMouldTemperature(ids,0);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return s;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@GetMapping("/getMouldTemperature2")
|
|
|
|
|
|
|
|
@ResponseBody
|
|
|
|
|
|
|
|
public String getMouldTemperature2(String ids){
|
|
|
|
|
|
|
|
String s = ifamBoxDeviceInfoService.getMouldTemperature(ids,1);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return s;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* 通过工位号获取MES小时产量
|
|
|
|
|
|
|
|
* @author WenJY
|
|
|
|
|
|
|
|
* @date 2022-06-09 16:54
|
|
|
|
|
|
|
|
* @return java.lang.String
|
|
|
|
|
|
|
|
* Proce_Code =1029 发泡前出库南线
|
|
|
|
|
|
|
|
* Proce_Code =1012 发泡前出库北线
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
@GetMapping("/getHourProdutionJson")
|
|
|
|
|
|
|
|
@ResponseBody
|
|
|
|
|
|
|
|
public String getHourProdutionStatisticsJson(String ids){
|
|
|
|
|
|
|
|
System.out.println("通过工位号获取MES小时产量:"+ids);
|
|
|
|
|
|
|
|
String type=(ids.equals("0"))?"1029":"1012";
|
|
|
|
|
|
|
|
List<MesHourProdutionStatistics> mesHourProdutionStatisticsList =
|
|
|
|
|
|
|
|
iMesProductionDataService.getMesHourProdutionStatisticsListType("1010",type);
|
|
|
|
|
|
|
|
if(mesHourProdutionStatisticsList.size()>0){
|
|
|
|
|
|
|
|
return JSONArray.toJSONString(mesHourProdutionStatisticsList);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return JSONArray.toJSONString(new ArrayList<MesHourProdutionStatistics>());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* 通过工位号获取MES物料产量
|
|
|
|
|
|
|
|
* @author WenJY
|
|
|
|
|
|
|
|
* @date 2022-06-09 17:06
|
|
|
|
|
|
|
|
* @return java.lang.String
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
@GetMapping("/getMaterialProdutionJson")
|
|
|
|
|
|
|
|
@ResponseBody
|
|
|
|
|
|
|
|
public String getMaterialProdutionStatisticsJson(String ids){
|
|
|
|
|
|
|
|
String type=(ids.equals("0"))?"1029":"1012";
|
|
|
|
|
|
|
|
List<MesMaterialProductionStatistics> mesMaterialProductionStatisticsList =
|
|
|
|
|
|
|
|
iMesProductionDataService.getMesMaterialProductionStatisticsListType("1010",type);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return JSONArray.toJSONString(mesMaterialProductionStatisticsList);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* 获取MES物料库存
|
|
|
|
|
|
|
|
* @author WenJY
|
|
|
|
|
|
|
|
* @date 2022-06-09 17:18
|
|
|
|
|
|
|
|
* @return java.lang.String
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
@GetMapping("/getMaterialStoreJson")
|
|
|
|
|
|
|
|
@ResponseBody
|
|
|
|
|
|
|
|
public String getMesMaterialStoreStatisticsJson(){
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<MesMaterialStoreStatistics> mesMaterialStoreStatisticsList =
|
|
|
|
|
|
|
|
iMesProductionDataService.getMesMaterialStoreStatisticsList("1010");
|
|
|
|
|
|
|
|
return JSONArray.toJSONString(mesMaterialStoreStatisticsList);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// /**
|
|
|
|
|
|
|
|
// * 根据型号统计产量
|
|
|
|
|
|
|
|
// *
|
|
|
|
|
|
|
|
// * @author WenJY
|
|
|
|
|
|
|
|
// * @date 2022/4/20 10:15
|
|
|
|
|
|
|
|
// * @return java.lang.String
|
|
|
|
|
|
|
|
// */
|
|
|
|
|
|
|
|
// @GetMapping("/getStatisticalOutputByModel")
|
|
|
|
|
|
|
|
// @ResponseBody
|
|
|
|
|
|
|
|
// public String getStatisticalOutputByModel() {
|
|
|
|
|
|
|
|
// String info =
|
|
|
|
|
|
|
|
// "{\n"
|
|
|
|
|
|
|
|
// + "\t\"datas\":[\n"
|
|
|
|
|
|
|
|
// + " {\"ranking\": 1,\"station\":\"SC227\",\"value\": 199999},\n"
|
|
|
|
|
|
|
|
// + " {\"ranking\": 2,\"station\":\"SC228\",\"value\": 104970},\n"
|
|
|
|
|
|
|
|
// + " {\"ranking\": 3,\"station\":\"SC229\",\"value\": 29034},\n"
|
|
|
|
|
|
|
|
// + " {\"ranking\": 4,\"station\":\"SC223\",\"value\": 23489},\n"
|
|
|
|
|
|
|
|
// + " {\"ranking\": 5,\"station\":\"SC224\",\"value\": 18203}\n"
|
|
|
|
|
|
|
|
// + " ],\n"
|
|
|
|
|
|
|
|
// + "\t\"plan\":[290000, 290000, 290000, 290000, 290000, 290000]\n"
|
|
|
|
|
|
|
|
// + "}";
|
|
|
|
|
|
|
|
// return info;
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// /**
|
|
|
|
|
|
|
|
// * 库存 统计
|
|
|
|
|
|
|
|
// *
|
|
|
|
|
|
|
|
// * @author WenJY
|
|
|
|
|
|
|
|
// * @date 2022/4/20 10:16
|
|
|
|
|
|
|
|
// * @return java.lang.String
|
|
|
|
|
|
|
|
// */
|
|
|
|
|
|
|
|
// @GetMapping("/getInventoryStatistics")
|
|
|
|
|
|
|
|
// @ResponseBody
|
|
|
|
|
|
|
|
// public String getInventoryStatistics() {
|
|
|
|
|
|
|
|
// String info =
|
|
|
|
|
|
|
|
// "{\n"
|
|
|
|
|
|
|
|
// + "\t\"datas\":[\n"
|
|
|
|
|
|
|
|
// + " {\n"
|
|
|
|
|
|
|
|
// + " \"name\": \"SC528\",\n"
|
|
|
|
|
|
|
|
// + " \"value\": 175.17\n"
|
|
|
|
|
|
|
|
// + " },\n"
|
|
|
|
|
|
|
|
// + " {\n"
|
|
|
|
|
|
|
|
// + " \"name\": \"SC529\",\n"
|
|
|
|
|
|
|
|
// + " \"value\": 148.35\n"
|
|
|
|
|
|
|
|
// + " },\n"
|
|
|
|
|
|
|
|
// + " {\n"
|
|
|
|
|
|
|
|
// + " \"name\": \"SC327\",\n"
|
|
|
|
|
|
|
|
// + " \"value\": 95.36\n"
|
|
|
|
|
|
|
|
// + " }\n"
|
|
|
|
|
|
|
|
// + " ]\n"
|
|
|
|
|
|
|
|
// + "}";
|
|
|
|
|
|
|
|
// return info;
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
}
|