Authored by LUOXC

fixbug

... ... @@ -14,6 +14,7 @@ import com.yohoufo.order.common.InviterType;
import com.yohoufo.order.utils.IdUtils;
import com.yohoufo.order.utils.InviteSettlementUtils;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.tuple.Pair;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
... ... @@ -163,14 +164,16 @@ public class InviterSettleService {
inviteSettlementItemMapper.selectByUidTypeInviteSettlementIdAndSellerUid(uid, type, settlementId, stats.getSellerUid())
);
List<Integer> ids = settle.getRight().stream().map(InviteSettlementItem::getId).collect(Collectors.toList());
inviteSettlementItemMapper.updateToSettledRollback(
uid,
type,
InviteSettlementItem.STATUS_SETTLED,
InviteSettlementItem.STATUS_ENABLE,
0,
ids
);
if (CollectionUtils.isNotEmpty(ids)) {
inviteSettlementItemMapper.updateToSettledRollback(
uid,
type,
InviteSettlementItem.STATUS_SETTLED,
InviteSettlementItem.STATUS_ENABLE,
0,
ids
);
}
return settle.getLeft();
})
.reduce(BigDecimal.ZERO, BigDecimal::add);
... ...