|
@@ -35,12 +35,19 @@ import org.springblade.core.mp.support.Query;
|
|
|
import org.springblade.core.secure.utils.AuthUtil;
|
|
import org.springblade.core.secure.utils.AuthUtil;
|
|
|
import org.springblade.core.tool.api.R;
|
|
import org.springblade.core.tool.api.R;
|
|
|
import org.springblade.core.tool.utils.Func;
|
|
import org.springblade.core.tool.utils.Func;
|
|
|
|
|
+import org.springblade.core.tool.utils.ObjectUtil;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import org.springblade.check.service.IAuditPathsService;
|
|
import org.springblade.check.service.IAuditPathsService;
|
|
|
import org.springblade.core.boot.ctrl.BladeController;
|
|
import org.springblade.core.boot.ctrl.BladeController;
|
|
|
|
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
|
|
+import java.util.Comparator;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
+import java.util.TreeSet;
|
|
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
+
|
|
|
|
|
+import static io.seata.common.util.LambdaUtils.distinctByKey;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 审批流配置主表 控制器
|
|
* 审批流配置主表 控制器
|
|
@@ -125,4 +132,48 @@ public class AuditPathsController extends BladeController {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 获得所有类型
|
|
|
|
|
+ * @param auditPaths 审批流配置类
|
|
|
|
|
+ */
|
|
|
|
|
+ @GetMapping("/typeList")
|
|
|
|
|
+ @ApiOperation(value = "获得审批类型", notes = "传入auditPaths")
|
|
|
|
|
+ public R<List<AuditPaths>> typeList(AuditPaths auditPaths) {
|
|
|
|
|
+ LambdaQueryWrapper<AuditPaths> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
|
|
+ lambdaQueryWrapper.eq(AuditPaths::getTenantId, AuthUtil.getTenantId());
|
|
|
|
|
+ lambdaQueryWrapper.ne(AuditPaths::getBusinessType, "");
|
|
|
|
|
+ //获得所有数据
|
|
|
|
|
+ List<AuditPaths> list = auditPathsService.list(lambdaQueryWrapper);
|
|
|
|
|
+ List<AuditPaths> pathsList = new ArrayList<>();
|
|
|
|
|
+ //根据类型去重
|
|
|
|
|
+ if (ObjectUtil.isNotEmpty(list)){
|
|
|
|
|
+ pathsList = list.stream().collect(Collectors.collectingAndThen(
|
|
|
|
|
+ Collectors.toCollection(() -> new TreeSet<>(
|
|
|
|
|
+ Comparator.comparing(AuditPaths::getBusinessType))), ArrayList::new));
|
|
|
|
|
+ }
|
|
|
|
|
+ return R.data(pathsList);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 根据类型获得所有审批名称
|
|
|
|
|
+ * @param auditPaths 审批流配置类
|
|
|
|
|
+ */
|
|
|
|
|
+ @GetMapping("/pathNameList")
|
|
|
|
|
+ @ApiOperation(value = "获得审批名称", notes = "传入auditPaths")
|
|
|
|
|
+ public R<List<AuditPaths>> pathNameList(AuditPaths auditPaths) {
|
|
|
|
|
+ LambdaQueryWrapper<AuditPaths> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
|
|
+ lambdaQueryWrapper.eq(StringUtils.isNotBlank(auditPaths.getBusinessType()),AuditPaths::getBusinessType,auditPaths.getBusinessType())
|
|
|
|
|
+ .eq(AuditPaths::getTenantId, AuthUtil.getTenantId());
|
|
|
|
|
+ //根据类型获得所有数据
|
|
|
|
|
+ List<AuditPaths> list = auditPathsService.list(lambdaQueryWrapper);
|
|
|
|
|
+ //根据审批名称去重
|
|
|
|
|
+ List<AuditPaths> pathsList = new ArrayList<>();
|
|
|
|
|
+ //根据类型去重
|
|
|
|
|
+ if (ObjectUtil.isNotEmpty(list)){
|
|
|
|
|
+ pathsList = list.stream().collect(Collectors.collectingAndThen(
|
|
|
|
|
+ Collectors.toCollection(() -> new TreeSet<>(
|
|
|
|
|
+ Comparator.comparing(AuditPaths::getPathName))), ArrayList::new));
|
|
|
|
|
+ }
|
|
|
|
|
+ return R.data(pathsList);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|