优化
This commit is contained in:
@@ -148,7 +148,8 @@ public class OverseasStorageFeeService {
|
||||
throw new BizException(ResultCode.VALIDATION_FAILED, "费用类型和计费单位不匹配");
|
||||
}
|
||||
List<OverseasStorageFeeDtos.TierRequest> tiers = new ArrayList<>(source);
|
||||
tiers.sort(Comparator.comparing(OverseasStorageFeeDtos.TierRequest::feeType)
|
||||
tiers.sort(Comparator.comparingInt((OverseasStorageFeeDtos.TierRequest tier) ->
|
||||
"STORAGE".equals(tier.feeType()) ? 0 : 1)
|
||||
.thenComparingInt(OverseasStorageFeeDtos.TierRequest::startDay));
|
||||
for (String feeType : List.of("STORAGE", "RETURN_STORAGE")) {
|
||||
List<OverseasStorageFeeDtos.TierRequest> group = tiers.stream().filter(t -> feeType.equals(t.feeType())).toList();
|
||||
|
||||
Reference in New Issue
Block a user