|
|
@ -8,6 +8,7 @@ import com.productionboard.entity.TankShellDevice.*;
|
|
|
|
import com.productionboard.mapper.*;
|
|
|
|
import com.productionboard.mapper.*;
|
|
|
|
import com.productionboard.service.ITankShellDeviceInfoService;
|
|
|
|
import com.productionboard.service.ITankShellDeviceInfoService;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
import org.thymeleaf.util.StringUtils;
|
|
|
|
import org.thymeleaf.util.StringUtils;
|
|
|
|
|
|
|
|
|
|
|
@ -48,9 +49,13 @@ public class TankShellDeviceInfoServiceImpl implements ITankShellDeviceInfoServi
|
|
|
|
|
|
|
|
|
|
|
|
private SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
|
private SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Value("${in_id}")
|
|
|
|
|
|
|
|
private int in_id;
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public String getDataInformationJson() {
|
|
|
|
public String getDataInformationJson() {
|
|
|
|
List<TankShellDeviceDataInformation> tankShellDeviceDataInformations = tankShellDeviceDataInformationMapper.selectList(null);
|
|
|
|
// List<TankShellDeviceDataInformation> tankShellDeviceDataInformations = tankShellDeviceDataInformationMapper.selectList(null);
|
|
|
|
|
|
|
|
List<TankShellDeviceDataInformation> tankShellDeviceDataInformations = tankShellDeviceDataInformationMapper.getTankShellDeviceDataInformations(in_id);
|
|
|
|
|
|
|
|
|
|
|
|
if(tankShellDeviceDataInformations.size() > 0 && tankShellDeviceDataInformations.get(0) == null){
|
|
|
|
if(tankShellDeviceDataInformations.size() > 0 && tankShellDeviceDataInformations.get(0) == null){
|
|
|
|
tankShellDeviceDataInformations.remove(0);
|
|
|
|
tankShellDeviceDataInformations.remove(0);
|
|
|
@ -68,7 +73,8 @@ public class TankShellDeviceInfoServiceImpl implements ITankShellDeviceInfoServi
|
|
|
|
public String getRunParameters() {
|
|
|
|
public String getRunParameters() {
|
|
|
|
String[] result = new String[10];
|
|
|
|
String[] result = new String[10];
|
|
|
|
try{
|
|
|
|
try{
|
|
|
|
List<TankShellThisMonthEnergy> tankShellThisMonthEnergies = tankShellThisMonthEnergyMapper.selectList(null);
|
|
|
|
// List<TankShellThisMonthEnergy> tankShellThisMonthEnergies = tankShellThisMonthEnergyMapper.selectList(null);
|
|
|
|
|
|
|
|
List<TankShellThisMonthEnergy> tankShellThisMonthEnergies = tankShellThisMonthEnergyMapper.getTankShellThisMonthEnergies(in_id);
|
|
|
|
|
|
|
|
|
|
|
|
Calendar calendar = Calendar.getInstance();
|
|
|
|
Calendar calendar = Calendar.getInstance();
|
|
|
|
calendar.setTime(new Date());
|
|
|
|
calendar.setTime(new Date());
|
|
|
@ -77,14 +83,16 @@ public class TankShellDeviceInfoServiceImpl implements ITankShellDeviceInfoServi
|
|
|
|
//昨日产量、能耗
|
|
|
|
//昨日产量、能耗
|
|
|
|
QueryWrapper<TankShellEnergyConsumption> wrapper = new QueryWrapper<TankShellEnergyConsumption>();
|
|
|
|
QueryWrapper<TankShellEnergyConsumption> wrapper = new QueryWrapper<TankShellEnergyConsumption>();
|
|
|
|
wrapper.eq("createTime",simpleDateFormat.parse(lastDate));
|
|
|
|
wrapper.eq("createTime",simpleDateFormat.parse(lastDate));
|
|
|
|
List<TankShellEnergyConsumption> tankShellYesterdayEnergies = tankShellEnergyConsumptionMapper.selectList(wrapper);
|
|
|
|
// List<TankShellEnergyConsumption> tankShellYesterdayEnergies = tankShellEnergyConsumptionMapper.selectList(wrapper);
|
|
|
|
|
|
|
|
List<TankShellEnergyConsumption> tankShellYesterdayEnergies = tankShellEnergyConsumptionMapper.getTankShellYesterdayEnergies(in_id);
|
|
|
|
|
|
|
|
|
|
|
|
result[0] = tankShellYesterdayEnergies.size() > 0 ? tankShellYesterdayEnergies.get(0).getProduction():"0";
|
|
|
|
result[0] = tankShellYesterdayEnergies.size() > 0 ? tankShellYesterdayEnergies.get(0).getProduction():"0";
|
|
|
|
result[1] = tankShellYesterdayEnergies.size() > 0 ? tankShellYesterdayEnergies.get(0).getEnergy():"0";
|
|
|
|
result[1] = tankShellYesterdayEnergies.size() > 0 ? tankShellYesterdayEnergies.get(0).getEnergy():"0";
|
|
|
|
result[2] = tankShellThisMonthEnergies.size() > 0 ? tankShellThisMonthEnergies.get(0).getProduction():"0";
|
|
|
|
result[2] = tankShellThisMonthEnergies.size() > 0 ? tankShellThisMonthEnergies.get(0).getProduction():"0";
|
|
|
|
result[3] = tankShellThisMonthEnergies.size() > 0 ? tankShellThisMonthEnergies.get(0).getEnergy():"0";
|
|
|
|
result[3] = tankShellThisMonthEnergies.size() > 0 ? tankShellThisMonthEnergies.get(0).getEnergy():"0";
|
|
|
|
|
|
|
|
|
|
|
|
List<TankShellDeviceDataInformation> deviceDataInformations = tankShellDeviceDataInformationMapper.selectList(null);
|
|
|
|
// List<TankShellDeviceDataInformation> deviceDataInformations = tankShellDeviceDataInformationMapper.selectList(null);
|
|
|
|
|
|
|
|
List<TankShellDeviceDataInformation> deviceDataInformations = tankShellDeviceDataInformationMapper.getDeviceDataInformations(in_id);
|
|
|
|
if(deviceDataInformations.size() > 0){
|
|
|
|
if(deviceDataInformations.size() > 0){
|
|
|
|
TankShellDeviceDataInformation tankShellDeviceDataInformation = deviceDataInformations.get(0);
|
|
|
|
TankShellDeviceDataInformation tankShellDeviceDataInformation = deviceDataInformations.get(0);
|
|
|
|
if(tankShellDeviceDataInformation != null){
|
|
|
|
if(tankShellDeviceDataInformation != null){
|
|
|
@ -121,7 +129,8 @@ public class TankShellDeviceInfoServiceImpl implements ITankShellDeviceInfoServi
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public List<TankShellLossStatistics> getLossStatisticsList() {
|
|
|
|
public List<TankShellLossStatistics> getLossStatisticsList() {
|
|
|
|
List<TankShellLossStatistics> tankShellLossStatistics = tankShellLossStatisticsMapper.selectList(null);
|
|
|
|
// List<TankShellLossStatistics> tankShellLossStatistics = tankShellLossStatisticsMapper.selectList(null);
|
|
|
|
|
|
|
|
List<TankShellLossStatistics> tankShellLossStatistics = tankShellLossStatisticsMapper.getTankShellLossStatistics(in_id);
|
|
|
|
return tankShellLossStatistics;
|
|
|
|
return tankShellLossStatistics;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -137,13 +146,14 @@ public class TankShellDeviceInfoServiceImpl implements ITankShellDeviceInfoServi
|
|
|
|
x.like("prameterName","伺服").or().like("prameterName","伺服")
|
|
|
|
x.like("prameterName","伺服").or().like("prameterName","伺服")
|
|
|
|
);
|
|
|
|
);
|
|
|
|
List<TankShellDevicePrameterValue> tankShellDevicePrameterValues = tankShellDevicePrameterValueMapper.selectList(wrapper);*/
|
|
|
|
List<TankShellDevicePrameterValue> tankShellDevicePrameterValues = tankShellDevicePrameterValueMapper.selectList(wrapper);*/
|
|
|
|
List<TankShellDevicePrameterValue> tankShellDevicePrameterValues = tankShellDevicePrameterValueMapper.SelectDevicePrameterValues();
|
|
|
|
List<TankShellDevicePrameterValue> tankShellDevicePrameterValues = tankShellDevicePrameterValueMapper.SelectDevicePrameterValues(in_id);
|
|
|
|
return JSONArray.toJSONString(tankShellDevicePrameterValues);
|
|
|
|
return JSONArray.toJSONString(tankShellDevicePrameterValues);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public String getEnergyConsumptionJson() {
|
|
|
|
public String getEnergyConsumptionJson() {
|
|
|
|
List<TankShellEnergyConsumption> tankShellEnergyConsumptions = tankShellEnergyConsumptionMapper.selectList(null);
|
|
|
|
// List<TankShellEnergyConsumption> tankShellEnergyConsumptions = tankShellEnergyConsumptionMapper.selectList(null);
|
|
|
|
|
|
|
|
List<TankShellEnergyConsumption> tankShellEnergyConsumptions = tankShellEnergyConsumptionMapper.getTankShellEnergyConsumptions(in_id);
|
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
|
|
if(tankShellEnergyConsumptions.size() > 0){
|
|
|
|
if(tankShellEnergyConsumptions.size() > 0){
|
|
|
|
String[] productionArray = new String[tankShellEnergyConsumptions.size()];
|
|
|
|
String[] productionArray = new String[tankShellEnergyConsumptions.size()];
|
|
|
@ -164,7 +174,9 @@ public class TankShellDeviceInfoServiceImpl implements ITankShellDeviceInfoServi
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public String getOeeStatisticsJson() {
|
|
|
|
public String getOeeStatisticsJson() {
|
|
|
|
List<TankShellOeeStatistics> tankShellOeeStatistics = tankShellOeeStatisticsMapper.selectList(null);
|
|
|
|
// List<TankShellOeeStatistics> tankShellOeeStatistics = tankShellOeeStatisticsMapper.selectList(null);
|
|
|
|
|
|
|
|
List<TankShellOeeStatistics> tankShellOeeStatistics = tankShellOeeStatisticsMapper.getTankShellOeeStatistics(in_id);
|
|
|
|
|
|
|
|
|
|
|
|
if(tankShellOeeStatistics.size()>0){
|
|
|
|
if(tankShellOeeStatistics.size()>0){
|
|
|
|
tankShellOeeStatistics.forEach(x->{
|
|
|
|
tankShellOeeStatistics.forEach(x->{
|
|
|
|
x.setXValue(hourFormat.format(x.getCreateTime()));
|
|
|
|
x.setXValue(hourFormat.format(x.getCreateTime()));
|
|
|
|