add - 箱壳设备可视化看板设备参数信息

master
wenjy 2 years ago
parent 629b027e9b
commit 9d2373cb9c

@ -57,6 +57,18 @@ public class TankShellDeviceController {
return iTankShellDeviceInfoService.getRunParameters(); 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 * OEE
* @author WenJY * @author WenJY

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

@ -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 20220609 10:40
*/
@Mapper
public interface TankShellDevicePrameterValueMapper extends BaseMapper<TankShellDevicePrameterValue> {
}

@ -23,6 +23,14 @@ public interface ITankShellDeviceInfoService {
*/ */
public String getRunParameters(); public String getRunParameters();
/**
*
* @author WenJY
* @date 2022-06-09 10:41
* @return java.lang.String
*/
public String getDeviceParameterValue();
/** /**
* JSON * JSON
* @author WenJY * @author WenJY

@ -16,6 +16,7 @@ import java.text.SimpleDateFormat;
import java.util.Calendar; import java.util.Calendar;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
/** /**
* @author WenJY * @author WenJY
@ -27,6 +28,9 @@ public class TankShellDeviceInfoServiceImpl implements ITankShellDeviceInfoServi
@Autowired @Autowired
private TankShellDeviceDataInformationMapper tankShellDeviceDataInformationMapper; private TankShellDeviceDataInformationMapper tankShellDeviceDataInformationMapper;
@Autowired
private TankShellDevicePrameterValueMapper tankShellDevicePrameterValueMapper;
@Autowired @Autowired
private TankShellThisMonthEnergyMapper tankShellThisMonthEnergyMapper; private TankShellThisMonthEnergyMapper tankShellThisMonthEnergyMapper;
@ -87,6 +91,21 @@ public class TankShellDeviceInfoServiceImpl implements ITankShellDeviceInfoServi
return JSONArray.toJSONString(result); return JSONArray.toJSONString(result);
} }
@Override
public String getDeviceParameterValue() {
Calendar calendar = Calendar.getInstance();
calendar.setTime(new Date());
calendar.add(Calendar.MINUTE,-1);
QueryWrapper<TankShellDevicePrameterValue> wrapper = new QueryWrapper<TankShellDevicePrameterValue>();
wrapper.eq("deviceId","XKCX001")
.between("createTime",calendar.getTime(),new Date())
.and(x->
x.like("prameterName","伺服").or().like("prameterName","伺服")
);
List<TankShellDevicePrameterValue> tankShellDevicePrameterValues = tankShellDevicePrameterValueMapper.selectList(wrapper);
return JSONArray.toJSONString(tankShellDevicePrameterValues);
}
@Override @Override
public String getEnergyConsumptionJson() { public String getEnergyConsumptionJson() {
List<TankShellEnergyConsumption> tankShellEnergyConsumptions = tankShellEnergyConsumptionMapper.selectList(null); List<TankShellEnergyConsumption> tankShellEnergyConsumptions = tankShellEnergyConsumptionMapper.selectList(null);

Loading…
Cancel
Save