瀏覽代碼

-申请单添加审批流

jiangbiao 2 年之前
父節點
當前提交
55c9fe9ae8

+ 4 - 0
master/src/main/java/com/ruoyi/config/ActivitiConfig.java

@@ -137,6 +137,10 @@ public class ActivitiConfig {
         Resource spec11 = resourceLoader.getResource("classpath:/processes/reserveInvoice.bpmn"); //加载流程图资源文件
         deploymentBuilder11.enableDuplicateFiltering().addInputStream(spec11.getFilename(), spec11.getInputStream()).name("预约开票审批流程").deploy();//按流程id部署
 
+        DeploymentBuilder deploymentBuilder12 = repositoryService().createDeployment();
+        Resource spec12 = resourceLoader.getResource("classpath:/processes/apply/offlinevalve.bpmn"); //加载流程图资源文件
+        deploymentBuilder12.enableDuplicateFiltering().addInputStream(spec12.getFilename(), spec12.getInputStream()).name("安全阀离线/切出申请流程").deploy();//按流程id部署
+
     }
 }
 

+ 55 - 19
master/src/main/java/com/ruoyi/project/apply/controller/TApplyOfflinevalveController.java

@@ -1,5 +1,6 @@
 package com.ruoyi.project.apply.controller;
 
+import com.ruoyi.common.utils.DateUtils;
 import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.ruoyi.framework.aspectj.lang.annotation.Log;
 import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
@@ -8,12 +9,21 @@ import com.ruoyi.framework.web.domain.AjaxResult;
 import com.ruoyi.framework.web.page.TableDataInfo;
 import com.ruoyi.project.apply.domain.TApplyOfflinevalve;
 import com.ruoyi.project.apply.service.ITApplyOfflinevalveService;
+import org.activiti.engine.ProcessEngine;
+import org.activiti.engine.ProcessEngines;
+import org.activiti.engine.RuntimeService;
+import org.activiti.engine.TaskService;
+import org.activiti.engine.impl.identity.Authentication;
+import org.activiti.engine.runtime.ProcessInstance;
+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.util.Date;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 
 /**
  * 安全阀离线切出申请Controller
@@ -23,18 +33,19 @@ import java.util.List;
  */
 @RestController
 @RequestMapping("/apply/offlinevalve")
-public class TApplyOfflinevalveController extends BaseController
-{
+public class TApplyOfflinevalveController extends BaseController {
     @Autowired
     private ITApplyOfflinevalveService tApplyOfflinevalveService;
 
+    @Autowired
+    private RuntimeService runtimeService;
+
     /**
      * 查询安全阀离线切出申请列表
      */
     @PreAuthorize("@ss.hasPermi('apply:offlinevalve:list')")
     @GetMapping("/list")
-    public TableDataInfo list(TApplyOfflinevalve tApplyOfflinevalve)
-    {
+    public TableDataInfo list(TApplyOfflinevalve tApplyOfflinevalve) {
         startPage();
         List<TApplyOfflinevalve> list = tApplyOfflinevalveService.selectTApplyOfflinevalveList(tApplyOfflinevalve);
         return getDataTable(list);
@@ -46,8 +57,7 @@ public class TApplyOfflinevalveController extends BaseController
     @PreAuthorize("@ss.hasPermi('apply:offlinevalve:export')")
     @Log(title = "安全阀离线切出申请", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
-    public AjaxResult export(TApplyOfflinevalve tApplyOfflinevalve)
-    {
+    public AjaxResult export(TApplyOfflinevalve tApplyOfflinevalve) {
         List<TApplyOfflinevalve> list = tApplyOfflinevalveService.selectTApplyOfflinevalveList(tApplyOfflinevalve);
         ExcelUtil<TApplyOfflinevalve> util = new ExcelUtil<TApplyOfflinevalve>(TApplyOfflinevalve.class);
         return util.exportExcel(list, "offlinevalve");
@@ -56,10 +66,9 @@ public class TApplyOfflinevalveController extends BaseController
     /**
      * 获取安全阀离线切出申请详细信息
      */
-    @PreAuthorize("@ss.hasPermi('apply:offlinevalve:query')")
+//    @PreAuthorize("@ss.hasPermi('apply:offlinevalve:query')")
     @GetMapping(value = "/{id}")
-    public AjaxResult getInfo(@PathVariable("id") Long id)
-    {
+    public AjaxResult getInfo(@PathVariable("id") Long id) {
         return AjaxResult.success(tApplyOfflinevalveService.selectTApplyOfflinevalveById(id));
     }
 
@@ -69,14 +78,43 @@ public class TApplyOfflinevalveController extends BaseController
     @PreAuthorize("@ss.hasPermi('apply:offlinevalve:add')")
     @Log(title = "安全阀离线切出申请", businessType = BusinessType.INSERT)
     @PostMapping
-    public AjaxResult add(@RequestBody TApplyOfflinevalve tApplyOfflinevalve)
-    {
-        tApplyOfflinevalve.setApplicant(getUserId().toString());
+    public AjaxResult add(@RequestBody TApplyOfflinevalve tApplyOfflinevalve) {
+        Long userId = getUserId();
+        // 新增申请数据
+        tApplyOfflinevalve.setApplicant(userId.toString());
         tApplyOfflinevalve.setApplicantName(getNickName());
         tApplyOfflinevalve.setApplicationTime(new Date());
         tApplyOfflinevalve.setCreatedate(new Date());
-        tApplyOfflinevalve.setCreaterCode(getUserId().toString());
-        return toAjax(tApplyOfflinevalveService.insertTApplyOfflinevalve(tApplyOfflinevalve));
+        tApplyOfflinevalve.setCreaterCode(userId.toString());
+        tApplyOfflinevalveService.insertTApplyOfflinevalve(tApplyOfflinevalve);
+
+        // 开始申请流程
+        tApplyOfflinevalve.setApNo(DateUtils.dateTimeNow() + userId);
+        long businessKey = tApplyOfflinevalve.getId();
+        String applyUser = userId.toString();
+        //开始工作流、监听
+        Authentication.setAuthenticatedUserId(applyUser);//设置当前申请人
+        Map<String, Object> variables = new HashMap<>();
+        variables.put("applyuser", applyUser);
+        variables.put("confirmer", tApplyOfflinevalve.getConfirmer());
+        variables.put("executor", tApplyOfflinevalve.getExecutor());
+        //采用key来启动流程定义并设置流程变量,返回流程实例
+        ProcessInstance pi = runtimeService.startProcessInstanceByKey("offlinevalve", String.valueOf(businessKey), variables);
+        logger.info("流程定义id:" + pi.getProcessDefinitionId());
+        logger.info("流程实例id:" + pi.getProcessInstanceId());
+        tApplyOfflinevalve.setProcessId(pi.getProcessInstanceId());
+        tApplyOfflinevalveService.updateTApplyOfflinevalve(tApplyOfflinevalve);
+
+        ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();
+        TaskService taskService = processEngine.getTaskService();
+        Task task = taskService.createTaskQuery().processInstanceId(pi.getProcessInstanceId()).active().singleResult();
+        String taskId = task.getId();
+        processEngine.getTaskService().claim(taskId, getUserId().toString());
+        taskService.addComment(taskId, pi.getProcessInstanceId(), "");
+        Map<String, Object> param = new HashMap<>();
+        param.put("condition", "1");
+        taskService.complete(taskId, param);
+        return toAjax(1);
     }
 
     /**
@@ -85,8 +123,7 @@ public class TApplyOfflinevalveController extends BaseController
     @PreAuthorize("@ss.hasPermi('apply:offlinevalve:edit')")
     @Log(title = "安全阀离线切出申请", businessType = BusinessType.UPDATE)
     @PutMapping
-    public AjaxResult edit(@RequestBody TApplyOfflinevalve tApplyOfflinevalve)
-    {
+    public AjaxResult edit(@RequestBody TApplyOfflinevalve tApplyOfflinevalve) {
         tApplyOfflinevalve.setUpdatedate(new Date());
         tApplyOfflinevalve.setUpdaterCode(getUserId());
         return toAjax(tApplyOfflinevalveService.updateTApplyOfflinevalve(tApplyOfflinevalve));
@@ -97,9 +134,8 @@ public class TApplyOfflinevalveController extends BaseController
      */
     @PreAuthorize("@ss.hasPermi('apply:offlinevalve:remove')")
     @Log(title = "安全阀离线切出申请", businessType = BusinessType.DELETE)
-	@DeleteMapping("/{ids}")
-    public AjaxResult remove(@PathVariable Long[] ids)
-    {
+    @DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids) {
         return toAjax(tApplyOfflinevalveService.deleteTApplyOfflinevalveByIds(ids));
     }
 }

+ 27 - 0
master/src/main/java/com/ruoyi/project/apply/domain/TApplyOfflinevalve.java

@@ -168,6 +168,33 @@ public class TApplyOfflinevalve extends BaseEntity
     /**申请人姓名*/
     private String applicantName;
 
+
+    /**
+     * 流程id
+     */
+    private String processId;
+
+    /**
+     * 申请编号
+     */
+    private String apNo;
+
+    public String getProcessId() {
+        return processId;
+    }
+
+    public void setProcessId(String processId) {
+        this.processId = processId;
+    }
+
+    public String getApNo() {
+        return apNo;
+    }
+
+    public void setApNo(String apNo) {
+        this.apNo = apNo;
+    }
+
     public String getLockConfirmer1Name() {
         return lockConfirmer1Name;
     }

+ 19 - 0
master/src/main/java/com/ruoyi/project/ehs/controller/TApproveDangerController.java

@@ -11,6 +11,8 @@ import com.alibaba.fastjson.JSON;
 import com.ruoyi.common.utils.file.FileUploadUtils;
 import com.ruoyi.common.utils.http.HttpContextUtils;
 import com.ruoyi.framework.config.RuoYiConfig;
+import com.ruoyi.project.apply.domain.TApplyOfflinevalve;
+import com.ruoyi.project.apply.service.ITApplyOfflinevalveService;
 import com.ruoyi.project.approve.damain.DevProcess;
 import com.ruoyi.project.approve.damain.DevTask;
 import com.ruoyi.project.common.domain.TCommonfile;
@@ -113,6 +115,9 @@ public class TApproveDangerController extends BaseController {
     @Autowired
     private ITApproveReserveInvoiceService tApproveReserveInvoiceService;
 
+    @Autowired
+    private ITApplyOfflinevalveService tApplyOfflinevalveService;
+
     /**
      * 任务申请
      */
@@ -276,6 +281,10 @@ public class TApproveDangerController extends BaseController {
                         TApproveReserveInvoice approve = tApproveReserveInvoiceService.selectTApproveReserveInvoiceById(Long.parseLong(pi.getBusinessKey()));
                         devProcess.setApproveObject(approve);
                         devProcess.setApNo(approve.getApNo());
+                    } else if (pi.getProcessDefinitionName().equals("安全阀离线/切出申请流程")) {
+                        TApplyOfflinevalve approve = tApplyOfflinevalveService.selectTApplyOfflinevalveById(Long.parseLong(pi.getBusinessKey()));
+                        devProcess.setApproveObject(approve);
+                        devProcess.setApNo(approve.getApNo());
                     }
                 } catch (Exception e) {
                     logger.error(e.toString());
@@ -385,6 +394,10 @@ public class TApproveDangerController extends BaseController {
                     TApproveReserveInvoice approve = tApproveReserveInvoiceService.selectTApproveReserveInvoiceById(Long.parseLong(pi.getBusinessKey()));
                     devTask.setApproveObject(approve);
                     devTask.setApNo(approve.getApNo());
+                } else if (pi.getProcessDefinitionName().equals("安全阀离线/切出申请流程")) {
+                    TApplyOfflinevalve approve = tApplyOfflinevalveService.selectTApplyOfflinevalveById(Long.parseLong(pi.getBusinessKey()));
+                    devTask.setApproveObject(approve);
+                    devTask.setApNo(approve.getApNo());
                 }
                 list.add(devTask);
             }
@@ -472,6 +485,12 @@ public class TApproveDangerController extends BaseController {
                     devProcess.setApNo(approve.getApNo());
                     devProcess.setApName(user.getNickName());
                     devProcess.setApproveObject(approve);
+                } else if (pi.getProcessDefinitionName().equals("安全阀离线/切出申请流程")) {
+                    TApplyOfflinevalve approve = tApplyOfflinevalveService.selectTApplyOfflinevalveById(Long.parseLong(pi.getBusinessKey()));
+                    SysUser user = sysUserService.selectUserById(Long.valueOf(approve.getCreaterCode()));
+                    devProcess.setApNo(approve.getApNo());
+                    devProcess.setApName(user.getNickName());
+                    devProcess.setApproveObject(approve);
                 } else {
                     TApproveDanger approveDanger = tApproveDangerService.selectTApproveDangerById(Long.parseLong(pi.getBusinessKey()));
                     SysUser user = sysUserService.selectUserById(approveDanger.getRecorderId());

+ 5 - 1
master/src/main/resources/mybatis/apply/TApplyOfflinevalveMapper.xml

@@ -43,11 +43,13 @@
         <result property="confirmerName"    column="confirmer_name"    />
         <result property="approverName"    column="approver_name"    />
         <result property="applicantName"    column="applicant_name"    />
+        <result property="apNo"    column="ap_no"    />
+        <result property="processId"    column="process_id"    />
         <result property="deptName" column="dept_name" />
     </resultMap>
 
     <sql id="selectTApplyOfflinevalveVo">
-        select d.id, d.dev_no, d.unit, d.offline_reason, d.safa, d.disassembly, d.executor, d.confirmer, d.applicant, d.application_time, d.approver, d.approve_time, d.reset_confirm, d.leak_confirm, d.revoke_confirm, d.lock_confirm, d.lock_confirmer1, d.lock_confirmer2, d.info_confirmer, d.confirm_time, d.remarks, d.temporary_time, d.execution_time, d.status, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.dept_id, d.approve_status, d.lock_confirmer1_name, d.lock_confirmer2_name, d.info_confirmer_name, d.executor_name, d.confirmer_name, d.approver_name, d.applicant_name ,s.dept_name from t_apply_offlinevalve d
+        select d.ap_no,d.process_id,d.id, d.dev_no, d.unit, d.offline_reason, d.safa, d.disassembly, d.executor, d.confirmer, d.applicant, d.application_time, d.approver, d.approve_time, d.reset_confirm, d.leak_confirm, d.revoke_confirm, d.lock_confirm, d.lock_confirmer1, d.lock_confirmer2, d.info_confirmer, d.confirm_time, d.remarks, d.temporary_time, d.execution_time, d.status, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.dept_id, d.approve_status, d.lock_confirmer1_name, d.lock_confirmer2_name, d.info_confirmer_name, d.executor_name, d.confirmer_name, d.approver_name, d.applicant_name ,s.dept_name from t_apply_offlinevalve d
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  left join sys_dept s on s.dept_id = d.dept_id
     </sql>
 
@@ -227,6 +229,8 @@
             <if test="confirmerName != null">confirmer_name = #{confirmerName},</if>
             <if test="approverName != null">approver_name = #{approverName},</if>
             <if test="applicantName != null">applicant_name = #{applicantName},</if>
+            <if test="apNo != null">ap_no = #{apNo},</if>
+            <if test="processId != null">process_id = #{processId},</if>
         </trim>
         where id = #{id}
     </update>

+ 209 - 0
master/src/main/resources/processes/apply/offlinevalve.bpmn

@@ -0,0 +1,209 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/test">
+  <process id="offlinevalve" name="安全阀离线/切出申请流程" isExecutable="true">
+    <startEvent id="startevent1" name="Start"></startEvent>
+    <userTask id="confirmertask1" name="临时措施确认人1" activiti:assignee="#{confirmer}"></userTask>
+    <userTask id="executortask" name="临时措施执行人" activiti:assignee="#{executor}"></userTask>
+    <sequenceFlow id="flow1" name="通过" sourceRef="confirmertask1" targetRef="executortask">
+      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${condition == 1}]]></conditionExpression>
+    </sequenceFlow>
+    <userTask id="confirmertask2" name="临时措施确认人2" activiti:assignee="#{confirmer}"></userTask>
+    <sequenceFlow id="flow2" name="通过" sourceRef="executortask" targetRef="confirmertask2">
+      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${condition == 1}]]></conditionExpression>
+    </sequenceFlow>
+    <userTask id="approvertask" name="批准人" activiti:assignee="#{approver}"></userTask>
+    <sequenceFlow id="flow3" name="通过" sourceRef="confirmertask2" targetRef="approvertask">
+      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${condition == 1}]]></conditionExpression>
+    </sequenceFlow>
+    <exclusiveGateway id="isunlock" name="判断是否拆解"></exclusiveGateway>
+    <sequenceFlow id="flow4" name="通过" sourceRef="approvertask" targetRef="isunlock">
+      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${condition == 1}]]></conditionExpression>
+    </sequenceFlow>
+    <endEvent id="endevent1" name="End"></endEvent>
+    <userTask id="infoconfirmertask2" name="信息确认人" activiti:assignee="#{infoconfirmer}"></userTask>
+    <sequenceFlow id="flow7" name="NA" sourceRef="isunlock" targetRef="infoconfirmertask2">
+      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${is_unlock == 0}]]></conditionExpression>
+    </sequenceFlow>
+    <sequenceFlow id="flow8" name="通过" sourceRef="infoconfirmertask2" targetRef="endevent1">
+      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${condition == 1}]]></conditionExpression>
+    </sequenceFlow>
+    <userTask id="infoconfirmertask" name="信息确认人" activiti:assignee="#{infoconfirmer}"></userTask>
+    <sequenceFlow id="flow9" name="是/否" sourceRef="isunlock" targetRef="infoconfirmertask">
+      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${is_unlock == 1}]]></conditionExpression>
+    </sequenceFlow>
+    <userTask id="lockconfirmertask" name="确认人1" activiti:assignee="#{lockConfirmer}"></userTask>
+    <sequenceFlow id="flow10" name="通过" sourceRef="infoconfirmertask" targetRef="lockconfirmertask">
+      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${condition == 1}]]></conditionExpression>
+    </sequenceFlow>
+    <sequenceFlow id="flow12" name="通过" sourceRef="lockconfirmertask" targetRef="infoconfirmertask2">
+      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${condition == 1}]]></conditionExpression>
+    </sequenceFlow>
+    <userTask id="applytask" name="申请人提交申请" activiti:assignee="#{applyuser}"></userTask>
+    <sequenceFlow id="flow13" sourceRef="startevent1" targetRef="applytask"></sequenceFlow>
+    <sequenceFlow id="flow14" name="通过" sourceRef="applytask" targetRef="confirmertask1">
+      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${condition == 1}]]></conditionExpression>
+    </sequenceFlow>
+    <sequenceFlow id="flow15" name="驳回" sourceRef="confirmertask1" targetRef="applytask">
+      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${condition == 2}]]></conditionExpression>
+    </sequenceFlow>
+    <sequenceFlow id="flow16" name="驳回" sourceRef="approvertask" targetRef="confirmertask1">
+      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${condition == 2}]]></conditionExpression>
+    </sequenceFlow>
+    <endEvent id="endevent2" name="End"></endEvent>
+    <sequenceFlow id="flow17" name="拒绝" sourceRef="approvertask" targetRef="endevent2">
+      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${condition == 0}]]></conditionExpression>
+    </sequenceFlow>
+    <sequenceFlow id="flow18" name="拒绝" sourceRef="confirmertask1" targetRef="endevent2">
+      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${condition == 0}]]></conditionExpression>
+    </sequenceFlow>
+  </process>
+  <bpmndi:BPMNDiagram id="BPMNDiagram_offlinevalve">
+    <bpmndi:BPMNPlane bpmnElement="offlinevalve" id="BPMNPlane_offlinevalve">
+      <bpmndi:BPMNShape bpmnElement="startevent1" id="BPMNShape_startevent1">
+        <omgdc:Bounds height="35.0" width="35.0" x="400.0" y="21.0"></omgdc:Bounds>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape bpmnElement="confirmertask1" id="BPMNShape_confirmertask1">
+        <omgdc:Bounds height="55.0" width="105.0" x="365.0" y="170.0"></omgdc:Bounds>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape bpmnElement="executortask" id="BPMNShape_executortask">
+        <omgdc:Bounds height="55.0" width="105.0" x="365.0" y="260.0"></omgdc:Bounds>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape bpmnElement="confirmertask2" id="BPMNShape_confirmertask2">
+        <omgdc:Bounds height="55.0" width="105.0" x="365.0" y="350.0"></omgdc:Bounds>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape bpmnElement="approvertask" id="BPMNShape_approvertask">
+        <omgdc:Bounds height="55.0" width="105.0" x="365.0" y="440.0"></omgdc:Bounds>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape bpmnElement="isunlock" id="BPMNShape_isunlock">
+        <omgdc:Bounds height="40.0" width="40.0" x="397.0" y="520.0"></omgdc:Bounds>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape bpmnElement="endevent1" id="BPMNShape_endevent1">
+        <omgdc:Bounds height="35.0" width="35.0" x="399.0" y="710.0"></omgdc:Bounds>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape bpmnElement="infoconfirmertask2" id="BPMNShape_infoconfirmertask2">
+        <omgdc:Bounds height="55.0" width="105.0" x="364.0" y="600.0"></omgdc:Bounds>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape bpmnElement="infoconfirmertask" id="BPMNShape_infoconfirmertask">
+        <omgdc:Bounds height="55.0" width="105.0" x="250.0" y="513.0"></omgdc:Bounds>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape bpmnElement="lockconfirmertask" id="BPMNShape_lockconfirmertask">
+        <omgdc:Bounds height="55.0" width="105.0" x="110.0" y="513.0"></omgdc:Bounds>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape bpmnElement="applytask" id="BPMNShape_applytask">
+        <omgdc:Bounds height="55.0" width="105.0" x="365.0" y="80.0"></omgdc:Bounds>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape bpmnElement="endevent2" id="BPMNShape_endevent2">
+        <omgdc:Bounds height="35.0" width="35.0" x="170.0" y="330.0"></omgdc:Bounds>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNEdge bpmnElement="flow1" id="BPMNEdge_flow1">
+        <omgdi:waypoint x="417.0" y="225.0"></omgdi:waypoint>
+        <omgdi:waypoint x="417.0" y="260.0"></omgdi:waypoint>
+        <bpmndi:BPMNLabel>
+          <omgdc:Bounds height="14.0" width="100.0" x="417.0" y="225.0"></omgdc:Bounds>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge bpmnElement="flow2" id="BPMNEdge_flow2">
+        <omgdi:waypoint x="417.0" y="315.0"></omgdi:waypoint>
+        <omgdi:waypoint x="417.0" y="350.0"></omgdi:waypoint>
+        <bpmndi:BPMNLabel>
+          <omgdc:Bounds height="14.0" width="100.0" x="417.0" y="315.0"></omgdc:Bounds>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge bpmnElement="flow3" id="BPMNEdge_flow3">
+        <omgdi:waypoint x="417.0" y="405.0"></omgdi:waypoint>
+        <omgdi:waypoint x="417.0" y="440.0"></omgdi:waypoint>
+        <bpmndi:BPMNLabel>
+          <omgdc:Bounds height="14.0" width="100.0" x="417.0" y="405.0"></omgdc:Bounds>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge bpmnElement="flow4" id="BPMNEdge_flow4">
+        <omgdi:waypoint x="417.0" y="495.0"></omgdi:waypoint>
+        <omgdi:waypoint x="417.0" y="520.0"></omgdi:waypoint>
+        <bpmndi:BPMNLabel>
+          <omgdc:Bounds height="14.0" width="100.0" x="417.0" y="495.0"></omgdc:Bounds>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge bpmnElement="flow7" id="BPMNEdge_flow7">
+        <omgdi:waypoint x="417.0" y="560.0"></omgdi:waypoint>
+        <omgdi:waypoint x="416.0" y="600.0"></omgdi:waypoint>
+        <bpmndi:BPMNLabel>
+          <omgdc:Bounds height="14.0" width="100.0" x="421.0" y="568.0"></omgdc:Bounds>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge bpmnElement="flow8" id="BPMNEdge_flow8">
+        <omgdi:waypoint x="416.0" y="655.0"></omgdi:waypoint>
+        <omgdi:waypoint x="416.0" y="710.0"></omgdi:waypoint>
+        <bpmndi:BPMNLabel>
+          <omgdc:Bounds height="14.0" width="100.0" x="416.0" y="655.0"></omgdc:Bounds>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge bpmnElement="flow9" id="BPMNEdge_flow9">
+        <omgdi:waypoint x="397.0" y="540.0"></omgdi:waypoint>
+        <omgdi:waypoint x="355.0" y="540.0"></omgdi:waypoint>
+        <bpmndi:BPMNLabel>
+          <omgdc:Bounds height="14.0" width="100.0" x="368.0" y="547.0"></omgdc:Bounds>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge bpmnElement="flow10" id="BPMNEdge_flow10">
+        <omgdi:waypoint x="250.0" y="540.0"></omgdi:waypoint>
+        <omgdi:waypoint x="215.0" y="540.0"></omgdi:waypoint>
+        <bpmndi:BPMNLabel>
+          <omgdc:Bounds height="14.0" width="100.0" x="221.0" y="547.0"></omgdc:Bounds>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge bpmnElement="flow12" id="BPMNEdge_flow12">
+        <omgdi:waypoint x="162.0" y="568.0"></omgdi:waypoint>
+        <omgdi:waypoint x="161.0" y="627.0"></omgdi:waypoint>
+        <omgdi:waypoint x="364.0" y="627.0"></omgdi:waypoint>
+        <bpmndi:BPMNLabel>
+          <omgdc:Bounds height="14.0" width="100.0" x="162.0" y="568.0"></omgdc:Bounds>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge bpmnElement="flow13" id="BPMNEdge_flow13">
+        <omgdi:waypoint x="417.0" y="56.0"></omgdi:waypoint>
+        <omgdi:waypoint x="417.0" y="80.0"></omgdi:waypoint>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge bpmnElement="flow14" id="BPMNEdge_flow14">
+        <omgdi:waypoint x="417.0" y="135.0"></omgdi:waypoint>
+        <omgdi:waypoint x="417.0" y="170.0"></omgdi:waypoint>
+        <bpmndi:BPMNLabel>
+          <omgdc:Bounds height="14.0" width="100.0" x="417.0" y="135.0"></omgdc:Bounds>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge bpmnElement="flow15" id="BPMNEdge_flow15">
+        <omgdi:waypoint x="470.0" y="197.0"></omgdi:waypoint>
+        <omgdi:waypoint x="538.0" y="197.0"></omgdi:waypoint>
+        <omgdi:waypoint x="538.0" y="107.0"></omgdi:waypoint>
+        <omgdi:waypoint x="470.0" y="107.0"></omgdi:waypoint>
+        <bpmndi:BPMNLabel>
+          <omgdc:Bounds height="14.0" width="100.0" x="509.0" y="149.0"></omgdc:Bounds>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge bpmnElement="flow16" id="BPMNEdge_flow16">
+        <omgdi:waypoint x="470.0" y="467.0"></omgdi:waypoint>
+        <omgdi:waypoint x="537.0" y="467.0"></omgdi:waypoint>
+        <omgdi:waypoint x="537.0" y="197.0"></omgdi:waypoint>
+        <omgdi:waypoint x="470.0" y="197.0"></omgdi:waypoint>
+        <bpmndi:BPMNLabel>
+          <omgdc:Bounds height="14.0" width="100.0" x="509.0" y="316.0"></omgdc:Bounds>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge bpmnElement="flow17" id="BPMNEdge_flow17">
+        <omgdi:waypoint x="365.0" y="467.0"></omgdi:waypoint>
+        <omgdi:waypoint x="187.0" y="467.0"></omgdi:waypoint>
+        <omgdi:waypoint x="187.0" y="365.0"></omgdi:waypoint>
+        <bpmndi:BPMNLabel>
+          <omgdc:Bounds height="14.0" width="100.0" x="281.0" y="470.0"></omgdc:Bounds>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge bpmnElement="flow18" id="BPMNEdge_flow18">
+        <omgdi:waypoint x="365.0" y="197.0"></omgdi:waypoint>
+        <omgdi:waypoint x="187.0" y="197.0"></omgdi:waypoint>
+        <omgdi:waypoint x="187.0" y="330.0"></omgdi:waypoint>
+        <bpmndi:BPMNLabel>
+          <omgdc:Bounds height="14.0" width="100.0" x="266.0" y="200.0"></omgdc:Bounds>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+    </bpmndi:BPMNPlane>
+  </bpmndi:BPMNDiagram>
+</definitions>

+ 228 - 0
master/src/main/resources/processes/apply/safetychange.bpmn

@@ -0,0 +1,228 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/test">
+  <process id="myProcess" name="My process" isExecutable="true">
+    <startEvent id="startevent1" name="Start"></startEvent>
+    <userTask id="usertask1" name="安全评估人"></userTask>
+    <sequenceFlow id="flow1" name="通过" sourceRef="usertask8" targetRef="usertask1">
+      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${condition == 1}]]></conditionExpression>
+    </sequenceFlow>
+    <userTask id="usertask2" name="批准人"></userTask>
+    <userTask id="usertask3" name="措施执行人"></userTask>
+    <sequenceFlow id="flow3" name="通过" sourceRef="usertask2" targetRef="usertask3">
+      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${condition == 1}]]></conditionExpression>
+    </sequenceFlow>
+    <userTask id="usertask4" name="措施确认人"></userTask>
+    <sequenceFlow id="flow4" name="通过" sourceRef="usertask3" targetRef="usertask4">
+      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${condition == 1}]]></conditionExpression>
+    </sequenceFlow>
+    <userTask id="usertask5" name="变更执行人"></userTask>
+    <sequenceFlow id="flow5" name="通过" sourceRef="usertask4" targetRef="usertask5">
+      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${condition == 1}]]></conditionExpression>
+    </sequenceFlow>
+    <userTask id="usertask6" name="确认人1"></userTask>
+    <sequenceFlow id="flow6" name="通过" sourceRef="usertask9" targetRef="usertask6">
+      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${condition == 1}]]></conditionExpression>
+    </sequenceFlow>
+    <userTask id="usertask7" name="确认人2(安全评估人)"></userTask>
+    <sequenceFlow id="flow7" name="通过" sourceRef="usertask6" targetRef="usertask7"></sequenceFlow>
+    <userTask id="usertask8" name="申请人提交申请"></userTask>
+    <sequenceFlow id="flow8" sourceRef="startevent1" targetRef="usertask8"></sequenceFlow>
+    <sequenceFlow id="flow11" name="驳回" sourceRef="usertask1" targetRef="usertask8">
+      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${condition == 2}]]></conditionExpression>
+    </sequenceFlow>
+    <sequenceFlow id="flow12" name="通过" sourceRef="usertask1" targetRef="usertask2">
+      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${condition == 1}]]></conditionExpression>
+    </sequenceFlow>
+    <sequenceFlow id="flow13" name="驳回" sourceRef="usertask2" targetRef="usertask1">
+      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${condition == 2}]]></conditionExpression>
+    </sequenceFlow>
+    <endEvent id="endevent1" name="End"></endEvent>
+    <sequenceFlow id="flow14" name="通过" sourceRef="usertask7" targetRef="endevent1">
+      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${condition == 1}]]></conditionExpression>
+    </sequenceFlow>
+    <endEvent id="endevent2" name="End"></endEvent>
+    <sequenceFlow id="flow15" name="拒绝" sourceRef="usertask1" targetRef="endevent2">
+      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${condition == 0}]]></conditionExpression>
+    </sequenceFlow>
+    <sequenceFlow id="flow16" name="拒绝" sourceRef="usertask2" targetRef="endevent2">
+      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${condition == 0}]]></conditionExpression>
+    </sequenceFlow>
+    <userTask id="usertask9" name="安全评估人"></userTask>
+    <sequenceFlow id="flow17" name="通过" sourceRef="usertask5" targetRef="usertask9">
+      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${condition == 1}]]></conditionExpression>
+    </sequenceFlow>
+    <textAnnotation id="textannotation1">
+      <text>开始</text>
+    </textAnnotation>
+    <association id="association1" sourceRef="textannotation1" targetRef="startevent1"></association>
+    <textAnnotation id="textannotation2">
+      <text>结束</text>
+    </textAnnotation>
+    <association id="association2" sourceRef="textannotation2" targetRef="endevent2"></association>
+    <textAnnotation id="textannotation3">
+      <text>结束</text>
+    </textAnnotation>
+    <association id="association3" sourceRef="textannotation3" targetRef="endevent1"></association>
+  </process>
+  <bpmndi:BPMNDiagram id="BPMNDiagram_myProcess">
+    <bpmndi:BPMNPlane bpmnElement="myProcess" id="BPMNPlane_myProcess">
+      <bpmndi:BPMNShape bpmnElement="startevent1" id="BPMNShape_startevent1">
+        <omgdc:Bounds height="35.0" width="35.0" x="410.0" y="8.0"></omgdc:Bounds>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape bpmnElement="usertask1" id="BPMNShape_usertask1">
+        <omgdc:Bounds height="55.0" width="105.0" x="375.0" y="189.0"></omgdc:Bounds>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape bpmnElement="usertask2" id="BPMNShape_usertask2">
+        <omgdc:Bounds height="55.0" width="105.0" x="375.0" y="269.0"></omgdc:Bounds>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape bpmnElement="usertask3" id="BPMNShape_usertask3">
+        <omgdc:Bounds height="55.0" width="105.0" x="375.0" y="350.0"></omgdc:Bounds>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape bpmnElement="usertask4" id="BPMNShape_usertask4">
+        <omgdc:Bounds height="55.0" width="105.0" x="520.0" y="350.0"></omgdc:Bounds>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape bpmnElement="usertask5" id="BPMNShape_usertask5">
+        <omgdc:Bounds height="55.0" width="105.0" x="670.0" y="350.0"></omgdc:Bounds>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape bpmnElement="usertask6" id="BPMNShape_usertask6">
+        <omgdc:Bounds height="55.0" width="105.0" x="520.0" y="469.0"></omgdc:Bounds>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape bpmnElement="usertask7" id="BPMNShape_usertask7">
+        <omgdc:Bounds height="71.0" width="105.0" x="377.0" y="461.0"></omgdc:Bounds>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape bpmnElement="usertask8" id="BPMNShape_usertask8">
+        <omgdc:Bounds height="55.0" width="105.0" x="375.0" y="89.0"></omgdc:Bounds>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape bpmnElement="endevent1" id="BPMNShape_endevent1">
+        <omgdc:Bounds height="35.0" width="35.0" x="412.0" y="569.0"></omgdc:Bounds>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape bpmnElement="endevent2" id="BPMNShape_endevent2">
+        <omgdc:Bounds height="35.0" width="35.0" x="620.0" y="279.0"></omgdc:Bounds>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape bpmnElement="usertask9" id="BPMNShape_usertask9">
+        <omgdc:Bounds height="55.0" width="105.0" x="670.0" y="469.0"></omgdc:Bounds>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape bpmnElement="textannotation1" id="BPMNShape_textannotation1">
+        <omgdc:Bounds height="50.0" width="100.0" x="479.0" y="1.0"></omgdc:Bounds>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape bpmnElement="textannotation2" id="BPMNShape_textannotation2">
+        <omgdc:Bounds height="50.0" width="100.0" x="684.0" y="272.0"></omgdc:Bounds>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape bpmnElement="textannotation3" id="BPMNShape_textannotation3">
+        <omgdc:Bounds height="50.0" width="100.0" x="485.0" y="562.0"></omgdc:Bounds>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNEdge bpmnElement="flow1" id="BPMNEdge_flow1">
+        <omgdi:waypoint x="427.0" y="144.0"></omgdi:waypoint>
+        <omgdi:waypoint x="427.0" y="189.0"></omgdi:waypoint>
+        <bpmndi:BPMNLabel>
+          <omgdc:Bounds height="14.0" width="100.0" x="427.0" y="144.0"></omgdc:Bounds>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge bpmnElement="flow3" id="BPMNEdge_flow3">
+        <omgdi:waypoint x="427.0" y="324.0"></omgdi:waypoint>
+        <omgdi:waypoint x="427.0" y="350.0"></omgdi:waypoint>
+        <bpmndi:BPMNLabel>
+          <omgdc:Bounds height="14.0" width="100.0" x="427.0" y="324.0"></omgdc:Bounds>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge bpmnElement="flow4" id="BPMNEdge_flow4">
+        <omgdi:waypoint x="480.0" y="377.0"></omgdi:waypoint>
+        <omgdi:waypoint x="520.0" y="377.0"></omgdi:waypoint>
+        <bpmndi:BPMNLabel>
+          <omgdc:Bounds height="14.0" width="100.0" x="480.0" y="377.0"></omgdc:Bounds>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge bpmnElement="flow5" id="BPMNEdge_flow5">
+        <omgdi:waypoint x="625.0" y="377.0"></omgdi:waypoint>
+        <omgdi:waypoint x="670.0" y="377.0"></omgdi:waypoint>
+        <bpmndi:BPMNLabel>
+          <omgdc:Bounds height="14.0" width="100.0" x="625.0" y="377.0"></omgdc:Bounds>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge bpmnElement="flow6" id="BPMNEdge_flow6">
+        <omgdi:waypoint x="670.0" y="496.0"></omgdi:waypoint>
+        <omgdi:waypoint x="625.0" y="496.0"></omgdi:waypoint>
+        <bpmndi:BPMNLabel>
+          <omgdc:Bounds height="14.0" width="100.0" x="631.0" y="496.0"></omgdc:Bounds>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge bpmnElement="flow7" id="BPMNEdge_flow7">
+        <omgdi:waypoint x="520.0" y="496.0"></omgdi:waypoint>
+        <omgdi:waypoint x="482.0" y="496.0"></omgdi:waypoint>
+        <bpmndi:BPMNLabel>
+          <omgdc:Bounds height="14.0" width="100.0" x="491.0" y="496.0"></omgdc:Bounds>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge bpmnElement="flow8" id="BPMNEdge_flow8">
+        <omgdi:waypoint x="427.0" y="43.0"></omgdi:waypoint>
+        <omgdi:waypoint x="427.0" y="89.0"></omgdi:waypoint>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge bpmnElement="flow11" id="BPMNEdge_flow11">
+        <omgdi:waypoint x="480.0" y="216.0"></omgdi:waypoint>
+        <omgdi:waypoint x="545.0" y="216.0"></omgdi:waypoint>
+        <omgdi:waypoint x="544.0" y="116.0"></omgdi:waypoint>
+        <omgdi:waypoint x="480.0" y="116.0"></omgdi:waypoint>
+        <bpmndi:BPMNLabel>
+          <omgdc:Bounds height="14.0" width="100.0" x="554.0" y="158.0"></omgdc:Bounds>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge bpmnElement="flow12" id="BPMNEdge_flow12">
+        <omgdi:waypoint x="427.0" y="244.0"></omgdi:waypoint>
+        <omgdi:waypoint x="427.0" y="269.0"></omgdi:waypoint>
+        <bpmndi:BPMNLabel>
+          <omgdc:Bounds height="14.0" width="100.0" x="427.0" y="244.0"></omgdc:Bounds>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge bpmnElement="flow13" id="BPMNEdge_flow13">
+        <omgdi:waypoint x="375.0" y="296.0"></omgdi:waypoint>
+        <omgdi:waypoint x="287.0" y="296.0"></omgdi:waypoint>
+        <omgdi:waypoint x="287.0" y="216.0"></omgdi:waypoint>
+        <omgdi:waypoint x="375.0" y="216.0"></omgdi:waypoint>
+        <bpmndi:BPMNLabel>
+          <omgdc:Bounds height="14.0" width="100.0" x="291.0" y="296.0"></omgdc:Bounds>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge bpmnElement="flow14" id="BPMNEdge_flow14">
+        <omgdi:waypoint x="429.0" y="532.0"></omgdi:waypoint>
+        <omgdi:waypoint x="429.0" y="569.0"></omgdi:waypoint>
+        <bpmndi:BPMNLabel>
+          <omgdc:Bounds height="14.0" width="100.0" x="429.0" y="532.0"></omgdc:Bounds>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge bpmnElement="flow15" id="BPMNEdge_flow15">
+        <omgdi:waypoint x="480.0" y="216.0"></omgdi:waypoint>
+        <omgdi:waypoint x="637.0" y="216.0"></omgdi:waypoint>
+        <omgdi:waypoint x="637.0" y="279.0"></omgdi:waypoint>
+        <bpmndi:BPMNLabel>
+          <omgdc:Bounds height="14.0" width="100.0" x="568.0" y="217.0"></omgdc:Bounds>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge bpmnElement="flow16" id="BPMNEdge_flow16">
+        <omgdi:waypoint x="480.0" y="296.0"></omgdi:waypoint>
+        <omgdi:waypoint x="620.0" y="296.0"></omgdi:waypoint>
+        <bpmndi:BPMNLabel>
+          <omgdc:Bounds height="14.0" width="100.0" x="522.0" y="296.0"></omgdc:Bounds>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge bpmnElement="flow17" id="BPMNEdge_flow17">
+        <omgdi:waypoint x="722.0" y="405.0"></omgdi:waypoint>
+        <omgdi:waypoint x="722.0" y="469.0"></omgdi:waypoint>
+        <bpmndi:BPMNLabel>
+          <omgdc:Bounds height="14.0" width="100.0" x="722.0" y="405.0"></omgdc:Bounds>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge bpmnElement="association1" id="BPMNEdge_association1">
+        <omgdi:waypoint x="479.0" y="26.0"></omgdi:waypoint>
+        <omgdi:waypoint x="445.0" y="25.0"></omgdi:waypoint>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge bpmnElement="association2" id="BPMNEdge_association2">
+        <omgdi:waypoint x="684.0" y="297.0"></omgdi:waypoint>
+        <omgdi:waypoint x="655.0" y="296.0"></omgdi:waypoint>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge bpmnElement="association3" id="BPMNEdge_association3">
+        <omgdi:waypoint x="485.0" y="587.0"></omgdi:waypoint>
+        <omgdi:waypoint x="447.0" y="586.0"></omgdi:waypoint>
+      </bpmndi:BPMNEdge>
+    </bpmndi:BPMNPlane>
+  </bpmndi:BPMNDiagram>
+</definitions>

+ 11 - 7
ui/src/views/apply/offlinevalve/index.vue

@@ -155,7 +155,7 @@
             size="mini"
             type="text"
             icon="el-icon-document"
-            @click="todoMethod"
+            @click="openApproveDetail(scope.row)"
           >流转详情
           </el-button>
         </template>
@@ -334,6 +334,9 @@
         </el-descriptions-item>
       </el-descriptions>
     </el-dialog>
+
+
+    <offlinevalve-detail v-if="offlinevalveDetailVisible" ref="offlinevalveDetail"></offlinevalve-detail>
   </div>
 </template>
 
@@ -353,12 +356,14 @@ import Treeselect from "@riophae/vue-treeselect";
 import "@riophae/vue-treeselect/dist/vue-treeselect.css";
 import {allSafetyvavle} from "@/api/reliability/safetyvavle";
 import {listPostUser} from "@/api/system/user";
+import OfflinevalveDetail from "@/views/approve/approveDetail/offlinevalve-detail";
 
 export default {
   name: "Offlinevalve",
-  components: {Treeselect},
+  components: {OfflinevalveDetail, Treeselect},
   data() {
     return {
+      offlinevalveDetailVisible:false,
       executorList:[],
       confirmerList:[],
       status: {0: "未完成", 1: "已完成"},
@@ -510,11 +515,10 @@ export default {
     });
   },
   methods: {
-    todoMethod() {
-      this.$confirm('功能开发中......', "", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "info"
+    openApproveDetail(row) {
+      this.offlinevalveDetailVisible = true
+      this.$nextTick(() => {
+        this.$refs.offlinevalveDetail.init(row.id, '',row.processId,'')
       })
     },
     // 字典翻译

+ 314 - 0
ui/src/views/approve/approveDetail/offlinevalve-detail.vue

@@ -0,0 +1,314 @@
+<template>
+  <el-dialog
+    :title="!this.taskForm.taskId == '' ? $t('处理') : $t('详情')"
+    :close-on-click-modal="false"
+    :visible.sync="visible"
+    :append-to-body="true"
+    width="60%">
+    <el-table :data="devList" border>
+      <el-table-column label="安全阀位号" align="center" prop="devNo" :show-overflow-tooltip="true" width="125"
+                       fixed="left"/>
+      <el-table-column label="单元" align="center" prop="unit" :show-overflow-tooltip="true" width="85"
+                       fixed="left"/>
+      <el-table-column label="申请状态" align="center" prop="approveStatus" :show-overflow-tooltip="true" width="85"
+                       fixed="left" :formatter="approveStatusFormat"/>
+      <el-table-column label="状态" align="center" prop="status" :show-overflow-tooltip="true" width="90"
+                       fixed="left" :formatter="statusFormat"/>
+      <el-table-column label="离线原因" align="center" prop="offlineReason" :show-overflow-tooltip="true"
+                       width="185"/>
+      <el-table-column label="安全阀锁开是否拆解" align="center" prop="disassembly" :show-overflow-tooltip="true"
+                       width="185"/>
+      <el-table-column label="临时措施执行人" align="center" prop="executorName" :show-overflow-tooltip="true"
+                       width="130"/>
+      <el-table-column label="临时措施执行时间" align="center" prop="executionTime" width="140">
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.executionTime, '{y}-{m}-{d} {h}:{i}') }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="临时措施确认人" align="center" prop="confirmerName" :show-overflow-tooltip="true"
+                       width="130"/>
+      <el-table-column label="临时措施确认时间" align="center" prop="temporaryTime" width="140">
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.temporaryTime, '{y}-{m}-{d} {h}:{i}') }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="申请人" align="center" prop="applicantName" :show-overflow-tooltip="true" width="90"/>
+      <el-table-column label="申请时间" align="center" prop="applicationTime" width="140">
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.applicationTime, '{y}-{m}-{d} {h}:{i}') }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="批准人" align="center" prop="approverName" :show-overflow-tooltip="true" width="90"/>
+      <el-table-column label="批准时间" align="center" prop="approveTime" width="100">
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.approveTime, '{y}-{m}-{d} {h}:{i}') }}</span>
+        </template>
+      </el-table-column>
+      />
+      <el-table-column label="备注" align="center" prop="remarks" :show-overflow-tooltip="true" width="140"/>
+    </el-table>
+    <el-form ref="form" :model="form" label-position="left" :rules="rules" label-width="340px"
+             style="margin-top: 30px">
+      <div v-if="flag">
+        <div v-if="taskName=='临时措施确认人1'">
+          <el-form-item label="安全评估以及临时措施执行" prop="safa">
+            <el-input type="textarea" v-model="form.safa" placeholder="请输入安全评估以及临时措施执行"/>
+          </el-form-item>
+          <el-form-item label="安全阀锁开是否拆解" prop="disassembly">
+            <el-radio-group v-model="form.disassembly">
+              <el-radio label="是">是</el-radio>
+              <el-radio label="否">否</el-radio>
+              <el-radio label="NA">NA</el-radio>
+            </el-radio-group>
+          </el-form-item>
+        </div>
+        <div v-if="taskName=='信息确认人'">
+          <el-row>
+            <el-col span="12">
+              <el-form-item label="离线安全阀是否已经复位" prop="resetConfirm">
+                <el-radio-group v-model="form.resetConfirm">
+                  <el-radio label="是">是</el-radio>
+                  <el-radio label="否">否</el-radio>
+                </el-radio-group>
+              </el-form-item>
+            </el-col>
+            <el-col span="12">
+              <el-form-item label="离线安全阀复位后现场是否存在泄漏" prop="leakConfirm">
+                <el-radio-group v-model="form.leakConfirm">
+                  <el-radio label="是">是</el-radio>
+                  <el-radio label="否">否</el-radio>
+                </el-radio-group>
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <el-row>
+            <el-col span="12">
+              <el-form-item label="离线安全复位后,之前采取的安全措施是否已撤销" prop="revokeConfirm">
+                <el-radio-group v-model="form.revokeConfirm">
+                  <el-radio label="是">是</el-radio>
+                  <el-radio label="否">否</el-radio>
+                </el-radio-group>
+              </el-form-item>
+            </el-col>
+            <el-col span="12">
+              <el-form-item label="离线安全复位后,是否已经重新上锁" prop="lockConfirm">
+                <el-radio-group v-model="form.lockConfirm">
+                  <el-radio label="是">是</el-radio>
+                  <el-radio label="否">否</el-radio>
+                  <el-radio label="NA">NA</el-radio>
+                </el-radio-group>
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </div>
+      </div>
+    </el-form>
+    <span slot="footer" class="dialog-footer">
+      <el-button v-if="!this.taskForm.taskId == ''" type="warning"
+                 @click="dataFormSubmit(2)" :disabled="submitDisabled">{{ $t('驳回') }}</el-button>
+      <el-button v-if="!this.taskForm.taskId == ''" type="primary"
+                 @click="dataFormSubmit(1)" :disabled="submitDisabled">{{ $t('通过') }}</el-button>
+      <el-button v-if="!this.taskForm.taskId == ''" type="danger"
+                 @click="dataFormSubmit(0)" :disabled="submitDisabled">{{ $t('拒绝') }}</el-button>
+      <el-button @click="visible = false">{{ $t('返回') }}</el-button>
+    </span>
+    <div>
+      <span>{{ $t('流转详情') }}</span>
+      <el-table :data="historyList" border v-loading="historyLoading" style="width: 100%;">
+        <el-table-column prop="taskName" header-align="center" align="center"
+                         :label="$t('流程进度')"></el-table-column>
+        <el-table-column prop="userName" header-align="center" align="center" :label="$t('姓名')"></el-table-column>
+        <el-table-column prop="taskCreateTime" header-align="center" align="center"
+                         :label="$t('开始时间')"></el-table-column>
+        <el-table-column prop="taskEndTime" header-align="center" align="center"
+                         :label="$t('结束时间')"></el-table-column>
+        <el-table-column prop="comment" header-align="center" align="center"
+                         :label="$t('审批意见')"></el-table-column>
+      </el-table>
+    </div>
+  </el-dialog>
+</template>
+
+<script>
+import {getOfflinevalve} from "@/api/apply/offlinevalve";
+import {getHistorylist} from "@/api/ehs/approvedanger";
+
+export default {
+  name: "offlinevalve-detail",
+  data() {
+    return {
+      //流转列表
+      historyList: [],
+      historyLoading: true,
+      submitDisabled: false,
+      taskName: '',
+      visible: false,
+      approveStatusList: [],
+      statusList: [],
+      taskForm: {
+        comment: '',
+        taskId: '',
+        files: '',
+        govDate: '',
+        govFileList: []
+      },
+      devList: [],
+      dataForm: {
+        id: null,
+        devNo: null,
+        unit: null,
+        offlineReason: null,
+        safa: null,
+        disassembly: null,
+        executor: null,
+        confirmer: null,
+        applicant: null,
+        applicationTime: null,
+        approver: null,
+        approveTime: null,
+        resetConfirm: null,
+        leakConfirm: null,
+        revokeConfirm: null,
+        lockConfirm: null,
+        lockConfirmer1: null,
+        lockConfirmer2: null,
+        infoConfirmer: null,
+        confirmTime: null,
+        remarks: null,
+        temporaryTime: null,
+        executionTime: null,
+        status: 0,
+        delFlag: null,
+        createrCode: null,
+        createdate: null,
+        updaterCode: null,
+        updatedate: null,
+        deptId: null,
+        approveStatus: null,
+        lockConfirmer1Name: null,
+        lockConfirmer2Name: null,
+        infoConfirmerName: null,
+        executorName: null,
+        confirmerName: null,
+        approverName: null,
+        applicantName: null,
+        apNo: null,
+        processId: null
+      },
+      form: {},
+      rules: {
+        safa: [{required: true, message: "请输入安全评估以及临时措施执行", trigger: "blur"}],
+        lockConfirm: [{required: true, message: "请选择是/否/NA", trigger: "blur"}],
+        revokeConfirm: [{required: true, message: "请选择是/否", trigger: "blur"}],
+        leakConfirm: [{required: true, message: "请选择是/否", trigger: "blur"}],
+        resetConfirm: [{required: true, message: "请选择是/否", trigger: "blur"}],
+        disassembly: [{required: true, message: "请选择是/否/NA", trigger: "blur"}]
+      },
+      flag: false
+    }
+  },
+  methods: {
+    init(id, taskId, processId, taskName, flag) {
+      this.flag = flag;
+      this.submitDisabled = false;
+      this.reset();
+      this.devList = [];
+      this.visible = true;
+      this.taskName = taskName;
+      this.taskForm.taskId = taskId;
+      console.log(this.taskForm.taskId)
+      this.dataForm.id = id || 0;
+      this.form.id = id || 0;
+      this.dataForm.processId = processId;
+      getOfflinevalve(id).then(res => {
+        this.dataForm = res.data;
+        this.devList.push(this.dataForm);
+      });
+      this.getDicts("apply_status").then(response => {
+        this.statusList = response.data;
+      });
+      this.getDicts("apply_approve_status").then(response => {
+        this.approveStatusList = response.data;
+      });
+      getHistorylist({processId: this.dataForm.processId}).then(response => {
+        this.historyList = response.rows;
+        this.historyLoading = false
+      });
+    },
+    dataFormSubmit(val) {
+      this.$refs["form"].validate(valid => {
+        this.submitDisabled = true;
+      })
+    },
+    // 字典翻译
+    approveStatusFormat(row, column) {
+      let s = this.selectDictLabel(this.approveStatusList, row.approveStatus)
+      let type = '';
+      if (row.approveStatus === '2') {
+        type = 'success';
+      } else if (row.approveStatus === '1') {
+        type = 'warning';
+      } else if (row.approveStatus === '3') {
+        type = 'danger';
+      }
+      return <el-tag type={type}>{s}</el-tag>;
+    },
+    statusFormat(row, column) {
+      let s = this.selectDictLabel(this.statusList, row.status);
+      let type = '';
+      if (row.status === 1) {
+        type = 'success';
+      }
+      return <el-tag type={type}>{s}</el-tag>;
+    },
+    reset() {
+      this.form = {
+        id: null,
+        devNo: null,
+        unit: null,
+        offlineReason: null,
+        safa: null,
+        disassembly: null,
+        executor: null,
+        confirmer: null,
+        applicant: null,
+        applicationTime: null,
+        approver: null,
+        approveTime: null,
+        resetConfirm: null,
+        leakConfirm: null,
+        revokeConfirm: null,
+        lockConfirm: null,
+        lockConfirmer1: null,
+        lockConfirmer2: null,
+        infoConfirmer: null,
+        confirmTime: null,
+        remarks: null,
+        temporaryTime: null,
+        executionTime: null,
+        status: 0,
+        delFlag: null,
+        createrCode: null,
+        createdate: null,
+        updaterCode: null,
+        updatedate: null,
+        deptId: null,
+        approveStatus: "1",
+        lockConfirmer1Name: null,
+        lockConfirmer2Name: null,
+        infoConfirmerName: null,
+        executorName: null,
+        confirmerName: null,
+        approverName: null,
+        applicantName: null
+      };
+      this.resetForm("form");
+    },
+  }
+
+}
+</script>
+
+<style scoped>
+
+</style>

+ 9 - 1
ui/src/views/approve/myapprove/index.vue

@@ -54,6 +54,7 @@
     <intact-detail v-if="intactDetailVisible" ref="intactDetail" @refreshDataList="getList"></intact-detail>
     <kekao-detail v-if="kekaoDetailVisible" ref="kekaoDetail" @refreshDataList="getList"></kekao-detail>
     <invoice-detail v-if="invoiceDetailVisible" ref="invoiceDetail" @refreshDataList="getList"></invoice-detail>
+    <offlinevalve-detail v-if="offlinevalveDetailVisible" ref="offlinevalveDetail" @refreshDataList="getList"></offlinevalve-detail>
   </div>
 </template>
 
@@ -70,10 +71,11 @@
   import IntactDetail from '../approveDetail/intact-detail';
   import KekaoDetail from "@/views/approve/approveDetail/kekao-detail";
   import InvoiceDetail from "@/views/approve/approveDetail/invoice-detail";
+  import OfflinevalveDetail from "@/views/approve/approveDetail/offlinevalve-detail";
 
   export default {
     name: "Myapprove",
-    components: { Treeselect,ProcessImg,AddOrUpdate,SpecModify,SpecTrainingPlan,SpecMaintenance,IntactDetail,KekaoDetail,InvoiceDetail},
+    components: {OfflinevalveDetail, Treeselect,ProcessImg,AddOrUpdate,SpecModify,SpecTrainingPlan,SpecMaintenance,IntactDetail,KekaoDetail,InvoiceDetail},
     data() {
       return {
         // 遮罩层
@@ -86,6 +88,7 @@
         intactDetailVisible:false,
         kekaoDetailVisible:false,
         invoiceDetailVisible:false,
+        offlinevalveDetailVisible:false,
         // 选中数组
         ids: [],
         // 非单个禁用
@@ -214,6 +217,11 @@
             console.log(row.taskName)
             this.$refs.invoiceDetail.init(row.approveObject.id, row.taskId, row.processId, row.taskName)
           })
+        } else if (row.processName == "安全阀离线/切出申请流程") {
+          this.offlinevalveDetailVisible = true
+          this.$nextTick(() => {
+            this.$refs.offlinevalveDetail.init(row.approveObject.id, row.taskId, row.processId, row.taskName)
+          })
         }  else {
           this.approveInfo = row;
           this.infoTaskName = row.taskName;

+ 9 - 0
ui/src/views/approve/pending/index.vue

@@ -129,6 +129,7 @@
     <kekao-resolve v-if="kekaoResolveVisible" ref="kekaoResolveDeal" @refreshDataList="getList"></kekao-resolve>
     <spec-maintenance v-if="specMaintenanceVisible" ref="specMaintenance" @refreshDataList="getList"></spec-maintenance>
     <invoice-detail v-if="invoiceDetailVisible" ref="invoiceDetail" @refreshDataList="getList"></invoice-detail>
+    <offlinevalve-detail v-if="offlinevalveDetailVisible" ref="offlinevalveDetail" @refreshDataList="getList"></offlinevalve-detail>
   </div>
 </template>
 
@@ -147,10 +148,12 @@
   import SpecMaintenance from "@/views/approve/pending/specMaintenance-deal";
   import KekaoResolve from '../approveDetail/kekao-resolve';
   import InvoiceDetail from "@/views/approve/approveDetail/invoice-detail";
+  import OfflinevalveDetail from "@/views/approve/approveDetail/offlinevalve-detail";
 
   export default {
     name: "Pending",
     components: {
+      OfflinevalveDetail,
       Treeselect,
       AddOrUpdate,
       SpecModify,
@@ -176,6 +179,7 @@
         kekaoResolveVisible:false,
         specMaintenanceVisible: false,
         invoiceDetailVisible:false,
+        offlinevalveDetailVisible:false,
         // 选中数组
         ids: [],
         // 非单个禁用
@@ -394,6 +398,11 @@
             console.log(row.approveObj)
             this.$refs.invoiceDetail.init(row.approveObject.id, row.taskId, row.processId,row.taskName)
           })
+        } else if (row.processName == "安全阀离线/切出申请流程") {
+          this.offlinevalveDetailVisible = true
+          this.$nextTick(() => {
+            this.$refs.offlinevalveDetail.init(row.approveObject.id, row.taskId, row.processId, row.taskName,true)
+          })
         }else {
           this.approveInfo = row;
           this.infoTaskName = row.taskName;

+ 9 - 0
ui/src/views/approve/taskdone/index.vue

@@ -58,6 +58,7 @@
     <intact-detail v-if="intactDetailVisible" ref="intactDetail" @refreshDataList="getList"></intact-detail>
     <kekao-detail v-if="kekaoDetailVisible" ref="kekaoDetail" @refreshDataList="getList"></kekao-detail>
     <invoice-detail v-if="invoiceDetailVisible" ref="invoiceDetail" @refreshDataList="getList"></invoice-detail>
+    <offlinevalve-detail v-if="offlinevalveDetailVisible" ref="offlinevalveDetail" @refreshDataList="getList"></offlinevalve-detail>
   </div>
 </template>
 
@@ -75,9 +76,11 @@
   import IntactDetail from "@/views/approve/approveDetail/intact-detail";
   import KekaoDetail from "@/views/approve/approveDetail/kekao-detail";
   import InvoiceDetail from "@/views/approve/approveDetail/invoice-detail";
+  import OfflinevalveDetail from "@/views/approve/approveDetail/offlinevalve-detail";
   export default {
     name: "Taskdone",
     components: {
+      OfflinevalveDetail,
       Treeselect, AddOrUpdate,ProcessImg,SpecModify,SpecTrainingPlan,SpecMaintenance,IntactDetail,KekaoDetail,InvoiceDetail
     },
     data() {
@@ -92,6 +95,7 @@
         intactDetailVisible:false,
         kekaoDetailVisible:false,
         invoiceDetailVisible:false,
+        offlinevalveDetailVisible:false,
         // 选中数组
         ids: [],
         // 非单个禁用
@@ -228,6 +232,11 @@
             console.log(row.approveObj)
             this.$refs.invoiceDetail.init(row.approveObject.id, row.taskId, row.processId,row.taskName)
           })
+        } else if (row.processName == "安全阀离线/切出申请流程") {
+          this.offlinevalveDetailVisible = true
+          this.$nextTick(() => {
+            this.$refs.offlinevalveDetail.init(row.approveObject.id, row.taskId, row.processId, row.taskName)
+          })
         }else {
           this.approveInfo = row;
           this.infoTaskName = row.taskName;