|
|
@@ -5,13 +5,14 @@ import cn.hutool.core.util.NumberUtil; |
|
|
|
import cn.hutool.core.util.StrUtil; |
|
|
|
import cn.hutool.json.JSONUtil; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.Wrapper; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|
|
|
import com.hz.pm.api.common.model.constant.ExistsSqlConst; |
|
|
|
import com.hz.pm.api.common.statemachine.event.ProjectStateChangeEvent; |
|
|
|
import com.hz.pm.api.common.util.BizDateUtil; |
|
|
|
import com.hz.pm.api.common.util.BizUtils; |
|
|
|
import com.hz.pm.api.open.model.po.MhSyncProjectListPO; |
|
|
|
import com.hz.pm.api.open.model.po.TenderSystemListReq; |
|
|
|
import com.hz.pm.api.open.model.po.TenderListReq; |
|
|
|
import com.hz.pm.api.open.model.vo.DeclaredProjectInfoToMhVO; |
|
|
|
import com.hz.pm.api.open.model.vo.ReferSystemReplaceInfoToMhVO; |
|
|
|
import com.hz.pm.api.open.model.vo.TenderToMhDetailVO; |
|
|
@@ -192,9 +193,29 @@ public class OpenApiProjectLibManage { |
|
|
|
return StrUtil.EMPTY; |
|
|
|
} |
|
|
|
|
|
|
|
public List<TenderToMhDetailVO> listTenders(TenderSystemListReq req) { |
|
|
|
public List<TenderToMhDetailVO> listTenders(TenderListReq req) { |
|
|
|
openApiCheckSignUtil.checkSign(req.getKey()); |
|
|
|
List<Purchase> purchases = purchaseService.list(); |
|
|
|
LambdaQueryWrapper<Purchase> purQuery = Wrappers.lambdaQuery(Purchase.class) |
|
|
|
.orderByDesc(Purchase::getCreateOn) |
|
|
|
.orderByDesc(Purchase::getId); |
|
|
|
if (req.hasProjectQuery()) { |
|
|
|
Wrapper<Project> projQuery = Wrappers.lambdaQuery(Project.class) |
|
|
|
.select(Project::getId, Project::getProjectCode) |
|
|
|
.eq(req.getProjectYear() != null, Project::getProjectYear, req.getProjectYear()) |
|
|
|
.eq(req.getBuildOrgCode() != null, Project::getBuildOrgCode, req.getBuildOrgCode()) |
|
|
|
.eq(req.getProjectCode() != null, Project::getProjectCode, req.getProjectCode()) |
|
|
|
.eq(Project::getNewest, Boolean.TRUE); |
|
|
|
List<Project> projects = projectService.list(projQuery); |
|
|
|
if (projects.isEmpty()) { |
|
|
|
return Collections.emptyList(); |
|
|
|
} |
|
|
|
List<Long> projectIds = projects.stream() |
|
|
|
.map(w -> ProjectIdCodeCacheUtil.get(w.getProjectCode())) |
|
|
|
.flatMap(Collection::stream) |
|
|
|
.collect(Collectors.toList()); |
|
|
|
purQuery.in(Purchase::getProjectId, projectIds); |
|
|
|
} |
|
|
|
List<Purchase> purchases = purchaseService.list(purQuery); |
|
|
|
if (purchases.isEmpty()) { |
|
|
|
return Collections.emptyList(); |
|
|
|
} |
|
|
@@ -216,6 +237,7 @@ public class OpenApiProjectLibManage { |
|
|
|
List<TenderToMhDetailVO> collect = purchases.stream().map(w -> { |
|
|
|
TenderToMhDetailVO tender = new TenderToMhDetailVO(); |
|
|
|
tender.setBidId(w.getId()); |
|
|
|
tender.setCreateOn(w.getCreateOn()); |
|
|
|
tender.setProjectCode(ProjectIdCodeCacheUtil.get(w.getProjectId())); |
|
|
|
tender.setName(w.getBidName()); |
|
|
|
tender.setBuyMain(String.valueOf(w.getPurchaseUnitId())); |
|
|
@@ -231,7 +253,7 @@ public class OpenApiProjectLibManage { |
|
|
|
|
|
|
|
Operation operation = operationMap.get(w.getId()); |
|
|
|
if (operation != null) { |
|
|
|
tender.setRefactorTime(operation.getAdaptationTime()); |
|
|
|
tender.setRefactorTime(operation.getActualAdaptionTime()); |
|
|
|
} |
|
|
|
|
|
|
|
BizUtils.notNull(w.getXcfhxEvalFinishDate(), ft -> tender.setXcCompleteTime(ft.atStartOfDay())); |
|
|
|