fix:退料页面优化,对账修改关闭逐个查询

This commit is contained in:
zhaoyf
2026-11-30 15:20:19 +08:00
parent c33b6ad2a2
commit 616f1ee81b
3 changed files with 92 additions and 60 deletions

View File

@@ -32,7 +32,7 @@ import java.util.stream.Collectors;
public class SapStockQueryService {
/** 单次请求的最大物料数,避免报文过大 */
private static final int BATCH_SIZE = 200;
private static final int BATCH_SIZE = 10000;
private final SapApi sapApi;
@@ -77,8 +77,9 @@ public class SapStockQueryService {
JSONObject result = sapApi.stockQueryBatch(chunk, SapConstant.WERKS, targetLgort);
mergeInto(merged, parse(result));
} catch (Exception e) {
log.warn("SAP库存批量查询失败({}个物料),退回逐个查询:{}", chunk.size(), e.getMessage());
queryOneByOne(merged, chunk, targetLgort, failedMaterials);
throw new BadRequestException("SAP库存查询失败:" + e.getMessage());
// log.warn("SAP库存批量查询失败({}个物料),退回逐个查询:{}", chunk.size(), e.getMessage());
// queryOneByOne(merged, chunk, targetLgort, failedMaterials);
}
}
return merged;

View File

@@ -52,9 +52,6 @@
<if test="query.sourceHouseCode != null and query.sourceHouseCode != ''">
and source_house_code like concat('%', #{query.sourceHouseCode}, '%')
</if>
<if test="query.sourceHouseCode != null and query.sourceHouseCode != ''">
and target_house_code like concat('%', #{query.targetHouseCode}, '%')
</if>
<if test="query.status != null">
and status = #{query.status}
</if>