Authored by LUOXC

fixbug

@@ -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,6 +164,7 @@ public class InviterSettleService { @@ -163,6 +164,7 @@ 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());
  167 + if (CollectionUtils.isNotEmpty(ids)) {
166 inviteSettlementItemMapper.updateToSettledRollback( 168 inviteSettlementItemMapper.updateToSettledRollback(
167 uid, 169 uid,
168 type, 170 type,
@@ -171,6 +173,7 @@ public class InviterSettleService { @@ -171,6 +173,7 @@ public class InviterSettleService {
171 0, 173 0,
172 ids 174 ids
173 ); 175 );
  176 + }
174 return settle.getLeft(); 177 return settle.getLeft();
175 }) 178 })
176 .reduce(BigDecimal.ZERO, BigDecimal::add); 179 .reduce(BigDecimal.ZERO, BigDecimal::add);