Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
潘荣晟
2025-10-30 09:20:26 +08:00
214 changed files with 9812 additions and 586 deletions

2
.gitignore vendored
View File

@@ -73,3 +73,5 @@ functions/mock
screenshot screenshot
.firebase .firebase
sessionStore sessionStore
/CLAUDE.md
/nul

View File

@@ -40,11 +40,6 @@
<artifactId>zt-module-erp-server</artifactId> <artifactId>zt-module-erp-server</artifactId>
<version>${revision}</version> <version>${revision}</version>
</dependency> </dependency>
<dependency>
<groupId>com.zt.plat</groupId>
<artifactId>zt-module-unit-management-server</artifactId>
<version>${revision}</version>
</dependency>
<!-- Web 相关 --> <!-- Web 相关 -->
<dependency> <dependency>
<groupId>com.zt.plat</groupId> <groupId>com.zt.plat</groupId>

View File

@@ -12,7 +12,6 @@
<module>zt-module-contract-order</module> <module>zt-module-contract-order</module>
<module>zt-module-erp</module> <module>zt-module-erp</module>
<module>base-server</module> <module>base-server</module>
<module>zt-module-unit-management</module>
</modules> </modules>
<name>${project.artifactId}</name> <name>${project.artifactId}</name>
@@ -148,8 +147,13 @@
<name>中铜 ZStack 私服</name> <name>中铜 ZStack 私服</name>
<url>http://172.16.46.63:30708/repository/test/</url> <url>http://172.16.46.63:30708/repository/test/</url>
<releases> <releases>
<enabled>true</enabled> <updatePolicy>always</updatePolicy>
<checksumPolicy>warn</checksumPolicy>
</releases> </releases>
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
</snapshots>
</repository> </repository>
</repositories> </repositories>

View File

@@ -29,4 +29,32 @@ public interface ErrorCodeConstants {
ErrorCode BUSINESS_DICTIONARY_TYPE_NOT_EXISTS = new ErrorCode(1_027_200_003, "业务字典类型不存在"); ErrorCode BUSINESS_DICTIONARY_TYPE_NOT_EXISTS = new ErrorCode(1_027_200_003, "业务字典类型不存在");
ErrorCode BUSINESS_DEPARTMENT_INDICATOR_NOT_EXISTS = new ErrorCode(1_027_200_004, "部门持有指标不存在"); ErrorCode BUSINESS_DEPARTMENT_INDICATOR_NOT_EXISTS = new ErrorCode(1_027_200_004, "部门持有指标不存在");
// ========== 模板文档管理系统 1-006-xxx-xxx ==========
// 模板分类 1-006-001-xxx
ErrorCode TEMPLATE_CATEGORY_NOT_EXISTS = new ErrorCode(1_006_001_001, "模板分类不存在");
// 标签库 1-006-002-xxx
ErrorCode TEMPLATE_TAG_NOT_EXISTS = new ErrorCode(1_006_002_001, "标签不存在");
ErrorCode TEMPLATE_TAG_CODE_DUPLICATE = new ErrorCode(1_006_002_002, "标签编码已存在");
// 模板 1-006-003-xxx
ErrorCode TEMPLATE_NOT_EXISTS = new ErrorCode(1_006_003_001, "模板不存在");
ErrorCode TEMPLATE_CODE_DUPLICATE = new ErrorCode(1_006_003_002, "模板编码已存在");
// 模板实例 1-006-004-xxx
ErrorCode TEMPLATE_INSTANCE_NOT_EXISTS = new ErrorCode(1_006_004_001, "模板实例不存在");
ErrorCode TEMPLATE_INSTANCE_CODE_DUPLICATE = new ErrorCode(1_006_004_002, "实例编码已存在");
// ========== 物料属性 ==========
ErrorCode MATERIAL_PROPERTIES_NOT_EXISTS = new ErrorCode(1_027_101_001, "物料属性不存在");
ErrorCode MATERIAL_HAS_PROPERTIES_NOT_EXISTS = new ErrorCode(1_027_101_002, "物料持有属性不存在");
ErrorCode MATERIAL_CLASSES_NOT_EXISTS = new ErrorCode(1_027_101_003, "物料分类不存在");
ErrorCode DEPARTMENT_MATERIAL_NOT_EXISTS = new ErrorCode(1_027_101_004, "组织物料不存在");
ErrorCode MATERIAL_HAS_CLASSES_NOT_EXISTS = new ErrorCode(1_027_101_004, "物料持有属性不存在");
// ========== 工艺信息属性 ==========
ErrorCode PROCESSING_INFOMATION_NOT_EXISTS = new ErrorCode(1_027_101_005, "工艺信息不存在");
ErrorCode PROCESSING_INFOMATION_OPERATION_NOT_EXISTS = new ErrorCode(1_027_101_006, "工艺工序不存在");
ErrorCode PROCESSING_OPERATION_NOT_EXISTS = new ErrorCode(1_027_101_007, "工序不存在");
ErrorCode PROCESSING_OPERATION_MATERIAL_NOT_EXISTS = new ErrorCode(1_027_101_008, "工艺工序物料不存在");
} }

View File

@@ -19,4 +19,13 @@ public interface UnitErrorCodeConstants {
ErrorCode UNT_INFO_NOT_EXISTS = ErrorCode UNT_INFO_NOT_EXISTS =
new ErrorCode(1_010_000_004, "单位信息记录不存在"); new ErrorCode(1_010_000_004, "单位信息记录不存在");
ErrorCode UNIT_NOT_FOUND =
new ErrorCode(1_010_000_005, "找不到单位: %s");
ErrorCode UNIT_CONVERSION_PATH_NOT_FOUND =
new ErrorCode(1_010_000_006, "无法找到从单位 [%s] 到单位 [%s] 的转换路径,请检查单位是否属于同一量纲或配置转换规则");
ErrorCode UNIT_DIFFERENT_QUANTITY =
new ErrorCode(1_010_000_007, "单位 [%s] 和单位 [%s] 不属于同一量纲,无法转换");
} }

View File

@@ -122,6 +122,13 @@
<artifactId>zt-spring-boot-starter-excel</artifactId> <artifactId>zt-spring-boot-starter-excel</artifactId>
</dependency> </dependency>
<!-- Velocity模板引擎 -->
<dependency>
<groupId>org.apache.velocity</groupId>
<artifactId>velocity-engine-core</artifactId>
<version>2.3</version>
</dependency>
<!-- 监控相关 --> <!-- 监控相关 -->
<dependency> <dependency>
<groupId>com.zt.plat</groupId> <groupId>com.zt.plat</groupId>

View File

@@ -28,6 +28,9 @@ public class ElementPageReqVO extends PageParam {
@Schema(description = "小数位数") @Schema(description = "小数位数")
private Long decimalValue; private Long decimalValue;
@Schema(description = "是否启用")
private String isEnable;
@Schema(description = "创建时间") @Schema(description = "创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime; private LocalDateTime[] createTime;

View File

@@ -36,6 +36,10 @@ public class ElementRespVO {
@ExcelProperty("品位单位") @ExcelProperty("品位单位")
private String gradeUnit; private String gradeUnit;
@Schema(description = "是否启用")
@ExcelProperty("是否启用")
private String isEnable;
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("创建时间") @ExcelProperty("创建时间")
private LocalDateTime createTime; private LocalDateTime createTime;

View File

@@ -1,7 +1,7 @@
package com.zt.plat.module.base.controller.admin.base.vo; package com.zt.plat.module.base.controller.admin.base.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotEmpty; import jakarta.validation.constraints.NotEmpty;
import lombok.Data; import lombok.Data;
@@ -21,13 +21,15 @@ public class ElementSaveReqVO {
private String name; private String name;
@Schema(description = "金属元素编码", requiredMode = Schema.RequiredMode.REQUIRED) @Schema(description = "金属元素编码", requiredMode = Schema.RequiredMode.REQUIRED)
// @NotEmpty(message = "金属元素编码不能为空")
private String coding; private String coding;
@Schema(description = "小数位数") @Schema(description = "小数位数")
@NotEmpty(message = "小数位数不能为空") @Min(value = 1, message = "数值必须大于0")
private Long decimalValue; private Long decimalValue;
@Schema(description = "是否启用")
private String isEnable;
@Schema(description = "品位单位", requiredMode = Schema.RequiredMode.REQUIRED) @Schema(description = "品位单位", requiredMode = Schema.RequiredMode.REQUIRED)
@NotEmpty(message = "品位单位不能为空") @NotEmpty(message = "品位单位不能为空")
private String gradeUnit; private String gradeUnit;

View File

@@ -19,6 +19,9 @@ public class MaterialInfomationPageReqVO extends PageParam {
@Schema(description = "物料名称", example = "张三") @Schema(description = "物料名称", example = "张三")
private String name; private String name;
@Schema(description = "分类ID", example = "1024")
private Long classesId;
@Schema(description = "备注") @Schema(description = "备注")
private String remark; private String remark;

View File

@@ -24,6 +24,10 @@ public class MaterialInfomationRespVO {
@ExcelProperty("物料名称") @ExcelProperty("物料名称")
private String name; private String name;
@Schema(description = "分类ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
@ExcelProperty("分类ID")
private Long classesId;
@Schema(description = "备注", requiredMode = Schema.RequiredMode.REQUIRED) @Schema(description = "备注", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("备注") @ExcelProperty("备注")
private String remark; private String remark;

View File

@@ -2,6 +2,7 @@ package com.zt.plat.module.base.controller.admin.base.vo;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotEmpty; import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import lombok.Data; import lombok.Data;
@Schema(description = "管理后台 - 物料信息新增/修改 Request VO") @Schema(description = "管理后台 - 物料信息新增/修改 Request VO")
@@ -19,6 +20,10 @@ public class MaterialInfomationSaveReqVO {
@NotEmpty(message = "物料名称不能为空") @NotEmpty(message = "物料名称不能为空")
private String name; private String name;
@Schema(description = "分类ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
@NotNull(message = "所属分类不能为空")
private Long classesId;
@Schema(description = "备注", requiredMode = Schema.RequiredMode.REQUIRED) @Schema(description = "备注", requiredMode = Schema.RequiredMode.REQUIRED)
@NotEmpty(message = "备注不能为空") @NotEmpty(message = "备注不能为空")
private String remark; private String remark;

View File

@@ -1,6 +1,7 @@
package com.zt.plat.module.base.controller.admin.base.vo; package com.zt.plat.module.base.controller.admin.base.vo;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.Min;
import lombok.Data; import lombok.Data;
@Schema(description = "管理后台 - 物料拓展数据新增/修改 Request VO") @Schema(description = "管理后台 - 物料拓展数据新增/修改 Request VO")
@@ -38,6 +39,7 @@ public class MaterialOtherSaveReqVO {
private String gradeUnit; private String gradeUnit;
@Schema(description = "小数位数") @Schema(description = "小数位数")
@Min(value = 1, message = "数值必须大于0")
private Long decimalValue; private Long decimalValue;
@Schema(description = "是否启用") @Schema(description = "是否启用")

View File

@@ -0,0 +1,107 @@
package com.zt.plat.module.base.controller.admin.departmentmaterial;
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 com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO;
import com.zt.plat.framework.common.pojo.PageParam;
import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.framework.common.pojo.CommonResult;
import com.zt.plat.framework.common.util.object.BeanUtils;
import static com.zt.plat.framework.common.pojo.CommonResult.success;
import com.zt.plat.framework.excel.core.util.ExcelUtils;
import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog;
import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*;
import com.zt.plat.module.base.controller.admin.departmentmaterial.vo.*;
import com.zt.plat.module.base.dal.dataobject.departmentmaterial.DepartmentMaterialDO;
import com.zt.plat.module.base.service.departmentmaterial.DepartmentMaterialService;
@Tag(name = "管理后台 - 组织架构物料")
@RestController
@RequestMapping("/base/department-material")
@Validated
public class DepartmentMaterialController {
@Resource
private DepartmentMaterialService departmentMaterialService;
@PostMapping("/create")
@Operation(summary = "创建组织架构物料")
@PreAuthorize("@ss.hasPermission('base:department-material:create')")
public CommonResult<DepartmentMaterialRespVO> createDepartmentMaterial(@Valid @RequestBody DepartmentMaterialSaveReqVO createReqVO) {
return success(departmentMaterialService.createDepartmentMaterial(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新组织架构物料")
@PreAuthorize("@ss.hasPermission('base:department-material:update')")
public CommonResult<Boolean> updateDepartmentMaterial(@Valid @RequestBody DepartmentMaterialSaveReqVO updateReqVO) {
departmentMaterialService.updateDepartmentMaterial(updateReqVO);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除组织架构物料")
@Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('base:department-material:delete')")
public CommonResult<Boolean> deleteDepartmentMaterial(@RequestParam("id") Long id) {
departmentMaterialService.deleteDepartmentMaterial(id);
return success(true);
}
@DeleteMapping("/delete-list")
@Parameter(name = "ids", description = "编号", required = true)
@Operation(summary = "批量删除组织架构物料")
@PreAuthorize("@ss.hasPermission('base:department-material:delete')")
public CommonResult<Boolean> deleteDepartmentMaterialList(@RequestBody BatchDeleteReqVO req) {
departmentMaterialService.deleteDepartmentMaterialListByIds(req.getIds());
return success(true);
}
@GetMapping("/get")
@Operation(summary = "获得组织架构物料")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('base:department-material:query')")
public CommonResult<DepartmentMaterialRespVO> getDepartmentMaterial(@RequestParam("id") Long id) {
DepartmentMaterialDO departmentMaterial = departmentMaterialService.getDepartmentMaterial(id);
return success(BeanUtils.toBean(departmentMaterial, DepartmentMaterialRespVO.class));
}
@GetMapping("/page")
@Operation(summary = "获得组织架构物料分页")
@PreAuthorize("@ss.hasPermission('base:department-material:query')")
public CommonResult<PageResult<DepartmentMaterialRespVO>> getDepartmentMaterialPage(@Valid DepartmentMaterialPageReqVO pageReqVO) {
PageResult<DepartmentMaterialRespVO> pageResult = departmentMaterialService.getDepartmentMaterialPage(pageReqVO);
return success(pageResult);
}
@GetMapping("/export-excel")
@Operation(summary = "导出组织架构物料 Excel")
@PreAuthorize("@ss.hasPermission('base:department-material:export')")
@ApiAccessLog(operateType = EXPORT)
public void exportDepartmentMaterialExcel(@Valid DepartmentMaterialPageReqVO pageReqVO,
HttpServletResponse response) throws IOException {
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
List<DepartmentMaterialRespVO> list = departmentMaterialService.getDepartmentMaterialPage(pageReqVO).getList();
// 导出 Excel
ExcelUtils.write(response, "组织架构物料.xls", "数据", DepartmentMaterialRespVO.class,
list);
}
}

View File

@@ -0,0 +1,47 @@
package com.zt.plat.module.base.controller.admin.departmentmaterial.vo;
import lombok.*;
import java.util.*;
import io.swagger.v3.oas.annotations.media.Schema;
import com.zt.plat.framework.common.pojo.PageParam;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@Schema(description = "管理后台 - 组织架构物料分页 Request VO")
@Data
public class DepartmentMaterialPageReqVO extends PageParam {
@Schema(description = "物料信息ID", example = "3923")
private Long infomationId;
@Schema(description = "物料信息ID集合(内部使用)")
private List<Long> infomationIds;
@Schema(description = "物料分类ID", example = "30114")
private Long classesId;
@Schema(description = "部门ID", example = "1001")
private Long deptId;
@Schema(description = "字典数据值-物料类型")
private String dictionaryDataValue;
@Schema(description = "状态编码", example = "1")
private String isEnable;
@Schema(description = "物料编码")
private String materialNumber;
@Schema(description = "物料名称")
private String materialName;
@Schema(description = "备注")
private String remark;
@Schema(description = "创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime;
}

View File

@@ -0,0 +1,83 @@
package com.zt.plat.module.base.controller.admin.departmentmaterial.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 DepartmentMaterialRespVO {
@Schema(description = "主键ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "5674")
@ExcelProperty("主键ID")
private Long id;
@Schema(description = "物料信息ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "3923")
@ExcelProperty("物料信息ID")
private Long infomationId;
@Schema(description = "物料分类ID", example = "30114")
@ExcelProperty("物料分类ID")
private Long classesId;
@Schema(description = "字典数据值-物料类型", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("字典数据值-物料类型")
private String dictionaryDataValue;
@Schema(description = "备注", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("备注")
private String remark;
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("创建时间")
private LocalDateTime createTime;
@Schema(description = "部门ID")
@ExcelIgnore
private Long deptId;
@Schema(description = "部门名称")
@ExcelProperty("部门名称")
private String deptName;
@Schema(description = "物料编码")
@ExcelProperty("物料编码")
private String materialNumber;
@Schema(description = "物料名称")
@ExcelProperty("物料名称")
private String materialName;
@Schema(description = "物料大类名称")
@ExcelProperty("物料大类")
private String categoryLargeName;
@Schema(description = "物料中类名称")
@ExcelProperty("物料中类")
private String categoryMediumName;
@Schema(description = "物料小类名称")
@ExcelProperty("物料小类")
private String categorySmallName;
@Schema(description = "物料分类路径")
@ExcelProperty("物料分类路径")
private String categoryPath;
@Schema(description = "组织物料类型名称")
@ExcelProperty("组织物料类型")
private String dictionaryDataLabel;
@Schema(description = "状态编码")
@ExcelProperty("状态编码")
private String isEnable;
@Schema(description = "状态名称")
@ExcelProperty("状态")
private String statusLabel;
}

View File

@@ -0,0 +1,30 @@
package com.zt.plat.module.base.controller.admin.departmentmaterial.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import jakarta.validation.constraints.*;
@Schema(description = "管理后台 - 组织架构物料新增/修改 Request VO")
@Data
public class DepartmentMaterialSaveReqVO {
@Schema(description = "主键ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "5674")
private Long id;
@Schema(description = "物料信息ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "3923")
@NotNull(message = "物料信息ID不能为空")
private Long infomationId;
@Schema(description = "物料分类ID", example = "30114")
private Long classesId;
@Schema(description = "字典数据值-物料类型", requiredMode = Schema.RequiredMode.REQUIRED)
@NotEmpty(message = "字典数据值-物料类型不能为空")
private String dictionaryDataValue;
@Schema(description = "备注", requiredMode = Schema.RequiredMode.REQUIRED)
@NotEmpty(message = "备注不能为空")
private String remark;
}

View File

@@ -0,0 +1,89 @@
package com.zt.plat.module.base.controller.admin.doctemplate;
import com.zt.plat.framework.common.pojo.CommonResult;
import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.module.base.controller.admin.doctemplate.vo.DocTemplateCategoryPageReqVO;
import com.zt.plat.module.base.controller.admin.doctemplate.vo.DocTemplateCategoryRespVO;
import com.zt.plat.module.base.controller.admin.doctemplate.vo.DocTemplateCategorySaveReqVO;
import com.zt.plat.module.base.service.doctemplate.DocTemplateCategoryService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import jakarta.annotation.Resource;
import jakarta.validation.Valid;
import java.util.List;
import static com.zt.plat.framework.common.pojo.CommonResult.success;
/**
* 模板分类 Controller
*
* @author 系统生成
*/
@Tag(name = "管理后台 - 模板分类")
@RestController
@RequestMapping("/base/doc-template-category")
@Validated
public class DocTemplateCategoryController {
@Resource
private DocTemplateCategoryService templateCategoryService;
@PostMapping("/create")
@Operation(summary = "创建模板分类")
@PreAuthorize("@ss.hasPermission('base:template-category:create')")
public CommonResult<Long> createTemplateCategory(@Valid @RequestBody DocTemplateCategorySaveReqVO createReqVO) {
return success(templateCategoryService.createTemplateCategory(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新模板分类")
@PreAuthorize("@ss.hasPermission('base:template-category:update')")
public CommonResult<Boolean> updateTemplateCategory(@Valid @RequestBody DocTemplateCategorySaveReqVO updateReqVO) {
templateCategoryService.updateTemplateCategory(updateReqVO);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除模板分类")
@Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('base:template-category:delete')")
public CommonResult<Boolean> deleteTemplateCategory(@RequestParam("id") Long id) {
templateCategoryService.deleteTemplateCategory(id);
return success(true);
}
@GetMapping("/get")
@Operation(summary = "获得模板分类")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('base:template-category:query')")
public CommonResult<DocTemplateCategoryRespVO> getTemplateCategory(@RequestParam("id") Long id) {
return success(templateCategoryService.getTemplateCategory(id));
}
@GetMapping("/page")
@Operation(summary = "获得模板分类分页")
@PreAuthorize("@ss.hasPermission('base:template-category:query')")
public CommonResult<PageResult<DocTemplateCategoryRespVO>> getTemplateCategoryPage(@Valid DocTemplateCategoryPageReqVO pageReqVO) {
return success(templateCategoryService.getTemplateCategoryPage(pageReqVO));
}
@GetMapping("/list")
@Operation(summary = "获得模板分类列表")
@PreAuthorize("@ss.hasPermission('base:template-category:query')")
public CommonResult<List<DocTemplateCategoryRespVO>> getTemplateCategoryList() {
return success(templateCategoryService.getTemplateCategoryList());
}
@GetMapping("/tree")
@Operation(summary = "获得模板分类树形结构")
@PreAuthorize("@ss.hasPermission('base:template-category:query')")
public CommonResult<List<DocTemplateCategoryRespVO>> getTemplateCategoryTree() {
return success(templateCategoryService.buildTree());
}
}

View File

@@ -0,0 +1,82 @@
package com.zt.plat.module.base.controller.admin.doctemplate;
import com.zt.plat.framework.common.pojo.CommonResult;
import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.module.base.controller.admin.doctemplate.vo.DocTemplatePageReqVO;
import com.zt.plat.module.base.controller.admin.doctemplate.vo.DocTemplateRespVO;
import com.zt.plat.module.base.controller.admin.doctemplate.vo.DocTemplateSaveReqVO;
import com.zt.plat.module.base.service.doctemplate.DocTemplateService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import jakarta.annotation.Resource;
import jakarta.validation.Valid;
import java.util.List;
import static com.zt.plat.framework.common.pojo.CommonResult.success;
/**
* 模板 Controller
*
* @author 系统生成
*/
@Tag(name = "管理后台 - 模板")
@RestController
@RequestMapping("/base/doc-template")
@Validated
public class DocTemplateController {
@Resource
private DocTemplateService templateService;
@PostMapping("/create")
@Operation(summary = "创建模板")
@PreAuthorize("@ss.hasPermission('base:template:create')")
public CommonResult<Long> createTemplate(@Valid @RequestBody DocTemplateSaveReqVO createReqVO) {
return success(templateService.createTemplate(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新模板")
@PreAuthorize("@ss.hasPermission('base:template:update')")
public CommonResult<Boolean> updateTemplate(@Valid @RequestBody DocTemplateSaveReqVO updateReqVO) {
templateService.updateTemplate(updateReqVO);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除模板")
@Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('base:template:delete')")
public CommonResult<Boolean> deleteTemplate(@RequestParam("id") Long id) {
templateService.deleteTemplate(id);
return success(true);
}
@GetMapping("/get")
@Operation(summary = "获得模板")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('base:template:query')")
public CommonResult<DocTemplateRespVO> getTemplate(@RequestParam("id") Long id) {
return success(templateService.getTemplate(id));
}
@GetMapping("/page")
@Operation(summary = "获得模板分页")
@PreAuthorize("@ss.hasPermission('base:template:query')")
public CommonResult<PageResult<DocTemplateRespVO>> getTemplatePage(@Valid DocTemplatePageReqVO pageReqVO) {
return success(templateService.getTemplatePage(pageReqVO));
}
@GetMapping("/list")
@Operation(summary = "获得模板列表")
@PreAuthorize("@ss.hasPermission('base:template:query')")
public CommonResult<List<DocTemplateRespVO>> getTemplateList() {
return success(templateService.getTemplateList());
}
}

View File

@@ -0,0 +1,107 @@
package com.zt.plat.module.base.controller.admin.doctemplate;
import com.zt.plat.framework.common.pojo.CommonResult;
import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.module.base.controller.admin.doctemplate.vo.DocTemplateInstancePageReqVO;
import com.zt.plat.module.base.controller.admin.doctemplate.vo.DocTemplateInstanceRespVO;
import com.zt.plat.module.base.controller.admin.doctemplate.vo.DocTemplateInstanceSaveReqVO;
import com.zt.plat.module.base.service.doctemplate.DocTemplateInstanceService;
import com.zt.plat.module.base.service.doctemplate.DocTemplateRenderService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import jakarta.annotation.Resource;
import jakarta.validation.Valid;
import java.util.List;
import java.util.Map;
import static com.zt.plat.framework.common.pojo.CommonResult.success;
/**
* 模板实例 Controller
*
* @author 系统生成
*/
@Tag(name = "管理后台 - 模板实例")
@RestController
@RequestMapping("/base/doc-template-instance")
@Validated
public class DocTemplateInstanceController {
@Resource
private DocTemplateInstanceService templateInstanceService;
@Resource
private DocTemplateRenderService renderService;
@PostMapping("/create")
@Operation(summary = "创建模板实例")
@PreAuthorize("@ss.hasPermission('base:template-instance:create')")
public CommonResult<Long> createTemplateInstance(@Valid @RequestBody DocTemplateInstanceSaveReqVO createReqVO) {
return success(templateInstanceService.createTemplateInstance(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新模板实例")
@PreAuthorize("@ss.hasPermission('base:template-instance:update')")
public CommonResult<Boolean> updateTemplateInstance(@Valid @RequestBody DocTemplateInstanceSaveReqVO updateReqVO) {
templateInstanceService.updateTemplateInstance(updateReqVO);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除模板实例")
@Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('base:template-instance:delete')")
public CommonResult<Boolean> deleteTemplateInstance(@RequestParam("id") Long id) {
templateInstanceService.deleteTemplateInstance(id);
return success(true);
}
@GetMapping("/get")
@Operation(summary = "获得模板实例")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('base:template-instance:query')")
public CommonResult<DocTemplateInstanceRespVO> getTemplateInstance(@RequestParam("id") Long id) {
return success(templateInstanceService.getTemplateInstance(id));
}
@GetMapping("/page")
@Operation(summary = "获得模板实例分页")
@PreAuthorize("@ss.hasPermission('base:template-instance:query')")
public CommonResult<PageResult<DocTemplateInstanceRespVO>> getTemplateInstancePage(@Valid DocTemplateInstancePageReqVO pageReqVO) {
return success(templateInstanceService.getTemplateInstancePage(pageReqVO));
}
@GetMapping("/list")
@Operation(summary = "获得模板实例列表")
@PreAuthorize("@ss.hasPermission('base:template-instance:query')")
public CommonResult<List<DocTemplateInstanceRespVO>> getTemplateInstanceList() {
return success(templateInstanceService.getTemplateInstanceList());
}
@PostMapping("/render")
@Operation(summary = "渲染模板实例")
@PreAuthorize("@ss.hasPermission('base:template-instance:query')")
public CommonResult<String> renderTemplateInstance(
@Parameter(name = "instanceId", description = "实例ID", required = true) @RequestParam("instanceId") Long instanceId,
@Parameter(name = "dataMap", description = "数据Map") @RequestBody(required = false) Map<String, Object> dataMap) {
String renderedContent = renderService.render(null, instanceId, null, dataMap);
return success(renderedContent);
}
@PostMapping("/render-and-save")
@Operation(summary = "渲染并保存模板实例")
@PreAuthorize("@ss.hasPermission('base:template-instance:update')")
public CommonResult<Boolean> renderAndSaveTemplateInstance(
@Parameter(name = "instanceId", description = "实例ID", required = true) @RequestParam("instanceId") Long instanceId,
@Parameter(name = "dataMap", description = "数据Map", required = true) @RequestBody Map<String, Object> dataMap) {
renderService.renderAndSave(instanceId, dataMap);
return success(true);
}
}

View File

@@ -0,0 +1,82 @@
package com.zt.plat.module.base.controller.admin.doctemplate;
import com.zt.plat.framework.common.pojo.CommonResult;
import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.module.base.controller.admin.doctemplate.vo.DocTemplateTagPageReqVO;
import com.zt.plat.module.base.controller.admin.doctemplate.vo.DocTemplateTagRespVO;
import com.zt.plat.module.base.controller.admin.doctemplate.vo.DocTemplateTagSaveReqVO;
import com.zt.plat.module.base.service.doctemplate.DocTemplateTagService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import jakarta.annotation.Resource;
import jakarta.validation.Valid;
import java.util.List;
import static com.zt.plat.framework.common.pojo.CommonResult.success;
/**
* 标签库 Controller
*
* @author 系统生成
*/
@Tag(name = "管理后台 - 标签库")
@RestController
@RequestMapping("/base/doc-template-tag")
@Validated
public class DocTemplateTagController {
@Resource
private DocTemplateTagService templateTagService;
@PostMapping("/create")
@Operation(summary = "创建标签")
@PreAuthorize("@ss.hasPermission('base:template-tag:create')")
public CommonResult<Long> createTemplateTag(@Valid @RequestBody DocTemplateTagSaveReqVO createReqVO) {
return success(templateTagService.createTemplateTag(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新标签")
@PreAuthorize("@ss.hasPermission('base:template-tag:update')")
public CommonResult<Boolean> updateTemplateTag(@Valid @RequestBody DocTemplateTagSaveReqVO updateReqVO) {
templateTagService.updateTemplateTag(updateReqVO);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除标签")
@Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('base:template-tag:delete')")
public CommonResult<Boolean> deleteTemplateTag(@RequestParam("id") Long id) {
templateTagService.deleteTemplateTag(id);
return success(true);
}
@GetMapping("/get")
@Operation(summary = "获得标签")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('base:template-tag:query')")
public CommonResult<DocTemplateTagRespVO> getTemplateTag(@RequestParam("id") Long id) {
return success(templateTagService.getTemplateTag(id));
}
@GetMapping("/page")
@Operation(summary = "获得标签分页")
@PreAuthorize("@ss.hasPermission('base:template-tag:query')")
public CommonResult<PageResult<DocTemplateTagRespVO>> getTemplateTagPage(@Valid DocTemplateTagPageReqVO pageReqVO) {
return success(templateTagService.getTemplateTagPage(pageReqVO));
}
@GetMapping("/list")
@Operation(summary = "获得标签列表")
@PreAuthorize("@ss.hasPermission('base:template-tag:query')")
public CommonResult<List<DocTemplateTagRespVO>> getTemplateTagList() {
return success(templateTagService.getTemplateTagList());
}
}

View File

@@ -0,0 +1,27 @@
package com.zt.plat.module.base.controller.admin.doctemplate.vo;
import com.zt.plat.framework.common.pojo.PageParam;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
@Schema(description = "管理后台 - 模板分类分页 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class DocTemplateCategoryPageReqVO extends PageParam {
@Schema(description = "分类名称", example = "采购类")
private String categoryName;
@Schema(description = "分类编码", example = "PURCHASE")
private String categoryCode;
@Schema(description = "父分类ID", example = "1")
private Long parentId;
@Schema(description = "层级1=大类2=小类)", example = "1")
private Integer level;
}

View File

@@ -0,0 +1,43 @@
package com.zt.plat.module.base.controller.admin.doctemplate.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.time.LocalDateTime;
import java.util.List;
@Schema(description = "管理后台 - 模板分类 Response VO")
@Data
public class DocTemplateCategoryRespVO {
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
private Long id;
@Schema(description = "分类名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "采购类")
private String categoryName;
@Schema(description = "分类编码", requiredMode = Schema.RequiredMode.REQUIRED, example = "PURCHASE")
private String categoryCode;
@Schema(description = "父分类ID", example = "1")
private Long parentId;
@Schema(description = "层级1=大类2=小类)", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
private Integer level;
@Schema(description = "排序号", example = "1")
private Integer sort;
@Schema(description = "备注", example = "采购业务相关文档分类")
private String remark;
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
private LocalDateTime createTime;
@Schema(description = "创建人", example = "admin")
private String creator;
@Schema(description = "子分类列表")
private List<DocTemplateCategoryRespVO> children;
}

View File

@@ -0,0 +1,37 @@
package com.zt.plat.module.base.controller.admin.doctemplate.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
@Schema(description = "管理后台 - 模板分类新增/修改 Request VO")
@Data
public class DocTemplateCategorySaveReqVO {
@Schema(description = "主键", example = "1024")
private Long id;
@Schema(description = "分类名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "采购类")
@NotBlank(message = "分类名称不能为空")
private String categoryName;
@Schema(description = "分类编码", requiredMode = Schema.RequiredMode.REQUIRED, example = "PURCHASE")
@NotBlank(message = "分类编码不能为空")
private String categoryCode;
@Schema(description = "父分类ID", example = "1")
private Long parentId;
@Schema(description = "层级1=大类2=小类)", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@NotNull(message = "层级不能为空")
private Integer level;
@Schema(description = "排序号", example = "1")
private Integer sort;
@Schema(description = "备注", example = "采购业务相关文档分类")
private String remark;
}

View File

@@ -0,0 +1,36 @@
package com.zt.plat.module.base.controller.admin.doctemplate.vo;
import com.zt.plat.framework.common.pojo.PageParam;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@Schema(description = "管理后台 - 模板实例分页 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class DocTemplateInstancePageReqVO extends PageParam {
@Schema(description = "实例名称", example = "采购合同")
private String instanceName;
@Schema(description = "模板ID", example = "1")
private Long templateId;
@Schema(description = "业务关联类型", example = "contract")
private String businessType;
@Schema(description = "状态", example = "draft")
private String status;
@Schema(description = "创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime;
}

View File

@@ -0,0 +1,51 @@
package com.zt.plat.module.base.controller.admin.doctemplate.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.time.LocalDateTime;
@Schema(description = "管理后台 - 模板实例 Response VO")
@Data
public class DocTemplateInstanceRespVO {
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
private Long id;
@Schema(description = "实例名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "2025年上海XX供应商采购合同")
private String instanceName;
@Schema(description = "实例编码", example = "DOC-20250127-001")
private String instanceCode;
@Schema(description = "引用的模板ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
private Long templateId;
@Schema(description = "业务关联类型", example = "contract")
private String businessType;
@Schema(description = "业务关联ID", example = "100")
private Long businessId;
@Schema(description = "业务关联标签", example = "PC-2025-001")
private String businessLabel;
@Schema(description = "用户编辑后的内容")
private String editedContent;
@Schema(description = "渲染后的最终内容")
private String renderedContent;
@Schema(description = "备注", example = "采购合同文档")
private String remark;
@Schema(description = "状态", example = "draft")
private String status;
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
private LocalDateTime createTime;
@Schema(description = "创建人", example = "admin")
private String creator;
}

View File

@@ -0,0 +1,49 @@
package com.zt.plat.module.base.controller.admin.doctemplate.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
@Schema(description = "管理后台 - 模板实例新增/修改 Request VO")
@Data
public class DocTemplateInstanceSaveReqVO {
@Schema(description = "主键", example = "1024")
private Long id;
@Schema(description = "实例名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "2025年上海XX供应商采购合同")
@NotBlank(message = "实例名称不能为空")
private String instanceName;
@Schema(description = "实例编码", example = "DOC-20250127-001")
private String instanceCode;
@Schema(description = "引用的模板ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@NotNull(message = "模板ID不能为空")
private Long templateId;
@Schema(description = "业务关联类型", example = "contract")
private String businessType;
@Schema(description = "业务关联ID", example = "100")
private Long businessId;
@Schema(description = "业务关联标签", example = "PC-2025-001")
private String businessLabel;
@Schema(description = "用户编辑后的内容", requiredMode = Schema.RequiredMode.REQUIRED)
@NotBlank(message = "内容不能为空")
private String editedContent;
@Schema(description = "渲染后的最终内容")
private String renderedContent;
@Schema(description = "备注", example = "采购合同文档")
private String remark;
@Schema(description = "状态", example = "draft")
private String status;
}

View File

@@ -0,0 +1,39 @@
package com.zt.plat.module.base.controller.admin.doctemplate.vo;
import com.zt.plat.framework.common.pojo.PageParam;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@Schema(description = "管理后台 - 模板分页 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class DocTemplatePageReqVO extends PageParam {
@Schema(description = "模板名称", example = "采购合同模板")
private String tmplName;
@Schema(description = "模板编码", example = "PO_CONTRACT_001")
private String tmplCode;
@Schema(description = "所属大类", example = "1")
private Long bigCategoryId;
@Schema(description = "所属小类", example = "11")
private Long smallCategoryId;
@Schema(description = "状态1=启用0=停用2=草稿)", example = "1")
private String enabled;
@Schema(description = "创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime;
}

View File

@@ -0,0 +1,57 @@
package com.zt.plat.module.base.controller.admin.doctemplate.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.time.LocalDateTime;
@Schema(description = "管理后台 - 模板 Response VO")
@Data
public class DocTemplateRespVO {
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
private Long id;
@Schema(description = "模板名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "采购合同模板")
private String tmplName;
@Schema(description = "模板编码(唯一)", requiredMode = Schema.RequiredMode.REQUIRED, example = "PO_CONTRACT_001")
private String tmplCode;
@Schema(description = "模板图标", example = "📄")
private String icon;
@Schema(description = "所属大类", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
private Long bigCategoryId;
@Schema(description = "所属小类", example = "11")
private Long smallCategoryId;
@Schema(description = "版本号", example = "v1.2")
private String version;
@Schema(description = "模板描述", example = "标准采购合同范本")
private String description;
@Schema(description = "模板内容HTML含占位符", requiredMode = Schema.RequiredMode.REQUIRED)
private String content;
@Schema(description = "SQL配置JSON格式可选")
private String sqlConfig;
@Schema(description = "数据源标识", example = "default")
private String dataSource;
@Schema(description = "使用次数", example = "10")
private Integer useCount;
@Schema(description = "状态1=启用0=停用2=草稿)", example = "1")
private String enabled;
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
private LocalDateTime createTime;
@Schema(description = "创建人", example = "admin")
private String creator;
}

View File

@@ -0,0 +1,53 @@
package com.zt.plat.module.base.controller.admin.doctemplate.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
@Schema(description = "管理后台 - 模板新增/修改 Request VO")
@Data
public class DocTemplateSaveReqVO {
@Schema(description = "主键", example = "1024")
private Long id;
@Schema(description = "模板名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "采购合同模板")
@NotBlank(message = "模板名称不能为空")
private String tmplName;
@Schema(description = "模板编码(唯一)", requiredMode = Schema.RequiredMode.REQUIRED, example = "PO_CONTRACT_001")
@NotBlank(message = "模板编码不能为空")
private String tmplCode;
@Schema(description = "模板图标", example = "📄")
private String icon;
@Schema(description = "所属大类", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@NotNull(message = "所属大类不能为空")
private Long bigCategoryId;
@Schema(description = "所属小类", example = "11")
private Long smallCategoryId;
@Schema(description = "版本号", example = "v1.2")
private String version;
@Schema(description = "模板描述", example = "标准采购合同范本")
private String description;
@Schema(description = "模板内容HTML含占位符", requiredMode = Schema.RequiredMode.REQUIRED)
@NotBlank(message = "模板内容不能为空")
private String content;
@Schema(description = "SQL配置JSON格式可选")
private String sqlConfig;
@Schema(description = "数据源标识", example = "default")
private String dataSource;
@Schema(description = "状态1=启用0=停用2=草稿)", example = "2")
private String enabled;
}

View File

@@ -0,0 +1,27 @@
package com.zt.plat.module.base.controller.admin.doctemplate.vo;
import com.zt.plat.framework.common.pojo.PageParam;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
@Schema(description = "管理后台 - 标签库分页 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class DocTemplateTagPageReqVO extends PageParam {
@Schema(description = "标签名称", example = "合同编号")
private String tagName;
@Schema(description = "标签编码", example = "contractNo")
private String tagCode;
@Schema(description = "所属分类ID", example = "1")
private Long categoryId;
@Schema(description = "是否启用1=启用0=停用)", example = "1")
private String enabled;
}

View File

@@ -0,0 +1,63 @@
package com.zt.plat.module.base.controller.admin.doctemplate.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.time.LocalDateTime;
@Schema(description = "管理后台 - 标签库 Response VO")
@Data
public class DocTemplateTagRespVO {
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
private Long id;
@Schema(description = "标签名称(中文)", requiredMode = Schema.RequiredMode.REQUIRED, example = "合同编号")
private String tagName;
@Schema(description = "标签编码Velocity变量名", requiredMode = Schema.RequiredMode.REQUIRED, example = "contractNo")
private String tagCode;
@Schema(description = "所属分类ID", example = "1")
private Long categoryId;
@Schema(description = "所属分类名称", example = "合同管理")
private String categoryName;
@Schema(description = "数据类型", example = "String")
private String dataType;
@Schema(description = "默认值", example = "")
private String defaultValue;
@Schema(description = "SQL脚本可选仅保存参考", example = "SELECT contract_no FROM contract_main WHERE id = #{businessId}")
private String sqlScript;
@Schema(description = "描述", example = "合同主表的合同编号字段")
private String description;
@Schema(description = "排序号", example = "1")
private Integer sort;
@Schema(description = "是否启用1=启用0=停用)", example = "1")
private String enabled;
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
private LocalDateTime createTime;
@Schema(description = "创建人ID", example = "1")
private String creator;
@Schema(description = "创建人名称", example = "管理员")
private String creatorName;
@Schema(description = "更新时间")
private LocalDateTime updateTime;
@Schema(description = "更新人ID", example = "1")
private String updater;
@Schema(description = "更新人名称", example = "管理员")
private String updaterName;
}

View File

@@ -0,0 +1,44 @@
package com.zt.plat.module.base.controller.admin.doctemplate.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import jakarta.validation.constraints.NotBlank;
@Schema(description = "管理后台 - 标签库新增/修改 Request VO")
@Data
public class DocTemplateTagSaveReqVO {
@Schema(description = "主键", example = "1024")
private Long id;
@Schema(description = "标签名称(中文)", requiredMode = Schema.RequiredMode.REQUIRED, example = "合同编号")
@NotBlank(message = "标签名称不能为空")
private String tagName;
@Schema(description = "标签编码Velocity变量名", requiredMode = Schema.RequiredMode.REQUIRED, example = "contractNo")
@NotBlank(message = "标签编码不能为空")
private String tagCode;
@Schema(description = "所属分类ID", example = "1")
private Long categoryId;
@Schema(description = "数据类型", example = "String")
private String dataType;
@Schema(description = "默认值", example = "")
private String defaultValue;
@Schema(description = "SQL脚本可选仅保存参考", example = "SELECT contract_no FROM contract_main WHERE id = #{businessId}")
private String sqlScript;
@Schema(description = "描述", example = "合同主表的合同编号字段")
private String description;
@Schema(description = "排序号", example = "1")
private Integer sort;
@Schema(description = "是否启用1=启用0=停用)", example = "1")
private String enabled;
}

View File

@@ -0,0 +1,138 @@
package com.zt.plat.module.base.controller.admin.materialclasses;
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 com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO;
import com.zt.plat.framework.common.pojo.PageParam;
import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.framework.common.pojo.CommonResult;
import com.zt.plat.framework.common.util.object.BeanUtils;
import static com.zt.plat.framework.common.pojo.CommonResult.success;
import com.zt.plat.framework.excel.core.util.ExcelUtils;
import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog;
import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*;
import com.zt.plat.module.base.controller.admin.materialclasses.vo.*;
import com.zt.plat.module.base.dal.dataobject.materialclasses.MaterialClassesDO;
import com.zt.plat.module.base.service.materialclasses.MaterialClassesService;
@Tag(name = "管理后台 - 物料分类")
@RestController
@RequestMapping("/base/material-classes")
@Validated
public class MaterialClassesController {
@Resource
private MaterialClassesService materialClassesService;
@PostMapping("/create")
@Operation(summary = "创建物料分类")
@PreAuthorize("@ss.hasPermission('base:material-classes:create')")
public CommonResult<MaterialClassesRespVO> createMaterialClasses(@Valid @RequestBody MaterialClassesSaveReqVO createReqVO) {
return success(materialClassesService.createMaterialClasses(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新物料分类")
@PreAuthorize("@ss.hasPermission('base:material-classes:update')")
public CommonResult<Boolean> updateMaterialClasses(@Valid @RequestBody MaterialClassesSaveReqVO updateReqVO) {
materialClassesService.updateMaterialClasses(updateReqVO);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除物料分类")
@Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('base:material-classes:delete')")
public CommonResult<Boolean> deleteMaterialClasses(@RequestParam("id") Long id) {
materialClassesService.deleteMaterialClasses(id);
return success(true);
}
@DeleteMapping("/delete-list")
@Parameter(name = "ids", description = "编号", required = true)
@Operation(summary = "批量删除物料分类")
@PreAuthorize("@ss.hasPermission('base:material-classes:delete')")
public CommonResult<Boolean> deleteMaterialClassesList(@RequestBody BatchDeleteReqVO req) {
materialClassesService.deleteMaterialClassesListByIds(req.getIds());
return success(true);
}
@GetMapping("/get")
@Operation(summary = "获得物料分类")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('base:material-classes:query')")
public CommonResult<MaterialClassesRespVO> getMaterialClasses(@RequestParam("id") Long id) {
MaterialClassesDO materialClasses = materialClassesService.getMaterialClasses(id);
return success(BeanUtils.toBean(materialClasses, MaterialClassesRespVO.class));
}
@GetMapping("/page")
@Operation(summary = "获得物料分类分页")
@PreAuthorize("@ss.hasPermission('base:material-classes:query')")
public CommonResult<PageResult<MaterialClassesRespVO>> getMaterialClassesPage(@Valid MaterialClassesPageReqVO pageReqVO) {
PageResult<MaterialClassesDO> pageResult = materialClassesService.getMaterialClassesPage(pageReqVO);
return success(BeanUtils.toBean(pageResult, MaterialClassesRespVO.class));
}
@GetMapping("/export-excel")
@Operation(summary = "导出物料分类 Excel")
@PreAuthorize("@ss.hasPermission('base:material-classes:export')")
@ApiAccessLog(operateType = EXPORT)
public void exportMaterialClassesExcel(@Valid MaterialClassesPageReqVO pageReqVO,
HttpServletResponse response) throws IOException {
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
List<MaterialClassesDO> list = materialClassesService.getMaterialClassesPage(pageReqVO).getList();
// 导出 Excel
ExcelUtils.write(response, "物料分类.xls", "数据", MaterialClassesRespVO.class,
BeanUtils.toBean(list, MaterialClassesRespVO.class));
}
@GetMapping("/tree")
@Operation(summary = "获得物料分类树")
@PreAuthorize("@ss.hasPermission('base:material-classes:query')")
public CommonResult<List<MaterialClassesTreeRespVO>> getMaterialClassesTree() {
List<MaterialClassesDO> list = materialClassesService.getMaterialClassesList();
return success(buildTree(list));
}
private List<MaterialClassesTreeRespVO> buildTree(List<MaterialClassesDO> list) {
if (list == null || list.isEmpty()) {
return Collections.emptyList();
}
Map<Long, MaterialClassesTreeRespVO> nodeMap = new LinkedHashMap<>();
list.stream()
.sorted(Comparator.comparing(MaterialClassesDO::getId))
.forEach(item -> {
MaterialClassesTreeRespVO node = BeanUtils.toBean(item, MaterialClassesTreeRespVO.class);
nodeMap.put(node.getId(), node);
});
List<MaterialClassesTreeRespVO> roots = new ArrayList<>();
nodeMap.values().forEach(node -> {
Long parentId = node.getParentId();
if (parentId == null || parentId == 0 || !nodeMap.containsKey(parentId)) {
roots.add(node);
} else {
nodeMap.get(parentId).getChildren().add(node);
}
});
return roots;
}
}

View File

@@ -0,0 +1,35 @@
package com.zt.plat.module.base.controller.admin.materialclasses.vo;
import lombok.*;
import java.util.*;
import io.swagger.v3.oas.annotations.media.Schema;
import com.zt.plat.framework.common.pojo.PageParam;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@Schema(description = "管理后台 - 物料分类分页 Request VO")
@Data
public class MaterialClassesPageReqVO extends PageParam {
@Schema(description = "父级ID", example = "20706")
private Long parentId;
@Schema(description = "分类编码")
private String code;
@Schema(description = "分类名称", example = "赵六")
private String name;
@Schema(description = "分类级别-用于类别层级(大/中/小类)")
private Long level;
@Schema(description = "备注")
private String remark;
@Schema(description = "创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime;
}

View File

@@ -0,0 +1,43 @@
package com.zt.plat.module.base.controller.admin.materialclasses.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 MaterialClassesRespVO {
@Schema(description = "主键ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "4051")
@ExcelProperty("主键ID")
private Long id;
@Schema(description = "父级ID", example = "20706")
@ExcelProperty("父级ID")
private Long parentId;
@Schema(description = "分类编码", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("分类编码")
private String code;
@Schema(description = "分类名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六")
@ExcelProperty("分类名称")
private String name;
@Schema(description = "分类级别-用于类别层级(大/中/小类)")
@ExcelProperty("分类级别-用于类别层级(大/中/小类)")
private Long level;
@Schema(description = "备注", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("备注")
private String remark;
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("创建时间")
private LocalDateTime createTime;
}

View File

@@ -0,0 +1,33 @@
package com.zt.plat.module.base.controller.admin.materialclasses.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import jakarta.validation.constraints.*;
@Schema(description = "管理后台 - 物料分类新增/修改 Request VO")
@Data
public class MaterialClassesSaveReqVO {
@Schema(description = "主键ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "4051")
private Long id;
@Schema(description = "父级ID", example = "20706")
private Long parentId;
@Schema(description = "分类编码", requiredMode = Schema.RequiredMode.REQUIRED)
@NotEmpty(message = "分类编码不能为空")
private String code;
@Schema(description = "分类名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六")
@NotEmpty(message = "分类名称不能为空")
private String name;
@Schema(description = "分类级别-用于类别层级(大/中/小类)")
private Long level;
@Schema(description = "备注", requiredMode = Schema.RequiredMode.REQUIRED)
@NotEmpty(message = "备注不能为空")
private String remark;
}

View File

@@ -0,0 +1,33 @@
package com.zt.plat.module.base.controller.admin.materialclasses.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.util.ArrayList;
import java.util.List;
@Schema(description = "管理后台 - 物料分类树节点 Response VO")
@Data
public class MaterialClassesTreeRespVO {
@Schema(description = "主键ID", example = "1001")
private Long id;
@Schema(description = "父级ID", example = "0")
private Long parentId;
@Schema(description = "分类编码", example = "CL-001")
private String code;
@Schema(description = "分类名称", example = "原材料")
private String name;
@Schema(description = "分类级别")
private Long level;
@Schema(description = "备注")
private String remark;
@Schema(description = "子节点")
private List<MaterialClassesTreeRespVO> children = new ArrayList<>();
}

View File

@@ -0,0 +1,107 @@
package com.zt.plat.module.base.controller.admin.materialhasclasses;
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 com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO;
import com.zt.plat.framework.common.pojo.PageParam;
import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.framework.common.pojo.CommonResult;
import com.zt.plat.framework.common.util.object.BeanUtils;
import static com.zt.plat.framework.common.pojo.CommonResult.success;
import com.zt.plat.framework.excel.core.util.ExcelUtils;
import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog;
import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*;
import com.zt.plat.module.base.controller.admin.materialhasclasses.vo.*;
import com.zt.plat.module.base.dal.dataobject.materialhasclasses.MaterialHasClassesDO;
import com.zt.plat.module.base.service.materialhasclasses.MaterialHasClassesService;
@Tag(name = "管理后台 - 物料持有分类")
@RestController
@RequestMapping("/base/material-has-classes")
@Validated
public class MaterialHasClassesController {
@Resource
private MaterialHasClassesService materialHasClassesService;
@PostMapping("/create")
@Operation(summary = "创建物料持有分类")
@PreAuthorize("@ss.hasPermission('base:material-has-classes:create')")
public CommonResult<MaterialHasClassesRespVO> createMaterialHasClasses(@Valid @RequestBody MaterialHasClassesSaveReqVO createReqVO) {
return success(materialHasClassesService.createMaterialHasClasses(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新物料持有分类")
@PreAuthorize("@ss.hasPermission('base:material-has-classes:update')")
public CommonResult<Boolean> updateMaterialHasClasses(@Valid @RequestBody MaterialHasClassesSaveReqVO updateReqVO) {
materialHasClassesService.updateMaterialHasClasses(updateReqVO);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除物料持有分类")
@Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('base:material-has-classes:delete')")
public CommonResult<Boolean> deleteMaterialHasClasses(@RequestParam("id") Long id) {
materialHasClassesService.deleteMaterialHasClasses(id);
return success(true);
}
@DeleteMapping("/delete-list")
@Parameter(name = "ids", description = "编号", required = true)
@Operation(summary = "批量删除物料持有分类")
@PreAuthorize("@ss.hasPermission('base:material-has-classes:delete')")
public CommonResult<Boolean> deleteMaterialHasClassesList(@RequestBody BatchDeleteReqVO req) {
materialHasClassesService.deleteMaterialHasClassesListByIds(req.getIds());
return success(true);
}
@GetMapping("/get")
@Operation(summary = "获得物料持有分类")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('base:material-has-classes:query')")
public CommonResult<MaterialHasClassesRespVO> getMaterialHasClasses(@RequestParam("id") Long id) {
MaterialHasClassesDO materialHasClasses = materialHasClassesService.getMaterialHasClasses(id);
return success(BeanUtils.toBean(materialHasClasses, MaterialHasClassesRespVO.class));
}
@GetMapping("/page")
@Operation(summary = "获得物料持有分类分页")
@PreAuthorize("@ss.hasPermission('base:material-has-classes:query')")
public CommonResult<PageResult<MaterialHasClassesRespVO>> getMaterialHasClassesPage(@Valid MaterialHasClassesPageReqVO pageReqVO) {
PageResult<MaterialHasClassesDO> pageResult = materialHasClassesService.getMaterialHasClassesPage(pageReqVO);
return success(BeanUtils.toBean(pageResult, MaterialHasClassesRespVO.class));
}
@GetMapping("/export-excel")
@Operation(summary = "导出物料持有分类 Excel")
@PreAuthorize("@ss.hasPermission('base:material-has-classes:export')")
@ApiAccessLog(operateType = EXPORT)
public void exportMaterialHasClassesExcel(@Valid MaterialHasClassesPageReqVO pageReqVO,
HttpServletResponse response) throws IOException {
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
List<MaterialHasClassesDO> list = materialHasClassesService.getMaterialHasClassesPage(pageReqVO).getList();
// 导出 Excel
ExcelUtils.write(response, "物料持有分类.xls", "数据", MaterialHasClassesRespVO.class,
BeanUtils.toBean(list, MaterialHasClassesRespVO.class));
}
}

View File

@@ -0,0 +1,26 @@
package com.zt.plat.module.base.controller.admin.materialhasclasses.vo;
import lombok.*;
import java.util.*;
import io.swagger.v3.oas.annotations.media.Schema;
import com.zt.plat.framework.common.pojo.PageParam;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@Schema(description = "管理后台 - 物料持有分类分页 Request VO")
@Data
public class MaterialHasClassesPageReqVO extends PageParam {
@Schema(description = "物料信息ID", example = "31031")
private Long infomationId;
@Schema(description = "创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime;
@Schema(description = "分类ID", example = "5914")
private Long classesId;
}

View File

@@ -0,0 +1,31 @@
package com.zt.plat.module.base.controller.admin.materialhasclasses.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 MaterialHasClassesRespVO {
@Schema(description = "主键ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "16228")
@ExcelProperty("主键ID")
private Long id;
@Schema(description = "物料信息ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "31031")
@ExcelProperty("物料信息ID")
private Long infomationId;
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("创建时间")
private LocalDateTime createTime;
@Schema(description = "分类ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "5914")
@ExcelProperty("分类ID")
private Long classesId;
}

View File

@@ -0,0 +1,23 @@
package com.zt.plat.module.base.controller.admin.materialhasclasses.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import jakarta.validation.constraints.*;
@Schema(description = "管理后台 - 物料持有分类新增/修改 Request VO")
@Data
public class MaterialHasClassesSaveReqVO {
@Schema(description = "主键ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "16228")
private Long id;
@Schema(description = "物料信息ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "31031")
@NotNull(message = "物料信息ID不能为空")
private Long infomationId;
@Schema(description = "分类ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "5914")
@NotNull(message = "分类ID不能为空")
private Long classesId;
}

View File

@@ -0,0 +1,107 @@
package com.zt.plat.module.base.controller.admin.materialhasproperties;
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 com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO;
import com.zt.plat.framework.common.pojo.PageParam;
import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.framework.common.pojo.CommonResult;
import com.zt.plat.framework.common.util.object.BeanUtils;
import static com.zt.plat.framework.common.pojo.CommonResult.success;
import com.zt.plat.framework.excel.core.util.ExcelUtils;
import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog;
import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*;
import com.zt.plat.module.base.controller.admin.materialhasproperties.vo.*;
import com.zt.plat.module.base.dal.dataobject.materialhasproperties.MaterialHasPropertiesDO;
import com.zt.plat.module.base.service.materialhasproperties.MaterialHasPropertiesService;
@Tag(name = "管理后台 - 物料持有属性")
@RestController
@RequestMapping("/base/material-has-properties")
@Validated
public class MaterialHasPropertiesController {
@Resource
private MaterialHasPropertiesService materialHasPropertiesService;
@PostMapping("/create")
@Operation(summary = "创建物料持有属性")
@PreAuthorize("@ss.hasPermission('base:material-has-properties:create')")
public CommonResult<MaterialHasPropertiesRespVO> createMaterialHasProperties(@Valid @RequestBody MaterialHasPropertiesSaveReqVO createReqVO) {
return success(materialHasPropertiesService.createMaterialHasProperties(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新物料持有属性")
@PreAuthorize("@ss.hasPermission('base:material-has-properties:update')")
public CommonResult<Boolean> updateMaterialHasProperties(@Valid @RequestBody MaterialHasPropertiesSaveReqVO updateReqVO) {
materialHasPropertiesService.updateMaterialHasProperties(updateReqVO);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除物料持有属性")
@Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('base:material-has-properties:delete')")
public CommonResult<Boolean> deleteMaterialHasProperties(@RequestParam("id") Long id) {
materialHasPropertiesService.deleteMaterialHasProperties(id);
return success(true);
}
@DeleteMapping("/delete-list")
@Parameter(name = "ids", description = "编号", required = true)
@Operation(summary = "批量删除物料持有属性")
@PreAuthorize("@ss.hasPermission('base:material-has-properties:delete')")
public CommonResult<Boolean> deleteMaterialHasPropertiesList(@RequestBody BatchDeleteReqVO req) {
materialHasPropertiesService.deleteMaterialHasPropertiesListByIds(req.getIds());
return success(true);
}
@GetMapping("/get")
@Operation(summary = "获得物料持有属性")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('base:material-has-properties:query')")
public CommonResult<MaterialHasPropertiesRespVO> getMaterialHasProperties(@RequestParam("id") Long id) {
MaterialHasPropertiesDO materialHasProperties = materialHasPropertiesService.getMaterialHasProperties(id);
return success(BeanUtils.toBean(materialHasProperties, MaterialHasPropertiesRespVO.class));
}
@GetMapping("/page")
@Operation(summary = "获得物料持有属性分页")
@PreAuthorize("@ss.hasPermission('base:material-has-properties:query')")
public CommonResult<PageResult<MaterialHasPropertiesRespVO>> getMaterialHasPropertiesPage(@Valid MaterialHasPropertiesPageReqVO pageReqVO) {
PageResult<MaterialHasPropertiesDO> pageResult = materialHasPropertiesService.getMaterialHasPropertiesPage(pageReqVO);
return success(BeanUtils.toBean(pageResult, MaterialHasPropertiesRespVO.class));
}
@GetMapping("/export-excel")
@Operation(summary = "导出物料持有属性 Excel")
@PreAuthorize("@ss.hasPermission('base:material-has-properties:export')")
@ApiAccessLog(operateType = EXPORT)
public void exportMaterialHasPropertiesExcel(@Valid MaterialHasPropertiesPageReqVO pageReqVO,
HttpServletResponse response) throws IOException {
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
List<MaterialHasPropertiesDO> list = materialHasPropertiesService.getMaterialHasPropertiesPage(pageReqVO).getList();
// 导出 Excel
ExcelUtils.write(response, "物料持有属性.xls", "数据", MaterialHasPropertiesRespVO.class,
BeanUtils.toBean(list, MaterialHasPropertiesRespVO.class));
}
}

View File

@@ -0,0 +1,41 @@
package com.zt.plat.module.base.controller.admin.materialhasproperties.vo;
import lombok.*;
import java.util.*;
import io.swagger.v3.oas.annotations.media.Schema;
import com.zt.plat.framework.common.pojo.PageParam;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@Schema(description = "管理后台 - 物料持有属性分页 Request VO")
@Data
public class MaterialHasPropertiesPageReqVO extends PageParam {
@Schema(description = "物料信息ID", example = "2614")
private Long infomationId;
@Schema(description = "属性ID", example = "8607")
private Long propertiesId;
@Schema(description = "计量单位ID-默认计量单位", example = "23731")
private Long unitId;
@Schema(description = "属性值")
private String value;
@Schema(description = "是否关键属性-关键属性表示物料唯一性")
private Integer isKey;
@Schema(description = "是否计量定价")
private Integer isMetering;
@Schema(description = "排序号")
private Long sort;
@Schema(description = "创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime;
}

View File

@@ -0,0 +1,51 @@
package com.zt.plat.module.base.controller.admin.materialhasproperties.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 MaterialHasPropertiesRespVO {
@Schema(description = "主键ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "6800")
@ExcelProperty("主键ID")
private Long id;
@Schema(description = "物料信息ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "2614")
@ExcelProperty("物料信息ID")
private Long infomationId;
@Schema(description = "属性ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "8607")
@ExcelProperty("属性ID")
private Long propertiesId;
@Schema(description = "计量单位ID-默认计量单位", example = "23731")
@ExcelProperty("计量单位ID-默认计量单位")
private Long unitId;
@Schema(description = "属性值", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("属性值")
private String value;
@Schema(description = "是否关键属性-关键属性表示物料唯一性")
@ExcelProperty("是否关键属性-关键属性表示物料唯一性")
private Integer isKey;
@Schema(description = "是否计量定价")
@ExcelProperty("是否计量定价")
private Integer isMetering;
@Schema(description = "排序号")
@ExcelProperty("排序号")
private Long sort;
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("创建时间")
private LocalDateTime createTime;
}

View File

@@ -0,0 +1,39 @@
package com.zt.plat.module.base.controller.admin.materialhasproperties.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import jakarta.validation.constraints.*;
@Schema(description = "管理后台 - 物料持有属性新增/修改 Request VO")
@Data
public class MaterialHasPropertiesSaveReqVO {
@Schema(description = "主键ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "6800")
private Long id;
@Schema(description = "物料信息ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "2614")
@NotNull(message = "物料信息ID不能为空")
private Long infomationId;
@Schema(description = "属性ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "8607")
@NotNull(message = "属性ID不能为空")
private Long propertiesId;
@Schema(description = "计量单位ID-默认计量单位", example = "23731")
private Long unitId;
@Schema(description = "属性值", requiredMode = Schema.RequiredMode.REQUIRED)
@NotEmpty(message = "属性值不能为空")
private String value;
@Schema(description = "是否关键属性-关键属性表示物料唯一性")
private Integer isKey;
@Schema(description = "是否计量定价")
private Integer isMetering;
@Schema(description = "排序号")
private Long sort;
}

View File

@@ -0,0 +1,107 @@
package com.zt.plat.module.base.controller.admin.materialproperties;
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 com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO;
import com.zt.plat.framework.common.pojo.PageParam;
import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.framework.common.pojo.CommonResult;
import com.zt.plat.framework.common.util.object.BeanUtils;
import static com.zt.plat.framework.common.pojo.CommonResult.success;
import com.zt.plat.framework.excel.core.util.ExcelUtils;
import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog;
import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*;
import com.zt.plat.module.base.controller.admin.materialproperties.vo.*;
import com.zt.plat.module.base.dal.dataobject.materialproperties.MaterialPropertiesDO;
import com.zt.plat.module.base.service.materialproperties.MaterialPropertiesService;
@Tag(name = "管理后台 - 物料属性")
@RestController
@RequestMapping("/base/material-properties")
@Validated
public class MaterialPropertiesController {
@Resource
private MaterialPropertiesService materialPropertiesService;
@PostMapping("/create")
@Operation(summary = "创建物料属性")
@PreAuthorize("@ss.hasPermission('base:material-properties:create')")
public CommonResult<MaterialPropertiesRespVO> createMaterialProperties(@Valid @RequestBody MaterialPropertiesSaveReqVO createReqVO) {
return success(materialPropertiesService.createMaterialProperties(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新物料属性")
@PreAuthorize("@ss.hasPermission('base:material-properties:update')")
public CommonResult<Boolean> updateMaterialProperties(@Valid @RequestBody MaterialPropertiesSaveReqVO updateReqVO) {
materialPropertiesService.updateMaterialProperties(updateReqVO);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除物料属性")
@Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('base:material-properties:delete')")
public CommonResult<Boolean> deleteMaterialProperties(@RequestParam("id") Long id) {
materialPropertiesService.deleteMaterialProperties(id);
return success(true);
}
@DeleteMapping("/delete-list")
@Parameter(name = "ids", description = "编号", required = true)
@Operation(summary = "批量删除物料属性")
@PreAuthorize("@ss.hasPermission('base:material-properties:delete')")
public CommonResult<Boolean> deleteMaterialPropertiesList(@RequestBody BatchDeleteReqVO req) {
materialPropertiesService.deleteMaterialPropertiesListByIds(req.getIds());
return success(true);
}
@GetMapping("/get")
@Operation(summary = "获得物料属性")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('base:material-properties:query')")
public CommonResult<MaterialPropertiesRespVO> getMaterialProperties(@RequestParam("id") Long id) {
MaterialPropertiesDO materialProperties = materialPropertiesService.getMaterialProperties(id);
return success(BeanUtils.toBean(materialProperties, MaterialPropertiesRespVO.class));
}
@GetMapping("/page")
@Operation(summary = "获得物料属性分页")
@PreAuthorize("@ss.hasPermission('base:material-properties:query')")
public CommonResult<PageResult<MaterialPropertiesRespVO>> getMaterialPropertiesPage(@Valid MaterialPropertiesPageReqVO pageReqVO) {
PageResult<MaterialPropertiesDO> pageResult = materialPropertiesService.getMaterialPropertiesPage(pageReqVO);
return success(BeanUtils.toBean(pageResult, MaterialPropertiesRespVO.class));
}
@GetMapping("/export-excel")
@Operation(summary = "导出物料属性 Excel")
@PreAuthorize("@ss.hasPermission('base:material-properties:export')")
@ApiAccessLog(operateType = EXPORT)
public void exportMaterialPropertiesExcel(@Valid MaterialPropertiesPageReqVO pageReqVO,
HttpServletResponse response) throws IOException {
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
List<MaterialPropertiesDO> list = materialPropertiesService.getMaterialPropertiesPage(pageReqVO).getList();
// 导出 Excel
ExcelUtils.write(response, "物料属性.xls", "数据", MaterialPropertiesRespVO.class,
BeanUtils.toBean(list, MaterialPropertiesRespVO.class));
}
}

View File

@@ -0,0 +1,38 @@
package com.zt.plat.module.base.controller.admin.materialproperties.vo;
import lombok.*;
import java.util.*;
import io.swagger.v3.oas.annotations.media.Schema;
import com.zt.plat.framework.common.pojo.PageParam;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@Schema(description = "管理后台 - 物料属性分页 Request VO")
@Data
public class MaterialPropertiesPageReqVO extends PageParam {
@Schema(description = "属性编码")
private String code;
@Schema(description = "属性名称", example = "芋艿")
private String name;
@Schema(description = "计量单位量ID", example = "30468")
private Long unitQuantityId;
@Schema(description = "业务字典数据值")
private String dictionaryDataValue;
@Schema(description = "数据类型", example = "1")
private String dataType;
@Schema(description = "备注")
private String remark;
@Schema(description = "创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime;
}

View File

@@ -0,0 +1,47 @@
package com.zt.plat.module.base.controller.admin.materialproperties.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 MaterialPropertiesRespVO {
@Schema(description = "主键ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "10591")
@ExcelProperty("主键ID")
private Long id;
@Schema(description = "属性编码", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("属性编码")
private String code;
@Schema(description = "属性名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
@ExcelProperty("属性名称")
private String name;
@Schema(description = "计量单位量ID", example = "30468")
@ExcelProperty("计量单位量ID")
private Long unitQuantityId;
@Schema(description = "业务字典数据值", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("业务字典数据值")
private String dictionaryDataValue;
@Schema(description = "数据类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@ExcelProperty("数据类型")
private String dataType;
@Schema(description = "备注", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("备注")
private String remark;
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("创建时间")
private LocalDateTime createTime;
}

View File

@@ -0,0 +1,38 @@
package com.zt.plat.module.base.controller.admin.materialproperties.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import jakarta.validation.constraints.*;
@Schema(description = "管理后台 - 物料属性新增/修改 Request VO")
@Data
public class MaterialPropertiesSaveReqVO {
@Schema(description = "主键ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "10591")
private Long id;
@Schema(description = "属性编码", requiredMode = Schema.RequiredMode.REQUIRED)
@NotEmpty(message = "属性编码不能为空")
private String code;
@Schema(description = "属性名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
@NotEmpty(message = "属性名称不能为空")
private String name;
@Schema(description = "计量单位量ID", example = "30468")
private Long unitQuantityId;
@Schema(description = "业务字典数据值", requiredMode = Schema.RequiredMode.REQUIRED)
@NotEmpty(message = "业务字典数据值不能为空")
private String dictionaryDataValue;
@Schema(description = "数据类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@NotEmpty(message = "数据类型不能为空")
private String dataType;
@Schema(description = "备注", requiredMode = Schema.RequiredMode.REQUIRED)
@NotEmpty(message = "备注不能为空")
private String remark;
}

View File

@@ -0,0 +1,138 @@
package com.zt.plat.module.base.controller.admin.processinginfomation;
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 com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO;
import com.zt.plat.framework.common.pojo.PageParam;
import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.framework.common.pojo.CommonResult;
import com.zt.plat.framework.common.util.object.BeanUtils;
import static com.zt.plat.framework.common.pojo.CommonResult.success;
import com.zt.plat.framework.excel.core.util.ExcelUtils;
import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog;
import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*;
import com.zt.plat.module.base.controller.admin.processinginfomation.vo.*;
import com.zt.plat.module.base.dal.dataobject.processinginfomation.ProcessingInfomationDO;
import com.zt.plat.module.base.service.processinginfomation.ProcessingInfomationService;
@Tag(name = "管理后台 - 工艺信息")
@RestController
@RequestMapping("/base/processing-infomation")
@Validated
public class ProcessingInfomationController {
@Resource
private ProcessingInfomationService processingInfomationService;
@PostMapping("/create")
@Operation(summary = "创建工艺信息")
@PreAuthorize("@ss.hasPermission('base:processing-infomation:create')")
public CommonResult<ProcessingInfomationRespVO> createProcessingInfomation(@Valid @RequestBody ProcessingInfomationSaveReqVO createReqVO) {
return success(processingInfomationService.createProcessingInfomation(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新工艺信息")
@PreAuthorize("@ss.hasPermission('base:processing-infomation:update')")
public CommonResult<Boolean> updateProcessingInfomation(@Valid @RequestBody ProcessingInfomationSaveReqVO updateReqVO) {
processingInfomationService.updateProcessingInfomation(updateReqVO);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除工艺信息")
@Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('base:processing-infomation:delete')")
public CommonResult<Boolean> deleteProcessingInfomation(@RequestParam("id") Long id) {
processingInfomationService.deleteProcessingInfomation(id);
return success(true);
}
@DeleteMapping("/delete-list")
@Parameter(name = "ids", description = "编号", required = true)
@Operation(summary = "批量删除工艺信息")
@PreAuthorize("@ss.hasPermission('base:processing-infomation:delete')")
public CommonResult<Boolean> deleteProcessingInfomationList(@RequestBody BatchDeleteReqVO req) {
processingInfomationService.deleteProcessingInfomationListByIds(req.getIds());
return success(true);
}
@GetMapping("/get")
@Operation(summary = "获得工艺信息")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('base:processing-infomation:query')")
public CommonResult<ProcessingInfomationRespVO> getProcessingInfomation(@RequestParam("id") Long id) {
ProcessingInfomationDO processingInfomation = processingInfomationService.getProcessingInfomation(id);
return success(BeanUtils.toBean(processingInfomation, ProcessingInfomationRespVO.class));
}
@GetMapping("/page")
@Operation(summary = "获得工艺信息分页")
@PreAuthorize("@ss.hasPermission('base:processing-infomation:query')")
public CommonResult<PageResult<ProcessingInfomationRespVO>> getProcessingInfomationPage(@Valid ProcessingInfomationPageReqVO pageReqVO) {
PageResult<ProcessingInfomationDO> pageResult = processingInfomationService.getProcessingInfomationPage(pageReqVO);
return success(BeanUtils.toBean(pageResult, ProcessingInfomationRespVO.class));
}
@GetMapping("/export-excel")
@Operation(summary = "导出工艺信息 Excel")
@PreAuthorize("@ss.hasPermission('base:processing-infomation:export')")
@ApiAccessLog(operateType = EXPORT)
public void exportProcessingInfomationExcel(@Valid ProcessingInfomationPageReqVO pageReqVO,
HttpServletResponse response) throws IOException {
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
List<ProcessingInfomationDO> list = processingInfomationService.getProcessingInfomationPage(pageReqVO).getList();
// 导出 Excel
ExcelUtils.write(response, "工艺信息.xls", "数据", ProcessingInfomationRespVO.class,
BeanUtils.toBean(list, ProcessingInfomationRespVO.class));
}
@GetMapping("/tree")
@Operation(summary = "获得工艺信息树")
@PreAuthorize("@ss.hasPermission('base:processing-infomation:query')")
public CommonResult<List<ProcessingInfomationTreeRespVO>> getProcessingInfomationTree() {
List<ProcessingInfomationDO> list = processingInfomationService.getProcessingInfomationList();
return success(buildTree(list));
}
private List<ProcessingInfomationTreeRespVO> buildTree(List<ProcessingInfomationDO> list) {
if (list == null || list.isEmpty()) {
return Collections.emptyList();
}
Map<Long, ProcessingInfomationTreeRespVO> nodeMap = new LinkedHashMap<>();
list.stream()
.sorted(Comparator.comparing(ProcessingInfomationDO::getId))
.forEach(item -> {
ProcessingInfomationTreeRespVO node = BeanUtils.toBean(item, ProcessingInfomationTreeRespVO.class);
nodeMap.put(node.getId(), node);
});
List<ProcessingInfomationTreeRespVO> roots = new ArrayList<>();
nodeMap.values().forEach(node -> {
Long parentId = node.getParentId();
if (parentId == null || parentId == 0 || !nodeMap.containsKey(parentId)) {
roots.add(node);
} else {
nodeMap.get(parentId).getChildren().add(node);
}
});
return roots;
}
}

View File

@@ -0,0 +1,42 @@
package com.zt.plat.module.base.controller.admin.processinginfomation.vo;
import lombok.*;
import java.util.*;
import io.swagger.v3.oas.annotations.media.Schema;
import com.zt.plat.framework.common.pojo.PageParam;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@Schema(description = "管理后台 - 工艺信息分页 Request VO")
@Data
public class ProcessingInfomationPageReqVO extends PageParam {
@Schema(description = "父级ID", example = "16823")
private Long parentId;
@Schema(description = "工艺编码-唯一业务键")
private String code;
@Schema(description = "工艺名称", example = "赵六")
private String name;
@Schema(description = "工艺类型值")
private Long typeValue;
@Schema(description = "状态值-工艺状态")
private String statusValue;
@Schema(description = "工艺描述")
private String description;
@Schema(description = "生效日期")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] effectiveDate;
@Schema(description = "创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime;
}

View File

@@ -0,0 +1,51 @@
package com.zt.plat.module.base.controller.admin.processinginfomation.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 ProcessingInfomationRespVO {
@Schema(description = "主键ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "16240")
@ExcelProperty("主键ID")
private Long id;
@Schema(description = "父级ID", example = "16823")
@ExcelProperty("父级ID")
private Long parentId;
@Schema(description = "工艺编码-唯一业务键", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("工艺编码-唯一业务键")
private String code;
@Schema(description = "工艺名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六")
@ExcelProperty("工艺名称")
private String name;
@Schema(description = "工艺类型值")
@ExcelProperty("工艺类型值")
private Long typeValue;
@Schema(description = "状态值-工艺状态", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("状态值-工艺状态")
private String statusValue;
@Schema(description = "工艺描述", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("工艺描述")
private String description;
@Schema(description = "生效日期")
@ExcelProperty("生效日期")
private LocalDateTime effectiveDate;
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("创建时间")
private LocalDateTime createTime;
}

View File

@@ -0,0 +1,42 @@
package com.zt.plat.module.base.controller.admin.processinginfomation.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import jakarta.validation.constraints.*;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
@Schema(description = "管理后台 - 工艺信息新增/修改 Request VO")
@Data
public class ProcessingInfomationSaveReqVO {
@Schema(description = "主键ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "16240")
private Long id;
@Schema(description = "父级ID", example = "16823")
private Long parentId;
@Schema(description = "工艺编码-唯一业务键", requiredMode = Schema.RequiredMode.REQUIRED)
@NotEmpty(message = "工艺编码-唯一业务键不能为空")
private String code;
@Schema(description = "工艺名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六")
@NotEmpty(message = "工艺名称不能为空")
private String name;
@Schema(description = "工艺类型值")
private Long typeValue;
@Schema(description = "状态值-工艺状态", requiredMode = Schema.RequiredMode.REQUIRED)
@NotEmpty(message = "状态值-工艺状态不能为空")
private String statusValue;
@Schema(description = "工艺描述", requiredMode = Schema.RequiredMode.REQUIRED)
@NotEmpty(message = "工艺描述不能为空")
private String description;
@Schema(description = "生效日期")
private LocalDateTime effectiveDate;
}

View File

@@ -0,0 +1,34 @@
package com.zt.plat.module.base.controller.admin.processinginfomation.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.util.ArrayList;
import java.util.List;
@Schema(description = "管理后台 - 工艺信息树节点 Response VO")
@Data
public class ProcessingInfomationTreeRespVO {
@Schema(description = "主键ID", example = "1001")
private Long id;
@Schema(description = "父级ID", example = "0")
private Long parentId;
@Schema(description = "工艺编码", example = "PRC-001")
private String code;
@Schema(description = "工艺名称", example = "熔铸")
private String name;
@Schema(description = "工艺类型值")
private Long typeValue;
@Schema(description = "状态值-工艺状态")
private String statusValue;
@Schema(description = "子节点")
private List<ProcessingInfomationTreeRespVO> children = new ArrayList<>();
}

View File

@@ -0,0 +1,107 @@
package com.zt.plat.module.base.controller.admin.processinginfomationoperation;
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 com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO;
import com.zt.plat.framework.common.pojo.PageParam;
import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.framework.common.pojo.CommonResult;
import com.zt.plat.framework.common.util.object.BeanUtils;
import static com.zt.plat.framework.common.pojo.CommonResult.success;
import com.zt.plat.framework.excel.core.util.ExcelUtils;
import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog;
import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*;
import com.zt.plat.module.base.controller.admin.processinginfomationoperation.vo.*;
import com.zt.plat.module.base.dal.dataobject.processinginfomationoperation.ProcessingInfomationOperationDO;
import com.zt.plat.module.base.service.processinginfomationoperation.ProcessingInfomationOperationService;
@Tag(name = "管理后台 - 工艺工序")
@RestController
@RequestMapping("/base/processing-infomation-operation")
@Validated
public class ProcessingInfomationOperationController {
@Resource
private ProcessingInfomationOperationService processingInfomationOperationService;
@PostMapping("/create")
@Operation(summary = "创建工艺工序")
@PreAuthorize("@ss.hasPermission('base:processing-infomation-operation:create')")
public CommonResult<ProcessingInfomationOperationRespVO> createProcessingInfomationOperation(@Valid @RequestBody ProcessingInfomationOperationSaveReqVO createReqVO) {
return success(processingInfomationOperationService.createProcessingInfomationOperation(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新工艺工序")
@PreAuthorize("@ss.hasPermission('base:processing-infomation-operation:update')")
public CommonResult<Boolean> updateProcessingInfomationOperation(@Valid @RequestBody ProcessingInfomationOperationSaveReqVO updateReqVO) {
processingInfomationOperationService.updateProcessingInfomationOperation(updateReqVO);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除工艺工序")
@Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('base:processing-infomation-operation:delete')")
public CommonResult<Boolean> deleteProcessingInfomationOperation(@RequestParam("id") Long id) {
processingInfomationOperationService.deleteProcessingInfomationOperation(id);
return success(true);
}
@DeleteMapping("/delete-list")
@Parameter(name = "ids", description = "编号", required = true)
@Operation(summary = "批量删除工艺工序")
@PreAuthorize("@ss.hasPermission('base:processing-infomation-operation:delete')")
public CommonResult<Boolean> deleteProcessingInfomationOperationList(@RequestBody BatchDeleteReqVO req) {
processingInfomationOperationService.deleteProcessingInfomationOperationListByIds(req.getIds());
return success(true);
}
@GetMapping("/get")
@Operation(summary = "获得工艺工序")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('base:processing-infomation-operation:query')")
public CommonResult<ProcessingInfomationOperationRespVO> getProcessingInfomationOperation(@RequestParam("id") Long id) {
ProcessingInfomationOperationDO processingInfomationOperation = processingInfomationOperationService.getProcessingInfomationOperation(id);
return success(BeanUtils.toBean(processingInfomationOperation, ProcessingInfomationOperationRespVO.class));
}
@GetMapping("/page")
@Operation(summary = "获得工艺工序分页")
@PreAuthorize("@ss.hasPermission('base:processing-infomation-operation:query')")
public CommonResult<PageResult<ProcessingInfomationOperationRespVO>> getProcessingInfomationOperationPage(@Valid ProcessingInfomationOperationPageReqVO pageReqVO) {
PageResult<ProcessingInfomationOperationRespVO> pageResult = processingInfomationOperationService.getProcessingInfomationOperationDetailPage(pageReqVO);
return success(pageResult);
}
@GetMapping("/export-excel")
@Operation(summary = "导出工艺工序 Excel")
@PreAuthorize("@ss.hasPermission('base:processing-infomation-operation:export')")
@ApiAccessLog(operateType = EXPORT)
public void exportProcessingInfomationOperationExcel(@Valid ProcessingInfomationOperationPageReqVO pageReqVO,
HttpServletResponse response) throws IOException {
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
List<ProcessingInfomationOperationRespVO> list = processingInfomationOperationService.getProcessingInfomationOperationDetailList(pageReqVO);
// 导出 Excel
ExcelUtils.write(response, "工艺工序.xls", "数据", ProcessingInfomationOperationRespVO.class,
list);
}
}

View File

@@ -0,0 +1,41 @@
package com.zt.plat.module.base.controller.admin.processinginfomationoperation.vo;
import lombok.*;
import java.util.*;
import io.swagger.v3.oas.annotations.media.Schema;
import com.zt.plat.framework.common.pojo.PageParam;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@Schema(description = "管理后台 - 工艺工序分页 Request VO")
@Data
public class ProcessingInfomationOperationPageReqVO extends PageParam {
@Schema(description = "前序工序ID", example = "14658")
private Long previousOperationId;
@Schema(description = "后续工序ID", example = "22110")
private Long nextOperationId;
@Schema(description = "工艺ID", example = "5773")
private Long processingId;
@Schema(description = "是否关键工序")
private Integer isKey;
@Schema(description = "备注")
private String remark;
@Schema(description = "后续工序编码")
private String nextOperationCode;
@Schema(description = "后续工序名称")
private String nextOperationName;
@Schema(description = "创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime;
}

View File

@@ -0,0 +1,59 @@
package com.zt.plat.module.base.controller.admin.processinginfomationoperation.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 ProcessingInfomationOperationRespVO {
@Schema(description = "主键ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "29694")
@ExcelProperty("主键ID")
private Long id;
@Schema(description = "前序工序ID", example = "14658")
@ExcelProperty("前序工序ID")
private Long previousOperationId;
@Schema(description = "前序工序编码")
@ExcelProperty("前序工序编码")
private String previousOperationCode;
@Schema(description = "前序工序名称")
@ExcelProperty("前序工序名称")
private String previousOperationName;
@Schema(description = "后续工序ID", example = "22110")
@ExcelProperty("后续工序ID")
private Long nextOperationId;
@Schema(description = "后续工序编码")
@ExcelProperty("后续工序编码")
private String nextOperationCode;
@Schema(description = "后续工序名称")
@ExcelProperty("后续工序名称")
private String nextOperationName;
@Schema(description = "工艺ID", example = "5773")
@ExcelProperty("工艺ID")
private Long processingId;
@Schema(description = "是否关键工序")
@ExcelProperty("是否关键工序")
private Integer isKey;
@Schema(description = "备注", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("备注")
private String remark;
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("创建时间")
private LocalDateTime createTime;
}

View File

@@ -0,0 +1,31 @@
package com.zt.plat.module.base.controller.admin.processinginfomationoperation.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import jakarta.validation.constraints.*;
@Schema(description = "管理后台 - 工艺工序新增/修改 Request VO")
@Data
public class ProcessingInfomationOperationSaveReqVO {
@Schema(description = "主键ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "29694")
private Long id;
@Schema(description = "前序工序ID", example = "14658")
private Long previousOperationId;
@Schema(description = "后续工序ID", example = "22110")
private Long nextOperationId;
@Schema(description = "工艺ID", example = "5773")
private Long processingId;
@Schema(description = "是否关键工序")
private Integer isKey;
@Schema(description = "备注", requiredMode = Schema.RequiredMode.REQUIRED)
@NotEmpty(message = "备注不能为空")
private String remark;
}

View File

@@ -0,0 +1,115 @@
package com.zt.plat.module.base.controller.admin.processingoperation;
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 com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO;
import com.zt.plat.framework.common.pojo.PageParam;
import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.framework.common.pojo.CommonResult;
import com.zt.plat.framework.common.util.object.BeanUtils;
import static com.zt.plat.framework.common.pojo.CommonResult.success;
import com.zt.plat.framework.excel.core.util.ExcelUtils;
import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog;
import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*;
import com.zt.plat.module.base.controller.admin.processingoperation.vo.*;
import com.zt.plat.module.base.dal.dataobject.processingoperation.ProcessingOperationDO;
import com.zt.plat.module.base.service.processingoperation.ProcessingOperationService;
@Tag(name = "管理后台 - 工序")
@RestController
@RequestMapping("/base/processing-operation")
@Validated
public class ProcessingOperationController {
@Resource
private ProcessingOperationService processingOperationService;
@PostMapping("/create")
@Operation(summary = "创建工序")
@PreAuthorize("@ss.hasPermission('base:processing-operation:create')")
public CommonResult<ProcessingOperationRespVO> createProcessingOperation(@Valid @RequestBody ProcessingOperationSaveReqVO createReqVO) {
return success(processingOperationService.createProcessingOperation(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新工序")
@PreAuthorize("@ss.hasPermission('base:processing-operation:update')")
public CommonResult<Boolean> updateProcessingOperation(@Valid @RequestBody ProcessingOperationSaveReqVO updateReqVO) {
processingOperationService.updateProcessingOperation(updateReqVO);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除工序")
@Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('base:processing-operation:delete')")
public CommonResult<Boolean> deleteProcessingOperation(@RequestParam("id") Long id) {
processingOperationService.deleteProcessingOperation(id);
return success(true);
}
@DeleteMapping("/delete-list")
@Parameter(name = "ids", description = "编号", required = true)
@Operation(summary = "批量删除工序")
@PreAuthorize("@ss.hasPermission('base:processing-operation:delete')")
public CommonResult<Boolean> deleteProcessingOperationList(@RequestBody BatchDeleteReqVO req) {
processingOperationService.deleteProcessingOperationListByIds(req.getIds());
return success(true);
}
@GetMapping("/get")
@Operation(summary = "获得工序")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('base:processing-operation:query')")
public CommonResult<ProcessingOperationRespVO> getProcessingOperation(@RequestParam("id") Long id) {
ProcessingOperationDO processingOperation = processingOperationService.getProcessingOperation(id);
return success(BeanUtils.toBean(processingOperation, ProcessingOperationRespVO.class));
}
@GetMapping("/page")
@Operation(summary = "获得工序分页")
@PreAuthorize("@ss.hasPermission('base:processing-operation:query')")
public CommonResult<PageResult<ProcessingOperationRespVO>> getProcessingOperationPage(@Valid ProcessingOperationPageReqVO pageReqVO) {
PageResult<ProcessingOperationDO> pageResult = processingOperationService.getProcessingOperationPage(pageReqVO);
return success(BeanUtils.toBean(pageResult, ProcessingOperationRespVO.class));
}
@GetMapping("/export-excel")
@Operation(summary = "导出工序 Excel")
@PreAuthorize("@ss.hasPermission('base:processing-operation:export')")
@ApiAccessLog(operateType = EXPORT)
public void exportProcessingOperationExcel(@Valid ProcessingOperationPageReqVO pageReqVO,
HttpServletResponse response) throws IOException {
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
List<ProcessingOperationDO> list = processingOperationService.getProcessingOperationPage(pageReqVO).getList();
// 导出 Excel
ExcelUtils.write(response, "工序.xls", "数据", ProcessingOperationRespVO.class,
BeanUtils.toBean(list, ProcessingOperationRespVO.class));
}
@GetMapping("/simple-list")
@Operation(summary = "获得工序简单列表")
@PreAuthorize("@ss.hasPermission('base:processing-operation:query')")
public CommonResult<List<ProcessingOperationSimpleRespVO>> getProcessingOperationSimpleList() {
List<ProcessingOperationDO> list = processingOperationService.getProcessingOperationList();
return success(BeanUtils.toBean(list, ProcessingOperationSimpleRespVO.class));
}
}

View File

@@ -0,0 +1,35 @@
package com.zt.plat.module.base.controller.admin.processingoperation.vo;
import lombok.*;
import java.util.*;
import io.swagger.v3.oas.annotations.media.Schema;
import com.zt.plat.framework.common.pojo.PageParam;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@Schema(description = "管理后台 - 工序分页 Request VO")
@Data
public class ProcessingOperationPageReqVO extends PageParam {
@Schema(description = "工序编码")
private String code;
@Schema(description = "工序名称", example = "王五")
private String name;
@Schema(description = "排序号")
private Long sort;
@Schema(description = "类型值-工序类型")
private String typeValue;
@Schema(description = "备注")
private String remark;
@Schema(description = "创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime;
}

View File

@@ -0,0 +1,43 @@
package com.zt.plat.module.base.controller.admin.processingoperation.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 ProcessingOperationRespVO {
@Schema(description = "主键ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "14097")
@ExcelProperty("主键ID")
private Long id;
@Schema(description = "工序编码", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("工序编码")
private String code;
@Schema(description = "工序名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五")
@ExcelProperty("工序名称")
private String name;
@Schema(description = "排序号")
@ExcelProperty("排序号")
private Long sort;
@Schema(description = "类型值-工序类型", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("类型值-工序类型")
private String typeValue;
@Schema(description = "备注", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("备注")
private String remark;
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("创建时间")
private LocalDateTime createTime;
}

View File

@@ -0,0 +1,34 @@
package com.zt.plat.module.base.controller.admin.processingoperation.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import jakarta.validation.constraints.*;
@Schema(description = "管理后台 - 工序新增/修改 Request VO")
@Data
public class ProcessingOperationSaveReqVO {
@Schema(description = "主键ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "14097")
private Long id;
@Schema(description = "工序编码", requiredMode = Schema.RequiredMode.REQUIRED)
@NotEmpty(message = "工序编码不能为空")
private String code;
@Schema(description = "工序名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五")
@NotEmpty(message = "工序名称不能为空")
private String name;
@Schema(description = "排序号")
private Long sort;
@Schema(description = "类型值-工序类型", requiredMode = Schema.RequiredMode.REQUIRED)
@NotEmpty(message = "类型值-工序类型不能为空")
private String typeValue;
@Schema(description = "备注", requiredMode = Schema.RequiredMode.REQUIRED)
@NotEmpty(message = "备注不能为空")
private String remark;
}

View File

@@ -0,0 +1,19 @@
package com.zt.plat.module.base.controller.admin.processingoperation.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
@Schema(description = "管理后台 - 工序简单信息 Response VO")
@Data
public class ProcessingOperationSimpleRespVO {
@Schema(description = "工序ID", example = "1001")
private Long id;
@Schema(description = "工序编码", example = "OP-001")
private String code;
@Schema(description = "工序名称", example = "熔铸")
private String name;
}

View File

@@ -0,0 +1,107 @@
package com.zt.plat.module.base.controller.admin.processingoperationmaterial;
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 com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO;
import com.zt.plat.framework.common.pojo.PageParam;
import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.framework.common.pojo.CommonResult;
import com.zt.plat.framework.common.util.object.BeanUtils;
import static com.zt.plat.framework.common.pojo.CommonResult.success;
import com.zt.plat.framework.excel.core.util.ExcelUtils;
import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog;
import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*;
import com.zt.plat.module.base.controller.admin.processingoperationmaterial.vo.*;
import com.zt.plat.module.base.dal.dataobject.processingoperationmaterial.ProcessingOperationMaterialDO;
import com.zt.plat.module.base.service.processingoperationmaterial.ProcessingOperationMaterialService;
@Tag(name = "管理后台 - 工艺工序物料")
@RestController
@RequestMapping("/base/processing-operation-material")
@Validated
public class ProcessingOperationMaterialController {
@Resource
private ProcessingOperationMaterialService processingOperationMaterialService;
@PostMapping("/create")
@Operation(summary = "创建工艺工序物料")
@PreAuthorize("@ss.hasPermission('base:processing-operation-material:create')")
public CommonResult<ProcessingOperationMaterialRespVO> createProcessingOperationMaterial(@Valid @RequestBody ProcessingOperationMaterialSaveReqVO createReqVO) {
return success(processingOperationMaterialService.createProcessingOperationMaterial(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新工艺工序物料")
@PreAuthorize("@ss.hasPermission('base:processing-operation-material:update')")
public CommonResult<Boolean> updateProcessingOperationMaterial(@Valid @RequestBody ProcessingOperationMaterialSaveReqVO updateReqVO) {
processingOperationMaterialService.updateProcessingOperationMaterial(updateReqVO);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除工艺工序物料")
@Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('base:processing-operation-material:delete')")
public CommonResult<Boolean> deleteProcessingOperationMaterial(@RequestParam("id") Long id) {
processingOperationMaterialService.deleteProcessingOperationMaterial(id);
return success(true);
}
@DeleteMapping("/delete-list")
@Parameter(name = "ids", description = "编号", required = true)
@Operation(summary = "批量删除工艺工序物料")
@PreAuthorize("@ss.hasPermission('base:processing-operation-material:delete')")
public CommonResult<Boolean> deleteProcessingOperationMaterialList(@RequestBody BatchDeleteReqVO req) {
processingOperationMaterialService.deleteProcessingOperationMaterialListByIds(req.getIds());
return success(true);
}
@GetMapping("/get")
@Operation(summary = "获得工艺工序物料")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('base:processing-operation-material:query')")
public CommonResult<ProcessingOperationMaterialRespVO> getProcessingOperationMaterial(@RequestParam("id") Long id) {
ProcessingOperationMaterialDO processingOperationMaterial = processingOperationMaterialService.getProcessingOperationMaterial(id);
return success(BeanUtils.toBean(processingOperationMaterial, ProcessingOperationMaterialRespVO.class));
}
@GetMapping("/page")
@Operation(summary = "获得工艺工序物料分页")
@PreAuthorize("@ss.hasPermission('base:processing-operation-material:query')")
public CommonResult<PageResult<ProcessingOperationMaterialRespVO>> getProcessingOperationMaterialPage(@Valid ProcessingOperationMaterialPageReqVO pageReqVO) {
PageResult<ProcessingOperationMaterialDO> pageResult = processingOperationMaterialService.getProcessingOperationMaterialPage(pageReqVO);
return success(BeanUtils.toBean(pageResult, ProcessingOperationMaterialRespVO.class));
}
@GetMapping("/export-excel")
@Operation(summary = "导出工艺工序物料 Excel")
@PreAuthorize("@ss.hasPermission('base:processing-operation-material:export')")
@ApiAccessLog(operateType = EXPORT)
public void exportProcessingOperationMaterialExcel(@Valid ProcessingOperationMaterialPageReqVO pageReqVO,
HttpServletResponse response) throws IOException {
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
List<ProcessingOperationMaterialDO> list = processingOperationMaterialService.getProcessingOperationMaterialPage(pageReqVO).getList();
// 导出 Excel
ExcelUtils.write(response, "工艺工序物料.xls", "数据", ProcessingOperationMaterialRespVO.class,
BeanUtils.toBean(list, ProcessingOperationMaterialRespVO.class));
}
}

View File

@@ -0,0 +1,29 @@
package com.zt.plat.module.base.controller.admin.processingoperationmaterial.vo;
import lombok.*;
import java.util.*;
import io.swagger.v3.oas.annotations.media.Schema;
import com.zt.plat.framework.common.pojo.PageParam;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@Schema(description = "管理后台 - 工艺工序物料分页 Request VO")
@Data
public class ProcessingOperationMaterialPageReqVO extends PageParam {
@Schema(description = "类型值-物料类型(产出/投入)")
private String typeValue;
@Schema(description = "备注")
private String remark;
@Schema(description = "创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime;
@Schema(description = "组织机构")
private String departmentIds;
}

View File

@@ -0,0 +1,43 @@
package com.zt.plat.module.base.controller.admin.processingoperationmaterial.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 ProcessingOperationMaterialRespVO {
@Schema(description = "主键ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "27200")
@ExcelProperty("主键ID")
private Long id;
@Schema(description = "工艺工序ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "18575")
@ExcelProperty("工艺工序ID")
private Long processingOperationId;
@Schema(description = "物料ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "15117")
@ExcelProperty("物料ID")
private Long materialId;
@Schema(description = "类型值-物料类型(产出/投入)", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("类型值-物料类型(产出/投入)")
private String typeValue;
@Schema(description = "备注", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("备注")
private String remark;
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("创建时间")
private LocalDateTime createTime;
@Schema(description = "组织机构")
@ExcelProperty("组织机构")
private String departmentIds;
}

View File

@@ -0,0 +1,32 @@
package com.zt.plat.module.base.controller.admin.processingoperationmaterial.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import jakarta.validation.constraints.*;
@Schema(description = "管理后台 - 工艺工序物料新增/修改 Request VO")
@Data
public class ProcessingOperationMaterialSaveReqVO {
@Schema(description = "主键ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "27200")
private Long id;
@Schema(description = "工艺工序ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "18575")
private Long processingOperationId;
@Schema(description = "物料ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "15117")
private Long materialId;
@Schema(description = "类型值-物料类型(产出/投入)", requiredMode = Schema.RequiredMode.REQUIRED)
@NotEmpty(message = "类型值-物料类型(产出/投入)不能为空")
private String typeValue;
@Schema(description = "备注", requiredMode = Schema.RequiredMode.REQUIRED)
@NotEmpty(message = "备注不能为空")
private String remark;
@Schema(description = "组织机构")
private String departmentIds;
}

View File

@@ -1,4 +1,4 @@
package com.zt.plat.module.unitmanagement.controller.admin.QuantityUnitRelation; package com.zt.plat.module.base.controller.admin.quantityUnitRelation;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import jakarta.annotation.Resource; import jakarta.annotation.Resource;
@@ -10,7 +10,6 @@ import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import jakarta.validation.constraints.*;
import jakarta.validation.*; import jakarta.validation.*;
import jakarta.servlet.http.*; import jakarta.servlet.http.*;
import java.util.*; import java.util.*;
@@ -28,9 +27,9 @@ import com.zt.plat.framework.excel.core.util.ExcelUtils;
import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog; import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog;
import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*; import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*;
import com.zt.plat.module.unitmanagement.controller.admin.QuantityUnitRelation.vo.*; import com.zt.plat.module.base.controller.admin.quantityUnitRelation.vo.*;
import com.zt.plat.module.unitmanagement.dal.dataobject.QuantityUnitRelation.QuantityUnitRelationDO; import com.zt.plat.module.base.dal.dataobject.quantityUnitRelation.QuantityUnitRelationDO;
import com.zt.plat.module.unitmanagement.service.QuantityUnitRelation.QuantityUnitRelationService; import com.zt.plat.module.base.service.quantityUnitRelation.QuantityUnitRelationService;
@Tag(name = "管理后台 - 计量单位量与单位关联") @Tag(name = "管理后台 - 计量单位量与单位关联")
@RestController @RestController
@@ -113,4 +112,19 @@ public class QuantityUnitRelationController implements BusinessControllerMarker
return success(true); return success(true);
} }
@PostMapping("/create-unit-with-relation")
@Operation(summary = "创建单位并关联到量纲(组合接口)")
@PreAuthorize("@ss.hasPermission('unitmanagement:quantity-unit-relation:create')")
public CommonResult<QuantityUnitRelationRespVO> createUnitWithRelation(@Valid @RequestBody CreateUnitWithRelationReqVO createReqVO) {
return success(quantityUnitRelationService.createUnitWithRelation(createReqVO));
}
@PostMapping("/delete-unit-with-relation")
@Operation(summary = "删除单位及关联关系(组合接口)")
@PreAuthorize("@ss.hasPermission('unitmanagement:quantity-unit-relation:delete')")
public CommonResult<Boolean> deleteUnitWithRelation(@Valid @RequestBody DeleteUnitWithRelationReqVO deleteReqVO) {
quantityUnitRelationService.deleteUnitWithRelation(deleteReqVO);
return success(true);
}
} }

View File

@@ -0,0 +1,27 @@
package com.zt.plat.module.base.controller.admin.quantityUnitRelation.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import jakarta.validation.constraints.*;
@Schema(description = "管理后台 - 创建单位并关联到量纲 Request VO")
@Data
public class CreateUnitWithRelationReqVO {
@Schema(description = "量纲ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@NotNull(message = "量纲ID不能为空")
private Long untQtyId;
@Schema(description = "单位名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "")
@NotEmpty(message = "单位名称不能为空")
private String name;
@Schema(description = "单位符号", requiredMode = Schema.RequiredMode.REQUIRED, example = "m")
@NotEmpty(message = "单位符号不能为空")
private String smb;
@Schema(description = "是否基准单位0=否1=是", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@NotNull(message = "是否基准单位不能为空")
private Integer isBse;
}

View File

@@ -0,0 +1,19 @@
package com.zt.plat.module.base.controller.admin.quantityUnitRelation.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import jakarta.validation.constraints.*;
@Schema(description = "管理后台 - 删除单位及关联关系 Request VO")
@Data
public class DeleteUnitWithRelationReqVO {
@Schema(description = "关联关系ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@NotNull(message = "关联关系ID不能为空")
private Long relationId;
@Schema(description = "单位ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@NotNull(message = "单位ID不能为空")
private Long untId;
}

View File

@@ -1,4 +1,4 @@
package com.zt.plat.module.unitmanagement.controller.admin.QuantityUnitRelation.vo; package com.zt.plat.module.base.controller.admin.quantityUnitRelation.vo;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*; import lombok.*;

View File

@@ -1,4 +1,4 @@
package com.zt.plat.module.unitmanagement.controller.admin.QuantityUnitRelation.vo; package com.zt.plat.module.base.controller.admin.quantityUnitRelation.vo;
import lombok.*; import lombok.*;
import java.util.*; import java.util.*;

View File

@@ -1,4 +1,4 @@
package com.zt.plat.module.unitmanagement.controller.admin.QuantityUnitRelation.vo; package com.zt.plat.module.base.controller.admin.quantityUnitRelation.vo;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*; import lombok.*;

View File

@@ -1,4 +1,4 @@
package com.zt.plat.module.unitmanagement.controller.admin.QuantityUnitRelation.vo; package com.zt.plat.module.base.controller.admin.quantityUnitRelation.vo;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*; import lombok.*;

View File

@@ -1,9 +1,8 @@
package com.zt.plat.module.base.controller.admin.templtp.vo; package com.zt.plat.module.base.controller.admin.templtp.vo;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*; import jakarta.validation.constraints.NotEmpty;
import java.util.*; import lombok.Data;
import jakarta.validation.constraints.*;
@Schema(description = "管理后台 - 实例字段值新增/修改 Request VO") @Schema(description = "管理后台 - 实例字段值新增/修改 Request VO")
@Data @Data
@@ -22,6 +21,6 @@ public class TemplateInstanceDataSaveReqVO {
@Schema(description = "用户填写的值", requiredMode = Schema.RequiredMode.REQUIRED) @Schema(description = "用户填写的值", requiredMode = Schema.RequiredMode.REQUIRED)
// @NotEmpty(message = "用户填写的值不能为空") // @NotEmpty(message = "用户填写的值不能为空")
private String fldVal; private Object fldVal;
} }

View File

@@ -1,4 +1,4 @@
package com.zt.plat.module.unitmanagement.controller.admin.UnitConversion; package com.zt.plat.module.base.controller.admin.unitConversion;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import jakarta.annotation.Resource; import jakarta.annotation.Resource;
@@ -10,7 +10,6 @@ import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import jakarta.validation.constraints.*;
import jakarta.validation.*; import jakarta.validation.*;
import jakarta.servlet.http.*; import jakarta.servlet.http.*;
import java.util.*; import java.util.*;
@@ -28,9 +27,9 @@ import com.zt.plat.framework.excel.core.util.ExcelUtils;
import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog; import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog;
import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*; import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*;
import com.zt.plat.module.unitmanagement.controller.admin.UnitConversion.vo.*; import com.zt.plat.module.base.controller.admin.unitConversion.vo.*;
import com.zt.plat.module.unitmanagement.dal.dataobject.UnitConversion.UnitConversionDO; import com.zt.plat.module.base.dal.dataobject.unitConversion.UnitConversionDO;
import com.zt.plat.module.unitmanagement.service.UnitConversion.UnitConversionService; import com.zt.plat.module.base.service.unitConversion.UnitConversionService;
@Tag(name = "管理后台 - 单位转换") @Tag(name = "管理后台 - 单位转换")
@RestController @RestController
@@ -38,7 +37,6 @@ import com.zt.plat.module.unitmanagement.service.UnitConversion.UnitConversionSe
@Validated @Validated
public class UnitConversionController implements BusinessControllerMarker { public class UnitConversionController implements BusinessControllerMarker {
@Resource @Resource
private UnitConversionService unitConversionService; private UnitConversionService unitConversionService;
@@ -105,4 +103,54 @@ public class UnitConversionController implements BusinessControllerMarker {
BeanUtils.toBean(list, UnitConversionRespVO.class)); BeanUtils.toBean(list, UnitConversionRespVO.class));
} }
@PostMapping("/convert")
@Operation(summary = "单位转换")
@PreAuthorize("@ss.hasPermission('unitmanagement:unit-conversion:query')")
public CommonResult<UnitConvertRespVO> convert(@Valid @RequestBody UnitConvertReqVO convertReqVO) {
return success(unitConversionService.convert(convertReqVO));
}
@PostMapping("/batch-convert")
@Operation(summary = "批量单位转换")
@PreAuthorize("@ss.hasPermission('unitmanagement:unit-conversion:query')")
public CommonResult<BatchUnitConvertRespVO> batchConvert(@Valid @RequestBody BatchUnitConvertReqVO batchReqVO) {
return success(unitConversionService.batchConvert(batchReqVO));
}
@PostMapping("/convert-by-symbol")
@Operation(summary = "按单位符号转换")
@PreAuthorize("@ss.hasPermission('unitmanagement:unit-conversion:query')")
public CommonResult<UnitConvertRespVO> convertBySymbol(@Valid @RequestBody UnitConvertBySymbolReqVO reqVO) {
return success(unitConversionService.convertBySymbol(reqVO));
}
@PostMapping("/convert-by-name")
@Operation(summary = "按单位名称转换")
@PreAuthorize("@ss.hasPermission('unitmanagement:unit-conversion:query')")
public CommonResult<UnitConvertRespVO> convertByName(@Valid @RequestBody UnitConvertByNameReqVO reqVO) {
return success(unitConversionService.convertByName(reqVO));
}
@PostMapping("/batch-convert-by-symbol")
@Operation(summary = "批量按单位符号转换")
@PreAuthorize("@ss.hasPermission('unitmanagement:unit-conversion:query')")
public CommonResult<BatchUnitConvertRespVO> batchConvertBySymbol(@Valid @RequestBody BatchUnitConvertBySymbolReqVO reqVO) {
return success(unitConversionService.batchConvertBySymbol(reqVO));
}
@PostMapping("/batch-convert-by-name")
@Operation(summary = "批量按单位名称转换")
@PreAuthorize("@ss.hasPermission('unitmanagement:unit-conversion:query')")
public CommonResult<BatchUnitConvertRespVO> batchConvertByName(@Valid @RequestBody BatchUnitConvertByNameReqVO reqVO) {
return success(unitConversionService.batchConvertByName(reqVO));
}
@GetMapping("/validate-paths")
@Operation(summary = "校验量纲的转换路径")
@Parameter(name = "quantityId", description = "量纲ID", required = true, example = "1")
@PreAuthorize("@ss.hasPermission('unitmanagement:unit-conversion:query')")
public CommonResult<UnitConversionValidationRespVO> validateConversionPaths(@RequestParam("quantityId") Long quantityId) {
return success(unitConversionService.validateConversionPaths(quantityId));
}
} }

View File

@@ -0,0 +1,33 @@
package com.zt.plat.module.base.controller.admin.unitConversion.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotEmpty;
import java.math.BigDecimal;
import java.util.List;
@Schema(description = "管理后台 - 批量按名称单位转换 Request VO")
@Data
public class BatchUnitConvertByNameReqVO {
@Schema(description = "源单位名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "千克")
@NotBlank(message = "源单位名称不能为空")
private String srcUnitName;
@Schema(description = "目标单位名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "")
@NotBlank(message = "目标单位名称不能为空")
private String tgtUnitName;
@Schema(description = "待转换的值列表", requiredMode = Schema.RequiredMode.REQUIRED)
@NotEmpty(message = "待转换的值列表不能为空")
private List<BigDecimal> values;
@Schema(description = "精度(小数位数)", example = "6")
private Integer precision = 6;
@Schema(description = "是否忽略错误(true:遇到错误继续执行, false:遇到错误立即停止)", example = "false")
private Boolean ignoreErrors = false;
}

View File

@@ -0,0 +1,33 @@
package com.zt.plat.module.base.controller.admin.unitConversion.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotEmpty;
import java.math.BigDecimal;
import java.util.List;
@Schema(description = "管理后台 - 批量按符号单位转换 Request VO")
@Data
public class BatchUnitConvertBySymbolReqVO {
@Schema(description = "源单位符号", requiredMode = Schema.RequiredMode.REQUIRED, example = "m")
@NotBlank(message = "源单位符号不能为空")
private String srcUnitSymbol;
@Schema(description = "目标单位符号", requiredMode = Schema.RequiredMode.REQUIRED, example = "km")
@NotBlank(message = "目标单位符号不能为空")
private String tgtUnitSymbol;
@Schema(description = "待转换的值列表", requiredMode = Schema.RequiredMode.REQUIRED)
@NotEmpty(message = "待转换的值列表不能为空")
private List<BigDecimal> values;
@Schema(description = "精度(小数位数)", example = "6")
private Integer precision = 6;
@Schema(description = "是否忽略错误(true:遇到错误继续执行, false:遇到错误立即停止)", example = "false")
private Boolean ignoreErrors = false;
}

View File

@@ -0,0 +1,19 @@
package com.zt.plat.module.base.controller.admin.unitConversion.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.NotEmpty;
import java.util.List;
@Schema(description = "管理后台 - 批量单位转换 Request VO")
@Data
public class BatchUnitConvertReqVO {
@Schema(description = "转换项列表", requiredMode = Schema.RequiredMode.REQUIRED)
@NotEmpty(message = "转换项列表不能为空")
private List<UnitConvertReqVO> items;
@Schema(description = "是否忽略错误(true:遇到错误继续执行, false:遇到错误立即停止)", example = "false")
private Boolean ignoreErrors = false;
}

View File

@@ -0,0 +1,42 @@
package com.zt.plat.module.base.controller.admin.unitConversion.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.Builder;
import java.util.List;
@Schema(description = "管理后台 - 批量单位转换 Response VO")
@Data
@Builder
public class BatchUnitConvertRespVO {
@Schema(description = "转换结果列表")
private List<UnitConvertResultItem> results;
@Schema(description = "成功数量", example = "10")
private Integer successCount;
@Schema(description = "失败数量", example = "0")
private Integer failureCount;
@Schema(description = "总数量", example = "10")
private Integer totalCount;
@Schema(description = "转换结果项")
@Data
@Builder
public static class UnitConvertResultItem {
@Schema(description = "是否成功", example = "true")
private Boolean success;
@Schema(description = "转换结果(成功时返回)")
private UnitConvertRespVO data;
@Schema(description = "错误信息(失败时返回)", example = "找不到转换规则")
private String errorMessage;
@Schema(description = "原始请求")
private UnitConvertReqVO request;
}
}

View File

@@ -1,4 +1,4 @@
package com.zt.plat.module.unitmanagement.controller.admin.UnitConversion.vo; package com.zt.plat.module.base.controller.admin.unitConversion.vo;
import lombok.*; import lombok.*;
import java.util.*; import java.util.*;
@@ -14,6 +14,9 @@ import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH
@Data @Data
public class UnitConversionPageReqVO extends PageParam { public class UnitConversionPageReqVO extends PageParam {
@Schema(description = "计量单位量ID(量纲ID)", example = "1")
private Long untQtyId;
@Schema(description = "源单位ID", example = "26239") @Schema(description = "源单位ID", example = "26239")
private Long srcUntId; private Long srcUntId;

View File

@@ -1,4 +1,4 @@
package com.zt.plat.module.unitmanagement.controller.admin.UnitConversion.vo; package com.zt.plat.module.base.controller.admin.unitConversion.vo;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*; import lombok.*;

View File

@@ -1,4 +1,4 @@
package com.zt.plat.module.unitmanagement.controller.admin.UnitConversion.vo; package com.zt.plat.module.base.controller.admin.unitConversion.vo;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*; import lombok.*;
@@ -13,6 +13,10 @@ public class UnitConversionSaveReqVO {
@Schema(description = "主键ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "339") @Schema(description = "主键ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "339")
private Long id; private Long id;
@Schema(description = "计量单位量ID(量纲ID)", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@NotNull(message = "量纲ID不能为空")
private Long untQtyId;
@Schema(description = "源单位ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "26239") @Schema(description = "源单位ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "26239")
@NotNull(message = "源单位ID不能为空") @NotNull(message = "源单位ID不能为空")
private Long srcUntId; private Long srcUntId;

View File

@@ -0,0 +1,110 @@
package com.zt.plat.module.base.controller.admin.unitConversion.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.List;
@Schema(description = "管理后台 - 单位转换路径校验响应 VO")
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class UnitConversionValidationRespVO {
@Schema(description = "量纲ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
private Long quantityId;
@Schema(description = "量纲名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "长度")
private String quantityName;
@Schema(description = "量纲符号", example = "L")
private String quantitySymbol;
@Schema(description = "总单位数", requiredMode = Schema.RequiredMode.REQUIRED, example = "8")
private Integer totalUnits;
@Schema(description = "可转换单位数", requiredMode = Schema.RequiredMode.REQUIRED, example = "8")
private Integer convertibleUnits;
@Schema(description = "不可转换单位数", requiredMode = Schema.RequiredMode.REQUIRED, example = "0")
private Integer unconvertibleUnits;
@Schema(description = "是否全部可转换", requiredMode = Schema.RequiredMode.REQUIRED, example = "true")
private Boolean allConvertible;
@Schema(description = "基准单位信息")
private BaseUnitInfo baseUnit;
@Schema(description = "不可转换的单位列表")
private List<UnconvertibleUnitInfo> unconvertibleUnitList;
@Schema(description = "转换路径详情")
private List<ConversionPathInfo> conversionPaths;
@Schema(description = "基准单位信息")
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public static class BaseUnitInfo {
@Schema(description = "单位ID", example = "1")
private Long unitId;
@Schema(description = "单位名称", example = "")
private String unitName;
@Schema(description = "单位符号", example = "m")
private String unitSymbol;
}
@Schema(description = "不可转换单位信息")
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public static class UnconvertibleUnitInfo {
@Schema(description = "单位ID", example = "1")
private Long unitId;
@Schema(description = "单位名称", example = "光年")
private String unitName;
@Schema(description = "单位符号", example = "ly")
private String unitSymbol;
@Schema(description = "原因", example = "缺少到基准单位的转换规则")
private String reason;
}
@Schema(description = "转换路径信息")
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public static class ConversionPathInfo {
@Schema(description = "源单位ID", example = "1")
private Long srcUnitId;
@Schema(description = "源单位名称", example = "千米")
private String srcUnitName;
@Schema(description = "目标单位ID", example = "2")
private Long tgtUnitId;
@Schema(description = "目标单位名称", example = "")
private String tgtUnitName;
@Schema(description = "是否有直接转换", example = "true")
private Boolean hasDirect;
@Schema(description = "是否可通过基准单位转换", example = "true")
private Boolean hasViaBase;
@Schema(description = "转换路径描述", example = "千米 → 米 (直接转换)")
private String pathDescription;
}
}

View File

@@ -0,0 +1,28 @@
package com.zt.plat.module.base.controller.admin.unitConversion.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.NotBlank;
import java.math.BigDecimal;
@Schema(description = "管理后台 - 按名称单位转换 Request VO")
@Data
public class UnitConvertByNameReqVO {
@Schema(description = "源单位名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "千克")
@NotBlank(message = "源单位名称不能为空")
private String srcUnitName;
@Schema(description = "目标单位名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "")
@NotBlank(message = "目标单位名称不能为空")
private String tgtUnitName;
@Schema(description = "待转换的值", requiredMode = Schema.RequiredMode.REQUIRED, example = "1000")
@NotNull(message = "待转换的值不能为空")
private BigDecimal value;
@Schema(description = "精度(小数位数)", example = "6")
private Integer precision = 6;
}

View File

@@ -0,0 +1,28 @@
package com.zt.plat.module.base.controller.admin.unitConversion.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.NotBlank;
import java.math.BigDecimal;
@Schema(description = "管理后台 - 按符号单位转换 Request VO")
@Data
public class UnitConvertBySymbolReqVO {
@Schema(description = "源单位符号", requiredMode = Schema.RequiredMode.REQUIRED, example = "kg")
@NotBlank(message = "源单位符号不能为空")
private String srcUnitSymbol;
@Schema(description = "目标单位符号", requiredMode = Schema.RequiredMode.REQUIRED, example = "t")
@NotBlank(message = "目标单位符号不能为空")
private String tgtUnitSymbol;
@Schema(description = "待转换的值", requiredMode = Schema.RequiredMode.REQUIRED, example = "1000")
@NotNull(message = "待转换的值不能为空")
private BigDecimal value;
@Schema(description = "精度(小数位数)", example = "6")
private Integer precision = 6;
}

View File

@@ -0,0 +1,26 @@
package com.zt.plat.module.base.controller.admin.unitConversion.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import jakarta.validation.constraints.NotNull;
import java.math.BigDecimal;
@Schema(description = "管理后台 - 单位转换 Request VO")
@Data
public class UnitConvertReqVO {
@Schema(description = "源单位ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@NotNull(message = "源单位ID不能为空")
private Long srcUntId;
@Schema(description = "目标单位ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
@NotNull(message = "目标单位ID不能为空")
private Long tgtUntId;
@Schema(description = "待转换的值", requiredMode = Schema.RequiredMode.REQUIRED, example = "100")
@NotNull(message = "待转换的值不能为空")
private BigDecimal value;
@Schema(description = "精度(小数位数)", example = "6")
private Integer precision = 6;
}

View File

@@ -0,0 +1,45 @@
package com.zt.plat.module.base.controller.admin.unitConversion.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.Builder;
import java.math.BigDecimal;
@Schema(description = "管理后台 - 单位转换 Response VO")
@Data
@Builder
public class UnitConvertRespVO {
@Schema(description = "源单位ID", example = "1")
private Long srcUntId;
@Schema(description = "源单位名称", example = "")
private String srcUntName;
@Schema(description = "源单位符号", example = "m")
private String srcUntSmb;
@Schema(description = "目标单位ID", example = "2")
private Long tgtUntId;
@Schema(description = "目标单位名称", example = "千米")
private String tgtUntName;
@Schema(description = "目标单位符号", example = "km")
private String tgtUntSmb;
@Schema(description = "原始值", example = "1000")
private BigDecimal originalValue;
@Schema(description = "转换后的值", example = "1")
private BigDecimal convertedValue;
@Schema(description = "转换因子", example = "0.001")
private BigDecimal factor;
@Schema(description = "转换公式", example = "1000m = 1km")
private String formula;
@Schema(description = "转换策略", example = "DIRECT")
private String strategy;
}

View File

@@ -1,4 +1,4 @@
package com.zt.plat.module.unitmanagement.controller.admin.UnitQuantity; package com.zt.plat.module.base.controller.admin.unitQuantity;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import jakarta.annotation.Resource; import jakarta.annotation.Resource;
@@ -10,7 +10,6 @@ import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import jakarta.validation.constraints.*;
import jakarta.validation.*; import jakarta.validation.*;
import jakarta.servlet.http.*; import jakarta.servlet.http.*;
import java.util.*; import java.util.*;
@@ -28,9 +27,9 @@ import com.zt.plat.framework.excel.core.util.ExcelUtils;
import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog; import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog;
import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*; import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*;
import com.zt.plat.module.unitmanagement.controller.admin.UnitQuantity.vo.*; import com.zt.plat.module.base.controller.admin.unitQuantity.vo.*;
import com.zt.plat.module.unitmanagement.dal.dataobject.UnitQuantity.UnitQuantityDO; import com.zt.plat.module.base.dal.dataobject.unitQuantity.UnitQuantityDO;
import com.zt.plat.module.unitmanagement.service.UnitQuantity.UnitQuantityService; import com.zt.plat.module.base.service.unitQuantity.UnitQuantityService;
@Tag(name = "管理后台 - 计量单位量") @Tag(name = "管理后台 - 计量单位量")
@RestController @RestController
@@ -105,4 +104,11 @@ public class UnitQuantityController implements BusinessControllerMarker {
BeanUtils.toBean(list, UnitQuantityRespVO.class)); BeanUtils.toBean(list, UnitQuantityRespVO.class));
} }
@GetMapping("/tree")
@Operation(summary = "获取量纲及单位树")
@PreAuthorize("@ss.hasPermission('unitmanagement:unit-quantity:query')")
public CommonResult<List<UnitQuantityTreeRespVO>> getUnitQuantityTree() {
return success(unitQuantityService.getUnitQuantityTree());
}
} }

View File

@@ -1,4 +1,4 @@
package com.zt.plat.module.unitmanagement.controller.admin.UnitQuantity.vo; package com.zt.plat.module.base.controller.admin.unitQuantity.vo;
import lombok.*; import lombok.*;
import java.util.*; import java.util.*;

View File

@@ -1,4 +1,4 @@
package com.zt.plat.module.unitmanagement.controller.admin.UnitQuantity.vo; package com.zt.plat.module.base.controller.admin.unitQuantity.vo;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*; import lombok.*;

View File

@@ -1,4 +1,4 @@
package com.zt.plat.module.unitmanagement.controller.admin.UnitQuantity.vo; package com.zt.plat.module.base.controller.admin.unitQuantity.vo;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*; import lombok.*;

View File

@@ -0,0 +1,45 @@
package com.zt.plat.module.base.controller.admin.unitQuantity.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.util.List;
@Schema(description = "管理后台 - 量纲及单位树 Response VO")
@Data
public class UnitQuantityTreeRespVO {
@Schema(description = "量纲ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
private Long id;
@Schema(description = "量纲名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "长度")
private String name;
@Schema(description = "量纲符号", requiredMode = Schema.RequiredMode.REQUIRED, example = "L")
private String symbol;
@Schema(description = "量纲描述", example = "用于测量物体长短、距离的物理量")
private String dsp;
@Schema(description = "下属单位列表")
private List<UnitItemVO> units;
@Schema(description = "单位项")
@Data
public static class UnitItemVO {
@Schema(description = "单位ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
private Long id;
@Schema(description = "单位名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "")
private String name;
@Schema(description = "单位符号", requiredMode = Schema.RequiredMode.REQUIRED, example = "m")
private String smb;
@Schema(description = "是否基准单位", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
private Integer isBse;
@Schema(description = "关联关系ID", example = "1")
private Long relationId;
}
}

View File

@@ -1,4 +1,4 @@
package com.zt.plat.module.unitmanagement.controller.admin.UntInfo; package com.zt.plat.module.base.controller.admin.untInfo;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import jakarta.annotation.Resource; import jakarta.annotation.Resource;
@@ -10,7 +10,6 @@ import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import jakarta.validation.constraints.*;
import jakarta.validation.*; import jakarta.validation.*;
import jakarta.servlet.http.*; import jakarta.servlet.http.*;
import java.util.*; import java.util.*;
@@ -28,9 +27,9 @@ import com.zt.plat.framework.excel.core.util.ExcelUtils;
import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog; import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog;
import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*; import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*;
import com.zt.plat.module.unitmanagement.controller.admin.UntInfo.vo.*; import com.zt.plat.module.base.controller.admin.untInfo.vo.*;
import com.zt.plat.module.unitmanagement.dal.dataobject.UntInfo.UntInfoDO; import com.zt.plat.module.base.dal.dataobject.untInfo.UntInfoDO;
import com.zt.plat.module.unitmanagement.service.UntInfo.UntInfoService; import com.zt.plat.module.base.service.untInfo.UntInfoService;
@Tag(name = "管理后台 - 计量单位") @Tag(name = "管理后台 - 计量单位")
@RestController @RestController

View File

@@ -1,4 +1,4 @@
package com.zt.plat.module.unitmanagement.controller.admin.UntInfo.vo; package com.zt.plat.module.base.controller.admin.untInfo.vo;
import lombok.*; import lombok.*;
import java.util.*; import java.util.*;

View File

@@ -1,4 +1,4 @@
package com.zt.plat.module.unitmanagement.controller.admin.UntInfo.vo; package com.zt.plat.module.base.controller.admin.untInfo.vo;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*; import lombok.*;

View File

@@ -1,4 +1,4 @@
package com.zt.plat.module.unitmanagement.controller.admin.UntInfo.vo; package com.zt.plat.module.base.controller.admin.untInfo.vo;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*; import lombok.*;

View File

@@ -0,0 +1,30 @@
package com.zt.plat.module.base.convert.doctemplate;
import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.module.base.controller.admin.doctemplate.vo.DocTemplateCategoryRespVO;
import com.zt.plat.module.base.controller.admin.doctemplate.vo.DocTemplateCategorySaveReqVO;
import com.zt.plat.module.base.dal.dataobject.doctemplate.DocTemplateCategoryDO;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;
import java.util.List;
/**
* 模板分类 Convert
*
* @author 系统生成
*/
@Mapper
public interface DocTemplateCategoryConvert {
DocTemplateCategoryConvert INSTANCE = Mappers.getMapper(DocTemplateCategoryConvert.class);
DocTemplateCategoryDO convert(DocTemplateCategorySaveReqVO bean);
DocTemplateCategoryRespVO convert(DocTemplateCategoryDO bean);
List<DocTemplateCategoryRespVO> convertList(List<DocTemplateCategoryDO> list);
PageResult<DocTemplateCategoryRespVO> convertPage(PageResult<DocTemplateCategoryDO> page);
}

View File

@@ -0,0 +1,30 @@
package com.zt.plat.module.base.convert.doctemplate;
import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.module.base.controller.admin.doctemplate.vo.DocTemplateRespVO;
import com.zt.plat.module.base.controller.admin.doctemplate.vo.DocTemplateSaveReqVO;
import com.zt.plat.module.base.dal.dataobject.doctemplate.DocTemplateDO;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;
import java.util.List;
/**
* 模板 Convert
*
* @author 系统生成
*/
@Mapper
public interface DocTemplateConvert {
DocTemplateConvert INSTANCE = Mappers.getMapper(DocTemplateConvert.class);
DocTemplateDO convert(DocTemplateSaveReqVO bean);
DocTemplateRespVO convert(DocTemplateDO bean);
List<DocTemplateRespVO> convertList(List<DocTemplateDO> list);
PageResult<DocTemplateRespVO> convertPage(PageResult<DocTemplateDO> page);
}

Some files were not shown because too many files have changed in this diff Show More