Showing
1 changed file
with
11 additions
and
8 deletions
@@ -14,6 +14,7 @@ import com.yohoufo.order.common.InviterType; | @@ -14,6 +14,7 @@ import com.yohoufo.order.common.InviterType; | ||
14 | import com.yohoufo.order.utils.IdUtils; | 14 | import com.yohoufo.order.utils.IdUtils; |
15 | import com.yohoufo.order.utils.InviteSettlementUtils; | 15 | import com.yohoufo.order.utils.InviteSettlementUtils; |
16 | import lombok.extern.slf4j.Slf4j; | 16 | import lombok.extern.slf4j.Slf4j; |
17 | +import org.apache.commons.collections.CollectionUtils; | ||
17 | import org.apache.commons.lang3.tuple.Pair; | 18 | import org.apache.commons.lang3.tuple.Pair; |
18 | import org.springframework.beans.factory.annotation.Autowired; | 19 | import org.springframework.beans.factory.annotation.Autowired; |
19 | import org.springframework.stereotype.Service; | 20 | import org.springframework.stereotype.Service; |
@@ -163,14 +164,16 @@ public class InviterSettleService { | @@ -163,14 +164,16 @@ public class InviterSettleService { | ||
163 | inviteSettlementItemMapper.selectByUidTypeInviteSettlementIdAndSellerUid(uid, type, settlementId, stats.getSellerUid()) | 164 | inviteSettlementItemMapper.selectByUidTypeInviteSettlementIdAndSellerUid(uid, type, settlementId, stats.getSellerUid()) |
164 | ); | 165 | ); |
165 | List<Integer> ids = settle.getRight().stream().map(InviteSettlementItem::getId).collect(Collectors.toList()); | 166 | List<Integer> ids = settle.getRight().stream().map(InviteSettlementItem::getId).collect(Collectors.toList()); |
166 | - inviteSettlementItemMapper.updateToSettledRollback( | ||
167 | - uid, | ||
168 | - type, | ||
169 | - InviteSettlementItem.STATUS_SETTLED, | ||
170 | - InviteSettlementItem.STATUS_ENABLE, | ||
171 | - 0, | ||
172 | - ids | ||
173 | - ); | 167 | + if (CollectionUtils.isNotEmpty(ids)) { |
168 | + inviteSettlementItemMapper.updateToSettledRollback( | ||
169 | + uid, | ||
170 | + type, | ||
171 | + InviteSettlementItem.STATUS_SETTLED, | ||
172 | + InviteSettlementItem.STATUS_ENABLE, | ||
173 | + 0, | ||
174 | + ids | ||
175 | + ); | ||
176 | + } | ||
174 | return settle.getLeft(); | 177 | return settle.getLeft(); |
175 | }) | 178 | }) |
176 | .reduce(BigDecimal.ZERO, BigDecimal::add); | 179 | .reduce(BigDecimal.ZERO, BigDecimal::add); |
-
Please register or login to post a comment