diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/PurchaseManage.java b/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/PurchaseManage.java index e385c5b..ec434ca 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/PurchaseManage.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/PurchaseManage.java @@ -17,6 +17,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.google.common.collect.Lists; import com.hz.pm.api.common.enumeration.ProjectProcessType; import com.hz.pm.api.common.helper.UserInfoHelper; +import com.hz.pm.api.common.model.constant.ExistsSqlConst; import com.hz.pm.api.common.statemachine.event.AbstractStateChangeEvent; import com.hz.pm.api.common.statemachine.event.AdaptStateChangeEvent; import com.hz.pm.api.common.statemachine.event.SelfTestStateChangeEvent; @@ -148,7 +149,7 @@ public class PurchaseManage { query.eq(Project::getNewest, Boolean.TRUE); query.orderByAsc(Project::getApprovalDate); if (req.getBidStatus() != null) { - query.exists("select 1 from nd_purchase np where np.project_id = nd_project.id " + + query.exists(ExistsSqlConst.PROJECT_EXISTS_PURCHASE + "and (np.status = {0} or np.adapt_status = {0} or np.self_test_status = {0} " + " or np.test_valid_status = {0} or np.xcfhx_apply_status = {0})", req.getBidStatus()); } @@ -483,6 +484,8 @@ public class PurchaseManage { .le(req.getCreateOnMax() != null, Purchase::getCreateOn, req.getCreateOnMax()) .ge(req.getCreateOnMin() != null, Purchase::getCreateOn, req.getCreateOnMin()) .eq(req.getStatus() != null, function, req.getStatus()) + .notExists(ExistsSqlConst.PURCHASE_EXISTS_PROJECT + + "and np.stage != {0}", ProjectStatus.STOPPED) .isNotNull(function) .orderByDesc(Purchase::getCreateOn); boolean display = !Boolean.FALSE.equals(req.getDisplay());