change - 箱壳设备看板loss统计

master
wenjy 2 years ago
parent 30f85d16da
commit a9571ede97

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

@ -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<TankShellLossStatistics> lossStatisticsList = iTankShellDeviceInfoService.getLossStatisticsList();
List<JSONObject> 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

@ -13,6 +13,7 @@ import java.io.Serializable;
* @author WenJY
* @date 20220607 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;
}
}

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

@ -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 20220610 11:25
*/
@Mapper
public interface TankShellLossStatisticsMapper extends BaseMapper<TankShellLossStatistics> {
}

@ -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<com.productionboard.entity.TankShellDevice.TankShellLossStatistics>
*/
public List<TankShellLossStatistics> getLossStatisticsList();
/**
*
* @author WenJY

@ -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<com.productionboard.entity.TankShellDevice.TankShellLossStatistics>
*/
@Override
public List<TankShellLossStatistics> getLossStatisticsList() {
List<TankShellLossStatistics> tankShellLossStatistics = tankShellLossStatisticsMapper.selectList(null);
return tankShellLossStatistics;
}
@Override
public String getDeviceParameterValue() {
/*Calendar calendar = Calendar.getInstance();

Loading…
Cancel
Save