From 1b035bac595e35d06e8fb59780899dbe26501cd6 Mon Sep 17 00:00:00 2001 From: wenjy Date: Wed, 8 Jun 2022 18:26:04 +0800 Subject: [PATCH] =?UTF-8?q?add=20-=20=E7=AE=B1=E5=A3=B3=E8=AE=BE=E5=A4=87?= =?UTF-8?q?=E7=9C=8B=E6=9D=BFOEE=E7=BB=9F=E8=AE=A1=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/TankShellDeviceController.java | 13 +++++++ .../TankShellEnergyConsumption.java | 1 + .../TankShellOeeStatistics.java | 32 ++++++++++++++++++ .../mapper/TankShellOeeStatisticsMapper.java | 13 +++++++ .../service/ITankShellDeviceInfoService.java | 8 +++++ .../impl/TankShellDeviceInfoServiceImpl.java | 19 +++++++++++ .../TankShellDeviceController.class | Bin 1597 -> 1776 bytes 7 files changed, 86 insertions(+) create mode 100644 productionboard/src/main/java/com/productionboard/entity/TankShellDevice/TankShellOeeStatistics.java create mode 100644 productionboard/src/main/java/com/productionboard/mapper/TankShellOeeStatisticsMapper.java diff --git a/productionboard/src/main/java/com/productionboard/controller/TankShellDeviceController.java b/productionboard/src/main/java/com/productionboard/controller/TankShellDeviceController.java index fe15b3e..636cd76 100644 --- a/productionboard/src/main/java/com/productionboard/controller/TankShellDeviceController.java +++ b/productionboard/src/main/java/com/productionboard/controller/TankShellDeviceController.java @@ -39,4 +39,17 @@ public class TankShellDeviceController { System.out.println("打印JSON:"+energyConsumptionJson); return energyConsumptionJson; } + + /** + * 获取OEE统计数据 + * @author WenJY + * @date 2022-06-08 18:23 + * @return java.lang.String + */ + @GetMapping("/getOeeStatistics") + @ResponseBody + public String getOeeStatisticsJson(){ + String oeeStatisticsJson = iTankShellDeviceInfoService.getOeeStatisticsJson(); + return oeeStatisticsJson; + } } diff --git a/productionboard/src/main/java/com/productionboard/entity/TankShellDevice/TankShellEnergyConsumption.java b/productionboard/src/main/java/com/productionboard/entity/TankShellDevice/TankShellEnergyConsumption.java index 1422d50..33d2230 100644 --- a/productionboard/src/main/java/com/productionboard/entity/TankShellDevice/TankShellEnergyConsumption.java +++ b/productionboard/src/main/java/com/productionboard/entity/TankShellDevice/TankShellEnergyConsumption.java @@ -10,6 +10,7 @@ import java.io.Serializable; import java.util.Date; /** + * 能耗产量对比 * @author WenJY * @date 2022年06月08日 18:02 */ diff --git a/productionboard/src/main/java/com/productionboard/entity/TankShellDevice/TankShellOeeStatistics.java b/productionboard/src/main/java/com/productionboard/entity/TankShellDevice/TankShellOeeStatistics.java new file mode 100644 index 0000000..203be55 --- /dev/null +++ b/productionboard/src/main/java/com/productionboard/entity/TankShellDevice/TankShellOeeStatistics.java @@ -0,0 +1,32 @@ +package com.productionboard.entity.TankShellDevice; + +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; + +/** + * OEE统计 + * @author WenJY + * @date 2022年06月08日 18:16 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@TableName("SCADA_UK_DEVICEINFO_2") +public class TankShellOeeStatistics implements Serializable { + + @TableField(exist = false) + private String xValue; + + @TableField("OEE") + public String yValue; + + @TableField("createtime") + private Date createTime; + +} diff --git a/productionboard/src/main/java/com/productionboard/mapper/TankShellOeeStatisticsMapper.java b/productionboard/src/main/java/com/productionboard/mapper/TankShellOeeStatisticsMapper.java new file mode 100644 index 0000000..7c2f7a0 --- /dev/null +++ b/productionboard/src/main/java/com/productionboard/mapper/TankShellOeeStatisticsMapper.java @@ -0,0 +1,13 @@ +package com.productionboard.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.productionboard.entity.TankShellDevice.TankShellOeeStatistics; +import org.apache.ibatis.annotations.Mapper; + +/** + * @author WenJY + * @date 2022年06月08日 18:17 + */ +@Mapper +public interface TankShellOeeStatisticsMapper extends BaseMapper { +} diff --git a/productionboard/src/main/java/com/productionboard/service/ITankShellDeviceInfoService.java b/productionboard/src/main/java/com/productionboard/service/ITankShellDeviceInfoService.java index 14a827a..ca5261e 100644 --- a/productionboard/src/main/java/com/productionboard/service/ITankShellDeviceInfoService.java +++ b/productionboard/src/main/java/com/productionboard/service/ITankShellDeviceInfoService.java @@ -14,4 +14,12 @@ public interface ITankShellDeviceInfoService { * @return java.lang.String */ public String getEnergyConsumptionJson(); + + /** + * OEE统计 + * @author WenJY + * @date 2022-06-08 18:18 + * @return java.lang.String + */ + public String getOeeStatisticsJson(); } diff --git a/productionboard/src/main/java/com/productionboard/service/impl/TankShellDeviceInfoServiceImpl.java b/productionboard/src/main/java/com/productionboard/service/impl/TankShellDeviceInfoServiceImpl.java index 3c412f2..5f2ffd1 100644 --- a/productionboard/src/main/java/com/productionboard/service/impl/TankShellDeviceInfoServiceImpl.java +++ b/productionboard/src/main/java/com/productionboard/service/impl/TankShellDeviceInfoServiceImpl.java @@ -3,7 +3,9 @@ package com.productionboard.service.impl; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.productionboard.entity.TankShellDevice.TankShellEnergyConsumption; +import com.productionboard.entity.TankShellDevice.TankShellOeeStatistics; import com.productionboard.mapper.TankShellEnergyConsumptionMapper; +import com.productionboard.mapper.TankShellOeeStatisticsMapper; import com.productionboard.service.ITankShellDeviceInfoService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -21,8 +23,13 @@ public class TankShellDeviceInfoServiceImpl implements ITankShellDeviceInfoServi @Autowired private TankShellEnergyConsumptionMapper tankShellEnergyConsumptionMapper; + @Autowired + private TankShellOeeStatisticsMapper tankShellOeeStatisticsMapper; + private SimpleDateFormat dateFormat = new SimpleDateFormat("MM-dd"); + private SimpleDateFormat hourFormat = new SimpleDateFormat("HH"); + @Override public String getEnergyConsumptionJson() { List tankShellEnergyConsumptions = tankShellEnergyConsumptionMapper.selectList(null); @@ -43,4 +50,16 @@ public class TankShellDeviceInfoServiceImpl implements ITankShellDeviceInfoServi } return JSONArray.toJSONString(jsonObject); } + + @Override + public String getOeeStatisticsJson() { + List tankShellOeeStatistics = tankShellOeeStatisticsMapper.selectList(null); + if(tankShellOeeStatistics.size()>0){ + tankShellOeeStatistics.forEach(x->{ + x.setXValue(hourFormat.format(x.getCreateTime())); + }); + } + String s = JSONArray.toJSONString(tankShellOeeStatistics); + return s; + } } diff --git a/productionboard/target/classes/com/productionboard/controller/TankShellDeviceController.class b/productionboard/target/classes/com/productionboard/controller/TankShellDeviceController.class index 50d27938406b0949d5fb838e36f71d0254dad2bb..71a80403e670a3e927eec961bbc3e68d8106490a 100644 GIT binary patch delta 627 zcmZut+b#o96kRjZF^r?yx)-fm6~z>-dtIxp2}!+qYM9Uv9y;;r2fXzwBpwJaBz%Cc z@daX?X|;(olbn57d+oLMe2DL+{jZ<*PXGz*nrOyEJtiCAg(aVOBc?FjfEgqVBuy9+ zo|SP908yn4goT>KI#L!k zBsQ@X+?&P3Hg+U-)#skXJ`SEf%(}R9xDR0P(FcJ(vTjCK|FR*YNzRePA+j2^f-zQj zfhf4fGt8D24-;(`!6sdlk1&&=6r&g;6BtK|3e~1WCJ;PCoU$^inV{_76zQ0LH%jXU z6JdkkGg56RU!2LoHAzs=E;yd%8LWi8Eo>IC8%)AXq8XEkQ@^-7T? I&;6