diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/composition/CompositionController.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/composition/CompositionController.java new file mode 100644 index 00000000..314f2814 --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/composition/CompositionController.java @@ -0,0 +1,95 @@ +package com.chanko.yunxi.mes.module.heli.controller.admin.composition; + +import org.springframework.web.bind.annotation.*; +import javax.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 javax.validation.constraints.*; +import javax.validation.*; +import javax.servlet.http.*; +import java.util.*; +import java.io.IOException; + +import com.chanko.yunxi.mes.framework.common.pojo.PageParam; +import com.chanko.yunxi.mes.framework.common.pojo.PageResult; +import com.chanko.yunxi.mes.framework.common.pojo.CommonResult; +import com.chanko.yunxi.mes.framework.common.util.object.BeanUtils; +import static com.chanko.yunxi.mes.framework.common.pojo.CommonResult.success; + +import com.chanko.yunxi.mes.framework.excel.core.util.ExcelUtils; + +import com.chanko.yunxi.mes.framework.operatelog.core.annotations.OperateLog; +import static com.chanko.yunxi.mes.framework.operatelog.core.enums.OperateTypeEnum.*; + +import com.chanko.yunxi.mes.module.heli.controller.admin.composition.vo.*; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.composition.CompositionDO; +import com.chanko.yunxi.mes.module.heli.service.composition.CompositionService; + +@Tag(name = "管理后台 - 材质") +@RestController +@RequestMapping("/heli/composition") +@Validated +public class CompositionController { + + @Resource + private CompositionService compositionService; + + @PostMapping("/create") + @Operation(summary = "创建材质") + @PreAuthorize("@ss.hasPermission('heli:composition:create')") + public CommonResult createComposition(@Valid @RequestBody CompositionSaveReqVO createReqVO) { + return success(compositionService.createComposition(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新材质") + @PreAuthorize("@ss.hasPermission('heli:composition:update')") + public CommonResult updateComposition(@Valid @RequestBody CompositionSaveReqVO updateReqVO) { + compositionService.updateComposition(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除材质") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('heli:composition:delete')") + public CommonResult deleteComposition(@RequestParam("id") Long id) { + compositionService.deleteComposition(id); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得材质") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('heli:composition:query')") + public CommonResult getComposition(@RequestParam("id") Long id) { + CompositionDO composition = compositionService.getComposition(id); + return success(BeanUtils.toBean(composition, CompositionRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得材质分页") + @PreAuthorize("@ss.hasPermission('heli:composition:query')") + public CommonResult> getCompositionPage(@Valid CompositionPageReqVO pageReqVO) { + PageResult pageResult = compositionService.getCompositionPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, CompositionRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出材质 Excel") + @PreAuthorize("@ss.hasPermission('heli:composition:export')") + @OperateLog(type = EXPORT) + public void exportCompositionExcel(@Valid CompositionPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = compositionService.getCompositionPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "材质.xls", "数据", CompositionRespVO.class, + BeanUtils.toBean(list, CompositionRespVO.class)); + } + +} \ No newline at end of file diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/composition/vo/CompositionPageReqVO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/composition/vo/CompositionPageReqVO.java new file mode 100644 index 00000000..4f66556a --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/composition/vo/CompositionPageReqVO.java @@ -0,0 +1,44 @@ +package com.chanko.yunxi.mes.module.heli.controller.admin.composition.vo; + +import lombok.*; +import java.util.*; +import io.swagger.v3.oas.annotations.media.Schema; +import com.chanko.yunxi.mes.framework.common.pojo.PageParam; +import java.math.BigDecimal; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +import static com.chanko.yunxi.mes.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 材质分页 Request VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class CompositionPageReqVO extends PageParam { + + @Schema(description = "材质名", example = "王五") + private String name; + + @Schema(description = "材质代号") + private String code; + + @Schema(description = "类型", example = "2") + private String type; + + @Schema(description = "密度") + private BigDecimal density; + + @Schema(description = "密度单位") + private String densityUnit; + + @Schema(description = "描述", example = "随便") + private String description; + + @Schema(description = "状态,1表示正常,2表示禁用", example = "2") + private Integer status; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + +} \ No newline at end of file diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/composition/vo/CompositionRespVO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/composition/vo/CompositionRespVO.java new file mode 100644 index 00000000..b53fd024 --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/composition/vo/CompositionRespVO.java @@ -0,0 +1,53 @@ +package com.chanko.yunxi.mes.module.heli.controller.admin.composition.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import java.util.*; +import java.math.BigDecimal; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; +import com.alibaba.excel.annotation.*; + +@Schema(description = "管理后台 - 材质 Response VO") +@Data +@ExcelIgnoreUnannotated +public class CompositionRespVO { + + @Schema(description = "自增字段,唯一", requiredMode = Schema.RequiredMode.REQUIRED, example = "457") + @ExcelProperty("自增字段,唯一") + private Long id; + + @Schema(description = "材质名", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五") + @ExcelProperty("材质名") + private String name; + + @Schema(description = "材质代号") + @ExcelProperty("材质代号") + private String code; + + @Schema(description = "类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") + @ExcelProperty("类型") + private String type; + + @Schema(description = "密度") + @ExcelProperty("密度") + private BigDecimal density; + + @Schema(description = "密度单位") + @ExcelProperty("密度单位") + private String densityUnit; + + @Schema(description = "描述", example = "随便") + @ExcelProperty("描述") + private String description; + + @Schema(description = "状态,1表示正常,2表示禁用", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") + @ExcelProperty("状态,1表示正常,2表示禁用") + private Integer status; + + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("创建时间") + private LocalDateTime createTime; + +} \ No newline at end of file diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/composition/vo/CompositionSaveReqVO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/composition/vo/CompositionSaveReqVO.java new file mode 100644 index 00000000..5f3ef546 --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/composition/vo/CompositionSaveReqVO.java @@ -0,0 +1,41 @@ +package com.chanko.yunxi.mes.module.heli.controller.admin.composition.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import javax.validation.constraints.*; +import java.util.*; +import java.math.BigDecimal; + +@Schema(description = "管理后台 - 材质新增/修改 Request VO") +@Data +public class CompositionSaveReqVO { + + @Schema(description = "自增字段,唯一", requiredMode = Schema.RequiredMode.REQUIRED, example = "457") + private Long id; + + @Schema(description = "材质名", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五") + @NotEmpty(message = "材质名不能为空") + private String name; + + @Schema(description = "材质代号") + private String code; + + @Schema(description = "类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") + @NotEmpty(message = "类型不能为空") + private String type; + + @Schema(description = "密度") + private BigDecimal density; + + @Schema(description = "密度单位") + private String densityUnit; + + @Schema(description = "描述", example = "随便") + private String description; + + @Schema(description = "状态,1表示正常,2表示禁用", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") + @NotNull(message = "状态,1表示正常,2表示禁用不能为空") + private Integer status; + +} \ No newline at end of file diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/material/MaterialController.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/material/MaterialController.java new file mode 100644 index 00000000..6e95ff00 --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/material/MaterialController.java @@ -0,0 +1,95 @@ +package com.chanko.yunxi.mes.module.heli.controller.admin.material; + +import org.springframework.web.bind.annotation.*; +import javax.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 javax.validation.constraints.*; +import javax.validation.*; +import javax.servlet.http.*; +import java.util.*; +import java.io.IOException; + +import com.chanko.yunxi.mes.framework.common.pojo.PageParam; +import com.chanko.yunxi.mes.framework.common.pojo.PageResult; +import com.chanko.yunxi.mes.framework.common.pojo.CommonResult; +import com.chanko.yunxi.mes.framework.common.util.object.BeanUtils; +import static com.chanko.yunxi.mes.framework.common.pojo.CommonResult.success; + +import com.chanko.yunxi.mes.framework.excel.core.util.ExcelUtils; + +import com.chanko.yunxi.mes.framework.operatelog.core.annotations.OperateLog; +import static com.chanko.yunxi.mes.framework.operatelog.core.enums.OperateTypeEnum.*; + +import com.chanko.yunxi.mes.module.heli.controller.admin.material.vo.*; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.material.MaterialDO; +import com.chanko.yunxi.mes.module.heli.service.material.MaterialService; + +@Tag(name = "管理后台 - 物料") +@RestController +@RequestMapping("/heli/material") +@Validated +public class MaterialController { + + @Resource + private MaterialService materialService; + + @PostMapping("/create") + @Operation(summary = "创建物料") + @PreAuthorize("@ss.hasPermission('heli:material:create')") + public CommonResult createMaterial(@Valid @RequestBody MaterialSaveReqVO createReqVO) { + return success(materialService.createMaterial(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新物料") + @PreAuthorize("@ss.hasPermission('heli:material:update')") + public CommonResult updateMaterial(@Valid @RequestBody MaterialSaveReqVO updateReqVO) { + materialService.updateMaterial(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除物料") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('heli:material:delete')") + public CommonResult deleteMaterial(@RequestParam("id") Long id) { + materialService.deleteMaterial(id); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得物料") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('heli:material:query')") + public CommonResult getMaterial(@RequestParam("id") Long id) { + MaterialDO material = materialService.getMaterial(id); + return success(BeanUtils.toBean(material, MaterialRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得物料分页") + @PreAuthorize("@ss.hasPermission('heli:material:query')") + public CommonResult> getMaterialPage(@Valid MaterialPageReqVO pageReqVO) { + PageResult pageResult = materialService.getMaterialPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, MaterialRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出物料 Excel") + @PreAuthorize("@ss.hasPermission('heli:material:export')") + @OperateLog(type = EXPORT) + public void exportMaterialExcel(@Valid MaterialPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = materialService.getMaterialPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "物料.xls", "数据", MaterialRespVO.class, + BeanUtils.toBean(list, MaterialRespVO.class)); + } + +} \ No newline at end of file diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/material/vo/MaterialPageReqVO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/material/vo/MaterialPageReqVO.java new file mode 100644 index 00000000..b67cf39a --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/material/vo/MaterialPageReqVO.java @@ -0,0 +1,82 @@ +package com.chanko.yunxi.mes.module.heli.controller.admin.material.vo; + +import lombok.*; +import java.util.*; +import io.swagger.v3.oas.annotations.media.Schema; +import com.chanko.yunxi.mes.framework.common.pojo.PageParam; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +import static com.chanko.yunxi.mes.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 物料分页 Request VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class MaterialPageReqVO extends PageParam { + + @Schema(description = "物料编码") + private String code; + + @Schema(description = "物料名称", example = "李四") + private String name; + + @Schema(description = "品牌") + private String brand; + + @Schema(description = "规格") + private String spec; + + @Schema(description = "物料分类 零件|半成品|模具 1 2 3", example = "2") + private String materialType; + + @Schema(description = "主要单位") + private String unit; + + @Schema(description = "尺寸信息") + private String sizeInfo; + + @Schema(description = "材质id", example = "17489") + private Long compositionId; + + @Schema(description = "库存预警上限") + private Long invUpperLimit; + + @Schema(description = "库存预警下限") + private Long invLowerLimit; + + @Schema(description = "管控方式,只有两种值,分别是1和2,1表示单个管理,2表示批次管理", example = "2") + private Integer traceType; + + @Schema(description = "虚拟物料标识,只能填写Y和N,Y表示虚拟物料,N表示反之") + private String virsualPart; + + @Schema(description = "物料主要来源,只有三种值,分别是1,2,3,其中1表示自制,2表示外购,3表示委外加工") + private Integer mainFrom; + + @Schema(description = "默认保存的仓库,对应仓库表中的Id") + private Long dftStoreWh; + + @Schema(description = "默认保存的库区,对应库区表中的Id") + private Long dftStoreRg; + + @Schema(description = "默认保存的库位,对应库位表中的Id") + private Long dftStorePn; + + @Schema(description = "默认工艺路线,对应工艺路线表中的Id") + private Long dftRoute; + + @Schema(description = "默认包装方式,对应包装方式表中的Id") + private Long dftPack; + + @Schema(description = "物料描述", example = "你说的对") + private String description; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + + @Schema(description = "状态,1表示正常,2表示禁用", example = "1") + private Integer status; + +} \ No newline at end of file diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/material/vo/MaterialRespVO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/material/vo/MaterialRespVO.java new file mode 100644 index 00000000..98cbf8f5 --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/material/vo/MaterialRespVO.java @@ -0,0 +1,104 @@ +package com.chanko.yunxi.mes.module.heli.controller.admin.material.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +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 MaterialRespVO { + + @Schema(description = "自增字段,唯一", requiredMode = Schema.RequiredMode.REQUIRED, example = "11225") + @ExcelProperty("自增字段,唯一") + 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 String brand; + + @Schema(description = "规格") + @ExcelProperty("规格") + private String spec; + + @Schema(description = "物料分类 零件|半成品|模具 1 2 3", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") + @ExcelProperty("物料分类 零件|半成品|模具 1 2 3") + private String materialType; + + @Schema(description = "主要单位") + @ExcelProperty("主要单位") + private String unit; + + @Schema(description = "尺寸信息") + @ExcelProperty("尺寸信息") + private String sizeInfo; + + @Schema(description = "材质id", requiredMode = Schema.RequiredMode.REQUIRED, example = "17489") + @ExcelProperty("材质id") + private Long compositionId; + + @Schema(description = "库存预警上限") + @ExcelProperty("库存预警上限") + private Long invUpperLimit; + + @Schema(description = "库存预警下限") + @ExcelProperty("库存预警下限") + private Long invLowerLimit; + + @Schema(description = "管控方式,只有两种值,分别是1和2,1表示单个管理,2表示批次管理", example = "2") + @ExcelProperty("管控方式,只有两种值,分别是1和2,1表示单个管理,2表示批次管理") + private Integer traceType; + + @Schema(description = "虚拟物料标识,只能填写Y和N,Y表示虚拟物料,N表示反之") + @ExcelProperty("虚拟物料标识,只能填写Y和N,Y表示虚拟物料,N表示反之") + private String virsualPart; + + @Schema(description = "物料主要来源,只有三种值,分别是1,2,3,其中1表示自制,2表示外购,3表示委外加工") + @ExcelProperty("物料主要来源,只有三种值,分别是1,2,3,其中1表示自制,2表示外购,3表示委外加工") + private Integer mainFrom; + + @Schema(description = "默认保存的仓库,对应仓库表中的Id") + @ExcelProperty("默认保存的仓库,对应仓库表中的Id") + private Long dftStoreWh; + + @Schema(description = "默认保存的库区,对应库区表中的Id") + @ExcelProperty("默认保存的库区,对应库区表中的Id") + private Long dftStoreRg; + + @Schema(description = "默认保存的库位,对应库位表中的Id") + @ExcelProperty("默认保存的库位,对应库位表中的Id") + private Long dftStorePn; + + @Schema(description = "默认工艺路线,对应工艺路线表中的Id") + @ExcelProperty("默认工艺路线,对应工艺路线表中的Id") + private Long dftRoute; + + @Schema(description = "默认包装方式,对应包装方式表中的Id") + @ExcelProperty("默认包装方式,对应包装方式表中的Id") + private Long dftPack; + + @Schema(description = "物料描述", example = "你说的对") + @ExcelProperty("物料描述") + private String description; + + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("创建时间") + private LocalDateTime createTime; + + @Schema(description = "状态,1表示正常,2表示禁用", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") + @ExcelProperty("状态,1表示正常,2表示禁用") + private Integer status; + +} \ No newline at end of file diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/material/vo/MaterialSaveReqVO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/material/vo/MaterialSaveReqVO.java new file mode 100644 index 00000000..959e8404 --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/material/vo/MaterialSaveReqVO.java @@ -0,0 +1,81 @@ +package com.chanko.yunxi.mes.module.heli.controller.admin.material.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import javax.validation.constraints.*; +import java.util.*; + +@Schema(description = "管理后台 - 物料新增/修改 Request VO") +@Data +public class MaterialSaveReqVO { + + @Schema(description = "自增字段,唯一", requiredMode = Schema.RequiredMode.REQUIRED, example = "11225") + 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 String brand; + + @Schema(description = "规格") + private String spec; + + @Schema(description = "物料分类 零件|半成品|模具 1 2 3", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") + @NotEmpty(message = "物料分类 零件|半成品|模具 1 2 3不能为空") + private String materialType; + + @Schema(description = "主要单位") + private String unit; + + @Schema(description = "尺寸信息") + private String sizeInfo; + + @Schema(description = "材质id", requiredMode = Schema.RequiredMode.REQUIRED, example = "17489") + @NotNull(message = "材质id不能为空") + private Long compositionId; + + @Schema(description = "库存预警上限") + private Long invUpperLimit; + + @Schema(description = "库存预警下限") + private Long invLowerLimit; + + @Schema(description = "管控方式,只有两种值,分别是1和2,1表示单个管理,2表示批次管理", example = "2") + private Integer traceType; + + @Schema(description = "虚拟物料标识,只能填写Y和N,Y表示虚拟物料,N表示反之") + private String virsualPart; + + @Schema(description = "物料主要来源,只有三种值,分别是1,2,3,其中1表示自制,2表示外购,3表示委外加工") + private Integer mainFrom; + + @Schema(description = "默认保存的仓库,对应仓库表中的Id") + private Long dftStoreWh; + + @Schema(description = "默认保存的库区,对应库区表中的Id") + private Long dftStoreRg; + + @Schema(description = "默认保存的库位,对应库位表中的Id") + private Long dftStorePn; + + @Schema(description = "默认工艺路线,对应工艺路线表中的Id") + private Long dftRoute; + + @Schema(description = "默认包装方式,对应包装方式表中的Id") + private Long dftPack; + + @Schema(description = "物料描述", example = "你说的对") + private String description; + + @Schema(description = "状态,1表示正常,2表示禁用", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") + @NotNull(message = "状态,1表示正常,2表示禁用不能为空") + private Integer status; + +} \ No newline at end of file diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/composition/CompositionDO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/composition/CompositionDO.java new file mode 100644 index 00000000..ab280062 --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/composition/CompositionDO.java @@ -0,0 +1,60 @@ +package com.chanko.yunxi.mes.module.heli.dal.dataobject.composition; + +import lombok.*; +import java.util.*; +import java.math.BigDecimal; +import java.time.LocalDateTime; +import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.*; +import com.chanko.yunxi.mes.framework.mybatis.core.dataobject.BaseDO; + +/** + * 材质 DO + * + * @author 开发者 + */ +@TableName("base_composition") +@KeySequence("base_composition_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class CompositionDO extends BaseDO { + + /** + * 自增字段,唯一 + */ + @TableId + private Long id; + /** + * 材质名 + */ + private String name; + /** + * 材质代号 + */ + private String code; + /** + * 类型 + */ + private String type; + /** + * 密度 + */ + private BigDecimal density; + /** + * 密度单位 + */ + private String densityUnit; + /** + * 描述 + */ + private String description; + /** + * 状态,1表示正常,2表示禁用 + */ + private Integer status; + +} \ No newline at end of file diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/material/MaterialDO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/material/MaterialDO.java new file mode 100644 index 00000000..9d6d902a --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/material/MaterialDO.java @@ -0,0 +1,111 @@ +package com.chanko.yunxi.mes.module.heli.dal.dataobject.material; + +import lombok.*; +import java.util.*; +import java.time.LocalDateTime; +import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.*; +import com.chanko.yunxi.mes.framework.mybatis.core.dataobject.BaseDO; + +/** + * 物料 DO + * + * @author 开发者 + */ +@TableName("base_material") +@KeySequence("base_material_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class MaterialDO extends BaseDO { + + /** + * 自增字段,唯一 + */ + @TableId + private Long id; + /** + * 物料编码 + */ + private String code; + /** + * 物料名称 + */ + private String name; + /** + * 品牌 + */ + private String brand; + /** + * 规格 + */ + private String spec; + /** + * 物料分类 零件|半成品|模具 1 2 3 + */ + private String materialType; + /** + * 主要单位 + */ + private String unit; + /** + * 尺寸信息 + */ + private String sizeInfo; + /** + * 材质id + */ + private Long compositionId; + /** + * 库存预警上限 + */ + private Long invUpperLimit; + /** + * 库存预警下限 + */ + private Long invLowerLimit; + /** + * 管控方式,只有两种值,分别是1和2,1表示单个管理,2表示批次管理 + */ + private Integer traceType; + /** + * 虚拟物料标识,只能填写Y和N,Y表示虚拟物料,N表示反之 + */ + private String virsualPart; + /** + * 物料主要来源,只有三种值,分别是1,2,3,其中1表示自制,2表示外购,3表示委外加工 + */ + private Integer mainFrom; + /** + * 默认保存的仓库,对应仓库表中的Id + */ + private Long dftStoreWh; + /** + * 默认保存的库区,对应库区表中的Id + */ + private Long dftStoreRg; + /** + * 默认保存的库位,对应库位表中的Id + */ + private Long dftStorePn; + /** + * 默认工艺路线,对应工艺路线表中的Id + */ + private Long dftRoute; + /** + * 默认包装方式,对应包装方式表中的Id + */ + private Long dftPack; + /** + * 物料描述 + */ + private String description; + /** + * 状态,1表示正常,2表示禁用 + */ + private Integer status; + +} \ No newline at end of file diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/composition/CompositionMapper.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/composition/CompositionMapper.java new file mode 100644 index 00000000..43ca9397 --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/composition/CompositionMapper.java @@ -0,0 +1,33 @@ +package com.chanko.yunxi.mes.module.heli.dal.mysql.composition; + +import java.util.*; + +import com.chanko.yunxi.mes.framework.common.pojo.PageResult; +import com.chanko.yunxi.mes.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.chanko.yunxi.mes.framework.mybatis.core.mapper.BaseMapperX; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.composition.CompositionDO; +import org.apache.ibatis.annotations.Mapper; +import com.chanko.yunxi.mes.module.heli.controller.admin.composition.vo.*; + +/** + * 材质 Mapper + * + * @author 开发者 + */ +@Mapper +public interface CompositionMapper extends BaseMapperX { + + default PageResult selectPage(CompositionPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .likeIfPresent(CompositionDO::getName, reqVO.getName()) + .eqIfPresent(CompositionDO::getCode, reqVO.getCode()) + .eqIfPresent(CompositionDO::getType, reqVO.getType()) + .eqIfPresent(CompositionDO::getDensity, reqVO.getDensity()) + .eqIfPresent(CompositionDO::getDensityUnit, reqVO.getDensityUnit()) + .eqIfPresent(CompositionDO::getDescription, reqVO.getDescription()) + .eqIfPresent(CompositionDO::getStatus, reqVO.getStatus()) + .betweenIfPresent(CompositionDO::getCreateTime, reqVO.getCreateTime()) + .orderByDesc(CompositionDO::getId)); + } + +} \ No newline at end of file diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/material/MaterialMapper.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/material/MaterialMapper.java new file mode 100644 index 00000000..a6750bc5 --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/material/MaterialMapper.java @@ -0,0 +1,46 @@ +package com.chanko.yunxi.mes.module.heli.dal.mysql.material; + +import java.util.*; + +import com.chanko.yunxi.mes.framework.common.pojo.PageResult; +import com.chanko.yunxi.mes.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.chanko.yunxi.mes.framework.mybatis.core.mapper.BaseMapperX; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.material.MaterialDO; +import org.apache.ibatis.annotations.Mapper; +import com.chanko.yunxi.mes.module.heli.controller.admin.material.vo.*; + +/** + * 物料 Mapper + * + * @author 开发者 + */ +@Mapper +public interface MaterialMapper extends BaseMapperX { + + default PageResult selectPage(MaterialPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(MaterialDO::getCode, reqVO.getCode()) + .likeIfPresent(MaterialDO::getName, reqVO.getName()) + .eqIfPresent(MaterialDO::getBrand, reqVO.getBrand()) + .eqIfPresent(MaterialDO::getSpec, reqVO.getSpec()) + .eqIfPresent(MaterialDO::getMaterialType, reqVO.getMaterialType()) + .eqIfPresent(MaterialDO::getUnit, reqVO.getUnit()) + .eqIfPresent(MaterialDO::getSizeInfo, reqVO.getSizeInfo()) + .eqIfPresent(MaterialDO::getCompositionId, reqVO.getCompositionId()) + .eqIfPresent(MaterialDO::getInvUpperLimit, reqVO.getInvUpperLimit()) + .eqIfPresent(MaterialDO::getInvLowerLimit, reqVO.getInvLowerLimit()) + .eqIfPresent(MaterialDO::getTraceType, reqVO.getTraceType()) + .eqIfPresent(MaterialDO::getVirsualPart, reqVO.getVirsualPart()) + .eqIfPresent(MaterialDO::getMainFrom, reqVO.getMainFrom()) + .eqIfPresent(MaterialDO::getDftStoreWh, reqVO.getDftStoreWh()) + .eqIfPresent(MaterialDO::getDftStoreRg, reqVO.getDftStoreRg()) + .eqIfPresent(MaterialDO::getDftStorePn, reqVO.getDftStorePn()) + .eqIfPresent(MaterialDO::getDftRoute, reqVO.getDftRoute()) + .eqIfPresent(MaterialDO::getDftPack, reqVO.getDftPack()) + .eqIfPresent(MaterialDO::getDescription, reqVO.getDescription()) + .betweenIfPresent(MaterialDO::getCreateTime, reqVO.getCreateTime()) + .eqIfPresent(MaterialDO::getStatus, reqVO.getStatus()) + .orderByDesc(MaterialDO::getId)); + } + +} \ No newline at end of file diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/composition/CompositionService.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/composition/CompositionService.java new file mode 100644 index 00000000..4893c762 --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/composition/CompositionService.java @@ -0,0 +1,55 @@ +package com.chanko.yunxi.mes.module.heli.service.composition; + +import java.util.*; +import javax.validation.*; +import com.chanko.yunxi.mes.module.heli.controller.admin.composition.vo.*; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.composition.CompositionDO; +import com.chanko.yunxi.mes.framework.common.pojo.PageResult; +import com.chanko.yunxi.mes.framework.common.pojo.PageParam; + +/** + * 材质 Service 接口 + * + * @author 开发者 + */ +public interface CompositionService { + + /** + * 创建材质 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + Long createComposition(@Valid CompositionSaveReqVO createReqVO); + + /** + * 更新材质 + * + * @param updateReqVO 更新信息 + */ + void updateComposition(@Valid CompositionSaveReqVO updateReqVO); + + /** + * 删除材质 + * + * @param id 编号 + */ + void deleteComposition(Long id); + + /** + * 获得材质 + * + * @param id 编号 + * @return 材质 + */ + CompositionDO getComposition(Long id); + + /** + * 获得材质分页 + * + * @param pageReqVO 分页查询 + * @return 材质分页 + */ + PageResult getCompositionPage(CompositionPageReqVO pageReqVO); + +} \ No newline at end of file diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/composition/CompositionServiceImpl.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/composition/CompositionServiceImpl.java new file mode 100644 index 00000000..4cc6cf41 --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/composition/CompositionServiceImpl.java @@ -0,0 +1,74 @@ +package com.chanko.yunxi.mes.module.heli.service.composition; + +import org.springframework.stereotype.Service; +import javax.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.transaction.annotation.Transactional; + +import java.util.*; +import com.chanko.yunxi.mes.module.heli.controller.admin.composition.vo.*; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.composition.CompositionDO; +import com.chanko.yunxi.mes.framework.common.pojo.PageResult; +import com.chanko.yunxi.mes.framework.common.pojo.PageParam; +import com.chanko.yunxi.mes.framework.common.util.object.BeanUtils; + +import com.chanko.yunxi.mes.module.heli.dal.mysql.composition.CompositionMapper; + +import static com.chanko.yunxi.mes.framework.common.exception.util.ServiceExceptionUtil.exception; +import static com.chanko.yunxi.mes.module.heli.enums.ErrorCodeConstants.*; + +/** + * 材质 Service 实现类 + * + * @author 开发者 + */ +@Service +@Validated +public class CompositionServiceImpl implements CompositionService { + + @Resource + private CompositionMapper compositionMapper; + + @Override + public Long createComposition(CompositionSaveReqVO createReqVO) { + // 插入 + CompositionDO composition = BeanUtils.toBean(createReqVO, CompositionDO.class); + compositionMapper.insert(composition); + // 返回 + return composition.getId(); + } + + @Override + public void updateComposition(CompositionSaveReqVO updateReqVO) { + // 校验存在 + validateCompositionExists(updateReqVO.getId()); + // 更新 + CompositionDO updateObj = BeanUtils.toBean(updateReqVO, CompositionDO.class); + compositionMapper.updateById(updateObj); + } + + @Override + public void deleteComposition(Long id) { + // 校验存在 + validateCompositionExists(id); + // 删除 + compositionMapper.deleteById(id); + } + + private void validateCompositionExists(Long id) { + if (compositionMapper.selectById(id) == null) { + throw exception(COMPOSITION_NOT_EXISTS); + } + } + + @Override + public CompositionDO getComposition(Long id) { + return compositionMapper.selectById(id); + } + + @Override + public PageResult getCompositionPage(CompositionPageReqVO pageReqVO) { + return compositionMapper.selectPage(pageReqVO); + } + +} \ No newline at end of file diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/material/MaterialService.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/material/MaterialService.java new file mode 100644 index 00000000..81155827 --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/material/MaterialService.java @@ -0,0 +1,55 @@ +package com.chanko.yunxi.mes.module.heli.service.material; + +import java.util.*; +import javax.validation.*; +import com.chanko.yunxi.mes.module.heli.controller.admin.material.vo.*; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.material.MaterialDO; +import com.chanko.yunxi.mes.framework.common.pojo.PageResult; +import com.chanko.yunxi.mes.framework.common.pojo.PageParam; + +/** + * 物料 Service 接口 + * + * @author 开发者 + */ +public interface MaterialService { + + /** + * 创建物料 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + Long createMaterial(@Valid MaterialSaveReqVO createReqVO); + + /** + * 更新物料 + * + * @param updateReqVO 更新信息 + */ + void updateMaterial(@Valid MaterialSaveReqVO updateReqVO); + + /** + * 删除物料 + * + * @param id 编号 + */ + void deleteMaterial(Long id); + + /** + * 获得物料 + * + * @param id 编号 + * @return 物料 + */ + MaterialDO getMaterial(Long id); + + /** + * 获得物料分页 + * + * @param pageReqVO 分页查询 + * @return 物料分页 + */ + PageResult getMaterialPage(MaterialPageReqVO pageReqVO); + +} \ No newline at end of file diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/material/MaterialServiceImpl.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/material/MaterialServiceImpl.java new file mode 100644 index 00000000..f2337082 --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/material/MaterialServiceImpl.java @@ -0,0 +1,74 @@ +package com.chanko.yunxi.mes.module.heli.service.material; + +import org.springframework.stereotype.Service; +import javax.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.transaction.annotation.Transactional; + +import java.util.*; +import com.chanko.yunxi.mes.module.heli.controller.admin.material.vo.*; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.material.MaterialDO; +import com.chanko.yunxi.mes.framework.common.pojo.PageResult; +import com.chanko.yunxi.mes.framework.common.pojo.PageParam; +import com.chanko.yunxi.mes.framework.common.util.object.BeanUtils; + +import com.chanko.yunxi.mes.module.heli.dal.mysql.material.MaterialMapper; + +import static com.chanko.yunxi.mes.framework.common.exception.util.ServiceExceptionUtil.exception; +import static com.chanko.yunxi.mes.module.heli.enums.ErrorCodeConstants.*; + +/** + * 物料 Service 实现类 + * + * @author 开发者 + */ +@Service +@Validated +public class MaterialServiceImpl implements MaterialService { + + @Resource + private MaterialMapper materialMapper; + + @Override + public Long createMaterial(MaterialSaveReqVO createReqVO) { + // 插入 + MaterialDO material = BeanUtils.toBean(createReqVO, MaterialDO.class); + materialMapper.insert(material); + // 返回 + return material.getId(); + } + + @Override + public void updateMaterial(MaterialSaveReqVO updateReqVO) { + // 校验存在 + validateMaterialExists(updateReqVO.getId()); + // 更新 + MaterialDO updateObj = BeanUtils.toBean(updateReqVO, MaterialDO.class); + materialMapper.updateById(updateObj); + } + + @Override + public void deleteMaterial(Long id) { + // 校验存在 + validateMaterialExists(id); + // 删除 + materialMapper.deleteById(id); + } + + private void validateMaterialExists(Long id) { + if (materialMapper.selectById(id) == null) { + throw exception(MATERIAL_NOT_EXISTS); + } + } + + @Override + public MaterialDO getMaterial(Long id) { + return materialMapper.selectById(id); + } + + @Override + public PageResult getMaterialPage(MaterialPageReqVO pageReqVO) { + return materialMapper.selectPage(pageReqVO); + } + +} \ No newline at end of file diff --git a/mes-module-heli/mes-module-heli-biz/src/main/resources/mapper/composition/CompositionMapper.xml b/mes-module-heli/mes-module-heli-biz/src/main/resources/mapper/composition/CompositionMapper.xml new file mode 100644 index 00000000..cb612660 --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/resources/mapper/composition/CompositionMapper.xml @@ -0,0 +1,12 @@ + + + + + + + \ No newline at end of file diff --git a/mes-module-heli/mes-module-heli-biz/src/main/resources/mapper/material/MaterialMapper.xml b/mes-module-heli/mes-module-heli-biz/src/main/resources/mapper/material/MaterialMapper.xml new file mode 100644 index 00000000..24786aca --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/resources/mapper/material/MaterialMapper.xml @@ -0,0 +1,12 @@ + + + + + + + \ No newline at end of file diff --git a/mes-ui/mes-ui-admin-vue3/src/api/heli/composition/index.ts b/mes-ui/mes-ui-admin-vue3/src/api/heli/composition/index.ts new file mode 100644 index 00000000..2860a0f3 --- /dev/null +++ b/mes-ui/mes-ui-admin-vue3/src/api/heli/composition/index.ts @@ -0,0 +1,42 @@ +import request from '@/config/axios' + +export interface CompositionVO { + id: number + name: string + code: string + type: string + density: number + densityUnit: string + description: string + status: number +} + +// 查询材质分页 +export const getCompositionPage = async (params) => { + return await request.get({ url: `/heli/composition/page`, params }) +} + +// 查询材质详情 +export const getComposition = async (id: number) => { + return await request.get({ url: `/heli/composition/get?id=` + id }) +} + +// 新增材质 +export const createComposition = async (data: CompositionVO) => { + return await request.post({ url: `/heli/composition/create`, data }) +} + +// 修改材质 +export const updateComposition = async (data: CompositionVO) => { + return await request.put({ url: `/heli/composition/update`, data }) +} + +// 删除材质 +export const deleteComposition = async (id: number) => { + return await request.delete({ url: `/heli/composition/delete?id=` + id }) +} + +// 导出材质 Excel +export const exportComposition = async (params) => { + return await request.download({ url: `/heli/composition/export-excel`, params }) +} \ No newline at end of file diff --git a/mes-ui/mes-ui-admin-vue3/src/api/heli/material/index.ts b/mes-ui/mes-ui-admin-vue3/src/api/heli/material/index.ts new file mode 100644 index 00000000..aa032e7f --- /dev/null +++ b/mes-ui/mes-ui-admin-vue3/src/api/heli/material/index.ts @@ -0,0 +1,55 @@ +import request from '@/config/axios' + +export interface MaterialVO { + id: number + code: string + name: string + brand: string + spec: string + materialType: string + unit: string + sizeInfo: string + compositionId: number + invUpperLimit: number + invLowerLimit: number + traceType: number + virsualPart: string + mainFrom: number + dftStoreWh: number + dftStoreRg: number + dftStorePn: number + dftRoute: number + dftPack: number + description: string + status: number +} + +// 查询物料分页 +export const getMaterialPage = async (params) => { + return await request.get({ url: `/heli/material/page`, params }) +} + +// 查询物料详情 +export const getMaterial = async (id: number) => { + return await request.get({ url: `/heli/material/get?id=` + id }) +} + +// 新增物料 +export const createMaterial = async (data: MaterialVO) => { + return await request.post({ url: `/heli/material/create`, data }) +} + +// 修改物料 +export const updateMaterial = async (data: MaterialVO) => { + return await request.put({ url: `/heli/material/update`, data }) +} + +// 删除物料 +export const deleteMaterial = async (id: number) => { + return await request.delete({ url: `/heli/material/delete?id=` + id }) +} + +// 导出物料 Excel +export const exportMaterial = async (params) => { + return await request.download({ url: `/heli/material/export-excel`, params }) +} \ No newline at end of file diff --git a/mes-ui/mes-ui-admin-vue3/src/views/heli/composition/CompositionForm.vue b/mes-ui/mes-ui-admin-vue3/src/views/heli/composition/CompositionForm.vue new file mode 100644 index 00000000..a944fc61 --- /dev/null +++ b/mes-ui/mes-ui-admin-vue3/src/views/heli/composition/CompositionForm.vue @@ -0,0 +1,125 @@ + + \ No newline at end of file diff --git a/mes-ui/mes-ui-admin-vue3/src/views/heli/composition/index.vue b/mes-ui/mes-ui-admin-vue3/src/views/heli/composition/index.vue new file mode 100644 index 00000000..68be7481 --- /dev/null +++ b/mes-ui/mes-ui-admin-vue3/src/views/heli/composition/index.vue @@ -0,0 +1,245 @@ + + + \ No newline at end of file diff --git a/mes-ui/mes-ui-admin-vue3/src/views/heli/material/MaterialForm.vue b/mes-ui/mes-ui-admin-vue3/src/views/heli/material/MaterialForm.vue new file mode 100644 index 00000000..d3f888c9 --- /dev/null +++ b/mes-ui/mes-ui-admin-vue3/src/views/heli/material/MaterialForm.vue @@ -0,0 +1,194 @@ + + \ No newline at end of file diff --git a/mes-ui/mes-ui-admin-vue3/src/views/heli/material/index.vue b/mes-ui/mes-ui-admin-vue3/src/views/heli/material/index.vue new file mode 100644 index 00000000..db8379ea --- /dev/null +++ b/mes-ui/mes-ui-admin-vue3/src/views/heli/material/index.vue @@ -0,0 +1,389 @@ + + + \ No newline at end of file