ly 2 жил өмнө
parent
commit
bf21a7d598

+ 1 - 1
src/main/java/io/renren/modules/aspen/controller/TDashboarddataController.java

@@ -26,7 +26,7 @@ import io.renren.common.utils.R;
  * @date 2021-05-11 16:13:06
  */
 @RestController
-@RequestMapping("aspen/talarmstatisticsday")
+@RequestMapping("aspen/tDashboarddataController")
 public class TDashboarddataController {
     @Autowired
     private TDashboarddataService tDashboarddataService;

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

@@ -104,4 +104,270 @@ public class TDashboarddataEntity implements Serializable {
 	/** 物料平衡表进料LPG */
 	private String energyfeedLpg;
 
+	/** 蒸汽平衡表SS进量Furnace */
+	private String steamSsinfur;
+
+	/** 蒸汽平衡表SS出量letdownn */
+	private String steamSsoutlet;
+
+	/** 蒸汽平衡表SS出量PGU/AEU */
+	private String steamSsoutaeu;
+
+	/** 蒸汽平衡表SS出量E481 */
+	private String steamSsoutesi;
+
+	/** 蒸汽平衡表SS出量K300 */
+	private String steamSsoutksan;
+
+	/** 蒸汽平衡表SSK300凝液 */
+	private String steamSsoutsc;
+
+	/** 蒸汽平衡表HS进量SUB */
+	private String steamHsinsub;
+
+	/** 蒸汽平衡表HS进量letdown */
+	private String steamHsinlet;
+
+	/** 蒸汽平衡表HS进量K300 */
+	private String steamHsinksan;
+
+	/** 蒸汽平衡表HS出量P900 */
+	private String steamHsoutpjiu;
+
+	/** 蒸汽平衡表HS出量PGU/AEU */
+	private String steamHsoutaeu;
+
+	/** 蒸汽平衡表HS出量letdown */
+	private String steamHsoutlet;
+
+	/** 蒸汽平衡表HS出量E372 */
+	private String steamHsoutesan;
+
+	/** 蒸汽平衡表HS出量PH1 */
+	private String steamHsoutphyi;
+
+	/** 蒸汽平衡表HS出量PH2 */
+	private String steamHsoutpher;
+
+	/** 蒸汽平衡表HS出量H520*/
+	private String steamHsouthwu;
+
+	/** 蒸汽平衡表HS出量K650 */
+	private String steamHsoutkliu;
+
+	/** 蒸汽平衡表HS出量K600 */
+	private String steamHsoutklz;
+
+	/** 蒸汽平衡表HS出量K600凝液 */
+	private String steamHsoutsc;
+
+	/** 蒸汽平衡表HHP引入SUB */
+	private String steamHhpsub;
+
+	/** 蒸汽平衡表MS进量PGU/AEU */
+	private String steamMsinaeu;
+
+	/** 蒸汽平衡表MS进量letdown */
+	private String steamMsinlet;
+
+	/** 蒸汽平衡表MS进量PH1 */
+	private String steamMsinphyi;
+
+	/** 蒸汽平衡表MS进量K600 */
+	private String steamMsinkliu;
+
+	/** 蒸汽平衡表MS出量Flare */
+	private String steamMsoutflare;
+
+	/** 蒸汽平衡表MS出量PGU/AEU */
+	private String steamMsoutaeu;
+
+	/** 蒸汽平衡表MS出量SCTU */
+	private String steamMsoutsctu;
+
+	/** 蒸汽平衡表MS出量E271/285 */
+	private String steamMsouteer;
+
+	/** 蒸汽平衡表MS出量Furnace */
+	private String steamMsoutfur;
+
+	/** 蒸汽平衡表MS出量真空泵 */
+	private String steamMsoutva;
+
+	/** 蒸汽平衡表MS出量tracing */
+	private String steamMsouttracing;
+
+	/** 蒸汽平衡表LS进量SUB */
+	private String steamLsinsub;
+
+	/** 蒸汽平衡表LS进量P900 */
+	private String steamLsinpjiu;
+
+	/** 蒸汽平衡表LS进量AEU */
+	private String steamLsinaeu;
+
+	/** 蒸汽平衡表LS进量E271/285 */
+	private String steamLsineer;
+
+	/** 蒸汽平衡表LS进量PH2 */
+	private String steamLsinpher;
+
+	/** 蒸汽平衡表LS出量SCTU */
+	private String steamLsoutsctu;
+
+	/** 蒸汽平衡表LS出量V900 */
+	private String steamLsoutvjiu;
+
+	/** 蒸汽平衡表LS出量E560 */
+	private String steamLsoutewuliu;
+
+	/** 蒸汽平衡表LS出量E534 */
+	private String steamLsoutewusan;
+
+	/** 蒸汽平衡表LS出量tracing */
+	private String steamLsouttracing;
+
+	/** 蒸汽平衡表LS出量E363 */
+	private String steamLsoutesan;
+
+	/** 蒸汽平衡表LS出量E470/475 */
+	private String steamLsoutesi;
+
+	/** 蒸汽平衡表LS出量其他 */
+	private String steamLsoutother;
+
+	/** 石脑油储罐T1621 */
+	private String napOne;
+
+	/** 石脑油储罐T1622 */
+	private String napTwo;
+
+	/** 石脑油储罐T1623 */
+	private String napThree;
+
+	/** 乙烯储罐STT1061 */
+	private String ehtOne;
+
+	/** 乙烯储罐STT1062 */
+	private String ehtTwo;
+
+	/** 乙烯储罐STT1063 */
+	private String ehtThree;
+
+	/** 乙烯储罐STT1064 */
+	private String ehtFour;
+
+	/** 乙烯储罐STT1065 */
+	private String ehtFive;
+
+	/** 丙烯储罐STT1011 */
+	private String acrOne;
+
+	/** 丙烯储罐STT1012 */
+	private String acrTwo;
+
+	/** 丙烯储罐STT1013 */
+	private String acrThree;
+
+	/** 丙烯储罐STT1014 */
+	private String acrFour;
+
+	/** 丙烯储罐STT1040 */
+	private String acrZero;
+
+	/** 芳烃储罐STT1520 */
+	private String proTwo;
+
+	/** 芳烃储罐STT1510 */
+	private String proOne;
+
+	/** 芳烃储罐STT1360 */
+	private String proThree;
+
+	/** 芳烃储罐STT1410 */
+	private String proFour;
+
+	/** BCC总需求SS-BCC */
+	private String ssBcc;
+
+	/** BCC总需求SS-SUB */
+	private String ssSub;
+
+	/** BCC总需求SS-EU */
+	private String ssEu;
+
+	/** BCC总需求SS-PGU */
+	private String ssPgu;
+
+	/** BCC总需求HHP-BCC */
+	private String hhpBcc;
+
+	/** BCC总需求HHP-SUB */
+	private String hhpSub;
+
+	/** BCC总需求HS-BCC */
+	private String hsBcc;
+
+	/** BCC总需求HS-SUB */
+	private String hsSub;
+
+	/** BCC总需求HS-EU */
+	private String hsEu;
+
+	/** BCC总需求HS-PGU */
+	private String hsPgu;
+
+	/** BCC总需求MS-BCC */
+	private String msBcc;
+
+	/** BCC总需求MS-EU */
+	private String msEu;
+
+	/** BCC总需求MS-PGU */
+	private String msPgu;
+
+	/** BCC总需求LS-BCC */
+	private String lsBcc;
+
+	/** BCC总需求LS-EU */
+	private String lsEu;
+
+	/** BCC总需求LS-PGU */
+	private String lsPgu;
+
+	/** BCC总需求TOTAL-BCC */
+	private String totalBcc;
+
+	/** BCC总需求TOTAL-EU */
+	private String totalEu;
+
+	/** BCC总需求总消耗-BCC */
+	private String zongBcc;
+
+	/** BCC总需求总消耗-EU */
+	private String zongEu;
+
+	/** BCC总需求总消耗-PGU */
+	private String zongPgu;
+
+	/** 前日产量乙烯C2H4 */
+	private String outputYixi;
+
+	/** 前日产量丙烯C3H6 */
+	private String outputBx;
+
+	/** 年产量 */
+	private String outputAnnual;
+
+	/** 瞬时能耗 */
+	private String instantaneous;
+
+	/** 累计能耗 */
+	private String cumulative;
+
+	/** 蒸汽平衡表HS出量C230 **/
+	private String steamHsouthc230;
+
+
+
 }

+ 1 - 1
src/main/java/io/renren/modules/aspen/service/impl/TDashboarddataServiceImpl.java

@@ -13,7 +13,7 @@ import io.renren.modules.aspen.entity.TDashboarddataEntity;
 import io.renren.modules.aspen.service.TDashboarddataService;
 
 
-@Service("tAlarmstatisticsDayService")
+@Service("tDashboarddataService")
 public class TDashboarddataServiceImpl extends ServiceImpl<TDashboarddataDao, TDashboarddataEntity> implements TDashboarddataService {
 
     @Override

+ 553 - 101
src/main/java/io/renren/modules/common/AspenController.java

@@ -1,16 +1,19 @@
 package io.renren.modules.common;
 
 import com.alibaba.fastjson.JSON;
+import com.baomidou.mybatisplus.core.conditions.Wrapper;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.opencsv.CSVReader;
-import io.renren.common.utils.ExcelUtils;
+import io.renren.common.utils.Constant;
+import io.renren.common.utils.PageUtils;
+import io.renren.common.utils.Query;
+import io.renren.modules.aspen.dao.TDailyProductionReportDao;
+import io.renren.modules.aspen.entity.TDailyProductionReport;
 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.service.SysMenuService;
-import org.apache.poi.ss.usermodel.Cell;
-import org.apache.poi.ss.usermodel.Row;
-import org.apache.poi.ss.usermodel.Sheet;
-import org.apache.poi.ss.usermodel.Workbook;
+import org.apache.commons.lang.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.Configuration;
 import org.springframework.scheduling.annotation.EnableScheduling;
@@ -21,7 +24,6 @@ import java.io.FileReader;
 import java.io.IOException;
 import java.math.BigDecimal;
 import java.util.Date;
-import java.util.List;
 @Component
 @Configuration      //1.主要用于标记配置类,兼备Component的效果。
 @EnableScheduling   // 2.开启定时任务
@@ -29,13 +31,15 @@ public class AspenController extends AbstractController {
 
     @Autowired
     private TDashboarddataService tDashboarddataService;
+    @Autowired
+    private TDailyProductionReportDao tDailyProductionReportDao;
 
-    @Scheduled(cron = "0/15 * * * * ?")
+    @Scheduled(cron = "0 */1 * * * ?")
 //    @Scheduled(cron = "0 */15 * * * ?")
     public void getExcelData(){
-        String csvFile = "D://ssyFile/物料.csv";
+        logger.info("实时获取数据");
+        String csvFile = "D://ssyFile/wuliao.csv";
 //        String csvFile = "C://dashboardAspen/wuliao.csv";
-//        B:\GLOBAL\7430-BYC\NANJING\CB\CBP_C\15 CBP Cracker Share 乙烯装置共享文件夹\Dashboard data\物料.xlsm
         TDashboarddataEntity dashboarddataEntity = new TDashboarddataEntity();
         CSVReader reader = null;
         try {
@@ -101,112 +105,560 @@ public class AspenController extends AbstractController {
                     dashboarddataEntity.setEnergyfeedTanliu(line[3]);
                     dashboarddataEntity.setEnergyfeedLpg(line[4]);
                 }
+                if (i == 15) {
+                    logger.info("第" + i + "行");
+                    line[0] = rounding(line[0]);
+                    line[2] = rounding(line[2]);
+                    dashboarddataEntity.setOutputYixi(rounding(line[0]));
+                    dashboarddataEntity.setInstantaneous(rounding(line[2]));
+                    logger.info("===========================" + line[5]);
+                    String annual = line[5];
+                    annual = new BigDecimal(annual).toPlainString();
+                    annual = new BigDecimal(annual).multiply(new BigDecimal("100")).toString();
+                    dashboarddataEntity.setOutputAnnual(rounding(annual)+"%");
+                }
+                if (i == 16) {
+                    logger.info("第" + i + "行");
+                    for (int j = 7; j < 20; j++) {
+                        logger.info("读数:" + line[j]);
+                        if (line[j].equals("")) {
+                            line[j] = "0";
+                        }else {
+                            if (!Character.isDigit(line[j].charAt(0))) {
+                                line[j] = "0";
+                            }else {
+                                BigDecimal b = new BigDecimal(Double.parseDouble(line[j]));
+                                double f = b.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
+                                line[j] = String.valueOf(f);
+                            }
+                        }
+                        logger.info(line[j]);
+                    }
+                    dashboarddataEntity.setNapOne(line[7]);
+                    dashboarddataEntity.setNapTwo(line[8]);
+                    dashboarddataEntity.setNapThree(line[9]);
+                    dashboarddataEntity.setEhtOne(line[10]);
+                    dashboarddataEntity.setEhtTwo(line[11]);
+                    dashboarddataEntity.setEhtThree(line[12]);
+                    dashboarddataEntity.setEhtFour(line[13]);
+                    dashboarddataEntity.setEhtFive(line[14]);
+                    dashboarddataEntity.setAcrOne(line[15]);
+                    dashboarddataEntity.setAcrTwo(line[16]);
+                    dashboarddataEntity.setAcrThree(line[17]);
+                    dashboarddataEntity.setAcrFour(line[18]);
+                    dashboarddataEntity.setAcrZero(line[19]);
+                }
+                if (i == 19) {
+                    logger.info("第" + i + "行");
+                    for (int j = 0; j < 3; j++) {
+                        logger.info("读数:" + line[j]);
+                        if (line[j].equals("")) {
+                            line[j] = "0.0";
+                        }else {
+                            if (!Character.isDigit(line[j].charAt(0))) {
+                                line[j] = "0.0";
+                            }else {
+                                BigDecimal b = new BigDecimal(Double.parseDouble(line[j]));
+                                double f = b.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
+                                line[j] = String.valueOf(f);
+                            }
+                        }
+                        logger.info(line[j]);
+                    }
+                    dashboarddataEntity.setOutputBx(line[0]);
+                    dashboarddataEntity.setCumulative(line[2]);
+                }
+                if (i == 20) {
+                    logger.info("第" + i + "行");
+                    for (int j = 7; j < 11; j++) {
+                        logger.info("读数:" + line[j]);
+                        if (line[j].equals("")) {
+                            line[j] = "0";
+                        }else {
+                            if (!Character.isDigit(line[j].charAt(0))) {
+                                line[j] = "0";
+                            }else {
+                                BigDecimal b = new BigDecimal(Double.parseDouble(line[j]));
+                                double f = b.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
+                                line[j] = String.valueOf(f);
+                            }
+                        }
+                        logger.info(line[j]);
+                    }
+                    dashboarddataEntity.setProTwo(line[7]);
+                    dashboarddataEntity.setProOne(line[8]);
+                    dashboarddataEntity.setProThree(line[9]);
+                    dashboarddataEntity.setProFour(line[10]);
+                }
+                /* SS */
+                if (i == 40) {
+                    logger.info("第" + i + "行");
+                    if (line[1].equals("")) {
+                        line[1] = "0.0";
+                    }else {
+                        if (!Character.isDigit(line[1].charAt(0))) {
+                            line[1] = "0.0";
+                        }else {
+                            BigDecimal b = new BigDecimal(Double.parseDouble(line[1]));
+                            double f = b.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
+                            line[1] = String.valueOf(f);
+                        }
+                    }
+                    dashboarddataEntity.setSteamSsinfur(line[1]);
+                }
+                if (i == 41) {
+                    logger.info("第" + i + "行");
+                    if (line[6].equals("")) {
+                        line[6] = "0.0";
+                    }else {
+                        if (!Character.isDigit(line[6].charAt(0))) {
+                            line[6] = "0.0";
+                        }else {
+                            BigDecimal b = new BigDecimal(Double.parseDouble(line[6]));
+                            double f = b.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
+                            line[6] = String.valueOf(f);
+                        }
+                    }
+                    dashboarddataEntity.setSteamSsoutlet(line[6]);
+                }
+                if (i == 42) {
+                    logger.info("第" + i + "行");
+                    if (line[6].equals("")) {
+                        line[6] = "0.0";
+                    }else {
+                        if (!Character.isDigit(line[6].charAt(0))) {
+                            line[6] = "0.0";
+                        }else {
+                            BigDecimal b = new BigDecimal(Double.parseDouble(line[6]));
+                            double f = b.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
+                            line[6] = String.valueOf(f);
+                        }
+                    }
+                    dashboarddataEntity.setSteamSsoutesi(line[6]);
+                }
+                if (i == 43) {
+                    logger.info("第" + i + "行");
+                    if (line[6].equals("")) {
+                        line[6] = "0.0";
+                    }else {
+                        if (!Character.isDigit(line[6].charAt(0))) {
+                            line[6] = "0.0";
+                        }else {
+                            BigDecimal b = new BigDecimal(Double.parseDouble(line[6]));
+                            double f = b.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
+                            line[6] = String.valueOf(f);
+                        }
+                    }
+                    dashboarddataEntity.setSteamSsoutaeu(line[6]);
+                }
+                if (i == 44) {
+                    logger.info("第" + i + "行");
+                    for (int j = 6; j < 9; j++) {
+                        logger.info("读数:" + line[j]);
+                        if (line[j].equals("")) {
+                            line[j] = "0.0";
+                        }else {
+                            if (!Character.isDigit(line[j].charAt(0))) {
+                                line[j] = "0.0";
+                            }else {
+                                BigDecimal b = new BigDecimal(Double.parseDouble(line[j]));
+                                double f = b.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
+                                line[j] = String.valueOf(f);
+                            }
+                        }
+                        logger.info(line[j]);
+                    }
+                    dashboarddataEntity.setSteamSsoutksan(line[6]);
+                    dashboarddataEntity.setSteamHsinksan(line[8]);
+                }
+                if (i == 45) {
+                    logger.info("第" + i + "行");
+                    if (line[8].equals("")) {
+                        line[8] = "0.0";
+                    }else {
+                        if (!Character.isDigit(line[8].charAt(0))) {
+                            line[8] = "0.0";
+                        }else {
+                            BigDecimal b = new BigDecimal(Double.parseDouble(line[8]));
+                            double f = b.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
+                            line[8] = String.valueOf(f);
+                        }
+                    }
+                    dashboarddataEntity.setSteamSsoutsc(line[8]);
+                }
+                /* HS */
+                if (i == 55) {
+                    logger.info("第" + i + "行");
+                    if (line[1].equals("")) {
+                        line[1] = "0.0";
+                    }else {
+                        if (!Character.isDigit(line[1].charAt(0))) {
+                            line[1] = "0.0";
+                        }else {
+                            BigDecimal b = new BigDecimal(Double.parseDouble(line[1]));
+                            double f = b.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
+                            line[1] = String.valueOf(f);
+                        }
+                    }
+                    dashboarddataEntity.setSteamHsinsub(line[1]);
+                }
+                if (i == 56) {
+                    logger.info("第" + i + "行");
+                    for (int j = 1; j < 10; j++) {
+                        logger.info("读数:" + line[j]);
+                        if (line[j].equals("")) {
+                            line[j] = "0.0";
+                        }else {
+                            if (!Character.isDigit(line[j].charAt(0))) {
+                                line[j] = "0.0";
+                            }else {
+                                BigDecimal b = new BigDecimal(Double.parseDouble(line[j]));
+                                double f = b.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
+                                line[j] = String.valueOf(f);
+                            }
+                        }
+                        logger.info(line[j]);
+                    }
+                    dashboarddataEntity.setSteamHhpsub(line[1]);
+                    dashboarddataEntity.setSteamHsoutpjiu(line[4]);
+                    dashboarddataEntity.setSteamHsouthwu(line[9]);
+                }
+                if (i == 57) {
+                    logger.info("第" + i + "行");
+                    for (int j = 1; j < 10; j++) {
+                        logger.info("读数:" + line[j]);
+                        if (line[j].equals("")) {
+                            line[j] = "0.0";
+                        }else {
+                            if (!Character.isDigit(line[j].charAt(0))) {
+                                line[j] = "0.0";
+                            }else {
+                                BigDecimal b = new BigDecimal(Double.parseDouble(line[j]));
+                                double f = b.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
+                                line[j] = String.valueOf(f);
+                            }
+                        }
+                        logger.info(line[j]);
+                    }
+                    dashboarddataEntity.setSteamHsinlet(line[1]);
+                    dashboarddataEntity.setSteamHsoutaeu(line[4]);
+                    dashboarddataEntity.setSteamHsouthc230(line[9]);
+                }
+                if (i == 58) {
+                    logger.info("第" + i + "行");
+                    if (line[4].equals("")) {
+                        line[4] = "0.0";
+                    }else {
+                        if (!Character.isDigit(line[4].charAt(0))) {
+                            line[4] = "0.0";
+                        }else {
+                            BigDecimal b = new BigDecimal(Double.parseDouble(line[4]));
+                            double f = b.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
+                            line[4] = String.valueOf(f);
+                        }
+                    }
+                    dashboarddataEntity.setSteamHsoutlet(line[4]);
+                }
+                if (i == 59) {
+                    logger.info("第" + i + "行");
+                    if (line[4].equals("")) {
+                        line[4] = "0.0";
+                    }else {
+                        if (!Character.isDigit(line[4].charAt(0))) {
+                            line[4] = "0.0";
+                        }else {
+                            BigDecimal b = new BigDecimal(Double.parseDouble(line[4]));
+                            double f = b.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
+                            line[4] = String.valueOf(f);
+                        }
+                    }
+                    dashboarddataEntity.setSteamHsoutesan(line[4]);
+                }
+                if (i == 60) {
+                    logger.info("第" + i + "行");
+                    if (line[4].equals("")) {
+                        line[4] = "0.0";
+                    }else {
+                        if (!Character.isDigit(line[4].charAt(0))) {
+                            line[4] = "0.0";
+                        }else {
+                            BigDecimal b = new BigDecimal(Double.parseDouble(line[4]));
+                            double f = b.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
+                            line[4] = String.valueOf(f);
+                        }
+                    }
+                    dashboarddataEntity.setSteamHsoutphyi(line[4]);
+                }
+                if (i == 61) {
+                    logger.info("第" + i + "行");
+                    if (line[4].equals("")) {
+                        line[4] = "0.0";
+                    }else {
+                        if (!Character.isDigit(line[4].charAt(0))) {
+                            line[4] = "0.0";
+                        }else {
+                            BigDecimal b = new BigDecimal(Double.parseDouble(line[4]));
+                            double f = b.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
+                            line[4] = String.valueOf(f);
+                        }
+                    }
+                    dashboarddataEntity.setSteamHsoutpher(line[4]);
+                }
+                if (i == 62) {
+                    logger.info("第" + i + "行");
+                    dashboarddataEntity.setSteamHsoutklz(rounding(line[4]));
+                    dashboarddataEntity.setSteamMsinkliu(rounding(line[6]));
+                }
+                if (i == 63) {
+                    logger.info("第" + i + "行");
+                    if (line[6].equals("")) {
+                        line[6] = "0.0";
+                    }else {
+                        if (!Character.isDigit(line[6].charAt(0))) {
+                            line[6] = "0.0";
+                        }else {
+                            BigDecimal b = new BigDecimal(Double.parseDouble(line[6]));
+                            double f = b.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
+                            line[6] = String.valueOf(f);
+                        }
+                    }
+                    dashboarddataEntity.setSteamHsoutsc(line[6]);
+                }
+                if (i == 64) {
+                    logger.info("第" + i + "行");
+                    if (line[4].equals("")) {
+                        line[4] = "0.0";
+                    }else {
+                        if (!Character.isDigit(line[4].charAt(0))) {
+                            line[4] = "0.0";
+                        }else {
+                            BigDecimal b = new BigDecimal(Double.parseDouble(line[4]));
+                            double f = b.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
+                            line[4] = String.valueOf(f);
+                        }
+                    }
+                    dashboarddataEntity.setSteamHsoutkliu(line[4]);
+                }
+                /* MS */
+                if (i == 69) {
+                    logger.info("第" + i + "行");
+                    dashboarddataEntity.setSteamMsinaeu(rounding(line[1]));
+                    dashboarddataEntity.setSteamMsoutflare(rounding(line[4]));
+                    dashboarddataEntity.setSteamMsoutfur(rounding(line[7]));
+                }
+                if (i == 70) {
+                    logger.info("第" + i + "行");
+                    dashboarddataEntity.setSteamMsinphyi(rounding(line[1]));
+                    dashboarddataEntity.setSteamMsoutaeu(rounding(line[4]));
+                    dashboarddataEntity.setSteamMsoutva(rounding(line[7]));
+                }
+                if (i == 71) {
+                    logger.info("第" + i + "行");
+                    dashboarddataEntity.setSteamMsinlet(rounding(line[1]));
+                    dashboarddataEntity.setSteamMsouttracing(rounding(line[7]));
+                }
+                if (i == 74) {
+                    logger.info("第" + i + "行");
+                    dashboarddataEntity.setSteamMsoutsctu(rounding(line[4]));
+                }
+                if (i == 79) {
+                    logger.info("第" + i + "行");
+                    dashboarddataEntity.setSteamMsouteer(rounding(line[4]));
+                }
+                /* LS */
+                if (i == 84) {
+                    logger.info("第" + i + "行");
+                    dashboarddataEntity.setSteamLsinsub(rounding(line[1]));
+                    dashboarddataEntity.setSteamLsoutsctu(rounding(line[5]));
+                }
+                if (i == 85) {
+                    logger.info("第" + i + "行");
+                    dashboarddataEntity.setSteamLsinpjiu(rounding(line[1]));
+                    dashboarddataEntity.setSteamLsoutvjiu(rounding(line[5]));
+                }
+                if (i == 86) {
+                    logger.info("第" + i + "行");
+                    dashboarddataEntity.setSteamLsinaeu(rounding(line[1]));
+                    dashboarddataEntity.setSteamLsoutewuliu(rounding(line[5]));
+                }
+                if (i == 87) {
+                    logger.info("第" + i + "行");
+                    dashboarddataEntity.setSteamLsineer(rounding(line[1]));
+                    dashboarddataEntity.setSteamLsoutewusan(rounding(line[5]));
+                }
+                if (i == 88) {
+                    logger.info("第" + i + "行");
+                    dashboarddataEntity.setSteamLsinpher(rounding(line[1]));
+                    dashboarddataEntity.setSteamLsouttracing(rounding(line[5]));
+                }
+                if (i == 89) {
+                    logger.info("第" + i + "行");
+                    dashboarddataEntity.setSteamLsoutesan(rounding(line[5]));
+                }
+                if (i == 90) {
+                    logger.info("第" + i + "行");
+                    dashboarddataEntity.setSteamLsoutesi(rounding(line[5]));
+                }
+                if (i == 91) {
+                    logger.info("第" + i + "行");
+                    dashboarddataEntity.setSteamLsoutother(rounding(line[5]));
+                }
+                /* 总需求 */
+                if (i == 99) {
+                    logger.info("第" + i + "行");
+                    dashboarddataEntity.setSsBcc(rounding(line[1]));
+                    dashboarddataEntity.setSsSub(rounding(line[2]));
+                    dashboarddataEntity.setSsEu(rounding(line[3]));
+                    dashboarddataEntity.setSsPgu(rounding(line[4]));
+                }
+                if (i == 100) {
+                    logger.info("第" + i + "行");
+                    dashboarddataEntity.setHhpBcc(rounding(line[1]));
+                    dashboarddataEntity.setHhpSub(rounding(line[2]));
+                }
+                if (i == 101) {
+                    logger.info("第" + i + "行");
+                    dashboarddataEntity.setHsBcc(rounding(line[1]));
+                    dashboarddataEntity.setHsSub(rounding(line[2]));
+                    dashboarddataEntity.setHsEu(rounding(line[3]));
+                    dashboarddataEntity.setHsPgu(rounding(line[4]));
+                }
+                if (i == 102) {
+                    logger.info("第" + i + "行");
+                    dashboarddataEntity.setMsBcc(rounding(line[1]));
+                    dashboarddataEntity.setMsEu(rounding(line[3]));
+                    dashboarddataEntity.setMsPgu(rounding(line[4]));
+                }
+                if (i == 103) {
+                    logger.info("第" + i + "行");
+                    dashboarddataEntity.setLsBcc(rounding(line[1]));
+                    dashboarddataEntity.setLsEu(rounding(line[3]));
+                    dashboarddataEntity.setLsPgu(rounding(line[4]));
+                }
+                if (i == 104) {
+                    logger.info("第" + i + "行");
+                    dashboarddataEntity.setTotalBcc(rounding(line[1]));
+                    dashboarddataEntity.setTotalEu(rounding(line[3]));
+                }
+                if (i == 105) {
+                    logger.info("第" + i + "行");
+                    dashboarddataEntity.setZongBcc(rounding(line[1]));
+                    dashboarddataEntity.setZongEu(rounding(line[3]));
+                    dashboarddataEntity.setZongPgu(rounding(line[4]));
+                }
                 i++;
             }
             dashboarddataEntity.setCreatedate(new Date());
+            //储罐的代码
+            TDailyProductionReport report = tDailyProductionReportDao.selectOne( new QueryWrapper<TDailyProductionReport>()
+                    .last("where REPORT_DATE = (select max(t2.REPORT_DATE) from t_daily_production_report t2)")
+            );
+            logger.info("TDailyProductionReport:" + JSON.toJSONString(report));
+            dashboarddataEntity.setNapOne(rounding0(report.getSctfStorageCltf1621()));
+            dashboarddataEntity.setNapTwo(rounding0(report.getSctfStorageCltf1622()));
+            dashboarddataEntity.setNapThree(rounding0(report.getSctfStorageCltf1623()));
+            dashboarddataEntity.setEhtOne(rounding0(report.getSctfStorageTk1061()));
+            dashboarddataEntity.setEhtTwo(rounding0(report.getSctfStorageTk1062()));
+            dashboarddataEntity.setEhtThree(rounding0(report.getSctfStorageTk1063()));
+            dashboarddataEntity.setEhtFour(rounding0(report.getSctfStorageTk1064()));
+            dashboarddataEntity.setEhtFive(rounding0(report.getSctfStorageTk1065Off()));
+            dashboarddataEntity.setAcrOne(rounding0(report.getSctfStorageTk1011()));
+            dashboarddataEntity.setAcrTwo(rounding0(report.getSctfStorageTk1012()));
+            dashboarddataEntity.setAcrThree(rounding0(report.getSctfStorageTk1013()));
+            dashboarddataEntity.setAcrFour(rounding0(report.getSctfStorageTk1014()));
+            dashboarddataEntity.setAcrZero(rounding0(report.getSctfStorageTk1040Off()));
+            dashboarddataEntity.setProTwo(rounding0(report.getSctfStorageTk1520Rpg()));
+            dashboarddataEntity.setProOne(rounding0(report.getSctfStorageTk1510B()));
+            dashboarddataEntity.setProThree(rounding0(report.getSctfStorageTk1360T()));
+            dashboarddataEntity.setProFour(rounding0(report.getSctfStorageTk1410X()));
+
             logger.info("dashboardData:" + dashboarddataEntity);
             tDashboarddataService.save(dashboarddataEntity);
         } catch (IOException e) {
             e.printStackTrace();
         }
-        /*Workbook workbook = ExcelUtils.getWorkBook("B://GLOBAL/7430-BYC/NANJING/CB/CBP/CBP_C/15 CBP Cracker Share 乙烯装置共享文件夹/Dashboard data/物料.xlsx");
-//        Workbook workbook = ExcelUtils.getWorkBook("D://ssyFile/ceshi.xlsx");
-        Sheet sheet = workbook.getSheetAt(0);
-        int rowNum = sheet.getLastRowNum();
-        TDashboarddataEntity dashboarddataEntity = new TDashboarddataEntity();
-        logger.info("rowNum:" + rowNum);
-        for (int i = 0; i <= rowNum; i++) {
-            if (i == 0) {
-                logger.info("i:" + i);
-                Row row = sheet.getRow(i);
-                int cellNum = row.getLastCellNum();
-                for (int j = 0; j <= cellNum; j++) {
-                    if (j == 4) {
-                        logger.info("==========");
-                    }
-                    Cell cell = row.getCell(j);
-                    String cellValue = ExcelUtils.getCellValue(cell);
+    }
 
-                }
-            }
-            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 == 6) {
-                logger.info("i:" + i);
-                Row row = sheet.getRow(i);
-                int cellNum = row.getLastCellNum();
-                for (int j = 0; j <= cellNum; j++) {
-                    if (j == 0) {
-                        logger.info("==========");
-                    }
-                    Cell cell = row.getCell(j);
-                    String cellValue = ExcelUtils.getCellValue(cell);
+//    @Scheduled(cron = "0 */1 * * * ?")
+    public void getDayTankData(){
+         TDailyProductionReport report = tDailyProductionReportDao.selectOne( new QueryWrapper<TDailyProductionReport>()
+                .last("where REPORT_DATE = (select max(t2.REPORT_DATE) from t_daily_production_report t2)")
+        );
+        logger.info(JSON.toJSONString(report));
 
+        TDashboarddataEntity data = tDashboarddataService.getOne( new QueryWrapper<TDashboarddataEntity>()
+              .eq("id" , "811")
+        );
+        data.setNapOne(rounding0(report.getSctfStorageCltf1621()));
+        data.setNapTwo(rounding0(report.getSctfStorageCltf1622()));
+        data.setNapThree(rounding0(report.getSctfStorageCltf1623()));
+        data.setEhtOne(rounding0(report.getSctfStorageTk1061()));
+        data.setEhtTwo(rounding0(report.getSctfStorageTk1062()));
+        data.setEhtThree(rounding0(report.getSctfStorageTk1063()));
+        data.setEhtFour(rounding0(report.getSctfStorageTk1064()));
+        data.setEhtFive(rounding0(report.getSctfStorageTk1065Off()));
+        data.setAcrOne(rounding0(report.getSctfStorageTk1011()));
+        data.setAcrTwo(rounding0(report.getSctfStorageTk1012()));
+        data.setAcrThree(rounding0(report.getSctfStorageTk1013()));
+        data.setAcrFour(rounding0(report.getSctfStorageTk1014()));
+        data.setAcrZero(rounding0(report.getSctfStorageTk1040Off()));
+        data.setProTwo(rounding0(report.getSctfStorageTk1520Rpg()));
+        data.setProOne(rounding0(report.getSctfStorageTk1510B()));
+        data.setProThree(rounding0(report.getSctfStorageTk1360T()));
+        data.setProFour(rounding0(report.getSctfStorageTk1410X()));
+        tDashboarddataService.saveOrUpdate(data);
+    }
+
+    public String rounding(String lineNum) {
+        try {
+            logger.info("读数:" + lineNum);
+            if (lineNum.equals("")) {
+                lineNum = "0.0";
+            }else {
+                if (!Character.isDigit(lineNum.charAt(0))) {
+                    if ("-".equals(lineNum.substring(0,1))){
+                        BigDecimal b = new BigDecimal(Double.parseDouble(lineNum));
+                        double f = b.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
+                        lineNum = String.valueOf(f);
+                    }else {
+                        lineNum = "0.0";
+                    }
+                }else {
+                    BigDecimal b = new BigDecimal(Double.parseDouble(lineNum));
+                    double f = b.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
+                    lineNum = String.valueOf(f);
                 }
             }
-            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);
+            logger.info(lineNum);
+            return lineNum;
+        }catch (Exception e) {
+            logger.error(String.valueOf(e));
+            return "0.0";
+        }
+    };
+    public String rounding0(String lineNum) {
+        try {
+            logger.info("读数:" + lineNum);
+            if (lineNum.equals("")) {
+                lineNum = "0.0";
+            }else {
+                if (!Character.isDigit(lineNum.charAt(0))) {
+                    if ("-".equals(lineNum.substring(0,1))){
+                        int b = new BigDecimal(Double.parseDouble(lineNum)).intValue();
+                        lineNum = String.valueOf(b);
+                    }else {
+                        lineNum = "0.0";
                     }
+                }else {
+                    int b = new BigDecimal(Double.parseDouble(lineNum)).intValue();
+                    lineNum = String.valueOf(b);
                 }
             }
+            logger.info(lineNum);
+            return lineNum;
+        }catch (Exception e) {
+            logger.error(String.valueOf(e));
+            return "0.0";
         }
-        dashboarddataEntity.setCreatedate(new Date());
-        logger.info("dashboardData:" + dashboarddataEntity);
-        tDashboarddataService.save(dashboarddataEntity);*/
     }
 }

+ 1 - 0
src/main/java/io/renren/modules/sys/controller/GetPwdController.java

@@ -16,6 +16,7 @@ public class GetPwdController {
     public void test() {
         String username = encryptor.encrypt("");
         System.out.println(username);
+
         String password = encryptor.encrypt("");
         System.out.println(password);
     }

+ 1 - 1
src/main/resources/application-dev.yml

@@ -6,7 +6,7 @@ spring:
       #            url: jdbc:mysql://106.12.179.155:3306/ssy_test?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai
       #            username: ENC(Jnap8dU25YV9cE1pJKpISg==)
       #            password: ENC(tjXpQ4vKnTCS/zeRsZdx6oTxW36qkJt9)
-      driver-class-name: oracle.jdbc.OracleDriver
+#      driver-class-name: oracle.jdbc.OracleDriver
       url: jdbc:oracle:thin:@47.114.101.16:1521:XE
       username: newcpms
       password: ssy666666

+ 89 - 1
src/main/resources/mapper/aspen/TDashboarddataDao.xml

@@ -30,7 +30,95 @@
         <result property="energyfeedTanwu"    column="energyfeed_tanwu"    />
         <result property="energyfeedTanliu"    column="energyfeed_tanliu"    />
         <result property="energyfeedLpg"    column="energyfeed_lpg"    />
+        <result property="steamSsinfur"    column="steam_ssinfur"    />
+        <result property="steamSsoutlet"    column="steam_ssoutlet"    />
+        <result property="steamSsoutaeu"    column="steam_ssoutaeu"    />
+        <result property="steamSsoutesi"    column="steam_ssoutesi"    />
+        <result property="steamSsoutksan"    column="steam_ssoutksan"    />
+        <result property="steamSsoutsc"    column="steam_ssoutsc"    />
+        <result property="steamHsinsub"    column="steam_hsinsub"    />
+        <result property="steamHsinlet"    column="steam_hsinlet"    />
+        <result property="steamHsinksan"    column="steam_hsinksan"    />
+        <result property="steamHsoutpjiu"    column="steam_hsoutpjiu"    />
+        <result property="steamHsoutaeu"    column="steam_hsoutaeu"    />
+        <result property="steamHsoutlet"    column="steam_hsoutlet"    />
+        <result property="steamHsoutesan"    column="steam_hsoutesan"    />
+        <result property="steamHsoutphyi"    column="steam_hsoutphyi"    />
+        <result property="steamHsoutpher"    column="steam_hsoutpher"    />
+        <result property="steamHsouthwu"    column="steam_hsouthwu"    />
+        <result property="steamHsoutkliu"    column="steam_hsoutkliu"    />
+        <result property="steamHsoutklz"    column="steam_hsoutklz"    />
+        <result property="steamHsoutsc"    column="steam_hsoutsc"    />
+        <result property="steamHhpsub"    column="steam_hhpsub"    />
+        <result property="steamMsinaeu"    column="steam_msinaeu"    />
+        <result property="steamMsinlet"    column="steam_msinlet"    />
+        <result property="steamMsinphyi"    column="steam_msinphyi"    />
+        <result property="steamMsinkliu"    column="steam_msinkliu"    />
+        <result property="steamMsoutflare"    column="steam_msoutflare"    />
+        <result property="steamMsoutaeu"    column="steam_msoutaeu"    />
+        <result property="steamMsoutsctu"    column="steam_msoutsctu"    />
+        <result property="steamMsouteer"    column="steam_msouteer"    />
+        <result property="steamMsoutfur"    column="steam_msoutfur"    />
+        <result property="steamMsoutva"    column="steam_msoutva"    />
+        <result property="steamMsouttracing"    column="steam_msouttracing"    />
+        <result property="steamLsinsub"    column="steam_lsinsub"    />
+        <result property="steamLsinpjiu"    column="steam_lsinpjiu"    />
+        <result property="steamLsinaeu"    column="steam_lsinaeu"    />
+        <result property="steamLsineer"    column="steam_lsineer"    />
+        <result property="steamLsinpher"    column="steam_lsinpher"    />
+        <result property="steamLsoutsctu"    column="steam_lsoutsctu"    />
+        <result property="steamLsoutvjiu"    column="steam_lsoutvjiu"    />
+        <result property="steamLsoutewuliu"    column="steam_lsoutewuliu"    />
+        <result property="steamLsoutewusan"    column="steam_lsoutewusan"    />
+        <result property="steamLsouttracing"    column="steam_lsouttracing"    />
+        <result property="steamLsoutesan"    column="steam_lsoutesan"    />
+        <result property="steamLsoutesi"    column="steam_lsoutesi"    />
+        <result property="steamLsoutother"    column="steam_lsoutother"    />
+        <result property="napOne"    column="nap_one"    />
+        <result property="napTwo"    column="nap_two"    />
+        <result property="napThree"    column="nap_three"    />
+        <result property="ehtOne"    column="eht_one"    />
+        <result property="ehtTwo"    column="eht_two"    />
+        <result property="ehtThree"    column="eht_three"    />
+        <result property="ehtFour"    column="eht_four"    />
+        <result property="ehtFive"    column="eht_five"    />
+        <result property="acrOne"    column="acr_one"    />
+        <result property="acrTwo"    column="acr_two"    />
+        <result property="acrThree"    column="acr_three"    />
+        <result property="acrFour"    column="acr_four"    />
+        <result property="acrZero"    column="acr_zero"    />
+        <result property="proTwo"    column="pro_two"    />
+        <result property="proOne"    column="pro_one"    />
+        <result property="proThree"    column="pro_three"    />
+        <result property="proFour"    column="pro_four"    />
+        <result property="ssBcc"    column="ss_bcc"    />
+        <result property="ssSub"    column="ss_sub"    />
+        <result property="ssEu"    column="ss_eu"    />
+        <result property="ssPgu"    column="ss_pgu"    />
+        <result property="hhpBcc"    column="hhp_bcc"    />
+        <result property="hhpSub"    column="hhp_sub"    />
+        <result property="hsBcc"    column="hs_bcc"    />
+        <result property="hsSub"    column="hs_sub"    />
+        <result property="hsEu"    column="hs_eu"    />
+        <result property="hsPgu"    column="hs_pgu"    />
+        <result property="msBcc"    column="ms_bcc"    />
+        <result property="msEu"    column="ms_eu"    />
+        <result property="msPgu"    column="ms_pgu"    />
+        <result property="lsBcc"    column="ls_bcc"    />
+        <result property="lsEu"    column="ls_eu"    />
+        <result property="lsPgu"    column="ls_pgu"    />
+        <result property="totalBcc"    column="total_bcc"    />
+        <result property="totalEu"    column="total_eu"    />
+        <result property="zongBcc"    column="zong_bcc"    />
+        <result property="zongEu"    column="zong_eu"    />
+        <result property="zongPgu"    column="zong_pgu"    />
+        <result property="outputYixi"    column="output_yixi"    />
+        <result property="outputBx"    column="output_bx"    />
+        <result property="outputAnnual"    column="output_annual"    />
+        <result property="instantaneous"    column="instantaneous"    />
+        <result property="cumulative"    column="cumulative"    />
+        <result property="steamHsouthc230"    column="steam_hsouthc230"    />
     </resultMap>
 
 
-</mapper>
+</mapper>