Commit 145bd6e15387567e60086f749947145d035ccc2f

Authored by 房远帅
1 parent 51e046e6

楚江ERP:客户资信-判断当前人是否有审核权限

1 package com.lframework.xingyun.sc.bo.customer.credit; 1 package com.lframework.xingyun.sc.bo.customer.credit;
2 2
  3 +import com.baomidou.mybatisplus.annotation.TableField;
3 import com.fasterxml.jackson.annotation.JsonFormat; 4 import com.fasterxml.jackson.annotation.JsonFormat;
4 import com.fasterxml.jackson.annotation.JsonIgnore; 5 import com.fasterxml.jackson.annotation.JsonIgnore;
5 import com.lframework.starter.web.core.dto.BaseDto; 6 import com.lframework.starter.web.core.dto.BaseDto;
@@ -438,6 +439,12 @@ public class GetCustomerCreditBo extends BaseBo<CustomerCredit> implements BaseD @@ -438,6 +439,12 @@ public class GetCustomerCreditBo extends BaseBo<CustomerCredit> implements BaseD
438 private String marketingCenterSupervisorName; 439 private String marketingCenterSupervisorName;
439 440
440 /** 441 /**
  442 + * 是否展示审核按钮(非持久化字段)
  443 + */
  444 + @TableField(exist = false)
  445 + private Boolean showExamine;
  446 +
  447 + /**
441 * 核心人员 448 * 核心人员
442 */ 449 */
443 @ApiModelProperty("核心人员") 450 @ApiModelProperty("核心人员")
@@ -332,6 +332,12 @@ public class CustomerCredit extends BaseEntity implements BaseDto { @@ -332,6 +332,12 @@ public class CustomerCredit extends BaseEntity implements BaseDto {
332 private String marketingCenterSupervisor; 332 private String marketingCenterSupervisor;
333 333
334 /** 334 /**
  335 + * 是否展示审核按钮(非持久化字段)
  336 + */
  337 + @TableField(exist = false)
  338 + private Boolean showExamine;
  339 +
  340 + /**
335 * 创建人ID 341 * 创建人ID
336 */ 342 */
337 @TableField(fill = FieldFill.INSERT) 343 @TableField(fill = FieldFill.INSERT)
@@ -5,8 +5,11 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers; @@ -5,8 +5,11 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
5 import com.fasterxml.jackson.core.JsonProcessingException; 5 import com.fasterxml.jackson.core.JsonProcessingException;
6 import com.fasterxml.jackson.databind.ObjectMapper; 6 import com.fasterxml.jackson.databind.ObjectMapper;
7 import com.github.pagehelper.PageInfo; 7 import com.github.pagehelper.PageInfo;
  8 +import com.lframework.starter.bpm.dto.FlowTaskDto;
  9 +import com.lframework.starter.bpm.mappers.FlowTaskWrapperMapper;
8 import com.lframework.starter.bpm.service.FlowDefinitionWrapperService; 10 import com.lframework.starter.bpm.service.FlowDefinitionWrapperService;
9 import com.lframework.starter.bpm.service.FlowInstanceWrapperService; 11 import com.lframework.starter.bpm.service.FlowInstanceWrapperService;
  12 +import com.lframework.starter.bpm.vo.flow.task.QueryTodoTaskListVo;
10 import com.lframework.starter.web.core.components.redis.RedisHandler; 13 import com.lframework.starter.web.core.components.redis.RedisHandler;
11 import com.lframework.starter.web.core.components.security.SecurityUtil; 14 import com.lframework.starter.web.core.components.security.SecurityUtil;
12 import com.lframework.starter.web.core.utils.*; 15 import com.lframework.starter.web.core.utils.*;
@@ -86,6 +89,8 @@ public class CustomerCreditServiceImpl extends BaseMpServiceImpl<CustomerCreditM @@ -86,6 +89,8 @@ public class CustomerCreditServiceImpl extends BaseMpServiceImpl<CustomerCreditM
86 private FlowInstanceWrapperService flowInstanceWrapperService; 89 private FlowInstanceWrapperService flowInstanceWrapperService;
87 @Autowired 90 @Autowired
88 private RedisHandler redisHandler; 91 private RedisHandler redisHandler;
  92 + @Resource
  93 + private FlowTaskWrapperMapper flowTaskWrapperMapper;
89 94
90 @Override 95 @Override
91 public PageResult<CustomerCredit> query(Integer pageIndex, Integer pageSize, QueryCustomerCreditVo vo) { 96 public PageResult<CustomerCredit> query(Integer pageIndex, Integer pageSize, QueryCustomerCreditVo vo) {
@@ -95,6 +100,21 @@ public class CustomerCreditServiceImpl extends BaseMpServiceImpl<CustomerCreditM @@ -95,6 +100,21 @@ public class CustomerCreditServiceImpl extends BaseMpServiceImpl<CustomerCreditM
95 100
96 PageHelperUtil.startPage(pageIndex, pageSize); 101 PageHelperUtil.startPage(pageIndex, pageSize);
97 List<CustomerCredit> datas = this.query(vo); 102 List<CustomerCredit> datas = this.query(vo);
  103 + if (CollectionUtils.isNotEmpty(datas)) {
  104 + // 获取当前人员的待办任务数据
  105 + List<FlowTaskDto> flowTaskList = flowTaskWrapperMapper.queryTodoList(new QueryTodoTaskListVo(), SecurityUtil.getCurrentUser().getId());
  106 + if (org.apache.commons.collections4.CollectionUtils.isEmpty(flowTaskList)) {
  107 + return new PageResult<>();
  108 + }
  109 + List<String> ids = flowTaskList.stream().map(FlowTaskDto::getBusinessId).collect(Collectors.toList());
  110 + for (CustomerCredit customerCredit : datas) {
  111 + if (ids.contains(customerCredit.getId())) {
  112 + customerCredit.setShowExamine(true);
  113 + } else {
  114 + customerCredit.setShowExamine(false);
  115 + }
  116 + }
  117 + }
98 118
99 return PageResultUtil.convert(new PageInfo<>(datas)); 119 return PageResultUtil.convert(new PageInfo<>(datas));
100 } 120 }