提交 bd08790d authored 作者: zjm's avatar zjm

工作交接修改提交

上级 82e0d0f1
......@@ -14,6 +14,7 @@ import org.springframework.security.core.annotation.AuthenticationPrincipal;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
import java.util.List;
import java.util.stream.Collectors;
/**
......@@ -82,5 +83,15 @@ public class HandoverController {
return ResponseEntity.ok(userService.findByUniteId1(securityUser.getCurrentUserInfo().getUnitsId()).stream().filter(userShenRe -> userShenRe.getTrainStatus()!=5).collect(Collectors.toList()));
}
/**
* 工作交接-终止工作交接
*/
@GetMapping(value = "/terminateWorkHandover/{billId}")
@ApiOperation(value = "工作交接-终止工作交接")
public ResponseEntity userList(@ApiIgnore @AuthenticationPrincipal SecurityUser securityUser, @PathVariable Integer billId) {
workHandoverService.terminateWorkHandover(billId);
return ResponseEntity.ok("终止成功");
}
}
......@@ -62,7 +62,7 @@ public class WorkHandover {
private String file;
/**
* 状态 1.新建 2.完成
* 状态 1.新建 2.完成 3.终止
*/
private Integer status=1;
......
......@@ -41,4 +41,9 @@ public interface WorkHandoverService {
* 交接人
*/
List<User> handover(List<Integer> userIds);
/**
* 终止工作交接
*/
void terminateWorkHandover(Integer billId);
}
......@@ -187,6 +187,22 @@ public class WorkHandoverServiceImpl implements WorkHandoverService {
return userService.findAllUserIdInUser(userIds);
}
@Override
public void terminateWorkHandover(Integer billId) {
Optional<WorkHandover> byId = workHandoverDao.findById(billId);
if (byId.isPresent()){
WorkHandover workHandover = byId.get();
workHandover.setStatus(3);
workHandoverDao.save(workHandover);
TaskBto taskBto = trainTaskService.selectFatherIsNullAndBillidAndBillType(workHandover.getWorkHandoverId(), BusinessEnum.WORK_HANDOVER.id);
taskService.moveToArchive(taskBto);
}else {
throw new ApiException("[工作交接] 终止工作交接任务");
}
}
private void addMessage(MessageBto messageBto){
messageService.add(messageBto);
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论