shi'sen'yuan 3 lat temu
rodzic
commit
c7999050a1
21 zmienionych plików z 534 dodań i 294 usunięć
  1. 3 0
      master/src/main/java/com/ruoyi/project/common/CommonController.java
  2. 54 21
      master/src/main/java/com/ruoyi/project/ehs/controller/TEnvironapprovalController.java
  3. 49 19
      master/src/main/java/com/ruoyi/project/ehs/controller/TFireapprovalController.java
  4. 153 14
      master/src/main/java/com/ruoyi/project/ehs/controller/THealthapprovalController.java
  5. 46 15
      master/src/main/java/com/ruoyi/project/ehs/controller/TSafetyapprovalController.java
  6. 47 49
      master/src/main/java/com/ruoyi/project/ehs/domain/TEnvironapproval.java
  7. 42 43
      master/src/main/java/com/ruoyi/project/ehs/domain/TFireapproval.java
  8. 45 51
      master/src/main/java/com/ruoyi/project/ehs/domain/THealthapproval.java
  9. 41 41
      master/src/main/java/com/ruoyi/project/ehs/domain/TSafetyapproval.java
  10. 15 4
      master/src/main/java/com/ruoyi/project/plant/controller/TTargetlistController.java
  11. 2 1
      master/src/main/resources/mybatis/ehs/TEnvironapprovalMapper.xml
  12. 2 1
      master/src/main/resources/mybatis/ehs/TFireapprovalMapper.xml
  13. 2 1
      master/src/main/resources/mybatis/ehs/THealthapprovalMapper.xml
  14. 2 1
      master/src/main/resources/mybatis/ehs/TSafetyapprovalMapper.xml
  15. BIN
      master/src/main/resources/static/template/ehs/environapproval.xlsx
  16. BIN
      master/src/main/resources/static/template/ehs/fireapproval.xlsx
  17. BIN
      master/src/main/resources/static/template/ehs/healthapproval.xlsx
  18. BIN
      master/src/main/resources/static/template/ehs/safetyapproval.xlsx
  19. BIN
      master/src/main/resources/static/template/plant/targetlist.xlsx
  20. 0 10
      ui/src/views/ehs/fireapproval/index.vue
  21. 31 23
      ui/src/views/ehs/healthapproval/index.vue

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

@@ -190,6 +190,9 @@ public class CommonController extends BaseController
         } else if( type.equals("environapproval") ) {
             downloadname = "环保批文清单导入模板.xlsx";
             url = "static/template/ehs/environapproval.xlsx";
+        } else if( type.equals("healthapproval") ) {
+            downloadname = "卫生批文清单导入模板.xlsx";
+            url = "static/template/ehs/healthapproval.xlsx";
         } else if( type.equals("safetyapprcont") ) {
             downloadname = "安全批文主要内容导入模板.xlsx";
             url = "static/template/ehs/safetyapprcont.xlsx";

+ 54 - 21
master/src/main/java/com/ruoyi/project/ehs/controller/TEnvironapprovalController.java

@@ -12,6 +12,7 @@ import com.ruoyi.common.utils.file.ExcelUtils;
 import com.ruoyi.common.utils.file.FileUploadUtils;
 import com.ruoyi.framework.config.RuoYiConfig;
 import com.ruoyi.project.plant.domain.TStaffmgr;
+import com.ruoyi.project.plant.service.ITStaffmgrService;
 import com.ruoyi.project.system.domain.SysDept;
 import com.ruoyi.project.system.domain.SysDictData;
 import com.ruoyi.project.system.service.ISysDeptService;
@@ -49,6 +50,9 @@ public class TEnvironapprovalController extends BaseController
     @Autowired
     private ISysDictTypeService iSysDictTypeService;
 
+    @Autowired
+    private ITStaffmgrService tStaffmgrService;
+
     /**
      * 查询环保批文清单列表
      */
@@ -58,12 +62,6 @@ public class TEnvironapprovalController extends BaseController
     {
         startPage();
         List<TEnvironapproval> list = tEnvironapprovalService.selectTEnvironapprovalList(tEnvironapproval);
-        for (TEnvironapproval e : list) {
-            SimpleDateFormat sdf = new SimpleDateFormat("yyyy.MM.dd");
-            if (e.getValidityBefore() != null && e.getValidityAfter() != null) {
-                e.setValidity(sdf.format(e.getValidityBefore()) + "-" + sdf.format(e.getValidityAfter()));
-            }
-        }
         return getDataTable(list);
     }
 
@@ -147,6 +145,8 @@ public class TEnvironapprovalController extends BaseController
         List<SysDictData> yesno = iSysDictTypeService.selectDictDataByType("YES_NO");
         //部门查询
         List<SysDept> dept = iSysDeptService.selectDeptList(new SysDept());
+        //人员查询
+        List<TStaffmgr> staffmgrs = tStaffmgrService.selectTStaffmgrList(new TStaffmgr());
         int rowNum = sheet.getPhysicalNumberOfRows();
         int failNumber = 0;
         for (int i = 1; i < rowNum; i++) {
@@ -172,39 +172,72 @@ public class TEnvironapprovalController extends BaseController
                         entity.setCertno(cellValue);//证书编号
                     } else if (j == 3) {
                         if (cellValue.length() > 3) {
-                            entity.setEffetivedate(new SimpleDateFormat(DateUtils.getDateFormat(cellValue)).parse(cellValue));//发证日期
+                            entity.setEffetivedate(new SimpleDateFormat(DateUtils.getDateFormat(cellValue)).parse(cellValue));//批准日期
                         }
                     } else if (j == 4) {
-                        for (SysDictData y : yesno) {
-                            if (y.getDictLabel().equals(cellValue.trim())) {
-                                entity.setIsPermanent(Long.parseLong(y.getDictValue()));//证书有效期是否永久
-                            }
-                        }
+                        entity.setScope(cellValue);//适用范围
                     } else if (j == 5) {
-                        if (cellValue.length() > 3) {
-                            entity.setValidityBefore(new SimpleDateFormat(DateUtils.getDateFormat(cellValue)).parse(cellValue));//证书有效期
-                        }
-                    } else if (j == 6) {
                         entity.setRelatedlaw(cellValue);//相关法规
+                    } else if (j == 6) {
+                        entity.setResponsauth(cellValue);//审批单位
                     } else if (j == 7) {
-                        entity.setResponsauth(cellValue);//主管部门
+                        if (cellValue.length() > 3) {
+                            entity.setValidityBefore(new SimpleDateFormat(DateUtils.getDateFormat(cellValue)).parse(cellValue));//证书有效期前
+                            entity.setIsPermanent(Long.parseLong("0"));
+                        }else {
+                            entity.setIsPermanent(Long.parseLong("1"));
+                        }
                     } else if (j == 8) {
-                        entity.setOwner(cellValue);//负责人
+                        if (cellValue.length() > 3) {
+                            entity.setValidityAfter(new SimpleDateFormat(DateUtils.getDateFormat(cellValue)).parse(cellValue));//证书有效期后
+                        }
                     } else if (j == 9) {
+                        for (SysDictData p : yesno) {
+                            if (p.getDictLabel().equals(cellValue.trim())) {
+                                entity.setFollow(p.getDictValue());//是否需要跟进
+                            }
+                        }
+                    } else if (j == 10) {
+                        entity.setAllowance(cellValue);//使用/储存/废物最大量
+                    } else if (j == 11) {
+                        entity.setRequirements(cellValue);//排放/监控要求
+                        if (!cellValue.equals("")) {
+                            entity.setReqPic("false");
+                        }else {
+                            entity.setReqPic("true");
+                        }
+                    } else if (j == 12) {
+                        entity.setContent(cellValue);//主要内容
+                        if (!cellValue.equals("")) {
+                            entity.setConPic("false");
+                        }else {
+                            entity.setConPic("true");
+                        }
+                    } else if (j == 13) {
+                        entity.setOwner(cellValue);//负责人
+                    } else if (j == 15) {
+                        for (TStaffmgr s : staffmgrs) {
+                            if (s.getStaffid().equals(cellValue.trim())) {
+                                entity.setReviewer(s.getStaffid());//回顾人
+                            }
+                        }
+                    } else if (j == 16) {
                         if (cellValue.length() > 3) {
                             entity.setReviewdate(new SimpleDateFormat(DateUtils.getDateFormat(cellValue)).parse(cellValue));//本次回顾日期
                         }
-                    } else if (j == 10) {
+                    } else if (j == 17) {
+                        entity.setReviewResult(cellValue);//回顾结果
+                    } else if (j == 18) {
                         if (cellValue.length() > 3) {
                             entity.setNextreviewdate(new SimpleDateFormat(DateUtils.getDateFormat(cellValue)).parse(cellValue));//下次回顾日期
                         }
-                    } else if (j == 11) {
+                    } else if (j == 19) {
                         for (SysDept d : dept) {
                             if (d.getDeptName().equals(cellValue.trim())) {
                                 entity.setDeptId(d.getDeptId());//部门编号
                             }
                         }
-                    } else if (j == 12) {
+                    } else if (j == 20) {
                         entity.setRemarks(cellValue);//备注
                     }
                 }

+ 49 - 19
master/src/main/java/com/ruoyi/project/ehs/controller/TFireapprovalController.java

@@ -9,6 +9,8 @@ import java.util.List;
 import com.alibaba.fastjson.JSON;
 import com.ruoyi.common.utils.DateUtils;
 import com.ruoyi.common.utils.file.ExcelUtils;
+import com.ruoyi.project.plant.domain.TStaffmgr;
+import com.ruoyi.project.plant.service.ITStaffmgrService;
 import com.ruoyi.project.system.domain.SysDept;
 import com.ruoyi.project.system.domain.SysDictData;
 import com.ruoyi.project.system.service.ISysDeptService;
@@ -46,6 +48,9 @@ public class TFireapprovalController extends BaseController
     @Autowired
     private ISysDictTypeService iSysDictTypeService;
 
+    @Autowired
+    private ITStaffmgrService tStaffmgrService;
+
     /**
      * 查询消防批文清单列表
      */
@@ -55,12 +60,6 @@ public class TFireapprovalController extends BaseController
     {
         startPage();
         List<TFireapproval> list = tFireapprovalService.selectTFireapprovalList(tFireapproval);
-        for (TFireapproval s : list) {
-            SimpleDateFormat sdf = new SimpleDateFormat("yyyy.MM.dd");
-            if (s.getValidityBefore() != null && s.getValidityAfter() != null) {
-                s.setValidity(sdf.format(s.getValidityBefore()) + "-" + sdf.format(s.getValidityAfter()));
-            }
-        }
         return getDataTable(list);
     }
 
@@ -141,8 +140,11 @@ public class TFireapprovalController extends BaseController
         SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
         //字典查询
         List<SysDictData> plant = iSysDictTypeService.selectDictDataByType("PLANT_DIVIDE");
+        List<SysDictData> yesNo = iSysDictTypeService.selectDictDataByType("YES_NO");
         //部门查询
         List<SysDept> dept = iSysDeptService.selectDeptList(new SysDept());
+        //人员查询
+        List<TStaffmgr> staffmgrs = tStaffmgrService.selectTStaffmgrList(new TStaffmgr());
         int rowNum = sheet.getPhysicalNumberOfRows();
         int failNumber = 0;
         for (int i = 1; i < rowNum; i++) {
@@ -163,40 +165,67 @@ public class TFireapprovalController extends BaseController
                             }
                         }
                     } else if (j == 1) {
-                        entity.setDivision(cellValue);//部门
-                    } else if (j == 2) {
                         entity.setApprovalname(cellValue);//批文名称
+                    } else if (j == 2) {
+                        entity.setFileno(cellValue);//证书编号
                     } else if (j == 3) {
-                        entity.setFileno(cellValue);//文件编号
-                    } else if (j == 4) {
                         if (cellValue.length() > 3) {
-                            entity.setEffetivedate(new SimpleDateFormat(DateUtils.getDateFormat(cellValue)).parse(cellValue));//发证日期
+                            entity.setEffetivedate(new SimpleDateFormat(DateUtils.getDateFormat(cellValue)).parse(cellValue));//批准日期
                         }
+                    } else if (j == 4) {
+                        entity.setScope(cellValue);//适用范围
                     } else if (j == 5) {
-                        entity.setValidity(cellValue);//有效期
+                        entity.setRelatedlaw(cellValue);//相关法规
                     } else if (j == 6) {
-
+                        entity.setResponsauth(cellValue);//审批单位
                     } else if (j == 7) {
-                        entity.setRelatedlaw(cellValue);//相关法规
+                        if (cellValue.length() > 3) {
+                            entity.setValidityBefore(new SimpleDateFormat(DateUtils.getDateFormat(cellValue)).parse(cellValue));//证书有效期前
+                            entity.setIsPermanent(Long.parseLong("0"));
+                        }else {
+                            entity.setIsPermanent(Long.parseLong("1"));
+                        }
                     } else if (j == 8) {
-                        entity.setResponsauth(cellValue);//主管部门
+                        if (cellValue.length() > 3) {
+                            entity.setValidityAfter(new SimpleDateFormat(DateUtils.getDateFormat(cellValue)).parse(cellValue));//证书有效期后
+                        }
                     } else if (j == 9) {
-                        entity.setOwner(cellValue);//负责人
+                        for (SysDictData p : yesNo) {
+                            if (p.getDictLabel().equals(cellValue.trim())) {
+                                entity.setFollow(p.getDictValue());//是否需要跟进
+                            }
+                        }
                     } else if (j == 10) {
+                        entity.setAllowance(cellValue);//使用/储存/废物最大量
+                    } else if (j == 11) {
+                        entity.setRequirements(cellValue);//排放/监控要求
+                    } else if (j == 12) {
+                        entity.setContent(cellValue);//主要内容
+                    } else if (j == 13) {
+                        entity.setOwner(cellValue);//负责人
+                    } else if (j == 15) {
+                        for (TStaffmgr s : staffmgrs) {
+                            if (s.getStaffid().equals(cellValue.trim())) {
+                                entity.setReviewer(s.getStaffid());//回顾人
+                            }
+                        }
+                    } else if (j == 16) {
                         if (cellValue.length() > 3) {
                             entity.setReviewdate(new SimpleDateFormat(DateUtils.getDateFormat(cellValue)).parse(cellValue));//本次回顾日期
                         }
-                    } else if (j == 11) {
+                    } else if (j == 17) {
+                        entity.setReviewResult(cellValue);//回顾结果
+                    } else if (j == 18) {
                         if (cellValue.length() > 3) {
                             entity.setNextreviewdate(new SimpleDateFormat(DateUtils.getDateFormat(cellValue)).parse(cellValue));//下次回顾日期
                         }
-                    } else if (j == 12) {
+                    } else if (j == 19) {
                         for (SysDept d : dept) {
                             if (d.getDeptName().equals(cellValue.trim())) {
                                 entity.setDeptId(d.getDeptId());//部门编号
                             }
                         }
-                    } else if (j == 13) {
+                    } else if (j == 20) {
                         entity.setRemarks(cellValue);//备注
                     }
                 }
@@ -219,6 +248,7 @@ public class TFireapprovalController extends BaseController
             }catch (Exception e){
                 failNumber++;
                 failRow.add(failNum+1);
+                logger.info("E:" + e);
             }
         }
         logger.info("list:" + JSON.toJSONString(list));

+ 153 - 14
master/src/main/java/com/ruoyi/project/ehs/controller/THealthapprovalController.java

@@ -1,17 +1,23 @@
 package com.ruoyi.project.ehs.controller;
 
+import java.io.IOException;
 import java.text.SimpleDateFormat;
+import java.util.ArrayList;
 import java.util.List;
+
+import com.alibaba.fastjson.JSON;
+import com.ruoyi.common.utils.DateUtils;
+import com.ruoyi.common.utils.file.ExcelUtils;
+import com.ruoyi.project.plant.domain.TStaffmgr;
+import com.ruoyi.project.plant.service.ITStaffmgrService;
+import com.ruoyi.project.system.domain.SysDept;
+import com.ruoyi.project.system.domain.SysDictData;
+import com.ruoyi.project.system.service.ISysDeptService;
+import com.ruoyi.project.system.service.ISysDictTypeService;
+import org.apache.poi.ss.usermodel.*;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 import com.ruoyi.framework.aspectj.lang.annotation.Log;
 import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
 import com.ruoyi.project.ehs.domain.THealthapproval;
@@ -20,6 +26,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 +41,15 @@ public class THealthapprovalController extends BaseController
     @Autowired
     private ITHealthapprovalService tHealthapprovalService;
 
+    @Autowired
+    private ISysDeptService iSysDeptService;
+
+    @Autowired
+    private ISysDictTypeService iSysDictTypeService;
+
+    @Autowired
+    private ITStaffmgrService tStaffmgrService;
+
     /**
      * 查询卫生批文清单列表
      */
@@ -43,12 +59,6 @@ public class THealthapprovalController extends BaseController
     {
         startPage();
         List<THealthapproval> list = tHealthapprovalService.selectTHealthapprovalList(tHealthapproval);
-        for (THealthapproval h : list) {
-            SimpleDateFormat sdf = new SimpleDateFormat("yyyy.MM.dd");
-            if (h.getValidityBefore() != null && h.getValidityAfter() != null) {
-                h.setValidity(sdf.format(h.getValidityBefore()) + "-" + sdf.format(h.getValidityAfter()));
-            }
-        }
         return getDataTable(list);
     }
 
@@ -107,4 +117,133 @@ public class THealthapprovalController extends BaseController
     {
         return toAjax(tHealthapprovalService.deleteTHealthapprovalByIds(ids));
     }
+
+    /**
+     * 批量导入安全批文清单
+     */
+    @PreAuthorize("@ss.hasPermi('ehs:healthapproval:add')")
+    @Log(title = "卫生批文清单", businessType = BusinessType.INSERT)
+    @PostMapping("/importData")
+    public AjaxResult importData(@RequestParam("file") MultipartFile file) throws IOException
+    {
+        //获取操作人员ID
+        Long userId = getUserId();
+        //报错行数统计
+        List<Integer> failRow =new ArrayList<Integer>();
+        Workbook workbook = ExcelUtils.getWorkBook(file);
+        Sheet sheet = workbook.getSheetAt(0);
+        List<THealthapproval> list = new ArrayList<THealthapproval>();
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+        //字典查询
+        List<SysDictData> plant = iSysDictTypeService.selectDictDataByType("PLANT_DIVIDE");
+        List<SysDictData> yesNo = iSysDictTypeService.selectDictDataByType("YES_NO");
+        //部门查询
+        List<SysDept> dept = iSysDeptService.selectDeptList(new SysDept());
+        //人员查询
+        List<TStaffmgr> staffmgrs = tStaffmgrService.selectTStaffmgrList(new TStaffmgr());
+        int rowNum = sheet.getPhysicalNumberOfRows();
+        int failNumber = 0;
+        for (int i = 1; i < rowNum; i++) {
+            try {
+                logger.info("读取行数:" + i);
+                Row row = sheet.getRow(i);
+                int cellNum = row.getPhysicalNumberOfCells();
+                THealthapproval entity = new THealthapproval();
+                for (int j = 0; j < cellNum; j++) {
+                    Cell cell = row.getCell(j);
+                    cell.setCellType(CellType.STRING);
+                    String cellValue = ExcelUtils.getCellValue(cell);
+                    logger.info("cellValue:" + cellValue);
+                    if (j == 0) {
+                        entity.setApprovalname(cellValue);//批文名称
+                    } else if (j == 1) {
+                        entity.setCertno(cellValue);//证书编号
+                    } else if (j == 2) {
+                        if (cellValue.length() > 3) {
+                            entity.setEffetivedate(new SimpleDateFormat(DateUtils.getDateFormat(cellValue)).parse(cellValue));//批准日期
+                        }
+                    } else if (j == 3) {
+                        entity.setScope(cellValue);//适用范围
+                    } else if (j == 4) {
+                        entity.setRelatedlaw(cellValue);//相关法规
+                    } else if (j == 5) {
+                        entity.setResponsauth(cellValue);//审批单位
+                    } else if (j == 6) {
+                        if (cellValue.length() > 3) {
+                            entity.setValidityBefore(new SimpleDateFormat(DateUtils.getDateFormat(cellValue)).parse(cellValue));//证书有效期前
+                            entity.setIsPermanent(Long.parseLong("0"));
+                        }else {
+                            entity.setIsPermanent(Long.parseLong("1"));
+                        }
+                    } else if (j == 7) {
+                        if (cellValue.length() > 3) {
+                            entity.setValidityAfter(new SimpleDateFormat(DateUtils.getDateFormat(cellValue)).parse(cellValue));//证书有效期后
+                        }
+                    } else if (j == 8) {
+                        for (SysDictData p : yesNo) {
+                            if (p.getDictLabel().equals(cellValue.trim())) {
+                                entity.setFollow(p.getDictValue());//是否需要跟进
+                            }
+                        }
+                    } else if (j == 9) {
+                        entity.setAllowance(cellValue);//使用/储存/废物最大量
+                    } else if (j == 10) {
+                        entity.setRequirements(cellValue);//排放/监控要求
+                    } else if (j == 11) {
+                        entity.setContent(cellValue);//主要内容
+                    } else if (j == 12) {
+                        entity.setOwner(cellValue);//负责人
+                    } else if (j == 14) {
+                        for (TStaffmgr s : staffmgrs) {
+                            if (s.getStaffid().equals(cellValue.trim())) {
+                                entity.setReviewer(s.getStaffid());//回顾人
+                            }
+                        }
+                    } else if (j == 15) {
+                        if (cellValue.length() > 3) {
+                            entity.setReviewdate(new SimpleDateFormat(DateUtils.getDateFormat(cellValue)).parse(cellValue));//本次回顾日期
+                        }
+                    } else if (j == 16) {
+                        entity.setReviewResult(cellValue);//回顾结果
+                    } else if (j == 17) {
+                        if (cellValue.length() > 3) {
+                            entity.setNextreviewdate(new SimpleDateFormat(DateUtils.getDateFormat(cellValue)).parse(cellValue));//下次回顾日期
+                        }
+                    } else if (j == 18) {
+                        for (SysDept d : dept) {
+                            if (d.getDeptName().equals(cellValue.trim())) {
+                                entity.setDeptId(d.getDeptId());//部门编号
+                            }
+                        }
+                    } else if (j == 19) {
+                        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 (THealthapproval t : list
+        ) {
+            failNum++;
+            try {
+                tHealthapprovalService.insertTHealthapproval(t);
+                successNumber++;
+            }catch (Exception e){
+                failNumber++;
+                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), failRow);
+    }
 }

+ 46 - 15
master/src/main/java/com/ruoyi/project/ehs/controller/TSafetyapprovalController.java

@@ -9,6 +9,8 @@ import java.util.List;
 import com.alibaba.fastjson.JSON;
 import com.ruoyi.common.utils.DateUtils;
 import com.ruoyi.common.utils.file.ExcelUtils;
+import com.ruoyi.project.plant.domain.TStaffmgr;
+import com.ruoyi.project.plant.service.ITStaffmgrService;
 import com.ruoyi.project.system.domain.SysDept;
 import com.ruoyi.project.system.domain.SysDictData;
 import com.ruoyi.project.system.service.ISysDeptService;
@@ -46,6 +48,9 @@ public class TSafetyapprovalController extends BaseController
     @Autowired
     private ISysDictTypeService iSysDictTypeService;
 
+    @Autowired
+    private ITStaffmgrService tStaffmgrService;
+
     /**
      * 查询安全批文清单列表
      */
@@ -55,12 +60,6 @@ public class TSafetyapprovalController extends BaseController
     {
         startPage();
         List<TSafetyapproval> list = tSafetyapprovalService.selectTSafetyapprovalList(tSafetyapproval);
-        for (TSafetyapproval s : list) {
-            SimpleDateFormat sdf = new SimpleDateFormat("yyyy.MM.dd");
-            if (s.getValidityBefore() != null && s.getValidityAfter() != null) {
-                s.setValidity(sdf.format(s.getValidityBefore()) + "-" + sdf.format(s.getValidityAfter()));
-            }
-        }
         return getDataTable(list);
     }
 
@@ -141,8 +140,11 @@ public class TSafetyapprovalController extends BaseController
         SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
         //字典查询
         List<SysDictData> plant = iSysDictTypeService.selectDictDataByType("PLANT_DIVIDE");
+        List<SysDictData> yesNo = iSysDictTypeService.selectDictDataByType("YES_NO");
         //部门查询
         List<SysDept> dept = iSysDeptService.selectDeptList(new SysDept());
+        //人员查询
+        List<TStaffmgr> staffmgrs = tStaffmgrService.selectTStaffmgrList(new TStaffmgr());
         int rowNum = sheet.getPhysicalNumberOfRows();
         int failNumber = 0;
         for (int i = 1; i < rowNum; i++) {
@@ -168,33 +170,62 @@ public class TSafetyapprovalController extends BaseController
                         entity.setCertno(cellValue);//证书编号
                     } else if (j == 3) {
                         if (cellValue.length() > 3) {
-                            entity.setEffetivedate(new SimpleDateFormat(DateUtils.getDateFormat(cellValue)).parse(cellValue));//发证日期
+                            entity.setEffetivedate(new SimpleDateFormat(DateUtils.getDateFormat(cellValue)).parse(cellValue));//批准日期
                         }
                     } else if (j == 4) {
-                        if (cellValue.length() > 3) {
-                            entity.setValidityAfter(new SimpleDateFormat(DateUtils.getDateFormat(cellValue)).parse(cellValue));//证书有效期
-                        }
+                        entity.setScope(cellValue);//适用范围
                     } else if (j == 5) {
                         entity.setRelatedlaw(cellValue);//相关法规
                     } else if (j == 6) {
-                        entity.setResponsauth(cellValue);//主管部门
+                        entity.setResponsauth(cellValue);//审批单位
                     } else if (j == 7) {
-                        entity.setOwner(cellValue);//负责人
+                        if (cellValue.length() > 3) {
+                            entity.setValidityBefore(new SimpleDateFormat(DateUtils.getDateFormat(cellValue)).parse(cellValue));//证书有效期前
+                            entity.setIsPermanent(Long.parseLong("0"));
+                        }else {
+                            entity.setIsPermanent(Long.parseLong("1"));
+                        }
                     } else if (j == 8) {
                         if (cellValue.length() > 3) {
-                            entity.setReviewdate(new SimpleDateFormat(DateUtils.getDateFormat(cellValue)).parse(cellValue));//本次回顾日期
+                            entity.setValidityAfter(new SimpleDateFormat(DateUtils.getDateFormat(cellValue)).parse(cellValue));//证书有效期后
                         }
                     } else if (j == 9) {
+                        for (SysDictData p : yesNo) {
+                            if (p.getDictLabel().equals(cellValue.trim())) {
+                                entity.setFollow(p.getDictValue());//是否需要跟进
+                            }
+                        }
+                    } else if (j == 10) {
+                        entity.setAllowance(cellValue);//使用/储存/废物最大量
+                    } else if (j == 11) {
+                        entity.setRequirements(cellValue);//排放/监控要求
+                    } else if (j == 12) {
+                        entity.setContent(cellValue);//主要内容
+                    } else if (j == 13) {
+                        entity.setOwner(cellValue);//负责人
+                    } else if (j == 15) {
+                        for (TStaffmgr s : staffmgrs) {
+                            if (s.getStaffid().equals(cellValue.trim())) {
+                                entity.setReviewer(s.getStaffid());//回顾人
+                            }
+                        }
+                    } else if (j == 16) {
+                        if (cellValue.length() > 3) {
+                            entity.setReviewdate(new SimpleDateFormat(DateUtils.getDateFormat(cellValue)).parse(cellValue));//本次回顾日期
+                        }
+                    } else if (j == 17) {
+                        entity.setReviewResult(cellValue);//回顾结果
+                    } else if (j == 18) {
                         if (cellValue.length() > 3) {
                             entity.setNextreviewdate(new SimpleDateFormat(DateUtils.getDateFormat(cellValue)).parse(cellValue));//下次回顾日期
                         }
-                    } else if (j == 10) {
+                    } else if (j == 19) {
                         for (SysDept d : dept) {
                             if (d.getDeptName().equals(cellValue.trim())) {
                                 entity.setDeptId(d.getDeptId());//部门编号
                             }
                         }
-                    } else if (j == 11) {
+                    } else if (j == 20) {
                         entity.setRemarks(cellValue);//备注
                     }
                 }

+ 47 - 49
master/src/main/java/com/ruoyi/project/ehs/domain/TEnvironapproval.java

@@ -34,35 +34,74 @@ public class TEnvironapproval extends BaseEntity
 
     /** 发证日期 */
     @JsonFormat(pattern = "yyyy-MM-dd" , timezone = "GMT+8")
-    @Excel(name = "发证日期", width = 30, dateFormat = "yyyy-MM-dd")
+    @Excel(name = "批准日期", width = 30, dateFormat = "yyyy-MM-dd")
     private Date effetivedate;
 
+    /** 适用范围 */
+    @Excel(name = "适用范围")
+    private String scope;
+
+    /** 相关法规 */
+    @Excel(name = "相关法规")
+    private String relatedlaw;
+
+    /** 主管部门 */
+    @Excel(name = "审批单位")
+    private String responsauth;
+
     /** 证书有效期是否永久 */
     @Excel(name = "证书有效期是否永久", dictType = "YES_NO")
     private Long isPermanent;
 
     /** 证书有效期(前) */
     @JsonFormat(pattern = "yyyy-MM-dd" , timezone = "GMT+8")
-    @Excel(name = "证书有效期", width = 30, dateFormat = "yyyy-MM-dd")
     private Date validityBefore;
+    /** 证书有效期(后) */
+    @JsonFormat(pattern = "yyyy-MM-dd" , timezone = "GMT+8")
+    private Date validityAfter;
+    @Excel(name = "证书有效期", width = 80)
+    private String validity;
 
-    /** 相关法规 */
-    @Excel(name = "相关法规")
-    private String relatedlaw;
+    /** 是否需要跟进 */
+    @Excel(name = "是否需要跟进", dictType = "YES_NO")
+    private String follow;
 
-    /** 主管部门 */
-    @Excel(name = "主管部门")
-    private String responsauth;
+    /** 使用/储存/废物最大量 */
+    @Excel(name = "使用/储存/废物最大量")
+    private String allowance;
+
+    /** 排放/监控要求 */
+    @Excel(name = "排放/监控要求")
+    private String requirements;
+    private String reqPic;
+    private String reqWater;
+    private String reqExhaust;
+
+    /** 主要内容 */
+    @Excel(name = "主要内容")
+    private String content;
+    private String conPic;
+    private String conWater;
+    private String conExhaust;
 
     /** 负责人 */
     @Excel(name = "负责人")
     private String owner;
 
+    /** 回顾人 */
+    private String reviewer;
+    @Excel(name = "回顾人")
+    private String reviewerName;
+
     /** 本次回顾日期 */
     @JsonFormat(pattern = "yyyy-MM-dd" , timezone = "GMT+8")
     @Excel(name = "本次回顾日期", width = 30, dateFormat = "yyyy-MM-dd")
     private Date reviewdate;
 
+    /** 回顾结果 */
+    @Excel(name = "回顾结果")
+    private String reviewResult;
+
     /** 下次回顾日期 */
     @JsonFormat(pattern = "yyyy-MM-dd" , timezone = "GMT+8")
     @Excel(name = "下次回顾日期", width = 30, dateFormat = "yyyy-MM-dd")
@@ -97,47 +136,6 @@ public class TEnvironapproval extends BaseEntity
     @Excel(name = "备注")
     private String remarks;
 
-    /** 适用范围 */
-    @Excel(name = "适用范围")
-    private String scope;
-
-    /** 是否需要跟进 */
-    @Excel(name = "是否需要跟进")
-    private String follow;
-
-    /** 使用/储存/废物最大量 */
-    @Excel(name = "使用/储存/废物最大量")
-    private String allowance;
-
-    /** 排放/监控要求 */
-    @Excel(name = "排放/监控要求")
-    private String requirements;
-    private String reqPic;
-    private String reqWater;
-    private String reqExhaust;
-
-    /** 回顾人 */
-    @Excel(name = "回顾人")
-    private String reviewer;
-    private String reviewerName;
-
-    /** 回顾结果 */
-    @Excel(name = "回顾结果")
-    private String reviewResult;
-
-    /** 证书有效期(后) */
-    @Excel(name = "证书有效期", readConverterExp = "后=")
-    private Date validityAfter;
-
-    private String validity;
-
-    /** 主要内容 */
-    @Excel(name = "主要内容")
-    private String content;
-    private String conPic;
-    private String conWater;
-    private String conExhaust;
-
     public void setId(Long id)
     {
         this.id = id;

+ 42 - 43
master/src/main/java/com/ruoyi/project/ehs/domain/TFireapproval.java

@@ -25,7 +25,6 @@ public class TFireapproval extends BaseEntity
     private String plantCode;
 
     /** 部门 */
-    @Excel(name = "部门")
     private String division;
 
     /** 批文名称 */
@@ -33,39 +32,72 @@ public class TFireapproval extends BaseEntity
     private String approvalname;
 
     /** 文件编号 */
-    @Excel(name = "文编号")
+    @Excel(name = "文编号")
     private String fileno;
 
     /** 发证日期 */
     @JsonFormat(pattern = "yyyy-MM-dd" , timezone = "GMT+8")
-    @Excel(name = "发证日期", width = 30, dateFormat = "yyyy-MM-dd")
+    @Excel(name = "批准日期", width = 30, dateFormat = "yyyy-MM-dd")
     private Date effetivedate;
 
+    /** 适用范围 */
+    @Excel(name = "适用范围")
+    private String scope;
+
+    /** 相关法规 */
+    @Excel(name = "相关法规")
+    private String relatedlaw;
+
+    /** 主管部门 */
+    @Excel(name = "审批单位")
+    private String responsauth;
+
+    /** 证书有效期是否永久 */
+    @Excel(name = "证书有效期是否永久", dictType = "YES_NO")
+    private Long isPermanent;
+
     /** 有效期 */
-    @Excel(name = "有效期")
     @JsonFormat(pattern = "yyyy-MM-dd" , timezone = "GMT+8")
     private Date validityBefore;
     @JsonFormat(pattern = "yyyy-MM-dd" , timezone = "GMT+8")
     private Date validityAfter;
+    @Excel(name = "证书有效期", width = 80)
     private String validity;
 
-    /** 相关法规 */
-    @Excel(name = "相关法规")
-    private String relatedlaw;
+    /** 是否需要跟进 */
+    @Excel(name = "是否需要跟进", dictType = "YES_NO")
+    private String follow;
 
-    /** 主管部门 */
-    @Excel(name = "主管部门")
-    private String responsauth;
+    /** 使用/储存/废物最大量 */
+    @Excel(name = "使用/储存/废物最大量")
+    private String allowance;
+
+    /** 排放/监控要求 */
+    @Excel(name = "排放/监控要求")
+    private String requirements;
+
+    /** 主要内容 */
+    @Excel(name = "主要内容")
+    private String content;
 
     /** 负责人 */
     @Excel(name = "负责人")
     private String owner;
 
+    /** 回顾人 */
+    private String reviewer;
+    @Excel(name = "回顾人")
+    private String reviewerName;
+
     /** 本次回顾时间 */
     @JsonFormat(pattern = "yyyy-MM-dd" , timezone = "GMT+8")
     @Excel(name = "本次回顾时间", width = 30, dateFormat = "yyyy-MM-dd")
     private Date reviewdate;
 
+    /** 回顾结果 */
+    @Excel(name = "回顾结果")
+    private String reviewResult;
+
     /** 下次回顾时间 */
     @JsonFormat(pattern = "yyyy-MM-dd" , timezone = "GMT+8")
     @Excel(name = "下次回顾时间", width = 30, dateFormat = "yyyy-MM-dd")
@@ -97,39 +129,6 @@ public class TFireapproval extends BaseEntity
     @Excel(name = "备注")
     private String remarks;
 
-    /** 适用范围 */
-    @Excel(name = "适用范围")
-    private String scope;
-
-    /** 是否需要跟进 */
-    @Excel(name = "是否需要跟进")
-    private String follow;
-
-    /** 使用/储存/废物最大量 */
-    @Excel(name = "使用/储存/废物最大量")
-    private String allowance;
-
-    /** 排放/监控要求 */
-    @Excel(name = "排放/监控要求")
-    private String requirements;
-
-    /** 回顾人 */
-    @Excel(name = "回顾人")
-    private String reviewer;
-    private String reviewerName;
-
-    /** 回顾结果 */
-    @Excel(name = "回顾结果")
-    private String reviewResult;
-
-    /** 主要内容 */
-    @Excel(name = "主要内容")
-    private String content;
-
-    /** 证书有效期是否永久 */
-    @Excel(name = "证书有效期是否永久")
-    private Long isPermanent;
-
     public void setId(Long id)
     {
         this.id = id;

+ 45 - 51
master/src/main/java/com/ruoyi/project/ehs/domain/THealthapproval.java

@@ -33,27 +33,65 @@ public class THealthapproval extends BaseEntity
     @Excel(name = "批准日期", width = 30, dateFormat = "yyyy-MM-dd")
     private Date effetivedate;
 
-    /** 证书有效期(前) */
-    @Excel(name = "证书有效期", readConverterExp = "前=")
-    private Date validityBefore;
+    /** 适用范围 */
+    @Excel(name = "适用范围")
+    private String scope;
 
     /** 相关法规 */
     @Excel(name = "相关法规")
     private String relatedlaw;
 
     /** 主管部门 */
-    @Excel(name = "主管部门")
+    @Excel(name = "审批单位")
     private String responsauth;
 
+    /** 证书有效期是否永久 */
+    @Excel(name = "证书有效期是否永久", dictType = "YES_NO")
+    private Long isPermanent;
+
+    /** 证书有效期(前) */
+    @JsonFormat(pattern = "yyyy-MM-dd" , timezone = "GMT+8")
+    private Date validityBefore;
+    /** 证书有效期(后) */
+    @JsonFormat(pattern = "yyyy-MM-dd" , timezone = "GMT+8")
+    private Date validityAfter;
+    @Excel(name = "证书有效期", width = 80)
+    private String validity;
+
+    /** 是否需要跟进 */
+    @Excel(name = "是否需要跟进", dictType = "YES_NO")
+    private String follow;
+
+    /** 使用/储存/废物最大量 */
+    @Excel(name = "使用/储存/废物最大量")
+    private String allowance;
+
+    /** 排放/监控要求 */
+    @Excel(name = "排放/监控要求")
+    private String requirements;
+
+    /** 主要内容 */
+    @Excel(name = "主要内容")
+    private String content;
+
     /** 负责人 */
     @Excel(name = "负责人")
     private String owner;
 
+    /** 回顾人 */
+    private String reviewer;
+    @Excel(name = "回顾人")
+    private String reviewerName;
+
     /** 本次回顾日期 */
     @JsonFormat(pattern = "yyyy-MM-dd" , timezone = "GMT+8")
     @Excel(name = "本次回顾日期", width = 30, dateFormat = "yyyy-MM-dd")
     private Date reviewdate;
 
+    /** 回顾结果 */
+    @Excel(name = "回顾结果")
+    private String reviewResult;
+
     /** 下次回顾日期 */
     @JsonFormat(pattern = "yyyy-MM-dd" , timezone = "GMT+8")
     @Excel(name = "下次回顾日期", width = 30, dateFormat = "yyyy-MM-dd")
@@ -63,73 +101,29 @@ public class THealthapproval extends BaseEntity
     private Long delFlag;
 
     /** 创建人 */
-    @Excel(name = "创建人")
     private String createrCode;
 
     /** 创建日期 */
     @JsonFormat(pattern = "yyyy-MM-dd" , timezone = "GMT+8")
-    @Excel(name = "创建日期", width = 30, dateFormat = "yyyy-MM-dd")
     private Date createdate;
 
     /** 更新人 */
-    @Excel(name = "更新人")
     private String updaterCode;
 
     /** 更新日期 */
     @JsonFormat(pattern = "yyyy-MM-dd" , timezone = "GMT+8")
-    @Excel(name = "更新日期", width = 30, dateFormat = "yyyy-MM-dd")
     private Date updatedate;
 
     /** 部门编号 */
-    @Excel(name = "部门编号")
     private Long deptId;
 
-    /** 备注 */
-    @Excel(name = "备注")
-    private String remarks;
-
-    /** 证书有效期是否永久 */
-    @Excel(name = "证书有效期是否永久")
-    private Long isPermanent;
-
-    /** 适用范围 */
-    @Excel(name = "适用范围")
-    private String scope;
-
-    /** 是否需要跟进 */
-    @Excel(name = "是否需要跟进")
-    private String follow;
-
-    /** 使用/储存/废物最大量 */
-    @Excel(name = "使用/储存/废物最大量")
-    private String allowance;
-
-    /** 排放/监控要求 */
-    @Excel(name = "排放/监控要求")
-    private String requirements;
-
-    /** 回顾人 */
-    @Excel(name = "回顾人")
-    private String reviewer;
-    private String reviewerName;
-
-    /** 回顾结果 */
-    @Excel(name = "回顾结果")
-    private String reviewResult;
-
-    /** 证书有效期(后) */
-    @Excel(name = "证书有效期", readConverterExp = "后=")
-    private Date validityAfter;
-
     /** 部门名称 */
     @Excel(name = "部门名称")
     private String deptName;
 
-    /** 主要内容 */
-    @Excel(name = "主要内容")
-    private String content;
-
-    private String validity;
+    /** 备注 */
+    @Excel(name = "备注")
+    private String remarks;
 
     public void setId(Long id)
     {

+ 41 - 41
master/src/main/java/com/ruoyi/project/ehs/domain/TSafetyapproval.java

@@ -34,34 +34,67 @@ public class TSafetyapproval extends BaseEntity
 
     /** 发证日期 */
     @JsonFormat(pattern = "yyyy-MM-dd" , timezone = "GMT+8")
-    @Excel(name = "发证日期", width = 30, dateFormat = "yyyy-MM-dd")
+    @Excel(name = "批准日期", width = 30, dateFormat = "yyyy-MM-dd")
     private Date effetivedate;
 
+    /** 适用范围 */
+    @Excel(name = "适用范围")
+    private String scope;
+
+    /** 相关法规 */
+    @Excel(name = "相关法规")
+    private String relatedlaw;
+
+    /** 主管部门 */
+    @Excel(name = "审批单位")
+    private String responsauth;
+
+    /** 证书有效期是否永久 */
+    @Excel(name = "证书有效期是否永久", dictType = "YES_NO")
+    private Long isPermanent;
+
     /** 证书有效期 */
     @JsonFormat(pattern = "yyyy-MM-dd" , timezone = "GMT+8")
-    @Excel(name = "证书有效期", width = 30, dateFormat = "yyyy-MM-dd")
     private Date validityBefore;
     @JsonFormat(pattern = "yyyy-MM-dd" , timezone = "GMT+8")
     private Date validityAfter;
+    @Excel(name = "证书有效期", width = 80)
     private String validity;
 
-    /** 相关法规 */
-    @Excel(name = "相关法规")
-    private String relatedlaw;
+    /** 是否需要跟进 */
+    @Excel(name = "是否需要跟进", dictType = "YES_NO")
+    private String follow;
 
-    /** 主管部门 */
-    @Excel(name = "主管部门")
-    private String responsauth;
+    /** 使用/储存/废物最大量 */
+    @Excel(name = "使用/储存/废物最大量")
+    private String allowance;
+
+    /** 排放/监控要求 */
+    @Excel(name = "排放/监控要求")
+    private String requirements;
+
+    /** 主要内容 */
+    @Excel(name = "主要内容")
+    private String content;
 
     /** 负责人 */
     @Excel(name = "负责人")
     private String owner;
 
+    /** 回顾人 */
+    private String reviewer;
+    @Excel(name = "回顾人")
+    private String reviewerName;
+
     /** 本次回顾日期 */
     @JsonFormat(pattern = "yyyy-MM-dd" , timezone = "GMT+8")
     @Excel(name = "本次回顾日期", width = 30, dateFormat = "yyyy-MM-dd")
     private Date reviewdate;
 
+    /** 回顾结果 */
+    @Excel(name = "回顾结果")
+    private String reviewResult;
+
     /** 下次回顾日期 */
     @JsonFormat(pattern = "yyyy-MM-dd" , timezone = "GMT+8")
     @Excel(name = "下次回顾日期", width = 30, dateFormat = "yyyy-MM-dd")
@@ -97,39 +130,6 @@ public class TSafetyapproval extends BaseEntity
     @Excel(name = "备注")
     private String remarks;
 
-    /** 适用范围 */
-    @Excel(name = "适用范围")
-    private String scope;
-
-    /** 是否需要跟进 */
-    @Excel(name = "是否需要跟进")
-    private String follow;
-
-    /** 使用/储存/废物最大量 */
-    @Excel(name = "使用/储存/废物最大量")
-    private String allowance;
-
-    /** 排放/监控要求 */
-    @Excel(name = "排放/监控要求")
-    private String requirements;
-
-    /** 回顾人 */
-    @Excel(name = "回顾人")
-    private String reviewer;
-    private String reviewerName;
-
-    /** 回顾结果 */
-    @Excel(name = "回顾结果")
-    private String reviewResult;
-
-    /** 主要内容 */
-    @Excel(name = "主要内容")
-    private String content;
-
-    /** 证书有效期是否永久 */
-    @Excel(name = "证书有效期是否永久")
-    private Long isPermanent;
-
     public void setId(Long id)
     {
         this.id = id;

+ 15 - 4
master/src/main/java/com/ruoyi/project/plant/controller/TTargetlistController.java

@@ -167,6 +167,7 @@ public class TTargetlistController extends BaseController
         List<TTargetlist> list = new ArrayList<TTargetlist>();
         //字典查询
         List<SysDictData> plant = iSysDictTypeService.selectDictDataByType("PLANT_DIVIDE");
+        List<SysDictData> partners = iSysDictTypeService.selectDictDataByType("PARTNERS");
         //部门查询
         List<SysDept> dept = iSysDeptService.selectDeptList(new SysDept());
         //父菜单查询
@@ -179,6 +180,7 @@ public class TTargetlistController extends BaseController
                 Row row = sheet.getRow(i);
                 int cellNum = row.getPhysicalNumberOfCells();
                 TTargetlist entity = new TTargetlist();
+                String year = null;
                 for (int j = 0; j < cellNum; j++) {
                     Cell cell = row.getCell(j);
                     cell.setCellType(CellType.STRING);
@@ -197,13 +199,14 @@ public class TTargetlistController extends BaseController
                     } else if (j == 3) {
                         entity.setTargets(cellValue);//目标
                     } else if (j == 4) {
-                        if (cellValue != "") {
+                        if (!cellValue.equals("")) {
                             entity.setYear(cellValue);//年度
+                            year = cellValue;
                         }
                     } else if (j == 5) {
-                        if (cellValue != "") {
+                        if (!cellValue.equals("")) {
                             for (TTargetlist t : tTargetlists) {
-                                if (t.getItem().equals(cellValue.trim())) {
+                                if (t.getItem().equals(cellValue.trim()) && t.getYear().equals(year)) {
                                     entity.setParentId(t.getId());//父菜单ID
                                 }
                             }
@@ -211,12 +214,20 @@ public class TTargetlistController extends BaseController
                             entity.setParentId(Long.parseLong("0"));
                         }
                     } else if (j == 6) {
+                        entity.setYardstick(cellValue);//判断标准
+                    } else if (j == 7) {
+                        for (SysDictData p : partners) {
+                            if (p.getDictLabel().equals(cellValue)) {
+                                entity.setPartners(p.getDictValue());//合作者
+                            }
+                        }
+                    } else if (j == 8) {
                         for (SysDept d : dept) {
                             if (d.getDeptName().equals(cellValue.trim())) {
                                 entity.setDeptId(d.getDeptId());//部门编号
                             }
                         }
-                    } else if (j == 7) {
+                    } else if (j == 9) {
                         entity.setRemarks(cellValue);//备注
                     }
                 }

+ 2 - 1
master/src/main/resources/mybatis/ehs/TEnvironapprovalMapper.xml

@@ -13,6 +13,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="isPermanent" column="is_permanent"    />
         <result property="validityBefore"    column="validity_before"    />
         <result property="validityAfter"    column="validity_after"    />
+        <result property="validity"    column="validity"    />
         <result property="relatedlaw"    column="relatedlaw"    />
         <result property="responsauth"    column="responsauth"    />
         <result property="owner"    column="owner"    />
@@ -44,7 +45,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
 
     <sql id="selectTEnvironapprovalVo">
-        select d.id, d.plant_code, d.approvalname, t.name, d.certno, d.effetivedate, d.is_permanent, d.validity_before, d.relatedlaw, d.responsauth, d.owner, d.reviewdate, d.nextreviewdate, d.conttype, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.dept_id, d.remarks, d.scope, d.follow, d.allowance, d.requirements, d.req_pic, d.req_water, d.req_exhaust, d.reviewer, d.validity_after, d.review_result, d.content, d.con_pic, d.con_water, d.con_exhaust ,s.dept_name from t_environapproval d
+        select d.id, d.plant_code, d.approvalname, t.name, d.certno, d.effetivedate, d.is_permanent, d.validity_before, CONCAT(TO_CHAR(d.validity_before,'YYYY.MM.dd-'), TO_CHAR(d.validity_after,'YYYY.MM.dd')) AS validity, d.relatedlaw, d.responsauth, d.owner, d.reviewdate, d.nextreviewdate, d.conttype, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.dept_id, d.remarks, d.scope, d.follow, d.allowance, d.requirements, d.req_pic, d.req_water, d.req_exhaust, d.reviewer, d.validity_after, d.review_result, d.content, d.con_pic, d.con_water, d.con_exhaust ,s.dept_name from t_environapproval d
       left join sys_dept s on s.dept_id = d.dept_id
       left join t_staffmgr t on t.staffid = d.reviewer
     </sql>

+ 2 - 1
master/src/main/resources/mybatis/ehs/TFireapprovalMapper.xml

@@ -13,6 +13,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="effetivedate"    column="effetivedate"    />
         <result property="validityBefore"    column="validity_before"    />
         <result property="validityAfter"    column="validity_after"    />
+        <result property="validity"    column="validity"    />
         <result property="relatedlaw"    column="relatedlaw"    />
         <result property="responsauth"    column="responsauth"    />
         <result property="owner"    column="owner"    />
@@ -38,7 +39,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
 
     <sql id="selectTFireapprovalVo">
-        select d.id, t.name, d.plant_code, d.division, d.approvalname, d.fileno, d.effetivedate, d.validity_before, d.relatedlaw, d.responsauth, d.owner, d.reviewdate, d.nextreviewdate, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.dept_id, d.remarks , d.scope, d.follow, d.allowance, d.requirements, d.reviewer, d.validity_after, d.review_result, d.content, d.is_permanent ,s.dept_name from t_fireapproval d
+        select d.id, t.name, d.plant_code, d.division, d.approvalname, d.fileno, d.effetivedate, d.validity_before, CONCAT(TO_CHAR(d.validity_before,'YYYY.MM.dd-'), TO_CHAR(d.validity_after,'YYYY.MM.dd')) AS validity, d.relatedlaw, d.responsauth, d.owner, d.reviewdate, d.nextreviewdate, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.dept_id, d.remarks , d.scope, d.follow, d.allowance, d.requirements, d.reviewer, d.validity_after, d.review_result, d.content, d.is_permanent ,s.dept_name from t_fireapproval d
       left join sys_dept s on s.dept_id = d.dept_id
       left join t_staffmgr t on t.staffid = d.reviewer
     </sql>

+ 2 - 1
master/src/main/resources/mybatis/ehs/THealthapprovalMapper.xml

@@ -10,6 +10,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="certno"    column="certno"    />
         <result property="effetivedate"    column="effetivedate"    />
         <result property="validityBefore"    column="validity_before"    />
+        <result property="validity"    column="validity"    />
         <result property="relatedlaw"    column="relatedlaw"    />
         <result property="responsauth"    column="responsauth"    />
         <result property="owner"    column="owner"    />
@@ -36,7 +37,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
 
     <sql id="selectTHealthapprovalVo">
-        select d.id, t.name, d.approvalname, d.certno, d.effetivedate, d.validity_before, d.relatedlaw, d.responsauth, d.owner, d.reviewdate, d.nextreviewdate, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.dept_id, d.remarks, d.is_permanent, d.scope, d.follow, d.allowance, d.requirements, d.reviewer, d.review_result, d.validity_after , d.content, s.dept_name from t_healthapproval d
+        select d.id, t.name, d.approvalname, d.certno, d.effetivedate, d.validity_before, CONCAT(TO_CHAR(d.validity_before,'YYYY.MM.dd-'), TO_CHAR(d.validity_after,'YYYY.MM.dd')) AS validity, d.relatedlaw, d.responsauth, d.owner, d.reviewdate, d.nextreviewdate, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.dept_id, d.remarks, d.is_permanent, d.scope, d.follow, d.allowance, d.requirements, d.reviewer, d.review_result, d.validity_after , d.content, s.dept_name from t_healthapproval d
       left join sys_dept s on s.dept_id = d.dept_id
       left join t_staffmgr t on t.staffid = d.reviewer
     </sql>

+ 2 - 1
master/src/main/resources/mybatis/ehs/TSafetyapprovalMapper.xml

@@ -12,6 +12,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="effetivedate"    column="effetivedate"    />
         <result property="validityBefore"    column="validity_before"    />
         <result property="validityAfter"    column="validity_after"    />
+        <result property="validity"    column="validity"    />
         <result property="relatedlaw"    column="relatedlaw"    />
         <result property="responsauth"    column="responsauth"    />
         <result property="owner"    column="owner"    />
@@ -38,7 +39,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
 
     <sql id="selectTSafetyapprovalVo">
-        select d.id, d.plant_code, d.approvalname, t.name, d.certno, d.effetivedate, d.validity_before, d.relatedlaw, d.responsauth, d.owner, d.reviewdate, d.nextreviewdate, d.conttype, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.dept_id, d.remarks, d.scope, d.follow, d.allowance, d.requirements, d.reviewer, d.validity_after, d.review_result , d.content, d.is_permanent, s.dept_name from t_safetyapproval d
+        select d.id, d.plant_code, d.approvalname, t.name, d.certno, d.effetivedate, d.validity_before, CONCAT(TO_CHAR(d.validity_before,'YYYY.MM.dd-'), TO_CHAR(d.validity_after,'YYYY.MM.dd')) AS validity, d.relatedlaw, d.responsauth, d.owner, d.reviewdate, d.nextreviewdate, d.conttype, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.dept_id, d.remarks, d.scope, d.follow, d.allowance, d.requirements, d.reviewer, d.validity_after, d.review_result , d.content, d.is_permanent, s.dept_name from t_safetyapproval d
       left join sys_dept s on s.dept_id = d.dept_id
       left join t_staffmgr t on t.staffid = d.reviewer
     </sql>

BIN
master/src/main/resources/static/template/ehs/environapproval.xlsx


BIN
master/src/main/resources/static/template/ehs/fireapproval.xlsx


BIN
master/src/main/resources/static/template/ehs/healthapproval.xlsx


BIN
master/src/main/resources/static/template/ehs/safetyapproval.xlsx


BIN
master/src/main/resources/static/template/plant/targetlist.xlsx


+ 0 - 10
ui/src/views/ehs/fireapproval/index.vue

@@ -150,11 +150,6 @@
               </el-select>
             </el-form-item>
           </el-col>
-          <el-col :span="12">
-            <el-form-item :label="$t('消防批文部门')" prop="division">
-              <el-input v-model="form.division" :placeholder="$t('请输入') + $t('消防批文部门')" />
-            </el-form-item>
-          </el-col>
         </el-row>
         <el-row>
           <el-col :span="12">
@@ -566,7 +561,6 @@ export default {
         pageNum: 1,
         pageSize: 20,
         plantCode: null,
-        division: null,
         approvalname: null,
         fileno: null,
         effetivedate: null,
@@ -587,9 +581,6 @@ export default {
         plantCode: [
           { required: true, message: this.$t('装置') + this.$t('不能为空'), trigger: "change" }
         ],
-        division: [
-          { required: true, message: this.$t('消防批文部门') + this.$t('不能为空'), trigger: "blur" }
-        ],
         approvalname: [
           { required: true, message: this.$t('批文名称') + this.$t('不能为空'), trigger: "blur" }
         ],
@@ -708,7 +699,6 @@ export default {
       this.form = {
         id: null,
         plantCode: null,
-        division: null,
         approvalname: null,
         fileno: null,
         effetivedate: null,

+ 31 - 23
ui/src/views/ehs/healthapproval/index.vue

@@ -329,7 +329,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"
@@ -342,9 +342,11 @@
               <em>{{ $t('点击上传') }}</em>
             </div>
             <div class="el-upload__tip" slot="tip">
-                <el-checkbox v-model="upload.updateSupport" />{{ $t('是否更新已经存在的用户数据') }}
                 <el-link type="info" style="font-size:12px" @click="importTemplate">{{ $t('下载模板') }}</el-link>
             </div>
+            <form ref="downloadFileForm" :action="upload.downloadAction" target="FORMSUBMIT">
+              <input name="type" :value="upload.type" hidden />
+            </form>
             <div class="el-upload__tip" style="color:red" slot="tip">{{ $t('提示:仅允许导入“xls”或“xlsx”格式文件!')}}</div>
         </el-upload>
         <div slot="footer" class="dialog-footer">
@@ -421,7 +423,7 @@
 </template>
 
 <script>
-import { listHealthapproval, getHealthapproval, delHealthapproval, addHealthapproval, updateHealthapproval, exportHealthapproval, importTemplate} from "@/api/ehs/healthapproval";
+import { listHealthapproval, getHealthapproval, delHealthapproval, addHealthapproval, updateHealthapproval, exportHealthapproval} from "@/api/ehs/healthapproval";
 import { listStaffmgr } from "@/api/plant/staffmgr";
 import {allFileList, delCommonfile} from "@/api/common/commonfile";
 import { treeselect } from "@/api/system/dept";
@@ -494,18 +496,22 @@ export default {
       reviewerOptions: [],
       // 用户导入参数
       upload: {
-          // 是否显示弹出层(用户导入)
-          open: false,
-          // 弹出层标题(用户导入)
-          title: "",
-          // 是否禁用上传
-          isUploading: false,
-          // 是否更新已经存在的用户数据
-          updateSupport: 0,
-          // 设置上传的请求头部
-          headers: { Authorization: "Bearer " + getToken() },
-          // 上传的地址
-          url: process.env.VUE_APP_BASE_API + "/ehs/healthapproval/importData"
+        //下载模板请求地址
+        downloadAction: process.env.VUE_APP_BASE_API + '/common/template',
+        //下载模板类型
+        type: "healthapproval",
+        // 是否显示弹出层(用户导入)
+        open: false,
+        // 弹出层标题(用户导入)
+        title: "",
+        // 是否禁用上传
+        isUploading: false,
+        // 是否更新已经存在的用户数据
+        updateSupport: 0,
+        // 设置上传的请求头部
+        headers: { Authorization: "Bearer " + getToken() },
+        // 上传的地址
+        url: process.env.VUE_APP_BASE_API + "/ehs/healthapproval/importData"
       },
       // 报告附件参数
       doc: {
@@ -751,9 +757,7 @@ export default {
     },
     /** 下载模板操作 */
     importTemplate() {
-        importTemplate().then(response => {
-            this.download(response.msg);
-        });
+      this.$refs['downloadFileForm'].submit()
     },
     // 文件上传中处理
     handleFileUploadProgress(event, file, fileList) {
@@ -761,11 +765,15 @@ export default {
     },
     // 文件上传成功处理
     handleFileSuccess(response, file, fileList) {
-        this.upload.open = false;
-        this.upload.isUploading = false;
-        this.$refs.upload.clearFiles();
-        this.$alert(response.msg, this.$t('导入结果'), { dangerouslyUseHTMLString: true });
-        this.getList();
+      this.upload.open = false;
+      this.upload.isUploading = false;
+      this.$refs.upload.clearFiles();
+      if (response.data[0] != null) {
+        this.$alert(this.$t('成功导入') + response.msg + this.$t('条数据') + "," + this.$t('第') + response.data + this.$t('行数据出现错误导入失败')+"。", this.$t('导入结果'), { dangerouslyUseHTMLString: true });
+      }else {
+        this.$alert(this.$t('成功导入') + response.msg + this.$t('条数据'), this.$t('导入结果'), { dangerouslyUseHTMLString: true });
+      }
+      this.getList();
     },
     // 提交上传文件
     submitFileForm() {