库存查询按照过期日期来过滤查询

This commit is contained in:
秦鸿展
2026-07-22 10:39:34 +08:00
parent be597775d9
commit 494f49ee1b
5 changed files with 53 additions and 1 deletions
@@ -18,6 +18,7 @@ import com.mhd.wms.domain.materialInventory.repository.po.MaterialInventoryQuery
import com.mhd.wms.domain.materialInventory.repository.todo.MaterialInventoryDO;
import com.mhd.wms.domain.materialInventory.repository.todo.MaterialInventoryQueryListDO;
import com.mhd.wms.domain.materialInventory.service.MaterialInventoryDomainService;
import com.mhd.wms.interfaces.dto.materialInventory.MaterialInventoryDTO;
import com.mhd.wms.domain.materialBarCode.repository.facade.IMaterialBarCodeService;
import com.mhd.wms.domain.materialBarCode.repository.po.MaterialBarCodePO;
import com.mhd.wms.domain.materialMoreDetail.repository.po.MaterialMoreDetailPO;
@@ -32,6 +32,8 @@ public interface MaterialInventoryMapper extends BaseMapper<MaterialInventory>
public List<MaterialInventoryPO> queryListByKw(MaterialInventoryDO materialInventoryDO);
//查物料库存列表-物料
public List<MaterialInventoryPO> queryListByWl(MaterialInventoryDO materialInventoryDO);
//查物料库存列表-物料+过期日期
public List<MaterialInventoryPO> queryListByWlExpiry(MaterialInventoryDO materialInventoryDO);
//查物料库存列表-货主
public List<MaterialInventoryPO> queryListByHz(MaterialInventoryDO materialInventoryDO);
//查物料库存列表-货主+物料(同一物料在不同货主下各一行)
@@ -85,6 +85,8 @@ public class MaterialInventoryImpl extends ServiceImpl<MaterialInventoryMapper,
return materialInventoryMapper.queryListByKw(materialInventoryDO);
} else if ("wlkw".equals(queryRule)) {
return materialInventoryMapper.queryListByWlKw(materialInventoryDO);
} else if ("wlExpiry".equals(queryRule)) {
return materialInventoryMapper.queryListByWlExpiry(materialInventoryDO);
} else if ("all".equals(queryRule)) {
return materialInventoryMapper.queryList(materialInventoryDO);
} else {
@@ -55,7 +55,9 @@ public class MaterialInventoryApi extends BaseController {
@GetMapping("/list")
public TableDataInfo list(MaterialInventoryDTO materialInventoryDTO,
@RequestParam(value = "customerName", required = false) String customerName,
@RequestParam(value = "excludeZeroInventoryQuantity", required = false) Boolean excludeZeroInventoryQuantity)
@RequestParam(value = "excludeZeroInventoryQuantity", required = false) Boolean excludeZeroInventoryQuantity,
@RequestParam(value = "expiryDateStart", required = false) String expiryDateStart,
@RequestParam(value = "expiryDateEnd", required = false) String expiryDateEnd)
{
if (Boolean.TRUE.equals(excludeZeroInventoryQuantity)) {
materialInventoryDTO.setExcludeZeroInventoryQuantity(true);
@@ -86,6 +88,8 @@ public class MaterialInventoryApi extends BaseController {
MaterialInventoryDO materialInventoryDO = materialInventoryAssembler.toDO(materialInventoryDTO);
materialInventoryDO.setExpiryDateStr(materialInventoryDTO.getExpiryDate());
materialInventoryDO.setProductionDateStr(materialInventoryDTO.getProductionDate());
materialInventoryDO.setExpiryDateStart(expiryDateStart);
materialInventoryDO.setExpiryDateEnd(expiryDateEnd);
Date updateTime = materialInventoryDTO.getUpdateTime();
if (updateTime != null) {
LocalDateTime localDateTime = updateTime.toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime();