1. 实现集中式的附件统一管理,统一上传统一预览(代码生成器,公共组件,公共附件元数据定义)
2. 实现统一的 DB 字段数据库定义(代码生成器,共用规范检查)
(cherry picked from commit c2195ee3cf)
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
package cn.iocoder.yudao.module.infra.api.businessfile;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.module.infra.api.businessfile.dto.BusinessFileSaveReqDTO;
|
||||
import cn.iocoder.yudao.module.infra.enums.ApiConstants;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author chenbowen
|
||||
*/
|
||||
@FeignClient(name = ApiConstants.NAME)
|
||||
@Tag(name = "RPC 服务 - 业务附件关联")
|
||||
public interface BusinessFileApi {
|
||||
|
||||
String PREFIX = ApiConstants.PREFIX + "/business-file";
|
||||
|
||||
@PostMapping(PREFIX + "/batch-create")
|
||||
@Operation(summary = "批量新增业务附件关联")
|
||||
CommonResult<List<Long>> batchCreateBusinessFile(@RequestBody List<BusinessFileSaveReqDTO> createReqDTOList);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package cn.iocoder.yudao.module.infra.api.businessfile.dto;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 业务附件关联保存请求 DTO
|
||||
* @author chenbowen
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class BusinessFileSaveReqDTO implements Serializable {
|
||||
/** 业务Id */
|
||||
private Long businessId;
|
||||
/** 业务编码 */
|
||||
private String businessCode;
|
||||
/** 文件名 */
|
||||
private String fileName;
|
||||
private Long fileId;
|
||||
/** 业务来源 */
|
||||
private String source;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
|
||||
package cn.iocoder.yudao.module.infra.api.stdnms;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.module.infra.api.stdnms.dto.StdNmsRespDTO;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Parameters;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
@FeignClient(name = "stdnms-api") // 可根据实际服务名调整
|
||||
@Tag(name = "RPC 服务 - 数据命名与简写标准")
|
||||
public interface StdNmsApi {
|
||||
|
||||
String PREFIX = "/api/stdnms";
|
||||
|
||||
@DeleteMapping(PREFIX + "/delete")
|
||||
@Operation(summary = "删除数据命名与简写标准")
|
||||
@Parameters({
|
||||
@Parameter(name = "id", description = "主键ID", example = "1001", required = true)
|
||||
})
|
||||
CommonResult<Boolean> deleteStdNms(@RequestParam("id") Long id);
|
||||
|
||||
@DeleteMapping(PREFIX + "/delete-batch")
|
||||
@Operation(summary = "批量删除数据命名与简写标准")
|
||||
@Parameters({
|
||||
@Parameter(name = "ids", description = "主键ID集合", example = "[1001,1002]", required = true)
|
||||
})
|
||||
CommonResult<Boolean> deleteStdNmsList(@RequestParam("ids") List<Long> ids);
|
||||
|
||||
@GetMapping(PREFIX + "/get")
|
||||
@Operation(summary = "根据主键获取数据命名与简写标准")
|
||||
@Parameters({
|
||||
@Parameter(name = "id", description = "主键ID", example = "1001", required = true)
|
||||
})
|
||||
CommonResult<StdNmsRespDTO> getStdNms(@RequestParam("id") Long id);
|
||||
|
||||
@GetMapping(PREFIX + "/get-by-abbr")
|
||||
@Operation(summary = "根据缩写获取数据命名与简写标准")
|
||||
@Parameters({
|
||||
@Parameter(name = "abbr", description = "简写/缩写", example = "devNm", required = true)
|
||||
})
|
||||
CommonResult<StdNmsRespDTO> getStdNmsByAbbr(@RequestParam("abbr") String abbr);
|
||||
|
||||
@GetMapping(PREFIX + "/list-by-abbrs")
|
||||
@Operation(summary = "根据缩写列表查询数据命名与简写标准")
|
||||
@Parameters({
|
||||
@Parameter(name = "abbrs", description = "简写/缩写集合", example = "[devNm,devType]", required = true)
|
||||
})
|
||||
CommonResult<List<StdNmsRespDTO>> getStdNmsListByAbbrs(@RequestParam("abbrs") Collection<String> abbrs);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package cn.iocoder.yudao.module.infra.api.stdnms.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Schema(description = "数据命名与简写标准响应 DTO")
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class StdNmsRespDTO implements Serializable {
|
||||
|
||||
@Schema(description = "主键ID", example = "1001")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "名称", example = "设备名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "简写/缩写", example = "devNm")
|
||||
private String abbr;
|
||||
|
||||
// 可根据实际需求补充其他字段
|
||||
}
|
||||
@@ -79,4 +79,11 @@ public interface ErrorCodeConstants {
|
||||
ErrorCode DEMO03_GRADE_NOT_EXISTS = new ErrorCode(1_001_201_009, "学生班级不存在");
|
||||
ErrorCode DEMO03_GRADE_EXISTS = new ErrorCode(1_001_201_010, "学生班级已存在");
|
||||
|
||||
// ========== 业务附件关联 ==========
|
||||
ErrorCode BUSINESS_FILE_NOT_EXISTS = new ErrorCode(1_002_201_010, "业务附件关联不存在");
|
||||
|
||||
// ========== 数据命名与简写标准 ==========
|
||||
ErrorCode STD_NMS_NOT_EXISTS = new ErrorCode(1_002_030_000, "数据命名与简写标准不存在");
|
||||
|
||||
ErrorCode STD_ABBR_NOT_EXISTS = new ErrorCode(1_002_030_001, "字段名 {} 不存在命名规范定义,请核对字段定义");
|
||||
}
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
package cn.iocoder.yudao.module.infra.api.businessfile;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.infra.api.businessfile.dto.BusinessFileSaveReqDTO;
|
||||
import cn.iocoder.yudao.module.infra.controller.admin.businessfile.vo.BusinessFileSaveReqVO;
|
||||
import cn.iocoder.yudao.module.infra.service.businessfile.BusinessFileService;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
/**
|
||||
* 业务附件关联 API 实现
|
||||
* @author chenbowen
|
||||
*/
|
||||
@RestController // 提供 RESTful API 接口,给 Feign 调用
|
||||
@Validated
|
||||
public class BusinessFileApiImpl implements BusinessFileApi {
|
||||
|
||||
@Resource
|
||||
private BusinessFileService businessFileService;
|
||||
|
||||
@Override
|
||||
public CommonResult<List<Long>> batchCreateBusinessFile(List<BusinessFileSaveReqDTO> createReqDTOList) {
|
||||
List<BusinessFileSaveReqVO> createReqVOList = BeanUtils.toBean(createReqDTOList, BusinessFileSaveReqVO.class);
|
||||
List<Long> ids = businessFileService.batchCreateBusinessFile(createReqVOList);
|
||||
return success(ids);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
package cn.iocoder.yudao.module.infra.api.stdnms;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.infra.api.stdnms.dto.StdNmsRespDTO;
|
||||
import cn.iocoder.yudao.module.infra.dal.dataobject.stdnms.stdnms.StdNmsDO;
|
||||
import cn.iocoder.yudao.module.infra.stdnms.StdNmsService;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
/**
|
||||
* 数据命名与简写标准 API 实现
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
@RestController // 提供 RESTful API 接口,给 Feign 调用
|
||||
@Validated
|
||||
public class StdNmsApiImpl implements StdNmsApi {
|
||||
|
||||
@Resource
|
||||
private StdNmsService stdNmsService;
|
||||
|
||||
@Override
|
||||
public CommonResult<Boolean> deleteStdNms(Long id) {
|
||||
stdNmsService.deleteStdNms(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<Boolean> deleteStdNmsList(List<Long> ids) {
|
||||
stdNmsService.deleteStdNmsListByIds(ids);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<StdNmsRespDTO> getStdNms(Long id) {
|
||||
StdNmsDO stdNms = stdNmsService.getStdNms(id);
|
||||
return success(BeanUtils.toBean(stdNms, StdNmsRespDTO.class));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<StdNmsRespDTO> getStdNmsByAbbr(String abbr) {
|
||||
StdNmsDO stdNms = stdNmsService.getStdNmsByAbbr(abbr);
|
||||
return success(BeanUtils.toBean(stdNms, StdNmsRespDTO.class));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<List<StdNmsRespDTO>> getStdNmsListByAbbrs(Collection<String> abbrs) {
|
||||
List<StdNmsDO> stdNmsList = stdNmsService.getStdNmsListByAbbrs(abbrs);
|
||||
return success(BeanUtils.toBean(stdNmsList, StdNmsRespDTO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,111 @@
|
||||
package cn.iocoder.yudao.module.infra.controller.admin.businessfile;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import jakarta.validation.constraints.*;
|
||||
import jakarta.validation.*;
|
||||
import jakarta.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import cn.iocoder.yudao.module.infra.controller.admin.businessfile.vo.*;
|
||||
import cn.iocoder.yudao.module.infra.dal.dataobject.businessfile.BusinessFileDO;
|
||||
import cn.iocoder.yudao.module.infra.service.businessfile.BusinessFileService;
|
||||
|
||||
@Tag(name = "管理后台 - 业务附件关联")
|
||||
@RestController
|
||||
@RequestMapping("/infra/business-file")
|
||||
@Validated
|
||||
public class BusinessFileController {
|
||||
|
||||
@Resource
|
||||
private BusinessFileService businessFileService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建业务附件关联")
|
||||
@PreAuthorize("@ss.hasPermission('infra:business-file:create')")
|
||||
public CommonResult<Long> createBusinessFile(@Valid @RequestBody BusinessFileSaveReqVO createReqVO) {
|
||||
return success(businessFileService.createBusinessFile(createReqVO));
|
||||
}
|
||||
|
||||
@PostMapping("/batch-create")
|
||||
@Operation(summary = "批量创建业务附件关联")
|
||||
@PreAuthorize("@ss.hasPermission('infra:business-file:create')")
|
||||
public CommonResult<List<Long>> batchCreateBusinessFile(@Valid @RequestBody List<BusinessFileSaveReqVO> createReqVOList) {
|
||||
return success(businessFileService.batchCreateBusinessFile(createReqVOList));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新业务附件关联")
|
||||
@PreAuthorize("@ss.hasPermission('infra:business-file:update')")
|
||||
public CommonResult<Boolean> updateBusinessFile(@Valid @RequestBody BusinessFileSaveReqVO updateReqVO) {
|
||||
businessFileService.updateBusinessFile(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除业务附件关联")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('infra:business-file:delete')")
|
||||
public CommonResult<Boolean> deleteBusinessFile(@RequestParam("id") Long id) {
|
||||
businessFileService.deleteBusinessFile(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除业务附件关联")
|
||||
@PreAuthorize("@ss.hasPermission('infra:business-file:delete')")
|
||||
public CommonResult<Boolean> deleteBusinessFileList(@RequestParam("ids") List<Long> ids) {
|
||||
businessFileService.deleteBusinessFileListByIds(ids);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得业务附件关联")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('infra:business-file:query')")
|
||||
public CommonResult<BusinessFileRespVO> getBusinessFile(@RequestParam("id") Long id) {
|
||||
BusinessFileDO businessFile = businessFileService.getBusinessFile(id);
|
||||
return success(BeanUtils.toBean(businessFile, BusinessFileRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得业务附件关联分页")
|
||||
@PreAuthorize("@ss.hasPermission('infra:business-file:query')")
|
||||
public CommonResult<PageResult<BusinessFileRespVO>> getBusinessFilePage(@Valid BusinessFilePageReqVO pageReqVO) {
|
||||
PageResult<BusinessFileDO> pageResult = businessFileService.getBusinessFilePage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, BusinessFileRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出业务附件关联 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('infra:business-file:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportBusinessFileExcel(@Valid BusinessFilePageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<BusinessFileDO> list = businessFileService.getBusinessFilePage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "业务附件关联.xls", "数据", BusinessFileRespVO.class,
|
||||
BeanUtils.toBean(list, BusinessFileRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package cn.iocoder.yudao.module.infra.controller.admin.businessfile.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 业务附件关联分页 Request VO")
|
||||
@Data
|
||||
public class BusinessFilePageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "业务Id", example = "24322")
|
||||
private Long businessId;
|
||||
|
||||
@Schema(description = "业务编码")
|
||||
private String businessCode;
|
||||
|
||||
@Schema(description = "附件fileId", example = "10125")
|
||||
private Long fileId;
|
||||
|
||||
@Schema(description = "附件名称", example = "李四")
|
||||
private String fileName;
|
||||
|
||||
@Schema(description = "附件来源")
|
||||
private String source;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package cn.iocoder.yudao.module.infra.controller.admin.businessfile.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 业务附件关联 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class BusinessFileRespVO {
|
||||
|
||||
@Schema(description = "主键ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "29216")
|
||||
@ExcelProperty("主键ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "业务Id", requiredMode = Schema.RequiredMode.REQUIRED, example = "24322")
|
||||
@ExcelProperty("业务Id")
|
||||
private Long businessId;
|
||||
|
||||
@Schema(description = "业务编码")
|
||||
@ExcelProperty("业务编码")
|
||||
private String businessCode;
|
||||
|
||||
@Schema(description = "附件fileId", requiredMode = Schema.RequiredMode.REQUIRED, example = "10125")
|
||||
@ExcelProperty("附件fileId")
|
||||
private Long fileId;
|
||||
|
||||
@Schema(description = "附件名称", example = "李四")
|
||||
@ExcelProperty("附件名称")
|
||||
private String fileName;
|
||||
|
||||
@Schema(description = "附件来源")
|
||||
@ExcelProperty("附件来源")
|
||||
private String source;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package cn.iocoder.yudao.module.infra.controller.admin.businessfile.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Schema(description = "管理后台 - 业务附件关联新增/修改 Request VO")
|
||||
@Data
|
||||
public class BusinessFileSaveReqVO {
|
||||
|
||||
@Schema(description = "主键ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "29216")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "附件Id", example = "李四")
|
||||
private Long fileId;
|
||||
|
||||
@Schema(description = "业务Id", example = "李四")
|
||||
private Long businessId;
|
||||
|
||||
@Schema(description = "附件名称", example = "李四")
|
||||
private String fileName;
|
||||
|
||||
@Schema(description = "附件来源")
|
||||
private String source;
|
||||
|
||||
}
|
||||
@@ -126,12 +126,17 @@ public class CodegenController {
|
||||
@GetMapping("/preview")
|
||||
@Parameters({
|
||||
@Parameter(name = "tableId", description = "表编号", required = true, example = "1024"),
|
||||
@Parameter(name = "isBusiness", description = "是否业务基类", example = "false")
|
||||
@Parameter(name = "isBusiness", description = "是否业务基类", example = "false"),
|
||||
@Parameter(name = "isStandardized", description = "是否标准化", example = "false"),
|
||||
@Parameter(name = "isFileUpload", description = "是否包含附件上传能力", example = "false")
|
||||
})
|
||||
@PreAuthorize("@ss.hasPermission('infra:codegen:preview')")
|
||||
public CommonResult<List<CodegenPreviewRespVO>> previewCodegen(@RequestParam("tableId") Long tableId,
|
||||
@RequestParam(value = "isBusiness", required = false, defaultValue = "false") Boolean isBusiness) {
|
||||
Map<String, String> codes = codegenService.generationCodes(tableId, isBusiness);
|
||||
public CommonResult<List<CodegenPreviewRespVO>> previewCodegen(
|
||||
@RequestParam("tableId") Long tableId,
|
||||
@RequestParam(value = "isBusiness", required = false, defaultValue = "false") Boolean isBusiness,
|
||||
@RequestParam(value = "isStandardized", required = false, defaultValue = "false") Boolean isStandardized,
|
||||
@RequestParam(value = "isFileUpload", required = false, defaultValue = "false") Boolean isFileUpload) {
|
||||
Map<String, String> codes = codegenService.generationCodes(tableId, isBusiness, isStandardized, isFileUpload);
|
||||
return success(CodegenConvert.INSTANCE.convert(codes));
|
||||
}
|
||||
|
||||
@@ -139,14 +144,19 @@ public class CodegenController {
|
||||
@GetMapping("/download")
|
||||
@Parameters({
|
||||
@Parameter(name = "tableId", description = "表编号", required = true, example = "1024"),
|
||||
@Parameter(name = "isBusiness", description = "是否业务基类", example = "false")
|
||||
@Parameter(name = "isBusiness", description = "是否业务基类", example = "false"),
|
||||
@Parameter(name = "isStandardized", description = "是否标准化", example = "false"),
|
||||
@Parameter(name = "isFileUpload", description = "是否包含附件上传能力", example = "false")
|
||||
})
|
||||
@PreAuthorize("@ss.hasPermission('infra:codegen:download')")
|
||||
public void downloadCodegen(@RequestParam("tableId") Long tableId,
|
||||
@RequestParam(value = "isBusiness", required = false, defaultValue = "false") Boolean isBusiness,
|
||||
HttpServletResponse response) throws IOException {
|
||||
// 生成代码,传递 isBusiness
|
||||
Map<String, String> codes = codegenService.generationCodes(tableId, isBusiness);
|
||||
public void downloadCodegen(
|
||||
@RequestParam("tableId") Long tableId,
|
||||
@RequestParam(value = "isBusiness", required = false, defaultValue = "false") Boolean isBusiness,
|
||||
@RequestParam(value = "isStandardized", required = false, defaultValue = "false") Boolean isStandardized,
|
||||
@RequestParam(value = "isFileUpload", required = false, defaultValue = "false") Boolean isFileUpload,
|
||||
HttpServletResponse response) throws IOException {
|
||||
// 生成代码,传递 isBusiness、isStandardized、isFileUpload
|
||||
Map<String, String> codes = codegenService.generationCodes(tableId, isBusiness, isStandardized, isFileUpload);
|
||||
// 构建 zip 包
|
||||
String[] paths = codes.keySet().toArray(new String[0]);
|
||||
ByteArrayInputStream[] ins = codes.values().stream().map(IoUtil::toUtf8Stream).toArray(ByteArrayInputStream[]::new);
|
||||
|
||||
@@ -76,7 +76,7 @@ public class FileRespVO {
|
||||
if (presignedUrl == null || presignedUrl.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
String base64PresignedUrl = Base64.getUrlEncoder().encodeToString(presignedUrl.getBytes(StandardCharsets.UTF_8));
|
||||
String base64PresignedUrl = Base64.getEncoder().encodeToString(presignedUrl.getBytes(StandardCharsets.UTF_8));
|
||||
String timestamp = String.valueOf(System.currentTimeMillis());
|
||||
String watermark = SpringUtils.getProperty("aj.captcha.water-mark", "中国铜业");
|
||||
return onlinePreview + base64PresignedUrl + "&t=" + timestamp + "&watermarkTxt=" + watermark;
|
||||
|
||||
@@ -0,0 +1,120 @@
|
||||
package cn.iocoder.yudao.module.infra.controller.admin.stdnms.stdnms;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore;
|
||||
import cn.iocoder.yudao.module.infra.controller.admin.stdnms.stdnms.vo.StdNmsPageReqVO;
|
||||
import cn.iocoder.yudao.module.infra.controller.admin.stdnms.stdnms.vo.StdNmsRespVO;
|
||||
import cn.iocoder.yudao.module.infra.controller.admin.stdnms.stdnms.vo.StdNmsSaveReqVO;
|
||||
import cn.iocoder.yudao.module.infra.dal.dataobject.stdnms.stdnms.StdNmsDO;
|
||||
import cn.iocoder.yudao.module.infra.stdnms.StdNmsService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.Valid;
|
||||
import org.springframework.dao.DataIntegrityViolationException;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
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 = "管理后台 - 数据命名与简写标准")
|
||||
@RestController
|
||||
@RequestMapping("/infra/std-nms")
|
||||
@Validated
|
||||
public class StdNmsController {
|
||||
|
||||
@Resource
|
||||
private StdNmsService stdNmsService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建数据命名与简写标准")
|
||||
@PreAuthorize("@ss.hasPermission('system:std-nms:create')")
|
||||
@TenantIgnore
|
||||
public CommonResult<Long> createStdNms(@Valid @RequestBody StdNmsSaveReqVO createReqVO) {
|
||||
try {
|
||||
return success(stdNmsService.createStdNms(createReqVO));
|
||||
} catch (DataIntegrityViolationException e) {
|
||||
return CommonResult.customize(0L, HttpStatus.BAD_REQUEST.value(), "已存在相同含义的定义");
|
||||
}
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新数据命名与简写标准")
|
||||
@PreAuthorize("@ss.hasPermission('system:std-nms:update')")
|
||||
@TenantIgnore
|
||||
public CommonResult<Boolean> updateStdNms(@Valid @RequestBody StdNmsSaveReqVO updateReqVO) {
|
||||
try {
|
||||
stdNmsService.updateStdNms(updateReqVO);
|
||||
} catch (Exception e) {
|
||||
return CommonResult.customize(true,HttpStatus.BAD_REQUEST.value(), "已存在相同含义的定义");
|
||||
}
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除数据命名与简写标准")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('system:std-nms:delete')")
|
||||
@TenantIgnore
|
||||
public CommonResult<Boolean> deleteStdNms(@RequestParam("id") Long id) {
|
||||
stdNmsService.deleteStdNms(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除数据命名与简写标准")
|
||||
@PreAuthorize("@ss.hasPermission('system:std-nms:delete')")
|
||||
@TenantIgnore
|
||||
public CommonResult<Boolean> deleteStdNmsList(@RequestParam("ids") List<Long> ids) {
|
||||
stdNmsService.deleteStdNmsListByIds(ids);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得数据命名与简写标准")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('system:std-nms:query')")
|
||||
@TenantIgnore
|
||||
public CommonResult<StdNmsRespVO> getStdNms(@RequestParam("id") Long id) {
|
||||
StdNmsDO stdNms = stdNmsService.getStdNms(id);
|
||||
return success(BeanUtils.toBean(stdNms, StdNmsRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得数据命名与简写标准分页")
|
||||
@PreAuthorize("@ss.hasPermission('system:std-nms:query')")
|
||||
@TenantIgnore
|
||||
public CommonResult<PageResult<StdNmsRespVO>> getStdNmsPage(@Valid StdNmsPageReqVO pageReqVO) {
|
||||
PageResult<StdNmsDO> pageResult = stdNmsService.getStdNmsPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, StdNmsRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出数据命名与简写标准 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('system:std-nms:export')")
|
||||
@TenantIgnore
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportStdNmsExcel(@Valid StdNmsPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<StdNmsDO> list = stdNmsService.getStdNmsPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "数据命名与简写标准.xls", "数据", StdNmsRespVO.class,
|
||||
BeanUtils.toBean(list, StdNmsRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package cn.iocoder.yudao.module.infra.controller.admin.stdnms.stdnms.vo;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 数据命名与简写标准分页 Request VO")
|
||||
@Data
|
||||
public class StdNmsPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "英文")
|
||||
private String word;
|
||||
|
||||
@Schema(description = "简写")
|
||||
private String abbr;
|
||||
|
||||
@Schema(description = "中文意思")
|
||||
private String info;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package cn.iocoder.yudao.module.infra.controller.admin.stdnms.stdnms.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 数据命名与简写标准 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class StdNmsRespVO {
|
||||
|
||||
@Schema(description = "主键ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "2987")
|
||||
@ExcelProperty("主键ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "英文", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("英文")
|
||||
private String word;
|
||||
|
||||
@Schema(description = "简写", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("简写")
|
||||
private String abbr;
|
||||
|
||||
@Schema(description = "中文意思", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("中文意思")
|
||||
private String info;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package cn.iocoder.yudao.module.infra.controller.admin.stdnms.stdnms.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import lombok.Data;
|
||||
|
||||
@Schema(description = "管理后台 - 数据命名与简写标准新增/修改 Request VO")
|
||||
@Data
|
||||
public class StdNmsSaveReqVO {
|
||||
|
||||
@Schema(description = "主键ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "2987")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "英文", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "英文不能为空")
|
||||
private String word;
|
||||
|
||||
@Schema(description = "简写", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "简写不能为空")
|
||||
private String abbr;
|
||||
|
||||
@Schema(description = "中文意思", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "中文意思不能为空")
|
||||
private String info;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
package cn.iocoder.yudao.module.infra.dal.dataobject.businessfile;
|
||||
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.*;
|
||||
/**
|
||||
* 业务附件关联 DO
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
@TableName("infra_bsn_file")
|
||||
@KeySequence("infra_bsn_file_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class BusinessFileDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
/**
|
||||
* 业务Id
|
||||
*/
|
||||
@TableField("BSN_ID")
|
||||
private Long businessId;
|
||||
/**
|
||||
* 业务编码
|
||||
*/
|
||||
@TableField("BSN_CD")
|
||||
private String businessCode;
|
||||
/**
|
||||
* 附件fileId
|
||||
*/
|
||||
@TableField("FILE_ID")
|
||||
private Long fileId;
|
||||
/**
|
||||
* 附件名称
|
||||
*/
|
||||
@TableField("FILE_NAME")
|
||||
private String fileName;
|
||||
/**
|
||||
* 附件来源
|
||||
*/
|
||||
@TableField("SRC")
|
||||
private String source;
|
||||
|
||||
|
||||
}
|
||||
@@ -2,11 +2,9 @@ package cn.iocoder.yudao.module.infra.dal.dataobject.file;
|
||||
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.*;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
/**
|
||||
* 文件表
|
||||
@@ -67,4 +65,16 @@ public class FileDO extends BaseDO {
|
||||
*/
|
||||
private String aesIv;
|
||||
|
||||
/**
|
||||
* 是否加密
|
||||
* <p>
|
||||
* 例如,使用 AES 加密时,isEncrypted = true;未加密时,isEncrypted = false。
|
||||
*/
|
||||
@TableField(exist = false) // 不在数据库中
|
||||
private Boolean isEncrypted;
|
||||
|
||||
|
||||
public Boolean getIsEncrypted() {
|
||||
return !StringUtils.isBlank(aesIv);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
package cn.iocoder.yudao.module.infra.dal.dataobject.stdnms.stdnms;
|
||||
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.*;
|
||||
/**
|
||||
* 数据命名与简写标准 DO
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
@TableName("infra_std_nms")
|
||||
@KeySequence("infra_std_nms_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
/**
|
||||
* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO
|
||||
*/
|
||||
public class StdNmsDO extends BaseDO {
|
||||
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
/**
|
||||
* 英文
|
||||
*/
|
||||
private String word;
|
||||
/**
|
||||
* 简写
|
||||
*/
|
||||
private String abbr;
|
||||
/**
|
||||
* 中文意思
|
||||
*/
|
||||
private String info;
|
||||
/**
|
||||
* 是否删除(取消逻辑删除)
|
||||
*/
|
||||
private Boolean deleted;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package cn.iocoder.yudao.module.infra.dal.mysql.businessfile;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.module.infra.dal.dataobject.businessfile.BusinessFileDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import cn.iocoder.yudao.module.infra.controller.admin.businessfile.vo.*;
|
||||
|
||||
/**
|
||||
* 业务附件关联 Mapper
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
@Mapper
|
||||
public interface BusinessFileMapper extends BaseMapperX<BusinessFileDO> {
|
||||
|
||||
default PageResult<BusinessFileDO> selectPage(BusinessFilePageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<BusinessFileDO>()
|
||||
.eqIfPresent(BusinessFileDO::getBusinessId, reqVO.getBusinessId())
|
||||
.eqIfPresent(BusinessFileDO::getBusinessCode, reqVO.getBusinessCode())
|
||||
.eqIfPresent(BusinessFileDO::getFileId, reqVO.getFileId())
|
||||
.likeIfPresent(BusinessFileDO::getFileName, reqVO.getFileName())
|
||||
.eqIfPresent(BusinessFileDO::getSource, reqVO.getSource())
|
||||
.betweenIfPresent(BusinessFileDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(BusinessFileDO::getId));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package cn.iocoder.yudao.module.infra.dal.mysql.stdnms;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.module.infra.controller.admin.stdnms.stdnms.vo.StdNmsPageReqVO;
|
||||
import cn.iocoder.yudao.module.infra.dal.dataobject.stdnms.stdnms.StdNmsDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 数据命名与简写标准 Mapper
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
@Mapper
|
||||
public interface StdNmsMapper extends BaseMapperX<StdNmsDO> {
|
||||
|
||||
// 使用自定义 XML SQL 分页查询,word 不区分大小写
|
||||
List<StdNmsDO> selectPageCustom(StdNmsPageReqVO reqVO);
|
||||
|
||||
default PageResult<StdNmsDO> selectPage(StdNmsPageReqVO reqVO) {
|
||||
List<StdNmsDO> records = selectPageCustom(reqVO);
|
||||
// 这里只做简单封装,如需 total 可自定义 count SQL
|
||||
return new PageResult<>(records, (long) records.size());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
package cn.iocoder.yudao.module.infra.service.businessfile;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.module.infra.controller.admin.businessfile.vo.BusinessFilePageReqVO;
|
||||
import cn.iocoder.yudao.module.infra.controller.admin.businessfile.vo.BusinessFileSaveReqVO;
|
||||
import cn.iocoder.yudao.module.infra.dal.dataobject.businessfile.BusinessFileDO;
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 业务附件关联 Service 接口
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
public interface BusinessFileService {
|
||||
|
||||
/**
|
||||
* 创建业务附件关联
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createBusinessFile(@Valid BusinessFileSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新业务附件关联
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateBusinessFile(@Valid BusinessFileSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除业务附件关联
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteBusinessFile(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除业务附件关联
|
||||
*
|
||||
* @param ids 编号
|
||||
*/
|
||||
void deleteBusinessFileListByIds(List<Long> ids);
|
||||
|
||||
/**
|
||||
* 获得业务附件关联
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 业务附件关联
|
||||
*/
|
||||
BusinessFileDO getBusinessFile(Long id);
|
||||
|
||||
/**
|
||||
* 获得业务附件关联分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 业务附件关联分页
|
||||
*/
|
||||
PageResult<BusinessFileDO> getBusinessFilePage(BusinessFilePageReqVO pageReqVO);
|
||||
|
||||
List<Long> batchCreateBusinessFile(List<BusinessFileSaveReqVO> createReqVOList);
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
package cn.iocoder.yudao.module.infra.service.businessfile;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.infra.controller.admin.businessfile.vo.BusinessFilePageReqVO;
|
||||
import cn.iocoder.yudao.module.infra.controller.admin.businessfile.vo.BusinessFileSaveReqVO;
|
||||
import cn.iocoder.yudao.module.infra.dal.dataobject.businessfile.BusinessFileDO;
|
||||
import cn.iocoder.yudao.module.infra.dal.mysql.businessfile.BusinessFileMapper;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.infra.enums.ErrorCodeConstants.BUSINESS_FILE_NOT_EXISTS;
|
||||
|
||||
/**
|
||||
* 业务附件关联 Service 实现类
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class BusinessFileServiceImpl implements BusinessFileService {
|
||||
|
||||
@Resource
|
||||
private BusinessFileMapper businessFileMapper;
|
||||
|
||||
@Override
|
||||
public Long createBusinessFile(BusinessFileSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
BusinessFileDO businessFile = BeanUtils.toBean(createReqVO, BusinessFileDO.class);
|
||||
businessFileMapper.insert(businessFile);
|
||||
// 返回
|
||||
return businessFile.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateBusinessFile(BusinessFileSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateBusinessFileExists(updateReqVO.getId());
|
||||
// 更新
|
||||
BusinessFileDO updateObj = BeanUtils.toBean(updateReqVO, BusinessFileDO.class);
|
||||
businessFileMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteBusinessFile(Long id) {
|
||||
// 校验存在
|
||||
validateBusinessFileExists(id);
|
||||
// 删除
|
||||
businessFileMapper.deleteById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteBusinessFileListByIds(List<Long> ids) {
|
||||
// 校验存在
|
||||
validateBusinessFileExists(ids);
|
||||
// 删除
|
||||
businessFileMapper.deleteByIds(ids);
|
||||
}
|
||||
|
||||
private void validateBusinessFileExists(List<Long> ids) {
|
||||
List<BusinessFileDO> list = businessFileMapper.selectByIds(ids);
|
||||
if (CollUtil.isEmpty(list) || list.size() != ids.size()) {
|
||||
throw exception(BUSINESS_FILE_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
private void validateBusinessFileExists(Long id) {
|
||||
if (businessFileMapper.selectById(id) == null) {
|
||||
throw exception(BUSINESS_FILE_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public BusinessFileDO getBusinessFile(Long id) {
|
||||
return businessFileMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<BusinessFileDO> getBusinessFilePage(BusinessFilePageReqVO pageReqVO) {
|
||||
return businessFileMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Long> batchCreateBusinessFile(List<BusinessFileSaveReqVO> createReqVOList) {
|
||||
List<BusinessFileDO> businessFileList = BeanUtils.toBean(createReqVOList, BusinessFileDO.class);
|
||||
List<Long> ids = new ArrayList<>();
|
||||
for (BusinessFileDO businessFile : businessFileList) {
|
||||
businessFileMapper.insert(businessFile);
|
||||
ids.add(businessFile.getId());
|
||||
}
|
||||
return ids;
|
||||
}
|
||||
}
|
||||
@@ -81,18 +81,14 @@ public interface CodegenService {
|
||||
List<CodegenColumnDO> getCodegenColumnListByTableId(Long tableId);
|
||||
|
||||
/**
|
||||
* 执行指定表的代码生成
|
||||
*
|
||||
* @param tableId 表编号
|
||||
* @return 生成结果。key 为文件路径,value 为对应的代码内容
|
||||
*/
|
||||
/**
|
||||
* 执行指定表的代码生成,支持业务基类继承
|
||||
* 执行指定表的代码生成,支持业务基类继承、标准化和附件上传能力
|
||||
* @param tableId 表编号
|
||||
* @param isBusiness 是否业务基类
|
||||
* @return 生成结果
|
||||
* @param isStandardized 是否标准化
|
||||
* @param isFileUpload 是否包含附件上传能力
|
||||
* @return 生成结果。key 为文件路径,value 为对应的代码内容
|
||||
*/
|
||||
Map<String, String> generationCodes(Long tableId, Boolean isBusiness);
|
||||
Map<String, String> generationCodes(Long tableId, Boolean isBusiness, Boolean isStandardized, Boolean isFileUpload);
|
||||
|
||||
/**
|
||||
* 兼容原有接口,默认 isBusiness=false
|
||||
|
||||
@@ -246,7 +246,7 @@ public class CodegenServiceImpl implements CodegenService {
|
||||
/**
|
||||
* 执行指定表的代码生成,支持业务基类继承
|
||||
*/
|
||||
public Map<String, String> generationCodes(Long tableId, Boolean isBusiness) {
|
||||
public Map<String, String> generationCodes(Long tableId, Boolean isBusiness, Boolean isStandardized, Boolean isFileUpload) {
|
||||
// 校验是否已经存在
|
||||
CodegenTableDO table = codegenTableMapper.selectById(tableId);
|
||||
if (table == null) {
|
||||
@@ -278,8 +278,13 @@ public class CodegenServiceImpl implements CodegenService {
|
||||
}
|
||||
}
|
||||
|
||||
// 执行生成,传递 isBusiness
|
||||
return codegenEngine.execute(table, columns, subTables, subColumnsList, isBusiness != null && isBusiness);
|
||||
// 执行生成,传递 extraParam
|
||||
Map<String, Object> extraParam = new HashMap<>();
|
||||
extraParam.put("isBusiness", isBusiness != null && isBusiness);
|
||||
extraParam.put("isStandardized", isStandardized != null && isStandardized);
|
||||
extraParam.put("isFileUpload", isFileUpload != null && isFileUpload);
|
||||
|
||||
return codegenEngine.execute(table, columns, subTables, subColumnsList, extraParam);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -287,7 +292,7 @@ public class CodegenServiceImpl implements CodegenService {
|
||||
*/
|
||||
@Override
|
||||
public Map<String, String> generationCodes(Long tableId) {
|
||||
return generationCodes(tableId, false);
|
||||
return generationCodes(tableId, false, false, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -29,11 +29,13 @@ import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.module.infra.dal.dataobject.codegen.CodegenColumnDO;
|
||||
import cn.iocoder.yudao.module.infra.dal.dataobject.codegen.CodegenTableDO;
|
||||
import cn.iocoder.yudao.module.infra.dal.dataobject.stdnms.stdnms.StdNmsDO;
|
||||
import cn.iocoder.yudao.module.infra.enums.codegen.CodegenFrontTypeEnum;
|
||||
import cn.iocoder.yudao.module.infra.enums.codegen.CodegenSceneEnum;
|
||||
import cn.iocoder.yudao.module.infra.enums.codegen.CodegenTemplateTypeEnum;
|
||||
import cn.iocoder.yudao.module.infra.enums.codegen.CodegenVOTypeEnum;
|
||||
import cn.iocoder.yudao.module.infra.framework.codegen.config.CodegenProperties;
|
||||
import cn.iocoder.yudao.module.infra.stdnms.StdNmsService;
|
||||
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
||||
import com.google.common.annotations.VisibleForTesting;
|
||||
import com.google.common.collect.ImmutableTable;
|
||||
@@ -46,9 +48,14 @@ import org.springframework.stereotype.Component;
|
||||
import org.springframework.util.ClassUtils;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.IntStream;
|
||||
|
||||
import static cn.hutool.core.map.MapUtil.getStr;
|
||||
import static cn.hutool.core.text.CharSequenceUtil.*;
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.infra.enums.ErrorCodeConstants.STD_ABBR_NOT_EXISTS;
|
||||
|
||||
/**
|
||||
* 代码生成的引擎,用于具体生成代码
|
||||
@@ -59,6 +66,8 @@ import static cn.hutool.core.text.CharSequenceUtil.*;
|
||||
*/
|
||||
@Component
|
||||
public class CodegenEngine {
|
||||
@Resource
|
||||
private StdNmsService stdNmsService;
|
||||
|
||||
/**
|
||||
* 后端的模板配置
|
||||
@@ -273,12 +282,22 @@ public class CodegenEngine {
|
||||
* 代码生成,支持业务基类继承
|
||||
* @param isBusiness 是否业务基类
|
||||
*/
|
||||
/**
|
||||
* 代码生成,支持传递额外参数
|
||||
* @param extraParam 额外参数,如 isBusiness
|
||||
*/
|
||||
public Map<String, String> execute(CodegenTableDO table, List<CodegenColumnDO> columns,
|
||||
List<CodegenTableDO> subTables, List<List<CodegenColumnDO>> subColumnsList, boolean isBusiness) {
|
||||
List<CodegenTableDO> subTables, List<List<CodegenColumnDO>> subColumnsList, Map<String, Object> extraParam) {
|
||||
// 1.1 初始化 bindMap 上下文
|
||||
Map<String, Object> bindingMap = initBindingMap(table, columns, subTables, subColumnsList);
|
||||
// 传递 isBusiness 到模板
|
||||
bindingMap.put("isBusiness", isBusiness);
|
||||
|
||||
// 标准化命名校验逻辑
|
||||
standardizedJavaField(columns, subColumnsList, extraParam);
|
||||
|
||||
// 传递 extraParam 到模板
|
||||
if (extraParam != null) {
|
||||
bindingMap.putAll(extraParam);
|
||||
}
|
||||
// 1.2 获得模版
|
||||
Map<String, String> templates = getTemplates(table.getFrontType());
|
||||
|
||||
@@ -308,12 +327,76 @@ public class CodegenEngine {
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 如果是标准化的字段名需要针对标准命名表映射 javaField 全名
|
||||
* @param columns 主表的字段集合
|
||||
* @param subColumnsList 子表的字段集合
|
||||
* @param extraParam 额外参数,包含 isStandardized 标志
|
||||
*/
|
||||
private void standardizedJavaField(List<CodegenColumnDO> columns, List<List<CodegenColumnDO>> subColumnsList, Map<String, Object> extraParam) {
|
||||
if (extraParam != null && Boolean.TRUE.equals(extraParam.get("isStandardized"))) {
|
||||
List<CodegenColumnDO> allColumns = new ArrayList<>();
|
||||
allColumns.addAll(columns);
|
||||
allColumns.addAll(Optional.ofNullable(subColumnsList).orElse(new ArrayList<>()).stream().flatMap(Collection::stream).toList());
|
||||
// BusinessBaseDO 字段集合
|
||||
Set<String> businessBaseFields = CodegenBuilder.BUSINESS_BASE_DO_FIELDS;
|
||||
Map<String, String> abbrToFullName = new HashMap<>();
|
||||
Set<String> columnNameSet = allColumns.stream()
|
||||
// 跳过 BusinessBaseDO 字段
|
||||
.filter(x -> !businessBaseFields.contains(x.getJavaField()))
|
||||
.map(CodegenColumnDO::getColumnName).collect(Collectors.toSet());
|
||||
// 分词(如驼峰转词组)
|
||||
Set<String> phrases = columnNameSet.stream().map(String::toLowerCase)
|
||||
// 分割,最终使用大写
|
||||
.flatMap(y -> Arrays.stream(y.split("_"))).map(String::toUpperCase)
|
||||
.collect(Collectors.toSet());
|
||||
List<StdNmsDO> checkedData = stdNmsService.getStdNmsListByAbbrs(phrases);
|
||||
Set<String> stdAbbrSet = checkedData.stream().map(StdNmsDO::getAbbr).collect(Collectors.toSet());
|
||||
phrases.removeAll(stdAbbrSet);
|
||||
if (CollUtil.isNotEmpty(phrases)) {
|
||||
throw exception(STD_ABBR_NOT_EXISTS, String.join(",", phrases));
|
||||
}
|
||||
Map<String, String> stdNmsAbbrMap = new ConcurrentHashMap<>();
|
||||
checkedData.forEach(x-> {
|
||||
stdNmsAbbrMap.put(x.getAbbr(), x.getWord());
|
||||
});
|
||||
|
||||
// 构造列名和全名的映射(需要根据短语映射的关系进行拼接)
|
||||
abbrToFullName = allColumns.stream()
|
||||
// 跳过 BusinessBaseDO 字段
|
||||
.filter(x -> !businessBaseFields.contains(x.getJavaField()))
|
||||
.collect(Collectors.toMap(
|
||||
CodegenColumnDO::getJavaField,
|
||||
column -> {
|
||||
// 1.1.1 获取短语
|
||||
String columnName = column.getColumnName().toUpperCase();
|
||||
List<String> words = new LinkedList<>(Arrays.asList(columnName.split("_")));
|
||||
List<String> fullWords = words.stream().map(stdNmsAbbrMap::get).map(String::toLowerCase).toList();
|
||||
// 拼接 fullName 除第一个单词外,首字母需要大写
|
||||
return IntStream.range(0, fullWords.size())
|
||||
.mapToObj(i -> i == 0 ? fullWords.get(i) : Character.toUpperCase(fullWords.get(i).charAt(0)) + fullWords.get(i).substring(1))
|
||||
.collect(Collectors.joining());
|
||||
},
|
||||
(v1, v2) -> v1,
|
||||
HashMap::new
|
||||
));
|
||||
// 替换 所有列的 javaField
|
||||
Map<String, String> finalAbbrToFullName = abbrToFullName;
|
||||
columns.stream().filter(x -> !businessBaseFields.contains(x.getJavaField())).forEach(column -> {
|
||||
String fullName = finalAbbrToFullName.get(column.getJavaField());
|
||||
column.setJavaField(fullName);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 兼容原有接口,默认 isBusiness=false
|
||||
*/
|
||||
public Map<String, String> execute(CodegenTableDO table, List<CodegenColumnDO> columns,
|
||||
List<CodegenTableDO> subTables, List<List<CodegenColumnDO>> subColumnsList) {
|
||||
return execute(table, columns, subTables, subColumnsList, false);
|
||||
Map<String, Object> extraParam = new HashMap<>();
|
||||
extraParam.put("isBusiness", false);
|
||||
return execute(table, columns, subTables, subColumnsList, extraParam);
|
||||
}
|
||||
|
||||
private void generateCode(Map<String, String> result, String vmPath,
|
||||
|
||||
@@ -124,15 +124,7 @@ public class FileServiceImpl implements FileService {
|
||||
@Override
|
||||
public FileRespVO createFileWhitReturn(byte[] content, String name, String directory, String type, Boolean encrypt) {
|
||||
FileDO entity = uploadFile(content, name, directory, type, encrypt);
|
||||
return new FileRespVO()
|
||||
.setId(entity.getId())
|
||||
.setName(entity.getName())
|
||||
.setPath(entity.getPath())
|
||||
.setUrl(entity.getUrl())
|
||||
.setType(entity.getType())
|
||||
.setSize(entity.getSize())
|
||||
.setConfigId(entity.getConfigId())
|
||||
.setIsEncrypted(entity.getAesIv() != null && !entity.getAesIv().isEmpty());
|
||||
return BeanUtils.toBean(entity, FileRespVO.class);
|
||||
}
|
||||
|
||||
private FileDO uploadFile(byte[] content, String name, String directory, String type, Boolean encrypt) throws Exception {
|
||||
|
||||
@@ -0,0 +1,76 @@
|
||||
package cn.iocoder.yudao.module.infra.stdnms;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.module.infra.controller.admin.stdnms.stdnms.vo.StdNmsPageReqVO;
|
||||
import cn.iocoder.yudao.module.infra.controller.admin.stdnms.stdnms.vo.StdNmsSaveReqVO;
|
||||
import cn.iocoder.yudao.module.infra.dal.dataobject.stdnms.stdnms.StdNmsDO;
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 数据命名与简写标准 Service 接口
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
public interface StdNmsService {
|
||||
|
||||
/**
|
||||
* 创建数据命名与简写标准
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createStdNms(@Valid StdNmsSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新数据命名与简写标准
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateStdNms(@Valid StdNmsSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除数据命名与简写标准
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteStdNms(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除数据命名与简写标准
|
||||
*
|
||||
* @param ids 编号
|
||||
*/
|
||||
void deleteStdNmsListByIds(List<Long> ids);
|
||||
|
||||
/**
|
||||
* 获得数据命名与简写标准
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 数据命名与简写标准
|
||||
*/
|
||||
StdNmsDO getStdNms(Long id);
|
||||
|
||||
/**
|
||||
* 获得数据命名与简写标准分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 数据命名与简写标准分页
|
||||
*/
|
||||
PageResult<StdNmsDO> getStdNmsPage(StdNmsPageReqVO pageReqVO);
|
||||
/**
|
||||
* 根据缩写查询数据命名与简写标准
|
||||
* @param abbr 缩写
|
||||
* @return 数据命名与简写标准
|
||||
*/
|
||||
StdNmsDO getStdNmsByAbbr(String abbr);
|
||||
|
||||
/**
|
||||
* 根据缩写列表查询数据命名与简写标准
|
||||
* @param abbrs 缩写列表
|
||||
* @return 数据命名与简写标准列表
|
||||
*/
|
||||
List<StdNmsDO> getStdNmsListByAbbrs(Collection<String> abbrs);
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
package cn.iocoder.yudao.module.infra.stdnms;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore;
|
||||
import cn.iocoder.yudao.module.infra.controller.admin.stdnms.stdnms.vo.StdNmsPageReqVO;
|
||||
import cn.iocoder.yudao.module.infra.controller.admin.stdnms.stdnms.vo.StdNmsSaveReqVO;
|
||||
import cn.iocoder.yudao.module.infra.dal.dataobject.stdnms.stdnms.StdNmsDO;
|
||||
import cn.iocoder.yudao.module.infra.dal.mysql.stdnms.StdNmsMapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.infra.enums.ErrorCodeConstants.STD_NMS_NOT_EXISTS;
|
||||
|
||||
/**
|
||||
* 数据命名与简写标准 Service 实现类
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
@TenantIgnore
|
||||
public class StdNmsServiceImpl implements StdNmsService {
|
||||
|
||||
@Resource
|
||||
private StdNmsMapper stdNmsMapper;
|
||||
|
||||
@Override
|
||||
public StdNmsDO getStdNmsByAbbr(String abbr) {
|
||||
QueryWrapper<StdNmsDO> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("abbr", abbr);
|
||||
return stdNmsMapper.selectOne(queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<StdNmsDO> getStdNmsListByAbbrs(Collection<String> abbrs) {
|
||||
QueryWrapper<StdNmsDO> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.in("abbr", abbrs);
|
||||
return stdNmsMapper.selectList(queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long createStdNms(StdNmsSaveReqVO createReqVO) {
|
||||
StdNmsDO stdNms = BeanUtils.toBean(createReqVO, StdNmsDO.class);
|
||||
stdNmsMapper.insert(stdNms);
|
||||
// 返回
|
||||
return stdNms.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateStdNms(StdNmsSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateStdNmsExists(updateReqVO.getId());
|
||||
// 更新
|
||||
StdNmsDO updateObj = BeanUtils.toBean(updateReqVO, StdNmsDO.class);
|
||||
stdNmsMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteStdNms(Long id) {
|
||||
// 校验存在
|
||||
validateStdNmsExists(id);
|
||||
// 删除
|
||||
stdNmsMapper.deleteById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteStdNmsListByIds(List<Long> ids) {
|
||||
// 校验存在
|
||||
validateStdNmsExists(ids);
|
||||
// 删除
|
||||
stdNmsMapper.deleteByIds(ids);
|
||||
}
|
||||
|
||||
private void validateStdNmsExists(List<Long> ids) {
|
||||
List<StdNmsDO> list = stdNmsMapper.selectByIds(ids);
|
||||
if (CollUtil.isEmpty(list) || list.size() != ids.size()) {
|
||||
throw exception(STD_NMS_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
private void validateStdNmsExists(Long id) {
|
||||
if (stdNmsMapper.selectById(id) == null) {
|
||||
throw exception(STD_NMS_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public StdNmsDO getStdNms(Long id) {
|
||||
return stdNmsMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<StdNmsDO> getStdNmsPage(StdNmsPageReqVO pageReqVO) {
|
||||
return stdNmsMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -173,5 +173,6 @@ yudao:
|
||||
enable: true
|
||||
ignore-urls:
|
||||
ignore-tables:
|
||||
- infra_std_nms
|
||||
|
||||
debug: false
|
||||
|
||||
@@ -3,10 +3,16 @@ package ${basePackage}.module.${table.moduleName}.controller.${sceneEnum.basePac
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import ${jakartaPackage}.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
#if ($sceneEnum.scene == 1)import org.springframework.security.access.prepost.PreAuthorize;#end
|
||||
#if ($sceneEnum.scene == 1)
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
#end
|
||||
#if($isBusiness && $isBusiness == true)
|
||||
import ${basePackage}.framework.business.interceptor.BusinessControllerMarker;
|
||||
#end
|
||||
#if($isFileUpload && $isFileUpload == true)
|
||||
import ${basePackage}.framework.business.annotation.FileUploadController;
|
||||
import ${basePackage}.framework.business.controller.AbstractFileUploadController;
|
||||
#end
|
||||
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
@@ -42,11 +48,27 @@ import ${basePackage}.module.${table.moduleName}.service.${table.businessName}.$
|
||||
##二级的 businessName 暂时不算在 HTTP 路径上,可以根据需要写
|
||||
@RequestMapping("/${table.moduleName}/${simpleClassName_strikeCase}")
|
||||
@Validated
|
||||
#if($isFileUpload && $isFileUpload == true)
|
||||
@FileUploadController(source = "${table.moduleName}.${table.businessName}")
|
||||
#end
|
||||
## 支持业务基类标记:isBusiness=true 时继承 BusinessControllerMarker
|
||||
#if($isBusiness && $isBusiness == true)
|
||||
#if($isBusiness && $isBusiness == true && (!$isFileUpload || !$isFileUpload == true))
|
||||
public class ${sceneEnum.prefixClass}${table.className}Controller implements BusinessControllerMarker {
|
||||
#else
|
||||
#elseif((!$isBusiness || !$isBusiness == true) && (!$isFileUpload || !$isFileUpload == true))
|
||||
public class ${sceneEnum.prefixClass}${table.className}Controller {
|
||||
#elseif($isBusiness && $isBusiness == true && $isFileUpload && $isFileUpload == true)
|
||||
public class ${sceneEnum.prefixClass}${table.className}Controller extends AbstractFileUploadController implements BusinessControllerMarker{
|
||||
#elseif((!$isBusiness || !$isBusiness == true) && $isFileUpload && $isFileUpload == true)
|
||||
public class ${sceneEnum.prefixClass}${table.className}Controller extends AbstractFileUploadController {
|
||||
#end
|
||||
|
||||
#if($isFileUpload && $isFileUpload == true)
|
||||
static {
|
||||
FileUploadController annotation = DemoContractController.class.getAnnotation(FileUploadController.class);
|
||||
if (annotation != null) {
|
||||
setFileUploadInfo(annotation);
|
||||
}
|
||||
}
|
||||
#end
|
||||
|
||||
@Resource
|
||||
@@ -57,7 +79,7 @@ public class ${sceneEnum.prefixClass}${table.className}Controller {
|
||||
#if ($sceneEnum.scene == 1)
|
||||
@PreAuthorize("@ss.hasPermission('${permissionPrefix}:create')")
|
||||
#end
|
||||
public CommonResult<${primaryColumn.javaType}> create${simpleClassName}(@Valid @RequestBody ${saveReqVOClass} ${saveReqVOVar}) {
|
||||
public CommonResult<${respVOClass}> create${simpleClassName}(@Valid @RequestBody ${saveReqVOClass} ${saveReqVOVar}) {
|
||||
return success(${classNameVar}Service.create${simpleClassName}(${saveReqVOVar}));
|
||||
}
|
||||
|
||||
|
||||
@@ -3,12 +3,12 @@ package ${basePackage}.module.${table.moduleName}.dal.dataobject.${table.busines
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
#foreach ($column in $columns)
|
||||
#if (${column.javaType} == "BigDecimal")
|
||||
import java.math.BigDecimal;
|
||||
#end
|
||||
#if (${column.javaType} == "LocalDateTime")
|
||||
import java.time.LocalDateTime;
|
||||
#end
|
||||
#if (${column.javaType} == "BigDecimal")
|
||||
import java.math.BigDecimal;
|
||||
#end
|
||||
#if (${column.javaType} == "LocalDateTime")
|
||||
import java.time.LocalDateTime;
|
||||
#end
|
||||
#end
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
## 导入基类
|
||||
@@ -21,19 +21,19 @@ import ${BaseDOClassName};
|
||||
#if ($voType == 20)
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
#foreach ($column in $columns)
|
||||
#if ("$!column.dictType" != "")## 有设置数据字典
|
||||
#foreach ($column in $columns)
|
||||
#if ("$!column.dictType" != "")## 有设置数据字典
|
||||
import ${DictFormatClassName};
|
||||
import ${DictConvertClassName};
|
||||
#break
|
||||
#break
|
||||
#end
|
||||
#end
|
||||
#end
|
||||
#end
|
||||
/**
|
||||
* ${table.classComment} DO
|
||||
*
|
||||
* @author ${table.author}
|
||||
*/
|
||||
* ${table.classComment} DO
|
||||
*
|
||||
* @author ${table.author}
|
||||
*/
|
||||
@TableName("${table.tableName.toLowerCase()}")
|
||||
@KeySequence("${table.tableName.toLowerCase()}_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@@ -48,8 +48,8 @@ import com.alibaba.excel.annotation.*;
|
||||
@ExcelIgnoreUnannotated
|
||||
#end
|
||||
/**
|
||||
* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO
|
||||
*/
|
||||
* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO
|
||||
*/
|
||||
#if($isBusiness && $isBusiness == true)
|
||||
public class ${table.className}DO extends BusinessBaseDO {
|
||||
#else
|
||||
@@ -58,67 +58,53 @@ public class ${table.className}DO extends BaseDO {
|
||||
|
||||
## 特殊:树表专属逻辑
|
||||
#if ( $table.templateType == 2 )
|
||||
public static final Long ${treeParentColumn_javaField_underlineCase.toUpperCase()}_ROOT = 0L;
|
||||
public static final Long ${treeParentColumn_javaField_underlineCase.toUpperCase()}_ROOT = 0L;
|
||||
|
||||
#end
|
||||
|
||||
## 字段定义宏,统一渲染字段
|
||||
#macro(renderField $column $isStandardized)
|
||||
/**
|
||||
* ${column.columnComment}
|
||||
#if ("$!column.dictType" != "")
|
||||
*
|
||||
* 枚举 {@link TODO ${column.dictType} 对应的类}
|
||||
#end
|
||||
*/
|
||||
#if (${column.primaryKey})
|
||||
@TableId#if (${column.javaType} == 'String')(type = IdType.INPUT)#else(type = IdType.ASSIGN_ID)#end
|
||||
#end
|
||||
#if ($voType == 20)
|
||||
@Schema(description = "${column.columnComment}"#if (!${column.nullable}), requiredMode = Schema.RequiredMode.REQUIRED#end#if (
|
||||
"$!column.example" != ""), example = "${column.example}"#end)
|
||||
#if ("$!column.dictType" != "")
|
||||
@ExcelProperty(value = "${column.columnComment}", converter = DictConvert.class)
|
||||
@DictFormat("${column.dictType}") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中
|
||||
#else
|
||||
@ExcelProperty("${column.columnComment}")
|
||||
#end
|
||||
#end
|
||||
#if($isStandardized == true)
|
||||
#if(!${column.primaryKey})
|
||||
@TableField("${column.columnName}")
|
||||
#end
|
||||
#end
|
||||
private ${column.javaType} ${column.javaField};
|
||||
#end
|
||||
|
||||
## 字段定义,分支避免嵌套,保证 Velocity 兼容性
|
||||
#if($isBusiness == true)
|
||||
#foreach ($column in $columns)
|
||||
#if (!${businessBaseDOFields.contains(${column.javaField})})
|
||||
/**
|
||||
* ${column.columnComment}
|
||||
#if ("$!column.dictType" != "")##处理枚举值
|
||||
*
|
||||
* 枚举 {@link TODO ${column.dictType} 对应的类}
|
||||
#foreach ($column in $columns)
|
||||
#if (!${businessBaseDOFields.contains(${column.javaField})})
|
||||
#renderField($column $isStandardized)
|
||||
#end
|
||||
#end
|
||||
*/
|
||||
#if (${column.primaryKey})##处理主键
|
||||
@TableId#if (${column.javaType} == 'String')(type = IdType.INPUT)#else(type = IdType.ASSIGN_ID)#end
|
||||
#end
|
||||
#if ($voType == 20)
|
||||
## 1. 处理 Swagger 注解
|
||||
@Schema(description = "${column.columnComment}"#if (!${column.nullable}), requiredMode = Schema.RequiredMode.REQUIRED#end#if ("$!column.example" != ""), example = "${column.example}"#end)
|
||||
## 2. 处理 Excel 导出
|
||||
#if ("$!column.dictType" != "")##处理枚举值
|
||||
@ExcelProperty(value = "${column.columnComment}", converter = DictConvert.class)
|
||||
@DictFormat("${column.dictType}") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中
|
||||
#else
|
||||
@ExcelProperty("${column.columnComment}")
|
||||
#end
|
||||
#end
|
||||
## 3. 处理字段定义
|
||||
private ${column.javaType} ${column.javaField};
|
||||
#end
|
||||
#end
|
||||
#else
|
||||
#foreach ($column in $columns)
|
||||
#if (!${baseDOFields.contains(${column.javaField})})
|
||||
/**
|
||||
* ${column.columnComment}
|
||||
#if ("$!column.dictType" != "")##处理枚举值
|
||||
*
|
||||
* 枚举 {@link TODO ${column.dictType} 对应的类}
|
||||
#foreach ($column in $columns)
|
||||
#if (!${baseDOFields.contains(${column.javaField})})
|
||||
#renderField($column $isStandardized)
|
||||
#end
|
||||
#end
|
||||
*/
|
||||
#if (${column.primaryKey})##处理主键
|
||||
@TableId#if (${column.javaType} == 'String')(type = IdType.INPUT)#else(type = IdType.ASSIGN_ID)#end
|
||||
#end
|
||||
#if ($voType == 20)
|
||||
## 1. 处理 Swagger 注解
|
||||
@Schema(description = "${column.columnComment}"#if (!${column.nullable}), requiredMode = Schema.RequiredMode.REQUIRED#end#if ("$!column.example" != ""), example = "${column.example}"#end)
|
||||
## 2. 处理 Excel 导出
|
||||
#if ("$!column.dictType" != "")##处理枚举值
|
||||
@ExcelProperty(value = "${column.columnComment}", converter = DictConvert.class)
|
||||
@DictFormat("${column.dictType}") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中
|
||||
#else
|
||||
@ExcelProperty("${column.columnComment}")
|
||||
#end
|
||||
#end
|
||||
## 3. 处理字段定义
|
||||
private ${column.javaType} ${column.javaField};
|
||||
#end
|
||||
#end
|
||||
#end
|
||||
|
||||
## 特殊:主子表专属逻辑(非 ERP 模式)
|
||||
@@ -126,21 +112,21 @@ public class ${table.className}DO extends BaseDO {
|
||||
#foreach ($subTable in $subTables)
|
||||
#set ($index = $foreach.count - 1)
|
||||
#if ( $subTable.subJoinMany)
|
||||
/**
|
||||
* ${subTable.classComment}列表
|
||||
*/
|
||||
@Schema(description = "${subTable.classComment}列表")
|
||||
@TableField(exist = false)
|
||||
private List<${subTable.className}DO> ${subClassNameVars.get($index)}s;
|
||||
/**
|
||||
* ${subTable.classComment}列表
|
||||
*/
|
||||
@Schema(description = "${subTable.classComment}列表")
|
||||
@TableField(exist = false)
|
||||
private List
|
||||
<${subTable.className}DO> ${subClassNameVars.get($index)}s;
|
||||
#else
|
||||
/**
|
||||
* ${subTable.classComment}
|
||||
*/
|
||||
@Schema(description = "${subTable.classComment}")
|
||||
@TableField(exist = false)
|
||||
private ${subTable.className}DO ${subClassNameVars.get($index)};
|
||||
/**
|
||||
* ${subTable.classComment}
|
||||
*/
|
||||
@Schema(description = "${subTable.classComment}")
|
||||
@TableField(exist = false)
|
||||
private ${subTable.className}DO ${subClassNameVars.get($index)};
|
||||
#end
|
||||
#end
|
||||
#end
|
||||
|
||||
}
|
||||
@@ -24,7 +24,7 @@ public interface ${table.className}Service {
|
||||
* @param ${saveReqVOVar} 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
${primaryColumn.javaType} create${simpleClassName}(@Valid ${saveReqVOClass} ${saveReqVOVar});
|
||||
${respVOClass} create${simpleClassName}(@Valid ${saveReqVOClass} ${saveReqVOVar});
|
||||
|
||||
/**
|
||||
* 更新${table.classComment}
|
||||
|
||||
@@ -52,7 +52,7 @@ public class ${table.className}ServiceImpl implements ${table.className}Service
|
||||
#if ( $subTables && $subTables.size() > 0 && $table.templateType != 11 )
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
#end
|
||||
public ${primaryColumn.javaType} create${simpleClassName}(${saveReqVOClass} ${saveReqVOVar}) {
|
||||
public ${respVOClass} create${simpleClassName}(${saveReqVOClass} ${saveReqVOVar}) {
|
||||
## 特殊:树表专属逻辑
|
||||
#if ( $table.templateType == 2 )
|
||||
#set ($TreeParentJavaField = $treeParentColumn.javaField.substring(0,1).toUpperCase() + ${treeParentColumn.javaField.substring(1)})##首字母大写
|
||||
@@ -86,7 +86,7 @@ public class ${table.className}ServiceImpl implements ${table.className}Service
|
||||
#end
|
||||
#end
|
||||
// 返回
|
||||
return ${classNameVar}.getId();
|
||||
return BeanUtils.toBean(${classNameVar}, ${respVOClass}.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -64,6 +64,11 @@ export const ${simpleClassName}Api = {
|
||||
export${simpleClassName}: async (params) => {
|
||||
return await request.download({ url: `${baseURL}/export-excel`, params })
|
||||
},
|
||||
|
||||
// 查询接口相关的文件上传元数据信息
|
||||
getFileUploadInfo: async () => {
|
||||
return await request.get({url: `${baseURL}/upload-info`})
|
||||
}
|
||||
## 特殊:主子表专属逻辑
|
||||
#foreach ($subTable in $subTables)
|
||||
#set ($index = $foreach.count - 1)
|
||||
|
||||
@@ -115,6 +115,11 @@
|
||||
#end
|
||||
#end
|
||||
#end
|
||||
#if($isFileUpload && $isFileUpload == true)
|
||||
<el-form-item label="附件" prop="files">
|
||||
<UploadFile v-model="formData.files" />
|
||||
</el-form-item>
|
||||
#end
|
||||
</el-form>
|
||||
## 特殊:主子表专属逻辑
|
||||
#if ( $table.templateType == 10 || $table.templateType == 12 )
|
||||
@@ -171,6 +176,9 @@ const formData = ref({
|
||||
#end
|
||||
#end
|
||||
#end
|
||||
#if($isFileUpload && $isFileUpload == true)
|
||||
files: undefined
|
||||
#end
|
||||
})
|
||||
const formRules = reactive({
|
||||
#foreach ($column in $columns)
|
||||
@@ -281,6 +289,9 @@ const resetForm = () => {
|
||||
$column.javaField: undefined,
|
||||
#end
|
||||
#end
|
||||
#end
|
||||
#if($isFileUpload && $isFileUpload == true)
|
||||
files: undefined
|
||||
#end
|
||||
}
|
||||
formRef.value?.resetFields()
|
||||
|
||||
@@ -181,7 +181,7 @@
|
||||
#end
|
||||
#end
|
||||
#end
|
||||
<el-table-column label="操作" align="center" min-width="120px">
|
||||
<el-table-column label="操作" align="center" min-width="200px">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
link
|
||||
@@ -199,6 +199,9 @@
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
#if($isFileUpload && $isFileUpload == true)
|
||||
<el-button link @click="openBusinessFile(scope.row.id)">附件</el-button>
|
||||
#end
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -248,6 +251,16 @@ import ${simpleClassName}Form from './${simpleClassName}Form.vue'
|
||||
import ${subSimpleClassName}List from './components/${subSimpleClassName}List.vue'
|
||||
#end
|
||||
#end
|
||||
#if($isFileUpload && $isFileUpload == true)
|
||||
import {useDialogStore} from '@/store/modules/dialog'
|
||||
import {FileUploadInfoVO} from '@/api/infra/file'
|
||||
const dialogStore = useDialogStore()
|
||||
const openBusinessFile = async (id: string) => {
|
||||
let fileUploadInfoVO : FileUploadInfoVO = await ${simpleClassName}Api.getFileUploadInfo();
|
||||
fileUploadInfoVO.businessId = id
|
||||
dialogStore.openBusinessFileDialog(fileUploadInfoVO)
|
||||
}
|
||||
#end
|
||||
|
||||
/** ${table.classComment} 列表 */
|
||||
defineOptions({ name: '${table.className}' })
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
<?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="cn.iocoder.yudao.module.infra.dal.mysql.businessfile.BusinessFileMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,24 @@
|
||||
<?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="cn.iocoder.yudao.module.infra.dal.mysql.stdnms.StdNmsMapper">
|
||||
|
||||
<select id="selectPageCustom" resultType="cn.iocoder.yudao.module.infra.dal.dataobject.stdnms.stdnms.StdNmsDO">
|
||||
SELECT * FROM infra_std_nms
|
||||
<where>
|
||||
<if test="word != null and word != ''">
|
||||
AND LOWER(word) LIKE CONCAT('%', LOWER(#{word}), '%')
|
||||
</if>
|
||||
<if test="abbr != null and abbr != ''">
|
||||
AND abbr = #{abbr}
|
||||
</if>
|
||||
<if test="info != null and info != ''">
|
||||
AND info = #{info}
|
||||
</if>
|
||||
<if test="createTime != null and createTime[0] != null and createTime[1] != null">
|
||||
AND create_time BETWEEN #{createTime[0]} AND #{createTime[1]}
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY id DESC
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -460,7 +460,9 @@ public class CodegenServiceImplTest extends BaseDbUnitTest {
|
||||
assertEquals(column01, columns.get(0));
|
||||
assertEquals(column02, columns.get(1));
|
||||
return true;
|
||||
}), isNull(), isNull(), eq(false))).thenReturn(codes);
|
||||
}), isNull(), isNull(), argThat(extraParam -> {
|
||||
return extraParam != null && Boolean.FALSE.equals(extraParam.get("isBusiness"));
|
||||
}))).thenReturn(codes);
|
||||
// 准备参数
|
||||
Long tableId = table.getId();
|
||||
|
||||
@@ -509,7 +511,9 @@ public class CodegenServiceImplTest extends BaseDbUnitTest {
|
||||
assertEquals(1, columns.size());
|
||||
assertPojoEquals(subColumn01, columns.size());
|
||||
return true;
|
||||
}), eq(false))).thenReturn(codes);
|
||||
}), argThat(extraParam -> {
|
||||
return extraParam != null && Boolean.FALSE.equals(extraParam.get("isBusiness"));
|
||||
}))).thenReturn(codes);
|
||||
// 准备参数
|
||||
Long tableId = table.getId();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user