Commit 4695d424 by 啦啦啦

提交新的请假流程代码

parent fc10f2ca
......@@ -16,6 +16,7 @@
<properties>
<java.version>1.8</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
......@@ -66,7 +67,19 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.6</version>
<configuration>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
</plugins>
</build>
</project>
......@@ -53,6 +53,7 @@ public class MiaoController {
map.put("title", form.getTitle());
map.put("content", form.getContent());
map.put("applicant", form.getApplicant());
map.put("days", form.getDays());
map.put("state", form.getState());
formsMap.add(map);
}
......@@ -83,6 +84,54 @@ public class MiaoController {
return "indexApprover";
}
//管理层的首页
@GetMapping( "/homeApproverzjl")
public String homeApproverzjl(ModelMap model){
List<VacationForm> forms = miaoService.formList();
List<HashMap<String, Object>> formsMap = new ArrayList<HashMap<String, Object>>();
for(VacationForm form : forms) {
//审核者只能看到待审核状态的请假单
if("管理层审核".equals(form.getState())) {
HashMap<String, Object> map = new HashMap<String, Object>();
map.put("id", form.getId());
map.put("title", form.getTitle());
map.put("content", form.getContent());
map.put("applicant", form.getApplicant());
map.put("state", form.getState());
formsMap.add(map);
}
}
model.addAttribute("forms",formsMap);
return "indexApproverzjl";
}
//人事的首页
@GetMapping( "/homeApproverHr")
public String homeApproverHr(ModelMap model){
List<VacationForm> forms = miaoService.formList();
List<HashMap<String, Object>> formsMap = new ArrayList<HashMap<String, Object>>();
for(VacationForm form : forms) {
//审核者只能看到待审核状态的请假单
if("通知人事".equals(form.getState())||"已结束".equals(form.getState())) {
HashMap<String, Object> map = new HashMap<String, Object>();
map.put("id", form.getId());
map.put("title", form.getTitle());
map.put("content", form.getContent());
map.put("applicant", form.getApplicant());
map.put("state", form.getState());
map.put("approver",form.getApprover());
formsMap.add(map);
}
}
model.addAttribute("forms",formsMap);
return "indexApproverHr";
}
//请假单页面
@GetMapping( "/form")
public String form(){
......@@ -139,9 +188,10 @@ public class MiaoController {
public ResultInfo writeForm(HttpServletRequest request){
ResultInfo result = new ResultInfo();
String title = request.getParameter("title");
String days = request.getParameter("days");
String content = request.getParameter("content");
String operator = request.getParameter("operator");
VacationForm form = miaoService.writeForm(title,content,operator);
VacationForm form = miaoService.writeForm(title,content,operator,days);
result.setCode(200);
result.setMsg("填写请假条成功");
result.setInfo(form);
......@@ -154,13 +204,31 @@ public class MiaoController {
public ResultInfo giveup(HttpServletRequest request){
ResultInfo result = new ResultInfo();
String formId = request.getParameter("formId");
String days = request.getParameter("days");
String operator = request.getParameter("operator");
miaoService.completeProcess(formId, operator, "giveup");
miaoService.completeProcess(days,formId, operator, "giveup");
result.setCode(200);
result.setMsg("放弃请假成功");
return result;
}
//申请未通过
@GetMapping( "/giveups")
@ResponseBody
public ResultInfo giveups(HttpServletRequest request){
ResultInfo result = new ResultInfo();
String formId = request.getParameter("formId");
String days = request.getParameter("days");
String operator = request.getParameter("operator");
miaoService.completeProcesss(days,formId, operator, "giveup");
result.setCode(200);
result.setMsg("放弃请假成功");
return result;
}
//申请者申请请假
@GetMapping( "/apply")
@ResponseBody
......@@ -168,7 +236,8 @@ public class MiaoController {
ResultInfo result = new ResultInfo();
String formId = request.getParameter("formId");
String operator = request.getParameter("operator");
miaoService.completeProcess(formId, operator, "apply");
String days = request.getParameter("days");
miaoService.completeProcess(days,formId, operator, "apply");
result.setCode(200);
result.setMsg("申请请假成功");
return result;
......
......@@ -24,6 +24,17 @@ public class VacationForm {
@Transient
private String state;
private Integer days;
public Integer getDays() {
return days;
}
public void setDays(Integer days) {
this.days = days;
}
public VacationForm(){
}
......
......@@ -9,15 +9,15 @@ import java.util.List;
public interface MiaoService {
public VacationForm writeForm(String title, String content, String applicant);
public VacationForm writeForm(String title, String content, String applicant,String days);
public boolean giveupVacation(String formId, String operator);
public boolean applyVacation(String formId, String operator);
public boolean applyVacation(String formId, String operator,String days);
public boolean approverVacation(String formId, String operator);
public void completeProcess(String formId, String operator, String input);
public void completeProcess(String days,String formId, String operator, String input);
public HashMap<String,String> getCurrentState(String formId);
......@@ -26,4 +26,6 @@ public interface MiaoService {
public User loginSuccess(String user);
public List historyState(String formId);
void completeProcesss(String days, String formId, String operator, String input);
}
......@@ -6,6 +6,7 @@ import com.bbd.bpm.domain.VacationForm;
import com.bbd.bpm.service.MiaoService;
import com.bbd.bpm.service.UserService;
import com.bbd.bpm.service.VacationFormService;
import io.swagger.models.auth.In;
import org.activiti.engine.HistoryService;
import org.activiti.engine.RuntimeService;
import org.activiti.engine.TaskService;
......@@ -16,10 +17,7 @@ import org.springframework.stereotype.Service;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
@Service("miaoService")
public class MiaoServiceImpl implements MiaoService {
......@@ -40,10 +38,11 @@ public class MiaoServiceImpl implements MiaoService {
//填写请假信息
@Override
public VacationForm writeForm(String title, String content, String applicant) {
public VacationForm writeForm(String title, String content, String applicant,String days) {
VacationForm form = new VacationForm();
String approver = "未知审批者";
form.setTitle(title);
form.setDays(Integer.valueOf(days));
form.setContent(content);
form.setApplicant(applicant);
form.setApprover(approver);
......@@ -52,20 +51,20 @@ public class MiaoServiceImpl implements MiaoService {
Map<String, Object> variables = new HashMap<String, Object>();
variables.put("employee", form.getApplicant());
//开始请假流程,使用formId作为流程的businessKey
runtimeService.startProcessInstanceByKey("myProcess", form.getId().toString(), variables);
runtimeService.startProcessInstanceByKey("myProcee", form.getId().toString(), variables);
return form;
}
//根据选择,申请或放弃请假
@Override
public void completeProcess(String formId, String operator, String input) {
public void completeProcess(String days,String formId, String operator, String input) {
//根据businessKey找到当前任务节点
Task task = taskService.createTaskQuery().processInstanceBusinessKey(formId).singleResult();
//设置输入参数,使流程自动流转到对应节点
taskService.setVariable(task.getId(), "input", input);
taskService.complete(task.getId());
if ("apply".equals(input)) {
applyVacation(formId, operator);
applyVacation(formId, operator,days);
} else {
giveupVacation(formId, operator);
}
......@@ -84,8 +83,7 @@ public class MiaoServiceImpl implements MiaoService {
return true;
}
@Override
public boolean applyVacation(String formId, String operator) {
public boolean applyVacation(String formId, String operator,String days) {
Task task = taskService.createTaskQuery().processInstanceBusinessKey(formId).singleResult();
Map<String, Object> variables = new HashMap<String, Object>();
List<User> users = userService.findAll();
......@@ -99,6 +97,8 @@ public class MiaoServiceImpl implements MiaoService {
managers = managers.substring(0, managers.length() - 1);
variables.put("employee", operator);
variables.put("managers", managers);
Integer day= Integer.valueOf(days);
variables.put("days",day);
taskService.claim(task.getId(), operator);
taskService.complete(task.getId(), variables);
return true;
......@@ -107,8 +107,22 @@ public class MiaoServiceImpl implements MiaoService {
@Override
public boolean approverVacation(String formId, String operator) {
Task task = taskService.createTaskQuery().processInstanceBusinessKey(formId).singleResult();
Map<String, Object> variables = new HashMap<String, Object>();
List<User> users = userService.findAll();
String managers = "";
//获取所有具有审核权限的用户
for (User user : users) {
if (user.getType().equals(3)) {
managers += user.getName() + ",";
}
}
managers = managers.substring(0, managers.length() - 1);
variables.put("employee", operator);
variables.put("managers", managers);
taskService.claim(task.getId(), operator);
taskService.complete(task.getId());
taskService.complete(task.getId(),variables);
//更新请假信息的审核人
try{
VacationForm form = vacationFormService.findById(Integer.parseInt(formId)).get();
......@@ -197,4 +211,26 @@ public class MiaoServiceImpl implements MiaoService {
}
return processList;
}
@Override
public void completeProcesss(String days, String formId, String operator, String input) {
//根据businessKey找到当前任务节点
Task task = taskService.createTaskQuery().processInstanceBusinessKey(formId).singleResult();
//设置输入参数,使流程自动流转到对应节点
taskService.setVariable(task.getId(), "input", input);
taskService.complete(task.getId());
giveupVacations(formId, operator);
}
//放弃请假
public boolean giveupVacations(String formId, String operator) {
Task task = taskService.createTaskQuery().processInstanceBusinessKey(formId).singleResult();
Map<String, Object> variables = new HashMap<String, Object>();
VacationForm vacationForm = vacationFormService.getOne(Integer.valueOf(formId));
variables.put("employee", vacationForm.getApplicant());
variables.put("managers", operator);
//认领任务
taskService.claim(task.getId(), vacationForm.getApplicant());
return true;
}
}
#端口
#�˿�
server.port=8081
spring.datasource.url=jdbc:mysql://localhost:3306/test?characterEncoding=UTF-8&serverTimezone=Asia/Shanghai
spring.datasource.url=jdbc:mysql://localhost:3306/activititest?characterEncoding=UTF-8&serverTimezone=Asia/Shanghai
spring.datasource.username=root
spring.datasource.password=root
......@@ -11,32 +11,32 @@ spring.datasource.connectionProperties=druid.stat.mergeSql=true;druid.stat.slowS
spring.datasource.driverClassName=com.mysql.jdbc.Driver
##Druid##
#spring.datasource.type=com.alibaba.druid.pool.DruidDataSource
#连接池启动时创建的连接数量的初始值
#���ӳ�����ʱ���������������ij�ʼֵ
spring.datasource.initialSize=5
#最小空闲值.当空闲的连接数少于阀值时,连接池就会预申请去一些连接,以免洪峰来时来不及申请
#��С����ֵ.�����е����������ڷ�ֵʱ�����ӳؾͻ�Ԥ����ȥһЩ���ӣ���������ʱ����������
spring.datasource.minIdle=5
#连接池的最大值,同一时间可以从池分配的最多连接数量,0时无限制
#���ӳص����ֵ��ͬһʱ����Դӳط�����������������0ʱ������
spring.datasource.maxActive=100
#最大建立连接等待时间。单位为 ms,如果超过此时间将接到异常。设为-1表示无限制
#��������ӵȴ�ʱ�䡣��λΪ ms�����������ʱ�佫�ӵ��쳣����Ϊ-1��ʾ������
spring.datasource.maxWait=60000
#1) Destroy线程会检测连接的间隔时间2) testWhileIdle的判断依据,详细看testWhileIdle属性的说明
#1) Destroy�̻߳������ӵļ��ʱ��2) testWhileIdle���ж����ݣ���ϸ��testWhileIdle���Ե�˵��
spring.datasource.timeBetweenEvictionRunsMillis=60000
#配置一个连接在池中最小生存的时间,单位是毫秒
#����һ�������ڳ�����С�����ʱ�䣬��λ�Ǻ���
spring.datasource.minEvictableIdleTimeMillis=300000
#用来检测连接是否有效的sql,要求是一个查询语句
#������������Ƿ���Ч��sql��Ҫ����һ����ѯ���
spring.datasource.validationQuery=SELECT 1
#建议配置为true,不影响性能,并且保证安全性。申请连接的时候检测,如果空闲时间大于timeBetweenEvictionRunsMillis,执行validationQuery检测连接是否有效
#��������Ϊtrue����Ӱ�����ܣ����ұ�֤��ȫ�ԡ��������ӵ�ʱ���⣬�������ʱ�����timeBetweenEvictionRunsMillis��ִ��validationQuery��������Ƿ���Ч
spring.datasource.testWhileIdle=true
#申请连接时执行validationQuery检测连接是否有效,配置true会降低性能
#��������ʱִ��validationQuery��������Ƿ���Ч������true�ή������
spring.datasource.testOnBorrow=false
#归还连接时执行validationQuery检测连接是否有效,配置true会降低性能
#�黹����ʱִ��validationQuery��������Ƿ���Ч������true�ή������
spring.datasource.testOnReturn=false
#是否缓存preparedStatement,也就是PSCache。PSCache对支持游标的数据库性能提升巨大,比如说oracle。在mysql5.5以下的版本中没有PSCache功能,建议关闭掉。
#�Ƿ񻺴�preparedStatement��Ҳ����PSCache��PSCache��֧���α�����ݿ����������޴󣬱���˵oracle����mysql5.5���µİ汾��û��PSCache���ܣ�����رյ���
spring.datasource.poolPreparedStatements=true
#指定每个连接上PSCache的大
��ÿ��������PSCache�Ĵ�С
spring.datasource.maxPoolPreparedStatementPerConnectionSize=20
#属性类型是字符串,通过别名的方式配置扩展插件,
#常用的插件有:监控统计用的filter:stat日志用的filter:log4j防御sql注入的filter:wall
#�����������ַ�����ͨ�������ķ�ʽ������չ�����
#���õIJ���У����ͳ���õ�filter:stat��־�õ�filter:log4j����sqlע���filter:wall
spring.datasource.filters=stat,wall,log4j
spring.datasource.useGlobalDataSourceStat=true
###############################
......
<?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.processes.org/test">
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 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" xmlns:xsd="http://www.w3.org/2001/XMLSchema" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.processes.org/test">
<process id="myProcess" name="My process" isExecutable="true">
<startEvent id="start" name="Start"></startEvent>
<userTask id="usertask1" name="提出请假申请" activiti:assignee="${employee}"></userTask>
......@@ -7,7 +7,6 @@
<userTask id="usertask2" name="领导审核" activiti:candidateUsers="${managers}"></userTask>
<sequenceFlow id="flow4" sourceRef="usertask1" targetRef="usertask2"></sequenceFlow>
<endEvent id="endevent1" name="End"></endEvent>
<sequenceFlow id="flow5" sourceRef="usertask2" targetRef="endevent1"></sequenceFlow>
<userTask id="usertask3" name="填写请假单" activiti:assignee="${employee}"></userTask>
<userTask id="usertask4" name="放弃请假"></userTask>
<sequenceFlow id="flow6" name="想了想还是不请了" sourceRef="exclusivegateway1" targetRef="usertask4">
......@@ -19,20 +18,28 @@
</sequenceFlow>
<exclusiveGateway id="exclusivegateway1" name="Exclusive Gateway"></exclusiveGateway>
<sequenceFlow id="flow2" sourceRef="usertask3" targetRef="exclusivegateway1"></sequenceFlow>
<exclusiveGateway id="exclusivegateway2" name="Exclusive Gateway"></exclusiveGateway>
<sequenceFlow id="flow8" sourceRef="usertask2" targetRef="exclusivegateway2"></sequenceFlow>
<sequenceFlow id="flow9" name="审核通过" sourceRef="exclusivegateway2" targetRef="endevent1">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${input=='apply'}]]></conditionExpression>
</sequenceFlow>
<sequenceFlow id="flow10" name="审核未通过" sourceRef="exclusivegateway2" targetRef="usertask3">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${input=='giveup'}]]></conditionExpression>
</sequenceFlow>
</process>
<bpmndi:BPMNDiagram id="BPMNDiagram_myProcess">
<bpmndi:BPMNPlane bpmnElement="myProcess" id="BPMNPlane_myProcess">
<bpmndi:BPMNShape bpmnElement="start" id="BPMNShape_start">
<omgdc:Bounds height="35.0" width="35.0" x="10.0" y="124.0"></omgdc:Bounds>
<omgdc:Bounds height="35.0" width="35.0" x="0.0" y="124.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="usertask1" id="BPMNShape_usertask1">
<omgdc:Bounds height="55.0" width="105.0" x="340.0" y="20.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="usertask2" id="BPMNShape_usertask2">
<omgdc:Bounds height="55.0" width="105.0" x="492.0" y="20.0"></omgdc:Bounds>
<omgdc:Bounds height="55.0" width="105.0" x="502.0" y="22.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="endevent1" id="BPMNShape_endevent1">
<omgdc:Bounds height="35.0" width="35.0" x="527.0" y="240.0"></omgdc:Bounds>
<omgdc:Bounds height="35.0" width="35.0" x="537.0" y="240.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="usertask3" id="BPMNShape_usertask3">
<omgdc:Bounds height="55.0" width="105.0" x="110.0" y="114.0"></omgdc:Bounds>
......@@ -43,43 +50,64 @@
<bpmndi:BPMNShape bpmnElement="exclusivegateway1" id="BPMNShape_exclusivegateway1">
<omgdc:Bounds height="40.0" width="40.0" x="250.0" y="121.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="exclusivegateway2" id="BPMNShape_exclusivegateway2">
<omgdc:Bounds height="40.0" width="40.0" x="535.0" y="140.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="flow1" id="BPMNEdge_flow1">
<omgdi:waypoint x="45.0" y="141.0"></omgdi:waypoint>
<omgdi:waypoint x="35.0" y="141.0"></omgdi:waypoint>
<omgdi:waypoint x="110.0" y="141.0"></omgdi:waypoint>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="14.0" width="36.0" x="45.0" y="141.0"></omgdc:Bounds>
<omgdc:Bounds height="16.0" width="48.0" x="35.0" y="141.0"></omgdc:Bounds>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow4" id="BPMNEdge_flow4">
<omgdi:waypoint x="445.0" y="47.0"></omgdi:waypoint>
<omgdi:waypoint x="492.0" y="47.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow5" id="BPMNEdge_flow5">
<omgdi:waypoint x="544.0" y="75.0"></omgdi:waypoint>
<omgdi:waypoint x="544.0" y="240.0"></omgdi:waypoint>
<omgdi:waypoint x="502.0" y="49.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow6" id="BPMNEdge_flow6">
<omgdi:waypoint x="270.0" y="161.0"></omgdi:waypoint>
<omgdi:waypoint x="392.0" y="230.0"></omgdi:waypoint>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="14.0" width="96.0" x="270.0" y="161.0"></omgdc:Bounds>
<omgdc:Bounds height="48.0" width="96.0" x="270.0" y="161.0"></omgdc:Bounds>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow7" id="BPMNEdge_flow7">
<omgdi:waypoint x="445.0" y="257.0"></omgdi:waypoint>
<omgdi:waypoint x="527.0" y="257.0"></omgdi:waypoint>
<omgdi:waypoint x="537.0" y="257.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow3" id="BPMNEdge_flow3">
<omgdi:waypoint x="270.0" y="121.0"></omgdi:waypoint>
<omgdi:waypoint x="392.0" y="75.0"></omgdi:waypoint>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="14.0" width="96.0" x="270.0" y="121.0"></omgdc:Bounds>
<omgdc:Bounds height="48.0" width="96.0" x="270.0" y="121.0"></omgdc:Bounds>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow2" id="BPMNEdge_flow2">
<omgdi:waypoint x="215.0" y="141.0"></omgdi:waypoint>
<omgdi:waypoint x="250.0" y="141.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow8" id="BPMNEdge_flow8">
<omgdi:waypoint x="554.0" y="77.0"></omgdi:waypoint>
<omgdi:waypoint x="555.0" y="140.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow9" id="BPMNEdge_flow9">
<omgdi:waypoint x="555.0" y="180.0"></omgdi:waypoint>
<omgdi:waypoint x="554.0" y="240.0"></omgdi:waypoint>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="16.0" width="64.0" x="565.0" y="180.0"></omgdc:Bounds>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow10" id="BPMNEdge_flow10">
<omgdi:waypoint x="575.0" y="160.0"></omgdi:waypoint>
<omgdi:waypoint x="676.0" y="160.0"></omgdi:waypoint>
<omgdi:waypoint x="676.0" y="351.0"></omgdi:waypoint>
<omgdi:waypoint x="365.0" y="351.0"></omgdi:waypoint>
<omgdi:waypoint x="162.0" y="351.0"></omgdi:waypoint>
<omgdi:waypoint x="162.0" y="169.0"></omgdi:waypoint>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="16.0" width="80.0" x="679.0" y="300.0"></omgdc:Bounds>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</definitions>
\ No newline at end of file
<?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: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" xmlns:xsd="http://www.w3.org/2001/XMLSchema" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.processes.org/test">
<process id="myProcesss" name="My process" isExecutable="true">
<startEvent id="start" name="Start"></startEvent>
<userTask id="usertask1" name="提出请假申请" activiti:assignee="${employee}"></userTask>
<sequenceFlow id="flow1" name="想请假" sourceRef="start" targetRef="usertask3"></sequenceFlow>
<userTask id="usertask2" name="领导审核" activiti:candidateUsers="${managers}"></userTask>
<endEvent id="endevent1" name="End"></endEvent>
<userTask id="usertask3" name="填写请假单" activiti:assignee="${employee}"></userTask>
<userTask id="usertask4" name="放弃请假"></userTask>
<sequenceFlow id="flow6" name="想了想还是不请了" sourceRef="exclusivegateway1" targetRef="usertask4">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${input=='giveup'}]]></conditionExpression>
</sequenceFlow>
<sequenceFlow id="flow7" sourceRef="usertask4" targetRef="endevent1"></sequenceFlow>
<sequenceFlow id="flow3" name="下定决心准备请假" sourceRef="exclusivegateway1" targetRef="usertask1">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${input=='apply'}]]></conditionExpression>
</sequenceFlow>
<exclusiveGateway id="exclusivegateway1" name="Exclusive Gateway"></exclusiveGateway>
<sequenceFlow id="flow2" sourceRef="usertask3" targetRef="exclusivegateway1"></sequenceFlow>
<exclusiveGateway id="exclusivegateway2" name="Exclusive Gateway"></exclusiveGateway>
<sequenceFlow id="flow8" sourceRef="usertask2" targetRef="exclusivegateway2"></sequenceFlow>
<sequenceFlow id="flow9" name="审核通过" sourceRef="exclusivegateway2" targetRef="endevent1">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${input=='apply'}]]></conditionExpression>
</sequenceFlow>
<sequenceFlow id="flow10" name="审核未通过" sourceRef="exclusivegateway2" targetRef="usertask3">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${input=='giveup'}]]></conditionExpression>
</sequenceFlow>
<exclusiveGateway id="exclusivegateway4" name="Exclusive Gateway"></exclusiveGateway>
<sequenceFlow id="flow4" sourceRef="usertask1" targetRef="exclusivegateway4"></sequenceFlow>
<sequenceFlow id="flow5" sourceRef="exclusivegateway4" targetRef="usertask2">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${days>10}]]></conditionExpression>
</sequenceFlow>
<sequenceFlow id="flow11" sourceRef="exclusivegateway4" targetRef="endevent1">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${days<10}]]></conditionExpression>
</sequenceFlow>
</process>
<bpmndi:BPMNDiagram id="BPMNDiagram_myProcesss">
<bpmndi:BPMNPlane bpmnElement="myProcesss" id="BPMNPlane_myProcesss">
<bpmndi:BPMNShape bpmnElement="start" id="BPMNShape_start">
<omgdc:Bounds height="35.0" width="35.0" x="0.0" y="124.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="usertask1" id="BPMNShape_usertask1">
<omgdc:Bounds height="55.0" width="105.0" x="340.0" y="20.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="usertask2" id="BPMNShape_usertask2">
<omgdc:Bounds height="55.0" width="105.0" x="655.0" y="20.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="endevent1" id="BPMNShape_endevent1">
<omgdc:Bounds height="35.0" width="35.0" x="537.0" y="240.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="usertask3" id="BPMNShape_usertask3">
<omgdc:Bounds height="55.0" width="105.0" x="110.0" y="114.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="usertask4" id="BPMNShape_usertask4">
<omgdc:Bounds height="55.0" width="105.0" x="340.0" y="230.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="exclusivegateway1" id="BPMNShape_exclusivegateway1">
<omgdc:Bounds height="40.0" width="40.0" x="250.0" y="121.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="exclusivegateway2" id="BPMNShape_exclusivegateway2">
<omgdc:Bounds height="40.0" width="40.0" x="535.0" y="140.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="exclusivegateway4" id="BPMNShape_exclusivegateway4">
<omgdc:Bounds height="40.0" width="40.0" x="490.0" y="28.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="flow1" id="BPMNEdge_flow1">
<omgdi:waypoint x="35.0" y="141.0"></omgdi:waypoint>
<omgdi:waypoint x="110.0" y="141.0"></omgdi:waypoint>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="16.0" width="48.0" x="35.0" y="141.0"></omgdc:Bounds>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow6" id="BPMNEdge_flow6">
<omgdi:waypoint x="270.0" y="161.0"></omgdi:waypoint>
<omgdi:waypoint x="392.0" y="230.0"></omgdi:waypoint>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="48.0" width="96.0" x="270.0" y="161.0"></omgdc:Bounds>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow7" id="BPMNEdge_flow7">
<omgdi:waypoint x="445.0" y="257.0"></omgdi:waypoint>
<omgdi:waypoint x="537.0" y="257.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow3" id="BPMNEdge_flow3">
<omgdi:waypoint x="270.0" y="121.0"></omgdi:waypoint>
<omgdi:waypoint x="392.0" y="75.0"></omgdi:waypoint>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="48.0" width="96.0" x="270.0" y="121.0"></omgdc:Bounds>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow2" id="BPMNEdge_flow2">
<omgdi:waypoint x="215.0" y="141.0"></omgdi:waypoint>
<omgdi:waypoint x="250.0" y="141.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow8" id="BPMNEdge_flow8">
<omgdi:waypoint x="707.0" y="75.0"></omgdi:waypoint>
<omgdi:waypoint x="555.0" y="140.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow9" id="BPMNEdge_flow9">
<omgdi:waypoint x="555.0" y="180.0"></omgdi:waypoint>
<omgdi:waypoint x="554.0" y="240.0"></omgdi:waypoint>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="16.0" width="64.0" x="565.0" y="180.0"></omgdc:Bounds>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow10" id="BPMNEdge_flow10">
<omgdi:waypoint x="575.0" y="160.0"></omgdi:waypoint>
<omgdi:waypoint x="676.0" y="160.0"></omgdi:waypoint>
<omgdi:waypoint x="676.0" y="351.0"></omgdi:waypoint>
<omgdi:waypoint x="365.0" y="351.0"></omgdi:waypoint>
<omgdi:waypoint x="162.0" y="351.0"></omgdi:waypoint>
<omgdi:waypoint x="162.0" y="169.0"></omgdi:waypoint>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="16.0" width="80.0" x="679.0" y="300.0"></omgdc:Bounds>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow4" id="BPMNEdge_flow4">
<omgdi:waypoint x="445.0" y="47.0"></omgdi:waypoint>
<omgdi:waypoint x="490.0" y="48.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow5" id="BPMNEdge_flow5">
<omgdi:waypoint x="530.0" y="48.0"></omgdi:waypoint>
<omgdi:waypoint x="655.0" y="47.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow11" id="BPMNEdge_flow11">
<omgdi:waypoint x="510.0" y="68.0"></omgdi:waypoint>
<omgdi:waypoint x="510.0" y="257.0"></omgdi:waypoint>
<omgdi:waypoint x="537.0" y="257.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</definitions>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" 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" xmlns:tns="http://www.processes.org/test" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" expressionLanguage="http://www.w3.org/1999/XPath" id="m1548745879356" name="" targetNamespace="http://www.processes.org/test" typeLanguage="http://www.w3.org/2001/XMLSchema">
<process id="myProceeee" isClosed="false" isExecutable="true" name="My process" processType="None">
<startEvent id="start" name="Start"/>
<userTask activiti:assignee="${employee}" activiti:exclusive="true" id="usertask1" name="提出请假申请"/>
<sequenceFlow id="flow1" name="想请假" sourceRef="start" targetRef="usertask3"/>
<userTask activiti:candidateUsers="${managers}" activiti:exclusive="true" id="usertask2" name="领导审核"/>
<endEvent id="endevent1" name="End"/>
<userTask activiti:assignee="${employee}" activiti:exclusive="true" id="usertask3" name="填写请假单"/>
<userTask activiti:exclusive="true" id="usertask4" name="放弃请假"/>
<sequenceFlow id="flow6" name="想了想还是不请了" sourceRef="exclusivegateway1" targetRef="usertask4">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${input=='giveup'}]]></conditionExpression>
</sequenceFlow>
<sequenceFlow id="flow7" sourceRef="usertask4" targetRef="endevent1"/>
<sequenceFlow id="flow3" name="下定决心准备请假" sourceRef="exclusivegateway1" targetRef="usertask1">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${input=='apply'}]]></conditionExpression>
</sequenceFlow>
<exclusiveGateway gatewayDirection="Unspecified" id="exclusivegateway1" name="Exclusive Gateway"/>
<sequenceFlow id="flow2" sourceRef="usertask3" targetRef="exclusivegateway1"/>
<exclusiveGateway gatewayDirection="Unspecified" id="exclusivegateway2" name="Exclusive Gateway"/>
<sequenceFlow id="flow8" sourceRef="usertask2" targetRef="exclusivegateway2"/>
<sequenceFlow id="flow9" name="审核通过" sourceRef="exclusivegateway2" targetRef="endevent1">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${input=='apply'}]]></conditionExpression>
</sequenceFlow>
<sequenceFlow id="flow10" name="审核未通过" sourceRef="exclusivegateway2" targetRef="usertask3">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${input=='giveup'}]]></conditionExpression>
</sequenceFlow>
<exclusiveGateway gatewayDirection="Unspecified" id="exclusivegateway4" name="Exclusive Gateway"/>
<sequenceFlow id="flow4" sourceRef="usertask1" targetRef="exclusivegateway4"/>
<sequenceFlow id="flow5" sourceRef="exclusivegateway4" targetRef="usertask2">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${days<10 && days>=3}]]></conditionExpression>
</sequenceFlow>
<userTask activiti:exclusive="true" id="usertask5" name="领导审核1"/>
<sequenceFlow id="flow11" sourceRef="exclusivegateway4" targetRef="usertask5">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${days<3}]]></conditionExpression>
</sequenceFlow>
<userTask activiti:exclusive="true" id="usertask6" name="领导审核2"/>
<sequenceFlow id="flow13" sourceRef="exclusivegateway4" targetRef="usertask6">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${days>10}]]></conditionExpression>
</sequenceFlow>
<sequenceFlow id="flow12" sourceRef="usertask5" targetRef="exclusivegateway2"/>
<sequenceFlow id="flow14" sourceRef="usertask6" targetRef="exclusivegateway2"/>
</process>
<bpmndi:BPMNDiagram documentation="background=#FFFFFF;count=1;horizontalcount=1;orientation=0;width=842.4;height=1195.2;imageableWidth=832.4;imageableHeight=1185.2;imageableX=5.0;imageableY=5.0" id="Diagram-_1" name="New Diagram">
<bpmndi:BPMNPlane bpmnElement="myProceeee">
<bpmndi:BPMNShape bpmnElement="start" id="Shape-start">
<omgdc:Bounds height="32.0" width="32.0" x="0.0" y="124.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="32.0" width="32.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="usertask1" id="Shape-usertask1">
<omgdc:Bounds height="55.0" width="105.0" x="380.0" y="114.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="55.0" width="105.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="usertask2" id="Shape-usertask2">
<omgdc:Bounds height="55.0" width="105.0" x="860.0" y="121.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="55.0" width="105.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="endevent1" id="Shape-endevent1">
<omgdc:Bounds height="32.0" width="32.0" x="920.0" y="410.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="32.0" width="32.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="usertask3" id="Shape-usertask3">
<omgdc:Bounds height="55.0" width="105.0" x="110.0" y="114.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="55.0" width="105.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="usertask4" id="Shape-usertask4">
<omgdc:Bounds height="55.0" width="105.0" x="330.0" y="400.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="55.0" width="105.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="exclusivegateway1" id="Shape-exclusivegateway1" isMarkerVisible="false">
<omgdc:Bounds height="32.0" width="32.0" x="250.0" y="121.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="32.0" width="32.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="exclusivegateway2" id="Shape-exclusivegateway2" isMarkerVisible="false">
<omgdc:Bounds height="32.0" width="32.0" x="1120.0" y="220.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="32.0" width="32.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="exclusivegateway4" id="Shape-exclusivegateway4" isMarkerVisible="false">
<omgdc:Bounds height="32.0" width="32.0" x="661.0" y="128.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="32.0" width="32.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="usertask5" id="Shape-usertask5">
<omgdc:Bounds height="55.0" width="105.0" x="860.0" y="40.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="55.0" width="105.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="usertask6" id="Shape-usertask6">
<omgdc:Bounds height="55.0" width="105.0" x="860.0" y="204.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="55.0" width="105.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="flow1" id="BPMNEdge_flow1" sourceElement="start" targetElement="usertask3">
<omgdi:waypoint x="32.0" y="140.0"/>
<omgdi:waypoint x="110.0" y="141.5"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="16.0" width="48.0" x="35.0" y="141.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow2" id="BPMNEdge_flow2" sourceElement="usertask3" targetElement="exclusivegateway1">
<omgdi:waypoint x="215.0" y="141.5"/>
<omgdi:waypoint x="250.0" y="137.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="-1.0" width="-1.0" x="-1.0" y="-1.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow3" id="BPMNEdge_flow3" sourceElement="exclusivegateway1" targetElement="usertask1">
<omgdi:waypoint x="282.0" y="137.0"/>
<omgdi:waypoint x="380.0" y="141.5"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="48.0" width="96.0" x="290.0" y="141.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow4" id="BPMNEdge_flow4" sourceElement="usertask1" targetElement="exclusivegateway4">
<omgdi:waypoint x="485.0" y="141.5"/>
<omgdi:waypoint x="661.0" y="144.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="-1.0" width="-1.0" x="-1.0" y="-1.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow5" id="BPMNEdge_flow5" sourceElement="exclusivegateway4" targetElement="usertask2">
<omgdi:waypoint x="693.0" y="144.0"/>
<omgdi:waypoint x="860.0" y="148.5"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="-1.0" width="-1.0" x="-1.0" y="-1.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow6" id="BPMNEdge_flow6" sourceElement="exclusivegateway1" targetElement="usertask4">
<omgdi:waypoint x="282.0" y="137.0"/>
<omgdi:waypoint x="330.0" y="427.5"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="48.0" width="96.0" x="270.0" y="161.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow7" id="BPMNEdge_flow7" sourceElement="usertask4" targetElement="endevent1">
<omgdi:waypoint x="435.0" y="427.5"/>
<omgdi:waypoint x="920.0" y="426.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="-1.0" width="-1.0" x="-1.0" y="-1.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow8" id="BPMNEdge_flow8" sourceElement="usertask2" targetElement="exclusivegateway2">
<omgdi:waypoint x="965.0" y="148.5"/>
<omgdi:waypoint x="1120.0" y="236.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="-1.0" width="-1.0" x="-1.0" y="-1.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow9" id="BPMNEdge_flow9" sourceElement="exclusivegateway2" targetElement="endevent1">
<omgdi:waypoint x="1120.0" y="236.0"/>
<omgdi:waypoint x="952.0" y="426.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="16.0" width="64.0" x="997.0" y="312.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow13" id="BPMNEdge_flow13" sourceElement="exclusivegateway4" targetElement="usertask6">
<omgdi:waypoint x="693.0" y="144.0"/>
<omgdi:waypoint x="860.0" y="231.5"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="-1.0" width="-1.0" x="-1.0" y="-1.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow14" id="BPMNEdge_flow14" sourceElement="usertask6" targetElement="exclusivegateway2">
<omgdi:waypoint x="965.0" y="231.5"/>
<omgdi:waypoint x="1120.0" y="236.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="-1.0" width="-1.0" x="-1.0" y="-1.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow10" id="BPMNEdge_flow10" sourceElement="exclusivegateway2" targetElement="usertask3">
<omgdi:waypoint x="1140.0" y="248.0"/>
<omgdi:waypoint x="1140.0" y="497.0"/>
<omgdi:waypoint x="676.0" y="497.0"/>
<omgdi:waypoint x="389.0" y="497.0"/>
<omgdi:waypoint x="162.0" y="497.0"/>
<omgdi:waypoint x="162.5" y="169.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="16.0" width="80.0" x="1020.0" y="509.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow11" id="BPMNEdge_flow11" sourceElement="exclusivegateway4" targetElement="usertask5">
<omgdi:waypoint x="693.0" y="144.0"/>
<omgdi:waypoint x="860.0" y="67.5"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="-1.0" width="-1.0" x="-1.0" y="-1.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow12" id="BPMNEdge_flow12" sourceElement="usertask5" targetElement="exclusivegateway2">
<omgdi:waypoint x="965.0" y="67.0"/>
<omgdi:waypoint x="1140.0" y="67.0"/>
<omgdi:waypoint x="1140.0" y="224.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="-1.0" width="-1.0" x="-1.0" y="-1.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</definitions>
<?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: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" xmlns:tns="http://www.processes.org/test" xmlns:xsd="http://www.w3.org/2001/XMLSchema" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.processes.org/test">
<process id="myProcee" name="My process" isExecutable="true" isClosed="false" processType="None">
<startEvent id="start" name="Start"></startEvent>
<userTask id="usertask1" name="提出请假申请" activiti:assignee="${employee}"></userTask>
<sequenceFlow id="flow1" name="想请假" sourceRef="start" targetRef="usertask3"></sequenceFlow>
<userTask id="usertask2" name="领导审核" activiti:candidateUsers="${managers}"></userTask>
<endEvent id="endevent1" name="End"></endEvent>
<userTask id="usertask3" name="填写请假单" activiti:assignee="${employee}"></userTask>
<userTask id="usertask4" name="放弃请假"></userTask>
<sequenceFlow id="flow6" name="想了想还是不请了" sourceRef="exclusivegateway1" targetRef="usertask4">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${input=='giveup'}]]></conditionExpression>
</sequenceFlow>
<sequenceFlow id="flow7" sourceRef="usertask4" targetRef="endevent1"></sequenceFlow>
<sequenceFlow id="flow3" name="下定决心准备请假" sourceRef="exclusivegateway1" targetRef="usertask1">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${input=='apply'}]]></conditionExpression>
</sequenceFlow>
<exclusiveGateway id="exclusivegateway1" name="Exclusive Gateway"></exclusiveGateway>
<sequenceFlow id="flow2" sourceRef="usertask3" targetRef="exclusivegateway1"></sequenceFlow>
<exclusiveGateway id="exclusivegateway2" name="Exclusive Gateway"></exclusiveGateway>
<sequenceFlow id="flow10" name="审核未通过" sourceRef="exclusivegateway2" targetRef="usertask3">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${input=='giveup'}]]></conditionExpression>
</sequenceFlow>
<exclusiveGateway id="exclusivegateway4" name="Exclusive Gateway"></exclusiveGateway>
<sequenceFlow id="flow4" sourceRef="usertask1" targetRef="exclusivegateway4"></sequenceFlow>
<sequenceFlow id="flow5" sourceRef="exclusivegateway4" targetRef="usertask2">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${days<10 && days>=3}]]></conditionExpression>
</sequenceFlow>
<userTask id="usertask5" name="领导审核" activiti:candidateUsers="${managers}"></userTask>
<sequenceFlow id="flow11" sourceRef="exclusivegateway4" targetRef="usertask5">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${days<3}]]></conditionExpression>
</sequenceFlow>
<userTask id="usertask6" name="管理层审核" activiti:candidateUsers="${managers}"></userTask>
<sequenceFlow id="flow13" sourceRef="exclusivegateway4" targetRef="usertask6">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${days>10}]]></conditionExpression>
</sequenceFlow>
<sequenceFlow id="flow12" sourceRef="usertask5" targetRef="exclusivegateway2"></sequenceFlow>
<sequenceFlow id="flow14" sourceRef="usertask6" targetRef="exclusivegateway2"></sequenceFlow>
<userTask id="usertask7" name="通知人事" activiti:candidateUsers="${managers}"></userTask>
<sequenceFlow id="flow15" sourceRef="exclusivegateway2" targetRef="usertask7">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${input=='apply'}]]></conditionExpression>
</sequenceFlow>
<sequenceFlow id="flow9" sourceRef="usertask7" targetRef="endevent1">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${input=='apply'}]]></conditionExpression>
</sequenceFlow>
<exclusiveGateway id="exclusivegateway5" name="Exclusive Gateway"></exclusiveGateway>
<sequenceFlow id="flow8" sourceRef="usertask2" targetRef="exclusivegateway5"></sequenceFlow>
<userTask id="usertask8" name="管理层审核" activiti:candidateUsers="${managers}"></userTask>
<sequenceFlow id="flow17" name="同意" sourceRef="exclusivegateway5" targetRef="usertask8">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${input=='apply'}]]></conditionExpression>
</sequenceFlow>
<sequenceFlow id="flow18" sourceRef="usertask8" targetRef="exclusivegateway2"></sequenceFlow>
<sequenceFlow id="flow19" sourceRef="exclusivegateway5" targetRef="usertask3">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${input=='giveup'}]]></conditionExpression>
</sequenceFlow>
</process>
<bpmndi:BPMNDiagram id="BPMNDiagram_myProcee">
<bpmndi:BPMNPlane bpmnElement="myProcee" id="BPMNPlane_myProcee">
<bpmndi:BPMNShape bpmnElement="start" id="BPMNShape_start">
<omgdc:Bounds height="35.0" width="35.0" x="0.0" y="124.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="usertask1" id="BPMNShape_usertask1">
<omgdc:Bounds height="55.0" width="105.0" x="380.0" y="114.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="usertask2" id="BPMNShape_usertask2">
<omgdc:Bounds height="55.0" width="105.0" x="740.0" y="121.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="endevent1" id="BPMNShape_endevent1">
<omgdc:Bounds height="35.0" width="35.0" x="1370.0" y="413.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="usertask3" id="BPMNShape_usertask3">
<omgdc:Bounds height="55.0" width="105.0" x="110.0" y="114.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="usertask4" id="BPMNShape_usertask4">
<omgdc:Bounds height="55.0" width="105.0" x="386.0" y="402.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="exclusivegateway1" id="BPMNShape_exclusivegateway1">
<omgdc:Bounds height="32.0" width="32.0" x="250.0" y="121.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="exclusivegateway2" id="BPMNShape_exclusivegateway2">
<omgdc:Bounds height="32.0" width="32.0" x="1260.0" y="122.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="exclusivegateway4" id="BPMNShape_exclusivegateway4">
<omgdc:Bounds height="32.0" width="32.0" x="580.0" y="127.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="usertask5" id="BPMNShape_usertask5">
<omgdc:Bounds height="55.0" width="105.0" x="750.0" y="27.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="usertask6" id="BPMNShape_usertask6">
<omgdc:Bounds height="55.0" width="105.0" x="767.0" y="251.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="usertask7" id="BPMNShape_usertask7">
<omgdc:Bounds height="55.0" width="105.0" x="1330.0" y="209.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="exclusivegateway5" id="BPMNShape_exclusivegateway5">
<omgdc:Bounds height="40.0" width="40.0" x="890.0" y="129.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="usertask8" id="BPMNShape_usertask8">
<omgdc:Bounds height="55.0" width="105.0" x="980.0" y="120.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="flow1" id="BPMNEdge_flow1">
<omgdi:waypoint x="35.0" y="141.0"></omgdi:waypoint>
<omgdi:waypoint x="110.0" y="141.0"></omgdi:waypoint>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="16.0" width="48.0" x="35.0" y="141.0"></omgdc:Bounds>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow6" id="BPMNEdge_flow6">
<omgdi:waypoint x="266.0" y="153.0"></omgdi:waypoint>
<omgdi:waypoint x="270.0" y="429.0"></omgdi:waypoint>
<omgdi:waypoint x="386.0" y="429.0"></omgdi:waypoint>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="48.0" width="96.0" x="270.0" y="161.0"></omgdc:Bounds>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow7" id="BPMNEdge_flow7">
<omgdi:waypoint x="491.0" y="429.0"></omgdi:waypoint>
<omgdi:waypoint x="1370.0" y="430.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow3" id="BPMNEdge_flow3">
<omgdi:waypoint x="282.0" y="137.0"></omgdi:waypoint>
<omgdi:waypoint x="380.0" y="141.0"></omgdi:waypoint>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="48.0" width="96.0" x="290.0" y="141.0"></omgdc:Bounds>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow2" id="BPMNEdge_flow2">
<omgdi:waypoint x="215.0" y="141.0"></omgdi:waypoint>
<omgdi:waypoint x="250.0" y="137.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow10" id="BPMNEdge_flow10">
<omgdi:waypoint x="1292.0" y="138.0"></omgdi:waypoint>
<omgdi:waypoint x="1377.0" y="147.0"></omgdi:waypoint>
<omgdi:waypoint x="1457.0" y="147.0"></omgdi:waypoint>
<omgdi:waypoint x="1457.0" y="497.0"></omgdi:waypoint>
<omgdi:waypoint x="1140.0" y="497.0"></omgdi:waypoint>
<omgdi:waypoint x="676.0" y="497.0"></omgdi:waypoint>
<omgdi:waypoint x="389.0" y="497.0"></omgdi:waypoint>
<omgdi:waypoint x="162.0" y="497.0"></omgdi:waypoint>
<omgdi:waypoint x="162.0" y="169.0"></omgdi:waypoint>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="16.0" width="80.0" x="1071.0" y="432.0"></omgdc:Bounds>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow4" id="BPMNEdge_flow4">
<omgdi:waypoint x="485.0" y="141.0"></omgdi:waypoint>
<omgdi:waypoint x="580.0" y="143.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow5" id="BPMNEdge_flow5">
<omgdi:waypoint x="612.0" y="143.0"></omgdi:waypoint>
<omgdi:waypoint x="740.0" y="148.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow11" id="BPMNEdge_flow11">
<omgdi:waypoint x="596.0" y="127.0"></omgdi:waypoint>
<omgdi:waypoint x="600.0" y="54.0"></omgdi:waypoint>
<omgdi:waypoint x="750.0" y="54.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow13" id="BPMNEdge_flow13">
<omgdi:waypoint x="596.0" y="159.0"></omgdi:waypoint>
<omgdi:waypoint x="600.0" y="278.0"></omgdi:waypoint>
<omgdi:waypoint x="767.0" y="278.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow12" id="BPMNEdge_flow12">
<omgdi:waypoint x="855.0" y="54.0"></omgdi:waypoint>
<omgdi:waypoint x="1279.0" y="54.0"></omgdi:waypoint>
<omgdi:waypoint x="1276.0" y="122.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow14" id="BPMNEdge_flow14">
<omgdi:waypoint x="872.0" y="278.0"></omgdi:waypoint>
<omgdi:waypoint x="1280.0" y="278.0"></omgdi:waypoint>
<omgdi:waypoint x="1276.0" y="154.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow15" id="BPMNEdge_flow15">
<omgdi:waypoint x="1276.0" y="154.0"></omgdi:waypoint>
<omgdi:waypoint x="1382.0" y="209.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow9" id="BPMNEdge_flow9">
<omgdi:waypoint x="1382.0" y="264.0"></omgdi:waypoint>
<omgdi:waypoint x="1387.0" y="413.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow8" id="BPMNEdge_flow8">
<omgdi:waypoint x="845.0" y="148.0"></omgdi:waypoint>
<omgdi:waypoint x="890.0" y="149.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow17" id="BPMNEdge_flow17">
<omgdi:waypoint x="930.0" y="149.0"></omgdi:waypoint>
<omgdi:waypoint x="980.0" y="147.0"></omgdi:waypoint>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="16.0" width="100.0" x="919.0" y="158.0"></omgdc:Bounds>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow18" id="BPMNEdge_flow18">
<omgdi:waypoint x="1085.0" y="147.0"></omgdi:waypoint>
<omgdi:waypoint x="1260.0" y="138.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow19" id="BPMNEdge_flow19">
<omgdi:waypoint x="910.0" y="129.0"></omgdi:waypoint>
<omgdi:waypoint x="910.0" y="12.0"></omgdi:waypoint>
<omgdi:waypoint x="558.0" y="12.0"></omgdi:waypoint>
<omgdi:waypoint x="162.0" y="12.0"></omgdi:waypoint>
<omgdi:waypoint x="162.0" y="114.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</definitions>
\ No newline at end of file
......@@ -8,6 +8,7 @@
<div>
<span>填写请假单</span>
<input id="title" placeholder="题目" /><br />
<input id="days" placeholder="请假天数" /><br />
<textarea id="content" placeholder="内容" rows="10"></textarea>
<button onclick="submit()">提交</button>
</div>
......@@ -53,6 +54,7 @@ button {
data : {
"title" : $("#title").val(),
"content" : $("#content").val(),
"days" : $("#days").val(),
"operator" : operator
},
success : function(data) {
......
......@@ -16,6 +16,7 @@
<td>请假标题</td>
<td>请假内容</td>
<td>请假人</td>
<td>请假天数</td>
<td>状态</td>
<td>操作</td>
</tr>
......@@ -23,11 +24,12 @@
<tr th:each="form:${forms}">
<td th:text="${form.title}"></td>
<td th:text="${form.content}"></td>
<td th:text="${form.days}"></td>
<td th:text="${form.applicant}"></td>
<td th:text="${form.state}"></td>
<td>
<button th:if="${form.state} == '填写请假单'"
th:onclick="'javascript:apply(\''+${form.id}+'\')'">申请请假</button>
th:onclick="'javascript:apply(\''+${form.id}+'\',\''+${form.days}+'\')'">申请请假</button>
<button th:if="${form.state} == '填写请假单'"
th:onclick="'javascript:giveup(\''+${form.id}+'\')'">放弃请假</button>
<button th:onclick="'javascript:checkState(\''+${form.id}+'\')'" data-toggle="modal" data-target="#myModal">查看流程</button>
......@@ -111,7 +113,7 @@ button {
});
}
function apply(formId) {
function apply(formId,days) {
var operator = getUser();
if (operator == "") {
location.href = "/";
......@@ -120,7 +122,8 @@ button {
url : "/apply",
data : {
"formId" : formId,
"operator" : operator
"operator" : operator,
"days":days
},
success : function(data) {
if (data.code == 200) {
......
......@@ -25,6 +25,7 @@
<td th:text="${form.state}"></td>
<td>
<button th:onclick="'javascript:approve(\''+${form.id}+'\')'">审批通过</button>
<button th:onclick="'javascript:giveup(\''+${form.id}+'\')'">审批不通过</button>
</td>
</tr>
</table>
......@@ -96,6 +97,25 @@ button {
});
}
function giveup(formId) {
var operator = getUser();
if (operator == "") {
location.href = "/";
}
$.ajax({
url : "/giveups",
data : {
"formId" : formId,
"operator" : operator
},
success : function(data) {
if (data.code == 200) {
location.href = "/homeApprover";
}
}
});
}
//获取cookie中的用户信息
function getUser(){
var name="userInfo=";
......
<!DOCTYPE html>
<html xmlns:th="http://www.w3.org/1999/xhtml">
<head>
<meta charset="UTF-8" />
<title>工作流</title>
</head>
<body>
<div>
<button class="log" onclick="logout()">退出</button>
</div>
<table th:if="${forms.size()}>0">
<thead>
<tr>
<td>请假标题</td>
<td>请假内容</td>
<td>请假人</td>
<td>审批人</td>
<td>状态</td>
<td>操作</td>
</tr>
</thead>
<tr th:each="form:${forms}">
<td th:text="${form.title}"></td>
<td th:text="${form.content}"></td>
<td th:text="${form.applicant}"></td>
<td th:text="${form.approver}"></td>
<td th:text="${form.state}"></td>
<td>
<span th:if="${form.state!='已结束'}" ><button th:onclick="'javascript:approve(\''+${form.id}+'\')'">人事收到</button></span>
<span th:if="${form.state=='已结束'}" >完成</span>
</td>
</tr>
</table>
<div th:if="${forms.size()}==0">
<br />暂无请假数据
</div>
</body>
</html>
<style>
* {
font-family: "微软雅黑";
font-size: 15px;
}
td {
padding: 5px 10px;
border: 1px solid #ccc;
}
button {
padding: 5px;
margin: 5px 0;
border: 1px solid #aaa;
border-radius: 4px;
}
.log{
float:right;
padding:5px 8px;
background:#ec5757;
color:#fff;
}
</style>
<script src="http://libs.baidu.com/jquery/1.9.1/jquery.min.js"></script>
<script>
function writeForm(){
location.href = "/form";
}
function logout(){
$.ajax({
url : "/logout",
success : function(data) {
if(data.code == 200){
location.href="/";
}
}
});
}
function approve(formId){
var operator = getUser();
debugger;
if(operator == ""){
location.href = "/";
}
$.ajax({
url : "/approve",
data : {
"formId" : formId,
"operator" : operator
},
success : function(data) {
if(data.code == 200){
location.href="/homeApproverHr";
}
}
});
}
//获取cookie中的用户信息
function getUser(){
var name="userInfo=";
var user = "";
var ca = document.cookie.split(';');
$.each(ca, function(i, item){
if(item.indexOf(name) != -1){
user = item.substring(name.length,item.length);
}
});
return user;
}
</script>
\ No newline at end of file
<!DOCTYPE html>
<html xmlns:th="http://www.w3.org/1999/xhtml">
<head>
<meta charset="UTF-8" />
<title>工作流</title>
</head>
<body>
<div>
<button class="log" onclick="logout()">退出</button>
</div>
<table th:if="${forms.size()}>0">
<thead>
<tr>
<td>请假标题</td>
<td>请假内容</td>
<td>请假人</td>
<td>状态</td>
<td>操作</td>
</tr>
</thead>
<tr th:each="form:${forms}">
<td th:text="${form.title}"></td>
<td th:text="${form.content}"></td>
<td th:text="${form.applicant}"></td>
<td th:text="${form.state}"></td>
<td>
<button th:onclick="'javascript:approve(\''+${form.id}+'\')'">审批通过</button>
<button th:onclick="'javascript:giveup(\''+${form.id}+'\')'">审批不通过</button>
</td>
</tr>
</table>
<div th:if="${forms.size()}==0">
<br />暂无请假数据
</div>
</body>
</html>
<style>
* {
font-family: "微软雅黑";
font-size: 15px;
}
td {
padding: 5px 10px;
border: 1px solid #ccc;
}
button {
padding: 5px;
margin: 5px 0;
border: 1px solid #aaa;
border-radius: 4px;
}
.log{
float:right;
padding:5px 8px;
background:#ec5757;
color:#fff;
}
</style>
<script src="http://libs.baidu.com/jquery/1.9.1/jquery.min.js"></script>
<script>
function writeForm(){
location.href = "/form";
}
function logout(){
$.ajax({
url : "/logout",
success : function(data) {
if(data.code == 200){
location.href="/";
}
}
});
}
function approve(formId){
var operator = getUser();
debugger;
if(operator == ""){
location.href = "/";
}
$.ajax({
url : "/approve",
data : {
"formId" : formId,
"operator" : operator
},
success : function(data) {
if(data.code == 200){
location.href="/homeApproverzjl";
}
}
});
}
function giveup(formId) {
var operator = getUser();
if (operator == "") {
location.href = "/";
}
$.ajax({
url : "/giveups",
data : {
"formId" : formId,
"operator" : operator
},
success : function(data) {
if (data.code == 200) {
location.href = "/homeApproverzjl";
}
}
});
}
//获取cookie中的用户信息
function getUser(){
var name="userInfo=";
var user = "";
var ca = document.cookie.split(';');
$.each(ca, function(i, item){
if(item.indexOf(name) != -1){
user = item.substring(name.length,item.length);
}
});
return user;
}
</script>
\ No newline at end of file
......@@ -55,8 +55,12 @@ button {
if(data.code == 200){
if(data.info.type == 1){
location.href="/home";
}else{
}else if(data.info.type == 2){
location.href="/homeApprover";
}else if(data.info.type == 3){
location.href="/homeApproverHr";
}else{
location.href="/homeApproverzjl";
}
}else{
alert(data.msg);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment