demand: 分批逻辑修复

This commit is contained in:
aike 2025-12-12 13:57:59 +08:00
parent e332b01163
commit c445db1d3e
4 changed files with 12 additions and 0 deletions

View File

@ -12,3 +12,4 @@ import java.lang.annotation.*;
public @interface WaybillLightCount {
}

View File

@ -49,3 +49,4 @@ public class EmisWaybillOther extends BaseEntity {
private String salesSupport;
}

View File

@ -78,3 +78,4 @@ public interface EmisWaybillOtherMapper extends BaseMapper<EmisWaybillOther> {
public int deleteEmisWaybillOtherByBillCode(@Param("billCode") String billCode);
}

View File

@ -293,6 +293,15 @@ public class EmisTmsSiteBatchDtlServiceImpl implements IEmisTmsSiteBatchDtlServi
}
}
// 根据batchNo去重
Map<String, EmisTmsSiteBatch> uniqueBatchMap = new LinkedHashMap<>();
for (EmisTmsSiteBatch batch : existingBatches) {
if (StringUtils.isNotBlank(batch.getBatchNo())) {
uniqueBatchMap.putIfAbsent(batch.getBatchNo(), batch);
}
}
existingBatches = new ArrayList<>(uniqueBatchMap.values());
// 计算去重后的批次总重量、总件数、总体积
BigDecimal totalWeight = existingBatches.stream()
.map(EmisTmsSiteBatch::getTotalWeight)