|
@@ -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.ProjectStateChangeEvent; |
|
|
import com.hz.pm.api.common.statemachine.event.TenderStateChangeEvent; |
|
|
import com.hz.pm.api.common.statemachine.event.TenderStateChangeEvent; |
|
|
import com.hz.pm.api.common.statemachine.event.XcfhxStateChangeEvent; |
|
|
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.common.util.DecimalUtil; |
|
|
import com.hz.pm.api.projectdeclared.model.entity.Contract; |
|
|
import com.hz.pm.api.projectdeclared.model.entity.Contract; |
|
|
import com.hz.pm.api.projectdeclared.model.entity.Purchase; |
|
|
import com.hz.pm.api.projectdeclared.model.entity.Purchase; |
|
@@ -958,26 +959,24 @@ public class WorkbenchManage { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public List<WorkbenchProjectMonitorEarlyWarnVO> projectMonitorEarlyWarnings(WorkbenchReq req) { |
|
|
public List<WorkbenchProjectMonitorEarlyWarnVO> projectMonitorEarlyWarnings(WorkbenchReq req) { |
|
|
UserInfoDetails userInfoDetails = LoginUserUtil.userDetail(); |
|
|
|
|
|
|
|
|
UserInfoDetails userInfoDetails = LoginUserUtil.userDetailNotNull(); |
|
|
// 从预警表中查询当前登录用户所能查看的项目 |
|
|
// 从预警表中查询当前登录用户所能查看的项目 |
|
|
LambdaQueryWrapper<ProjectEarlyWarning> queryWrapper = Wrappers.lambdaQuery(ProjectEarlyWarning.class); |
|
|
LambdaQueryWrapper<ProjectEarlyWarning> queryWrapper = Wrappers.lambdaQuery(ProjectEarlyWarning.class); |
|
|
buildPermissionWarningWrapper(queryWrapper, userInfoDetails); |
|
|
buildPermissionWarningWrapper(queryWrapper, userInfoDetails); |
|
|
// 查询状态非正常的预警信息 |
|
|
// 查询状态非正常的预警信息 |
|
|
queryWrapper.eq(ProjectEarlyWarning::getNormal, Boolean.FALSE); |
|
|
queryWrapper.eq(ProjectEarlyWarning::getNormal, Boolean.FALSE); |
|
|
queryWrapper.ne(ProjectEarlyWarning::getStatus, ProjectEarlyWarningStatusEnum.NORMAL); |
|
|
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) { |
|
|
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) { |
|
|
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); |
|
|
List<ProjectEarlyWarning> records = projectEarlyWarningService.list(queryWrapper); |
|
|
if (Objects.nonNull(req.getUnitId())) { |
|
|
if (Objects.nonNull(req.getUnitId())) { |
|
|
List<Long> viewUnitIds = mhUnitCache.getViewChildIdsRecursion(req.getUnitId()); |
|
|
List<Long> viewUnitIds = mhUnitCache.getViewChildIdsRecursion(req.getUnitId()); |
|
|