1. 新增物料相关接口

2. 修复部分服务因为包名设置错误导致无法采集日志的错误
This commit is contained in:
chenbowen
2025-11-06 13:41:56 +08:00
parent 8acfaffb62
commit 1282ef43cc
36 changed files with 1896 additions and 4 deletions

View File

@@ -0,0 +1,60 @@
package com.zt.plat.module.base.api.businessdictionarytype;
import com.zt.plat.framework.common.pojo.CommonResult;
import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.module.base.api.businessdictionarytype.dto.BusinessDictionaryDataDTO;
import com.zt.plat.module.base.api.businessdictionarytype.dto.BusinessDictionaryTypePageReqDTO;
import com.zt.plat.module.base.api.businessdictionarytype.dto.BusinessDictionaryTypeRespDTO;
import com.zt.plat.module.base.api.businessdictionarytype.dto.BusinessDictionaryTypeSaveReqDTO;
import com.zt.plat.module.base.enums.ApiConstants;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
@FeignClient(name = ApiConstants.NAME)
@Tag(name = "RPC 服务 - 业务字典类型")
public interface BusinessDictionaryTypeApi {
String PREFIX = ApiConstants.PREFIX + "/business-dictionary-type";
@PostMapping(PREFIX + "/create")
@Operation(summary = "创建业务字典类型")
CommonResult<BusinessDictionaryTypeRespDTO> createBusinessDictionaryType(@Valid @RequestBody BusinessDictionaryTypeSaveReqDTO createReqDTO);
@PutMapping(PREFIX + "/update")
@Operation(summary = "更新业务字典类型")
CommonResult<Boolean> updateBusinessDictionaryType(@Valid @RequestBody BusinessDictionaryTypeSaveReqDTO updateReqDTO);
@DeleteMapping(PREFIX + "/delete")
@Operation(summary = "删除业务字典类型")
CommonResult<Boolean> deleteBusinessDictionaryType(@RequestParam("id") Long id);
@DeleteMapping(PREFIX + "/delete-list")
@Operation(summary = "批量删除业务字典类型")
CommonResult<Boolean> deleteBusinessDictionaryTypeList(@RequestBody List<Long> ids);
@GetMapping(PREFIX + "/get")
@Operation(summary = "获得业务字典类型")
CommonResult<BusinessDictionaryTypeRespDTO> getBusinessDictionaryType(@RequestParam("id") Long id);
@GetMapping(PREFIX + "/page")
@Operation(summary = "获得业务字典类型分页")
CommonResult<PageResult<BusinessDictionaryTypeRespDTO>> getBusinessDictionaryTypePage(@Valid BusinessDictionaryTypePageReqDTO pageReqDTO);
@GetMapping(PREFIX + "/business-dictionary-data/list-by-dictionary-type-id")
@Operation(summary = "获得业务字典数据列表")
CommonResult<List<BusinessDictionaryDataDTO>> getBusinessDictionaryDataListByDictionaryTypeId(@RequestParam("dictionaryTypeId") Long dictionaryTypeId);
@GetMapping(PREFIX + "/business-dictionary-data/list-by-type")
@Operation(summary = "根据字典类型编码获取业务字典数据列表")
CommonResult<List<BusinessDictionaryDataDTO>> getBusinessDictionaryDataListByType(@RequestParam("type") String type);
}

View File

@@ -0,0 +1,35 @@
package com.zt.plat.module.base.api.businessdictionarytype.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
/**
* 业务字典数据 DTO
*/
@Data
public class BusinessDictionaryDataDTO {
@Schema(description = "主键ID", example = "1001")
private Long id;
@Schema(description = "上级字典", example = "2001")
private Long parentId;
@Schema(description = "字典类型", example = "3001")
private Long dictionaryTypeId;
@Schema(description = "排序号", example = "10")
private Long sort;
@Schema(description = "字典标签", example = "状态")
private String label;
@Schema(description = "字典值", example = "ENABLE")
private String value;
@Schema(description = "状态(0正常 1停用)", example = "0")
private Long status;
@Schema(description = "备注", example = "同义词")
private String remark;
}

View File

@@ -0,0 +1,21 @@
package com.zt.plat.module.base.api.businessdictionarytype.dto;
import com.zt.plat.framework.common.pojo.PageParam;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
/**
* 业务字典类型分页 Request DTO
*/
@Data
public class BusinessDictionaryTypePageReqDTO extends PageParam {
@Schema(description = "字典名称", example = "物料状态")
private String name;
@Schema(description = "字典类型", example = "base_material_status")
private String type;
@Schema(description = "状态(0正常 1停用)", example = "0")
private Long status;
}

View File

@@ -0,0 +1,31 @@
package com.zt.plat.module.base.api.businessdictionarytype.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.time.LocalDateTime;
/**
* 业务字典类型 Response DTO
*/
@Data
public class BusinessDictionaryTypeRespDTO {
@Schema(description = "主键ID", example = "11771")
private Long id;
@Schema(description = "字典名称", example = "物料状态")
private String name;
@Schema(description = "字典类型", example = "base_material_status")
private String type;
@Schema(description = "状态(0正常 1停用)", example = "0")
private Long status;
@Schema(description = "备注", example = "基础物料状态")
private String remark;
@Schema(description = "创建时间")
private LocalDateTime createTime;
}

View File

@@ -0,0 +1,38 @@
package com.zt.plat.module.base.api.businessdictionarytype.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotEmpty;
import lombok.Data;
import java.time.LocalDateTime;
import java.util.List;
/**
* 业务字典类型新增/修改 Request DTO
*/
@Data
public class BusinessDictionaryTypeSaveReqDTO {
@Schema(description = "主键ID", example = "11771")
private Long id;
@Schema(description = "字典名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "物料状态")
@NotEmpty(message = "字典名称不能为空")
private String name;
@Schema(description = "字典类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "base_material_status")
@NotEmpty(message = "字典类型不能为空")
private String type;
@Schema(description = "状态(0正常 1停用)", example = "0")
private Long status;
@Schema(description = "备注", example = "基础物料状态")
private String remark;
@Schema(description = "删除时间")
private LocalDateTime delTime;
@Schema(description = "业务字典数据列表")
private List<BusinessDictionaryDataDTO> businessDictionaryDatas;
}

View File

@@ -0,0 +1,51 @@
package com.zt.plat.module.base.api.departmentmaterial;
import com.zt.plat.framework.common.pojo.CommonResult;
import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.module.base.api.departmentmaterial.dto.DepartmentMaterialPageReqDTO;
import com.zt.plat.module.base.api.departmentmaterial.dto.DepartmentMaterialRespDTO;
import com.zt.plat.module.base.api.departmentmaterial.dto.DepartmentMaterialSaveReqDTO;
import com.zt.plat.module.base.enums.ApiConstants;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
@FeignClient(name = ApiConstants.NAME)
@Tag(name = "RPC 服务 - 组织架构物料")
public interface DepartmentMaterialApi {
String PREFIX = ApiConstants.PREFIX + "/department-material";
@PostMapping(PREFIX + "/create")
@Operation(summary = "创建组织架构物料")
CommonResult<DepartmentMaterialRespDTO> createDepartmentMaterial(@Valid @RequestBody DepartmentMaterialSaveReqDTO createReqDTO);
@PutMapping(PREFIX + "/update")
@Operation(summary = "更新组织架构物料")
CommonResult<Boolean> updateDepartmentMaterial(@Valid @RequestBody DepartmentMaterialSaveReqDTO updateReqDTO);
@DeleteMapping(PREFIX + "/delete")
@Operation(summary = "删除组织架构物料")
CommonResult<Boolean> deleteDepartmentMaterial(@RequestParam("id") Long id);
@DeleteMapping(PREFIX + "/delete-list")
@Operation(summary = "批量删除组织架构物料")
CommonResult<Boolean> deleteDepartmentMaterialList(@RequestBody List<Long> ids);
@GetMapping(PREFIX + "/get")
@Operation(summary = "获得组织架构物料")
CommonResult<DepartmentMaterialRespDTO> getDepartmentMaterial(@RequestParam("id") Long id);
@GetMapping(PREFIX + "/page")
@Operation(summary = "获得组织架构物料分页")
CommonResult<PageResult<DepartmentMaterialRespDTO>> getDepartmentMaterialPage(@Valid DepartmentMaterialPageReqDTO pageReqDTO);
}

View File

@@ -0,0 +1,49 @@
package com.zt.plat.module.base.api.departmentmaterial.dto;
import com.zt.plat.framework.common.pojo.PageParam;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import java.util.List;
import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
/**
* 组织架构物料分页 Request DTO
*/
@Data
public class DepartmentMaterialPageReqDTO 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 status;
@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,61 @@
package com.zt.plat.module.base.api.departmentmaterial.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.time.LocalDateTime;
/**
* 组织架构物料 Response DTO
*/
@Data
public class DepartmentMaterialRespDTO {
@Schema(description = "主键ID", example = "5674")
private Long id;
@Schema(description = "物料信息ID", example = "3923")
private Long infomationId;
@Schema(description = "物料分类ID", example = "30114")
private Long classesId;
@Schema(description = "字典数据值-物料类型")
private String dictionaryDataValue;
@Schema(description = "备注")
private String remark;
@Schema(description = "创建时间")
private LocalDateTime createTime;
@Schema(description = "部门ID")
private Long deptId;
@Schema(description = "部门名称")
private String deptName;
@Schema(description = "物料编码")
private String materialNumber;
@Schema(description = "物料名称")
private String materialName;
@Schema(description = "物料大类名称")
private String categoryLargeName;
@Schema(description = "物料中类名称")
private String categoryMediumName;
@Schema(description = "物料小类名称")
private String categorySmallName;
@Schema(description = "物料分类路径")
private String categoryPath;
@Schema(description = "组织物料类型名称")
private String dictionaryDataLabel;
@Schema(description = "状态编码")
private String status;
}

View File

@@ -0,0 +1,39 @@
package com.zt.plat.module.base.api.departmentmaterial.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
/**
* 组织架构物料新增/修改 Request DTO
*/
@Data
public class DepartmentMaterialSaveReqDTO {
@Schema(description = "主键ID", example = "5674")
private Long id;
@Schema(description = "部门ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1001")
@NotNull(message = "部门ID不能为空")
private Long deptId;
@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, example = "1")
@NotEmpty(message = "状态不能为空")
private String status;
@Schema(description = "备注", requiredMode = Schema.RequiredMode.REQUIRED)
@NotEmpty(message = "备注不能为空")
private String remark;
}

View File

@@ -0,0 +1,56 @@
package com.zt.plat.module.base.api.materialclasses;
import com.zt.plat.framework.common.pojo.CommonResult;
import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.module.base.api.materialclasses.dto.MaterialClassesPageReqDTO;
import com.zt.plat.module.base.api.materialclasses.dto.MaterialClassesRespDTO;
import com.zt.plat.module.base.api.materialclasses.dto.MaterialClassesSaveReqDTO;
import com.zt.plat.module.base.api.materialclasses.dto.MaterialClassesTreeRespDTO;
import com.zt.plat.module.base.enums.ApiConstants;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
@FeignClient(name = ApiConstants.NAME)
@Tag(name = "RPC 服务 - 物料分类")
public interface MaterialClassesApi {
String PREFIX = ApiConstants.PREFIX + "/material-classes";
@PostMapping(PREFIX + "/create")
@Operation(summary = "创建物料分类")
CommonResult<MaterialClassesRespDTO> createMaterialClasses(@Valid @RequestBody MaterialClassesSaveReqDTO createReqDTO);
@PutMapping(PREFIX + "/update")
@Operation(summary = "更新物料分类")
CommonResult<Boolean> updateMaterialClasses(@Valid @RequestBody MaterialClassesSaveReqDTO updateReqDTO);
@DeleteMapping(PREFIX + "/delete")
@Operation(summary = "删除物料分类")
CommonResult<Boolean> deleteMaterialClasses(@RequestParam("id") Long id);
@DeleteMapping(PREFIX + "/delete-list")
@Operation(summary = "批量删除物料分类")
CommonResult<Boolean> deleteMaterialClassesList(@RequestBody List<Long> ids);
@GetMapping(PREFIX + "/get")
@Operation(summary = "获得物料分类")
CommonResult<MaterialClassesRespDTO> getMaterialClasses(@RequestParam("id") Long id);
@GetMapping(PREFIX + "/page")
@Operation(summary = "获得物料分类分页")
CommonResult<PageResult<MaterialClassesRespDTO>> getMaterialClassesPage(@Valid MaterialClassesPageReqDTO pageReqDTO);
@GetMapping(PREFIX + "/tree")
@Operation(summary = "获得物料分类树")
CommonResult<List<MaterialClassesTreeRespDTO>> getMaterialClassesTree();
}

View File

@@ -0,0 +1,36 @@
package com.zt.plat.module.base.api.materialclasses.dto;
import com.zt.plat.framework.common.pojo.PageParam;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
/**
* 物料分类分页 Request DTO
*/
@Data
public class MaterialClassesPageReqDTO 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,34 @@
package com.zt.plat.module.base.api.materialclasses.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.time.LocalDateTime;
/**
* 物料分类 Response DTO
*/
@Data
public class MaterialClassesRespDTO {
@Schema(description = "主键ID", example = "4051")
private Long id;
@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 = "创建时间")
private LocalDateTime createTime;
}

View File

@@ -0,0 +1,33 @@
package com.zt.plat.module.base.api.materialclasses.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotEmpty;
import lombok.Data;
/**
* 物料分类新增/修改 Request DTO
*/
@Data
public class MaterialClassesSaveReqDTO {
@Schema(description = "主键ID", 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,35 @@
package com.zt.plat.module.base.api.materialclasses.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.util.ArrayList;
import java.util.List;
/**
* 物料分类树 Response DTO
*/
@Data
public class MaterialClassesTreeRespDTO {
@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<MaterialClassesTreeRespDTO> children = new ArrayList<>();
}

View File

@@ -0,0 +1,51 @@
package com.zt.plat.module.base.api.materialhasclasses;
import com.zt.plat.framework.common.pojo.CommonResult;
import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.module.base.api.materialhasclasses.dto.MaterialHasClassesPageReqDTO;
import com.zt.plat.module.base.api.materialhasclasses.dto.MaterialHasClassesRespDTO;
import com.zt.plat.module.base.api.materialhasclasses.dto.MaterialHasClassesSaveReqDTO;
import com.zt.plat.module.base.enums.ApiConstants;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
@FeignClient(name = ApiConstants.NAME)
@Tag(name = "RPC 服务 - 物料持有分类")
public interface MaterialHasClassesApi {
String PREFIX = ApiConstants.PREFIX + "/material-has-classes";
@PostMapping(PREFIX + "/create")
@Operation(summary = "创建物料持有分类")
CommonResult<MaterialHasClassesRespDTO> createMaterialHasClasses(@Valid @RequestBody MaterialHasClassesSaveReqDTO createReqDTO);
@PutMapping(PREFIX + "/update")
@Operation(summary = "更新物料持有分类")
CommonResult<Boolean> updateMaterialHasClasses(@Valid @RequestBody MaterialHasClassesSaveReqDTO updateReqDTO);
@DeleteMapping(PREFIX + "/delete")
@Operation(summary = "删除物料持有分类")
CommonResult<Boolean> deleteMaterialHasClasses(@RequestParam("id") Long id);
@DeleteMapping(PREFIX + "/delete-list")
@Operation(summary = "批量删除物料持有分类")
CommonResult<Boolean> deleteMaterialHasClassesList(@RequestBody List<Long> ids);
@GetMapping(PREFIX + "/get")
@Operation(summary = "获得物料持有分类")
CommonResult<MaterialHasClassesRespDTO> getMaterialHasClasses(@RequestParam("id") Long id);
@GetMapping(PREFIX + "/page")
@Operation(summary = "获得物料持有分类分页")
CommonResult<PageResult<MaterialHasClassesRespDTO>> getMaterialHasClassesPage(@Valid MaterialHasClassesPageReqDTO pageReqDTO);
}

View File

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

View File

@@ -0,0 +1,25 @@
package com.zt.plat.module.base.api.materialhasclasses.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.time.LocalDateTime;
/**
* 物料持有分类 Response DTO
*/
@Data
public class MaterialHasClassesRespDTO {
@Schema(description = "主键ID", example = "16228")
private Long id;
@Schema(description = "物料信息ID", example = "31031")
private Long infomationId;
@Schema(description = "分类ID", example = "5914")
private Long classesId;
@Schema(description = "创建时间")
private LocalDateTime createTime;
}

View File

@@ -0,0 +1,23 @@
package com.zt.plat.module.base.api.materialhasclasses.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
/**
* 物料持有分类新增/修改 Request DTO
*/
@Data
public class MaterialHasClassesSaveReqDTO {
@Schema(description = "主键ID", 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,51 @@
package com.zt.plat.module.base.api.materialhasproperties;
import com.zt.plat.framework.common.pojo.CommonResult;
import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.module.base.api.materialhasproperties.dto.MaterialHasPropertiesPageReqDTO;
import com.zt.plat.module.base.api.materialhasproperties.dto.MaterialHasPropertiesRespDTO;
import com.zt.plat.module.base.api.materialhasproperties.dto.MaterialHasPropertiesSaveReqDTO;
import com.zt.plat.module.base.enums.ApiConstants;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
@FeignClient(name = ApiConstants.NAME)
@Tag(name = "RPC 服务 - 物料持有属性")
public interface MaterialHasPropertiesApi {
String PREFIX = ApiConstants.PREFIX + "/material-has-properties";
@PostMapping(PREFIX + "/create")
@Operation(summary = "创建物料持有属性")
CommonResult<MaterialHasPropertiesRespDTO> createMaterialHasProperties(@Valid @RequestBody MaterialHasPropertiesSaveReqDTO createReqDTO);
@PutMapping(PREFIX + "/update")
@Operation(summary = "更新物料持有属性")
CommonResult<Boolean> updateMaterialHasProperties(@Valid @RequestBody MaterialHasPropertiesSaveReqDTO updateReqDTO);
@DeleteMapping(PREFIX + "/delete")
@Operation(summary = "删除物料持有属性")
CommonResult<Boolean> deleteMaterialHasProperties(@RequestParam("id") Long id);
@DeleteMapping(PREFIX + "/delete-list")
@Operation(summary = "批量删除物料持有属性")
CommonResult<Boolean> deleteMaterialHasPropertiesList(@RequestBody List<Long> ids);
@GetMapping(PREFIX + "/get")
@Operation(summary = "获得物料持有属性")
CommonResult<MaterialHasPropertiesRespDTO> getMaterialHasProperties(@RequestParam("id") Long id);
@GetMapping(PREFIX + "/page")
@Operation(summary = "获得物料持有属性分页")
CommonResult<PageResult<MaterialHasPropertiesRespDTO>> getMaterialHasPropertiesPage(@Valid MaterialHasPropertiesPageReqDTO pageReqDTO);
}

View File

@@ -0,0 +1,42 @@
package com.zt.plat.module.base.api.materialhasproperties.dto;
import com.zt.plat.framework.common.pojo.PageParam;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
/**
* 物料持有属性分页 Request DTO
*/
@Data
public class MaterialHasPropertiesPageReqDTO 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,40 @@
package com.zt.plat.module.base.api.materialhasproperties.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.time.LocalDateTime;
/**
* 物料持有属性 Response DTO
*/
@Data
public class MaterialHasPropertiesRespDTO {
@Schema(description = "主键ID", example = "6800")
private Long id;
@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 = "创建时间")
private LocalDateTime createTime;
}

View File

@@ -0,0 +1,40 @@
package com.zt.plat.module.base.api.materialhasproperties.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
/**
* 物料持有属性新增/修改 Request DTO
*/
@Data
public class MaterialHasPropertiesSaveReqDTO {
@Schema(description = "主键ID", 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,57 @@
package com.zt.plat.module.base.api.materialproperties;
import com.zt.plat.framework.common.pojo.CommonResult;
import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.module.base.api.materialproperties.dto.MaterialPropertiesPageReqDTO;
import com.zt.plat.module.base.api.materialproperties.dto.MaterialPropertiesRespDTO;
import com.zt.plat.module.base.api.materialproperties.dto.MaterialPropertiesSaveReqDTO;
import com.zt.plat.module.base.api.materialproperties.dto.MaterialPropertiesSimplePageReqDTO;
import com.zt.plat.module.base.api.materialproperties.dto.MaterialPropertiesSimpleRespDTO;
import com.zt.plat.module.base.enums.ApiConstants;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
@FeignClient(name = ApiConstants.NAME)
@Tag(name = "RPC 服务 - 物料属性")
public interface MaterialPropertiesApi {
String PREFIX = ApiConstants.PREFIX + "/material-properties";
@PostMapping(PREFIX + "/create")
@Operation(summary = "创建物料属性")
CommonResult<MaterialPropertiesRespDTO> createMaterialProperties(@Valid @RequestBody MaterialPropertiesSaveReqDTO createReqDTO);
@PutMapping(PREFIX + "/update")
@Operation(summary = "更新物料属性")
CommonResult<Boolean> updateMaterialProperties(@Valid @RequestBody MaterialPropertiesSaveReqDTO updateReqDTO);
@DeleteMapping(PREFIX + "/delete")
@Operation(summary = "删除物料属性")
CommonResult<Boolean> deleteMaterialProperties(@RequestParam("id") Long id);
@DeleteMapping(PREFIX + "/delete-list")
@Operation(summary = "批量删除物料属性")
CommonResult<Boolean> deleteMaterialPropertiesList(@RequestBody List<Long> ids);
@GetMapping(PREFIX + "/get")
@Operation(summary = "获得物料属性")
CommonResult<MaterialPropertiesRespDTO> getMaterialProperties(@RequestParam("id") Long id);
@GetMapping(PREFIX + "/page")
@Operation(summary = "获得物料属性分页")
CommonResult<PageResult<MaterialPropertiesRespDTO>> getMaterialPropertiesPage(@Valid MaterialPropertiesPageReqDTO pageReqDTO);
@GetMapping(PREFIX + "/simple-page")
@Operation(summary = "获得物料属性精简分页")
CommonResult<PageResult<MaterialPropertiesSimpleRespDTO>> getMaterialPropertiesSimplePage(@Valid MaterialPropertiesSimplePageReqDTO pageReqDTO);
}

View File

@@ -0,0 +1,42 @@
package com.zt.plat.module.base.api.materialproperties.dto;
import com.zt.plat.framework.common.pojo.PageParam;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
/**
* 物料属性分页 Request DTO
*/
@Data
public class MaterialPropertiesPageReqDTO extends PageParam {
@Schema(description = "属性编码")
private String code;
@Schema(description = "属性名称", example = "含量")
private String name;
@Schema(description = "关键字(编码/名称模糊匹配)")
private String keyword;
@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,49 @@
package com.zt.plat.module.base.api.materialproperties.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.time.LocalDateTime;
/**
* 物料属性 Response DTO
*/
@Data
public class MaterialPropertiesRespDTO {
@Schema(description = "主键ID", example = "10591")
private Long id;
@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 = "属性类型名称")
private String dictionaryDataLabel;
@Schema(description = "数据类型", example = "1")
private String dataType;
@Schema(description = "备注")
private String remark;
@Schema(description = "量纲名称")
private String unitQuantityName;
@Schema(description = "计量单位名称")
private String unitName;
@Schema(description = "计量单位符号")
private String unitSymbol;
@Schema(description = "创建时间")
private LocalDateTime createTime;
}

View File

@@ -0,0 +1,38 @@
package com.zt.plat.module.base.api.materialproperties.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotEmpty;
import lombok.Data;
/**
* 物料属性新增/修改 Request DTO
*/
@Data
public class MaterialPropertiesSaveReqDTO {
@Schema(description = "主键ID", 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,18 @@
package com.zt.plat.module.base.api.materialproperties.dto;
import com.zt.plat.framework.common.pojo.PageParam;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
/**
* 物料属性精简分页 Request DTO
*/
@Data
public class MaterialPropertiesSimplePageReqDTO extends PageParam {
@Schema(description = "关键字(编码/名称模糊匹配)")
private String keyword;
@Schema(description = "属性类型")
private String dictionaryDataValue;
}

View File

@@ -0,0 +1,35 @@
package com.zt.plat.module.base.api.materialproperties.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
/**
* 物料属性精简 Response DTO
*/
@Data
public class MaterialPropertiesSimpleRespDTO {
@Schema(description = "物料属性ID", example = "1001")
private Long id;
@Schema(description = "属性编码")
private String code;
@Schema(description = "属性名称")
private String name;
@Schema(description = "数据类型")
private String dataType;
@Schema(description = "单位名称")
private String unitName;
@Schema(description = "单位符号")
private String unitSymbol;
@Schema(description = "属性类型")
private String dictionaryDataValue;
@Schema(description = "属性类型名称")
private String dictionaryDataLabel;
}