From b5e1554ee50255774624191ef1cb35b768380f13 Mon Sep 17 00:00:00 2001 From: WendyYang Date: Mon, 2 Dec 2024 14:02:09 +0800 Subject: [PATCH] =?UTF-8?q?feat:=201.=20=E9=A1=B9=E7=9B=AE=E9=A2=84?= =?UTF-8?q?=E8=AD=A6=E7=9B=91=E6=B5=8B=E4=B8=8D=E5=B1=95=E7=A4=BA=E5=B7=B2?= =?UTF-8?q?=E5=8F=98=E6=9B=B4=E5=92=8C=E5=B7=B2=E7=BB=88=E6=AD=A2=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE=E4=BF=A1=E6=81=AF=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hz/pm/api/workbench/manage/WorkbenchManage.java | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/workbench/manage/WorkbenchManage.java b/hz-pm-api/src/main/java/com/hz/pm/api/workbench/manage/WorkbenchManage.java index c186701..79ea93d 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/workbench/manage/WorkbenchManage.java +++ b/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 projectMonitorEarlyWarnings(WorkbenchReq req) { - UserInfoDetails userInfoDetails = LoginUserUtil.userDetail(); + UserInfoDetails userInfoDetails = LoginUserUtil.userDetailNotNull(); // 从预警表中查询当前登录用户所能查看的项目 LambdaQueryWrapper queryWrapper = Wrappers.lambdaQuery(ProjectEarlyWarning.class); buildPermissionWarningWrapper(queryWrapper, userInfoDetails); // 查询状态非正常的预警信息 queryWrapper.eq(ProjectEarlyWarning::getNormal, Boolean.FALSE); queryWrapper.ne(ProjectEarlyWarning::getStatus, ProjectEarlyWarningStatusEnum.NORMAL); + List 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 records = projectEarlyWarningService.list(queryWrapper); if (Objects.nonNull(req.getUnitId())) { List viewUnitIds = mhUnitCache.getViewChildIdsRecursion(req.getUnitId());