| | |
| | | package com.xcong.excoin.modules.otc.service.impl; |
| | | |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import cn.hutool.core.date.DateUtil; |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | |
| | | import com.xcong.excoin.common.entity.QueryRequest; |
| | | import com.xcong.excoin.modules.member.entity.MemberAccountMoneyChangeEntity; |
| | | import com.xcong.excoin.modules.member.entity.MemberEntity; |
| | | import com.xcong.excoin.modules.member.entity.MemberWalletCoinEntity; |
| | | import com.xcong.excoin.modules.member.mapper.MemberMapper; |
| | | import com.xcong.excoin.modules.member.mapper.MemberWalletCoinMapper; |
| | | import com.xcong.excoin.modules.otc.entity.OtcEntrustOrderEntity; |
| | | import com.xcong.excoin.modules.otc.entity.OtcMarketBussinessEntity; |
| | | import com.xcong.excoin.modules.otc.entity.OtcOrderAppealEntity; |
| | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | @RequiredArgsConstructor |
| | |
| | | private OtcEntrustOrderMapper otcEntrustOrderMapper; |
| | | @Resource |
| | | private OtcOrderMapper otcOrderMapper; |
| | | @Resource |
| | | private MemberWalletCoinMapper memberWalletCoinMapper; |
| | | @Resource |
| | | private MemberMapper memberMapper; |
| | | |
| | |
| | | otcAppealInfoVo.setFinishTime(finishTime); |
| | | } |
| | | //获取对应的商户信息 |
| | | long payMdId = otcOrderEntity.getPayMdId(); |
| | | long payMdId = otcOrderEntity.getPayMbId(); |
| | | OtcMarketBussinessEntity otcMarketBussinessEntity = otcMarketBussinessMapper.selectById(payMdId); |
| | | if(ObjectUtil.isNotEmpty(otcMarketBussinessEntity)){ |
| | | String nikename = otcMarketBussinessEntity.getNikename(); |
| | |
| | | return otcAppealInfoVo; |
| | | } |
| | | |
| | | @Override |
| | | public OtcOrderEntity otcOrderInfo(long id) { |
| | | OtcOrderEntity otcOrderEntity = otcOrderMapper.selectById(id); |
| | | return otcOrderEntity; |
| | | } |
| | | |
| | | @Override |
| | | @Transactional |
| | | public FebsResponse updateOrderInfo(OtcOrderEntity otcOrderEntity) { |
| | | Long id = otcOrderEntity.getId(); |
| | | OtcOrderEntity otcOrder = otcOrderMapper.selectById(id); |
| | | if(ObjectUtil.isEmpty(otcOrder)){ |
| | | return new FebsResponse().fail().message("连接超时,请刷新页面重试"); |
| | | } |
| | | Integer status = otcOrder.getStatus(); |
| | | if(OtcOrderEntity.STATUS_ONE != status){ |
| | | return new FebsResponse().fail().message("当前订单不是待付款状态"); |
| | | } |
| | | String payName = otcOrderEntity.getPayName(); |
| | | if(StrUtil.isEmpty(payName)){ |
| | | return new FebsResponse().fail().message("请输入付款人"); |
| | | } |
| | | BigDecimal coinAmount = otcOrderEntity.getCoinAmount(); |
| | | /** |
| | | * 获取订单信息--订单编号 |
| | | * 获取买单和买单 |
| | | * 更新payName字段 |
| | | * 更新订单状态 |
| | | */ |
| | | QueryWrapper<OtcOrderEntity> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("order_no",otcOrder.getOrderNo()); |
| | | List<OtcOrderEntity> list = otcOrderMapper.selectList(queryWrapper); |
| | | if(CollUtil.isNotEmpty(list)){ |
| | | for(OtcOrderEntity order : list){ |
| | | order.setStatus(OtcOrderEntity.STATUS_TWO); |
| | | order.setPayName(payName); |
| | | order.setPayTime(DateUtil.date()); |
| | | otcOrderMapper.updateById(order); |
| | | } |
| | | } |
| | | return new FebsResponse().success(); |
| | | } |
| | | |
| | | } |