|
|
@@ -6,6 +6,7 @@ import com.uas.platform.b2c.fa.settlement.dao.ExchangeRateDao;
|
|
|
import com.uas.platform.b2c.fa.settlement.model.ExchangeRate;
|
|
|
import com.uas.platform.b2c.fa.settlement.service.ExchangeRateService;
|
|
|
import com.uas.platform.b2c.trade.support.ResultMap;
|
|
|
+import org.apache.commons.collections.CollectionUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
@@ -58,7 +59,10 @@ public class ExchangeRateServiceImpl implements ExchangeRateService {
|
|
|
@Override
|
|
|
public ResultMap getExchangeRate(String type) {
|
|
|
List<ExchangeRate> exchangeRates = exchangeRateDao.findByFromCurrency(type);
|
|
|
- return ResultMap.success(exchangeRates);
|
|
|
+ if (CollectionUtils.isNotEmpty(exchangeRates)) {
|
|
|
+ return ResultMap.success(exchangeRates.get(0));
|
|
|
+ }
|
|
|
+ return ResultMap.success(null);
|
|
|
}
|
|
|
|
|
|
/**
|