shi'sen'yuan 3 jaren geleden
bovenliggende
commit
3ce7557e8a

+ 0 - 1
master/src/main/java/com/ruoyi/project/aspen/controller/TDashboarddataController.java

@@ -52,7 +52,6 @@ public class TDashboarddataController extends BaseController
     public AjaxResult selectLast(TDashboarddata tDashboarddata)
     {
         TDashboarddata dashboarddata = tDashboarddataService.selectLast(tDashboarddata);
-//        logger.info("dashboarddata:" + dashboarddata);
         return AjaxResult.success(dashboarddata);
     }
 

+ 103 - 0
master/src/main/java/com/ruoyi/project/aspen/controller/TDashboarddayController.java

@@ -0,0 +1,103 @@
+package com.ruoyi.project.aspen.controller;
+
+import java.util.List;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.ruoyi.framework.aspectj.lang.annotation.Log;
+import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
+import com.ruoyi.project.aspen.domain.TDashboardday;
+import com.ruoyi.project.aspen.service.ITDashboarddayService;
+import com.ruoyi.framework.web.controller.BaseController;
+import com.ruoyi.framework.web.domain.AjaxResult;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.framework.web.page.TableDataInfo;
+
+/**
+ * DASHBOARD每日抓取数据Controller
+ *
+ * @author ruoyi
+ * @date 2022-02-11
+ */
+@RestController
+@RequestMapping("/aspen/dashboardday")
+public class TDashboarddayController extends BaseController
+{
+    @Autowired
+    private ITDashboarddayService tDashboarddayService;
+
+    /**
+     * 查询DASHBOARD每日抓取数据列表
+     */
+    @PreAuthorize("@ss.hasPermi('aspen:dashboardday:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(TDashboardday tDashboardday)
+    {
+        startPage();
+        List<TDashboardday> list = tDashboarddayService.selectTDashboarddayList(tDashboardday);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出DASHBOARD每日抓取数据列表
+     */
+    @PreAuthorize("@ss.hasPermi('aspen:dashboardday:export')")
+    @Log(title = "DASHBOARD每日抓取数据", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(TDashboardday tDashboardday)
+    {
+        List<TDashboardday> list = tDashboarddayService.selectTDashboarddayList(tDashboardday);
+        ExcelUtil<TDashboardday> util = new ExcelUtil<TDashboardday>(TDashboardday.class);
+        return util.exportExcel(list, "dashboardday");
+    }
+
+    /**
+     * 获取DASHBOARD每日抓取数据详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('aspen:dashboardday:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return AjaxResult.success(tDashboarddayService.selectTDashboarddayById(id));
+    }
+
+    /**
+     * 新增DASHBOARD每日抓取数据
+     */
+    @PreAuthorize("@ss.hasPermi('aspen:dashboardday:add')")
+    @Log(title = "DASHBOARD每日抓取数据", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody TDashboardday tDashboardday)
+    {
+        return toAjax(tDashboarddayService.insertTDashboardday(tDashboardday));
+    }
+
+    /**
+     * 修改DASHBOARD每日抓取数据
+     */
+    @PreAuthorize("@ss.hasPermi('aspen:dashboardday:edit')")
+    @Log(title = "DASHBOARD每日抓取数据", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody TDashboardday tDashboardday)
+    {
+        return toAjax(tDashboarddayService.updateTDashboardday(tDashboardday));
+    }
+
+    /**
+     * 删除DASHBOARD每日抓取数据
+     */
+    @PreAuthorize("@ss.hasPermi('aspen:dashboardday:remove')")
+    @Log(title = "DASHBOARD每日抓取数据", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(tDashboarddayService.deleteTDashboarddayByIds(ids));
+    }
+}

+ 195 - 0
master/src/main/java/com/ruoyi/project/aspen/domain/TDashboardday.java

@@ -0,0 +1,195 @@
+package com.ruoyi.project.aspen.domain;
+
+import java.util.Date;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.ruoyi.framework.aspectj.lang.annotation.Excel;
+import com.ruoyi.framework.web.domain.BaseEntity;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+
+/**
+ * DASHBOARD每日抓取数据对象 t_dashboardday
+ *
+ * @author ruoyi
+ * @date 2022-02-11
+ */
+public class TDashboardday extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 唯一标识ID */
+    private Long id;
+
+    /** 删除状态 */
+    private Long delFlag;
+
+    /** 创建人 */
+    @Excel(name = "创建人")
+    private String createrCode;
+
+    /** 抓取时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd" , timezone = "GMT+8")
+    @Excel(name = "抓取时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date createdate;
+
+    /** 修改人 */
+    @Excel(name = "修改人")
+    private String updaterCode;
+
+    /** 修改时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd" , timezone = "GMT+8")
+    @Excel(name = "修改时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date updatedate;
+
+    /** 前日产量 C2H4 */
+    @Excel(name = "前日产量 C2H4")
+    private String dailyYixi;
+
+    /** 前日产量C3H6 */
+    @Excel(name = "前日产量C3H6")
+    private String dailyBingxi;
+
+    /** 加工损失率 */
+    @Excel(name = "加工损失率")
+    private String lossRate;
+
+    /** 每日能耗 */
+    @Excel(name = "每日能耗")
+    private String energyConsumption;
+
+    /** 产品产量 */
+    @Excel(name = "产品产量")
+    private String productPutput;
+
+    /** 数据日期 */
+    @JsonFormat(pattern = "yyyy-MM-dd" , timezone = "GMT+8")
+    @Excel(name = "数据日期", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date dataDate;
+
+    public void setId(Long id)
+    {
+        this.id = id;
+    }
+
+    public Long getId()
+    {
+        return id;
+    }
+    public void setDelFlag(Long delFlag)
+    {
+        this.delFlag = delFlag;
+    }
+
+    public Long getDelFlag()
+    {
+        return delFlag;
+    }
+    public void setCreaterCode(String createrCode)
+    {
+        this.createrCode = createrCode;
+    }
+
+    public String getCreaterCode()
+    {
+        return createrCode;
+    }
+    public void setCreatedate(Date createdate)
+    {
+        this.createdate = createdate;
+    }
+
+    public Date getCreatedate()
+    {
+        return createdate;
+    }
+    public void setUpdaterCode(String updaterCode)
+    {
+        this.updaterCode = updaterCode;
+    }
+
+    public String getUpdaterCode()
+    {
+        return updaterCode;
+    }
+    public void setUpdatedate(Date updatedate)
+    {
+        this.updatedate = updatedate;
+    }
+
+    public Date getUpdatedate()
+    {
+        return updatedate;
+    }
+    public void setDailyYixi(String dailyYixi)
+    {
+        this.dailyYixi = dailyYixi;
+    }
+
+    public String getDailyYixi()
+    {
+        return dailyYixi;
+    }
+    public void setDailyBingxi(String dailyBingxi)
+    {
+        this.dailyBingxi = dailyBingxi;
+    }
+
+    public String getDailyBingxi()
+    {
+        return dailyBingxi;
+    }
+    public void setLossRate(String lossRate)
+    {
+        this.lossRate = lossRate;
+    }
+
+    public String getLossRate()
+    {
+        return lossRate;
+    }
+    public void setEnergyConsumption(String energyConsumption)
+    {
+        this.energyConsumption = energyConsumption;
+    }
+
+    public String getEnergyConsumption()
+    {
+        return energyConsumption;
+    }
+    public void setProductPutput(String productPutput)
+    {
+        this.productPutput = productPutput;
+    }
+
+    public String getProductPutput()
+    {
+        return productPutput;
+    }
+    public void setDataDate(Date dataDate)
+    {
+        this.dataDate = dataDate;
+    }
+
+    public Date getDataDate()
+    {
+        return dataDate;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("delFlag", getDelFlag())
+            .append("createrCode", getCreaterCode())
+            .append("createdate", getCreatedate())
+            .append("updaterCode", getUpdaterCode())
+            .append("updatedate", getUpdatedate())
+            .append("dailyYixi", getDailyYixi())
+            .append("dailyBingxi", getDailyBingxi())
+            .append("lossRate", getLossRate())
+            .append("energyConsumption", getEnergyConsumption())
+            .append("productPutput", getProductPutput())
+            .append("dataDate", getDataDate())
+            .toString();
+    }
+}

+ 63 - 0
master/src/main/java/com/ruoyi/project/aspen/mapper/TDashboarddayMapper.java

@@ -0,0 +1,63 @@
+package com.ruoyi.project.aspen.mapper;
+
+import java.util.List;
+import com.ruoyi.framework.aspectj.lang.annotation.DataScope;
+import com.ruoyi.project.aspen.domain.TDashboardday;
+
+/**
+ * DASHBOARD每日抓取数据Mapper接口
+ * 
+ * @author ruoyi
+ * @date 2022-02-11
+ */
+public interface TDashboarddayMapper 
+{
+    /**
+     * 查询DASHBOARD每日抓取数据
+     * 
+     * @param id DASHBOARD每日抓取数据ID
+     * @return DASHBOARD每日抓取数据
+     */
+    public TDashboardday selectTDashboarddayById(Long id);
+
+    /**
+     * 查询DASHBOARD每日抓取数据列表
+     * 
+     * @param tDashboardday DASHBOARD每日抓取数据
+     * @return DASHBOARD每日抓取数据集合
+     */
+    @DataScope(deptAlias = "d")
+    public List<TDashboardday> selectTDashboarddayList(TDashboardday tDashboardday);
+
+    /**
+     * 新增DASHBOARD每日抓取数据
+     * 
+     * @param tDashboardday DASHBOARD每日抓取数据
+     * @return 结果
+     */
+    public int insertTDashboardday(TDashboardday tDashboardday);
+
+    /**
+     * 修改DASHBOARD每日抓取数据
+     * 
+     * @param tDashboardday DASHBOARD每日抓取数据
+     * @return 结果
+     */
+    public int updateTDashboardday(TDashboardday tDashboardday);
+
+    /**
+     * 删除DASHBOARD每日抓取数据
+     * 
+     * @param id DASHBOARD每日抓取数据ID
+     * @return 结果
+     */
+    public int deleteTDashboarddayById(Long id);
+
+    /**
+     * 批量删除DASHBOARD每日抓取数据
+     * 
+     * @param ids 需要删除的数据ID
+     * @return 结果
+     */
+    public int deleteTDashboarddayByIds(Long[] ids);
+}

+ 61 - 0
master/src/main/java/com/ruoyi/project/aspen/service/ITDashboarddayService.java

@@ -0,0 +1,61 @@
+package com.ruoyi.project.aspen.service;
+
+import java.util.List;
+import com.ruoyi.project.aspen.domain.TDashboardday;
+
+/**
+ * DASHBOARD每日抓取数据Service接口
+ * 
+ * @author ruoyi
+ * @date 2022-02-11
+ */
+public interface ITDashboarddayService 
+{
+    /**
+     * 查询DASHBOARD每日抓取数据
+     * 
+     * @param id DASHBOARD每日抓取数据ID
+     * @return DASHBOARD每日抓取数据
+     */
+    public TDashboardday selectTDashboarddayById(Long id);
+
+    /**
+     * 查询DASHBOARD每日抓取数据列表
+     * 
+     * @param tDashboardday DASHBOARD每日抓取数据
+     * @return DASHBOARD每日抓取数据集合
+     */
+    public List<TDashboardday> selectTDashboarddayList(TDashboardday tDashboardday);
+
+    /**
+     * 新增DASHBOARD每日抓取数据
+     * 
+     * @param tDashboardday DASHBOARD每日抓取数据
+     * @return 结果
+     */
+    public int insertTDashboardday(TDashboardday tDashboardday);
+
+    /**
+     * 修改DASHBOARD每日抓取数据
+     * 
+     * @param tDashboardday DASHBOARD每日抓取数据
+     * @return 结果
+     */
+    public int updateTDashboardday(TDashboardday tDashboardday);
+
+    /**
+     * 批量删除DASHBOARD每日抓取数据
+     * 
+     * @param ids 需要删除的DASHBOARD每日抓取数据ID
+     * @return 结果
+     */
+    public int deleteTDashboarddayByIds(Long[] ids);
+
+    /**
+     * 删除DASHBOARD每日抓取数据信息
+     * 
+     * @param id DASHBOARD每日抓取数据ID
+     * @return 结果
+     */
+    public int deleteTDashboarddayById(Long id);
+}

+ 93 - 0
master/src/main/java/com/ruoyi/project/aspen/service/impl/TDashboarddayServiceImpl.java

@@ -0,0 +1,93 @@
+package com.ruoyi.project.aspen.service.impl;
+
+import java.util.List;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.ruoyi.project.aspen.mapper.TDashboarddayMapper;
+import com.ruoyi.project.aspen.domain.TDashboardday;
+import com.ruoyi.project.aspen.service.ITDashboarddayService;
+
+/**
+ * DASHBOARD每日抓取数据Service业务层处理
+ *
+ * @author ruoyi
+ * @date 2022-02-11
+ */
+@Service
+public class TDashboarddayServiceImpl implements ITDashboarddayService
+{
+    @Autowired
+    private TDashboarddayMapper tDashboarddayMapper;
+
+    /**
+     * 查询DASHBOARD每日抓取数据
+     *
+     * @param id DASHBOARD每日抓取数据ID
+     * @return DASHBOARD每日抓取数据
+     */
+    @Override
+    public TDashboardday selectTDashboarddayById(Long id)
+    {
+        return tDashboarddayMapper.selectTDashboarddayById(id);
+    }
+
+    /**
+     * 查询DASHBOARD每日抓取数据列表
+     *
+     * @param tDashboardday DASHBOARD每日抓取数据
+     * @return DASHBOARD每日抓取数据
+     */
+    @Override
+    public List<TDashboardday> selectTDashboarddayList(TDashboardday tDashboardday)
+    {
+        return tDashboarddayMapper.selectTDashboarddayList(tDashboardday);
+    }
+
+    /**
+     * 新增DASHBOARD每日抓取数据
+     *
+     * @param tDashboardday DASHBOARD每日抓取数据
+     * @return 结果
+     */
+    @Override
+    public int insertTDashboardday(TDashboardday tDashboardday)
+    {
+        return tDashboarddayMapper.insertTDashboardday(tDashboardday);
+    }
+
+    /**
+     * 修改DASHBOARD每日抓取数据
+     *
+     * @param tDashboardday DASHBOARD每日抓取数据
+     * @return 结果
+     */
+    @Override
+    public int updateTDashboardday(TDashboardday tDashboardday)
+    {
+        return tDashboarddayMapper.updateTDashboardday(tDashboardday);
+    }
+
+    /**
+     * 批量删除DASHBOARD每日抓取数据
+     *
+     * @param ids 需要删除的DASHBOARD每日抓取数据ID
+     * @return 结果
+     */
+    @Override
+    public int deleteTDashboarddayByIds(Long[] ids)
+    {
+        return tDashboarddayMapper.deleteTDashboarddayByIds(ids);
+    }
+
+    /**
+     * 删除DASHBOARD每日抓取数据信息
+     *
+     * @param id DASHBOARD每日抓取数据ID
+     * @return 结果
+     */
+    @Override
+    public int deleteTDashboarddayById(Long id)
+    {
+        return tDashboarddayMapper.deleteTDashboarddayById(id);
+    }
+}

+ 116 - 0
master/src/main/resources/mybatis/aspen/TDashboarddayMapper.xml

@@ -0,0 +1,116 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.ruoyi.project.aspen.mapper.TDashboarddayMapper">
+    
+    <resultMap type="TDashboardday" id="TDashboarddayResult">
+        <result property="id"    column="id"    />
+        <result property="delFlag"    column="del_flag"    />
+        <result property="createrCode"    column="creater_code"    />
+        <result property="createdate"    column="createdate"    />
+        <result property="updaterCode"    column="updater_code"    />
+        <result property="updatedate"    column="updatedate"    />
+        <result property="dailyYixi"    column="daily_yixi"    />
+        <result property="dailyBingxi"    column="daily_bingxi"    />
+        <result property="lossRate"    column="loss_rate"    />
+        <result property="energyConsumption"    column="energy_consumption"    />
+        <result property="productPutput"    column="product_putput"    />
+        <result property="dataDate"    column="data_date"    />
+        <result property="deptName" column="dept_name" />
+    </resultMap>
+
+    <sql id="selectTDashboarddayVo">
+        select d.id, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.daily_yixi, d.daily_bingxi, d.loss_rate, d.energy_consumption, d.product_putput, d.data_date ,s.dept_name from t_dashboardday d
+      left join sys_dept s on s.dept_id = d.dept_id
+    </sql>
+
+    <select id="selectTDashboarddayList" parameterType="TDashboardday" resultMap="TDashboarddayResult">
+        <include refid="selectTDashboarddayVo"/>
+        <where>  
+            <if test="createrCode != null  and createrCode != ''"> and creater_code = #{createrCode}</if>
+            <if test="createdate != null "> and createdate = #{createdate}</if>
+            <if test="updaterCode != null  and updaterCode != ''"> and updater_code = #{updaterCode}</if>
+            <if test="updatedate != null "> and updatedate = #{updatedate}</if>
+            <if test="dailyYixi != null  and dailyYixi != ''"> and daily_yixi = #{dailyYixi}</if>
+            <if test="dailyBingxi != null  and dailyBingxi != ''"> and daily_bingxi = #{dailyBingxi}</if>
+            <if test="lossRate != null  and lossRate != ''"> and loss_rate = #{lossRate}</if>
+            <if test="energyConsumption != null  and energyConsumption != ''"> and energy_consumption = #{energyConsumption}</if>
+            <if test="productPutput != null  and productPutput != ''"> and product_putput = #{productPutput}</if>
+            <if test="dataDate != null "> and data_date = #{dataDate}</if>
+            and d.del_flag = 0
+        </where>
+        <!-- 数据范围过滤 -->
+        ${params.dataScope}
+    </select>
+    
+    <select id="selectTDashboarddayById" parameterType="Long" resultMap="TDashboarddayResult">
+        <include refid="selectTDashboarddayVo"/>
+        where id = #{id}
+    </select>
+        
+    <insert id="insertTDashboardday" parameterType="TDashboardday">
+        <selectKey keyProperty="id" resultType="long" order="BEFORE">
+            SELECT seq_t_dashboardday.NEXTVAL as id FROM DUAL
+        </selectKey>
+        insert into t_dashboardday
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="id != null">id,</if>
+            <if test="delFlag != null">del_flag,</if>
+            <if test="createrCode != null">creater_code,</if>
+            <if test="createdate != null">createdate,</if>
+            <if test="updaterCode != null">updater_code,</if>
+            <if test="updatedate != null">updatedate,</if>
+            <if test="dailyYixi != null">daily_yixi,</if>
+            <if test="dailyBingxi != null">daily_bingxi,</if>
+            <if test="lossRate != null">loss_rate,</if>
+            <if test="energyConsumption != null">energy_consumption,</if>
+            <if test="productPutput != null">product_putput,</if>
+            <if test="dataDate != null">data_date,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="id != null">#{id},</if>
+            <if test="delFlag != null">#{delFlag},</if>
+            <if test="createrCode != null">#{createrCode},</if>
+            <if test="createdate != null">#{createdate},</if>
+            <if test="updaterCode != null">#{updaterCode},</if>
+            <if test="updatedate != null">#{updatedate},</if>
+            <if test="dailyYixi != null">#{dailyYixi},</if>
+            <if test="dailyBingxi != null">#{dailyBingxi},</if>
+            <if test="lossRate != null">#{lossRate},</if>
+            <if test="energyConsumption != null">#{energyConsumption},</if>
+            <if test="productPutput != null">#{productPutput},</if>
+            <if test="dataDate != null">#{dataDate},</if>
+         </trim>
+    </insert>
+
+    <update id="updateTDashboardday" parameterType="TDashboardday">
+        update t_dashboardday
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="delFlag != null">del_flag = #{delFlag},</if>
+            <if test="createrCode != null">creater_code = #{createrCode},</if>
+            <if test="createdate != null">createdate = #{createdate},</if>
+            <if test="updaterCode != null">updater_code = #{updaterCode},</if>
+            <if test="updatedate != null">updatedate = #{updatedate},</if>
+            <if test="dailyYixi != null">daily_yixi = #{dailyYixi},</if>
+            <if test="dailyBingxi != null">daily_bingxi = #{dailyBingxi},</if>
+            <if test="lossRate != null">loss_rate = #{lossRate},</if>
+            <if test="energyConsumption != null">energy_consumption = #{energyConsumption},</if>
+            <if test="productPutput != null">product_putput = #{productPutput},</if>
+            <if test="dataDate != null">data_date = #{dataDate},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <update id="deleteTDashboarddayById" parameterType="Long">
+        update t_dashboardday set del_flag = 2 where id = #{id}
+    </update>
+
+    <update id="deleteTDashboarddayByIds" parameterType="String">
+        update t_dashboardday set del_flag = 2 where id in
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </update>
+    
+</mapper>

+ 53 - 0
ui/src/api/aspen/dashboardday.js

@@ -0,0 +1,53 @@
+import request from '@/utils/request'
+
+// 查询DASHBOARD每日抓取数据列表
+export function listDashboardday(query) {
+  return request({
+    url: '/aspen/dashboardday/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询DASHBOARD每日抓取数据详细
+export function getDashboardday(id) {
+  return request({
+    url: '/aspen/dashboardday/' + id,
+    method: 'get'
+  })
+}
+
+// 新增DASHBOARD每日抓取数据
+export function addDashboardday(data) {
+  return request({
+    url: '/aspen/dashboardday',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改DASHBOARD每日抓取数据
+export function updateDashboardday(data) {
+  return request({
+    url: '/aspen/dashboardday',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除DASHBOARD每日抓取数据
+export function delDashboardday(id) {
+  return request({
+    url: '/aspen/dashboardday/' + id,
+    method: 'delete'
+  })
+}
+
+// 导出DASHBOARD每日抓取数据
+export function exportDashboardday(query) {
+  return request({
+    url: '/aspen/dashboardday/export',
+    method: 'get',
+    params: query
+  })
+}

+ 0 - 27
ui/src/views/dashboard/LossrateChart.vue

@@ -25,27 +25,12 @@
   },
   data() {
     return {
-      //显示表格数据
-      chartsList1: [],
-      chartsList2: [],
       // 查询参数
       queryParams: {
-        item: 4,
-        year: 2020
-      },
-      // 获取当前年份
-      searchFormField: {
-        year: this.getNowTime(),
       },
       chart: null
     }
   },
-  watch: {
-    year(newValue, oldValue) {
-      this.queryParams.year = newValue
-      this.getList()
-    }
-  },
   beforeDestroy() {
     if (!this.chart) {
       return
@@ -55,27 +40,15 @@
   },
   mounted() {
     this.$nextTick(() => {
-      /*this.queryParams.year = this.searchFormField.year;*/
       this.getList()
     })
   },
   methods: {
     getList() {
       listMonthplan(this.queryParams).then(response => {
-        this.chartsList1 = response.rows[0];
-        this.chartsList2 = response.rows[1];
-        this.chartsList3 = response.rows[2];
         this.initChart()
       });
     },
-    /** 获取当前年份 */
-    getNowTime() {
-      var now = new Date();
-      var year = now.getFullYear(); //得到年份
-      var defaultDate = `${year}`;
-      return defaultDate;
-      this.$set(this.searchFormField, "year", defaultDate);
-    },
     initChart() {
       // 基于准备好的dom,初始化echarts实例
       this.chart = this.echarts.init(document.getElementById('LossrateChart'))

+ 57 - 14
ui/src/views/dashboard/productProportion.vue

@@ -6,18 +6,61 @@
 
 <script>
 import resize from "./mixins/resize";
+import { selectLast } from "@/api/aspen/dashboarddata";
 
 export default {
   data() {
     return {
-      chart: null
+      chart: null,
+      // dashboard抓取数据
+      dashboarddata: {
+        energyYixi: null,
+        energyBingxi: null,
+        energyQingqi: null,
+        energyJiawan: null,
+        energyCsi: null,
+        energyBenzene: null,
+        energyToluene: null,
+        energyXylene: null,
+        energyTanliu: null,
+        energyWashoil: null,
+        energyTanwu: null,
+        energyIma: null,
+        energyCjiu: null,
+        energyRpg: null,
+        energyfeedNap: null,
+        energyfeedYiwan: null,
+        energyfeedTanwu: null,
+        energyfeedTanliu: null,
+        energyfeedLpg: null,
+        energyOffgas: null,
+        energyLpg: null
+      },
+      // 查询参数
+      queryParams: {
+      },
     };
   },
   mixins: [resize],
   mounted() {
-    this.initChart();
+    this.getList()
+    // 每隔30秒请求一次数据
+    window.setInterval(() => {undefined
+      setTimeout(() => {undefined
+        ///调取接口获取数据
+        this.getList();
+      }, 0)
+    }, 10000)
   },
   methods: {
+    /** 查询dashboard抓取数据列表 */
+    getList()
+    {
+      selectLast(this.queryParams).then(response => {
+        this.dashboarddata = response.data;
+        this.initChart();
+      });
+    },
     initChart() {
       // 基于准备好的dom,初始化echarts实例
       this.chart = this.echarts.init(document.getElementById("productProportion"));
@@ -44,7 +87,7 @@ export default {
         legend: [{
           icon: "circle",
           orient: 'vertical',
-          right: 75,
+          right: 62,
           top: 40,
           bottom: 20,
           data: ["H2", "C2H4", "CH4", "C3H6"],
@@ -54,7 +97,7 @@ export default {
         }, {
           icon: "circle",
           orient: 'vertical',
-          right: 5,
+          right: -6,
           top: 40,
           bottom: 20,
           data: ["Offgas", "LPG", "C4", "RPG"],
@@ -75,7 +118,7 @@ export default {
             },
             weight: {
               fontSize: 8,
-              color: '#999'
+              color: '#ffffff'
             }
           }
         },
@@ -84,16 +127,16 @@ export default {
             type: "pie",
             radius: [10, 55],
             roseType: "area",
-            center: ["36%", "40%"],
+            center: ["36%", "50%"],
             data: [
-              { value: 1550, name: "H2" },
-              { value: 555, name: "C2H4" },
-              { value: 1555, name: "CH4" },
-              { value: 2555, name: "C3H6" },
-              { value: 250, name: "Offgas" },
-              { value: 3555, name: "LPG" },
-              { value: 350, name: "C4" },
-              { value: 4555, name: "RPG" }
+              { value: this.dashboarddata.energyQingqi, name: "H2" },
+              { value: this.dashboarddata.energyYixi, name: "C2H4" },
+              { value: this.dashboarddata.energyJiawan, name: "CH4" },
+              { value: this.dashboarddata.energyBingxi, name: "C3H6" },
+              { value: this.dashboarddata.energyOffgas, name: "Offgas" },
+              { value: this.dashboarddata.energyLpg, name: "LPG" },
+              { value: this.dashboarddata.energyCsi, name: "C4" },
+              { value: this.dashboarddata.energyRpg, name: "RPG" }
             ],
           }
         ]

+ 0 - 1
ui/src/views/front/materialBalance.vue

@@ -401,7 +401,6 @@
       {
         selectLast(this.queryParams).then(response => {
           this.dashboarddata = response.data;
-          console.info("刷新数据" + response.data)
         });
       }
     }