From fe501f577f47fbd3ec927620e3a7ef3476ba22b1 Mon Sep 17 00:00:00 2001 From: Helius <wangdoubleone@gmail.com> Date: Thu, 20 May 2021 18:13:54 +0800 Subject: [PATCH] odify --- src/main/java/com/xcong/excoin/modules/otc/service/impl/OtcOrderServiceImpl.java | 11 ++++++++--- 1 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/xcong/excoin/modules/otc/service/impl/OtcOrderServiceImpl.java b/src/main/java/com/xcong/excoin/modules/otc/service/impl/OtcOrderServiceImpl.java index 476d7f1..153f899 100644 --- a/src/main/java/com/xcong/excoin/modules/otc/service/impl/OtcOrderServiceImpl.java +++ b/src/main/java/com/xcong/excoin/modules/otc/service/impl/OtcOrderServiceImpl.java @@ -1,6 +1,8 @@ package com.xcong.excoin.modules.otc.service.impl; import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.date.DateUnit; +import cn.hutool.core.date.DateUtil; import cn.hutool.core.util.StrUtil; import cn.hutool.crypto.SecureUtil; import com.baomidou.mybatisplus.core.metadata.IPage; @@ -19,8 +21,8 @@ import com.xcong.excoin.modules.otc.dao.OtcEntrustOrderDao; import com.xcong.excoin.modules.otc.dao.OtcMarketBussinessDao; import com.xcong.excoin.modules.otc.dto.HasPayDto; -import com.xcong.excoin.modules.otc.dto.OrderAddDto; import com.xcong.excoin.modules.otc.dto.OrderListDto; +import com.xcong.excoin.modules.otc.dto.OtcOrderAddDto; import com.xcong.excoin.modules.otc.entity.OtcEntrustOrder; import com.xcong.excoin.modules.otc.entity.OtcMarketBussiness; import com.xcong.excoin.modules.otc.entity.OtcOrder; @@ -54,7 +56,7 @@ @Override @Transactional(rollbackFor = Exception.class) - public void buyOrder(OrderAddDto orderAddDto) { + public void buyOrder(OtcOrderAddDto orderAddDto) { MemberEntity member = LoginUserUtils.getAppLoginUser(); OtcEntrustOrder entrustOrder = otcEntrustOrderDao.selectById(orderAddDto.getId()); if (entrustOrder == null) { @@ -109,7 +111,7 @@ @Override @Transactional(rollbackFor = Exception.class) - public void saleOrder(OrderAddDto orderAddDto) { + public void saleOrder(OtcOrderAddDto orderAddDto) { MemberEntity member = LoginUserUtils.getAppLoginUser(); OtcEntrustOrder entrustOrder = otcEntrustOrderDao.selectById(orderAddDto.getId()); if (entrustOrder == null) { @@ -283,6 +285,9 @@ buyDetail.setOrderCnt(otcMb.getBuyCnt()); } + long between = DateUtil.between(buyOrder.getCreateTime(), new Date(), DateUnit.SECOND); + buyDetail.setTimes(between); + return Result.ok(buyDetail); } -- Gitblit v1.9.1