fix:完善批次接口,准备物料验收入库模块及验收新建接口。

This commit is contained in:
shusir
2026-01-30 14:16:54 +08:00
parent 5a03ed1cab
commit 5bf435b08e
41 changed files with 2433 additions and 7 deletions

View File

@@ -185,7 +185,7 @@ public interface ErrorCodeConstants {
ErrorCode MATERIAL_BATCH_ASSIGN_END = new ErrorCode(1_032_160_000, "物料批次已拆分,不可操作");
ErrorCode GONGDUAN_BELONG_MATERIAL_BATCH_NOT_EQUAL = new ErrorCode(1_032_160_000, "工段所属的物料批次不一致");
ErrorCode GONGDUAN_QUANTITY_MATERIAL_BATCH_NOT_EQUAL = new ErrorCode(1_032_160_000, "工段累加数量和批次数量不一致");
ErrorCode MATERIAL_BATCH_NOT_ASSIGN_FOR_SUBMIT = new ErrorCode(1_032_160_000, "物料批次未拆分,不可提交");
ErrorCode MATERIAL_BATCH_ASSIGN_NOT_EXISTS = new ErrorCode(1_032_160_000, "物料批次分发不存在");
ErrorCode MATERIAL_INVENTORY_INBOUND_NOT_EXISTS = new ErrorCode(1_032_160_000, "入库,出库不存在");
ErrorCode MATERIAL_INVENTORY_INBOUND_DETAIL_NOT_EXISTS = new ErrorCode(1_032_160_000, "入库明细,出库明细等不存在");

View File

@@ -0,0 +1,105 @@
package com.zt.plat.module.qms.resource.material.controller.admin;
import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog;
import com.zt.plat.framework.business.interceptor.BusinessControllerMarker;
import com.zt.plat.framework.common.pojo.CommonResult;
import com.zt.plat.framework.common.pojo.PageParam;
import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO;
import com.zt.plat.framework.common.util.object.BeanUtils;
import com.zt.plat.framework.excel.core.util.ExcelUtils;
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryInboundPageReqVO;
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryInboundRespVO;
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryInboundSaveReqVO;
import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialInventoryInboundDO;
import com.zt.plat.module.qms.resource.material.service.MaterialInventoryInboundService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.validation.Valid;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.io.IOException;
import java.util.List;
import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
import static com.zt.plat.framework.common.pojo.CommonResult.success;
@Tag(name = "管理后台 - 入库")
@RestController
@RequestMapping("/t/material-inventory-inbound")
@Validated
public class MaterialInventoryInboundController implements BusinessControllerMarker {
@Resource
private MaterialInventoryInboundService materialInventoryInboundService;
@PostMapping("/create")
@Operation(summary = "创建入库")
@PreAuthorize("@ss.hasPermission('t:material-inventory-inbound:create')")
public CommonResult<MaterialInventoryInboundRespVO> createMaterialInventoryInbound(@Valid @RequestBody MaterialInventoryInboundSaveReqVO createReqVO) {
return success(materialInventoryInboundService.createMaterialInventoryInbound(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新入库")
@PreAuthorize("@ss.hasPermission('t: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('t: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('t: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('t: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('t: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('t: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));
}
}

View File

@@ -0,0 +1,105 @@
package com.zt.plat.module.qms.resource.material.controller.admin;
import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog;
import com.zt.plat.framework.business.interceptor.BusinessControllerMarker;
import com.zt.plat.framework.common.pojo.CommonResult;
import com.zt.plat.framework.common.pojo.PageParam;
import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO;
import com.zt.plat.framework.common.util.object.BeanUtils;
import com.zt.plat.framework.excel.core.util.ExcelUtils;
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 com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialInventoryInboundDetailDO;
import com.zt.plat.module.qms.resource.material.service.MaterialInventoryInboundDetailService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.validation.Valid;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.io.IOException;
import java.util.List;
import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
import static com.zt.plat.framework.common.pojo.CommonResult.success;
@Tag(name = "管理后台 - 入库明细,验收入库、盘盈入库等")
@RestController
@RequestMapping("/t/material-inventory-inbound-detail")
@Validated
public class MaterialInventoryInboundDetailController implements BusinessControllerMarker {
@Resource
private MaterialInventoryInboundDetailService materialInventoryInboundDetailService;
@PostMapping("/create")
@Operation(summary = "创建入库明细,验收入库、盘盈入库等")
@PreAuthorize("@ss.hasPermission('t: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('t: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('t: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('t: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('t: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('t: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('t: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));
}
}

View File

@@ -0,0 +1,118 @@
package com.zt.plat.module.qms.resource.material.controller.admin;
import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog;
import com.zt.plat.framework.business.annotation.FileUploadController;
import com.zt.plat.framework.business.controller.AbstractFileUploadController;
import com.zt.plat.framework.business.interceptor.BusinessControllerMarker;
import com.zt.plat.framework.common.pojo.CommonResult;
import com.zt.plat.framework.common.pojo.PageParam;
import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO;
import com.zt.plat.framework.common.util.object.BeanUtils;
import com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore;
import com.zt.plat.framework.excel.core.util.ExcelUtils;
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialLifecyclePageReqVO;
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialLifecycleRespVO;
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialLifecycleSaveReqVO;
import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialLifecycleDO;
import com.zt.plat.module.qms.resource.material.service.MaterialLifecycleService;
import com.zt.plat.module.qms.resource.material.valid.AddGroup;
import com.zt.plat.module.qms.resource.material.valid.UpdateGroup;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.validation.Valid;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.io.IOException;
import java.util.List;
import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
import static com.zt.plat.framework.common.pojo.CommonResult.success;
@Tag(name = "管理后台 - 物料通用流程,物料验收、退换货")
@RestController
@RequestMapping("/t/material-lifecycle")
@Validated
@FileUploadController(source = "t.materiallifecycle")
@DeptDataPermissionIgnore(enable = "true")
public class MaterialLifecycleController extends AbstractFileUploadController implements BusinessControllerMarker{
static {
FileUploadController annotation = MaterialLifecycleController.class.getAnnotation(FileUploadController.class);
if (annotation != null) {
setFileUploadInfo(annotation);
}
}
@Resource
private MaterialLifecycleService materialLifecycleService;
@PostMapping("/create")
@Operation(summary = "新建物料流程")
// @PreAuthorize("@ss.hasPermission('t:material-lifecycle:create')")
public CommonResult<MaterialLifecycleRespVO> createMaterialLifecycle(@Validated(AddGroup.class) @RequestBody MaterialLifecycleSaveReqVO createReqVO) {
return success(materialLifecycleService.createMaterialLifecycle(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新物料流程")
// @PreAuthorize("@ss.hasPermission('t:material-lifecycle:update')")
public CommonResult<Boolean> updateMaterialLifecycle(@Validated(UpdateGroup.class) @RequestBody MaterialLifecycleSaveReqVO updateReqVO) {
materialLifecycleService.updateMaterialLifecycle(updateReqVO);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除物料通用流程,物料验收、退换货")
@Parameter(name = "id", description = "编号", required = true)
// @PreAuthorize("@ss.hasPermission('t:material-lifecycle:delete')")
public CommonResult<Boolean> deleteMaterialLifecycle(@RequestParam("id") Long id) {
materialLifecycleService.deleteMaterialLifecycle(id);
return success(true);
}
@DeleteMapping("/delete-list")
@Parameter(name = "ids", description = "编号", required = true)
@Operation(summary = "批量删除物料通用流程,物料验收、退换货")
@PreAuthorize("@ss.hasPermission('t:material-lifecycle:delete')")
public CommonResult<Boolean> deleteMaterialLifecycleList(@RequestBody BatchDeleteReqVO req) {
materialLifecycleService.deleteMaterialLifecycleListByIds(req.getIds());
return success(true);
}
@GetMapping("/get")
@Operation(summary = "获得物料通用流程,物料验收、退换货")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('t:material-lifecycle:query')")
public CommonResult<MaterialLifecycleRespVO> getMaterialLifecycle(@RequestParam("id") Long id) {
MaterialLifecycleDO materialLifecycle = materialLifecycleService.getMaterialLifecycle(id);
return success(BeanUtils.toBean(materialLifecycle, MaterialLifecycleRespVO.class));
}
@GetMapping("/page")
@Operation(summary = "获得物料通用流程,物料验收、退换货分页")
@PreAuthorize("@ss.hasPermission('t:material-lifecycle:query')")
public CommonResult<PageResult<MaterialLifecycleRespVO>> getMaterialLifecyclePage(@Valid MaterialLifecyclePageReqVO pageReqVO) {
PageResult<MaterialLifecycleDO> pageResult = materialLifecycleService.getMaterialLifecyclePage(pageReqVO);
return success(BeanUtils.toBean(pageResult, MaterialLifecycleRespVO.class));
}
@GetMapping("/export-excel")
@Operation(summary = "导出物料通用流程,物料验收、退换货 Excel")
@PreAuthorize("@ss.hasPermission('t:material-lifecycle:export')")
@ApiAccessLog(operateType = EXPORT)
public void exportMaterialLifecycleExcel(@Valid MaterialLifecyclePageReqVO pageReqVO,
HttpServletResponse response) throws IOException {
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
List<MaterialLifecycleDO> list = materialLifecycleService.getMaterialLifecyclePage(pageReqVO).getList();
// 导出 Excel
ExcelUtils.write(response, "物料通用流程,物料验收、退换货.xls", "数据", MaterialLifecycleRespVO.class,
BeanUtils.toBean(list, MaterialLifecycleRespVO.class));
}
}

View File

@@ -0,0 +1,105 @@
package com.zt.plat.module.qms.resource.material.controller.admin;
import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog;
import com.zt.plat.framework.business.interceptor.BusinessControllerMarker;
import com.zt.plat.framework.common.pojo.CommonResult;
import com.zt.plat.framework.common.pojo.PageParam;
import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO;
import com.zt.plat.framework.common.util.object.BeanUtils;
import com.zt.plat.framework.excel.core.util.ExcelUtils;
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialLifecycleDetailPageReqVO;
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialLifecycleDetailRespVO;
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialLifecycleDetailSaveReqVO;
import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialLifecycleDetailDO;
import com.zt.plat.module.qms.resource.material.service.MaterialLifecycleDetailService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.validation.Valid;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.io.IOException;
import java.util.List;
import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
import static com.zt.plat.framework.common.pojo.CommonResult.success;
@Tag(name = "管理后台 - 物料通用流程明细")
@RestController
@RequestMapping("/t/material-lifecycle-detail")
@Validated
public class MaterialLifecycleDetailController implements BusinessControllerMarker {
@Resource
private MaterialLifecycleDetailService materialLifecycleDetailService;
@PostMapping("/create")
@Operation(summary = "创建物料通用流程明细")
@PreAuthorize("@ss.hasPermission('t:material-lifecycle-detail:create')")
public CommonResult<MaterialLifecycleDetailRespVO> createMaterialLifecycleDetail(@Valid @RequestBody MaterialLifecycleDetailSaveReqVO createReqVO) {
return success(materialLifecycleDetailService.createMaterialLifecycleDetail(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新物料通用流程明细")
@PreAuthorize("@ss.hasPermission('t:material-lifecycle-detail:update')")
public CommonResult<Boolean> updateMaterialLifecycleDetail(@Valid @RequestBody MaterialLifecycleDetailSaveReqVO updateReqVO) {
materialLifecycleDetailService.updateMaterialLifecycleDetail(updateReqVO);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除物料通用流程明细")
@Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('t:material-lifecycle-detail:delete')")
public CommonResult<Boolean> deleteMaterialLifecycleDetail(@RequestParam("id") Long id) {
materialLifecycleDetailService.deleteMaterialLifecycleDetail(id);
return success(true);
}
@DeleteMapping("/delete-list")
@Parameter(name = "ids", description = "编号", required = true)
@Operation(summary = "批量删除物料通用流程明细")
@PreAuthorize("@ss.hasPermission('t:material-lifecycle-detail:delete')")
public CommonResult<Boolean> deleteMaterialLifecycleDetailList(@RequestBody BatchDeleteReqVO req) {
materialLifecycleDetailService.deleteMaterialLifecycleDetailListByIds(req.getIds());
return success(true);
}
@GetMapping("/get")
@Operation(summary = "获得物料通用流程明细")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('t:material-lifecycle-detail:query')")
public CommonResult<MaterialLifecycleDetailRespVO> getMaterialLifecycleDetail(@RequestParam("id") Long id) {
MaterialLifecycleDetailDO materialLifecycleDetail = materialLifecycleDetailService.getMaterialLifecycleDetail(id);
return success(BeanUtils.toBean(materialLifecycleDetail, MaterialLifecycleDetailRespVO.class));
}
@GetMapping("/page")
@Operation(summary = "获得物料通用流程明细分页")
@PreAuthorize("@ss.hasPermission('t:material-lifecycle-detail:query')")
public CommonResult<PageResult<MaterialLifecycleDetailRespVO>> getMaterialLifecycleDetailPage(@Valid MaterialLifecycleDetailPageReqVO pageReqVO) {
PageResult<MaterialLifecycleDetailDO> pageResult = materialLifecycleDetailService.getMaterialLifecycleDetailPage(pageReqVO);
return success(BeanUtils.toBean(pageResult, MaterialLifecycleDetailRespVO.class));
}
@GetMapping("/export-excel")
@Operation(summary = "导出物料通用流程明细 Excel")
@PreAuthorize("@ss.hasPermission('t:material-lifecycle-detail:export')")
@ApiAccessLog(operateType = EXPORT)
public void exportMaterialLifecycleDetailExcel(@Valid MaterialLifecycleDetailPageReqVO pageReqVO,
HttpServletResponse response) throws IOException {
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
List<MaterialLifecycleDetailDO> list = materialLifecycleDetailService.getMaterialLifecycleDetailPage(pageReqVO).getList();
// 导出 Excel
ExcelUtils.write(response, "物料通用流程明细.xls", "数据", MaterialLifecycleDetailRespVO.class,
BeanUtils.toBean(list, MaterialLifecycleDetailRespVO.class));
}
}

View File

@@ -17,8 +17,8 @@ import java.time.LocalDateTime;
@Data
public class MaterialBatchSaveReqVO {
@Null(groups = AddGroup.class, message = "新增数据 ID 必须为空")
@NotNull(groups = UpdateGroup.class, message = "修改数据 ID 不能为空")
@Null(groups = AddGroup.class, message = "新增操作 id必须为空")
@NotNull(groups = UpdateGroup.class, message = "修改操作 id不能为空")
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "9716")
private Long id;

View File

@@ -0,0 +1,54 @@
package com.zt.plat.module.qms.resource.material.controller.vo;
import com.zt.plat.framework.common.pojo.PageParam;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
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 = "30205")
private Long inboundId;
@Schema(description = "批次id", example = "16666")
private Long batchId;
@Schema(description = "批次工段id", example = "1454")
private Long batchGongduanId;
@Schema(description = "物料实例ID", example = "17457")
private Long materialInfomationId;
@Schema(description = "入库人", example = "赵六")
private String inboundUserName;
@Schema(description = "入库人id", example = "6313")
private Long inboundUserId;
@Schema(description = "入库人部门", example = "张三")
private String inboundDepartmentName;
@Schema(description = "入库人部门id", example = "10963")
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;
}

View File

@@ -0,0 +1,67 @@
package com.zt.plat.module.qms.resource.material.controller.vo;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.time.LocalDateTime;
@Schema(description = "管理后台 - 入库明细,验收入库、盘盈入库等 Response VO")
@Data
@ExcelIgnoreUnannotated
public class MaterialInventoryInboundDetailRespVO {
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "31154")
@ExcelProperty("主键")
private Long id;
@Schema(description = "入库单ID", example = "30205")
@ExcelProperty("入库单ID")
private Long inboundId;
@Schema(description = "批次id", example = "16666")
@ExcelProperty("批次id")
private Long batchId;
@Schema(description = "批次工段id", example = "1454")
@ExcelProperty("批次工段id")
private Long batchGongduanId;
@Schema(description = "物料实例ID", example = "17457")
@ExcelProperty("物料实例ID")
private Long materialInfomationId;
@Schema(description = "入库人", example = "赵六")
@ExcelProperty("入库人")
private String inboundUserName;
@Schema(description = "入库人id", example = "6313")
@ExcelProperty("入库人id")
private Long inboundUserId;
@Schema(description = "入库人部门", example = "张三")
@ExcelProperty("入库人部门")
private String inboundDepartmentName;
@Schema(description = "入库人部门id", example = "10963")
@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;
}

View File

@@ -0,0 +1,48 @@
package com.zt.plat.module.qms.resource.material.controller.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.time.LocalDateTime;
@Schema(description = "管理后台 - 入库明细,验收入库、盘盈入库等新增/修改 Request VO")
@Data
public class MaterialInventoryInboundDetailSaveReqVO {
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "31154")
private Long id;
@Schema(description = "入库单ID", example = "30205")
private Long inboundId;
@Schema(description = "批次id", example = "16666")
private Long batchId;
@Schema(description = "批次工段id", example = "1454")
private Long batchGongduanId;
@Schema(description = "物料实例ID", example = "17457")
private Long materialInfomationId;
@Schema(description = "入库人", example = "赵六")
private String inboundUserName;
@Schema(description = "入库人id", example = "6313")
private Long inboundUserId;
@Schema(description = "入库人部门", example = "张三")
private String inboundDepartmentName;
@Schema(description = "入库人部门id", example = "10963")
private Long inboundDepartmentId;
@Schema(description = "入库时间")
private LocalDateTime inboundTime;
@Schema(description = "所属部门")
private String systemDepartmentCode;
@Schema(description = "备注")
private String remark;
}

View File

@@ -0,0 +1,60 @@
package com.zt.plat.module.qms.resource.material.controller.vo;
import com.zt.plat.framework.common.pojo.PageParam;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
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 = "业务类型,【字典】【jy_material_in_bsn_type】验收入库、盘盈入库等", example = "2")
private String businessType;
@Schema(description = "业务类型编码")
private String businessTypeCode;
@Schema(description = "申请人")
private String applyUser;
@Schema(description = "申请人id", example = "18778")
private Long applyUserId;
@Schema(description = "申请部门")
private String applyDepartment;
@Schema(description = "申请部门id", example = "29535")
private Long applyDepartmentId;
@Schema(description = "申请时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] applyTime;
@Schema(description = "流程实例id", example = "16660")
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;
}

View File

@@ -0,0 +1,75 @@
package com.zt.plat.module.qms.resource.material.controller.vo;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.time.LocalDateTime;
@Schema(description = "管理后台 - 入库 Response VO")
@Data
@ExcelIgnoreUnannotated
public class MaterialInventoryInboundRespVO {
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "3584")
@ExcelProperty("主键")
private Long id;
@Schema(description = "标题")
@ExcelProperty("标题")
private String title;
@Schema(description = "业务类型,【字典】【jy_material_in_bsn_type】验收入库、盘盈入库等", example = "2")
@ExcelProperty("业务类型,【字典】【jy_material_in_bsn_type】验收入库、盘盈入库等")
private String businessType;
@Schema(description = "业务类型编码")
@ExcelProperty("业务类型编码")
private String businessTypeCode;
@Schema(description = "申请人")
@ExcelProperty("申请人")
private String applyUser;
@Schema(description = "申请人id", example = "18778")
@ExcelProperty("申请人id")
private Long applyUserId;
@Schema(description = "申请部门")
@ExcelProperty("申请部门")
private String applyDepartment;
@Schema(description = "申请部门id", example = "29535")
@ExcelProperty("申请部门id")
private Long applyDepartmentId;
@Schema(description = "申请时间")
@ExcelProperty("申请时间")
private LocalDateTime applyTime;
@Schema(description = "流程实例id", example = "16660")
@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;
}

View File

@@ -0,0 +1,54 @@
package com.zt.plat.module.qms.resource.material.controller.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.time.LocalDateTime;
@Schema(description = "管理后台 - 入库新增/修改 Request VO")
@Data
public class MaterialInventoryInboundSaveReqVO {
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "3584")
private Long id;
@Schema(description = "标题")
private String title;
@Schema(description = "业务类型,【字典】【jy_material_in_bsn_type】验收入库、盘盈入库等", example = "2")
private String businessType;
@Schema(description = "业务类型编码")
private String businessTypeCode;
@Schema(description = "申请人")
private String applyUser;
@Schema(description = "申请人id", example = "18778")
private Long applyUserId;
@Schema(description = "申请部门")
private String applyDepartment;
@Schema(description = "申请部门id", example = "29535")
private Long applyDepartmentId;
@Schema(description = "申请时间")
private LocalDateTime applyTime;
@Schema(description = "流程实例id", example = "16660")
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;
}

View File

@@ -0,0 +1,53 @@
package com.zt.plat.module.qms.resource.material.controller.vo;
import com.zt.plat.framework.common.pojo.PageParam;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
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 MaterialLifecycleDetailPageReqVO extends PageParam {
@Schema(description = "父id", example = "6294")
private Long materialLifecycleId;
@Schema(description = "物料大类id", example = "31283")
private String categoryProductId;
@Schema(description = "物料批次id", example = "12948")
private Long batchId;
@Schema(description = "批次工段id", example = "21334")
private Long batchGongduanId;
@Schema(description = "物料实例id", example = "968")
private Long infomationId;
@Schema(description = "影响数量", example = "15772")
private String influenceCount;
@Schema(description = "明细操作类型,【字典】【jy_material_lifecycle_detail_bsn_type】", example = "1")
private String businessType;
@Schema(description = "处理状态,0未处理1已处理", example = "2")
private Integer treatmentStatus;
@Schema(description = "表单数据,表单数据")
private String formData;
@Schema(description = "所属部门")
private String systemDepartmentCode;
@Schema(description = "备注")
private String remark;
@Schema(description = "创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime;
}

View File

@@ -0,0 +1,67 @@
package com.zt.plat.module.qms.resource.material.controller.vo;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.time.LocalDateTime;
@Schema(description = "管理后台 - 物料通用流程明细 Response VO")
@Data
@ExcelIgnoreUnannotated
public class MaterialLifecycleDetailRespVO {
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "6130")
@ExcelProperty("主键")
private Long id;
@Schema(description = "父id", example = "6294")
@ExcelProperty("父id")
private Long lifecycleId;
@Schema(description = "物料大类id", example = "31283")
@ExcelProperty("物料大类id")
private Long productId;
@Schema(description = "物料批次id", example = "12948")
@ExcelProperty("物料批次id")
private Long batchId;
@Schema(description = "批次工段id", example = "21334")
@ExcelProperty("批次工段id")
private Long batchGongduanId;
@Schema(description = "物料实例id", example = "968")
@ExcelProperty("物料实例id")
private Long infomationId;
@Schema(description = "影响数量", example = "15772")
@ExcelProperty("影响数量")
private String influenceCount;
@Schema(description = "明细操作类型,【字典】【jy_material_lifecycle_detail_bsn_type】", example = "1")
@ExcelProperty("明细操作类型,【字典】【jy_material_lifecycle_detail_bsn_type】")
private String businessType;
@Schema(description = "处理状态,0未处理1已处理", example = "2")
@ExcelProperty("处理状态,0未处理1已处理")
private Integer treatmentStatus;
@Schema(description = "表单数据,表单数据")
@ExcelProperty("表单数据,表单数据")
private String formData;
@Schema(description = "所属部门")
@ExcelProperty("所属部门")
private String systemDepartmentCode;
@Schema(description = "备注")
@ExcelProperty("备注")
private String remark;
@Schema(description = "创建时间")
@ExcelProperty("创建时间")
private LocalDateTime createTime;
}

View File

@@ -0,0 +1,46 @@
package com.zt.plat.module.qms.resource.material.controller.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
@Schema(description = "管理后台 - 物料通用流程明细新增/修改 Request VO")
@Data
public class MaterialLifecycleDetailSaveReqVO {
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "6130")
private Long id;
@Schema(description = "父id", example = "6294")
private Long lifecycleId;
@Schema(description = "物料大类id", example = "31283")
private Long productId;
@Schema(description = "物料批次id", example = "12948")
private Long batchId;
@Schema(description = "批次工段id", example = "21334")
private Long batchGongduanId;
@Schema(description = "物料实例id", example = "968")
private Long infomationId;
@Schema(description = "影响数量", example = "15772")
private String influenceCount;
@Schema(description = "明细操作类型,【字典】【jy_material_lifecycle_detail_bsn_type】", example = "1")
private String businessType;
@Schema(description = "处理状态,0未处理1已处理", example = "2")
private Integer treatmentStatus;
@Schema(description = "表单数据,表单数据")
private String formData;
@Schema(description = "所属部门")
private String systemDepartmentCode;
@Schema(description = "备注")
private String remark;
}

View File

@@ -0,0 +1,63 @@
package com.zt.plat.module.qms.resource.material.controller.vo;
import com.zt.plat.framework.common.pojo.PageParam;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
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 MaterialLifecyclePageReqVO extends PageParam {
@Schema(description = "标题")
private String title;
@Schema(description = "业务类型,【字典】【jy_material_lifecycle_bsn_type】验收、退换货、配置申请", example = "2")
private String businessType;
@Schema(description = "业务类型编码")
private String businessTypeCode;
@Schema(description = "申请人")
private String applyUser;
@Schema(description = "申请人id", example = "4976")
private Long applyUserId;
@Schema(description = "申请部门")
private String applyDepartment;
@Schema(description = "申请部门id", example = "19765")
private Long applyDepartmentId;
@Schema(description = "申请时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] applyTime;
@Schema(description = "表单数据,表单数据")
private String formData;
@Schema(description = "流程实例id", example = "12151")
private String flowInstanceId;
@Schema(description = "提交状态,提交状态,0-未提交1-已提交", example = "1")
private Integer submitStatus;
@Schema(description = "流程审批状态", example = "1")
private String flowStatus;
@Schema(description = "所属部门")
private String systemDepartmentCode;
@Schema(description = "备注")
private String remark;
@Schema(description = "创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime;
}

View File

@@ -0,0 +1,79 @@
package com.zt.plat.module.qms.resource.material.controller.vo;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.time.LocalDateTime;
@Schema(description = "管理后台 - 物料通用流程,物料验收、退换货 Response VO")
@Data
@ExcelIgnoreUnannotated
public class MaterialLifecycleRespVO {
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "7663")
@ExcelProperty("主键")
private Long id;
@Schema(description = "标题")
@ExcelProperty("标题")
private String title;
@Schema(description = "业务类型,【字典】【jy_material_lifecycle_bsn_type】验收、退换货、配置申请", example = "2")
@ExcelProperty("业务类型,【字典】【jy_material_lifecycle_bsn_type】验收、退换货、配置申请")
private String businessType;
@Schema(description = "业务类型编码")
@ExcelProperty("业务类型编码")
private String businessTypeCode;
@Schema(description = "申请人")
@ExcelProperty("申请人")
private String applyUser;
@Schema(description = "申请人id", example = "4976")
@ExcelProperty("申请人id")
private Long applyUserId;
@Schema(description = "申请部门")
@ExcelProperty("申请部门")
private String applyDepartment;
@Schema(description = "申请部门id", example = "19765")
@ExcelProperty("申请部门id")
private Long applyDepartmentId;
@Schema(description = "申请时间")
@ExcelProperty("申请时间")
private LocalDateTime applyTime;
@Schema(description = "表单数据,表单数据")
@ExcelProperty("表单数据,表单数据")
private String formData;
@Schema(description = "流程实例id", example = "12151")
@ExcelProperty("流程实例id")
private String flowInstanceId;
@Schema(description = "提交状态,提交状态,0-未提交1-已提交", example = "1")
@ExcelProperty("提交状态,提交状态,0-未提交1-已提交")
private Integer submitStatus;
@Schema(description = "流程审批状态", example = "1")
@ExcelProperty("流程审批状态")
private String flowStatus;
@Schema(description = "所属部门")
@ExcelProperty("所属部门")
private String systemDepartmentCode;
@Schema(description = "备注")
@ExcelProperty("备注")
private String remark;
@Schema(description = "创建时间")
@ExcelProperty("创建时间")
private LocalDateTime createTime;
}

View File

@@ -0,0 +1,72 @@
package com.zt.plat.module.qms.resource.material.controller.vo;
import com.zt.plat.module.qms.resource.material.valid.AddGroup;
import com.zt.plat.module.qms.resource.material.valid.UpdateGroup;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Null;
import lombok.Data;
import java.time.LocalDateTime;
import java.util.List;
@Schema(description = "管理后台 - 物料通用流程,物料验收、退换货新增/修改 Request VO")
@Data
public class MaterialLifecycleSaveReqVO {
@Null(groups = AddGroup.class, message = "新增操作 id必须为空")
@NotNull(groups = UpdateGroup.class, message = "修改操作 id不能为空")
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "7663")
private Long id;
@Schema(description = "标题")
private String title;
@Schema(description = "业务类型,【字典】【jy_material_lifecycle_bsn_type】验收、退换货、配置申请", example = "2")
private String businessType;
@Schema(description = "业务类型编码")
private String businessTypeCode;
@Schema(description = "申请人")
@NotNull(groups = AddGroup.class, message = "申请人不能为空")
private String applyUser;
@Schema(description = "申请人id", example = "4976")
@NotNull(groups = AddGroup.class, message = "申请人id 不能为空")
private Long applyUserId;
@Schema(description = "申请部门")
@NotNull(groups = AddGroup.class, message = "申请部门不能为空")
private String applyDepartment;
@Schema(description = "申请部门id", example = "19765")
@NotNull(groups = AddGroup.class, message = "申请部门id 不能为空")
private Long applyDepartmentId;
@Schema(description = "申请时间")
@NotNull(groups = AddGroup.class, message = "申请时间不能为空")
private LocalDateTime applyTime;
@Schema(description = "表单数据,表单数据")
private String formData;
// @Schema(description = "流程实例id", example = "12151")
// private String flowInstanceId;
// @Schema(description = "提交状态,提交状态,0-未提交1-已提交", example = "1")
// private Integer submitStatus;
// @Schema(description = "流程审批状态", example = "1")
// private String flowStatus;
@Schema(description = "所属部门")
private String systemDepartmentCode;
@Schema(description = "备注")
private String remark;
@Schema(description = "工段列表")
private List<Long> gongIds;
}

View File

@@ -0,0 +1,99 @@
package com.zt.plat.module.qms.resource.material.dal.dataobject;
import com.baomidou.mybatisplus.annotation.*;
import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO;
import lombok.*;
import java.time.LocalDateTime;
/**
* 入库 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;
/**
* 业务类型,【字典】【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;
}

View File

@@ -0,0 +1,89 @@
package com.zt.plat.module.qms.resource.material.dal.dataobject;
import com.baomidou.mybatisplus.annotation.*;
import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO;
import lombok.*;
import java.time.LocalDateTime;
/**
* 入库明细,验收入库、盘盈入库等 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_ID")
private Long batchId;
/**
* 批次工段id
*/
@TableField("BAT_GONG_ID")
private Long batchGongduanId;
/**
* 物料实例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;
}

View File

@@ -0,0 +1,104 @@
package com.zt.plat.module.qms.resource.material.dal.dataobject;
import com.baomidou.mybatisplus.annotation.*;
import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO;
import lombok.*;
import java.time.LocalDateTime;
/**
* 物料通用流程,物料验收、退换货 DO
*
* @author 后台管理
*/
@TableName("t_mtrl_lfc")
@KeySequence("t_mtrl_lfc_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
/**
* 支持业务基类继承isBusiness=true 时继承 BusinessBaseDO否则继承 BaseDO
*/
public class MaterialLifecycleDO extends BusinessBaseDO {
/**
* 主键
*/
@TableId(type = IdType.ASSIGN_ID)
private Long id;
/**
* 标题
*/
@TableField("TTL")
private String title;
/**
* 业务类型,【字典】【jy_material_lifecycle_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;
/**
* 表单数据,表单数据
*/
@TableField("FORM_DAT")
private String formData;
/**
* 流程实例id
*/
@TableField("FLW_INSC_ID")
private String flowInstanceId;
/**
* 提交状态,提交状态,0-未提交1-已提交
*/
@TableField("SBM_STS")
private Integer submitStatus;
/**
* 流程审批状态
*/
@TableField("FLW_STS")
private String flowStatus;
/**
* 所属部门
*/
@TableField("SYS_DEPT_CD")
private String systemDepartmentCode;
/**
* 备注
*/
@TableField("RMK")
private String remark;
}

View File

@@ -0,0 +1,87 @@
package com.zt.plat.module.qms.resource.material.dal.dataobject;
import com.baomidou.mybatisplus.annotation.*;
import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO;
import lombok.*;
/**
* 物料通用流程明细 DO
*
* @author 后台管理
*/
@TableName("t_mtrl_lfc_dtl")
@KeySequence("t_mtrl_lfc_dtl_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
/**
* 支持业务基类继承isBusiness=true 时继承 BusinessBaseDO否则继承 BaseDO
*/
public class MaterialLifecycleDetailDO extends BusinessBaseDO {
/**
* 主键
*/
@TableId(type = IdType.ASSIGN_ID)
private Long id;
/**
* 父id
*/
@TableField("LFC_ID")
private Long lifecycleId;
/**
* 物料大类id
*/
@TableField("PDT_ID")
private Long productId;
/**
* 物料批次id
*/
@TableField("BAT_ID")
private Long batchId;
/**
* 批次工段id
*/
@TableField("BAT_GONG_ID")
private Long batchGongduanId;
/**
* 物料实例id
*/
@TableField("INF_ID")
private Long infomationId;
/**
* 影响数量
*/
@TableField("INFL_CNT")
private String influenceCount;
/**
* 明细操作类型,【字典】【jy_material_lifecycle_detail_bsn_type】
*/
@TableField("BSN_TP")
private String businessType;
/**
* 处理状态,0未处理1已处理
*/
@TableField("TMT_STS")
private Integer treatmentStatus;
/**
* 表单数据,表单数据
*/
@TableField("FORM_DAT")
private String formData;
/**
* 所属部门
*/
@TableField("SYS_DEPT_CD")
private String systemDepartmentCode;
/**
* 备注
*/
@TableField("RMK")
private String remark;
}

View File

@@ -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.mapper.BaseMapperX;
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryInboundDetailPageReqVO;
import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialInventoryInboundDetailDO;
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::getBatchId, reqVO.getBatchId())
.eqIfPresent(MaterialInventoryInboundDetailDO::getBatchGongduanId, reqVO.getBatchGongduanId())
.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));
}
}

View File

@@ -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.mapper.BaseMapperX;
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryInboundPageReqVO;
import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialInventoryInboundDO;
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));
}
}

View File

@@ -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.mapper.BaseMapperX;
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialLifecycleDetailPageReqVO;
import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialLifecycleDetailDO;
import org.apache.ibatis.annotations.Mapper;
/**
* 物料通用流程明细 Mapper
*
* @author 后台管理
*/
@Mapper
public interface MaterialLifecycleDetailMapper extends BaseMapperX<MaterialLifecycleDetailDO> {
default PageResult<MaterialLifecycleDetailDO> selectPage(MaterialLifecycleDetailPageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX<MaterialLifecycleDetailDO>()
.eqIfPresent(MaterialLifecycleDetailDO::getLifecycleId, reqVO.getMaterialLifecycleId())
.eqIfPresent(MaterialLifecycleDetailDO::getProductId, reqVO.getCategoryProductId())
.eqIfPresent(MaterialLifecycleDetailDO::getBatchId, reqVO.getBatchId())
.eqIfPresent(MaterialLifecycleDetailDO::getBatchGongduanId, reqVO.getBatchGongduanId())
.eqIfPresent(MaterialLifecycleDetailDO::getInfomationId, reqVO.getInfomationId())
.eqIfPresent(MaterialLifecycleDetailDO::getInfluenceCount, reqVO.getInfluenceCount())
.eqIfPresent(MaterialLifecycleDetailDO::getBusinessType, reqVO.getBusinessType())
.eqIfPresent(MaterialLifecycleDetailDO::getTreatmentStatus, reqVO.getTreatmentStatus())
.eqIfPresent(MaterialLifecycleDetailDO::getFormData, reqVO.getFormData())
.eqIfPresent(MaterialLifecycleDetailDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode())
.eqIfPresent(MaterialLifecycleDetailDO::getRemark, reqVO.getRemark())
.betweenIfPresent(MaterialLifecycleDetailDO::getCreateTime, reqVO.getCreateTime())
.orderByDesc(MaterialLifecycleDetailDO::getId));
}
}

View File

@@ -0,0 +1,38 @@
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.mapper.BaseMapperX;
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialLifecyclePageReqVO;
import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialLifecycleDO;
import org.apache.ibatis.annotations.Mapper;
/**
* 物料通用流程,物料验收、退换货 Mapper
*
* @author 后台管理
*/
@Mapper
public interface MaterialLifecycleMapper extends BaseMapperX<MaterialLifecycleDO> {
default PageResult<MaterialLifecycleDO> selectPage(MaterialLifecyclePageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX<MaterialLifecycleDO>()
.eqIfPresent(MaterialLifecycleDO::getTitle, reqVO.getTitle())
.eqIfPresent(MaterialLifecycleDO::getBusinessType, reqVO.getBusinessType())
.eqIfPresent(MaterialLifecycleDO::getBusinessTypeCode, reqVO.getBusinessTypeCode())
.eqIfPresent(MaterialLifecycleDO::getApplyUser, reqVO.getApplyUser())
.eqIfPresent(MaterialLifecycleDO::getApplyUserId, reqVO.getApplyUserId())
.eqIfPresent(MaterialLifecycleDO::getApplyDepartment, reqVO.getApplyDepartment())
.eqIfPresent(MaterialLifecycleDO::getApplyDepartmentId, reqVO.getApplyDepartmentId())
.betweenIfPresent(MaterialLifecycleDO::getApplyTime, reqVO.getApplyTime())
.eqIfPresent(MaterialLifecycleDO::getFormData, reqVO.getFormData())
.eqIfPresent(MaterialLifecycleDO::getFlowInstanceId, reqVO.getFlowInstanceId())
.eqIfPresent(MaterialLifecycleDO::getSubmitStatus, reqVO.getSubmitStatus())
.eqIfPresent(MaterialLifecycleDO::getFlowStatus, reqVO.getFlowStatus())
.eqIfPresent(MaterialLifecycleDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode())
.eqIfPresent(MaterialLifecycleDO::getRemark, reqVO.getRemark())
.betweenIfPresent(MaterialLifecycleDO::getCreateTime, reqVO.getCreateTime())
.orderByDesc(MaterialLifecycleDO::getId));
}
}

View File

@@ -108,4 +108,12 @@ public interface MaterialBatchService {
* @return 是否
*/
Boolean submitMaterialBatch(Long id);
/**
* 根据工段ids 获取工段列表
*
* @param gongIds ids
* @return 工段列表
*/
List<MaterialBatchDO> getGongduanListByGongIds(List<Long> gongIds);
}

View File

@@ -20,6 +20,7 @@ import com.zt.plat.module.qms.resource.material.dal.mapper.MaterialBatchMapper;
import jakarta.annotation.Resource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.validation.annotation.Validated;
import java.math.BigDecimal;
@@ -94,6 +95,7 @@ public class MaterialBatchServiceImpl implements MaterialBatchService {
materialBatchMapper.deleteById(id);
}
@Transactional
@Override
public void deleteMaterialBatchListByIds(List<Long> ids) {
// 校验存在
@@ -163,6 +165,7 @@ public class MaterialBatchServiceImpl implements MaterialBatchService {
* 批次工段拆分
*
*/
@Transactional
@Override
public List<MaterialBatchRespVO> assignMaterialBatchGongduan(List<MaterialBatchSaveReqVO> createReqVOs) {
// 是否已经拆分过
@@ -245,6 +248,14 @@ public class MaterialBatchServiceImpl implements MaterialBatchService {
return true;
}
@Override
public List<MaterialBatchDO> getGongduanListByGongIds(List<Long> gongIds) {
return materialBatchMapper.selectList(Wrappers.lambdaQuery(MaterialBatchDO.class)
.in(MaterialBatchDO::getId, gongIds)
.ne(MaterialBatchDO::getParentId, 0));
}
/**
* 组装物料批次树
*

View File

@@ -0,0 +1,64 @@
package com.zt.plat.module.qms.resource.material.service;
import com.zt.plat.framework.common.pojo.PageResult;
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 com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialInventoryInboundDetailDO;
import jakarta.validation.Valid;
import java.util.List;
/**
* 入库明细,验收入库、盘盈入库等 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);
}

View File

@@ -0,0 +1,89 @@
package com.zt.plat.module.qms.resource.material.service;
import cn.hutool.core.collection.CollUtil;
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.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 com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialInventoryInboundDetailDO;
import com.zt.plat.module.qms.resource.material.dal.mapper.MaterialInventoryInboundDetailMapper;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
import java.util.List;
import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception;
import static com.zt.plat.module.qms.enums.ErrorCodeConstants.MATERIAL_INVENTORY_INBOUND_DETAIL_NOT_EXISTS;
/**
* 入库明细,验收入库、盘盈入库等 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);
}
}

View File

@@ -0,0 +1,64 @@
package com.zt.plat.module.qms.resource.material.service;
import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryInboundPageReqVO;
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryInboundRespVO;
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryInboundSaveReqVO;
import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialInventoryInboundDO;
import jakarta.validation.Valid;
import java.util.List;
/**
* 入库 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);
}

View File

@@ -0,0 +1,90 @@
package com.zt.plat.module.qms.resource.material.service;
import cn.hutool.core.collection.CollUtil;
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.controller.vo.MaterialInventoryInboundPageReqVO;
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryInboundRespVO;
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryInboundSaveReqVO;
import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialInventoryInboundDO;
import com.zt.plat.module.qms.resource.material.dal.mapper.MaterialInventoryInboundMapper;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
import java.util.List;
import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception;
import static com.zt.plat.module.qms.enums.ErrorCodeConstants.MATERIAL_INVENTORY_INBOUND_NOT_EXISTS;
/**
* 入库 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);
}
}

View File

@@ -0,0 +1,71 @@
package com.zt.plat.module.qms.resource.material.service;
import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialLifecycleDetailPageReqVO;
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialLifecycleDetailRespVO;
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialLifecycleDetailSaveReqVO;
import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialLifecycleDetailDO;
import jakarta.validation.Valid;
import java.util.List;
/**
* 物料通用流程明细 Service 接口
*
* @author 后台管理
*/
public interface MaterialLifecycleDetailService {
/**
* 创建物料通用流程明细
*
* @param createReqVO 创建信息
* @return 编号
*/
MaterialLifecycleDetailRespVO createMaterialLifecycleDetail(@Valid MaterialLifecycleDetailSaveReqVO createReqVO);
/**
* 更新物料通用流程明细
*
* @param updateReqVO 更新信息
*/
void updateMaterialLifecycleDetail(@Valid MaterialLifecycleDetailSaveReqVO updateReqVO);
/**
* 删除物料通用流程明细
*
* @param id 编号
*/
void deleteMaterialLifecycleDetail(Long id);
/**
* 批量删除物料通用流程明细
*
* @param ids 编号
*/
void deleteMaterialLifecycleDetailListByIds(List<Long> ids);
/**
* 获得物料通用流程明细
*
* @param id 编号
* @return 物料通用流程明细
*/
MaterialLifecycleDetailDO getMaterialLifecycleDetail(Long id);
/**
* 获得物料通用流程明细分页
*
* @param pageReqVO 分页查询
* @return 物料通用流程明细分页
*/
PageResult<MaterialLifecycleDetailDO> getMaterialLifecycleDetailPage(MaterialLifecycleDetailPageReqVO pageReqVO);
/**
* 批量保存
*
* @param detailDOS 需要保存的列表
* @return 成功与否
*/
Boolean saveBatch(List<MaterialLifecycleDetailDO> detailDOS);
}

View File

@@ -0,0 +1,96 @@
package com.zt.plat.module.qms.resource.material.service;
import cn.hutool.core.collection.CollUtil;
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.controller.vo.MaterialLifecycleDetailPageReqVO;
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialLifecycleDetailRespVO;
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialLifecycleDetailSaveReqVO;
import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialLifecycleDetailDO;
import com.zt.plat.module.qms.resource.material.dal.mapper.MaterialLifecycleDetailMapper;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
import java.util.List;
import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception;
import static com.zt.plat.module.qms.enums.ErrorCodeConstants.MATERIAL_LIFECYCLE_DETAIL_NOT_EXISTS;
/**
* 物料通用流程明细 Service 实现类
*
* @author 后台管理
*/
@Service
@Validated
public class MaterialLifecycleDetailServiceImpl implements MaterialLifecycleDetailService {
@Resource
private MaterialLifecycleDetailMapper materialLifecycleDetailMapper;
@Override
public MaterialLifecycleDetailRespVO createMaterialLifecycleDetail(MaterialLifecycleDetailSaveReqVO createReqVO) {
// 插入
MaterialLifecycleDetailDO materialLifecycleDetail = BeanUtils.toBean(createReqVO, MaterialLifecycleDetailDO.class);
materialLifecycleDetailMapper.insert(materialLifecycleDetail);
// 返回
return BeanUtils.toBean(materialLifecycleDetail, MaterialLifecycleDetailRespVO.class);
}
@Override
public void updateMaterialLifecycleDetail(MaterialLifecycleDetailSaveReqVO updateReqVO) {
// 校验存在
validateMaterialLifecycleDetailExists(updateReqVO.getId());
// 更新
MaterialLifecycleDetailDO updateObj = BeanUtils.toBean(updateReqVO, MaterialLifecycleDetailDO.class);
materialLifecycleDetailMapper.updateById(updateObj);
}
@Override
public void deleteMaterialLifecycleDetail(Long id) {
// 校验存在
validateMaterialLifecycleDetailExists(id);
// 删除
materialLifecycleDetailMapper.deleteById(id);
}
@Override
public void deleteMaterialLifecycleDetailListByIds(List<Long> ids) {
// 校验存在
validateMaterialLifecycleDetailExists(ids);
// 删除
materialLifecycleDetailMapper.deleteByIds(ids);
}
private void validateMaterialLifecycleDetailExists(List<Long> ids) {
List<MaterialLifecycleDetailDO> list = materialLifecycleDetailMapper.selectByIds(ids);
if (CollUtil.isEmpty(list) || list.size() != ids.size()) {
throw exception(MATERIAL_LIFECYCLE_DETAIL_NOT_EXISTS);
}
}
private void validateMaterialLifecycleDetailExists(Long id) {
if (materialLifecycleDetailMapper.selectById(id) == null) {
throw exception(MATERIAL_LIFECYCLE_DETAIL_NOT_EXISTS);
}
}
@Override
public MaterialLifecycleDetailDO getMaterialLifecycleDetail(Long id) {
return materialLifecycleDetailMapper.selectById(id);
}
@Override
public PageResult<MaterialLifecycleDetailDO> getMaterialLifecycleDetailPage(MaterialLifecycleDetailPageReqVO pageReqVO) {
return materialLifecycleDetailMapper.selectPage(pageReqVO);
}
@Override
public Boolean saveBatch(List<MaterialLifecycleDetailDO> detailDOS) {
if (CollUtil.isEmpty(detailDOS)) return false;
materialLifecycleDetailMapper.insertBatch(detailDOS);
return true;
}
}

View File

@@ -0,0 +1,64 @@
package com.zt.plat.module.qms.resource.material.service;
import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialLifecyclePageReqVO;
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialLifecycleRespVO;
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialLifecycleSaveReqVO;
import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialLifecycleDO;
import jakarta.validation.Valid;
import java.util.List;
/**
* 物料通用流程,物料验收、退换货 Service 接口
*
* @author 后台管理
*/
public interface MaterialLifecycleService {
/**
* 创建物料通用流程,物料验收、退换货
*
* @param createReqVO 创建信息
* @return 编号
*/
MaterialLifecycleRespVO createMaterialLifecycle(@Valid MaterialLifecycleSaveReqVO createReqVO);
/**
* 更新物料通用流程,物料验收、退换货
*
* @param updateReqVO 更新信息
*/
void updateMaterialLifecycle(@Valid MaterialLifecycleSaveReqVO updateReqVO);
/**
* 删除物料通用流程,物料验收、退换货
*
* @param id 编号
*/
void deleteMaterialLifecycle(Long id);
/**
* 批量删除物料通用流程,物料验收、退换货
*
* @param ids 编号
*/
void deleteMaterialLifecycleListByIds(List<Long> ids);
/**
* 获得物料通用流程,物料验收、退换货
*
* @param id 编号
* @return 物料通用流程,物料验收、退换货
*/
MaterialLifecycleDO getMaterialLifecycle(Long id);
/**
* 获得物料通用流程,物料验收、退换货分页
*
* @param pageReqVO 分页查询
* @return 物料通用流程,物料验收、退换货分页
*/
PageResult<MaterialLifecycleDO> getMaterialLifecyclePage(MaterialLifecyclePageReqVO pageReqVO);
}

View File

@@ -0,0 +1,130 @@
package com.zt.plat.module.qms.resource.material.service;
import cn.hutool.core.collection.CollUtil;
import com.zt.plat.framework.common.exception.ServiceException;
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.controller.vo.MaterialLifecyclePageReqVO;
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialLifecycleRespVO;
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialLifecycleSaveReqVO;
import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialBatchDO;
import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialLifecycleDO;
import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialLifecycleDetailDO;
import com.zt.plat.module.qms.resource.material.dal.mapper.MaterialLifecycleMapper;
import jakarta.annotation.Resource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.validation.annotation.Validated;
import java.util.List;
import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;
import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception;
import static com.zt.plat.module.qms.enums.ErrorCodeConstants.MATERIAL_LIFECYCLE_NOT_EXISTS;
/**
* 物料通用流程,物料验收、退换货 Service 实现类
*
* @author 后台管理
*/
@Service
@Validated
public class MaterialLifecycleServiceImpl implements MaterialLifecycleService {
@Resource
private MaterialLifecycleMapper materialLifecycleMapper;
@Autowired
private MaterialBatchService materialBatchService;
@Autowired
private MaterialLifecycleDetailService materialLifecycleDetailService;
@Transactional
@Override
public MaterialLifecycleRespVO createMaterialLifecycle(MaterialLifecycleSaveReqVO createReqVO) {
// 插入
MaterialLifecycleDO mtrlLfc = BeanUtils.toBean(createReqVO, MaterialLifecycleDO.class);
mtrlLfc.setSubmitStatus(0);
materialLifecycleMapper.insert(mtrlLfc);
List<Long> gongIds = createReqVO.getGongIds();
if (CollUtil.isEmpty(gongIds))
return BeanUtils.toBean(mtrlLfc, MaterialLifecycleRespVO.class);
// 保存工段明细
List<MaterialBatchDO> gongs = materialBatchService.getGongduanListByGongIds(gongIds);
if (CollUtil.isEmpty(gongs) || gongs.size() != gongIds.size())
throw new ServiceException(1_032_160_000, "工段不存在或与传入的工段数量不匹配");
Map<Long, MaterialBatchDO> gongsMap = gongs.stream().collect(Collectors.toMap(MaterialBatchDO::getId, Function.identity()));
List<MaterialLifecycleDetailDO> detailDOS = gongIds.stream().map(id -> {
MaterialBatchDO gong = gongsMap.get(id);
MaterialLifecycleDetailDO detailDO = new MaterialLifecycleDetailDO();
detailDO.setLifecycleId(mtrlLfc.getId())
.setProductId(gong.getProductId()).setBatchId(gong.getParentId())
.setBatchGongduanId(gong.getId())
.setTreatmentStatus(0);
return detailDO;
}).toList();
materialLifecycleDetailService.saveBatch(detailDOS);
return BeanUtils.toBean(mtrlLfc, MaterialLifecycleRespVO.class);
}
@Transactional
@Override
public void updateMaterialLifecycle(MaterialLifecycleSaveReqVO updateReqVO) {
MaterialLifecycleDO lifecycleDO = materialLifecycleMapper.selectById(updateReqVO.getId());
if (lifecycleDO == null) throw exception(MATERIAL_LIFECYCLE_NOT_EXISTS);
if (lifecycleDO.getSubmitStatus() == 1) throw new ServiceException(1_032_160_000, "流程已提交,不可修改");
List<Long> gongIds = updateReqVO.getGongIds();
// 更新
MaterialLifecycleDO updateObj = BeanUtils.toBean(updateReqVO, MaterialLifecycleDO.class);
if (CollUtil.isEmpty(gongIds)) {
materialLifecycleMapper.updateById(updateObj);
return;
}
// 明细表
}
@Override
public void deleteMaterialLifecycle(Long id) {
// 校验存在
validateMaterialLifecycleExists(id);
// 删除
materialLifecycleMapper.deleteById(id);
}
@Override
public void deleteMaterialLifecycleListByIds(List<Long> ids) {
// 校验存在
validateMaterialLifecycleExists(ids);
// 删除
materialLifecycleMapper.deleteByIds(ids);
}
private void validateMaterialLifecycleExists(List<Long> ids) {
List<MaterialLifecycleDO> list = materialLifecycleMapper.selectByIds(ids);
if (CollUtil.isEmpty(list) || list.size() != ids.size()) {
throw exception(MATERIAL_LIFECYCLE_NOT_EXISTS);
}
}
private void validateMaterialLifecycleExists(Long id) {
if (materialLifecycleMapper.selectById(id) == null) {
throw exception(MATERIAL_LIFECYCLE_NOT_EXISTS);
}
}
@Override
public MaterialLifecycleDO getMaterialLifecycle(Long id) {
return materialLifecycleMapper.selectById(id);
}
@Override
public PageResult<MaterialLifecycleDO> getMaterialLifecyclePage(MaterialLifecyclePageReqVO pageReqVO) {
return materialLifecycleMapper.selectPage(pageReqVO);
}
}

View File

@@ -1,4 +0,0 @@
package com.zt.plat.module.qms.resource.material.service.assist;
public class MaterialProductBatchService {
}

View File

@@ -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>

View File

@@ -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>

View File

@@ -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.MaterialLifecycleDetailMapper">
<!--
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
文档可见https://www.iocoder.cn/MyBatis/x-plugins/
-->
</mapper>

View File

@@ -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.MaterialLifecycleMapper">
<!--
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
文档可见https://www.iocoder.cn/MyBatis/x-plugins/
-->
</mapper>