Commit 254b0845 by chenweisong

更新

parent 9f929833
...@@ -17,6 +17,7 @@ import com.keymobile.rest.vo.SimpleTask; ...@@ -17,6 +17,7 @@ import com.keymobile.rest.vo.SimpleTask;
import io.swagger.annotations.*; import io.swagger.annotations.*;
import org.activiti.engine.*; import org.activiti.engine.*;
import org.activiti.engine.history.HistoricActivityInstance; import org.activiti.engine.history.HistoricActivityInstance;
import org.activiti.engine.history.HistoricProcessInstance;
import org.activiti.engine.repository.Deployment; import org.activiti.engine.repository.Deployment;
import org.activiti.engine.repository.ProcessDefinition; import org.activiti.engine.repository.ProcessDefinition;
import org.activiti.engine.runtime.ProcessInstance; import org.activiti.engine.runtime.ProcessInstance;
...@@ -115,9 +116,7 @@ public class TaskController { ...@@ -115,9 +116,7 @@ public class TaskController {
Template template = templateService.findById(templateId); Template template = templateService.findById(templateId);
vars.put("config", template.getConfig()); vars.put("config", template.getConfig());
vars.put("templateId", template.getId()); vars.put("templateId", template.getId());
if (StringUtils.isNotEmpty(template.getUpStreamAddr())) { vars.put("headerLine", template.getHeaderLine());
vars.put("filePath", template.getUpStreamAddr());
}
} }
missions.add(convertTaskToMission(task, vars)); missions.add(convertTaskToMission(task, vars));
}); });
...@@ -141,9 +140,7 @@ public class TaskController { ...@@ -141,9 +140,7 @@ public class TaskController {
vars.put("type", CommonConstant.TASK_TYPE_GROUP); vars.put("type", CommonConstant.TASK_TYPE_GROUP);
vars.put("config", template.getConfig()); vars.put("config", template.getConfig());
vars.put("templateId", templateId); vars.put("templateId", templateId);
if (StringUtils.isNotEmpty(template.getUpStreamAddr())) { vars.put("headerLine", template.getHeaderLine());
vars.put("filePath", template.getUpStreamAddr());
}
missions.add(convertTaskToMission(groupTask, vars)); missions.add(convertTaskToMission(groupTask, vars));
} }
}); });
...@@ -347,35 +344,22 @@ public class TaskController { ...@@ -347,35 +344,22 @@ public class TaskController {
public SimplePage viewTasksProgress(int pageNo, int pageSize) { public SimplePage viewTasksProgress(int pageNo, int pageSize) {
String orderBy = "descending"; // String orderBy = "descending"; //
String propBy = "id"; // groupBy String propBy = "id"; // groupBy
Page<Process> page = processService.findAllByActivityStatus(Activity.STATUS_BEGIN, pageNo, pageSize, orderBy, propBy); Page<Process> page = processService.findAll(pageNo, pageSize, orderBy, propBy);
List<Process> processes = page.getContent(); List<Process> processes = page.getContent();
List<Map> list = new ArrayList<>(); List<Map> list = new ArrayList<>();
processes.forEach(process -> { processes.forEach(process -> {
Map map = new HashMap(); Map map = new HashMap();
map.put("id", process.getId()); map.put("id", process.getId());
// List<HistoricActivityInstance> lisst = historyService // 历史相关Service
// .createHistoricActivityInstanceQuery() // 创建历史活动实例查询 HistoricProcessInstance historicActivityInstances = historyService.createHistoricProcessInstanceQuery().processInstanceId(process.getProcessId()).singleResult();
// .processInstanceId(process.getProcessId()) // 执行流程实例id
// .finished() // int nrOfInstances = Integer.parseInt(runtimeService.getVariable(historicActivityInstances.getProcessVariables(), "nrOfInstances").toString());
// .list(); // // 当前获取的会签任务数量
// for (HistoricActivityInstance hai : lisst) { // int nrOfActiveInstances = Integer.parseInt(runtimeService.getVariable(historicActivityInstances.getExecutionId(), "nrOfActiveInstances").toString());
// System.out.println("活动ID:" + hai.getId()); // // 已经完成的会签任务数量
// } // int nrOfCompletedInstances = Integer.parseInt(runtimeService.getVariable(historicActivityInstances.getExecutionId(), "nrOfCompletedInstances").toString());
List<ProcessInstance> s = runtimeService.createProcessInstanceQuery() // System.out.println(nrOfInstances + "*" + nrOfActiveInstances + "*" + nrOfCompletedInstances);
.processInstanceId(process.getProcessId()).active()
.list();
List<Task> asda = taskService.createTaskQuery()
.processInstanceId(process.getProcessId()).active()
.list();
for (Task hai : asda) {
int nrOfInstances = Integer.parseInt(runtimeService.getVariable(hai.getExecutionId(), "nrOfInstances").toString());
// 当前获取的会签任务数量
int nrOfActiveInstances = Integer.parseInt(runtimeService.getVariable(hai.getExecutionId(), "nrOfActiveInstances").toString());
// 已经完成的会签任务数量
int nrOfCompletedInstances = Integer.parseInt(runtimeService.getVariable(hai.getExecutionId(), "nrOfCompletedInstances").toString());
System.out.println(nrOfInstances + "*" + nrOfActiveInstances + "*" + nrOfCompletedInstances );
}
}); });
return SimplePage.of(page, list); return SimplePage.of(page, list);
} }
...@@ -401,8 +385,8 @@ public class TaskController { ...@@ -401,8 +385,8 @@ public class TaskController {
} }
long templateId = Long.parseLong(params.get("templateId").toString()); long templateId = Long.parseLong(params.get("templateId").toString());
String config = params.get("config").toString(); String config = params.get("config").toString();
String filePath = params.get("filePath").toString(); int headerLine = Integer.valueOf(params.get("headerLine").toString());
builder.filePath(filePath); builder.headerLine(headerLine);
builder.config(config); builder.config(config);
builder.excelId(templateId); builder.excelId(templateId);
} else if (task.getTaskDefinitionKey().equals(CommonConstant.MISSION_KEY_MANAGER_AUDIT)) { } else if (task.getTaskDefinitionKey().equals(CommonConstant.MISSION_KEY_MANAGER_AUDIT)) {
......
...@@ -11,6 +11,5 @@ public interface ProcessDao extends JpaRepository<Process, Long> { ...@@ -11,6 +11,5 @@ public interface ProcessDao extends JpaRepository<Process, Long> {
Page<Process> findAll(Pageable pageable); Page<Process> findAll(Pageable pageable);
Page<Process> findAllByActivity_status(int status, Pageable pageable);
} }
...@@ -31,8 +31,8 @@ public class Template implements Serializable { ...@@ -31,8 +31,8 @@ public class Template implements Serializable {
@Column(nullable = false, columnDefinition = ("varchar(2000) comment '模板配置'")) @Column(nullable = false, columnDefinition = ("varchar(2000) comment '模板配置'"))
private String config; private String config;
@Column(name = "data_at", columnDefinition = ("integer(20) default 1 comment 'spreadJs表头行数'")) @Column(name = "header_line", columnDefinition = ("integer(20) default 1 comment 'spreadJs表头行数'"))
private Integer dataAt = 1; private Integer headerLine = 0;
@Column(name = "need_audit", columnDefinition = ("integer(2) default 1 comment '需要审核'")) @Column(name = "need_audit", columnDefinition = ("integer(2) default 1 comment '需要审核'"))
private Integer needAudit = 1; private Integer needAudit = 1;
......
...@@ -32,10 +32,6 @@ public class ProcessService { ...@@ -32,10 +32,6 @@ public class ProcessService {
return processDao.findAll(pageable); return processDao.findAll(pageable);
} }
public Page<Process> findAllByActivityStatus(int status, int pageNo, int pageSize, String orderBy, String propBy) {
Pageable pageable = convert(pageNo, pageSize, orderBy, propBy);
return processDao.findAllByActivity_status(status, pageable);
}
private Pageable convert(int pageNo, int pageSize, String orderBy, String propBy) { private Pageable convert(int pageNo, int pageSize, String orderBy, String propBy) {
pageNo--; pageNo--;
......
...@@ -13,8 +13,8 @@ public class Mission { ...@@ -13,8 +13,8 @@ public class Mission {
private String id; private String id;
@ApiModelProperty(name = "user", value = "当前登录用户") @ApiModelProperty(name = "user", value = "当前登录用户")
private String user; private String user;
@ApiModelProperty(name = "filePath", value = "文件路径") @ApiModelProperty(name = "headerLine", value = "表头行数")
private String filePath; private Integer headerLine;
@ApiModelProperty(name = "taskType", value = "task类别 1 个人task 2 组task") @ApiModelProperty(name = "taskType", value = "task类别 1 个人task 2 组task")
private int taskType; private int taskType;
@ApiModelProperty(name = "createAt", value = "任务发放时间") @ApiModelProperty(name = "createAt", value = "任务发放时间")
......
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