Browse Source

极光推送
检查内容导出

jiangbiao 7 months ago
parent
commit
fbe693a756
35 changed files with 962 additions and 177 deletions
  1. 2 0
      master/src/main/java/com/ruoyi/RuoYiApplication.java
  2. 11 1
      master/src/main/java/com/ruoyi/common/jpush/JiGuangPushService.java
  3. 74 0
      master/src/main/java/com/ruoyi/common/utils/file/FileUtils.java
  4. 5 1
      master/src/main/java/com/ruoyi/config/ActivitiConfig.java
  5. 3 0
      master/src/main/java/com/ruoyi/project/common/CommonController.java
  6. 1 1
      master/src/main/java/com/ruoyi/project/patrol/patrol/controller/TIndexController.java
  7. 1 0
      master/src/main/java/com/ruoyi/project/pssr/controller/TPssrAboveallController.java
  8. 89 11
      master/src/main/java/com/ruoyi/project/pssr/controller/TPssrApproveController.java
  9. 6 2
      master/src/main/java/com/ruoyi/project/pssr/controller/TPssrContentModelController.java
  10. 85 0
      master/src/main/java/com/ruoyi/project/pssr/controller/TPssrRegionController.java
  11. 309 31
      master/src/main/java/com/ruoyi/project/pssr/controller/TPssrSubcontentController.java
  12. 58 3
      master/src/main/java/com/ruoyi/project/pssr/domain/TPssrAboveall.java
  13. 37 0
      master/src/main/java/com/ruoyi/project/pssr/domain/TPssrApprove.java
  14. 19 0
      master/src/main/java/com/ruoyi/project/pssr/domain/TPssrContentModel.java
  15. 31 0
      master/src/main/java/com/ruoyi/project/pssr/domain/TPssrSubcontent.java
  16. 1 0
      master/src/main/java/com/ruoyi/project/pssr/mapper/TPssrApproveMapper.java
  17. 1 0
      master/src/main/java/com/ruoyi/project/pssr/service/ITPssrApproveService.java
  18. 5 0
      master/src/main/java/com/ruoyi/project/pssr/service/impl/TPssrApproveServiceImpl.java
  19. 2 0
      master/src/main/resources/application.yml
  20. 37 1
      master/src/main/resources/mybatis/pssr/TPssrAboveallMapper.xml
  21. 23 2
      master/src/main/resources/mybatis/pssr/TPssrApproveMapper.xml
  22. 11 1
      master/src/main/resources/mybatis/pssr/TPssrContentModelMapper.xml
  23. 1 0
      master/src/main/resources/mybatis/pssr/TPssrRegionMapper.xml
  24. 11 1
      master/src/main/resources/mybatis/pssr/TPssrSubcontentMapper.xml
  25. 3 3
      master/src/main/resources/processes/pssr/pssrMgrConfirm.bpmn
  26. BIN
      master/src/main/resources/static/template/pssr/pssrRegionTmpl.xlsx
  27. BIN
      master/src/main/resources/static/template/pssr/pssrTmpl.xlsx
  28. BIN
      master/src/main/resources/static/word/pssr/pssrConfirm.docx
  29. 1 1
      ui/src/layout/components/Navbar.vue
  30. 1 1
      ui/src/views/approve/approveDetail/pssrApprove-detail.vue
  31. 9 9
      ui/src/views/pssr/aboveall/index.vue
  32. 11 2
      ui/src/views/pssr/pssrModel/index.vue
  33. 17 10
      ui/src/views/pssr/region/index.vue
  34. 69 68
      ui/src/views/pssr/subcontent/index.vue
  35. 28 28
      ui/src/views/pssr/subitem/index.vue

+ 2 - 0
master/src/main/java/com/ruoyi/RuoYiApplication.java

@@ -19,6 +19,7 @@ import javax.servlet.MultipartConfigElement;
 import java.security.InvalidKeyException;
 import java.security.NoSuchAlgorithmException;
 import org.apache.commons.codec.binary.Base64;
+import org.springframework.scheduling.annotation.EnableAsync;
 
 /**
  * 启动程序
@@ -26,6 +27,7 @@ import org.apache.commons.codec.binary.Base64;
  * @author ruoyi
  */
 @SpringBootApplication(exclude = { DataSourceAutoConfiguration.class })
+@EnableAsync
 public class RuoYiApplication
 {
     public static void main(String[] args)

+ 11 - 1
master/src/main/java/com/ruoyi/common/jpush/JiGuangPushService.java

@@ -11,6 +11,8 @@ import com.alibaba.fastjson.JSON;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.scheduling.annotation.Async;
 import org.springframework.stereotype.Service;
 
 import java.util.Arrays;
@@ -23,12 +25,15 @@ public class JiGuangPushService {
     @Autowired
     private PushApi pushApi;
 
+    @Value("${jpush.isDev}")
+    private boolean isDev;
+
     public void getCidForPush() {
         CidGetResult result = pushApi.getCidForPush(10);
         log.info("result:{}", result);
     }
 
-
+    @Async
     public void send(String title, String alert, String... alias) {
         PushSendParam param = new PushSendParam();
         // 通知内容
@@ -45,6 +50,11 @@ public class JiGuangPushService {
         notificationMessage.setAndroid(android);
         param.setNotification(notificationMessage);
 
+        if (isDev) {
+            for (String s : alias) {
+                s = "dev-" + s;
+            }
+        }
         // 目标人群
         Audience audience = new Audience();
         audience.setAliasList(Arrays.asList(alias));

+ 74 - 0
master/src/main/java/com/ruoyi/common/utils/file/FileUtils.java

@@ -1,5 +1,10 @@
 package com.ruoyi.common.utils.file;
 
+import com.ruoyi.common.utils.StringUtils;
+import com.ruoyi.framework.config.RuoYiConfig;
+
+import java.awt.*;
+import java.awt.image.BufferedImage;
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.FileNotFoundException;
@@ -7,6 +12,9 @@ import java.io.IOException;
 import java.io.OutputStream;
 import java.io.UnsupportedEncodingException;
 import java.net.URLEncoder;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+import javax.imageio.ImageIO;
 import javax.servlet.http.HttpServletRequest;
 
 /**
@@ -172,4 +180,70 @@ public class FileUtils extends org.apache.commons.io.FileUtils
         int index = Math.max(lastUnixPos, lastWindowsPos);
         return fileName.substring(index + 1);
     }
+
+
+    /**
+     * @param
+     * @return 映射签名的文件名
+     * @throws IOException
+     */
+    public static String fileName(String filepath) {
+        if (StringUtils.isEmpty(filepath)){
+            filepath = "/profile/uploadPath/userSign/暂无签名.jpg";
+        }
+        String newFilePath = filepath.replace("/profile", "");
+        String pathName = RuoYiConfig.getProfile() + newFilePath;
+        if (!new File(pathName).exists()) {
+            genSignImage(pathName);
+        }
+        return pathName;
+    }
+
+    public static void genSignImage(String pathName) {
+        String nickName = pathName.substring(pathName.lastIndexOf("/") + 1, pathName.lastIndexOf("."));
+        String fileType = pathName.substring(pathName.lastIndexOf(".") + 1);
+        int width = 350; // 图片宽度
+        int height = 100; // 图片高度
+
+        // 创建一个类型为预定义图像类型之一的 BufferedImage
+        BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
+
+        // 获取 Graphics2D
+        Graphics2D g2d = image.createGraphics();
+
+        // 设置背景颜色
+        g2d.setColor(Color.WHITE);
+        g2d.fillRect(0, 0, width, height);
+
+        // 设置字体和颜色
+        g2d.setFont(new Font("楷体", Font.BOLD, 80)); // 设置字体样式、大小和类型
+        g2d.setColor(Color.BLACK); // 设置文字颜色
+
+        // 计算文本的宽度和高度,用于定位
+        FontMetrics fm = g2d.getFontMetrics();
+        int textWidth = fm.stringWidth(nickName);
+        int textHeight = fm.getHeight();
+
+        // 在图片上绘制文本
+        // 注意:x和y坐标定义了文本左下角的位置
+        int x = (width - textWidth) / 2; // 居中显示
+        int y = height - textHeight + 70; // 距离底部10像素
+        g2d.drawString(nickName, x, y);
+
+        // 释放图形上下文使用的系统资源
+        g2d.dispose();
+
+        // 保存图片到文件
+        try {
+            String path = pathName.substring(0, pathName.lastIndexOf("/"));
+            if (!new File(path).isDirectory()) {
+                new File(path).mkdirs();
+            }
+            OutputStream out = Files.newOutputStream(Paths.get(pathName));
+            ImageIO.write(image, fileType, out);
+            out.close();
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+    }
 }

+ 5 - 1
master/src/main/java/com/ruoyi/config/ActivitiConfig.java

@@ -171,7 +171,11 @@ public class ActivitiConfig {
 
         DeploymentBuilder pssr3Db = repositoryService().createDeployment();
         Resource pssr3 = resourceLoader.getResource("classpath:/processes/pssr/pssr3confirm.bpmn"); //加载流程图资源文件
-        pssr3Db.enableDuplicateFiltering().addInputStream(pssr3.getFilename(), pssr3.getInputStream()).name("PSSR双确认人确认流程").deploy();//按流程id部署
+        pssr3Db.enableDuplicateFiltering().addInputStream(pssr3.getFilename(), pssr3.getInputStream()).name("PSSR三确认人确认流程").deploy();//按流程id部署
+
+        DeploymentBuilder pssrMgrDb = repositoryService().createDeployment();
+        Resource pssrMgr = resourceLoader.getResource("classpath:/processes/pssr/pssrMgrConfirm.bpmn"); //加载流程图资源文件
+        pssrMgrDb.enableDuplicateFiltering().addInputStream(pssrMgr.getFilename(), pssrMgr.getInputStream()).name("PSSR经理确认流程").deploy();//按流程id部署
 
     }
 }

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

@@ -343,6 +343,9 @@ public class CommonController extends BaseController
         }else if( type.equals("pssrTmpl") ) {
             downloadname = "开车条件确认表导入模板.xlsx";
             url = "static/template/pssr/pssrTmpl.xlsx";
+        }else if( type.equals("pssrRegionTmpl") ) {
+            downloadname = "PSSR区域导入模板.xlsx";
+            url = "static/template/pssr/pssrRegionTmpl.xlsx";
         }
 
         InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream(url);

+ 1 - 1
master/src/main/java/com/ruoyi/project/patrol/patrol/controller/TIndexController.java

@@ -38,6 +38,6 @@ public class TIndexController extends BaseController {
 
     @PostMapping
     public void sentTest() {
-        jiGuangPushService.send("欢迎使用EHS管理助手", "欢迎使用EHS管理助手!","20219","100","10020","1");
+        jiGuangPushService.send("欢迎使用EHS管理助手", "欢迎使用EHS管理助手!","1");
     }
 }

+ 1 - 0
master/src/main/java/com/ruoyi/project/pssr/controller/TPssrAboveallController.java

@@ -1,5 +1,6 @@
 package com.ruoyi.project.pssr.controller;
 
+import com.deepoove.poi.data.*;
 import com.ruoyi.common.utils.StringUtils;
 import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.ruoyi.framework.aspectj.lang.annotation.Log;

+ 89 - 11
master/src/main/java/com/ruoyi/project/pssr/controller/TPssrApproveController.java

@@ -1,6 +1,7 @@
 package com.ruoyi.project.pssr.controller;
 
 import com.ruoyi.common.utils.DateUtils;
+import com.ruoyi.common.utils.StringUtils;
 import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.ruoyi.framework.aspectj.lang.annotation.Log;
 import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
@@ -51,6 +52,9 @@ public class TPssrApproveController extends BaseController {
     @Autowired
     private ITPssrApproveService tPssrApproveService;
 
+    @Autowired
+    private ITPssrAboveallService tPssrAboveallService;
+
     @Autowired
     private ITPssrSubcontentService tPssrSubcontentService;
 
@@ -289,10 +293,10 @@ public class TPssrApproveController extends BaseController {
     }
 
     // pssr发起经理审批
-    public void doMgrApprove(Long aboveallID) {
+    public void doMgrApprove(Long aboveallId) {
         String userId = getUserId().toString();
         TPssrApprove approve = new TPssrApprove();
-        approve.setAboveallId(aboveallID);
+        approve.setAboveallId(aboveallId);
         approve.setApproveStatus(1L);
         approve.setApNo(DateUtils.dateTimeNow() + userId);
         approve.setApproveStatus(1L);
@@ -300,27 +304,97 @@ public class TPssrApproveController extends BaseController {
         approve.setCreatedate(new Date());
         tPssrApproveService.insertTPssrApprove(approve);
 
+        TPssrAboveall aboveall = tPssrAboveallService.selectTPssrAboveallById(aboveallId);
+
 
         TStaffmgr tStaffmgr = new TStaffmgr();
-        tStaffmgr.setActualposts("24");
+        tStaffmgr.setActualposts("24");//装置经理
         tStaffmgr.setDeptId(103L);
-        String executor = "";
         for (SysUser user : userService.selectUserPost(tStaffmgr)) {
-            executor = user.getUserId().toString();
+            approve.setCbpMgr(user.getUserId());
+            approve.setPlantMgr(user.getUserId());
+            aboveall.setPlantMgr(user.getUserId());
+            aboveall.setConfirm(user.getUserId().toString());
+        }
+
+        tStaffmgr.setActualposts("40");//ctm经理
+        for (SysUser user : userService.selectUserPost(tStaffmgr)) {
+            approve.setCtmMgr(user.getUserId());
+            aboveall.setCtmMgr(user.getUserId());
         }
 
+        tStaffmgr.setActualposts("42");//cta经理
+        for (SysUser user : userService.selectUserPost(tStaffmgr)) {
+            approve.setCtaMgr(user.getUserId());
+            aboveall.setCtaMgr(user.getUserId());
+        }
+        List<String> executor = new ArrayList<>();
+        executor.add(approve.getCbpMgr().toString());
+        executor.add(approve.getCtmMgr().toString());
+        executor.add(approve.getCtaMgr().toString());
+
+        tPssrApproveService.insertTPssrApprove(approve);
         // 开始申请流程
         long businessKey = approve.getApproveId();
         //开始工作流、监听
         Authentication.setAuthenticatedUserId(userId);//设置当前申请人
         Map<String, Object> variables = new HashMap<>();
         variables.put("applyUser", userId);
-        variables.put("jlUser", executor);
+        variables.put("allJlUsers", executor);
+        variables.put("jlUser", approve.getPlantMgr());
         //采用key来启动流程定义并设置流程变量,返回流程实例
         ProcessInstance pi = runtimeService.startProcessInstanceByKey("pssrMgrConfirm", String.valueOf(businessKey), variables);
         approve.setProcessId(pi.getProcessInstanceId());
         tPssrApproveService.updateTPssrApprove(approve);
+        aboveall.setApproveStatus(1L);
+        tPssrAboveallService.updateTPssrAboveall(aboveall);
+    }
+
+    @PutMapping("/handleMgrApprove")
+    public AjaxResult handleMgrApprove(DevTask devTask){
+        TPssrApprove approve = devTask.gettPssrApprove();
+        //使用任务服务完成任务(提交任务)
+        String taskId = devTask.getTaskId();
+        // 使用任务id,获取任务对象,获取流程实例id
+        Task task = taskService.createTaskQuery().taskId(taskId).singleResult();
+        //利用任务对象,获取流程实例id
+        String taskName = task.getName();//实例名
+        String processInstancesId = task.getProcessInstanceId();
+        String userId = getUserId().toString();
 
+
+        String condition = devTask.getCondition();
+        TPssrAboveall aboveall = tPssrAboveallService.selectTPssrAboveallById(approve.getAboveallId());
+
+        if (taskName.equals("所有装置经理")){
+            if (condition.equals("0")){
+                if (aboveall.getPlantMgr()==getUserId()){
+                    aboveall.setPlantConfirmdate(new Date());
+                } else if (aboveall.getCtmMgr()==getUserId()) {
+                    aboveall.setCtmConfirmdate(new Date());
+                } else if (aboveall.getCtaMgr()==getUserId()) {
+                    aboveall.setCtaConfirmdate(new Date());
+                }
+            }
+        }
+        if (taskName.equals("装置经理")){
+            if (condition.equals("0")){
+                aboveall.setApproveStatus(2L);
+            }else if (condition.equals("1")){
+                aboveall.setApproveStatus(0L);
+            }
+        }
+        tPssrAboveallService.updateTPssrAboveall(aboveall);
+        //处理流程节点
+        Map<String, Object> param = new HashMap<>();
+        param.put("condition", condition);
+        ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();
+        TaskService taskService = processEngine.getTaskService();
+        //认领任务
+        processEngine.getTaskService().claim(taskId, userId);
+        taskService.complete(taskId, param);
+
+        return AjaxResult.success();
     }
 
     // 检修项目审批流程发起申请
@@ -369,10 +443,10 @@ public class TPssrApproveController extends BaseController {
         exchanger.setSubId(sub.getId());
         exchanger.setApproveStatus(1L);
         TPssrOverhaulExchanger tPssrOverhaulExchanger = tPssrOverhaulExchangerService.selectAllConfirmedPersonBySubId(exchanger);
-        if (tPssrOverhaulExchanger == null) {
-            return;
+        String confirmers = null;
+        if (tPssrOverhaulExchanger != null) {
+            confirmers = tPssrOverhaulExchanger.getConfirmedPerson();
         }
-        String confirmers = tPssrOverhaulExchanger.getConfirmedPerson();
         logger.info("=======================confirmers:{}", confirmers);
 
         TPssrApprove exist = new TPssrApprove();
@@ -407,10 +481,10 @@ public class TPssrApproveController extends BaseController {
             TPssrApprove approve = tPssrApproves.get(0);
             try {
                 runtimeService.deleteProcessInstance(approve.getProcessId(), "pssr1confirm");
+                historyService.deleteHistoricProcessInstance(approve.getProcessId());
             } catch (Exception e) {
                 logger.info("无运行时流程");
             }
-            historyService.deleteHistoricProcessInstance(approve.getProcessId());
 
             // 开始申请流程
             long businessKey = approve.getApproveId();
@@ -418,7 +492,11 @@ public class TPssrApproveController extends BaseController {
             Authentication.setAuthenticatedUserId(userId);//设置当前申请人
             Map<String, Object> variables = new HashMap<>();
             variables.put("applyUser", userId);
-            variables.put("confirmUsers", Arrays.asList(confirmers.split(",")));
+            List<String> confirmersList = new ArrayList<>();
+            if (StringUtils.isNotEmpty(confirmers)) {
+                confirmersList = Arrays.asList(confirmers.split(","));
+            }
+            variables.put("confirmUsers", confirmersList);
             variables.put("chargePerson", sub.getConfirm());
             //采用key来启动流程定义并设置流程变量,返回流程实例
             ProcessInstance pi = runtimeService.startProcessInstanceByKey("pssr1confirm", String.valueOf(businessKey), variables);

+ 6 - 2
master/src/main/java/com/ruoyi/project/pssr/controller/TPssrContentModelController.java

@@ -141,10 +141,14 @@ public class TPssrContentModelController extends BaseController
                     String cellValue = ExcelUtils.getCellValue(cell);
                     logger.info("cellValue:" + cellValue);
                     if (j == 0) {
-                        entity.setSerialNumber(cellValue);
+                        entity.setDeptUnit(cellValue);
                     } else if (j == 1) {
-                        entity.setItem(cellValue);
+                        entity.setSerialNumber(cellValue);
                     } else if (j == 2) {
+                        entity.setItem(cellValue);
+                    }  else if (j == 3) {
+                        entity.setForShort(cellValue);
+                    } else if (j == 4) {
                         entity.setContent(cellValue);
                     }
                 }

+ 85 - 0
master/src/main/java/com/ruoyi/project/pssr/controller/TPssrRegionController.java

@@ -1,5 +1,7 @@
 package com.ruoyi.project.pssr.controller;
 
+import com.alibaba.fastjson.JSON;
+import com.ruoyi.common.utils.file.ExcelUtils;
 import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.ruoyi.framework.aspectj.lang.annotation.Log;
 import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
@@ -7,11 +9,20 @@ 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.TPssrRegion;
+import com.ruoyi.project.pssr.domain.TPssrRegion;
 import com.ruoyi.project.pssr.service.ITPssrRegionService;
+import org.apache.poi.ss.usermodel.Cell;
+import org.apache.poi.ss.usermodel.Row;
+import org.apache.poi.ss.usermodel.Sheet;
+import org.apache.poi.ss.usermodel.Workbook;
 import org.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.IOException;
+import java.util.ArrayList;
+import java.util.Date;
 import java.util.List;
 import java.util.Map;
 import java.util.stream.Collectors;
@@ -98,4 +109,78 @@ public class TPssrRegionController extends BaseController {
     public AjaxResult remove(@PathVariable Long[] ids) {
         return toAjax(tPssrRegionService.deleteTPssrRegionByIds(ids));
     }
+
+
+
+    @PreAuthorize("@ss.hasPermi('pssr:region: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<TPssrRegion> list = new ArrayList<>();
+        int rowNum = sheet.getLastRowNum();
+        int failNumber = 0;
+        String topic = "";
+        boolean flag = false;
+        for (int i = 1; i <= rowNum; i++) {
+            try {
+                logger.info("读取行数:" + i);
+                Row row = sheet.getRow(i);
+                if (row == null) {
+                    sheet.removeRow(row);
+                    rowNum++;
+                    continue;
+                }
+                int cellNum = row.getLastCellNum();
+                TPssrRegion entity = new TPssrRegion();
+                for (int j = 0; j < cellNum; j++) {
+                    Cell cell = row.getCell(j);
+                    if (cell == null) {
+                        continue;
+                    }
+                    String cellValue = ExcelUtils.getCellValue(cell);
+                    logger.info("cellValue:" + cellValue);
+                    if (j == 0) {
+                        entity.setPlant(cellValue);
+                    } else if (j == 1) {
+                        entity.setRegion(cellValue);
+                    } else if (j == 2) {
+                        entity.setUnit(cellValue);
+                    }  else if (j == 3) {
+                        entity.setRemarks(cellValue);
+                    }
+                }
+                entity.setCreaterCode(userId.toString());
+                entity.setCreatedate(new Date());
+                logger.info("entity:" + entity);
+                list.add(entity);
+            } catch (Exception e) {
+                failNumber++;
+                failRow.add(i + 1);
+            }
+        }
+        int successNumber = 0;
+        int failNum = 0;
+        for (TPssrRegion t : list) {
+            failNum++;
+            try {
+                add(t);
+                successNumber++;
+            } catch (Exception e) {
+                e.printStackTrace();
+                failNumber++;
+                failRow.add(failNum + 1);
+            }
+        }
+        logger.info("list:" + JSON.toJSONString(list));
+        logger.info("successNumber:{}", successNumber);
+        logger.info("failNumber:{}", failNumber);
+        logger.info("failRow:{}", failRow);
+        return AjaxResult.success(String.valueOf(successNumber), failRow);
+    }
 }

+ 309 - 31
master/src/main/java/com/ruoyi/project/pssr/controller/TPssrSubcontentController.java

@@ -1,24 +1,45 @@
 package com.ruoyi.project.pssr.controller;
 
-import java.util.List;
-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 com.deepoove.poi.XWPFTemplate;
+import com.deepoove.poi.data.*;
+import com.deepoove.poi.data.style.Style;
+import com.deepoove.poi.data.style.TableStyle;
+import com.ruoyi.common.utils.DateUtils;
+import com.ruoyi.common.utils.file.FileUploadUtils;
+import com.ruoyi.common.utils.file.FileUtils;
 import com.ruoyi.framework.aspectj.lang.annotation.Log;
 import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
-import com.ruoyi.project.pssr.domain.TPssrSubcontent;
-import com.ruoyi.project.pssr.service.ITPssrSubcontentService;
+import com.ruoyi.framework.config.RuoYiConfig;
 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 com.ruoyi.project.pssr.domain.TPssrAboveall;
+import com.ruoyi.project.pssr.domain.TPssrApprove;
+import com.ruoyi.project.pssr.domain.TPssrSubcontent;
+import com.ruoyi.project.pssr.service.ITPssrAboveallService;
+import com.ruoyi.project.pssr.service.ITPssrApproveService;
+import com.ruoyi.project.pssr.service.ITPssrSubcontentService;
+import com.ruoyi.project.system.domain.SysUser;
+import com.ruoyi.project.system.service.impl.SysUserServiceImpl;
+import io.jsonwebtoken.lang.Assert;
+import org.activiti.engine.HistoryService;
+import org.activiti.engine.ProcessEngine;
+import org.activiti.engine.ProcessEngines;
+import org.activiti.engine.TaskService;
+import org.activiti.engine.task.Task;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
 
 /**
  * 开车条件确认Controller
@@ -28,18 +49,28 @@ import com.ruoyi.framework.web.page.TableDataInfo;
  */
 @RestController
 @RequestMapping("/pssr/subcontent")
-public class TPssrSubcontentController extends BaseController
-{
+public class TPssrSubcontentController extends BaseController {
     @Autowired
     private ITPssrSubcontentService tPssrSubcontentService;
+    @Autowired
+    private ITPssrAboveallService tPssrAboveallService;
+    @Autowired
+    private ITPssrApproveService tPssrApproveService;
+    @Autowired
+    private SysUserServiceImpl sysUserService;
+
+    @Autowired
+    private HistoryService historyService;
+
+    @Autowired
+    private TaskService taskService;
 
     /**
      * 查询开车条件确认列表
      */
     @PreAuthorize("@ss.hasPermi('pssr:subcontent:list')")
     @GetMapping("/list")
-    public TableDataInfo list(TPssrSubcontent tPssrSubcontent)
-    {
+    public TableDataInfo list(TPssrSubcontent tPssrSubcontent) {
         startPage();
         List<TPssrSubcontent> list = tPssrSubcontentService.selectTPssrSubcontentList(tPssrSubcontent);
         return getDataTable(list);
@@ -51,20 +82,203 @@ public class TPssrSubcontentController extends BaseController
     @PreAuthorize("@ss.hasPermi('pssr:subcontent:export')")
     @Log(title = "开车条件确认", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
-    public AjaxResult export(TPssrSubcontent tPssrSubcontent)
-    {
+    public AjaxResult export(TPssrSubcontent tPssrSubcontent) throws IOException {
         List<TPssrSubcontent> list = tPssrSubcontentService.selectTPssrSubcontentList(tPssrSubcontent);
-        ExcelUtil<TPssrSubcontent> util = new ExcelUtil<TPssrSubcontent>(TPssrSubcontent.class);
-        return util.exportExcel(list, "subcontent");
+//        ExcelUtil<TPssrSubcontent> util = new ExcelUtil<TPssrSubcontent>(TPssrSubcontent.class);
+//        return util.exportExcel(list, "subcontent");
+
+        //渲染文本
+        Map<String, Object> params = getWordData(list, tPssrSubcontent.getAboveallId());
+        // 模板路径
+        String templatePath = "static/word/pssr/pssrConfirm.docx";
+        // 生成word的路径
+        String fileDir = RuoYiConfig.getProfile() + "/" + "pssr";
+        // 生成word的文件名称
+        String time = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd_HH-mm-ss"));
+        String fileName = time + tPssrSubcontent.getAboveallId() + "_" + DateUtils.getDate() + ".docx";
+        String wordPath = createWord(templatePath, fileDir, fileName, params, "pssr");
+        return AjaxResult.success(wordPath);
+
     }
 
+    public Map<String, Object> getWordData(List<TPssrSubcontent> list, Long aboveallId) {
+        TPssrApprove approve = null;
+        TPssrAboveall aboveall = tPssrAboveallService.selectTPssrAboveallById(aboveallId);
+        Map<String, Object> params = new HashMap<>();
+        TableRenderData tableRenderData = new TableRenderData();
+
+        TableStyle tableStyle = new TableStyle();
+        tableStyle.setWidth("100%");
+        tableStyle.setColWidths(new int[]{10, 13, 47, 10, 10, 10});
+        tableRenderData.setTableStyle(tableStyle);
+
+        // 创建表头行
+        RowRenderData row1 = Rows.of("部门", "项目", "内容", "确认人", "确认时间", "备注").center().textBold().rowExactHeight(1.1f).create();
+        tableRenderData.addRow(row1);
+
+        int plant = 0, ctm = 0, cta = 0, count = 1;
+        PictureRenderData plantMgr = null;
+
+        for (int i = 0; i < list.size(); i++) {
+            TPssrSubcontent subcontent = list.get(i);
+
+            // 获取审批信息
+            if (approve == null) {
+                approve = tPssrApproveService.selectTPssrApproveByAboveallId(subcontent.getAboveallId());
+            }
+
+            // 创建数据行
+            RowRenderData row = Rows.of(subcontent.getDeptUnit(), subcontent.getItem(), subcontent.getContent(), subcontent.getApproveStatus() == 2 ? "" : "",  // 如果需要确认人签名图片,这里空着
+                    DateUtils.dateTime(subcontent.getConfirmationDate()), subcontent.getRemarks()).verticalCenter().rowExactHeight(1.1f).create();
+
+
+            // 如果确认状态为2,插入确认人签名图片
+            if (subcontent.getApproveStatus() == 2) {
+                SysUser sysUser = sysUserService.selectUserById(Long.valueOf(subcontent.getConfirm()));
+                if (sysUser != null) {
+                    row.getCells().set(3, new CellRenderData().addParagraph(new ParagraphRenderData().addPicture(Pictures.ofLocal(FileUtils.fileName(sysUser.getSignUrl())).size(120, 40).create())));
+                }
+            }
+
+            tableRenderData.addRow(row);
+
+            // 判断所属部门是否相同,记录索引
+            if (subcontent.getDeptUnit().equals("Plant")) plant = count;
+            if (subcontent.getDeptUnit().equals("CTM")) ctm = count;
+            if (subcontent.getDeptUnit().equals("CTA")) cta = count;
+
+            // 判断是否为最后一条或部门是否不相同
+            if (i < list.size() - 1 && subcontent.getDeptUnit().equals(list.get(i + 1).getDeptUnit())) {
+                count++;
+            } else {
+                count++;
+                //根据当前数据所属部门添加经理审批行
+                RowRenderData signRow = Rows.of("", "装置经理确认:                    日期:", "", "", "", "").verticalCenter().textBold().rowExactHeight(1.1f).create();
+                if (subcontent.getDeptUnit().equals("Plant")) {
+                    plant = count;
+                    signRow = Rows.of("", "装置经理确认:                    日期:", "", "", "", "").verticalCenter().textBold().rowExactHeight(1.1f).create();
+                }
+                if (subcontent.getDeptUnit().equals("CTM")) {
+                    ctm = count + 1;
+                    signRow = Rows.of("", "CTM 经理确认:                    日期:", "", "", "", "").verticalCenter().textBold().rowExactHeight(1.1f).create();
+                }
+                if (subcontent.getDeptUnit().equals("CTA")) {
+                    cta = count + 2;
+                    signRow = Rows.of("", "CTA 经理确认:                    日期:", "", "", "", "").verticalCenter().textBold().rowExactHeight(1.1f).create();
+                }
+                // 添加经理审批签字数据
+                if (approve != null) {
+                    SysUser sysUser = null;
+                    //根据当前所属部门查询部门经理
+                    if (subcontent.getDeptUnit().equals("Plant")) {
+                        sysUser = sysUserService.selectUserById(Long.valueOf(aboveall.getPlantMgr()));
+                        plantMgr = Pictures.ofLocal(FileUtils.fileName(sysUser.getSignUrl())).size(110, 30).create();
+                    }
+                    if (subcontent.getDeptUnit().equals("CTM")) {
+                        sysUser = sysUserService.selectUserById(Long.valueOf(aboveall.getCtmMgr()));
+                    }
+                    if (subcontent.getDeptUnit().equals("CTA")) {
+                        sysUser = sysUserService.selectUserById(Long.valueOf(aboveall.getCtaMgr()));
+                    }
+                    if (sysUser != null) {
+                        //经理签字图片
+                        PictureRenderData mgr = Pictures.ofLocal(FileUtils.fileName(sysUser.getSignUrl())).size(110, 30).create();
+                        //空数据列,为了后面合并
+                        TextRenderData text = Texts.of("").create();
+                        CellRenderData cell = new CellRenderData();
+                        cell.addParagraph(new ParagraphRenderData().addText(text));
+                        //数据列,该列内容为经理签字和日期
+                        CellRenderData cell2 = new CellRenderData();
+                        if (subcontent.getDeptUnit().equals("Plant"))
+                            cell2.addParagraph(new ParagraphRenderData().addText(Texts.of("装置经理确认:").create()).addPicture(mgr).addText("         日期:" + DateUtils.dateTime(aboveall.getConfirmationDate())));
+                        if (subcontent.getDeptUnit().equals("CTM"))
+                            cell2.addParagraph(new ParagraphRenderData().addText(Texts.of("CTM 经理确认:").create()).addPicture(mgr).addText("         日期:" + DateUtils.dateTime(aboveall.getConfirmationDate())));
+                        if (subcontent.getDeptUnit().equals("CTA"))
+                            cell2.addParagraph(new ParagraphRenderData().addText(Texts.of("CTA 经理确认:").create()).addPicture(mgr).addText("         日期:" + DateUtils.dateTime(aboveall.getConfirmationDate())));
+                        signRow = Rows.of(cell, cell2, cell, cell, cell, cell).verticalCenter().textBold().rowExactHeight(1.1f).create();
+                    }
+                }
+                tableRenderData.addRow(signRow);
+            }
+        }
+
+
+        // 设置第一列加粗样式
+        Style boldStyle = new Style();
+        boldStyle.setBold(true);
+        // 遍历每一行,将第一列的文字加粗
+        for (RowRenderData row : tableRenderData.getRows()) {
+            // 获取第一列
+            CellRenderData firstColumn = row.getCells().get(0);
+
+            // 直接使用现有内容并应用加粗样式
+            String text = firstColumn.getParagraphs().get(0).getContents().get(0).toString();  // 获取第一列的文本内容
+
+            // 使用 Cells.of 创建带加粗样式的新单元格
+            firstColumn = Cells.of(Texts.of(text).style(boldStyle).create()).center().create();
+
+            // 将加粗后的单元格重新放回第一列
+            row.getCells().set(0, firstColumn);
+        }
+
+        // 合并第一列和每个部门的最后一行
+        MergeCellRule rule = MergeCellRule.builder().map(MergeCellRule.Grid.of(1, 0), MergeCellRule.Grid.of(plant, 0))
+                .map(MergeCellRule.Grid.of(plant, 1), MergeCellRule.Grid.of(plant, 5))
+                .map(MergeCellRule.Grid.of(plant + 1, 0), MergeCellRule.Grid.of(ctm, 0))
+                .map(MergeCellRule.Grid.of(ctm, 1), MergeCellRule.Grid.of(ctm, 5))
+                .map(MergeCellRule.Grid.of(ctm + 1, 0), MergeCellRule.Grid.of(cta, 0))
+                .map(MergeCellRule.Grid.of(cta, 1), MergeCellRule.Grid.of(cta, 5)).build();
+        tableRenderData.setMergeRule(rule);
+
+        // 准备表格数据和其他参数
+        params.put("unit", aboveall.getUnit() + "_" + aboveall.getUnitDes());
+        params.put("subcontent", tableRenderData);
+        params.put("plantMgr", plantMgr);
+        params.put("confirmDate", DateUtils.dateTime(aboveall.getConfirmationDate()));
+
+        return params;
+
+    }
+
+
+    private String createWord(String templatePath, String fileDir, String fileName, Map<String, Object> paramMap, String directory) throws IOException {
+        Assert.notNull(templatePath, "word模板文件路径不能为空");
+        Assert.notNull(fileDir, "生成的文件存放地址不能为空");
+        Assert.notNull(fileName, "生成的文件名不能为空");
+        File dir = new File(fileDir);
+        if (!dir.exists()) {
+            logger.info("目录不存在,创建文件夹{}!", fileDir);
+            dir.mkdirs();
+        }
+        fileName = fileName.replaceAll("/", "_"); //替换文件中敏感字段
+        logger.info("目录文件{}!", fileName);
+        String filePath = fileDir + "/" + fileName;
+        logger.info("目录{}!", filePath);
+        logger.info("模板{}!", templatePath);
+        // 读取模板渲染参数
+        InputStream is = getClass().getClassLoader().getResourceAsStream(templatePath);
+
+        XWPFTemplate template = XWPFTemplate.compile(is).render(paramMap);
+        try {
+            // 将模板参数写入路径
+            template.writeToFile(filePath);
+            template.close();
+            is.close();
+        } catch (Exception e) {
+            logger.error("生成word异常{}", e.getMessage());
+            e.printStackTrace();
+        }
+        String pathFileName = FileUploadUtils.getPathFileName(RuoYiConfig.getFilePath("/" + directory), fileName);
+        return pathFileName;
+    }
+
+
     /**
      * 获取开车条件确认详细信息
      */
     @PreAuthorize("@ss.hasPermi('pssr:subcontent:query')")
     @GetMapping(value = "/{id}")
-    public AjaxResult getInfo(@PathVariable("id") Long id)
-    {
+    public AjaxResult getInfo(@PathVariable("id") Long id) {
         return AjaxResult.success(tPssrSubcontentService.selectTPssrSubcontentById(id));
     }
 
@@ -74,8 +288,7 @@ public class TPssrSubcontentController extends BaseController
     @PreAuthorize("@ss.hasPermi('pssr:subcontent:add')")
     @Log(title = "开车条件确认", businessType = BusinessType.INSERT)
     @PostMapping
-    public AjaxResult add(@RequestBody TPssrSubcontent tPssrSubcontent)
-    {
+    public AjaxResult add(@RequestBody TPssrSubcontent tPssrSubcontent) {
         return toAjax(tPssrSubcontentService.insertTPssrSubcontent(tPssrSubcontent));
     }
 
@@ -85,8 +298,7 @@ public class TPssrSubcontentController extends BaseController
     @PreAuthorize("@ss.hasPermi('pssr:subcontent:edit')")
     @Log(title = "开车条件确认", businessType = BusinessType.UPDATE)
     @PutMapping
-    public AjaxResult edit(@RequestBody TPssrSubcontent tPssrSubcontent)
-    {
+    public AjaxResult edit(@RequestBody TPssrSubcontent tPssrSubcontent) {
         return toAjax(tPssrSubcontentService.updateTPssrSubcontent(tPssrSubcontent));
     }
 
@@ -95,9 +307,75 @@ public class TPssrSubcontentController extends BaseController
      */
     @PreAuthorize("@ss.hasPermi('pssr:subcontent:remove')")
     @Log(title = "开车条件确认", businessType = BusinessType.DELETE)
-	@DeleteMapping("/{ids}")
-    public AjaxResult remove(@PathVariable Long[] ids)
-    {
+    @DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids) {
         return toAjax(tPssrSubcontentService.deleteTPssrSubcontentByIds(ids));
     }
+
+    public AjaxResult handleApprove(@RequestBody TPssrSubcontent tPssrSubcontent) {
+        if (tPssrSubcontent.getIds() != null && tPssrSubcontent.getIds().size() > 0) {
+            for (Long id : tPssrSubcontent.getIds()) {
+                TPssrSubcontent subcontent = new TPssrSubcontent();
+                subcontent.setId(id);
+                subcontent.setApproveStatus(tPssrSubcontent.getApproveStatus());
+                if (tPssrSubcontent.getApproveStatus() == 2) {
+                    subcontent.setConfirmationDate(new Date());
+                }
+                subcontent.setUpdatedate(new Date());
+                subcontent.setUpdaterCode(getUserId().toString());
+                tPssrSubcontentService.updateTPssrSubcontent(subcontent);
+            }
+        } else {
+            TPssrSubcontent pssrSubcontent = new TPssrSubcontent();
+            pssrSubcontent.setAboveallId(tPssrSubcontent.getAboveallId());
+            pssrSubcontent.setApproveStatus(1L);
+            for (TPssrSubcontent subcontent : tPssrSubcontentService.selectTPssrSubcontentList(pssrSubcontent)) {
+                subcontent.setApproveStatus(tPssrSubcontent.getApproveStatus());
+                if (tPssrSubcontent.getApproveStatus() == 2) {
+                    subcontent.setConfirmationDate(new Date());
+                }
+                subcontent.setUpdatedate(new Date());
+                subcontent.setUpdaterCode(getUserId().toString());
+                tPssrSubcontentService.updateTPssrSubcontent(subcontent);
+            }
+        }
+        TPssrApprove approve = tPssrApproveService.selectTPssrApproveByAboveallId(tPssrSubcontent.getAboveallId());
+        TPssrAboveall aboveall = tPssrAboveallService.selectTPssrAboveallById(tPssrSubcontent.getAboveallId());
+        Task task = taskService.createTaskQuery().processInstanceId(approve.getProcessId()).singleResult();
+
+        if (task.getName().equals("所有装置经理")) {
+            if (aboveall.getPlantMgr() == getUserId()) {
+                aboveall.setPlantConfirmdate(new Date());
+            } else if (aboveall.getCtmMgr() == getUserId()) {
+                aboveall.setCtmConfirmdate(new Date());
+            } else if (aboveall.getCtaMgr() == getUserId()) {
+                aboveall.setCtaConfirmdate(new Date());
+            }
+        }
+
+        String condition = "0";
+        if (task.getName().equals("装置经理")) {
+            if (tPssrSubcontent.getApproveStatus() == 2) {
+                aboveall.setApproveStatus(2L);
+                condition = "0";
+            } else if (tPssrSubcontent.getApproveStatus() == 0) {
+                aboveall.setApproveStatus(0L);
+                condition = "1";
+                // 将选中的数据重新发起申请
+                for (Long id : tPssrSubcontent.getIds()) {
+                    new TPssrApproveController().doApprove(id);
+                }
+            }
+        }
+        tPssrAboveallService.updateTPssrAboveall(aboveall);
+        //处理流程节点
+        Map<String, Object> param = new HashMap<>();
+        param.put("condition", condition);
+        ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();
+        TaskService taskService = processEngine.getTaskService();
+        //认领任务
+        processEngine.getTaskService().claim(task.getId(), getUserId().toString());
+        taskService.complete(task.getId(), param);
+        return AjaxResult.success();
+    }
 }

+ 58 - 3
master/src/main/java/com/ruoyi/project/pssr/domain/TPssrAboveall.java

@@ -32,7 +32,7 @@ public class TPssrAboveall extends BaseEntity
 
     /** 审批状态 */
     @Excel(name = "审批状态")
-    private String approveStatus;
+    private Long approveStatus;
 
     /** 单元 */
     @Excel(name = "单元")
@@ -77,6 +77,61 @@ public class TPssrAboveall extends BaseEntity
     
     private String deptName;
 
+    private Long plantMgr;
+    private Long ctaMgr;
+    private Long ctmMgr;
+    private Date plantConfirmdate;
+    private Date ctaConfirmdate;
+    private Date ctmConfirmdate;
+
+    public Long getPlantMgr() {
+        return plantMgr;
+    }
+
+    public void setPlantMgr(Long plantMgr) {
+        this.plantMgr = plantMgr;
+    }
+
+    public Long getCtaMgr() {
+        return ctaMgr;
+    }
+
+    public void setCtaMgr(Long ctaMgr) {
+        this.ctaMgr = ctaMgr;
+    }
+
+    public Long getCtmMgr() {
+        return ctmMgr;
+    }
+
+    public void setCtmMgr(Long ctmMgr) {
+        this.ctmMgr = ctmMgr;
+    }
+
+    public Date getPlantConfirmdate() {
+        return plantConfirmdate;
+    }
+
+    public void setPlantConfirmdate(Date plantConfirmdate) {
+        this.plantConfirmdate = plantConfirmdate;
+    }
+
+    public Date getCtaConfirmdate() {
+        return ctaConfirmdate;
+    }
+
+    public void setCtaConfirmdate(Date ctaConfirmdate) {
+        this.ctaConfirmdate = ctaConfirmdate;
+    }
+
+    public Date getCtmConfirmdate() {
+        return ctmConfirmdate;
+    }
+
+    public void setCtmConfirmdate(Date ctmConfirmdate) {
+        this.ctmConfirmdate = ctmConfirmdate;
+    }
+
     public String getDeptName() {
         return deptName;
     }
@@ -144,12 +199,12 @@ public class TPssrAboveall extends BaseEntity
     {
         return region;
     }
-    public void setApproveStatus(String approveStatus)
+    public void setApproveStatus(Long approveStatus)
     {
         this.approveStatus = approveStatus;
     }
 
-    public String getApproveStatus()
+    public Long getApproveStatus()
     {
         return approveStatus;
     }

+ 37 - 0
master/src/main/java/com/ruoyi/project/pssr/domain/TPssrApprove.java

@@ -75,6 +75,43 @@ public class TPssrApprove extends BaseEntity
     
     private String deptName;
 
+    private Long cbpMgr;
+    private Long ctmMgr;
+    private Long ctaMgr;
+    private Long plantMgr;
+
+    public Long getCbpMgr() {
+        return cbpMgr;
+    }
+
+    public void setCbpMgr(Long cbpMgr) {
+        this.cbpMgr = cbpMgr;
+    }
+
+    public Long getCtmMgr() {
+        return ctmMgr;
+    }
+
+    public void setCtmMgr(Long ctmMgr) {
+        this.ctmMgr = ctmMgr;
+    }
+
+    public Long getCtaMgr() {
+        return ctaMgr;
+    }
+
+    public void setCtaMgr(Long ctaMgr) {
+        this.ctaMgr = ctaMgr;
+    }
+
+    public Long getPlantMgr() {
+        return plantMgr;
+    }
+
+    public void setPlantMgr(Long plantMgr) {
+        this.plantMgr = plantMgr;
+    }
+
     public String getDeptName() {
         return deptName;
     }

+ 19 - 0
master/src/main/java/com/ruoyi/project/pssr/domain/TPssrContentModel.java

@@ -79,6 +79,25 @@ public class TPssrContentModel extends BaseEntity
     @Excel(name = "审批状态")
     private Long approveStatus;
 
+    private String forShort;
+    private String deptUnit;
+
+    public String getForShort() {
+        return forShort;
+    }
+
+    public void setForShort(String forShort) {
+        this.forShort = forShort;
+    }
+
+    public String getDeptUnit() {
+        return deptUnit;
+    }
+
+    public void setDeptUnit(String deptUnit) {
+        this.deptUnit = deptUnit;
+    }
+
     public void setId(Long id)
     {
         this.id = id;

+ 31 - 0
master/src/main/java/com/ruoyi/project/pssr/domain/TPssrSubcontent.java

@@ -1,6 +1,8 @@
 package com.ruoyi.project.pssr.domain;
 
 import java.util.Date;
+import java.util.List;
+
 import com.fasterxml.jackson.annotation.JsonFormat;
 import com.ruoyi.framework.aspectj.lang.annotation.Excel;
 import com.ruoyi.framework.web.domain.BaseEntity;
@@ -108,6 +110,35 @@ public class TPssrSubcontent extends BaseEntity
 
     private Long status;
 
+    private String forShort;
+    private String deptUnit;
+
+    private List<Long> ids;
+
+    public List<Long> getIds() {
+        return ids;
+    }
+
+    public void setIds(List<Long> ids) {
+        this.ids = ids;
+    }
+
+    public String getForShort() {
+        return forShort;
+    }
+
+    public void setForShort(String forShort) {
+        this.forShort = forShort;
+    }
+
+    public String getDeptUnit() {
+        return deptUnit;
+    }
+
+    public void setDeptUnit(String deptUnit) {
+        this.deptUnit = deptUnit;
+    }
+
     public String getConfirmName() {
         return confirmName;
     }

+ 1 - 0
master/src/main/java/com/ruoyi/project/pssr/mapper/TPssrApproveMapper.java

@@ -20,6 +20,7 @@ public interface TPssrApproveMapper
      */
     public TPssrApprove selectTPssrApproveById(Long approveId);
     public TPssrApprove selectTPssrApproveBySubId(Long subId);
+    public TPssrApprove selectTPssrApproveByAboveallId(Long aboveallId);
 
     /**
      * 查询pssr审批管理列表

+ 1 - 0
master/src/main/java/com/ruoyi/project/pssr/service/ITPssrApproveService.java

@@ -19,6 +19,7 @@ public interface ITPssrApproveService
      */
     public TPssrApprove selectTPssrApproveById(Long approveId);
     public TPssrApprove selectTPssrApproveBySubId(Long subId);
+    public TPssrApprove selectTPssrApproveByAboveallId(Long aboveallId);
 
     /**
      * 查询pssr审批管理列表

+ 5 - 0
master/src/main/java/com/ruoyi/project/pssr/service/impl/TPssrApproveServiceImpl.java

@@ -35,6 +35,11 @@ public class TPssrApproveServiceImpl implements ITPssrApproveService
     {
         return tPssrApproveMapper.selectTPssrApproveBySubId(subId);
     }
+    @Override
+    public TPssrApprove selectTPssrApproveByAboveallId(Long aboveallId)
+    {
+        return tPssrApproveMapper.selectTPssrApproveByAboveallId(aboveallId);
+    }
 
     /**
      * 查询pssr审批管理列表

+ 2 - 0
master/src/main/resources/application.yml

@@ -22,6 +22,8 @@ ruoyi:
 jpush:
   appKey: 2c1d3d89dc7cfb5ff22e6eb9
   masterSecret: ca98a81c8339a81b3b85fb6a
+  isDev: true
+#  isDev: false
 
 # 开发环境配置
 server:

+ 37 - 1
master/src/main/resources/mybatis/pssr/TPssrAboveallMapper.xml

@@ -22,10 +22,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="includePublic"    column="include_public"    />
         <result property="unitDes"    column="unit_des"    />
         <result property="deptName" column="dept_name" />
+        <result property="plantMgr" column="plant_mgr" />
+        <result property="ctaMgr" column="cta_mgr" />
+        <result property="ctmMgr" column="ctm_mgr" />
+        <result property="plantConfirmdate" column="plant_confirmdate" />
+        <result property="ctaConfirmdate" column="cta_confirmdate" />
+        <result property="ctmConfirmdate" column="ctm_confirmdate" />
     </resultMap>
 
     <sql id="selectTPssrAboveallVo">
-        select d.id, d.approve_id, d.region, d.approve_status, d.unit, d.confirm, d.confirmation_date, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.dept_id, d.remarks, d.include_public, d.unit_des ,s.dept_name from t_pssr_aboveall d
+        select d.plant_mgr,
+               d.cta_mgr,
+               d.ctm_mgr,
+               d.plant_confirmdate,
+               d.cta_confirmdate,
+               d.ctm_confirmdate,
+            d.id, d.approve_id, d.region, d.approve_status, d.unit, d.confirm, d.confirmation_date, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.dept_id, d.remarks, d.include_public, d.unit_des ,s.dept_name from t_pssr_aboveall d
       left join sys_dept s on s.dept_id = d.dept_id
     </sql>
 
@@ -46,6 +58,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="remarks != null  and remarks != ''"> and remarks = #{remarks}</if>
             <if test="includePublic != null "> and include_public = #{includePublic}</if>
             <if test="unitDes != null  and unitDes != ''"> and unit_des = #{unitDes}</if>
+            <if test="plantMgr != null  "> and plant_mgr = #{plantMgr}</if>
+            <if test="ctaMgr != null  "> and cta_mgr = #{ctaMgr}</if>
+            <if test="ctmMgr != null  "> and ctm_mgr = #{ctmMgr}</if>
+            <if test="plantConfirmdate != null  "> and plant_confirmdate = #{plantConfirmdate}</if>
+            <if test="ctaConfirmdate != null  "> and cta_confirmdate = #{ctaConfirmdate}</if>
+            <if test="ctmConfirmdate != null  "> and ctm_confirmdate = #{ctmConfirmdate}</if>
             and d.del_flag = 0
         </where>
         <!-- 数据范围过滤 -->
@@ -80,6 +98,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="remarks != null">remarks,</if>
             <if test="includePublic != null">include_public,</if>
             <if test="unitDes != null">unit_des,</if>
+            <if test="plantMgr != null">plant_mgr,</if>
+            <if test="ctaMgr != null">cta_mgr,</if>
+            <if test="ctmMgr != null">ctm_mgr,</if>
+            <if test="plantConfirmdate != null">plant_confirmdate,</if>
+            <if test="ctaConfirmdate != null">cta_confirmdate,</if>
+            <if test="ctmConfirmdate != null">ctm_confirmdate,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="id != null">#{id},</if>
@@ -98,6 +122,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="remarks != null">#{remarks},</if>
             <if test="includePublic != null">#{includePublic},</if>
             <if test="unitDes != null">#{unitDes},</if>
+            <if test="plantMgr != null">#{plantMgr},</if>
+            <if test="ctaMgr != null">#{ctaMgr},</if>
+            <if test="ctmMgr != null">#{ctmMgr},</if>
+            <if test="plantConfirmdate != null">#{plantConfirmdate},</if>
+            <if test="ctaConfirmdate != null">#{ctaConfirmdate},</if>
+            <if test="ctmConfirmdate != null">#{ctmConfirmdate},</if>
          </trim>
     </insert>
 
@@ -119,6 +149,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="remarks != null">remarks = #{remarks},</if>
             <if test="includePublic != null">include_public = #{includePublic},</if>
             <if test="unitDes != null">unit_des = #{unitDes},</if>
+            <if test="plantMgr != null">plant_mgr = #{plantMgr},</if>
+            <if test="ctaMgr != null">cta_mgr = #{ctaMgr},</if>
+            <if test="ctmMgr != null">ctm_mgr = #{ctmMgr},</if>
+            <if test="plantConfirmdate != null">plant_confirmdate = #{plantConfirmdate},</if>
+            <if test="ctaConfirmdate != null">cta_confirmdate = #{ctaConfirmdate},</if>
+            <if test="ctmConfirmdate != null">ctm_confirmdate = #{ctmConfirmdate},</if>
         </trim>
         where id = #{id}
     </update>

+ 23 - 2
master/src/main/resources/mybatis/pssr/TPssrApproveMapper.xml

@@ -21,10 +21,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="deptId"    column="dept_id"    />
         <result property="remarks"    column="remarks"    />
         <result property="deptName" column="dept_name" />
+        <result property="cbpMgr" column="cbp_mgr" />
+        <result property="ctmMgr" column="ctm_mgr" />
+        <result property="ctaMgr" column="cta_mgr" />
+        <result property="plantMgr" column="plant_mgr" />
     </resultMap>
 
     <sql id="selectTPssrApproveVo">
-        select d.approve_id, d.sub_id,d.aboveall_id, d.ap_no, d.process_id, d.approve_status, d.sub_approver, d.sub_charge, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.dept_id, d.remarks ,s.dept_name from t_pssr_approve d
+        select d.cbp_mgr,d.ctm_mgr,d.cta_mgr,d.plant_mgr,d.approve_id, d.sub_id,d.aboveall_id, d.ap_no, d.process_id, d.approve_status, d.sub_approver, d.sub_charge, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.dept_id, d.remarks ,s.dept_name from t_pssr_approve d
       left join sys_dept s on s.dept_id = d.dept_id
     </sql>
 
@@ -55,10 +59,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         where approve_id = #{approveId}
     </select>
 
-    <select id="selectTPssrApproveById" parameterType="Long" resultMap="TPssrApproveResult">
+    <select id="selectTPssrApproveBySubId" parameterType="Long" resultMap="TPssrApproveResult">
         <include refid="selectTPssrApproveVo"/>
         where sub_id = #{subId}
     </select>
+
+    <select id="selectTPssrApproveByAboveallId" parameterType="Long" resultMap="TPssrApproveResult">
+        <include refid="selectTPssrApproveVo"/>
+        where aboveall_id = #{aboveallId}
+    </select>
         
     <insert id="insertTPssrApprove" parameterType="TPssrApprove">
         <selectKey keyProperty="approveId" resultType="long" order="BEFORE">
@@ -81,6 +90,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="updatedate != null">updatedate,</if>
             <if test="deptId != null">dept_id,</if>
             <if test="remarks != null">remarks,</if>
+            <if test="cbpMgr != null">cbp_mgr,</if>
+            <if test="ctmMgr != null">ctm_mgr,</if>
+            <if test="ctaMgr != null">cta_mgr,</if>
+            <if test="plantMgr != null">plant_mgr,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="approveId != null">#{approveId},</if>
@@ -98,6 +111,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="updatedate != null">#{updatedate},</if>
             <if test="deptId != null">#{deptId},</if>
             <if test="remarks != null">#{remarks},</if>
+            <if test="cbpMgr != null">#{cbpMgr},</if>
+            <if test="ctmMgr != null">#{ctmMgr},</if>
+            <if test="ctaMgr != null">#{ctaMgr},</if>
+            <if test="plantMgr != null">#{plantMgr},</if>
          </trim>
     </insert>
 
@@ -118,6 +135,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="updatedate != null">updatedate = #{updatedate},</if>
             <if test="deptId != null">dept_id = #{deptId},</if>
             <if test="remarks != null">remarks = #{remarks},</if>
+            <if test="cbpMgr != null">cbp_mgr = #{cbpMgr},</if>
+            <if test="ctmMgr != null">ctm_mgr = #{ctmMgr},</if>
+            <if test="ctaMgr != null">cta_mgr = #{ctaMgr},</if>
+            <if test="plantMgr != null">plant_mgr = #{plantMgr},</if>
         </trim>
         where approve_id = #{approveId}
     </update>

+ 11 - 1
master/src/main/resources/mybatis/pssr/TPssrContentModelMapper.xml

@@ -19,10 +19,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="remarks"    column="remarks"    />
         <result property="approveStatus"    column="approve_status"    />
         <result property="deptName" column="dept_name" />
+        <result property="forShort" column="for_short" />
+        <result property="deptUnit" column="dept_unit" />
     </resultMap>
 
     <sql id="selectTPssrContentModelVo">
-        select d.id, d.status, d.serial_number, d.item, d.content, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.dept_id, d.remarks, d.approve_status ,s.dept_name from t_pssr_content_model d
+        select d.for_short,d.dept_unit,d.id, d.status, d.serial_number, d.item, d.content, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.dept_id, d.remarks, d.approve_status ,s.dept_name from t_pssr_content_model d
       left join sys_dept s on s.dept_id = d.dept_id
     </sql>
 
@@ -40,6 +42,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="deptId != null "> and dept_id = #{deptId}</if>
             <if test="remarks != null  and remarks != ''"> and remarks = #{remarks}</if>
             <if test="approveStatus != null "> and approve_status = #{approveStatus}</if>
+            <if test="forShort != null "> and for_short = #{forShort}</if>
+            <if test="deptUnit != null "> and dept_unit = #{deptUnit}</if>
             and d.del_flag = 0
         </where>
         <!-- 数据范围过滤 -->
@@ -71,6 +75,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="deptId != null">dept_id,</if>
             <if test="remarks != null">remarks,</if>
             <if test="approveStatus != null">approve_status,</if>
+            <if test="forShort != null">for_short,</if>
+            <if test="deptUnit != null">dept_unit,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="id != null">#{id},</if>
@@ -86,6 +92,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="deptId != null">#{deptId},</if>
             <if test="remarks != null">#{remarks},</if>
             <if test="approveStatus != null">#{approveStatus},</if>
+            <if test="forShort != null">#{forShort},</if>
+            <if test="deptUnit != null">#{deptUnit},</if>
          </trim>
     </insert>
 
@@ -104,6 +112,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="deptId != null">dept_id = #{deptId},</if>
             <if test="remarks != null">remarks = #{remarks},</if>
             <if test="approveStatus != null">approve_status = #{approveStatus},</if>
+            <if test="forShort != null">for_short = #{forShort},</if>
+            <if test="deptUnit != null">dept_unit = #{deptUnit},</if>
         </trim>
         where id = #{id}
     </update>

+ 1 - 0
master/src/main/resources/mybatis/pssr/TPssrRegionMapper.xml

@@ -44,6 +44,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </where>
         <!-- 数据范围过滤 -->
         ${params.dataScope}
+        order by region,createdate
     </select>
     
     <select id="selectTPssrRegionById" parameterType="Long" resultMap="TPssrRegionResult">

+ 11 - 1
master/src/main/resources/mybatis/pssr/TPssrSubcontentMapper.xml

@@ -26,10 +26,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="region"    column="region"    />
         <result property="approveStatus"    column="approve_status"    />
         <result property="deptName" column="dept_name" />
+        <result property="forShort" column="for_short" />
+        <result property="deptUnit" column="dept_unit" />
     </resultMap>
 
     <sql id="selectTPssrSubcontentVo">
-        select d.id, d.approve_id, d.aboveall_id, d.serial_number, d.item, d.content, d.confirm,u.NICK_NAME confirm_name, d.confirmation_date, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.dept_id, d.remarks, d.unit_des, d.unit, d.region, d.approve_status ,s.dept_name from t_pssr_subcontent d
+        select d.for_short,d.dept_unit,d.id, d.approve_id, d.aboveall_id, d.serial_number, d.item, d.content, d.confirm,u.NICK_NAME confirm_name, d.confirmation_date, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.dept_id, d.remarks, d.unit_des, d.unit, d.region, d.approve_status ,s.dept_name from t_pssr_subcontent d
       left join sys_dept s on s.dept_id = d.dept_id
         left join sys_user  u on d.CONFIRM = u.USER_ID
     </sql>
@@ -54,6 +56,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="unit != null  and unit != ''"> and unit = #{unit}</if>
             <if test="region != null  and region != ''"> and region = #{region}</if>
             <if test="approveStatus != null "> and approve_status = #{approveStatus}</if>
+            <if test="forShort != null "> and for_short = #{forShort}</if>
+            <if test="deptUnit != null "> and dept_unit = #{deptUnit}</if>
             and d.del_flag = 0
         </where>
         <!-- 数据范围过滤 -->
@@ -91,6 +95,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="unit != null">unit,</if>
             <if test="region != null">region,</if>
             <if test="approveStatus != null">approve_status,</if>
+            <if test="forShort != null">for_short,</if>
+            <if test="deptUnit != null">dept_unit,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="id != null">#{id},</if>
@@ -112,6 +118,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="unit != null">#{unit},</if>
             <if test="region != null">#{region},</if>
             <if test="approveStatus != null">#{approveStatus},</if>
+            <if test="forShort != null">#{forShort},</if>
+            <if test="deptUnit != null">#{deptUnit},</if>
          </trim>
     </insert>
 
@@ -136,6 +144,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="unit != null">unit = #{unit},</if>
             <if test="region != null">region = #{region},</if>
             <if test="approveStatus != null">approve_status = #{approveStatus},</if>
+            <if test="forShort != null">for_short = #{forShort},</if>
+            <if test="deptUnit != null">dept_unit = #{deptUnit},</if>
         </trim>
         where id = #{id}
     </update>

+ 3 - 3
master/src/main/resources/processes/pssr/pssrMgrConfirm.bpmn

@@ -10,7 +10,7 @@
             </activiti:multiInstanceLoopCharacteristics>
         </extensionElements>
     </userTask>
-    <sequenceFlow id="flow1" sourceRef="startevent1" targetRef="allJlUser"></sequenceFlow>
+    <sequenceFlow id="flow1" sourceRef="applyUser" targetRef="allJlUser"></sequenceFlow>
     <userTask id="jlUser" name="装置经理"  activiti:assignee="#{jlUser}"></userTask>
     <sequenceFlow id="flow2" sourceRef="allJlUser" targetRef="jlUser">
       <conditionExpression xsi:type="tFormalExpression"><![CDATA[${condition == 0}]]></conditionExpression>
@@ -29,13 +29,13 @@
   </process>
   <bpmndi:BPMNDiagram id="BPMNDiagram_pssrMgrConfirm">
     <bpmndi:BPMNPlane bpmnElement="pssrMgrConfirm" id="BPMNPlane_pssrMgrConfirm">
-      <bpmndi:BPMNShape bpmnElement="startevent1" id="BPMNShape_startevent1">
+      <bpmndi:BPMNShape bpmnElement="applyUser" id="BPMNShape_applyUser">
         <omgdc:Bounds height="35.0" width="35.0" x="140.0" y="290.0"></omgdc:Bounds>
       </bpmndi:BPMNShape>
       <bpmndi:BPMNShape bpmnElement="allJlUser" id="BPMNShape_allJlUser">
         <omgdc:Bounds height="55.0" width="105.0" x="220.0" y="280.0"></omgdc:Bounds>
       </bpmndi:BPMNShape>
-      <bpmndi:BPMNShape bpmnElement="usertask2" id="BPMNShape_usertask2">
+      <bpmndi:BPMNShape bpmnElement="jlUser" id="BPMNShape_jlUser">
         <omgdc:Bounds height="55.0" width="105.0" x="370.0" y="280.0"></omgdc:Bounds>
       </bpmndi:BPMNShape>
       <bpmndi:BPMNShape bpmnElement="endevent1" id="BPMNShape_endevent1">

BIN
master/src/main/resources/static/template/pssr/pssrRegionTmpl.xlsx


BIN
master/src/main/resources/static/template/pssr/pssrTmpl.xlsx


BIN
master/src/main/resources/static/word/pssr/pssrConfirm.docx


+ 1 - 1
ui/src/layout/components/Navbar.vue

@@ -172,7 +172,7 @@ export default {
         type: 'warning'
       }).then(() => {
         this.$store.dispatch('LogOut').then(() => {
-          location.href = '/cpms/index.html';
+          location.href = '/index';
         })
       })
     }

+ 1 - 1
ui/src/views/approve/approveDetail/pssrApprove-detail.vue

@@ -82,7 +82,7 @@ export default {
           this.isApprove = 6;
         }
         console.log(res)
-        this.sn = res.data.serialNumber
+        this.sn = res.data.forShort
         this.subId = id;
         this.taskForm.taskId = taskId
         this.taskForm.processId = processId

+ 9 - 9
ui/src/views/pssr/aboveall/index.vue

@@ -10,11 +10,6 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-      <el-form-item label="审批状态" prop="approveStatus">
-        <el-select v-model="queryParams.approveStatus" placeholder="请选择审批状态" clearable size="small">
-          <el-option label="请选择字典生成" value=""/>
-        </el-select>
-      </el-form-item>
       <el-form-item label="单元" prop="unit">
         <el-input
           v-model="queryParams.unit"
@@ -96,7 +91,7 @@
           <dict-tag :options="dict.type.pssr_approve_status" :value="scope.row.approveStatus" :show-type="getTagType(scope.row.approveStatus)"/>
         </template>
       </el-table-column>
-      <el-table-column label="确认人" align="center" prop="confirm" :show-overflow-tooltip="true"/>
+      <el-table-column label="确认人" align="center" prop="confirm" :show-overflow-tooltip="true" />
       <el-table-column label="确认时间" align="center" prop="confirmationDate">
         <template slot-scope="scope">
           <span>{{ parseTime(scope.row.confirmationDate, '{y}-{m}-{d}') }}</span>
@@ -176,7 +171,8 @@
           </el-col>
         </el-row>
         <el-card class="mb10">
-          <el-table :data="subcontents" border :row-class-name="tableRowClassName" @selection-change="handleSubSelectionChange" max-height="500">
+          <el-table :data="subcontents" v-loading="subloading"  border :row-class-name="tableRowClassName" @selection-change="handleSubSelectionChange" max-height="500">
+            <el-table-column label="所属部门" align="center" prop="deptUnit" :show-overflow-tooltip="true" width="80"/>
             <el-table-column label="序号" align="center" prop="serialNumber" :show-overflow-tooltip="true" width="80"/>
             <el-table-column label="项目" align="center" prop="item" :show-overflow-tooltip="true" width="180"/>
             <el-table-column label="开车条件检查内容" align="center" prop="content" :show-overflow-tooltip="true"/>
@@ -187,7 +183,7 @@
                            placeholder="请选择确认人" @change="handleChangeConfirm(scope.row.confirm,scope.row)">
                   <el-option v-for="user in userOptions"
                              :label="user.nickName"
-                             :value="user.userId+''"
+                             :value="user.userId"
                              :key="user.userId"/>
                 </el-select>
               </template>
@@ -291,6 +287,7 @@ export default {
       userOptions: [],
       // 遮罩层
       loading: true,
+      subloading: true,
       // 选中数组
       ids: [],
       subRows: [],
@@ -446,7 +443,7 @@ export default {
         id: null,
         approveId: null,
         region: null,
-        approveStatus: "0",
+        approveStatus: 0,
         includePublic: 0,
         unit: null,
         confirm: null,
@@ -483,11 +480,13 @@ export default {
       this.reset();
       this.open = true;
       this.title = "添加PSSR";
+      this.subloading = true;
       listPssrModel({
         pageNum: 1,
         pageSize: 200
       }).then(res => {
         this.subcontents = res.rows;
+        this.subloading = false;
       })
     },
     /** 修改按钮操作 */
@@ -503,6 +502,7 @@ export default {
           item.status=1;
         })
         this.subcontents = res.rows;
+        this.subloading = true;
       })
       getAboveall(id).then(response => {
         this.form = response.data;

+ 11 - 2
ui/src/views/pssr/pssrModel/index.vue

@@ -84,6 +84,7 @@
     <el-table v-loading="loading" :data="pssrModelList" @selection-change="handleSelectionChange" :height="clientHeight"
               border>
       <el-table-column type="selection" width="55" align="center"/>
+      <el-table-column label="所属部门" align="center" prop="deptUnit" :show-overflow-tooltip="true" width="200"/>
       <el-table-column label="序号" align="center" prop="serialNumber" :show-overflow-tooltip="true" width="80"/>
       <el-table-column label="项目" align="center" prop="item" :show-overflow-tooltip="true" width="200"/>
       <el-table-column label="开车条件检查内容" align="center" prop="content" :show-overflow-tooltip="true"/>
@@ -136,6 +137,12 @@
         <el-form-item label="开车条件检查内容" prop="content">
           <el-input v-model="form.content" type="textarea" placeholder="请输入开车条件检查内容"/>
         </el-form-item>
+        <el-form-item label="所属部门" prop="deptUnit">
+          <el-input v-model="form.deptUnit" placeholder="请输入所属部门"/>
+        </el-form-item>
+        <el-form-item label="表简称" prop="forShort" v-hasPermi="['pssr:pssrModel:add']">
+          <el-input v-model="form.forShort" placeholder="请输入表简称"/>
+        </el-form-item>
         <el-form-item label="启用状态" prop="status">
           <el-radio-group v-model="form.status">
             <el-radio :label="1">启用</el-radio>
@@ -263,7 +270,7 @@ export default {
       // 查询参数
       queryParams: {
         pageNum: 1,
-        pageSize: 30,
+        pageSize: 50,
         status: null,
         serialNumber: null,
         item: null,
@@ -303,7 +310,7 @@ export default {
   created() {
     //设置表格高度对应屏幕高度
     this.$nextTick(() => {
-      this.clientHeight = document.body.clientHeight - 350
+      this.clientHeight = document.body.clientHeight - 250
     })
     this.getList();
     this.getTreeselect();
@@ -340,6 +347,8 @@ export default {
         delFlag: null,
         createrCode: null,
         createdate: null,
+        forShort: null,
+        deptUnit: null,
         updaterCode: null,
         updatedate: null,
         deptId: null,

+ 17 - 10
ui/src/views/pssr/region/index.vue

@@ -169,7 +169,8 @@
       </div>
     </el-dialog>
     <!-- 用户导入对话框 -->
-    <el-dialog :close-on-click-modal="false" :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
+    <el-dialog :close-on-click-modal="false" :title="upload.title" :visible.sync="upload.open" width="400px"
+               append-to-body>
       <el-upload
         ref="upload"
         :limit="1"
@@ -184,15 +185,17 @@
       >
         <i class="el-icon-upload"></i>
         <div class="el-upload__text">
-          将文件拖到此处,或
-          <em>点击上传</em>
+          {{ $t('将文件拖到此处,或') }}
+          <em>{{ $t('点击上传') }}</em>
         </div>
         <div class="el-upload__tip" slot="tip">
-          <el-checkbox v-model="upload.updateSupport"/>
-          是否更新已经存在的用户数据
-          <el-link type="info" style="font-size:12px" @click="importTemplate">下载模板</el-link>
+          <!--<el-checkbox v-model="upload.updateSupport" />是否更新已经存在的用户数据-->
+          <el-link type="info" style="font-size:12px" @click="importTemplate">{{ $t('下载模板') }}</el-link>
         </div>
-        <div class="el-upload__tip" style="color:red" slot="tip">提示:仅允许导入“xls”或“xlsx”格式文件!</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">
         <el-button type="primary" @click="submitFileForm">确 定</el-button>
@@ -247,7 +250,11 @@ export default {
       // 是否显示弹出层
       open: false,
       // 用户导入参数
+      // 用户导入参数
       upload: {
+        downloadAction: process.env.VUE_APP_BASE_API + '/common/template',
+        //下载模板类型
+        type: "pssrRegionTmpl",
         // 是否显示弹出层(用户导入)
         open: false,
         // 弹出层标题(用户导入)
@@ -315,6 +322,8 @@ export default {
   },
   methods: {
     userFormatter(row) {
+      if (row.chargePerson==null)
+        return ""
       let ids = row.chargePerson.split(',');
       let nickName = '';
       ids.forEach(id => {
@@ -455,9 +464,7 @@ export default {
     },
     /** 下载模板操作 */
     importTemplate() {
-      importTemplate().then(response => {
-        this.download(response.msg);
-      });
+      this.$refs['downloadFileForm'].submit()
     },
     // 文件上传中处理
     handleFileUploadProgress(event, file, fileList) {

+ 69 - 68
ui/src/views/pssr/subcontent/index.vue

@@ -35,48 +35,48 @@
     </el-form>
 
     <el-row :gutter="10" class="mb8">
-<!--      <el-col :span="1.5">
-        <el-button
-          type="primary"
-          icon="el-icon-plus"
-          size="mini"
-          @click="handleAdd"
-          v-hasPermi="['pssr:subcontent:add']"
-        >新增
-        </el-button>
-      </el-col>
-      <el-col :span="1.5">
-        <el-button
-          type="success"
-          icon="el-icon-edit"
-          size="mini"
-          :disabled="single"
-          @click="handleUpdate"
-          v-hasPermi="['pssr:subcontent:edit']"
-        >修改
-        </el-button>
-      </el-col>
-      <el-col :span="1.5">
-        <el-button
-          type="danger"
-          icon="el-icon-delete"
-          size="mini"
-          :disabled="multiple"
-          @click="handleDelete"
-          v-hasPermi="['pssr:subcontent:remove']"
-        >删除
-        </el-button>
-      </el-col>
-      <el-col :span="1.5">
-        <el-button
-          type="info"
-          icon="el-icon-upload2"
-          size="mini"
-          @click="handleImport"
-          v-hasPermi="['pssr:subcontent:edit']"
-        >导入
-        </el-button>
-      </el-col>
+      <!--      <el-col :span="1.5">
+              <el-button
+                type="primary"
+                icon="el-icon-plus"
+                size="mini"
+                @click="handleAdd"
+                v-hasPermi="['pssr:subcontent:add']"
+              >新增
+              </el-button>
+            </el-col>
+            <el-col :span="1.5">
+              <el-button
+                type="success"
+                icon="el-icon-edit"
+                size="mini"
+                :disabled="single"
+                @click="handleUpdate"
+                v-hasPermi="['pssr:subcontent:edit']"
+              >修改
+              </el-button>
+            </el-col>
+            <el-col :span="1.5">
+              <el-button
+                type="danger"
+                icon="el-icon-delete"
+                size="mini"
+                :disabled="multiple"
+                @click="handleDelete"
+                v-hasPermi="['pssr:subcontent:remove']"
+              >删除
+              </el-button>
+            </el-col>
+            <el-col :span="1.5">
+              <el-button
+                type="info"
+                icon="el-icon-upload2"
+                size="mini"
+                @click="handleImport"
+                v-hasPermi="['pssr:subcontent:edit']"
+              >导入
+              </el-button>
+            </el-col>-->
       <el-col :span="1.5">
         <el-button
           type="warning"
@@ -86,7 +86,7 @@
           v-hasPermi="['pssr:subcontent:export']"
         >导出
         </el-button>
-      </el-col>-->
+      </el-col>
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
@@ -98,7 +98,8 @@
       <el-table-column label="开车条件检查内容" align="center" prop="content" :show-overflow-tooltip="true"/>
       <el-table-column label="审批状态" align="center" prop="approveStatus" :show-overflow-tooltip="true">
         <template slot-scope="scope">
-          <dict-tag :options="dict.type.pssr_approve_status" :value="scope.row.approveStatus" :show-type="getTagType(scope.row.approveStatus)"/>
+          <dict-tag :options="dict.type.pssr_approve_status" :value="scope.row.approveStatus"
+                    :show-type="getTagType(scope.row.approveStatus)"/>
         </template>
       </el-table-column>
       <el-table-column label="确认人" align="center" prop="confirmName" :show-overflow-tooltip="true" width="180"/>
@@ -110,22 +111,22 @@
       <el-table-column label="备注" align="center" prop="remarks" :show-overflow-tooltip="true" width="180"/>
       <el-table-column label="操作" align="center" fixed="right" width="120" class-name="small-padding fixed-width">
         <template slot-scope="scope">
-<!--          <el-button
-            size="mini"
-            type="text"
-            icon="el-icon-edit"
-            @click="handleUpdate(scope.row)"
-            v-hasPermi="['pssr:subcontent:edit']"
-          >修改
-          </el-button>
-          <el-button
-            size="mini"
-            type="text"
-            icon="el-icon-delete"
-            @click="handleDelete(scope.row)"
-            v-hasPermi="['pssr:subcontent:remove']"
-          >删除
-          </el-button>-->
+          <!--          <el-button
+                      size="mini"
+                      type="text"
+                      icon="el-icon-edit"
+                      @click="handleUpdate(scope.row)"
+                      v-hasPermi="['pssr:subcontent:edit']"
+                    >修改
+                    </el-button>
+                    <el-button
+                      size="mini"
+                      type="text"
+                      icon="el-icon-delete"
+                      @click="handleDelete(scope.row)"
+                      v-hasPermi="['pssr:subcontent:remove']"
+                    >删除
+                    </el-button>-->
           <el-button
             size="mini"
             type="text"
@@ -222,7 +223,7 @@ import "@riophae/vue-treeselect/dist/vue-treeselect.css";
 import {listUserNoPage} from "@/api/system/user";
 
 export default {
-  dicts:['pssr_approve_status'],
+  dicts: ['pssr_approve_status'],
   name: "Subcontent",
   components: {Treeselect},
   // components: { Editor },
@@ -322,18 +323,18 @@ export default {
     });
   },
   methods: {
-    getTagType(val){
-      if (val==0){
+    getTagType(val) {
+      if (val == 0) {
         return ''
-      }else if (val==1){
+      } else if (val == 1) {
         return 'warning'
-      }else if (val==2){
+      } else if (val == 2) {
         return 'success'
       }
     },
-    gotoSubIndex(row){
+    gotoSubIndex(row) {
       console.log(row)
-      this.$router.push({ name: 'Subitem', params: { subId: row.id,serialNumber:row.serialNumber } });
+      this.$router.push({name: 'Subitem', params: {subId: row.id, serialNumber: row.forShort}});
     },
     /** 查询开车条件确认列表 */
     getList() {
@@ -452,7 +453,7 @@ export default {
       }).then(function () {
         return exportSubcontent(queryParams);
       }).then(response => {
-        this.download(response.msg);
+        window.open(process.env.VUE_APP_BASE_API + response.msg);
       })
     },
     /** 导入按钮操作 */

+ 28 - 28
ui/src/views/pssr/subitem/index.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="app-container">
-    <div v-if="sn=='01'">
+    <div v-if="sn=='jxxm'">
       <el-tabs v-model="activeName" @tab-click="handleClick">
         <el-tab-pane label="管道" name="first">
           <overhaul-pipe :sub-id="Number(si)" :is-approve="Number(isApprove)"/>
@@ -22,19 +22,19 @@
         </el-tab-pane>
       </el-tabs>
     </div>
-    <div v-if="sn=='02'">
+    <div v-if="sn=='kgfa'">
       <programme :sub-id="Number(si)" :is-approve="Number(isApprove)"/>
     </div>
-    <div v-if="sn=='03'">
+    <div v-if="sn=='mb'">
       <blind :sub-id="Number(si)" :is-approve="Number(isApprove)"  @refreshHisList="refreshHisList"/>
     </div>
-    <div v-if="sn=='04'">
+    <div v-if="sn=='qm'">
       <airtight :sub-id="Number(si)" :is-approve="Number(isApprove)"/>
     </div>
-    <div v-if="sn=='05'">
+    <div v-if="sn=='rsfh'">
       <protection :sub-id="Number(si)" :is-approve="Number(isApprove)"/>
     </div>
-    <div v-if="sn=='06'">
+    <div v-if="sn=='aqcs'">
       <el-tabs v-model="activeName" @tab-click="handleClick">
         <el-tab-pane label="安全阀" name="first">
           <safety-valve :sub-id="Number(si)" :is-approve="Number(isApprove)"/>
@@ -53,40 +53,40 @@
         </el-tab-pane>
       </el-tabs>
     </div>
-    <div v-if="sn=='07'">
+    <div v-if="sn=='gygc'">
       <public :sub-id="Number(si)" :is-approve="Number(isApprove)"/>
     </div>
-    <div v-if="sn=='08'">
+    <div v-if="sn=='yl'">
       <material :sub-id="Number(si)" :is-approve="Number(isApprove)"/>
     </div>
-    <div v-if="sn=='09'">
+    <div v-if="sn=='xcws'">
       <hygiene :sub-id="Number(si)" :is-approve="Number(isApprove)"/>
     </div>
-    <div v-if="sn=='10'">
+    <div v-if="sn=='sbqj'">
       <cleaning :sub-id="Number(si)" :is-approve="Number(isApprove)"/>
     </div>
-    <div v-if="sn=='11'">
+    <div v-if="sn=='dj'">
       <circuit :sub-id="Number(si)" :is-approve="Number(isApprove)"/>
     </div>
-    <div v-if="sn=='12'">
+    <div v-if="sn=='xqfss'">
       <patrol :sub-id="Number(si)" :is-approve="Number(isApprove)"/>
     </div>
-    <div v-if="sn=='13'">
+    <div v-if="sn=='txjk'">
       <patrol :sub-id="Number(si)" :is-approve="Number(isApprove)"/>
     </div>
-    <div v-if="sn=='14'">
+    <div v-if="sn=='hjvocxt'">
       <torchvoc :sub-id="Number(si)" :is-approve="Number(isApprove)"/>
     </div>
-    <div v-if="sn=='15'">
+    <div v-if="sn=='bxsjcy'">
       <patrol :sub-id="Number(si)" :is-approve="Number(isApprove)"/>
     </div>
-    <div v-if="sn=='16'">
+    <div v-if="sn=='xtdqzh'">
       <nitrogen :sub-id="Number(si)" :is-approve="Number(isApprove)"/>
     </div>
-    <div v-if="sn=='17'">
+    <div v-if="sn=='sksgfmzt'">
       <lock :sub-id="Number(si)" :is-approve="Number(isApprove)" @refreshHisList="refreshHisList"/>
     </div>
-    <div v-if="sn=='18'">
+    <div v-if="sn=='jb'">
       <el-tabs v-model="activeName" @tab-click="handleClick">
         <el-tab-pane label="机泵过滤器清理工作清单" name="first">
           <pump-cleaning :sub-id="Number(si)" :is-approve="Number(isApprove)"/>
@@ -99,34 +99,34 @@
         </el-tab-pane>
       </el-tabs>
     </div>
-    <div v-if="sn=='19'">
+    <div v-if="sn=='zdj'">
       <frame :sub-id="Number(si)" :is-approve="Number(isApprove)"/>
     </div>
-    <div v-if="sn=='20'">
+    <div v-if="sn=='tzsb'">
       <pipe :sub-id="Number(si)" :is-approve="Number(isApprove)"/>
     </div>
-    <div v-if="sn=='21'">
+    <div v-if="sn=='ybjy'">
       <instrument-calibration :sub-id="Number(si)" :is-approve="Number(isApprove)"/>
     </div>
-    <div v-if="sn=='22'">
+    <div v-if="sn=='yblscs'">
       <instrument-test :sub-id="Number(si)" :is-approve="Number(isApprove)"/>
     </div>
-    <div v-if="sn=='23'">
+    <div v-if="sn=='bjlszqr'">
       <alarm :sub-id="Number(si)" :is-approve="Number(isApprove)"/>
     </div>
-    <div v-if="sn=='24'">
+    <div v-if="sn=='qtjcq'">
       <gasdetector :sub-id="Number(si)" :is-approve="Number(isApprove)"/>
     </div>
-    <div v-if="sn=='25'">
+    <div v-if="sn=='zm'">
       <lighting :sub-id="Number(si)" :is-approve="Number(isApprove)"/>
     </div>
-    <div v-if="sn=='26'">
+    <div v-if="sn=='djsb'">
       <motor :sub-id="Number(si)" :is-approve="Number(isApprove)"/>
     </div>
-    <div v-if="sn=='27'">
+    <div v-if="sn=='jdjdkj'">
       <franklinism :sub-id="Number(si)" :is-approve="Number(isApprove)"/>
     </div>
-    <div v-if="sn=='28'">
+    <div v-if="sn=='zxfxy'">
       <analyzer :sub-id="Number(si)" :is-approve="Number(isApprove)"/>
     </div>
   </div>