add - 箱壳设备看板产量能耗对比接口

master
wenjy 3 years ago
parent f994c24e30
commit c4e6253589

@ -14,7 +14,7 @@
<bytecodeTargetLevel>
<module name="deviceboard" target="8" />
<module name="productionboard" target="8" />
<module name="visualboard" target="1.5" />
<module name="visualboard" target="1.8" />
</bytecodeTargetLevel>
</component>
<component name="JavacSettings">

@ -15,8 +15,8 @@
</facet>
</component>
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
<output url="file://$MODULE_DIR$/${project.build.directory}/classes" />
<output-test url="file://$MODULE_DIR$/${project.build.directory}/test-classes" />
<output url="file://$MODULE_DIR$/target/classes" />
<output-test url="file://$MODULE_DIR$/target/test-classes" />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />

@ -15,8 +15,8 @@
</facet>
</component>
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
<output url="file://$MODULE_DIR$/${project.build.directory}/classes" />
<output-test url="file://$MODULE_DIR$/${project.build.directory}/test-classes" />
<output url="file://$MODULE_DIR$/target/classes" />
<output-test url="file://$MODULE_DIR$/target/test-classes" />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />

@ -1,8 +1,11 @@
package com.productionboard.controller;
import com.productionboard.service.ITankShellDeviceInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
/**
* 线
@ -12,10 +15,28 @@ import org.springframework.web.bind.annotation.RequestMapping;
@Controller
@RequestMapping("/tankShellDevice")
public class TankShellDeviceController {
@Autowired
private ITankShellDeviceInfoService iTankShellDeviceInfoService;
private String prefix = "tankShell/device";
@GetMapping()
public String index() {
return prefix;
}
/**
*
* @author WenJY
* @date 2022-06-08 18:01
* @return java.lang.String
*/
@GetMapping("/getEnergyConsumption")
@ResponseBody
public String getEnergyConsumption(){
String energyConsumptionJson = iTankShellDeviceInfoService.getEnergyConsumptionJson();
System.out.println("打印JSON"+energyConsumptionJson);
return energyConsumptionJson;
}
}

@ -0,0 +1,33 @@
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 20220608 18:02
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("SCADA_UK_DEVICEINFO_1")
public class TankShellEnergyConsumption implements Serializable {
@TableField("production")
private String production;
@TableField("hourenergy")
private String energy;
@TableField(exist = false)
private String xValue;
@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.TankShellEnergyConsumption;
import org.apache.ibatis.annotations.Mapper;
/**
* @author WenJY
* @date 20220608 18:05
*/
@Mapper
public interface TankShellEnergyConsumptionMapper extends BaseMapper<TankShellEnergyConsumption> {
}

@ -0,0 +1,17 @@
package com.productionboard.service;
/**
*
* @author WenJY
* @date 20220608 18:05
*/
public interface ITankShellDeviceInfoService {
/**
* JSON
* @author WenJY
* @date 2022-06-08 18:06
* @return java.lang.String
*/
public String getEnergyConsumptionJson();
}

@ -0,0 +1,46 @@
package com.productionboard.service.impl;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.productionboard.entity.TankShellDevice.TankShellEnergyConsumption;
import com.productionboard.mapper.TankShellEnergyConsumptionMapper;
import com.productionboard.service.ITankShellDeviceInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.text.SimpleDateFormat;
import java.util.List;
/**
* @author WenJY
* @date 20220608 18:06
*/
@Service
public class TankShellDeviceInfoServiceImpl implements ITankShellDeviceInfoService {
@Autowired
private TankShellEnergyConsumptionMapper tankShellEnergyConsumptionMapper;
private SimpleDateFormat dateFormat = new SimpleDateFormat("MM-dd");
@Override
public String getEnergyConsumptionJson() {
List<TankShellEnergyConsumption> tankShellEnergyConsumptions = tankShellEnergyConsumptionMapper.selectList(null);
JSONObject jsonObject = new JSONObject();
if(tankShellEnergyConsumptions.size() > 0){
String[] productionArray = new String[tankShellEnergyConsumptions.size()];
String[] energyArray = new String[tankShellEnergyConsumptions.size()];
String[] xValueArray = new String[tankShellEnergyConsumptions.size()];
for (int i = 0;i< tankShellEnergyConsumptions.size();i++){
productionArray[i] = tankShellEnergyConsumptions.get(i).getEnergy();
energyArray[i] = tankShellEnergyConsumptions.get(i).getEnergy();
xValueArray[i] = dateFormat.format(tankShellEnergyConsumptions.get(i).getCreateTime());
}
jsonObject.put("productionArray",productionArray);
jsonObject.put("energyArray",energyArray);
jsonObject.put("xValueArray",xValueArray);
}
return JSONArray.toJSONString(jsonObject);
}
}

@ -1,27 +1,27 @@
C:\Users\ADMIN\Desktop\visualboard\productionboard\src\main\java\com\productionboard\controller\AdsorptionTankController.java
C:\Users\ADMIN\Desktop\visualboard\productionboard\src\main\java\com\productionboard\mapper\AluminumThisMonthEnergyMapper.java
C:\Users\ADMIN\Desktop\visualboard\productionboard\src\main\java\com\productionboard\controller\TankShellDeviceController.java
C:\Users\ADMIN\Desktop\visualboard\productionboard\src\main\java\com\productionboard\mapper\AluminumLossStatisticsMapper.java
C:\Users\ADMIN\Desktop\visualboard\productionboard\src\main\java\com\productionboard\entity\AluminumDevice\AluminumThisMonthEnergy.java
C:\Users\ADMIN\Desktop\visualboard\productionboard\src\main\java\com\productionboard\controller\FoamBoxController.java
C:\Users\ADMIN\Desktop\visualboard\productionboard\src\main\java\com\productionboard\controller\AluminumLinerkController.java
C:\Users\ADMIN\Desktop\visualboard\productionboard\src\main\java\com\productionboard\ProductionBoardApplication.java
C:\Users\ADMIN\Desktop\visualboard\productionboard\src\main\java\com\productionboard\controller\PreassembleController.java
C:\Users\ADMIN\Desktop\visualboard\productionboard\src\main\java\com\productionboard\entity\AluminumDevice\AluminumOeeStatistics.java
C:\Users\ADMIN\Desktop\visualboard\productionboard\src\main\java\com\productionboard\mapper\AluminumDeviceDataInformationMapper.java
C:\Users\ADMIN\Desktop\visualboard\productionboard\src\main\java\com\productionboard\service\IAluminumDeviceInfoService.java
C:\Users\ADMIN\Desktop\visualboard\productionboard\src\main\java\com\productionboard\entity\BasicScadaDeviceinfo.java
C:\Users\ADMIN\Desktop\visualboard\productionboard\src\main\java\com\productionboard\mapper\AluminumYesterdayEnergyMapper.java
C:\Users\ADMIN\Desktop\visualboard\productionboard\src\main\java\com\productionboard\controller\TankShellController.java
C:\Users\ADMIN\Desktop\visualboard\productionboard\src\main\java\com\productionboard\controller\AluminumTtankController.java
C:\Users\ADMIN\Desktop\visualboard\productionboard\src\main\java\com\productionboard\entity\AluminumDevice\AluminumYesterdayEnergy.java
C:\Users\ADMIN\Desktop\visualboard\productionboard\src\main\java\com\productionboard\service\impl\AluminumDeviceInfoServiceImpl.java
C:\Users\ADMIN\Desktop\visualboard\productionboard\src\main\java\com\productionboard\controller\StorageController.java
C:\Users\ADMIN\Desktop\visualboard\productionboard\src\main\java\com\productionboard\mapper\AluminumOeeStatisticsMapper.java
C:\Users\ADMIN\Desktop\visualboard\productionboard\src\main\java\com\productionboard\entity\AluminumDevice\AluminumLossStatistics.java
C:\Users\ADMIN\Desktop\visualboard\productionboard\src\main\java\com\productionboard\mapper\BasicScadaDeviceinfoMapper.java
C:\Users\ADMIN\Desktop\visualboard\productionboard\src\main\java\com\productionboard\service\BasicScadaDeviceinfoService.java
C:\Users\ADMIN\Desktop\visualboard\productionboard\src\main\java\com\productionboard\common\CodeGenerator.java
C:\Users\ADMIN\Desktop\visualboard\productionboard\src\main\java\com\productionboard\service\impl\BasicScadaDeviceinfoServiceImpl.java
C:\Users\ADMIN\Desktop\visualboard\productionboard\src\main\java\com\productionboard\config\MybatisPlusConfig.java
C:\Users\ADMIN\Desktop\visualboard\productionboard\src\main\java\com\productionboard\entity\AluminumDevice\AluminumDeviceDataInformation.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\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\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\AluminumOeeStatisticsMapper.java
E:\桌面\scada-visual-board\productionboard\src\main\java\com\productionboard\mapper\BasicScadaDeviceinfoMapper.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\AluminumDevice\AluminumThisMonthEnergy.java
E:\桌面\scada-visual-board\productionboard\src\main\java\com\productionboard\controller\TankShellDeviceController.java
E:\桌面\scada-visual-board\productionboard\src\main\java\com\productionboard\service\IAluminumDeviceInfoService.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\impl\BasicScadaDeviceinfoServiceImpl.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\service\impl\AluminumDeviceInfoServiceImpl.java
E:\桌面\scada-visual-board\productionboard\src\main\java\com\productionboard\controller\TankShellController.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\controller\PreassembleController.java
E:\桌面\scada-visual-board\productionboard\src\main\java\com\productionboard\mapper\AluminumLossStatisticsMapper.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

@ -14,9 +14,9 @@
<configuration />
</facet>
</component>
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_5">
<output url="file://$MODULE_DIR$/${project.build.directory}/classes" />
<output-test url="file://$MODULE_DIR$/${project.build.directory}/test-classes" />
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
<output url="file://$MODULE_DIR$/target/classes" />
<output-test url="file://$MODULE_DIR$/target/test-classes" />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />

Loading…
Cancel
Save