shi'sen'yuan пре 3 година
родитељ
комит
485807768a

+ 12 - 12
src/main/java/io/renren/modules/aspen/controller/TAlarmstatisticsDayController.java → src/main/java/io/renren/modules/aspen/controller/TDashboarddataController.java

@@ -11,8 +11,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 
-import io.renren.modules.aspen.entity.TAlarmstatisticsDayEntity;
-import io.renren.modules.aspen.service.TAlarmstatisticsDayService;
+import io.renren.modules.aspen.entity.TDashboarddataEntity;
+import io.renren.modules.aspen.service.TDashboarddataService;
 import io.renren.common.utils.PageUtils;
 import io.renren.common.utils.R;
 
@@ -27,9 +27,9 @@ import io.renren.common.utils.R;
  */
 @RestController
 @RequestMapping("aspen/talarmstatisticsday")
-public class TAlarmstatisticsDayController {
+public class TDashboarddataController {
     @Autowired
-    private TAlarmstatisticsDayService tAlarmstatisticsDayService;
+    private TDashboarddataService tDashboarddataService;
 
     /**
      * 列表
@@ -37,7 +37,7 @@ public class TAlarmstatisticsDayController {
     @RequestMapping("/list")
     @RequiresPermissions("aspen:talarmstatisticsday:list")
     public R list(@RequestParam Map<String, Object> params){
-        PageUtils page = tAlarmstatisticsDayService.queryPage(params);
+        PageUtils page = tDashboarddataService.queryPage(params);
 
         return R.ok().put("page", page);
     }
@@ -49,9 +49,9 @@ public class TAlarmstatisticsDayController {
     @RequestMapping("/info/{id}")
     @RequiresPermissions("aspen:talarmstatisticsday:info")
     public R info(@PathVariable("id") Integer id){
-		TAlarmstatisticsDayEntity tAlarmstatisticsDay = tAlarmstatisticsDayService.getById(id);
+		TDashboarddataEntity tDashboarddata = tDashboarddataService.getById(id);
 
-        return R.ok().put("tAlarmstatisticsDay", tAlarmstatisticsDay);
+        return R.ok().put("tDashboarddata", tDashboarddata);
     }
 
     /**
@@ -59,8 +59,8 @@ public class TAlarmstatisticsDayController {
      */
     @RequestMapping("/save")
     @RequiresPermissions("aspen:talarmstatisticsday:save")
-    public R save(@RequestBody TAlarmstatisticsDayEntity tAlarmstatisticsDay){
-		tAlarmstatisticsDayService.save(tAlarmstatisticsDay);
+    public R save(@RequestBody TDashboarddataEntity tDashboarddata){
+        tDashboarddataService.save(tDashboarddata);
 
         return R.ok();
     }
@@ -70,8 +70,8 @@ public class TAlarmstatisticsDayController {
      */
     @RequestMapping("/update")
     @RequiresPermissions("aspen:talarmstatisticsday:update")
-    public R update(@RequestBody TAlarmstatisticsDayEntity tAlarmstatisticsDay){
-		tAlarmstatisticsDayService.updateById(tAlarmstatisticsDay);
+    public R update(@RequestBody TDashboarddataEntity tDashboarddata){
+        tDashboarddataService.updateById(tDashboarddata);
 
         return R.ok();
     }
@@ -82,7 +82,7 @@ public class TAlarmstatisticsDayController {
     @RequestMapping("/delete")
     @RequiresPermissions("aspen:talarmstatisticsday:delete")
     public R delete(@RequestBody Integer[] ids){
-		tAlarmstatisticsDayService.removeByIds(Arrays.asList(ids));
+        tDashboarddataService.removeByIds(Arrays.asList(ids));
 
         return R.ok();
     }

+ 2 - 2
src/main/java/io/renren/modules/aspen/dao/TAlarmstatisticsDayDao.java → src/main/java/io/renren/modules/aspen/dao/TDashboarddataDao.java

@@ -1,6 +1,6 @@
 package io.renren.modules.aspen.dao;
 
-import io.renren.modules.aspen.entity.TAlarmstatisticsDayEntity;
+import io.renren.modules.aspen.entity.TDashboarddataEntity;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import org.apache.ibatis.annotations.Mapper;
 
@@ -12,6 +12,6 @@ import org.apache.ibatis.annotations.Mapper;
  * @date 2021-05-11 16:13:06
  */
 @Mapper
-public interface TAlarmstatisticsDayDao extends BaseMapper<TAlarmstatisticsDayEntity> {
+public interface TDashboarddataDao extends BaseMapper<TDashboarddataEntity> {
 	
 }

+ 0 - 80
src/main/java/io/renren/modules/aspen/entity/TAlarmstatisticsDayEntity.java

@@ -1,80 +0,0 @@
-package io.renren.modules.aspen.entity;
-
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableName;
-
-import java.io.Serializable;
-import java.util.Date;
-import lombok.Data;
-
-/**
- * 报警统计表(当天)
- * 
- * @author chenshun
- * @email sunlightcs@gmail.com
- * @date 2021-05-11 16:13:06
- */
-@Data
-@TableName("T_ALARMSTATISTICS_DAY")
-public class TAlarmstatisticsDayEntity implements Serializable {
-	private static final long serialVersionUID = 1L;
-
-	/**
-	 * 唯一标识ID
-	 */
-	@TableId
-	private Integer id;
-	/**
-	 * 装置名称
-	 */
-	private String plantCode;
-	/**
-	 * 内容
-	 */
-	private String modulename;
-	/**
-	 * 等级
-	 */
-	private String levelname;
-	/**
-	 * 次数
-	 */
-	private Integer count;
-	/**
-	 * 录入日期
-	 */
-	private Date inputdate;
-	/**
-	 * ANALYSIS
-	 */
-	private String analysis;
-	/**
-	 * 状态
-	 */
-	private Integer delFlag;
-	/**
-	 * 创建人
-	 */
-	private String createrCode;
-	/**
-	 * 创建日期
-	 */
-	private Date createdate;
-	/**
-	 * 修改人
-	 */
-	private String updaterCode;
-	/**
-	 * 修改时间
-	 */
-	private Date updatedate;
-	/**
-	 * 备注
-	 */
-	private String remarks;
-	/**
-	 * 部门编号
-	 */
-	private Integer deptId;
-
-}

+ 107 - 0
src/main/java/io/renren/modules/aspen/entity/TDashboarddataEntity.java

@@ -0,0 +1,107 @@
+package io.renren.modules.aspen.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.KeySequence;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+
+import java.io.Serializable;
+import java.util.Date;
+import lombok.Data;
+
+/**
+ * 报警统计表(当天)
+ * 
+ * @author chenshun
+ * @email sunlightcs@gmail.com
+ * @date 2021-05-11 16:13:06
+ */
+@Data
+@TableName("T_DASHBOARDDATA")
+@KeySequence(value = "SEQ_T_DASHBOARDDATA")
+public class TDashboarddataEntity implements Serializable {
+	private static final long serialVersionUID = 1L;
+
+	/** 唯一标识ID */
+	@TableId(type = IdType.INPUT)
+	private Long id;
+
+	/** 删除状态 */
+	private Long delFlag;
+
+	/** 创建人 */
+	private String createrCode;
+
+	/** 抓取时间 */
+	private Date createdate;
+
+	/** 修改人 */
+	private String updaterCode;
+
+	/** 修改时间 */
+	private Date updatedate;
+
+	/** 物料平衡表产品乙烯 */
+	private String energyYixi;
+
+	/** 物料平衡表产品丙烯 */
+	private String energyBingxi;
+
+	/** 物料平衡表产品氢气 */
+	private String energyQingqi;
+
+	/** 物料平衡表产品甲烷 */
+	private String energyJiawan;
+
+	/** 物料平衡表产品Offgas */
+	private String energyOffgas;
+
+	/** 物料平衡表产品LPG */
+	private String energyLpg;
+
+	/** 物料平衡表产品C4 */
+	private String energyCsi;
+
+	/** 物料平衡表产品benzene */
+	private String energyBenzene;
+
+	/** 物料平衡表产品toluene */
+	private String energyToluene;
+
+	/** 物料平衡表产品xylene */
+	private String energyXylene;
+
+	/** 物料平衡表产品C6 */
+	private String energyTanliu;
+
+	/** 物料平衡表产品wash oil */
+	private String energyWashoil;
+
+	/** 物料平衡表产品C5 */
+	private String energyTanwu;
+
+	/** 物料平衡表产品IMA */
+	private String energyIma;
+
+	/** 物料平衡表产品C9 */
+	private String energyCjiu;
+
+	/** 物料平衡表产品RPG */
+	private String energyRpg;
+
+	/** 物料平衡表进料NAP */
+	private String energyfeedNap;
+
+	/** 物料平衡表进料乙烷 */
+	private String energyfeedYiwan;
+
+	/** 物料平衡表进料C5 */
+	private String energyfeedTanwu;
+
+	/** 物料平衡表进料C6 */
+	private String energyfeedTanliu;
+
+	/** 物料平衡表进料LPG */
+	private String energyfeedLpg;
+
+}

+ 2 - 2
src/main/java/io/renren/modules/aspen/service/TAlarmstatisticsDayService.java → src/main/java/io/renren/modules/aspen/service/TDashboarddataService.java

@@ -2,7 +2,7 @@ package io.renren.modules.aspen.service;
 
 import com.baomidou.mybatisplus.extension.service.IService;
 import io.renren.common.utils.PageUtils;
-import io.renren.modules.aspen.entity.TAlarmstatisticsDayEntity;
+import io.renren.modules.aspen.entity.TDashboarddataEntity;
 
 import java.util.Map;
 
@@ -13,7 +13,7 @@ import java.util.Map;
  * @email sunlightcs@gmail.com
  * @date 2021-05-11 16:13:06
  */
-public interface TAlarmstatisticsDayService extends IService<TAlarmstatisticsDayEntity> {
+public interface TDashboarddataService extends IService<TDashboarddataEntity> {
 
     PageUtils queryPage(Map<String, Object> params);
 }

+ 7 - 7
src/main/java/io/renren/modules/aspen/service/impl/TAlarmstatisticsDayServiceImpl.java → src/main/java/io/renren/modules/aspen/service/impl/TDashboarddataServiceImpl.java

@@ -8,19 +8,19 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import io.renren.common.utils.PageUtils;
 import io.renren.common.utils.Query;
 
-import io.renren.modules.aspen.dao.TAlarmstatisticsDayDao;
-import io.renren.modules.aspen.entity.TAlarmstatisticsDayEntity;
-import io.renren.modules.aspen.service.TAlarmstatisticsDayService;
+import io.renren.modules.aspen.dao.TDashboarddataDao;
+import io.renren.modules.aspen.entity.TDashboarddataEntity;
+import io.renren.modules.aspen.service.TDashboarddataService;
 
 
 @Service("tAlarmstatisticsDayService")
-public class TAlarmstatisticsDayServiceImpl extends ServiceImpl<TAlarmstatisticsDayDao, TAlarmstatisticsDayEntity> implements TAlarmstatisticsDayService {
+public class TDashboarddataServiceImpl extends ServiceImpl<TDashboarddataDao, TDashboarddataEntity> implements TDashboarddataService {
 
     @Override
     public PageUtils queryPage(Map<String, Object> params) {
-        IPage<TAlarmstatisticsDayEntity> page = this.page(
-                new Query<TAlarmstatisticsDayEntity>().getPage(params),
-                new QueryWrapper<TAlarmstatisticsDayEntity>()
+        IPage<TDashboarddataEntity> page = this.page(
+                new Query<TDashboarddataEntity>().getPage(params),
+                new QueryWrapper<TDashboarddataEntity>()
         );
 
         return new PageUtils(page);

+ 71 - 18
src/main/java/io/renren/modules/common/AspenController.java

@@ -2,10 +2,9 @@ package io.renren.modules.common;
 
 import com.alibaba.fastjson.JSON;
 import io.renren.common.utils.ExcelUtils;
-import io.renren.modules.aspen.entity.TAlarmstatisticsDayEntity;
-import io.renren.modules.aspen.service.TAlarmstatisticsDayService;
+import io.renren.modules.aspen.entity.TDashboarddataEntity;
+import io.renren.modules.aspen.service.TDashboarddataService;
 import io.renren.modules.sys.controller.AbstractController;
-import io.renren.modules.sys.entity.SysMenuEntity;
 import io.renren.modules.sys.service.SysMenuService;
 import org.apache.poi.ss.usermodel.Cell;
 import org.apache.poi.ss.usermodel.Row;
@@ -17,8 +16,7 @@ import org.springframework.scheduling.annotation.EnableScheduling;
 import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Component;
 
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
+import java.util.Date;
 import java.util.List;
 @Component
 @Configuration      //1.主要用于标记配置类,兼备Component的效果。
@@ -28,27 +26,82 @@ public class AspenController extends AbstractController {
     @Autowired
     private SysMenuService sysMenuService;
     @Autowired
-    private TAlarmstatisticsDayService tAlarmstatisticsDayService;
+    private TDashboarddataService tDashboarddataService;
 
     @Scheduled(cron = "0/9 * * * * ?")
     public void getExcelData(){
         Workbook workbook = ExcelUtils.getWorkBook("D://ssyFile/K300.xlsm");
         Sheet sheet = workbook.getSheetAt(0);
         int rowNum = sheet.getPhysicalNumberOfRows();
-        for (int i = 1; i < rowNum; i++) {
-            Row row = sheet.getRow(i);
-            int cellNum = row.getPhysicalNumberOfCells();
-            for (int j = 0; j < cellNum; j++) {
-                Cell cell = row.getCell(j);
-                String cellValue = ExcelUtils.getCellValue(cell);
-                if (j == 0) {
-                    logger.info(cellValue + "第一列");
-                }else if (j ==1) {
-                    logger.info(cellValue + "第二列");
+        TDashboarddataEntity dashboarddataEntity = new TDashboarddataEntity();
+        for (int i = 0; i < rowNum; i++) {
+            if (i == 4) {
+                logger.info("i:" + i);
+                Row row = sheet.getRow(i);
+                int cellNum = row.getPhysicalNumberOfCells();
+                for (int j = 0; j < cellNum; j++) {
+                    Cell cell = row.getCell(j);
+                    String cellValue = ExcelUtils.getCellValue(cell);
+                    if (j == 0) {
+                        dashboarddataEntity.setEnergyYixi(cellValue);
+                    }else if (j == 1) {
+                        dashboarddataEntity.setEnergyBingxi(cellValue);
+                    }else if (j == 2) {
+                        dashboarddataEntity.setEnergyQingqi(cellValue);
+                    }else if (j == 3) {
+                        dashboarddataEntity.setEnergyJiawan(cellValue);
+                    }else if (j == 4) {
+                        dashboarddataEntity.setEnergyOffgas(cellValue);
+                    }else if (j == 5) {
+                        dashboarddataEntity.setEnergyLpg(cellValue);
+                    }else if (j == 6) {
+                        dashboarddataEntity.setEnergyCsi(cellValue);
+                    }else if (j == 7) {
+                        dashboarddataEntity.setEnergyBenzene(cellValue);
+                    }else if (j == 8) {
+                        dashboarddataEntity.setEnergyToluene(cellValue);
+                    }else if (j == 9) {
+                        dashboarddataEntity.setEnergyXylene(cellValue);
+                    }else if (j == 10) {
+                        dashboarddataEntity.setEnergyTanliu(cellValue);
+                    }else if (j == 11) {
+                        dashboarddataEntity.setEnergyWashoil(cellValue);
+                    }else if (j == 12) {
+                        dashboarddataEntity.setEnergyTanwu(cellValue);
+                    }else if (j == 13) {
+                        dashboarddataEntity.setEnergyIma(cellValue);
+                    }else if (j == 14) {
+                        dashboarddataEntity.setEnergyCjiu(cellValue);
+                    }else if (j == 15) {
+                        dashboarddataEntity.setEnergyRpg(cellValue);
+                    }
+                }
+            }
+            if (i == 11) {
+                logger.info("i:" + i);
+                Row row = sheet.getRow(i);
+                int cellNum = row.getPhysicalNumberOfCells();
+                for (int j = 0; j < cellNum; j++) {
+                    Cell cell = row.getCell(j);
+                    String cellValue = ExcelUtils.getCellValue(cell);
+                    if (j == 0) {
+                        dashboarddataEntity.setEnergyfeedNap(cellValue);
+                    }else if (j ==1) {
+                        dashboarddataEntity.setEnergyfeedYiwan(cellValue);
+                    }else if (j ==2) {
+                        dashboarddataEntity.setEnergyfeedTanwu(cellValue);
+                    }else if (j ==3) {
+                        dashboarddataEntity.setEnergyfeedTanliu(cellValue);
+                    }else if (j ==4) {
+                        dashboarddataEntity.setEnergyfeedLpg(cellValue);
+                    }
                 }
             }
         }
-        List<TAlarmstatisticsDayEntity> menuList = tAlarmstatisticsDayService.list();
-        logger.info(JSON.toJSONString(menuList));
+        dashboarddataEntity.setCreatedate(new Date());
+        logger.info("dashboardData:" + dashboarddataEntity);
+        /*tDashboarddataService.save(dashboarddataEntity);
+        List<TDashboarddataEntity> menuList = tDashboarddataService.list();
+        logger.info(JSON.toJSONString(menuList));*/
     }
 }

+ 0 - 25
src/main/resources/mapper/aspen/TAlarmstatisticsDayDao.xml

@@ -1,25 +0,0 @@
-<?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="io.renren.modules.aspen.dao.TAlarmstatisticsDayDao">
-
-	<!-- 可根据自己的需求,是否要使用 -->
-    <resultMap type="io.renren.modules.aspen.entity.TAlarmstatisticsDayEntity" id="tAlarmstatisticsDayMap">
-        <result property="id" column="ID"/>
-        <result property="plantCode" column="PLANT_CODE"/>
-        <result property="modulename" column="MODULENAME"/>
-        <result property="levelname" column="LEVELNAME"/>
-        <result property="count" column="COUNT"/>
-        <result property="inputdate" column="INPUTDATE"/>
-        <result property="analysis" column="ANALYSIS"/>
-        <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="remarks" column="REMARKS"/>
-        <result property="deptId" column="DEPT_ID"/>
-    </resultMap>
-
-
-</mapper>

+ 36 - 0
src/main/resources/mapper/aspen/TDashboarddataDao.xml

@@ -0,0 +1,36 @@
+<?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="io.renren.modules.aspen.dao.TDashboarddataDao">
+
+	<!-- 可根据自己的需求,是否要使用 -->
+    <resultMap type="io.renren.modules.aspen.entity.TDashboarddataEntity" id="tDashboarddataMap">
+        <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="energyYixi"    column="energy_yixi"    />
+        <result property="energyBingxi"    column="energy_bingxi"    />
+        <result property="energyQingqi"    column="energy_qingqi"    />
+        <result property="energyJiawan"    column="energy_jiawan"    />
+        <result property="energyCsi"    column="energy_csi"    />
+        <result property="energyBenzene"    column="energy_benzene"    />
+        <result property="energyToluene"    column="energy_toluene"    />
+        <result property="energyXylene"    column="energy_xylene"    />
+        <result property="energyTanliu"    column="energy_tanliu"    />
+        <result property="energyWashoil"    column="energy_washoil"    />
+        <result property="energyTanwu"    column="energy_tanwu"    />
+        <result property="energyIma"    column="energy_ima"    />
+        <result property="energyCjiu"    column="energy_cjiu"    />
+        <result property="energyRpg"    column="energy_rpg"    />
+        <result property="energyfeedNap"    column="energyfeed_nap"    />
+        <result property="energyfeedYiwan"    column="energyfeed_yiwan"    />
+        <result property="energyfeedTanwu"    column="energyfeed_tanwu"    />
+        <result property="energyfeedTanliu"    column="energyfeed_tanliu"    />
+        <result property="energyfeedLpg"    column="energyfeed_lpg"    />
+    </resultMap>
+
+
+</mapper>