From eaba61ac9b3088c023034c301f0b275f3b177250 Mon Sep 17 00:00:00 2001 From: wenjy Date: Sun, 11 Dec 2022 20:41:33 +0800 Subject: [PATCH] =?UTF-8?q?change=20-=202022-12-11=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../scada/AbsorbDeviceMesController.java | 11 +++++++++++ .../web/controller/scada/UShellMesController.java | 14 -------------- ruoyi-admin/src/main/resources/application.yml | 4 ++-- .../resources/templates/scada/AbsorbDeviceKB.html | 13 ++++++++++--- .../domain/AbsorbDeviceKB/KBAdsorbDeviceinfo.java | 4 ++++ .../ruoyi/system/domain/ScadaFoamParameter.java | 2 ++ .../impl/ScadaFoamParameterServiceImpl.java | 9 +++++++++ .../resources/mapper/system/ScadaAbsorbMapper.xml | 11 ++++++----- .../mapper/system/ScadaFoamParameterMapper.xml | 2 ++ 9 files changed, 46 insertions(+), 24 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/scada/AbsorbDeviceMesController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/scada/AbsorbDeviceMesController.java index 9a37d32..96d9aaa 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/scada/AbsorbDeviceMesController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/scada/AbsorbDeviceMesController.java @@ -115,6 +115,17 @@ public class AbsorbDeviceMesController { public KBAdsorbDeviceinfo getdeviceState() { KBAdsorbDeviceinfo deviceinfos = null; deviceinfos = KBAdsorbDeviceinfoService.getAdsorbDeviceinfo(); + if(deviceinfos == null){ + deviceinfos = new KBAdsorbDeviceinfo(); + deviceinfos.setDevicePower("0"); + deviceinfos.setDeviceEnergy("0"); + deviceinfos.setDeviceTakt("0"); + deviceinfos.setDeviceStatus("异常"); + deviceinfos.setOpenTime("0"); + deviceinfos.setRunTime("0"); + deviceinfos.setCount(0); + deviceinfos.setLossTime("0"); + } return deviceinfos; } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/scada/UShellMesController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/scada/UShellMesController.java index e7f6bf8..04c3d1f 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/scada/UShellMesController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/scada/UShellMesController.java @@ -131,13 +131,6 @@ public class UShellMesController { EchartsDTO echarts = new EchartsDTO(); List xAxisInfo = new ArrayList(); List seriesInfo = new ArrayList(); - /*List infoList = iMosIoStoreBinDetialRepository.findByMaterialState("1"); - List inventoryInfo = infoList.stream().filter(s->s.getStoreCode().contains("U00")).collect(Collectors.toList()); - Map map = inventoryInfo.stream().collect(Collectors.groupingBy(ImosIoStoreBinDetial::getMaterialName,Collectors.counting())); - for (String key : map.keySet()) { - xAxisInfo.add(key); - seriesInfo.add(map.get(key)); - }*/ List orderInfos = imosPrPlanService.getUhullInventoryInfo(); orderInfos.forEach(x->{ @@ -158,13 +151,6 @@ public class UShellMesController { EchartsDTO echarts = new EchartsDTO(); List xAxisInfo = new ArrayList(); List seriesInfo = new ArrayList(); - /*List infoList = iMosIoStoreBinDetialRepository.findByMaterialState("1"); - List inventoryInfo = infoList.stream().filter(s->s.getStoreCode().equals("L001")).collect(Collectors.toList()); - Map map = inventoryInfo.stream().collect(Collectors.groupingBy(ImosIoStoreBinDetial::getMaterialName,Collectors.counting())); - for (String key : map.keySet()) { - xAxisInfo.add(key); - seriesInfo.add(map.get(key)); - }*/ List orderInfos = imosPrPlanService.getLinerInventoryInfo(); orderInfos.forEach(x->{ diff --git a/ruoyi-admin/src/main/resources/application.yml b/ruoyi-admin/src/main/resources/application.yml index 06daf9b..9ed7600 100644 --- a/ruoyi-admin/src/main/resources/application.yml +++ b/ruoyi-admin/src/main/resources/application.yml @@ -16,7 +16,7 @@ ruoyi: # 开发环境配置 server: # 服务器的HTTP端口,正式端口8012 - port: 8012 + port: 8013 servlet: # 应用的访问路径 context-path: / @@ -138,4 +138,4 @@ swagger: # 是否开启swagger enabled: true -in_id: 1 +in_id: 2 diff --git a/ruoyi-admin/src/main/resources/templates/scada/AbsorbDeviceKB.html b/ruoyi-admin/src/main/resources/templates/scada/AbsorbDeviceKB.html index 2be4266..ea53840 100644 --- a/ruoyi-admin/src/main/resources/templates/scada/AbsorbDeviceKB.html +++ b/ruoyi-admin/src/main/resources/templates/scada/AbsorbDeviceKB.html @@ -735,6 +735,7 @@ const stopDurationElement = document.getElementById("stop-duration") const lossElement = document.getElementById("loss-duration") const deviceTaktElement = document.getElementById("deviceTakt-duration") + const malfunctionElement = document.getElementById("status-card_failure") const productionYesterdayElement = document.getElementById("production-yesterday") const energyConsumptionYesterdayElement = document.getElementById("energy-consumption-yesterday") @@ -749,12 +750,13 @@ autoUpdate("/system/AbsorbDeviceMes/deviceState", INTERVAL, data => { setStatus(data.deviceStatus) - energyConsumptionElement.innerText = data.deviceEnergy - powerElement.innerText = data.devicePower + energyConsumptionElement.innerText = test(data.deviceEnergy,100) + powerElement.innerText = test(data.devicePower,1000) runDurationElement.innerText = data.runTime stopDurationElement.innerText = (data.openTime - data.runTime).toFixed(2) - lossElement.innerText = (data.openTime - data.runTime).toFixed(2) + lossElement.innerText = data.lossTime deviceTaktElement.innerText = data.deviceTakt + malfunctionElement.innerText = data.count }) autoUpdate("/system/AbsorbDeviceMes/DeviceOEE", INTERVAL, data => { @@ -1485,6 +1487,11 @@ fontAdjust() } + const test = (number,flag) =>{ + var info = Math.floor(number / flag); + return info.toFixed(2); + } + window.onresize = resize $(() => { resize() diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/AbsorbDeviceKB/KBAdsorbDeviceinfo.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/AbsorbDeviceKB/KBAdsorbDeviceinfo.java index 7a4d469..30e638f 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/domain/AbsorbDeviceKB/KBAdsorbDeviceinfo.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/AbsorbDeviceKB/KBAdsorbDeviceinfo.java @@ -30,4 +30,8 @@ public class KBAdsorbDeviceinfo { private String runTime; private Date collectTime; + + private int count; + + private String lossTime; } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/ScadaFoamParameter.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/ScadaFoamParameter.java index 96803dc..c76f97c 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/domain/ScadaFoamParameter.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/ScadaFoamParameter.java @@ -258,5 +258,7 @@ public class ScadaFoamParameter extends BaseEntity @Excel(name = "发泡机状态") private int deviceStatus; + private String deviceId; + private String value; } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ScadaFoamParameterServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ScadaFoamParameterServiceImpl.java index 1106dd7..a1b5f26 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ScadaFoamParameterServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ScadaFoamParameterServiceImpl.java @@ -5,6 +5,7 @@ import java.util.List; import com.ruoyi.common.annotation.DataSource; import com.ruoyi.common.enums.DataSourceType; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import com.ruoyi.system.mapper.ScadaFoamParameterMapper; import com.ruoyi.system.domain.ScadaFoamParameter; @@ -24,6 +25,9 @@ public class ScadaFoamParameterServiceImpl implements IScadaFoamParameterService @Autowired private ScadaFoamParameterMapper scadaFoamParameterMapper; + @Value("${in_id}") + private int in_id; + /** * 查询发泡参数 * @@ -46,6 +50,11 @@ public class ScadaFoamParameterServiceImpl implements IScadaFoamParameterService @DataSource(value = DataSourceType.MASTER) public List selectScadaFoamParameterList(ScadaFoamParameter scadaFoamParameter) { + if(in_id==1){ + scadaFoamParameter.setDeviceId("HF202009857"); + }else { + scadaFoamParameter.setDeviceId("HF202009859"); + } return scadaFoamParameterMapper.selectScadaFoamParameterList(scadaFoamParameter); } diff --git a/ruoyi-system/src/main/resources/mapper/system/ScadaAbsorbMapper.xml b/ruoyi-system/src/main/resources/mapper/system/ScadaAbsorbMapper.xml index 76140f6..031ab8a 100644 --- a/ruoyi-system/src/main/resources/mapper/system/ScadaAbsorbMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/ScadaAbsorbMapper.xml @@ -28,11 +28,12 @@