Commit 92a4eb60 by sdif

用户端代码提交

parent d24f12b8
...@@ -55,8 +55,6 @@ public class AppletTotalOrderController extends BaseController { ...@@ -55,8 +55,6 @@ public class AppletTotalOrderController extends BaseController {
private final ITotalOrderService iTotalOrderService; private final ITotalOrderService iTotalOrderService;
private final IPaymentRecordService iPaymentRecordService;
private final IPayService iPayService; private final IPayService iPayService;
/** /**
......
...@@ -2,6 +2,7 @@ package com.pz.system.datastructure; ...@@ -2,6 +2,7 @@ package com.pz.system.datastructure;
import com.pz.system.domain.TotalOrder; import com.pz.system.domain.TotalOrder;
import com.pz.system.domain.bo.TotalOrderBo; import com.pz.system.domain.bo.TotalOrderBo;
import com.pz.system.mapper.TotalOrderMapper;
import com.pz.system.service.ITotalOrderService; import com.pz.system.service.ITotalOrderService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled; import org.springframework.scheduling.annotation.Scheduled;
...@@ -13,8 +14,8 @@ import java.util.concurrent.DelayQueue; ...@@ -13,8 +14,8 @@ import java.util.concurrent.DelayQueue;
public class OrderDelayQueue { public class OrderDelayQueue {
private DelayQueue<TotalOrder> delayQueue = new DelayQueue<>(); private DelayQueue<TotalOrder> delayQueue = new DelayQueue<>();
@Autowired /*@Autowired
private ITotalOrderService iTotalOrderService; private TotalOrderMapper iTotalOrderService;*/
// 添加订单到延时队列 // 添加订单到延时队列
public void addOrder(TotalOrder order) { public void addOrder(TotalOrder order) {
...@@ -43,6 +44,6 @@ public class OrderDelayQueue { ...@@ -43,6 +44,6 @@ public class OrderDelayQueue {
totalOrderBo.setId(order.getId()); totalOrderBo.setId(order.getId());
// 执行取消订单的相关操作 // 执行取消订单的相关操作
iTotalOrderService.cancelOrder(totalOrderBo); //iTotalOrderService.cancelOrder(totalOrderBo);
} }
} }
...@@ -92,8 +92,7 @@ public class TotalOrderServiceImpl implements ITotalOrderService { ...@@ -92,8 +92,7 @@ public class TotalOrderServiceImpl implements ITotalOrderService {
private final PaymentRecordMapper paymentRecordMapper; private final PaymentRecordMapper paymentRecordMapper;
@Autowired private final OrderDelayQueue delayQueue;
private OrderDelayQueue delayQueue;
@Override @Override
public TotalOrderVo queryById(Long id) { public TotalOrderVo queryById(Long id) {
...@@ -420,7 +419,7 @@ public class TotalOrderServiceImpl implements ITotalOrderService { ...@@ -420,7 +419,7 @@ public class TotalOrderServiceImpl implements ITotalOrderService {
public Boolean finishOrder(TotalOrderBo bo) { public Boolean finishOrder(TotalOrderBo bo) {
TotalOrder totalOrder = BeanUtil.toBean(bo, TotalOrder.class); TotalOrder totalOrder = BeanUtil.toBean(bo, TotalOrder.class);
totalOrder.setStatus(2); totalOrder.setStatus(TotalOrderStatus.DONE.getCode());
return baseMapper.updateById(totalOrder) > 1; return baseMapper.updateById(totalOrder) > 1;
} }
...@@ -460,7 +459,7 @@ public class TotalOrderServiceImpl implements ITotalOrderService { ...@@ -460,7 +459,7 @@ public class TotalOrderServiceImpl implements ITotalOrderService {
baseMapper.updateById(totalOrder); baseMapper.updateById(totalOrder);
//添加支付记录 //添加支付记录
PaymentRecord paymentRecord = new PaymentRecord(); PaymentRecord paymentRecord = new PaymentRecord();
paymentRecord.setPayType(1); paymentRecord.setPayType(0);
paymentRecord.setOrderId(totalOrder.getId().intValue()); paymentRecord.setOrderId(totalOrder.getId().intValue());
paymentRecord.setMoney(totalOrder.getPayMoney()); paymentRecord.setMoney(totalOrder.getPayMoney());
paymentRecord.setUid(totalOrder.getUid()); paymentRecord.setUid(totalOrder.getUid());
...@@ -480,6 +479,13 @@ public class TotalOrderServiceImpl implements ITotalOrderService { ...@@ -480,6 +479,13 @@ public class TotalOrderServiceImpl implements ITotalOrderService {
totalOrder.setStatus(TotalOrderStatus.REFUND.getCode()); totalOrder.setStatus(TotalOrderStatus.REFUND.getCode());
if(baseMapper.updateById(totalOrder) > 0){ if(baseMapper.updateById(totalOrder) > 0){
//添加退款记录
PaymentRecord paymentRecord = new PaymentRecord();
paymentRecord.setPayType(1);
paymentRecord.setOrderId(totalOrder.getId().intValue());
paymentRecord.setMoney(totalOrder.getRefundAmount());
paymentRecord.setUid(totalOrder.getUid());
paymentRecordMapper.insert(paymentRecord);
return true; return true;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment