diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/open/controller/OpenApiProjectLibController.java b/hz-pm-api/src/main/java/com/hz/pm/api/open/controller/OpenApiProjectLibController.java index 17144f2..b6046fa 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/open/controller/OpenApiProjectLibController.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/open/controller/OpenApiProjectLibController.java @@ -2,7 +2,7 @@ package com.hz.pm.api.open.controller; import com.hz.pm.api.open.manage.OpenApiProjectLibManage; 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.TenderToMhDetailVO; import io.swagger.annotations.Api; @@ -40,7 +40,7 @@ public class OpenApiProjectLibController { @PostMapping("/listTenders") @ApiOperation("获取所有标项系统信息") - public List listTenders(@RequestBody @Valid TenderSystemListReq req) { + public List listTenders(@RequestBody @Valid TenderListReq req) { return openApiProjectLibManage.listTenders(req); } diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/open/manage/OpenApiProjectLibManage.java b/hz-pm-api/src/main/java/com/hz/pm/api/open/manage/OpenApiProjectLibManage.java index 3e35c20..ce32176 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/open/manage/OpenApiProjectLibManage.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/open/manage/OpenApiProjectLibManage.java @@ -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 listTenders(TenderSystemListReq req) { + public List listTenders(TenderListReq req) { openApiCheckSignUtil.checkSign(req.getKey()); - List purchases = purchaseService.list(); + LambdaQueryWrapper purQuery = Wrappers.lambdaQuery(Purchase.class) + .orderByDesc(Purchase::getCreateOn) + .orderByDesc(Purchase::getId); + if (req.hasProjectQuery()) { + Wrapper 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 projects = projectService.list(projQuery); + if (projects.isEmpty()) { + return Collections.emptyList(); + } + List projectIds = projects.stream() + .map(w -> ProjectIdCodeCacheUtil.get(w.getProjectCode())) + .flatMap(Collection::stream) + .collect(Collectors.toList()); + purQuery.in(Purchase::getProjectId, projectIds); + } + List purchases = purchaseService.list(purQuery); if (purchases.isEmpty()) { return Collections.emptyList(); } @@ -216,6 +237,7 @@ public class OpenApiProjectLibManage { List 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())); diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/open/model/po/TenderSystemListReq.java b/hz-pm-api/src/main/java/com/hz/pm/api/open/model/po/TenderListReq.java similarity index 56% rename from hz-pm-api/src/main/java/com/hz/pm/api/open/model/po/TenderSystemListReq.java rename to hz-pm-api/src/main/java/com/hz/pm/api/open/model/po/TenderListReq.java index ee2d581..4a9eada 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/open/model/po/TenderSystemListReq.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/open/model/po/TenderListReq.java @@ -7,14 +7,14 @@ import javax.validation.constraints.NotBlank; /** *

- * TenderSystemListReq + * TenderListReq *

* * @author WendyYang * @since 11:36 2024/12/9 */ @Data -public class TenderSystemListReq { +public class TenderListReq { @ApiModelProperty("校验公钥") @NotBlank(message = "秘钥不能为空") @@ -23,4 +23,14 @@ public class TenderSystemListReq { @ApiModelProperty("项目年度") private Integer projectYear; + @ApiModelProperty("项目编码") + private String projectCode; + + @ApiModelProperty("建设单位编码") + private Long buildOrgCode; + + public boolean hasProjectQuery() { + return projectYear != null || projectCode != null || buildOrgCode != null; + } + } diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/open/model/vo/TenderToMhDetailVO.java b/hz-pm-api/src/main/java/com/hz/pm/api/open/model/vo/TenderToMhDetailVO.java index 23d2651..b43039d 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/open/model/vo/TenderToMhDetailVO.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/open/model/vo/TenderToMhDetailVO.java @@ -24,6 +24,9 @@ public class TenderToMhDetailVO { @ApiModelProperty(value = "标项ID") private Long bidId; + @ApiModelProperty(value = "标项创建时间") + private LocalDateTime createOn; + @ApiModelProperty(value = "标项名称") private String name; diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/controller/PurchaseController.java b/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/controller/PurchaseController.java index a33d18b..a7a3067 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/controller/PurchaseController.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/controller/PurchaseController.java @@ -150,7 +150,7 @@ public class PurchaseController { @ApiOperation("新增系统(信创审符合性查信息)") @WebLog("新增系统(信创审符合性查信息)") @PostMapping("/add-system") - public Long addSystem(@Validated @RequestBody XcfhxApplySaveDTO dto) { + public Long addSystem(@Valid @RequestBody XcfhxApplySaveDTO dto) { return purchaseManage.addSystem(dto); } diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/model/dto/ReviewChecklistApproveDTO.java b/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/model/dto/ReviewChecklistApproveDTO.java deleted file mode 100644 index 63fb0ad..0000000 --- a/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/model/dto/ReviewChecklistApproveDTO.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.hz.pm.api.projectdeclared.model.dto; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotNull; - -/** - * @Classname ReviewChecklistApproveDTO - * @Description - * @Date 2023/11/07 15:35 - * @Author PoffyZhang - */ -@Data -@ApiModel(value = "ReviewChecklistApproveDTO", description = "") -public class ReviewChecklistApproveDTO { - - private static final long serialVersionUID = 1L; - - @ApiModelProperty("项目编号") - @NotBlank(message = "请传项目编号") - private String projectCode; - - @ApiModelProperty("标题") - @NotBlank(message = "请传入标题") - private String title; - - @ApiModelProperty("子标题") - @NotBlank(message = "请传入子标题") - private String subTitle; - - @ApiModelProperty("内容") - @NotBlank(message = "请传入内容") - private String content; - - @ApiModelProperty("对应页码") - @NotBlank(message = "请传入对应页码") - private String corrPageNum; - - @ApiModelProperty("否决情形") - @NotBlank(message = "请传入否决情形") - private String rejectionSituation; - - @ApiModelProperty("响应情况") - @NotBlank(message = "请传入响应情况") - private String responseSituation; - - @ApiModelProperty("评审意见") - @NotBlank(message = "请传入评审意见") - private String reviewComments; - - @ApiModelProperty("审核结果 1.通过 2不通过 3一票否决") - @NotNull(message = "请传入审核结果") - private Integer reviewResult; - -} diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/model/dto/XcfhxApplyEditDTO.java b/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/model/dto/XcfhxApplyEditDTO.java index e9a6084..b66605c 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/model/dto/XcfhxApplyEditDTO.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/model/dto/XcfhxApplyEditDTO.java @@ -2,10 +2,9 @@ package com.hz.pm.api.projectdeclared.model.dto; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import lombok.AllArgsConstructor; import lombok.Data; +import lombok.NoArgsConstructor; -import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotNull; /** @@ -16,7 +15,7 @@ import javax.validation.constraints.NotNull; */ @Data @ApiModel(value = "信创审查对象", description = "采购对象") -@AllArgsConstructor +@NoArgsConstructor public class XcfhxApplyEditDTO { @ApiModelProperty("系统名称") @NotNull(message = "编辑时id必传") diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/model/dto/XcfhxApplySaveDTO.java b/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/model/dto/XcfhxApplySaveDTO.java index fa20ddd..e47a818 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/model/dto/XcfhxApplySaveDTO.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/model/dto/XcfhxApplySaveDTO.java @@ -2,8 +2,8 @@ package com.hz.pm.api.projectdeclared.model.dto; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import lombok.AllArgsConstructor; import lombok.Data; +import lombok.NoArgsConstructor; import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotNull; @@ -15,8 +15,8 @@ import javax.validation.constraints.NotNull; * @Author PoffyZhang */ @Data +@NoArgsConstructor @ApiModel(value = "信创审查对象", description = "采购对象") -@AllArgsConstructor public class XcfhxApplySaveDTO { @ApiModelProperty("系统名称")