change - 铝内胆数据信息、LOSS统计

master
wenjy 3 years ago
parent 5cbf5e2707
commit 7ba83e087d

@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: cn.easyproject:orai18n:12.1.0.2.0">
<CLASSES>
<root url="jar://D:/开发环境/Maven/apache-maven-3.6.3/repository/cn/easyproject/orai18n/12.1.0.2.0/orai18n-12.1.0.2.0.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://D:/开发环境/Maven/apache-maven-3.6.3/repository/cn/easyproject/orai18n/12.1.0.2.0/orai18n-12.1.0.2.0-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://D:/开发环境/Maven/apache-maven-3.6.3/repository/cn/easyproject/orai18n/12.1.0.2.0/orai18n-12.1.0.2.0-sources.jar!/" />
</SOURCES>
</library>
</component>

@ -112,5 +112,6 @@
<orderEntry type="library" name="Maven: org.mybatis:mybatis:3.5.2" level="project" />
<orderEntry type="library" name="Maven: org.mybatis:mybatis-spring:2.0.2" level="project" />
<orderEntry type="library" name="Maven: com.alibaba:fastjson:1.2.47" level="project" />
<orderEntry type="library" name="Maven: cn.easyproject:orai18n:12.1.0.2.0" level="project" />
</component>
</module>

@ -88,6 +88,13 @@
<version>1.2.47</version>
</dependency>
<!-- https://mvnrepository.com/artifact/cn.easyproject/orai18n -->
<dependency>
<groupId>cn.easyproject</groupId>
<artifactId>orai18n</artifactId>
<version>12.1.0.2.0</version>
</dependency>
</dependencies>
<build>

@ -112,5 +112,6 @@
<orderEntry type="library" name="Maven: org.mybatis:mybatis:3.5.2" level="project" />
<orderEntry type="library" name="Maven: org.mybatis:mybatis-spring:2.0.2" level="project" />
<orderEntry type="library" name="Maven: com.alibaba:fastjson:1.2.47" level="project" />
<orderEntry type="library" name="Maven: cn.easyproject:orai18n:12.1.0.2.0" level="project" />
</component>
</module>

@ -1,12 +1,21 @@
package com.productionboard.controller;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.productionboard.entity.AluminumDevice.AluminumDeviceDataInformation;
import com.productionboard.entity.AluminumDevice.AluminumLossStatistics;
import com.productionboard.service.IAluminumDeviceInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.ArrayList;
import java.util.List;
/**
*
*
* @author WenJY
* @date 20220420 10:42
*/
@ -16,12 +25,53 @@ public class AluminumLinerkController {
private String prefix = "aluminumLiner/index";
@Autowired
private IAluminumDeviceInfoService aluminumDeviceInfoService;
@GetMapping()
public String index()
{
return prefix;
}
/**
*
* @author WenJY
* @date 2022-06-07 10:38
* @return java.lang.String
*/
@GetMapping("/getDataInformation")
@ResponseBody
public String getDataInformation(){
List<AluminumDeviceDataInformation> dataInformationList = aluminumDeviceInfoService.getDataInformationList();
String s = JSONArray.toJSONString(dataInformationList);
return s;
}
/**
*
* @author WenJY
* @date 2022-06-07 10:39
* @return java.lang.String
*/
@GetMapping("/getLossStatistics")
@ResponseBody
public String lossStatistics(){
List<AluminumLossStatistics> lossStatisticsList = aluminumDeviceInfoService.getLossStatisticsList();
List<JSONObject> jsonObjectList = new ArrayList<>();
if(lossStatisticsList.size() > 0){
lossStatisticsList.forEach(x->{
JSONObject jsonObject = new JSONObject();
jsonObject.put("name",x.getXValue());
jsonObject.put("value",x.getYValue());
jsonObjectList.add(jsonObject);
});
}
String s = JSONArray.toJSONString(jsonObjectList);
return s;
}
/**
*
*

@ -0,0 +1,54 @@
package com.productionboard.entity.AluminumDevice;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.util.Date;
/**
*
* @author WenJY
* @date 20220606 16:06
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("SCADA_LCB_DEVICEINFO_1")
public class AluminumDeviceDataInformation implements Serializable {
/** 设备编号 */
@TableField("DEVICEID")
private String deviceId;
/** 设备状态 */
@TableField("DEVICESTATUS")
private String deviceStatus;
/** 设备节拍 */
@TableField("DEVICETAKT")
private String deviceTakt;
/** 开机时间 */
@TableField("OPENTIME")
private String openTime;
/** 运行时间 */
@TableField("RUNTIME")
private String runTime;
/** 设备功率 */
@TableField("DEVICEPOWER")
private String devicePower;
/** 设备能耗 */
@TableField("DEVICEENERGY")
private String deviceEnergy;
/** 采集时间 */
@TableField("COLLECTTIME")
private Date collectTime;
}

@ -0,0 +1,19 @@
package com.productionboard.entity.AluminumDevice;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.io.Serializable;
/**
* @author WenJY
* @date 20220607 10:51
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("SCADA_LCB_DEVICEINFO_1")
public class AluminumEnergyProduction implements Serializable {
}

@ -0,0 +1,27 @@
package com.productionboard.entity.AluminumDevice;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.io.Serializable;
/**
* Loss
* @author WenJY
* @date 20220607 10:55
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("SCADA_LCB_DEVICEINFO_3")
public class AluminumLossStatistics implements Serializable {
@TableField("NAME")
public String xValue;
@TableField("VALUE")
public String yValue;
}

@ -0,0 +1,13 @@
package com.productionboard.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.productionboard.entity.AluminumDevice.AluminumDeviceDataInformation;
import org.apache.ibatis.annotations.Mapper;
/**
* @author WenJY
* @date 20220606 16:24
*/
@Mapper
public interface AluminumDeviceDataInformationMapper extends BaseMapper<AluminumDeviceDataInformation> {
}

@ -0,0 +1,13 @@
package com.productionboard.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.productionboard.entity.AluminumDevice.AluminumLossStatistics;
import org.apache.ibatis.annotations.Mapper;
/**
* @author WenJY
* @date 20220607 11:00
*/
@Mapper
public interface AluminumLossStatisticsMapper extends BaseMapper<AluminumLossStatistics> {
}

@ -0,0 +1,28 @@
package com.productionboard.service;
import com.productionboard.entity.AluminumDevice.AluminumDeviceDataInformation;
import com.productionboard.entity.AluminumDevice.AluminumLossStatistics;
import java.util.List;
/**
* @author WenJY
* @date 20220606 16:23
*/
public interface IAluminumDeviceInfoService {
/**
*
* @author WenJY
* @date 2022-06-06 16:24
* @return java.util.List<com.productionboard.entity.AluminumDevice.AluminumDeviceDataInformation>
*/
public List<AluminumDeviceDataInformation> getDataInformationList();
/**
* Loss
* @author WenJY
* @date 2022-06-07 11:00
* @return java.util.List<com.productionboard.entity.AluminumDevice.AluminumLossStatistics>
*/
public List<AluminumLossStatistics> getLossStatisticsList();
}

@ -0,0 +1,48 @@
package com.productionboard.service.impl;
import com.productionboard.entity.AluminumDevice.AluminumDeviceDataInformation;
import com.productionboard.entity.AluminumDevice.AluminumLossStatistics;
import com.productionboard.mapper.AluminumDeviceDataInformationMapper;
import com.productionboard.mapper.AluminumLossStatisticsMapper;
import com.productionboard.service.IAluminumDeviceInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* @author WenJY
* @date 20220606 16:18
*/
@Service
public class AluminumDeviceInfoServiceImpl implements IAluminumDeviceInfoService
{
@Autowired
private AluminumDeviceDataInformationMapper dataInformationMapper;
@Autowired
private AluminumLossStatisticsMapper aluminumLossStatisticsMapper;
/**
*
* @author WenJY
* @date 2022-06-07 11:01
* @return java.util.List<com.productionboard.entity.AluminumDevice.AluminumDeviceDataInformation>
*/
@Override
public List<AluminumDeviceDataInformation> getDataInformationList() {
return dataInformationMapper.selectList(null);
}
/**
* Loss
* @author WenJY
* @date 2022-06-07 11:01
* @return java.util.List<com.productionboard.entity.AluminumDevice.AluminumLossStatistics>
*/
@Override
public List<AluminumLossStatistics> getLossStatisticsList() {
return aluminumLossStatisticsMapper.selectList(null);
}
}

@ -2,8 +2,8 @@
spring:
datasource:
driver-class-name: oracle.jdbc.driver.OracleDriver
url: jdbc:oracle:thin:@10.100.71.101:1521/orcl
username: aucma
url: jdbc:oracle:thin:@10.100.71.119:1521:ORCL
username: system
password: aucma
# url: jdbc:oracle:thin:@124.70.0.226:1521/scada
# username: aucma

@ -9,7 +9,7 @@ body {
.dataInformation{
border: 1px solid red;
border: 0px solid red;
position: absolute;
width: 24%;
height: 22%;

@ -1,8 +1,23 @@
$(() => {
const statusArray = [0, 0, 0, 0, 0];
//数据信息
$.getJSON('/aluminumLiner/getDataInformation', function (result) {
const statusArray = [1,0,0,0,0];
if(result.length > 0) {
statusArray[0] = result[0].deviceStatus == "正常" ? 0 : 1;
statusArray[1] = result[0].devicePower;
statusArray[2] = result[0].deviceEnergy;
}
dataInformationFunction(statusArray);
});
//loss/aluminumLiner/getLossStatistics
$.getJSON('/aluminumLiner/getLossStatistics', function (result) {
loss(result, document.getElementById("loss"));
});
const syntheticDate = [0, 0, 0, 0, 0];
dataInformationFunction(statusArray);
synthetic(syntheticDate)
//设备OEE统计
@ -13,6 +28,7 @@ $(() => {
inventory(result, document.getElementById("inventory"));
});
//生产计划
$.ajax({
url: '/storage/getProductionPlan',
@ -48,11 +64,6 @@ $(() => {
}
});
//loss
$.getJSON('/tankShell/getInventoryStatistics', function (result) {
loss(result, document.getElementById("loss"));
});
//设备故障排名

@ -2025,7 +2025,7 @@ const loss = (res, ids) => {
];
let Res =
{
datas: [
datas:res.length > 0 ? res : [
{
name: '>30分钟',
value: 2
@ -2038,7 +2038,7 @@ const loss = (res, ids) => {
name: '0-3分钟',
value: 9
},
]
],
}
Res.datas.forEach((item) => {
@ -2091,9 +2091,6 @@ const loss = (res, ids) => {
}
},
yAxis: {
interval: 4,
min: 0,
max: 12,
splitLine: {
show: true,
},

@ -3,12 +3,11 @@ const dataInformationFunction = (statusArray) => {
let info = `<table style="position: absolute;top: 8%;width: 100%;height:100%;">
<tr style="width: 100%; height: 50%;">
<td style="border:0px solid red;text-align:center;width: 50%;"><img src="../../img/foamBox/${statusArray[0] == 0 ? "deviceopen.png" : "deviceclose.png"}" width="20%" height="40%"/>${statusArray[0] == 0 ? `<span style="color:green;margin-left: 10px">运行正常</span>` : `<span style="color:red;margin-left: 10px">运行异常</span>`}</td>
<td style="border:0px solid red;text-align:center;width: 50%;color: #E6ECBE;">389kW</td>
<td style="border:0px solid red;text-align:center;width: 50%;color: #E6ECBE;">${statusArray[1]}</td>
</tr>
<tr style="width: 100%; height: 50%;">
<td style="border:0px solid red;text-align:center;width: 50%;color: white;">4563kW·h</td>
<td style="border:0px solid red;text-align:center;width: 50%;color: #D18DA2;">2</td>
<td style="border:0px solid red;text-align:center;width: 50%;color: white;">${statusArray[2]}kW·h</td>
<td style="border:0px solid red;text-align:center;width: 50%;color: #D18DA2;">${statusArray[3]}</td>
</tr>
</table>`;

@ -15,6 +15,8 @@
<body>
<!--数据信息-->
<div class="dataInformation" id="dataInformation"></div>
<!--能耗产量统计-->
<div class="synthetic" id="synthetic"></div>
<!--设备OEE统计-->

@ -2,8 +2,8 @@
spring:
datasource:
driver-class-name: oracle.jdbc.driver.OracleDriver
url: jdbc:oracle:thin:@10.100.71.101:1521/orcl
username: aucma
url: jdbc:oracle:thin:@10.100.71.119:1521:ORCL
username: system
password: aucma
# url: jdbc:oracle:thin:@124.70.0.226:1521/scada
# username: aucma

@ -9,7 +9,7 @@ body {
.dataInformation{
border: 1px solid red;
border: 0px solid red;
position: absolute;
width: 24%;
height: 22%;

@ -1,8 +1,23 @@
$(() => {
const statusArray = [0, 0, 0, 0, 0];
//数据信息
$.getJSON('/aluminumLiner/getDataInformation', function (result) {
const statusArray = [1,0,0,0,0];
if(result.length > 0) {
statusArray[0] = result[0].deviceStatus == "正常" ? 0 : 1;
statusArray[1] = result[0].devicePower;
statusArray[2] = result[0].deviceEnergy;
}
dataInformationFunction(statusArray);
});
//loss/aluminumLiner/getLossStatistics
$.getJSON('/aluminumLiner/getLossStatistics', function (result) {
loss(result, document.getElementById("loss"));
});
const syntheticDate = [0, 0, 0, 0, 0];
dataInformationFunction(statusArray);
synthetic(syntheticDate)
//设备OEE统计
@ -13,6 +28,7 @@ $(() => {
inventory(result, document.getElementById("inventory"));
});
//生产计划
$.ajax({
url: '/storage/getProductionPlan',
@ -48,11 +64,6 @@ $(() => {
}
});
//loss
$.getJSON('/tankShell/getInventoryStatistics', function (result) {
loss(result, document.getElementById("loss"));
});
//设备故障排名

@ -2025,7 +2025,7 @@ const loss = (res, ids) => {
];
let Res =
{
datas: [
datas:res.length > 0 ? res : [
{
name: '>30分钟',
value: 2
@ -2038,7 +2038,7 @@ const loss = (res, ids) => {
name: '0-3分钟',
value: 9
},
]
],
}
Res.datas.forEach((item) => {
@ -2091,9 +2091,6 @@ const loss = (res, ids) => {
}
},
yAxis: {
interval: 4,
min: 0,
max: 12,
splitLine: {
show: true,
},

@ -3,12 +3,11 @@ const dataInformationFunction = (statusArray) => {
let info = `<table style="position: absolute;top: 8%;width: 100%;height:100%;">
<tr style="width: 100%; height: 50%;">
<td style="border:0px solid red;text-align:center;width: 50%;"><img src="../../img/foamBox/${statusArray[0] == 0 ? "deviceopen.png" : "deviceclose.png"}" width="20%" height="40%"/>${statusArray[0] == 0 ? `<span style="color:green;margin-left: 10px">运行正常</span>` : `<span style="color:red;margin-left: 10px">运行异常</span>`}</td>
<td style="border:0px solid red;text-align:center;width: 50%;color: #E6ECBE;">389kW</td>
<td style="border:0px solid red;text-align:center;width: 50%;color: #E6ECBE;">${statusArray[1]}</td>
</tr>
<tr style="width: 100%; height: 50%;">
<td style="border:0px solid red;text-align:center;width: 50%;color: white;">4563kW·h</td>
<td style="border:0px solid red;text-align:center;width: 50%;color: #D18DA2;">2</td>
<td style="border:0px solid red;text-align:center;width: 50%;color: white;">${statusArray[2]}kW·h</td>
<td style="border:0px solid red;text-align:center;width: 50%;color: #D18DA2;">${statusArray[3]}</td>
</tr>
</table>`;

@ -15,6 +15,8 @@
<body>
<!--数据信息-->
<div class="dataInformation" id="dataInformation"></div>
<!--能耗产量统计-->
<div class="synthetic" id="synthetic"></div>
<!--设备OEE统计-->

@ -112,5 +112,6 @@
<orderEntry type="library" name="Maven: org.mybatis:mybatis:3.5.2" level="project" />
<orderEntry type="library" name="Maven: org.mybatis:mybatis-spring:2.0.2" level="project" />
<orderEntry type="library" name="Maven: com.alibaba:fastjson:1.2.47" level="project" />
<orderEntry type="library" name="Maven: cn.easyproject:orai18n:12.1.0.2.0" level="project" />
</component>
</module>
Loading…
Cancel
Save