浏览代码

Merge branch 'master' of E:\newcpms with conflicts.

wangggziwen 6 月之前
父节点
当前提交
1c194e7ed3

+ 12 - 0
master/src/main/java/com/ruoyi/project/common/CommonController.java

@@ -397,6 +397,18 @@ public class CommonController extends BaseController
         }else if( type.equals("nitrogen") ) {
             downloadname = "PSSR氮气置换导入模板.xlsx";
             url = "static/template/pssr/nitrogen.xlsx";
+        }else if( type.equals("safetyBrust") ) {
+            downloadname = "PSSR安全设施-爆破片导入模板.xlsx";
+            url = "static/template/pssr/safetyBrust.xlsx";
+        }else if( type.equals("safetyBreath") ) {
+            downloadname = "PSSR安全设施-呼吸阀导入模板.xlsx";
+            url = "static/template/pssr/safetyBreath.xlsx";
+        }else if( type.equals("safetyBleed") ) {
+            downloadname = "PSSR安全设施-泄放阀导入模板.xlsx";
+            url = "static/template/pssr/safetyBleed.xlsx";
+        }else if( type.equals("safetyFlamearrester") ) {
+            downloadname = "PSSR安全设施-灭火器导入模板.xlsx";
+            url = "static/template/pssr/safetyFlamearrester.xlsx";
         }
 
         InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream(url);

+ 103 - 3
master/src/main/java/com/ruoyi/project/pssr/controller/TPssrSafetyBleedController.java

@@ -1,5 +1,6 @@
 package com.ruoyi.project.pssr.controller;
 
+import com.alibaba.fastjson.JSON;
 import com.ruoyi.common.utils.DateUtils;
 import com.ruoyi.common.utils.file.ExcelUtils;
 import com.ruoyi.common.utils.poi.ExcelUtil;
@@ -9,24 +10,28 @@ import com.ruoyi.framework.web.controller.BaseController;
 import com.ruoyi.framework.web.domain.AjaxResult;
 import com.ruoyi.framework.web.page.TableDataInfo;
 import com.ruoyi.project.pssr.domain.TPssrSafetyBleed;
+import com.ruoyi.project.pssr.domain.TPssrSafetyBleed;
 import com.ruoyi.project.pssr.service.ITPssrFileService;
 import com.ruoyi.project.pssr.service.ITPssrSafetyBleedService;
 import com.ruoyi.project.pssr.service.ITPssrTurndownService;
+import com.ruoyi.project.system.domain.SysDept;
 import com.ruoyi.project.system.domain.SysUser;
+import com.ruoyi.project.system.service.ISysDeptService;
 import com.ruoyi.project.system.service.ISysUserService;
-import org.apache.poi.ss.usermodel.Cell;
-import org.apache.poi.ss.usermodel.CellStyle;
-import org.apache.poi.ss.usermodel.Row;
+import org.apache.poi.ss.usermodel.*;
 import org.apache.poi.xssf.usermodel.XSSFSheet;
 import org.apache.poi.xssf.usermodel.XSSFWorkbook;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
 
 import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
 import java.util.List;
 
 /**
@@ -50,6 +55,101 @@ public class TPssrSafetyBleedController extends BaseController {
     private ISysUserService sysUserService;
     private String forShort = "aqss-bd";
 
+    @Autowired
+    private ISysDeptService iSysDeptService;
+
+    @Autowired
+    private ISysUserService userService;
+
+    /**
+     * 批量导入
+     */
+    @PreAuthorize("@ss.hasPermi('pssr:safetyBleed:add')")
+    @PostMapping("/importData")
+    public AjaxResult importInterlockData(MultipartFile file, Long subId) throws IOException
+    {
+        //获取操作人员ID
+        Long userId = getUserId();
+        //报错行数统计
+        List<Integer> failRow =new ArrayList<Integer>();
+        Workbook workbook = ExcelUtils.getWorkBook(file);
+        Sheet sheet = workbook.getSheetAt(0);
+        List<TPssrSafetyBleed> list = new ArrayList<TPssrSafetyBleed>();
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+        //部门查询
+        List<SysDept> dept = iSysDeptService.selectDeptList(new SysDept());
+        int rowNum = sheet.getPhysicalNumberOfRows();
+        int failNumber = 0;
+        for (int i = 2; i <= rowNum; i++) {
+            try {
+                logger.info("读取行数:" + i);
+                Row row = sheet.getRow(i);
+                int cellNum = row.getPhysicalNumberOfCells();
+                TPssrSafetyBleed entity = new TPssrSafetyBleed();
+                entity.setDeptId(userService.selectUserById(getUserId()).getDeptId());
+                entity.setSubId(subId);
+                entity.setApproveStatus(0L);
+                for (int j = 0; j < cellNum; j++) {
+                    Cell cell = row.getCell(j);
+                    String cellValue = ExcelUtils.getCellValue(cell);
+                    logger.info("cellValue:" + cellValue);
+                    if (j == 0) {
+                        entity.setUnit(cellValue);
+                    } else if (j == 1) {
+                        entity.setPidNo(cellValue);
+                    } else if (j == 2) {
+                        entity.setDevNo(cellValue);
+                    } else if (j == 3) {
+                        entity.setVerify(cellValue);
+                    } else if (j == 4) {
+                        entity.setInValidity(cellValue);
+                    } else if (j == 5) {
+                        entity.setInstallLocation(cellValue);
+                    } else if (j == 6) {
+                        entity.setInstallAccuracy(cellValue);
+                    } else if (j == 7) {
+                        entity.setPutUse(cellValue);
+                    } else if (j == 8) {
+                        entity.setSetPressure(cellValue);
+                    } else if (j == 9) {
+                        entity.setUniformPressure(cellValue);
+                    } else if (j == 10) {
+                        if (cellValue.length() > 3) {
+                            entity.setConfirmationTime(new SimpleDateFormat(DateUtils.getDateFormat(cellValue)).parse(cellValue));
+                        }
+                    } else if (j == 11) {
+                        entity.setRemarks(cellValue);
+                    }
+                }
+                entity.setCreaterCode(userId.toString());
+                logger.info("entity:" + entity);
+                list.add(entity);
+            }catch (Exception e){
+                failNumber++;
+                failRow.add(i+1);
+            }
+        }
+        int successNumber = 0;
+        int failNum = 0;
+        for (TPssrSafetyBleed t : list
+        ) {
+            failNum++;
+            try {
+                tPssrSafetyBleedService.insertTPssrSafetyBleed(t);
+                successNumber++;
+            }catch (Exception e){
+                failNumber++;
+                logger.info("e:" + e);
+                failRow.add(failNum+1);
+            }
+        }
+        logger.info("list:" + JSON.toJSONString(list));
+        logger.info("successNumber:" +String.valueOf(successNumber));
+        logger.info("failNumber:" +String.valueOf(failNumber));
+        logger.info("failRow:" +String.valueOf(failRow));
+        return AjaxResult.success("导入成功行数:" + String.valueOf(successNumber));
+    }
+
     /**
      * 查询安全设施-紧急泄放阀列表
      */

+ 103 - 3
master/src/main/java/com/ruoyi/project/pssr/controller/TPssrSafetyBreathController.java

@@ -1,5 +1,6 @@
 package com.ruoyi.project.pssr.controller;
 
+import com.alibaba.fastjson.JSON;
 import com.ruoyi.common.utils.DateUtils;
 import com.ruoyi.common.utils.file.ExcelUtils;
 import com.ruoyi.common.utils.poi.ExcelUtil;
@@ -9,24 +10,28 @@ import com.ruoyi.framework.web.controller.BaseController;
 import com.ruoyi.framework.web.domain.AjaxResult;
 import com.ruoyi.framework.web.page.TableDataInfo;
 import com.ruoyi.project.pssr.domain.TPssrSafetyBreath;
+import com.ruoyi.project.pssr.domain.TPssrSafetyBreath;
 import com.ruoyi.project.pssr.service.ITPssrFileService;
 import com.ruoyi.project.pssr.service.ITPssrSafetyBreathService;
 import com.ruoyi.project.pssr.service.ITPssrTurndownService;
+import com.ruoyi.project.system.domain.SysDept;
 import com.ruoyi.project.system.domain.SysUser;
+import com.ruoyi.project.system.service.ISysDeptService;
 import com.ruoyi.project.system.service.ISysUserService;
-import org.apache.poi.ss.usermodel.Cell;
-import org.apache.poi.ss.usermodel.CellStyle;
-import org.apache.poi.ss.usermodel.Row;
+import org.apache.poi.ss.usermodel.*;
 import org.apache.poi.xssf.usermodel.XSSFSheet;
 import org.apache.poi.xssf.usermodel.XSSFWorkbook;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
 
 import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
 import java.util.List;
 
 /**
@@ -50,6 +55,101 @@ public class TPssrSafetyBreathController extends BaseController {
     private ISysUserService sysUserService;
     private String forShort = "aqss-bh";
 
+    @Autowired
+    private ISysDeptService iSysDeptService;
+
+    @Autowired
+    private ISysUserService userService;
+
+    /**
+     * 批量导入
+     */
+    @PreAuthorize("@ss.hasPermi('pssr:safetyBreath:add')")
+    @PostMapping("/importData")
+    public AjaxResult importInterlockData(MultipartFile file, Long subId) throws IOException
+    {
+        //获取操作人员ID
+        Long userId = getUserId();
+        //报错行数统计
+        List<Integer> failRow =new ArrayList<Integer>();
+        Workbook workbook = ExcelUtils.getWorkBook(file);
+        Sheet sheet = workbook.getSheetAt(0);
+        List<TPssrSafetyBreath> list = new ArrayList<TPssrSafetyBreath>();
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+        //部门查询
+        List<SysDept> dept = iSysDeptService.selectDeptList(new SysDept());
+        int rowNum = sheet.getPhysicalNumberOfRows();
+        int failNumber = 0;
+        for (int i = 2; i <= rowNum; i++) {
+            try {
+                logger.info("读取行数:" + i);
+                Row row = sheet.getRow(i);
+                int cellNum = row.getPhysicalNumberOfCells();
+                TPssrSafetyBreath entity = new TPssrSafetyBreath();
+                entity.setDeptId(userService.selectUserById(getUserId()).getDeptId());
+                entity.setSubId(subId);
+                entity.setApproveStatus(0L);
+                for (int j = 0; j < cellNum; j++) {
+                    Cell cell = row.getCell(j);
+                    String cellValue = ExcelUtils.getCellValue(cell);
+                    logger.info("cellValue:" + cellValue);
+                    if (j == 0) {
+                        entity.setUnit(cellValue);
+                    } else if (j == 1) {
+                        entity.setPidNo(cellValue);
+                    } else if (j == 2) {
+                        entity.setDevNo(cellValue);
+                    } else if (j == 3) {
+                        entity.setVerify(cellValue);
+                    } else if (j == 4) {
+                        entity.setInValidity(cellValue);
+                    } else if (j == 5) {
+                        entity.setInstallLocation(cellValue);
+                    } else if (j == 6) {
+                        entity.setInstallAccuracy(cellValue);
+                    } else if (j == 7) {
+                        entity.setPutUse(cellValue);
+                    } else if (j == 8) {
+                        entity.setSetPressure(cellValue);
+                    } else if (j == 9) {
+                        entity.setUniformPressure(cellValue);
+                    } else if (j == 10) {
+                        if (cellValue.length() > 3) {
+                            entity.setConfirmationTime(new SimpleDateFormat(DateUtils.getDateFormat(cellValue)).parse(cellValue));
+                        }
+                    } else if (j == 11) {
+                        entity.setRemarks(cellValue);
+                    }
+                }
+                entity.setCreaterCode(userId.toString());
+                logger.info("entity:" + entity);
+                list.add(entity);
+            }catch (Exception e){
+                failNumber++;
+                failRow.add(i+1);
+            }
+        }
+        int successNumber = 0;
+        int failNum = 0;
+        for (TPssrSafetyBreath t : list
+        ) {
+            failNum++;
+            try {
+                tPssrSafetyBreathService.insertTPssrSafetyBreath(t);
+                successNumber++;
+            }catch (Exception e){
+                failNumber++;
+                logger.info("e:" + e);
+                failRow.add(failNum+1);
+            }
+        }
+        logger.info("list:" + JSON.toJSONString(list));
+        logger.info("successNumber:" +String.valueOf(successNumber));
+        logger.info("failNumber:" +String.valueOf(failNumber));
+        logger.info("failRow:" +String.valueOf(failRow));
+        return AjaxResult.success("导入成功行数:" + String.valueOf(successNumber));
+    }
+
     /**
      * 查询安全设施-呼吸阀列表
      */

+ 101 - 3
master/src/main/java/com/ruoyi/project/pssr/controller/TPssrSafetyBrustController.java

@@ -1,5 +1,6 @@
 package com.ruoyi.project.pssr.controller;
 
+import com.alibaba.fastjson.JSON;
 import com.ruoyi.common.utils.DateUtils;
 import com.ruoyi.common.utils.file.ExcelUtils;
 import com.ruoyi.common.utils.poi.ExcelUtil;
@@ -9,24 +10,28 @@ import com.ruoyi.framework.web.controller.BaseController;
 import com.ruoyi.framework.web.domain.AjaxResult;
 import com.ruoyi.framework.web.page.TableDataInfo;
 import com.ruoyi.project.pssr.domain.TPssrSafetyBrust;
+import com.ruoyi.project.pssr.domain.TPssrSafetyBrust;
 import com.ruoyi.project.pssr.service.ITPssrFileService;
 import com.ruoyi.project.pssr.service.ITPssrSafetyBrustService;
 import com.ruoyi.project.pssr.service.ITPssrTurndownService;
+import com.ruoyi.project.system.domain.SysDept;
 import com.ruoyi.project.system.domain.SysUser;
+import com.ruoyi.project.system.service.ISysDeptService;
 import com.ruoyi.project.system.service.ISysUserService;
-import org.apache.poi.ss.usermodel.Cell;
-import org.apache.poi.ss.usermodel.CellStyle;
-import org.apache.poi.ss.usermodel.Row;
+import org.apache.poi.ss.usermodel.*;
 import org.apache.poi.xssf.usermodel.XSSFSheet;
 import org.apache.poi.xssf.usermodel.XSSFWorkbook;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
 
 import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
 import java.util.List;
 
 /**
@@ -50,6 +55,99 @@ public class TPssrSafetyBrustController extends BaseController {
     private ISysUserService sysUserService;
     private String forShort = "aqss-bt";
 
+    @Autowired
+    private ISysDeptService iSysDeptService;
+
+    @Autowired
+    private ISysUserService userService;
+
+    /**
+     * 批量导入
+     */
+    @PreAuthorize("@ss.hasPermi('pssr:safetyBrust:add')")
+    @PostMapping("/importData")
+    public AjaxResult importInterlockData(MultipartFile file, Long subId) throws IOException
+    {
+        //获取操作人员ID
+        Long userId = getUserId();
+        //报错行数统计
+        List<Integer> failRow =new ArrayList<Integer>();
+        Workbook workbook = ExcelUtils.getWorkBook(file);
+        Sheet sheet = workbook.getSheetAt(0);
+        List<TPssrSafetyBrust> list = new ArrayList<TPssrSafetyBrust>();
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+        //部门查询
+        List<SysDept> dept = iSysDeptService.selectDeptList(new SysDept());
+        int rowNum = sheet.getPhysicalNumberOfRows();
+        int failNumber = 0;
+        for (int i = 2; i <= rowNum; i++) {
+            try {
+                logger.info("读取行数:" + i);
+                Row row = sheet.getRow(i);
+                int cellNum = row.getPhysicalNumberOfCells();
+                TPssrSafetyBrust entity = new TPssrSafetyBrust();
+                entity.setDeptId(userService.selectUserById(getUserId()).getDeptId());
+                entity.setSubId(subId);
+                entity.setApproveStatus(0L);
+                for (int j = 0; j < cellNum; j++) {
+                    Cell cell = row.getCell(j);
+                    String cellValue = ExcelUtils.getCellValue(cell);
+                    logger.info("cellValue:" + cellValue);
+                    if (j == 0) {
+                        entity.setDevNo(cellValue);
+                    } else if (j == 1) {
+                        entity.setSafetyDev(cellValue);
+                    } else if (j == 2) {
+                        entity.setInstallLocation(cellValue);
+                    } else if (j == 3) {
+                        entity.setInstallLocation(cellValue);
+                    } else if (j == 4) {
+                        entity.setInstallAccuracy(cellValue);
+                    } else if (j == 5) {
+                        entity.setPutUse(cellValue);
+                    } else if (j == 6) {
+                        entity.setSetPressure(cellValue);
+                    } else if (j == 7) {
+                        entity.setUniformPressure(cellValue);
+                    } else if (j == 8) {
+                        entity.setIs0kpa(cellValue);
+                    } else if (j == 9) {
+                        if (cellValue.length() > 3) {
+                            entity.setConfirmationTime(new SimpleDateFormat(DateUtils.getDateFormat(cellValue)).parse(cellValue));
+                        }
+                    } else if (j == 10) {
+                        entity.setRemarks(cellValue);
+                    }
+                }
+                entity.setCreaterCode(userId.toString());
+                logger.info("entity:" + entity);
+                list.add(entity);
+            }catch (Exception e){
+                failNumber++;
+                failRow.add(i+1);
+            }
+        }
+        int successNumber = 0;
+        int failNum = 0;
+        for (TPssrSafetyBrust t : list
+        ) {
+            failNum++;
+            try {
+                tPssrSafetyBrustService.insertTPssrSafetyBrust(t);
+                successNumber++;
+            }catch (Exception e){
+                failNumber++;
+                logger.info("e:" + e);
+                failRow.add(failNum+1);
+            }
+        }
+        logger.info("list:" + JSON.toJSONString(list));
+        logger.info("successNumber:" +String.valueOf(successNumber));
+        logger.info("failNumber:" +String.valueOf(failNumber));
+        logger.info("failRow:" +String.valueOf(failRow));
+        return AjaxResult.success("导入成功行数:" + String.valueOf(successNumber));
+    }
+
     /**
      * 查询安全设施-爆破片列表
      */

+ 93 - 3
master/src/main/java/com/ruoyi/project/pssr/controller/TPssrSafetyFlamearresterController.java

@@ -1,5 +1,6 @@
 package com.ruoyi.project.pssr.controller;
 
+import com.alibaba.fastjson.JSON;
 import com.ruoyi.common.utils.DateUtils;
 import com.ruoyi.common.utils.file.ExcelUtils;
 import com.ruoyi.common.utils.poi.ExcelUtil;
@@ -9,24 +10,28 @@ import com.ruoyi.framework.web.controller.BaseController;
 import com.ruoyi.framework.web.domain.AjaxResult;
 import com.ruoyi.framework.web.page.TableDataInfo;
 import com.ruoyi.project.pssr.domain.TPssrSafetyFlamearrester;
+import com.ruoyi.project.pssr.domain.TPssrSafetyFlamearrester;
 import com.ruoyi.project.pssr.service.ITPssrFileService;
 import com.ruoyi.project.pssr.service.ITPssrSafetyFlamearresterService;
 import com.ruoyi.project.pssr.service.ITPssrTurndownService;
+import com.ruoyi.project.system.domain.SysDept;
 import com.ruoyi.project.system.domain.SysUser;
+import com.ruoyi.project.system.service.ISysDeptService;
 import com.ruoyi.project.system.service.ISysUserService;
-import org.apache.poi.ss.usermodel.Cell;
-import org.apache.poi.ss.usermodel.CellStyle;
-import org.apache.poi.ss.usermodel.Row;
+import org.apache.poi.ss.usermodel.*;
 import org.apache.poi.xssf.usermodel.XSSFSheet;
 import org.apache.poi.xssf.usermodel.XSSFWorkbook;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
 
 import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
 import java.util.List;
 
 /**
@@ -50,6 +55,91 @@ public class TPssrSafetyFlamearresterController extends BaseController {
     private ISysUserService sysUserService;
     private String forShort = "aqss-f";
 
+    @Autowired
+    private ISysDeptService iSysDeptService;
+
+    @Autowired
+    private ISysUserService userService;
+
+    /**
+     * 批量导入
+     */
+    @PreAuthorize("@ss.hasPermi('pssr:safetyFlamearrester:add')")
+    @PostMapping("/importData")
+    public AjaxResult importInterlockData(MultipartFile file, Long subId) throws IOException
+    {
+        //获取操作人员ID
+        Long userId = getUserId();
+        //报错行数统计
+        List<Integer> failRow =new ArrayList<Integer>();
+        Workbook workbook = ExcelUtils.getWorkBook(file);
+        Sheet sheet = workbook.getSheetAt(0);
+        List<TPssrSafetyFlamearrester> list = new ArrayList<TPssrSafetyFlamearrester>();
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+        //部门查询
+        List<SysDept> dept = iSysDeptService.selectDeptList(new SysDept());
+        int rowNum = sheet.getPhysicalNumberOfRows();
+        int failNumber = 0;
+        for (int i = 2; i <= rowNum; i++) {
+            try {
+                logger.info("读取行数:" + i);
+                Row row = sheet.getRow(i);
+                int cellNum = row.getPhysicalNumberOfCells();
+                TPssrSafetyFlamearrester entity = new TPssrSafetyFlamearrester();
+                entity.setDeptId(userService.selectUserById(getUserId()).getDeptId());
+                entity.setSubId(subId);
+                entity.setApproveStatus(0L);
+                for (int j = 0; j < cellNum; j++) {
+                    Cell cell = row.getCell(j);
+                    String cellValue = ExcelUtils.getCellValue(cell);
+                    logger.info("cellValue:" + cellValue);
+                    if (j == 0) {
+                        entity.setDevNo(cellValue);
+                    } else if (j == 1) {
+                        entity.setInstallLocation(cellValue);
+                    } else if (j == 2) {
+                        entity.setUniformFlow(cellValue);
+                    } else if (j == 3) {
+                        entity.setCorrosion(cellValue);
+                    } else if (j == 4) {
+                        entity.setPutUse(cellValue);
+                    } else if (j == 5) {
+                        if (cellValue.length() > 3) {
+                            entity.setConfirmationTime(new SimpleDateFormat(DateUtils.getDateFormat(cellValue)).parse(cellValue));
+                        }
+                    } else if (j == 6) {
+                        entity.setRemarks(cellValue);
+                    }
+                }
+                entity.setCreaterCode(userId.toString());
+                logger.info("entity:" + entity);
+                list.add(entity);
+            }catch (Exception e){
+                failNumber++;
+                failRow.add(i+1);
+            }
+        }
+        int successNumber = 0;
+        int failNum = 0;
+        for (TPssrSafetyFlamearrester t : list
+        ) {
+            failNum++;
+            try {
+                tPssrSafetyFlamearresterService.insertTPssrSafetyFlamearrester(t);
+                successNumber++;
+            }catch (Exception e){
+                failNumber++;
+                logger.info("e:" + e);
+                failRow.add(failNum+1);
+            }
+        }
+        logger.info("list:" + JSON.toJSONString(list));
+        logger.info("successNumber:" +String.valueOf(successNumber));
+        logger.info("failNumber:" +String.valueOf(failNumber));
+        logger.info("failRow:" +String.valueOf(failRow));
+        return AjaxResult.success("导入成功行数:" + String.valueOf(successNumber));
+    }
+
     /**
      * 查询安全设施-阻火器列表
      */

二进制
master/src/main/resources/static/template/pssr/safetyBleed.xlsx


二进制
master/src/main/resources/static/template/pssr/safetyBreath.xlsx


二进制
master/src/main/resources/static/template/pssr/safetyBrust.xlsx


二进制
master/src/main/resources/static/template/pssr/safetyFlamearrester.xlsx


+ 12 - 7
ui/src/views/pssr/safetyBleed/index.vue

@@ -281,7 +281,7 @@
         :limit="1"
         accept=".xlsx, .xls"
         :headers="upload.headers"
-        :action="upload.url + '?updateSupport=' + upload.updateSupport"
+        :action="upload.url"
         :disabled="upload.isUploading"
         :on-progress="handleFileUploadProgress"
         :on-success="handleFileSuccess"
@@ -294,9 +294,12 @@
           <em>点击上传</em>
         </div>
         <div class="el-upload__tip" slot="tip">
-          <el-checkbox v-model="upload.updateSupport"/>
-          是否更新已经存在的用户数据
+          <!--<el-checkbox v-model="upload.updateSupport"/>-->
+          <!--是否更新已经存在的用户数据-->
           <el-link type="info" style="font-size:12px" @click="importTemplate">下载模板</el-link>
+          <form ref="downloadFileForm" :action="upload.downloadAction" target="FORMSUBMIT">
+            <input name="type" :value="upload.type" hidden />
+          </form>
         </div>
         <div class="el-upload__tip" style="color:red" slot="tip">提示:仅允许导入“xls”或“xlsx”格式文件!</div>
       </el-upload>
@@ -384,6 +387,10 @@ export default {
       open: false,
       // 用户导入参数
       upload: {
+        //下载模板请求地址
+        downloadAction: process.env.VUE_APP_BASE_API + '/common/template',
+        //下载模板类型
+        type: 'safetyBleed',
         // 是否显示弹出层(用户导入)
         open: false,
         // 弹出层标题(用户导入)
@@ -395,7 +402,7 @@ export default {
         // 设置上传的请求头部
         headers: {Authorization: "Bearer " + getToken()},
         // 上传的地址
-        url: process.env.VUE_APP_BASE_API + "/pssr/safetyBleed/importData"
+        url: process.env.VUE_APP_BASE_API + "/pssr/safetyBleed/importData?subId=" + this.subId
       },
       // 查询参数
       queryParams: {
@@ -587,9 +594,7 @@ export default {
     },
     /** 下载模板操作 */
     importTemplate() {
-      importTemplate().then(response => {
-        this.download(response.msg);
-      });
+      this.$refs['downloadFileForm'].submit()
     },
     // 文件上传中处理
     handleFileUploadProgress(event, file, fileList) {

+ 12 - 7
ui/src/views/pssr/safetyBreath/index.vue

@@ -281,7 +281,7 @@
         :limit="1"
         accept=".xlsx, .xls"
         :headers="upload.headers"
-        :action="upload.url + '?updateSupport=' + upload.updateSupport"
+        :action="upload.url"
         :disabled="upload.isUploading"
         :on-progress="handleFileUploadProgress"
         :on-success="handleFileSuccess"
@@ -294,9 +294,12 @@
           <em>点击上传</em>
         </div>
         <div class="el-upload__tip" slot="tip">
-          <el-checkbox v-model="upload.updateSupport"/>
-          是否更新已经存在的用户数据
+          <!--<el-checkbox v-model="upload.updateSupport"/>-->
+          <!--是否更新已经存在的用户数据-->
           <el-link type="info" style="font-size:12px" @click="importTemplate">下载模板</el-link>
+          <form ref="downloadFileForm" :action="upload.downloadAction" target="FORMSUBMIT">
+            <input name="type" :value="upload.type" hidden />
+          </form>
         </div>
         <div class="el-upload__tip" style="color:red" slot="tip">提示:仅允许导入“xls”或“xlsx”格式文件!</div>
       </el-upload>
@@ -384,6 +387,10 @@ export default {
       open: false,
       // 用户导入参数
       upload: {
+        //下载模板请求地址
+        downloadAction: process.env.VUE_APP_BASE_API + '/common/template',
+        //下载模板类型
+        type: 'safetyBreath',
         // 是否显示弹出层(用户导入)
         open: false,
         // 弹出层标题(用户导入)
@@ -395,7 +402,7 @@ export default {
         // 设置上传的请求头部
         headers: {Authorization: "Bearer " + getToken()},
         // 上传的地址
-        url: process.env.VUE_APP_BASE_API + "/pssr/safetyBreath/importData"
+        url: process.env.VUE_APP_BASE_API + "/pssr/safetyBreath/importData?subId=" + this.subId
       },
       // 查询参数
       queryParams: {
@@ -580,9 +587,7 @@ export default {
     },
     /** 下载模板操作 */
     importTemplate() {
-      importTemplate().then(response => {
-        this.download(response.msg);
-      });
+      this.$refs['downloadFileForm'].submit()
     },
     // 文件上传中处理
     handleFileUploadProgress(event, file, fileList) {

+ 12 - 7
ui/src/views/pssr/safetyBrust/index.vue

@@ -299,7 +299,7 @@
         :limit="1"
         accept=".xlsx, .xls"
         :headers="upload.headers"
-        :action="upload.url + '?updateSupport=' + upload.updateSupport"
+        :action="upload.url"
         :disabled="upload.isUploading"
         :on-progress="handleFileUploadProgress"
         :on-success="handleFileSuccess"
@@ -312,9 +312,12 @@
           <em>点击上传</em>
         </div>
         <div class="el-upload__tip" slot="tip">
-          <el-checkbox v-model="upload.updateSupport"/>
-          是否更新已经存在的用户数据
+          <!--<el-checkbox v-model="upload.updateSupport"/>-->
+          <!--是否更新已经存在的用户数据-->
           <el-link type="info" style="font-size:12px" @click="importTemplate">下载模板</el-link>
+          <form ref="downloadFileForm" :action="upload.downloadAction" target="FORMSUBMIT">
+            <input name="type" :value="upload.type" hidden />
+          </form>
         </div>
         <div class="el-upload__tip" style="color:red" slot="tip">提示:仅允许导入“xls”或“xlsx”格式文件!</div>
       </el-upload>
@@ -402,6 +405,10 @@ export default {
       open: false,
       // 用户导入参数
       upload: {
+        //下载模板请求地址
+        downloadAction: process.env.VUE_APP_BASE_API + '/common/template',
+        //下载模板类型
+        type: 'safetyBrust',
         // 是否显示弹出层(用户导入)
         open: false,
         // 弹出层标题(用户导入)
@@ -413,7 +420,7 @@ export default {
         // 设置上传的请求头部
         headers: {Authorization: "Bearer " + getToken()},
         // 上传的地址
-        url: process.env.VUE_APP_BASE_API + "/pssr/safetyBrust/importData"
+        url: process.env.VUE_APP_BASE_API + "/pssr/safetyBrust/importData?subId=" + this.subId
       },
       // 查询参数
       queryParams: {
@@ -598,9 +605,7 @@ export default {
     },
     /** 下载模板操作 */
     importTemplate() {
-      importTemplate().then(response => {
-        this.download(response.msg);
-      });
+      this.$refs['downloadFileForm'].submit()
     },
     // 文件上传中处理
     handleFileUploadProgress(event, file, fileList) {

+ 12 - 7
ui/src/views/pssr/safetyFlamearrester/index.vue

@@ -275,7 +275,7 @@
         :limit="1"
         accept=".xlsx, .xls"
         :headers="upload.headers"
-        :action="upload.url + '?updateSupport=' + upload.updateSupport"
+        :action="upload.url"
         :disabled="upload.isUploading"
         :on-progress="handleFileUploadProgress"
         :on-success="handleFileSuccess"
@@ -288,9 +288,12 @@
           <em>点击上传</em>
         </div>
         <div class="el-upload__tip" slot="tip">
-          <el-checkbox v-model="upload.updateSupport"/>
-          是否更新已经存在的用户数据
+          <!--<el-checkbox v-model="upload.updateSupport"/>-->
+          <!--是否更新已经存在的用户数据-->
           <el-link type="info" style="font-size:12px" @click="importTemplate">下载模板</el-link>
+          <form ref="downloadFileForm" :action="upload.downloadAction" target="FORMSUBMIT">
+            <input name="type" :value="upload.type" hidden />
+          </form>
         </div>
         <div class="el-upload__tip" style="color:red" slot="tip">提示:仅允许导入“xls”或“xlsx”格式文件!</div>
       </el-upload>
@@ -378,6 +381,10 @@ export default {
       open: false,
       // 用户导入参数
       upload: {
+        //下载模板请求地址
+        downloadAction: process.env.VUE_APP_BASE_API + '/common/template',
+        //下载模板类型
+        type: 'safetyFlamearrester',
         // 是否显示弹出层(用户导入)
         open: false,
         // 弹出层标题(用户导入)
@@ -389,7 +396,7 @@ export default {
         // 设置上传的请求头部
         headers: {Authorization: "Bearer " + getToken()},
         // 上传的地址
-        url: process.env.VUE_APP_BASE_API + "/pssr/safetyFlamearrester/importData"
+        url: process.env.VUE_APP_BASE_API + "/pssr/safetyFlamearrester/importData?subId=" + this.subId
       },
       // 查询参数
       queryParams: {
@@ -566,9 +573,7 @@ export default {
     },
     /** 下载模板操作 */
     importTemplate() {
-      importTemplate().then(response => {
-        this.download(response.msg);
-      });
+      this.$refs['downloadFileForm'].submit()
     },
     // 文件上传中处理
     handleFileUploadProgress(event, file, fileList) {