Commit d7ac0dd2 by chenweisong

更新

parent 03c5aa75
...@@ -122,11 +122,13 @@ public class IndexCtrl { ...@@ -122,11 +122,13 @@ public class IndexCtrl {
// 新建excel实例 // 新建excel实例
List<ExcelForm> excelFormList = form.getExcels(); List<ExcelForm> excelFormList = form.getExcels();
excelFormList.forEach(excelForm -> { excelFormList.forEach(excelForm -> {
TwinkleValidator.notLessThan(excelForm.getUserIdList().size(), 1, "补录人不能为空"); TwinkleValidator.notEmpty(excelForm.getUserIds(), "补录人不能为空");
excelForm.setJob(job); excelForm.setJob(job);
Excel excel = excelService.save(excelForm); Excel excel = excelService.save(excelForm);
// 新建补录人员任务关联 // 新建补录人员任务关联
List<User> userList = userService.findAllByIdIn(excelForm.getUserIdList()); String[] userIds = excelForm.getUserIds().split(",");
List<Long> userIdList = Arrays.asList(userIds).stream().map(Long::parseLong).collect(Collectors.toList());
List<User> userList = userService.findAllByIdIn(userIdList);
TwinkleValidator.notLessThan(userList.size(), 1, "补录人员不存在"); TwinkleValidator.notLessThan(userList.size(), 1, "补录人员不存在");
userList.forEach(user -> { userList.forEach(user -> {
jobInfoService.save(user, excel); jobInfoService.save(user, excel);
...@@ -210,6 +212,7 @@ public class IndexCtrl { ...@@ -210,6 +212,7 @@ public class IndexCtrl {
User judge = userService.getAudit(); User judge = userService.getAudit();
List<Task> taskList = taskService.createTaskQuery().processInstanceId(job.getProcessId()) List<Task> taskList = taskService.createTaskQuery().processInstanceId(job.getProcessId())
.taskAssignee(judge.getUsername()).list(); .taskAssignee(judge.getUsername()).list();
TwinkleValidator.notLessThan(taskList.size(), 1, "启动失败");
Task task = taskList.get(0); Task task = taskList.get(0);
taskService.complete(task.getId(), ImmutableMap.of("pass", "true")); taskService.complete(task.getId(), ImmutableMap.of("pass", "true"));
job.setStatus(Job.STATUS_COMPLETED); job.setStatus(Job.STATUS_COMPLETED);
...@@ -226,6 +229,7 @@ public class IndexCtrl { ...@@ -226,6 +229,7 @@ public class IndexCtrl {
User judge = userService.getAudit(); User judge = userService.getAudit();
List<Task> taskList = taskService.createTaskQuery().processInstanceId(job.getProcessId()) List<Task> taskList = taskService.createTaskQuery().processInstanceId(job.getProcessId())
.taskAssignee(judge.getUsername()).list(); .taskAssignee(judge.getUsername()).list();
TwinkleValidator.notLessThan(taskList.size(), 1, "启动失败");
Task task = taskList.get(0); Task task = taskList.get(0);
taskService.complete(task.getId(), ImmutableMap.of("pass", "false")); taskService.complete(task.getId(), ImmutableMap.of("pass", "false"));
return ApiResponse.ok(); return ApiResponse.ok();
......
...@@ -20,10 +20,10 @@ public class ExcelForm { ...@@ -20,10 +20,10 @@ public class ExcelForm {
@ApiModelProperty(name = "id", value = "表格id,修改的时候需要用到") @ApiModelProperty(name = "id", value = "表格id,修改的时候需要用到")
private Long id; private Long id;
@ApiModelProperty(required = true, name = "userIds", value = "补录人员ids, 用逗号隔开", hidden = true) @ApiModelProperty(required = true, name = "userIds", value = "补录人员ids, 用逗号隔开")
private String userIds; private String userIds;
@ApiModelProperty(required = true, name = "userIdList", value = "补录人员id集合") @ApiModelProperty(required = true, name = "userIdList", value = "补录人员id集合", hidden = true)
private List<Long> userIdList; private List<Long> userIdList;
@ApiModelProperty(name = "remark", value = "表格名称", required = true) @ApiModelProperty(name = "remark", value = "表格名称", required = true)
......
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