diff --git a/productionboard/src/main/java/com/productionboard/controller/TankShellDeviceController.java b/productionboard/src/main/java/com/productionboard/controller/TankShellDeviceController.java index 7bf4250..4d9bb41 100644 --- a/productionboard/src/main/java/com/productionboard/controller/TankShellDeviceController.java +++ b/productionboard/src/main/java/com/productionboard/controller/TankShellDeviceController.java @@ -57,6 +57,18 @@ public class TankShellDeviceController { return iTankShellDeviceInfoService.getRunParameters(); } + /** + * 获取设备参数值 + * @author WenJY + * @date 2022-06-09 10:52 + * @return java.lang.String + */ + @GetMapping("/getDeviceParameterValue") + @ResponseBody + public String getDeviceParameterValue(){ + return iTankShellDeviceInfoService.getDeviceParameterValue(); + } + /** * 获取OEE统计数据 * @author WenJY diff --git a/productionboard/src/main/java/com/productionboard/entity/TankShellDevice/TankShellDevicePrameterValue.java b/productionboard/src/main/java/com/productionboard/entity/TankShellDevice/TankShellDevicePrameterValue.java new file mode 100644 index 0000000..99cac2b --- /dev/null +++ b/productionboard/src/main/java/com/productionboard/entity/TankShellDevice/TankShellDevicePrameterValue.java @@ -0,0 +1,34 @@ +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; + +/** + * 设备参数信息 + * @author WenJY + * @date 2022年06月09日 10:37 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@TableName("SCADA_PRAMERTER_VALUE") +public class TankShellDevicePrameterValue implements Serializable { + + @TableField("deviceid") + private String deviceId; + + @TableField("prametername") + private String prameterName; + + @TableField("value") + private String prameterValue; + + @TableField("createtime") + private Date createTime; +} diff --git a/productionboard/src/main/java/com/productionboard/mapper/TankShellDevicePrameterValueMapper.java b/productionboard/src/main/java/com/productionboard/mapper/TankShellDevicePrameterValueMapper.java new file mode 100644 index 0000000..dd84cca --- /dev/null +++ b/productionboard/src/main/java/com/productionboard/mapper/TankShellDevicePrameterValueMapper.java @@ -0,0 +1,13 @@ +package com.productionboard.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.productionboard.entity.TankShellDevice.TankShellDevicePrameterValue; +import org.apache.ibatis.annotations.Mapper; + +/** + * @author WenJY + * @date 2022年06月09日 10:40 + */ +@Mapper +public interface TankShellDevicePrameterValueMapper 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 64cd68e..d2e1a04 100644 --- a/productionboard/src/main/java/com/productionboard/service/ITankShellDeviceInfoService.java +++ b/productionboard/src/main/java/com/productionboard/service/ITankShellDeviceInfoService.java @@ -23,6 +23,14 @@ public interface ITankShellDeviceInfoService { */ public String getRunParameters(); + /** + * 获取设备参数值 + * @author WenJY + * @date 2022-06-09 10:41 + * @return java.lang.String + */ + public String getDeviceParameterValue(); + /** * 获取能耗产量对比JSON * @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 abe5dce..8a2ccec 100644 --- a/productionboard/src/main/java/com/productionboard/service/impl/TankShellDeviceInfoServiceImpl.java +++ b/productionboard/src/main/java/com/productionboard/service/impl/TankShellDeviceInfoServiceImpl.java @@ -16,6 +16,7 @@ import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; import java.util.List; +import java.util.stream.Collectors; /** * @author WenJY @@ -27,6 +28,9 @@ public class TankShellDeviceInfoServiceImpl implements ITankShellDeviceInfoServi @Autowired private TankShellDeviceDataInformationMapper tankShellDeviceDataInformationMapper; + @Autowired + private TankShellDevicePrameterValueMapper tankShellDevicePrameterValueMapper; + @Autowired private TankShellThisMonthEnergyMapper tankShellThisMonthEnergyMapper; @@ -87,6 +91,21 @@ public class TankShellDeviceInfoServiceImpl implements ITankShellDeviceInfoServi return JSONArray.toJSONString(result); } + @Override + public String getDeviceParameterValue() { + Calendar calendar = Calendar.getInstance(); + calendar.setTime(new Date()); + calendar.add(Calendar.MINUTE,-1); + QueryWrapper wrapper = new QueryWrapper(); + wrapper.eq("deviceId","XKCX001") + .between("createTime",calendar.getTime(),new Date()) + .and(x-> + x.like("prameterName","伺服").or().like("prameterName","伺服") + ); + List tankShellDevicePrameterValues = tankShellDevicePrameterValueMapper.selectList(wrapper); + return JSONArray.toJSONString(tankShellDevicePrameterValues); + } + @Override public String getEnergyConsumptionJson() { List tankShellEnergyConsumptions = tankShellEnergyConsumptionMapper.selectList(null); diff --git a/productionboard/target/classes/com/productionboard/controller/TankShellDeviceController.class b/productionboard/target/classes/com/productionboard/controller/TankShellDeviceController.class index e2c424c..18b6ef0 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/service/ITankShellDeviceInfoService.class b/productionboard/target/classes/com/productionboard/service/ITankShellDeviceInfoService.class index 7851bc0..eb287a7 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 98401d1..ccf97dd 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