refactor(sip): 优化产品信息查询逻辑
- 将 IProductInfoService 和 ProductInfoMapper 中的 query 方法返回类型改为 List<ProductInfo> - 在 OrderInfoServiceImpl 和 ProductInfoServiceImpl 中添加空值判断逻辑,避免无效查询 - 使用特殊字符串 "-23232$$$$32" 作为默认序列号,以应对极端情况master
parent
2cfe2069bc
commit
a118d193a6
|
@ -66,6 +66,6 @@ public interface ProductInfoMapper
|
||||||
|
|
||||||
List<ProductInfo> listByProductCodeList(@Param("list") List<String> productCodeList);
|
List<ProductInfo> listByProductCodeList(@Param("list") List<String> productCodeList);
|
||||||
|
|
||||||
ProductInfo query(MaintenanceRecordsDto dto);
|
List<ProductInfo> query(MaintenanceRecordsDto dto);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -62,5 +62,5 @@ public interface IProductInfoService
|
||||||
*/
|
*/
|
||||||
public int deleteProductInfoById(Long id);
|
public int deleteProductInfoById(Long id);
|
||||||
|
|
||||||
ProductInfo query(MaintenanceRecordsDto dto);
|
List<ProductInfo> query(MaintenanceRecordsDto dto);
|
||||||
}
|
}
|
||||||
|
|
|
@ -134,6 +134,9 @@ public class OrderInfoServiceImpl implements IOrderInfoService
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<OrderInfo> selectOrderInfoByMaintenance(MaintenanceRecordsDto dto) {
|
public List<OrderInfo> selectOrderInfoByMaintenance(MaintenanceRecordsDto dto) {
|
||||||
|
if (StringUtils.isEmpty(dto.getSerialNumber()) && StringUtils.isEmpty(dto.getProductCode())){
|
||||||
|
dto.setSerialNumber("-23232$$$$32");
|
||||||
|
}
|
||||||
return orderInfoMapper.selectOrderInfoByMaintenance(dto);
|
return orderInfoMapper.selectOrderInfoByMaintenance(dto);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,7 @@ package com.ruoyi.sip.service.impl;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.ruoyi.common.utils.StringUtils;
|
||||||
import com.ruoyi.sip.domain.MaintenanceRecordsDto;
|
import com.ruoyi.sip.domain.MaintenanceRecordsDto;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
@ -95,7 +96,10 @@ public class ProductInfoServiceImpl implements IProductInfoService
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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);
|
return productInfoMapper.query(dto);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue