fix:物料新增入库
This commit is contained in:
@@ -182,6 +182,7 @@ public interface ErrorCodeConstants {
|
|||||||
ErrorCode MATERIAL_LIFECYCLE_NOT_EXISTS = new ErrorCode(1_032_160_000, "物料通用流程不存在");
|
ErrorCode MATERIAL_LIFECYCLE_NOT_EXISTS = new ErrorCode(1_032_160_000, "物料通用流程不存在");
|
||||||
|
|
||||||
ErrorCode MATERIAL_BATCH_NOT_EXISTS = new ErrorCode(1_032_160_000, "物料批次不存在");
|
ErrorCode MATERIAL_BATCH_NOT_EXISTS = new ErrorCode(1_032_160_000, "物料批次不存在");
|
||||||
|
ErrorCode MATERIAL_BATCH_GONG_NOT_EXISTS = new ErrorCode(1_032_160_000, "物料批次工段不存在");
|
||||||
ErrorCode MATERIAL_BATCH_ASSIGN_END = new ErrorCode(1_032_160_000, "物料批次已拆分,不可操作");
|
ErrorCode MATERIAL_BATCH_ASSIGN_END = new ErrorCode(1_032_160_000, "物料批次已拆分,不可操作");
|
||||||
ErrorCode GONGDUAN_BELONG_MATERIAL_BATCH_NOT_EQUAL = new ErrorCode(1_032_160_000, "工段所属的物料批次不一致");
|
ErrorCode GONGDUAN_BELONG_MATERIAL_BATCH_NOT_EQUAL = new ErrorCode(1_032_160_000, "工段所属的物料批次不一致");
|
||||||
ErrorCode GONGDUAN_QUANTITY_MATERIAL_BATCH_NOT_EQUAL = new ErrorCode(1_032_160_000, "工段累加数量和批次数量不一致");
|
ErrorCode GONGDUAN_QUANTITY_MATERIAL_BATCH_NOT_EQUAL = new ErrorCode(1_032_160_000, "工段累加数量和批次数量不一致");
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ import java.util.List;
|
|||||||
import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
|
import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
|
||||||
import static com.zt.plat.framework.common.pojo.CommonResult.success;
|
import static com.zt.plat.framework.common.pojo.CommonResult.success;
|
||||||
|
|
||||||
@Tag(name = "管理后台 - 入库")
|
@Tag(name = "管理后台 - 物料入库")
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/qms/resource/material-inventory-inbound")
|
@RequestMapping("/qms/resource/material-inventory-inbound")
|
||||||
@Validated
|
@Validated
|
||||||
@@ -41,21 +41,13 @@ public class MaterialInventoryInboundController implements BusinessControllerMar
|
|||||||
@Resource
|
@Resource
|
||||||
private MaterialInventoryInboundService materialInventoryInboundService;
|
private MaterialInventoryInboundService materialInventoryInboundService;
|
||||||
|
|
||||||
@PostMapping("/create")
|
@PostMapping("/add")
|
||||||
@Operation(summary = "物料入库")
|
@Operation(summary = "物料入库")
|
||||||
// @PreAuthorize("@ss.hasPermission('qms:material-inventory-inbound:create')")
|
// @PreAuthorize("@ss.hasPermission('qms:material-inventory-inbound:create')")
|
||||||
public CommonResult<MaterialInventoryInboundRespVO> createMaterialInventoryInbound(@Valid @RequestBody MaterialInventoryInboundSaveReqVO createReqVO) {
|
public CommonResult<MaterialInventoryInboundRespVO> createMaterialInventoryInbound(@Valid @RequestBody MaterialInventoryInboundSaveReqVO createReqVO) {
|
||||||
return success(materialInventoryInboundService.createMaterialInventoryInbound(createReqVO));
|
return success(materialInventoryInboundService.createMaterialInventoryInbound(createReqVO));
|
||||||
}
|
}
|
||||||
|
|
||||||
@PutMapping("/update")
|
|
||||||
@Operation(summary = "更新入库")
|
|
||||||
@PreAuthorize("@ss.hasPermission('qms:material-inventory-inbound:update')")
|
|
||||||
public CommonResult<Boolean> updateMaterialInventoryInbound(@Valid @RequestBody MaterialInventoryInboundSaveReqVO updateReqVO) {
|
|
||||||
materialInventoryInboundService.updateMaterialInventoryInbound(updateReqVO);
|
|
||||||
return success(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
@DeleteMapping("/delete")
|
@DeleteMapping("/delete")
|
||||||
@Operation(summary = "删除入库")
|
@Operation(summary = "删除入库")
|
||||||
@Parameter(name = "id", description = "编号", required = true)
|
@Parameter(name = "id", description = "编号", required = true)
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ import static com.zt.plat.framework.common.pojo.CommonResult.success;
|
|||||||
|
|
||||||
@Tag(name = "管理后台 - 入库明细,验收入库、盘盈入库等")
|
@Tag(name = "管理后台 - 入库明细,验收入库、盘盈入库等")
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/t/material-inventory-inbound-detail")
|
@RequestMapping("/qms/resource/material-inventory-inbound-detail")
|
||||||
@Validated
|
@Validated
|
||||||
public class MaterialInventoryInboundDetailController implements BusinessControllerMarker {
|
public class MaterialInventoryInboundDetailController implements BusinessControllerMarker {
|
||||||
|
|
||||||
@@ -41,14 +41,14 @@ public class MaterialInventoryInboundDetailController implements BusinessControl
|
|||||||
|
|
||||||
@PostMapping("/create")
|
@PostMapping("/create")
|
||||||
@Operation(summary = "创建入库明细,验收入库、盘盈入库等")
|
@Operation(summary = "创建入库明细,验收入库、盘盈入库等")
|
||||||
@PreAuthorize("@ss.hasPermission('t:material-inventory-inbound-detail:create')")
|
@PreAuthorize("@ss.hasPermission('qms:material-inventory-inbound-detail:create')")
|
||||||
public CommonResult<MaterialInventoryInboundDetailRespVO> createMaterialInventoryInboundDetail(@Valid @RequestBody MaterialInventoryInboundDetailSaveReqVO createReqVO) {
|
public CommonResult<MaterialInventoryInboundDetailRespVO> createMaterialInventoryInboundDetail(@Valid @RequestBody MaterialInventoryInboundDetailSaveReqVO createReqVO) {
|
||||||
return success(materialInventoryInboundDetailService.createMaterialInventoryInboundDetail(createReqVO));
|
return success(materialInventoryInboundDetailService.createMaterialInventoryInboundDetail(createReqVO));
|
||||||
}
|
}
|
||||||
|
|
||||||
@PutMapping("/update")
|
@PutMapping("/update")
|
||||||
@Operation(summary = "更新入库明细,验收入库、盘盈入库等")
|
@Operation(summary = "更新入库明细,验收入库、盘盈入库等")
|
||||||
@PreAuthorize("@ss.hasPermission('t:material-inventory-inbound-detail:update')")
|
@PreAuthorize("@ss.hasPermission('qms:material-inventory-inbound-detail:update')")
|
||||||
public CommonResult<Boolean> updateMaterialInventoryInboundDetail(@Valid @RequestBody MaterialInventoryInboundDetailSaveReqVO updateReqVO) {
|
public CommonResult<Boolean> updateMaterialInventoryInboundDetail(@Valid @RequestBody MaterialInventoryInboundDetailSaveReqVO updateReqVO) {
|
||||||
materialInventoryInboundDetailService.updateMaterialInventoryInboundDetail(updateReqVO);
|
materialInventoryInboundDetailService.updateMaterialInventoryInboundDetail(updateReqVO);
|
||||||
return success(true);
|
return success(true);
|
||||||
@@ -57,7 +57,7 @@ public class MaterialInventoryInboundDetailController implements BusinessControl
|
|||||||
@DeleteMapping("/delete")
|
@DeleteMapping("/delete")
|
||||||
@Operation(summary = "删除入库明细,验收入库、盘盈入库等")
|
@Operation(summary = "删除入库明细,验收入库、盘盈入库等")
|
||||||
@Parameter(name = "id", description = "编号", required = true)
|
@Parameter(name = "id", description = "编号", required = true)
|
||||||
@PreAuthorize("@ss.hasPermission('t:material-inventory-inbound-detail:delete')")
|
@PreAuthorize("@ss.hasPermission('qms:material-inventory-inbound-detail:delete')")
|
||||||
public CommonResult<Boolean> deleteMaterialInventoryInboundDetail(@RequestParam("id") Long id) {
|
public CommonResult<Boolean> deleteMaterialInventoryInboundDetail(@RequestParam("id") Long id) {
|
||||||
materialInventoryInboundDetailService.deleteMaterialInventoryInboundDetail(id);
|
materialInventoryInboundDetailService.deleteMaterialInventoryInboundDetail(id);
|
||||||
return success(true);
|
return success(true);
|
||||||
@@ -66,7 +66,7 @@ public class MaterialInventoryInboundDetailController implements BusinessControl
|
|||||||
@DeleteMapping("/delete-list")
|
@DeleteMapping("/delete-list")
|
||||||
@Parameter(name = "ids", description = "编号", required = true)
|
@Parameter(name = "ids", description = "编号", required = true)
|
||||||
@Operation(summary = "批量删除入库明细,验收入库、盘盈入库等")
|
@Operation(summary = "批量删除入库明细,验收入库、盘盈入库等")
|
||||||
@PreAuthorize("@ss.hasPermission('t:material-inventory-inbound-detail:delete')")
|
@PreAuthorize("@ss.hasPermission('qms:material-inventory-inbound-detail:delete')")
|
||||||
public CommonResult<Boolean> deleteMaterialInventoryInboundDetailList(@RequestBody BatchDeleteReqVO req) {
|
public CommonResult<Boolean> deleteMaterialInventoryInboundDetailList(@RequestBody BatchDeleteReqVO req) {
|
||||||
materialInventoryInboundDetailService.deleteMaterialInventoryInboundDetailListByIds(req.getIds());
|
materialInventoryInboundDetailService.deleteMaterialInventoryInboundDetailListByIds(req.getIds());
|
||||||
return success(true);
|
return success(true);
|
||||||
@@ -75,7 +75,7 @@ public class MaterialInventoryInboundDetailController implements BusinessControl
|
|||||||
@GetMapping("/get")
|
@GetMapping("/get")
|
||||||
@Operation(summary = "获得入库明细,验收入库、盘盈入库等")
|
@Operation(summary = "获得入库明细,验收入库、盘盈入库等")
|
||||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||||
@PreAuthorize("@ss.hasPermission('t:material-inventory-inbound-detail:query')")
|
@PreAuthorize("@ss.hasPermission('qms:material-inventory-inbound-detail:query')")
|
||||||
public CommonResult<MaterialInventoryInboundDetailRespVO> getMaterialInventoryInboundDetail(@RequestParam("id") Long id) {
|
public CommonResult<MaterialInventoryInboundDetailRespVO> getMaterialInventoryInboundDetail(@RequestParam("id") Long id) {
|
||||||
MaterialInventoryInboundDetailDO materialInventoryInboundDetail = materialInventoryInboundDetailService.getMaterialInventoryInboundDetail(id);
|
MaterialInventoryInboundDetailDO materialInventoryInboundDetail = materialInventoryInboundDetailService.getMaterialInventoryInboundDetail(id);
|
||||||
return success(BeanUtils.toBean(materialInventoryInboundDetail, MaterialInventoryInboundDetailRespVO.class));
|
return success(BeanUtils.toBean(materialInventoryInboundDetail, MaterialInventoryInboundDetailRespVO.class));
|
||||||
@@ -83,7 +83,7 @@ public class MaterialInventoryInboundDetailController implements BusinessControl
|
|||||||
|
|
||||||
@GetMapping("/page")
|
@GetMapping("/page")
|
||||||
@Operation(summary = "获得入库明细,验收入库、盘盈入库等分页")
|
@Operation(summary = "获得入库明细,验收入库、盘盈入库等分页")
|
||||||
@PreAuthorize("@ss.hasPermission('t:material-inventory-inbound-detail:query')")
|
// @PreAuthorize("@ss.hasPermission('qms:material-inventory-inbound-detail:query')")
|
||||||
public CommonResult<PageResult<MaterialInventoryInboundDetailRespVO>> getMaterialInventoryInboundDetailPage(@Valid MaterialInventoryInboundDetailPageReqVO pageReqVO) {
|
public CommonResult<PageResult<MaterialInventoryInboundDetailRespVO>> getMaterialInventoryInboundDetailPage(@Valid MaterialInventoryInboundDetailPageReqVO pageReqVO) {
|
||||||
PageResult<MaterialInventoryInboundDetailDO> pageResult = materialInventoryInboundDetailService.getMaterialInventoryInboundDetailPage(pageReqVO);
|
PageResult<MaterialInventoryInboundDetailDO> pageResult = materialInventoryInboundDetailService.getMaterialInventoryInboundDetailPage(pageReqVO);
|
||||||
return success(BeanUtils.toBean(pageResult, MaterialInventoryInboundDetailRespVO.class));
|
return success(BeanUtils.toBean(pageResult, MaterialInventoryInboundDetailRespVO.class));
|
||||||
@@ -91,7 +91,7 @@ public class MaterialInventoryInboundDetailController implements BusinessControl
|
|||||||
|
|
||||||
@GetMapping("/export-excel")
|
@GetMapping("/export-excel")
|
||||||
@Operation(summary = "导出入库明细,验收入库、盘盈入库等 Excel")
|
@Operation(summary = "导出入库明细,验收入库、盘盈入库等 Excel")
|
||||||
@PreAuthorize("@ss.hasPermission('t:material-inventory-inbound-detail:export')")
|
@PreAuthorize("@ss.hasPermission('qms:material-inventory-inbound-detail:export')")
|
||||||
@ApiAccessLog(operateType = EXPORT)
|
@ApiAccessLog(operateType = EXPORT)
|
||||||
public void exportMaterialInventoryInboundDetailExcel(@Valid MaterialInventoryInboundDetailPageReqVO pageReqVO,
|
public void exportMaterialInventoryInboundDetailExcel(@Valid MaterialInventoryInboundDetailPageReqVO pageReqVO,
|
||||||
HttpServletResponse response) throws IOException {
|
HttpServletResponse response) throws IOException {
|
||||||
|
|||||||
@@ -25,6 +25,9 @@ public class MaterialBatchPageReqVO extends PageParam {
|
|||||||
@Schema(description = "是否只需要工段")
|
@Schema(description = "是否只需要工段")
|
||||||
private Boolean onlyGong = false;
|
private Boolean onlyGong = false;
|
||||||
|
|
||||||
|
@Schema(description = "true-已处理,false-未处理")
|
||||||
|
private Boolean treatment = false;
|
||||||
|
|
||||||
@Schema(description = "批次编号")
|
@Schema(description = "批次编号")
|
||||||
private String batchNo;
|
private String batchNo;
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.zt.plat.module.qms.resource.material.controller.vo;
|
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 io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
import org.springframework.format.annotation.DateTimeFormat;
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
@@ -48,6 +49,10 @@ public class MaterialBatchRespVO {
|
|||||||
@ExcelProperty("总数量")
|
@ExcelProperty("总数量")
|
||||||
private BigDecimal inboundQuantity;
|
private BigDecimal inboundQuantity;
|
||||||
|
|
||||||
|
@Schema(description = "已入库数量")
|
||||||
|
@ExcelProperty("已入库数量")
|
||||||
|
private BigDecimal inboundEndQuantity;
|
||||||
|
|
||||||
@Schema(description = "存放位置描述")
|
@Schema(description = "存放位置描述")
|
||||||
@ExcelProperty("存放位置描述")
|
@ExcelProperty("存放位置描述")
|
||||||
private String location;
|
private String location;
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.zt.plat.module.qms.resource.material.controller.vo;
|
package com.zt.plat.module.qms.resource.material.controller.vo;
|
||||||
|
|
||||||
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import com.zt.plat.framework.common.pojo.PageParam;
|
import com.zt.plat.framework.common.pojo.PageParam;
|
||||||
@@ -26,6 +27,9 @@ public class MaterialInfomationPageReqVO extends PageParam {
|
|||||||
@Schema(description = "编码")
|
@Schema(description = "编码")
|
||||||
private String code;
|
private String code;
|
||||||
|
|
||||||
|
@Schema(description = "名称")
|
||||||
|
private String name;
|
||||||
|
|
||||||
@Schema(description = "技术参数")
|
@Schema(description = "技术参数")
|
||||||
private String parameter;
|
private String parameter;
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.zt.plat.module.qms.resource.material.controller.vo;
|
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 io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
import org.springframework.format.annotation.DateTimeFormat;
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
@@ -33,6 +34,10 @@ public class MaterialInfomationRespVO {
|
|||||||
@ExcelProperty("编码")
|
@ExcelProperty("编码")
|
||||||
private String code;
|
private String code;
|
||||||
|
|
||||||
|
@Schema(description = "名称")
|
||||||
|
@ExcelProperty("名称")
|
||||||
|
private String name;
|
||||||
|
|
||||||
@Schema(description = "技术参数")
|
@Schema(description = "技术参数")
|
||||||
@ExcelProperty("技术参数")
|
@ExcelProperty("技术参数")
|
||||||
private String parameter;
|
private String parameter;
|
||||||
|
|||||||
@@ -1,9 +1,7 @@
|
|||||||
package com.zt.plat.module.qms.resource.material.controller.vo;
|
package com.zt.plat.module.qms.resource.material.controller.vo;
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.*;
|
import lombok.Data;
|
||||||
import jakarta.validation.constraints.*;
|
|
||||||
import org.springframework.format.annotation.DateTimeFormat;
|
|
||||||
|
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
@@ -27,6 +25,9 @@ public class MaterialInfomationSaveReqVO {
|
|||||||
@Schema(description = "编码")
|
@Schema(description = "编码")
|
||||||
private String code;
|
private String code;
|
||||||
|
|
||||||
|
@Schema(description = "名称")
|
||||||
|
private String name;
|
||||||
|
|
||||||
@Schema(description = "技术参数")
|
@Schema(description = "技术参数")
|
||||||
private String parameter;
|
private String parameter;
|
||||||
|
|
||||||
|
|||||||
@@ -24,10 +24,16 @@ public class MaterialInventoryInboundDetailRespVO {
|
|||||||
@ExcelProperty("批次id")
|
@ExcelProperty("批次id")
|
||||||
private Long batchId;
|
private Long batchId;
|
||||||
|
|
||||||
|
// 物料名称
|
||||||
|
|
||||||
|
// 批次编号
|
||||||
|
|
||||||
@Schema(description = "批次工段id", example = "1454")
|
@Schema(description = "批次工段id", example = "1454")
|
||||||
@ExcelProperty("批次工段id")
|
@ExcelProperty("批次工段id")
|
||||||
private Long batchGongduanId;
|
private Long batchGongduanId;
|
||||||
|
|
||||||
|
// 工段名
|
||||||
|
|
||||||
@Schema(description = "物料实例ID", example = "17457")
|
@Schema(description = "物料实例ID", example = "17457")
|
||||||
@ExcelProperty("物料实例ID")
|
@ExcelProperty("物料实例ID")
|
||||||
private Long materialInfomationId;
|
private Long materialInfomationId;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package com.zt.plat.module.qms.resource.material.controller.vo;
|
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 io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import jakarta.validation.constraints.Min;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
@@ -48,6 +48,7 @@ public class MaterialInventoryInboundSaveReqVO {
|
|||||||
private Long gongduanId;
|
private Long gongduanId;
|
||||||
|
|
||||||
@Schema(description = "入库数量")
|
@Schema(description = "入库数量")
|
||||||
|
@Min(value = 0, message = "入库数量不能小于0")
|
||||||
private BigDecimal quantity;
|
private BigDecimal quantity;
|
||||||
|
|
||||||
@Schema(description = "库位id")
|
@Schema(description = "库位id")
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user