change - 箱壳成型数据监控平台添加能耗曲线

master
wenjy 2 years ago
parent b2ef9d6cfe
commit 2780abae8a

@ -24,7 +24,7 @@ public class TankShellEnergyConsumption implements Serializable {
private String production; private String production;
@TableField("hourenergy") @TableField("hourenergy")
private String energy; private String hourenergy;
@TableField(exist = false) @TableField(exist = false)
private String xValue; private String xValue;

@ -20,7 +20,7 @@ public interface TankShellEnergyConsumptionMapper extends BaseMapper<TankShellEn
* @param in_id * @param in_id
* @return * @return
*/ */
@Select("select * from table ( scada_tank_shell_energy_new(#{in_id}) )") @Select("select production,hourenergy,createtime from table ( scada_tank_shell_energy_new(#{in_id}) )")
List<TankShellEnergyConsumption> getTankShellEnergyConsumptions(@Param("in_id") Integer in_id); List<TankShellEnergyConsumption> getTankShellEnergyConsumptions(@Param("in_id") Integer in_id);
/** /**
@ -28,6 +28,6 @@ public interface TankShellEnergyConsumptionMapper extends BaseMapper<TankShellEn
* @param in_id * @param in_id
* @return * @return
*/ */
@Select("select * from table ( scada_tank_yesterday_energies(#{in_id}) )") @Select("select production,energy as hourenergy,createtime from table ( scada_tank_yesterday_energies(#{in_id}) )")
List<TankShellEnergyConsumption> getTankShellYesterdayEnergies(@Param("in_id") Integer in_id); List<TankShellEnergyConsumption> getTankShellYesterdayEnergies(@Param("in_id") Integer in_id);
} }

@ -116,7 +116,7 @@ public class TankShellDeviceInfoServiceImpl implements ITankShellDeviceInfoServi
List<TankShellEnergyConsumption> tankShellYesterdayEnergies = tankShellEnergyConsumptionMapper.getTankShellYesterdayEnergies(in_id); 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).getHourenergy():"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";
@ -208,14 +208,16 @@ public class TankShellDeviceInfoServiceImpl implements ITankShellDeviceInfoServi
for (int i = 0;i< tankShellEnergyConsumptions.size();i++){ for (int i = 0;i< tankShellEnergyConsumptions.size();i++){
productionArray[i] = tankShellEnergyConsumptions.get(i).getProduction(); productionArray[i] = tankShellEnergyConsumptions.get(i).getProduction();
energyArray[i] = tankShellEnergyConsumptions.get(i).getEnergy(); energyArray[i] = tankShellEnergyConsumptions.get(i).getHourenergy();
xValueArray[i] = dateFormat.format(tankShellEnergyConsumptions.get(i).getCreateTime()); xValueArray[i] = dateFormat.format(tankShellEnergyConsumptions.get(i).getCreateTime());
} }
jsonObject.put("productionArray",productionArray); jsonObject.put("productionArray",productionArray);
jsonObject.put("energyArray",energyArray); jsonObject.put("energyArray",energyArray);
jsonObject.put("xValueArray",xValueArray); jsonObject.put("xValueArray",xValueArray);
} }
return JSONArray.toJSONString(jsonObject); String s = JSONArray.toJSONString(jsonObject);
System.out.println("能耗产量数据:"+s);
return s;
} }
@Override @Override

@ -2293,8 +2293,15 @@ const energyConsumption = (res, ids) => {
} }
}, },
lineStyle: { lineStyle: {
color: '#45b685' color: '#0066FF'
}, },
/*label: {
show: true,
position: "buttom",
textStyle: {
color: "#0066FF",
},
},*/
data: yAxisDataTwo, data: yAxisDataTwo,
}, },
{ {

@ -12,6 +12,6 @@ mybatis-plus:
mapper-locations: classpath*:/mapper/**Mapper.xml mapper-locations: classpath*:/mapper/**Mapper.xml
server: server:
port: 6070 port: 6069
in_id: 2 in_id: 1

@ -7,8 +7,8 @@ $(() => {
if (result.length > 0) { if (result.length > 0) {
if(result[0].deviceEnergy > 0){ if(result[0].deviceEnergy > 0){
statusArray[0] = result[0].deviceStatus == "正常" ? "1" : "0"; statusArray[0] = result[0].deviceStatus == "正常" ? "1" : "0";
statusArray[1] = test(result[0].devicePower,1000); statusArray[1] = result[0].devicePower;
statusArray[2] = test(result[0].deviceEnergy,100); statusArray[2] = result[0].deviceEnergy;
statusArray[3] = result[0].count; statusArray[3] = result[0].count;
dataInformationFunction(statusArray); dataInformationFunction(statusArray);
} }

Loading…
Cancel
Save