Helius
2021-05-25 2049e6d4ebdf711ded2593808e7b16abaaf6586c
src/main/java/com/xcong/excoin/modules/otc/service/impl/OtcOrderServiceImpl.java
@@ -19,18 +19,12 @@
import com.xcong.excoin.modules.member.entity.MemberEntity;
import com.xcong.excoin.modules.member.entity.MemberPaymentMethodEntity;
import com.xcong.excoin.modules.member.entity.MemberWalletCoinEntity;
import com.xcong.excoin.modules.otc.dao.OtcEntrustOrderDao;
import com.xcong.excoin.modules.otc.dao.OtcMarketBussinessDao;
import com.xcong.excoin.modules.otc.dao.OtcOrderAppealDao;
import com.xcong.excoin.modules.otc.dao.*;
import com.xcong.excoin.modules.otc.dto.HasPayDto;
import com.xcong.excoin.modules.otc.dto.OrderApealDto;
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;
import com.xcong.excoin.modules.otc.dao.OtcOrderDao;
import com.xcong.excoin.modules.otc.entity.OtcOrderAppeal;
import com.xcong.excoin.modules.otc.entity.*;
import com.xcong.excoin.modules.otc.service.OtcOrderService;
import com.xcong.excoin.modules.otc.vo.BuyOrderDetailVo;
import com.xcong.excoin.modules.otc.vo.OrderListVo;
@@ -57,6 +51,7 @@
    private final MemberWalletCoinDao memberWalletCoinDao;
    private final MemberDao memberDao;
    private final MemberPaymentMethodDao memberPaymentMethodDao;
    private final OtcBlackListDao otcBlackListDao;
    @Override
@@ -312,9 +307,17 @@
        buyDetail.setCreateTime(buyOrder.getCreateTime());
        buyDetail.setIsMb(member.getIsTrader());
        buyDetail.setPayName(buyOrder.getPayName());
        buyDetail.setIsOwnEntrust(member.getId().equals(buyOrder.getEntrustOrderId()) ? 1 : 2);
        OtcOrder saleOrder = this.baseMapper.selectOrderByOrderNoAndType(otcOrder.getOrderNo(), OtcEntrustOrder.ORDER_TYPE_S);
        MemberEntity saleMember = memberDao.selectById(saleOrder.getMemberId());
        OtcBlackList otcBlackList = otcBlackListDao.selectByMemberIdAndBlackMemberId(member.getId(), buyOrder.getEntrustMemberId());
        if (otcBlackList != null) {
            buyDetail.setIsBlack(1);
        } else {
            buyDetail.setIsBlack(2);
        }
        buyDetail.setSaleName(saleMember.getName());
@@ -353,7 +356,6 @@
        }
        MemberEntity buyMember = memberDao.selectById(saleOrder.getOppositeMemberId());
        SaleOrderDetailVo saleDetail = new SaleOrderDetailVo();
        saleDetail.setOrderNo(saleOrder.getOrderNo());
        saleDetail.setUsdtAmount(saleOrder.getCoinAmount());
@@ -365,7 +367,14 @@
        saleDetail.setPayName(saleOrder.getPayName());
        saleDetail.setSaleName(buyMember.getName());
        saleDetail.setPayType(saleOrder.getPayType());
        saleDetail.setIsOwnEntrust(member.getId().equals(saleOrder.getEntrustOrderId()) ? 1 : 2);
        OtcBlackList otcBlackList = otcBlackListDao.selectByMemberIdAndBlackMemberId(member.getId(), saleOrder.getEntrustMemberId());
        if (otcBlackList != null) {
            saleDetail.setIsBlack(1);
        } else {
            saleDetail.setIsBlack(2);
        }
        if (!saleOrder.getMemberId().equals(saleOrder.getEntrustMemberId())) {
            OtcMarketBussiness otcMb = otcMarketBussinessDao.selectMarketBussinessByMemberId(saleOrder.getEntrustMemberId());
            saleDetail.setMbId(otcMb.getId());
@@ -416,15 +425,12 @@
        if(StrUtil.isEmpty(reason)){
            return Result.fail("请填写申诉原因");
        }
        String content = orderApealDto.getContent();
        if(StrUtil.isEmpty(content)){
            return Result.fail("请填写申诉内容");
        }
        List<String> content = orderApealDto.getContent();
        OtcOrderAppeal otcOrderAppeal = new OtcOrderAppeal();
        otcOrderAppeal.setMemberId(memberId);
        otcOrderAppeal.setOrderId(orderId);
        otcOrderAppeal.setReason(reason);
        otcOrderAppeal.setContent(content);
        otcOrderAppeal.setContent(content.toString());
        otcOrderAppeal.setStatus(OtcOrderAppeal.STATUS_ONE);
        otcOrderAppealDao.insert(otcOrderAppeal);
        return Result.ok("成功");