1
0
Prechádzať zdrojové kódy

Merge branch 'master' of http://git.ds-bay.com/project/kmall-pt-general

 Conflicts:
	kmall-admin/src/main/java/com/kmall/admin/controller/OrderController.java
zcb 4 rokov pred
rodič
commit
c88969607c

+ 115 - 0
kmall-admin/src/main/java/com/kmall/admin/controller/OrderController.java

@@ -1,6 +1,7 @@
 package com.kmall.admin.controller;
 
 import com.kmall.admin.dto.OrderExpressDto;
+import com.kmall.admin.dto.SystemFormatDto;
 import com.kmall.admin.entity.*;
 import com.kmall.admin.fromcomm.entity.SysUserEntity;
 import com.kmall.admin.service.*;
@@ -1270,4 +1271,118 @@ public class OrderController {
     }
 
 
+
+
+
+
+
+
+    /**
+     * System Format 导出请求
+     */
+    @RequestMapping(value = "exportSystemFormat")
+    public R exportSystemFormat(@RequestParam Map<String, Object> params, HttpServletResponse response, HttpServletRequest request) {
+        ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", "thirdPartyMerchCode");
+        params = ParamUtils.setTimeMap(params);
+        params.put("isOnfiilineOrder", Dict.isOnfflineOrder.item_1.getItem());
+        ExcelExport ee = new ExcelExport("System Format");
+        //查询列表数据
+        // =================================================System Format导出开始=====================================
+        List<SystemFormatDto> systemFormatList = orderService.queryExportSystemFormatList(params);
+        String[] header = new String[]{"Receipt No.", "Cash Register No.", "Time Stamp Details (Date & Time)", "Staff ID", "Staff Name",
+                "HS Code", "HS Code Name", "E-matou Code", "PLU", "MychemID", "Product Name (EN)","Product Name (CN)", "Barcode", "Pack Size", "Product Specification",
+                "Brand","EDLP","Current Price","Cost Price","Deduction Rate","Unit Sold","Sales","Tax amount","Total Sales incl. Tax","Tax Rate",
+                "GP ¥","GP %","Product Category","Supplier Name","Transaction Type","Sale Return Type","Remark"};
+
+        LinkedHashMap<String, Object> headerMap = initHeaderMap();
+        List<Map<String, Object>> list = new ArrayList<>();
+        list.add(headerMap);
+        if (systemFormatList != null && systemFormatList.size() > 0) {
+            for (SystemFormatDto systemFormat : systemFormatList) {
+                LinkedHashMap<String, Object> map = new LinkedHashMap<>();
+
+                map.put("ReceiptNo",systemFormat.getReceiptNo());
+                map.put("CashRegisterNo",systemFormat.getCashRegisterNo());
+                map.put("TimeStampDetails",systemFormat.getTimeStampDetails());
+                map.put("StaffID",systemFormat.getStaffID());
+                map.put("StaffName",systemFormat.getStaffName());
+                map.put("HSCode",systemFormat.getHsCode());
+                map.put("HSCodeName",systemFormat.getHsCodeName());
+                map.put("EmatouCode",systemFormat.getEmatouCode());
+                map.put("PLU",systemFormat.getPlu());
+                map.put("MychemID",systemFormat.getMychemID());
+                map.put("ProductNameEN",systemFormat.getProductNameEN());
+                map.put("ProductNameCN",systemFormat.getProductNameCN());
+                map.put("Barcode",systemFormat.getBarcode());
+                map.put("PackSize",systemFormat.getPackSize());
+                map.put("ProductSpecification",systemFormat.getProductSpecification());
+                map.put("Brand",systemFormat.getBrand());
+                map.put("EDLP",systemFormat.getEdlp());
+                map.put("CurrentPrice",systemFormat.getCurrentPrice());
+                map.put("CostPrice",systemFormat.getCostPrice());
+                map.put("DeductionRate",systemFormat.getDeductionRate());
+                map.put("UnitSold",systemFormat.getUnitSold());
+                map.put("Sales",systemFormat.getSales());
+                map.put("TaxAmount",systemFormat.getTaxAmount());
+                map.put("TotalSalesInclTax",systemFormat.getTotalSalesInclTax());
+                map.put("TaxRate",systemFormat.getTaxRate());
+                map.put("GP1",systemFormat.getGp1());
+                map.put("GP2",systemFormat.getGp2());
+                map.put("ProductCategory",systemFormat.getProductCategory());
+                map.put("SupplierName",systemFormat.getSupplierName());
+                map.put("TransactionType",systemFormat.getTransactionType());
+                map.put("SaleReturnType",systemFormat.getSaleReturnType());
+                map.put("Remark",systemFormat.getRemark());
+
+                list.add(map);
+            }
+        }
+
+        // =================================================System Format导出结束=====================================
+
+        ee.addSheetByMap("System Format", list, header);
+        ee.export(response);
+
+
+        return R.ok();
+    }
+
+    private LinkedHashMap<String, Object> initHeaderMap() {
+        LinkedHashMap<String, Object> headerMap = new LinkedHashMap<>();
+        headerMap.put("ReceiptNo","销售单号");
+        headerMap.put("CashRegisterNo","收银台");
+        headerMap.put("TimeStampDetails","销售时间");
+        headerMap.put("StaffID","收银员");
+        headerMap.put("StaffName","收银员姓名");
+        headerMap.put("HSCode","品类编码");
+        headerMap.put("HSCodeName","品类名称");
+        headerMap.put("EmatouCode","商品编码");
+        headerMap.put("PLU","PLU");
+        headerMap.put("MychemID","MychemID");
+        headerMap.put("ProductNameEN","商品名称(英文)");
+        headerMap.put("ProductNameCN","商品名称(中文)");
+        headerMap.put("Barcode","商品主条码");
+        headerMap.put("PackSize","规格");
+        headerMap.put("ProductSpecification","单位");
+        headerMap.put("Brand","品牌");
+        headerMap.put("EDLP","日常价");
+        headerMap.put("CurrentPrice","实际销售价");
+        headerMap.put("CostPrice","进货价");
+        headerMap.put("DeductionRate","扣率 (EDLP vs 实际销售价)");
+        headerMap.put("UnitSold","销售数量");
+        headerMap.put("Sales","销售额");
+        headerMap.put("TaxAmount","综合税额");
+        headerMap.put("TotalSalesInclTax","总销售额");
+        headerMap.put("TaxRate","综合税率");
+        headerMap.put("GP1","预估毛利额");
+        headerMap.put("GP2","预估毛利率");
+        headerMap.put("ProductCategory","商品类型");
+        headerMap.put("SupplierName","主供应商名称");
+        headerMap.put("TransactionType","销售类型");
+        headerMap.put("SaleReturnType","退货类型");
+        headerMap.put("Remark","备注");
+        return headerMap;
+    }
+
+
 }

+ 8 - 0
kmall-admin/src/main/java/com/kmall/admin/dao/OrderDao.java

@@ -2,6 +2,7 @@ package com.kmall.admin.dao;
 
 import com.kmall.admin.dto.OrderRecognitionDto;
 import com.kmall.admin.dto.SendTempDto;
+import com.kmall.admin.dto.SystemFormatDto;
 import com.kmall.admin.entity.OrderEntity;
 import com.kmall.admin.entity.PurchaseSalesInStockDetail;
 import com.kmall.admin.entity.RealtimeSalesDetection;
@@ -146,4 +147,11 @@ public interface OrderDao extends BaseDao<OrderEntity> {
     void updateOrderProcessRecord(Map processParam);
 
     List<OrderEntity> queryPickUpCodeList(Map<String, Object> map);
+
+    /**
+     * System Format导出
+     * @param params
+     * @return
+     */
+    List<SystemFormatDto> queryExportSystemFormatList(Map<String, Object> params);
 }

+ 302 - 0
kmall-admin/src/main/java/com/kmall/admin/dto/SystemFormatDto.java

@@ -0,0 +1,302 @@
+package com.kmall.admin.dto;
+
+import java.io.Serializable;
+
+/**
+ * @author 小问号
+ * @email
+ * @date 2020年11月19日14:15:24
+ */
+public class SystemFormatDto implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    private String receiptNo;// 销售单号
+    private String cashRegisterNo;// 收银台
+    private String timeStampDetails;// 销售时间
+    private String staffID;// 收银员
+    private String staffName;// 收银员姓名
+    private String hsCode;// 品类编码
+    private String hsCodeName;// 品类名称
+    private String ematouCode;// 商品编码
+    private String plu;// PLU
+    private String mychemID;// MychemID
+    private String productNameEN;// 商品名称(英文)
+    private String productNameCN;// 商品名称(中文)
+    private String barcode;// 商品主条码
+    private String packSize;// 规格
+    private String productSpecification;// 单位
+    private String brand;// 品牌
+    private String edlp;// 日常价
+    private String currentPrice;// 实际销售价
+    private String costPrice;// 进货价
+    private String deductionRate;// 扣率 (EDLP vs 实际销售价)
+    private String unitSold;// 销售数量
+    private String sales;// 销售额
+    private String taxAmount;// 综合税额
+    private String totalSalesInclTax;// 总销售额
+    private String taxRate;// 综合税率
+    private String gp1;// 预估毛利额
+    private String gp2;// 预估毛利率
+    private String productCategory;// 商品类型
+    private String supplierName;// 主供应商名称
+    private String transactionType;// 销售类型
+    private String saleReturnType;// 退货类型
+    private String remark;// 备注
+
+
+    public String getReceiptNo() {
+        return receiptNo;
+    }
+
+    public void setReceiptNo(String receiptNo) {
+        this.receiptNo = receiptNo;
+    }
+
+    public String getCashRegisterNo() {
+        return cashRegisterNo;
+    }
+
+    public void setCashRegisterNo(String cashRegisterNo) {
+        this.cashRegisterNo = cashRegisterNo;
+    }
+
+    public String getTimeStampDetails() {
+        return timeStampDetails;
+    }
+
+    public void setTimeStampDetails(String timeStampDetails) {
+        this.timeStampDetails = timeStampDetails;
+    }
+
+    public String getStaffID() {
+        return staffID;
+    }
+
+    public void setStaffID(String staffID) {
+        this.staffID = staffID;
+    }
+
+    public String getStaffName() {
+        return staffName;
+    }
+
+    public void setStaffName(String staffName) {
+        this.staffName = staffName;
+    }
+
+    public String getHsCode() {
+        return hsCode;
+    }
+
+    public void setHsCode(String hsCode) {
+        this.hsCode = hsCode;
+    }
+
+    public String getHsCodeName() {
+        return hsCodeName;
+    }
+
+    public void setHsCodeName(String hsCodeName) {
+        this.hsCodeName = hsCodeName;
+    }
+
+    public String getEmatouCode() {
+        return ematouCode;
+    }
+
+    public void setEmatouCode(String ematouCode) {
+        this.ematouCode = ematouCode;
+    }
+
+    public String getPlu() {
+        return plu;
+    }
+
+    public void setPlu(String plu) {
+        this.plu = plu;
+    }
+
+    public String getMychemID() {
+        return mychemID;
+    }
+
+    public void setMychemID(String mychemID) {
+        this.mychemID = mychemID;
+    }
+
+    public String getProductNameEN() {
+        return productNameEN;
+    }
+
+    public void setProductNameEN(String productNameEN) {
+        this.productNameEN = productNameEN;
+    }
+
+    public String getProductNameCN() {
+        return productNameCN;
+    }
+
+    public void setProductNameCN(String productNameCN) {
+        this.productNameCN = productNameCN;
+    }
+
+    public String getBarcode() {
+        return barcode;
+    }
+
+    public void setBarcode(String barcode) {
+        this.barcode = barcode;
+    }
+
+    public String getPackSize() {
+        return packSize;
+    }
+
+    public void setPackSize(String packSize) {
+        this.packSize = packSize;
+    }
+
+    public String getProductSpecification() {
+        return productSpecification;
+    }
+
+    public void setProductSpecification(String productSpecification) {
+        this.productSpecification = productSpecification;
+    }
+
+    public String getBrand() {
+        return brand;
+    }
+
+    public void setBrand(String brand) {
+        this.brand = brand;
+    }
+
+    public String getEdlp() {
+        return edlp;
+    }
+
+    public void setEdlp(String edlp) {
+        this.edlp = edlp;
+    }
+
+    public String getCurrentPrice() {
+        return currentPrice;
+    }
+
+    public void setCurrentPrice(String currentPrice) {
+        this.currentPrice = currentPrice;
+    }
+
+    public String getCostPrice() {
+        return costPrice;
+    }
+
+    public void setCostPrice(String costPrice) {
+        this.costPrice = costPrice;
+    }
+
+    public String getDeductionRate() {
+        return deductionRate;
+    }
+
+    public void setDeductionRate(String deductionRate) {
+        this.deductionRate = deductionRate;
+    }
+
+    public String getUnitSold() {
+        return unitSold;
+    }
+
+    public void setUnitSold(String unitSold) {
+        this.unitSold = unitSold;
+    }
+
+    public String getSales() {
+        return sales;
+    }
+
+    public void setSales(String sales) {
+        this.sales = sales;
+    }
+
+    public String getTaxAmount() {
+        return taxAmount;
+    }
+
+    public void setTaxAmount(String taxAmount) {
+        this.taxAmount = taxAmount;
+    }
+
+    public String getTotalSalesInclTax() {
+        return totalSalesInclTax;
+    }
+
+    public void setTotalSalesInclTax(String totalSalesInclTax) {
+        this.totalSalesInclTax = totalSalesInclTax;
+    }
+
+    public String getTaxRate() {
+        return taxRate;
+    }
+
+    public void setTaxRate(String taxRate) {
+        this.taxRate = taxRate;
+    }
+
+    public String getGp1() {
+        return gp1;
+    }
+
+    public void setGp1(String gp1) {
+        this.gp1 = gp1;
+    }
+
+    public String getGp2() {
+        return gp2;
+    }
+
+    public void setGp2(String gp2) {
+        this.gp2 = gp2;
+    }
+
+    public String getProductCategory() {
+        return productCategory;
+    }
+
+    public void setProductCategory(String productCategory) {
+        this.productCategory = productCategory;
+    }
+
+    public String getSupplierName() {
+        return supplierName;
+    }
+
+    public void setSupplierName(String supplierName) {
+        this.supplierName = supplierName;
+    }
+
+    public String getTransactionType() {
+        return transactionType;
+    }
+
+    public void setTransactionType(String transactionType) {
+        this.transactionType = transactionType;
+    }
+
+    public String getSaleReturnType() {
+        return saleReturnType;
+    }
+
+    public void setSaleReturnType(String saleReturnType) {
+        this.saleReturnType = saleReturnType;
+    }
+
+    public String getRemark() {
+        return remark;
+    }
+
+    public void setRemark(String remark) {
+        this.remark = remark;
+    }
+}

+ 8 - 0
kmall-admin/src/main/java/com/kmall/admin/service/OrderService.java

@@ -2,6 +2,7 @@ package com.kmall.admin.service;
 
 import com.kmall.admin.dto.OrderExpressDto;
 import com.kmall.admin.dto.OrderRecognitionDto;
+import com.kmall.admin.dto.SystemFormatDto;
 import com.kmall.admin.entity.*;
 import com.kmall.admin.fromcomm.entity.SysUserEntity;
 import com.kmall.common.utils.Query;
@@ -180,4 +181,11 @@ public interface OrderService {
      * @return
      */
     List<OrderEntity> queryMasterExportList(Map<String, Object> params);
+
+    /**
+     * System Format 导出
+     * @param params
+     * @return
+     */
+    List<SystemFormatDto> queryExportSystemFormatList(Map<String, Object> params);
 }

+ 7 - 0
kmall-admin/src/main/java/com/kmall/admin/service/impl/OrderServiceImpl.java

@@ -15,6 +15,7 @@ import com.kmall.admin.dao.vip.Mall2MemberPointsDao;
 import com.kmall.admin.dao.vip.Mall2PointsRulesDao;
 import com.kmall.admin.dto.OrderExpressDto;
 import com.kmall.admin.dto.OrderRecognitionDto;
+import com.kmall.admin.dto.SystemFormatDto;
 import com.kmall.admin.entity.*;
 import com.kmall.admin.entity.OrderProcessRecordEntity;
 import com.kmall.admin.entity.alarm.Mall2LowPriceWarningEntity;
@@ -2720,6 +2721,12 @@ public class OrderServiceImpl implements OrderService {
         return orderDao.queryMasterExportList(params);
     }
 
+    @Override
+    public List<SystemFormatDto> queryExportSystemFormatList(Map<String, Object> params) {
+        List<SystemFormatDto> systemFormatList = orderDao.queryExportSystemFormatList(params);
+        return systemFormatList;
+    }
+
 
     /**
      * 设置订单数据

+ 54 - 0
kmall-admin/src/main/resources/mybatis/mapper/OrderDao.xml

@@ -2031,6 +2031,60 @@
         </if>
         order by o.id desc
     </select>
+    <select id="queryExportSystemFormatList" resultType="com.kmall.admin.dto.SystemFormatDto">
+        SELECT distinct
+        o.id,
+        o.order_sn as receiptNo,
+        u.username as cashRegisterNo,
+        o.pay_time as timeStampDetails,
+        u.username as staffID,
+        u.username as staffName,
+        c.id as hsCode,
+        c.name as hsCodeName,
+        gs.goods_sn as ematouCode,
+        gs.plu as plu,
+        gs.english_name as productNameEN,
+        gs.name as productNameCN,
+        gs.prod_barcode as barcode,
+        gs.ciq_prod_model as packSize,
+        uc.name as productSpecification,
+        b.name as brand,
+        gs.daily_price as edlp,
+        g.number as unitSold,
+        g.actual_payment_amount as sales,
+        o.order_price as totalSalesInclTax,
+        gs.goods_rate as taxRate,
+        sup.child_supplier_name as supplierName
+        FROM
+        mall_order o
+        LEFT JOIN mall_order_goods g ON o.id = g.order_id
+        left join mall_store s on o.store_id = s.id
+        LEFT JOIN mall_goods gs ON g.goods_id = gs.id
+        left join mall_sale_record record on record.order_sn = o.order_sn
+        LEFT JOIN sys_user u ON record.saller_id = u.user_id
+        left join sys_cus_unit_code uc on uc.code = gs.unit_code
+        left join mall_product_store_rela sr on sr.goods_id=gs.id
+        left join mall_brand b on b.id=sr.brand_id
+        left join mall_category c on b.category_id = c.id
+        left join mall_supplier sup on gs.supplier_id = sup.id
+        WHERE 1=1
+        <if test="orderSn != null and orderSn.trim() != ''">
+            AND o.order_sn LIKE concat('%',#{orderSn},'%')
+        </if>
+        <if test="orderStatus != null and orderStatus.trim() != ''">
+            AND o.order_status = #{orderStatus}
+        </if>
+        <if test="isOnfiilineOrder != null">
+            AND o.is_onffline_order = #{isOnfiilineOrder}
+        </if>
+        <if test="startTime != null and startTime != ''">
+            AND o.add_time <![CDATA[ >  ]]> #{startTime}
+        </if>
+        <if test="endTime != null and endTime != ''">
+            AND o.add_time <![CDATA[ <  ]]> #{endTime}
+        </if>
+
+    </select>
 
     <update id="updateOrderInfo" parameterType="map">
         UPDATE mall_order a

+ 1 - 0
kmall-admin/src/main/webapp/WEB-INF/page/shop/offilineOrderList.html

@@ -41,6 +41,7 @@
                 #if($shiro.hasPermission("order:exportOffilineOrder"))
                 <i-button type="primary" @click="exportOffilineOrder"><i class="fa fa-cloud-download"></i>&nbsp;导出</i-button>
                 #end
+                <i-button type="primary" @click="exportSystemFormat"><i class="fa fa-cloud-download"></i>&nbsp;System Format 导出</i-button>
             </div>
            <!-- TODO req_hidden_20200610 #if($shiro.hasPermission("order:wxMicropayPay"))
             <div class="buttons-group">

+ 8 - 0
kmall-admin/src/main/webapp/js/shop/offilineOrderList.js

@@ -482,6 +482,14 @@ let vm = new Vue({
             params.startTime=vm.q.startTime;
             params.endTime=vm.q.endTime;
             exportFile('#rrapp', '../order/exportOffilineOrder', params);
+        },
+        exportSystemFormat : function () {
+            var params = {};
+            params.orderSn=vm.q.orderSn,
+                params.orderStatus=vm.q.orderStatus;
+            params.startTime=vm.q.startTime;
+            params.endTime=vm.q.endTime;
+            exportFile('#rrapp', '../order/exportSystemFormat', params);
         }
     },
     created: function () {