Commit 254b0845 by chenweisong

更新

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