Browse Source

项目归集删除

tags/24080901
PoffyZhang 1 year ago
parent
commit
d3e2ba0d35
3 changed files with 36 additions and 2 deletions
  1. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/common/constant/BizConst.java
  2. +9
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/gov/controller/GovProjectCollectionController.java
  3. +26
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/gov/manage/GovProjectCollectionManage.java

+ 1
- 1
pmapi/src/main/java/com/ningdatech/pmapi/common/constant/BizConst.java View File

@@ -95,6 +95,6 @@ public interface BizConst {
String PROD = "prod";

String SAVE_SUCCESS = "保存成功";
String OP_SUCCESS = "操作成功";
String SAVE_FAIL = "保存失败";
}

+ 9
- 1
pmapi/src/main/java/com/ningdatech/pmapi/gov/controller/GovProjectCollectionController.java View File

@@ -15,6 +15,7 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;
import java.util.List;

/**
@@ -56,7 +57,14 @@ public class GovProjectCollectionController {
@PostMapping("/save")
@ApiOperation("项目归集保存")
@WebLog("项目归集保存")
public String save(@RequestBody GovBizProjectSaveDTO saveDTO) {
public String save(@Valid @RequestBody GovBizProjectSaveDTO saveDTO) {
return collectionManage.save(saveDTO);
}

@PostMapping("/remove/{projId}")
@ApiOperation("项目归集删除")
@WebLog("项目归集删除")
public String remove(@PathVariable String projId) {
return collectionManage.remove(projId);
}
}

+ 26
- 0
pmapi/src/main/java/com/ningdatech/pmapi/gov/manage/GovProjectCollectionManage.java View File

@@ -319,6 +319,32 @@ public class GovProjectCollectionManage {
return BizConst.SAVE_SUCCESS;
}

/**
* 删除项目归集
* @param projId
* @return
*/
public String remove(String projId) {
GovBizProjectBaseinfo baseinfo = baseinfoService.getOne(Wrappers.lambdaQuery(GovBizProjectBaseinfo.class)
.eq(GovBizProjectBaseinfo::getBaseProjId, projId)
.last(BizConst.LIMIT_1));
VUtils.isTrue(Objects.isNull(baseinfo)).throwMessage("项目不存在!");

baseinfoService.removeById(baseinfo);
projectApplyService.remove(Wrappers.lambdaQuery(GovBizProjectApply.class)
.eq(GovBizProjectApply::getBaseProjId,projId));
approveService.remove(Wrappers.lambdaQuery(GovBizProjectApprove.class)
.eq(GovBizProjectApprove::getBaseProjId,projId));
cimplementService.remove(Wrappers.lambdaQuery(GovBizProjectCimplement.class)
.eq(GovBizProjectCimplement::getBaseProjId,projId));
mimplementService.remove(Wrappers.lambdaQuery(GovBizProjectMimplement.class)
.eq(GovBizProjectMimplement::getBaseProjId,projId));
procureService.remove(Wrappers.lambdaQuery(GovBizProjectProcure.class)
.eq(GovBizProjectProcure::getBaseProjId,projId));
return BizConst.OP_SUCCESS;
}

private void checkName(String baseProjName, String baseProjId) {
VUtils.isTrue(baseinfoService.count(Wrappers.lambdaQuery(GovBizProjectBaseinfo.class)
.eq(GovBizProjectBaseinfo::getBaseProjName,baseProjName)


Loading…
Cancel
Save