Selaa lähdekoodia

王子文 生产日报导入

wangggziwen 2 vuotta sitten
vanhempi
commit
94a925576e

+ 21 - 0
master/src/main/java/com/ruoyi/project/production/controller/TDailyProductionReportController.java

@@ -2,6 +2,9 @@ package com.ruoyi.project.production.controller;
 
 import java.util.Date;
 import java.util.List;
+
+import com.ruoyi.project.system.domain.SysUser;
+import com.ruoyi.project.training.spec.domain.vo.TStPlanImportVO;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -20,6 +23,7 @@ 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;
+import org.springframework.web.multipart.MultipartFile;
 
 /**
  * 每日生产报告Controller
@@ -34,6 +38,23 @@ public class TDailyProductionReportController extends BaseController
     @Autowired
     private ITDailyProductionReportService tDailyProductionReportService;
 
+    /**
+     * 导入每日生产报告数据
+     *
+     * @param file 用户上传的文件
+     * @param updateSupport 是否更新支持,如果已存在,则进行更新数据
+     * @return
+     * @throws Exception
+     */
+    @Log(title = "每日生产报告", businessType = BusinessType.IMPORT)
+    @PreAuthorize("@ss.hasPermi('production:report:add')")
+    @PostMapping("/importData")
+    public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception
+    {
+        String message = tDailyProductionReportService.importData(file, updateSupport);
+        return AjaxResult.success(message);
+    }
+
     /**
      * 查询日期最新的每日生产报告列表
      */

+ 11 - 0
master/src/main/java/com/ruoyi/project/production/service/ITDailyProductionReportService.java

@@ -1,8 +1,10 @@
 package com.ruoyi.project.production.service;
 
+import java.io.IOException;
 import java.util.Date;
 import java.util.List;
 import com.ruoyi.project.production.domain.TDailyProductionReport;
+import org.springframework.web.multipart.MultipartFile;
 
 /**
  * 每日生产报告Service接口
@@ -66,4 +68,13 @@ public interface ITDailyProductionReportService
      * @return 结果
      */
     public int deleteTDailyProductionReportById(Long id);
+
+    /**
+     * 导入每日生产报告数据
+     *
+     * @param file 用户上传的文件
+     * @param isUpdateSupport 是否更新支持,如果已存在,则进行更新数据
+     * @return 结果
+     */
+    public String importData(MultipartFile file, boolean isUpdateSupport) throws IOException;
 }

+ 391 - 1
master/src/main/java/com/ruoyi/project/production/service/impl/TDailyProductionReportServiceImpl.java

@@ -1,12 +1,16 @@
 package com.ruoyi.project.production.service.impl;
 
+import java.io.IOException;
 import java.util.Date;
 import java.util.List;
+
+import org.apache.poi.ss.usermodel.*;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.ruoyi.project.production.mapper.TDailyProductionReportMapper;
 import com.ruoyi.project.production.domain.TDailyProductionReport;
 import com.ruoyi.project.production.service.ITDailyProductionReportService;
+import org.springframework.web.multipart.MultipartFile;
 
 /**
  * 每日生产报告Service业务层处理
@@ -101,4 +105,390 @@ public class TDailyProductionReportServiceImpl implements ITDailyProductionRepor
     {
         return tDailyProductionReportMapper.deleteTDailyProductionReportById(id);
     }
-}
+
+    /**
+     * 导入每日生产报告数据
+     *
+     * @param file 用户上传的文件
+     * @param isUpdateSupport 是否更新支持,如果已存在,则进行更新数据
+     * @return 结果
+     */
+    @Override
+    public String importData(MultipartFile file, boolean isUpdateSupport) throws IOException {
+        // 获取用户上传的excel
+        Workbook wb = WorkbookFactory.create(file.getInputStream());
+
+        // 获取第一个sheet
+        Sheet sheet = wb.getSheetAt(0);
+
+        // 用户上传的生产日报
+        TDailyProductionReport tDailyProductionReport = new TDailyProductionReport();
+
+        // rowIndex = 1
+        tDailyProductionReport.setFromDate(this.getCellDataDate(sheet, 1, 10));
+
+        // rowIndex = 2
+        tDailyProductionReport.setToDate(this.getCellDataDate(sheet, 1, 12));
+        tDailyProductionReport.setReportDate(this.getCellDataDate(sheet, 2, 21));
+
+        // rowIndex = 4
+        tDailyProductionReport.setNap(this.getCellDataString(sheet, 4, 0));
+
+        // rowIndex = 5
+        tDailyProductionReport.setH2YieldPercentage(this.getCellDataString(sheet, 5, 6));
+        tDailyProductionReport.setH2Produced(this.getCellDataString(sheet, 5, 7));
+        tDailyProductionReport.setH2Inventory(this.getCellDataString(sheet, 5, 8));
+        tDailyProductionReport.setH2Change(this.getCellDataString(sheet, 5, 9));
+        tDailyProductionReport.setH2Import(this.getCellDataString(sheet, 5, 10));
+        tDailyProductionReport.setH2Export(this.getCellDataString(sheet, 5, 11));
+        tDailyProductionReport.setH2ToPgu(this.getCellDataString(sheet, 5, 12));
+        tDailyProductionReport.setH2ToYpc(this.getCellDataString(sheet, 5, 13));
+        tDailyProductionReport.setH2ToOxo(this.getCellDataString(sheet, 5, 14));
+        tDailyProductionReport.setH2FrSyngasToSub(this.getCellDataString(sheet, 5, 15));
+
+        // rowIndex = 6
+        tDailyProductionReport.setC5(this.getCellDataString(sheet, 6, 0));
+
+        // rowIndex = 7
+        tDailyProductionReport.setEthylenYieldPercentage(this.getCellDataString(sheet, 7, 6));
+        tDailyProductionReport.setEthylenProduced(this.getCellDataString(sheet, 7, 7));
+        tDailyProductionReport.setEthylenInventory(this.getCellDataString(sheet, 7, 8));
+        tDailyProductionReport.setEthylenChange(this.getCellDataString(sheet, 7, 9));
+        tDailyProductionReport.setEthylenImport(this.getCellDataString(sheet, 7, 10));
+        tDailyProductionReport.setEthylenExport(this.getCellDataString(sheet, 7, 11));
+        tDailyProductionReport.setEthylenToTm(this.getCellDataString(sheet, 7, 12));
+        tDailyProductionReport.setEthylenToTs(this.getCellDataString(sheet, 7, 13));
+        tDailyProductionReport.setEthylenToEoEg(this.getCellDataString(sheet, 7, 14));
+        tDailyProductionReport.setEthylenToOxo(this.getCellDataString(sheet, 7, 15));
+        tDailyProductionReport.setEthylenToYbs(this.getCellDataString(sheet, 7, 16));
+        tDailyProductionReport.setEthylenToYpc(this.getCellDataString(sheet, 7, 17));
+        tDailyProductionReport.setEthylenToWacker(this.getCellDataString(sheet, 7, 18));
+        tDailyProductionReport.setEthylenToDyna(this.getCellDataString(sheet, 7, 19));
+        tDailyProductionReport.setEthylenToCelanLongx(this.getCellDataString(sheet, 7, 20));
+        tDailyProductionReport.setEthylenFrYpc(this.getCellDataString(sheet, 7, 21));
+        tDailyProductionReport.setEthylenFrLongxiang(this.getCellDataString(sheet, 7, 22));
+
+        // rowIndex = 8
+        tDailyProductionReport.setC6C8Na(this.getCellDataString(sheet, 8, 0));
+
+        // rowIndex = 9
+        tDailyProductionReport.setPropyleneYieldPercentage(this.getCellDataString(sheet, 9, 6));
+        tDailyProductionReport.setPropyleneProduced(this.getCellDataString(sheet, 9, 7));
+        tDailyProductionReport.setPropyleneInventory(this.getCellDataString(sheet, 9, 8));
+        tDailyProductionReport.setPropyleneChange(this.getCellDataString(sheet, 9, 9));
+        tDailyProductionReport.setPropyleneImport(this.getCellDataString(sheet, 9, 10));
+        tDailyProductionReport.setPropyleneExport(this.getCellDataString(sheet, 9, 11));
+        tDailyProductionReport.setPropyleneToAaAe(this.getCellDataString(sheet, 9, 12));
+        tDailyProductionReport.setPropyleneToGaa(this.getCellDataString(sheet, 9, 13));
+        tDailyProductionReport.setPropyleneToOxo(this.getCellDataString(sheet, 9, 14));
+        tDailyProductionReport.setPropyleneToLdpe(this.getCellDataString(sheet, 9, 15));
+        tDailyProductionReport.setPropyleneToYpc(this.getCellDataString(sheet, 9, 16));
+        tDailyProductionReport.setPropyleneToRoad(this.getCellDataString(sheet, 9, 17));
+        tDailyProductionReport.setPropyleneToShip(this.getCellDataString(sheet, 9, 18));
+        tDailyProductionReport.setPropyleneFrYpc(this.getCellDataString(sheet, 9, 19));
+        tDailyProductionReport.setPropyleneFrShip(this.getCellDataString(sheet, 9, 20));
+        tDailyProductionReport.setPropyleneFrChengzhi(this.getCellDataString(sheet, 9, 21));
+
+        // rowIndex = 10
+        tDailyProductionReport.setWisonEthane(this.getCellDataString(sheet, 10, 0));
+        tDailyProductionReport.setC3LpgYieldPercentage(this.getCellDataString(sheet, 10, 6));
+        tDailyProductionReport.setC3LpgProduced(this.getCellDataString(sheet, 10, 7));
+
+        // rowIndex = 11
+        tDailyProductionReport.setC4LpgYieldPercentage(this.getCellDataString(sheet, 11, 6));
+        tDailyProductionReport.setC4LpgProduced(this.getCellDataString(sheet, 11, 7));
+        tDailyProductionReport.setC3C4Inventory(this.getCellDataString(sheet, 11, 8));
+        tDailyProductionReport.setC3C4Change(this.getCellDataString(sheet, 11, 9));
+        tDailyProductionReport.setC3C4Import(this.getCellDataString(sheet, 11, 10));
+        tDailyProductionReport.setC3C4Export(this.getCellDataString(sheet, 11, 11));
+        tDailyProductionReport.setC3C4ToSub(this.getCellDataString(sheet, 11, 12));
+        tDailyProductionReport.setC3C4ToFurAsFule(this.getCellDataString(sheet, 11, 13));
+        tDailyProductionReport.setC3C4AsFeed(this.getCellDataString(sheet, 11, 14));
+        tDailyProductionReport.setC3C4FrYpc(this.getCellDataString(sheet, 11, 15));
+        tDailyProductionReport.setC3C4FrTruck(this.getCellDataString(sheet, 11, 16));
+
+        // rowIndex = 12
+        tDailyProductionReport.setLpgToFurnace(this.getCellDataString(sheet, 12, 0));
+
+        // rowIndex = 13
+        tDailyProductionReport.setMixedC4sYieldPercentage(this.getCellDataString(sheet, 13, 6));
+        tDailyProductionReport.setMixedC4sProduced(this.getCellDataString(sheet, 13, 7));
+        tDailyProductionReport.setMixedC4sInventory(this.getCellDataString(sheet, 13, 8));
+        tDailyProductionReport.setMixedC4sChange(this.getCellDataString(sheet, 13, 9));
+        tDailyProductionReport.setMixedC4sImport(this.getCellDataString(sheet, 13, 10));
+        tDailyProductionReport.setMixedC4sExport(this.getCellDataString(sheet, 13, 11));
+        tDailyProductionReport.setMixedC4sToBd(this.getCellDataString(sheet, 13, 12));
+        tDailyProductionReport.setMixedC4sToYpc(this.getCellDataString(sheet, 13, 13));
+        tDailyProductionReport.setMixedC4sToTruck(this.getCellDataString(sheet, 13, 14));
+        tDailyProductionReport.setMixedC4sToShip(this.getCellDataString(sheet, 13, 15));
+        tDailyProductionReport.setMixedC4sFrYpc(this.getCellDataString(sheet, 13, 16));
+        tDailyProductionReport.setMixedC4sFrTruck(this.getCellDataString(sheet, 13, 17));
+        tDailyProductionReport.setMixedC4sFrShip(this.getCellDataString(sheet, 13, 18));
+        tDailyProductionReport.setMixedC4sFrBdR1(this.getCellDataString(sheet, 13, 19));
+        tDailyProductionReport.setMixedC4sToR800(this.getCellDataString(sheet, 13, 20));
+
+        // rowIndex = 14
+        tDailyProductionReport.setRaff1FrBd(this.getCellDataString(sheet, 14, 0));
+
+        // rowIndex = 15
+        tDailyProductionReport.setEboYieldPercentage(this.getCellDataString(sheet, 15, 6));
+        tDailyProductionReport.setEboProduced(this.getCellDataString(sheet, 15, 7));
+        tDailyProductionReport.setEboInventory(this.getCellDataString(sheet, 15, 8));
+        tDailyProductionReport.setEboChange(this.getCellDataString(sheet, 15, 9));
+        tDailyProductionReport.setEboImport(this.getCellDataString(sheet, 15, 10));
+        tDailyProductionReport.setEboExport(this.getCellDataString(sheet, 15, 11));
+        tDailyProductionReport.setEboToShip(this.getCellDataString(sheet, 15, 12));
+        tDailyProductionReport.setEboToRttf(this.getCellDataString(sheet, 15, 13));
+        tDailyProductionReport.setEboToTrain(this.getCellDataString(sheet, 15, 14));
+        tDailyProductionReport.setEboFrBd(this.getCellDataString(sheet, 15, 15));
+
+        // rowIndex = 16
+        tDailyProductionReport.setRaff2FrIb(this.getCellDataString(sheet, 16, 0));
+
+        // rowIndex = 17
+        tDailyProductionReport.setNaphthaleneYieldPercentage(this.getCellDataString(sheet, 17, 6));
+        tDailyProductionReport.setNaphthaleneProduced(this.getCellDataString(sheet, 17, 7));
+        tDailyProductionReport.setNaphthaleneInventory(this.getCellDataString(sheet, 17, 8));
+        tDailyProductionReport.setNaphthaleneChange(this.getCellDataString(sheet, 17, 9));
+        tDailyProductionReport.setNaphthaleneImport(this.getCellDataString(sheet, 17, 10));
+        tDailyProductionReport.setNaphthaleneExport(this.getCellDataString(sheet, 17, 11));
+        tDailyProductionReport.setNaphthaleneToTruck(this.getCellDataString(sheet, 17, 12));
+
+        // rowIndex = 18
+        tDailyProductionReport.setRaff3FrBd(this.getCellDataString(sheet, 18, 0));
+        tDailyProductionReport.setAeuBenzeneToShip(this.getCellDataString(sheet, 18, 20));
+        tDailyProductionReport.setAeuBenzeneFrShip(this.getCellDataString(sheet, 18, 21));
+
+        // rowIndex = 19
+        tDailyProductionReport.setPoFluxOilYieldPercentage(this.getCellDataString(sheet, 19, 6));
+        tDailyProductionReport.setPoFluxOilProduced(this.getCellDataString(sheet, 19, 7));
+        tDailyProductionReport.setPoFluxOilInventory(this.getCellDataString(sheet, 19, 8));
+        tDailyProductionReport.setPoFluxOilChange(this.getCellDataString(sheet, 19, 9));
+        tDailyProductionReport.setPoFluxOilImport(this.getCellDataString(sheet, 19, 10));
+        tDailyProductionReport.setPoFluxOilExport(this.getCellDataString(sheet, 19, 11));
+        tDailyProductionReport.setPoFluxOilToBd(this.getCellDataString(sheet, 19, 12));
+
+        // rowIndex = 20
+        tDailyProductionReport.setRaff3FrBd(this.getCellDataString(sheet, 20, 0));
+        tDailyProductionReport.setAeuBenzeneToYbs(this.getCellDataString(sheet, 20, 20));
+
+        // rowIndex = 21
+        tDailyProductionReport.setOffgasYieldPercentage(this.getCellDataString(sheet, 21, 6));
+        tDailyProductionReport.setOffgasProduced(this.getCellDataString(sheet, 21, 7));
+        tDailyProductionReport.setOffgasInventory(this.getCellDataString(sheet, 21, 8));
+        tDailyProductionReport.setOffgasChange(this.getCellDataString(sheet, 21, 9));
+        tDailyProductionReport.setOffgasImport(this.getCellDataString(sheet, 21, 10));
+        tDailyProductionReport.setOffgasExport(this.getCellDataString(sheet, 21, 11));
+        tDailyProductionReport.setOffgasToFurnance(this.getCellDataString(sheet, 21, 12));
+        tDailyProductionReport.setOffgasToYbs(this.getCellDataString(sheet, 21, 13));
+        tDailyProductionReport.setOffgasToCEru(this.getCellDataString(sheet, 21, 14));
+        tDailyProductionReport.setOffgasSubInCloseU2(this.getCellDataString(sheet, 21, 15));
+        tDailyProductionReport.setOffgasFlareSctu(this.getCellDataString(sheet, 21, 16));
+        tDailyProductionReport.setOffgasToU2Nm3(this.getCellDataString(sheet, 21, 17));
+        tDailyProductionReport.setOffgasFlareLossT(this.getCellDataString(sheet, 21, 18));
+
+        // rowIndex = 22
+        tDailyProductionReport.setC2FrLdpe(this.getCellDataString(sheet, 22, 0));
+        tDailyProductionReport.setAeuBenzeneToRttf(this.getCellDataString(sheet, 22, 20));
+        tDailyProductionReport.setAeuBenzeneToTrain(this.getCellDataString(sheet, 22, 21));
+
+        // rowIndex = 23
+        tDailyProductionReport.setRpgYieldPercentage(this.getCellDataString(sheet, 23, 6));
+        tDailyProductionReport.setRpgProduced(this.getCellDataString(sheet, 23, 7));
+        tDailyProductionReport.setRpgInventory(this.getCellDataString(sheet, 23, 8));
+        tDailyProductionReport.setRpgChange(this.getCellDataString(sheet, 23, 9));
+        tDailyProductionReport.setRpgImport(this.getCellDataString(sheet, 23, 10));
+        tDailyProductionReport.setRpgExport(this.getCellDataString(sheet, 23, 11));
+        tDailyProductionReport.setRpgToPgu(this.getCellDataString(sheet, 23, 12));
+        tDailyProductionReport.setRpgFrYfcc(this.getCellDataString(sheet, 23, 13));
+
+        // rowIndex = 24
+        tDailyProductionReport.setC3FrOxo(this.getCellDataString(sheet, 24, 0));
+
+        // rowIndex = 25
+        tDailyProductionReport.setMethaneYieldPercentage(this.getCellDataString(sheet, 25, 6));
+        tDailyProductionReport.setMethaneProduced(this.getCellDataString(sheet, 25, 7));
+        tDailyProductionReport.setMethaneToEoEg(this.getCellDataString(sheet, 25, 8));
+        tDailyProductionReport.setAeuTolueneToShip(this.getCellDataString(sheet, 25, 20));
+        tDailyProductionReport.setAeuTolueneFrShip(this.getCellDataString(sheet, 25, 21));
+
+        // rowIndex = 26
+        tDailyProductionReport.setMixedC3C4(this.getCellDataString(sheet, 26, 0));
+        tDailyProductionReport.setAeuBenzeneYeildPercentage(this.getCellDataString(sheet, 26, 17));
+        tDailyProductionReport.setAeuBenzeneInventory(this.getCellDataString(sheet, 26, 18));
+
+        // rowIndex = 27
+        tDailyProductionReport.setResidueOilYieldPercentage(this.getCellDataString(sheet, 27, 6));
+        tDailyProductionReport.setResidueOilProduced(this.getCellDataString(sheet, 27, 7));
+        tDailyProductionReport.setAeuBenzeneProduced(this.getCellDataString(sheet, 27, 17));
+        tDailyProductionReport.setAeuBenzeneChange(this.getCellDataString(sheet, 27, 18));
+        tDailyProductionReport.setAeuTolueneToYpc(this.getCellDataString(sheet, 27, 20));
+        tDailyProductionReport.setAeuTolueneFrYpc(this.getCellDataString(sheet, 27, 21));
+
+        // rowIndex = 28
+        tDailyProductionReport.setHyC9(this.getCellDataString(sheet, 28, 0));
+        tDailyProductionReport.setAeuTolueneYeildPercentage(this.getCellDataString(sheet, 28, 17));
+        tDailyProductionReport.setAeuTolueneInventory(this.getCellDataString(sheet, 28, 18));
+
+        // rowIndex = 29
+        tDailyProductionReport.setAeuTolueneProduced(this.getCellDataString(sheet, 29, 17));
+        tDailyProductionReport.setAeuTolueneChange(this.getCellDataString(sheet, 29, 18));
+        tDailyProductionReport.setAeuTolueneToRttf(this.getCellDataString(sheet, 29, 20));
+        tDailyProductionReport.setAeuTolueneFrYbs(this.getCellDataString(sheet, 29, 21));
+
+        // rowIndex = 30
+        tDailyProductionReport.setPguOffgas(this.getCellDataString(sheet, 30, 0));
+        tDailyProductionReport.setPguAeuTH(this.getCellDataString(sheet, 30, 13));
+        tDailyProductionReport.setAeuXyleneYeildPercentage(this.getCellDataString(sheet, 30, 17));
+        tDailyProductionReport.setAeuXyleneInventory(this.getCellDataString(sheet, 30, 18));
+
+        // rowIndex = 31
+        tDailyProductionReport.setAeuXyleneProduced(this.getCellDataString(sheet, 31, 17));
+        tDailyProductionReport.setAeuXyleneChange(this.getCellDataString(sheet, 31, 18));
+        tDailyProductionReport.setAeuTolueneToEu(this.getCellDataString(sheet, 31, 20));
+
+        // rowIndex = 32
+        tDailyProductionReport.setWashOil(this.getCellDataString(sheet, 32, 0));
+        tDailyProductionReport.setPguToAeu(this.getCellDataString(sheet, 32, 13));
+        tDailyProductionReport.setAeuC6C8NaYeildPercentage(this.getCellDataString(sheet, 32, 17));
+        tDailyProductionReport.setAeuC6C8NaInventory(this.getCellDataString(sheet, 32, 18));
+
+        // rowIndex = 33
+        tDailyProductionReport.setPguRpgTH(this.getCellDataString(sheet, 33, 6));
+        tDailyProductionReport.setPguBtxYeildPercentage(this.getCellDataString(sheet, 33, 10));
+        tDailyProductionReport.setPguBtxInventory(this.getCellDataString(sheet, 33, 11));
+        tDailyProductionReport.setPguBtxExport(this.getCellDataString(sheet, 33, 12));
+        tDailyProductionReport.setAeuC6C8NaProduced(this.getCellDataString(sheet, 33, 17));
+        tDailyProductionReport.setAeuC6C8NaChange(this.getCellDataString(sheet, 33, 18));
+
+        // rowIndex = 34
+        tDailyProductionReport.setToluene(this.getCellDataString(sheet, 34, 0));
+        tDailyProductionReport.setRpgToPgu(this.getCellDataString(sheet, 34, 6));
+        tDailyProductionReport.setPguBtxProduced(this.getCellDataString(sheet, 34, 10));
+        tDailyProductionReport.setPguBtxChange(this.getCellDataString(sheet, 34, 11));
+        tDailyProductionReport.setPguBtxToAeu(this.getCellDataString(sheet, 34, 12));
+        tDailyProductionReport.setAeuToPgu(this.getCellDataString(sheet, 34, 13));
+        tDailyProductionReport.setAeuXyleneToShip(this.getCellDataString(sheet, 34, 20));
+        tDailyProductionReport.setAeuXyleneFrShip(this.getCellDataString(sheet, 34, 21));
+
+        // rowIndex = 35
+        tDailyProductionReport.setPguRpg1(this.getCellDataString(sheet, 35, 5));
+
+        // rowIndex = 36
+        tDailyProductionReport.setHyC4FrR800(this.getCellDataString(sheet, 36, 0));
+        tDailyProductionReport.setPguRpg2(this.getCellDataString(sheet, 36, 5));
+        tDailyProductionReport.setPguToRpg(this.getCellDataString(sheet, 36, 6));
+        tDailyProductionReport.setAeuTotalFeed(this.getCellDataString(sheet, 36, 17));
+        tDailyProductionReport.setPguAeuTotalFeed(this.getCellDataString(sheet, 36, 18));
+        tDailyProductionReport.setAeuXyleneToYpc(this.getCellDataString(sheet, 36, 20));
+        tDailyProductionReport.setAeuXyleneFrYpc(this.getCellDataString(sheet, 36, 21));
+
+        // rowIndex = 37
+        tDailyProductionReport.setPguWashoilYeildPercentage(this.getCellDataString(sheet, 37, 10));
+        tDailyProductionReport.setPguWashoilInventory(this.getCellDataString(sheet, 37, 11));
+        tDailyProductionReport.setAeuOutput(this.getCellDataString(sheet, 37, 17));
+        tDailyProductionReport.setPguAeuOutput(this.getCellDataString(sheet, 37, 18));
+
+        // rowIndex = 38
+        tDailyProductionReport.setTotalInput(this.getCellDataString(sheet, 38, 2));
+        tDailyProductionReport.setPguWashoilProduced(this.getCellDataString(sheet, 38, 10));
+        tDailyProductionReport.setPguWashoilChange(this.getCellDataString(sheet, 38, 11));
+        tDailyProductionReport.setPguWashoilToEu(this.getCellDataString(sheet, 38, 12));
+        tDailyProductionReport.setAeuTotalLoss(this.getCellDataString(sheet, 38, 17));
+        tDailyProductionReport.setPguAeuTotalLoss(this.getCellDataString(sheet, 38, 18));
+        tDailyProductionReport.setAeuXyleneToRttf(this.getCellDataString(sheet, 38, 20));
+
+        // rowIndex = 39
+        tDailyProductionReport.setTotalOutput(this.getCellDataString(sheet, 39, 2));
+        tDailyProductionReport.setPguH2(this.getCellDataString(sheet, 39, 5));
+        tDailyProductionReport.setPguOffgasYeildPercentage(this.getCellDataString(sheet, 39, 10));
+        tDailyProductionReport.setPguOffgasInventory(this.getCellDataString(sheet, 39, 11));
+        tDailyProductionReport.setAeuLossPercentage(this.getCellDataString(sheet, 39, 17));
+        tDailyProductionReport.setPguAeuLossPercentage(this.getCellDataString(sheet, 39, 18));
+
+        // rowIndex = 40
+        tDailyProductionReport.setTotalLoss(this.getCellDataString(sheet, 40, 2));
+        tDailyProductionReport.setPguOffgasProduced(this.getCellDataString(sheet, 40, 10));
+        tDailyProductionReport.setPguOffgasChange(this.getCellDataString(sheet, 40, 11));
+        tDailyProductionReport.setPguOffgasToEu(this.getCellDataString(sheet, 40, 12));
+        tDailyProductionReport.setAeuFeedLoadPercentage(this.getCellDataString(sheet, 40, 17));
+        tDailyProductionReport.setPguAeuFeedLoadPercentage(this.getCellDataString(sheet, 40, 18));
+
+        // rowIndex = 41
+        tDailyProductionReport.setLossPercentage(this.getCellDataString(sheet, 41, 2));
+        tDailyProductionReport.setPguTotalFeed(this.getCellDataString(sheet, 41, 6));
+        tDailyProductionReport.setPguC5YeildPercentage(this.getCellDataString(sheet, 41, 10));
+        tDailyProductionReport.setPguC5Inventory(this.getCellDataString(sheet, 41, 11));
+        tDailyProductionReport.setPguC5Export(this.getCellDataString(sheet, 41, 12));
+        tDailyProductionReport.setAeuC6C8NaToEu(this.getCellDataString(sheet, 41, 20));
+        tDailyProductionReport.setAeuC6C8NaToYpc(this.getCellDataString(sheet, 41, 21));
+
+        // rowIndex = 42
+        tDailyProductionReport.setTotalFurnanceFeed(this.getCellDataString(sheet, 42, 2));
+        tDailyProductionReport.setPguOutput(this.getCellDataString(sheet, 42, 6));
+        tDailyProductionReport.setPguC5Produced(this.getCellDataString(sheet, 42, 10));
+        tDailyProductionReport.setPguC5Change(this.getCellDataString(sheet, 42, 11));
+        tDailyProductionReport.setPguC5ToAeu(this.getCellDataString(sheet, 42, 12));
+        tDailyProductionReport.setPguC5ToEu(this.getCellDataString(sheet, 42, 13));
+        tDailyProductionReport.setPguC5ToYuanguan(this.getCellDataString(sheet, 42, 14));
+
+        // rowIndex = 43
+        tDailyProductionReport.setNapFrCltf(this.getCellDataString(sheet, 43, 2));
+        tDailyProductionReport.setPguTotalLoss(this.getCellDataString(sheet, 43, 6));
+        tDailyProductionReport.setPguC9YeildPercentage(this.getCellDataString(sheet, 43, 10));
+        tDailyProductionReport.setPguC9Inventory(this.getCellDataString(sheet, 43, 11));
+        tDailyProductionReport.setPguC9Export(this.getCellDataString(sheet, 43, 12));
+
+        // rowIndex = 44
+        tDailyProductionReport.setTotalPE(this.getCellDataString(sheet, 44, 2));
+        tDailyProductionReport.setPguLossPercentage(this.getCellDataString(sheet, 44, 6));
+        tDailyProductionReport.setPguC9Produced(this.getCellDataString(sheet, 44, 10));
+        tDailyProductionReport.setPguC9Change(this.getCellDataString(sheet, 44, 11));
+        tDailyProductionReport.setPguC9ToAeu(this.getCellDataString(sheet, 44, 12));
+        tDailyProductionReport.setPguC9ToRttf(this.getCellDataString(sheet, 44, 13));
+        tDailyProductionReport.setPguC9ToShip(this.getCellDataString(sheet, 44, 14));
+        tDailyProductionReport.setPguC9ToYfcc(this.getCellDataString(sheet, 44, 15));
+
+        // rowIndex = 45
+        tDailyProductionReport.setPlantModeIs(this.getCellDataString(sheet, 45, 2));
+        tDailyProductionReport.setPguFeedLoadPercentage(this.getCellDataString(sheet, 45, 6));
+
+        // rowIndex = 46
+        tDailyProductionReport.setPlantLoad3495tD(this.getCellDataString(sheet, 46, 2));
+
+        // rowIndex = 47
+        tDailyProductionReport.setAvgFurnanceFeedTH(this.getCellDataString(sheet, 47, 2));
+
+        // rowIndex = 48
+        tDailyProductionReport.setFeedingRatioPercentage(this.getCellDataString(sheet, 48, 2));
+
+        // 新增一条生产日报记录
+//        tDailyProductionReportMapper.insertTDailyProductionReport(tDailyProductionReport);
+
+        return null;
+    }
+
+    private String getCellDataString(Sheet sheet, int rowIndex, int cellIndex) {
+        String cellValue = null;
+        // 根据行下标,获取行对象
+        Row row = sheet.getRow(rowIndex);
+        // 根据列下表,获取单元格对象,如果单元格的值为空,则返回null
+        Cell cell = row.getCell(cellIndex, Row.MissingCellPolicy.RETURN_BLANK_AS_NULL);
+        // 设置单元格格式
+        cell.setCellType(CellType.STRING);
+        // 获取单元格数据
+        if (cellValue != null) {
+            cellValue =  cell.getStringCellValue();
+        }
+        return cellValue;
+    }
+
+    private Date getCellDataDate(Sheet sheet, int rowIndex, int cellIndex) {
+        // 根据行下标,获取行对象
+        Row row = sheet.getRow(rowIndex);
+        // 根据列下表,获取单元格对象,如果单元格的值为空,则返回null
+        Cell cell = row.getCell(cellIndex, Row.MissingCellPolicy.RETURN_BLANK_AS_NULL);
+        // 获取单元格数据
+        return cell.getDateCellValue();
+    }
+}

+ 45 - 5
ui/src/views/production/daily/index.vue

@@ -93,7 +93,7 @@
             <td class="no-border bg-blue">{{reportData.reportDate}}</td>
           </tr>
           <tr>
-            <td class="bg-blue-light">Nap</td>
+            <td class="bg-blue-light" id="Nap">Nap</td>
             <td class="no-border"></td>
             <td class="bg-green" rowspan="35">Cracker</td>
             <td class="no-border" rowspan="2" colspan="2"></td>
@@ -2792,6 +2792,36 @@
         </table>
       </div>
     </form>
+    <!-- 用户导入对话框 -->
+    <el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
+      <el-upload
+        ref="upload"
+        :limit="1"
+        accept=".xlsx, .xls"
+        :headers="upload.headers"
+        :action="upload.url + '?updateSupport=' + upload.updateSupport"
+        :disabled="upload.isUploading"
+        :on-progress="handleFileUploadProgress"
+        :on-success="handleFileSuccess"
+        :auto-upload="false"
+        drag
+      >
+        <i class="el-icon-upload"></i>
+        <div class="el-upload__text">
+          将文件拖到此处,或
+          <em>点击上传</em>
+        </div>
+        <!--<div class="el-upload__tip" slot="tip">-->
+          <!--<el-checkbox v-model="upload.updateSupport" />是否更新已经存在的用户数据-->
+          <!--<el-link type="info" style="font-size:12px" @click="importTemplate">下载模板</el-link>-->
+        <!--</div>-->
+        <div class="el-upload__tip" style="color:red" slot="tip">提示:仅允许导入“xls”或“xlsx”格式文件!</div>
+      </el-upload>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitFileForm">确 定</el-button>
+        <el-button @click="upload.open = false">取 消</el-button>
+      </div>
+    </el-dialog>
   </div>
 </template>
 
@@ -3945,6 +3975,17 @@ export default {
       this.getTreeselect();
       this.loading = false;
   },
+  // mounted() {
+  //   let element = document.getElementById("Nap");
+  //   let offsetHeight = element.offsetHeight;  // 页面渲染后的单元格高度
+  //   let top = 0 - offsetHeight; // 箭头元素相对定位top属性的值
+  //   let elements = document.getElementsByClassName("triangle-right"); // 箭头元素数组
+  //   Array.prototype.forEach.call(elements, function (element) { // 遍历
+  //     element.setAttribute("position", "relative"); // 相对定位
+  //     element.setAttribute("right", "-8px");  // 向右移8px
+  //     element.setAttribute("top", top + "px");  // 向上移一个单元格的高度
+  //   });
+  // },
   methods: {
     /** 编辑按钮操作 */
     handleUpdate(row) {
@@ -4634,7 +4675,7 @@ export default {
     },
       /** 导入按钮操作 */
       handleImport() {
-          this.upload.title = "用户导入";
+          this.upload.title = "生产日报导入";
           this.upload.open = true;
       },
       /** 下载模板操作 */
@@ -4683,9 +4724,8 @@ export default {
     border-width:8px;
     display:inline-block;
     float:right;
-    position:relative;
-    right:-8px;
-    top:-24px;
+    /*position:relative;*/
+    /*right:-8px;*/
   }
   .triangle-bottom{
     height:8px;