|
|
@@ -5,6 +5,7 @@ import cn.hutool.core.collection.CollUtil;
|
|
|
import cn.hutool.core.date.DatePattern;
|
|
|
import cn.hutool.core.date.DateUtil;
|
|
|
import cn.hutool.core.lang.Assert;
|
|
|
+import cn.hutool.core.lang.Pair;
|
|
|
import cn.hutool.core.util.RandomUtil;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
@@ -98,18 +99,24 @@ public class FlowInfoServiceImpl extends ServiceImpl<FlowInfoMapper, FlowInfo> i
|
|
|
.orderByDesc(FlowInfo::getCreateTime);
|
|
|
|
|
|
DataScope dataScope = DataScope.of();
|
|
|
- //选择了审核状态,则只能看到自己审核的
|
|
|
+ if (StrUtil.isNotBlank(vo.getStatus())) {
|
|
|
+ if (vo.getStatus().contains(",")) {
|
|
|
+ vo.getStatusList().addAll(Arrays.asList(vo.getStatus().split(",")));
|
|
|
+ } else {
|
|
|
+ vo.getStatusList().add(vo.getStatus());
|
|
|
+ }
|
|
|
+ vo.setStatus(null);
|
|
|
+ }
|
|
|
+
|
|
|
if (CollUtil.isNotEmpty(vo.getStatusList())) {
|
|
|
- if (GeneStatusEnum.GENE_EDITING.getStatus().equals(vo.getStatusList().get(0))) {
|
|
|
- lqw.eq(FlowInfo::getGeneEditPlId, UserUtil.getUserId());
|
|
|
- dataScope = null;
|
|
|
- } else if (GeneStatusEnum.PROJECT_LEADER.getStatus().equals(vo.getStatusList().get(0))) {
|
|
|
- lqw.eq(FlowInfo::getProjectLeaderId, UserUtil.getUserId());
|
|
|
- dataScope = null;
|
|
|
- } else if (GeneStatusEnum.PROJECT_MANAGEMENT.getStatus().equals(vo.getStatusList().get(0))) {
|
|
|
- lqw.eq(FlowInfo::getProjectManageId, UserUtil.getUserId());
|
|
|
+ Optional<Pair<String, String>> opt = GeneStatusEnum.getGeneAuditStatusList().stream()
|
|
|
+ .filter(x -> vo.getStatusList().contains(x.getKey()))
|
|
|
+ .findAny();
|
|
|
+ if (opt.isPresent()) {
|
|
|
dataScope = null;
|
|
|
+ lqw.and(x -> queryStatus(vo.getStatusList(), x));
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
|
|
|
Page<FlowInfo> page = baseMapper.selectPageByScope(pageQuery, lqw, dataScope);
|
|
|
@@ -133,6 +140,19 @@ public class FlowInfoServiceImpl extends ServiceImpl<FlowInfoMapper, FlowInfo> i
|
|
|
return pageDto.setRecords(records);
|
|
|
}
|
|
|
|
|
|
+ private void queryStatus(List<String> statusList, LambdaQueryWrapper<FlowInfo> lqw2) {
|
|
|
+ //选择了审核状态,则只能看到自己审核的
|
|
|
+ for (String sta : statusList) {
|
|
|
+ if (GeneStatusEnum.GENE_EDITING.getStatus().equals(sta)) {
|
|
|
+ lqw2.or(x -> x.eq(FlowInfo::getGeneEditPlId, UserUtil.getUserId()));
|
|
|
+ } else if (GeneStatusEnum.PROJECT_LEADER.getStatus().equals(sta)) {
|
|
|
+ lqw2.or(x -> x.eq(FlowInfo::getProjectLeaderId, UserUtil.getUserId()));
|
|
|
+ } else if (GeneStatusEnum.PROJECT_MANAGEMENT.getStatus().equals(sta)) {
|
|
|
+ lqw2.or(x -> x.eq(FlowInfo::getProjectManageId, UserUtil.getUserId()));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public FlowDetailDto getDetail(Long id) {
|
|
|
FlowInfo flowInfo = getById(id);
|