修改二期发泡线

master
夜笙歌 2 years ago
parent 5cbb324c4d
commit 9529624138

@ -48,9 +48,11 @@ public class FoamBoxController {
{
switch (id) {
case 0:
case 2:
mmap.put("positionId",0);
break;
case 1:
case 3:
mmap.put("positionId",1);
break;
default:

@ -1,239 +0,0 @@
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 20220420 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;
}
/**
* ISOPOL
* @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;
// }
}

@ -9,9 +9,9 @@ $(() => {
//设备运行状态
$.getJSON(`/foamBox/getRunStatusJson?ids=${ids}`, function (result) {
if (ids === 0 || ids === 1){
if (htmlId === '0' || htmlId === '1') {
deviceStatus(result);
}else{
} else {
deviceStatus2(result)
}
});
@ -140,3 +140,15 @@ const deviceStatus = (statusArray) => {
$(".foamingLineRunStatus table tr").append(info);
}
const deviceStatus2 = (statusArray) => {
let info = `
<img src="../../img/foamBox/${statusArray[0] == 1 ? "deviceopen.png" : "deviceclose.png"}" style="position: absolute;transform: translate(-50%,-50%);top:30%;left:34%;width: 2vw;"/>
<img src="../../img/foamBox/${statusArray[1] == 1 ? "deviceopen.png" : "deviceclose.png"}" style="position: absolute;transform: translate(-50%,-50%);top:30%;left:45%;width: 2vw;"/>
<img src="../../img/foamBox/${statusArray[4] == 1 ? "deviceopen.png" : "deviceclose.png"}" style="position: absolute;transform: translate(-50%,-50%);top:30%;left:60%;width: 2vw;"/>
<img src="../../img/foamBox/${statusArray[5] == 1 ? "deviceopen.png" : "deviceclose.png"}" style="position: absolute;transform: translate(-50%,-50%);top:30%;left:68%;width: 2vw;"/>
`;
$(".foamingLineRunStatus table tr").append(info);
}

@ -1,137 +0,0 @@
$(() => {
let fun = () => {
//班组计划统计
$.getJSON(`/foamBox/getTeamStatisticsJson?ids=${ids}`, function (result) {
console.log(result)
onDutyPlan(result.planAmount, result.actualAmount, result.planAmount - result.actualAmount)
});
//设备运行状态
$.getJSON(`/foamBox/getRunStatusJson?ids=${ids}`, function (result) {
deviceStatus(result);
});
// deviceStatus([1,1,1,1,1,1]);
//库存统计
$.getJSON(`/foamBox/getMaterialStoreJson`, function (result) {
threeDimensionalCylindrical(result, document.getElementById("inventoryStatistics"));
});
//按型号统计产量
$.getJSON(`/foamBox/getMaterialProdutionJson?ids=${ids}`, function (result) {
horizontalBarChart(result, document.getElementById("statisticalOutputByModel"));
});
//小时产量
$.getJSON(`/foamBox/getHourProdutionJson?ids=${ids}`, function (result) {
brokenLineAreaDiagram(result, document.getElementById("hourlyOutputStatistics"));
});
//发泡参数
$.getJSON(`/foamBox/getParamTemperature?ids=${ids}`, function (result) {
multipleBrokenLineAreaDiagram(result, document.getElementById("foamingParameters"));
});
// 模具温度1
$.getJSON(`/foamBox/getMouldTemperature?ids=${ids}`, function (result) {
temperature(result, document.getElementById("temperatureOne"));
});
$.getJSON(`/foamBox/getMouldTemperature2?ids=${ids}`, function (result) {
temperature(result, document.getElementById("temperatureTwo"));
});
setTimeout(fun, 10000)
}
fun()
})
const temperature = (res, ids) => {
let mycharts = echarts.init(ids);
console.log(res);
let option = {
grid: {
top: '15%',
left: '6%',
right: '6%',
bottom: '3%',
containLabel: true
},
tooltip: {
// trigger: "axis",
},
xAxis: [
{
interval: 0,
type: 'category',
data: res.xValueList,
axisPointer: {
type: 'shadow'
},
axisLabel: {
show: true,
rotate: 30,
interval: 0
}
}
],
yAxis: [
{
splitLine: {
show: false,
},
type: 'value',
name: '温度',
min: 0,
// max: 50,
interval: 10,
axisLabel: {
formatter: '{value} °C '
}
},
],
series: [
{
name: '内膜温度',
type: 'bar',
tooltip: {
valueFormatter: function (value) {
return value + ' ml';
}
},
data: res.interiorList
},
{
name: '外膜温度',
type: 'bar',
tooltip: {
valueFormatter: function (value) {
return value + ' ml';
}
},
data: res.lateralList
},
]
};
mycharts.setOption(option);
$(window).resize(mycharts.resize);
}
const deviceStatus = (statusArray) => {
let info = `
<img src="../../img/foamBox/${statusArray[0] == 1 ? "deviceopen.png" : "deviceclose.png"}" style="position: absolute;transform: translate(-50%,-50%);top:30%;left:34%;width: 2vw;"/>
<img src="../../img/foamBox/${statusArray[1] == 1 ? "deviceopen.png" : "deviceclose.png"}" style="position: absolute;transform: translate(-50%,-50%);top:30%;left:45%;width: 2vw;"/>
<img src="../../img/foamBox/${statusArray[4] == 1 ? "deviceopen.png" : "deviceclose.png"}" style="position: absolute;transform: translate(-50%,-50%);top:30%;left:60%;width: 2vw;"/>
<img src="../../img/foamBox/${statusArray[5] == 1 ? "deviceopen.png" : "deviceclose.png"}" style="position: absolute;transform: translate(-50%,-50%);top:30%;left:68%;width: 2vw;"/>
`;
$(".foamingLineRunStatus table tr").append(info);
}

@ -64,6 +64,18 @@
});
const ids = [[${positionId}]];
const htmlId = location.href.split('?')[1].split('=')[1]
if (htmlId === '2' || htmlId === '3') {
$('body').css(
{
backgroundColor: 'aquamarine',
background: 'url(../../img/foamBox/foamBoxbackground2.jpg)',
backgroundPosition: 'center center',
backgroundRepeat: 'no-repeat',
backgroundAttachment: 'fixed',
backgroundSize: '100% 100%',
})
}
// let info = `
// <td style="border:0px solid red;text-align:center;"><img src="${true ? '../../img/foamBox/deviceopen.png' :'../../img/foamBox/deviceopen.png'}" style="width: 30px;height: 30px;"/></td>

@ -1,89 +0,0 @@
<!DOCTYPE html>
<html lang="zh" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro" xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="UTF-8">
<title>发泡和发泡线数据展示平台</title>
<link href="../../../css/common/ondutyplan.css" rel="stylesheet">
<link href="../../../css/foamBox/style.css" rel="stylesheet">
<link href="../../../css/common/swiper-bundle.min.css" rel="stylesheet">
<script src="../../../js/common/swiper-bundle.min.js"></script>
<script src="../../../js/common/jquery.min.js"></script>
<script src="../../../js/common/echarts.min.js"></script>
<script src="../../../js/common/date-time-common.js"></script>
<script src="../../../js/common/update-split-blocks.js"></script>
<script src="../../../js/common/ondutyplan.js"></script>
<script src="../../../js/common/echarts.common.js"></script>
</head>
<body>
<!--库存统计-->
<div class="inventoryStatistics" id="inventoryStatistics"></div>
<!--型号产量统计-->
<div class="statisticalOutputByModel" id="statisticalOutputByModel"></div>
<!--小时产量统计-->
<div class="hourlyOutputStatistics" id="hourlyOutputStatistics"></div>
<!--发泡参数-->
<div class="foamingParameters" id="foamingParameters"></div>
<!--设备运行状态-->
<div class="foamingLineRunStatus">
<table style="width: 100%;height:100%;">
<tr style="width: 100%;">
</tr>
</table>
</div>
<!-- 轮播 -->
<div class="swiperModule">
<div class="swiper mySwiper">
<div class="swiper-wrapper">
<div class="swiper-slide">
<div class="temperatureOne" id="temperatureOne"></div>
</div>
<div class="swiper-slide">
<div class="temperatureTwo" id="temperatureTwo"></div>
</div>
</div>
</div>
</div>
</body>
<script src="../../../js/foamBox/index.js"></script>
<script>
var swiper = new Swiper(".mySwiper", {
spaceBetween: 30,
// loop: true,
centeredSlides: true,
autoplay: {
delay: 15000,
disableOnInteraction: false,
},
});
const ids = [[${positionId}]];
$('body').css(
{
backgroundColor: 'aquamarine',
background: 'url(../../img/foamBox/foamBoxbackground2.jpg)',
backgroundPosition: 'center center',
backgroundRepeat: 'no-repeat',
backgroundAttachment: 'fixed',
backgroundSize: '100% 100%',
})
// let info = `
// <td style="border:0px solid red;text-align:center;"><img src="${true ? '../../img/foamBox/deviceopen.png' :'../../img/foamBox/deviceopen.png'}" style="width: 30px;height: 30px;"/></td>
// <td style="border:0px solid red;text-align:center;"><img src="${true ? '../../img/foamBox/deviceopen.png' :'../../img/foamBox/deviceopen.png'}" style="width: 30px;height: 30px;"/></td>
// <td style="border:0px solid red;text-align:center;"><img src="${true ? '../../img/foamBox/deviceopen.png' :'../../img/foamBox/deviceopen.png'}" style="width: 30px;height: 30px;"/></td>
// <td style="border:0px solid red;text-align:center;"><img src="${true ? '../../img/foamBox/deviceopen.png' :'../../img/foamBox/deviceopen.png'}" style="width: 30px;height: 30px;"/></td>
// <td style="border:0px solid red;text-align:right;padding-right: 12px;"><img src="${true ? '../../img/foamBox/deviceopen.png' :'../../img/foamBox/deviceopen.png'}" style="width: 30px;height: 30px;"/></td>
// <td style="border:0px solid red;text-align:right;"><img src="${true ? '../../img/foamBox/deviceopen.png' :'../../img/foamBox/deviceopen.png'}" style="width: 30px;height: 30px;"/></td>
// `;
// $(".foamingLineRunStatus table tr").append(info);
</script>
</html>
Loading…
Cancel
Save