change - 数据异常情况处理

master
wenjy 2 years ago
parent 0f0b06a368
commit 2bb997d928

@ -1,2 +0,0 @@
com\deviceboard\DeviceBoardApplication.class
com\deviceboard\controller\TestController.class

@ -1,2 +1,2 @@
C:\Users\ADMIN\Desktop\新建文件夹 (4)\scada-visual-board\deviceboard\src\main\java\com\deviceboard\DeviceBoardApplication.java
C:\Users\ADMIN\Desktop\新建文件夹 (4)\scada-visual-board\deviceboard\src\main\java\com\deviceboard\controller\TestController.java
E:\×ÀÃæ\scada-visual-board\deviceboard\src\main\java\com\deviceboard\DeviceBoardApplication.java
E:\×ÀÃæ\scada-visual-board\deviceboard\src\main\java\com\deviceboard\controller\TestController.java

@ -48,6 +48,14 @@ public class AluminumLinerkController {
@ResponseBody
public String getDataInformation(){
List<AluminumDeviceDataInformation> dataInformationList = aluminumDeviceInfoService.getDataInformationList();
if(dataInformationList.size() > 0 && dataInformationList.get(0) == null){
dataInformationList.remove(0);
AluminumDeviceDataInformation aluminumDeviceDataInformation = new AluminumDeviceDataInformation();
aluminumDeviceDataInformation.setDeviceStatus("0");
aluminumDeviceDataInformation.setDevicePower("0");
aluminumDeviceDataInformation.setDeviceEnergy("0");
dataInformationList.add(aluminumDeviceDataInformation);
}
String s = JSONArray.toJSONString(dataInformationList);
return s;
}

@ -20,6 +20,13 @@ import java.util.Date;
@TableName("SCADA_LCB_DEVICEINFO_1")
public class AluminumDeviceDataInformation implements Serializable {
public AluminumDeviceDataInformation() {
}
public AluminumDeviceDataInformation(String deviceStatus) {
this.deviceStatus = deviceStatus;
}
/** 设备编号 */
@TableField("DEVICEID")
private String deviceId;

@ -65,12 +65,21 @@ public class AluminumDeviceInfoServiceImpl implements IAluminumDeviceInfoService
List<AluminumDeviceDataInformation> aluminumDeviceDataInformations = dataInformationMapper.selectList(null);
if(aluminumDeviceDataInformations.size() > 0){
AluminumDeviceDataInformation aluminumDeviceDataInformation = aluminumDeviceDataInformations.get(0);
result[4] = aluminumDeviceDataInformation.getRunTime();
result[5] = aluminumDeviceDataInformation.getStopTime();
result[6] = aluminumDeviceDataInformation.getDeviceOee();
result[7] = "0";
result[8] = aluminumDeviceDataInformation.getRunTime();
result[9] = aluminumDeviceDataInformation.getDeviceTakt();
if(aluminumDeviceDataInformation != null){
result[4] = aluminumDeviceDataInformation.getRunTime();
result[5] = aluminumDeviceDataInformation.getStopTime();
result[6] = aluminumDeviceDataInformation.getDeviceOee();
result[7] = "0";
result[8] = aluminumDeviceDataInformation.getRunTime();
result[9] = aluminumDeviceDataInformation.getDeviceTakt();
}else{
result[4] = "0";
result[5] = "0";
result[6] = "0";
result[7] = "0";
result[8] = "0";
result[9] = "0";
}
}
}catch (Exception e){

@ -11,6 +11,7 @@ import com.productionboard.mapper.*;
import com.productionboard.service.ITankShellDeviceInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.thymeleaf.util.StringUtils;
import java.text.SimpleDateFormat;
import java.util.Calendar;
@ -49,6 +50,16 @@ public class TankShellDeviceInfoServiceImpl implements ITankShellDeviceInfoServi
@Override
public String getDataInformationJson() {
List<TankShellDeviceDataInformation> tankShellDeviceDataInformations = tankShellDeviceDataInformationMapper.selectList(null);
if(tankShellDeviceDataInformations.size() > 0 && tankShellDeviceDataInformations.get(0) == null){
tankShellDeviceDataInformations.remove(0);
TankShellDeviceDataInformation tankShellDeviceDataInformation = new TankShellDeviceDataInformation();
tankShellDeviceDataInformation.setDeviceStatus("0");
tankShellDeviceDataInformation.setDevicePower("0");
tankShellDeviceDataInformation.setDeviceEnergy("0");
tankShellDeviceDataInformations.add(tankShellDeviceDataInformation);
}
return JSONArray.toJSONString(tankShellDeviceDataInformations);
}
@ -75,12 +86,22 @@ public class TankShellDeviceInfoServiceImpl implements ITankShellDeviceInfoServi
List<TankShellDeviceDataInformation> deviceDataInformations = tankShellDeviceDataInformationMapper.selectList(null);
if(deviceDataInformations.size() > 0){
TankShellDeviceDataInformation tankShellDeviceDataInformation = deviceDataInformations.get(0);
result[4] = tankShellDeviceDataInformation.getRunTime();
result[5] = tankShellDeviceDataInformation.getStopTime();
result[6] = tankShellDeviceDataInformation.getDeviceOee();
result[7] = "0";
result[8] = tankShellDeviceDataInformation.getRunTime();
result[9] = tankShellDeviceDataInformation.getDeviceTakt();
if(tankShellDeviceDataInformation != null){
result[4] = tankShellDeviceDataInformation.getRunTime();
result[5] = tankShellDeviceDataInformation.getStopTime();
result[6] = tankShellDeviceDataInformation.getDeviceOee();
result[7] = "0";
result[8] = tankShellDeviceDataInformation.getStopTime();
result[9] = tankShellDeviceDataInformation.getDeviceTakt();
}else {
result[4] = "0";
result[5] = "0";
result[6] = "0";
result[7] = "0";
result[8] = "0";
result[9] = "0";
}
}
}catch (Exception e){

@ -1,41 +1,51 @@
com\productionboard\mapper\AluminumLossStatisticsMapper.class
com\productionboard\common\CodeGenerator.class
com\productionboard\entity\MesProduction\MesMaterialStoreStatistics.class
com\productionboard\mapper\MesHourProdutionStatisticsMapper.class
com\productionboard\common\CodeGenerator$1.class
com\productionboard\service\impl\AluminumDeviceInfoServiceImpl.class
com\productionboard\entity\BasicScadaDeviceinfo.class
com\productionboard\controller\FoamBoxController.class
com\productionboard\mapper\TankShellDeviceDataInformationMapper.class
com\productionboard\service\IAluminumDeviceInfoService.class
com\productionboard\service\impl\BasicScadaDeviceinfoServiceImpl.class
com\productionboard\controller\StorageController.class
com\productionboard\mapper\AluminumYesterdayEnergyMapper.class
com\productionboard\entity\AluminumDevice\AluminumThisMonthEnergy.class
com\productionboard\common\CodeGenerator$2.class
com\productionboard\service\IMesProductionDataService.class
com\productionboard\entity\TankShellDevice\TankShellEnergyConsumption.class
com\productionboard\entity\AluminumDevice\AluminumDeviceDataInformation.class
com\productionboard\mapper\BasicScadaDeviceinfoMapper.class
com\productionboard\controller\TankShellDeviceController.class
com\productionboard\service\ITankShellDeviceInfoService.class
com\productionboard\config\MybatisPlusConfig.class
com\productionboard\entity\TankShellDevice\TankShellDevicePrameterValue.class
com\productionboard\mapper\TankShellOeeStatisticsMapper.class
com\productionboard\entity\AluminumDevice\AluminumYesterdayEnergy.class
com\productionboard\mapper\TankShellEnergyConsumptionMapper.class
com\productionboard\controller\AluminumLinerkController.class
com\productionboard\controller\PreassembleController.class
com\productionboard\service\BasicScadaDeviceinfoService.class
com\productionboard\entity\TankShellDevice\TankShellDeviceDataInformation.class
com\productionboard\mapper\AluminumDeviceDataInformationMapper.class
com\productionboard\ProductionBoardApplication.class
com\productionboard\entity\TankShellDevice\TankShellOeeStatistics.class
com\productionboard\mapper\AluminumThisMonthEnergyMapper.class
com\productionboard\service\impl\TankShellDeviceInfoServiceImpl.class
com\productionboard\mapper\MesMaterialProductionStatisticsMapper.class
com\productionboard\mapper\AluminumOeeStatisticsMapper.class
com\productionboard\entity\AluminumDevice\AluminumOeeStatistics.class
com\productionboard\mapper\TankShellDevicePrameterValueMapper.class
com\productionboard\mapper\TankShellThisMonthEnergyMapper.class
com\productionboard\controller\TankShellController.class
com\productionboard\entity\TankShellDevice\TankShellThisMonthEnergy.class
com\productionboard\entity\AluminumDevice\AluminumLossStatistics.class
com\productionboard\service\impl\MesProductionDataServiceImpl.class
com\productionboard\controller\AluminumTtankController.class
com\productionboard\mapper\AluminumLossStatisticsMapper.class
com\productionboard\mapper\MesMaterialStoreStatisticsMapper.class
com\productionboard\entity\BasicScadaDeviceinfo.class
com\productionboard\entity\MesProduction\MesHourProdutionStatistics.class
com\productionboard\service\impl\BasicScadaDeviceinfoServiceImpl.class
com\productionboard\controller\StorageController.class
com\productionboard\mapper\AluminumYesterdayEnergyMapper.class
com\productionboard\entity\AluminumDevice\AluminumThisMonthEnergy.class
com\productionboard\common\CodeGenerator$2.class
com\productionboard\entity\AluminumDevice\AluminumDeviceDataInformation.class
com\productionboard\entity\TankShellDevice\TankShellDevicePrameterValue.class
com\productionboard\mapper\MesTeamStatisticsMapper.class
com\productionboard\mapper\TankShellOeeStatisticsMapper.class
com\productionboard\entity\MesProduction\MesMaterialProductionStatistics.class
com\productionboard\entity\MesProduction\MesTeamStatistics.class
com\productionboard\mapper\TankShellEnergyConsumptionMapper.class
com\productionboard\service\BasicScadaDeviceinfoService.class
com\productionboard\entity\TankShellDevice\TankShellDeviceDataInformation.class
com\productionboard\mapper\AluminumDeviceDataInformationMapper.class
com\productionboard\service\impl\TankShellDeviceInfoServiceImpl.class
com\productionboard\entity\AluminumDevice\AluminumOeeStatistics.class
com\productionboard\controller\TankShellController.class
com\productionboard\entity\AluminumDevice\AluminumLossStatistics.class
com\productionboard\controller\AdsorptionTankController.class

@ -1,39 +1,49 @@
C:\Users\ADMIN\Desktop\新建文件夹 (4)\scada-visual-board\productionboard\src\main\java\com\productionboard\mapper\BasicScadaDeviceinfoMapper.java
C:\Users\ADMIN\Desktop\新建文件夹 (4)\scada-visual-board\productionboard\src\main\java\com\productionboard\mapper\TankShellEnergyConsumptionMapper.java
C:\Users\ADMIN\Desktop\新建文件夹 (4)\scada-visual-board\productionboard\src\main\java\com\productionboard\service\impl\BasicScadaDeviceinfoServiceImpl.java
C:\Users\ADMIN\Desktop\新建文件夹 (4)\scada-visual-board\productionboard\src\main\java\com\productionboard\mapper\AluminumLossStatisticsMapper.java
C:\Users\ADMIN\Desktop\新建文件夹 (4)\scada-visual-board\productionboard\src\main\java\com\productionboard\mapper\TankShellThisMonthEnergyMapper.java
C:\Users\ADMIN\Desktop\新建文件夹 (4)\scada-visual-board\productionboard\src\main\java\com\productionboard\config\MybatisPlusConfig.java
C:\Users\ADMIN\Desktop\新建文件夹 (4)\scada-visual-board\productionboard\src\main\java\com\productionboard\entity\AluminumDevice\AluminumLossStatistics.java
C:\Users\ADMIN\Desktop\新建文件夹 (4)\scada-visual-board\productionboard\src\main\java\com\productionboard\service\impl\TankShellDeviceInfoServiceImpl.java
C:\Users\ADMIN\Desktop\新建文件夹 (4)\scada-visual-board\productionboard\src\main\java\com\productionboard\controller\PreassembleController.java
C:\Users\ADMIN\Desktop\新建文件夹 (4)\scada-visual-board\productionboard\src\main\java\com\productionboard\entity\TankShellDevice\TankShellThisMonthEnergy.java
C:\Users\ADMIN\Desktop\新建文件夹 (4)\scada-visual-board\productionboard\src\main\java\com\productionboard\controller\AluminumLinerkController.java
C:\Users\ADMIN\Desktop\新建文件夹 (4)\scada-visual-board\productionboard\src\main\java\com\productionboard\entity\AluminumDevice\AluminumYesterdayEnergy.java
C:\Users\ADMIN\Desktop\新建文件夹 (4)\scada-visual-board\productionboard\src\main\java\com\productionboard\controller\TankShellDeviceController.java
C:\Users\ADMIN\Desktop\新建文件夹 (4)\scada-visual-board\productionboard\src\main\java\com\productionboard\entity\AluminumDevice\AluminumOeeStatistics.java
C:\Users\ADMIN\Desktop\新建文件夹 (4)\scada-visual-board\productionboard\src\main\java\com\productionboard\mapper\AluminumThisMonthEnergyMapper.java
C:\Users\ADMIN\Desktop\新建文件夹 (4)\scada-visual-board\productionboard\src\main\java\com\productionboard\ProductionBoardApplication.java
C:\Users\ADMIN\Desktop\新建文件夹 (4)\scada-visual-board\productionboard\src\main\java\com\productionboard\entity\AluminumDevice\AluminumThisMonthEnergy.java
C:\Users\ADMIN\Desktop\新建文件夹 (4)\scada-visual-board\productionboard\src\main\java\com\productionboard\controller\FoamBoxController.java
C:\Users\ADMIN\Desktop\新建文件夹 (4)\scada-visual-board\productionboard\src\main\java\com\productionboard\controller\AluminumTtankController.java
C:\Users\ADMIN\Desktop\新建文件夹 (4)\scada-visual-board\productionboard\src\main\java\com\productionboard\service\IAluminumDeviceInfoService.java
C:\Users\ADMIN\Desktop\新建文件夹 (4)\scada-visual-board\productionboard\src\main\java\com\productionboard\mapper\AluminumDeviceDataInformationMapper.java
C:\Users\ADMIN\Desktop\新建文件夹 (4)\scada-visual-board\productionboard\src\main\java\com\productionboard\common\CodeGenerator.java
C:\Users\ADMIN\Desktop\新建文件夹 (4)\scada-visual-board\productionboard\src\main\java\com\productionboard\entity\TankShellDevice\TankShellOeeStatistics.java
C:\Users\ADMIN\Desktop\新建文件夹 (4)\scada-visual-board\productionboard\src\main\java\com\productionboard\entity\TankShellDevice\TankShellEnergyConsumption.java
C:\Users\ADMIN\Desktop\新建文件夹 (4)\scada-visual-board\productionboard\src\main\java\com\productionboard\mapper\AluminumYesterdayEnergyMapper.java
C:\Users\ADMIN\Desktop\新建文件夹 (4)\scada-visual-board\productionboard\src\main\java\com\productionboard\mapper\TankShellDevicePrameterValueMapper.java
C:\Users\ADMIN\Desktop\新建文件夹 (4)\scada-visual-board\productionboard\src\main\java\com\productionboard\mapper\TankShellDeviceDataInformationMapper.java
C:\Users\ADMIN\Desktop\新建文件夹 (4)\scada-visual-board\productionboard\src\main\java\com\productionboard\service\BasicScadaDeviceinfoService.java
C:\Users\ADMIN\Desktop\新建文件夹 (4)\scada-visual-board\productionboard\src\main\java\com\productionboard\service\impl\AluminumDeviceInfoServiceImpl.java
C:\Users\ADMIN\Desktop\新建文件夹 (4)\scada-visual-board\productionboard\src\main\java\com\productionboard\entity\BasicScadaDeviceinfo.java
C:\Users\ADMIN\Desktop\新建文件夹 (4)\scada-visual-board\productionboard\src\main\java\com\productionboard\entity\AluminumDevice\AluminumDeviceDataInformation.java
C:\Users\ADMIN\Desktop\新建文件夹 (4)\scada-visual-board\productionboard\src\main\java\com\productionboard\entity\TankShellDevice\TankShellDeviceDataInformation.java
C:\Users\ADMIN\Desktop\新建文件夹 (4)\scada-visual-board\productionboard\src\main\java\com\productionboard\service\ITankShellDeviceInfoService.java
C:\Users\ADMIN\Desktop\新建文件夹 (4)\scada-visual-board\productionboard\src\main\java\com\productionboard\controller\TankShellController.java
C:\Users\ADMIN\Desktop\新建文件夹 (4)\scada-visual-board\productionboard\src\main\java\com\productionboard\controller\StorageController.java
C:\Users\ADMIN\Desktop\新建文件夹 (4)\scada-visual-board\productionboard\src\main\java\com\productionboard\controller\AdsorptionTankController.java
C:\Users\ADMIN\Desktop\新建文件夹 (4)\scada-visual-board\productionboard\src\main\java\com\productionboard\mapper\TankShellOeeStatisticsMapper.java
C:\Users\ADMIN\Desktop\新建文件夹 (4)\scada-visual-board\productionboard\src\main\java\com\productionboard\entity\TankShellDevice\TankShellDevicePrameterValue.java
C:\Users\ADMIN\Desktop\新建文件夹 (4)\scada-visual-board\productionboard\src\main\java\com\productionboard\mapper\AluminumOeeStatisticsMapper.java
E:\桌面\scada-visual-board\productionboard\src\main\java\com\productionboard\entity\TankShellDevice\TankShellThisMonthEnergy.java
E:\桌面\scada-visual-board\productionboard\src\main\java\com\productionboard\mapper\TankShellThisMonthEnergyMapper.java
E:\桌面\scada-visual-board\productionboard\src\main\java\com\productionboard\entity\BasicScadaDeviceinfo.java
E:\桌面\scada-visual-board\productionboard\src\main\java\com\productionboard\controller\FoamBoxController.java
E:\桌面\scada-visual-board\productionboard\src\main\java\com\productionboard\common\CodeGenerator.java
E:\桌面\scada-visual-board\productionboard\src\main\java\com\productionboard\mapper\AluminumYesterdayEnergyMapper.java
E:\桌面\scada-visual-board\productionboard\src\main\java\com\productionboard\mapper\TankShellDevicePrameterValueMapper.java
E:\桌面\scada-visual-board\productionboard\src\main\java\com\productionboard\ProductionBoardApplication.java
E:\桌面\scada-visual-board\productionboard\src\main\java\com\productionboard\controller\AdsorptionTankController.java
E:\桌面\scada-visual-board\productionboard\src\main\java\com\productionboard\config\MybatisPlusConfig.java
E:\桌面\scada-visual-board\productionboard\src\main\java\com\productionboard\mapper\TankShellDeviceDataInformationMapper.java
E:\桌面\scada-visual-board\productionboard\src\main\java\com\productionboard\mapper\TankShellOeeStatisticsMapper.java
E:\桌面\scada-visual-board\productionboard\src\main\java\com\productionboard\entity\TankShellDevice\TankShellDeviceDataInformation.java
E:\桌面\scada-visual-board\productionboard\src\main\java\com\productionboard\mapper\AluminumOeeStatisticsMapper.java
E:\桌面\scada-visual-board\productionboard\src\main\java\com\productionboard\entity\AluminumDevice\AluminumThisMonthEnergy.java
E:\桌面\scada-visual-board\productionboard\src\main\java\com\productionboard\service\impl\BasicScadaDeviceinfoServiceImpl.java
E:\桌面\scada-visual-board\productionboard\src\main\java\com\productionboard\service\impl\TankShellDeviceInfoServiceImpl.java
E:\桌面\scada-visual-board\productionboard\src\main\java\com\productionboard\service\impl\AluminumDeviceInfoServiceImpl.java
E:\桌面\scada-visual-board\productionboard\src\main\java\com\productionboard\entity\AluminumDevice\AluminumYesterdayEnergy.java
E:\桌面\scada-visual-board\productionboard\src\main\java\com\productionboard\controller\StorageController.java
E:\桌面\scada-visual-board\productionboard\src\main\java\com\productionboard\mapper\MesHourProdutionStatisticsMapper.java
E:\桌面\scada-visual-board\productionboard\src\main\java\com\productionboard\controller\PreassembleController.java
E:\桌面\scada-visual-board\productionboard\src\main\java\com\productionboard\entity\MesProduction\MesTeamStatistics.java
E:\桌面\scada-visual-board\productionboard\src\main\java\com\productionboard\entity\TankShellDevice\TankShellDevicePrameterValue.java
E:\桌面\scada-visual-board\productionboard\src\main\java\com\productionboard\mapper\MesMaterialStoreStatisticsMapper.java
E:\桌面\scada-visual-board\productionboard\src\main\java\com\productionboard\entity\AluminumDevice\AluminumOeeStatistics.java
E:\桌面\scada-visual-board\productionboard\src\main\java\com\productionboard\controller\AluminumLinerkController.java
E:\桌面\scada-visual-board\productionboard\src\main\java\com\productionboard\mapper\BasicScadaDeviceinfoMapper.java
E:\桌面\scada-visual-board\productionboard\src\main\java\com\productionboard\entity\MesProduction\MesMaterialProductionStatistics.java
E:\桌面\scada-visual-board\productionboard\src\main\java\com\productionboard\mapper\MesTeamStatisticsMapper.java
E:\桌面\scada-visual-board\productionboard\src\main\java\com\productionboard\service\ITankShellDeviceInfoService.java
E:\桌面\scada-visual-board\productionboard\src\main\java\com\productionboard\mapper\TankShellEnergyConsumptionMapper.java
E:\桌面\scada-visual-board\productionboard\src\main\java\com\productionboard\mapper\AluminumDeviceDataInformationMapper.java
E:\桌面\scada-visual-board\productionboard\src\main\java\com\productionboard\entity\MesProduction\MesMaterialStoreStatistics.java
E:\桌面\scada-visual-board\productionboard\src\main\java\com\productionboard\controller\TankShellDeviceController.java
E:\桌面\scada-visual-board\productionboard\src\main\java\com\productionboard\entity\MesProduction\MesHourProdutionStatistics.java
E:\桌面\scada-visual-board\productionboard\src\main\java\com\productionboard\service\IAluminumDeviceInfoService.java
E:\桌面\scada-visual-board\productionboard\src\main\java\com\productionboard\service\impl\MesProductionDataServiceImpl.java
E:\桌面\scada-visual-board\productionboard\src\main\java\com\productionboard\mapper\AluminumThisMonthEnergyMapper.java
E:\桌面\scada-visual-board\productionboard\src\main\java\com\productionboard\service\IMesProductionDataService.java
E:\桌面\scada-visual-board\productionboard\src\main\java\com\productionboard\controller\AluminumTtankController.java
E:\桌面\scada-visual-board\productionboard\src\main\java\com\productionboard\entity\AluminumDevice\AluminumLossStatistics.java
E:\桌面\scada-visual-board\productionboard\src\main\java\com\productionboard\entity\TankShellDevice\TankShellOeeStatistics.java
E:\桌面\scada-visual-board\productionboard\src\main\java\com\productionboard\entity\TankShellDevice\TankShellEnergyConsumption.java
E:\桌面\scada-visual-board\productionboard\src\main\java\com\productionboard\controller\TankShellController.java
E:\桌面\scada-visual-board\productionboard\src\main\java\com\productionboard\mapper\AluminumLossStatisticsMapper.java
E:\桌面\scada-visual-board\productionboard\src\main\java\com\productionboard\mapper\MesMaterialProductionStatisticsMapper.java
E:\桌面\scada-visual-board\productionboard\src\main\java\com\productionboard\entity\AluminumDevice\AluminumDeviceDataInformation.java
E:\桌面\scada-visual-board\productionboard\src\main\java\com\productionboard\service\BasicScadaDeviceinfoService.java

Loading…
Cancel
Save