From 8bb0c90b4088e4946c99e2c20636d9a7fb87a72a Mon Sep 17 00:00:00 2001 From: PQZ Date: Tue, 10 Sep 2024 15:44:54 +0800 Subject: [PATCH] 1 --- .../yudao/common/ErrorCodeConstants.java | 4 +- .../controller/admin/BaseTypeController.java | 88 ++++++----- .../module/conf/mapper/BaseTypeMapper.java | 23 +-- .../module/conf/service/BaseTypeService.java | 45 +++--- .../service/impl/BaseTypeServiceImpl.java | 145 ++++++++---------- .../module/conf/vo/BaseTypeListReqVO.java | 25 +-- .../yudao/module/conf/vo/BaseTypeRespVO.java | 36 +---- .../module/conf/vo/BaseTypeSaveReqVO.java | 25 +-- .../mapper/baseType/BaseTypeMapper.xml | 26 +++- 9 files changed, 187 insertions(+), 230 deletions(-) diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/common/ErrorCodeConstants.java b/dl-module-base/src/main/java/cn/iocoder/yudao/common/ErrorCodeConstants.java index 7a1c402d..3ef2f593 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/common/ErrorCodeConstants.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/common/ErrorCodeConstants.java @@ -5,8 +5,6 @@ import cn.iocoder.yudao.framework.common.exception.ErrorCode; public interface ErrorCodeConstants { ErrorCode BASE_TYPE_NOT_EXISTS = new ErrorCode(500, "配置类型不存在"); ErrorCode BASE_TYPE_EXITS_CHILDREN = new ErrorCode(500, "存在存在子配置类型,无法删除"); - ErrorCode BASE_TYPE_PARENT_NOT_EXITS = new ErrorCode(500,"父级配置类型不存在"); - ErrorCode BASE_TYPE_PARENT_ERROR = new ErrorCode(500, "不能设置自己为父配置类型"); - ErrorCode BASE_TYPE_NAME_DUPLICATE = new ErrorCode(500, "已经存在该分类名称的配置类型"); + ErrorCode BASE_TYPE_NAME_DUPLICATE = new ErrorCode(500, "同父级下配置类型名称重复"); ErrorCode BASE_TYPE_PARENT_IS_CHILD = new ErrorCode(500, "不能设置自己的子BaseType为父BaseType"); } diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/conf/controller/admin/BaseTypeController.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/conf/controller/admin/BaseTypeController.java index 1f56da92..cfb48480 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/conf/controller/admin/BaseTypeController.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/conf/controller/admin/BaseTypeController.java @@ -1,10 +1,6 @@ package cn.iocoder.yudao.module.conf.controller.admin; -import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog; import cn.iocoder.yudao.framework.common.pojo.CommonResult; -import cn.iocoder.yudao.framework.common.util.object.BeanUtils; -import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; -import cn.iocoder.yudao.module.conf.entity.BaseType; import cn.iocoder.yudao.module.conf.service.BaseTypeService; import cn.iocoder.yudao.module.conf.vo.BaseTypeListReqVO; import cn.iocoder.yudao.module.conf.vo.BaseTypeRespVO; @@ -17,15 +13,12 @@ import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; import javax.validation.Valid; -import java.io.IOException; import java.util.List; -import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.EXPORT; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; -@Tag(name = "管理后台 - 配置类型") +@Tag(name = "管理后台 - 账目配置类型") @RestController @RequestMapping("/conf/baseType") @Validated @@ -34,57 +27,80 @@ public class BaseTypeController { @Resource private BaseTypeService baseTypeService; + /** + * 新增账目配置类型 + * + * @param createReqVO BaseTypeSaveReqVO实体 + * @return cn.iocoder.yudao.framework.common.pojo.CommonResult + * @author PQZ + * @date 11:21 2024/9/10 + **/ @PostMapping("/create") @Operation(summary = "创建配置类型") - @PreAuthorize("@ss.hasPermission('conf:base-type:create')") - public CommonResult createBaseType(@Valid @RequestBody BaseTypeSaveReqVO createReqVO) { - return success(baseTypeService.createBaseType(createReqVO)); - } - - @PutMapping("/update") - @Operation(summary = "更新配置类型") - @PreAuthorize("@ss.hasPermission('conf:base-type:update')") - public CommonResult updateBaseType(@Valid @RequestBody BaseTypeSaveReqVO updateReqVO) { - baseTypeService.updateBaseType(updateReqVO); + public CommonResult createBaseType(@Valid @RequestBody BaseTypeSaveReqVO createReqVO) { + baseTypeService.saveBaseType(createReqVO); return success(true); } + /** + * 编辑账目配置类型 + * + * @param updateReqVO BaseTypeSaveReqVO实体 + * @return cn.iocoder.yudao.framework.common.pojo.CommonResult + * @author PQZ + * @date 14:25 2024/9/10 + **/ + @PutMapping("/update") + @Operation(summary = "更新配置类型") + public CommonResult updateBaseType(@Valid @RequestBody BaseTypeSaveReqVO updateReqVO) { + baseTypeService.saveBaseType(updateReqVO); + return success(true); + } + + /** + * 删除配置类型 + * + * @param id 类型id + * @return cn.iocoder.yudao.framework.common.pojo.CommonResult + * @author PQZ + * @date 14:25 2024/9/10 + **/ @DeleteMapping("/delete") @Operation(summary = "删除配置类型") @Parameter(name = "id", description = "编号", required = true) - @PreAuthorize("@ss.hasPermission('conf:base-type:delete')") public CommonResult deleteBaseType(@RequestParam("id") String id) { baseTypeService.deleteBaseType(id); return success(true); } + /** + * 根据id获取配置类型 + * + * @param id 配置类型id + * @return cn.iocoder.yudao.framework.common.pojo.CommonResult + * @author PQZ + * @date 14:26 2024/9/10 + **/ @GetMapping("/get") @Operation(summary = "获得配置类型") @Parameter(name = "id", description = "编号", required = true, example = "1024") - @PreAuthorize("@ss.hasPermission('conf:base-type:query')") public CommonResult getBaseType(@RequestParam("id") String id) { - BaseType baseType = baseTypeService.getBaseType(id); - return success(BeanUtils.toBean(baseType, BaseTypeRespVO.class)); + return success(baseTypeService.getBaseType(id)); } + /** + * 配置类型列表 + * + * @param listReqVO BaseTypeListReqVO 实体 + * @return cn.iocoder.yudao.framework.common.pojo.CommonResult> + * @author PQZ + * @date 14:26 2024/9/10 + **/ @GetMapping("/list") @Operation(summary = "获得配置类型列表") - @PreAuthorize("@ss.hasPermission('conf:base-type:query')") public CommonResult> getBaseTypeList(@Valid BaseTypeListReqVO listReqVO) { - List list = baseTypeService.getBaseTypeList(listReqVO); - return success(BeanUtils.toBean(list, BaseTypeRespVO.class)); + return success(baseTypeService.getBaseTypeList(listReqVO)); } - @GetMapping("/export-excel") - @Operation(summary = "导出配置类型 Excel") - @PreAuthorize("@ss.hasPermission('conf:base-type:export')") - @ApiAccessLog(operateType = EXPORT) - public void exportBaseTypeExcel(@Valid BaseTypeListReqVO listReqVO, - HttpServletResponse response) throws IOException { - List list = baseTypeService.getBaseTypeList(listReqVO); - // 导出 Excel - ExcelUtils.write(response, "配置类型.xls", "数据", BaseTypeRespVO.class, - BeanUtils.toBean(list, BaseTypeRespVO.class)); - } } \ No newline at end of file diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/conf/mapper/BaseTypeMapper.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/conf/mapper/BaseTypeMapper.java index 93e1540b..fb02a7a3 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/conf/mapper/BaseTypeMapper.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/conf/mapper/BaseTypeMapper.java @@ -3,8 +3,10 @@ package cn.iocoder.yudao.module.conf.mapper; import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; import cn.iocoder.yudao.module.conf.entity.BaseType; import cn.iocoder.yudao.module.conf.vo.BaseTypeListReqVO; +import cn.iocoder.yudao.module.conf.vo.BaseTypeRespVO; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; import java.util.List; @@ -16,17 +18,16 @@ import java.util.List; @Mapper public interface BaseTypeMapper extends BaseMapper { - default List selectList(BaseTypeListReqVO reqVO) { - return selectList(new LambdaQueryWrapperX() - .eqIfPresent(BaseType::getParentId, reqVO.getParentId()) - .likeIfPresent(BaseType::getName, reqVO.getName()) - .eqIfPresent(BaseType::getCode, reqVO.getCode()) - .eqIfPresent(BaseType::getType, reqVO.getType()) - .eqIfPresent(BaseType::getRemark, reqVO.getRemark()) - .eqIfPresent(BaseType::getCorpId, reqVO.getCorpId()) - .betweenIfPresent(BaseType::getCreateTime, reqVO.getCreateTime()) - .orderByDesc(BaseType::getId)); - } + + /** + * 查询配置类型列表 + * @author PQZ + * @date 14:55 2024/9/10 + * @param entity BaseTypeListReqVO实体 + * @return java.util.List + **/ + List queryList(@Param("entity") BaseTypeListReqVO entity); + } \ No newline at end of file diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/conf/service/BaseTypeService.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/conf/service/BaseTypeService.java index 01bf3ad1..e28099df 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/conf/service/BaseTypeService.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/conf/service/BaseTypeService.java @@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.conf.service; import cn.iocoder.yudao.module.conf.entity.BaseType; import cn.iocoder.yudao.module.conf.vo.BaseTypeListReqVO; +import cn.iocoder.yudao.module.conf.vo.BaseTypeRespVO; import cn.iocoder.yudao.module.conf.vo.BaseTypeSaveReqVO; import com.baomidou.mybatisplus.extension.service.IService; @@ -16,19 +17,13 @@ import java.util.List; public interface BaseTypeService extends IService { /** - * 创建配置类型 + * 新增账目配置类型 * - * @param createReqVO 创建信息 - * @return 编号 - */ - String createBaseType(@Valid BaseTypeSaveReqVO createReqVO); - - /** - * 更新配置类型 - * - * @param updateReqVO 更新信息 - */ - void updateBaseType(@Valid BaseTypeSaveReqVO updateReqVO); + * @param saveReqVO BaseTypeSaveReqVO实体 + * @author PQZ + * @date 11:23 2024/9/10 + **/ + void saveBaseType(BaseTypeSaveReqVO saveReqVO); /** * 删除配置类型 @@ -38,19 +33,21 @@ public interface BaseTypeService extends IService { void deleteBaseType(String id); /** - * 获得配置类型 - * - * @param id 编号 - * @return 配置类型 - */ - BaseType getBaseType(String id); + * 根据类型id查询配置类型 + * @author PQZ + * @date 14:40 2024/9/10 + * @param id 类型id + * @return cn.iocoder.yudao.module.conf.entity.BaseType + **/ + BaseTypeRespVO getBaseType(String id); /** - * 获得配置类型列表 - * - * @param listReqVO 查询条件 - * @return 配置类型列表 - */ - List getBaseTypeList(BaseTypeListReqVO listReqVO); + * 获取配置类型列表 + * @author PQZ + * @date 14:27 2024/9/10 + * @param listReqVO BaseTypeListReqVO + * @return java.util.List + **/ + List getBaseTypeList(BaseTypeListReqVO listReqVO); } \ No newline at end of file diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/conf/service/impl/BaseTypeServiceImpl.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/conf/service/impl/BaseTypeServiceImpl.java index f26c5a60..5d891076 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/conf/service/impl/BaseTypeServiceImpl.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/conf/service/impl/BaseTypeServiceImpl.java @@ -1,17 +1,21 @@ package cn.iocoder.yudao.module.conf.service.impl; import cn.iocoder.yudao.framework.common.util.object.BeanUtils; +import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; import cn.iocoder.yudao.module.conf.entity.BaseType; import cn.iocoder.yudao.module.conf.mapper.BaseTypeMapper; import cn.iocoder.yudao.module.conf.service.BaseTypeService; import cn.iocoder.yudao.module.conf.vo.BaseTypeListReqVO; +import cn.iocoder.yudao.module.conf.vo.BaseTypeRespVO; import cn.iocoder.yudao.module.conf.vo.BaseTypeSaveReqVO; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; import org.springframework.validation.annotation.Validated; import javax.annotation.Resource; +import java.util.Arrays; import java.util.List; import java.util.Objects; @@ -30,41 +34,31 @@ public class BaseTypeServiceImpl extends ServiceImpl i @Resource private BaseTypeMapper baseTypeMapper; + /** + * 新增账目配置类型 + * + * @param saveReqVO BaseTypeSaveReqVO实体 + * @author PQZ + * @date 11:23 2024/9/10 + **/ @Override - public String createBaseType(BaseTypeSaveReqVO createReqVO) { - // 校验父iid的有效性 - validateParentBaseType(null, createReqVO.getParentId()); - // 校验分类名称的唯一性 - validateBaseTypeNameUnique(null, createReqVO.getParentId(), createReqVO.getName()); - - // 插入 - BaseType baseType = BeanUtils.toBean(createReqVO, BaseType.class); - baseTypeMapper.insert(baseType); - // 返回 - return baseType.getId(); + public void saveBaseType(BaseTypeSaveReqVO saveReqVO) { + /*1、数据校验*/ + //同级别下校验名称是否重复 + validateBaseTypeNameUnique(saveReqVO.getId(),saveReqVO.getParentId(),saveReqVO.getType(),saveReqVO.getName()); + /*2、数据保存*/ + //类型转换 + BaseType baseType = BeanUtils.toBean(saveReqVO, BaseType.class); + //数据保存 + saveOrUpdate(baseType); } - @Override - public void updateBaseType(BaseTypeSaveReqVO updateReqVO) { - // 校验存在 - validateBaseTypeExists(updateReqVO.getId()); - // 校验父iid的有效性 - validateParentBaseType(updateReqVO.getId(), updateReqVO.getParentId()); - // 校验分类名称的唯一性 - validateBaseTypeNameUnique(updateReqVO.getId(), updateReqVO.getParentId(), updateReqVO.getName()); - - // 更新 - BaseType updateObj = BeanUtils.toBean(updateReqVO, BaseType.class); - baseTypeMapper.updateById(updateObj); - } @Override public void deleteBaseType(String id) { - // 校验存在 - validateBaseTypeExists(id); // 校验是否有子配置类型 LambdaQueryWrapper lambdaQueryWrapper = new LambdaQueryWrapper<>(); - lambdaQueryWrapper.eq(BaseType::getParentId,id); + lambdaQueryWrapper.eq(BaseType::getParentId, id); List list = list(lambdaQueryWrapper); if (list.size() > 0) { throw exception(BASE_TYPE_EXITS_CHILDREN); @@ -73,70 +67,63 @@ public class BaseTypeServiceImpl extends ServiceImpl i baseTypeMapper.deleteById(id); } - private void validateBaseTypeExists(String id) { - if (baseTypeMapper.selectById(id) == null) { + + /** + * 同类型,同级别下校验名称唯一性 + * + * @param id id + * @param parentId 父类id + * @param type 配置类型 + * @param name 名称 + * @author PQZ + * @date 11:34 2024/9/10 + **/ + private void validateBaseTypeNameUnique(String id, String parentId, String type, String name) { + //配置类型不能为空 + if (StringUtils.isBlank(type)) { throw exception(BASE_TYPE_NOT_EXISTS); } - } - - private void validateParentBaseType(String id, String parentId) { - if (parentId == null ) { - return; - } - // 1. 不能设置自己为父配置类型 - if (Objects.equals(id, parentId)) { - throw exception(BASE_TYPE_PARENT_ERROR); - } - // 2. 父配置类型不存在 - BaseType parentBaseType = baseTypeMapper.selectById(parentId); - if (parentBaseType == null) { - throw exception(BASE_TYPE_PARENT_NOT_EXITS); - } - // 3. 递归校验父配置类型,如果父配置类型是自己的子配置类型,则报错,避免形成环路 - if (id == null) { // id 为空,说明新增,不需要考虑环路 - return; - } - for (int i = 0; i < Short.MAX_VALUE; i++) { - // 3.1 校验环路 - parentId = parentBaseType.getParentId(); - if (Objects.equals(id, parentId)) { - throw exception(BASE_TYPE_PARENT_IS_CHILD); - } - // 3.2 继续递归下一级父配置类型 - if (parentId == null ) { - break; - } - parentBaseType = baseTypeMapper.selectById(parentId); - if (parentBaseType == null) { - break; - } - } - } - - private void validateBaseTypeNameUnique(String id, String parentId, String name) { LambdaQueryWrapper lambdaQueryWrapper = new LambdaQueryWrapper<>(); - lambdaQueryWrapper.eq(BaseType::getParentId,parentId).eq(BaseType::getName,name); - BaseType baseType = getOne(lambdaQueryWrapper); - if (baseType == null) { - return; + lambdaQueryWrapper.eq(BaseDO::getDeleted, 0).eq(BaseType::getType, type).eq(BaseType::getName, name).eq(BaseType::getParentId, parentId); + //id存在为编辑情况,排除自身 + if (null != id) { + lambdaQueryWrapper.ne(BaseType::getId, id); } - // 如果 id 为空,说明不用比较是否为相同 id 的配置类型 - if (id == null) { - throw exception(BASE_TYPE_NAME_DUPLICATE); - } - if (!Objects.equals(baseType.getId(), id)) { + //查询list,校验唯一性 + List list = list(lambdaQueryWrapper); + if (list.size() > 0) { throw exception(BASE_TYPE_NAME_DUPLICATE); } } + /** + * 根据类型id查询配置类型 + * @author PQZ + * @date 14:40 2024/9/10 + * @param id 类型id + * @return cn.iocoder.yudao.module.conf.entity.BaseType + **/ @Override - public BaseType getBaseType(String id) { - return baseTypeMapper.selectById(id); + public BaseTypeRespVO getBaseType(String id) { + BaseType baseType = getById(id); + BaseTypeRespVO result = BeanUtils.toBean(baseType, BaseTypeRespVO.class); + //关联子公司转换 + if (StringUtils.isNotBlank(result.getCorpId())){ + result.setCorpIds(Arrays.asList(result.getCorpId().split(","))); + } + return result; } + /** + * 获取配置类型列表 + * @author PQZ + * @date 14:27 2024/9/10 + * @param listReqVO BaseTypeListReqVO + * @return java.util.List + **/ @Override - public List getBaseTypeList(BaseTypeListReqVO listReqVO) { - return baseTypeMapper.selectList(listReqVO); + public List getBaseTypeList(BaseTypeListReqVO listReqVO) { + return baseTypeMapper.queryList(listReqVO); } } \ No newline at end of file diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/conf/vo/BaseTypeListReqVO.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/conf/vo/BaseTypeListReqVO.java index 2fd188d4..4a64f6ed 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/conf/vo/BaseTypeListReqVO.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/conf/vo/BaseTypeListReqVO.java @@ -1,5 +1,6 @@ package cn.iocoder.yudao.module.conf.vo; +import cn.iocoder.yudao.module.conf.entity.BaseType; import lombok.*; import java.util.*; import io.swagger.v3.oas.annotations.media.Schema; @@ -11,28 +12,6 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_ @Schema(description = "管理后台 - 配置类型列表 Request VO") @Data -public class BaseTypeListReqVO { - - @Schema(description = "父iid", example = "21252") - private String parentId; - - @Schema(description = "分类名称", example = "赵六") - private String name; - - @Schema(description = "分类编码") - private String code; - - @Schema(description = "类型(01账目分类;02配件分类;03服务分类)", example = "1") - private String type; - - @Schema(description = "备注", example = "你猜") - private String remark; - - @Schema(description = "关联供应商id", example = "14355") - private String corpId; - - @Schema(description = "创建时间") - @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) - private LocalDateTime[] createTime; +public class BaseTypeListReqVO extends BaseType { } \ No newline at end of file diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/conf/vo/BaseTypeRespVO.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/conf/vo/BaseTypeRespVO.java index c57594c9..bd64509a 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/conf/vo/BaseTypeRespVO.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/conf/vo/BaseTypeRespVO.java @@ -1,5 +1,6 @@ package cn.iocoder.yudao.module.conf.vo; +import cn.iocoder.yudao.module.conf.entity.BaseType; import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; import java.util.*; @@ -10,34 +11,9 @@ import com.alibaba.excel.annotation.*; @Schema(description = "管理后台 - 配置类型 Response VO") @Data @ExcelIgnoreUnannotated -public class BaseTypeRespVO { - - @Schema(description = "父iid", example = "21252") - @ExcelProperty("父iid") - private String parentId; - - @Schema(description = "分类名称", example = "赵六") - @ExcelProperty("分类名称") - private String name; - - @Schema(description = "分类编码") - @ExcelProperty("分类编码") - private String code; - - @Schema(description = "类型(01账目分类;02配件分类;03服务分类)", example = "1") - @ExcelProperty("类型(01账目分类;02配件分类;03服务分类)") - private String type; - - @Schema(description = "备注", requiredMode = Schema.RequiredMode.REQUIRED, example = "你猜") - @ExcelProperty("备注") - private String remark; - - @Schema(description = "关联供应商id", requiredMode = Schema.RequiredMode.REQUIRED, example = "14355") - @ExcelProperty("关联供应商id") - private String corpId; - - @Schema(description = "创建时间") - @ExcelProperty("创建时间") - private LocalDateTime createTime; - +public class BaseTypeRespVO extends BaseType { + /**关联子公司*/ + List corpIds; + /**子公司名称字符串*/ + String corpNames; } \ No newline at end of file diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/conf/vo/BaseTypeSaveReqVO.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/conf/vo/BaseTypeSaveReqVO.java index ea360410..432820a3 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/conf/vo/BaseTypeSaveReqVO.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/conf/vo/BaseTypeSaveReqVO.java @@ -1,5 +1,6 @@ package cn.iocoder.yudao.module.conf.vo; +import cn.iocoder.yudao.module.conf.entity.BaseType; import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; import java.util.*; @@ -7,27 +8,5 @@ import javax.validation.constraints.*; @Schema(description = "管理后台 - 配置类型新增/修改 Request VO") @Data -public class BaseTypeSaveReqVO { - - private String id; - @Schema(description = "父iid", example = "21252") - private String parentId; - - @Schema(description = "分类名称", example = "赵六") - private String name; - - @Schema(description = "分类编码") - private String code; - - @Schema(description = "类型(01账目分类;02配件分类;03服务分类)", example = "1") - private String type; - - @Schema(description = "备注", requiredMode = Schema.RequiredMode.REQUIRED, example = "你猜") - @NotEmpty(message = "备注不能为空") - private String remark; - - @Schema(description = "关联供应商id", requiredMode = Schema.RequiredMode.REQUIRED, example = "14355") - @NotEmpty(message = "关联供应商id不能为空") - private String corpId; - +public class BaseTypeSaveReqVO extends BaseType { } \ No newline at end of file diff --git a/dl-module-base/src/main/resources/mapper/baseType/BaseTypeMapper.xml b/dl-module-base/src/main/resources/mapper/baseType/BaseTypeMapper.xml index f3d151eb..b0dbf3e4 100644 --- a/dl-module-base/src/main/resources/mapper/baseType/BaseTypeMapper.xml +++ b/dl-module-base/src/main/resources/mapper/baseType/BaseTypeMapper.xml @@ -1,6 +1,6 @@ - + + \ No newline at end of file