| | |
| | | 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; |
| | |
| | | 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; |
| | |
| | | |
| | | @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) { |
| | |
| | | |
| | | @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) { |
| | |
| | | buyDetail.setOrderCnt(otcMb.getBuyCnt()); |
| | | } |
| | | |
| | | long between = DateUtil.between(buyOrder.getCreateTime(), new Date(), DateUnit.SECOND); |
| | | buyDetail.setTimes(between); |
| | | |
| | | return Result.ok(buyDetail); |
| | | } |
| | | |