| | |
| | | DataDictionaryCustom coinAPriceDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode( |
| | | PoolEnum.COIN_A_PRICE.getType(), |
| | | PoolEnum.COIN_A_PRICE.getCode()); |
| | | |
| | | BigDecimal coinAPrice = coinAUsdt.divide(coinACnt,12,BigDecimal.ROUND_DOWN); |
| | | coinAPriceDic.setValue(coinAPrice.toString()); |
| | | dataDictionaryCustomMapper.updateById(coinAPriceDic); |
| | |
| | | DappAKlineEntity oldOne = dappAKlineMapper.selectOneByType(); |
| | | if(ObjectUtil.isNotEmpty(oldOne)){ |
| | | dappAKlineEntity.setOpenPrice(oldOne.getClosePrice()); |
| | | dappAKlineEntity.setLowestPrice(oldOne.getOpenPrice()); |
| | | dappAKlineEntity.setLowestPrice(oldOne.getClosePrice()); |
| | | }else{ |
| | | dappAKlineEntity.setOpenPrice(coinAPrice); |
| | | dappAKlineEntity.setLowestPrice(coinAPrice); |
| | |
| | | dappAKlineEntity.setType(1); |
| | | if(CollUtil.isNotEmpty(dappAKlineEntities)){ |
| | | |
| | | List<BigDecimal> openPriceList = dappAKlineEntities.stream().map(DappAKlineEntity::getClosePrice).collect(Collectors.toList()); |
| | | List<BigDecimal> openPriceList = dappAKlineEntities.stream().map(DappAKlineEntity::getOpenPrice).collect(Collectors.toList()); |
| | | BigDecimal openPrice = openPriceList.stream().min(BigDecimal::compareTo).get(); |
| | | dappAKlineEntity.setOpenPrice(openPrice); |
| | | //获取最高价 |
| | |
| | | dappAKlineEntity.setHighestPrice(coinAPrice); |
| | | dappAKlineEntity.setLowestPrice(coinAPrice); |
| | | } |
| | | DappAKlineEntity oldOne = dappAKlineMapper.selectOneByType(); |
| | | if(ObjectUtil.isNotEmpty(oldOne)){ |
| | | dappAKlineEntity.setClosePrice(oldOne.getClosePrice()); |
| | | }else{ |
| | | dappAKlineEntity.setClosePrice(coinAPrice); |
| | | } |
| | | dappAKlineEntity.setClosePrice(coinAPrice); |
| | | dappAKlineMapper.insert(dappAKlineEntity); |
| | | |
| | | chainProducer.sendAntKLineMsg(1); |
| | |
| | | DappAKlineEntity oldOne = dappAKlineMapper.selectOneByType(); |
| | | if(ObjectUtil.isNotEmpty(oldOne)){ |
| | | dappAKlineEntity.setOpenPrice(oldOne.getClosePrice()); |
| | | dappAKlineEntity.setLowestPrice(oldOne.getOpenPrice()); |
| | | dappAKlineEntity.setLowestPrice(oldOne.getClosePrice()); |
| | | }else{ |
| | | dappAKlineEntity.setOpenPrice(coinAPrice); |
| | | dappAKlineEntity.setLowestPrice(coinAPrice); |