| | |
| | | import com.matrix.system.score.entity.ScoreVipDetail; |
| | | import com.matrix.system.score.service.ScoreVipDetailService; |
| | | import com.matrix.system.shopXcx.bean.ShopOrder; |
| | | import com.matrix.system.shopXcx.bean.ShopOrderDetails; |
| | | import com.matrix.system.shopXcx.dao.ShopOrderDao; |
| | | import com.matrix.system.shopXcx.dao.ShopOrderDetailsDao; |
| | | import com.rabbitmq.client.DeliverCallback; |
| | |
| | | LogUtil.debug("收到分销订单退款任务orderId={}", orderId); |
| | | QueryWrapper queryWrapper=new QueryWrapper(); |
| | | queryWrapper.eq("order_id",orderId); |
| | | ShopSalesmanOrder shopSalesmanOrder = shopSalesmanOrderDao.selectOne(queryWrapper); |
| | | if(shopSalesmanOrder!=null){ |
| | | shopSalesmanOrder.setOrderStatus(ShopSalesmanOrder.STATUS_YTK); |
| | | shopSalesmanOrderDao.updateById(shopSalesmanOrder); |
| | | }else{ |
| | | LogUtil.debug("改订单为生成分销订单={}", orderId); |
| | | } |
| | | List<ShopSalesmanOrder> list = shopSalesmanOrderDao.selectList(queryWrapper); |
| | | |
| | | list.forEach(shopSalesmanOrder->{ |
| | | |
| | | if(shopSalesmanOrder!=null){ |
| | | shopSalesmanOrder.setOrderStatus(ShopSalesmanOrder.STATUS_YTK); |
| | | shopSalesmanOrderDao.updateById(shopSalesmanOrder); |
| | | }else{ |
| | | LogUtil.debug("改订单为生成分销订单={}", orderId); |
| | | } |
| | | |
| | | |
| | | }); |
| | | ShopOrder order=shopOrderDao.selectById(Integer.parseInt(orderId)); |
| | | |
| | | //如果是积分支付则需要返还积分 |
| | | if(order.getScorePay()!=null && order.getScorePay()>0){ |
| | | LogUtil.debug("处理积分退款={}", orderId); |
| | | scoreVipDetailService.refundScore(order.getUserId(),null,order.getScorePay(),Long.parseLong(order.getId()+""), ScoreVipDetail.SCORE_VIP_TYPE_CASH); |
| | | scoreVipDetailService.refundScore(order.getUserId(),order.getScorePay(),Long.parseLong(order.getId()+""), ScoreVipDetail.SCORE_VIP_TYPE_CASH); |
| | | } |
| | | |
| | | //消费获得积分返还,如果本订单获得了积分则要扣除获得积分 |
| | | scoreVipDetailService.removeByBusinessId(order.getUserId(),null,Long.parseLong(order.getId()+""), ScoreVipDetail.SCORE_VIP_TYPE_CASH){ |
| | | |
| | | } |
| | | scoreVipDetailService.removeByBusinessId(order.getUserId(),Long.parseLong(order.getId()+"")); |
| | | |
| | | |
| | | } |