Showing
2 changed files
with
25 additions
and
1 deletions
| 1 | 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 | 6 | import com.lframework.starter.web.core.annotations.security.HasPermission; |
| 4 | 7 | import com.lframework.starter.web.core.components.security.SecurityUtil; |
| 5 | 8 | import com.lframework.starter.web.core.controller.DefaultBaseController; |
| 6 | 9 | import com.lframework.starter.web.core.utils.PageResultUtil; |
| 7 | 10 | import com.lframework.starter.web.core.components.resp.PageResult; |
| 8 | 11 | import com.lframework.starter.web.core.components.resp.InvokeResult; |
| 12 | +import javax.annotation.Resource; | |
| 9 | 13 | import javax.validation.constraints.NotBlank; |
| 10 | 14 | import com.lframework.xingyun.sc.bo.shipments.delay.GetDelayedShipmentBo; |
| 11 | 15 | import com.lframework.xingyun.sc.entity.DelayedShipment; |
| ... | ... | @@ -22,6 +26,7 @@ import com.lframework.starter.common.exceptions.impl.DefaultClientException; |
| 22 | 26 | import io.swagger.annotations.ApiOperation; |
| 23 | 27 | import com.lframework.starter.common.utils.CollectionUtil; |
| 24 | 28 | import io.swagger.annotations.Api; |
| 29 | +import org.apache.commons.collections.CollectionUtils; | |
| 25 | 30 | import org.springframework.web.bind.annotation.DeleteMapping; |
| 26 | 31 | import org.springframework.beans.factory.annotation.Autowired; |
| 27 | 32 | import org.springframework.validation.annotation.Validated; |
| ... | ... | @@ -44,6 +49,8 @@ public class DelayedShipmentController extends DefaultBaseController { |
| 44 | 49 | private DelayedShipmentService delayedShipmentService; |
| 45 | 50 | @Autowired |
| 46 | 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 | 103 | QueryDelayedShipmentDetailVo vo = new QueryDelayedShipmentDetailVo(); |
| 97 | 104 | vo.setDelayedShipmentId(id); |
| 98 | 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 | 123 | result.setDelayedShipmentDetailList(delayedShipmentDetailList); |
| 100 | 124 | |
| 101 | 125 | return InvokeResultBuilder.success(result); | ... | ... |