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; }