Commit 9ad3153789fa380be96e717fb3d27a85b0bf2f65

Authored by 房远帅
1 parent ba15ee6b

客户资信、延期发货:审核详情按钮展示权限

... ... @@ -462,6 +462,12 @@ public class GetCustomerCreditBo extends BaseBo<CustomerCredit> implements BaseD
462 462 @ApiModelProperty(value = "是否展示审核按钮")
463 463 private Boolean showExamine;
464 464
  465 + /**
  466 + * 是否展示审核详情按钮(非持久化字段)
  467 + */
  468 + @ApiModelProperty(value = "是否展示审核按钮")
  469 + private Boolean showExamineDetail;
  470 +
465 471
466 472 /**
467 473 * 企业操作类型
... ...
... ... @@ -71,9 +71,15 @@ public class GetDelayedShipmentBo extends BaseBo<DelayedShipment> {
71 71 private Boolean showExamine;
72 72
73 73 /**
  74 + * 是否展示审核详情按钮(非持久化字段)
  75 + */
  76 + @ApiModelProperty("是否展示审核详情按钮")
  77 + private Boolean showExamineDetail;
  78 +
  79 + /**
74 80 * 是否是创建人(非持久化字段)
75 81 */
76   - @ApiModelProperty("是否展示审核按钮")
  82 + @ApiModelProperty("是否是创建人")
77 83 private Boolean delayedCreateBy;
78 84
79 85
... ...
... ... @@ -4,7 +4,9 @@ import com.alibaba.excel.EasyExcel;
4 4 import com.alibaba.excel.ExcelWriter;
5 5 import com.alibaba.excel.write.metadata.WriteSheet;
6 6 import com.lframework.starter.bpm.dto.FlowTaskDto;
  7 +import com.lframework.starter.bpm.entity.FlowInstanceWrapper;
7 8 import com.lframework.starter.bpm.mappers.FlowTaskWrapperMapper;
  9 +import com.lframework.starter.bpm.service.FlowInstanceWrapperService;
8 10 import com.lframework.starter.bpm.vo.flow.task.QueryTodoTaskListVo;
9 11 import com.lframework.starter.common.utils.StringUtil;
10 12 import com.lframework.starter.web.core.annotations.security.HasPermission;
... ... @@ -86,6 +88,8 @@ public class CustomerCreditController extends DefaultBaseController {
86 88 private ContractDistributorStandardService contractDistributorStandardService;
87 89 @Resource
88 90 private FlowTaskWrapperMapper flowTaskWrapperMapper;
  91 + @Resource
  92 + private FlowInstanceWrapperService flowInstanceWrapperService;
89 93
90 94 /**
91 95 * 查询列表
... ... @@ -500,11 +504,24 @@ public class CustomerCreditController extends DefaultBaseController {
500 504 data.setSupervisorReviewName(sysUser.getName());
501 505 }
502 506 }
  507 +
  508 + //流程数据
  509 + List<String> ids = new ArrayList<>();
  510 + ids.add(credit.getId());
  511 + List<FlowInstanceWrapper> flowByBusinessIdList = flowInstanceWrapperService.getFlowByBusinessIdList(ids);
  512 + if (CollectionUtils.isNotEmpty(flowByBusinessIdList)) {
  513 + List<String> collect = flowByBusinessIdList.stream().map(FlowInstanceWrapper::getBusinessId).collect(Collectors.toList());
  514 + data.setShowExamineDetail(collect.contains(credit.getId()));
  515 + } else {
  516 + data.setShowExamineDetail(false);
  517 + }
503 518 // 获取当前人员的待办任务数据
504 519 List<FlowTaskDto> flowTaskList = flowTaskWrapperMapper.queryTodoList(new QueryTodoTaskListVo(), SecurityUtil.getCurrentUser().getId());
505 520 if (CollectionUtils.isNotEmpty(flowTaskList)) {
506 521 List<String> businessIds = flowTaskList.stream().map(FlowTaskDto::getBusinessId).collect(Collectors.toList());
507 522 data.setShowExamine(businessIds.contains(credit.getId()));
  523 + } else {
  524 + data.setShowExamine(false);
508 525 }
509 526 // enterpriseOperationType 转中文
510 527 String opType = data.getEnterpriseOperationType();
... ...
1 1 package com.lframework.xingyun.sc.controller.shipments.delay;
2 2
3 3 import com.lframework.starter.bpm.dto.FlowTaskDto;
  4 +import com.lframework.starter.bpm.entity.FlowInstanceWrapper;
4 5 import com.lframework.starter.bpm.mappers.FlowTaskWrapperMapper;
  6 +import com.lframework.starter.bpm.service.FlowInstanceWrapperService;
5 7 import com.lframework.starter.bpm.vo.flow.task.QueryTodoTaskListVo;
6 8 import com.lframework.starter.web.core.annotations.security.HasPermission;
7 9 import com.lframework.starter.web.core.components.security.SecurityUtil;
... ... @@ -27,11 +29,13 @@ import com.lframework.starter.common.exceptions.impl.DefaultClientException;
27 29 import io.swagger.annotations.ApiOperation;
28 30 import com.lframework.starter.common.utils.CollectionUtil;
29 31 import io.swagger.annotations.Api;
  32 +import org.apache.commons.collections.CollectionUtils;
30 33 import org.springframework.web.bind.annotation.DeleteMapping;
31 34 import org.springframework.beans.factory.annotation.Autowired;
32 35 import org.springframework.validation.annotation.Validated;
33 36 import org.springframework.web.bind.annotation.*;
34 37 import javax.validation.Valid;
  38 +import java.util.ArrayList;
35 39 import java.util.List;
36 40 import java.util.stream.Collectors;
37 41
... ... @@ -51,6 +55,8 @@ public class DelayedShipmentController extends DefaultBaseController {
51 55 private DelayedShipmentDetailService delayedShipmentDetailService;
52 56 @Resource
53 57 private FlowTaskWrapperMapper flowTaskWrapperMapper;
  58 + @Resource
  59 + private FlowInstanceWrapperService flowInstanceWrapperService;
54 60
55 61 /**
56 62 * 查询列表
... ... @@ -106,9 +112,21 @@ public class DelayedShipmentController extends DefaultBaseController {
106 112 result.setDelayedShipmentDetailList(delayedShipmentDetailList);
107 113 // 获取当前人员的待办任务数据
108 114 List<FlowTaskDto> flowTaskList = flowTaskWrapperMapper.queryTodoList(new QueryTodoTaskListVo(), SecurityUtil.getCurrentUser().getId());
109   - if (org.apache.commons.collections.CollectionUtils.isNotEmpty(flowTaskList)) {
  115 + if (CollectionUtils.isNotEmpty(flowTaskList)) {
110 116 List<String> businessIds = flowTaskList.stream().map(FlowTaskDto::getBusinessId).collect(Collectors.toList());
111 117 result.setShowExamine(businessIds.contains(result.getId()));
  118 + } else {
  119 + result.setShowExamine(false);
  120 + }
  121 + //流程数据
  122 + List<String> ids = new ArrayList<>();
  123 + ids.add(result.getId());
  124 + List<FlowInstanceWrapper> flowByBusinessIdList = flowInstanceWrapperService.getFlowByBusinessIdList(ids);
  125 + if (CollectionUtils.isNotEmpty(flowByBusinessIdList)) {
  126 + List<String> collect = flowByBusinessIdList.stream().map(FlowInstanceWrapper::getBusinessId).collect(Collectors.toList());
  127 + result.setShowExamineDetail(collect.contains(result.getId()));
  128 + } else {
  129 + result.setShowExamineDetail(false);
112 130 }
113 131
114 132 return InvokeResultBuilder.success(result);
... ...
... ... @@ -369,6 +369,12 @@ public class CustomerCredit extends BaseEntity implements BaseDto {
369 369 private Boolean showExamine = false;
370 370
371 371 /**
  372 + * 是否展示审核详情按钮(非持久化字段)
  373 + */
  374 + @TableField(exist = false)
  375 + private Boolean showExamineDetail;
  376 +
  377 + /**
372 378 * 流程发起人(非持久化字段)
373 379 */
374 380 @TableField(exist = false)
... ...
... ... @@ -72,6 +72,12 @@ public class DelayedShipment extends BaseEntity implements BaseDto {
72 72 private Boolean showExamine = false;
73 73
74 74 /**
  75 + * 是否展示审核按钮详情(非持久化字段)
  76 + */
  77 + @TableField(exist = false)
  78 + private Boolean showExamineDetail;
  79 +
  80 + /**
75 81 * 创建人ID
76 82 */
77 83 @TableField(fill = FieldFill.INSERT)
... ...
... ... @@ -7,6 +7,7 @@ import com.fasterxml.jackson.core.JsonProcessingException;
7 7 import com.fasterxml.jackson.databind.ObjectMapper;
8 8 import com.github.pagehelper.PageInfo;
9 9 import com.lframework.starter.bpm.dto.FlowTaskDto;
  10 +import com.lframework.starter.bpm.entity.FlowInstanceWrapper;
10 11 import com.lframework.starter.bpm.mappers.FlowTaskWrapperMapper;
11 12 import com.lframework.starter.bpm.service.FlowDefinitionWrapperService;
12 13 import com.lframework.starter.bpm.service.FlowInstanceWrapperService;
... ... @@ -111,6 +112,19 @@ public class CustomerCreditServiceImpl extends BaseMpServiceImpl<CustomerCreditM
111 112 PageHelperUtil.startPage(pageIndex, pageSize);
112 113 List<CustomerCredit> datas = this.query(vo);
113 114 if (CollectionUtils.isNotEmpty(datas)) {
  115 + //流程数据
  116 + List<FlowInstanceWrapper> flowByConditionList = flowInstanceWrapperService.getFlowByBusinessIdList(
  117 + datas.stream().map(CustomerCredit::getId).collect(Collectors.toList()));
  118 + if (CollectionUtils.isNotEmpty(flowByConditionList)) {
  119 + List<String> idList = flowByConditionList.stream().map(FlowInstanceWrapper::getBusinessId).collect(Collectors.toList());
  120 + for (CustomerCredit customerCredit : datas) {
  121 + if (idList.contains(customerCredit.getId())) {
  122 + customerCredit.setShowExamineDetail(true);
  123 + } else {
  124 + customerCredit.setShowExamineDetail(false);
  125 + }
  126 + }
  127 + }
114 128 // 获取当前人员的待办任务数据
115 129 List<FlowTaskDto> flowTaskList = flowTaskWrapperMapper.queryTodoList(new QueryTodoTaskListVo(), SecurityUtil.getCurrentUser().getId());
116 130 if (org.apache.commons.collections4.CollectionUtils.isEmpty(flowTaskList)) {
... ...
... ... @@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
4 4 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
5 5 import com.github.pagehelper.PageInfo;
6 6 import com.lframework.starter.bpm.dto.FlowTaskDto;
  7 +import com.lframework.starter.bpm.entity.FlowInstanceWrapper;
7 8 import com.lframework.starter.bpm.mappers.FlowTaskWrapperMapper;
8 9 import com.lframework.starter.bpm.service.FlowInstanceWrapperService;
9 10 import com.lframework.starter.bpm.vo.flow.task.QueryTodoTaskListVo;
... ... @@ -29,10 +30,7 @@ import com.lframework.starter.web.inner.dto.message.SysSiteMessageDto;
29 30 import com.lframework.starter.web.inner.dto.system.UserInfoDto;
30 31 import com.lframework.starter.web.inner.service.system.SysUserRoleService;
31 32 import com.lframework.starter.web.inner.service.system.SysUserService;
32   -import com.lframework.xingyun.sc.entity.DelayedShipment;
33   -import com.lframework.xingyun.sc.entity.DelayedShipmentDetail;
34   -import com.lframework.xingyun.sc.entity.PurchaseOrderInfo;
35   -import com.lframework.xingyun.sc.entity.RequestCarTicket;
  33 +import com.lframework.xingyun.sc.entity.*;
36 34 import com.lframework.xingyun.sc.handlers.TransactorHandler;
37 35 import com.lframework.xingyun.sc.mappers.DelayedShipmentMapper;
38 36 import com.lframework.xingyun.sc.service.order.PurchaseOrderInfoService;
... ... @@ -93,6 +91,19 @@ public class DelayedShipmentServiceImpl extends BaseMpServiceImpl<DelayedShipmen
93 91 PageHelperUtil.startPage(pageIndex, pageSize);
94 92 List<DelayedShipment> datas = this.query(vo);
95 93 if (CollectionUtils.isNotEmpty(datas)) {
  94 + //流程数据
  95 + List<FlowInstanceWrapper> flowByConditionList = flowInstanceWrapperService.getFlowByBusinessIdList(
  96 + datas.stream().map(DelayedShipment::getId).collect(Collectors.toList()));
  97 + if (CollectionUtils.isNotEmpty(flowByConditionList)) {
  98 + List<String> idList = flowByConditionList.stream().map(FlowInstanceWrapper::getBusinessId).collect(Collectors.toList());
  99 + for (DelayedShipment delayedShipment : datas) {
  100 + if (idList.contains(delayedShipment.getId())) {
  101 + delayedShipment.setShowExamineDetail(true);
  102 + } else {
  103 + delayedShipment.setShowExamineDetail(false);
  104 + }
  105 + }
  106 + }
96 107 // 获取当前人员的待办任务数据
97 108 List<FlowTaskDto> flowTaskList = flowTaskWrapperMapper.queryTodoList(new QueryTodoTaskListVo(), SecurityUtil.getCurrentUser().getId());
98 109 if (org.apache.commons.collections4.CollectionUtils.isEmpty(flowTaskList)) {
... ...