refactor(sip): 优化产品信息查询逻辑

- 将 IProductInfoService 和 ProductInfoMapper 中的 query 方法返回类型改为 List<ProductInfo>
- 在 OrderInfoServiceImpl 和 ProductInfoServiceImpl 中添加空值判断逻辑,避免无效查询
- 使用特殊字符串 "-23232$$$$32" 作为默认序列号,以应对极端情况
master
chenhao 2025-04-23 15:09:07 +08:00
parent 2cfe2069bc
commit a118d193a6
4 changed files with 10 additions and 3 deletions

View File

@ -66,6 +66,6 @@ public interface ProductInfoMapper
List<ProductInfo> listByProductCodeList(@Param("list") List<String> productCodeList);
ProductInfo query(MaintenanceRecordsDto dto);
List<ProductInfo> query(MaintenanceRecordsDto dto);
}

View File

@ -62,5 +62,5 @@ public interface IProductInfoService
*/
public int deleteProductInfoById(Long id);
ProductInfo query(MaintenanceRecordsDto dto);
List<ProductInfo> query(MaintenanceRecordsDto dto);
}

View File

@ -134,6 +134,9 @@ public class OrderInfoServiceImpl implements IOrderInfoService
@Override
public List<OrderInfo> selectOrderInfoByMaintenance(MaintenanceRecordsDto dto) {
if (StringUtils.isEmpty(dto.getSerialNumber()) && StringUtils.isEmpty(dto.getProductCode())){
dto.setSerialNumber("-23232$$$$32");
}
return orderInfoMapper.selectOrderInfoByMaintenance(dto);
}

View File

@ -2,6 +2,7 @@ package com.ruoyi.sip.service.impl;
import java.util.List;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.sip.domain.MaintenanceRecordsDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -95,7 +96,10 @@ public class ProductInfoServiceImpl implements IProductInfoService
}
@Override
public ProductInfo query(MaintenanceRecordsDto dto) {
public List<ProductInfo> query(MaintenanceRecordsDto dto) {
if (StringUtils.isEmpty(dto.getSerialNumber()) && StringUtils.isEmpty(dto.getProductCode())){
dto.setSerialNumber("-23232$$$$32");
}
return productInfoMapper.query(dto);
}
}