fix:物料盘点 todo 库存数量需要带上仓库或库位条件。

This commit is contained in:
shusir
2026-03-24 18:04:22 +08:00
parent f253ea4f39
commit a227770ec1
25 changed files with 353 additions and 290 deletions

View File

@@ -79,4 +79,12 @@ public interface ConfigWarehouseLocationService {
* @return 存放位置列表
*/
List<ConfigWarehouseLocationDO> getListByIds(List<Long> ids);
/**
* 获得存放位置列表
*
* @param warehouseIds 仓库id集合
* @return 存放位置列表
*/
List<ConfigWarehouseLocationDO> getLocationsByWarehouseIds(List<Long> warehouseIds);
}

View File

@@ -2,6 +2,7 @@ package com.zt.plat.module.qms.business.config.service;
import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.zt.plat.framework.common.pojo.CommonResult;
import com.zt.plat.framework.security.core.util.SecurityFrameworkUtils;
import com.zt.plat.module.qms.business.config.controller.vo.ConfigPermissionSaveReqVO;
@@ -194,4 +195,12 @@ public class ConfigWarehouseLocationServiceImpl implements ConfigWarehouseLocati
return configWarehouseLocationMapper.selectByIds(ids);
}
@Override
public List<ConfigWarehouseLocationDO> getLocationsByWarehouseIds(List<Long> warehouseIds) {
if (CollUtil.isEmpty(warehouseIds)) return Collections.emptyList();
return configWarehouseLocationMapper.selectList(Wrappers.lambdaQuery(ConfigWarehouseLocationDO.class)
.eq(ConfigWarehouseLocationDO::getDataType, QmsWarehouseLocationConstant.DATA_TYPE_LOCATION)
.in(ConfigWarehouseLocationDO::getParentId, warehouseIds));
}
}

View File

@@ -46,6 +46,12 @@ public class MaterialInventoryCheckDetailController implements BusinessControlle
return success(materialInventoryCheckDetailService.createMaterialInventoryCheckDetail(createReqVO));
}
@PutMapping("/inventory-inf")
@Operation(summary = "盘点物料")
public CommonResult<MaterialInventoryCheckDetailRespVO> inventoryCheckInfomation(@Valid @RequestBody MaterialInventoryCheckDetailSaveReqVO inventoryReqVO) {
return success(materialInventoryCheckDetailService.inventoryCheckInfomation(inventoryReqVO));
}
// @PutMapping("/update")
@Operation(summary = "更新库存盘点明细")
@PreAuthorize("@ss.hasPermission('qms:material-inventory-check-detail:update')")
@@ -85,8 +91,8 @@ public class MaterialInventoryCheckDetailController implements BusinessControlle
@Operation(summary = "获得库存盘点明细分页")
// @PreAuthorize("@ss.hasPermission('qms:material-inventory-check-detail:query')")
public CommonResult<PageResult<MaterialInventoryCheckDetailRespVO>> getMaterialInventoryCheckDetailPage(@Valid MaterialInventoryCheckDetailPageReqVO pageReqVO) {
PageResult<MaterialInventoryCheckDetailDO> pageResult = materialInventoryCheckDetailService.getMaterialInventoryCheckDetailPage(pageReqVO);
return success(BeanUtils.toBean(pageResult, MaterialInventoryCheckDetailRespVO.class));
PageResult<MaterialInventoryCheckDetailRespVO> pageResult = materialInventoryCheckDetailService.getPageWithInf(pageReqVO);
return success(pageResult);
}
@GetMapping("/export-excel")

View File

@@ -16,12 +16,6 @@ import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH
@Data
public class MaterialInfomationPageReqVO extends PageParam {
@Schema(description = "业务类型 inventory_check_detail-盘点明细")
private MaterialInfomationPageBusinessType businessType;
@Schema(description = "盘点项id")
private Long checkItemId;
@Schema(description = "物料大类id", example = "2691")
private Long productId;

View File

@@ -194,6 +194,9 @@ public class MaterialInfomationRespVO {
@Schema(description = "盘点明细id")
private Long checkDetailId;
@Schema(description = "是否在库")
private Integer present;
@Schema(description = "初始总量")
@ExcelProperty("初始总量")
private BigDecimal initialVolume;

View File

@@ -13,8 +13,11 @@ import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH
@Data
public class MaterialInventoryCheckDetailPageReqVO extends PageParam {
@Schema(description = "盘点单id")
private Long checkId;
@Schema(description = "盘点项id", example = "1655")
private Long parentId;
private Long itemId;
@Schema(description = "物料实例id", example = "6754")
private Long infomationId;

View File

@@ -26,14 +26,25 @@ public class MaterialInventoryCheckDetailRespVO {
@ExcelProperty("物料实例id")
private Long infomationId;
@Schema(description = "物料名称")
private String infomationName;
@Schema(description = "物料编号")
private String infomationCode;
@Schema(description = "批次号")
private String batchNo;
@Schema(description = "存放位置")
private String locationName;
@Schema(description = "存放位置编码")
private String locationCode;
@Schema(description = "是否存在,1-存在0-不存在")
@ExcelProperty("是否存在,1-存在0-不存在")
private Integer present;
@Schema(description = "物料编号,系统不存在的临时存储起来")
@ExcelProperty("物料编号,系统不存在的临时存储起来")
private String infomationCode;
@Schema(description = "当前数量")
@ExcelProperty("当前数量")
private String currentQuantity;

View File

@@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.math.BigDecimal;
@Schema(description = "管理后台 - 库存盘点明细新增/修改 Request VO")
@Data
public class MaterialInventoryCheckDetailSaveReqVO {
@@ -27,7 +29,7 @@ public class MaterialInventoryCheckDetailSaveReqVO {
private String infomationCode;
@Schema(description = "当前数量")
private String currentQuantity;
private BigDecimal currentQuantity;
@Schema(description = "状态", example = "1")
private String status;

View File

@@ -2,6 +2,7 @@ package com.zt.plat.module.qms.resource.material.controller.vo;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.TableField;
import com.zt.plat.module.infra.api.businessfile.dto.BusinessFileWithUrlRespDTO;
import com.zt.plat.module.qms.core.aspect.annotation.Dict;
import io.swagger.v3.oas.annotations.media.Schema;
@@ -91,6 +92,9 @@ public class MaterialLifecycleRespVO {
@Schema(description = "事由/说明")
private String reason;
@Schema(description = "自定义json配置")
private String customConfig;
@Schema(description = "所属部门")
@ExcelProperty("所属部门")
private String systemDepartmentCode;

View File

@@ -8,6 +8,7 @@ import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import java.util.List;
import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@@ -15,6 +16,18 @@ import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH
@Data
public class MaterialProductPageReqVO extends PageParam {
@Schema(description = "业务类型")
private String businessType;
@Schema(description = "部门ids")
private List<Long> departmentIds;
@Schema(description = "仓库ids")
private List<Long> warehouseIds;
@Schema(description = "库位ids")
private List<Long> locationIds;
@Schema(description = "父id", example = "7533")
private Long parentId;

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