Commit ee6e03cf by chenweisong

更新

parent d7ac0dd2
......@@ -33,7 +33,7 @@ public class Swagger2Config {
ApiInfo apiInfo() {
return new ApiInfoBuilder()
.title("补录系统")
.description("补录系统api")
.description("补录系统接口列表")
.termsOfServiceUrl("")
.version("1.0.0")
.contact(new Contact("", "", ""))
......@@ -55,7 +55,7 @@ public class Swagger2Config {
return new Docket(DocumentationType.SWAGGER_2)
.host(this.host)
.select()
.apis(RequestHandlerSelectors.basePackage("com.keymobile.rest.ctrl"))
.apis(RequestHandlerSelectors.basePackage("com.keymobile.rest.controller"))
.paths(PathSelectors.any())
.build()
.apiInfo(this.apiInfo());
......
package com.keymobile.rest.common.constant;
public interface AssignmentConstant {
int KIND_RECORD = 1;
int KIND_AUDIT = 2;
int TYPE_AUTO = 2;
int TYPE_MANUAL = 1;
int STATUS_RELEASED = 2;
int STATUS_UNRELEASED = 1;
int STATUS_COMPLETED = 3;
int AUDIT_NEED = 1;
int AUDIT_NO_NEED = 2;
}
package com.keymobile.rest.common.constant;
public interface TemplateConstant {
}
package com.keymobile.rest.controller;
import com.google.common.collect.ImmutableMap;
import com.keymobile.rest.common.bean.ApiResponse;
import com.keymobile.rest.model.*;
import com.keymobile.rest.service.ExcelService;
import com.keymobile.rest.service.JobInfoService;
import com.keymobile.rest.service.UserService;
import com.keymobile.rest.vo.RecordDataForm;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.activiti.engine.*;
import org.activiti.engine.task.Task;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@Api(value = "模板控制器")
@RestController
@RequestMapping(path = "/api/excel")
public class ExcelController {
@Autowired
private RecordDataService recordDataService;
@Autowired
private ExcelService excelService;
@Autowired
private JobInfoService jobInfoService;
@Autowired
private UserService userService;
@Autowired
private TaskService taskService;
@ApiOperation(value = "填写补录数据")
@PostMapping(value = "/excel/saveData")
public ApiResponse saveRecordData(@RequestBody RecordDataForm form) {
User curUser = userService.getNormalUser();
Template template = excelService.get(form.getExcelId());
ProcessInfo processInfo = jobInfoService.findByExcelIdAndUserId(form.getExcelId(), curUser.getId());
DataInfo dataInfo;
if (form.getDataId() != null) {
dataInfo = recordDataService.update(form);
} else {
form.setProcessInfo(processInfo);
dataInfo = recordDataService.save(form);
}
Assignment assignment = template.getAssignment();
String processId = assignment.getProcessId();
// 发起人把流程发送到下一个人
List<Task> taskList = taskService.createTaskQuery().processInstanceId(processId)
.taskAssignee(curUser.getUsername()).list();
Task task = taskList.get(0);
User judge = userService.getAudit();
taskService.complete(task.getId(), ImmutableMap.of("judgeId", judge.getUsername()));
return ApiResponse.ok(dataInfo.getId());
}
@ApiOperation(value = "传excelId过来,获取用户填写的数据")
@PostMapping(value = "/excel/getData")
public ApiResponse getRecordData(@RequestParam long excelId) {
User curUser = userService.getNormalUser();
ProcessInfo processInfo = jobInfoService.findByExcelIdAndUserId(excelId, curUser.getId());
List<DataInfo> dataInfoList = processInfo.getDataInfoList();
if (dataInfoList.size() > 0) {
return ApiResponse.ok(dataInfoList.get(0));
} else {
return ApiResponse.ok();
}
}
}
package com.keymobile.rest.controller;
import com.google.common.collect.ImmutableMap;
import com.keymobile.activiti.service.formService.FormExcelFileService;
import com.keymobile.rest.common.bean.ApiResponse;
import com.keymobile.rest.model.*;
import com.keymobile.rest.service.*;
import com.keymobile.rest.vo.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.activiti.engine.*;
import org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl;
import org.activiti.engine.task.Task;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.*;
@Api(value = "用户控制器")
@RestController
@RequestMapping(path = "/api/user")
public class UserController {
@Autowired
private UserService userService;
@ApiOperation(value = "获取补录人员列表")
@PostMapping(value = "/user/list")
public ApiResponse getUserList() {
List<User> userList = userService.findAllByRole(User.ROLE_NORMAL);
return ApiResponse.ok(userList);
}
}
package com.keymobile.rest.dao;
import com.keymobile.rest.model.Excel;
import com.keymobile.rest.model.Template;
import org.springframework.data.jpa.repository.JpaRepository;
import java.util.List;
public interface ExcelDao extends JpaRepository<Excel, Long> {
public interface ExcelDao extends JpaRepository<Template, Long> {
List<Excel> findAllByIdIn(List<Long> ids);
List<Template> findAllByIdIn(List<Long> ids);
List<Excel> findAllByJobId(long jid);
List<Template> findAllByJobId(long jid);
}
package com.keymobile.rest.dao;
import com.keymobile.rest.model.Job;
import com.keymobile.rest.model.Assignment;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
public interface JobDao extends JpaRepository<Job, Long> {
public interface JobDao extends JpaRepository<Assignment, Long> {
Page<Job> findAll(Pageable pageable);
Page<Assignment> findAll(Pageable pageable);
Page<Job> findAllByNameLike(String valueOf, Pageable pageable);
Page<Assignment> findAllByNameLike(String valueOf, Pageable pageable);
Job findByProcessId(String pid);
Assignment findByProcessId(String pid);
}
package com.keymobile.rest.dao;
import com.keymobile.rest.model.JobInfo;
import com.keymobile.rest.model.ProcessInfo;
import org.springframework.data.jpa.repository.JpaRepository;
import java.util.List;
public interface JobInfoDao extends JpaRepository<JobInfo, Long> {
public interface JobInfoDao extends JpaRepository<ProcessInfo, Long> {
List<JobInfo> findAllByExcelId(long eid);
List<ProcessInfo> findAllByExcelId(long eid);
List<JobInfo> findAllByUserId(long uid);
List<ProcessInfo> findAllByUserId(long uid);
void deleteAllByExcelId(long eid);
JobInfo findByExcelIdAndUserId(long eid, long uid);
ProcessInfo findByExcelIdAndUserId(long eid, long uid);
}
package com.keymobile.rest.dao;
import com.keymobile.rest.model.RecordData;
import com.keymobile.rest.model.DataInfo;
import org.springframework.data.jpa.repository.JpaRepository;
public interface RecordDataDao extends JpaRepository<RecordData, Long> {
public interface RecordDataDao extends JpaRepository<DataInfo, Long> {
......
package com.keymobile.rest.model;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.CreationTimestamp;
......@@ -13,28 +12,15 @@ import java.io.Serializable;
import java.util.List;
/**
* @name 流程、任务
* @desc 包含属于哪个activiti流程、相关人员、附件信息id
* @name 活动, 任务
* @desc 包含一些活动的定义以及绑定一些spreadJs生成的excel模板
*/
@JsonIgnoreProperties(value = {"hibernateLazyInitializer", "handler", "fieldHandler"})
@NoArgsConstructor // 自动生成无参数构造函数。
@AllArgsConstructor // 自动生成全参数构造函数。
@NoArgsConstructor
@Data
@Entity
public class Job implements Serializable {
public class Assignment implements Serializable {
public static int KIND_RECORD = 1;
public static int KIND_AUDIT = 2;
public static int TYPE_AUTO = 2;
public static int TYPE_MANUAL = 1;
public static int STATUS_RELEASED = 2;
public static int STATUS_UNRELEASED = 1;
public static int STATUS_COMPLETED = 3;
public static int AUDIT_NEED = 1;
public static int AUDIT_NO_NEED = 2;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
......@@ -44,20 +30,17 @@ public class Job implements Serializable {
private String name;
@Column(nullable = false)
private int type = 1;
private int type;
@Column(nullable = false)
private int status = 1;
private int status;
@Column(nullable = false)
private int audit = 1;
private int needAudit;
@Column
private String remark;
@Column(name = "process_id")
private String processId;
// 报送频度 按年 按年 按周 按月 按日 自动推送
@Column(name = "start_at")
private Timestamp startAt;
......@@ -67,14 +50,9 @@ public class Job implements Serializable {
@CreationTimestamp
private Timestamp createAt;
@OneToMany(fetch = FetchType.EAGER, mappedBy = "job")
private List<Excel> excelList;
private List<Template> templateList;
@ManyToOne
private User user;
@Transient
private int kind;
}
......@@ -2,7 +2,6 @@ package com.keymobile.rest.model;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.CreationTimestamp;
......@@ -12,14 +11,13 @@ import java.io.Serializable;
import java.sql.Timestamp;
/**
* spreadJs 填写的数据
* 已经填写的数据实例
*/
@JsonIgnoreProperties(value = {"hibernateLazyInitializer", "handler", "fieldHandler"})
@NoArgsConstructor
@AllArgsConstructor
@Data
@Entity
public class RecordData implements Serializable {
public class DataInfo implements Serializable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
......@@ -34,5 +32,5 @@ public class RecordData implements Serializable {
@ManyToOne(fetch = FetchType.LAZY)
@JsonIgnore
private JobInfo jobInfo;
private ProcessInfo processInfo;
}
package com.keymobile.rest.model;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.persistence.*;
import java.io.Serializable;
/**
* @name 进程
* @desc
*/
@JsonIgnoreProperties(value = {"hibernateLazyInitializer", "handler", "fieldHandler"})
@NoArgsConstructor
@Data
@Entity
public class Process implements Serializable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private long id;
// activiti运行中的流程实例id
@Column(name = "process_id")
private String processId;
}
package com.keymobile.rest.model;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.CreationTimestamp;
......@@ -13,14 +11,13 @@ import java.sql.Timestamp;
import java.util.List;
/**
* spreadJs 补录人员信息
* 进程&指派人员关系
*/
@JsonIgnoreProperties(value = {"hibernateLazyInitializer", "handler", "fieldHandler"})
@NoArgsConstructor
@AllArgsConstructor
@Data
@Entity
public class JobInfo implements Serializable {
public class ProcessInfo implements Serializable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
......@@ -31,12 +28,12 @@ public class JobInfo implements Serializable {
private Timestamp createAt;
@OneToOne
private Excel excel;
private Template template;
@OneToOne
private User user;
@OneToMany(mappedBy = "jobInfo", fetch = FetchType.EAGER)
List<RecordData> recordDataList;
List<DataInfo> dataInfoList;
}
......@@ -2,7 +2,6 @@ package com.keymobile.rest.model;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.CreationTimestamp;
......@@ -10,17 +9,15 @@ import org.hibernate.annotations.CreationTimestamp;
import javax.persistence.*;
import java.io.Serializable;
import java.sql.Timestamp;
import java.util.List;
/**
* spreadJs 配置的报表
*/
@JsonIgnoreProperties(value = {"hibernateLazyInitializer", "handler", "fieldHandler"})
@NoArgsConstructor
@AllArgsConstructor
@Data
@Entity
public class Excel implements Serializable {
public class Template implements Serializable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
......@@ -44,5 +41,5 @@ public class Excel implements Serializable {
@ManyToOne(fetch = FetchType.LAZY)
@JsonIgnore
private Job job;
private Assignment assignment;
}
package com.keymobile.rest.model;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
......@@ -10,7 +9,6 @@ import java.io.Serializable;
@JsonIgnoreProperties(value = {"hibernateLazyInitializer", "handler", "fieldHandler"})
@NoArgsConstructor
@AllArgsConstructor
@Data
@Entity
public class User implements Serializable {
......
......@@ -2,7 +2,7 @@ package com.keymobile.rest.service;
import com.keymobile.activiti.utils.DateUtil;
import com.keymobile.rest.dao.*;
import com.keymobile.rest.model.Excel;
import com.keymobile.rest.model.Template;
import com.keymobile.rest.vo.ExcelForm;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -16,36 +16,36 @@ public class ExcelService {
@Autowired
private ExcelDao excelDao;
public Excel save(ExcelForm form) {
Excel excel = new Excel();
excel.setName(form.getName());
excel.setDataAt(1);
excel.setConfig(form.getConfig());
excel.setRemark(form.getRemark());
excel.setJob(form.getJob());
public Template save(ExcelForm form) {
Template template = new Template();
template.setName(form.getName());
template.setDataAt(1);
template.setConfig(form.getConfig());
template.setRemark(form.getRemark());
template.setAssignment(form.getAssignment());
Timestamp now = Timestamp.valueOf(DateUtil.getDateTime());
excel.setCreateAt(now);
excel = excelDao.save(excel);
return excel;
template.setCreateAt(now);
template = excelDao.save(template);
return template;
}
public Excel get(long id) {
public Template get(long id) {
return excelDao.getOne(id);
}
public void update(Excel excel) {
excelDao.save(excel);
public void update(Template template) {
excelDao.save(template);
}
public List<Excel> findAllByIdIn(List<Long> ids) {
public List<Template> findAllByIdIn(List<Long> ids) {
return excelDao.findAllByIdIn(ids);
}
public List<Excel> findAllByJobId(long jid) {
public List<Template> findAllByJobId(long jid) {
return excelDao.findAllByJobId(jid);
}
public void saveAll(List<Excel> excelList) {
excelDao.saveAll(excelList);
public void saveAll(List<Template> templateList) {
excelDao.saveAll(templateList);
}
}
......@@ -2,8 +2,8 @@ package com.keymobile.rest.service;
import com.keymobile.activiti.utils.DateUtil;
import com.keymobile.rest.dao.*;
import com.keymobile.rest.model.Excel;
import com.keymobile.rest.model.JobInfo;
import com.keymobile.rest.model.Template;
import com.keymobile.rest.model.ProcessInfo;
import com.keymobile.rest.model.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -17,9 +17,9 @@ public class JobInfoService {
@Autowired
private JobInfoDao jobInfoDao;
public JobInfo save(User user, Excel excel) {
JobInfo info = new JobInfo();
info.setExcel(excel);
public ProcessInfo save(User user, Template template) {
ProcessInfo info = new ProcessInfo();
info.setTemplate(template);
info.setUser(user);
Timestamp now = Timestamp.valueOf(DateUtil.getDateTime());
info.setCreateAt(now);
......@@ -27,15 +27,15 @@ public class JobInfoService {
return info;
}
public List<JobInfo> findAllByExcelId(long eid) {
public List<ProcessInfo> findAllByExcelId(long eid) {
return jobInfoDao.findAllByExcelId(eid);
}
public JobInfo findByExcelIdAndUserId(long eid, long uid) {
public ProcessInfo findByExcelIdAndUserId(long eid, long uid) {
return jobInfoDao.findByExcelIdAndUserId(eid, uid);
}
public List<JobInfo> findByUserId(long uid) {
public List<ProcessInfo> findByUserId(long uid) {
return jobInfoDao.findAllByUserId(uid);
}
......
......@@ -2,7 +2,7 @@ package com.keymobile.rest.service;
import com.keymobile.activiti.utils.DateUtil;
import com.keymobile.rest.dao.JobDao;
import com.keymobile.rest.model.Job;
import com.keymobile.rest.model.Assignment;
import com.keymobile.rest.vo.JobForm;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
......@@ -13,7 +13,6 @@ import org.springframework.stereotype.Service;
import java.sql.Timestamp;
import java.time.LocalDateTime;
import java.util.Date;
@Service
public class JobService {
......@@ -21,56 +20,60 @@ public class JobService {
@Autowired
private JobDao jobDao;
public Job get(long id) {
public Assignment get(long id) {
return jobDao.getOne(id);
}
public Job update(Job job) {
return jobDao.save(job);
public Assignment update(Assignment assignment) {
return jobDao.save(assignment);
}
public Job save(JobForm form) {
Job job = new Job();
public Assignment save(Assignment assignment) {
return jobDao.save(assignment);
}
public Assignment save(JobForm form) {
Assignment assignment = new Assignment();
Timestamp now = Timestamp.valueOf(DateUtil.getDateTime());
job.setCreateAt(now);
job.setStatus(Job.STATUS_UNRELEASED);
job.setAudit(Job.AUDIT_NEED);
job.setName(form.getName());
job.setType(form.getType());
if (form.getType() == Job.TYPE_AUTO) {
assignment.setCreateAt(now);
assignment.setStatus(Assignment.STATUS_UNRELEASED);
assignment.setAudit(Assignment.AUDIT_NEED);
assignment.setName(form.getName());
assignment.setType(form.getType());
if (form.getType() == Assignment.TYPE_AUTO) {
Timestamp startAt;
try {
startAt = Timestamp.valueOf(form.getStartAt());
} catch (Exception e) {
startAt = Timestamp.valueOf(LocalDateTime.now());
}
job.setStartAt(startAt);
assignment.setStartAt(startAt);
}
job.setUser(form.getUser());
job = jobDao.save(job);
return job;
assignment.setUser(form.getUser());
assignment = jobDao.save(assignment);
return assignment;
}
public Job findByProcessId(String pid) {
public Assignment findByProcessId(String pid) {
return jobDao.findByProcessId(pid);
}
public Page<Job> findAll(int pageNo, int pageSize) {
public Page<Assignment> findAll(int pageNo, int pageSize) {
Pageable pageable = convert(pageNo, pageSize);
return jobDao.findAll(pageable);
}
public Page<Job> findAllByName(String name, int pageNo, int pageSize) {
public Page<Assignment> findAllByName(String name, int pageNo, int pageSize) {
Pageable pageable = convert(pageNo, pageSize);
return jobDao.findAllByNameLike(("%" + name + "%"), pageable);
}
public Page<Job> findAll(int pageNo, int pageSize, String orderBy, String propBy) {
public Page<Assignment> findAll(int pageNo, int pageSize, String orderBy, String propBy) {
Pageable pageable = convert(pageNo, pageSize, orderBy, propBy);
return jobDao.findAll(pageable);
}
public Page<Job> findAllByName(String name, int pageNo, int pageSize, String orderBy, String propBy) {
public Page<Assignment> findAllByName(String name, int pageNo, int pageSize, String orderBy, String propBy) {
Pageable pageable = convert(pageNo, pageSize, orderBy, propBy);
return jobDao.findAllByNameLike(("%" + name + "%"), pageable);
}
......
......@@ -2,7 +2,7 @@ package com.keymobile.rest.service;
import com.keymobile.activiti.utils.DateUtil;
import com.keymobile.rest.dao.*;
import com.keymobile.rest.model.RecordData;
import com.keymobile.rest.model.DataInfo;
import com.keymobile.rest.vo.RecordDataForm;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -15,22 +15,22 @@ public class RecordDataService {
@Autowired
private RecordDataDao recordDataDao;
public RecordData get(long id) {
public DataInfo get(long id) {
return recordDataDao.getOne(id);
}
public RecordData save(RecordDataForm form) {
RecordData data = new RecordData();
public DataInfo save(RecordDataForm form) {
DataInfo data = new DataInfo();
data.setDatas(form.getDataStr());
data.setJobInfo(form.getJobInfo());
data.setProcessInfo(form.getProcessInfo());
Timestamp now = Timestamp.valueOf(DateUtil.getDateTime());
data.setCreateAt(now);
data = recordDataDao.save(data);
return data;
}
public RecordData update(RecordDataForm form) {
RecordData data = this.get(form.getDataId());
public DataInfo update(RecordDataForm form) {
DataInfo data = this.get(form.getDataId());
data = recordDataDao.save(data);
return data;
}
......
......@@ -13,6 +13,10 @@ public class UserService {
@Autowired
private UserDao userDao;
public List<User> findAllByIdIn(List<Long> ids) {
return userDao.findAllByIdIn(ids);
}
public List<User> findAllByRole(int role) {
return userDao.findAllByRole(role);
}
......@@ -35,7 +39,5 @@ public class UserService {
return user;
}
public List<User> findAllByIdIn(List<Long> ids) {
return userDao.findAllByIdIn(ids);
}
}
package com.keymobile.rest.vo;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.keymobile.rest.model.Job;
import com.keymobile.rest.model.Assignment;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import java.sql.Timestamp;
import java.util.List;
@Data
......@@ -39,5 +34,5 @@ public class ExcelForm {
private Integer dataAt;
@JsonIgnore
private Job job;
private Assignment assignment;
}
package com.keymobile.rest.vo;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.keymobile.rest.model.JobInfo;
import com.keymobile.rest.model.ProcessInfo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
......@@ -27,7 +27,7 @@ public class RecordDataForm {
private List<Object> dataList;
@JsonIgnore
private JobInfo jobInfo;
private ProcessInfo processInfo;
}
<?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.activiti.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="m1583334145142" name="" targetNamespace="http://www.activiti.org/test" typeLanguage="http://www.w3.org/2001/XMLSchema">
<process id="RecordProcess" isClosed="false" isExecutable="true" name="RecordProcess" processType="None">
<startEvent id="startEvent" name="流程开始">
<extensionElements>
<activiti:executionListener event="start"/>
</extensionElements>
</startEvent>
<endEvent id="endEvent" name="End"/>
<userTask activiti:assignee="chenws" activiti:candidateUsers="${activityDemoServiceImpl.findUsersForSP(execution)}" activiti:exclusive="true" id="checkData" name="审批数据"/>
<exclusiveGateway gatewayDirection="Unspecified" id="isDataPass" name="数据是否正确通过">
<extensionElements>
<activiti:executionListener event="start">
<activiti:field>
<activiti:string/>
</activiti:field>
</activiti:executionListener>
</extensionElements>
</exclusiveGateway>
<sequenceFlow id="flow5" sourceRef="checkData" targetRef="isDataPass"/>
<userTask activiti:assignee="管理" activiti:exclusive="true" id="addExcel" name="添加补录模板">
<extensionElements>
<activiti:taskListener event="create"/>
</extensionElements>
</userTask>
<userTask activiti:assignee="chenws" activiti:candidateUsers="${userIds}" activiti:exclusive="true" id="addData" name="补录人员填写模板"/>
<sequenceFlow id="_7" sourceRef="addExcel" targetRef="addData"/>
<sequenceFlow id="_8" sourceRef="addData" targetRef="checkData"/>
<sequenceFlow id="_10" sourceRef="startEvent" targetRef="addExcel"/>
<sequenceFlow id="_12" skipExpression="${sign=='false'}" sourceRef="isDataPass" targetRef="addData">
<conditionExpression xsi:type="tFormalExpression">
<![CDATA[
]]>
</conditionExpression>
</sequenceFlow>
<sequenceFlow id="_13" sourceRef="isDataPass" targetRef="endEvent">
<extensionElements>
<activiti:executionListener event="start"/>
</extensionElements>
<conditionExpression xsi:type="tFormalExpression">
<![CDATA[
]]>
</conditionExpression>
</sequenceFlow>
</process>
<bpmndi:BPMNDiagram documentation="background=#3C3F41;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="RecordProcess">
<bpmndi:BPMNShape bpmnElement="startEvent" id="Shape-startEvent">
<omgdc:Bounds height="32.0" width="32.0" x="450.0" y="45.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="32.0" width="32.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="endEvent" id="Shape-endEvent">
<omgdc:Bounds height="32.0" width="32.0" x="455.0" y="675.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="32.0" width="32.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="checkData" id="Shape-checkData">
<omgdc:Bounds height="55.0" width="105.0" x="410.0" y="445.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="55.0" width="105.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="isDataPass" id="Shape-isDataPass" isMarkerVisible="false">
<omgdc:Bounds height="32.0" width="32.0" x="455.0" y="545.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="32.0" width="32.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="addExcel" id="Shape-addExcel">
<omgdc:Bounds height="55.0" width="105.0" x="415.0" y="205.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="55.0" width="105.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="addData" id="Shape-addData">
<omgdc:Bounds height="70.0" width="105.0" x="400.0" y="315.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="70.0" width="105.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="_13" id="BPMNEdge__13" sourceElement="isDataPass" targetElement="endEvent">
<omgdi:waypoint x="471.0" y="577.0"/>
<omgdi:waypoint x="471.0" y="675.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="0.0" width="0.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="_12" id="BPMNEdge__12" sourceElement="isDataPass" targetElement="addData">
<omgdi:waypoint x="458.0" y="558.0"/>
<omgdi:waypoint x="350.0" y="558.0"/>
<omgdi:waypoint x="400.0" y="350.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="checkData" targetElement="isDataPass">
<omgdi:waypoint x="471.0" y="500.0"/>
<omgdi:waypoint x="471.0" y="545.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="-1.0" width="-1.0" x="-1.0" y="-1.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="_7" id="BPMNEdge__7" sourceElement="addExcel" targetElement="addData">
<omgdi:waypoint x="460.0" y="260.0"/>
<omgdi:waypoint x="460.0" y="315.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="0.0" width="0.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="_8" id="BPMNEdge__8" sourceElement="addData" targetElement="checkData">
<omgdi:waypoint x="457.5" y="385.0"/>
<omgdi:waypoint x="457.5" y="445.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="0.0" width="0.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="_10" id="BPMNEdge__10" sourceElement="startEvent" targetElement="addExcel">
<omgdi:waypoint x="466.0" y="77.0"/>
<omgdi:waypoint x="466.0" y="205.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="0.0" width="0.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</definitions>
<?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.activiti.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="m1583334145142" name="" targetNamespace="http://www.activiti.org/test" typeLanguage="http://www.w3.org/2001/XMLSchema">
<process id="testProcess" isClosed="false" isExecutable="true" name="Test process" processType="None">
<startEvent id="startevent1" name="Start"/>
<endEvent id="endevent1" name="End"/>
<serviceTask activiti:exclusive="true" activiti:expression="#{activityDemoServiceImpl.updateBizStatus(execution,&quot;tj&quot;)}" id="servicetask1" name="用户提交"/>
<userTask activiti:candidateUsers="${activityDemoServiceImpl.findUsersForSL(execution)}" activiti:exclusive="true" id="usertask1" name="受理"/>
<exclusiveGateway gatewayDirection="Unspecified" id="exclusivegateway1" name="Exclusive Gateway"/>
<userTask activiti:candidateUsers="${activityDemoServiceImpl.findUsersForSP(execution)}" activiti:exclusive="true" id="usertask2" name="审批"/>
<exclusiveGateway gatewayDirection="Unspecified" id="exclusivegateway3" name="Exclusive Gateway"/>
<serviceTask activiti:exclusive="true" activiti:expression="#{activityDemoServiceImpl.updateBizStatus(execution,&quot;qf&quot;)}" id="servicetask2" name="已签发"/>
<serviceTask activiti:exclusive="true" activiti:expression="#{activityDemoServiceImpl.updateBizStatus(execution,&quot;bq&quot;)}" id="servicetask3" name="资料不全"/>
<sequenceFlow id="flow1" sourceRef="startevent1" targetRef="servicetask1"/>
<sequenceFlow id="flow2" sourceRef="servicetask1" targetRef="usertask1"/>
<sequenceFlow id="flow3" sourceRef="usertask1" targetRef="exclusivegateway1"/>
<sequenceFlow id="flow4" skipExpression="${sign=='true'}" sourceRef="exclusivegateway1" targetRef="usertask2"/>
<sequenceFlow id="flow5" sourceRef="usertask2" targetRef="exclusivegateway3"/>
<sequenceFlow id="flow6" skipExpression="${sign=='true'}" sourceRef="exclusivegateway3" targetRef="servicetask2"/>
<sequenceFlow id="flow7" sourceRef="servicetask2" targetRef="endevent1"/>
<sequenceFlow id="flow8" skipExpression="${sign=='false'}" sourceRef="exclusivegateway3" targetRef="servicetask3"/>
<sequenceFlow id="flow9" skipExpression="${sign=='false'}" sourceRef="exclusivegateway1" targetRef="servicetask3"/>
<sequenceFlow id="flow10" sourceRef="servicetask3" targetRef="endevent1"/>
</process>
<bpmndi:BPMNDiagram documentation="background=#3C3F41;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="testProcess">
<bpmndi:BPMNShape bpmnElement="startevent1" id="Shape-startevent1">
<omgdc:Bounds height="32.0" width="32.0" x="20.0" y="140.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="32.0" width="32.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="860.0" y="140.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="32.0" width="32.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="servicetask1" id="Shape-servicetask1">
<omgdc:Bounds height="55.0" width="105.0" x="90.0" y="130.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="55.0" width="105.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="230.0" y="130.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="380.0" y="137.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="32.0" width="32.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="460.0" y="130.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="55.0" width="105.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="exclusivegateway3" id="Shape-exclusivegateway3" isMarkerVisible="false">
<omgdc:Bounds height="32.0" width="32.0" x="608.0" y="137.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="32.0" width="32.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="servicetask2" id="Shape-servicetask2">
<omgdc:Bounds height="55.0" width="105.0" x="680.0" y="130.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="55.0" width="105.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="servicetask3" id="Shape-servicetask3">
<omgdc:Bounds height="55.0" width="105.0" x="576.0" y="20.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="startevent1" targetElement="servicetask1">
<omgdi:waypoint x="52.0" y="156.0"/>
<omgdi:waypoint x="90.0" y="157.5"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="-1.0" width="-1.0" x="-1.0" y="-1.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow2" id="BPMNEdge_flow2" sourceElement="servicetask1" targetElement="usertask1">
<omgdi:waypoint x="195.0" y="157.5"/>
<omgdi:waypoint x="230.0" y="157.5"/>
<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="usertask1" targetElement="exclusivegateway1">
<omgdi:waypoint x="335.0" y="157.5"/>
<omgdi:waypoint x="380.0" y="153.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="-1.0" width="-1.0" x="-1.0" y="-1.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow4" id="BPMNEdge_flow4" sourceElement="exclusivegateway1" targetElement="usertask2">
<omgdi:waypoint x="412.0" y="153.0"/>
<omgdi:waypoint x="460.0" y="157.5"/>
<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="usertask2" targetElement="exclusivegateway3">
<omgdi:waypoint x="565.0" y="157.5"/>
<omgdi:waypoint x="608.0" y="153.0"/>
<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="exclusivegateway3" targetElement="servicetask2">
<omgdi:waypoint x="640.0" y="153.0"/>
<omgdi:waypoint x="680.0" y="157.5"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="-1.0" width="-1.0" x="-1.0" y="-1.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow7" id="BPMNEdge_flow7" sourceElement="servicetask2" targetElement="endevent1">
<omgdi:waypoint x="785.0" y="157.5"/>
<omgdi:waypoint x="860.0" y="156.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="servicetask3" targetElement="endevent1">
<omgdi:waypoint x="681.0" y="47.0"/>
<omgdi:waypoint x="877.0" y="47.0"/>
<omgdi:waypoint x="877.0" y="140.0312805773287"/>
<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="exclusivegateway3" targetElement="servicetask3">
<omgdi:waypoint x="624.0" y="137.0"/>
<omgdi:waypoint x="624.0" y="75.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="exclusivegateway1" targetElement="servicetask3">
<omgdi:waypoint x="400.0" y="141.0"/>
<omgdi:waypoint x="400.0" y="47.0"/>
<omgdi:waypoint x="576.0" y="47.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>
......@@ -52,8 +52,8 @@ app:
active-process: RecordStandardProcess.bpmn
swagger2:
# host: localhost:8110
host: 47.105.236.43/activiti
host: localhost:8110
# host: 47.105.236.43/activiti
......
package com.keymobile;
import com.keymobile.rest.common.exception.TwinkleException;
import com.keymobile.rest.common.validator.TwinkleValidator;
import com.keymobile.rest.model.Job;
import com.keymobile.rest.service.JobService;
import javafx.application.Application;
import org.activiti.engine.*;
import org.activiti.engine.history.HistoricProcessInstance;
import org.activiti.engine.history.HistoricProcessInstanceQuery;
import org.activiti.engine.repository.DeploymentBuilder;
import org.activiti.engine.repository.ProcessDefinition;
import org.activiti.engine.task.Task;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import javax.annotation.Resource;
import java.io.IOException;
import java.io.InputStream;
import java.util.List;
@RunWith(SpringRunner.class)
......
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