@@ -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"); | |||
} | |||
} |
@@ -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; | |||
/** | |||
* <p> | |||
* 评审模版配置表 前端控制器 | |||
* </p> | |||
* | |||
* @author WendyYang | |||
* @since 2023-02-14 | |||
*/ | |||
@RestController | |||
@AllArgsConstructor | |||
@Api(tags = "评审模版配置") | |||
@RequestMapping("/api/v1/reviewTemplateSettings") | |||
public class ReviewTemplateSettingsController { | |||
} |
@@ -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; | |||
/** | |||
* <p> | |||
* 评审模版配置表 Mapper 接口 | |||
* </p> | |||
* | |||
* @author WendyYang | |||
* @since 2023-02-14 | |||
*/ | |||
public interface ReviewTemplateSettingsMapper extends BaseMapper<ReviewTemplateSettings> { | |||
} |
@@ -0,0 +1,5 @@ | |||
<?xml version="1.0" encoding="UTF-8"?> | |||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |||
<mapper namespace="com.ningdatech.pmapi.expert.mapper.ReviewTemplateSettingsMapper"> | |||
</mapper> |
@@ -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; | |||
/** | |||
* <p> | |||
* ReviewTemplateSettingsDTO | |||
* </p> | |||
* | |||
* @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<OptionDTO> 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; | |||
} | |||
} |
@@ -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; | |||
/** | |||
* <p> | |||
* 评审模版配置表 | |||
* </p> | |||
* | |||
* @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 + | |||
"}"; | |||
} | |||
} |
@@ -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; | |||
/** | |||
* <p> | |||
* 评审模版配置表 服务类 | |||
* </p> | |||
* | |||
* @author WendyYang | |||
* @since 2023-02-14 | |||
*/ | |||
public interface IReviewTemplateSettingsService extends IService<ReviewTemplateSettings> { | |||
} |
@@ -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; | |||
/** | |||
* <p> | |||
* 评审模版配置表 服务实现类 | |||
* </p> | |||
* | |||
* @author WendyYang | |||
* @since 2023-02-14 | |||
*/ | |||
@Service | |||
public class ReviewTemplateSettingsServiceImpl extends ServiceImpl<ReviewTemplateSettingsMapper, ReviewTemplateSettings> implements IReviewTemplateSettingsService { | |||
} |
@@ -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; | |||
/** | |||
* <p> | |||
@@ -32,11 +30,11 @@ public class MenuManage { | |||
private final IRoleMenuService roleMenuService; | |||
public List<MenuRoleVO> buildUserMenu(List<Menu> list, UserInfoDetails loginUser) { | |||
if (Objects.isNull(loginUser) || CollUtil.isEmpty(loginUser.getRoleIdList())) { | |||
/*if (Objects.isNull(loginUser) || CollUtil.isEmpty(loginUser.getRoleIdList())) { | |||
return Collections.emptyList(); | |||
} | |||
}*/ | |||
List<RoleMenu> roleMenus = roleMenuService.list(Wrappers.lambdaQuery(RoleMenu.class) | |||
.in(RoleMenu::getRoleId, loginUser.getRoleIdList())); | |||
.in(RoleMenu::getRoleId, LoginUserUtil.getRoleIdList())); | |||
List<MenuRoleVO> menuRoles = CollUtils.convert(list, w -> BeanUtil.copyProperties(w, MenuRoleVO.class)); | |||
return TreeUtil.buildUserTree(menuRoles, roleMenus); | |||
} | |||
@@ -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<Long> getRoleIdList() { | |||
List<Long> roleIdList = new ArrayList<>(); | |||
roleIdList.add(1L); | |||
return roleIdList; | |||
} | |||
} |