@@ -16,6 +16,7 @@ import com.hz.pm.api.common.enumeration.BoolDisplayEnum; | |||||
import com.hz.pm.api.common.enumeration.CommonEnum; | import com.hz.pm.api.common.enumeration.CommonEnum; | ||||
import com.hz.pm.api.common.enumeration.ProjectProcessType; | import com.hz.pm.api.common.enumeration.ProjectProcessType; | ||||
import com.hz.pm.api.common.helper.UserInfoHelper; | import com.hz.pm.api.common.helper.UserInfoHelper; | ||||
import com.hz.pm.api.common.model.constant.ExistsSqlConst; | |||||
import com.hz.pm.api.common.model.constant.MhUnitConst; | import com.hz.pm.api.common.model.constant.MhUnitConst; | ||||
import com.hz.pm.api.common.model.constant.TypeReferenceConst; | import com.hz.pm.api.common.model.constant.TypeReferenceConst; | ||||
import com.hz.pm.api.common.statemachine.event.ProjectStateChangeEvent; | import com.hz.pm.api.common.statemachine.event.ProjectStateChangeEvent; | ||||
@@ -353,19 +354,38 @@ public class DeclaredProjectManage { | |||||
* @return | * @return | ||||
*/ | */ | ||||
public PageVo<ProjectLibListItemVO> projectLibList(ProjectListReq req) { | public PageVo<ProjectLibListItemVO> projectLibList(ProjectListReq req) { | ||||
Integer status = req.getStatus(); | |||||
req.setStatus(null); | |||||
UserFullInfoDTO user = userInfoHelper.getUserFullInfo(LoginUserUtil.getUserId()); | UserFullInfoDTO user = userInfoHelper.getUserFullInfo(LoginUserUtil.getUserId()); | ||||
LambdaQueryWrapper<Project> query = ProjectManageUtil.projectQuery(req); | LambdaQueryWrapper<Project> query = ProjectManageUtil.projectQuery(req); | ||||
// 当非预审申报的时候 是自己单位 当是预审申报的时候 要主管单位 | // 当非预审申报的时候 是自己单位 当是预审申报的时候 要主管单位 | ||||
if (!projectQueryPermission(query, user, req.getDeclaredUnitId())) { | if (!projectQueryPermission(query, user, req.getDeclaredUnitId())) { | ||||
return PageVo.empty(); | return PageVo.empty(); | ||||
} | } | ||||
if (status != null) { | |||||
if (ProjectStatus.COMPLIANCE_REVIEW_PASSED.eq(status)) { | |||||
query.exists(ExistsSqlConst.PROJECT_EXISTS_STATUS_CHANGE + | |||||
" and npsc.event = {0}", ProjectStateChangeEvent.COMPLIANCE_REVIEW_PASS); | |||||
} else { | |||||
query.eq(Project::getStatus, status); | |||||
} | |||||
} | |||||
query.ne(Project::getStage, ProjectStatus.STOPPED.getCode()); | |||||
query.eq(Project::getNewest, Boolean.TRUE); | query.eq(Project::getNewest, Boolean.TRUE); | ||||
Page<Project> page = projectService.page(req.page(), query); | Page<Project> page = projectService.page(req.page(), query); | ||||
if (page.getTotal() == 0) { | if (page.getTotal() == 0) { | ||||
return PageVo.empty(); | return PageVo.empty(); | ||||
} | } | ||||
List<ProjectLibListItemVO> records = CollUtils.convert(page.getRecords(), | |||||
w -> BeanUtil.copyProperties(w, ProjectLibListItemVO.class)); | |||||
List<ProjectLibListItemVO> records = CollUtils.convert(page.getRecords(), w -> { | |||||
ProjectLibListItemVO item = BeanUtil.copyProperties(w, ProjectLibListItemVO.class); | |||||
if (!ProjectStatus.TO_BE_DECLARED.eq(w.getStatus()) | |||||
&& ProjectStatus.COMPLIANCE_REVIEW_FAILED.eq(w.getStatus()) | |||||
&& ProjectStatus.ON_COMPLIANCE_REVIEW.eq(w.getStatus()) | |||||
&& !ProjectStatus.CHANGE.eq(w.getStage())) { | |||||
item.setStatus(ProjectStatus.COMPLIANCE_REVIEW_PASSED.getCode()); | |||||
} | |||||
return item; | |||||
}); | |||||
return PageVo.of(records, page.getTotal()); | return PageVo.of(records, page.getTotal()); | ||||
} | } | ||||
@@ -7,6 +7,8 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | |||||
import com.hz.pm.api.common.enumeration.ProjectProcessType; | import com.hz.pm.api.common.enumeration.ProjectProcessType; | ||||
import com.hz.pm.api.common.helper.UserInfoHelper; | import com.hz.pm.api.common.helper.UserInfoHelper; | ||||
import com.hz.pm.api.common.model.constant.BizConst; | import com.hz.pm.api.common.model.constant.BizConst; | ||||
import com.hz.pm.api.common.model.constant.ExistsSqlConst; | |||||
import com.hz.pm.api.common.statemachine.event.ProjectStateChangeEvent; | |||||
import com.hz.pm.api.common.statemachine.util.ProjectStateMachineUtil; | import com.hz.pm.api.common.statemachine.util.ProjectStateMachineUtil; | ||||
import com.hz.pm.api.datascope.model.DataScopeDTO; | import com.hz.pm.api.datascope.model.DataScopeDTO; | ||||
import com.hz.pm.api.datascope.utils.DataScopeUtil; | import com.hz.pm.api.datascope.utils.DataScopeUtil; | ||||
@@ -121,8 +123,8 @@ public class ProjectReviewManage { | |||||
/** | /** | ||||
* 项目列表 | * 项目列表 | ||||
* | * | ||||
* @param req | |||||
* @return | |||||
* @param req \ | |||||
* @return \ | |||||
*/ | */ | ||||
public PageVo<ProjectLibListItemVO> pageReviewProject(ProjectListReq req) { | public PageVo<ProjectLibListItemVO> pageReviewProject(ProjectListReq req) { | ||||
UserFullInfoDTO user = userInfoHelper.getUserFullInfo(LoginUserUtil.getUserId()); | UserFullInfoDTO user = userInfoHelper.getUserFullInfo(LoginUserUtil.getUserId()); | ||||
@@ -130,20 +132,38 @@ public class ProjectReviewManage { | |||||
if (!projectQueryPermission(query, user, req.getDeclaredUnitId())) { | if (!projectQueryPermission(query, user, req.getDeclaredUnitId())) { | ||||
return PageVo.empty(); | return PageVo.empty(); | ||||
} | } | ||||
Integer status = req.getStatus(); | |||||
if (status != null) { | |||||
req.setStatus(null); | |||||
if (ProjectStatus.PROJECT_REVIEW_PASSED.eq(status)) { | |||||
query.exists(ExistsSqlConst.PROJECT_EXISTS_STATUS_CHANGE + | |||||
" and npsc.event = {0}", ProjectStateChangeEvent.PROJECT_REVIEW_PASS); | |||||
} else { | |||||
query.eq(Project::getStatus, status); | |||||
} | |||||
} else { | |||||
query.exists(ExistsSqlConst.PROJECT_EXISTS_STATUS_CHANGE + | |||||
" and npsc.event = {0}", ProjectStateChangeEvent.COMPLIANCE_REVIEW_PASS); | |||||
} | |||||
ProjectManageUtil.projectQuery(query, req); | ProjectManageUtil.projectQuery(query, req); | ||||
query.in(Project::getStatus, | |||||
ProjectStatus.WITHOUT_PROJECT_REVIEW.getCode(), | |||||
ProjectStatus.ON_PROJECT_REVIEW.getCode(), | |||||
ProjectStatus.PROJECT_REVIEW_FAILED.getCode()) | |||||
.eq(Project::getNewest, Boolean.TRUE); | |||||
query.eq(Project::getNewest, Boolean.TRUE) | |||||
.ne(Project::getStage, ProjectStatus.STOPPED.getCode()); | |||||
Page<Project> page = projectService.page(req.page(), query); | Page<Project> page = projectService.page(req.page(), query); | ||||
long total; | |||||
if ((total = page.getTotal()) == 0) { | |||||
if (page.getTotal() == 0) { | |||||
return PageVo.empty(); | return PageVo.empty(); | ||||
} | } | ||||
List<ProjectLibListItemVO> records = CollUtils.convert(page.getRecords(), | |||||
w -> BeanUtil.copyProperties(w, ProjectLibListItemVO.class)); | |||||
return PageVo.of(records, total); | |||||
List<ProjectLibListItemVO> records = CollUtils.convert(page.getRecords(), w -> { | |||||
ProjectLibListItemVO item = BeanUtil.copyProperties(w, ProjectLibListItemVO.class); | |||||
if (!ProjectStatus.PROJECT_REVIEW_FAILED.eq(w.getStatus()) | |||||
&& !ProjectStatus.COMPLIANCE_REVIEW_PASSED.eq(w.getStatus()) | |||||
&& !ProjectStatus.WITHOUT_PROJECT_REVIEW.eq(w.getStatus()) | |||||
&& !ProjectStatus.ON_PROJECT_REVIEW.eq(w.getStatus()) | |||||
&& !ProjectStatus.CHANGE.eq(w.getStage())) { | |||||
item.setStatus(ProjectStatus.PROJECT_REVIEW_PASSED.getCode()); | |||||
} | |||||
return item; | |||||
}); | |||||
return PageVo.of(records, page.getTotal()); | |||||
} | } | ||||
private boolean projectQueryPermission(LambdaQueryWrapper<Project> query, | private boolean projectQueryPermission(LambdaQueryWrapper<Project> query, | ||||
@@ -4,6 +4,7 @@ import cn.hutool.core.bean.BeanUtil; | |||||
import cn.hutool.core.bean.copier.CopyOptions; | import cn.hutool.core.bean.copier.CopyOptions; | ||||
import cn.hutool.core.collection.CollUtil; | import cn.hutool.core.collection.CollUtil; | ||||
import cn.hutool.core.lang.Assert; | import cn.hutool.core.lang.Assert; | ||||
import cn.hutool.core.util.ArrayUtil; | |||||
import cn.hutool.core.util.NumberUtil; | import cn.hutool.core.util.NumberUtil; | ||||
import com.alibaba.fastjson.JSONObject; | import com.alibaba.fastjson.JSONObject; | ||||
import com.baomidou.mybatisplus.core.conditions.Wrapper; | import com.baomidou.mybatisplus.core.conditions.Wrapper; | ||||
@@ -962,7 +963,9 @@ public class ProjectLibManage { | |||||
replaceInfo.setSourceSystem(curr.getSourceSystemNames().get(i1)); | replaceInfo.setSourceSystem(curr.getSourceSystemNames().get(i1)); | ||||
replaceInfo.setTargetSystem(curr.getTargetSystemName()); | replaceInfo.setTargetSystem(curr.getTargetSystemName()); | ||||
replaceInfo.setBatchNo(i + 1); | replaceInfo.setBatchNo(i + 1); | ||||
replaceInfo.setSourceSystemId(curr.getSourceSystemIds().get(i1)); | |||||
if (ArrayUtil.isNotEmpty(curr.getSourceSystemIds())) { | |||||
replaceInfo.setSourceSystemId(curr.getSourceSystemIds().get(i1)); | |||||
} | |||||
replaceInfos.add(replaceInfo); | replaceInfos.add(replaceInfo); | ||||
} | } | ||||
} | } | ||||
@@ -31,6 +31,7 @@ public enum ProjectStatus implements IStatus<Integer, String> { | |||||
*/ | */ | ||||
ON_COMPLIANCE_REVIEW(10030, "合规性审查中", 10000), | ON_COMPLIANCE_REVIEW(10030, "合规性审查中", 10000), | ||||
COMPLIANCE_REVIEW_FAILED(10031, "合规性审查不通过", 10000), | COMPLIANCE_REVIEW_FAILED(10031, "合规性审查不通过", 10000), | ||||
COMPLIANCE_REVIEW_PASSED(10032, "合规性审查通过", 10000), | |||||
/** | /** | ||||
* 项目评审 | * 项目评审 | ||||
@@ -38,6 +39,7 @@ public enum ProjectStatus implements IStatus<Integer, String> { | |||||
WITHOUT_PROJECT_REVIEW(10040, "待项目评审", 10000), | WITHOUT_PROJECT_REVIEW(10040, "待项目评审", 10000), | ||||
ON_PROJECT_REVIEW(10041, "项目评审中", 10000), | ON_PROJECT_REVIEW(10041, "项目评审中", 10000), | ||||
PROJECT_REVIEW_FAILED(10042, "项目评审不通过", 10000), | PROJECT_REVIEW_FAILED(10042, "项目评审不通过", 10000), | ||||
PROJECT_REVIEW_PASSED(10043, "项目评审通过", 10000), | |||||
ON_ANNUAL_PLAN(10010, "年度计划中", 10000), | ON_ANNUAL_PLAN(10010, "年度计划中", 10000), | ||||
@@ -68,7 +68,7 @@ public class QxWorkbenchManage { | |||||
stat.setTotalBudget(DecimalUtil.sum(purchases, QxPurchase::getPurchaseBudget)); | stat.setTotalBudget(DecimalUtil.sum(purchases, QxPurchase::getPurchaseBudget)); | ||||
stat.setTotalContractAmount(DecimalUtil.sum(purchases, QxPurchase::getContractAmount)); | stat.setTotalContractAmount(DecimalUtil.sum(purchases, QxPurchase::getContractAmount)); | ||||
QueryWrapper<QxProjectSystemReplaceInfos> wrapper = new QueryWrapper<>(); | QueryWrapper<QxProjectSystemReplaceInfos> wrapper = new QueryWrapper<>(); | ||||
wrapper.select("count(distinct project_id) adaptCount"); | |||||
wrapper.select("count(distinct project_id) \"adaptCount\""); | |||||
wrapper.in("project_id", projectIds); | wrapper.in("project_id", projectIds); | ||||
wrapper.isNotNull("has_security_eval"); | wrapper.isNotNull("has_security_eval"); | ||||
Map<String, Object> map = qxProjectSystemReplaceInfosService.getMap(wrapper); | Map<String, Object> map = qxProjectSystemReplaceInfosService.getMap(wrapper); | ||||