Compare commits
2 Commits
433ac9124b
...
8fa69a0906
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8fa69a0906 | ||
|
|
3bb70a94f2 |
@@ -150,9 +150,15 @@ public interface ErrorCodeConstants {
|
|||||||
ErrorCode MATERIAL_INFOMATION_NOT_EXISTS = new ErrorCode(1_032_150_000, "试剂耗材不存在");
|
ErrorCode MATERIAL_INFOMATION_NOT_EXISTS = new ErrorCode(1_032_150_000, "试剂耗材不存在");
|
||||||
ErrorCode MATERIAL_PRODUCT_NOT_EXISTS = new ErrorCode(1_032_150_000, "试剂耗材大类不存在");
|
ErrorCode MATERIAL_PRODUCT_NOT_EXISTS = new ErrorCode(1_032_150_000, "试剂耗材大类不存在");
|
||||||
|
|
||||||
|
|
||||||
ErrorCode MATERIAL_LIFECYCLE_DETAIL_NOT_EXISTS = new ErrorCode(1_032_150_000, "物料通用流程明细不存在");
|
ErrorCode MATERIAL_LIFECYCLE_DETAIL_NOT_EXISTS = new ErrorCode(1_032_150_000, "物料通用流程明细不存在");
|
||||||
ErrorCode MATERIAL_LIFECYCLE_NOT_EXISTS = new ErrorCode(1_032_150_000, "物料通用流程不存在");
|
ErrorCode MATERIAL_LIFECYCLE_NOT_EXISTS = new ErrorCode(1_032_150_000, "物料通用流程不存在");
|
||||||
|
|
||||||
|
ErrorCode MATERIAL_BATCH_NOT_EXISTS = new ErrorCode(1_032_150_000, "物料批次不存在");
|
||||||
|
ErrorCode MATERIAL_BATCH_ASSIGN_NOT_EXISTS = new ErrorCode(1_032_150_000, "物料批次分发不存在");
|
||||||
|
ErrorCode MATERIAL_INVENTORY_INBOUND_NOT_EXISTS = new ErrorCode(1_032_150_000, "入库,出库不存在");
|
||||||
|
ErrorCode MATERIAL_INVENTORY_INBOUND_DETAIL_NOT_EXISTS = new ErrorCode(1_032_150_000, "入库明细,出库明细等不存在");
|
||||||
|
|
||||||
|
|
||||||
/*================================= tx 1_032_200_000 ~ 1_032_249_999 ==================================*/
|
/*================================= tx 1_032_200_000 ~ 1_032_249_999 ==================================*/
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,118 @@
|
|||||||
|
package com.zt.plat.module.qms.resource.material.controller.admin;
|
||||||
|
|
||||||
|
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialBatchAssignPageReqVO;
|
||||||
|
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialBatchAssignRespVO;
|
||||||
|
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialBatchAssignSaveReqVO;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import com.zt.plat.framework.business.interceptor.BusinessControllerMarker;
|
||||||
|
import com.zt.plat.framework.business.annotation.FileUploadController;
|
||||||
|
import com.zt.plat.framework.business.controller.AbstractFileUploadController;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
|
||||||
|
import jakarta.validation.*;
|
||||||
|
import jakarta.servlet.http.*;
|
||||||
|
import java.util.*;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO;
|
||||||
|
import com.zt.plat.framework.common.pojo.PageParam;
|
||||||
|
import com.zt.plat.framework.common.pojo.PageResult;
|
||||||
|
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||||
|
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||||
|
import static com.zt.plat.framework.common.pojo.CommonResult.success;
|
||||||
|
|
||||||
|
import com.zt.plat.framework.excel.core.util.ExcelUtils;
|
||||||
|
|
||||||
|
import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog;
|
||||||
|
import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||||
|
|
||||||
|
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")
|
||||||
|
@Validated
|
||||||
|
@FileUploadController(source = "qms.materialbatchassign")
|
||||||
|
public class MaterialBatchAssignController extends AbstractFileUploadController implements BusinessControllerMarker{
|
||||||
|
|
||||||
|
static {
|
||||||
|
FileUploadController annotation = MaterialBatchAssignController.class.getAnnotation(FileUploadController.class);
|
||||||
|
if (annotation != null) {
|
||||||
|
setFileUploadInfo(annotation);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private MaterialBatchAssignService materialBatchAssignService;
|
||||||
|
|
||||||
|
@PostMapping("/create")
|
||||||
|
@Operation(summary = "创建物料批次分发")
|
||||||
|
@PreAuthorize("@ss.hasPermission('qms:material-batch-assign:create')")
|
||||||
|
public CommonResult<MaterialBatchAssignRespVO> createMaterialBatchAssign(@Valid @RequestBody MaterialBatchAssignSaveReqVO createReqVO) {
|
||||||
|
return success(materialBatchAssignService.createMaterialBatchAssign(createReqVO));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/update")
|
||||||
|
@Operation(summary = "更新物料批次分发")
|
||||||
|
@PreAuthorize("@ss.hasPermission('qms:material-batch-assign:update')")
|
||||||
|
public CommonResult<Boolean> updateMaterialBatchAssign(@Valid @RequestBody MaterialBatchAssignSaveReqVO updateReqVO) {
|
||||||
|
materialBatchAssignService.updateMaterialBatchAssign(updateReqVO);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete")
|
||||||
|
@Operation(summary = "删除物料批次分发")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true)
|
||||||
|
@PreAuthorize("@ss.hasPermission('qms:material-batch-assign:delete')")
|
||||||
|
public CommonResult<Boolean> deleteMaterialBatchAssign(@RequestParam("id") Long id) {
|
||||||
|
materialBatchAssignService.deleteMaterialBatchAssign(id);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete-list")
|
||||||
|
@Parameter(name = "ids", description = "编号", required = true)
|
||||||
|
@Operation(summary = "批量删除物料批次分发")
|
||||||
|
@PreAuthorize("@ss.hasPermission('qms:material-batch-assign:delete')")
|
||||||
|
public CommonResult<Boolean> deleteMaterialBatchAssignList(@RequestBody BatchDeleteReqVO req) {
|
||||||
|
materialBatchAssignService.deleteMaterialBatchAssignListByIds(req.getIds());
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/get")
|
||||||
|
@Operation(summary = "获得物料批次分发")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||||
|
@PreAuthorize("@ss.hasPermission('qms:material-batch-assign:query')")
|
||||||
|
public CommonResult<MaterialBatchAssignRespVO> getMaterialBatchAssign(@RequestParam("id") Long id) {
|
||||||
|
MaterialBatchAssignDO materialBatchAssign = materialBatchAssignService.getMaterialBatchAssign(id);
|
||||||
|
return success(BeanUtils.toBean(materialBatchAssign, MaterialBatchAssignRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/page")
|
||||||
|
@Operation(summary = "获得物料批次分发分页")
|
||||||
|
@PreAuthorize("@ss.hasPermission('qms:material-batch-assign:query')")
|
||||||
|
public CommonResult<PageResult<MaterialBatchAssignRespVO>> getMaterialBatchAssignPage(@Valid MaterialBatchAssignPageReqVO pageReqVO) {
|
||||||
|
PageResult<MaterialBatchAssignDO> pageResult = materialBatchAssignService.getMaterialBatchAssignPage(pageReqVO);
|
||||||
|
return success(BeanUtils.toBean(pageResult, MaterialBatchAssignRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/export-excel")
|
||||||
|
@Operation(summary = "导出物料批次分发 Excel")
|
||||||
|
@PreAuthorize("@ss.hasPermission('qms:material-batch-assign:export')")
|
||||||
|
@ApiAccessLog(operateType = EXPORT)
|
||||||
|
public void exportMaterialBatchAssignExcel(@Valid MaterialBatchAssignPageReqVO pageReqVO,
|
||||||
|
HttpServletResponse response) throws IOException {
|
||||||
|
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||||
|
List<MaterialBatchAssignDO> list = materialBatchAssignService.getMaterialBatchAssignPage(pageReqVO).getList();
|
||||||
|
// 导出 Excel
|
||||||
|
ExcelUtils.write(response, "物料批次分发.xls", "数据", MaterialBatchAssignRespVO.class,
|
||||||
|
BeanUtils.toBean(list, MaterialBatchAssignRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,118 @@
|
|||||||
|
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 org.springframework.web.bind.annotation.*;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import com.zt.plat.framework.business.interceptor.BusinessControllerMarker;
|
||||||
|
import com.zt.plat.framework.business.annotation.FileUploadController;
|
||||||
|
import com.zt.plat.framework.business.controller.AbstractFileUploadController;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
|
||||||
|
import jakarta.validation.*;
|
||||||
|
import jakarta.servlet.http.*;
|
||||||
|
import java.util.*;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO;
|
||||||
|
import com.zt.plat.framework.common.pojo.PageParam;
|
||||||
|
import com.zt.plat.framework.common.pojo.PageResult;
|
||||||
|
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||||
|
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||||
|
import static com.zt.plat.framework.common.pojo.CommonResult.success;
|
||||||
|
|
||||||
|
import com.zt.plat.framework.excel.core.util.ExcelUtils;
|
||||||
|
|
||||||
|
import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog;
|
||||||
|
import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||||
|
|
||||||
|
import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialBatchDO;
|
||||||
|
import com.zt.plat.module.qms.resource.material.service.MaterialBatchService;
|
||||||
|
|
||||||
|
@Tag(name = "管理后台 - 物料批次")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/qms/material-batch")
|
||||||
|
@Validated
|
||||||
|
@FileUploadController(source = "qms.materialbatch")
|
||||||
|
public class MaterialBatchController extends AbstractFileUploadController implements BusinessControllerMarker{
|
||||||
|
|
||||||
|
static {
|
||||||
|
FileUploadController annotation = MaterialBatchController.class.getAnnotation(FileUploadController.class);
|
||||||
|
if (annotation != null) {
|
||||||
|
setFileUploadInfo(annotation);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private MaterialBatchService materialBatchService;
|
||||||
|
|
||||||
|
@PostMapping("/create")
|
||||||
|
@Operation(summary = "创建物料批次")
|
||||||
|
@PreAuthorize("@ss.hasPermission('qms:material-batch:create')")
|
||||||
|
public CommonResult<MaterialBatchRespVO> createMaterialBatch(@Valid @RequestBody MaterialBatchSaveReqVO createReqVO) {
|
||||||
|
return success(materialBatchService.createMaterialBatch(createReqVO));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/update")
|
||||||
|
@Operation(summary = "更新物料批次")
|
||||||
|
@PreAuthorize("@ss.hasPermission('qms:material-batch:update')")
|
||||||
|
public CommonResult<Boolean> updateMaterialBatch(@Valid @RequestBody MaterialBatchSaveReqVO updateReqVO) {
|
||||||
|
materialBatchService.updateMaterialBatch(updateReqVO);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete")
|
||||||
|
@Operation(summary = "删除物料批次")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true)
|
||||||
|
@PreAuthorize("@ss.hasPermission('qms:material-batch:delete')")
|
||||||
|
public CommonResult<Boolean> deleteMaterialBatch(@RequestParam("id") Long id) {
|
||||||
|
materialBatchService.deleteMaterialBatch(id);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete-list")
|
||||||
|
@Parameter(name = "ids", description = "编号", required = true)
|
||||||
|
@Operation(summary = "批量删除物料批次")
|
||||||
|
@PreAuthorize("@ss.hasPermission('qms:material-batch:delete')")
|
||||||
|
public CommonResult<Boolean> deleteMaterialBatchList(@RequestBody BatchDeleteReqVO req) {
|
||||||
|
materialBatchService.deleteMaterialBatchListByIds(req.getIds());
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/get")
|
||||||
|
@Operation(summary = "获得物料批次")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||||
|
@PreAuthorize("@ss.hasPermission('qms:material-batch:query')")
|
||||||
|
public CommonResult<MaterialBatchRespVO> getMaterialBatch(@RequestParam("id") Long id) {
|
||||||
|
MaterialBatchDO materialBatch = materialBatchService.getMaterialBatch(id);
|
||||||
|
return success(BeanUtils.toBean(materialBatch, MaterialBatchRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/page")
|
||||||
|
@Operation(summary = "获得物料批次分页")
|
||||||
|
@PreAuthorize("@ss.hasPermission('qms:material-batch:query')")
|
||||||
|
public CommonResult<PageResult<MaterialBatchRespVO>> getMaterialBatchPage(@Valid MaterialBatchPageReqVO pageReqVO) {
|
||||||
|
PageResult<MaterialBatchDO> pageResult = materialBatchService.getMaterialBatchPage(pageReqVO);
|
||||||
|
return success(BeanUtils.toBean(pageResult, MaterialBatchRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/export-excel")
|
||||||
|
@Operation(summary = "导出物料批次 Excel")
|
||||||
|
@PreAuthorize("@ss.hasPermission('qms:material-batch:export')")
|
||||||
|
@ApiAccessLog(operateType = EXPORT)
|
||||||
|
public void exportMaterialBatchExcel(@Valid MaterialBatchPageReqVO pageReqVO,
|
||||||
|
HttpServletResponse response) throws IOException {
|
||||||
|
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||||
|
List<MaterialBatchDO> list = materialBatchService.getMaterialBatchPage(pageReqVO).getList();
|
||||||
|
// 导出 Excel
|
||||||
|
ExcelUtils.write(response, "物料批次.xls", "数据", MaterialBatchRespVO.class,
|
||||||
|
BeanUtils.toBean(list, MaterialBatchRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,118 @@
|
|||||||
|
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 org.springframework.web.bind.annotation.*;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import com.zt.plat.framework.business.interceptor.BusinessControllerMarker;
|
||||||
|
import com.zt.plat.framework.business.annotation.FileUploadController;
|
||||||
|
import com.zt.plat.framework.business.controller.AbstractFileUploadController;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
|
||||||
|
import jakarta.validation.*;
|
||||||
|
import jakarta.servlet.http.*;
|
||||||
|
import java.util.*;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO;
|
||||||
|
import com.zt.plat.framework.common.pojo.PageParam;
|
||||||
|
import com.zt.plat.framework.common.pojo.PageResult;
|
||||||
|
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||||
|
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||||
|
import static com.zt.plat.framework.common.pojo.CommonResult.success;
|
||||||
|
|
||||||
|
import com.zt.plat.framework.excel.core.util.ExcelUtils;
|
||||||
|
|
||||||
|
import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog;
|
||||||
|
import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||||
|
|
||||||
|
import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialInventoryInboundDO;
|
||||||
|
import com.zt.plat.module.qms.resource.material.service.MaterialInventoryInboundService;
|
||||||
|
|
||||||
|
@Tag(name = "管理后台 - 入库")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/qms/material-inventory-inbound")
|
||||||
|
@Validated
|
||||||
|
@FileUploadController(source = "qms.materialinventoryinbound")
|
||||||
|
public class MaterialInventoryInboundController extends AbstractFileUploadController implements BusinessControllerMarker{
|
||||||
|
|
||||||
|
static {
|
||||||
|
FileUploadController annotation = MaterialInventoryInboundController.class.getAnnotation(FileUploadController.class);
|
||||||
|
if (annotation != null) {
|
||||||
|
setFileUploadInfo(annotation);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private MaterialInventoryInboundService materialInventoryInboundService;
|
||||||
|
|
||||||
|
@PostMapping("/create")
|
||||||
|
@Operation(summary = "创建入库")
|
||||||
|
@PreAuthorize("@ss.hasPermission('qms:material-inventory-inbound:create')")
|
||||||
|
public CommonResult<MaterialInventoryInboundRespVO> createMaterialInventoryInbound(@Valid @RequestBody MaterialInventoryInboundSaveReqVO 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")
|
||||||
|
@Operation(summary = "删除入库")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true)
|
||||||
|
@PreAuthorize("@ss.hasPermission('qms:material-inventory-inbound:delete')")
|
||||||
|
public CommonResult<Boolean> deleteMaterialInventoryInbound(@RequestParam("id") Long id) {
|
||||||
|
materialInventoryInboundService.deleteMaterialInventoryInbound(id);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete-list")
|
||||||
|
@Parameter(name = "ids", description = "编号", required = true)
|
||||||
|
@Operation(summary = "批量删除入库")
|
||||||
|
@PreAuthorize("@ss.hasPermission('qms:material-inventory-inbound:delete')")
|
||||||
|
public CommonResult<Boolean> deleteMaterialInventoryInboundList(@RequestBody BatchDeleteReqVO req) {
|
||||||
|
materialInventoryInboundService.deleteMaterialInventoryInboundListByIds(req.getIds());
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/get")
|
||||||
|
@Operation(summary = "获得入库")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||||
|
@PreAuthorize("@ss.hasPermission('qms:material-inventory-inbound:query')")
|
||||||
|
public CommonResult<MaterialInventoryInboundRespVO> getMaterialInventoryInbound(@RequestParam("id") Long id) {
|
||||||
|
MaterialInventoryInboundDO materialInventoryInbound = materialInventoryInboundService.getMaterialInventoryInbound(id);
|
||||||
|
return success(BeanUtils.toBean(materialInventoryInbound, MaterialInventoryInboundRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/page")
|
||||||
|
@Operation(summary = "获得入库分页")
|
||||||
|
@PreAuthorize("@ss.hasPermission('qms:material-inventory-inbound:query')")
|
||||||
|
public CommonResult<PageResult<MaterialInventoryInboundRespVO>> getMaterialInventoryInboundPage(@Valid MaterialInventoryInboundPageReqVO pageReqVO) {
|
||||||
|
PageResult<MaterialInventoryInboundDO> pageResult = materialInventoryInboundService.getMaterialInventoryInboundPage(pageReqVO);
|
||||||
|
return success(BeanUtils.toBean(pageResult, MaterialInventoryInboundRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/export-excel")
|
||||||
|
@Operation(summary = "导出入库 Excel")
|
||||||
|
@PreAuthorize("@ss.hasPermission('qms:material-inventory-inbound:export')")
|
||||||
|
@ApiAccessLog(operateType = EXPORT)
|
||||||
|
public void exportMaterialInventoryInboundExcel(@Valid MaterialInventoryInboundPageReqVO pageReqVO,
|
||||||
|
HttpServletResponse response) throws IOException {
|
||||||
|
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||||
|
List<MaterialInventoryInboundDO> list = materialInventoryInboundService.getMaterialInventoryInboundPage(pageReqVO).getList();
|
||||||
|
// 导出 Excel
|
||||||
|
ExcelUtils.write(response, "入库.xls", "数据", MaterialInventoryInboundRespVO.class,
|
||||||
|
BeanUtils.toBean(list, MaterialInventoryInboundRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,118 @@
|
|||||||
|
package com.zt.plat.module.qms.resource.material.controller.admin;
|
||||||
|
|
||||||
|
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryInboundDetailPageReqVO;
|
||||||
|
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryInboundDetailRespVO;
|
||||||
|
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryInboundDetailSaveReqVO;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import com.zt.plat.framework.business.interceptor.BusinessControllerMarker;
|
||||||
|
import com.zt.plat.framework.business.annotation.FileUploadController;
|
||||||
|
import com.zt.plat.framework.business.controller.AbstractFileUploadController;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
|
||||||
|
import jakarta.validation.*;
|
||||||
|
import jakarta.servlet.http.*;
|
||||||
|
import java.util.*;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO;
|
||||||
|
import com.zt.plat.framework.common.pojo.PageParam;
|
||||||
|
import com.zt.plat.framework.common.pojo.PageResult;
|
||||||
|
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||||
|
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||||
|
import static com.zt.plat.framework.common.pojo.CommonResult.success;
|
||||||
|
|
||||||
|
import com.zt.plat.framework.excel.core.util.ExcelUtils;
|
||||||
|
|
||||||
|
import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog;
|
||||||
|
import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||||
|
|
||||||
|
import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialInventoryInboundDetailDO;
|
||||||
|
import com.zt.plat.module.qms.resource.material.service.MaterialInventoryInboundDetailService;
|
||||||
|
|
||||||
|
@Tag(name = "管理后台 - 入库明细,出库明细,含领用出库、退货出库、盘亏出库、销毁出库等")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/qms/material-inventory-inbound-detail")
|
||||||
|
@Validated
|
||||||
|
@FileUploadController(source = "qms.materialinventoryinbounddetail")
|
||||||
|
public class MaterialInventoryInboundDetailController extends AbstractFileUploadController implements BusinessControllerMarker{
|
||||||
|
|
||||||
|
static {
|
||||||
|
FileUploadController annotation = MaterialInventoryInboundDetailController.class.getAnnotation(FileUploadController.class);
|
||||||
|
if (annotation != null) {
|
||||||
|
setFileUploadInfo(annotation);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private MaterialInventoryInboundDetailService materialInventoryInboundDetailService;
|
||||||
|
|
||||||
|
@PostMapping("/create")
|
||||||
|
@Operation(summary = "创建入库明细,出库明细,含领用出库、退货出库、盘亏出库、销毁出库等")
|
||||||
|
@PreAuthorize("@ss.hasPermission('qms:material-inventory-inbound-detail:create')")
|
||||||
|
public CommonResult<MaterialInventoryInboundDetailRespVO> createMaterialInventoryInboundDetail(@Valid @RequestBody MaterialInventoryInboundDetailSaveReqVO createReqVO) {
|
||||||
|
return success(materialInventoryInboundDetailService.createMaterialInventoryInboundDetail(createReqVO));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/update")
|
||||||
|
@Operation(summary = "更新入库明细,出库明细,含领用出库、退货出库、盘亏出库、销毁出库等")
|
||||||
|
@PreAuthorize("@ss.hasPermission('qms:material-inventory-inbound-detail:update')")
|
||||||
|
public CommonResult<Boolean> updateMaterialInventoryInboundDetail(@Valid @RequestBody MaterialInventoryInboundDetailSaveReqVO updateReqVO) {
|
||||||
|
materialInventoryInboundDetailService.updateMaterialInventoryInboundDetail(updateReqVO);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete")
|
||||||
|
@Operation(summary = "删除入库明细,出库明细,含领用出库、退货出库、盘亏出库、销毁出库等")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true)
|
||||||
|
@PreAuthorize("@ss.hasPermission('qms:material-inventory-inbound-detail:delete')")
|
||||||
|
public CommonResult<Boolean> deleteMaterialInventoryInboundDetail(@RequestParam("id") Long id) {
|
||||||
|
materialInventoryInboundDetailService.deleteMaterialInventoryInboundDetail(id);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete-list")
|
||||||
|
@Parameter(name = "ids", description = "编号", required = true)
|
||||||
|
@Operation(summary = "批量删除入库明细,出库明细,含领用出库、退货出库、盘亏出库、销毁出库等")
|
||||||
|
@PreAuthorize("@ss.hasPermission('qms:material-inventory-inbound-detail:delete')")
|
||||||
|
public CommonResult<Boolean> deleteMaterialInventoryInboundDetailList(@RequestBody BatchDeleteReqVO req) {
|
||||||
|
materialInventoryInboundDetailService.deleteMaterialInventoryInboundDetailListByIds(req.getIds());
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/get")
|
||||||
|
@Operation(summary = "获得入库明细,出库明细,含领用出库、退货出库、盘亏出库、销毁出库等")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||||
|
@PreAuthorize("@ss.hasPermission('qms:material-inventory-inbound-detail:query')")
|
||||||
|
public CommonResult<MaterialInventoryInboundDetailRespVO> getMaterialInventoryInboundDetail(@RequestParam("id") Long id) {
|
||||||
|
MaterialInventoryInboundDetailDO materialInventoryInboundDetail = materialInventoryInboundDetailService.getMaterialInventoryInboundDetail(id);
|
||||||
|
return success(BeanUtils.toBean(materialInventoryInboundDetail, MaterialInventoryInboundDetailRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/page")
|
||||||
|
@Operation(summary = "获得入库明细,出库明细,含领用出库、退货出库、盘亏出库、销毁出库等分页")
|
||||||
|
@PreAuthorize("@ss.hasPermission('qms:material-inventory-inbound-detail:query')")
|
||||||
|
public CommonResult<PageResult<MaterialInventoryInboundDetailRespVO>> getMaterialInventoryInboundDetailPage(@Valid MaterialInventoryInboundDetailPageReqVO pageReqVO) {
|
||||||
|
PageResult<MaterialInventoryInboundDetailDO> pageResult = materialInventoryInboundDetailService.getMaterialInventoryInboundDetailPage(pageReqVO);
|
||||||
|
return success(BeanUtils.toBean(pageResult, MaterialInventoryInboundDetailRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/export-excel")
|
||||||
|
@Operation(summary = "导出入库明细,出库明细,含领用出库、退货出库、盘亏出库、销毁出库等 Excel")
|
||||||
|
@PreAuthorize("@ss.hasPermission('qms:material-inventory-inbound-detail:export')")
|
||||||
|
@ApiAccessLog(operateType = EXPORT)
|
||||||
|
public void exportMaterialInventoryInboundDetailExcel(@Valid MaterialInventoryInboundDetailPageReqVO pageReqVO,
|
||||||
|
HttpServletResponse response) throws IOException {
|
||||||
|
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||||
|
List<MaterialInventoryInboundDetailDO> list = materialInventoryInboundDetailService.getMaterialInventoryInboundDetailPage(pageReqVO).getList();
|
||||||
|
// 导出 Excel
|
||||||
|
ExcelUtils.write(response, "入库明细,出库明细,含领用出库、退货出库、盘亏出库、销毁出库等.xls", "数据", MaterialInventoryInboundDetailRespVO.class,
|
||||||
|
BeanUtils.toBean(list, MaterialInventoryInboundDetailRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
package com.zt.plat.module.qms.resource.material.controller.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import com.zt.plat.framework.common.pojo.PageParam;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 物料批次分发分页 Request VO")
|
||||||
|
@Data
|
||||||
|
public class MaterialBatchAssignPageReqVO extends PageParam {
|
||||||
|
|
||||||
|
@Schema(description = "源批次ID", example = "23099")
|
||||||
|
private Long batchId;
|
||||||
|
|
||||||
|
@Schema(description = "产品id", example = "10774")
|
||||||
|
private String productId;
|
||||||
|
|
||||||
|
@Schema(description = "库房ID", example = "24720")
|
||||||
|
private Long warehouseId;
|
||||||
|
|
||||||
|
@Schema(description = "数量")
|
||||||
|
private String inboundQuantity;
|
||||||
|
|
||||||
|
@Schema(description = "暂存位置记录", example = "https://www.iocoder.cn")
|
||||||
|
private String url;
|
||||||
|
|
||||||
|
@Schema(description = "所属部门")
|
||||||
|
private String systemDepartmentCode;
|
||||||
|
|
||||||
|
@Schema(description = "备注")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
private LocalDateTime[] createTime;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,50 @@
|
|||||||
|
package com.zt.plat.module.qms.resource.material.controller.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import com.alibaba.excel.annotation.*;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 物料批次分发 Response VO")
|
||||||
|
@Data
|
||||||
|
@ExcelIgnoreUnannotated
|
||||||
|
public class MaterialBatchAssignRespVO {
|
||||||
|
|
||||||
|
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "15114")
|
||||||
|
@ExcelProperty("主键")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "源批次ID", example = "23099")
|
||||||
|
@ExcelProperty("源批次ID")
|
||||||
|
private Long batchId;
|
||||||
|
|
||||||
|
@Schema(description = "产品id", example = "10774")
|
||||||
|
@ExcelProperty("产品id")
|
||||||
|
private String productId;
|
||||||
|
|
||||||
|
@Schema(description = "库房ID", example = "24720")
|
||||||
|
@ExcelProperty("库房ID")
|
||||||
|
private Long warehouseId;
|
||||||
|
|
||||||
|
@Schema(description = "数量")
|
||||||
|
@ExcelProperty("数量")
|
||||||
|
private String inboundQuantity;
|
||||||
|
|
||||||
|
@Schema(description = "暂存位置记录", example = "https://www.iocoder.cn")
|
||||||
|
@ExcelProperty("暂存位置记录")
|
||||||
|
private String url;
|
||||||
|
|
||||||
|
@Schema(description = "所属部门")
|
||||||
|
@ExcelProperty("所属部门")
|
||||||
|
private String systemDepartmentCode;
|
||||||
|
|
||||||
|
@Schema(description = "备注")
|
||||||
|
@ExcelProperty("备注")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
@ExcelProperty("创建时间")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
package com.zt.plat.module.qms.resource.material.controller.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 物料批次分发新增/修改 Request VO")
|
||||||
|
@Data
|
||||||
|
public class MaterialBatchAssignSaveReqVO {
|
||||||
|
|
||||||
|
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "15114")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "源批次ID", example = "23099")
|
||||||
|
private Long batchId;
|
||||||
|
|
||||||
|
@Schema(description = "产品id", example = "10774")
|
||||||
|
private String productId;
|
||||||
|
|
||||||
|
@Schema(description = "库房ID", example = "24720")
|
||||||
|
private Long warehouseId;
|
||||||
|
|
||||||
|
@Schema(description = "数量")
|
||||||
|
private String inboundQuantity;
|
||||||
|
|
||||||
|
@Schema(description = "暂存位置记录", example = "https://www.iocoder.cn")
|
||||||
|
private String url;
|
||||||
|
|
||||||
|
@Schema(description = "所属部门")
|
||||||
|
private String systemDepartmentCode;
|
||||||
|
|
||||||
|
@Schema(description = "备注")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,51 @@
|
|||||||
|
package com.zt.plat.module.qms.resource.material.controller.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import com.zt.plat.framework.common.pojo.PageParam;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 物料批次分页 Request VO")
|
||||||
|
@Data
|
||||||
|
public class MaterialBatchPageReqVO extends PageParam {
|
||||||
|
|
||||||
|
@Schema(description = "产品id", example = "16851")
|
||||||
|
private Long productId;
|
||||||
|
|
||||||
|
@Schema(description = "批次编号")
|
||||||
|
private String batchNo;
|
||||||
|
|
||||||
|
@Schema(description = "总数量")
|
||||||
|
private String inboundQuantity;
|
||||||
|
|
||||||
|
@Schema(description = "存放位置描述")
|
||||||
|
private String location;
|
||||||
|
|
||||||
|
@Schema(description = "供应商id", example = "6956")
|
||||||
|
private Long supplierId;
|
||||||
|
|
||||||
|
@Schema(description = "生产日期")
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
private LocalDateTime[] manufacturerDate;
|
||||||
|
|
||||||
|
@Schema(description = "到期日期")
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
private LocalDateTime[] dueDate;
|
||||||
|
|
||||||
|
@Schema(description = "验收状态", example = "1")
|
||||||
|
private String acceptanceStatus;
|
||||||
|
|
||||||
|
@Schema(description = "所属部门")
|
||||||
|
private String systemDepartmentCode;
|
||||||
|
|
||||||
|
@Schema(description = "备注")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
private LocalDateTime[] createTime;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,62 @@
|
|||||||
|
package com.zt.plat.module.qms.resource.material.controller.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import com.alibaba.excel.annotation.*;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 物料批次 Response VO")
|
||||||
|
@Data
|
||||||
|
@ExcelIgnoreUnannotated
|
||||||
|
public class MaterialBatchRespVO {
|
||||||
|
|
||||||
|
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "25470")
|
||||||
|
@ExcelProperty("主键")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "产品id", example = "16851")
|
||||||
|
@ExcelProperty("产品id")
|
||||||
|
private Long productId;
|
||||||
|
|
||||||
|
@Schema(description = "批次编号")
|
||||||
|
@ExcelProperty("批次编号")
|
||||||
|
private String batchNo;
|
||||||
|
|
||||||
|
@Schema(description = "总数量")
|
||||||
|
@ExcelProperty("总数量")
|
||||||
|
private String inboundQuantity;
|
||||||
|
|
||||||
|
@Schema(description = "存放位置描述")
|
||||||
|
@ExcelProperty("存放位置描述")
|
||||||
|
private String location;
|
||||||
|
|
||||||
|
@Schema(description = "供应商id", example = "6956")
|
||||||
|
@ExcelProperty("供应商id")
|
||||||
|
private Long supplierId;
|
||||||
|
|
||||||
|
@Schema(description = "生产日期")
|
||||||
|
@ExcelProperty("生产日期")
|
||||||
|
private LocalDateTime manufacturerDate;
|
||||||
|
|
||||||
|
@Schema(description = "到期日期")
|
||||||
|
@ExcelProperty("到期日期")
|
||||||
|
private LocalDateTime dueDate;
|
||||||
|
|
||||||
|
@Schema(description = "验收状态", example = "1")
|
||||||
|
@ExcelProperty("验收状态")
|
||||||
|
private String acceptanceStatus;
|
||||||
|
|
||||||
|
@Schema(description = "所属部门")
|
||||||
|
@ExcelProperty("所属部门")
|
||||||
|
private String systemDepartmentCode;
|
||||||
|
|
||||||
|
@Schema(description = "备注")
|
||||||
|
@ExcelProperty("备注")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
@ExcelProperty("创建时间")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
package com.zt.plat.module.qms.resource.material.controller.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 物料批次新增/修改 Request VO")
|
||||||
|
@Data
|
||||||
|
public class MaterialBatchSaveReqVO {
|
||||||
|
|
||||||
|
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "25470")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "产品id", example = "16851")
|
||||||
|
private Long productId;
|
||||||
|
|
||||||
|
@Schema(description = "批次编号")
|
||||||
|
private String batchNo;
|
||||||
|
|
||||||
|
@Schema(description = "总数量")
|
||||||
|
private String inboundQuantity;
|
||||||
|
|
||||||
|
@Schema(description = "存放位置描述")
|
||||||
|
private String location;
|
||||||
|
|
||||||
|
@Schema(description = "供应商id", example = "6956")
|
||||||
|
private Long supplierId;
|
||||||
|
|
||||||
|
@Schema(description = "生产日期")
|
||||||
|
private LocalDateTime manufacturerDate;
|
||||||
|
|
||||||
|
@Schema(description = "到期日期")
|
||||||
|
private LocalDateTime dueDate;
|
||||||
|
|
||||||
|
@Schema(description = "验收状态", example = "1")
|
||||||
|
private String acceptanceStatus;
|
||||||
|
|
||||||
|
@Schema(description = "所属部门")
|
||||||
|
private String systemDepartmentCode;
|
||||||
|
|
||||||
|
@Schema(description = "备注")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,53 @@
|
|||||||
|
package com.zt.plat.module.qms.resource.material.controller.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import com.zt.plat.framework.common.pojo.PageParam;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 入库明细,出库明细,含领用出库、退货出库、盘亏出库、销毁出库等分页 Request VO")
|
||||||
|
@Data
|
||||||
|
public class MaterialInventoryInboundDetailPageReqVO extends PageParam {
|
||||||
|
|
||||||
|
@Schema(description = "入库单ID", example = "8031")
|
||||||
|
private Long inboundId;
|
||||||
|
|
||||||
|
@Schema(description = "分发批次id", example = "24731")
|
||||||
|
private Long batchAssignId;
|
||||||
|
|
||||||
|
@Schema(description = "入库方式")
|
||||||
|
private String inboundWay;
|
||||||
|
|
||||||
|
@Schema(description = "物料实例ID", example = "23510")
|
||||||
|
private Long materialInfomationId;
|
||||||
|
|
||||||
|
@Schema(description = "入库人", example = "赵六")
|
||||||
|
private String inboundUserName;
|
||||||
|
|
||||||
|
@Schema(description = "入库人id", example = "8857")
|
||||||
|
private Long inboundUserId;
|
||||||
|
|
||||||
|
@Schema(description = "入库人部门", example = "芋艿")
|
||||||
|
private String inboundDepartmentName;
|
||||||
|
|
||||||
|
@Schema(description = "入库人部门id", example = "8008")
|
||||||
|
private Long inboundDepartmentId;
|
||||||
|
|
||||||
|
@Schema(description = "入库时间")
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
private LocalDateTime[] inboundTime;
|
||||||
|
|
||||||
|
@Schema(description = "所属部门")
|
||||||
|
private String systemDepartmentCode;
|
||||||
|
|
||||||
|
@Schema(description = "备注")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
private LocalDateTime[] createTime;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,66 @@
|
|||||||
|
package com.zt.plat.module.qms.resource.material.controller.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import com.alibaba.excel.annotation.*;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 入库明细,出库明细,含领用出库、退货出库、盘亏出库、销毁出库等 Response VO")
|
||||||
|
@Data
|
||||||
|
@ExcelIgnoreUnannotated
|
||||||
|
public class MaterialInventoryInboundDetailRespVO {
|
||||||
|
|
||||||
|
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "20724")
|
||||||
|
@ExcelProperty("主键")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "入库单ID", example = "8031")
|
||||||
|
@ExcelProperty("入库单ID")
|
||||||
|
private Long inboundId;
|
||||||
|
|
||||||
|
@Schema(description = "分发批次id", example = "24731")
|
||||||
|
@ExcelProperty("分发批次id")
|
||||||
|
private Long batchAssignId;
|
||||||
|
|
||||||
|
@Schema(description = "入库方式")
|
||||||
|
@ExcelProperty("入库方式")
|
||||||
|
private String inboundWay;
|
||||||
|
|
||||||
|
@Schema(description = "物料实例ID", example = "23510")
|
||||||
|
@ExcelProperty("物料实例ID")
|
||||||
|
private Long materialInfomationId;
|
||||||
|
|
||||||
|
@Schema(description = "入库人", example = "赵六")
|
||||||
|
@ExcelProperty("入库人")
|
||||||
|
private String inboundUserName;
|
||||||
|
|
||||||
|
@Schema(description = "入库人id", example = "8857")
|
||||||
|
@ExcelProperty("入库人id")
|
||||||
|
private Long inboundUserId;
|
||||||
|
|
||||||
|
@Schema(description = "入库人部门", example = "芋艿")
|
||||||
|
@ExcelProperty("入库人部门")
|
||||||
|
private String inboundDepartmentName;
|
||||||
|
|
||||||
|
@Schema(description = "入库人部门id", example = "8008")
|
||||||
|
@ExcelProperty("入库人部门id")
|
||||||
|
private Long inboundDepartmentId;
|
||||||
|
|
||||||
|
@Schema(description = "入库时间")
|
||||||
|
@ExcelProperty("入库时间")
|
||||||
|
private LocalDateTime inboundTime;
|
||||||
|
|
||||||
|
@Schema(description = "所属部门")
|
||||||
|
@ExcelProperty("所属部门")
|
||||||
|
private String systemDepartmentCode;
|
||||||
|
|
||||||
|
@Schema(description = "备注")
|
||||||
|
@ExcelProperty("备注")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
@ExcelProperty("创建时间")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
package com.zt.plat.module.qms.resource.material.controller.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 入库明细,出库明细,含领用出库、退货出库、盘亏出库、销毁出库等新增/修改 Request VO")
|
||||||
|
@Data
|
||||||
|
public class MaterialInventoryInboundDetailSaveReqVO {
|
||||||
|
|
||||||
|
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "20724")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "入库单ID", example = "8031")
|
||||||
|
private Long inboundId;
|
||||||
|
|
||||||
|
@Schema(description = "分发批次id", example = "24731")
|
||||||
|
private Long batchAssignId;
|
||||||
|
|
||||||
|
@Schema(description = "入库方式")
|
||||||
|
private String inboundWay;
|
||||||
|
|
||||||
|
@Schema(description = "物料实例ID", example = "23510")
|
||||||
|
private Long materialInfomationId;
|
||||||
|
|
||||||
|
@Schema(description = "入库人", example = "赵六")
|
||||||
|
private String inboundUserName;
|
||||||
|
|
||||||
|
@Schema(description = "入库人id", example = "8857")
|
||||||
|
private Long inboundUserId;
|
||||||
|
|
||||||
|
@Schema(description = "入库人部门", example = "芋艿")
|
||||||
|
private String inboundDepartmentName;
|
||||||
|
|
||||||
|
@Schema(description = "入库人部门id", example = "8008")
|
||||||
|
private Long inboundDepartmentId;
|
||||||
|
|
||||||
|
@Schema(description = "入库时间")
|
||||||
|
private LocalDateTime inboundTime;
|
||||||
|
|
||||||
|
@Schema(description = "所属部门")
|
||||||
|
private String systemDepartmentCode;
|
||||||
|
|
||||||
|
@Schema(description = "备注")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,59 @@
|
|||||||
|
package com.zt.plat.module.qms.resource.material.controller.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import com.zt.plat.framework.common.pojo.PageParam;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 入库分页 Request VO")
|
||||||
|
@Data
|
||||||
|
public class MaterialInventoryInboundPageReqVO extends PageParam {
|
||||||
|
|
||||||
|
@Schema(description = "标题")
|
||||||
|
private String title;
|
||||||
|
|
||||||
|
@Schema(description = "业务类型1.验收上架,【字典】【jy_material_in_bsn_type】领用出库、盘亏出库、损坏出库等", example = "1")
|
||||||
|
private String businessType;
|
||||||
|
|
||||||
|
@Schema(description = "业务类型编码")
|
||||||
|
private String businessTypeCode;
|
||||||
|
|
||||||
|
@Schema(description = "申请人")
|
||||||
|
private String applyUser;
|
||||||
|
|
||||||
|
@Schema(description = "申请人id", example = "30960")
|
||||||
|
private Long applyUserId;
|
||||||
|
|
||||||
|
@Schema(description = "申请部门")
|
||||||
|
private String applyDepartment;
|
||||||
|
|
||||||
|
@Schema(description = "申请部门id", example = "666")
|
||||||
|
private Long applyDepartmentId;
|
||||||
|
|
||||||
|
@Schema(description = "申请时间")
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
private LocalDateTime[] applyTime;
|
||||||
|
|
||||||
|
@Schema(description = "流程实例id", example = "654")
|
||||||
|
private String flowInstanceId;
|
||||||
|
|
||||||
|
@Schema(description = "流程审批状态", example = "1")
|
||||||
|
private String flowStatus;
|
||||||
|
|
||||||
|
@Schema(description = "意见json")
|
||||||
|
private String commentJson;
|
||||||
|
|
||||||
|
@Schema(description = "所属部门")
|
||||||
|
private String systemDepartmentCode;
|
||||||
|
|
||||||
|
@Schema(description = "备注")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
private LocalDateTime[] createTime;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,74 @@
|
|||||||
|
package com.zt.plat.module.qms.resource.material.controller.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import com.alibaba.excel.annotation.*;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 入库 Response VO")
|
||||||
|
@Data
|
||||||
|
@ExcelIgnoreUnannotated
|
||||||
|
public class MaterialInventoryInboundRespVO {
|
||||||
|
|
||||||
|
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "15437")
|
||||||
|
@ExcelProperty("主键")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "标题")
|
||||||
|
@ExcelProperty("标题")
|
||||||
|
private String title;
|
||||||
|
|
||||||
|
@Schema(description = "业务类型1.验收上架,【字典】【jy_material_in_bsn_type】领用出库、盘亏出库、损坏出库等", example = "1")
|
||||||
|
@ExcelProperty("业务类型1.验收上架,【字典】【jy_material_in_bsn_type】领用出库、盘亏出库、损坏出库等")
|
||||||
|
private String businessType;
|
||||||
|
|
||||||
|
@Schema(description = "业务类型编码")
|
||||||
|
@ExcelProperty("业务类型编码")
|
||||||
|
private String businessTypeCode;
|
||||||
|
|
||||||
|
@Schema(description = "申请人")
|
||||||
|
@ExcelProperty("申请人")
|
||||||
|
private String applyUser;
|
||||||
|
|
||||||
|
@Schema(description = "申请人id", example = "30960")
|
||||||
|
@ExcelProperty("申请人id")
|
||||||
|
private Long applyUserId;
|
||||||
|
|
||||||
|
@Schema(description = "申请部门")
|
||||||
|
@ExcelProperty("申请部门")
|
||||||
|
private String applyDepartment;
|
||||||
|
|
||||||
|
@Schema(description = "申请部门id", example = "666")
|
||||||
|
@ExcelProperty("申请部门id")
|
||||||
|
private Long applyDepartmentId;
|
||||||
|
|
||||||
|
@Schema(description = "申请时间")
|
||||||
|
@ExcelProperty("申请时间")
|
||||||
|
private LocalDateTime applyTime;
|
||||||
|
|
||||||
|
@Schema(description = "流程实例id", example = "654")
|
||||||
|
@ExcelProperty("流程实例id")
|
||||||
|
private String flowInstanceId;
|
||||||
|
|
||||||
|
@Schema(description = "流程审批状态", example = "1")
|
||||||
|
@ExcelProperty("流程审批状态")
|
||||||
|
private String flowStatus;
|
||||||
|
|
||||||
|
@Schema(description = "意见json")
|
||||||
|
@ExcelProperty("意见json")
|
||||||
|
private String commentJson;
|
||||||
|
|
||||||
|
@Schema(description = "所属部门")
|
||||||
|
@ExcelProperty("所属部门")
|
||||||
|
private String systemDepartmentCode;
|
||||||
|
|
||||||
|
@Schema(description = "备注")
|
||||||
|
@ExcelProperty("备注")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
@ExcelProperty("创建时间")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,54 @@
|
|||||||
|
package com.zt.plat.module.qms.resource.material.controller.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 入库新增/修改 Request VO")
|
||||||
|
@Data
|
||||||
|
public class MaterialInventoryInboundSaveReqVO {
|
||||||
|
|
||||||
|
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "15437")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "标题")
|
||||||
|
private String title;
|
||||||
|
|
||||||
|
@Schema(description = "业务类型1.验收上架,【字典】【jy_material_in_bsn_type】领用出库、盘亏出库、损坏出库等", example = "1")
|
||||||
|
private String businessType;
|
||||||
|
|
||||||
|
@Schema(description = "业务类型编码")
|
||||||
|
private String businessTypeCode;
|
||||||
|
|
||||||
|
@Schema(description = "申请人")
|
||||||
|
private String applyUser;
|
||||||
|
|
||||||
|
@Schema(description = "申请人id", example = "30960")
|
||||||
|
private Long applyUserId;
|
||||||
|
|
||||||
|
@Schema(description = "申请部门")
|
||||||
|
private String applyDepartment;
|
||||||
|
|
||||||
|
@Schema(description = "申请部门id", example = "666")
|
||||||
|
private Long applyDepartmentId;
|
||||||
|
|
||||||
|
@Schema(description = "申请时间")
|
||||||
|
private LocalDateTime applyTime;
|
||||||
|
|
||||||
|
@Schema(description = "流程实例id", example = "654")
|
||||||
|
private String flowInstanceId;
|
||||||
|
|
||||||
|
@Schema(description = "流程审批状态", example = "1")
|
||||||
|
private String flowStatus;
|
||||||
|
|
||||||
|
@Schema(description = "意见json")
|
||||||
|
private String commentJson;
|
||||||
|
|
||||||
|
@Schema(description = "所属部门")
|
||||||
|
private String systemDepartmentCode;
|
||||||
|
|
||||||
|
@Schema(description = "备注")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,67 @@
|
|||||||
|
package com.zt.plat.module.qms.resource.material.dal.dataobject;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO;
|
||||||
|
/**
|
||||||
|
* 物料批次分发 DO
|
||||||
|
*
|
||||||
|
* @author 后台管理
|
||||||
|
*/
|
||||||
|
@TableName("t_mtrl_bat_asn")
|
||||||
|
@KeySequence("t_mtrl_bat_asn_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
/**
|
||||||
|
* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO
|
||||||
|
*/
|
||||||
|
public class MaterialBatchAssignDO extends BusinessBaseDO {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 源批次ID
|
||||||
|
*/
|
||||||
|
@TableField("BAT_ID")
|
||||||
|
private Long batchId;
|
||||||
|
/**
|
||||||
|
* 产品id
|
||||||
|
*/
|
||||||
|
@TableField("PDT_ID")
|
||||||
|
private String productId;
|
||||||
|
/**
|
||||||
|
* 库房ID
|
||||||
|
*/
|
||||||
|
@TableField("WRH_ID")
|
||||||
|
private Long warehouseId;
|
||||||
|
/**
|
||||||
|
* 数量
|
||||||
|
*/
|
||||||
|
@TableField("INB_QTY")
|
||||||
|
private String inboundQuantity;
|
||||||
|
/**
|
||||||
|
* 暂存位置记录
|
||||||
|
*/
|
||||||
|
@TableField("URL")
|
||||||
|
private String url;
|
||||||
|
/**
|
||||||
|
* 所属部门
|
||||||
|
*/
|
||||||
|
@TableField("SYS_DEPT_CD")
|
||||||
|
private String systemDepartmentCode;
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
@TableField("RMK")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,85 @@
|
|||||||
|
package com.zt.plat.module.qms.resource.material.dal.dataobject;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO;
|
||||||
|
/**
|
||||||
|
* 物料批次 DO
|
||||||
|
*
|
||||||
|
* @author 后台管理
|
||||||
|
*/
|
||||||
|
@TableName("t_mtrl_bat")
|
||||||
|
@KeySequence("t_mtrl_bat_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
/**
|
||||||
|
* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO
|
||||||
|
*/
|
||||||
|
public class MaterialBatchDO extends BusinessBaseDO {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 产品id
|
||||||
|
*/
|
||||||
|
@TableField("PDT_ID")
|
||||||
|
private Long productId;
|
||||||
|
/**
|
||||||
|
* 批次编号
|
||||||
|
*/
|
||||||
|
@TableField("BAT_NO")
|
||||||
|
private String batchNo;
|
||||||
|
/**
|
||||||
|
* 总数量
|
||||||
|
*/
|
||||||
|
@TableField("INB_QTY")
|
||||||
|
private String inboundQuantity;
|
||||||
|
/**
|
||||||
|
* 存放位置描述
|
||||||
|
*/
|
||||||
|
@TableField("LOC")
|
||||||
|
private String location;
|
||||||
|
/**
|
||||||
|
* 供应商id
|
||||||
|
*/
|
||||||
|
@TableField("SPLR_ID")
|
||||||
|
private Long supplierId;
|
||||||
|
/**
|
||||||
|
* 生产日期
|
||||||
|
*/
|
||||||
|
@TableField("MFR_DT")
|
||||||
|
private LocalDateTime manufacturerDate;
|
||||||
|
/**
|
||||||
|
* 到期日期
|
||||||
|
*/
|
||||||
|
@TableField("DUE_DT")
|
||||||
|
private LocalDateTime dueDate;
|
||||||
|
/**
|
||||||
|
* 验收状态
|
||||||
|
*/
|
||||||
|
@TableField("ACPT_STS")
|
||||||
|
private String acceptanceStatus;
|
||||||
|
/**
|
||||||
|
* 所属部门
|
||||||
|
*/
|
||||||
|
@TableField("SYS_DEPT_CD")
|
||||||
|
private String systemDepartmentCode;
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
@TableField("RMK")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,100 @@
|
|||||||
|
package com.zt.plat.module.qms.resource.material.dal.dataobject;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO;
|
||||||
|
/**
|
||||||
|
* 入库 DO
|
||||||
|
*
|
||||||
|
* @author 后台管理
|
||||||
|
*/
|
||||||
|
@TableName("t_mtrl_invt_inb")
|
||||||
|
@KeySequence("t_mtrl_invt_inb_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
/**
|
||||||
|
* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO
|
||||||
|
*/
|
||||||
|
public class MaterialInventoryInboundDO extends BusinessBaseDO {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 标题
|
||||||
|
*/
|
||||||
|
@TableField("TTL")
|
||||||
|
private String title;
|
||||||
|
/**
|
||||||
|
* 业务类型1.验收上架,【字典】【jy_material_in_bsn_type】领用出库、盘亏出库、损坏出库等
|
||||||
|
*/
|
||||||
|
@TableField("BSN_TP")
|
||||||
|
private String businessType;
|
||||||
|
/**
|
||||||
|
* 业务类型编码
|
||||||
|
*/
|
||||||
|
@TableField("BSN_TP_CD")
|
||||||
|
private String businessTypeCode;
|
||||||
|
/**
|
||||||
|
* 申请人
|
||||||
|
*/
|
||||||
|
@TableField("APL_USER")
|
||||||
|
private String applyUser;
|
||||||
|
/**
|
||||||
|
* 申请人id
|
||||||
|
*/
|
||||||
|
@TableField("APL_USER_ID")
|
||||||
|
private Long applyUserId;
|
||||||
|
/**
|
||||||
|
* 申请部门
|
||||||
|
*/
|
||||||
|
@TableField("APL_DEPT")
|
||||||
|
private String applyDepartment;
|
||||||
|
/**
|
||||||
|
* 申请部门id
|
||||||
|
*/
|
||||||
|
@TableField("APL_DEPT_ID")
|
||||||
|
private Long applyDepartmentId;
|
||||||
|
/**
|
||||||
|
* 申请时间
|
||||||
|
*/
|
||||||
|
@TableField("APL_TM")
|
||||||
|
private LocalDateTime applyTime;
|
||||||
|
/**
|
||||||
|
* 流程实例id
|
||||||
|
*/
|
||||||
|
@TableField("FLW_INSC_ID")
|
||||||
|
private String flowInstanceId;
|
||||||
|
/**
|
||||||
|
* 流程审批状态
|
||||||
|
*/
|
||||||
|
@TableField("FLW_STS")
|
||||||
|
private String flowStatus;
|
||||||
|
/**
|
||||||
|
* 意见json
|
||||||
|
*/
|
||||||
|
@TableField("CMT_JSON")
|
||||||
|
private String commentJson;
|
||||||
|
/**
|
||||||
|
* 所属部门
|
||||||
|
*/
|
||||||
|
@TableField("SYS_DEPT_CD")
|
||||||
|
private String systemDepartmentCode;
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
@TableField("RMK")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,90 @@
|
|||||||
|
package com.zt.plat.module.qms.resource.material.dal.dataobject;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO;
|
||||||
|
/**
|
||||||
|
* 入库明细,出库明细,含领用出库、退货出库、盘亏出库、销毁出库等 DO
|
||||||
|
*
|
||||||
|
* @author 后台管理
|
||||||
|
*/
|
||||||
|
@TableName("t_mtrl_invt_inb_dtl")
|
||||||
|
@KeySequence("t_mtrl_invt_inb_dtl_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
/**
|
||||||
|
* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO
|
||||||
|
*/
|
||||||
|
public class MaterialInventoryInboundDetailDO extends BusinessBaseDO {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 入库单ID
|
||||||
|
*/
|
||||||
|
@TableField("INB_ID")
|
||||||
|
private Long inboundId;
|
||||||
|
/**
|
||||||
|
* 分发批次id
|
||||||
|
*/
|
||||||
|
@TableField("BAT_ASN_ID")
|
||||||
|
private Long batchAssignId;
|
||||||
|
/**
|
||||||
|
* 入库方式
|
||||||
|
*/
|
||||||
|
@TableField("INB_WY")
|
||||||
|
private String inboundWay;
|
||||||
|
/**
|
||||||
|
* 物料实例ID
|
||||||
|
*/
|
||||||
|
@TableField("MTRL_INF_ID")
|
||||||
|
private Long materialInfomationId;
|
||||||
|
/**
|
||||||
|
* 入库人
|
||||||
|
*/
|
||||||
|
@TableField("INB_USER_NAME")
|
||||||
|
private String inboundUserName;
|
||||||
|
/**
|
||||||
|
* 入库人id
|
||||||
|
*/
|
||||||
|
@TableField("INB_USER_ID")
|
||||||
|
private Long inboundUserId;
|
||||||
|
/**
|
||||||
|
* 入库人部门
|
||||||
|
*/
|
||||||
|
@TableField("INB_DEPT_NAME")
|
||||||
|
private String inboundDepartmentName;
|
||||||
|
/**
|
||||||
|
* 入库人部门id
|
||||||
|
*/
|
||||||
|
@TableField("INB_DEPT_ID")
|
||||||
|
private Long inboundDepartmentId;
|
||||||
|
/**
|
||||||
|
* 入库时间
|
||||||
|
*/
|
||||||
|
@TableField("INB_TM")
|
||||||
|
private LocalDateTime inboundTime;
|
||||||
|
/**
|
||||||
|
* 所属部门
|
||||||
|
*/
|
||||||
|
@TableField("SYS_DEPT_CD")
|
||||||
|
private String systemDepartmentCode;
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
@TableField("RMK")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
package com.zt.plat.module.qms.resource.material.dal.mapper;
|
||||||
|
|
||||||
|
import com.zt.plat.framework.common.pojo.PageResult;
|
||||||
|
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||||
|
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
|
import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialBatchAssignDO;
|
||||||
|
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialBatchAssignPageReqVO;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物料批次分发 Mapper
|
||||||
|
*
|
||||||
|
* @author 后台管理
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface MaterialBatchAssignMapper extends BaseMapperX<MaterialBatchAssignDO> {
|
||||||
|
|
||||||
|
default PageResult<MaterialBatchAssignDO> selectPage(MaterialBatchAssignPageReqVO reqVO) {
|
||||||
|
return selectPage(reqVO, new LambdaQueryWrapperX<MaterialBatchAssignDO>()
|
||||||
|
.eqIfPresent(MaterialBatchAssignDO::getBatchId, reqVO.getBatchId())
|
||||||
|
.eqIfPresent(MaterialBatchAssignDO::getProductId, reqVO.getProductId())
|
||||||
|
.eqIfPresent(MaterialBatchAssignDO::getWarehouseId, reqVO.getWarehouseId())
|
||||||
|
.eqIfPresent(MaterialBatchAssignDO::getInboundQuantity, reqVO.getInboundQuantity())
|
||||||
|
.eqIfPresent(MaterialBatchAssignDO::getUrl, reqVO.getUrl())
|
||||||
|
.eqIfPresent(MaterialBatchAssignDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode())
|
||||||
|
.eqIfPresent(MaterialBatchAssignDO::getRemark, reqVO.getRemark())
|
||||||
|
.betweenIfPresent(MaterialBatchAssignDO::getCreateTime, reqVO.getCreateTime())
|
||||||
|
.orderByDesc(MaterialBatchAssignDO::getId));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
package com.zt.plat.module.qms.resource.material.dal.mapper;
|
||||||
|
|
||||||
|
import com.zt.plat.framework.common.pojo.PageResult;
|
||||||
|
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||||
|
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
|
import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialBatchDO;
|
||||||
|
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialBatchPageReqVO;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物料批次 Mapper
|
||||||
|
*
|
||||||
|
* @author 后台管理
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface MaterialBatchMapper extends BaseMapperX<MaterialBatchDO> {
|
||||||
|
|
||||||
|
default PageResult<MaterialBatchDO> selectPage(MaterialBatchPageReqVO reqVO) {
|
||||||
|
return selectPage(reqVO, new LambdaQueryWrapperX<MaterialBatchDO>()
|
||||||
|
.eqIfPresent(MaterialBatchDO::getProductId, reqVO.getProductId())
|
||||||
|
.eqIfPresent(MaterialBatchDO::getBatchNo, reqVO.getBatchNo())
|
||||||
|
.eqIfPresent(MaterialBatchDO::getInboundQuantity, reqVO.getInboundQuantity())
|
||||||
|
.eqIfPresent(MaterialBatchDO::getLocation, reqVO.getLocation())
|
||||||
|
.eqIfPresent(MaterialBatchDO::getSupplierId, reqVO.getSupplierId())
|
||||||
|
.betweenIfPresent(MaterialBatchDO::getManufacturerDate, reqVO.getManufacturerDate())
|
||||||
|
.betweenIfPresent(MaterialBatchDO::getDueDate, reqVO.getDueDate())
|
||||||
|
.eqIfPresent(MaterialBatchDO::getAcceptanceStatus, reqVO.getAcceptanceStatus())
|
||||||
|
.eqIfPresent(MaterialBatchDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode())
|
||||||
|
.eqIfPresent(MaterialBatchDO::getRemark, reqVO.getRemark())
|
||||||
|
.betweenIfPresent(MaterialBatchDO::getCreateTime, reqVO.getCreateTime())
|
||||||
|
.orderByDesc(MaterialBatchDO::getId));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
package com.zt.plat.module.qms.resource.material.dal.mapper;
|
||||||
|
|
||||||
|
import com.zt.plat.framework.common.pojo.PageResult;
|
||||||
|
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||||
|
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
|
import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialInventoryInboundDetailDO;
|
||||||
|
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryInboundDetailPageReqVO;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 入库明细,出库明细,含领用出库、退货出库、盘亏出库、销毁出库等 Mapper
|
||||||
|
*
|
||||||
|
* @author 后台管理
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface MaterialInventoryInboundDetailMapper extends BaseMapperX<MaterialInventoryInboundDetailDO> {
|
||||||
|
|
||||||
|
default PageResult<MaterialInventoryInboundDetailDO> selectPage(MaterialInventoryInboundDetailPageReqVO reqVO) {
|
||||||
|
return selectPage(reqVO, new LambdaQueryWrapperX<MaterialInventoryInboundDetailDO>()
|
||||||
|
.eqIfPresent(MaterialInventoryInboundDetailDO::getInboundId, reqVO.getInboundId())
|
||||||
|
.eqIfPresent(MaterialInventoryInboundDetailDO::getBatchAssignId, reqVO.getBatchAssignId())
|
||||||
|
.eqIfPresent(MaterialInventoryInboundDetailDO::getInboundWay, reqVO.getInboundWay())
|
||||||
|
.eqIfPresent(MaterialInventoryInboundDetailDO::getMaterialInfomationId, reqVO.getMaterialInfomationId())
|
||||||
|
.likeIfPresent(MaterialInventoryInboundDetailDO::getInboundUserName, reqVO.getInboundUserName())
|
||||||
|
.eqIfPresent(MaterialInventoryInboundDetailDO::getInboundUserId, reqVO.getInboundUserId())
|
||||||
|
.likeIfPresent(MaterialInventoryInboundDetailDO::getInboundDepartmentName, reqVO.getInboundDepartmentName())
|
||||||
|
.eqIfPresent(MaterialInventoryInboundDetailDO::getInboundDepartmentId, reqVO.getInboundDepartmentId())
|
||||||
|
.betweenIfPresent(MaterialInventoryInboundDetailDO::getInboundTime, reqVO.getInboundTime())
|
||||||
|
.eqIfPresent(MaterialInventoryInboundDetailDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode())
|
||||||
|
.eqIfPresent(MaterialInventoryInboundDetailDO::getRemark, reqVO.getRemark())
|
||||||
|
.betweenIfPresent(MaterialInventoryInboundDetailDO::getCreateTime, reqVO.getCreateTime())
|
||||||
|
.orderByDesc(MaterialInventoryInboundDetailDO::getId));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
package com.zt.plat.module.qms.resource.material.dal.mapper;
|
||||||
|
|
||||||
|
import com.zt.plat.framework.common.pojo.PageResult;
|
||||||
|
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||||
|
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
|
import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialInventoryInboundDO;
|
||||||
|
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryInboundPageReqVO;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 入库 Mapper
|
||||||
|
*
|
||||||
|
* @author 后台管理
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface MaterialInventoryInboundMapper extends BaseMapperX<MaterialInventoryInboundDO> {
|
||||||
|
|
||||||
|
default PageResult<MaterialInventoryInboundDO> selectPage(MaterialInventoryInboundPageReqVO reqVO) {
|
||||||
|
return selectPage(reqVO, new LambdaQueryWrapperX<MaterialInventoryInboundDO>()
|
||||||
|
.eqIfPresent(MaterialInventoryInboundDO::getTitle, reqVO.getTitle())
|
||||||
|
.eqIfPresent(MaterialInventoryInboundDO::getBusinessType, reqVO.getBusinessType())
|
||||||
|
.eqIfPresent(MaterialInventoryInboundDO::getBusinessTypeCode, reqVO.getBusinessTypeCode())
|
||||||
|
.eqIfPresent(MaterialInventoryInboundDO::getApplyUser, reqVO.getApplyUser())
|
||||||
|
.eqIfPresent(MaterialInventoryInboundDO::getApplyUserId, reqVO.getApplyUserId())
|
||||||
|
.eqIfPresent(MaterialInventoryInboundDO::getApplyDepartment, reqVO.getApplyDepartment())
|
||||||
|
.eqIfPresent(MaterialInventoryInboundDO::getApplyDepartmentId, reqVO.getApplyDepartmentId())
|
||||||
|
.betweenIfPresent(MaterialInventoryInboundDO::getApplyTime, reqVO.getApplyTime())
|
||||||
|
.eqIfPresent(MaterialInventoryInboundDO::getFlowInstanceId, reqVO.getFlowInstanceId())
|
||||||
|
.eqIfPresent(MaterialInventoryInboundDO::getFlowStatus, reqVO.getFlowStatus())
|
||||||
|
.eqIfPresent(MaterialInventoryInboundDO::getCommentJson, reqVO.getCommentJson())
|
||||||
|
.eqIfPresent(MaterialInventoryInboundDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode())
|
||||||
|
.eqIfPresent(MaterialInventoryInboundDO::getRemark, reqVO.getRemark())
|
||||||
|
.betweenIfPresent(MaterialInventoryInboundDO::getCreateTime, reqVO.getCreateTime())
|
||||||
|
.orderByDesc(MaterialInventoryInboundDO::getId));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,64 @@
|
|||||||
|
package com.zt.plat.module.qms.resource.material.service;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialBatchAssignPageReqVO;
|
||||||
|
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialBatchAssignRespVO;
|
||||||
|
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialBatchAssignSaveReqVO;
|
||||||
|
import jakarta.validation.*;
|
||||||
|
import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialBatchAssignDO;
|
||||||
|
import com.zt.plat.framework.common.pojo.PageResult;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物料批次分发 Service 接口
|
||||||
|
*
|
||||||
|
* @author 后台管理
|
||||||
|
*/
|
||||||
|
public interface MaterialBatchAssignService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建物料批次分发
|
||||||
|
*
|
||||||
|
* @param createReqVO 创建信息
|
||||||
|
* @return 编号
|
||||||
|
*/
|
||||||
|
MaterialBatchAssignRespVO createMaterialBatchAssign(@Valid MaterialBatchAssignSaveReqVO createReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新物料批次分发
|
||||||
|
*
|
||||||
|
* @param updateReqVO 更新信息
|
||||||
|
*/
|
||||||
|
void updateMaterialBatchAssign(@Valid MaterialBatchAssignSaveReqVO updateReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除物料批次分发
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
*/
|
||||||
|
void deleteMaterialBatchAssign(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除物料批次分发
|
||||||
|
*
|
||||||
|
* @param ids 编号
|
||||||
|
*/
|
||||||
|
void deleteMaterialBatchAssignListByIds(List<Long> ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得物料批次分发
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
* @return 物料批次分发
|
||||||
|
*/
|
||||||
|
MaterialBatchAssignDO getMaterialBatchAssign(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得物料批次分发分页
|
||||||
|
*
|
||||||
|
* @param pageReqVO 分页查询
|
||||||
|
* @return 物料批次分发分页
|
||||||
|
*/
|
||||||
|
PageResult<MaterialBatchAssignDO> getMaterialBatchAssignPage(MaterialBatchAssignPageReqVO pageReqVO);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,92 @@
|
|||||||
|
package com.zt.plat.module.qms.resource.material.service;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialBatchAssignPageReqVO;
|
||||||
|
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialBatchAssignRespVO;
|
||||||
|
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialBatchAssignSaveReqVO;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialBatchAssignDO;
|
||||||
|
import com.zt.plat.framework.common.pojo.PageResult;
|
||||||
|
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||||
|
|
||||||
|
import com.zt.plat.module.qms.resource.material.dal.mapper.MaterialBatchAssignMapper;
|
||||||
|
|
||||||
|
import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||||
|
import static com.zt.plat.framework.common.util.collection.CollectionUtils.convertList;
|
||||||
|
import static com.zt.plat.module.qms.enums.ErrorCodeConstants.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物料批次分发 Service 实现类
|
||||||
|
*
|
||||||
|
* @author 后台管理
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Validated
|
||||||
|
public class MaterialBatchAssignServiceImpl implements MaterialBatchAssignService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private MaterialBatchAssignMapper materialBatchAssignMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MaterialBatchAssignRespVO createMaterialBatchAssign(MaterialBatchAssignSaveReqVO createReqVO) {
|
||||||
|
// 插入
|
||||||
|
MaterialBatchAssignDO materialBatchAssign = BeanUtils.toBean(createReqVO, MaterialBatchAssignDO.class);
|
||||||
|
materialBatchAssignMapper.insert(materialBatchAssign);
|
||||||
|
// 返回
|
||||||
|
return BeanUtils.toBean(materialBatchAssign, MaterialBatchAssignRespVO.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateMaterialBatchAssign(MaterialBatchAssignSaveReqVO updateReqVO) {
|
||||||
|
// 校验存在
|
||||||
|
validateMaterialBatchAssignExists(updateReqVO.getId());
|
||||||
|
// 更新
|
||||||
|
MaterialBatchAssignDO updateObj = BeanUtils.toBean(updateReqVO, MaterialBatchAssignDO.class);
|
||||||
|
materialBatchAssignMapper.updateById(updateObj);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteMaterialBatchAssign(Long id) {
|
||||||
|
// 校验存在
|
||||||
|
validateMaterialBatchAssignExists(id);
|
||||||
|
// 删除
|
||||||
|
materialBatchAssignMapper.deleteById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteMaterialBatchAssignListByIds(List<Long> ids) {
|
||||||
|
// 校验存在
|
||||||
|
validateMaterialBatchAssignExists(ids);
|
||||||
|
// 删除
|
||||||
|
materialBatchAssignMapper.deleteByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void validateMaterialBatchAssignExists(List<Long> ids) {
|
||||||
|
List<MaterialBatchAssignDO> list = materialBatchAssignMapper.selectByIds(ids);
|
||||||
|
if (CollUtil.isEmpty(list) || list.size() != ids.size()) {
|
||||||
|
throw exception(MATERIAL_BATCH_ASSIGN_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void validateMaterialBatchAssignExists(Long id) {
|
||||||
|
if (materialBatchAssignMapper.selectById(id) == null) {
|
||||||
|
throw exception(MATERIAL_BATCH_ASSIGN_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MaterialBatchAssignDO getMaterialBatchAssign(Long id) {
|
||||||
|
return materialBatchAssignMapper.selectById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResult<MaterialBatchAssignDO> getMaterialBatchAssignPage(MaterialBatchAssignPageReqVO pageReqVO) {
|
||||||
|
return materialBatchAssignMapper.selectPage(pageReqVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,64 @@
|
|||||||
|
package com.zt.plat.module.qms.resource.material.service;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
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 jakarta.validation.*;
|
||||||
|
import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialBatchDO;
|
||||||
|
import com.zt.plat.framework.common.pojo.PageResult;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物料批次 Service 接口
|
||||||
|
*
|
||||||
|
* @author 后台管理
|
||||||
|
*/
|
||||||
|
public interface MaterialBatchService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建物料批次
|
||||||
|
*
|
||||||
|
* @param createReqVO 创建信息
|
||||||
|
* @return 编号
|
||||||
|
*/
|
||||||
|
MaterialBatchRespVO createMaterialBatch(@Valid MaterialBatchSaveReqVO createReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新物料批次
|
||||||
|
*
|
||||||
|
* @param updateReqVO 更新信息
|
||||||
|
*/
|
||||||
|
void updateMaterialBatch(@Valid MaterialBatchSaveReqVO updateReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除物料批次
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
*/
|
||||||
|
void deleteMaterialBatch(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除物料批次
|
||||||
|
*
|
||||||
|
* @param ids 编号
|
||||||
|
*/
|
||||||
|
void deleteMaterialBatchListByIds(List<Long> ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得物料批次
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
* @return 物料批次
|
||||||
|
*/
|
||||||
|
MaterialBatchDO getMaterialBatch(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得物料批次分页
|
||||||
|
*
|
||||||
|
* @param pageReqVO 分页查询
|
||||||
|
* @return 物料批次分页
|
||||||
|
*/
|
||||||
|
PageResult<MaterialBatchDO> getMaterialBatchPage(MaterialBatchPageReqVO pageReqVO);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,92 @@
|
|||||||
|
package com.zt.plat.module.qms.resource.material.service;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
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 org.springframework.stereotype.Service;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialBatchDO;
|
||||||
|
import com.zt.plat.framework.common.pojo.PageResult;
|
||||||
|
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||||
|
|
||||||
|
import com.zt.plat.module.qms.resource.material.dal.mapper.MaterialBatchMapper;
|
||||||
|
|
||||||
|
import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||||
|
import static com.zt.plat.framework.common.util.collection.CollectionUtils.convertList;
|
||||||
|
import static com.zt.plat.module.qms.enums.ErrorCodeConstants.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物料批次 Service 实现类
|
||||||
|
*
|
||||||
|
* @author 后台管理
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Validated
|
||||||
|
public class MaterialBatchServiceImpl implements MaterialBatchService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private MaterialBatchMapper materialBatchMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MaterialBatchRespVO createMaterialBatch(MaterialBatchSaveReqVO createReqVO) {
|
||||||
|
// 插入
|
||||||
|
MaterialBatchDO materialBatch = BeanUtils.toBean(createReqVO, MaterialBatchDO.class);
|
||||||
|
materialBatchMapper.insert(materialBatch);
|
||||||
|
// 返回
|
||||||
|
return BeanUtils.toBean(materialBatch, MaterialBatchRespVO.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateMaterialBatch(MaterialBatchSaveReqVO updateReqVO) {
|
||||||
|
// 校验存在
|
||||||
|
validateMaterialBatchExists(updateReqVO.getId());
|
||||||
|
// 更新
|
||||||
|
MaterialBatchDO updateObj = BeanUtils.toBean(updateReqVO, MaterialBatchDO.class);
|
||||||
|
materialBatchMapper.updateById(updateObj);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteMaterialBatch(Long id) {
|
||||||
|
// 校验存在
|
||||||
|
validateMaterialBatchExists(id);
|
||||||
|
// 删除
|
||||||
|
materialBatchMapper.deleteById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteMaterialBatchListByIds(List<Long> ids) {
|
||||||
|
// 校验存在
|
||||||
|
validateMaterialBatchExists(ids);
|
||||||
|
// 删除
|
||||||
|
materialBatchMapper.deleteByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void validateMaterialBatchExists(List<Long> ids) {
|
||||||
|
List<MaterialBatchDO> list = materialBatchMapper.selectByIds(ids);
|
||||||
|
if (CollUtil.isEmpty(list) || list.size() != ids.size()) {
|
||||||
|
throw exception(MATERIAL_BATCH_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void validateMaterialBatchExists(Long id) {
|
||||||
|
if (materialBatchMapper.selectById(id) == null) {
|
||||||
|
throw exception(MATERIAL_BATCH_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MaterialBatchDO getMaterialBatch(Long id) {
|
||||||
|
return materialBatchMapper.selectById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResult<MaterialBatchDO> getMaterialBatchPage(MaterialBatchPageReqVO pageReqVO) {
|
||||||
|
return materialBatchMapper.selectPage(pageReqVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,64 @@
|
|||||||
|
package com.zt.plat.module.qms.resource.material.service;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryInboundDetailPageReqVO;
|
||||||
|
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryInboundDetailRespVO;
|
||||||
|
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryInboundDetailSaveReqVO;
|
||||||
|
import jakarta.validation.*;
|
||||||
|
import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialInventoryInboundDetailDO;
|
||||||
|
import com.zt.plat.framework.common.pojo.PageResult;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 入库明细,出库明细,含领用出库、退货出库、盘亏出库、销毁出库等 Service 接口
|
||||||
|
*
|
||||||
|
* @author 后台管理
|
||||||
|
*/
|
||||||
|
public interface MaterialInventoryInboundDetailService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建入库明细,出库明细,含领用出库、退货出库、盘亏出库、销毁出库等
|
||||||
|
*
|
||||||
|
* @param createReqVO 创建信息
|
||||||
|
* @return 编号
|
||||||
|
*/
|
||||||
|
MaterialInventoryInboundDetailRespVO createMaterialInventoryInboundDetail(@Valid MaterialInventoryInboundDetailSaveReqVO createReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新入库明细,出库明细,含领用出库、退货出库、盘亏出库、销毁出库等
|
||||||
|
*
|
||||||
|
* @param updateReqVO 更新信息
|
||||||
|
*/
|
||||||
|
void updateMaterialInventoryInboundDetail(@Valid MaterialInventoryInboundDetailSaveReqVO updateReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除入库明细,出库明细,含领用出库、退货出库、盘亏出库、销毁出库等
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
*/
|
||||||
|
void deleteMaterialInventoryInboundDetail(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除入库明细,出库明细,含领用出库、退货出库、盘亏出库、销毁出库等
|
||||||
|
*
|
||||||
|
* @param ids 编号
|
||||||
|
*/
|
||||||
|
void deleteMaterialInventoryInboundDetailListByIds(List<Long> ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得入库明细,出库明细,含领用出库、退货出库、盘亏出库、销毁出库等
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
* @return 入库明细,出库明细,含领用出库、退货出库、盘亏出库、销毁出库等
|
||||||
|
*/
|
||||||
|
MaterialInventoryInboundDetailDO getMaterialInventoryInboundDetail(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得入库明细,出库明细,含领用出库、退货出库、盘亏出库、销毁出库等分页
|
||||||
|
*
|
||||||
|
* @param pageReqVO 分页查询
|
||||||
|
* @return 入库明细,出库明细,含领用出库、退货出库、盘亏出库、销毁出库等分页
|
||||||
|
*/
|
||||||
|
PageResult<MaterialInventoryInboundDetailDO> getMaterialInventoryInboundDetailPage(MaterialInventoryInboundDetailPageReqVO pageReqVO);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,92 @@
|
|||||||
|
package com.zt.plat.module.qms.resource.material.service;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryInboundDetailPageReqVO;
|
||||||
|
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryInboundDetailRespVO;
|
||||||
|
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryInboundDetailSaveReqVO;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialInventoryInboundDetailDO;
|
||||||
|
import com.zt.plat.framework.common.pojo.PageResult;
|
||||||
|
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||||
|
|
||||||
|
import com.zt.plat.module.qms.resource.material.dal.mapper.MaterialInventoryInboundDetailMapper;
|
||||||
|
|
||||||
|
import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||||
|
import static com.zt.plat.framework.common.util.collection.CollectionUtils.convertList;
|
||||||
|
import static com.zt.plat.module.qms.enums.ErrorCodeConstants.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 入库明细,出库明细,含领用出库、退货出库、盘亏出库、销毁出库等 Service 实现类
|
||||||
|
*
|
||||||
|
* @author 后台管理
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Validated
|
||||||
|
public class MaterialInventoryInboundDetailServiceImpl implements MaterialInventoryInboundDetailService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private MaterialInventoryInboundDetailMapper materialInventoryInboundDetailMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MaterialInventoryInboundDetailRespVO createMaterialInventoryInboundDetail(MaterialInventoryInboundDetailSaveReqVO createReqVO) {
|
||||||
|
// 插入
|
||||||
|
MaterialInventoryInboundDetailDO materialInventoryInboundDetail = BeanUtils.toBean(createReqVO, MaterialInventoryInboundDetailDO.class);
|
||||||
|
materialInventoryInboundDetailMapper.insert(materialInventoryInboundDetail);
|
||||||
|
// 返回
|
||||||
|
return BeanUtils.toBean(materialInventoryInboundDetail, MaterialInventoryInboundDetailRespVO.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateMaterialInventoryInboundDetail(MaterialInventoryInboundDetailSaveReqVO updateReqVO) {
|
||||||
|
// 校验存在
|
||||||
|
validateMaterialInventoryInboundDetailExists(updateReqVO.getId());
|
||||||
|
// 更新
|
||||||
|
MaterialInventoryInboundDetailDO updateObj = BeanUtils.toBean(updateReqVO, MaterialInventoryInboundDetailDO.class);
|
||||||
|
materialInventoryInboundDetailMapper.updateById(updateObj);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteMaterialInventoryInboundDetail(Long id) {
|
||||||
|
// 校验存在
|
||||||
|
validateMaterialInventoryInboundDetailExists(id);
|
||||||
|
// 删除
|
||||||
|
materialInventoryInboundDetailMapper.deleteById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteMaterialInventoryInboundDetailListByIds(List<Long> ids) {
|
||||||
|
// 校验存在
|
||||||
|
validateMaterialInventoryInboundDetailExists(ids);
|
||||||
|
// 删除
|
||||||
|
materialInventoryInboundDetailMapper.deleteByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void validateMaterialInventoryInboundDetailExists(List<Long> ids) {
|
||||||
|
List<MaterialInventoryInboundDetailDO> list = materialInventoryInboundDetailMapper.selectByIds(ids);
|
||||||
|
if (CollUtil.isEmpty(list) || list.size() != ids.size()) {
|
||||||
|
throw exception(MATERIAL_INVENTORY_INBOUND_DETAIL_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void validateMaterialInventoryInboundDetailExists(Long id) {
|
||||||
|
if (materialInventoryInboundDetailMapper.selectById(id) == null) {
|
||||||
|
throw exception(MATERIAL_INVENTORY_INBOUND_DETAIL_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MaterialInventoryInboundDetailDO getMaterialInventoryInboundDetail(Long id) {
|
||||||
|
return materialInventoryInboundDetailMapper.selectById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResult<MaterialInventoryInboundDetailDO> getMaterialInventoryInboundDetailPage(MaterialInventoryInboundDetailPageReqVO pageReqVO) {
|
||||||
|
return materialInventoryInboundDetailMapper.selectPage(pageReqVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,64 @@
|
|||||||
|
package com.zt.plat.module.qms.resource.material.service;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
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 jakarta.validation.*;
|
||||||
|
import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialInventoryInboundDO;
|
||||||
|
import com.zt.plat.framework.common.pojo.PageResult;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 入库 Service 接口
|
||||||
|
*
|
||||||
|
* @author 后台管理
|
||||||
|
*/
|
||||||
|
public interface MaterialInventoryInboundService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建入库
|
||||||
|
*
|
||||||
|
* @param createReqVO 创建信息
|
||||||
|
* @return 编号
|
||||||
|
*/
|
||||||
|
MaterialInventoryInboundRespVO createMaterialInventoryInbound(@Valid MaterialInventoryInboundSaveReqVO createReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新入库
|
||||||
|
*
|
||||||
|
* @param updateReqVO 更新信息
|
||||||
|
*/
|
||||||
|
void updateMaterialInventoryInbound(@Valid MaterialInventoryInboundSaveReqVO updateReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除入库
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
*/
|
||||||
|
void deleteMaterialInventoryInbound(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除入库
|
||||||
|
*
|
||||||
|
* @param ids 编号
|
||||||
|
*/
|
||||||
|
void deleteMaterialInventoryInboundListByIds(List<Long> ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得入库
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
* @return 入库
|
||||||
|
*/
|
||||||
|
MaterialInventoryInboundDO getMaterialInventoryInbound(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得入库分页
|
||||||
|
*
|
||||||
|
* @param pageReqVO 分页查询
|
||||||
|
* @return 入库分页
|
||||||
|
*/
|
||||||
|
PageResult<MaterialInventoryInboundDO> getMaterialInventoryInboundPage(MaterialInventoryInboundPageReqVO pageReqVO);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,92 @@
|
|||||||
|
package com.zt.plat.module.qms.resource.material.service;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
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 org.springframework.stereotype.Service;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialInventoryInboundDO;
|
||||||
|
import com.zt.plat.framework.common.pojo.PageResult;
|
||||||
|
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||||
|
|
||||||
|
import com.zt.plat.module.qms.resource.material.dal.mapper.MaterialInventoryInboundMapper;
|
||||||
|
|
||||||
|
import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||||
|
import static com.zt.plat.framework.common.util.collection.CollectionUtils.convertList;
|
||||||
|
import static com.zt.plat.module.qms.enums.ErrorCodeConstants.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 入库 Service 实现类
|
||||||
|
*
|
||||||
|
* @author 后台管理
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Validated
|
||||||
|
public class MaterialInventoryInboundServiceImpl implements MaterialInventoryInboundService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private MaterialInventoryInboundMapper materialInventoryInboundMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MaterialInventoryInboundRespVO createMaterialInventoryInbound(MaterialInventoryInboundSaveReqVO createReqVO) {
|
||||||
|
// 插入
|
||||||
|
MaterialInventoryInboundDO materialInventoryInbound = BeanUtils.toBean(createReqVO, MaterialInventoryInboundDO.class);
|
||||||
|
materialInventoryInboundMapper.insert(materialInventoryInbound);
|
||||||
|
// 返回
|
||||||
|
return BeanUtils.toBean(materialInventoryInbound, MaterialInventoryInboundRespVO.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateMaterialInventoryInbound(MaterialInventoryInboundSaveReqVO updateReqVO) {
|
||||||
|
// 校验存在
|
||||||
|
validateMaterialInventoryInboundExists(updateReqVO.getId());
|
||||||
|
// 更新
|
||||||
|
MaterialInventoryInboundDO updateObj = BeanUtils.toBean(updateReqVO, MaterialInventoryInboundDO.class);
|
||||||
|
materialInventoryInboundMapper.updateById(updateObj);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteMaterialInventoryInbound(Long id) {
|
||||||
|
// 校验存在
|
||||||
|
validateMaterialInventoryInboundExists(id);
|
||||||
|
// 删除
|
||||||
|
materialInventoryInboundMapper.deleteById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteMaterialInventoryInboundListByIds(List<Long> ids) {
|
||||||
|
// 校验存在
|
||||||
|
validateMaterialInventoryInboundExists(ids);
|
||||||
|
// 删除
|
||||||
|
materialInventoryInboundMapper.deleteByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void validateMaterialInventoryInboundExists(List<Long> ids) {
|
||||||
|
List<MaterialInventoryInboundDO> list = materialInventoryInboundMapper.selectByIds(ids);
|
||||||
|
if (CollUtil.isEmpty(list) || list.size() != ids.size()) {
|
||||||
|
throw exception(MATERIAL_INVENTORY_INBOUND_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void validateMaterialInventoryInboundExists(Long id) {
|
||||||
|
if (materialInventoryInboundMapper.selectById(id) == null) {
|
||||||
|
throw exception(MATERIAL_INVENTORY_INBOUND_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MaterialInventoryInboundDO getMaterialInventoryInbound(Long id) {
|
||||||
|
return materialInventoryInboundMapper.selectById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResult<MaterialInventoryInboundDO> getMaterialInventoryInboundPage(MaterialInventoryInboundPageReqVO pageReqVO) {
|
||||||
|
return materialInventoryInboundMapper.selectPage(pageReqVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.zt.plat.module.qms.resource.material.dal.mapper.MaterialBatchAssignMapper">
|
||||||
|
|
||||||
|
<!--
|
||||||
|
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||||
|
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||||
|
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||||
|
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||||
|
-->
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.zt.plat.module.qms.resource.material.dal.mapper.MaterialBatchMapper">
|
||||||
|
|
||||||
|
<!--
|
||||||
|
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||||
|
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||||
|
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||||
|
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||||
|
-->
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.zt.plat.module.qms.resource.material.dal.mapper.MaterialInventoryInboundDetailMapper">
|
||||||
|
|
||||||
|
<!--
|
||||||
|
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||||
|
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||||
|
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||||
|
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||||
|
-->
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.zt.plat.module.qms.resource.material.dal.mapper.MaterialInventoryInboundMapper">
|
||||||
|
|
||||||
|
<!--
|
||||||
|
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||||
|
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||||
|
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||||
|
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||||
|
-->
|
||||||
|
|
||||||
|
</mapper>
|
||||||
Reference in New Issue
Block a user