change - 2022-12-11修改

master
wenjy 2 years ago
parent 7aa791f195
commit 146d1ace94

@ -55,13 +55,26 @@ public class AluminumLinerkController {
@ResponseBody @ResponseBody
public String getDataInformation(){ public String getDataInformation(){
List<AluminumDeviceDataInformation> dataInformationList = aluminumDeviceInfoService.getDataInformationList(); List<AluminumDeviceDataInformation> dataInformationList = aluminumDeviceInfoService.getDataInformationList();
if(dataInformationList.size() > 0 && dataInformationList.get(0) == null){ if(dataInformationList.get(0) == null){
dataInformationList.remove(0); dataInformationList.remove(0);
AluminumDeviceDataInformation aluminumDeviceDataInformation = new AluminumDeviceDataInformation(); AluminumDeviceDataInformation aluminumDeviceDataInformation = new AluminumDeviceDataInformation();
aluminumDeviceDataInformation.setDeviceStatus("0"); aluminumDeviceDataInformation.setDeviceStatus("0");
aluminumDeviceDataInformation.setDevicePower("0"); aluminumDeviceDataInformation.setDevicePower("0");
aluminumDeviceDataInformation.setDeviceEnergy("0"); aluminumDeviceDataInformation.setDeviceEnergy("0");
aluminumDeviceDataInformation.setCount(0);
dataInformationList.add(aluminumDeviceDataInformation); dataInformationList.add(aluminumDeviceDataInformation);
}else{
for(AluminumDeviceDataInformation item : dataInformationList){
if(item.getDeviceStatus() == null){
item.setDeviceStatus("0");
}
if(item.getDevicePower() == null){
item.setDevicePower("0");
}
if(item.getDeviceEnergy() == null){
item.setDeviceEnergy("0");
}
}
} }
String s = JSONArray.toJSONString(dataInformationList); String s = JSONArray.toJSONString(dataInformationList);
return s; return s;

@ -185,57 +185,4 @@ public class FoamBoxController {
return JSONArray.toJSONString(mesMaterialStoreStatisticsList); 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;
// }
} }

@ -66,4 +66,10 @@ public class AluminumDeviceDataInformation implements Serializable {
/** 采集时间 */ /** 采集时间 */
@TableField("COLLECTTIME") @TableField("COLLECTTIME")
private Date collectTime; private Date collectTime;
@TableField("count")
private int count;
@TableField("lossTime")
private String lossTime;
} }

@ -59,4 +59,10 @@ public class TankShellDeviceDataInformation implements Serializable {
@TableField("COLLECTTIME") @TableField("COLLECTTIME")
private Date collectTime; private Date collectTime;
@TableField("COUNT")
private int alarmCount;
@TableField("lossTime")
private String lossTime;
} }

@ -20,7 +20,7 @@ public interface TankShellDeviceDataInformationMapper extends BaseMapper<TankShe
* @param in_id * @param in_id
* @return * @return
*/ */
@Select("select * from table ( scada_tank_shell_device_new(#{in_id}) )") @Select("select * from table ( scada_device_data_info_new(#{in_id}) )")
List<TankShellDeviceDataInformation> getTankShellDeviceDataInformations(@Param("in_id") Integer in_id); List<TankShellDeviceDataInformation> getTankShellDeviceDataInformations(@Param("in_id") Integer in_id);
/** /**

@ -74,8 +74,8 @@ public class AluminumDeviceInfoServiceImpl implements IAluminumDeviceInfoService
result[4] = aluminumDeviceDataInformation.getRunTime(); result[4] = aluminumDeviceDataInformation.getRunTime();
result[5] = aluminumDeviceDataInformation.getStopTime(); result[5] = aluminumDeviceDataInformation.getStopTime();
result[6] = aluminumDeviceDataInformation.getDeviceOee(); result[6] = aluminumDeviceDataInformation.getDeviceOee();
result[7] = "0"; result[7] = aluminumDeviceDataInformation.getCount()+"";
result[8] = aluminumDeviceDataInformation.getRunTime(); result[8] = aluminumDeviceDataInformation.getLossTime();
result[9] = aluminumDeviceDataInformation.getDeviceTakt(); result[9] = aluminumDeviceDataInformation.getDeviceTakt();
}else{ }else{
result[4] = "0"; result[4] = "0";

@ -20,6 +20,7 @@ import org.springframework.stereotype.Service;
import java.lang.reflect.Array; import java.lang.reflect.Array;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date;
import java.util.List; import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -42,6 +43,8 @@ public class FoamBoxDeviceInfoServiceImpl implements IFoamBoxDeviceInfoService {
private SimpleDateFormat simpleDateFormat = new SimpleDateFormat("HH:mm:ss"); private SimpleDateFormat simpleDateFormat = new SimpleDateFormat("HH:mm:ss");
private SimpleDateFormat minimumDateFormat = new SimpleDateFormat("HH");
@Value("${in_id}") @Value("${in_id}")
private int in_id; private int in_id;
@ -124,7 +127,6 @@ public class FoamBoxDeviceInfoServiceImpl implements IFoamBoxDeviceInfoService {
break; break;
} }
// List<FoamBoxParamTemperature> foamBoxParamTemperatures = foamBoxParamTemperatureMapper.selectList(wrapper);
String DEVICEID = "HF202009858"; String DEVICEID = "HF202009858";
if ("1".equals(ids)){ if ("1".equals(ids)){
DEVICEID = "HF202009857"; DEVICEID = "HF202009857";
@ -158,11 +160,11 @@ public class FoamBoxDeviceInfoServiceImpl implements IFoamBoxDeviceInfoService {
String[] polArray1 = new String[15]; String[] polArray1 = new String[15];
String[] polArray2 = new String[15]; String[] polArray2 = new String[15];
for (int i = 0;i<15;i++){ for (int i = 0;i<15;i++){
xAxisArray[i] = 0+i+""; xAxisArray[i] = minimumDateFormat.format(new Date())+":"+i;
isoArray1[i] = 1+i+""; isoArray1[i] = "23";
isoArray2[i] = 2+i+""; isoArray2[i] = "21";
polArray1[i] = 1+i+""; polArray1[i] = "22";
polArray2[i] = 2+i+""; polArray2[i] = "23";
} }
result.put("xAxisArray",xAxisArray); result.put("xAxisArray",xAxisArray);
result.put("isoArray1",isoArray1); result.put("isoArray1",isoArray1);

@ -221,8 +221,13 @@ public class MesProductionDataServiceImpl implements IMesProductionDataService {
planInfo.setCha((oq -aq)+""); planInfo.setCha((oq -aq)+"");
//map.put("17",String.format("%.1f%%", ((double)actualQtuitem / (double)planQtyItem * 100))); //map.put("17",String.format("%.1f%%", ((double)actualQtuitem / (double)planQtyItem * 100)));
if(oq == 0){
planInfo.setRound("0.00%");
}else {
planInfo.setRound(String.format("%.1f%%", ((double)aq / (double)oq * 100))); planInfo.setRound(String.format("%.1f%%", ((double)aq / (double)oq * 100)));
} }
}
return aluminumLinerMesPlan; return aluminumLinerMesPlan;
} }
} }

@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.productionboard.entity.AluminumDevice.AluminumDeviceDataInformation;
import com.productionboard.entity.TankShellDevice.*; import com.productionboard.entity.TankShellDevice.*;
import com.productionboard.mapper.*; import com.productionboard.mapper.*;
import com.productionboard.service.ITankShellDeviceInfoService; import com.productionboard.service.ITankShellDeviceInfoService;
@ -57,14 +58,42 @@ public class TankShellDeviceInfoServiceImpl implements ITankShellDeviceInfoServi
// List<TankShellDeviceDataInformation> tankShellDeviceDataInformations = tankShellDeviceDataInformationMapper.selectList(null); // List<TankShellDeviceDataInformation> tankShellDeviceDataInformations = tankShellDeviceDataInformationMapper.selectList(null);
List<TankShellDeviceDataInformation> tankShellDeviceDataInformations = tankShellDeviceDataInformationMapper.getTankShellDeviceDataInformations(in_id); List<TankShellDeviceDataInformation> tankShellDeviceDataInformations = tankShellDeviceDataInformationMapper.getTankShellDeviceDataInformations(in_id);
if(tankShellDeviceDataInformations.size() > 0 && tankShellDeviceDataInformations.get(0) == null){ if(tankShellDeviceDataInformations == null || tankShellDeviceDataInformations.size() ==0){
tankShellDeviceDataInformations.remove(0);
TankShellDeviceDataInformation tankShellDeviceDataInformation = new TankShellDeviceDataInformation(); TankShellDeviceDataInformation tankShellDeviceDataInformation = new TankShellDeviceDataInformation();
tankShellDeviceDataInformation.setDeviceStatus("0"); tankShellDeviceDataInformation.setDeviceStatus("0");
tankShellDeviceDataInformation.setDevicePower("0"); tankShellDeviceDataInformation.setDevicePower("0");
tankShellDeviceDataInformation.setDeviceEnergy("0"); tankShellDeviceDataInformation.setDeviceEnergy("0");
tankShellDeviceDataInformation.setAlarmCount(0);
tankShellDeviceDataInformations.add(tankShellDeviceDataInformation); tankShellDeviceDataInformations.add(tankShellDeviceDataInformation);
}else{
if(tankShellDeviceDataInformations.get(0) == null){
TankShellDeviceDataInformation tankShellDeviceDataInformation = new TankShellDeviceDataInformation();
tankShellDeviceDataInformation.setDeviceStatus("0");
tankShellDeviceDataInformation.setDevicePower("0");
tankShellDeviceDataInformation.setDeviceEnergy("0");
tankShellDeviceDataInformation.setAlarmCount(0);
tankShellDeviceDataInformations.add(tankShellDeviceDataInformation);
}else{
for(TankShellDeviceDataInformation item : tankShellDeviceDataInformations){
if(item.getDeviceStatus().equals("正常")){
item.setDeviceStatus("1");
}else {
item.setDeviceStatus("0");
} }
if(item.getDeviceStatus() == null){
item.setDeviceStatus("0");
}
if(item.getDevicePower() == null){
item.setDevicePower("0");
}
if(item.getDeviceEnergy() == null){
item.setDeviceEnergy("0");
}
}
}
}
return JSONArray.toJSONString(tankShellDeviceDataInformations); return JSONArray.toJSONString(tankShellDeviceDataInformations);
} }
@ -99,9 +128,10 @@ public class TankShellDeviceInfoServiceImpl implements ITankShellDeviceInfoServi
result[4] = tankShellDeviceDataInformation.getRunTime(); result[4] = tankShellDeviceDataInformation.getRunTime();
result[5] = tankShellDeviceDataInformation.getStopTime(); result[5] = tankShellDeviceDataInformation.getStopTime();
result[6] = tankShellDeviceDataInformation.getDeviceOee(); result[6] = tankShellDeviceDataInformation.getDeviceOee();
result[7] = "0"; result[7] = tankShellDeviceDataInformation.getAlarmCount()+"";
result[8] = tankShellDeviceDataInformation.getStopTime(); result[8] = tankShellDeviceDataInformation.getLossTime();
result[9] = tankShellDeviceDataInformation.getDeviceTakt(); result[9] = tankShellDeviceDataInformation.getDeviceTakt();
}else { }else {
result[4] = "0"; result[4] = "0";
result[5] = "0"; result[5] = "0";
@ -111,13 +141,29 @@ public class TankShellDeviceInfoServiceImpl implements ITankShellDeviceInfoServi
result[9] = "0"; result[9] = "0";
} }
}else {
result[4] = "0";
result[5] = "0";
result[6] = "0";
result[7] = "0";
result[8] = "0";
result[9] = "0";
} }
for (int i = 0; i < result.length; i++) {
//
if(result[i] == null){
result[i] = "0";
}
}
}catch (Exception e){ }catch (Exception e){
System.out.println("箱壳设备看板getRunParameters方法异常:"+e.getMessage()); System.out.println("箱壳设备看板getRunParameters方法异常:"+e.getMessage());
result[0] = "-"; result[0] = "-";
} }
return JSONArray.toJSONString(result); return JSONArray.toJSONString(result);
} }

@ -5,9 +5,10 @@ $(() => {
$.getJSON('/aluminumLiner/getDataInformation', function (result) { $.getJSON('/aluminumLiner/getDataInformation', function (result) {
const statusArray = [1, 0, 0, 0, 0]; const statusArray = [1, 0, 0, 0, 0];
if (result.length > 0) { if (result.length > 0) {
statusArray[0] = result[0].deviceStatus; statusArray[0] = result[0].deviceStatus == "正常" ? "1" : "0";
statusArray[1] = result[0].devicePower; statusArray[1] = test(result[0].devicePower,100);
statusArray[2] = result[0].deviceEnergy; statusArray[2] = test(result[0].deviceEnergy,1000);
//statusArray[3] = result[0].count;
} }
dataInformationFunction(statusArray); dataInformationFunction(statusArray);
}); });
@ -78,3 +79,8 @@ $(() => {
fun2() fun2()
tableAnimation('#productionPlan') tableAnimation('#productionPlan')
}) })
const test = (number,flag) =>{
var info = Math.floor(number / flag);
return info.toFixed(2);
}

@ -32,9 +32,6 @@ $(() => {
$("#meterParam").text(result[9]); $("#meterParam").text(result[9]);
}); });
$.getJSON('/tankShellDevice/getRunParameters', function (result) {
runParamStatisticsFunction(result)
});
return setTimeout(fun,10000) return setTimeout(fun,10000)
} }
fun() fun()
@ -86,16 +83,22 @@ const dataInformationFunction = (statusArray) => {
let info = `<table style="position: absolute;top: 8%;width: 100%;height:100%;"> let info = `<table style="position: absolute;top: 8%;width: 100%;height:100%;">
<tr style="width: 100%; height: 50%;"> <tr style="width: 100%; height: 50%;">
<td style="border:0px solid red;text-align:center;width: 50%;"><i ${res.deviceStatus == 1 ? 'style="color:rgb(107, 253, 110);"' : 'style="color: rgb(255, 105, 106);"'} class="fa-regular ${res.deviceStatus == 1 ? "fa-circle-check" : "fa-circle-xmark"}"></i>${res.deviceStatus == 1 ? `<span style="color:rgb(107, 253, 110);margin-left: 10px"></span>` : `<span style="color:rgb(255, 105, 106);margin-left: 10px"></span>`}</td> <td style="border:0px solid red;text-align:center;width: 50%;"><i ${res.deviceStatus == 1 ? 'style="color:rgb(107, 253, 110);"' : 'style="color: rgb(255, 105, 106);"'} class="fa-regular ${res.deviceStatus == 1 ? "fa-circle-check" : "fa-circle-xmark"}"></i>${res.deviceStatus == 1 ? `<span style="color:rgb(107, 253, 110);margin-left: 10px"></span>` : `<span style="color:rgb(255, 105, 106);margin-left: 10px"></span>`}</td>
<td style="border:0px solid red;text-align:center;width: 50%;color: #FFEF76;"> ${res.devicePower}kW</td> <td style="border:0px solid red;text-align:center;width: 50%;color: #FFEF76;"> ${test(res.devicePower,1000)} kW</td>
</tr> </tr>
<tr style="width: 100%; height: 50%;"> <tr style="width: 100%; height: 50%;">
<td style="border:0px solid red;text-align:center;width: 50%;color: #59B2F6;"> ${res.deviceEnergy}kW·h</td> <td style="border:0px solid red;text-align:center;width: 50%;color: #59B2F6;"> ${test(res.deviceEnergy,100)}kW·h</td>
<td style="border:0px solid red;text-align:center;width: 50%;color: red;">0</td> <td style="border:0px solid red;text-align:center;width: 50%;color: red;">0</td>
</tr> </tr>
</table>`; </table>`;
$("#dataInformation").html(info); $("#dataInformation").html(info);
}
const test = (number,flag) =>{
var info = Math.floor(number / flag);
return info.toFixed(2);
} }
/*能耗产量统计*/ /*能耗产量统计*/
@ -113,6 +116,7 @@ const energyProductionStatisticsFunction = (statusArray) => {
} }
const runParamStatisticsFunction = (statusArray) => { const runParamStatisticsFunction = (statusArray) => {
console.log(statusArray)
let info = ` let info = `
<div style="font-size:175%;left: 9%;color:#59B2F6">${statusArray[4]}</div> <div style="font-size:175%;left: 9%;color:#59B2F6">${statusArray[4]}</div>
<div style="font-size:175%;left: 35%;color:#FF696A">${statusArray[5]}</div> <div style="font-size:175%;left: 35%;color:#FF696A">${statusArray[5]}</div>

@ -1,5 +1,5 @@
$(() => { $(() => {
// onDutyPlan(1234,1202,33); let fun = () => {
$.getJSON('/adsorptionTank/getTeamStatisticsJson', function (result) { $.getJSON('/adsorptionTank/getTeamStatisticsJson', function (result) {
// alert(result.actualAmount+"\t"+ result.differenceAmount) // alert(result.actualAmount+"\t"+ result.differenceAmount)
storageStatistics(result.className, result.planAmount, result.actualAmount, result.differenceAmount,) storageStatistics(result.className, result.planAmount, result.actualAmount, result.differenceAmount,)
@ -20,6 +20,9 @@ $(() => {
$.getJSON('/adsorptionTank/getMaterialStoreJson', function (result) { $.getJSON('/adsorptionTank/getMaterialStoreJson', function (result) {
threeDimensionalCylindrical(result, document.getElementById("inventoryStatistics")); threeDimensionalCylindrical(result, document.getElementById("inventoryStatistics"));
}); });
setTimeout(fun, 10000)
}
fun()
}) })

@ -5,9 +5,10 @@ $(() => {
$.getJSON('/aluminumLiner/getDataInformation', function (result) { $.getJSON('/aluminumLiner/getDataInformation', function (result) {
const statusArray = [1, 0, 0, 0, 0]; const statusArray = [1, 0, 0, 0, 0];
if (result.length > 0) { if (result.length > 0) {
statusArray[0] = result[0].deviceStatus; statusArray[0] = result[0].deviceStatus == "正常" ? "1" : "0";
statusArray[1] = result[0].devicePower; statusArray[1] = test(result[0].devicePower,100);
statusArray[2] = result[0].deviceEnergy; statusArray[2] = test(result[0].deviceEnergy,1000);
//statusArray[3] = result[0].count;
} }
dataInformationFunction(statusArray); dataInformationFunction(statusArray);
}); });
@ -78,3 +79,8 @@ $(() => {
fun2() fun2()
tableAnimation('#productionPlan') tableAnimation('#productionPlan')
}) })
const test = (number,flag) =>{
var info = Math.floor(number / flag);
return info.toFixed(2);
}

@ -1226,7 +1226,7 @@ const multipleThreeDimensionalCylindrical = (res, ids, type = 1) => {
color: "#fff", color: "#fff",
fontSize: fontSize, fontSize: fontSize,
}, },
data: ["箱壳库", "内胆库"], data: ["内胆库", "箱壳库"],
}, },
xAxis: [ xAxis: [
{ {

@ -42,9 +42,9 @@ let onDutyPlan = (scheduledProductionNumber, actualOutPutNumber, differenceValue
differenceValue.push(`#differenceValue :nth-child(${i})`); differenceValue.push(`#differenceValue :nth-child(${i})`);
} }
updateSplitBlocks(scheduledProductionNumber, scheduledProduction); updateSplitBlocks(scheduledProductionNumber || 0, scheduledProduction);
updateSplitBlocks(actualOutPutNumber, actualOutPut); updateSplitBlocks(actualOutPutNumber || 0, actualOutPut);
updateSplitBlocks(differenceValueNumber, differenceValue); updateSplitBlocks(differenceValueNumber || 0, differenceValue);
} }
let storageStatistics = (leftInStoreNumber, leftOutStoreNumber, rightInStoreNumber, rightOutStoreNumber) => { let storageStatistics = (leftInStoreNumber, leftOutStoreNumber, rightInStoreNumber, rightOutStoreNumber) => {

@ -33,13 +33,15 @@ $(() => {
let fun = () => { let fun = () => {
//当前库存统计 //当前库存统计
$.getJSON(`/storage/getStoreStatistics?ids=${ids}`, function (result) { // $.getJSON(`/storage/getStoreStatistics?ids=${ids}`, function (result) {
multipleThreeDimensionalCylindrical(result, document.getElementById("theCurrentInventory"), 2); // multipleThreeDimensionalCylindrical(result, document.getElementById("theCurrentInventory"), 2);
}); // });
//库位参数 //库位参数
$.getJSON(`/storage/getParamJson?ids=${ids}`, function (result) { $.getJSON(`/storage/getParamJson?ids=${ids}`, function (result) {
//单日出入库统计 //单日出入库统计
storageStatistics(result[0] == null ? 0 : result[0], result[1] == null ? 0 : result[1], result[2] == null ? 0 : result[2], result[3] == null ? 0 : result[3]); storageStatistics(result[0] == null ? 0 : result[0], result[1] == null ? 0 : result[1], result[2] == null ? 0 : result[2], result[3] == null ? 0 : result[3]);
})
//当前库存统计 //当前库存统计
$.getJSON('/tankShell/getMaterialStoreJson', function (result) { $.getJSON('/tankShell/getMaterialStoreJson', function (result) {
multipleThreeDimensionalCylindrical(result, document.getElementById("theCurrentInventory")); multipleThreeDimensionalCylindrical(result, document.getElementById("theCurrentInventory"));
@ -53,18 +55,27 @@ $(() => {
//单日出入库统计 //单日出入库统计
storageStatistics(result.inStoreLeftCount, result.outStoreLeftCount, result.inStoreRightCount, result.outStoreRightCount); storageStatistics(result.inStoreLeftCount, result.outStoreLeftCount, result.inStoreRightCount, result.outStoreRightCount);
//库存统计
// $("#emptyLocation-left").text(result[4] == null ? 0 : result[4]);
// $("#haveUsedLocation-left").text(result[6] == null ? 0 : result[5]);
// $("#emptyLocation-right").text(result[5] == null ? 0 : result[6]);
// $("#haveUsedLocation-right").text(result[7] == null ? 0 : result[7]);
//库存统计 //库存统计
$("#emptyLocation-left").text(result.freeStoreLeftCount); $("#emptyLocation-left").text(result.freeStoreLeftCount);
$("#haveUsedLocation-left").text(result.useStoreLeftCount); $("#haveUsedLocation-left").text(result.useStoreLeftCount);
$("#emptyLocation-right").text(result.freeStoreRightCount); $("#emptyLocation-right").text(result.freeStoreRightCount);
$("#haveUsedLocation-right").text(result.useStoreRightCount); $("#haveUsedLocation-right").text(result.useStoreRightCount);
//库位占比
// $("#emptyLocationNumber").text(result[8] == null ? 0 : result[8]);
// $("#emptyLocationRatio").text(result[9] == null ? 0 : result[9]);
// $("#haveUsedLocationNumber").text(result[10] == null ? 0 : result[10]);
// $("#haveUsedLocationRatio").text(result[11] == null ? 0 : result[11]);
//库位占比 //库位占比
$("#emptyLocationNumber").text(result.freeStoreCount); $("#emptyLocationNumber").text(result.freeStoreCount);
$("#emptyLocationRatio").text(GetPercent(result.freeStoreCount, 312)); $("#emptyLocationRatio").text(GetPercent(result.freeStoreCount, 312));
$("#haveUsedLocationNumber").text(result.useStoreCount); $("#haveUsedLocationNumber").text(result.useStoreCount);
$("#haveUsedLocationRatio").text(GetPercent(result.useStoreCount, 312)); $("#haveUsedLocationRatio").text(GetPercent(result.useStoreCount, 312));
});
//百分比 //百分比
function GetPercent(num, total) { function GetPercent(num, total) {
@ -75,6 +86,10 @@ $(() => {
} }
return total <= 0 ? "0%" : (Math.round(num / total * 10000) / 100.00) + "%"; return total <= 0 ? "0%" : (Math.round(num / total * 10000) / 100.00) + "%";
} }
});
setTimeout(fun, 10000)
} }
) fun()
})

@ -1,12 +1,9 @@
$(() => { $(() => {
let fun = () => {
//设备OEE统计 //设备OEE统计
$.getJSON('/tankShellDevice/getOeeStatistics', function (result) { $.getJSON('/tankShellDevice/getOeeStatistics', function (result) {
OEEStatistics(result, document.getElementById("OEEStatistics")); OEEStatistics(result, document.getElementById("OEEStatistics"));
}); });
setInterval(() => {
// OEEStatistics(result, document.getElementById("OEEStatistics"));
}, 1000);
//设备故障排名 //设备故障排名
$.getJSON('/tankShellDevice/getStatisticalOutputByModel', function (result) { $.getJSON('/tankShellDevice/getStatisticalOutputByModel', function (result) {
@ -23,6 +20,22 @@ $(() => {
energyConsumption(result, document.getElementById("energyConsumption")); energyConsumption(result, document.getElementById("energyConsumption"));
}); });
/*数据信息*/
$.getJSON('/tankShellDevice/getDataInformation', function (result) {
dataInformationFunction(result)
});
$.getJSON('/tankShellDevice/getRunParameters', function (result) {
console.log(result);
energyProductionStatisticsFunction(result)
runParamStatisticsFunction(result)
$("#lossParam").text(result[8]);
$("#meterParam").text(result[9]);
});
return setTimeout(fun,10000)
}
fun()
const tableRes = {} const tableRes = {}
//设备信息 //设备信息
const getTable = () => { const getTable = () => {
@ -61,21 +74,6 @@ $(() => {
getTable() getTable()
}, 10000); }, 10000);
tableAnimation('#productionPlan') tableAnimation('#productionPlan')
/*数据信息*/
$.getJSON('/tankShellDevice/getDataInformation', function (result) {
dataInformationFunction(result)
});
$.getJSON('/tankShellDevice/getRunParameters', function (result) {
console.log(result);
energyProductionStatisticsFunction(result)
runParamStatisticsFunction(result)
$("#lossParam").text(result[8]);
$("#meterParam").text(result[9]);
});
$.getJSON('/tankShellDevice/getRunParameters', function (result) {
runParamStatisticsFunction(result)
});
}) })
/*数据信息*/ /*数据信息*/
@ -85,16 +83,22 @@ const dataInformationFunction = (statusArray) => {
let info = `<table style="position: absolute;top: 8%;width: 100%;height:100%;"> let info = `<table style="position: absolute;top: 8%;width: 100%;height:100%;">
<tr style="width: 100%; height: 50%;"> <tr style="width: 100%; height: 50%;">
<td style="border:0px solid red;text-align:center;width: 50%;"><i ${res.deviceStatus == 1 ? 'style="color:rgb(107, 253, 110);"' : 'style="color: rgb(255, 105, 106);"'} class="fa-regular ${res.deviceStatus == 1 ? "fa-circle-check" : "fa-circle-xmark"}"></i>${res.deviceStatus == 1 ? `<span style="color:rgb(107, 253, 110);margin-left: 10px"></span>` : `<span style="color:rgb(255, 105, 106);margin-left: 10px"></span>`}</td> <td style="border:0px solid red;text-align:center;width: 50%;"><i ${res.deviceStatus == 1 ? 'style="color:rgb(107, 253, 110);"' : 'style="color: rgb(255, 105, 106);"'} class="fa-regular ${res.deviceStatus == 1 ? "fa-circle-check" : "fa-circle-xmark"}"></i>${res.deviceStatus == 1 ? `<span style="color:rgb(107, 253, 110);margin-left: 10px"></span>` : `<span style="color:rgb(255, 105, 106);margin-left: 10px"></span>`}</td>
<td style="border:0px solid red;text-align:center;width: 50%;color: #FFEF76;"> ${res.devicePower}kW</td> <td style="border:0px solid red;text-align:center;width: 50%;color: #FFEF76;"> ${test(res.devicePower,1000)} kW</td>
</tr> </tr>
<tr style="width: 100%; height: 50%;"> <tr style="width: 100%; height: 50%;">
<td style="border:0px solid red;text-align:center;width: 50%;color: #59B2F6;"> ${res.deviceEnergy}kW·h</td> <td style="border:0px solid red;text-align:center;width: 50%;color: #59B2F6;"> ${test(res.deviceEnergy,100)}kW·h</td>
<td style="border:0px solid red;text-align:center;width: 50%;color: red;">2</td> <td style="border:0px solid red;text-align:center;width: 50%;color: red;">0</td>
</tr> </tr>
</table>`; </table>`;
$("#dataInformation").append(info); $("#dataInformation").html(info);
}
const test = (number,flag) =>{
var info = Math.floor(number / flag);
return info.toFixed(2);
} }
/*能耗产量统计*/ /*能耗产量统计*/
@ -108,10 +112,11 @@ const energyProductionStatisticsFunction = (statusArray) => {
</tr> </tr>
</table>`; </table>`;
$("#energyProductionStatistics").append(info); $("#energyProductionStatistics").html(info);
} }
const runParamStatisticsFunction = (statusArray) => { const runParamStatisticsFunction = (statusArray) => {
console.log(statusArray)
let info = ` let info = `
<div style="font-size:175%;left: 9%;color:#59B2F6">${statusArray[4]}</div> <div style="font-size:175%;left: 9%;color:#59B2F6">${statusArray[4]}</div>
<div style="font-size:175%;left: 35%;color:#FF696A">${statusArray[5]}</div> <div style="font-size:175%;left: 35%;color:#FF696A">${statusArray[5]}</div>

@ -18,7 +18,7 @@ $(() => {
//库存统计 //库存统计
$.getJSON('/tankShell/getMaterialStoreJson', function (result) { $.getJSON('/tankShell/getMaterialStoreJson', function (result) {
multipleThreeDimensionalCylindrical(result, document.getElementById("inventoryStatistics")); multipleThreeDimensionalCylindrical(result, document.getElementById("inventoryStatistics"),);
}); });
setTimeout(fun, 10000) setTimeout(fun, 10000)
} }

Loading…
Cancel
Save