| | |
| | | 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; |
| | |
| | | import com.xcong.excoin.modules.member.entity.MemberAccountMoneyChangeEntity; |
| | | import com.xcong.excoin.modules.member.entity.MemberEntity; |
| | | import com.xcong.excoin.modules.member.mapper.MemberMapper; |
| | | 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 com.xcong.excoin.modules.otc.entity.OtcOrderEntity; |
| | | import com.xcong.excoin.modules.otc.mapper.OtcEntrustOrderMapper; |
| | | import com.xcong.excoin.modules.otc.mapper.OtcMarketBussinessMapper; |
| | | 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 |
| | |
| | | |
| | | @Resource |
| | | private OtcMarketBussinessMapper otcMarketBussinessMapper; |
| | | @Resource |
| | | private OtcOrderAppealMapper otcOrderAppealMapper; |
| | | @Resource |
| | | private OtcEntrustOrderMapper otcEntrustOrderMapper; |
| | | @Resource |
| | | private OtcOrderMapper otcOrderMapper; |
| | | @Resource |
| | | private MemberMapper memberMapper; |
| | | |
| | |
| | | return new FebsResponse().success(); |
| | | } |
| | | |
| | | @Override |
| | | public IPage<OtcOrderAppealEntity> otcAppealList(OtcOrderAppealEntity otcOrderAppealEntity, QueryRequest request) { |
| | | Page<OtcOrderAppealEntity> page = new Page<>(request.getPageNum(), request.getPageSize()); |
| | | IPage<OtcOrderAppealEntity> otcOrderAppealEntitys = otcOrderAppealMapper.otcAppealList(page, otcOrderAppealEntity); |
| | | return otcOrderAppealEntitys; |
| | | } |
| | | |
| | | @Override |
| | | @Transactional |
| | | public FebsResponse dealDone(Long id) { |
| | | OtcOrderAppealEntity otcOrderAppealEntity = otcOrderAppealMapper.selectById(id); |
| | | Integer status = otcOrderAppealEntity.getStatus(); |
| | | if(OtcOrderAppealEntity.STATUS_TWO != status){ |
| | | return new FebsResponse().fail().message("当前状态不是处理中"); |
| | | } |
| | | |
| | | otcOrderAppealEntity.setStatus(OtcOrderAppealEntity.STATUS_THREE); |
| | | otcOrderAppealMapper.updateById(otcOrderAppealEntity); |
| | | return new FebsResponse().success(); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional |
| | | public FebsResponse dealIng(Long id) { |
| | | OtcOrderAppealEntity otcOrderAppealEntity = otcOrderAppealMapper.selectById(id); |
| | | Integer status = otcOrderAppealEntity.getStatus(); |
| | | if(OtcOrderAppealEntity.STATUS_ONE != status){ |
| | | return new FebsResponse().fail().message("当前状态不是待处理"); |
| | | } |
| | | |
| | | otcOrderAppealEntity.setStatus(OtcOrderAppealEntity.STATUS_TWO); |
| | | otcOrderAppealMapper.updateById(otcOrderAppealEntity); |
| | | return new FebsResponse().success(); |
| | | } |
| | | |
| | | @Override |
| | | public IPage<OtcEntrustOrderEntity> otcEntrustList(OtcEntrustOrderEntity otcEntrustOrderEntity, QueryRequest request) { |
| | | Page<OtcEntrustOrderEntity> page = new Page<>(request.getPageNum(), request.getPageSize()); |
| | | IPage<OtcEntrustOrderEntity> otcEntrustOrderEntitys = otcEntrustOrderMapper.otcEntrustList(page, otcEntrustOrderEntity); |
| | | return otcEntrustOrderEntitys; |
| | | } |
| | | |
| | | @Override |
| | | public IPage<OtcOrderEntity> otcOrderList(OtcOrderEntity otcOrderEntity, QueryRequest request) { |
| | | Page<OtcOrderEntity> page = new Page<>(request.getPageNum(), request.getPageSize()); |
| | | IPage<OtcOrderEntity> otcOrderEntitys = otcOrderMapper.otcOrderList(page, otcOrderEntity); |
| | | 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; |
| | | } |
| | | |
| | | } |