Browse Source

危险作业导出

wangbo 2 months ago
parent
commit
61e5f3c662

+ 1 - 1
js-security/security-common/src/main/java/com/rongwei/sfcommon/sys/service/RiskJobService.java

@@ -8,6 +8,6 @@ public interface    RiskJobService {
 
      void riskJobExport2(String id,String jobtype, String tenantid, HttpServletResponse response);
 
-
+     void riskJobExport2(String id,String jobtype, String tenantid, String processinstid, HttpServletResponse response);
 //    void riskJobExport(ExcelFormData excelData, HttpServletResponse response) throws Exception;
 }

+ 198 - 62
js-security/security-common/src/main/java/com/rongwei/sfcommon/sys/service/impl/RiskJobServiceImpl.java

@@ -1,6 +1,4 @@
 package com.rongwei.sfcommon.sys.service.impl;
-
-import com.aspose.cells.DocumentPropertyCollection;
 import com.aspose.words.Document;
 import com.aspose.words.DocumentBuilder;
 import com.aspose.words.MailMergeCleanupOptions;
@@ -13,6 +11,7 @@ import com.rongwei.rwadmincommon.system.domain.SysDictDo;
 import com.rongwei.rwcommon.base.exception.CustomException;
 import com.rongwei.rwcommon.utils.StringUtils;
 import com.rongwei.rwcommonentity.commonservers.domain.SysFileItemDo;
+import com.rongwei.safecommon.fegin.WFFeginClient;
 import com.rongwei.sfcommon.sys.service.*;
 import lombok.SneakyThrows;
 import lombok.extern.slf4j.Slf4j;
@@ -28,8 +27,13 @@ import java.net.URLEncoder;
 import java.nio.file.Files;
 import java.nio.file.Paths;
 import java.text.SimpleDateFormat;
+import java.time.LocalDate;
 import java.time.LocalDateTime;
+import java.time.OffsetDateTime;
+import java.time.ZonedDateTime;
 import java.time.format.DateTimeFormatter;
+import java.time.format.DateTimeParseException;
+import java.time.temporal.TemporalAccessor;
 import java.util.*;
 import java.util.stream.Collectors;
 
@@ -38,7 +42,8 @@ import java.util.stream.Collectors;
 public class RiskJobServiceImpl implements RiskJobService {
     private static final Logger logger = LoggerFactory.getLogger(RiskJobServiceImpl.class.getName());
     public static final String DEFAULT_FONT_NAME = "仿宋";
-
+//    private static final DateTimeFormatter DATE_TIME_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+    private static final DateTimeFormatter DATE_TIME_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSSZ");
     public static final Map<String, String> CHECK_BOX= new HashMap<String, String>() {{
         put("DHFS", "dhfs");
         put("FHYP", "fhyp");
@@ -49,7 +54,6 @@ public class RiskJobServiceImpl implements RiskJobService {
         put("吊装作业", "吊装作业.docx");
         put("受限空间作业", "受限空间作业.docx");
         put("临时用电作业", "临时用电作业.docx");
-
         put("动土作业", "动土作业.docx");
         put("断路作业", "断路作业.docx");
         put("盲板抽堵", "盲板抽堵作业.docx");
@@ -93,6 +97,9 @@ public class RiskJobServiceImpl implements RiskJobService {
     @Autowired
     AspMbcdzyService aspMbcdzyService;
 
+    @Autowired
+    private WFFeginClient wfFeginClient;
+
     @Autowired
     AspCombustibleGasDetectionService aspCombustibleGasDetectionService;
 
@@ -179,7 +186,7 @@ public class RiskJobServiceImpl implements RiskJobService {
 //        return subList3;
 //    }
 
-    private List<Map<String, String>> getAqcsList(String id) {
+    private List<Map<String, String>> getAqcsList(String id,Map<String, String> wordMap) {
         List<AspInspectionInformationTableDo> aqcsList = aspInspectionInformationTableService.list(new QueryWrapper<AspInspectionInformationTableDo>()
                 .eq("jobid",id)
                 .eq("deleted", '0'));
@@ -189,7 +196,12 @@ public class RiskJobServiceImpl implements RiskJobService {
                 Map<String, String> subItem2 = new HashMap<>();
                 subItem2.put("MAINSAFETYMEASURES", defaultEmptyStr(item.getMainsafetymeasures()));
                 subItem2.put("WHETHERITINVOLVES", defaultEmptyStr(item.getWhetheritinvolves()));
+                // 检查人
                 subItem2.put("CHECKUSER", defaultEmptyStr(item.getCheckuser()));
+
+                // 插入图片签名
+//                insertImageToBookmark(doc, "CHECKUSER", wordMap.get("SDBMFZRQZ"));
+
                 subList2.add(subItem2);
             }
         }
@@ -198,18 +210,18 @@ public class RiskJobServiceImpl implements RiskJobService {
 
 
     // 获取动火人信息
-    private String getDhrxx(String id,Map<String, String> wordMap) {
-        List<AspSpecialPersonalInformationDo> dhrList = aspSpecialPersonalInformationService.list(new QueryWrapper<AspSpecialPersonalInformationDo>()
-                .eq("jobid", id)
-                .eq("deleted", "0"));
-        if (dhrList != null && !dhrList.isEmpty()) {
-            String dhrxx = dhrList.stream()
-                    .map(item -> defaultEmptyStr(item.getName()) + "," + defaultEmptyStr(item.getCertificateno()))
-                    .collect(Collectors.joining(" "));
-            wordMap.put("DHRJZSBH", defaultEmptyStr(dhrxx));
-        }
-        return "";  // 如果没有动火人信息,返回空字符串
-    }
+//    private String getDhrxx(String id,Map<String, String> wordMap) {
+//        List<AspSpecialPersonalInformationDo> dhrList = aspSpecialPersonalInformationService.list(new QueryWrapper<AspSpecialPersonalInformationDo>()
+//                .eq("jobid", id)
+//                .eq("deleted", "0"));
+//        if (dhrList != null && !dhrList.isEmpty()) {
+//            String dhrxx = dhrList.stream()
+//                    .map(item -> defaultEmptyStr(item.getName()) + "," + defaultEmptyStr(item.getCertificateno()))
+//                    .collect(Collectors.joining(" "));
+//            wordMap.put("DHRJZSBH", defaultEmptyStr(dhrxx));
+//        }
+//        return "";  // 如果没有动火人信息,返回空字符串
+//    }
     private String getryxx(String id,Map<String, String> wordMap) {
         List<AspSpecialPersonalInformationDo> dhrList = aspSpecialPersonalInformationService.list(new QueryWrapper<AspSpecialPersonalInformationDo>()
                 .eq("jobid", id)
@@ -233,12 +245,59 @@ public class RiskJobServiceImpl implements RiskJobService {
         return "";  // 如果没有信息,返回空字符串
     }
 
+    @Override
+    public void riskJobExport2(String id, String jobtype, String tenantid, HttpServletResponse response) {
+        riskJobExportCommon(id, jobtype, tenantid, null, response);
+    }
 
+    @Override
+    public void riskJobExport2(String id, String jobtype, String tenantid, String processinstid, HttpServletResponse response) {
+        riskJobExportCommon(id, jobtype, tenantid, processinstid, response);
+    }
 
-    public void riskJobExport2(String id, String jobtype,String tenantid,HttpServletResponse response) {
+
+    private void riskJobExportCommon(String id, String jobtype, String tenantid, String processinstid, HttpServletResponse response) {
         Map<String, String> wordMap = new HashMap<>();
         // 获取通用数据字典数据
         List<SysDictDo> sysDictDoList = getSysDictDoList();
+
+        // 根据作业类型获取并处理数据
+        processJobDataByType(id, jobtype, wordMap, sysDictDoList);
+
+        // 气体检查数据
+        List<Map<String, String>> subList1 = getCombustibleGasDetectionList(id, sysDictDoList);
+
+        // 关联作业
+        getJobData(id, wordMap);
+
+        // 安全措施数据
+        List<Map<String, String>> subList2 = getAqcsList(id, wordMap);
+
+        // 作业人信息
+        getryxx(id, wordMap);
+
+        // 如果有流程实例ID,处理流程评论信息
+        if (processinstid != null) {
+            processWorkflowComments(processinstid, wordMap);
+        }
+
+        // 风险辨识
+        List<AspJobConfigFxbsDo> fxbsList = aspJobConfigFxbsService.list(new QueryWrapper<AspJobConfigFxbsDo>()
+                .eq("tenantid", tenantid)
+                .eq("jobtype", jobtype)
+                .eq("deleted", '0'));
+        String[] fxbs = fxbsList != null
+                ? fxbsList.stream()
+                .sorted(Comparator.comparing(AspJobConfigFxbsDo::getSon))
+                .map(AspJobConfigFxbsDo::getFxbsx)
+                .toArray(String[]::new)
+                : new String[0];
+
+        response(wordMap, response, subList1, subList2, fxbs, sysDictDoList, jobtype);
+    }
+
+
+    private void processJobDataByType(String id, String jobtype, Map<String, String> wordMap, List<SysDictDo> sysDictDoList) {
         if ("动火作业".equals(jobtype)) {
             AspDhzyDo dhzyDo = dhzyService.getById(id);
             if (dhzyDo == null) {
@@ -247,79 +306,138 @@ public class RiskJobServiceImpl implements RiskJobService {
             processAspDhzyDo(dhzyDo, wordMap, sysDictDoList);
         } else if ("受限空间作业".equals(jobtype)) {
             AspSxkjzyDo sxkjzyDo = sxkjzyService.getById(id);
-
             if (sxkjzyDo == null) {
                 throw new RuntimeException("未找到该受限空间作业信息!");
             }
             processAspSxkjzyDo(sxkjzyDo, wordMap, sysDictDoList);
-        }else if ("高处作业".equals(jobtype)) {
+        } else if ("高处作业".equals(jobtype)) {
             AspGczyDo aspGczyDo = aspGczyService.getById(id);
-            if(aspGczyDo == null){
+            if (aspGczyDo == null) {
                 throw new RuntimeException("未找到该高处作业信息!");
             }
             processAspGczyDo(aspGczyDo, wordMap, sysDictDoList);
-        }else if ("吊装作业".equals(jobtype)) {
+        } else if ("吊装作业".equals(jobtype)) {
             AspDzzyDo aspDzzyDo = aspDzzyService.getById(id);
-            if(aspDzzyDo == null){
+            if (aspDzzyDo == null) {
                 throw new RuntimeException("未找到该吊装作业信息!");
             }
             processAspDzzyDo(aspDzzyDo, wordMap, sysDictDoList);
-        }else if ("临时用电作业".equals(jobtype)) {
+        } else if ("临时用电作业".equals(jobtype)) {
             AspLsydzyDo aspLsydzyDo = aspLsydzyService.getById(id);
-            if(aspLsydzyDo == null){
+            if (aspLsydzyDo == null) {
                 throw new RuntimeException("未找到该临时用电作业信息!");
             }
-            processAspLsydzyDo(aspLsydzyDo,wordMap,sysDictDoList);
-        }else if ("动土作业".equals(jobtype)) {
+            processAspLsydzyDo(aspLsydzyDo, wordMap, sysDictDoList);
+        } else if ("动土作业".equals(jobtype)) {
             AspDtzyDo aspdtzyDo = aspDtzyService.getById(id);
-            if(aspdtzyDo == null){
+            if (aspdtzyDo == null) {
                 throw new RuntimeException("未找到该动土作业信息!");
             }
-            processAspDtzyDo(aspdtzyDo,wordMap,sysDictDoList);
-        }else if ("断路作业".equals(jobtype)) {
+            processAspDtzyDo(aspdtzyDo, wordMap, sysDictDoList);
+        } else if ("断路作业".equals(jobtype)) {
             AspDlzzDo aspdlzzDo = aspDlzzService.getById(id);
-            if(aspdlzzDo == null){
+            if (aspdlzzDo == null) {
                 throw new RuntimeException("未找到该断路作业信息!");
             }
-            processAspDlzzDo(aspdlzzDo,wordMap,sysDictDoList);
-        }else if ("盲板抽堵".equals(jobtype)) {
+            processAspDlzzDo(aspdlzzDo, wordMap, sysDictDoList);
+        } else if ("盲板抽堵".equals(jobtype)) {
             AspMbcdzyDo aspmbcdzyDo = aspMbcdzyService.getById(id);
-            if(aspmbcdzyDo == null){
+            if (aspmbcdzyDo == null) {
                 throw new RuntimeException("未找到该盲板抽堵作业信息!");
             }
-            processAspMbcdDo(aspmbcdzyDo,wordMap,sysDictDoList);
-        }else {
+            processAspMbcdDo(aspmbcdzyDo, wordMap, sysDictDoList);
+        } else {
             throw new RuntimeException("未找到作业信息!");
         }
+    }
 
-        // 气体检查数据
-        List<Map<String, String>> subList1 = getCombustibleGasDetectionList(id,sysDictDoList);
 
-        // 关联作业
-        getJobData(id,wordMap);
-
-        // 安全措施数据
-        List<Map<String, String>> subList2 = getAqcsList(id);
 
-        // 作业人信息
-        getryxx(id,wordMap);
+    private void processWorkflowComments(String processinstid, Map<String, String> wordMap) {
+        //获取流程评论信息 取每个节点最新的  留下审批人名字 和审批人评论 签名使用流程控制
+        List<Map<String, Object>> wfinfolist = wfFeginClient.getCommentsByProcInstId(processinstid);
+        List<Map<String, Object>> resultList = processComments(wfinfolist);
+
+        //去resultList里找
+        for (Map<String, Object> map : resultList) {
+            String taskName = defaultEmptyStr(map.get("taskname"));
+            if ("安环部".equals(taskName)) {
+                wordMap.put("AQGLBYJ", defaultEmptyStr(map.get("taskcomment")));
+                wordMap.put("AHBWXZYZG", defaultEmptyStr(map.get("assigneename")));
+                wordMap.put("AQGLBMSPRQ", defaultEmptyStr(map.get("provedate")));
+            } else if ("部门副总".equals(taskName)) {
+                wordMap.put("FGLDYJ", defaultEmptyStr(map.get("taskcomment")));
+                wordMap.put("BMFZQZ", defaultEmptyStr(map.get("assigneename")));
+                wordMap.put("FGLDSPRQ", defaultEmptyStr(map.get("provedate")));
+            } else if ("总经理".equals(taskName)) {
+                // 补充逻辑
+            } else if ("总工程师".equals(taskName)) {
+                // 补充逻辑
+            } else if ("属地部门经理".equals(taskName)) {
+                wordMap.put("SDBMYJ", defaultEmptyStr(map.get("taskcomment")));
+                wordMap.put("BMJLQM", defaultEmptyStr(map.get("assigneename")));
+                wordMap.put("SDBMSPRQ", defaultEmptyStr(map.get("provedate")));
+            } else if ("开始".equals(taskName)) {
+                wordMap.put("ZYFZRYJ", "同意开始");
+                wordMap.put("ZYFZRSPRQ", defaultEmptyStr(map.get("provedate")));
+            }
+        }
+    }
 
-        // 风险辨识
-        List<AspJobConfigFxbsDo> fxbsList = aspJobConfigFxbsService.list(new QueryWrapper<AspJobConfigFxbsDo>()
-                .eq("tenantid",tenantid)
-                .eq("jobtype",jobtype)
-                .eq("deleted", '0'));
-        String[] fxbs = fxbsList != null
-                ? fxbsList.stream()
-                .sorted(Comparator.comparing(AspJobConfigFxbsDo::getSon))
-                .map(AspJobConfigFxbsDo::getFxbsx)
-                .toArray(String[]::new)
-                : new String[0];
 
-        response(wordMap,response,subList1,subList2,fxbs,sysDictDoList,jobtype);
+    // 处理评论列表,按TASKNAME分组并保留CREATEDATE最新的记录
+    public static List<Map<String, Object>> processComments(List<Map<String, Object>> wfinfolist) {
+        return wfinfolist.stream()
+                .filter(comment ->
+                        comment.get("taskname") instanceof String &&
+                                comment.get("createdate") instanceof String
+//                                &&
+//                                comment.get("assigneename") instanceof String &&
+//                                !((String) comment.get("assigneename")).trim().isEmpty()
+                )
+                .collect(Collectors.groupingBy(
+                        comment -> (String) comment.get("taskname"),
+                        Collectors.collectingAndThen(
+                                Collectors.maxBy(Comparator.comparing(
+                                        comment -> (String) comment.get("createdate")
+                                )),
+                                Optional::get
+                        )
+                ))
+                .values()
+                .stream()
+                .map(comment -> {
+                    Map<String, Object> result = new HashMap<>();
+                    result.put("taskname", comment.get("taskname"));
+                    result.put("assigneename", comment.get("assigneename"));
+                    result.put("taskcomment", comment.get("taskcomment"));
+
+                    // 处理provedate字段,将字符串转换为LocalDateTime
+                    Object provedateObj = comment.get("provedate");
+                    if (provedateObj instanceof String) {
+                        try {
+                            // 解析为OffsetDateTime以处理时区,然后转换为LocalDateTime
+                            OffsetDateTime offsetDateTime = OffsetDateTime.parse((String) provedateObj, DATE_TIME_FORMATTER);
+                            result.put("provedate", offsetDateTime.toLocalDateTime());
+                        } catch (DateTimeParseException e) {
+                            // 解析失败时保留原始值或设置为null
+                            System.err.println("Failed to parse date: " + provedateObj);
+                            result.put("provedate", null);
+                        }
+                    } else {
+                        result.put("provedate", null);
+                    }
 
+                    return result;
+                })
+                .collect(Collectors.toList());
     }
 
+
+
+
+
+
     public void processAspDhzyDo(AspDhzyDo dhzyDo, Map<String, String> wordMap, List<SysDictDo> sysDictDoList) {
         // 动火方式处理
 //        String dhfs = dhzyDo.getDhfs();
@@ -451,8 +569,6 @@ public class RiskJobServiceImpl implements RiskJobService {
         wordMap.put("JSJDRQM", defaultEmptyStr(GczyDo.getJsjdrqm()));
         wordMap.put("FXBSX", defaultEmptyStr(GczyDo.getFxbs()));
 
-
-
     }
 
 
@@ -643,19 +759,39 @@ public class RiskJobServiceImpl implements RiskJobService {
 
 
 
-
-
     public String defaultEmptyStr(Object str) {
         if (str == null) {
             return "";
         }
         if (str instanceof Date) {
-//            return new SimpleDateFormat("yyyy-MM-dd").format(str);
+            // 处理旧版 Date 类型
             return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format((Date) str);
+        } else if (str instanceof java.time.temporal.TemporalAccessor) {
+            // 统一处理 Java 8 时间类型(LocalDateTime、LocalDate、ZonedDateTime 等)
+            DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+            if (str instanceof LocalDateTime) {
+                return ((LocalDateTime) str).format(formatter);
+            } else if (str instanceof LocalDate) {
+                return ((LocalDate) str).atStartOfDay().format(formatter);
+            } else if (str instanceof ZonedDateTime) {
+                return ((ZonedDateTime) str).format(formatter);
+            }
+            return formatter.format((TemporalAccessor) str);
         }
         return str.toString();
     }
 
+//    public String defaultEmptyStr(Object str) {
+//        if (str == null) {
+//            return "";
+//        }
+//        if (str instanceof Date) {
+////            return new SimpleDateFormat("yyyy-MM-dd").format(str);
+//            return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format((Date) str);
+//        }
+//        return str.toString();
+//    }
+
     public void checkBoxDispose(Map<String, String> wordMap, Document document, String[] fxbs, List<SysDictDo> sysDictDoList) {
         try {
             DocumentBuilder builder = new DocumentBuilder(document);

BIN
js-security/security-common/src/main/resources/导出PDF(动火作业待修改).docx


+ 56 - 207
js-security/security-entity/src/main/java/com/rongwe/scentity/domian/AspDhzyDo.java

@@ -461,212 +461,61 @@ public class AspDhzyDo extends BaseDo implements Serializable {
      * 接受交底人签名
      */
     private String jsjdrqm;
-//    /**
-//     * 主键ID
-//     */
-//    @TableId
-//    private String id;
-//    /**
-//     * 是否在四色图区域,0:否,1:是
-//     */
-//    private String sfsstqy;
-//    /**
-//     * 风险四色图ID,当作业在四色图区域内时必填
-//     */
-//    private String fssstid;
-//    /**
-//     * 作业证编号
-//     */
-//    private String zyzbh;
-//    /**
-//     * 作业申请单位
-//     */
-//    private String sqdw;
-//    /**
-//     * 作业申请人
-//     */
-//    private String sqr;
-//    /**
-//     * 作业申请时间
-//     */
-//    private Date zysqsj;
-//    /**
-//     * 作业内容
-//     */
-//    private String zynr;
-//    /**
-//     * 作业位置
-//     */
-//    private String zywz;
-//    /**
-//     * 动火作业级别,1:特级,2:一级,3:二级
-//     */
-//    private String dhzyjb;
-//    /**
-//     * 动火方式
-//     */
-//    private String dhfs;
-//    /**
-//     * 作业实施开始时间
-//     */
-//    private Date zykssj;
-//    /**
-//     * 作业实施结束时间
-//     */
-//    private Date zyjssj;
-//    /**
-//     * 作业负责人
-//     */
-//    private String zyfzr;
-//    /**
-//     * 作业人员信息
-//     */
-//    private String zyryxx;
-//    /**
-//     * 作业单位类型
-//     */
-//    private String zydwlx;
-//    /**
-//     * 作业单位名称
-//     */
-//    private String zydwmc;
-//    /**
-//     * 涉及的其他特殊作业
-//     */
-//    private String sfsjqttszy;
-//    /**
-//     * 涉及的其他特殊作业安全作业证编号
-//     */
-//    private String sjqttszyzbh;
-//    /**
-//     * 风险辨识
-//     */
-//    private String fxbs;
-//    /**
-//     * 风险预防措施
-//     */
-//    private String fxyfcs;
-//    /**
-//     * 防护用品
-//     */
-//    private String fhyp;
-//    /**
-//     * 监护人
-//     */
-//    private String jhr;
-//    /**
-//     * 监护人岗位
-//     */
-//    private String jhrgw;
-//    /**
-//     * 监护人证件编号
-//     */
-//    private String jhrzjbh;
-//    /**
-//     * 验收人
-//     */
-//    private String ysr;
-//    /**
-//     * 安全交底人
-//     */
-//    private String aqjdr;
-//    /**
-//     * 当前状态
-//     */
-//    private String dqzt;
-//    /**
-//     * 接受交底人
-//     */
-//    private String jsjdr;
-//    /**
-//     * 经度
-//     */
-//    private BigDecimal longitude;
-//    /**
-//     * 纬度
-//     */
-//    private BigDecimal latitude;
-//    /**
-//     * 视频回放地址
-//     */
-//    private String video_url;
-//    /**
-//     * 创建时间
-//     */
-//    private Date create_time;
-//    /**
-//     * 创建人
-//     */
-//    private String create_by;
-//    /**
-//     * 最后修改时间
-//     */
-//    private Date update_time;
-//    /**
-//     * 最后修改人
-//     */
-//    private String update_by;
-//    /**
-//     * 删除标识
-//     */
-//    private String delete_mark;
-//    /**
-//     * 企业编码
-//     */
-//    private String company_code;
-//    /**
-//     * 电子作业票附件
-//     */
-//    private String fileUrl;
-//    /**
-//     * 计划开始时间
-//     */
-//    private Date jhkssj;
-//    /**
-//     * 计划结束时间
-//     */
-//    private Date jhjssj;
-//    /**
-//     * JAS附件
-//     */
-//    private String jsaFileUrl;
-//
-//    private String tenantid;
-//    /**
-//     * 扩展json格式配置
-//     */
-//    private String roption;
-//    /**
-//     * 是否删除Y/N
-//     */
-//    private String deleted;
-//    /**
-//     * 备注
-//     */
-//    private String remark;
-//    /**
-//     * 创建时间
-//     */
-//    private Date createdate;
-//    /**
-//     * 创建用户ID
-//     */
-//    private String createuserid;
-//    /**
-//     * 修改日期
-//     */
-//    private Date modifydate;
-//    /**
-//     * 修改用户ID
-//     */
-//    private String modifyuserid;
-//    /**
-//     * 创建人名称
-//     */
-//    private String createusername;
-//    /**
-//     * 修改人名称
-//     */
-//    private String modifyusername;
+
+    /**
+     * 流程id
+     */
+    private String processinstid;
+
+    /**
+     * 属地部门经理
+     */
+    private String sdbmjl;
+
+    /**
+     * 属地部门经理ID
+     */
+    private String sdbmlid;
+
+    /**
+     * 部门副总
+     */
+    private String bmfz;
+
+    /**
+     * 部门副总ID
+     */
+    private String bmfzid;
+
+    /**
+     * 安环部危险作业主管
+     */
+    private String ahbwxzyzg;
+
+    /**
+     * 安环部危险作业主管ID
+     */
+    private String ahbwxzyzgid;
+
+    /**
+     * 总工程师
+     */
+    private String zgcs;
+
+    /**
+     * 总工程师ID
+     */
+    private String zgcsid;
+
+    /**
+     * 总经理
+     */
+    private String zjl;
+
+    /**
+     * 总经理ID
+     */
+    private String zjlid;
+
 
 }

+ 13 - 5
js-security/security-server/src/main/java/com/rongwei/savecheck/controller/RiskJobController.java

@@ -1,8 +1,10 @@
 package com.rongwei.savecheck.controller;
 
 
+import com.rongwei.safecommon.fegin.WFFeginClient;
 import com.rongwei.sfcommon.sys.service.RiskJobService;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
@@ -10,6 +12,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
 import javax.servlet.http.HttpServletResponse;
+import java.util.List;
 import java.util.Map;
 
 @RestController
@@ -23,15 +26,20 @@ public class RiskJobController {
     @PostMapping("/formExcelExport")
     public void formExcelExport(@RequestBody Map<String, String> params, HttpServletResponse response) throws Exception {
         log.info("开始导出");
-        String id = params.get("id");
-        String jobtype = params.get("jobtype");
-        String  tenantid = params.get("tenantid");
         try{
-            riskJobService.riskJobExport2(id, jobtype,tenantid, response);
+            String id = params.get("id");
+            String jobtype = params.get("jobtype");
+            String  tenantid = params.get("tenantid");
+            String  processinstid = params.get("processinstid");
+
+            if(StringUtils.isNoneBlank(processinstid)) {
+                riskJobService.riskJobExport2(id, jobtype, tenantid, processinstid, response);
+            }else {
+                riskJobService.riskJobExport2(id, jobtype, tenantid, response);
+            }
         } catch (Exception e) {
             log.error("导出失败", e);
         }
-
     }