| | |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.xcong.excoin.modules.platform.dao.PlatformCnyUsdtExchangeDao; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | |
| | | * @author wzy |
| | | * @date 2020-05-28 |
| | | **/ |
| | | @Slf4j |
| | | @Component |
| | | @ConditionalOnProperty(prefix = "app", name = "other-job", havingValue = "true") |
| | | public class UsdtCnyExchangePriceUpdateJob { |
| | |
| | | String code = jsonObject.getString("code"); |
| | | if ("200".equals(code)) { |
| | | JSONObject jsonData = (JSONObject) jsonObject.get("data"); |
| | | log.info("{}", jsonData); |
| | | log.info("{}", jsonData.getDouble("price")); |
| | | log.info("{}", jsonData.getString("price")); |
| | | cnyUsdtExchangeDao.updateUsdt(BigDecimal.valueOf(jsonData.getDouble("price"))); |
| | | } |
| | | } catch (Exception e) { |