Helius
2021-01-18 fc46f2a7c6680df278f4c68c5e91a0ce544a2de4
zq-erp/src/main/java/com/matrix/system/shopXcx/mqTask/OrderTask.java
@@ -8,10 +8,7 @@
import com.matrix.system.common.constance.AppConstance;
import com.matrix.system.common.dao.BusParameterSettingsDao;
import com.matrix.system.constance.Dictionary;
import com.matrix.system.hive.bean.ShoppingGoods;
import com.matrix.system.hive.bean.SysOrder;
import com.matrix.system.hive.bean.SysOrderItem;
import com.matrix.system.hive.bean.SysVipInfo;
import com.matrix.system.hive.bean.*;
import com.matrix.system.hive.dao.SysOrderDao;
import com.matrix.system.hive.dao.SysOrderItemDao;
import com.matrix.system.hive.dao.SysVipInfoDao;
@@ -30,6 +27,7 @@
import org.springframework.transaction.annotation.Transactional;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@@ -88,6 +86,7 @@
        }
        //获取订单归属门店
        order.setCompanyId(bizUser.getCompanyId());
        order.setShopId(Long.parseLong(orderDto.getStoreId()+""));
        //同步的订单订单编号保持一致
        order.setOrderNo(orderDto.getOrderNo());
@@ -133,11 +132,6 @@
            orderItem.setPrice(orderItemDto.getPrice().doubleValue());
            orderItem.setZkPrice(orderItemDto.getPrice().doubleValue());
            orderItem.setGoodsId(shoppingGoods.getId());
            if (shoppingGoods.getGoodType().equals(Dictionary.SHOPPING_GOODS_TYPE_JJCP)) {
                orderItem.setAssembleId(shoppingGoods.getAssembleGoods().get(0).getId());
            } else if (shoppingGoods.getGoodType().equals(Dictionary.SHOPPING_GOODS_TYPE_XM)) {
                orderItem.setAssembleId(shoppingGoods.getAssembleProj().get(0).getId());
            }
            // 设置对应产品的id
            switch (shoppingGoods.getGoodType()) {
@@ -193,6 +187,15 @@
        // 设置销量
        orderService.setShopSelCount(sourceOrder);
        SysOrderFlow flow = new SysOrderFlow();
        flow.setAmount(orderDto.getOrderMoney());
        flow.setPayMethod("微信");
        List<SysOrderFlow> flows = new ArrayList<>();
        flows.add(flow);
        sourceOrder.setFlows(flows);
        orderService.updateAfterMoney(sourceOrder);
    }