fix:物料验收流程

This commit is contained in:
shusir
2026-02-03 18:02:09 +08:00
parent 8121c7a97f
commit a96fa0ed9b
9 changed files with 217 additions and 129 deletions

View File

@@ -93,7 +93,12 @@ public class MaterialBatchController implements BusinessControllerMarker {
@Operation(summary = "获得物料批次分页") @Operation(summary = "获得物料批次分页")
// @PreAuthorize("@ss.hasPermission('qms:material-batch:query')") // @PreAuthorize("@ss.hasPermission('qms:material-batch:query')")
public CommonResult<PageResult<MaterialBatchRespVO>> getMaterialBatchPage(@Valid MaterialBatchPageReqVO pageReqVO) { public CommonResult<PageResult<MaterialBatchRespVO>> getMaterialBatchPage(@Valid MaterialBatchPageReqVO pageReqVO) {
PageResult<MaterialBatchRespVO> pageResult = materialBatchService.getMaterialBatchPageWithPdtInfo(pageReqVO); PageResult<MaterialBatchRespVO> pageResult;
if (!pageReqVO.getOnlyGong()) {
pageResult = materialBatchService.getMaterialBatchPageWithPdtInfo(pageReqVO);
} else {
pageResult = materialBatchService.getMaterialBatchGongPageWithPdtInfo(pageReqVO);
}
return success(pageResult); return success(pageResult);
} }

View File

@@ -5,6 +5,7 @@ import com.alibaba.excel.annotation.ExcelProperty;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import java.math.BigDecimal;
import java.time.LocalDateTime; import java.time.LocalDateTime;
@Schema(description = "管理后台 - 物料通用流程明细 Response VO") @Schema(description = "管理后台 - 物料通用流程明细 Response VO")
@@ -53,6 +54,10 @@ public class MaterialLifecycleDetailRespVO {
@ExcelProperty("批次工段-部门名称") @ExcelProperty("批次工段-部门名称")
private String assignDepartmentName; private String assignDepartmentName;
@Schema(description = "是否检化验,1-是0-否")
@ExcelProperty("是否检化验,1-是0-否")
private Integer assayFlag;
@Schema(description = "物料实例id", example = "968") @Schema(description = "物料实例id", example = "968")
@ExcelProperty("物料实例id") @ExcelProperty("物料实例id")
private Long infomationId; private Long infomationId;

View File

@@ -22,6 +22,9 @@ public class MaterialLifecycleDetailSaveReqVO {
@Schema(description = "批次工段id", example = "21334") @Schema(description = "批次工段id", example = "21334")
private Long batchGongduanId; private Long batchGongduanId;
@Schema(description = "是否检化验,1-是0-否")
private Integer assayFlag;
@Schema(description = "物料实例id", example = "968") @Schema(description = "物料实例id", example = "968")
private Long infomationId; private Long infomationId;

View File

@@ -42,7 +42,6 @@ public class MaterialLifecycleSaveReqVO {
private Long applyDepartmentId; private Long applyDepartmentId;
@Schema(description = "申请时间") @Schema(description = "申请时间")
@NotNull(groups = AddGroup.class, message = "申请时间不能为空")
private LocalDateTime applyTime; private LocalDateTime applyTime;
@Schema(description = "表单数据,表单数据") @Schema(description = "表单数据,表单数据")
@@ -64,6 +63,6 @@ public class MaterialLifecycleSaveReqVO {
private String remark; private String remark;
@Schema(description = "工段列表") @Schema(description = "工段列表")
private List<Long> gongIds; private List<MaterialLifecycleDetailSaveReqVO> detailList;
} }

View File

@@ -48,6 +48,11 @@ public class MaterialLifecycleDetailDO extends BusinessBaseDO {
*/ */
@TableField("BAT_GONG_ID") @TableField("BAT_GONG_ID")
private Long batchGongduanId; private Long batchGongduanId;
/**
* 是否检化验,1-是0-否
*/
@TableField("ASY_FLG")
private Integer assayFlag;
/** /**
* 物料实例id * 物料实例id
*/ */

View File

@@ -1,7 +1,6 @@
package com.zt.plat.module.qms.resource.material.dal.mapper; package com.zt.plat.module.qms.resource.material.dal.mapper;
import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollUtil;
import com.github.yulichang.base.MPJBaseMapper;
import com.github.yulichang.wrapper.MPJLambdaWrapper; import com.github.yulichang.wrapper.MPJLambdaWrapper;
import com.zt.plat.framework.common.pojo.PageResult; import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
@@ -44,8 +43,38 @@ public interface MaterialBatchMapper extends BaseMapperX<MaterialBatchDO> {
.orderByDesc(MaterialBatchDO::getId)); .orderByDesc(MaterialBatchDO::getId));
} }
// onlyGong 是否只查询工段 default PageResult<MaterialBatchRespVO> selectPageWithPdtInfo(MaterialBatchPageReqVO reqVO, List<Long> pdtIds) {
default PageResult<MaterialBatchRespVO> selectPage(MaterialBatchPageReqVO reqVO, List<Long> pdtIds, Boolean onlyGong) {
MPJLambdaWrapper<MaterialBatchDO> wrapper = new MPJLambdaWrapperX<MaterialBatchDO>()
.selectAll(MaterialBatchDO.class)
.selectAs(MaterialProductDO::getName, MaterialBatchRespVO::getProductName)
.selectAs(MaterialProductDO::getCode, MaterialBatchRespVO::getProductCode)
.selectAs(MaterialProductDO::getModelNo, MaterialBatchRespVO::getProductModelNo)
.leftJoin(MaterialProductDO.class, MaterialProductDO::getId, MaterialBatchDO::getProductId)
// 只查询批次
.eq(MaterialBatchDO::getParentId, 0)
.in(CollUtil.isNotEmpty(pdtIds), MaterialBatchDO::getProductId, pdtIds)
.eq(CollUtil.isEmpty(pdtIds) && reqVO.getProductId() != null, MaterialBatchDO::getProductId, reqVO.getProductId())
.likeIfExists(MaterialBatchDO::getBatchNo, reqVO.getBatchNo())
.likeIfExists(MaterialBatchDO::getLocation, reqVO.getLocation())
.likeIfExists(MaterialBatchDO::getSupplierId, reqVO.getSupplierId())
// .betweenIfPresent(MaterialBatchDO::getManufacturerDate, reqVO.getManufacturerDate())
// .betweenIfPresent(MaterialBatchDO::getDueDate, reqVO.getDueDate())
.eqIfExists(MaterialBatchDO::getAssignDepartmentId, reqVO.getAssignDepartmentId())
.likeIfExists(MaterialBatchDO::getAssignDepartmentName, reqVO.getAssignDepartmentName())
.eqIfExists(MaterialBatchDO::getAcceptanceStatus, reqVO.getAcceptanceStatus())
.eqIfExists(MaterialBatchDO::getAssayFlag, reqVO.getAssayFlag())
.eqIfExists(MaterialBatchDO::getAssayStatus, reqVO.getAssayStatus())
.eqIfExists(MaterialBatchDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode())
.eqIfExists(MaterialBatchDO::getRemark, reqVO.getRemark())
// .betweenIfPresent(MaterialBatchDO::getCreateTime, reqVO.getCreateTime())
.orderByDesc(MaterialBatchDO::getId);
return selectJoinPage(reqVO, MaterialBatchRespVO.class, wrapper);
}
default PageResult<MaterialBatchRespVO> selectGongPage(MaterialBatchPageReqVO reqVO, List<Long> pdtIds) {
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser(); LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
Long visitDeptId = null; Long visitDeptId = null;
if (loginUser != null) { if (loginUser != null) {
@@ -57,11 +86,10 @@ public interface MaterialBatchMapper extends BaseMapperX<MaterialBatchDO> {
.selectAs(MaterialProductDO::getCode, MaterialBatchRespVO::getProductCode) .selectAs(MaterialProductDO::getCode, MaterialBatchRespVO::getProductCode)
.selectAs(MaterialProductDO::getModelNo, MaterialBatchRespVO::getProductModelNo) .selectAs(MaterialProductDO::getModelNo, MaterialBatchRespVO::getProductModelNo)
.leftJoin(MaterialProductDO.class, MaterialProductDO::getId, MaterialBatchDO::getProductId) .leftJoin(MaterialProductDO.class, MaterialProductDO::getId, MaterialBatchDO::getProductId)
// 只查询批次,不查询工段
.eq(onlyGong != null && !onlyGong, MaterialBatchDO::getParentId, 0)
// 只查询工段 // 只查询工段
.ne(onlyGong != null && onlyGong, MaterialBatchDO::getParentId, 0) .ne(MaterialBatchDO::getParentId, 0)
.eq(onlyGong != null && onlyGong, MaterialBatchDO::getSubmitStatus, 1) .eq(MaterialBatchDO::getSubmitStatus, 1)
.notExists("SELECT 1 FROM t_mtrl_lfc_dtl ld WHERE ld.BAT_GONG_ID = t.id AND ld.DELETED = 0")
// .eq(onlyGong != null && visitDeptId != null && onlyGong, MaterialBatchDO::getAssignDepartmentId, visitDeptId) // .eq(onlyGong != null && visitDeptId != null && onlyGong, MaterialBatchDO::getAssignDepartmentId, visitDeptId)
.in(CollUtil.isNotEmpty(pdtIds), MaterialBatchDO::getProductId, pdtIds) .in(CollUtil.isNotEmpty(pdtIds), MaterialBatchDO::getProductId, pdtIds)
.eq(CollUtil.isEmpty(pdtIds) && reqVO.getProductId() != null, MaterialBatchDO::getProductId, reqVO.getProductId()) .eq(CollUtil.isEmpty(pdtIds) && reqVO.getProductId() != null, MaterialBatchDO::getProductId, reqVO.getProductId())

View File

@@ -1,5 +1,6 @@
package com.zt.plat.module.qms.resource.material.dal.mapper; package com.zt.plat.module.qms.resource.material.dal.mapper;
import com.github.yulichang.wrapper.MPJLambdaWrapper;
import com.zt.plat.framework.common.pojo.PageResult; import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
@@ -39,16 +40,18 @@ public interface MaterialLifecycleDetailMapper extends BaseMapperX<MaterialLifec
} }
default List<MaterialLifecycleDetailRespVO> selectListWithPdtBatInfo(Long id){ default List<MaterialLifecycleDetailRespVO> selectListWithPdtBatInfo(Long id){
MPJLambdaWrapperX<MaterialLifecycleDetailDO> wrapperX = new MPJLambdaWrapperX<MaterialLifecycleDetailDO>() MPJLambdaWrapper<MaterialLifecycleDetailDO> wrapper = new MPJLambdaWrapper<MaterialLifecycleDetailDO>()
.selectAll(MaterialLifecycleDetailDO.class) .selectAll(MaterialLifecycleDetailDO.class)
.selectAs(MaterialProductDO::getName, MaterialLifecycleDetailRespVO::getProductName) .selectAs(MaterialProductDO::getName, MaterialLifecycleDetailRespVO::getProductName)
.selectAs(MaterialProductDO::getCode, MaterialLifecycleDetailRespVO::getProductCode) .selectAs(MaterialProductDO::getCode, MaterialLifecycleDetailRespVO::getProductCode)
.selectAs(MaterialProductDO::getModelNo, MaterialLifecycleDetailRespVO::getProductModelNo) .selectAs(MaterialProductDO::getModelNo, MaterialLifecycleDetailRespVO::getProductModelNo)
.selectAs(MaterialBatchDO::getBatchNo, MaterialLifecycleDetailRespVO::getBatchNo) .selectAs("batch.BAT_NO", MaterialLifecycleDetailRespVO::getBatchNo)
.selectAs("gongduan.INB_QTY", MaterialLifecycleDetailRespVO::getInfluenceCount)
.leftJoin(MaterialProductDO.class, MaterialProductDO::getId, MaterialLifecycleDetailDO::getProductId) .leftJoin(MaterialProductDO.class, MaterialProductDO::getId, MaterialLifecycleDetailDO::getProductId)
.leftJoin(MaterialBatchDO.class, MaterialBatchDO::getId, MaterialLifecycleDetailDO::getBatchId) .leftJoin(MaterialBatchDO.class, "batch", MaterialBatchDO::getId, MaterialLifecycleDetailDO::getBatchId)
.leftJoin(MaterialBatchDO.class, "gongduan", MaterialBatchDO::getId, MaterialLifecycleDetailDO::getBatchGongduanId)
.eq(MaterialLifecycleDetailDO::getLifecycleId, id); .eq(MaterialLifecycleDetailDO::getLifecycleId, id);
return selectJoinList(MaterialLifecycleDetailRespVO.class, wrapperX); return selectJoinList(MaterialLifecycleDetailRespVO.class, wrapper);
} }
} }