瀏覽代碼

feat:

1. 项目预警监测不展示已变更和已终止项目信息;
tags/24121201
WendyYang 1 月之前
父節點
當前提交
b5e1554ee5
共有 1 個檔案被更改,包括 9 行新增10 行删除
  1. +9
    -10
      hz-pm-api/src/main/java/com/hz/pm/api/workbench/manage/WorkbenchManage.java

+ 9
- 10
hz-pm-api/src/main/java/com/hz/pm/api/workbench/manage/WorkbenchManage.java 查看文件

@@ -19,6 +19,7 @@ import com.hz.pm.api.common.statemachine.event.AbstractStateChangeEvent;
import com.hz.pm.api.common.statemachine.event.ProjectStateChangeEvent;
import com.hz.pm.api.common.statemachine.event.TenderStateChangeEvent;
import com.hz.pm.api.common.statemachine.event.XcfhxStateChangeEvent;
import com.hz.pm.api.common.util.BizUtils;
import com.hz.pm.api.common.util.DecimalUtil;
import com.hz.pm.api.projectdeclared.model.entity.Contract;
import com.hz.pm.api.projectdeclared.model.entity.Purchase;
@@ -958,26 +959,24 @@ public class WorkbenchManage {
}

public List<WorkbenchProjectMonitorEarlyWarnVO> projectMonitorEarlyWarnings(WorkbenchReq req) {
UserInfoDetails userInfoDetails = LoginUserUtil.userDetail();
UserInfoDetails userInfoDetails = LoginUserUtil.userDetailNotNull();
// 从预警表中查询当前登录用户所能查看的项目
LambdaQueryWrapper<ProjectEarlyWarning> queryWrapper = Wrappers.lambdaQuery(ProjectEarlyWarning.class);
buildPermissionWarningWrapper(queryWrapper, userInfoDetails);
// 查询状态非正常的预警信息
queryWrapper.eq(ProjectEarlyWarning::getNormal, Boolean.FALSE);
queryWrapper.ne(ProjectEarlyWarning::getStatus, ProjectEarlyWarningStatusEnum.NORMAL);
List<ProjectStatus> hiddenProjectStatus = Arrays.asList(ProjectStatus.STOPPED_PASSED, ProjectStatus.CHANGE_APPLY_PASSED);
String hiddenStatusInSql = BizUtils.inSqlJoin(CollUtils.convert(hiddenProjectStatus, w -> w.getCode().toString()));
StringBuilder existsProjectSql = new StringBuilder("select 1 from nd_project np where np.project_code = nd_project_early_warning.project_code" +
" and np.newest = 1 and np.status not in " + hiddenStatusInSql);
if (req.getUnitStrip() != null) {
String unitStripSql = String.format("select 1 from nd_project np where " +
"np.project_code = nd_project_early_warning.project_code " +
" and np.newest = 1 and np.unit_strip = %d", req.getUnitStrip());
queryWrapper.exists(unitStripSql);
existsProjectSql.append(" and np.unit_strip = ").append(req.getUnitStrip());
}
if (req.getProjectYear() != null) {
String projectYearSql = String.format("select 1 from nd_project np where " +
"np.project_code = nd_project_early_warning.project_code " +
" and np.newest = 1 and np.project_year = %d", req.getProjectYear());
queryWrapper.exists(projectYearSql);
existsProjectSql.append(" and np.project_year = ").append(req.getProjectYear());
}
queryWrapper.exists(existsProjectSql.toString());
List<ProjectEarlyWarning> records = projectEarlyWarningService.list(queryWrapper);
if (Objects.nonNull(req.getUnitId())) {
List<Long> viewUnitIds = mhUnitCache.getViewChildIdsRecursion(req.getUnitId());


Loading…
取消
儲存