|
@@ -1,10 +1,8 @@
|
|
package org.springblade.manager.controller;
|
|
package org.springblade.manager.controller;
|
|
|
|
|
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
|
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
|
-import io.swagger.annotations.Api;
|
|
|
|
-import io.swagger.annotations.ApiImplicitParam;
|
|
|
|
-import io.swagger.annotations.ApiImplicitParams;
|
|
|
|
-import io.swagger.annotations.ApiOperation;
|
|
|
|
|
|
+import io.swagger.annotations.*;
|
|
import lombok.AllArgsConstructor;
|
|
import lombok.AllArgsConstructor;
|
|
import org.springblade.core.boot.ctrl.BladeController;
|
|
import org.springblade.core.boot.ctrl.BladeController;
|
|
import org.springblade.core.cache.utils.CacheUtil;
|
|
import org.springblade.core.cache.utils.CacheUtil;
|
|
@@ -16,7 +14,10 @@ import org.springblade.core.tool.utils.Func;
|
|
import org.springblade.manager.dto.WbsTreeDTO2;
|
|
import org.springblade.manager.dto.WbsTreeDTO2;
|
|
import org.springblade.manager.dto.WbsTreePrivateDTO2;
|
|
import org.springblade.manager.dto.WbsTreePrivateDTO2;
|
|
import org.springblade.manager.entity.WbsTree;
|
|
import org.springblade.manager.entity.WbsTree;
|
|
|
|
+import org.springblade.manager.entity.WbsTreeContract;
|
|
import org.springblade.manager.entity.WbsTreePrivate;
|
|
import org.springblade.manager.entity.WbsTreePrivate;
|
|
|
|
+import org.springblade.manager.mapper.WbsTreeContractMapper;
|
|
|
|
+import org.springblade.manager.mapper.WbsTreePrivateMapper;
|
|
import org.springblade.manager.service.IWbsTreePrivateService;
|
|
import org.springblade.manager.service.IWbsTreePrivateService;
|
|
import org.springblade.manager.vo.WbsNodeTableVO;
|
|
import org.springblade.manager.vo.WbsNodeTableVO;
|
|
import org.springblade.manager.vo.WbsTreePrivateVO;
|
|
import org.springblade.manager.vo.WbsTreePrivateVO;
|
|
@@ -40,12 +41,50 @@ import static org.springblade.core.cache.constant.CacheConstant.SYS_CACHE;
|
|
public class WbsTreePrivateController extends BladeController {
|
|
public class WbsTreePrivateController extends BladeController {
|
|
|
|
|
|
private final IWbsTreePrivateService wbsTreePrivateService;
|
|
private final IWbsTreePrivateService wbsTreePrivateService;
|
|
|
|
+ private final WbsTreeContractMapper wbsTreeContractMapper;
|
|
|
|
+ private final WbsTreePrivateMapper wbsTreePrivateMapper;
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 私有库节点逻辑删除
|
|
|
|
+ */
|
|
|
|
+ @PostMapping("/remove")
|
|
|
|
+ @ApiOperationSupport(order = 1)
|
|
|
|
+ @ApiOperation(value = "私有库节点逻辑删除", notes = "传入节点pKeyId")
|
|
|
|
+ public R remove(@ApiParam(value = "主键id", required = true) @RequestParam String pKeyId) {
|
|
|
|
+ //是否存在子节点、表单
|
|
|
|
+ WbsTreePrivate wbsTreePrivate = wbsTreePrivateMapper.selectOne(Wrappers.<WbsTreePrivate>query().lambda()
|
|
|
|
+ .eq(WbsTreePrivate::getPKeyId, pKeyId)
|
|
|
|
+ .eq(WbsTreePrivate::getStatus, 1));
|
|
|
|
+ List<WbsTreePrivate> wbsTreePrivate1 = wbsTreePrivateMapper.selectList(Wrappers.<WbsTreePrivate>query().lambda()
|
|
|
|
+ .eq(WbsTreePrivate::getParentId, wbsTreePrivate.getId())
|
|
|
|
+ .eq(WbsTreePrivate::getProjectId, wbsTreePrivate.getProjectId())
|
|
|
|
+ .eq(WbsTreePrivate::getWbsId, wbsTreePrivate.getWbsId())
|
|
|
|
+ .eq(WbsTreePrivate::getStatus, 1));
|
|
|
|
+ if (wbsTreePrivate1.size() > 0) {
|
|
|
|
+ return R.fail("当前节点下存在子节点或表单,删除失败");
|
|
|
|
+ }
|
|
|
|
+ //是否被合同段引用
|
|
|
|
+ List<WbsTreeContract> wbsTreeContracts = wbsTreeContractMapper.selectList(Wrappers.<WbsTreeContract>query().lambda()
|
|
|
|
+ .eq(WbsTreeContract::getStatus, 1)
|
|
|
|
+ .eq(WbsTreeContract::getId, wbsTreePrivate.getId())
|
|
|
|
+ .eq(WbsTreeContract::getProjectId, wbsTreePrivate.getProjectId())
|
|
|
|
+ .eq(WbsTreeContract::getWbsId, wbsTreePrivate.getWbsId())
|
|
|
|
+ );
|
|
|
|
+ if (wbsTreeContracts.size() > 0) {
|
|
|
|
+ return R.fail("当前节点已被项目合同段引用,删除失败");
|
|
|
|
+ }
|
|
|
|
+ if (wbsTreePrivateService.deleteLogicBypKeyId(pKeyId) > 0) {
|
|
|
|
+ return R.success("删除成功");
|
|
|
|
+ }
|
|
|
|
+ return R.fail("删除失败");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
|
|
/**
|
|
/**
|
|
* wbs私有库新增节点接口 同步合同段wbs库
|
|
* wbs私有库新增节点接口 同步合同段wbs库
|
|
*/
|
|
*/
|
|
@PostMapping("/submit")
|
|
@PostMapping("/submit")
|
|
- @ApiOperationSupport(order = 1)
|
|
|
|
|
|
+ @ApiOperationSupport(order = 2)
|
|
@ApiOperation(value = "新增或修改节点", notes = "WbsTreePrivate")
|
|
@ApiOperation(value = "新增或修改节点", notes = "WbsTreePrivate")
|
|
public R submit(@Valid @RequestBody WbsTreePrivate wbsTreePrivate) {
|
|
public R submit(@Valid @RequestBody WbsTreePrivate wbsTreePrivate) {
|
|
if (wbsTreePrivateService.submit(wbsTreePrivate)) {
|
|
if (wbsTreePrivateService.submit(wbsTreePrivate)) {
|
|
@@ -61,7 +100,7 @@ public class WbsTreePrivateController extends BladeController {
|
|
* 查询当前节点下所有表单(根据节点ID查询当前表单)
|
|
* 查询当前节点下所有表单(根据节点ID查询当前表单)
|
|
*/
|
|
*/
|
|
@GetMapping("/findNodeTableByCondition")
|
|
@GetMapping("/findNodeTableByCondition")
|
|
- @ApiOperationSupport(order = 2)
|
|
|
|
|
|
+ @ApiOperationSupport(order = 3)
|
|
@ApiOperation(value = "查询当前节点下所有元素表", notes = "传入父节点id、wbsId、projectId")
|
|
@ApiOperation(value = "查询当前节点下所有元素表", notes = "传入父节点id、wbsId、projectId")
|
|
public R<List<WbsNodeTableVO>> findNodeTableByCondition(@RequestParam("parentId") String parentId,
|
|
public R<List<WbsNodeTableVO>> findNodeTableByCondition(@RequestParam("parentId") String parentId,
|
|
@RequestParam("wbsId") String wbsId,
|
|
@RequestParam("wbsId") String wbsId,
|
|
@@ -75,7 +114,7 @@ public class WbsTreePrivateController extends BladeController {
|
|
|
|
|
|
|
|
|
|
@GetMapping("/removeTableByCondition")
|
|
@GetMapping("/removeTableByCondition")
|
|
- @ApiOperationSupport(order = 3)
|
|
|
|
|
|
+ @ApiOperationSupport(order = 4)
|
|
@ApiOperation(value = "删除节点下的元素表", notes = "传入表单id、wbsId、projectId")
|
|
@ApiOperation(value = "删除节点下的元素表", notes = "传入表单id、wbsId、projectId")
|
|
public R removeTableByCondition(@RequestParam("id") String id,
|
|
public R removeTableByCondition(@RequestParam("id") String id,
|
|
@RequestParam("wbsId") String wbsId,
|
|
@RequestParam("wbsId") String wbsId,
|
|
@@ -93,7 +132,7 @@ public class WbsTreePrivateController extends BladeController {
|
|
* wbs私有树懒加载获取项目私有节点树形结构
|
|
* wbs私有树懒加载获取项目私有节点树形结构
|
|
*/
|
|
*/
|
|
@GetMapping("/lazy-tree")
|
|
@GetMapping("/lazy-tree")
|
|
- @ApiOperationSupport(order = 2)
|
|
|
|
|
|
+ @ApiOperationSupport(order = 5)
|
|
@ApiOperation(value = "项目级懒加载节点树形结构", notes = "传入wbsId,parentId,,项目id,请求头token")
|
|
@ApiOperation(value = "项目级懒加载节点树形结构", notes = "传入wbsId,parentId,,项目id,请求头token")
|
|
@ApiImplicitParams(value = {
|
|
@ApiImplicitParams(value = {
|
|
@ApiImplicitParam(name = "wbsId", value = "wbsId", required = true),
|
|
@ApiImplicitParam(name = "wbsId", value = "wbsId", required = true),
|
|
@@ -113,7 +152,7 @@ public class WbsTreePrivateController extends BladeController {
|
|
*/
|
|
*/
|
|
|
|
|
|
@GetMapping("/detail")
|
|
@GetMapping("/detail")
|
|
- @ApiOperationSupport(order = 1)
|
|
|
|
|
|
+ @ApiOperationSupport(order = 6)
|
|
@ApiOperation(value = "详情", notes = "传入主键id,wbsId,项目id,请求头token")
|
|
@ApiOperation(value = "详情", notes = "传入主键id,wbsId,项目id,请求头token")
|
|
@ApiImplicitParams(value = {
|
|
@ApiImplicitParams(value = {
|
|
@ApiImplicitParam(name = "id", value = "节点id", required = true),
|
|
@ApiImplicitParam(name = "id", value = "节点id", required = true),
|
|
@@ -132,7 +171,7 @@ public class WbsTreePrivateController extends BladeController {
|
|
/**
|
|
/**
|
|
* 查询当前节点所有同级节点
|
|
* 查询当前节点所有同级节点
|
|
*/
|
|
*/
|
|
- @ApiOperationSupport(order = 14)
|
|
|
|
|
|
+ @ApiOperationSupport(order = 7)
|
|
@ApiOperation(value = "查询当前节点所有同级节点", notes = "传入项目id、当前节点parentId")
|
|
@ApiOperation(value = "查询当前节点所有同级节点", notes = "传入项目id、当前节点parentId")
|
|
@RequestMapping(value = "/findWbsTreePrivateSameLevel", method = RequestMethod.GET)
|
|
@RequestMapping(value = "/findWbsTreePrivateSameLevel", method = RequestMethod.GET)
|
|
public R<List<WbsTreePrivateDTO2>> findWbsTreePrivateSameLevel(@RequestParam("projectId") String projectId,
|
|
public R<List<WbsTreePrivateDTO2>> findWbsTreePrivateSameLevel(@RequestParam("projectId") String projectId,
|
|
@@ -145,7 +184,7 @@ public class WbsTreePrivateController extends BladeController {
|
|
/**
|
|
/**
|
|
* wbs树节点手动排序
|
|
* wbs树节点手动排序
|
|
*/
|
|
*/
|
|
- @ApiOperationSupport(order = 15)
|
|
|
|
|
|
+ @ApiOperationSupport(order = 8)
|
|
@ApiOperation(value = "wbs私有树节点手动排序", notes = "WbsTreeDTO2集合,pKeyId=节点pKeyId")
|
|
@ApiOperation(value = "wbs私有树节点手动排序", notes = "WbsTreeDTO2集合,pKeyId=节点pKeyId")
|
|
@RequestMapping(value = "/wbsTreePrivateSort", method = RequestMethod.POST)
|
|
@RequestMapping(value = "/wbsTreePrivateSort", method = RequestMethod.POST)
|
|
public R wbsTreePrivateSort(@RequestBody List<WbsTreePrivateDTO2> wbsTreeDTO) {
|
|
public R wbsTreePrivateSort(@RequestBody List<WbsTreePrivateDTO2> wbsTreeDTO) {
|
|
@@ -157,7 +196,7 @@ public class WbsTreePrivateController extends BladeController {
|
|
/**
|
|
/**
|
|
* wbs树节点下表单手动排序
|
|
* wbs树节点下表单手动排序
|
|
*/
|
|
*/
|
|
- @ApiOperationSupport(order = 15)
|
|
|
|
|
|
+ @ApiOperationSupport(order = 9)
|
|
@ApiOperation(value = "wbs私有树表单手动排序", notes = "WbsTreeDTO2集合,pKeyId=表单pKeyId")
|
|
@ApiOperation(value = "wbs私有树表单手动排序", notes = "WbsTreeDTO2集合,pKeyId=表单pKeyId")
|
|
@RequestMapping(value = "/wbsTreePrivateTableSort", method = RequestMethod.POST)
|
|
@RequestMapping(value = "/wbsTreePrivateTableSort", method = RequestMethod.POST)
|
|
public R wbsTreePrivateTableSort(@RequestBody List<WbsTreePrivateDTO2> wbsTreeDTO) {
|
|
public R wbsTreePrivateTableSort(@RequestBody List<WbsTreePrivateDTO2> wbsTreeDTO) {
|