Commit 971cd65d by guojuxing

toMap key重复处理

parent de33fca7
......@@ -11,6 +11,7 @@ import com.gic.api.base.commons.Page;
import com.gic.commons.util.EntityUtil;
import com.gic.enterprise.dto.BillingPayInfoDTO;
import com.gic.enterprise.utils.UserDetail;
import com.gic.finance.constant.TransferAccountApprovalStatusEnum;
import com.gic.finance.dto.TransferAccountsApprovalDTO;
import com.gic.finance.service.TransferAccountsApprovalApiService;
import org.apache.commons.collections.CollectionUtils;
......@@ -101,8 +102,8 @@ public class BillingPayInfoController {
ServiceResponse<List<TransferAccountsApprovalDTO>> approvalResponse = transferAccountsApprovalApiService
.listByOrderSerialNumber(orderSerialNumberList);
if (approvalResponse.isSuccess()) {
badMoneyMap = approvalResponse.getResult().stream().filter(e -> e != null)
.collect(Collectors.toMap(TransferAccountsApprovalDTO::getOrderNumber, TransferAccountsApprovalDTO::getBadAmount, (oldValue,newValue) -> newValue));
badMoneyMap = approvalResponse.getResult().stream().filter(e -> e.getApprovalStatus() == TransferAccountApprovalStatusEnum.AGREE.getCode())
.collect(Collectors.toMap(e -> e.getOrderNumber(), e -> e.getBadAmount(), (oldValue,newValue) -> newValue));
} else {
badMoneyMap = new HashMap<>(2);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment