xiaoyong931011
2021-05-18 546103af40acfb6e8a5371902324d01785e61dee
src/main/java/com/xcong/excoin/modules/otc/service/impl/OtcServiceImpl.java
@@ -1,5 +1,6 @@
package com.xcong.excoin.modules.otc.service.impl;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -17,11 +18,14 @@
import com.xcong.excoin.modules.otc.mapper.OtcOrderAppealMapper;
import com.xcong.excoin.modules.otc.mapper.OtcOrderMapper;
import com.xcong.excoin.modules.otc.service.OtcService;
import com.xcong.excoin.modules.otc.vo.OtcAppealInfoVo;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.Date;
@Service
@RequiredArgsConstructor
@@ -130,4 +134,45 @@
        return otcOrderEntitys;
    }
    @Override
    public OtcAppealInfoVo otcAppealInfo(long id) {
        OtcAppealInfoVo otcAppealInfoVo = new OtcAppealInfoVo();
        OtcOrderAppealEntity otcOrderAppealEntity = otcOrderAppealMapper.selectById(id);
        otcAppealInfoVo.setId(id);
        if(ObjectUtil.isNotEmpty(otcOrderAppealEntity)){
            String reason = otcOrderAppealEntity.getReason();
            otcAppealInfoVo.setReason(reason);
            String content = otcOrderAppealEntity.getContent();
            otcAppealInfoVo.setContent(content);
        }
        //获取对应的订单详情
        long orderId = otcOrderAppealEntity.getOrderId();
        OtcOrderEntity otcOrderEntity = otcOrderMapper.selectById(orderId);
        if(ObjectUtil.isNotEmpty(otcOrderEntity)){
            String orderNo = otcOrderEntity.getOrderNo();
            otcAppealInfoVo.setOrderNo(orderNo);
            BigDecimal unitPrice = otcOrderEntity.getUnitPrice();
            otcAppealInfoVo.setUnitPrice(unitPrice);
            BigDecimal coinAmount = otcOrderEntity.getCoinAmount();
            otcAppealInfoVo.setCoinAmount(coinAmount);
            BigDecimal totalAmount = otcOrderEntity.getTotalAmount();
            otcAppealInfoVo.setTotalAmount(totalAmount);
            Integer status = otcOrderEntity.getStatus();
            otcAppealInfoVo.setStatus(status);
            Date payTime = otcOrderEntity.getPayTime();
            otcAppealInfoVo.setPayTime(payTime);
            Date finishTime = otcOrderEntity.getFinishTime();
            otcAppealInfoVo.setFinishTime(finishTime);
        }
        //获取对应的商户信息
        long payMdId = otcOrderEntity.getPayMdId();
        OtcMarketBussinessEntity otcMarketBussinessEntity = otcMarketBussinessMapper.selectById(payMdId);
        if(ObjectUtil.isNotEmpty(otcMarketBussinessEntity)){
            String nikename = otcMarketBussinessEntity.getNikename();
            otcAppealInfoVo.setNikename(nikename);
        }
        return otcAppealInfoVo;
    }
}