diff --git a/mes-module-heli/mes-module-heli-api/src/main/java/com/chanko/yunxi/mes/module/heli/enums/ErrorCodeConstants.java b/mes-module-heli/mes-module-heli-api/src/main/java/com/chanko/yunxi/mes/module/heli/enums/ErrorCodeConstants.java index a6462988..93254126 100644 --- a/mes-module-heli/mes-module-heli-api/src/main/java/com/chanko/yunxi/mes/module/heli/enums/ErrorCodeConstants.java +++ b/mes-module-heli/mes-module-heli-api/src/main/java/com/chanko/yunxi/mes/module/heli/enums/ErrorCodeConstants.java @@ -44,6 +44,8 @@ public interface ErrorCodeConstants { ErrorCode STORAGE_NOT_EXISTS = new ErrorCode(1_003_004,"库存不存在"); ErrorCode STORAGE_MAT_NOT_EXISTS = new ErrorCode(1_003_005, "物料不存在"); ErrorCode STORAGE_LOG_NOT_EXISTS = new ErrorCode(1_003_006, "库存日志不存在"); + ErrorCode STORAGE_CHECK_NOT_EXISTS = new ErrorCode(1_003_007, "库存盘点不存在"); + ErrorCode STORAGE_CHECK_MAT_NOT_EXISTS = new ErrorCode(1_003_008, "盘点物料不存在"); /************订单管理***********/ ErrorCode PROJECT_ORDER_NOT_EXISTS = new ErrorCode(1_004_001, "项目订单不存在"); diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/storagecheck/StorageCheckController.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/storagecheck/StorageCheckController.java new file mode 100644 index 00000000..80dafe22 --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/storagecheck/StorageCheckController.java @@ -0,0 +1,95 @@ +package com.chanko.yunxi.mes.module.heli.controller.admin.storagecheck; + +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.storagecheck.vo.*; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.storagecheck.StorageCheckDO; +import com.chanko.yunxi.mes.module.heli.service.storagecheck.StorageCheckService; + +@Tag(name = "管理后台 - 入/出库盘点") +@RestController +@RequestMapping("/heli/storage-check") +@Validated +public class StorageCheckController { + + @Resource + private StorageCheckService storageCheckService; + + @PostMapping("/create") + @Operation(summary = "创建入/出库盘点") + @PreAuthorize("@ss.hasPermission('heli:storage-check:create')") + public CommonResult createStorageCheck(@Valid @RequestBody StorageCheckSaveReqVO createReqVO) { + return success(storageCheckService.createStorageCheck(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新入/出库盘点") + @PreAuthorize("@ss.hasPermission('heli:storage-check:update')") + public CommonResult updateStorageCheck(@Valid @RequestBody StorageCheckSaveReqVO updateReqVO) { + storageCheckService.updateStorageCheck(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除入/出库盘点") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('heli:storage-check:delete')") + public CommonResult deleteStorageCheck(@RequestParam("id") Long id) { + storageCheckService.deleteStorageCheck(id); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得入/出库盘点") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('heli:storage-check:query')") + public CommonResult getStorageCheck(@RequestParam("id") Long id) { + StorageCheckDO storageCheck = storageCheckService.getStorageCheck(id); + return success(BeanUtils.toBean(storageCheck, StorageCheckRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得入/出库盘点分页") + @PreAuthorize("@ss.hasPermission('heli:storage-check:query')") + public CommonResult> getStorageCheckPage(@Valid StorageCheckPageReqVO pageReqVO) { + PageResult pageResult = storageCheckService.getStorageCheckPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, StorageCheckRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出入/出库盘点 Excel") + @PreAuthorize("@ss.hasPermission('heli:storage-check:export')") + @OperateLog(type = EXPORT) + public void exportStorageCheckExcel(@Valid StorageCheckPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = storageCheckService.getStorageCheckPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "入/出库盘点.xls", "数据", StorageCheckRespVO.class, + BeanUtils.toBean(list, StorageCheckRespVO.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/storagecheck/vo/StorageCheckPageReqVO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/storagecheck/vo/StorageCheckPageReqVO.java new file mode 100644 index 00000000..ee345539 --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/storagecheck/vo/StorageCheckPageReqVO.java @@ -0,0 +1,74 @@ +package com.chanko.yunxi.mes.module.heli.controller.admin.storagecheck.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 StorageCheckPageReqVO extends PageParam { + + @Schema(description = "主键id") + private Long id; + + @Schema(description = "盘点单号") + private String stockNo; + + @Schema(description = "盘点类型:1部分盘点2整体盘点") + private Integer checkType; + + @Schema(description = "排除库存为0的物料:1是2否") + private Integer noZero; + + @Schema(description = "备注") + private String description; + + @Schema(description = "状态:1已保存;2已提交;3已删除") + private Integer status; + + @Schema(description = "仓库Id,对应 wms_wh 表中的Id") + private Long whId; + + @Schema(description = "记录的创建人,对应员工表中的 Id") + private String creator; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + + @Schema(description = "记录的修改人,对应员工表中的 Id") + private String updater; + + @Schema(description = "更新时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] updateTime; + + @Schema(description = "入库人") + private Long keeper; + + @Schema(description = "入库时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] keeperTime; + + @Schema(description = "出库人") + private Long outbound; + + @Schema(description = "出库时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] outboundTime; + + @Schema(description = "作废人") + private Long cancel; + + @Schema(description = "作废时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] cancelTime; + +} \ 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/storagecheck/vo/StorageCheckRespVO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/storagecheck/vo/StorageCheckRespVO.java new file mode 100644 index 00000000..72027852 --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/storagecheck/vo/StorageCheckRespVO.java @@ -0,0 +1,89 @@ +package com.chanko.yunxi.mes.module.heli.controller.admin.storagecheck.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.*; +import com.chanko.yunxi.mes.framework.excel.core.annotations.DictFormat; +import com.chanko.yunxi.mes.framework.excel.core.convert.DictConvert; + +@Schema(description = "管理后台 - 入/出库盘点 Response VO") +@Data +@ExcelIgnoreUnannotated +public class StorageCheckRespVO { + + @Schema(description = "主键id", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("主键id") + private Long id; + + @Schema(description = "盘点单号", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("盘点单号") + private String stockNo; + + @Schema(description = "盘点类型:1部分盘点2整体盘点") + @ExcelProperty(value = "盘点类型:1部分盘点2整体盘点", converter = DictConvert.class) + @DictFormat("heli_storage_mat_check_type") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中 + private Integer checkType; + + @Schema(description = "排除库存为0的物料:1是2否") + @ExcelProperty(value = "排除库存为0的物料:1是2否", converter = DictConvert.class) + @DictFormat("heli_common_is_or_not") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中 + private Integer noZero; + + @Schema(description = "备注") + @ExcelProperty("备注") + private String description; + + @Schema(description = "状态:1已保存;2已提交;3已删除") + @ExcelProperty(value = "状态:1已保存;2已提交;3已删除", converter = DictConvert.class) + @DictFormat("heli_storage_mat_check_status") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中 + private Integer status; + + @Schema(description = "仓库Id,对应 wms_wh 表中的Id", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("仓库Id,对应 wms_wh 表中的Id") + private Long whId; + + @Schema(description = "记录的创建人,对应员工表中的 Id", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("记录的创建人,对应员工表中的 Id") + private String creator; + + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("创建时间") + private LocalDateTime createTime; + + @Schema(description = "记录的修改人,对应员工表中的 Id") + @ExcelProperty("记录的修改人,对应员工表中的 Id") + private String updater; + + @Schema(description = "更新时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("更新时间") + private LocalDateTime updateTime; + + @Schema(description = "入库人") + @ExcelProperty("入库人") + private Long keeper; + + @Schema(description = "入库时间") + @ExcelProperty("入库时间") + private LocalDateTime keeperTime; + + @Schema(description = "出库人") + @ExcelProperty("出库人") + private Long outbound; + + @Schema(description = "出库时间") + @ExcelProperty("出库时间") + private LocalDateTime outboundTime; + + @Schema(description = "作废人") + @ExcelProperty("作废人") + private Long cancel; + + @Schema(description = "作废时间") + @ExcelProperty("作废时间") + private LocalDateTime cancelTime; + +} \ 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/storagecheck/vo/StorageCheckSaveReqVO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/storagecheck/vo/StorageCheckSaveReqVO.java new file mode 100644 index 00000000..2ed796cc --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/storagecheck/vo/StorageCheckSaveReqVO.java @@ -0,0 +1,56 @@ +package com.chanko.yunxi.mes.module.heli.controller.admin.storagecheck.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import javax.validation.constraints.*; +import java.util.*; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +@Schema(description = "管理后台 - 入/出库盘点新增/修改 Request VO") +@Data +public class StorageCheckSaveReqVO { + + @Schema(description = "主键id", requiredMode = Schema.RequiredMode.REQUIRED) + private Long id; + + @Schema(description = "盘点单号", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "盘点单号不能为空") + private String stockNo; + + @Schema(description = "盘点类型:1部分盘点2整体盘点") + private Integer checkType; + + @Schema(description = "排除库存为0的物料:1是2否") + private Integer noZero; + + @Schema(description = "备注") + private String description; + + @Schema(description = "状态:1已保存;2已提交;3已删除") + private Integer status; + + @Schema(description = "仓库Id,对应 wms_wh 表中的Id", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "仓库Id,对应 wms_wh 表中的Id不能为空") + private Long whId; + + @Schema(description = "入库人") + private Long keeper; + + @Schema(description = "入库时间") + private LocalDateTime keeperTime; + + @Schema(description = "出库人") + private Long outbound; + + @Schema(description = "出库时间") + private LocalDateTime outboundTime; + + @Schema(description = "作废人") + private Long cancel; + + @Schema(description = "作废时间") + private LocalDateTime cancelTime; + +} \ 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/storagecheckmat/StorageCheckMatController.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/storagecheckmat/StorageCheckMatController.java new file mode 100644 index 00000000..c0667b82 --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/storagecheckmat/StorageCheckMatController.java @@ -0,0 +1,95 @@ +package com.chanko.yunxi.mes.module.heli.controller.admin.storagecheckmat; + +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.storagecheckmat.vo.*; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.storagecheckmat.StorageCheckMatDO; +import com.chanko.yunxi.mes.module.heli.service.storagecheckmat.StorageCheckMatService; + +@Tag(name = "管理后台 - 盘点物料") +@RestController +@RequestMapping("/heli/storage-check-mat") +@Validated +public class StorageCheckMatController { + + @Resource + private StorageCheckMatService storageCheckMatService; + + @PostMapping("/create") + @Operation(summary = "创建盘点物料") + @PreAuthorize("@ss.hasPermission('heli:storage-check-mat:create')") + public CommonResult createStorageCheckMat(@Valid @RequestBody StorageCheckMatSaveReqVO createReqVO) { + return success(storageCheckMatService.createStorageCheckMat(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新盘点物料") + @PreAuthorize("@ss.hasPermission('heli:storage-check-mat:update')") + public CommonResult updateStorageCheckMat(@Valid @RequestBody StorageCheckMatSaveReqVO updateReqVO) { + storageCheckMatService.updateStorageCheckMat(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除盘点物料") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('heli:storage-check-mat:delete')") + public CommonResult deleteStorageCheckMat(@RequestParam("id") Long id) { + storageCheckMatService.deleteStorageCheckMat(id); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得盘点物料") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('heli:storage-check-mat:query')") + public CommonResult getStorageCheckMat(@RequestParam("id") Long id) { + StorageCheckMatDO storageCheckMat = storageCheckMatService.getStorageCheckMat(id); + return success(BeanUtils.toBean(storageCheckMat, StorageCheckMatRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得盘点物料分页") + @PreAuthorize("@ss.hasPermission('heli:storage-check-mat:query')") + public CommonResult> getStorageCheckMatPage(@Valid StorageCheckMatPageReqVO pageReqVO) { + PageResult pageResult = storageCheckMatService.getStorageCheckMatPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, StorageCheckMatRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出盘点物料 Excel") + @PreAuthorize("@ss.hasPermission('heli:storage-check-mat:export')") + @OperateLog(type = EXPORT) + public void exportStorageCheckMatExcel(@Valid StorageCheckMatPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = storageCheckMatService.getStorageCheckMatPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "盘点物料.xls", "数据", StorageCheckMatRespVO.class, + BeanUtils.toBean(list, StorageCheckMatRespVO.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/storagecheckmat/vo/StorageCheckMatPageReqVO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/storagecheckmat/vo/StorageCheckMatPageReqVO.java new file mode 100644 index 00000000..1703d6b5 --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/storagecheckmat/vo/StorageCheckMatPageReqVO.java @@ -0,0 +1,60 @@ +package com.chanko.yunxi.mes.module.heli.controller.admin.storagecheckmat.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 StorageCheckMatPageReqVO extends PageParam { + + @Schema(description = "主键id") + private Long id; + + @Schema(description = "盘点Id") + private Long checkId; + + @Schema(description = "物料 Id,对应 base_material表中的 Id 列") + private Long matId; + + @Schema(description = "仓库 Id,对应 wms_wh 表中的Id") + private Long whId; + + @Schema(description = "库区 Id,对应 wms_rg 表中的Id") + private Long rgId; + + @Schema(description = "库区 Id,对应 wms_rg 表中的Id") + private Long pnId; + + @Schema(description = "盘点数量") + private BigDecimal storageOkQty; + + @Schema(description = "物料当前库存数量") + private BigDecimal matRest; + + @Schema(description = "批次号") + private String lotNo; + + @Schema(description = "记录的创建人,对应员工表中的 Id") + private String creator; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + + @Schema(description = "记录的修改人,对应员工表中的 Id") + private String updater; + + @Schema(description = "更新时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] updateTime; + +} \ 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/storagecheckmat/vo/StorageCheckMatRespVO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/storagecheckmat/vo/StorageCheckMatRespVO.java new file mode 100644 index 00000000..0accfeb0 --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/storagecheckmat/vo/StorageCheckMatRespVO.java @@ -0,0 +1,69 @@ +package com.chanko.yunxi.mes.module.heli.controller.admin.storagecheckmat.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 StorageCheckMatRespVO { + + @Schema(description = "主键id", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("主键id") + private Long id; + + @Schema(description = "盘点Id", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("盘点Id") + private Long checkId; + + @Schema(description = "物料 Id,对应 base_material表中的 Id 列", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("物料 Id,对应 base_material表中的 Id 列") + private Long matId; + + @Schema(description = "仓库 Id,对应 wms_wh 表中的Id", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("仓库 Id,对应 wms_wh 表中的Id") + private Long whId; + + @Schema(description = "库区 Id,对应 wms_rg 表中的Id", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("库区 Id,对应 wms_rg 表中的Id") + private Long rgId; + + @Schema(description = "库区 Id,对应 wms_rg 表中的Id", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("库区 Id,对应 wms_rg 表中的Id") + private Long pnId; + + @Schema(description = "盘点数量") + @ExcelProperty("盘点数量") + private BigDecimal storageOkQty; + + @Schema(description = "物料当前库存数量") + @ExcelProperty("物料当前库存数量") + private BigDecimal matRest; + + @Schema(description = "批次号") + @ExcelProperty("批次号") + private String lotNo; + + @Schema(description = "记录的创建人,对应员工表中的 Id", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("记录的创建人,对应员工表中的 Id") + private String creator; + + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("创建时间") + private LocalDateTime createTime; + + @Schema(description = "记录的修改人,对应员工表中的 Id") + @ExcelProperty("记录的修改人,对应员工表中的 Id") + private String updater; + + @Schema(description = "更新时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("更新时间") + private LocalDateTime updateTime; + +} \ 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/storagecheckmat/vo/StorageCheckMatSaveReqVO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/storagecheckmat/vo/StorageCheckMatSaveReqVO.java new file mode 100644 index 00000000..25abb814 --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/storagecheckmat/vo/StorageCheckMatSaveReqVO.java @@ -0,0 +1,46 @@ +package com.chanko.yunxi.mes.module.heli.controller.admin.storagecheckmat.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 StorageCheckMatSaveReqVO { + + @Schema(description = "主键id", requiredMode = Schema.RequiredMode.REQUIRED) + private Long id; + + @Schema(description = "盘点Id", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "盘点Id不能为空") + private Long checkId; + + @Schema(description = "物料 Id,对应 base_material表中的 Id 列", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "物料 Id,对应 base_material表中的 Id 列不能为空") + private Long matId; + + @Schema(description = "仓库 Id,对应 wms_wh 表中的Id", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "仓库 Id,对应 wms_wh 表中的Id不能为空") + private Long whId; + + @Schema(description = "库区 Id,对应 wms_rg 表中的Id", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "库区 Id,对应 wms_rg 表中的Id不能为空") + private Long rgId; + + @Schema(description = "库区 Id,对应 wms_rg 表中的Id", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "库区 Id,对应 wms_rg 表中的Id不能为空") + private Long pnId; + + @Schema(description = "盘点数量") + private BigDecimal storageOkQty; + + @Schema(description = "物料当前库存数量") + private BigDecimal matRest; + + @Schema(description = "批次号") + private String lotNo; + +} \ 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/storagecheck/StorageCheckDO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/storagecheck/StorageCheckDO.java new file mode 100644 index 00000000..cc341263 --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/storagecheck/StorageCheckDO.java @@ -0,0 +1,88 @@ +package com.chanko.yunxi.mes.module.heli.dal.dataobject.storagecheck; + +import lombok.*; +import java.util.*; +import java.time.LocalDateTime; +import java.time.LocalDateTime; +import java.time.LocalDateTime; +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("wms_storage_check") +@KeySequence("wms_storage_check_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class StorageCheckDO extends BaseDO { + + /** + * 主键id + */ + @TableId + private Long id; + /** + * 盘点单号 + */ + private String stockNo; + /** + * 盘点类型:1部分盘点2整体盘点 + * + * 枚举 {@link TODO heli_storage_mat_check_type 对应的类} + */ + private Integer checkType; + /** + * 排除库存为0的物料:1是2否 + * + * 枚举 {@link TODO heli_common_is_or_not 对应的类} + */ + private Integer noZero; + /** + * 备注 + */ + private String description; + /** + * 状态:1已保存;2已提交;3已删除 + * + * 枚举 {@link TODO heli_storage_mat_check_status 对应的类} + */ + private Integer status; + /** + * 仓库Id,对应 wms_wh 表中的Id + */ + private Long whId; + /** + * 入库人 + */ + private Long keeper; + /** + * 入库时间 + */ + private LocalDateTime keeperTime; + /** + * 出库人 + */ + private Long outbound; + /** + * 出库时间 + */ + private LocalDateTime outboundTime; + /** + * 作废人 + */ + private Long cancel; + /** + * 作废时间 + */ + private LocalDateTime cancelTime; + +} \ 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/storagecheckmat/StorageCheckMatDO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/storagecheckmat/StorageCheckMatDO.java new file mode 100644 index 00000000..2fd38e90 --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/storagecheckmat/StorageCheckMatDO.java @@ -0,0 +1,65 @@ +package com.chanko.yunxi.mes.module.heli.dal.dataobject.storagecheckmat; + +import lombok.*; +import java.util.*; +import java.math.BigDecimal; +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("wms_storage_check_mat") +@KeySequence("wms_storage_check_mat_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class StorageCheckMatDO extends BaseDO { + + /** + * 主键id + */ + @TableId + private Long id; + /** + * 盘点Id + */ + private Long checkId; + /** + * 物料 Id,对应 base_material表中的 Id 列 + */ + private Long matId; + /** + * 仓库 Id,对应 wms_wh 表中的Id + */ + private Long whId; + /** + * 库区 Id,对应 wms_rg 表中的Id + */ + private Long rgId; + /** + * 库区 Id,对应 wms_rg 表中的Id + */ + private Long pnId; + /** + * 盘点数量 + */ + private BigDecimal storageOkQty; + /** + * 物料当前库存数量 + */ + private BigDecimal matRest; + /** + * 批次号 + */ + private String lotNo; + +} \ 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/storagecheck/StorageCheckMapper.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/storagecheck/StorageCheckMapper.java new file mode 100644 index 00000000..7f3a49c7 --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/storagecheck/StorageCheckMapper.java @@ -0,0 +1,42 @@ +package com.chanko.yunxi.mes.module.heli.dal.mysql.storagecheck; + +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.storagecheck.StorageCheckDO; +import org.apache.ibatis.annotations.Mapper; +import com.chanko.yunxi.mes.module.heli.controller.admin.storagecheck.vo.*; + +/** + * 入/出库盘点 Mapper + * + * @author 管理员 + */ +@Mapper +public interface StorageCheckMapper extends BaseMapperX { + + default PageResult selectPage(StorageCheckPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(StorageCheckDO::getId, reqVO.getId()) + .eqIfPresent(StorageCheckDO::getStockNo, reqVO.getStockNo()) + .eqIfPresent(StorageCheckDO::getCheckType, reqVO.getCheckType()) + .eqIfPresent(StorageCheckDO::getNoZero, reqVO.getNoZero()) + .eqIfPresent(StorageCheckDO::getDescription, reqVO.getDescription()) + .eqIfPresent(StorageCheckDO::getStatus, reqVO.getStatus()) + .eqIfPresent(StorageCheckDO::getWhId, reqVO.getWhId()) + .eqIfPresent(StorageCheckDO::getCreator, reqVO.getCreator()) + .betweenIfPresent(StorageCheckDO::getCreateTime, reqVO.getCreateTime()) + .eqIfPresent(StorageCheckDO::getUpdater, reqVO.getUpdater()) + .betweenIfPresent(StorageCheckDO::getUpdateTime, reqVO.getUpdateTime()) + .eqIfPresent(StorageCheckDO::getKeeper, reqVO.getKeeper()) + .betweenIfPresent(StorageCheckDO::getKeeperTime, reqVO.getKeeperTime()) + .eqIfPresent(StorageCheckDO::getOutbound, reqVO.getOutbound()) + .betweenIfPresent(StorageCheckDO::getOutboundTime, reqVO.getOutboundTime()) + .eqIfPresent(StorageCheckDO::getCancel, reqVO.getCancel()) + .betweenIfPresent(StorageCheckDO::getCancelTime, reqVO.getCancelTime()) + .orderByDesc(StorageCheckDO::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/storagecheckmat/StorageCheckMatMapper.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/storagecheckmat/StorageCheckMatMapper.java new file mode 100644 index 00000000..42d4d551 --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/storagecheckmat/StorageCheckMatMapper.java @@ -0,0 +1,38 @@ +package com.chanko.yunxi.mes.module.heli.dal.mysql.storagecheckmat; + +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.storagecheckmat.StorageCheckMatDO; +import org.apache.ibatis.annotations.Mapper; +import com.chanko.yunxi.mes.module.heli.controller.admin.storagecheckmat.vo.*; + +/** + * 盘点物料 Mapper + * + * @author 管理员 + */ +@Mapper +public interface StorageCheckMatMapper extends BaseMapperX { + + default PageResult selectPage(StorageCheckMatPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(StorageCheckMatDO::getId, reqVO.getId()) + .eqIfPresent(StorageCheckMatDO::getCheckId, reqVO.getCheckId()) + .eqIfPresent(StorageCheckMatDO::getMatId, reqVO.getMatId()) + .eqIfPresent(StorageCheckMatDO::getWhId, reqVO.getWhId()) + .eqIfPresent(StorageCheckMatDO::getRgId, reqVO.getRgId()) + .eqIfPresent(StorageCheckMatDO::getPnId, reqVO.getPnId()) + .eqIfPresent(StorageCheckMatDO::getStorageOkQty, reqVO.getStorageOkQty()) + .eqIfPresent(StorageCheckMatDO::getMatRest, reqVO.getMatRest()) + .eqIfPresent(StorageCheckMatDO::getLotNo, reqVO.getLotNo()) + .eqIfPresent(StorageCheckMatDO::getCreator, reqVO.getCreator()) + .betweenIfPresent(StorageCheckMatDO::getCreateTime, reqVO.getCreateTime()) + .eqIfPresent(StorageCheckMatDO::getUpdater, reqVO.getUpdater()) + .betweenIfPresent(StorageCheckMatDO::getUpdateTime, reqVO.getUpdateTime()) + .orderByDesc(StorageCheckMatDO::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/storagecheck/StorageCheckService.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/storagecheck/StorageCheckService.java new file mode 100644 index 00000000..5c7412f8 --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/storagecheck/StorageCheckService.java @@ -0,0 +1,55 @@ +package com.chanko.yunxi.mes.module.heli.service.storagecheck; + +import java.util.*; +import javax.validation.*; +import com.chanko.yunxi.mes.module.heli.controller.admin.storagecheck.vo.*; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.storagecheck.StorageCheckDO; +import com.chanko.yunxi.mes.framework.common.pojo.PageResult; +import com.chanko.yunxi.mes.framework.common.pojo.PageParam; + +/** + * 入/出库盘点 Service 接口 + * + * @author 管理员 + */ +public interface StorageCheckService { + + /** + * 创建入/出库盘点 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + Long createStorageCheck(@Valid StorageCheckSaveReqVO createReqVO); + + /** + * 更新入/出库盘点 + * + * @param updateReqVO 更新信息 + */ + void updateStorageCheck(@Valid StorageCheckSaveReqVO updateReqVO); + + /** + * 删除入/出库盘点 + * + * @param id 编号 + */ + void deleteStorageCheck(Long id); + + /** + * 获得入/出库盘点 + * + * @param id 编号 + * @return 入/出库盘点 + */ + StorageCheckDO getStorageCheck(Long id); + + /** + * 获得入/出库盘点分页 + * + * @param pageReqVO 分页查询 + * @return 入/出库盘点分页 + */ + PageResult getStorageCheckPage(StorageCheckPageReqVO 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/storagecheck/StorageCheckServiceImpl.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/storagecheck/StorageCheckServiceImpl.java new file mode 100644 index 00000000..5ab69dda --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/storagecheck/StorageCheckServiceImpl.java @@ -0,0 +1,74 @@ +package com.chanko.yunxi.mes.module.heli.service.storagecheck; + +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.storagecheck.vo.*; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.storagecheck.StorageCheckDO; +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.storagecheck.StorageCheckMapper; + +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 StorageCheckServiceImpl implements StorageCheckService { + + @Resource + private StorageCheckMapper storageCheckMapper; + + @Override + public Long createStorageCheck(StorageCheckSaveReqVO createReqVO) { + // 插入 + StorageCheckDO storageCheck = BeanUtils.toBean(createReqVO, StorageCheckDO.class); + storageCheckMapper.insert(storageCheck); + // 返回 + return storageCheck.getId(); + } + + @Override + public void updateStorageCheck(StorageCheckSaveReqVO updateReqVO) { + // 校验存在 + validateStorageCheckExists(updateReqVO.getId()); + // 更新 + StorageCheckDO updateObj = BeanUtils.toBean(updateReqVO, StorageCheckDO.class); + storageCheckMapper.updateById(updateObj); + } + + @Override + public void deleteStorageCheck(Long id) { + // 校验存在 + validateStorageCheckExists(id); + // 删除 + storageCheckMapper.deleteById(id); + } + + private void validateStorageCheckExists(Long id) { + if (storageCheckMapper.selectById(id) == null) { + throw exception(STORAGE_CHECK_NOT_EXISTS); + } + } + + @Override + public StorageCheckDO getStorageCheck(Long id) { + return storageCheckMapper.selectById(id); + } + + @Override + public PageResult getStorageCheckPage(StorageCheckPageReqVO pageReqVO) { + return storageCheckMapper.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/storagecheckmat/StorageCheckMatService.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/storagecheckmat/StorageCheckMatService.java new file mode 100644 index 00000000..00227048 --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/storagecheckmat/StorageCheckMatService.java @@ -0,0 +1,55 @@ +package com.chanko.yunxi.mes.module.heli.service.storagecheckmat; + +import java.util.*; +import javax.validation.*; +import com.chanko.yunxi.mes.module.heli.controller.admin.storagecheckmat.vo.*; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.storagecheckmat.StorageCheckMatDO; +import com.chanko.yunxi.mes.framework.common.pojo.PageResult; +import com.chanko.yunxi.mes.framework.common.pojo.PageParam; + +/** + * 盘点物料 Service 接口 + * + * @author 管理员 + */ +public interface StorageCheckMatService { + + /** + * 创建盘点物料 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + Long createStorageCheckMat(@Valid StorageCheckMatSaveReqVO createReqVO); + + /** + * 更新盘点物料 + * + * @param updateReqVO 更新信息 + */ + void updateStorageCheckMat(@Valid StorageCheckMatSaveReqVO updateReqVO); + + /** + * 删除盘点物料 + * + * @param id 编号 + */ + void deleteStorageCheckMat(Long id); + + /** + * 获得盘点物料 + * + * @param id 编号 + * @return 盘点物料 + */ + StorageCheckMatDO getStorageCheckMat(Long id); + + /** + * 获得盘点物料分页 + * + * @param pageReqVO 分页查询 + * @return 盘点物料分页 + */ + PageResult getStorageCheckMatPage(StorageCheckMatPageReqVO 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/storagecheckmat/StorageCheckMatServiceImpl.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/storagecheckmat/StorageCheckMatServiceImpl.java new file mode 100644 index 00000000..6ab814b3 --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/storagecheckmat/StorageCheckMatServiceImpl.java @@ -0,0 +1,74 @@ +package com.chanko.yunxi.mes.module.heli.service.storagecheckmat; + +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.storagecheckmat.vo.*; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.storagecheckmat.StorageCheckMatDO; +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.storagecheckmat.StorageCheckMatMapper; + +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 StorageCheckMatServiceImpl implements StorageCheckMatService { + + @Resource + private StorageCheckMatMapper storageCheckMatMapper; + + @Override + public Long createStorageCheckMat(StorageCheckMatSaveReqVO createReqVO) { + // 插入 + StorageCheckMatDO storageCheckMat = BeanUtils.toBean(createReqVO, StorageCheckMatDO.class); + storageCheckMatMapper.insert(storageCheckMat); + // 返回 + return storageCheckMat.getId(); + } + + @Override + public void updateStorageCheckMat(StorageCheckMatSaveReqVO updateReqVO) { + // 校验存在 + validateStorageCheckMatExists(updateReqVO.getId()); + // 更新 + StorageCheckMatDO updateObj = BeanUtils.toBean(updateReqVO, StorageCheckMatDO.class); + storageCheckMatMapper.updateById(updateObj); + } + + @Override + public void deleteStorageCheckMat(Long id) { + // 校验存在 + validateStorageCheckMatExists(id); + // 删除 + storageCheckMatMapper.deleteById(id); + } + + private void validateStorageCheckMatExists(Long id) { + if (storageCheckMatMapper.selectById(id) == null) { + throw exception(STORAGE_CHECK_MAT_NOT_EXISTS); + } + } + + @Override + public StorageCheckMatDO getStorageCheckMat(Long id) { + return storageCheckMatMapper.selectById(id); + } + + @Override + public PageResult getStorageCheckMatPage(StorageCheckMatPageReqVO pageReqVO) { + return storageCheckMatMapper.selectPage(pageReqVO); + } + +} \ No newline at end of file diff --git a/mes-module-heli/mes-module-heli-biz/src/main/resources/mapper/storagecheck/StorageCheckMapper.xml b/mes-module-heli/mes-module-heli-biz/src/main/resources/mapper/storagecheck/StorageCheckMapper.xml new file mode 100644 index 00000000..8971e1c4 --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/resources/mapper/storagecheck/StorageCheckMapper.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/storagecheckmat/StorageCheckMatMapper.xml b/mes-module-heli/mes-module-heli-biz/src/main/resources/mapper/storagecheckmat/StorageCheckMatMapper.xml new file mode 100644 index 00000000..21bc3b44 --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/resources/mapper/storagecheckmat/StorageCheckMatMapper.xml @@ -0,0 +1,12 @@ + + + + + + + \ No newline at end of file diff --git a/mes-ui/mes-ui-admin-vue3/src/api/heli/storagecheck/index.ts b/mes-ui/mes-ui-admin-vue3/src/api/heli/storagecheck/index.ts new file mode 100644 index 00000000..6eec5658 --- /dev/null +++ b/mes-ui/mes-ui-admin-vue3/src/api/heli/storagecheck/index.ts @@ -0,0 +1,47 @@ +import request from '@/config/axios' + +export interface StorageCheckVO { + id: number + stockNo: string + checkType: number + noZero: number + description: string + status: number + whId: number + keeper: number + keeperTime: Date + outbound: number + outboundTime: Date + cancel: number + cancelTime: Date +} + +// 查询入/出库盘点分页 +export const getStorageCheckPage = async (params) => { + return await request.get({ url: `/heli/storage-check/page`, params }) +} + +// 查询入/出库盘点详情 +export const getStorageCheck = async (id: number) => { + return await request.get({ url: `/heli/storage-check/get?id=` + id }) +} + +// 新增入/出库盘点 +export const createStorageCheck = async (data: StorageCheckVO) => { + return await request.post({ url: `/heli/storage-check/create`, data }) +} + +// 修改入/出库盘点 +export const updateStorageCheck = async (data: StorageCheckVO) => { + return await request.put({ url: `/heli/storage-check/update`, data }) +} + +// 删除入/出库盘点 +export const deleteStorageCheck = async (id: number) => { + return await request.delete({ url: `/heli/storage-check/delete?id=` + id }) +} + +// 导出入/出库盘点 Excel +export const exportStorageCheck = async (params) => { + return await request.download({ url: `/heli/storage-check/export-excel`, params }) +} \ No newline at end of file diff --git a/mes-ui/mes-ui-admin-vue3/src/api/heli/storagecheckmat/index.ts b/mes-ui/mes-ui-admin-vue3/src/api/heli/storagecheckmat/index.ts new file mode 100644 index 00000000..c2efa32c --- /dev/null +++ b/mes-ui/mes-ui-admin-vue3/src/api/heli/storagecheckmat/index.ts @@ -0,0 +1,43 @@ +import request from '@/config/axios' + +export interface StorageCheckMatVO { + id: number + checkId: number + matId: number + whId: number + rgId: number + pnId: number + storageOkQty: number + matRest: number + lotNo: string +} + +// 查询盘点物料分页 +export const getStorageCheckMatPage = async (params) => { + return await request.get({ url: `/heli/storage-check-mat/page`, params }) +} + +// 查询盘点物料详情 +export const getStorageCheckMat = async (id: number) => { + return await request.get({ url: `/heli/storage-check-mat/get?id=` + id }) +} + +// 新增盘点物料 +export const createStorageCheckMat = async (data: StorageCheckMatVO) => { + return await request.post({ url: `/heli/storage-check-mat/create`, data }) +} + +// 修改盘点物料 +export const updateStorageCheckMat = async (data: StorageCheckMatVO) => { + return await request.put({ url: `/heli/storage-check-mat/update`, data }) +} + +// 删除盘点物料 +export const deleteStorageCheckMat = async (id: number) => { + return await request.delete({ url: `/heli/storage-check-mat/delete?id=` + id }) +} + +// 导出盘点物料 Excel +export const exportStorageCheckMat = async (params) => { + return await request.download({ url: `/heli/storage-check-mat/export-excel`, params }) +} \ No newline at end of file diff --git a/mes-ui/mes-ui-admin-vue3/src/views/heli/storagecheck/StorageCheckForm.vue b/mes-ui/mes-ui-admin-vue3/src/views/heli/storagecheck/StorageCheckForm.vue new file mode 100644 index 00000000..2518bfd1 --- /dev/null +++ b/mes-ui/mes-ui-admin-vue3/src/views/heli/storagecheck/StorageCheckForm.vue @@ -0,0 +1,183 @@ + + \ No newline at end of file diff --git a/mes-ui/mes-ui-admin-vue3/src/views/heli/storagecheck/index.vue b/mes-ui/mes-ui-admin-vue3/src/views/heli/storagecheck/index.vue new file mode 100644 index 00000000..bbd6a5ad --- /dev/null +++ b/mes-ui/mes-ui-admin-vue3/src/views/heli/storagecheck/index.vue @@ -0,0 +1,404 @@ + + + \ No newline at end of file diff --git a/mes-ui/mes-ui-admin-vue3/src/views/heli/storagecheckmat/StorageCheckMatForm.vue b/mes-ui/mes-ui-admin-vue3/src/views/heli/storagecheckmat/StorageCheckMatForm.vue new file mode 100644 index 00000000..4bf830b0 --- /dev/null +++ b/mes-ui/mes-ui-admin-vue3/src/views/heli/storagecheckmat/StorageCheckMatForm.vue @@ -0,0 +1,128 @@ + + \ No newline at end of file diff --git a/mes-ui/mes-ui-admin-vue3/src/views/heli/storagecheckmat/index.vue b/mes-ui/mes-ui-admin-vue3/src/views/heli/storagecheckmat/index.vue new file mode 100644 index 00000000..e1683648 --- /dev/null +++ b/mes-ui/mes-ui-admin-vue3/src/views/heli/storagecheckmat/index.vue @@ -0,0 +1,314 @@ + + + \ No newline at end of file