|
@@ -18,7 +18,9 @@ import com.ym.mec.biz.dal.entity.*;
|
|
|
import com.ym.mec.biz.dal.mapper.GoodsSubMapper;
|
|
|
import com.ym.mec.biz.service.*;
|
|
|
import com.ym.mec.common.dto.OrderCreate;
|
|
|
+import com.ym.mec.common.exception.BizException;
|
|
|
import com.ym.mec.common.page.WrapperUtil;
|
|
|
+import com.ym.mec.mall.MallFeignService;
|
|
|
import org.apache.commons.collections.CollectionUtils;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -70,6 +72,8 @@ public class SellOrderServiceImpl extends BaseServiceImpl<Integer, SellOrder> im
|
|
|
private StudentPaymentOrderDetailService studentPaymentOrderDetailService;
|
|
|
@Autowired
|
|
|
private GoodsSubService goodsSubService;
|
|
|
+ @Autowired
|
|
|
+ private MallFeignService mallFeignService;
|
|
|
|
|
|
@Override
|
|
|
public BaseDAO<Integer, SellOrder> getDAO() {
|
|
@@ -544,6 +548,33 @@ public class SellOrderServiceImpl extends BaseServiceImpl<Integer, SellOrder> im
|
|
|
return orderItems;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public void syncSellOrder2Mall(List<SellOrder> sellOrders, StudentPaymentOrder studentPaymentOrder) {
|
|
|
+ List<OrderCreate.OrderItem> orderItems = this.convertMallOrder(sellOrders);
|
|
|
+ OrderCreate mallOrder = new OrderCreate();
|
|
|
+ mallOrder.setOrderItemList(orderItems);
|
|
|
+ mallOrder.setOrchestraId(studentPaymentOrder.getMusicGroupId());
|
|
|
+ mallOrder.setStatus(2);
|
|
|
+ mallOrder.setOrderNo(studentPaymentOrder.getOrderNo());
|
|
|
+ mallOrder.setTotalAmount(studentPaymentOrder.getExpectAmount());
|
|
|
+ String paymentBusinessChannel = studentPaymentOrder.getPaymentBusinessChannel();
|
|
|
+ if (StringUtils.endsWithIgnoreCase(paymentBusinessChannel, "wx_pub") ||
|
|
|
+ StringUtils.endsWithIgnoreCase(paymentBusinessChannel, "WECHAT") ||
|
|
|
+ StringUtils.endsWithIgnoreCase(paymentBusinessChannel, "WXPay")) {
|
|
|
+ mallOrder.setPayType(2);
|
|
|
+ } else {
|
|
|
+ mallOrder.setPayType(1);
|
|
|
+ }
|
|
|
+ mallOrder.setMemberId(studentPaymentOrder.getUserId().longValue());
|
|
|
+ mallOrder.setPlatformType("STUDENT");
|
|
|
+ mallOrder.setSourceType(1);
|
|
|
+
|
|
|
+ boolean b = mallFeignService.productOrderCreate(mallOrder);
|
|
|
+ if (!b) {
|
|
|
+ throw new BizException("同步商城订单失败");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
public Map<String, BigDecimal> calcSellAmount(StudentPaymentOrder order,BigDecimal cloudBalanceIncome,BigDecimal cloudIncome) {
|
|
|
List<StudentPaymentOrderDetail> orderDetails = studentPaymentOrderDetailDao.getOrderDetail(order.getId());
|
|
|
//总余额支付
|