|
@@ -2,7 +2,6 @@ package com.yonge.cooleshow.biz.dal.service.impl;
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
-import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.yonge.cooleshow.biz.dal.enums.*;
|
|
@@ -39,7 +38,6 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import com.yonge.cooleshow.biz.dal.dto.search.OrderSearch;
|
|
|
import com.yonge.cooleshow.biz.dal.dao.UserOrderDao;
|
|
|
-import org.springframework.transaction.annotation.Propagation;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
import javax.annotation.PostConstruct;
|
|
@@ -54,8 +52,7 @@ import java.util.function.Function;
|
|
|
@Service
|
|
|
public class UserOrderServiceImpl extends ServiceImpl<UserOrderDao, UserOrder> implements UserOrderService {
|
|
|
private final static Logger log = LoggerFactory.getLogger(UserOrderServiceImpl.class);
|
|
|
- @Autowired
|
|
|
- private UserOrderService self;
|
|
|
+
|
|
|
@Autowired
|
|
|
private MemberPriceSettingsService memberPriceSettingsService;
|
|
|
@Autowired
|
|
@@ -110,6 +107,7 @@ public class UserOrderServiceImpl extends ServiceImpl<UserOrderDao, UserOrder> i
|
|
|
|
|
|
/**********订单生成后******************/
|
|
|
|
|
|
+
|
|
|
//曲目购买
|
|
|
orderAfter.put(GoodTypeEnum.MUSIC, musicSheetService::orderAfterSheet);
|
|
|
|
|
@@ -310,7 +308,7 @@ public class UserOrderServiceImpl extends ServiceImpl<UserOrderDao, UserOrder> i
|
|
|
|
|
|
//判断订单是否是无需支付的订单,若是,则直接完成订单
|
|
|
if (BigDecimal.ZERO.compareTo(orderVo.getActualPrice()) == 0) {
|
|
|
- orderSuccess(orderVo,null);
|
|
|
+ orderSuccess(orderVo);
|
|
|
}
|
|
|
return HttpResponseResult.succeed(orderVo);
|
|
|
}
|
|
@@ -378,7 +376,7 @@ public class UserOrderServiceImpl extends ServiceImpl<UserOrderDao, UserOrder> i
|
|
|
closeOrSuccessOrder(orderNo);
|
|
|
}
|
|
|
|
|
|
- public void closeOrSuccessOrder(String orderNo) {
|
|
|
+ private void closeOrSuccessOrder(String orderNo) {
|
|
|
UserOrderVo detail = detail(orderNo, null);
|
|
|
if (null == detail) {
|
|
|
return;
|
|
@@ -446,7 +444,7 @@ public class UserOrderServiceImpl extends ServiceImpl<UserOrderDao, UserOrder> i
|
|
|
* @param orderNo
|
|
|
* @return 可以继续支付 true
|
|
|
*/
|
|
|
- public Boolean checkAndSuccessOrder(String orderNo) {
|
|
|
+ private Boolean checkAndSuccessOrder(String orderNo) {
|
|
|
UserOrderVo detail = detail(orderNo, null);
|
|
|
if (null == detail) {
|
|
|
return true;
|
|
@@ -493,7 +491,7 @@ public class UserOrderServiceImpl extends ServiceImpl<UserOrderDao, UserOrder> i
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
- public HttpResponseResult<OrderPayRes> doOrderPay(OrderPayReq payReq, UserOrderVo detail) throws Exception {
|
|
|
+ private HttpResponseResult<OrderPayRes> doOrderPay(OrderPayReq payReq, UserOrderVo detail) throws Exception {
|
|
|
Boolean aBoolean = checkAndSuccessOrder(payReq.getOrderNo());
|
|
|
if (aBoolean) {
|
|
|
return orderPaymentService.createOrderPayment(payReq, detail);
|
|
@@ -510,8 +508,7 @@ public class UserOrderServiceImpl extends ServiceImpl<UserOrderDao, UserOrder> i
|
|
|
* @updateTime 2022/3/31 16:15
|
|
|
* @return: com.yonge.cooleshow.biz.dal.entity.Order
|
|
|
*/
|
|
|
- @Transactional(rollbackFor = Exception.class)
|
|
|
- public UserOrderVo insertOrder(OrderReq orderReq) {
|
|
|
+ private UserOrderVo insertOrder(OrderReq orderReq) {
|
|
|
UserOrder userOrder = new UserOrder();
|
|
|
|
|
|
userOrder.setOrderNo(orderReq.getOrderNo());
|
|
@@ -613,7 +610,7 @@ public class UserOrderServiceImpl extends ServiceImpl<UserOrderDao, UserOrder> i
|
|
|
* @updateTime 2022/3/31 16:49
|
|
|
* @return: java.math.BigDecimal
|
|
|
*/
|
|
|
- public BigDecimal getServiceFeeRate(GoodTypeEnum goodTypeEnum) {
|
|
|
+ private BigDecimal getServiceFeeRate(GoodTypeEnum goodTypeEnum) {
|
|
|
String configValue = "0";
|
|
|
if (GoodTypeEnum.VIDEO.equals(goodTypeEnum)) {
|
|
|
configValue = sysConfigService.findConfigValue(SysConfigConstant.VIDEO_LESSON_SERVICE_FEE);
|
|
@@ -634,7 +631,7 @@ public class UserOrderServiceImpl extends ServiceImpl<UserOrderDao, UserOrder> i
|
|
|
* @updateTime 2022/3/31 16:49
|
|
|
* @return: java.math.BigDecimal
|
|
|
*/
|
|
|
- public String getGoodUrlByType(GoodTypeEnum goodTypeEnum) {
|
|
|
+ private String getGoodUrlByType(GoodTypeEnum goodTypeEnum) {
|
|
|
String configValue = "";
|
|
|
if (GoodTypeEnum.VIP.equals(goodTypeEnum)) {
|
|
|
configValue = sysConfigService.findConfigValue(SysConfigConstant.GOOD_LOGO_VIP);
|
|
@@ -652,7 +649,7 @@ public class UserOrderServiceImpl extends ServiceImpl<UserOrderDao, UserOrder> i
|
|
|
return configValue;
|
|
|
}
|
|
|
|
|
|
- public Boolean checkPositiveOrZero(BigDecimal amount) {
|
|
|
+ private Boolean checkPositiveOrZero(BigDecimal amount) {
|
|
|
if (null == amount) {
|
|
|
return false;
|
|
|
}
|
|
@@ -680,6 +677,7 @@ public class UserOrderServiceImpl extends ServiceImpl<UserOrderDao, UserOrder> i
|
|
|
&& !OrderStatusEnum.FAIL.equals(orderStatus)) {
|
|
|
return;
|
|
|
}
|
|
|
+
|
|
|
List<UserOrderDetailVo> orderDetailList = orderDetailService.getOrderDetilListByOrderNo(userOrder.getOrderNo());
|
|
|
for (UserOrderDetailVo orderDetailVo : orderDetailList) {
|
|
|
orderDetailVo.setUserId(userOrder.getUserId());
|
|
@@ -696,7 +694,7 @@ public class UserOrderServiceImpl extends ServiceImpl<UserOrderDao, UserOrder> i
|
|
|
baseMapper.updateById(userOrder);
|
|
|
}
|
|
|
|
|
|
- public void orderSuccess(UserOrderVo detail) {
|
|
|
+ private void orderSuccess(UserOrderVo detail) {
|
|
|
orderSuccess(detail, null);
|
|
|
}
|
|
|
|
|
@@ -751,14 +749,9 @@ public class UserOrderServiceImpl extends ServiceImpl<UserOrderDao, UserOrder> i
|
|
|
log.error("订单完成-更新付款单失败, UserOrderVo is {},PaymentCallBack is {}", JSONObject.toJSONString(detail), JSONObject.toJSONString(data));
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
-
|
|
|
- /*List<UserOrderDetailVo> orderDetailList = detail.getOrderDetailList();
|
|
|
- if(CollectionUtils.isEmpty(orderDetailList)){
|
|
|
- orderDetailList = orderDetailService.getOrderDetilListByOrderNo(detail.getOrderNo());
|
|
|
- }*/
|
|
|
+ //调用业务
|
|
|
List<UserOrderDetailVo> orderDetailList = orderDetailService.getOrderDetilListByOrderNo(detail.getOrderNo());
|
|
|
|
|
|
- //调用业务
|
|
|
for (UserOrderDetailVo orderDetailVo : orderDetailList) {
|
|
|
orderDetailVo.setUserId(detail.getUserId());
|
|
|
orderDetailVo.setOrderId(detail.getId());
|
|
@@ -781,7 +774,7 @@ public class UserOrderServiceImpl extends ServiceImpl<UserOrderDao, UserOrder> i
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public void testOrderSuccess(UserOrderVo detail) {
|
|
|
+ private void testOrderSuccess(UserOrderVo detail) {
|
|
|
if (null == detail || StringUtil.isEmpty(detail.getOrderNo())) {
|
|
|
return;
|
|
|
}
|