From 63abd2e164b796842bd16c4b0fe12fe6c7963b11 Mon Sep 17 00:00:00 2001 From: liuxinxin Date: Tue, 14 Feb 2023 16:30:54 +0800 Subject: [PATCH 1/3] LoginUserUtil getUserRoleIdList --- .../main/java/com/ningdatech/pmapi/user/util/LoginUserUtil.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/user/util/LoginUserUtil.java b/pmapi/src/main/java/com/ningdatech/pmapi/user/util/LoginUserUtil.java index 090a9e5..05d8870 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/user/util/LoginUserUtil.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/user/util/LoginUserUtil.java @@ -3,6 +3,9 @@ package com.ningdatech.pmapi.user.util; import com.ningdatech.basic.auth.AbstractLoginUserUtil; import com.ningdatech.pmapi.user.security.auth.model.UserInfoDetails; +import java.util.ArrayList; +import java.util.List; + /** * @Author liuxinxin @@ -15,4 +18,10 @@ public class LoginUserUtil extends AbstractLoginUserUtil { return getLoginUserPrincipal(); } + public static List getRoleIdList() { + List roleIdList = new ArrayList<>(); + roleIdList.add(1L); + return roleIdList; + } + } From e82470b110c4635169a348cb41cd38f1743e95ea Mon Sep 17 00:00:00 2001 From: WendyYang Date: Tue, 14 Feb 2023 16:40:32 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=A7=92=E8=89=B2?= =?UTF-8?q?=E8=8E=B7=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/ningdatech/pmapi/sys/manage/MenuManage.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/manage/MenuManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/manage/MenuManage.java index d5cb44f..5e029a5 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/manage/MenuManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/manage/MenuManage.java @@ -1,7 +1,6 @@ package com.ningdatech.pmapi.sys.manage; import cn.hutool.core.bean.BeanUtil; -import cn.hutool.core.collection.CollUtil; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.ningdatech.basic.util.CollUtils; import com.ningdatech.pmapi.common.util.TreeUtil; @@ -10,12 +9,11 @@ import com.ningdatech.pmapi.sys.model.entity.RoleMenu; import com.ningdatech.pmapi.sys.model.vo.MenuRoleVO; import com.ningdatech.pmapi.sys.service.IRoleMenuService; import com.ningdatech.pmapi.user.security.auth.model.UserInfoDetails; +import com.ningdatech.pmapi.user.util.LoginUserUtil; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Component; -import java.util.Collections; import java.util.List; -import java.util.Objects; /** *

@@ -32,11 +30,11 @@ public class MenuManage { private final IRoleMenuService roleMenuService; public List buildUserMenu(List

list, UserInfoDetails loginUser) { - if (Objects.isNull(loginUser) || CollUtil.isEmpty(loginUser.getRoleIdList())) { + /*if (Objects.isNull(loginUser) || CollUtil.isEmpty(loginUser.getRoleIdList())) { return Collections.emptyList(); - } + }*/ List roleMenus = roleMenuService.list(Wrappers.lambdaQuery(RoleMenu.class) - .in(RoleMenu::getRoleId, loginUser.getRoleIdList())); + .in(RoleMenu::getRoleId, LoginUserUtil.getRoleIdList())); List menuRoles = CollUtils.convert(list, w -> BeanUtil.copyProperties(w, MenuRoleVO.class)); return TreeUtil.buildUserTree(menuRoles, roleMenus); } From 7212b3a3bb16531ca73fca1f8c2a82f9c151591f Mon Sep 17 00:00:00 2001 From: WendyYang Date: Tue, 14 Feb 2023 17:59:50 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E8=AF=84=E5=AE=A1=E6=A8=A1=E7=89=88?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E5=88=9D=E5=A7=8B=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../config/GeneratorCodeKingbaseConfig.java | 2 +- .../ReviewTemplateSettingsController.java | 23 +++++ .../mapper/ReviewTemplateSettingsMapper.java | 16 +++ .../expert/mapper/ReviewTemplateSettingsMapper.xml | 5 + .../model/dto/ReviewTemplateSettingsDTO.java | 56 ++++++++++ .../model/entity/ReviewTemplateSettings.java | 113 +++++++++++++++++++++ .../service/IReviewTemplateSettingsService.java | 16 +++ .../impl/ReviewTemplateSettingsServiceImpl.java | 20 ++++ 8 files changed, 250 insertions(+), 1 deletion(-) create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/expert/controller/ReviewTemplateSettingsController.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/expert/mapper/ReviewTemplateSettingsMapper.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/expert/mapper/ReviewTemplateSettingsMapper.xml create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/expert/model/dto/ReviewTemplateSettingsDTO.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/expert/model/entity/ReviewTemplateSettings.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/expert/service/IReviewTemplateSettingsService.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/expert/service/impl/ReviewTemplateSettingsServiceImpl.java diff --git a/ningda-generator/src/main/java/com/ningdatech/generator/config/GeneratorCodeKingbaseConfig.java b/ningda-generator/src/main/java/com/ningdatech/generator/config/GeneratorCodeKingbaseConfig.java index c4453af..a7e15c1 100644 --- a/ningda-generator/src/main/java/com/ningdatech/generator/config/GeneratorCodeKingbaseConfig.java +++ b/ningda-generator/src/main/java/com/ningdatech/generator/config/GeneratorCodeKingbaseConfig.java @@ -56,7 +56,7 @@ public class GeneratorCodeKingbaseConfig { } public static void main(String[] args) { - generate("Poffy", "projectlib", PATH_YYD, "nd_project_inst"); + generate("WendyYang", "expert", PATH_YYD, "nd_review_template_settings"); } } 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 new file mode 100644 index 0000000..8cecd91 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/controller/ReviewTemplateSettingsController.java @@ -0,0 +1,23 @@ +package com.ningdatech.pmapi.expert.controller; + + +import io.swagger.annotations.Api; +import lombok.AllArgsConstructor; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + *

+ * 评审模版配置表 前端控制器 + *

+ * + * @author WendyYang + * @since 2023-02-14 + */ +@RestController +@AllArgsConstructor +@Api(tags = "评审模版配置") +@RequestMapping("/api/v1/reviewTemplateSettings") +public class ReviewTemplateSettingsController { + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/mapper/ReviewTemplateSettingsMapper.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/mapper/ReviewTemplateSettingsMapper.java new file mode 100644 index 0000000..cc6e563 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/mapper/ReviewTemplateSettingsMapper.java @@ -0,0 +1,16 @@ +package com.ningdatech.pmapi.expert.mapper; + +import com.ningdatech.pmapi.expert.model.entity.ReviewTemplateSettings; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + *

+ * 评审模版配置表 Mapper 接口 + *

+ * + * @author WendyYang + * @since 2023-02-14 + */ +public interface ReviewTemplateSettingsMapper extends BaseMapper { + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/mapper/ReviewTemplateSettingsMapper.xml b/pmapi/src/main/java/com/ningdatech/pmapi/expert/mapper/ReviewTemplateSettingsMapper.xml new file mode 100644 index 0000000..11cc746 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/mapper/ReviewTemplateSettingsMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/dto/ReviewTemplateSettingsDTO.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/dto/ReviewTemplateSettingsDTO.java new file mode 100644 index 0000000..9321e0e --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/dto/ReviewTemplateSettingsDTO.java @@ -0,0 +1,56 @@ +package com.ningdatech.pmapi.expert.model.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.Valid; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotEmpty; +import javax.validation.constraints.NotNull; +import java.util.List; + +/** + *

+ * ReviewTemplateSettingsDTO + *

+ * + * @author WendyYang + * @since 17:06 2023/2/14 + */ +@Data +public class ReviewTemplateSettingsDTO { + + @ApiModelProperty("序号") + @NotNull(message = "序号不能为空") + private Integer serialNo; + + @ApiModelProperty("标题") + @NotBlank(message = "标题不能为空") + private String title; + + @Valid + @ApiModelProperty("选项") + @NotEmpty(message = "选项不能为空") + private List options; + + @ApiModelProperty("选择类型:1 单选、2 多选") + @NotNull(message = "选择类型不能为空") + private Integer optionType; + + @Data + @ApiModel("选项实体") + public static class OptionDTO { + + @ApiModelProperty("序号") + @NotNull(message = "序号不能为空") + private Integer serialNo; + + @ApiModelProperty("选项内容") + @NotBlank(message = "选项内容不能为空") + private String option; + + } + + +} 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 new file mode 100644 index 0000000..1c3e544 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/entity/ReviewTemplateSettings.java @@ -0,0 +1,113 @@ +package com.ningdatech.pmapi.expert.model.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import java.io.Serializable; +import java.time.LocalDateTime; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +/** + *

+ * 评审模版配置表 + *

+ * + * @author WendyYang + * @since 2023-02-14 + */ +@TableName("nd_review_template_settings") +@ApiModel(value = "NdReviewTemplateSettings对象", description = "评审模版配置表") +public class ReviewTemplateSettings implements Serializable { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty("主键") + private Long id; + + @ApiModelProperty("模版类型:1 初步方案评审模版、2 建设方案评审模版、3 验收方案评审模版") + private Integer templateType; + + @ApiModelProperty("模版内容") + private String content; + + private Long createBy; + + private Long updateBy; + + private LocalDateTime createOn; + + private LocalDateTime updateOn; + + @ApiModelProperty("是否是最新") + private Boolean isLast; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + public Integer getTemplateType() { + return templateType; + } + + public void setTemplateType(Integer templateType) { + this.templateType = templateType; + } + public String getContent() { + return content; + } + + public void setContent(String content) { + this.content = content; + } + public Long getCreateBy() { + return createBy; + } + + public void setCreateBy(Long createBy) { + this.createBy = createBy; + } + public Long getUpdateBy() { + return updateBy; + } + + public void setUpdateBy(Long updateBy) { + this.updateBy = updateBy; + } + public LocalDateTime getCreateOn() { + return createOn; + } + + public void setCreateOn(LocalDateTime createOn) { + this.createOn = createOn; + } + public LocalDateTime getUpdateOn() { + return updateOn; + } + + public void setUpdateOn(LocalDateTime updateOn) { + this.updateOn = updateOn; + } + public Boolean getIsLast() { + return isLast; + } + + public void setIsLast(Boolean isLast) { + this.isLast = isLast; + } + + @Override + public String toString() { + return "NdReviewTemplateSettings{" + + "id=" + id + + ", templateType=" + templateType + + ", content=" + content + + ", createBy=" + createBy + + ", updateBy=" + updateBy + + ", createOn=" + createOn + + ", updateOn=" + updateOn + + ", isLast=" + isLast + + "}"; + } +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/service/IReviewTemplateSettingsService.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/service/IReviewTemplateSettingsService.java new file mode 100644 index 0000000..fcf043f --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/service/IReviewTemplateSettingsService.java @@ -0,0 +1,16 @@ +package com.ningdatech.pmapi.expert.service; + +import com.ningdatech.pmapi.expert.model.entity.ReviewTemplateSettings; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 评审模版配置表 服务类 + *

+ * + * @author WendyYang + * @since 2023-02-14 + */ +public interface IReviewTemplateSettingsService extends IService { + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/service/impl/ReviewTemplateSettingsServiceImpl.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/service/impl/ReviewTemplateSettingsServiceImpl.java new file mode 100644 index 0000000..2ab2842 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/service/impl/ReviewTemplateSettingsServiceImpl.java @@ -0,0 +1,20 @@ +package com.ningdatech.pmapi.expert.service.impl; + +import com.ningdatech.pmapi.expert.model.entity.ReviewTemplateSettings; +import com.ningdatech.pmapi.expert.mapper.ReviewTemplateSettingsMapper; +import com.ningdatech.pmapi.expert.service.IReviewTemplateSettingsService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 评审模版配置表 服务实现类 + *

+ * + * @author WendyYang + * @since 2023-02-14 + */ +@Service +public class ReviewTemplateSettingsServiceImpl extends ServiceImpl implements IReviewTemplateSettingsService { + +}