提交 59f63423 authored 作者: zjm's avatar zjm

fix(配发模块): 修改了撤回接口代码

修改了撤回接口代码
上级 d23ba565
...@@ -803,8 +803,14 @@ public class AllotBillController { ...@@ -803,8 +803,14 @@ public class AllotBillController {
//根据任务id查询子任务 发件方是子任务 收件方是主任务 //根据任务id查询子任务 发件方是子任务 收件方是主任务
TaskBto taskBto = taskService.get(taskId); TaskBto taskBto = taskService.get(taskId);
Integer parentTaskId = taskBto.getParentTaskId(); Integer parentTaskId = taskBto.getParentTaskId();
MessageBto messageBto1;
TaskBto parentTask = taskService.get(parentTaskId); if (parentTaskId!=null){
TaskBto parentTask = taskService.get(parentTaskId);
taskService.moveToRevoke(parentTask);
messageBto1 = messageService.findByTaskId(parentTaskId).parse2Bto();
}else {
messageBto1 = messageService.findByTaskId(taskBto.getId()).parse2Bto();
}
//父任务未被完成 可以被撤回 //父任务未被完成 可以被撤回
Integer billId = taskBto.getBillId(); Integer billId = taskBto.getBillId();
String title = taskBto.getTitle(); String title = taskBto.getTitle();
...@@ -813,7 +819,6 @@ public class AllotBillController { ...@@ -813,7 +819,6 @@ public class AllotBillController {
Integer currentUserId = userUtils.getCurrentUserId(); Integer currentUserId = userUtils.getCurrentUserId();
List<Integer> idList = userPublicService.findOtherUser(currentUserId); List<Integer> idList = userPublicService.findOtherUser(currentUserId);
//找到收件方的阅知 //找到收件方的阅知
MessageBto messageBto1 = messageService.findByTaskId(parentTaskId).parse2Bto();
//纵向配发阅知要发给收件单位的人 //纵向配发阅知要发给收件单位的人
if (allotBill.getAllotType() == 1) { if (allotBill.getAllotType() == 1) {
idList.addAll(userDao.findAllByUnitsId(userPublicService.findUnitIdByName(allotBill.getReceiveUnit())).stream() idList.addAll(userDao.findAllByUnitsId(userPublicService.findUnitIdByName(allotBill.getReceiveUnit())).stream()
...@@ -861,18 +866,22 @@ public class AllotBillController { ...@@ -861,18 +866,22 @@ public class AllotBillController {
messageBto1.setContent("撤回对" + allotBill.getReceiveUnit()+"的型号为"+deviceLibraryList.stream().map(DeviceLibrary::getModel) messageBto1.setContent("撤回对" + allotBill.getReceiveUnit()+"的型号为"+deviceLibraryList.stream().map(DeviceLibrary::getModel)
.collect(Collectors.toList())+"的任务"); .collect(Collectors.toList())+"的任务");
MessageBto messageBto = new MessageBto(-1, parentTask.getBusinessType(), messageBto1.getContent(), idList, 1); MessageBto messageBto = new MessageBto(-1, taskBto.getBusinessType(), messageBto1.getContent(), idList, 1);
BeanUtils.copyProperties(messageBto1,messageBto); BeanUtils.copyProperties(messageBto1,messageBto);
messageBto.setTaskId(-1); messageBto.setTaskId(-1);
messageService.add(messageBto); messageService.add(messageBto);
myWebSocket.sendMessage1(); myWebSocket.sendMessage1();
//将任务都完结 //将任务都完结
taskService.moveToRevoke(taskBto); taskService.moveToRevoke(taskBto);
taskService.moveToRevoke(parentTask);
return ResponseEntity.ok(messageBto); return ResponseEntity.ok(messageBto);
} }
//递归取出最大目录 //递归取出最大目录
public PackingLibrary getPackingLibrary(PackingLibrary packingLibrary) { public PackingLibrary getPackingLibrary(PackingLibrary packingLibrary) {
Integer partParentId = packingLibrary.getPartParentId(); Integer partParentId = packingLibrary.getPartParentId();
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论