@@ -31,6 +31,7 @@ public class MhApiClient { | |||
private static final String USER_URL = "/sync/user"; | |||
private static final String EXPERT_URL = "/sync/expert"; | |||
private static final String COMPANY_URL = "/sync/company"; | |||
private static final String PROJECT_URL = "/project_info/getProjectInfoList"; | |||
public MhRetDTO<List<MhUnitDTO>> queryUnits() { | |||
@@ -69,4 +70,11 @@ public class MhApiClient { | |||
}, false); | |||
} | |||
public MhRetDTO<List<MhProjectDTO>> listProjects() { | |||
String requestUrl = mhApiHost + PROJECT_URL; | |||
String retBody = HttpUtil.get(requestUrl); | |||
return JSONUtil.toBean(retBody, new TypeReference<MhRetDTO<List<MhProjectDTO>>>() { | |||
}, false); | |||
} | |||
} |
@@ -0,0 +1,46 @@ | |||
package com.hz.pm.api.external.model.dto; | |||
import io.swagger.annotations.ApiModelProperty; | |||
import lombok.Data; | |||
import java.math.BigDecimal; | |||
/** | |||
* <p> | |||
* ResponseData | |||
* </p> | |||
* | |||
* @author WendyYang | |||
* @since 14:24 2024/1/23 | |||
*/ | |||
@Data | |||
public class MhProjectDTO { | |||
@ApiModelProperty("项目合规性检查附件") | |||
private String fileId; | |||
@ApiModelProperty("项目复核附件") | |||
private String fileIdThree; | |||
@ApiModelProperty("项目评审附件") | |||
private String fileIdTwo; | |||
@ApiModelProperty("项目评审预算金额") | |||
private BigDecimal money; | |||
@ApiModelProperty("项目名称") | |||
private String projectName; | |||
@ApiModelProperty("关键指标对象") | |||
private MhProjectSchemeTargetDTO schemeTargetData; | |||
@ApiModelProperty("项目总金额") | |||
private BigDecimal totalMoney; | |||
@ApiModelProperty("单位ID") | |||
private Long unitId; | |||
@ApiModelProperty("单位名称") | |||
private String unitName; | |||
} |
@@ -0,0 +1,91 @@ | |||
package com.hz.pm.api.external.model.dto; | |||
import io.swagger.annotations.ApiModel; | |||
import io.swagger.annotations.ApiModelProperty; | |||
import lombok.Data; | |||
import java.math.BigDecimal; | |||
import java.util.Date; | |||
/** | |||
* <p> | |||
* MhProjectSchemeTargetDTO | |||
* </p> | |||
* | |||
* @author WendyYang | |||
* @since 14:26 2024/1/23 | |||
*/ | |||
@Data | |||
@ApiModel("关键指标对象") | |||
public class MhProjectSchemeTargetDTO { | |||
@ApiModelProperty(value = "迁移上云信息系统数量") | |||
private int cloudSystemNum; | |||
@ApiModelProperty(value = "创建时间") | |||
private Date createTime; | |||
@ApiModelProperty(value = "创建单位") | |||
private Long createUnit; | |||
@ApiModelProperty(value = "创建人") | |||
private String createUser; | |||
@ApiModelProperty(value = "附件") | |||
private String fileId; | |||
@ApiModelProperty(value = "本地部署非涉密信息系统数量") | |||
private Integer fsmLocalSystemNum; | |||
@ApiModelProperty(value = "更新购置非涉密服务器数量") | |||
private Integer fsmServerNum; | |||
@ApiModelProperty(value = "更新购置非涉密数据库数量") | |||
private Integer fsmUpdateDbNum; | |||
@ApiModelProperty(value = "更新购置非涉密中间件数量") | |||
private Integer fsmUpdateMiddleNum; | |||
@ApiModelProperty(value = "vCPU(核数)") | |||
private Integer hostCpuNum; | |||
@ApiModelProperty(value = "内存(GB)") | |||
private Integer hostMemoryNum; | |||
@ApiModelProperty(value = "信创云虚拟主机数量") | |||
private Integer hostNum; | |||
@ApiModelProperty(value = "存储(GB)") | |||
private Integer hostStoreNum; | |||
@ApiModelProperty(value = "ID") | |||
private String id; | |||
@ApiModelProperty(value = "总投资预算金额(万元)") | |||
private BigDecimal money; | |||
@ApiModelProperty(value = "本地部署涉密信息系统数量") | |||
private Integer smLocalSystemNum; | |||
@ApiModelProperty(value = "更新购置涉密服务器数量") | |||
private Integer smServerNum; | |||
@ApiModelProperty(value = "更新购置涉密数据库数量") | |||
private Integer smUpdateDbNum; | |||
@ApiModelProperty(value = "更新购置涉密中间件数量") | |||
private Integer smUpdateMiddleNum; | |||
@ApiModelProperty(value = "更新时间") | |||
private Date updateTime; | |||
@ApiModelProperty(value = "更新人") | |||
private String updateUser; | |||
@ApiModelProperty(value = "信创云数据库数量") | |||
private Integer xcDbNum; | |||
@ApiModelProperty(value = "信创云中间件数量") | |||
private Integer xcMiddleNum; | |||
} |
@@ -78,15 +78,15 @@ public class GovProjectCollectionController { | |||
@PostMapping("/save") | |||
@ApiOperation("项目归集保存") | |||
@WebLog("项目归集保存") | |||
public String save(@Valid @RequestBody GovBizProjectSaveDTO saveDTO) { | |||
return collectionManage.save(saveDTO,null); | |||
public String save(@Valid @RequestBody GovBizProjectSaveDTO req) { | |||
return collectionManage.save(req); | |||
} | |||
@PostMapping("/operation/save") | |||
@ApiOperation("运维项目归集保存") | |||
@WebLog("运维项目归集保存") | |||
public String operationSave(@Valid @RequestBody GovOperationProjectSaveDTO saveDTO) { | |||
return collectionManage.operationSave(saveDTO,null); | |||
return collectionManage.operationSave(saveDTO, null); | |||
} | |||
@PostMapping("/remove/{projId}") | |||
@@ -131,14 +131,14 @@ public class GovProjectCollectionController { | |||
@ApiOperation("项目归集暂存草稿箱") | |||
@WebLog("项目归集暂存草稿箱") | |||
public String draft(@Valid @RequestBody GovBizProjectSaveDTO saveDTO) { | |||
return collectionManage.draft(saveDTO,null); | |||
return collectionManage.draft(saveDTO, null); | |||
} | |||
@PostMapping("/operation/draft") | |||
@ApiOperation("运维项目归集暂存草稿箱") | |||
@WebLog("运维项目归集暂存草稿箱") | |||
public String operationDraft(@Valid @RequestBody GovOperationProjectSaveDTO saveDTO) { | |||
return collectionManage.operationDraft(saveDTO,null); | |||
return collectionManage.operationDraft(saveDTO, null); | |||
} | |||
@PostMapping("/draft-remove/{draftId}") | |||
@@ -200,7 +200,7 @@ public class GovProjectCollectionController { | |||
@PostMapping("/remove-project") | |||
@ApiOperation("删除申报项目") | |||
@WebLog("删除申报项目") | |||
public String removeProject(@RequestBody List<String> projectCodes){ | |||
public String removeProject(@RequestBody List<String> projectCodes) { | |||
return collectionManage.removeProject(projectCodes); | |||
} | |||
@@ -78,6 +78,8 @@ import java.time.temporal.Temporal; | |||
import java.util.*; | |||
import java.util.stream.Collectors; | |||
import static com.hz.pm.api.gov.contants.BizProjectContant.ProjectCollection.*; | |||
/** | |||
* @author zpf | |||
* @since 2023/8/21 下午2:27 | |||
@@ -341,11 +343,11 @@ public class GovProjectCollectionManage { | |||
UserInfoDetails user = LoginUserUtil.loginUserDetail(); | |||
Page<GovOperationProjectDraft> page = req.page(); | |||
LambdaQueryWrapper<GovOperationProjectDraft> wrapper = Wrappers.lambdaQuery(GovOperationProjectDraft.class) | |||
.like(StringUtils.isNotBlank(req.getProjectName()), GovOperationProjectDraft::getBaseProjName, req.getProjectName()) | |||
.like(StringUtils.isNotBlank(req.getBuildOrg()), GovOperationProjectDraft::getBaseBuildDeprt, req.getBuildOrg()) | |||
.like(StrUtil.isNotBlank(req.getProjectName()), GovOperationProjectDraft::getBaseProjName, req.getProjectName()) | |||
.like(StrUtil.isNotBlank(req.getBuildOrg()), GovOperationProjectDraft::getBaseBuildDeprt, req.getBuildOrg()) | |||
.gt(Objects.nonNull(req.getCreateOnMin()), GovOperationProjectDraft::getTongTime, req.getCreateOnMin()) | |||
.le(Objects.nonNull(req.getCreateOnMax()), GovOperationProjectDraft::getTongTime, req.getCreateOnMax()) | |||
.eq(StringUtils.isNotBlank(req.getProjectType()), GovOperationProjectDraft::getBaseProjType, req.getProjectType()) | |||
.eq(StrUtil.isNotBlank(req.getProjectType()), GovOperationProjectDraft::getBaseProjType, req.getProjectType()) | |||
.eq(GovOperationProjectDraft::getDeleted, Boolean.FALSE) | |||
.eq(GovOperationProjectDraft::getCreateId, user.getUserId()) | |||
.orderByDesc(GovOperationProjectDraft::getBizTime); | |||
@@ -653,24 +655,23 @@ public class GovProjectCollectionManage { | |||
/** | |||
* 项目归集保存 | |||
* | |||
* @param saveDTO | |||
* @return | |||
* @param req \ | |||
* @return \ | |||
*/ | |||
@Transactional | |||
public String save(GovBizProjectSaveDTO saveDTO, UserInfoDetails user) { | |||
if (Objects.isNull(user)) { | |||
user = LoginUserUtil.loginUserDetail(); | |||
} | |||
@Transactional(rollbackFor = Exception.class) | |||
public String save(GovBizProjectSaveDTO req) { | |||
LocalDateTime now = LocalDateTime.now(); | |||
UserInfoDetails user = LoginUserUtil.loginUserDetail(); | |||
GovBizProjectBaseinfoDTO base = saveDTO.getBaseinfo(); | |||
String baseProjId = saveDTO.getBaseProjId(); | |||
GovBizProjectBaseinfoDTO base = req.getBaseinfo(); | |||
String baseProjId = req.getBaseProjId(); | |||
String baseProjName = base.getBaseProjName(); | |||
//1.保存基本信息 | |||
GovBizProjectBaseinfoDTO baseinfo = saveDTO.getBaseinfo(); | |||
GovBizProjectBaseinfoDTO baseinfo = req.getBaseinfo(); | |||
baseinfo.setBaseProjId(baseProjId); | |||
baseinfo.setBaseProjName(baseProjName); | |||
baseinfo.setIsEffective(BizProjectContant.ProjectCollection.IS_EFFECTIVE); | |||
baseinfo.setIsEffective(IS_EFFECTIVE); | |||
GovBizProjectBaseinfo oldBaseInfo = baseinfoService.getOne(Wrappers.lambdaQuery(GovBizProjectBaseinfo.class) | |||
.eq(GovBizProjectBaseinfo::getBaseProjId, baseProjId) | |||
.last(BizConst.LIMIT_1)); | |||
@@ -679,28 +680,28 @@ public class GovProjectCollectionManage { | |||
checkName(baseProjName, baseProjId); | |||
GovBizProjectBaseinfo saveBase = BeanUtil.copyProperties(baseinfo, GovBizProjectBaseinfo.class); | |||
saveBase.setBaseProjName(baseProjName); | |||
saveBase.setIsEffective(BizProjectContant.ProjectCollection.IS_EFFECTIVE); | |||
saveBase.setIsEffective(IS_EFFECTIVE); | |||
if (Objects.nonNull(oldBaseInfo)) { | |||
saveBase.setId(oldBaseInfo.getId()); | |||
saveBase.setBaseAreaCode(null); | |||
} else { | |||
saveBase.setTongTime(LocalDateTime.now()); | |||
saveBase.setTongTime(now); | |||
} | |||
saveBase.setAreaCode(RegionConst.RC_HZ); | |||
saveBase.setBizTime(LocalDateTime.now()); | |||
saveBase.setBizTime(now); | |||
saveBase.setUpdateBy(user.getUsername()); | |||
saveBase.setUpdateOn(LocalDateTime.now()); | |||
saveBase.setUpdateOn(now); | |||
//如果是新增的话 要生成 项目编号 | |||
if (StringUtils.isBlank(baseProjId) || BizProjectContant.ProjectCollection.DRAFT.equals(baseProjId)) { | |||
baseProjId = generateProjectCodeUtil.generateProjectCode(saveDTO); | |||
if (StringUtils.isBlank(baseProjId) || DRAFT.equals(baseProjId)) { | |||
baseProjId = generateProjectCodeUtil.generateProjectCode(req); | |||
saveBase.setBaseProjId(baseProjId); | |||
} | |||
baseinfoService.saveOrUpdate(saveBase); | |||
// 2.保存 申报信息 | |||
GovBizProjectApplyDTO apply = saveDTO.getApply(); | |||
GovBizProjectApplyDTO apply = req.getApply(); | |||
if (Objects.nonNull(apply)) { | |||
apply.setBaseProjId(baseProjId); | |||
apply.setBaseProjName(baseProjName); | |||
@@ -713,7 +714,7 @@ public class GovProjectCollectionManage { | |||
if (Objects.nonNull(oldApply)) { | |||
saveApply.setId(oldApply.getId()); | |||
} else { | |||
saveApply.setTongTime(LocalDateTime.now()); | |||
saveApply.setTongTime(now); | |||
} | |||
if (Objects.nonNull(saveApply.getBaseProjStartTime()) && | |||
Objects.nonNull(saveApply.getBaseProjEndTime())) { | |||
@@ -721,16 +722,16 @@ public class GovProjectCollectionManage { | |||
saveApply.getBaseProjEndTime())); | |||
} | |||
saveApply.setAreaCode(RegionConst.RC_HZ); | |||
saveApply.setBizTime(LocalDateTime.now()); | |||
saveApply.setBizTime(now); | |||
saveApply.setUpdateBy(user.getUsername()); | |||
saveApply.setUpdateOn(LocalDateTime.now()); | |||
saveApply.setUpdateOn(now); | |||
if (projectApplyService.saveOrUpdate(saveApply)) { | |||
threadPoolTaskScheduler.execute(() -> uploadFileToProvincialOssApply(apply, oldApply, saveApply)); | |||
} | |||
} | |||
// 3.保存 审批信息 | |||
GovBizProjectApproveDTO approve = saveDTO.getApprove(); | |||
GovBizProjectApproveDTO approve = req.getApprove(); | |||
if (Objects.nonNull(approve)) { | |||
approve.setBaseProjId(baseProjId); | |||
approve.setBaseProjName(baseProjName); | |||
@@ -755,7 +756,7 @@ public class GovProjectCollectionManage { | |||
} | |||
// 4.保存 建设项目 实施信息 | |||
GovBizProjectCimplementDTO cimplement = saveDTO.getCimplement(); | |||
GovBizProjectCimplementDTO cimplement = req.getCimplement(); | |||
if (Objects.nonNull(cimplement)) { | |||
cimplement.setBaseProjId(baseProjId); | |||
cimplement.setBaseProjName(baseProjName); | |||
@@ -772,19 +773,19 @@ public class GovProjectCollectionManage { | |||
if (Objects.nonNull(oldCimplement)) { | |||
saveCimplement.setId(oldCimplement.getId()); | |||
} else { | |||
saveCimplement.setTongTime(LocalDateTime.now()); | |||
saveCimplement.setTongTime(now); | |||
} | |||
saveCimplement.setAreaCode(RegionConst.RC_HZ); | |||
saveCimplement.setBizTime(LocalDateTime.now()); | |||
saveCimplement.setBizTime(now); | |||
saveCimplement.setUpdateBy(user.getUsername()); | |||
saveCimplement.setUpdateOn(LocalDateTime.now()); | |||
saveCimplement.setUpdateOn(now); | |||
if (cimplementService.saveOrUpdate(saveCimplement)) { | |||
threadPoolTaskScheduler.execute(() -> uploadFileToProvincialOssCimplement(cimplement, oldCimplement, saveCimplement)); | |||
} | |||
} | |||
// 5.保存 运维项目 实施信息 | |||
GovBizProjectMimplementDTO mimplement = saveDTO.getMimplement(); | |||
GovBizProjectMimplementDTO mimplement = req.getMimplement(); | |||
if (Objects.nonNull(mimplement)) { | |||
mimplement.setBaseProjId(baseProjId); | |||
mimplement.setBaseProjName(baseProjName); | |||
@@ -801,22 +802,22 @@ public class GovProjectCollectionManage { | |||
if (Objects.nonNull(oldMimplement)) { | |||
saveMimplement.setId(oldMimplement.getId()); | |||
} else { | |||
saveMimplement.setTongTime(LocalDateTime.now()); | |||
saveMimplement.setTongTime(now); | |||
} | |||
if (Objects.nonNull(saveBase.getAreaCode())) { | |||
saveMimplement.setAreaCode(saveBase.getAreaCode()); | |||
} | |||
saveMimplement.setAreaCode(RegionConst.RC_HZ); | |||
saveMimplement.setBizTime(LocalDateTime.now()); | |||
saveMimplement.setBizTime(now); | |||
saveMimplement.setUpdateBy(user.getUsername()); | |||
saveMimplement.setUpdateOn(LocalDateTime.now()); | |||
saveMimplement.setUpdateOn(now); | |||
if (mimplementService.saveOrUpdate(saveMimplement)) { | |||
threadPoolTaskScheduler.execute(() -> uploadFileToProvincialOssMimplement(mimplement, oldMimplement, saveMimplement)); | |||
} | |||
} | |||
// 6.保存 采购信息 | |||
List<GovBizProjectProcureDTO> procures = saveDTO.getProcures(); | |||
List<GovBizProjectProcureDTO> procures = req.getProcures(); | |||
if (Objects.nonNull(procures)) { | |||
procureService.remove(Wrappers.lambdaQuery(GovBizProjectProcure.class) | |||
@@ -831,10 +832,10 @@ public class GovProjectCollectionManage { | |||
saveProcure.setBaseProjId(baseProjId); | |||
saveProcure.setId(null); | |||
saveProcure.setAreaCode(RegionConst.RC_HZ); | |||
saveProcure.setTongTime(LocalDateTime.now()); | |||
saveProcure.setBizTime(LocalDateTime.now()); | |||
saveProcure.setTongTime(now); | |||
saveProcure.setBizTime(now); | |||
saveProcure.setUpdateBy(user.getUsername()); | |||
saveProcure.setUpdateOn(LocalDateTime.now()); | |||
saveProcure.setUpdateOn(now); | |||
if (procureService.save(saveProcure)) { | |||
threadPoolTaskScheduler.execute(() -> uploadFileToProvincialOssProcure(procure, null, saveProcure)); | |||
} | |||
@@ -843,8 +844,8 @@ public class GovProjectCollectionManage { | |||
} | |||
if (Objects.nonNull(saveDTO.getDraftId())) { | |||
draftService.removeById(saveDTO.getDraftId()); | |||
if (Objects.nonNull(req.getDraftId())) { | |||
draftService.removeById(req.getDraftId()); | |||
} | |||
return BizConst.SAVE_SUCCESS; | |||
@@ -871,7 +872,7 @@ public class GovProjectCollectionManage { | |||
GovOperationProjectBaseinfoDTO baseinfo = saveDTO.getBaseinfo(); | |||
baseinfo.setBaseProjId(baseProjId); | |||
baseinfo.setBaseProjName(baseProjName); | |||
baseinfo.setIsEffective(BizProjectContant.ProjectCollection.IS_EFFECTIVE); | |||
baseinfo.setIsEffective(IS_EFFECTIVE); | |||
GovOperationProjectBaseinfo oldBaseInfo = operationProjectBaseinfoService.getOne(Wrappers.lambdaQuery(GovOperationProjectBaseinfo.class) | |||
.eq(GovOperationProjectBaseinfo::getBaseProjId, baseProjId) | |||
.last(BizConst.LIMIT_1)); | |||
@@ -880,7 +881,7 @@ public class GovProjectCollectionManage { | |||
checkNameOperation(baseProjName, baseProjId); | |||
GovOperationProjectBaseinfo saveBase = BeanUtil.copyProperties(baseinfo, GovOperationProjectBaseinfo.class); | |||
saveBase.setBaseProjName(baseProjName); | |||
saveBase.setIsEffective(BizProjectContant.ProjectCollection.IS_EFFECTIVE); | |||
saveBase.setIsEffective(IS_EFFECTIVE); | |||
if (Objects.nonNull(oldBaseInfo)) { | |||
saveBase.setId(oldBaseInfo.getId()); | |||
saveBase.setBaseAreaCode(null); | |||
@@ -892,7 +893,7 @@ public class GovProjectCollectionManage { | |||
saveBase.setUpdateOn(LocalDateTime.now()); | |||
//如果是新增的话 要生成 项目编号 | |||
if (StringUtils.isBlank(baseProjId) || BizProjectContant.ProjectCollection.DRAFT.equals(baseProjId)) { | |||
if (StringUtils.isBlank(baseProjId) || DRAFT.equals(baseProjId)) { | |||
baseProjId = generateProjectCodeUtil.generateProjectCode(saveDTO); | |||
saveBase.setBaseProjId(baseProjId); | |||
} | |||
@@ -1099,7 +1100,7 @@ public class GovProjectCollectionManage { | |||
String baseProjName = base.getBaseProjName(); | |||
//要生成 草稿的项目编号 | |||
if (StringUtils.isBlank(baseProjId)) { | |||
baseProjId = BizProjectContant.ProjectCollection.DRAFT; | |||
baseProjId = DRAFT; | |||
} | |||
// 2.保存 申报信息 | |||
@@ -1158,12 +1159,12 @@ public class GovProjectCollectionManage { | |||
.setIgnoreError(Boolean.TRUE).setIgnoreNullValue(Boolean.TRUE)); | |||
draft.setBaseProjId(baseProjId); | |||
draft.setBaseProjName(baseProjName); | |||
draft.setIsEffective(BizProjectContant.ProjectCollection.IS_EFFECTIVE); | |||
draft.setIsEffective(IS_EFFECTIVE); | |||
draft.setAreaCode(RegionConst.RC_HZ); | |||
draft.setBizTime(LocalDateTime.now()); | |||
draft.setUpdateBy(user.getUsername()); | |||
draft.setUpdateOn(LocalDateTime.now()); | |||
draft.setOp(BizProjectContant.ProjectCollection.OP_INSERT); | |||
draft.setOp(OP_INSERT); | |||
draftService.saveOrUpdate(draft); | |||
@@ -1194,7 +1195,7 @@ public class GovProjectCollectionManage { | |||
String baseProjName = base.getBaseProjName(); | |||
//要生成 草稿的项目编号 | |||
if (StringUtils.isBlank(baseProjId)) { | |||
baseProjId = BizProjectContant.ProjectCollection.DRAFT; | |||
baseProjId = DRAFT; | |||
} | |||
// 2.保存 申报信息 | |||
@@ -1253,12 +1254,12 @@ public class GovProjectCollectionManage { | |||
.setIgnoreError(Boolean.TRUE).setIgnoreNullValue(Boolean.TRUE)); | |||
draft.setBaseProjId(baseProjId); | |||
draft.setBaseProjName(baseProjName); | |||
draft.setIsEffective(BizProjectContant.ProjectCollection.IS_EFFECTIVE); | |||
draft.setIsEffective(IS_EFFECTIVE); | |||
draft.setAreaCode(RegionConst.RC_HZ); | |||
draft.setBizTime(LocalDateTime.now()); | |||
draft.setUpdateBy(user.getUsername()); | |||
draft.setUpdateOn(LocalDateTime.now()); | |||
draft.setOp(BizProjectContant.ProjectCollection.OP_INSERT); | |||
draft.setOp(OP_INSERT); | |||
operationProjectDraftService.saveOrUpdate(draft); | |||
@@ -21,6 +21,7 @@ import com.hz.pm.api.projectlib.model.vo.ProjectApplicationVO; | |||
import com.hz.pm.api.projectlib.model.vo.ProjectDetailVO; | |||
import lombok.extern.slf4j.Slf4j; | |||
import org.apache.commons.lang3.StringUtils; | |||
import java.math.BigDecimal; | |||
import java.util.Collections; | |||
import java.util.List; | |||
@@ -38,12 +39,13 @@ public class ProjectConvertUtil { | |||
/** | |||
* 申报项目 转为 项目归集 | |||
* | |||
* @param project | |||
* @return | |||
*/ | |||
public static GovBizProjectDetailVO declaredToCollection(ProjectDetailVO project, FileService fileService){ | |||
public static GovBizProjectDetailVO declaredToCollection(ProjectDetailVO project, FileService fileService) { | |||
GovBizProjectDetailVO projectCollection = new GovBizProjectDetailVO(); | |||
if(Objects.isNull(project)){ | |||
if (Objects.isNull(project)) { | |||
return projectCollection; | |||
} | |||
String projectCode = project.getProjectCode(); | |||
@@ -52,11 +54,11 @@ public class ProjectConvertUtil { | |||
projectCollection.setBaseProjName(projectName); | |||
projectCollection.setBaseinfo(buildBaseinfo(project)); | |||
projectCollection.setApply(buildApply(project)); | |||
projectCollection.setApprove(buildApprove(project,fileService)); | |||
projectCollection.setApprove(buildApprove(project, fileService)); | |||
String projectType = project.getProjectType(); | |||
ProjectTypeNewEnum match = ProjectTypeNewEnum.match(projectType); | |||
if(Objects.nonNull(match)){ | |||
switch (match){ | |||
if (Objects.nonNull(match)) { | |||
switch (match) { | |||
case SJ_BUILD: | |||
case FIRST_BUILD: | |||
case SZ_BUILD: | |||
@@ -98,10 +100,8 @@ public class ProjectConvertUtil { | |||
baseinfo.setBaseProvManDepartDing(project.getHigherSuperOrgCode()); | |||
baseinfo.setBaseProvManDeprtType(project.getBaseProvManDeprtType()); | |||
ProjectStatusEnum match = ProjectStatusEnum.match(project.getStatus()); | |||
if(Objects.nonNull(match)){ | |||
if(Objects.nonNull(match.getCollectionStatus())){ | |||
baseinfo.setBaseProjSetProg(match.getCollectionStatus().getCode()); | |||
} | |||
if (Objects.nonNull(match) && (Objects.nonNull(match.getCollectionStatus()))) { | |||
baseinfo.setBaseProjSetProg(match.getCollectionStatus().getCode()); | |||
} | |||
baseinfo.setBaseProjType(project.getProjectType()); | |||
baseinfo.setDeleted(Boolean.FALSE); | |||
@@ -117,7 +117,7 @@ public class ProjectConvertUtil { | |||
apply.setBaseHistorProjId(project.getBaseHistorProjId()); | |||
apply.setBaseBasisEstablish(project.getBaseBasisEstablish()); | |||
List<ProjectApplicationVO> projectApplications = project.getProjectApplications(); | |||
if(CollUtil.isNotEmpty(projectApplications)){ | |||
if (CollUtil.isNotEmpty(projectApplications)) { | |||
String appName = projectApplications.stream().map(app -> { | |||
if (StringUtils.isNotBlank(app.getRelatedExistsApplication())) { | |||
return app.getRelatedExistsApplication(); | |||
@@ -140,8 +140,8 @@ public class ProjectConvertUtil { | |||
} | |||
apply.setBaseBasisAmountOri(project.getBaseBasisAmountOri()); | |||
String coreBusiness = project.getCoreBusiness(); | |||
if(StringUtils.isNotBlank(coreBusiness)){ | |||
try{ | |||
if (StringUtils.isNotBlank(coreBusiness)) { | |||
try { | |||
JSONArray coreJson = JSON.parseArray(coreBusiness); | |||
String matters = coreJson.stream().map(j -> { | |||
JSONObject matterJson = JSON.parseObject(JSON.toJSONString(j)); | |||
@@ -155,8 +155,8 @@ public class ProjectConvertUtil { | |||
.collect(Collectors.joining(StrPool.SEMICOLON_CHINA)); | |||
apply.setBaseCoreBusiness(matters); | |||
apply.setBaseCoreBusinessCode(matterCodes); | |||
}catch (Exception e){ | |||
log.error("项目转化失败",e); | |||
} catch (Exception e) { | |||
log.error("项目转化失败", e); | |||
} | |||
} | |||
apply.setBaseDevelopCode(project.getDevelopCode()); | |||
@@ -166,14 +166,14 @@ public class ProjectConvertUtil { | |||
apply.setBaseProjApplyFile(project.getProjectApplicationForm()); | |||
String beginTime = project.getBeginTime(); | |||
String endTime = project.getEndTime(); | |||
if(StringUtils.isNotBlank(beginTime)){ | |||
if (StringUtils.isNotBlank(beginTime)) { | |||
apply.setBaseProjStartTime(BizUtils.convertLocalDateTime(beginTime)); | |||
} | |||
if(StringUtils.isNotBlank(endTime)){ | |||
if (StringUtils.isNotBlank(endTime)) { | |||
apply.setBaseProjEndTime(BizUtils.convertLocalDateTime(endTime)); | |||
} | |||
if(StringUtils.isNotBlank(beginTime) && StringUtils.isNotBlank(endTime)){ | |||
try{ | |||
if (StringUtils.isNotBlank(beginTime) && StringUtils.isNotBlank(endTime)) { | |||
try { | |||
String yearEnd = endTime.split(StrPool.DASH)[0]; | |||
String yearStart = beginTime.split(StrPool.DASH)[0]; | |||
String monthEnd = endTime.split(StrPool.DASH)[1]; | |||
@@ -181,8 +181,8 @@ public class ProjectConvertUtil { | |||
Integer duration = Integer.parseInt(monthEnd) - Integer.parseInt(monthStart) + | |||
(Integer.parseInt(yearEnd) - Integer.parseInt(yearStart)) * 12; | |||
apply.setBaseProjDuration(String.valueOf(duration)); | |||
}catch (Exception e){ | |||
log.error("日期转换失败:",e); | |||
} catch (Exception e) { | |||
log.error("日期转换失败:", e); | |||
} | |||
} | |||
apply.setBaseProjConsClass(project.getBuildLevel()); | |||
@@ -203,12 +203,12 @@ public class ProjectConvertUtil { | |||
} | |||
//转化审批信息 | |||
private static GovBizProjectApproveVO buildApprove(ProjectDetailVO project,FileService fileService) { | |||
private static GovBizProjectApproveVO buildApprove(ProjectDetailVO project, FileService fileService) { | |||
GovBizProjectApproveVO approve = new GovBizProjectApproveVO(); | |||
// approve.setBaseProjId(project.getProjectCode()); | |||
approve.setBaseProjName(project.getProjectName()); | |||
File file = fileService.getById(project.getApprovedFile()); | |||
if(Objects.nonNull(file)){ | |||
if (Objects.nonNull(file)) { | |||
approve.setApprovalFile(JSON.toJSONString(Lists.newArrayList(file))); | |||
} | |||
approve.setAreaCode(RegionConst.RC_HZ); | |||
@@ -220,24 +220,24 @@ public class ProjectConvertUtil { | |||
approve.setBaseProjReplyAmount(project.getApprovalBudget()); | |||
approve.setBaseReviewCommentsFile(project.getProposeAttachFiles()); | |||
List<ProjectApplicationVO> projectApplications = project.getProjectApplications(); | |||
if(CollUtil.isNotEmpty(projectApplications)){ | |||
if (CollUtil.isNotEmpty(projectApplications)) { | |||
Integer max = 0; | |||
for(ProjectApplicationVO app : projectApplications){ | |||
max = Math.max(app.getSecrecyGrade(),max); | |||
for (ProjectApplicationVO app : projectApplications) { | |||
max = Math.max(app.getSecrecyGrade(), max); | |||
} | |||
if(max > 0){ | |||
approve.setEqualProtectionLevel(String.format(StrPool.FORMAT_DATE_SINGLE_DIGITS,max)); | |||
if (max > 0) { | |||
approve.setEqualProtectionLevel(String.format(StrPool.FORMAT_DATE_SINGLE_DIGITS, max)); | |||
} | |||
} | |||
approve.setPreliminaryDesignScheme(project.getPreliminaryPlanFile()); | |||
approve.setPreliminaryDesignFile(project.getPreliminaryInspectionMaterials()); | |||
approve.setBaseReviewOpinion(project.getProposeAttach()); | |||
if(Objects.nonNull(project.getBaseReviewResults())){ | |||
if (Objects.nonNull(project.getBaseReviewResults())) { | |||
approve.setBaseReviewResults(String.format(StrPool.FORMAT_DATE_SINGLE_DIGITS, | |||
project.getBaseReviewResults())); | |||
} | |||
List<PurchaseVO> purchases = project.getPurchases(); | |||
if(CollUtil.isNotEmpty(purchases)){ | |||
if (CollUtil.isNotEmpty(purchases)) { | |||
purchases.stream().map(PurchaseVO::getTransactionAmount) | |||
.filter(Objects::nonNull).reduce(BigDecimal::add) | |||
.ifPresent(approve::setReleaseYearMoney); | |||
@@ -256,15 +256,15 @@ public class ProjectConvertUtil { | |||
cim.setDeleted(Boolean.FALSE); | |||
cim.setBaseDevelopCode(project.getDevelopCode()); | |||
//总结报告 | |||
cim.setBaseSummReportFile(searchReportFile(project,5,2)); | |||
cim.setBaseSummReportFile(searchReportFile(project, 5, 2)); | |||
//监理总结报告 | |||
cim.setBaseEstaSummFile(searchReportFile(project,5,3)); | |||
cim.setBaseEstaSummFile(searchReportFile(project, 5, 3)); | |||
//建设核查表 | |||
cim.setBaseCheckFile(searchReportFile(project,3,2)); | |||
cim.setBaseThirdAcceptFile(searchReportFile(project,5,4)); | |||
cim.setBaseInitialOpinionFile(searchReportFile(project,5,5)); | |||
cim.setBaseCheckFile(searchReportFile(project, 3, 2)); | |||
cim.setBaseThirdAcceptFile(searchReportFile(project, 5, 4)); | |||
cim.setBaseInitialOpinionFile(searchReportFile(project, 5, 5)); | |||
List<ProjectApplicationVO> projectApplications = project.getProjectApplications(); | |||
if(CollUtil.isNotEmpty(projectApplications)){ | |||
if (CollUtil.isNotEmpty(projectApplications)) { | |||
String appCode = projectApplications.stream().map(app -> { | |||
if (StringUtils.isNotBlank(app.getRelatedExistsApplication())) { | |||
return app.getRelatedExistsApplicationCode(); | |||
@@ -286,13 +286,13 @@ public class ProjectConvertUtil { | |||
mim.setDeleted(Boolean.FALSE); | |||
mim.setBaseDevelopCode(project.getDevelopCode()); | |||
//监理总结报告 | |||
mim.setBaseEstaSummFile(searchReportFile(project,5,3)); | |||
mim.setBaseEstaSummFile(searchReportFile(project, 5, 3)); | |||
//建设核查表 | |||
// mim.setBaseCheckFile(searchReportFile(project,3,2)); | |||
mim.setBaseThirdAcceptFile(searchReportFile(project,5,4)); | |||
mim.setBaseThirdAcceptFile(searchReportFile(project, 5, 4)); | |||
// mim.setBaseInitialOpinionFile(searchReportFile(project,5,5)); | |||
List<ProjectApplicationVO> projectApplications = project.getProjectApplications(); | |||
if(CollUtil.isNotEmpty(projectApplications)){ | |||
if (CollUtil.isNotEmpty(projectApplications)) { | |||
String appCode = projectApplications.stream().map(app -> { | |||
if (StringUtils.isNotBlank(app.getRelatedExistsApplication())) { | |||
return app.getRelatedExistsApplicationCode(); | |||
@@ -309,13 +309,13 @@ public class ProjectConvertUtil { | |||
List<PurchaseVO> purchases = project.getPurchases(); | |||
ContractVO contract = project.getContract(); | |||
final BigDecimal[] paymentTotal = {BigDecimal.ZERO}; | |||
if(Objects.nonNull(contract)){ | |||
if (Objects.nonNull(contract)) { | |||
List<PaymentPlanVO> payments = contract.getPayments(); | |||
payments.stream().map(PaymentPlanVO::getPaymentAmount) | |||
.reduce(BigDecimal::add) | |||
.ifPresent(b -> paymentTotal[0] = b); | |||
} | |||
if(CollUtil.isNotEmpty(purchases)){ | |||
if (CollUtil.isNotEmpty(purchases)) { | |||
return purchases.stream().map(p -> { | |||
GovBizProjectProcureVO purchase = new GovBizProjectProcureVO(); | |||
purchase.setBaseProjName(project.getProjectName()); | |||
@@ -333,7 +333,7 @@ public class ProjectConvertUtil { | |||
purchase.setBaseWinningBidTime(p.getTransactionTime()); | |||
purchase.setBiddingFile(p.getAcceptanceLetter()); | |||
purchase.setPaymentProgress(paymentTotal[0]); | |||
if(Objects.nonNull(contract)){ | |||
if (Objects.nonNull(contract)) { | |||
purchase.setPurchaseContract(contract.getAttachment()); | |||
} | |||
purchase.setSetProjCodeFinan(project.getFinancialCode()); | |||
@@ -346,31 +346,32 @@ public class ProjectConvertUtil { | |||
/** | |||
* 查询项目 初验终验的 报告 | |||
* | |||
* @param project | |||
* @return | |||
*/ | |||
private static String searchReportFile(ProjectDetailVO project,Integer firstIndex,Integer secondIndex) { | |||
if(Objects.isNull(project)){ | |||
private static String searchReportFile(ProjectDetailVO project, Integer firstIndex, Integer secondIndex) { | |||
if (Objects.isNull(project)) { | |||
return null; | |||
} | |||
if(StringUtils.isNotBlank(project.getFinalAcceptanceMaterials())){ | |||
return searchReportFileInner(project.getFinalAcceptanceMaterials(),firstIndex,secondIndex); | |||
}else if(StringUtils.isNotBlank(project.getPreliminaryInspectionMaterials())){ | |||
return searchReportFileInner(project.getFinalAcceptanceMaterials(),firstIndex,secondIndex); | |||
if (StringUtils.isNotBlank(project.getFinalAcceptanceMaterials())) { | |||
return searchReportFileInner(project.getFinalAcceptanceMaterials(), firstIndex, secondIndex); | |||
} else if (StringUtils.isNotBlank(project.getPreliminaryInspectionMaterials())) { | |||
return searchReportFileInner(project.getFinalAcceptanceMaterials(), firstIndex, secondIndex); | |||
} | |||
return null; | |||
} | |||
private static String searchReportFileInner(String fileStr,Integer firstIndex,Integer secondIndex) { | |||
try{ | |||
private static String searchReportFileInner(String fileStr, Integer firstIndex, Integer secondIndex) { | |||
try { | |||
JSONArray jsonArray = JSON.parseArray(fileStr); | |||
JSONObject jsonObject = JSON.parseObject(JSON.toJSONString(jsonArray.get(firstIndex - 1))); | |||
JSONArray data = jsonObject.getJSONArray("data"); | |||
JSONObject wangong = JSON.parseObject(JSON.toJSONString(data.get(secondIndex - 1))); | |||
JSONArray files = wangong.getJSONArray("files"); | |||
return JSON.toJSONString(files); | |||
}catch (Exception e){ | |||
log.error("解析文件失败:",e); | |||
} catch (Exception e) { | |||
log.error("解析文件失败:", e); | |||
} | |||
return null; | |||
} | |||
@@ -1,8 +1,6 @@ | |||
package com.hz.pm.api.projectlib.controller; | |||
import com.alibaba.fastjson.JSONObject; | |||
import com.ningdatech.basic.model.PageVo; | |||
import com.ningdatech.log.annotation.WebLog; | |||
import com.hz.pm.api.common.helper.UserInfoHelper; | |||
import com.hz.pm.api.gov.model.vo.GovBizProjectDetailVO; | |||
import com.hz.pm.api.projectlib.manage.ProjectLibManage; | |||
@@ -13,6 +11,8 @@ import com.hz.pm.api.projectlib.model.vo.ProjectDetailVO; | |||
import com.hz.pm.api.projectlib.model.vo.ProjectLibListItemVO; | |||
import com.hz.pm.api.user.security.model.UserFullInfoDTO; | |||
import com.hz.pm.api.user.util.LoginUserUtil; | |||
import com.ningdatech.basic.model.PageVo; | |||
import com.ningdatech.log.annotation.WebLog; | |||
import com.wflow.workflow.bean.vo.ProcessDetailVO; | |||
import io.swagger.annotations.Api; | |||
import io.swagger.annotations.ApiOperation; | |||
@@ -45,21 +45,21 @@ public class ProjectLibController { | |||
@ApiOperation("项目库列表") | |||
public PageVo<ProjectLibListItemVO> projectLibList(ProjectListReq req) { | |||
UserFullInfoDTO user = userInfoHelper.getUserFullInfo(LoginUserUtil.getUserId()); | |||
return projectLibManage.projectLibListWithPermission(req,user); | |||
return projectLibManage.projectLibListWithPermission(req, user); | |||
} | |||
@GetMapping("/all-list") | |||
@ApiOperation("包含申报项目列表和项目归集列表") | |||
public PageVo<ProjectLibListItemVO> projectAllList(ProjectListReq req) { | |||
UserFullInfoDTO user = userInfoHelper.getUserFullInfo(LoginUserUtil.getUserId()); | |||
return projectLibManage.projectAllListWithPermission(req,user); | |||
return projectLibManage.projectAllListWithPermission(req, user); | |||
} | |||
@GetMapping("/lib-list") | |||
@ApiOperation("包含申报项目列表和项目归集(运维项目)列表") | |||
public PageVo<ProjectLibListItemVO> libList(ProjectListReq req) { | |||
UserFullInfoDTO user = userInfoHelper.getUserFullInfo(LoginUserUtil.getUserId()); | |||
return projectLibManage.libListWithPermission(req,user); | |||
return projectLibManage.libListWithPermission(req, user); | |||
} | |||
@GetMapping("/history-list/{id}") | |||
@@ -82,38 +82,38 @@ public class ProjectLibController { | |||
@GetMapping("/prePlan/{id}") | |||
@ApiOperation("获取项目初步方案详情") | |||
public ProjectDetailVO constructDetail (@PathVariable Long id){ | |||
public ProjectDetailVO constructDetail(@PathVariable Long id) { | |||
return projectLibManage.getPrePlanProjectDetail(id); | |||
} | |||
@GetMapping("/{id}") | |||
@ApiOperation("获取项目详情") | |||
public ProjectDetailVO detail (@PathVariable Long id){ | |||
public ProjectDetailVO detail(@PathVariable Long id) { | |||
return projectLibManage.getProjectDetail(id); | |||
} | |||
@GetMapping("/convert-to-collection/{projectCode}") | |||
@ApiOperation("申报项目转化为项目归集") | |||
public GovBizProjectDetailVO convertToCollection(@PathVariable String projectCode){ | |||
public GovBizProjectDetailVO convertToCollection(@PathVariable String projectCode) { | |||
return projectLibManage.convertToCollection(projectCode); | |||
} | |||
@GetMapping("/detail/{projectCode}") | |||
@ApiOperation("获取项目详情(编号)") | |||
public ProjectDetailVO detailProjectCode (@PathVariable String projectCode){ | |||
public ProjectDetailVO detailProjectCode(@PathVariable String projectCode) { | |||
return projectLibManage.detailProjectCode(projectCode); | |||
} | |||
@GetMapping("/processSchedule/{projectId}") | |||
@ApiOperation("项目库申报项目当前进度详情") | |||
public List<ProcessDetailVO> processScheduleDetail(@PathVariable("projectId") Long projectId){ | |||
public List<ProcessDetailVO> processScheduleDetail(@PathVariable("projectId") Long projectId) { | |||
return projectLibManage.processScheduleDetail(projectId); | |||
} | |||
@PostMapping("/exportList") | |||
@ApiOperation("项目库列表导出") | |||
@WebLog("项目库列表导出") | |||
public void exportList(@Valid @RequestBody ProjectListReq param, HttpServletResponse response){ | |||
projectLibManage.exportList(param,response); | |||
public void exportList(@Valid @RequestBody ProjectListReq param, HttpServletResponse response) { | |||
projectLibManage.exportList(param, response); | |||
} | |||
} |