From a7ba9dc161b8338b0ce90566399c34a38cb131b6 Mon Sep 17 00:00:00 2001 From: wenjy Date: Wed, 8 Jun 2022 17:06:04 +0800 Subject: [PATCH] =?UTF-8?q?add=20-=20=E9=93=9D=E5=86=85=E8=83=86=E8=AE=BE?= =?UTF-8?q?=E5=A4=87OEE=E8=B6=8B=E5=8A=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/AluminumLinerkController.java | 8 ++++++++ .../entity/AluminumDevice/AluminumOeeStatistics.java | 6 ++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/productionboard/src/main/java/com/productionboard/controller/AluminumLinerkController.java b/productionboard/src/main/java/com/productionboard/controller/AluminumLinerkController.java index 22705f3..9343d9f 100644 --- a/productionboard/src/main/java/com/productionboard/controller/AluminumLinerkController.java +++ b/productionboard/src/main/java/com/productionboard/controller/AluminumLinerkController.java @@ -12,6 +12,7 @@ import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; +import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.List; @@ -29,6 +30,8 @@ public class AluminumLinerkController { @Autowired private IAluminumDeviceInfoService aluminumDeviceInfoService; + private SimpleDateFormat hourFormat = new SimpleDateFormat("HH"); + @GetMapping() public String index() { @@ -65,6 +68,11 @@ public class AluminumLinerkController { @ResponseBody public String oeeStatistics() { List oeeStatisticsList = aluminumDeviceInfoService.getOeeStatisticsList(); + if(oeeStatisticsList.size()>0){ + oeeStatisticsList.forEach(x->{ + x.setYValue(hourFormat.format(x.getCreateTime())); + }); + } return JSONArray.toJSONString(oeeStatisticsList); } diff --git a/productionboard/src/main/java/com/productionboard/entity/AluminumDevice/AluminumOeeStatistics.java b/productionboard/src/main/java/com/productionboard/entity/AluminumDevice/AluminumOeeStatistics.java index fbc6ce4..29913d1 100644 --- a/productionboard/src/main/java/com/productionboard/entity/AluminumDevice/AluminumOeeStatistics.java +++ b/productionboard/src/main/java/com/productionboard/entity/AluminumDevice/AluminumOeeStatistics.java @@ -23,8 +23,10 @@ public class AluminumOeeStatistics implements Serializable { @TableField("OEE") public String xValue; - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") + @TableField(exist = false) + public String yValue; + @TableField("CREATETIME") - public Date yValue; + public Date createTime; }