|
@@ -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.*;
|
|
@@ -1237,4 +1238,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;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
}
|