diff --git a/productionboard/src/main/java/com/productionboard/controller/AluminumLinerkController.java b/productionboard/src/main/java/com/productionboard/controller/AluminumLinerkController.java index b0170dc..d415a76 100644 --- a/productionboard/src/main/java/com/productionboard/controller/AluminumLinerkController.java +++ b/productionboard/src/main/java/com/productionboard/controller/AluminumLinerkController.java @@ -105,8 +105,8 @@ public class AluminumLinerkController { if(lossStatisticsList.size() > 0){ lossStatisticsList.forEach(x->{ JSONObject jsonObject = new JSONObject(); - jsonObject.put("name",x.getxValue()); - jsonObject.put("value",x.getyValue()); + jsonObject.put("name",x.getXValue()); + jsonObject.put("value",x.getYValue()); jsonObjectList.add(jsonObject); }); } diff --git a/productionboard/src/main/java/com/productionboard/controller/TankShellDeviceController.java b/productionboard/src/main/java/com/productionboard/controller/TankShellDeviceController.java index 4d9bb41..202dd3e 100644 --- a/productionboard/src/main/java/com/productionboard/controller/TankShellDeviceController.java +++ b/productionboard/src/main/java/com/productionboard/controller/TankShellDeviceController.java @@ -1,5 +1,9 @@ package com.productionboard.controller; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.productionboard.entity.AluminumDevice.AluminumLossStatistics; +import com.productionboard.entity.TankShellDevice.TankShellLossStatistics; import com.productionboard.service.ITankShellDeviceInfoService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; @@ -7,6 +11,9 @@ 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 @@ -32,6 +39,30 @@ public class TankShellDeviceController { return iTankShellDeviceInfoService.getDataInformationJson(); } + /** + * loss统计 + * @author WenJY + * @date 2022-06-10 11:28 + * @return java.lang.String + */ + @GetMapping("/getLossStatistics") + @ResponseBody + public String lossStatistics(){ + List lossStatisticsList = iTankShellDeviceInfoService.getLossStatisticsList(); + + List 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; + } + /** * 设备产量能耗对比 * @author WenJY diff --git a/productionboard/src/main/java/com/productionboard/entity/AluminumDevice/AluminumLossStatistics.java b/productionboard/src/main/java/com/productionboard/entity/AluminumDevice/AluminumLossStatistics.java index 7ed12bb..b8656f9 100644 --- a/productionboard/src/main/java/com/productionboard/entity/AluminumDevice/AluminumLossStatistics.java +++ b/productionboard/src/main/java/com/productionboard/entity/AluminumDevice/AluminumLossStatistics.java @@ -13,6 +13,7 @@ import java.io.Serializable; * @author WenJY * @date 2022年06月07日 10:55 */ +@Data @EqualsAndHashCode(callSuper = false) @Accessors(chain = true) @TableName("SCADA_LCB_DEVICEINFO_3") @@ -23,20 +24,4 @@ public class AluminumLossStatistics implements Serializable { @TableField("VALUE") public String yValue; - - public String getxValue() { - return xValue; - } - - public void setxValue(String xValue) { - this.xValue = xValue; - } - - public String getyValue() { - return yValue; - } - - public void setyValue(String yValue) { - this.yValue = yValue; - } } diff --git a/productionboard/src/main/java/com/productionboard/entity/TankShellDevice/TankShellLossStatistics.java b/productionboard/src/main/java/com/productionboard/entity/TankShellDevice/TankShellLossStatistics.java new file mode 100644 index 0000000..81231ef --- /dev/null +++ b/productionboard/src/main/java/com/productionboard/entity/TankShellDevice/TankShellLossStatistics.java @@ -0,0 +1,27 @@ +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; + +/** + * @author WenJY + * @date 2022年06月10日 11:23 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@TableName("SCADA_UK_DEVICEINFO_4") +public class TankShellLossStatistics implements Serializable { + + @TableField("NAME") + public String xValue; + + @TableField("VALUE") + public String yValue; + +} diff --git a/productionboard/src/main/java/com/productionboard/mapper/TankShellLossStatisticsMapper.java b/productionboard/src/main/java/com/productionboard/mapper/TankShellLossStatisticsMapper.java new file mode 100644 index 0000000..ef17c8e --- /dev/null +++ b/productionboard/src/main/java/com/productionboard/mapper/TankShellLossStatisticsMapper.java @@ -0,0 +1,13 @@ +package com.productionboard.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.productionboard.entity.TankShellDevice.TankShellLossStatistics; +import org.apache.ibatis.annotations.Mapper; + +/** + * @author WenJY + * @date 2022年06月10日 11:25 + */ +@Mapper +public interface TankShellLossStatisticsMapper 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 d2e1a04..c13040b 100644 --- a/productionboard/src/main/java/com/productionboard/service/ITankShellDeviceInfoService.java +++ b/productionboard/src/main/java/com/productionboard/service/ITankShellDeviceInfoService.java @@ -1,5 +1,10 @@ package com.productionboard.service; +import com.productionboard.entity.AluminumDevice.AluminumLossStatistics; +import com.productionboard.entity.TankShellDevice.TankShellLossStatistics; + +import java.util.List; + /** * 箱壳设备数据 * @author WenJY @@ -23,6 +28,14 @@ public interface ITankShellDeviceInfoService { */ public String getRunParameters(); + /** + * 获取Loss统计 + * @author WenJY + * @date 2022-06-10 11:26 + * @return java.util.List + */ + public List getLossStatisticsList(); + /** * 获取设备参数值 * @author WenJY 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 d7f9874..e3f3c74 100644 --- a/productionboard/src/main/java/com/productionboard/service/impl/TankShellDeviceInfoServiceImpl.java +++ b/productionboard/src/main/java/com/productionboard/service/impl/TankShellDeviceInfoServiceImpl.java @@ -32,6 +32,9 @@ public class TankShellDeviceInfoServiceImpl implements ITankShellDeviceInfoServi @Autowired private TankShellDevicePrameterValueMapper tankShellDevicePrameterValueMapper; + @Autowired + private TankShellLossStatisticsMapper tankShellLossStatisticsMapper; + @Autowired private TankShellThisMonthEnergyMapper tankShellThisMonthEnergyMapper; @@ -112,6 +115,18 @@ public class TankShellDeviceInfoServiceImpl implements ITankShellDeviceInfoServi return JSONArray.toJSONString(result); } + /** + * 获取Loss统计 + * @author WenJY + * @date 2022-06-10 11:26 + * @return java.util.List + */ + @Override + public List getLossStatisticsList() { + List tankShellLossStatistics = tankShellLossStatisticsMapper.selectList(null); + return tankShellLossStatistics; + } + @Override public String getDeviceParameterValue() { /*Calendar calendar = Calendar.getInstance(); diff --git a/productionboard/target/classes/com/productionboard/controller/AluminumLinerkController.class b/productionboard/target/classes/com/productionboard/controller/AluminumLinerkController.class index bac8d13..95d961a 100644 Binary files a/productionboard/target/classes/com/productionboard/controller/AluminumLinerkController.class and b/productionboard/target/classes/com/productionboard/controller/AluminumLinerkController.class differ diff --git a/productionboard/target/classes/com/productionboard/controller/TankShellDeviceController.class b/productionboard/target/classes/com/productionboard/controller/TankShellDeviceController.class index 18b6ef0..c5db8d5 100644 Binary files a/productionboard/target/classes/com/productionboard/controller/TankShellDeviceController.class and b/productionboard/target/classes/com/productionboard/controller/TankShellDeviceController.class differ diff --git a/productionboard/target/classes/com/productionboard/entity/AluminumDevice/AluminumLossStatistics.class b/productionboard/target/classes/com/productionboard/entity/AluminumDevice/AluminumLossStatistics.class index 52815e9..186d7d3 100644 Binary files a/productionboard/target/classes/com/productionboard/entity/AluminumDevice/AluminumLossStatistics.class and b/productionboard/target/classes/com/productionboard/entity/AluminumDevice/AluminumLossStatistics.class differ diff --git a/productionboard/target/classes/com/productionboard/service/ITankShellDeviceInfoService.class b/productionboard/target/classes/com/productionboard/service/ITankShellDeviceInfoService.class index eb287a7..07af862 100644 Binary files a/productionboard/target/classes/com/productionboard/service/ITankShellDeviceInfoService.class and b/productionboard/target/classes/com/productionboard/service/ITankShellDeviceInfoService.class differ diff --git a/productionboard/target/classes/com/productionboard/service/impl/TankShellDeviceInfoServiceImpl.class b/productionboard/target/classes/com/productionboard/service/impl/TankShellDeviceInfoServiceImpl.class index 6039980..3ce4810 100644 Binary files a/productionboard/target/classes/com/productionboard/service/impl/TankShellDeviceInfoServiceImpl.class and b/productionboard/target/classes/com/productionboard/service/impl/TankShellDeviceInfoServiceImpl.class differ