|
@@ -53,6 +53,7 @@ import com.fs.live.param.FsUserLiveOrderPayUParam;
|
|
|
import com.fs.live.param.LiveOrderConfirmParam;
|
|
import com.fs.live.param.LiveOrderConfirmParam;
|
|
|
import com.fs.live.param.LiveOrderFinishParam;
|
|
import com.fs.live.param.LiveOrderFinishParam;
|
|
|
import com.fs.live.service.ILiveOrderLogsService;
|
|
import com.fs.live.service.ILiveOrderLogsService;
|
|
|
|
|
+import com.fs.live.service.ILiveUserFirstEntryService;
|
|
|
import com.fs.live.vo.LiveGoodsVo;
|
|
import com.fs.live.vo.LiveGoodsVo;
|
|
|
import com.fs.live.vo.LiveOrderItemVo;
|
|
import com.fs.live.vo.LiveOrderItemVo;
|
|
|
import com.fs.live.vo.LiveOrderListVo;
|
|
import com.fs.live.vo.LiveOrderListVo;
|
|
@@ -207,6 +208,10 @@ public class LiveOrderServiceImpl implements ILiveOrderService {
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private LiveOrderMapper liveOrderMapper;
|
|
private LiveOrderMapper liveOrderMapper;
|
|
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private ILiveUserFirstEntryService liveUserFirstEntryService;
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
public LiveOrderServiceImpl(RedisCache redisCache) {
|
|
public LiveOrderServiceImpl(RedisCache redisCache) {
|
|
|
this.redisCache = redisCache;
|
|
this.redisCache = redisCache;
|
|
|
}
|
|
}
|
|
@@ -527,6 +532,18 @@ public class LiveOrderServiceImpl implements ILiveOrderService {
|
|
|
return "";
|
|
return "";
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ // 佣金处理
|
|
|
|
|
+ if (order.getCompanyUserId() == -1L) {
|
|
|
|
|
+ companyService.addCompanyTuiLiveMoney(order);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ // 目前是一级佣金
|
|
|
|
|
+ FsStoreProduct product = JSONUtil.toBean(order.getItemJson(), FsStoreProduct.class);
|
|
|
|
|
+ List<FsStoreProductAttrValue> productAttrValues = fsStoreProductAttrValueMapper.selectFsStoreProductAttrValueByProductId(product.getProductId());
|
|
|
|
|
+ if (productAttrValues != null && !productAttrValues.isEmpty()) {
|
|
|
|
|
+ userService.addTuiLiveMoney(order, productAttrValues);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
//增加用户购买次数
|
|
//增加用户购买次数
|
|
|
userService.incPayCount(Long.valueOf(order.getUserId()));
|
|
userService.incPayCount(Long.valueOf(order.getUserId()));
|
|
|
|
|
|
|
@@ -549,6 +566,7 @@ public class LiveOrderServiceImpl implements ILiveOrderService {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
|
|
+ @Transactional(rollbackFor = Throwable.class,propagation = Propagation.REQUIRED)
|
|
|
public R wxPayment(FsUserLiveOrderPayUParam param) {
|
|
public R wxPayment(FsUserLiveOrderPayUParam param) {
|
|
|
LiveOrder order = baseMapper.selectLiveOrderByOrderId(String.valueOf(param.getOrderId()));
|
|
LiveOrder order = baseMapper.selectLiveOrderByOrderId(String.valueOf(param.getOrderId()));
|
|
|
if (order == null) {
|
|
if (order == null) {
|
|
@@ -839,7 +857,7 @@ public class LiveOrderServiceImpl implements ILiveOrderService {
|
|
|
payProcessContext.setPaymentId(payment.getPaymentId());
|
|
payProcessContext.setPaymentId(payment.getPaymentId());
|
|
|
payProcessContext.setPayCode(payment.getPayCode());
|
|
payProcessContext.setPayCode(payment.getPayCode());
|
|
|
payProcessContext.setUserId(Long.valueOf(order.getUserId()));
|
|
payProcessContext.setUserId(Long.valueOf(order.getUserId()));
|
|
|
- payProcessContext.setOrderPrefix("refund-");
|
|
|
|
|
|
|
+ payProcessContext.setOrderPrefix("refundLive-");
|
|
|
best.refundLiveOrder(payProcessContext);
|
|
best.refundLiveOrder(payProcessContext);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -1577,6 +1595,11 @@ public class LiveOrderServiceImpl implements ILiveOrderService {
|
|
|
liveOrder.setStoreHouseCode("CQDS001");
|
|
liveOrder.setStoreHouseCode("CQDS001");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ LiveUserFirstEntry liveUserFirstEntry = liveUserFirstEntryService.selectEntityByLiveIdUserId(liveOrder.getLiveId(), Long.parseLong(liveOrder.getUserId()));
|
|
|
|
|
+ liveOrder.setCompanyId(liveUserFirstEntry.getCompanyId());
|
|
|
|
|
+ liveOrder.setCompanyUserId(liveUserFirstEntry.getCompanyUserId());
|
|
|
|
|
+ liveOrder.setTuiUserId(liveUserFirstEntry.getCompanyUserId());
|
|
|
|
|
+
|
|
|
String orderSn = SnowflakeUtils.nextId();
|
|
String orderSn = SnowflakeUtils.nextId();
|
|
|
log.info("订单生成:"+orderSn);
|
|
log.info("订单生成:"+orderSn);
|
|
|
liveOrder.setOrderCode(orderSn);
|
|
liveOrder.setOrderCode(orderSn);
|