|
1
|
package com.lframework.xingyun.sc.controller.shipments.delay;
|
1
|
package com.lframework.xingyun.sc.controller.shipments.delay;
|
|
2
|
|
2
|
|
|
|
|
3
|
+import com.lframework.starter.bpm.dto.FlowTaskDto;
|
|
|
|
4
|
+import com.lframework.starter.bpm.mappers.FlowTaskWrapperMapper;
|
|
|
|
5
|
+import com.lframework.starter.bpm.vo.flow.task.QueryTodoTaskListVo;
|
|
3
|
import com.lframework.starter.web.core.annotations.security.HasPermission;
|
6
|
import com.lframework.starter.web.core.annotations.security.HasPermission;
|
|
4
|
import com.lframework.starter.web.core.components.security.SecurityUtil;
|
7
|
import com.lframework.starter.web.core.components.security.SecurityUtil;
|
|
5
|
import com.lframework.starter.web.core.controller.DefaultBaseController;
|
8
|
import com.lframework.starter.web.core.controller.DefaultBaseController;
|
|
6
|
import com.lframework.starter.web.core.utils.PageResultUtil;
|
9
|
import com.lframework.starter.web.core.utils.PageResultUtil;
|
|
7
|
import com.lframework.starter.web.core.components.resp.PageResult;
|
10
|
import com.lframework.starter.web.core.components.resp.PageResult;
|
|
8
|
import com.lframework.starter.web.core.components.resp.InvokeResult;
|
11
|
import com.lframework.starter.web.core.components.resp.InvokeResult;
|
|
|
|
12
|
+import javax.annotation.Resource;
|
|
9
|
import javax.validation.constraints.NotBlank;
|
13
|
import javax.validation.constraints.NotBlank;
|
|
10
|
import com.lframework.xingyun.sc.bo.shipments.delay.GetDelayedShipmentBo;
|
14
|
import com.lframework.xingyun.sc.bo.shipments.delay.GetDelayedShipmentBo;
|
|
11
|
import com.lframework.xingyun.sc.entity.DelayedShipment;
|
15
|
import com.lframework.xingyun.sc.entity.DelayedShipment;
|
|
@@ -22,6 +26,7 @@ import com.lframework.starter.common.exceptions.impl.DefaultClientException; |
|
@@ -22,6 +26,7 @@ import com.lframework.starter.common.exceptions.impl.DefaultClientException; |
|
22
|
import io.swagger.annotations.ApiOperation;
|
26
|
import io.swagger.annotations.ApiOperation;
|
|
23
|
import com.lframework.starter.common.utils.CollectionUtil;
|
27
|
import com.lframework.starter.common.utils.CollectionUtil;
|
|
24
|
import io.swagger.annotations.Api;
|
28
|
import io.swagger.annotations.Api;
|
|
|
|
29
|
+import org.apache.commons.collections.CollectionUtils;
|
|
25
|
import org.springframework.web.bind.annotation.DeleteMapping;
|
30
|
import org.springframework.web.bind.annotation.DeleteMapping;
|
|
26
|
import org.springframework.beans.factory.annotation.Autowired;
|
31
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
27
|
import org.springframework.validation.annotation.Validated;
|
32
|
import org.springframework.validation.annotation.Validated;
|
|
@@ -44,6 +49,8 @@ public class DelayedShipmentController extends DefaultBaseController { |
|
@@ -44,6 +49,8 @@ public class DelayedShipmentController extends DefaultBaseController { |
|
44
|
private DelayedShipmentService delayedShipmentService;
|
49
|
private DelayedShipmentService delayedShipmentService;
|
|
45
|
@Autowired
|
50
|
@Autowired
|
|
46
|
private DelayedShipmentDetailService delayedShipmentDetailService;
|
51
|
private DelayedShipmentDetailService delayedShipmentDetailService;
|
|
|
|
52
|
+ @Resource
|
|
|
|
53
|
+ private FlowTaskWrapperMapper flowTaskWrapperMapper;
|
|
47
|
|
54
|
|
|
48
|
/**
|
55
|
/**
|
|
49
|
* 查询列表
|
56
|
* 查询列表
|
|
@@ -96,6 +103,23 @@ public class DelayedShipmentController extends DefaultBaseController { |
|
@@ -96,6 +103,23 @@ public class DelayedShipmentController extends DefaultBaseController { |
|
96
|
QueryDelayedShipmentDetailVo vo = new QueryDelayedShipmentDetailVo();
|
103
|
QueryDelayedShipmentDetailVo vo = new QueryDelayedShipmentDetailVo();
|
|
97
|
vo.setDelayedShipmentId(id);
|
104
|
vo.setDelayedShipmentId(id);
|
|
98
|
List<DelayedShipmentDetail> delayedShipmentDetailList = delayedShipmentDetailService.query(vo);
|
105
|
List<DelayedShipmentDetail> delayedShipmentDetailList = delayedShipmentDetailService.query(vo);
|
|
|
|
106
|
+ String currentUserId = SecurityUtil.getCurrentUser().getId();
|
|
|
|
107
|
+ // 判断 createById 是否等于当前用户 ID
|
|
|
|
108
|
+ boolean isCreateBy = false;
|
|
|
|
109
|
+ if (currentUserId.equals(data.getCreateById())) {
|
|
|
|
110
|
+ isCreateBy = true;
|
|
|
|
111
|
+ }
|
|
|
|
112
|
+ result.setDelayedCreateBy(isCreateBy);
|
|
|
|
113
|
+ // 获取当前人员的待办任务数据
|
|
|
|
114
|
+ List<FlowTaskDto> flowTaskList = flowTaskWrapperMapper.queryTodoList(new QueryTodoTaskListVo(), SecurityUtil.getCurrentUser().getId());
|
|
|
|
115
|
+ if (CollectionUtils.isNotEmpty(flowTaskList)) {
|
|
|
|
116
|
+ List<String> ids = flowTaskList.stream().map(FlowTaskDto::getBusinessId).collect(Collectors.toList());
|
|
|
|
117
|
+ if (ids.contains(data.getId())) {
|
|
|
|
118
|
+ result.setShowExamine(true);
|
|
|
|
119
|
+ } else {
|
|
|
|
120
|
+ result.setShowExamine(false);
|
|
|
|
121
|
+ }
|
|
|
|
122
|
+ }
|
|
99
|
result.setDelayedShipmentDetailList(delayedShipmentDetailList);
|
123
|
result.setDelayedShipmentDetailList(delayedShipmentDetailList);
|
|
100
|
|
124
|
|
|
101
|
return InvokeResultBuilder.success(result);
|
125
|
return InvokeResultBuilder.success(result);
|