|
|
@@ -16,7 +16,9 @@ import com.uas.platform.b2c.trade.rate.model.RateVendor;
|
|
|
import com.uas.platform.b2c.trade.rate.service.RateService;
|
|
|
import com.uas.platform.core.exception.IllegalOperatorException;
|
|
|
import com.uas.platform.core.model.Status;
|
|
|
+import org.apache.kafka.common.metrics.stats.Rate;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.data.mongodb.core.index.Index;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
@@ -189,17 +191,35 @@ public class RateServiceImpl implements RateService{
|
|
|
|
|
|
@Override
|
|
|
public RateBuyer getRateBuyerByOrderId(String orderId) {
|
|
|
- return rateBuyerDao.findByOrderId(orderId).get(0);
|
|
|
+ RateBuyer rateBuyer ;
|
|
|
+ try {
|
|
|
+ rateBuyer = rateBuyerDao.findByOrderId(orderId).get(0);
|
|
|
+ }catch (IndexOutOfBoundsException e){
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ return rateBuyer;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public RateVendor getRateVendorByOrderId(String orderId) {
|
|
|
- return rateVendorDao.findByOrderId(orderId).get(0);
|
|
|
+ RateVendor rateVendor;
|
|
|
+ try {
|
|
|
+ rateVendor = rateVendorDao.findByOrderId(orderId).get(0);
|
|
|
+ }catch (IndexOutOfBoundsException e){
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ return rateVendor;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public RateGoods getRateGoodsByGoodsId(Long goodsId) {
|
|
|
- return rateGoodsDao.findByGoodsId(goodsId).get(0);
|
|
|
+ RateGoods rateGoods;
|
|
|
+ try {
|
|
|
+ rateGoods = rateGoodsDao.findByGoodsId(goodsId).get(0);
|
|
|
+ }catch (IndexOutOfBoundsException e){
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ return rateGoods;
|
|
|
}
|
|
|
|
|
|
@Override
|