Browse Source

运维 草稿箱

master
PoffyZhang 1 year ago
parent
commit
f4c185b003
2 changed files with 119 additions and 1 deletions
  1. +14
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/gov/controller/GovProjectCollectionController.java
  2. +105
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/gov/manage/GovProjectCollectionManage.java

+ 14
- 0
pmapi/src/main/java/com/ningdatech/pmapi/gov/controller/GovProjectCollectionController.java View File

@@ -122,6 +122,13 @@ public class GovProjectCollectionController {
return collectionManage.draft(saveDTO,null);
}

@PostMapping("/operation/draft")
@ApiOperation("运维项目归集暂存草稿箱")
@WebLog("运维项目归集暂存草稿箱")
public String operationDraft(@Valid @RequestBody GovBizProjectSaveDTO saveDTO) {
return collectionManage.operationDraft(saveDTO,null);
}

@PostMapping("/draft-remove/{draftId}")
@ApiOperation("项目归集草稿箱删除")
@WebLog("项目归集草稿箱删除")
@@ -129,6 +136,13 @@ public class GovProjectCollectionController {
return collectionManage.draftRemove(draftId);
}

@PostMapping("/operation/draft-remove/{draftId}")
@ApiOperation("运维项目归集草稿箱删除")
@WebLog("运维项目归集草稿箱删除")
public String operationDraftRemove(@PathVariable Long draftId) {
return collectionManage.operationDraftRemove(draftId);
}

@PostMapping("/push-task")
@ApiOperation("主动调用定时器方法")
@WebLog("主动调用定时器方法")


+ 105
- 1
pmapi/src/main/java/com/ningdatech/pmapi/gov/manage/GovProjectCollectionManage.java View File

@@ -1037,7 +1037,7 @@ public class GovProjectCollectionManage {
// pushProject(saveDTO);
//如果是草稿箱来的 就要删除
if(Objects.nonNull(saveDTO.getDraftId())){
draftService.removeById(saveDTO.getDraftId());
operationProjectDraftService.removeById(saveDTO.getDraftId());
}

return BizConst.SAVE_SUCCESS;
@@ -1162,6 +1162,103 @@ public class GovProjectCollectionManage {
return BizConst.SAVE_SUCCESS;
}

public String operationDraft(GovBizProjectSaveDTO saveDTO, UserInfoDetails user) {
if(Objects.isNull(user)){
user = LoginUserUtil.loginUserDetail();
}

GovOperationProjectDraft draft = new GovOperationProjectDraft();
//草稿id
Long draftId = saveDTO.getDraftId();
String baseAreaCode = user.getRegionCode() + BizConst.NINE_AREA_CODE_LAST;
if(Objects.nonNull(draftId)){
GovBizProjectDraft oldDraft = draftService.getById(draftId);
VUtils.isTrue(Objects.isNull(oldDraft)).throwMessage("该草稿不存在!");
draft.setId(draftId);
}else{
draft.setTongTime(LocalDateTime.now());
draft.setBaseAreaCode(baseAreaCode);
draft.setCreateId(user.getUserId());
draft.setTongTime(LocalDateTime.now());
}

//1.保存基本信息
GovBizProjectBaseinfoDTO base = saveDTO.getBaseinfo();
String baseProjId = base.getBaseProjId();
String baseProjName = base.getBaseProjName();
//要生成 草稿的项目编号
if(StringUtils.isBlank(baseProjId)){
baseProjId = BizProjectContant.ProjectCollection.DRAFT;
}

// 2.保存 申报信息
GovBizProjectApplyDTO apply = saveDTO.getApply();
BeanUtil.copyProperties(apply, draft, CopyOptions.create()
.setIgnoreError(Boolean.TRUE).setIgnoreNullValue(Boolean.TRUE));

// 3.保存 审批信息
GovBizProjectApproveDTO approve = saveDTO.getApprove();
BeanUtil.copyProperties(approve, draft, CopyOptions.create()
.setIgnoreError(Boolean.TRUE).setIgnoreNullValue(Boolean.TRUE));

// 4.保存 建设项目 实施信息
GovBizProjectCimplementDTO cimplement = saveDTO.getCimplement();
if(Objects.nonNull(cimplement)){
BeanUtil.copyProperties(cimplement, draft, CopyOptions.create()
.setIgnoreError(Boolean.TRUE).setIgnoreNullValue(Boolean.TRUE));
draft.setBaseBidCode(baseProjId + "-1");
draft.setBaseChanFileCimplement(cimplement.getBaseChanFile());
draft.setBaseLogAggregationCimplement(cimplement.getBaseLogAggregation());
draft.setBaseBusinessMetricsCimplement(cimplement.getBaseBusinessMetrics());
draft.setBaseEstaSummFileCimplement(cimplement.getBaseEstaSummFile());
draft.setBaseInforLevelFileCimplement(cimplement.getBaseInforLevelFile());
draft.setBaseEngineerPostpoFileCimplement(cimplement.getBaseEngineerPostpoFile());
draft.setBaseUserConsFileCimplement(cimplement.getBaseUserConsFile());
draft.setBasePasswAssessFileCimplement(cimplement.getBasePasswAssessFile());
draft.setBaseThirdAcceptFileCimplement(cimplement.getBaseThirdAcceptFile());
draft.setBaseFinalExpertOpinionFileCimplement(cimplement.getBaseFinalExpertOpinionFile());
}

// 5.保存 运维项目 实施信息
GovBizProjectMimplementDTO mimplement = saveDTO.getMimplement();
if(Objects.nonNull(mimplement)){
BeanUtil.copyProperties(mimplement, draft, CopyOptions.create()
.setIgnoreError(Boolean.TRUE).setIgnoreNullValue(Boolean.TRUE));
draft.setBaseLogAggregationMimplement(mimplement.getBaseLogAggregation());
draft.setBaseBusinessMetricsMimplement(mimplement.getBaseBusinessMetrics());
draft.setBaseChanFileMimplement(mimplement.getBaseChanFile());
draft.setBaseEstaSummFileMimplement(mimplement.getBaseEstaSummFile());
draft.setBaseInforLevelFileMimplement(mimplement.getBaseInforLevelFile());
draft.setBaseEngineerPostpoFileMimplement(mimplement.getBaseEngineerPostpoFile());
draft.setBaseThirdAcceptFileMimplement(mimplement.getBaseThirdAcceptFile());
draft.setBaseUserConsFileMimplement(mimplement.getBaseUserConsFile());
draft.setBaseFinalExpertOpinionFileMimplement(mimplement.getBaseFinalExpertOpinionFile());
draft.setBasePasswAssessFileMimplement(mimplement.getBasePasswAssessFile());
}

// 6.保存 采购信息
List<GovBizProjectProcureDTO> procures = saveDTO.getProcures();
if(Objects.nonNull(procures)){
draft.setProcure(JSON.toJSONString(procures));
}

//最后再保存 基本信息
BeanUtil.copyProperties(base, draft, CopyOptions.create()
.setIgnoreError(Boolean.TRUE).setIgnoreNullValue(Boolean.TRUE));
draft.setBaseProjId(baseProjId);
draft.setBaseProjName(baseProjName);
draft.setIsEffective(BizProjectContant.ProjectCollection.IS_EFFECTIVE);
draft.setAreaCode(RegionConst.RC_LS);
draft.setBizTime(LocalDateTime.now());
draft.setUpdateBy(user.getUsername());
draft.setUpdateOn(LocalDateTime.now());
draft.setOp(BizProjectContant.ProjectCollection.OP_INSERT);

operationProjectDraftService.saveOrUpdate(draft);

return BizConst.SAVE_SUCCESS;
}

/**
* 删除项目归集
* @param projId
@@ -1222,6 +1319,13 @@ public class GovProjectCollectionManage {
return BizConst.OP_FAIL;
}

public String operationDraftRemove(Long draftId) {
if(operationProjectDraftService.removeById(draftId)){
return BizConst.OP_SUCCESS;
}
return BizConst.OP_FAIL;
}

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


Loading…
Cancel
Save