详情查询修改

This commit is contained in:
秦鸿展
2026-05-07 17:43:54 +08:00
parent afdea9dbf1
commit b754aaf949
3 changed files with 24 additions and 6 deletions
@@ -106,7 +106,8 @@ public class BatchDetailApplicationService {
throw new ServiceException("获取物料规则信息失败");
}
MaterialGoodsRuleFeign materialGoodsRuleFeign = JSON.parseObject(JSONObject.toJSONString(ajaxResult.get("data")), MaterialGoodsRuleFeign.class);
if (ObjectUtil.isNull(materialGoodsRuleFeign)){
// 无商品规则或未绑定批次模板时,不返回任何批次属性(避免 batchId 空导致查全表)
if (ObjectUtil.isNull(materialGoodsRuleFeign) || materialGoodsRuleFeign.getBatchId() == null) {
return new ArrayList<>();
}
return getBatchDetailListByBatchId(materialGoodsRuleFeign.getBatchId());
@@ -7,6 +7,7 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
/**
* 批次管理详情
@@ -66,6 +67,10 @@ public class BatchDetailDomainService {
* 获取批次管理详情详细信息
*/
public List<BatchDetailPO> getBatchDetailListByBatchId(Long batchId) {
// batchId 为空时不能查列表:XML 中 batchId 为 null 不拼条件,会返回全部批次属性
if (batchId == null) {
return new ArrayList<>();
}
BatchDetailDO batchDetailDO = new BatchDetailDO();
batchDetailDO.setBatchId(batchId);
return batchDetailService.queryList(batchDetailDO);