1. 新增组织架构物料管理

2. 新增物料属性管理
3. 物料类别与信息管理
This commit is contained in:
chenbowen
2025-11-06 09:09:26 +08:00
parent 48b9209fd1
commit 72145fd402
28 changed files with 787 additions and 221 deletions

View File

@@ -5,12 +5,12 @@ import com.zt.plat.framework.common.pojo.CommonResult;
import com.zt.plat.framework.common.pojo.PageParam;
import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO;
import com.zt.plat.framework.common.util.object.BeanUtils;
import com.zt.plat.framework.excel.core.util.ExcelUtils;
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.dataobject.base.MaterialInfomationDO;
import com.zt.plat.module.base.controller.admin.base.vo.MaterialInfomationSimplePageReqVO;
import com.zt.plat.module.base.controller.admin.base.vo.MaterialInfomationSimpleRespVO;
import com.zt.plat.module.base.service.base.MaterialInfomationService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
@@ -76,16 +76,23 @@ public class MaterialInfomationController {
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('base:material-infomation:query')")
public CommonResult<MaterialInfomationRespVO> getMaterialInfomation(@RequestParam("id") Long id) {
MaterialInfomationDO materialInfomation = materialInfomationService.getMaterialInfomation(id);
return success(BeanUtils.toBean(materialInfomation, MaterialInfomationRespVO.class));
MaterialInfomationRespVO materialInfomation = materialInfomationService.getMaterialInfomation(id);
return success(materialInfomation);
}
@GetMapping("/page")
@Operation(summary = "获得物料信息分页")
@PreAuthorize("@ss.hasPermission('base:material-infomation:query')")
public CommonResult<PageResult<MaterialInfomationRespVO>> getMaterialInfomationPage(@Valid MaterialInfomationPageReqVO pageReqVO) {
PageResult<MaterialInfomationDO> pageResult = materialInfomationService.getMaterialInfomationPage(pageReqVO);
return success(BeanUtils.toBean(pageResult, MaterialInfomationRespVO.class));
PageResult<MaterialInfomationRespVO> pageResult = materialInfomationService.getMaterialInfomationPage(pageReqVO);
return success(pageResult);
}
@GetMapping("/simple-page")
@Operation(summary = "获得物料信息精简分页")
@PreAuthorize("@ss.hasPermission('base:material-infomation:query')")
public CommonResult<PageResult<MaterialInfomationSimpleRespVO>> getMaterialInfomationSimplePage(@Valid MaterialInfomationSimplePageReqVO pageReqVO) {
return success(materialInfomationService.getMaterialInfomationSimplePage(pageReqVO));
}
@GetMapping("/export-excel")
@@ -95,10 +102,10 @@ public class MaterialInfomationController {
public void exportMaterialInfomationExcel(@Valid MaterialInfomationPageReqVO pageReqVO,
HttpServletResponse response) throws IOException {
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
List<MaterialInfomationDO> list = materialInfomationService.getMaterialInfomationPage(pageReqVO).getList();
// 导出 Excel
ExcelUtils.write(response, "物料信息.xls", "数据", MaterialInfomationRespVO.class,
BeanUtils.toBean(list, MaterialInfomationRespVO.class));
List<MaterialInfomationRespVO> list = materialInfomationService.getMaterialInfomationPage(pageReqVO).getList();
// 导出 Excel
ExcelUtils.write(response, "物料信息.xls", "数据", MaterialInfomationRespVO.class,
list);
}
@GetMapping("/getOneTest")

View File

@@ -116,4 +116,12 @@ public class BusinessDictionaryTypeController implements BusinessControllerMarke
return success(businessDictionaryTypeService.getBusinessDictionaryDataListByDictionaryTypeId(dictionaryTypeId));
}
@GetMapping("/business-dictionary-data/list-by-type")
@Operation(summary = "根据字典类型编码获取业务字典数据列表")
@PreAuthorize("@ss.hasPermission('base:business-dictionary-type:query')")
public CommonResult<List<BusinessDictionaryDataDO>> getBusinessDictionaryDataListByType(@RequestParam("type") String type) {
// 通过类型编码直接获取对应的业务字典项,避免前端重复查询字典类型 ID
return success(businessDictionaryTypeService.getBusinessDictionaryDataListByType(type));
}
}

View File

@@ -19,7 +19,6 @@ 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;
@@ -79,8 +78,8 @@ public class DepartmentMaterialController {
@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));
DepartmentMaterialRespVO departmentMaterial = departmentMaterialService.getDepartmentMaterial(id);
return success(departmentMaterial);
}
@GetMapping("/page")

View File

@@ -29,7 +29,8 @@ public class DepartmentMaterialPageReqVO extends PageParam {
private String dictionaryDataValue;
@Schema(description = "状态编码", example = "1")
private String isEnable;
// 对应系统字典 base_material_status用于前端筛选
private String status;
@Schema(description = "物料编码")
private String materialNumber;

View File

@@ -74,10 +74,7 @@ public class DepartmentMaterialRespVO {
@Schema(description = "状态编码")
@ExcelProperty("状态编码")
private String isEnable;
@Schema(description = "状态名称")
@ExcelProperty("状态")
private String statusLabel;
// base_material_status 系统字典取值
private String status;
}

View File

@@ -12,6 +12,10 @@ public class DepartmentMaterialSaveReqVO {
@Schema(description = "主键ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "5674")
private Long id;
@Schema(description = "部门ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1001")
@NotNull(message = "部门ID不能为空")
private Long deptId;
@Schema(description = "物料信息ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "3923")
@NotNull(message = "物料信息ID不能为空")
private Long infomationId;
@@ -23,6 +27,11 @@ public class DepartmentMaterialSaveReqVO {
@NotEmpty(message = "字典数据值-物料类型不能为空")
private String dictionaryDataValue;
@Schema(description = "状态编码", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
// 对应系统字典 base_material_status
@NotEmpty(message = "状态不能为空")
private String status;
@Schema(description = "备注", requiredMode = Schema.RequiredMode.REQUIRED)
@NotEmpty(message = "备注不能为空")
private String remark;

View File

@@ -1,5 +1,7 @@
package com.zt.plat.module.base.controller.admin.materialproperties;
import com.zt.plat.framework.common.util.object.BeanUtils;
import com.zt.plat.module.base.dal.dataobject.materialproperties.MaterialPropertiesDO;
import org.springframework.web.bind.annotation.*;
import jakarta.annotation.Resource;
import org.springframework.validation.annotation.Validated;
@@ -19,7 +21,6 @@ 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;
@@ -28,7 +29,6 @@ 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 = "管理后台 - 物料属性")
@@ -79,16 +79,23 @@ public class MaterialPropertiesController {
@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));
MaterialPropertiesRespVO materialProperties = materialPropertiesService.getMaterialProperties(id);
return success(materialProperties);
}
@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));
PageResult<MaterialPropertiesRespVO> pageResult = materialPropertiesService.getMaterialPropertiesPage(pageReqVO);
return success(pageResult);
}
@GetMapping("/simple-page")
@Operation(summary = "获得物料属性精简分页")
@PreAuthorize("@ss.hasPermission('base:material-properties:query')")
public CommonResult<PageResult<MaterialPropertiesSimpleRespVO>> getMaterialPropertiesSimplePage(@Valid MaterialPropertiesSimplePageReqVO pageReqVO) {
return success(materialPropertiesService.getMaterialPropertiesSimplePage(pageReqVO));
}
@GetMapping("/export-excel")
@@ -98,10 +105,10 @@ public class MaterialPropertiesController {
public void exportMaterialPropertiesExcel(@Valid MaterialPropertiesPageReqVO pageReqVO,
HttpServletResponse response) throws IOException {
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
List<MaterialPropertiesDO> list = materialPropertiesService.getMaterialPropertiesPage(pageReqVO).getList();
List<MaterialPropertiesRespVO> list = materialPropertiesService.getMaterialPropertiesPage(pageReqVO).getList();
// 导出 Excel
ExcelUtils.write(response, "物料属性.xls", "数据", MaterialPropertiesRespVO.class,
BeanUtils.toBean(list, MaterialPropertiesRespVO.class));
list);
}
}

View File

@@ -19,10 +19,13 @@ public class MaterialPropertiesPageReqVO extends PageParam {
@Schema(description = "属性名称", example = "芋艿")
private String name;
@Schema(description = "关键字(编码/名称模糊匹配)")
private String keyword;
@Schema(description = "计量单位量ID", example = "30468")
private Long unitQuantityId;
@Schema(description = "业务字典数据值")
@Schema(description = "属性类型")
private String dictionaryDataValue;
@Schema(description = "数据类型", example = "1")

View File

@@ -28,10 +28,14 @@ public class MaterialPropertiesRespVO {
@ExcelProperty("计量单位量ID")
private Long unitQuantityId;
@Schema(description = "业务字典数据值", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("业务字典数据值")
@Schema(description = "属性类型", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("属性类型")
private String dictionaryDataValue;
@Schema(description = "属性类型名称")
@ExcelProperty("属性类型名称")
private String dictionaryDataLabel;
@Schema(description = "数据类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@ExcelProperty("数据类型")
private String dataType;
@@ -40,6 +44,18 @@ public class MaterialPropertiesRespVO {
@ExcelProperty("备注")
private String remark;
@Schema(description = "量纲名称")
@ExcelProperty("量纲名称")
private String unitQuantityName;
@Schema(description = "计量单位名称")
@ExcelProperty("计量单位")
private String unitName;
@Schema(description = "计量单位符号")
@ExcelProperty("计量单位符号")
private String unitSymbol;
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("创建时间")
private LocalDateTime createTime;

View File

@@ -20,11 +20,11 @@ public class MaterialPropertiesSaveReqVO {
@NotEmpty(message = "属性名称不能为空")
private String name;
@Schema(description = "计量单位量ID", example = "30468")
@Schema(description = "计量单位量ID", requiredMode = Schema.RequiredMode.NOT_REQUIRED, example = "30468")
private Long unitQuantityId;
@Schema(description = "业务字典数据值", requiredMode = Schema.RequiredMode.REQUIRED)
@NotEmpty(message = "业务字典数据值不能为空")
@Schema(description = "属性类型(业务字典数据值)", requiredMode = Schema.RequiredMode.REQUIRED)
@NotEmpty(message = "属性类型不能为空")
private String dictionaryDataValue;
@Schema(description = "数据类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")

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