Merge pull request 'demand: 分批逻辑修复' (#265) from develop into master

Reviewed-on: http://git.xdadan.loc/tanex/emis-service/pulls/265
This commit is contained in:
heyu 2025-12-12 13:59:15 +08:00
commit b68d02dbe9
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)