物料、工艺基本增删改查逻辑
This commit is contained in:
@@ -45,4 +45,16 @@ public interface ErrorCodeConstants {
|
||||
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, "工艺工序物料不存在");
|
||||
}
|
||||
|
||||
@@ -19,6 +19,9 @@ public class MaterialInfomationPageReqVO extends PageParam {
|
||||
@Schema(description = "物料名称", example = "张三")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "分类ID", example = "1024")
|
||||
private Long classesId;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
|
||||
|
||||
@@ -24,6 +24,10 @@ public class MaterialInfomationRespVO {
|
||||
@ExcelProperty("物料名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "分类ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
|
||||
@ExcelProperty("分类ID")
|
||||
private Long classesId;
|
||||
|
||||
@Schema(description = "备注", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.zt.plat.module.base.controller.admin.base.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
@Schema(description = "管理后台 - 物料信息新增/修改 Request VO")
|
||||
@@ -19,6 +20,10 @@ public class MaterialInfomationSaveReqVO {
|
||||
@NotEmpty(message = "物料名称不能为空")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "分类ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
|
||||
@NotNull(message = "所属分类不能为空")
|
||||
private Long classesId;
|
||||
|
||||
@Schema(description = "备注", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "备注不能为空")
|
||||
private String remark;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
}
|
||||
@@ -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<>();
|
||||
}
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
}
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
}
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
}
|
||||
@@ -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<>();
|
||||
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
}
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
}
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.zt.plat.module.base.dal.dao.departmentmaterial;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import com.zt.plat.module.base.dal.dataobject.departmentmaterial.DepartmentMaterialDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import com.zt.plat.module.base.controller.admin.departmentmaterial.vo.*;
|
||||
|
||||
/**
|
||||
* 组织架构物料 Mapper
|
||||
*
|
||||
* @author 后台管理-1
|
||||
*/
|
||||
@Mapper
|
||||
public interface DepartmentMaterialMapper extends BaseMapperX<DepartmentMaterialDO> {
|
||||
|
||||
default PageResult<DepartmentMaterialDO> selectPage(DepartmentMaterialPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<DepartmentMaterialDO>()
|
||||
.eqIfPresent(DepartmentMaterialDO::getInfomationId, reqVO.getInfomationId())
|
||||
.inIfPresent(DepartmentMaterialDO::getInfomationId, reqVO.getInfomationIds())
|
||||
.eqIfPresent(DepartmentMaterialDO::getClassesId, reqVO.getClassesId())
|
||||
.eqIfPresent(DepartmentMaterialDO::getDeptId, reqVO.getDeptId())
|
||||
.eqIfPresent(DepartmentMaterialDO::getDictionaryDataValue, reqVO.getDictionaryDataValue())
|
||||
.eqIfPresent(DepartmentMaterialDO::getRemark, reqVO.getRemark())
|
||||
.betweenIfPresent(DepartmentMaterialDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(DepartmentMaterialDO::getId));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.zt.plat.module.base.dal.dao.materialclasses;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import com.zt.plat.module.base.dal.dataobject.materialclasses.MaterialClassesDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import com.zt.plat.module.base.controller.admin.materialclasses.vo.*;
|
||||
|
||||
/**
|
||||
* 物料分类 Mapper
|
||||
*
|
||||
* @author 后台管理-1
|
||||
*/
|
||||
@Mapper
|
||||
public interface MaterialClassesMapper extends BaseMapperX<MaterialClassesDO> {
|
||||
|
||||
default PageResult<MaterialClassesDO> selectPage(MaterialClassesPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<MaterialClassesDO>()
|
||||
.eqIfPresent(MaterialClassesDO::getParentId, reqVO.getParentId())
|
||||
.eqIfPresent(MaterialClassesDO::getCode, reqVO.getCode())
|
||||
.likeIfPresent(MaterialClassesDO::getName, reqVO.getName())
|
||||
.eqIfPresent(MaterialClassesDO::getLevel, reqVO.getLevel())
|
||||
.eqIfPresent(MaterialClassesDO::getRemark, reqVO.getRemark())
|
||||
.betweenIfPresent(MaterialClassesDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(MaterialClassesDO::getId));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.zt.plat.module.base.dal.dao.materialhasclasses;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import com.zt.plat.module.base.dal.dataobject.materialhasclasses.MaterialHasClassesDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import com.zt.plat.module.base.controller.admin.materialhasclasses.vo.*;
|
||||
|
||||
/**
|
||||
* 物料持有分类 Mapper
|
||||
*
|
||||
* @author 后台管理-1
|
||||
*/
|
||||
@Mapper
|
||||
public interface MaterialHasClassesMapper extends BaseMapperX<MaterialHasClassesDO> {
|
||||
|
||||
default PageResult<MaterialHasClassesDO> selectPage(MaterialHasClassesPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<MaterialHasClassesDO>()
|
||||
.eqIfPresent(MaterialHasClassesDO::getInfomationId, reqVO.getInfomationId())
|
||||
.betweenIfPresent(MaterialHasClassesDO::getCreateTime, reqVO.getCreateTime())
|
||||
.eqIfPresent(MaterialHasClassesDO::getClassesId, reqVO.getClassesId())
|
||||
.orderByDesc(MaterialHasClassesDO::getId));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.zt.plat.module.base.dal.dao.materialhasproperties;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import com.zt.plat.module.base.dal.dataobject.materialhasproperties.MaterialHasPropertiesDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import com.zt.plat.module.base.controller.admin.materialhasproperties.vo.*;
|
||||
|
||||
/**
|
||||
* 物料持有属性 Mapper
|
||||
*
|
||||
* @author 后台管理-1
|
||||
*/
|
||||
@Mapper
|
||||
public interface MaterialHasPropertiesMapper extends BaseMapperX<MaterialHasPropertiesDO> {
|
||||
|
||||
default PageResult<MaterialHasPropertiesDO> selectPage(MaterialHasPropertiesPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<MaterialHasPropertiesDO>()
|
||||
.eqIfPresent(MaterialHasPropertiesDO::getInfomationId, reqVO.getInfomationId())
|
||||
.eqIfPresent(MaterialHasPropertiesDO::getPropertiesId, reqVO.getPropertiesId())
|
||||
.eqIfPresent(MaterialHasPropertiesDO::getUnitId, reqVO.getUnitId())
|
||||
.eqIfPresent(MaterialHasPropertiesDO::getValue, reqVO.getValue())
|
||||
.eqIfPresent(MaterialHasPropertiesDO::getIsKey, reqVO.getIsKey())
|
||||
.eqIfPresent(MaterialHasPropertiesDO::getIsMetering, reqVO.getIsMetering())
|
||||
.eqIfPresent(MaterialHasPropertiesDO::getSort, reqVO.getSort())
|
||||
.betweenIfPresent(MaterialHasPropertiesDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(MaterialHasPropertiesDO::getId));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.zt.plat.module.base.dal.dao.materialproperties;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import com.zt.plat.module.base.dal.dataobject.materialproperties.MaterialPropertiesDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import com.zt.plat.module.base.controller.admin.materialproperties.vo.*;
|
||||
|
||||
/**
|
||||
* 物料属性 Mapper
|
||||
*
|
||||
* @author 后台管理-1
|
||||
*/
|
||||
@Mapper
|
||||
public interface MaterialPropertiesMapper extends BaseMapperX<MaterialPropertiesDO> {
|
||||
|
||||
default PageResult<MaterialPropertiesDO> selectPage(MaterialPropertiesPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<MaterialPropertiesDO>()
|
||||
.eqIfPresent(MaterialPropertiesDO::getCode, reqVO.getCode())
|
||||
.likeIfPresent(MaterialPropertiesDO::getName, reqVO.getName())
|
||||
.eqIfPresent(MaterialPropertiesDO::getUnitQuantityId, reqVO.getUnitQuantityId())
|
||||
.eqIfPresent(MaterialPropertiesDO::getDictionaryDataValue, reqVO.getDictionaryDataValue())
|
||||
.eqIfPresent(MaterialPropertiesDO::getDataType, reqVO.getDataType())
|
||||
.eqIfPresent(MaterialPropertiesDO::getRemark, reqVO.getRemark())
|
||||
.betweenIfPresent(MaterialPropertiesDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(MaterialPropertiesDO::getId));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.zt.plat.module.base.dal.dao.processinginfomation;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import com.zt.plat.module.base.dal.dataobject.processinginfomation.ProcessingInfomationDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import com.zt.plat.module.base.controller.admin.processinginfomation.vo.*;
|
||||
|
||||
/**
|
||||
* 工艺信息 Mapper
|
||||
*
|
||||
* @author 后台管理-1
|
||||
*/
|
||||
@Mapper
|
||||
public interface ProcessingInfomationMapper extends BaseMapperX<ProcessingInfomationDO> {
|
||||
|
||||
default PageResult<ProcessingInfomationDO> selectPage(ProcessingInfomationPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<ProcessingInfomationDO>()
|
||||
.eqIfPresent(ProcessingInfomationDO::getParentId, reqVO.getParentId())
|
||||
.eqIfPresent(ProcessingInfomationDO::getCode, reqVO.getCode())
|
||||
.likeIfPresent(ProcessingInfomationDO::getName, reqVO.getName())
|
||||
.eqIfPresent(ProcessingInfomationDO::getTypeValue, reqVO.getTypeValue())
|
||||
.eqIfPresent(ProcessingInfomationDO::getStatusValue, reqVO.getStatusValue())
|
||||
.eqIfPresent(ProcessingInfomationDO::getDescription, reqVO.getDescription())
|
||||
.betweenIfPresent(ProcessingInfomationDO::getEffectiveDate, reqVO.getEffectiveDate())
|
||||
.betweenIfPresent(ProcessingInfomationDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(ProcessingInfomationDO::getId));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.zt.plat.module.base.dal.dao.processinginfomationoperation;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import com.zt.plat.module.base.dal.dataobject.processinginfomationoperation.ProcessingInfomationOperationDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import com.zt.plat.module.base.controller.admin.processinginfomationoperation.vo.*;
|
||||
|
||||
/**
|
||||
* 工艺工序 Mapper
|
||||
*
|
||||
* @author 后台管理-1
|
||||
*/
|
||||
@Mapper
|
||||
public interface ProcessingInfomationOperationMapper extends BaseMapperX<ProcessingInfomationOperationDO> {
|
||||
|
||||
default PageResult<ProcessingInfomationOperationDO> selectPage(ProcessingInfomationOperationPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<ProcessingInfomationOperationDO>()
|
||||
.eqIfPresent(ProcessingInfomationOperationDO::getPreviousOperationId, reqVO.getPreviousOperationId())
|
||||
.eqIfPresent(ProcessingInfomationOperationDO::getNextOperationId, reqVO.getNextOperationId())
|
||||
.eqIfPresent(ProcessingInfomationOperationDO::getProcessingId, reqVO.getProcessingId())
|
||||
.eqIfPresent(ProcessingInfomationOperationDO::getIsKey, reqVO.getIsKey())
|
||||
.eqIfPresent(ProcessingInfomationOperationDO::getRemark, reqVO.getRemark())
|
||||
.betweenIfPresent(ProcessingInfomationOperationDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(ProcessingInfomationOperationDO::getId));
|
||||
}
|
||||
|
||||
default List<ProcessingInfomationOperationDO> selectList(ProcessingInfomationOperationPageReqVO reqVO) {
|
||||
return selectList(new LambdaQueryWrapperX<ProcessingInfomationOperationDO>()
|
||||
.eqIfPresent(ProcessingInfomationOperationDO::getPreviousOperationId, reqVO.getPreviousOperationId())
|
||||
.eqIfPresent(ProcessingInfomationOperationDO::getNextOperationId, reqVO.getNextOperationId())
|
||||
.eqIfPresent(ProcessingInfomationOperationDO::getProcessingId, reqVO.getProcessingId())
|
||||
.eqIfPresent(ProcessingInfomationOperationDO::getIsKey, reqVO.getIsKey())
|
||||
.eqIfPresent(ProcessingInfomationOperationDO::getRemark, reqVO.getRemark())
|
||||
.betweenIfPresent(ProcessingInfomationOperationDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(ProcessingInfomationOperationDO::getId));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.zt.plat.module.base.dal.dao.processingoperation;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import com.zt.plat.module.base.dal.dataobject.processingoperation.ProcessingOperationDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import com.zt.plat.module.base.controller.admin.processingoperation.vo.*;
|
||||
|
||||
/**
|
||||
* 工序 Mapper
|
||||
*
|
||||
* @author 后台管理-1
|
||||
*/
|
||||
@Mapper
|
||||
public interface ProcessingOperationMapper extends BaseMapperX<ProcessingOperationDO> {
|
||||
|
||||
default PageResult<ProcessingOperationDO> selectPage(ProcessingOperationPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<ProcessingOperationDO>()
|
||||
.eqIfPresent(ProcessingOperationDO::getCode, reqVO.getCode())
|
||||
.likeIfPresent(ProcessingOperationDO::getName, reqVO.getName())
|
||||
.eqIfPresent(ProcessingOperationDO::getSort, reqVO.getSort())
|
||||
.eqIfPresent(ProcessingOperationDO::getTypeValue, reqVO.getTypeValue())
|
||||
.eqIfPresent(ProcessingOperationDO::getRemark, reqVO.getRemark())
|
||||
.betweenIfPresent(ProcessingOperationDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(ProcessingOperationDO::getId));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.zt.plat.module.base.dal.dao.processingoperationmaterial;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import com.zt.plat.module.base.dal.dataobject.processingoperationmaterial.ProcessingOperationMaterialDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import com.zt.plat.module.base.controller.admin.processingoperationmaterial.vo.*;
|
||||
|
||||
/**
|
||||
* 工艺工序物料 Mapper
|
||||
*
|
||||
* @author 后台管理-1
|
||||
*/
|
||||
@Mapper
|
||||
public interface ProcessingOperationMaterialMapper extends BaseMapperX<ProcessingOperationMaterialDO> {
|
||||
|
||||
default PageResult<ProcessingOperationMaterialDO> selectPage(ProcessingOperationMaterialPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<ProcessingOperationMaterialDO>()
|
||||
.eqIfPresent(ProcessingOperationMaterialDO::getTypeValue, reqVO.getTypeValue())
|
||||
.eqIfPresent(ProcessingOperationMaterialDO::getRemark, reqVO.getRemark())
|
||||
.betweenIfPresent(ProcessingOperationMaterialDO::getCreateTime, reqVO.getCreateTime())
|
||||
.eqIfPresent(ProcessingOperationMaterialDO::getDepartmentIds, reqVO.getDepartmentIds())
|
||||
.orderByDesc(ProcessingOperationMaterialDO::getId));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -39,6 +39,11 @@ public class MaterialInfomationDO extends BaseDO {
|
||||
@TableField("NAME")
|
||||
private String name;
|
||||
/**
|
||||
* 分类ID(中间表关联)
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private Long classesId;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@TableField("RMK")
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
package com.zt.plat.module.base.dal.dataobject.departmentmaterial;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.zt.plat.framework.mybatis.core.dataobject.BaseDO;
|
||||
/**
|
||||
* 组织架构物料 DO
|
||||
*
|
||||
* @author 后台管理-1
|
||||
*/
|
||||
@TableName("bse_dept_mtrl")
|
||||
@KeySequence("bse_dept_mtrl_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
/**
|
||||
* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO
|
||||
*/
|
||||
public class DepartmentMaterialDO extends BaseDO {
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
/**
|
||||
* 部门ID
|
||||
*/
|
||||
@TableField("DEPT_ID")
|
||||
private Long deptId;
|
||||
/**
|
||||
* 物料信息ID
|
||||
*/
|
||||
@TableField("INF_ID")
|
||||
private Long infomationId;
|
||||
/**
|
||||
* 物料分类ID
|
||||
*/
|
||||
@TableField("CLS_ID")
|
||||
private Long classesId;
|
||||
/**
|
||||
* 字典数据值-物料类型
|
||||
*/
|
||||
@TableField("DIC_DAT_VAL")
|
||||
private String dictionaryDataValue;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@TableField("RMK")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
package com.zt.plat.module.base.dal.dataobject.materialclasses;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.zt.plat.framework.mybatis.core.dataobject.BaseDO;
|
||||
/**
|
||||
* 物料分类 DO
|
||||
*
|
||||
* @author 后台管理-1
|
||||
*/
|
||||
@TableName("bse_mtrl_cls")
|
||||
@KeySequence("bse_mtrl_cls_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
/**
|
||||
* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO
|
||||
*/
|
||||
public class MaterialClassesDO extends BaseDO {
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
/**
|
||||
* 父级ID
|
||||
*/
|
||||
@TableField("PRN_ID")
|
||||
private Long parentId;
|
||||
/**
|
||||
* 分类编码
|
||||
*/
|
||||
@TableField("CD")
|
||||
private String code;
|
||||
/**
|
||||
* 分类名称
|
||||
*/
|
||||
@TableField("NAME")
|
||||
private String name;
|
||||
/**
|
||||
* 分类级别-用于类别层级(大/中/小类)
|
||||
*/
|
||||
@TableField("LVL")
|
||||
private Long level;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@TableField("RMK")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package com.zt.plat.module.base.dal.dataobject.materialhasclasses;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.zt.plat.framework.mybatis.core.dataobject.BaseDO;
|
||||
/**
|
||||
* 物料持有分类 DO
|
||||
*
|
||||
* @author 后台管理-1
|
||||
*/
|
||||
@TableName("bse_mtrl_hs_cls")
|
||||
@KeySequence("bse_mtrl_hs_cls_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
/**
|
||||
* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO
|
||||
*/
|
||||
public class MaterialHasClassesDO extends BaseDO {
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
/**
|
||||
* 物料信息ID
|
||||
*/
|
||||
@TableField("INF_ID")
|
||||
private Long infomationId;
|
||||
/**
|
||||
* 分类ID
|
||||
*/
|
||||
@TableField("CLS_ID")
|
||||
private Long classesId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
package com.zt.plat.module.base.dal.dataobject.materialhasproperties;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.zt.plat.framework.mybatis.core.dataobject.BaseDO;
|
||||
/**
|
||||
* 物料持有属性 DO
|
||||
*
|
||||
* @author 后台管理-1
|
||||
*/
|
||||
@TableName("bse_mtrl_hs_prps")
|
||||
@KeySequence("bse_mtrl_hs_prps_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
/**
|
||||
* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO
|
||||
*/
|
||||
public class MaterialHasPropertiesDO extends BaseDO {
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
/**
|
||||
* 物料信息ID
|
||||
*/
|
||||
@TableField("INF_ID")
|
||||
private Long infomationId;
|
||||
/**
|
||||
* 属性ID
|
||||
*/
|
||||
@TableField("PRPS_ID")
|
||||
private Long propertiesId;
|
||||
/**
|
||||
* 计量单位ID-默认计量单位
|
||||
*/
|
||||
@TableField("UNT_ID")
|
||||
private Long unitId;
|
||||
/**
|
||||
* 属性值
|
||||
*/
|
||||
@TableField("VAL")
|
||||
private String value;
|
||||
/**
|
||||
* 是否关键属性-关键属性表示物料唯一性
|
||||
*/
|
||||
@TableField("IS_KY")
|
||||
private Integer isKey;
|
||||
/**
|
||||
* 是否计量定价
|
||||
*/
|
||||
@TableField("IS_MTNG")
|
||||
private Integer isMetering;
|
||||
/**
|
||||
* 排序号
|
||||
*/
|
||||
@TableField("SRT")
|
||||
private Long sort;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package com.zt.plat.module.base.dal.dataobject.materialproperties;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.zt.plat.framework.mybatis.core.dataobject.BaseDO;
|
||||
/**
|
||||
* 物料属性 DO
|
||||
*
|
||||
* @author 后台管理-1
|
||||
*/
|
||||
@TableName("bse_mtrl_prps")
|
||||
@KeySequence("bse_mtrl_prps_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
/**
|
||||
* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO
|
||||
*/
|
||||
public class MaterialPropertiesDO extends BaseDO {
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
/**
|
||||
* 属性编码
|
||||
*/
|
||||
@TableField("CD")
|
||||
private String code;
|
||||
/**
|
||||
* 属性名称
|
||||
*/
|
||||
@TableField("NAME")
|
||||
private String name;
|
||||
/**
|
||||
* 计量单位量ID
|
||||
*/
|
||||
@TableField("UNT_QTY_ID")
|
||||
private Long unitQuantityId;
|
||||
/**
|
||||
* 业务字典数据值
|
||||
*/
|
||||
@TableField("DIC_DAT_VAL")
|
||||
private String dictionaryDataValue;
|
||||
/**
|
||||
* 数据类型
|
||||
*/
|
||||
@TableField("DAT_TP")
|
||||
private String dataType;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@TableField("RMK")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
package com.zt.plat.module.base.dal.dataobject.processinginfomation;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.zt.plat.framework.mybatis.core.dataobject.BaseDO;
|
||||
/**
|
||||
* 工艺信息 DO
|
||||
*
|
||||
* @author 后台管理-1
|
||||
*/
|
||||
@TableName("bse_proc_inf")
|
||||
@KeySequence("bse_proc_inf_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
/**
|
||||
* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO
|
||||
*/
|
||||
public class ProcessingInfomationDO extends BaseDO {
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
/**
|
||||
* 父级ID
|
||||
*/
|
||||
@TableField("PRN_ID")
|
||||
private Long parentId;
|
||||
/**
|
||||
* 工艺编码-唯一业务键
|
||||
*/
|
||||
@TableField("CD")
|
||||
private String code;
|
||||
/**
|
||||
* 工艺名称
|
||||
*/
|
||||
@TableField("NAME")
|
||||
private String name;
|
||||
/**
|
||||
* 工艺类型值
|
||||
*/
|
||||
@TableField("TP_VAL")
|
||||
private Long typeValue;
|
||||
/**
|
||||
* 状态值-工艺状态
|
||||
*/
|
||||
@TableField("STS_VAL")
|
||||
private String statusValue;
|
||||
/**
|
||||
* 工艺描述
|
||||
*/
|
||||
@TableField("DSP")
|
||||
private String description;
|
||||
/**
|
||||
* 部门ID
|
||||
*/
|
||||
@TableField("DEPT_ID")
|
||||
private Long deptId;
|
||||
/**
|
||||
* 生效日期
|
||||
*/
|
||||
@TableField("EFCT_DT")
|
||||
private LocalDateTime effectiveDate;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
package com.zt.plat.module.base.dal.dataobject.processinginfomationoperation;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.zt.plat.framework.mybatis.core.dataobject.BaseDO;
|
||||
/**
|
||||
* 工艺工序 DO
|
||||
*
|
||||
* @author 后台管理-1
|
||||
*/
|
||||
@TableName("bse_proc_inf_optn")
|
||||
@KeySequence("bse_proc_inf_optn_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
/**
|
||||
* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO
|
||||
*/
|
||||
public class ProcessingInfomationOperationDO extends BaseDO {
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
/**
|
||||
* 前序工序ID
|
||||
*/
|
||||
@TableField("PRE_OPTN_ID")
|
||||
private Long previousOperationId;
|
||||
/**
|
||||
* 后续工序ID
|
||||
*/
|
||||
@TableField("NXT_OPTN_ID")
|
||||
private Long nextOperationId;
|
||||
/**
|
||||
* 工艺ID
|
||||
*/
|
||||
@TableField("PROC_ID")
|
||||
private Long processingId;
|
||||
/**
|
||||
* 是否关键工序
|
||||
*/
|
||||
@TableField("IS_KY")
|
||||
private Integer isKey;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@TableField("RMK")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
package com.zt.plat.module.base.dal.dataobject.processingoperation;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.zt.plat.framework.mybatis.core.dataobject.BaseDO;
|
||||
/**
|
||||
* 工序 DO
|
||||
*
|
||||
* @author 后台管理-1
|
||||
*/
|
||||
@TableName("bse_proc_optn")
|
||||
@KeySequence("bse_proc_optn_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
/**
|
||||
* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO
|
||||
*/
|
||||
public class ProcessingOperationDO extends BaseDO {
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
/**
|
||||
* 工序编码
|
||||
*/
|
||||
@TableField("CD")
|
||||
private String code;
|
||||
/**
|
||||
* 工序名称
|
||||
*/
|
||||
@TableField("NAME")
|
||||
private String name;
|
||||
/**
|
||||
* 排序号
|
||||
*/
|
||||
@TableField("SRT")
|
||||
private Long sort;
|
||||
/**
|
||||
* 类型值-工序类型
|
||||
*/
|
||||
@TableField("TP_VAL")
|
||||
private String typeValue;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@TableField("RMK")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
package com.zt.plat.module.base.dal.dataobject.processingoperationmaterial;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.zt.plat.framework.mybatis.core.dataobject.BaseDO;
|
||||
/**
|
||||
* 工艺工序物料 DO
|
||||
*
|
||||
* @author 后台管理-1
|
||||
*/
|
||||
@TableName("bse_proc_optn_mtrl")
|
||||
@KeySequence("bse_proc_optn_mtrl_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
/**
|
||||
* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO
|
||||
*/
|
||||
public class ProcessingOperationMaterialDO extends BaseDO {
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
/**
|
||||
* 工艺工序ID
|
||||
*/
|
||||
private Long processingOperationId;
|
||||
/**
|
||||
* 物料ID
|
||||
*/
|
||||
private Long materialId;
|
||||
/**
|
||||
* 类型值-物料类型(产出/投入)
|
||||
*/
|
||||
@TableField("TP_VAL")
|
||||
private String typeValue;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@TableField("RMK")
|
||||
private String remark;
|
||||
/**
|
||||
* 组织机构
|
||||
*/
|
||||
@TableField("DEPT_IDS")
|
||||
private String departmentIds;
|
||||
|
||||
}
|
||||
@@ -7,6 +7,8 @@ import com.zt.plat.module.base.controller.admin.base.vo.MaterialInfomationPageRe
|
||||
import com.zt.plat.module.base.dal.dataobject.base.MaterialInfomationDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 物料信息 Mapper
|
||||
*
|
||||
@@ -16,11 +18,16 @@ import org.apache.ibatis.annotations.Mapper;
|
||||
public interface MaterialInfomationMapper extends BaseMapperX<MaterialInfomationDO> {
|
||||
|
||||
default PageResult<MaterialInfomationDO> selectPage(MaterialInfomationPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<MaterialInfomationDO>()
|
||||
return selectPage(reqVO, (Collection<Long>) null);
|
||||
}
|
||||
|
||||
default PageResult<MaterialInfomationDO> selectPage(MaterialInfomationPageReqVO reqVO, Collection<Long> infomationIds) {
|
||||
return BaseMapperX.super.selectPage(reqVO, new LambdaQueryWrapperX<MaterialInfomationDO>()
|
||||
.eqIfPresent(MaterialInfomationDO::getCode, reqVO.getCode())
|
||||
.likeIfPresent(MaterialInfomationDO::getName, reqVO.getName())
|
||||
.eqIfPresent(MaterialInfomationDO::getRemark, reqVO.getRemark())
|
||||
.betweenIfPresent(MaterialInfomationDO::getCreateTime, reqVO.getCreateTime())
|
||||
.inIfPresent(MaterialInfomationDO::getId, infomationIds)
|
||||
.orderByDesc(MaterialInfomationDO::getId));
|
||||
}
|
||||
|
||||
|
||||
@@ -1,21 +1,29 @@
|
||||
package com.zt.plat.module.base.service.base;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||
import com.zt.plat.module.base.controller.admin.base.vo.MaterialInfomationPageReqVO;
|
||||
import com.zt.plat.module.base.controller.admin.base.vo.MaterialInfomationRespVO;
|
||||
import com.zt.plat.module.base.controller.admin.base.vo.MaterialInfomationSaveReqVO;
|
||||
import com.zt.plat.module.base.dal.dao.materialhasclasses.MaterialHasClassesMapper;
|
||||
import com.zt.plat.module.base.dal.dataobject.base.MaterialInfomationDO;
|
||||
import com.zt.plat.module.base.dal.dataobject.materialhasclasses.MaterialHasClassesDO;
|
||||
import com.zt.plat.module.base.dal.mysql.base.MaterialInfomationMapper;
|
||||
import com.zt.plat.module.erp.api.ErpExternalApi;
|
||||
import com.zt.plat.module.erp.api.dto.ErpProductiveVersionReqDTO;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static com.zt.plat.module.base.enums.ErrorCodeConstants.MATERIAL_INFOMATION_NOT_EXISTS;
|
||||
@@ -35,23 +43,46 @@ public class MaterialInfomationServiceImpl implements MaterialInfomationService
|
||||
@Resource
|
||||
private ErpExternalApi erpExternalApi;
|
||||
|
||||
@Resource
|
||||
private MaterialHasClassesMapper materialHasClassesMapper;
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public MaterialInfomationRespVO createMaterialInfomation(MaterialInfomationSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
MaterialInfomationDO materialInfomation = BeanUtils.toBean(createReqVO, MaterialInfomationDO.class);
|
||||
materialInfomationMapper.insert(materialInfomation);
|
||||
// 维护分类关联
|
||||
if (createReqVO.getClassesId() != null) {
|
||||
MaterialHasClassesDO relation = MaterialHasClassesDO.builder()
|
||||
.classesId(createReqVO.getClassesId())
|
||||
.infomationId(materialInfomation.getId())
|
||||
.build();
|
||||
materialHasClassesMapper.insert(relation);
|
||||
materialInfomation.setClassesId(createReqVO.getClassesId());
|
||||
}
|
||||
// 返回
|
||||
return BeanUtils.toBean(materialInfomation, MaterialInfomationRespVO.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void updateMaterialInfomation(MaterialInfomationSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateMaterialInfomationExists(updateReqVO.getId());
|
||||
// 更新
|
||||
MaterialInfomationDO updateObj = BeanUtils.toBean(updateReqVO, MaterialInfomationDO.class);
|
||||
materialInfomationMapper.updateById(updateObj);
|
||||
// 更新分类关联
|
||||
materialHasClassesMapper.delete(new LambdaUpdateWrapper<MaterialHasClassesDO>()
|
||||
.eq(MaterialHasClassesDO::getInfomationId, updateReqVO.getId()));
|
||||
if (updateReqVO.getClassesId() != null) {
|
||||
MaterialHasClassesDO relation = MaterialHasClassesDO.builder()
|
||||
.classesId(updateReqVO.getClassesId())
|
||||
.infomationId(updateReqVO.getId())
|
||||
.build();
|
||||
materialHasClassesMapper.insert(relation);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -60,6 +91,8 @@ public class MaterialInfomationServiceImpl implements MaterialInfomationService
|
||||
validateMaterialInfomationExists(id);
|
||||
// 删除
|
||||
materialInfomationMapper.deleteById(id);
|
||||
materialHasClassesMapper.delete(new LambdaUpdateWrapper<MaterialHasClassesDO>()
|
||||
.eq(MaterialHasClassesDO::getInfomationId, id));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -85,12 +118,52 @@ public class MaterialInfomationServiceImpl implements MaterialInfomationService
|
||||
|
||||
@Override
|
||||
public MaterialInfomationDO getMaterialInfomation(Long id) {
|
||||
return materialInfomationMapper.selectById(id);
|
||||
MaterialInfomationDO info = materialInfomationMapper.selectById(id);
|
||||
if (info == null) {
|
||||
return null;
|
||||
}
|
||||
MaterialHasClassesDO relation = materialHasClassesMapper.selectFirstOne(MaterialHasClassesDO::getInfomationId, id);
|
||||
if (relation != null) {
|
||||
info.setClassesId(relation.getClassesId());
|
||||
}
|
||||
return info;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<MaterialInfomationDO> getMaterialInfomationPage(MaterialInfomationPageReqVO pageReqVO) {
|
||||
return materialInfomationMapper.selectPage(pageReqVO);
|
||||
List<Long> infomationIds = null;
|
||||
List<MaterialHasClassesDO> relationList = Collections.emptyList();
|
||||
if (pageReqVO.getClassesId() != null) {
|
||||
relationList = materialHasClassesMapper.selectList(MaterialHasClassesDO::getClassesId, pageReqVO.getClassesId());
|
||||
if (CollUtil.isEmpty(relationList)) {
|
||||
return PageResult.empty();
|
||||
}
|
||||
infomationIds = relationList.stream()
|
||||
.map(MaterialHasClassesDO::getInfomationId)
|
||||
.filter(Objects::nonNull)
|
||||
.distinct()
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
PageResult<MaterialInfomationDO> pageResult = materialInfomationMapper.selectPage(pageReqVO, infomationIds);
|
||||
if (CollUtil.isEmpty(pageResult.getList())) {
|
||||
return pageResult;
|
||||
}
|
||||
|
||||
List<Long> currentInfoIds = pageResult.getList().stream()
|
||||
.map(MaterialInfomationDO::getId)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
if (pageReqVO.getClassesId() == null) {
|
||||
relationList = materialHasClassesMapper.selectList(MaterialHasClassesDO::getInfomationId, currentInfoIds);
|
||||
}
|
||||
|
||||
Map<Long, Long> infoClassMap = relationList.stream()
|
||||
.filter(item -> item.getInfomationId() != null)
|
||||
.collect(Collectors.toMap(MaterialHasClassesDO::getInfomationId, MaterialHasClassesDO::getClassesId, (existing, replacement) -> existing));
|
||||
|
||||
pageResult.getList().forEach(item -> item.setClassesId(infoClassMap.get(item.getId())));
|
||||
return pageResult;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
package com.zt.plat.module.base.service.departmentmaterial;
|
||||
|
||||
import java.util.*;
|
||||
import jakarta.validation.*;
|
||||
import com.zt.plat.module.base.controller.admin.departmentmaterial.vo.*;
|
||||
import com.zt.plat.module.base.dal.dataobject.departmentmaterial.DepartmentMaterialDO;
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.common.pojo.PageParam;
|
||||
|
||||
/**
|
||||
* 组织架构物料 Service 接口
|
||||
*
|
||||
* @author 后台管理-1
|
||||
*/
|
||||
public interface DepartmentMaterialService {
|
||||
|
||||
/**
|
||||
* 创建组织架构物料
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
DepartmentMaterialRespVO createDepartmentMaterial(@Valid DepartmentMaterialSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新组织架构物料
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateDepartmentMaterial(@Valid DepartmentMaterialSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除组织架构物料
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteDepartmentMaterial(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除组织架构物料
|
||||
*
|
||||
* @param ids 编号
|
||||
*/
|
||||
void deleteDepartmentMaterialListByIds(List<Long> ids);
|
||||
|
||||
/**
|
||||
* 获得组织架构物料
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 组织架构物料
|
||||
*/
|
||||
DepartmentMaterialDO getDepartmentMaterial(Long id);
|
||||
|
||||
/**
|
||||
* 获得组织架构物料分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 组织架构物料分页
|
||||
*/
|
||||
PageResult<DepartmentMaterialRespVO> getDepartmentMaterialPage(DepartmentMaterialPageReqVO pageReqVO);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,246 @@
|
||||
package com.zt.plat.module.base.service.departmentmaterial;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.common.util.collection.CollectionUtils;
|
||||
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.zt.plat.module.base.controller.admin.departmentmaterial.vo.*;
|
||||
import com.zt.plat.module.base.dal.dao.departmentmaterial.DepartmentMaterialMapper;
|
||||
import com.zt.plat.module.base.dal.dao.materialclasses.MaterialClassesMapper;
|
||||
import com.zt.plat.module.base.dal.dataobject.base.MaterialInfomationDO;
|
||||
import com.zt.plat.module.base.dal.dataobject.departmentmaterial.DepartmentMaterialDO;
|
||||
import com.zt.plat.module.base.dal.dataobject.materialclasses.MaterialClassesDO;
|
||||
import com.zt.plat.module.base.dal.mysql.base.MaterialInfomationMapper;
|
||||
import com.zt.plat.module.system.api.dept.DeptApi;
|
||||
import com.zt.plat.module.system.api.dept.dto.DeptRespDTO;
|
||||
|
||||
import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static com.zt.plat.module.base.enums.ErrorCodeConstants.*;
|
||||
|
||||
/**
|
||||
* 组织架构物料 Service 实现类
|
||||
*
|
||||
* @author 后台管理-1
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class DepartmentMaterialServiceImpl implements DepartmentMaterialService {
|
||||
|
||||
@Resource
|
||||
private DepartmentMaterialMapper departmentMaterialMapper;
|
||||
|
||||
@Resource
|
||||
private MaterialInfomationMapper materialInfomationMapper;
|
||||
|
||||
@Resource
|
||||
private MaterialClassesMapper materialClassesMapper;
|
||||
|
||||
@Resource
|
||||
private DeptApi deptApi;
|
||||
|
||||
@Override
|
||||
public DepartmentMaterialRespVO createDepartmentMaterial(DepartmentMaterialSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
DepartmentMaterialDO departmentMaterial = BeanUtils.toBean(createReqVO, DepartmentMaterialDO.class);
|
||||
departmentMaterialMapper.insert(departmentMaterial);
|
||||
// 返回
|
||||
return BeanUtils.toBean(departmentMaterial, DepartmentMaterialRespVO.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateDepartmentMaterial(DepartmentMaterialSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateDepartmentMaterialExists(updateReqVO.getId());
|
||||
// 更新
|
||||
DepartmentMaterialDO updateObj = BeanUtils.toBean(updateReqVO, DepartmentMaterialDO.class);
|
||||
departmentMaterialMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteDepartmentMaterial(Long id) {
|
||||
// 校验存在
|
||||
validateDepartmentMaterialExists(id);
|
||||
// 删除
|
||||
departmentMaterialMapper.deleteById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteDepartmentMaterialListByIds(List<Long> ids) {
|
||||
// 校验存在
|
||||
validateDepartmentMaterialExists(ids);
|
||||
// 删除
|
||||
departmentMaterialMapper.deleteByIds(ids);
|
||||
}
|
||||
|
||||
private void validateDepartmentMaterialExists(List<Long> ids) {
|
||||
List<DepartmentMaterialDO> list = departmentMaterialMapper.selectByIds(ids);
|
||||
if (CollUtil.isEmpty(list) || list.size() != ids.size()) {
|
||||
throw exception(DEPARTMENT_MATERIAL_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
private void validateDepartmentMaterialExists(Long id) {
|
||||
if (departmentMaterialMapper.selectById(id) == null) {
|
||||
throw exception(DEPARTMENT_MATERIAL_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public DepartmentMaterialDO getDepartmentMaterial(Long id) {
|
||||
return departmentMaterialMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<DepartmentMaterialRespVO> getDepartmentMaterialPage(DepartmentMaterialPageReqVO pageReqVO) {
|
||||
// 预处理物料名称/编码查询条件
|
||||
List<Long> matchedInfoIds = null;
|
||||
if (StrUtil.isNotBlank(pageReqVO.getMaterialName()) || StrUtil.isNotBlank(pageReqVO.getMaterialNumber())) {
|
||||
LambdaQueryWrapperX<MaterialInfomationDO> infoWrapper = new LambdaQueryWrapperX<>();
|
||||
infoWrapper.likeIfPresent(MaterialInfomationDO::getName, pageReqVO.getMaterialName())
|
||||
.likeIfPresent(MaterialInfomationDO::getCode, pageReqVO.getMaterialNumber());
|
||||
List<MaterialInfomationDO> infoCandidates = materialInfomationMapper.selectList(infoWrapper);
|
||||
if (CollUtil.isEmpty(infoCandidates)) {
|
||||
return PageResult.empty();
|
||||
}
|
||||
matchedInfoIds = infoCandidates.stream().map(MaterialInfomationDO::getId).toList();
|
||||
pageReqVO.setInfomationIds(matchedInfoIds);
|
||||
}
|
||||
|
||||
PageResult<DepartmentMaterialDO> pageResult = departmentMaterialMapper.selectPage(pageReqVO);
|
||||
// 重置,避免后续使用该入参出现意外的 in 条件
|
||||
pageReqVO.setInfomationIds(null);
|
||||
|
||||
if (CollUtil.isEmpty(pageResult.getList())) {
|
||||
return PageResult.empty(pageResult.getTotal());
|
||||
}
|
||||
|
||||
// 关联数据准备
|
||||
Set<Long> infoIds = pageResult.getList().stream()
|
||||
.map(DepartmentMaterialDO::getInfomationId)
|
||||
.filter(Objects::nonNull)
|
||||
.collect(Collectors.toSet());
|
||||
Map<Long, MaterialInfomationDO> infoMap = infoIds.isEmpty()
|
||||
? Collections.emptyMap()
|
||||
: materialInfomationMapper.selectBatchIds(infoIds).stream()
|
||||
.filter(Objects::nonNull)
|
||||
.collect(Collectors.toMap(MaterialInfomationDO::getId, Function.identity()));
|
||||
|
||||
Set<Long> classIds = new HashSet<>();
|
||||
pageResult.getList().forEach(item -> {
|
||||
if (item.getClassesId() != null) {
|
||||
classIds.add(item.getClassesId());
|
||||
}
|
||||
MaterialInfomationDO info = infoMap.get(item.getInfomationId());
|
||||
if (info != null && info.getClassesId() != null) {
|
||||
classIds.add(info.getClassesId());
|
||||
}
|
||||
});
|
||||
|
||||
Map<Long, MaterialClassesDO> classCache = loadClassHierarchy(classIds);
|
||||
|
||||
Set<Long> deptIds = pageResult.getList().stream()
|
||||
.map(DepartmentMaterialDO::getDeptId)
|
||||
.filter(Objects::nonNull)
|
||||
.collect(Collectors.toSet());
|
||||
|
||||
Map<Long, DeptRespDTO> deptMap = Collections.emptyMap();
|
||||
if (!deptIds.isEmpty()) {
|
||||
try {
|
||||
deptMap = CollectionUtils.convertMap(deptApi.getDeptList(deptIds).getCheckedData(), DeptRespDTO::getId);
|
||||
} catch (Exception ignore) {
|
||||
deptMap = Collections.emptyMap();
|
||||
}
|
||||
}
|
||||
|
||||
List<DepartmentMaterialRespVO> respList = new ArrayList<>(pageResult.getList().size());
|
||||
for (DepartmentMaterialDO item : pageResult.getList()) {
|
||||
DepartmentMaterialRespVO respVO = BeanUtils.toBean(item, DepartmentMaterialRespVO.class);
|
||||
|
||||
MaterialInfomationDO info = infoMap.get(item.getInfomationId());
|
||||
if (info != null) {
|
||||
respVO.setMaterialNumber(info.getCode());
|
||||
respVO.setMaterialName(info.getName());
|
||||
}
|
||||
|
||||
Long targetClassId = item.getClassesId();
|
||||
if (targetClassId == null && info != null) {
|
||||
targetClassId = info.getClassesId();
|
||||
}
|
||||
if (targetClassId != null) {
|
||||
List<String> classPath = buildClassPath(targetClassId, classCache);
|
||||
if (!classPath.isEmpty()) {
|
||||
respVO.setCategoryLargeName(classPath.get(0));
|
||||
if (classPath.size() > 1) {
|
||||
respVO.setCategoryMediumName(classPath.get(1));
|
||||
}
|
||||
if (classPath.size() > 2) {
|
||||
respVO.setCategorySmallName(classPath.get(classPath.size() - 1));
|
||||
}
|
||||
respVO.setCategoryPath(String.join("/", classPath));
|
||||
}
|
||||
}
|
||||
|
||||
DeptRespDTO deptRespDTO = deptMap.get(item.getDeptId());
|
||||
if (deptRespDTO != null) {
|
||||
respVO.setDeptName(deptRespDTO.getName());
|
||||
}
|
||||
|
||||
respVO.setStatusLabel(StrUtil.isNotBlank(respVO.getStatusLabel()) ? respVO.getStatusLabel() : "未配置");
|
||||
|
||||
respVO.setDictionaryDataLabel(respVO.getDictionaryDataValue());
|
||||
respList.add(respVO);
|
||||
}
|
||||
|
||||
return new PageResult<>(respList, pageResult.getTotal());
|
||||
}
|
||||
|
||||
private Map<Long, MaterialClassesDO> loadClassHierarchy(Set<Long> initialIds) {
|
||||
if (CollUtil.isEmpty(initialIds)) {
|
||||
return Collections.emptyMap();
|
||||
}
|
||||
Map<Long, MaterialClassesDO> cache = new HashMap<>();
|
||||
Set<Long> pending = new HashSet<>(initialIds);
|
||||
while (!pending.isEmpty()) {
|
||||
List<MaterialClassesDO> fetched = materialClassesMapper.selectBatchIds(pending);
|
||||
pending = new HashSet<>();
|
||||
for (MaterialClassesDO cls : fetched) {
|
||||
if (cls == null || cache.containsKey(cls.getId())) {
|
||||
continue;
|
||||
}
|
||||
cache.put(cls.getId(), cls);
|
||||
Long parentId = cls.getParentId();
|
||||
if (parentId != null && parentId > 0 && !cache.containsKey(parentId)) {
|
||||
pending.add(parentId);
|
||||
}
|
||||
}
|
||||
}
|
||||
return cache;
|
||||
}
|
||||
|
||||
private List<String> buildClassPath(Long classId, Map<Long, MaterialClassesDO> cache) {
|
||||
List<String> path = new ArrayList<>();
|
||||
MaterialClassesDO current = cache.get(classId);
|
||||
int guard = 0;
|
||||
while (current != null && guard++ < 10) {
|
||||
path.add(current.getName());
|
||||
Long parentId = current.getParentId();
|
||||
if (parentId == null || parentId == 0) {
|
||||
break;
|
||||
}
|
||||
current = cache.get(parentId);
|
||||
}
|
||||
Collections.reverse(path);
|
||||
return path;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
package com.zt.plat.module.base.service.materialclasses;
|
||||
|
||||
import java.util.*;
|
||||
import jakarta.validation.*;
|
||||
import com.zt.plat.module.base.controller.admin.materialclasses.vo.*;
|
||||
import com.zt.plat.module.base.dal.dataobject.materialclasses.MaterialClassesDO;
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.common.pojo.PageParam;
|
||||
|
||||
/**
|
||||
* 物料分类 Service 接口
|
||||
*
|
||||
* @author 后台管理-1
|
||||
*/
|
||||
public interface MaterialClassesService {
|
||||
|
||||
/**
|
||||
* 创建物料分类
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
MaterialClassesRespVO createMaterialClasses(@Valid MaterialClassesSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新物料分类
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateMaterialClasses(@Valid MaterialClassesSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除物料分类
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteMaterialClasses(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除物料分类
|
||||
*
|
||||
* @param ids 编号
|
||||
*/
|
||||
void deleteMaterialClassesListByIds(List<Long> ids);
|
||||
|
||||
/**
|
||||
* 获得物料分类
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 物料分类
|
||||
*/
|
||||
MaterialClassesDO getMaterialClasses(Long id);
|
||||
|
||||
/**
|
||||
* 获得物料分类分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 物料分类分页
|
||||
*/
|
||||
PageResult<MaterialClassesDO> getMaterialClassesPage(MaterialClassesPageReqVO pageReqVO);
|
||||
|
||||
/**
|
||||
* 获得全部物料分类
|
||||
*
|
||||
* @return 分类列表
|
||||
*/
|
||||
List<MaterialClassesDO> getMaterialClassesList();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,97 @@
|
||||
package com.zt.plat.module.base.service.materialclasses;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import org.springframework.stereotype.Service;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
import com.zt.plat.module.base.controller.admin.materialclasses.vo.*;
|
||||
import com.zt.plat.module.base.dal.dataobject.materialclasses.MaterialClassesDO;
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.common.pojo.PageParam;
|
||||
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||
|
||||
import com.zt.plat.module.base.dal.dao.materialclasses.MaterialClassesMapper;
|
||||
|
||||
import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static com.zt.plat.framework.common.util.collection.CollectionUtils.convertList;
|
||||
import static com.zt.plat.framework.common.util.collection.CollectionUtils.diffList;
|
||||
import static com.zt.plat.module.base.enums.ErrorCodeConstants.*;
|
||||
|
||||
/**
|
||||
* 物料分类 Service 实现类
|
||||
*
|
||||
* @author 后台管理-1
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class MaterialClassesServiceImpl implements MaterialClassesService {
|
||||
|
||||
@Resource
|
||||
private MaterialClassesMapper materialClassesMapper;
|
||||
|
||||
@Override
|
||||
public MaterialClassesRespVO createMaterialClasses(MaterialClassesSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
MaterialClassesDO materialClasses = BeanUtils.toBean(createReqVO, MaterialClassesDO.class);
|
||||
materialClassesMapper.insert(materialClasses);
|
||||
// 返回
|
||||
return BeanUtils.toBean(materialClasses, MaterialClassesRespVO.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateMaterialClasses(MaterialClassesSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateMaterialClassesExists(updateReqVO.getId());
|
||||
// 更新
|
||||
MaterialClassesDO updateObj = BeanUtils.toBean(updateReqVO, MaterialClassesDO.class);
|
||||
materialClassesMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteMaterialClasses(Long id) {
|
||||
// 校验存在
|
||||
validateMaterialClassesExists(id);
|
||||
// 删除
|
||||
materialClassesMapper.deleteById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteMaterialClassesListByIds(List<Long> ids) {
|
||||
// 校验存在
|
||||
validateMaterialClassesExists(ids);
|
||||
// 删除
|
||||
materialClassesMapper.deleteByIds(ids);
|
||||
}
|
||||
|
||||
private void validateMaterialClassesExists(List<Long> ids) {
|
||||
List<MaterialClassesDO> list = materialClassesMapper.selectByIds(ids);
|
||||
if (CollUtil.isEmpty(list) || list.size() != ids.size()) {
|
||||
throw exception(MATERIAL_CLASSES_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
private void validateMaterialClassesExists(Long id) {
|
||||
if (materialClassesMapper.selectById(id) == null) {
|
||||
throw exception(MATERIAL_CLASSES_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public MaterialClassesDO getMaterialClasses(Long id) {
|
||||
return materialClassesMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<MaterialClassesDO> getMaterialClassesPage(MaterialClassesPageReqVO pageReqVO) {
|
||||
return materialClassesMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MaterialClassesDO> getMaterialClassesList() {
|
||||
return materialClassesMapper.selectList();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
package com.zt.plat.module.base.service.materialhasclasses;
|
||||
|
||||
import java.util.*;
|
||||
import jakarta.validation.*;
|
||||
import com.zt.plat.module.base.controller.admin.materialhasclasses.vo.*;
|
||||
import com.zt.plat.module.base.dal.dataobject.materialhasclasses.MaterialHasClassesDO;
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.common.pojo.PageParam;
|
||||
|
||||
/**
|
||||
* 物料持有分类 Service 接口
|
||||
*
|
||||
* @author 后台管理-1
|
||||
*/
|
||||
public interface MaterialHasClassesService {
|
||||
|
||||
/**
|
||||
* 创建物料持有分类
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
MaterialHasClassesRespVO createMaterialHasClasses(@Valid MaterialHasClassesSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新物料持有分类
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateMaterialHasClasses(@Valid MaterialHasClassesSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除物料持有分类
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteMaterialHasClasses(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除物料持有分类
|
||||
*
|
||||
* @param ids 编号
|
||||
*/
|
||||
void deleteMaterialHasClassesListByIds(List<Long> ids);
|
||||
|
||||
/**
|
||||
* 获得物料持有分类
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 物料持有分类
|
||||
*/
|
||||
MaterialHasClassesDO getMaterialHasClasses(Long id);
|
||||
|
||||
/**
|
||||
* 获得物料持有分类分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 物料持有分类分页
|
||||
*/
|
||||
PageResult<MaterialHasClassesDO> getMaterialHasClassesPage(MaterialHasClassesPageReqVO pageReqVO);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
package com.zt.plat.module.base.service.materialhasclasses;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import org.springframework.stereotype.Service;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
import com.zt.plat.module.base.controller.admin.materialhasclasses.vo.*;
|
||||
import com.zt.plat.module.base.dal.dataobject.materialhasclasses.MaterialHasClassesDO;
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.common.pojo.PageParam;
|
||||
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||
|
||||
import com.zt.plat.module.base.dal.dao.materialhasclasses.MaterialHasClassesMapper;
|
||||
|
||||
import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static com.zt.plat.framework.common.util.collection.CollectionUtils.convertList;
|
||||
import static com.zt.plat.framework.common.util.collection.CollectionUtils.diffList;
|
||||
import static com.zt.plat.module.base.enums.ErrorCodeConstants.*;
|
||||
|
||||
/**
|
||||
* 物料持有分类 Service 实现类
|
||||
*
|
||||
* @author 后台管理-1
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class MaterialHasClassesServiceImpl implements MaterialHasClassesService {
|
||||
|
||||
@Resource
|
||||
private MaterialHasClassesMapper materialHasClassesMapper;
|
||||
|
||||
@Override
|
||||
public MaterialHasClassesRespVO createMaterialHasClasses(MaterialHasClassesSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
MaterialHasClassesDO materialHasClasses = BeanUtils.toBean(createReqVO, MaterialHasClassesDO.class);
|
||||
materialHasClassesMapper.insert(materialHasClasses);
|
||||
// 返回
|
||||
return BeanUtils.toBean(materialHasClasses, MaterialHasClassesRespVO.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateMaterialHasClasses(MaterialHasClassesSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateMaterialHasClassesExists(updateReqVO.getId());
|
||||
// 更新
|
||||
MaterialHasClassesDO updateObj = BeanUtils.toBean(updateReqVO, MaterialHasClassesDO.class);
|
||||
materialHasClassesMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteMaterialHasClasses(Long id) {
|
||||
// 校验存在
|
||||
validateMaterialHasClassesExists(id);
|
||||
// 删除
|
||||
materialHasClassesMapper.deleteById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteMaterialHasClassesListByIds(List<Long> ids) {
|
||||
// 校验存在
|
||||
validateMaterialHasClassesExists(ids);
|
||||
// 删除
|
||||
materialHasClassesMapper.deleteByIds(ids);
|
||||
}
|
||||
|
||||
private void validateMaterialHasClassesExists(List<Long> ids) {
|
||||
List<MaterialHasClassesDO> list = materialHasClassesMapper.selectByIds(ids);
|
||||
if (CollUtil.isEmpty(list) || list.size() != ids.size()) {
|
||||
throw exception(MATERIAL_HAS_CLASSES_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
private void validateMaterialHasClassesExists(Long id) {
|
||||
if (materialHasClassesMapper.selectById(id) == null) {
|
||||
throw exception(MATERIAL_HAS_CLASSES_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public MaterialHasClassesDO getMaterialHasClasses(Long id) {
|
||||
return materialHasClassesMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<MaterialHasClassesDO> getMaterialHasClassesPage(MaterialHasClassesPageReqVO pageReqVO) {
|
||||
return materialHasClassesMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
package com.zt.plat.module.base.service.materialhasproperties;
|
||||
|
||||
import java.util.*;
|
||||
import jakarta.validation.*;
|
||||
import com.zt.plat.module.base.controller.admin.materialhasproperties.vo.*;
|
||||
import com.zt.plat.module.base.dal.dataobject.materialhasproperties.MaterialHasPropertiesDO;
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.common.pojo.PageParam;
|
||||
|
||||
/**
|
||||
* 物料持有属性 Service 接口
|
||||
*
|
||||
* @author 后台管理-1
|
||||
*/
|
||||
public interface MaterialHasPropertiesService {
|
||||
|
||||
/**
|
||||
* 创建物料持有属性
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
MaterialHasPropertiesRespVO createMaterialHasProperties(@Valid MaterialHasPropertiesSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新物料持有属性
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateMaterialHasProperties(@Valid MaterialHasPropertiesSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除物料持有属性
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteMaterialHasProperties(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除物料持有属性
|
||||
*
|
||||
* @param ids 编号
|
||||
*/
|
||||
void deleteMaterialHasPropertiesListByIds(List<Long> ids);
|
||||
|
||||
/**
|
||||
* 获得物料持有属性
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 物料持有属性
|
||||
*/
|
||||
MaterialHasPropertiesDO getMaterialHasProperties(Long id);
|
||||
|
||||
/**
|
||||
* 获得物料持有属性分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 物料持有属性分页
|
||||
*/
|
||||
PageResult<MaterialHasPropertiesDO> getMaterialHasPropertiesPage(MaterialHasPropertiesPageReqVO pageReqVO);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
package com.zt.plat.module.base.service.materialhasproperties;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import org.springframework.stereotype.Service;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
import com.zt.plat.module.base.controller.admin.materialhasproperties.vo.*;
|
||||
import com.zt.plat.module.base.dal.dataobject.materialhasproperties.MaterialHasPropertiesDO;
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.common.pojo.PageParam;
|
||||
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||
|
||||
import com.zt.plat.module.base.dal.dao.materialhasproperties.MaterialHasPropertiesMapper;
|
||||
|
||||
import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static com.zt.plat.framework.common.util.collection.CollectionUtils.convertList;
|
||||
import static com.zt.plat.framework.common.util.collection.CollectionUtils.diffList;
|
||||
import static com.zt.plat.module.base.enums.ErrorCodeConstants.*;
|
||||
|
||||
/**
|
||||
* 物料持有属性 Service 实现类
|
||||
*
|
||||
* @author 后台管理-1
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class MaterialHasPropertiesServiceImpl implements MaterialHasPropertiesService {
|
||||
|
||||
@Resource
|
||||
private MaterialHasPropertiesMapper materialHasPropertiesMapper;
|
||||
|
||||
@Override
|
||||
public MaterialHasPropertiesRespVO createMaterialHasProperties(MaterialHasPropertiesSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
MaterialHasPropertiesDO materialHasProperties = BeanUtils.toBean(createReqVO, MaterialHasPropertiesDO.class);
|
||||
materialHasPropertiesMapper.insert(materialHasProperties);
|
||||
// 返回
|
||||
return BeanUtils.toBean(materialHasProperties, MaterialHasPropertiesRespVO.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateMaterialHasProperties(MaterialHasPropertiesSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateMaterialHasPropertiesExists(updateReqVO.getId());
|
||||
// 更新
|
||||
MaterialHasPropertiesDO updateObj = BeanUtils.toBean(updateReqVO, MaterialHasPropertiesDO.class);
|
||||
materialHasPropertiesMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteMaterialHasProperties(Long id) {
|
||||
// 校验存在
|
||||
validateMaterialHasPropertiesExists(id);
|
||||
// 删除
|
||||
materialHasPropertiesMapper.deleteById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteMaterialHasPropertiesListByIds(List<Long> ids) {
|
||||
// 校验存在
|
||||
validateMaterialHasPropertiesExists(ids);
|
||||
// 删除
|
||||
materialHasPropertiesMapper.deleteByIds(ids);
|
||||
}
|
||||
|
||||
private void validateMaterialHasPropertiesExists(List<Long> ids) {
|
||||
List<MaterialHasPropertiesDO> list = materialHasPropertiesMapper.selectByIds(ids);
|
||||
if (CollUtil.isEmpty(list) || list.size() != ids.size()) {
|
||||
throw exception(MATERIAL_HAS_PROPERTIES_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
private void validateMaterialHasPropertiesExists(Long id) {
|
||||
if (materialHasPropertiesMapper.selectById(id) == null) {
|
||||
throw exception(MATERIAL_HAS_PROPERTIES_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public MaterialHasPropertiesDO getMaterialHasProperties(Long id) {
|
||||
return materialHasPropertiesMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<MaterialHasPropertiesDO> getMaterialHasPropertiesPage(MaterialHasPropertiesPageReqVO pageReqVO) {
|
||||
return materialHasPropertiesMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
package com.zt.plat.module.base.service.materialproperties;
|
||||
|
||||
import java.util.*;
|
||||
import jakarta.validation.*;
|
||||
import com.zt.plat.module.base.controller.admin.materialproperties.vo.*;
|
||||
import com.zt.plat.module.base.dal.dataobject.materialproperties.MaterialPropertiesDO;
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.common.pojo.PageParam;
|
||||
|
||||
/**
|
||||
* 物料属性 Service 接口
|
||||
*
|
||||
* @author 后台管理-1
|
||||
*/
|
||||
public interface MaterialPropertiesService {
|
||||
|
||||
/**
|
||||
* 创建物料属性
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
MaterialPropertiesRespVO createMaterialProperties(@Valid MaterialPropertiesSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新物料属性
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateMaterialProperties(@Valid MaterialPropertiesSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除物料属性
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteMaterialProperties(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除物料属性
|
||||
*
|
||||
* @param ids 编号
|
||||
*/
|
||||
void deleteMaterialPropertiesListByIds(List<Long> ids);
|
||||
|
||||
/**
|
||||
* 获得物料属性
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 物料属性
|
||||
*/
|
||||
MaterialPropertiesDO getMaterialProperties(Long id);
|
||||
|
||||
/**
|
||||
* 获得物料属性分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 物料属性分页
|
||||
*/
|
||||
PageResult<MaterialPropertiesDO> getMaterialPropertiesPage(MaterialPropertiesPageReqVO pageReqVO);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
package com.zt.plat.module.base.service.materialproperties;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import org.springframework.stereotype.Service;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
import com.zt.plat.module.base.controller.admin.materialproperties.vo.*;
|
||||
import com.zt.plat.module.base.dal.dataobject.materialproperties.MaterialPropertiesDO;
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.common.pojo.PageParam;
|
||||
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||
|
||||
import com.zt.plat.module.base.dal.dao.materialproperties.MaterialPropertiesMapper;
|
||||
|
||||
import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static com.zt.plat.framework.common.util.collection.CollectionUtils.convertList;
|
||||
import static com.zt.plat.framework.common.util.collection.CollectionUtils.diffList;
|
||||
import static com.zt.plat.module.base.enums.ErrorCodeConstants.*;
|
||||
|
||||
/**
|
||||
* 物料属性 Service 实现类
|
||||
*
|
||||
* @author 后台管理-1
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class MaterialPropertiesServiceImpl implements MaterialPropertiesService {
|
||||
|
||||
@Resource
|
||||
private MaterialPropertiesMapper materialPropertiesMapper;
|
||||
|
||||
@Override
|
||||
public MaterialPropertiesRespVO createMaterialProperties(MaterialPropertiesSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
MaterialPropertiesDO materialProperties = BeanUtils.toBean(createReqVO, MaterialPropertiesDO.class);
|
||||
materialPropertiesMapper.insert(materialProperties);
|
||||
// 返回
|
||||
return BeanUtils.toBean(materialProperties, MaterialPropertiesRespVO.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateMaterialProperties(MaterialPropertiesSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateMaterialPropertiesExists(updateReqVO.getId());
|
||||
// 更新
|
||||
MaterialPropertiesDO updateObj = BeanUtils.toBean(updateReqVO, MaterialPropertiesDO.class);
|
||||
materialPropertiesMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteMaterialProperties(Long id) {
|
||||
// 校验存在
|
||||
validateMaterialPropertiesExists(id);
|
||||
// 删除
|
||||
materialPropertiesMapper.deleteById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteMaterialPropertiesListByIds(List<Long> ids) {
|
||||
// 校验存在
|
||||
validateMaterialPropertiesExists(ids);
|
||||
// 删除
|
||||
materialPropertiesMapper.deleteByIds(ids);
|
||||
}
|
||||
|
||||
private void validateMaterialPropertiesExists(List<Long> ids) {
|
||||
List<MaterialPropertiesDO> list = materialPropertiesMapper.selectByIds(ids);
|
||||
if (CollUtil.isEmpty(list) || list.size() != ids.size()) {
|
||||
throw exception(MATERIAL_PROPERTIES_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
private void validateMaterialPropertiesExists(Long id) {
|
||||
if (materialPropertiesMapper.selectById(id) == null) {
|
||||
throw exception(MATERIAL_PROPERTIES_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public MaterialPropertiesDO getMaterialProperties(Long id) {
|
||||
return materialPropertiesMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<MaterialPropertiesDO> getMaterialPropertiesPage(MaterialPropertiesPageReqVO pageReqVO) {
|
||||
return materialPropertiesMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
package com.zt.plat.module.base.service.processinginfomation;
|
||||
|
||||
import java.util.*;
|
||||
import jakarta.validation.*;
|
||||
import com.zt.plat.module.base.controller.admin.processinginfomation.vo.*;
|
||||
import com.zt.plat.module.base.dal.dataobject.processinginfomation.ProcessingInfomationDO;
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.common.pojo.PageParam;
|
||||
|
||||
/**
|
||||
* 工艺信息 Service 接口
|
||||
*
|
||||
* @author 后台管理-1
|
||||
*/
|
||||
public interface ProcessingInfomationService {
|
||||
|
||||
/**
|
||||
* 创建工艺信息
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
ProcessingInfomationRespVO createProcessingInfomation(@Valid ProcessingInfomationSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新工艺信息
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateProcessingInfomation(@Valid ProcessingInfomationSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除工艺信息
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteProcessingInfomation(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除工艺信息
|
||||
*
|
||||
* @param ids 编号
|
||||
*/
|
||||
void deleteProcessingInfomationListByIds(List<Long> ids);
|
||||
|
||||
/**
|
||||
* 获得工艺信息
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 工艺信息
|
||||
*/
|
||||
ProcessingInfomationDO getProcessingInfomation(Long id);
|
||||
|
||||
/**
|
||||
* 获得工艺信息分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 工艺信息分页
|
||||
*/
|
||||
PageResult<ProcessingInfomationDO> getProcessingInfomationPage(ProcessingInfomationPageReqVO pageReqVO);
|
||||
|
||||
/**
|
||||
* 获得全部工艺信息
|
||||
*
|
||||
* @return 工艺信息列表
|
||||
*/
|
||||
List<ProcessingInfomationDO> getProcessingInfomationList();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,97 @@
|
||||
package com.zt.plat.module.base.service.processinginfomation;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import org.springframework.stereotype.Service;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
import com.zt.plat.module.base.controller.admin.processinginfomation.vo.*;
|
||||
import com.zt.plat.module.base.dal.dataobject.processinginfomation.ProcessingInfomationDO;
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.common.pojo.PageParam;
|
||||
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||
|
||||
import com.zt.plat.module.base.dal.dao.processinginfomation.ProcessingInfomationMapper;
|
||||
|
||||
import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static com.zt.plat.framework.common.util.collection.CollectionUtils.convertList;
|
||||
import static com.zt.plat.framework.common.util.collection.CollectionUtils.diffList;
|
||||
import static com.zt.plat.module.base.enums.ErrorCodeConstants.*;
|
||||
|
||||
/**
|
||||
* 工艺信息 Service 实现类
|
||||
*
|
||||
* @author 后台管理-1
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class ProcessingInfomationServiceImpl implements ProcessingInfomationService {
|
||||
|
||||
@Resource
|
||||
private ProcessingInfomationMapper processingInfomationMapper;
|
||||
|
||||
@Override
|
||||
public ProcessingInfomationRespVO createProcessingInfomation(ProcessingInfomationSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
ProcessingInfomationDO processingInfomation = BeanUtils.toBean(createReqVO, ProcessingInfomationDO.class);
|
||||
processingInfomationMapper.insert(processingInfomation);
|
||||
// 返回
|
||||
return BeanUtils.toBean(processingInfomation, ProcessingInfomationRespVO.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateProcessingInfomation(ProcessingInfomationSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateProcessingInfomationExists(updateReqVO.getId());
|
||||
// 更新
|
||||
ProcessingInfomationDO updateObj = BeanUtils.toBean(updateReqVO, ProcessingInfomationDO.class);
|
||||
processingInfomationMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteProcessingInfomation(Long id) {
|
||||
// 校验存在
|
||||
validateProcessingInfomationExists(id);
|
||||
// 删除
|
||||
processingInfomationMapper.deleteById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteProcessingInfomationListByIds(List<Long> ids) {
|
||||
// 校验存在
|
||||
validateProcessingInfomationExists(ids);
|
||||
// 删除
|
||||
processingInfomationMapper.deleteByIds(ids);
|
||||
}
|
||||
|
||||
private void validateProcessingInfomationExists(List<Long> ids) {
|
||||
List<ProcessingInfomationDO> list = processingInfomationMapper.selectByIds(ids);
|
||||
if (CollUtil.isEmpty(list) || list.size() != ids.size()) {
|
||||
throw exception(PROCESSING_INFOMATION_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
private void validateProcessingInfomationExists(Long id) {
|
||||
if (processingInfomationMapper.selectById(id) == null) {
|
||||
throw exception(PROCESSING_INFOMATION_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ProcessingInfomationDO getProcessingInfomation(Long id) {
|
||||
return processingInfomationMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<ProcessingInfomationDO> getProcessingInfomationPage(ProcessingInfomationPageReqVO pageReqVO) {
|
||||
return processingInfomationMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ProcessingInfomationDO> getProcessingInfomationList() {
|
||||
return processingInfomationMapper.selectList();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
package com.zt.plat.module.base.service.processinginfomationoperation;
|
||||
|
||||
import java.util.*;
|
||||
import jakarta.validation.*;
|
||||
import com.zt.plat.module.base.controller.admin.processinginfomationoperation.vo.*;
|
||||
import com.zt.plat.module.base.dal.dataobject.processinginfomationoperation.ProcessingInfomationOperationDO;
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.common.pojo.PageParam;
|
||||
|
||||
/**
|
||||
* 工艺工序 Service 接口
|
||||
*
|
||||
* @author 后台管理-1
|
||||
*/
|
||||
public interface ProcessingInfomationOperationService {
|
||||
|
||||
/**
|
||||
* 创建工艺工序
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
ProcessingInfomationOperationRespVO createProcessingInfomationOperation(@Valid ProcessingInfomationOperationSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新工艺工序
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateProcessingInfomationOperation(@Valid ProcessingInfomationOperationSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除工艺工序
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteProcessingInfomationOperation(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除工艺工序
|
||||
*
|
||||
* @param ids 编号
|
||||
*/
|
||||
void deleteProcessingInfomationOperationListByIds(List<Long> ids);
|
||||
|
||||
/**
|
||||
* 获得工艺工序
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 工艺工序
|
||||
*/
|
||||
ProcessingInfomationOperationDO getProcessingInfomationOperation(Long id);
|
||||
|
||||
/**
|
||||
* 获得工艺工序分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 工艺工序分页
|
||||
*/
|
||||
PageResult<ProcessingInfomationOperationDO> getProcessingInfomationOperationPage(ProcessingInfomationOperationPageReqVO pageReqVO);
|
||||
|
||||
/**
|
||||
* 获得工艺工序明细分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 工艺工序分页数据(携带工序信息)
|
||||
*/
|
||||
PageResult<ProcessingInfomationOperationRespVO> getProcessingInfomationOperationDetailPage(ProcessingInfomationOperationPageReqVO pageReqVO);
|
||||
|
||||
/**
|
||||
* 获得工艺工序明细列表
|
||||
*
|
||||
* @param pageReqVO 查询条件
|
||||
* @return 工艺工序列表(携带工序信息)
|
||||
*/
|
||||
List<ProcessingInfomationOperationRespVO> getProcessingInfomationOperationDetailList(ProcessingInfomationOperationPageReqVO pageReqVO);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,182 @@
|
||||
package com.zt.plat.module.base.service.processinginfomationoperation;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import org.springframework.stereotype.Service;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
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.dal.dao.processingoperation.ProcessingOperationMapper;
|
||||
import com.zt.plat.module.base.dal.dataobject.processingoperation.ProcessingOperationDO;
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.common.pojo.PageParam;
|
||||
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||
|
||||
import com.zt.plat.module.base.dal.dao.processinginfomationoperation.ProcessingInfomationOperationMapper;
|
||||
|
||||
import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static com.zt.plat.framework.common.util.collection.CollectionUtils.convertList;
|
||||
import static com.zt.plat.framework.common.util.collection.CollectionUtils.diffList;
|
||||
import static com.zt.plat.module.base.enums.ErrorCodeConstants.*;
|
||||
|
||||
/**
|
||||
* 工艺工序 Service 实现类
|
||||
*
|
||||
* @author 后台管理-1
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class ProcessingInfomationOperationServiceImpl implements ProcessingInfomationOperationService {
|
||||
|
||||
@Resource
|
||||
private ProcessingInfomationOperationMapper processingInfomationOperationMapper;
|
||||
@Resource
|
||||
private ProcessingOperationMapper processingOperationMapper;
|
||||
|
||||
@Override
|
||||
public ProcessingInfomationOperationRespVO createProcessingInfomationOperation(ProcessingInfomationOperationSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
ProcessingInfomationOperationDO processingInfomationOperation = BeanUtils.toBean(createReqVO, ProcessingInfomationOperationDO.class);
|
||||
processingInfomationOperationMapper.insert(processingInfomationOperation);
|
||||
// 返回
|
||||
return BeanUtils.toBean(processingInfomationOperation, ProcessingInfomationOperationRespVO.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateProcessingInfomationOperation(ProcessingInfomationOperationSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateProcessingInfomationOperationExists(updateReqVO.getId());
|
||||
// 更新
|
||||
ProcessingInfomationOperationDO updateObj = BeanUtils.toBean(updateReqVO, ProcessingInfomationOperationDO.class);
|
||||
processingInfomationOperationMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteProcessingInfomationOperation(Long id) {
|
||||
// 校验存在
|
||||
validateProcessingInfomationOperationExists(id);
|
||||
// 删除
|
||||
processingInfomationOperationMapper.deleteById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteProcessingInfomationOperationListByIds(List<Long> ids) {
|
||||
// 校验存在
|
||||
validateProcessingInfomationOperationExists(ids);
|
||||
// 删除
|
||||
processingInfomationOperationMapper.deleteByIds(ids);
|
||||
}
|
||||
|
||||
private void validateProcessingInfomationOperationExists(List<Long> ids) {
|
||||
List<ProcessingInfomationOperationDO> list = processingInfomationOperationMapper.selectByIds(ids);
|
||||
if (CollUtil.isEmpty(list) || list.size() != ids.size()) {
|
||||
throw exception(PROCESSING_INFOMATION_OPERATION_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
private void validateProcessingInfomationOperationExists(Long id) {
|
||||
if (processingInfomationOperationMapper.selectById(id) == null) {
|
||||
throw exception(PROCESSING_INFOMATION_OPERATION_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ProcessingInfomationOperationDO getProcessingInfomationOperation(Long id) {
|
||||
return processingInfomationOperationMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<ProcessingInfomationOperationDO> getProcessingInfomationOperationPage(ProcessingInfomationOperationPageReqVO pageReqVO) {
|
||||
return processingInfomationOperationMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<ProcessingInfomationOperationRespVO> getProcessingInfomationOperationDetailPage(ProcessingInfomationOperationPageReqVO pageReqVO) {
|
||||
List<ProcessingInfomationOperationRespVO> detailList = buildDetailList(pageReqVO);
|
||||
int total = detailList.size();
|
||||
if (total == 0) {
|
||||
return new PageResult<>(Collections.emptyList(), 0L);
|
||||
}
|
||||
Integer pageSize = pageReqVO.getPageSize();
|
||||
if (pageSize != null && pageSize <= 0) {
|
||||
return new PageResult<>(detailList, (long) total);
|
||||
}
|
||||
int pageNo = pageReqVO.getPageNo() == null ? 1 : pageReqVO.getPageNo();
|
||||
int size = (pageSize == null || pageSize <= 0) ? total : pageSize;
|
||||
int fromIndex = Math.max((pageNo - 1) * size, 0);
|
||||
if (fromIndex >= total) {
|
||||
return new PageResult<>(Collections.emptyList(), (long) total);
|
||||
}
|
||||
int toIndex = Math.min(fromIndex + size, total);
|
||||
return new PageResult<>(detailList.subList(fromIndex, toIndex), (long) total);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ProcessingInfomationOperationRespVO> getProcessingInfomationOperationDetailList(ProcessingInfomationOperationPageReqVO pageReqVO) {
|
||||
return buildDetailList(pageReqVO);
|
||||
}
|
||||
|
||||
private List<ProcessingInfomationOperationRespVO> buildDetailList(ProcessingInfomationOperationPageReqVO pageReqVO) {
|
||||
List<ProcessingInfomationOperationDO> relations = processingInfomationOperationMapper.selectList(pageReqVO);
|
||||
if (CollUtil.isEmpty(relations)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
Set<Long> operationIds = relations.stream()
|
||||
.flatMap(item -> Stream.of(item.getPreviousOperationId(), item.getNextOperationId()))
|
||||
.filter(Objects::nonNull)
|
||||
.collect(Collectors.toSet());
|
||||
Map<Long, ProcessingOperationDO> operationMap;
|
||||
if (operationIds.isEmpty()) {
|
||||
operationMap = Collections.emptyMap();
|
||||
} else {
|
||||
List<ProcessingOperationDO> operations = processingOperationMapper.selectBatchIds(operationIds);
|
||||
if (CollUtil.isEmpty(operations)) {
|
||||
operationMap = Collections.emptyMap();
|
||||
} else {
|
||||
operationMap = operations.stream()
|
||||
.filter(Objects::nonNull)
|
||||
.collect(Collectors.toMap(ProcessingOperationDO::getId, Function.identity(), (v1, v2) -> v1));
|
||||
}
|
||||
}
|
||||
List<ProcessingInfomationOperationRespVO> detailList = relations.stream()
|
||||
.map(item -> convertToResp(item, operationMap))
|
||||
.collect(Collectors.toList());
|
||||
String nextCode = pageReqVO.getNextOperationCode();
|
||||
if (StrUtil.isNotBlank(nextCode)) {
|
||||
detailList = detailList.stream()
|
||||
.filter(item -> StrUtil.containsIgnoreCase(item.getNextOperationCode(), nextCode))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
String nextName = pageReqVO.getNextOperationName();
|
||||
if (StrUtil.isNotBlank(nextName)) {
|
||||
detailList = detailList.stream()
|
||||
.filter(item -> StrUtil.containsIgnoreCase(item.getNextOperationName(), nextName))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
return detailList;
|
||||
}
|
||||
|
||||
private ProcessingInfomationOperationRespVO convertToResp(ProcessingInfomationOperationDO relation,
|
||||
Map<Long, ProcessingOperationDO> operationMap) {
|
||||
ProcessingInfomationOperationRespVO resp = BeanUtils.toBean(relation, ProcessingInfomationOperationRespVO.class);
|
||||
ProcessingOperationDO previous = operationMap.get(relation.getPreviousOperationId());
|
||||
if (previous != null) {
|
||||
resp.setPreviousOperationCode(previous.getCode());
|
||||
resp.setPreviousOperationName(previous.getName());
|
||||
}
|
||||
ProcessingOperationDO next = operationMap.get(relation.getNextOperationId());
|
||||
if (next != null) {
|
||||
resp.setNextOperationCode(next.getCode());
|
||||
resp.setNextOperationName(next.getName());
|
||||
}
|
||||
return resp;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
package com.zt.plat.module.base.service.processingoperation;
|
||||
|
||||
import java.util.*;
|
||||
import jakarta.validation.*;
|
||||
import com.zt.plat.module.base.controller.admin.processingoperation.vo.*;
|
||||
import com.zt.plat.module.base.dal.dataobject.processingoperation.ProcessingOperationDO;
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.common.pojo.PageParam;
|
||||
|
||||
/**
|
||||
* 工序 Service 接口
|
||||
*
|
||||
* @author 后台管理-1
|
||||
*/
|
||||
public interface ProcessingOperationService {
|
||||
|
||||
/**
|
||||
* 创建工序
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
ProcessingOperationRespVO createProcessingOperation(@Valid ProcessingOperationSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新工序
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateProcessingOperation(@Valid ProcessingOperationSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除工序
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteProcessingOperation(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除工序
|
||||
*
|
||||
* @param ids 编号
|
||||
*/
|
||||
void deleteProcessingOperationListByIds(List<Long> ids);
|
||||
|
||||
/**
|
||||
* 获得工序
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 工序
|
||||
*/
|
||||
ProcessingOperationDO getProcessingOperation(Long id);
|
||||
|
||||
/**
|
||||
* 获得工序分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 工序分页
|
||||
*/
|
||||
PageResult<ProcessingOperationDO> getProcessingOperationPage(ProcessingOperationPageReqVO pageReqVO);
|
||||
|
||||
/**
|
||||
* 获得全部工序
|
||||
*
|
||||
* @return 工序列表
|
||||
*/
|
||||
List<ProcessingOperationDO> getProcessingOperationList();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,97 @@
|
||||
package com.zt.plat.module.base.service.processingoperation;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import org.springframework.stereotype.Service;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
import com.zt.plat.module.base.controller.admin.processingoperation.vo.*;
|
||||
import com.zt.plat.module.base.dal.dataobject.processingoperation.ProcessingOperationDO;
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.common.pojo.PageParam;
|
||||
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||
|
||||
import com.zt.plat.module.base.dal.dao.processingoperation.ProcessingOperationMapper;
|
||||
|
||||
import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static com.zt.plat.framework.common.util.collection.CollectionUtils.convertList;
|
||||
import static com.zt.plat.framework.common.util.collection.CollectionUtils.diffList;
|
||||
import static com.zt.plat.module.base.enums.ErrorCodeConstants.*;
|
||||
|
||||
/**
|
||||
* 工序 Service 实现类
|
||||
*
|
||||
* @author 后台管理-1
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class ProcessingOperationServiceImpl implements ProcessingOperationService {
|
||||
|
||||
@Resource
|
||||
private ProcessingOperationMapper processingOperationMapper;
|
||||
|
||||
@Override
|
||||
public ProcessingOperationRespVO createProcessingOperation(ProcessingOperationSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
ProcessingOperationDO processingOperation = BeanUtils.toBean(createReqVO, ProcessingOperationDO.class);
|
||||
processingOperationMapper.insert(processingOperation);
|
||||
// 返回
|
||||
return BeanUtils.toBean(processingOperation, ProcessingOperationRespVO.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateProcessingOperation(ProcessingOperationSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateProcessingOperationExists(updateReqVO.getId());
|
||||
// 更新
|
||||
ProcessingOperationDO updateObj = BeanUtils.toBean(updateReqVO, ProcessingOperationDO.class);
|
||||
processingOperationMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteProcessingOperation(Long id) {
|
||||
// 校验存在
|
||||
validateProcessingOperationExists(id);
|
||||
// 删除
|
||||
processingOperationMapper.deleteById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteProcessingOperationListByIds(List<Long> ids) {
|
||||
// 校验存在
|
||||
validateProcessingOperationExists(ids);
|
||||
// 删除
|
||||
processingOperationMapper.deleteByIds(ids);
|
||||
}
|
||||
|
||||
private void validateProcessingOperationExists(List<Long> ids) {
|
||||
List<ProcessingOperationDO> list = processingOperationMapper.selectByIds(ids);
|
||||
if (CollUtil.isEmpty(list) || list.size() != ids.size()) {
|
||||
throw exception(PROCESSING_OPERATION_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
private void validateProcessingOperationExists(Long id) {
|
||||
if (processingOperationMapper.selectById(id) == null) {
|
||||
throw exception(PROCESSING_OPERATION_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ProcessingOperationDO getProcessingOperation(Long id) {
|
||||
return processingOperationMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<ProcessingOperationDO> getProcessingOperationPage(ProcessingOperationPageReqVO pageReqVO) {
|
||||
return processingOperationMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ProcessingOperationDO> getProcessingOperationList() {
|
||||
return processingOperationMapper.selectList();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
package com.zt.plat.module.base.service.processingoperationmaterial;
|
||||
|
||||
import java.util.*;
|
||||
import jakarta.validation.*;
|
||||
import com.zt.plat.module.base.controller.admin.processingoperationmaterial.vo.*;
|
||||
import com.zt.plat.module.base.dal.dataobject.processingoperationmaterial.ProcessingOperationMaterialDO;
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.common.pojo.PageParam;
|
||||
|
||||
/**
|
||||
* 工艺工序物料 Service 接口
|
||||
*
|
||||
* @author 后台管理-1
|
||||
*/
|
||||
public interface ProcessingOperationMaterialService {
|
||||
|
||||
/**
|
||||
* 创建工艺工序物料
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
ProcessingOperationMaterialRespVO createProcessingOperationMaterial(@Valid ProcessingOperationMaterialSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新工艺工序物料
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateProcessingOperationMaterial(@Valid ProcessingOperationMaterialSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除工艺工序物料
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteProcessingOperationMaterial(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除工艺工序物料
|
||||
*
|
||||
* @param ids 编号
|
||||
*/
|
||||
void deleteProcessingOperationMaterialListByIds(List<Long> ids);
|
||||
|
||||
/**
|
||||
* 获得工艺工序物料
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 工艺工序物料
|
||||
*/
|
||||
ProcessingOperationMaterialDO getProcessingOperationMaterial(Long id);
|
||||
|
||||
/**
|
||||
* 获得工艺工序物料分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 工艺工序物料分页
|
||||
*/
|
||||
PageResult<ProcessingOperationMaterialDO> getProcessingOperationMaterialPage(ProcessingOperationMaterialPageReqVO pageReqVO);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
package com.zt.plat.module.base.service.processingoperationmaterial;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import org.springframework.stereotype.Service;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
import com.zt.plat.module.base.controller.admin.processingoperationmaterial.vo.*;
|
||||
import com.zt.plat.module.base.dal.dataobject.processingoperationmaterial.ProcessingOperationMaterialDO;
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.common.pojo.PageParam;
|
||||
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||
|
||||
import com.zt.plat.module.base.dal.dao.processingoperationmaterial.ProcessingOperationMaterialMapper;
|
||||
|
||||
import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static com.zt.plat.framework.common.util.collection.CollectionUtils.convertList;
|
||||
import static com.zt.plat.framework.common.util.collection.CollectionUtils.diffList;
|
||||
import static com.zt.plat.module.base.enums.ErrorCodeConstants.*;
|
||||
|
||||
/**
|
||||
* 工艺工序物料 Service 实现类
|
||||
*
|
||||
* @author 后台管理-1
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class ProcessingOperationMaterialServiceImpl implements ProcessingOperationMaterialService {
|
||||
|
||||
@Resource
|
||||
private ProcessingOperationMaterialMapper processingOperationMaterialMapper;
|
||||
|
||||
@Override
|
||||
public ProcessingOperationMaterialRespVO createProcessingOperationMaterial(ProcessingOperationMaterialSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
ProcessingOperationMaterialDO processingOperationMaterial = BeanUtils.toBean(createReqVO, ProcessingOperationMaterialDO.class);
|
||||
processingOperationMaterialMapper.insert(processingOperationMaterial);
|
||||
// 返回
|
||||
return BeanUtils.toBean(processingOperationMaterial, ProcessingOperationMaterialRespVO.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateProcessingOperationMaterial(ProcessingOperationMaterialSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateProcessingOperationMaterialExists(updateReqVO.getId());
|
||||
// 更新
|
||||
ProcessingOperationMaterialDO updateObj = BeanUtils.toBean(updateReqVO, ProcessingOperationMaterialDO.class);
|
||||
processingOperationMaterialMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteProcessingOperationMaterial(Long id) {
|
||||
// 校验存在
|
||||
validateProcessingOperationMaterialExists(id);
|
||||
// 删除
|
||||
processingOperationMaterialMapper.deleteById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteProcessingOperationMaterialListByIds(List<Long> ids) {
|
||||
// 校验存在
|
||||
validateProcessingOperationMaterialExists(ids);
|
||||
// 删除
|
||||
processingOperationMaterialMapper.deleteByIds(ids);
|
||||
}
|
||||
|
||||
private void validateProcessingOperationMaterialExists(List<Long> ids) {
|
||||
List<ProcessingOperationMaterialDO> list = processingOperationMaterialMapper.selectByIds(ids);
|
||||
if (CollUtil.isEmpty(list) || list.size() != ids.size()) {
|
||||
throw exception(PROCESSING_OPERATION_MATERIAL_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
private void validateProcessingOperationMaterialExists(Long id) {
|
||||
if (processingOperationMaterialMapper.selectById(id) == null) {
|
||||
throw exception(PROCESSING_OPERATION_MATERIAL_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ProcessingOperationMaterialDO getProcessingOperationMaterial(Long id) {
|
||||
return processingOperationMaterialMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<ProcessingOperationMaterialDO> getProcessingOperationMaterialPage(ProcessingOperationMaterialPageReqVO pageReqVO) {
|
||||
return processingOperationMaterialMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.zt.plat.module.base.dal.dao.departmentmaterial.DepartmentMaterialMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.zt.plat.module.base.dal.dao.materialclasses.MaterialClassesMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.zt.plat.module.base.dal.dao.materialhasclasses.MaterialHasClassesMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.zt.plat.module.base.dal.dao.materialhasproperties.MaterialHasPropertiesMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.zt.plat.module.base.dal.dao.materialproperties.MaterialPropertiesMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.zt.plat.module.base.dal.dao.processinginfomation.ProcessingInfomationMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.zt.plat.module.base.dal.dao.processinginfomationoperation.ProcessingInfomationOperationMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.zt.plat.module.base.dal.dao.processingoperation.ProcessingOperationMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.zt.plat.module.base.dal.dao.processingoperationmaterial.ProcessingOperationMaterialMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user