feat:入库、批量入库

This commit is contained in:
禁止呵呵
2025-12-09 09:29:14 +08:00
parent f2571944c1
commit c1b975cca0
16 changed files with 244 additions and 15 deletions

View File

@@ -26,18 +26,20 @@ import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.framework.common.pojo.CommonResult;
import com.zt.plat.framework.common.util.object.BeanUtils;
import static com.zt.plat.framework.common.pojo.CommonResult.success;
import static com.zt.plat.framework.common.pojo.CommonResult.error;
import com.zt.plat.framework.excel.core.util.ExcelUtils;
import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog;
import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*;
import static com.zt.plat.module.qms.enums.ErrorCodeConstants.MATERIAL_BATCH_ASSIGN_NOT_EXISTS;
import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialBatchAssignDO;
import com.zt.plat.module.qms.resource.material.service.MaterialBatchAssignService;
@Tag(name = "管理后台 - 物料批次分发")
@RestController
@RequestMapping("/qms/material-batch-assign")
@RequestMapping("/qms/resource/material-batch-assign")
@Validated
@FileUploadController(source = "qms.materialbatchassign")
public class MaterialBatchAssignController extends AbstractFileUploadController implements BusinessControllerMarker{
@@ -94,6 +96,21 @@ public class MaterialBatchAssignController extends AbstractFileUploadController
return success(BeanUtils.toBean(materialBatchAssign, MaterialBatchAssignRespVO.class));
}
@GetMapping("/get-by-inf")
@Operation(summary = "获得物料批次分发")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
// @PreAuthorize("@ss.hasPermission('qms:material-batch-assign:query')")
public CommonResult<PageResult<MaterialBatchAssignRespVO>> getMaterialBatchAssignByInfiId(MaterialBatchAssignPageReqVO pageReqVO) {
if(pageReqVO.getMaterialInfomationId()==null||pageReqVO.getMaterialInfomationId().length()==0){
return error(MATERIAL_BATCH_ASSIGN_NOT_EXISTS,"示例编号不能为空");
}
PageResult<MaterialBatchAssignDO> pageResult = materialBatchAssignService.getMaterialBatchAssignByInfId(pageReqVO);
return success(BeanUtils.toBean(pageResult, MaterialBatchAssignRespVO.class));
}
@GetMapping("/page")
@Operation(summary = "获得物料批次分发分页")
@PreAuthorize("@ss.hasPermission('qms:material-batch-assign:query')")

View File

@@ -1,8 +1,7 @@
package com.zt.plat.module.qms.resource.material.controller.admin;
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialBatchPageReqVO;
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialBatchRespVO;
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialBatchSaveReqVO;
import com.zt.plat.module.qms.resource.material.controller.vo.*;
import com.zt.plat.module.qms.resource.material.service.MaterialBatchAssignService;
import org.springframework.web.bind.annotation.*;
import jakarta.annotation.Resource;
import org.springframework.validation.annotation.Validated;
@@ -37,11 +36,14 @@ import com.zt.plat.module.qms.resource.material.service.MaterialBatchService;
@Tag(name = "管理后台 - 物料批次")
@RestController
@RequestMapping("/qms/material-batch")
@RequestMapping("/qms/resource/material-batch")
@Validated
@FileUploadController(source = "qms.materialbatch")
public class MaterialBatchController extends AbstractFileUploadController implements BusinessControllerMarker{
@Resource
private MaterialBatchAssignService materialBatchAssignService;
static {
FileUploadController annotation = MaterialBatchController.class.getAnnotation(FileUploadController.class);
if (annotation != null) {
@@ -115,4 +117,10 @@ public class MaterialBatchController extends AbstractFileUploadController implem
BeanUtils.toBean(list, MaterialBatchRespVO.class));
}
@PostMapping("/assign")
@Operation(summary = "物料分发")
public CommonResult<MaterialBatchAssignRespVO> assign(@Valid @RequestBody MaterialBatchAssignSaveReqVO createReqVO) {
return success(materialBatchAssignService.assignLab(createReqVO));
}
}

View File

@@ -3,6 +3,7 @@ package com.zt.plat.module.qms.resource.material.controller.admin;
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryInboundPageReqVO;
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryInboundRespVO;
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryInboundSaveReqVO;
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialProductRespVO;
import org.springframework.web.bind.annotation.*;
import jakarta.annotation.Resource;
import org.springframework.validation.annotation.Validated;
@@ -37,7 +38,7 @@ import com.zt.plat.module.qms.resource.material.service.MaterialInventoryInbound
@Tag(name = "管理后台 - 入库")
@RestController
@RequestMapping("/qms/material-inventory-inbound")
@RequestMapping("/qms/resource/material-inventory-inbound")
@Validated
@FileUploadController(source = "qms.materialinventoryinbound")
public class MaterialInventoryInboundController extends AbstractFileUploadController implements BusinessControllerMarker{
@@ -115,4 +116,16 @@ public class MaterialInventoryInboundController extends AbstractFileUploadContro
BeanUtils.toBean(list, MaterialInventoryInboundRespVO.class));
}
@PostMapping("/multi-put")
@Operation(summary = "批量上架")
public CommonResult<PageResult<MaterialInventoryInboundRespVO>> createMaterialInventoryInboundMulti(@Valid @RequestBody MaterialInventoryInboundSaveReqVO createReqVO) {
return success(materialInventoryInboundService.multiCreateMaterialInventoryInbound(createReqVO));
}
@PostMapping("single-put")
@Operation(summary = "单一上架")
public CommonResult<PageResult<MaterialInventoryInboundRespVO>> createMaterialInventoryInboundSingle(@Valid @RequestBody MaterialInventoryInboundSaveReqVO createReqVO) {
return success(materialInventoryInboundService.singleCreateMaterialInventoryInbound(createReqVO));
}
}

View File

@@ -37,4 +37,7 @@ public class MaterialBatchAssignPageReqVO extends PageParam {
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime;
@Schema(description = "实例ID")
private String materialInfomationId;
}

View File

@@ -10,13 +10,13 @@ public class MaterialBatchAssignSaveReqVO {
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "15114")
private Long id;
@Schema(description = "源批次ID", example = "23099")
@Schema(description = "源批次ID",requiredMode = Schema.RequiredMode.REQUIRED, example = "23099")
private Long batchId;
@Schema(description = "产品id", example = "10774")
private String productId;
@Schema(description = "库房ID", example = "24720")
@Schema(description = "库房ID",requiredMode = Schema.RequiredMode.REQUIRED, example = "24720")
private Long warehouseId;
@Schema(description = "数量")

View File

@@ -78,5 +78,8 @@ public class MaterialInfomationPageReqVO extends PageParam {
@Schema(description = "大类ids")
List<Long> productIds;
@Schema(description = "入库id")
private long inventoryInboundId;
}

View File

@@ -1,5 +1,6 @@
package com.zt.plat.module.qms.resource.material.controller.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
@@ -45,4 +46,19 @@ public class MaterialInventoryInboundDetailSaveReqVO {
@Schema(description = "备注")
private String remark;
@Schema(description = "申请数量")
private Long quantity;
/**
* 存放位置
*/
@TableField("LOC_ID")
private String locationId;
/**
* 物料大类id
*/
@TableField("PDT_ID")
private Long productId;
}

View File

@@ -1,5 +1,6 @@
package com.zt.plat.module.qms.resource.material.controller.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
@@ -51,4 +52,8 @@ public class MaterialInventoryInboundSaveReqVO {
@Schema(description = "备注")
private String remark;
@Schema(description = "详情",requiredMode = Schema.RequiredMode.REQUIRED)
private MaterialInventoryInboundDetailSaveReqVO detail;
}

View File

@@ -47,7 +47,7 @@ public class MaterialBatchAssignDO extends BusinessBaseDO {
* 数量
*/
@TableField("INB_QTY")
private String inboundQuantity;
private Long inboundQuantity;
/**
* 暂存位置记录
*/
@@ -64,4 +64,6 @@ public class MaterialBatchAssignDO extends BusinessBaseDO {
@TableField("RMK")
private String remark;
}

View File

@@ -121,4 +121,9 @@ public class MaterialInfomationDO extends BusinessBaseDO {
@TableField("RMK")
private String remark;
/**
* 库存入库id
*/
@TableField("INVT_INB_ID")
private long inventoryInboundId;
}

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