From 406bcb74e5bbfeb70284bb26c4fb2b2d5041e7e9 Mon Sep 17 00:00:00 2001 From: WendyYang Date: Wed, 15 Feb 2023 17:30:42 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=89=B9=E9=87=8F=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E8=AF=84=E5=AE=A1=E6=A8=A1=E7=89=88=E7=9A=84=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../expert/controller/ReviewTemplateSettingsController.java | 11 +++++++++-- .../pmapi/expert/manage/ReviewTemplateSettingsManage.java | 8 ++++++++ .../pmapi/expert/model/entity/ReviewTemplateSettings.java | 8 +++++--- 3 files changed, 22 insertions(+), 5 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/controller/ReviewTemplateSettingsController.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/controller/ReviewTemplateSettingsController.java index 085d7db..0baacbf 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/expert/controller/ReviewTemplateSettingsController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/controller/ReviewTemplateSettingsController.java @@ -12,6 +12,7 @@ import lombok.AllArgsConstructor; import org.springframework.web.bind.annotation.*; import javax.validation.Valid; +import java.util.List; /** *

@@ -42,10 +43,16 @@ public class ReviewTemplateSettingsController { reviewTemplateSettingsManage.saveOrUpdate(req); } - @GetMapping("/template/{templateId}") + @GetMapping("/template") @ApiModelProperty("根据模版ID获取评审模版") - public ReviewTemplateVO getTemplateById(@PathVariable Long templateId) { + public ReviewTemplateVO getTemplateById(@RequestParam Long templateId) { return reviewTemplateSettingsManage.getReviewTemplateSettings(templateId); } + @GetMapping("/templates") + @ApiModelProperty("(批量)根据模版ID获取评审模版") + public List getTemplateById(@RequestParam List templateIds) { + return reviewTemplateSettingsManage.listReviewTemplateSettings(templateIds); + } + } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/manage/ReviewTemplateSettingsManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/manage/ReviewTemplateSettingsManage.java index 493ef1e..c81ca99 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/expert/manage/ReviewTemplateSettingsManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/manage/ReviewTemplateSettingsManage.java @@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.ningdatech.basic.exception.BizException; +import com.ningdatech.basic.util.CollUtils; import com.ningdatech.pmapi.common.constant.BizConst; import com.ningdatech.pmapi.expert.model.dto.ReviewTemplateSettingsDTO; import com.ningdatech.pmapi.expert.model.entity.ReviewTemplateSettings; @@ -16,6 +17,8 @@ import lombok.AllArgsConstructor; import org.springframework.stereotype.Component; import org.springframework.transaction.annotation.Transactional; +import java.util.List; + /** *

* ReviewTemplateSettingsManage @@ -62,6 +65,11 @@ public class ReviewTemplateSettingsManage { return buildTemplateDetail(settings); } + public List listReviewTemplateSettings(List templateIds) { + List settings = reviewTemplateSettingsService.listByIds(templateIds); + return CollUtils.convert(settings, this::buildTemplateDetail); + } + private ReviewTemplateVO buildTemplateDetail(ReviewTemplateSettings settings) { if (settings == null) { throw BizException.wrap("模版不存在"); diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/entity/ReviewTemplateSettings.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/entity/ReviewTemplateSettings.java index 6709249..f0fea2f 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/entity/ReviewTemplateSettings.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/entity/ReviewTemplateSettings.java @@ -1,8 +1,6 @@ package com.ningdatech.pmapi.expert.model.entity; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.*; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -41,12 +39,16 @@ public class ReviewTemplateSettings implements Serializable { @ApiModelProperty("区域编码") private String regionCode; + @TableField(fill = FieldFill.INSERT) private Long createBy; + @TableField(fill = FieldFill.INSERT_UPDATE) private Long updateBy; + @TableField(fill = FieldFill.INSERT) private LocalDateTime createOn; + @TableField(fill = FieldFill.INSERT_UPDATE) private LocalDateTime updateOn; }