jyy
2021-04-13 9a1e5d285c9e67b97c1f79bb393404a50ae6aa72
zq-erp/src/main/java/com/matrix/system/shopXcx/action/ShopOrderAction.java
@@ -16,7 +16,6 @@
import com.matrix.core.tools.excl.ExcelVersion;
import com.matrix.system.common.bean.SysUsers;
import com.matrix.system.common.constance.AppConstance;
import com.matrix.system.constance.Dictionary;
import com.matrix.system.hive.action.BaseController;
import com.matrix.system.hive.action.util.QueryUtil;
import com.matrix.system.hive.bean.SysShopInfo;
@@ -108,8 +107,8 @@
        ExcelSheetPO orderSheet = new ExcelSheetPO();
        orderSheet.setSheetName("订单列表");
        orderSheet.setTitle("订单列表");
        String[] header = new String[]{"订单编号", "客户姓名", "客户电话", "收货地址", "下单时间", "订单金额",
                "优惠总金额", "优惠说明", "订单状态", "配送方式", "门店名称", "商品名称", "规格", "生产企业", "单价", "购买数量"};
        String[] header = new String[]{"订单编号", "客户姓名", "客户电话", "收货地址", "店铺名称","订单状态","下单时间",  "购买商品","订单金额",
                "优惠总金额",  "配送方式"};
        orderSheet.setHeaders(header);
        List<List<Object>> body = new ArrayList<>();
        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy年MM月dd日 HH:mm:ss");
@@ -133,42 +132,26 @@
                } else {
                    bodyItem.add("");
                }
                //下单时间
                bodyItem.add(dateFormat.format(shopOrder.getOrderTime()));
                //购买数量
//            bodyItem.add(shopOrder.getPurchaseQuantity());
                //订单金额
                bodyItem.add(shopOrder.getOrderMoney());
                //优惠总金额
                bodyItem.add(shopOrder.getDiscountAmount());
                //优惠说明
                bodyItem.add(shopOrder.getDiscountExplain());
                //店铺名称
                bodyItem.add(shopOrder.getStoreName());
                //订单状态
                bodyItem.add(OrderStatusEnum.getNameByCode(shopOrder.getOrderStatus()));
                //配送方式 门店
                bodyItem.add("物流");
                bodyItem.add("");
                //商品名称
                //下单时间
                bodyItem.add(dateFormat.format(shopOrder.getOrderTime()));
                //购买商品
                ShopSku shopSku = shopOrderDetails.getShopSku();
                ShopProduct shopProduct = shopOrderDetails.getShopProduct();
                if (shopProduct == null) {
                    bodyItem.add("");
                } else {
                    bodyItem.add(shopProduct.getTitle());
                    bodyItem.add(shopProduct.getTitle()+ "(" +shopSku.getName()+ ")*" + shopOrderDetails.getCount());
                }
                //规格名称、生产企业、单价
                ShopSku shopSku = shopOrderDetails.getShopSku();
                if (shopSku == null) {
                    bodyItem.add("");
                    bodyItem.add(shopOrderDetails.getProductionEnterprise());
                    bodyItem.add("");
                } else {
                    bodyItem.add(shopSku.getName());
                    bodyItem.add(shopOrderDetails.getProductionEnterprise());
                    bodyItem.add(shopSku.getPrice());
                }
                //购买数量
                bodyItem.add(shopOrderDetails.getCount());
                //订单金额
                bodyItem.add(shopOrder.getOrderMoney());
                //优惠总金额
                bodyItem.add(shopOrder.getDiscountAmount());
                //配送方式 门店
                bodyItem.add("物流");
                body.add(bodyItem);
            }
        }