Browse Source

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

zcb 4 years ago
parent
commit
702ebbc664
22 changed files with 264 additions and 73 deletions
  1. 2 2
      kmall-admin/src/main/java/com/kmall/admin/controller/GoodsController.java
  2. 31 14
      kmall-admin/src/main/java/com/kmall/admin/controller/OrderController.java
  3. 1 8
      kmall-admin/src/main/java/com/kmall/admin/controller/OrderRefundController.java
  4. 1 0
      kmall-admin/src/main/java/com/kmall/admin/controller/PickUpCodeController.java
  5. 51 3
      kmall-admin/src/main/java/com/kmall/admin/controller/exportPDF/ExportPDFController.java
  6. 1 1
      kmall-admin/src/main/java/com/kmall/admin/dao/GoodsDao.java
  7. 2 1
      kmall-admin/src/main/java/com/kmall/admin/service/GoodsService.java
  8. 11 9
      kmall-admin/src/main/java/com/kmall/admin/service/impl/GoodsServiceImpl.java
  9. 23 0
      kmall-admin/src/main/resources/XmlTemplate/PDFGoodsDtoList.xml
  10. 11 4
      kmall-admin/src/main/resources/mybatis/mapper/GoodsDao.xml
  11. 6 0
      kmall-admin/src/main/resources/mybatis/mapper/OrderRefundDao.xml
  12. 1 1
      kmall-admin/src/main/resources/mybatis/mapper/PickUpCodeDao.xml
  13. 1 1
      kmall-admin/src/main/resources/mybatis/mapper/SalesDataUploadDao.xml
  14. 1 1
      kmall-admin/src/main/webapp/WEB-INF/page/sale/salesdataupload.html
  15. 9 0
      kmall-admin/src/main/webapp/WEB-INF/page/shop/goodsexportpdf.html
  16. 6 0
      kmall-admin/src/main/webapp/WEB-INF/page/shop/orderrefund.html
  17. 5 4
      kmall-admin/src/main/webapp/js/sale/sale.js
  18. 23 0
      kmall-admin/src/main/webapp/js/shop/goodsexportpdf.js
  19. 12 23
      kmall-admin/src/main/webapp/js/shop/orderrefund.js
  20. BIN
      kmall-admin/src/main/webapp/statics/file/pdf_goods_export_yyyy_mm_dd_v1.0.0.xlsx
  21. 64 1
      kmall-api/src/main/java/com/kmall/api/entity/exportpdf/PDFGoodsDto.java
  22. 2 0
      kmall-common/src/main/java/com/kmall/common/constant/JxlsXmlTemplateName.java

+ 2 - 2
kmall-admin/src/main/java/com/kmall/admin/controller/GoodsController.java

@@ -109,8 +109,8 @@ public class GoodsController {
     }
 
     @RequestMapping("/queryGoodsName")
-    public R queryGoodsName(@RequestParam String goodsName) {
-        List<GoodsEntity> goodsList = goodsService.queryByName(goodsName);
+    public R queryGoodsName(@RequestParam String storeId, @RequestParam String goodsName) {
+        List<GoodsEntity> goodsList = goodsService.queryByName(storeId, goodsName);
         return R.ok().put("goodsList", goodsList);
     }
 

+ 31 - 14
kmall-admin/src/main/java/com/kmall/admin/controller/OrderController.java

@@ -1162,7 +1162,7 @@ public class OrderController {
         String[] header = new String[]{"订单号", "操作店员", "购买类型", "订单业务类型", "订单状态",
                 "付款状态", "sku", "商品名称", "数量", "实际支付", /*"订单总价",*/ "下单时间", "付款时间", "零售价", "优惠金额", "成交价"};
 
-        List<Map<String, Object>> list = new ArrayList<>();
+        List<Map<String, Object>> list = new LinkedList<>();
         if (orderEntityList != null && orderEntityList.size() > 0) {
             for (OrderEntity orderEntity : orderEntityList) {
                 LinkedHashMap<String, Object> map = new LinkedHashMap<>();
@@ -1202,8 +1202,9 @@ public class OrderController {
         List<OrderEntity> masterOrderEntityList = orderService.queryMasterExportOffilineOrderList(params);
         String[] headerMaster = new String[]{"订单号", "操作店员", "购买类型", "订单业务类型", "订单状态",
                 "付款状态", "实际支付", "订单总价", "下单时间", "付款时间"};
-        List<Map<String, Object>> listMaster = new ArrayList<>();
+        List<Map<String, Object>> listMaster = new LinkedList<>();
         if (masterOrderEntityList != null && masterOrderEntityList.size() > 0) {
+
             for (OrderEntity orderEntity : masterOrderEntityList) {
                 LinkedHashMap<String, Object> map = new LinkedHashMap<>();
                 // 订单业务类型
@@ -1288,6 +1289,7 @@ public class OrderController {
      */
     @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());
@@ -1301,20 +1303,22 @@ public class OrderController {
                 "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<Map<String, Object>> list = new LinkedList<>();
         list.add(headerMap);
         if (systemFormatList != null && systemFormatList.size() > 0) {
             for (SystemFormatDto systemFormat : systemFormatList) {
-                LinkedHashMap<String, Object> map = new LinkedHashMap<>();
-
-
+                LinkedHashMap<String, Object> map = new LinkedHashMap<>(32);
                 if (Objects.nonNull(systemFormat.getTaxRate()) && Objects.nonNull(systemFormat.getTotalSalesInclTax())){
                     // 设置综合税额
-                    systemFormat.setTaxAmount(new BigDecimal(systemFormat.getTotalSalesInclTax()).multiply(new BigDecimal(systemFormat.getTaxRate())).setScale(2,BigDecimal.ROUND_HALF_UP).toString());
+                    BigDecimal totalSalesIncTax = new BigDecimal(systemFormat.getTotalSalesInclTax());
+                    BigDecimal taxRate = new BigDecimal(systemFormat.getTaxRate());
+                    systemFormat.setTaxAmount(totalSalesIncTax.multiply(taxRate).setScale(2,BigDecimal.ROUND_HALF_UP).toString());
                     // 设置商品销售额(税前)
-                    systemFormat.setSales(new BigDecimal(systemFormat.getTotalSalesInclTax()).subtract(new BigDecimal(systemFormat.getTaxAmount())).setScale(2,BigDecimal.ROUND_HALF_UP).toString());
+                    BigDecimal taxAmount = new BigDecimal(systemFormat.getTaxAmount());
+                    systemFormat.setSales(totalSalesIncTax.subtract(taxAmount).setScale(2,BigDecimal.ROUND_HALF_UP).toString());
                     // 设置实际销售额
-                    systemFormat.setCurrentPrice(new BigDecimal(systemFormat.getTotalSalesInclTax()).divide(new BigDecimal(systemFormat.getUnitSold()),2,BigDecimal.ROUND_HALF_UP).setScale(2,BigDecimal.ROUND_HALF_UP).toEngineeringString());
+                    BigDecimal unitSold = new BigDecimal(systemFormat.getUnitSold());
+                    systemFormat.setCurrentPrice(totalSalesIncTax.divide(unitSold,2,BigDecimal.ROUND_HALF_UP).setScale(2,BigDecimal.ROUND_HALF_UP).toEngineeringString());
                     if (Dict.orderStatus.item_401.getItem().equals(systemFormat.getOrderStatus())){
                         systemFormat.setUnitSold("-"+systemFormat.getUnitSold());
                         systemFormat.setSales("-"+systemFormat.getSales());
@@ -1325,15 +1329,27 @@ public class OrderController {
 
                 if (Objects.nonNull(systemFormat.getCurrentPrice()) && Objects.nonNull(systemFormat.getEdlp())){
                     // 设置扣率
-                    systemFormat.setDeductionRate(new BigDecimal(1).subtract(new BigDecimal(systemFormat.getCurrentPrice()).divide(new BigDecimal(systemFormat.getEdlp()),2,BigDecimal.ROUND_HALF_UP).setScale(2,BigDecimal.ROUND_HALF_UP)).toString());
+                    BigDecimal edlp = new BigDecimal(systemFormat.getEdlp());
+                    BigDecimal currentPrice = new BigDecimal(systemFormat.getCurrentPrice());
+                    if (!"0".equals(systemFormat.getEdlp())  && edlp.compareTo(BigDecimal.ZERO)!=0) {
+                        systemFormat.setDeductionRate(new BigDecimal(1).subtract(currentPrice.divide(edlp, 4, BigDecimal.ROUND_HALF_UP)).multiply(new BigDecimal(100)).setScale(2, BigDecimal.ROUND_HALF_UP).toString()+"%");
+                    }
                     if (Objects.nonNull(systemFormat.getCostPrice())){
                         // 设置GP ¥
-                        systemFormat.setGp1(new BigDecimal(systemFormat.getCurrentPrice()).subtract(new BigDecimal(systemFormat.getCostPrice())).setScale(4,BigDecimal.ROUND_HALF_UP).toEngineeringString());
+                        systemFormat.setGp1(currentPrice.subtract(new BigDecimal(systemFormat.getCostPrice())).setScale(2,BigDecimal.ROUND_HALF_UP).toString());
                         // 设置GP %
-                        systemFormat.setGp2(new BigDecimal(systemFormat.getGp1()).divide(new BigDecimal(systemFormat.getCurrentPrice()),4,BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)).setScale(4,BigDecimal.ROUND_HALF_UP).toString()+"%");
+                        if (!"0".equals(systemFormat.getCurrentPrice()) && StringUtils.isNotEmpty(systemFormat.getCurrentPrice())
+                                && currentPrice.compareTo(BigDecimal.ZERO)!=0) {
+                            BigDecimal gp1 = new BigDecimal(systemFormat.getGp1());
+                            systemFormat.setGp2(gp1.divide(currentPrice, 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)).setScale(2, BigDecimal.ROUND_HALF_UP).toString() + "%");
+                        }
                         if (Dict.orderStatus.item_401.getItem().equals(systemFormat.getOrderStatus())){
-                            systemFormat.setGp1("-"+systemFormat.getGp1());
-                            systemFormat.setGp2("-"+systemFormat.getGp2());
+                            if (!systemFormat.getGp1().contains("-")) {
+                                systemFormat.setGp1("-" + systemFormat.getGp1());
+                            }
+                            if (StringUtils.isNotEmpty(systemFormat.getGp2()) && !systemFormat.getGp2().contains("-")) {
+                                systemFormat.setGp2("-" + systemFormat.getGp2());
+                            }
                         }
 
                     }
@@ -1382,6 +1398,7 @@ public class OrderController {
 
                 list.add(map);
             }
+
         }
 
         // =================================================System Format导出结束=====================================

+ 1 - 8
kmall-admin/src/main/java/com/kmall/admin/controller/OrderRefundController.java

@@ -36,7 +36,7 @@ public class OrderRefundController {
      * 查看列表
      */
     @RequestMapping("/list")
-    @RequiresPermissions("orderrefund:list")
+    //@RequiresPermissions("orderrefund:list")
     @ResponseBody
     public R list(@RequestParam Map<String, Object> params) {
         ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", "thirdPartyMerchCode");
@@ -46,13 +46,6 @@ public class OrderRefundController {
         Query query = new Query(params);
 
         List<OrderRefundEntity> orderRefundList = orderRefundService.queryList(query);
-        for (OrderRefundEntity entity: orderRefundList
-             ) {
-            if(entity.getIsOnfflineOrder().equalsIgnoreCase(Dict.isOnfflineOrder.item_1.getItem())) {
-                SysUserEntity sysUserEntity = sysUserService.queryObject(entity.getUserId().longValue());
-                entity.setUserName("操作店员:"+sysUserEntity.getUsername());
-            }
-        }
         int total = orderRefundService.queryTotal(query);
 
         PageUtils pageUtil = new PageUtils(orderRefundList, total, query.getLimit(), query.getPage());

+ 1 - 0
kmall-admin/src/main/java/com/kmall/admin/controller/PickUpCodeController.java

@@ -170,6 +170,7 @@ public class PickUpCodeController {
      * @return
      */
     @RequestMapping("/confirmDelivery/{orderSn}")
+    @ResponseBody
     public R confirmDelivery(@PathVariable("orderSn") String orderSn){
         if(StringUtils.isEmpty(orderSn)){
             return R.error("订单编号为空!");

+ 51 - 3
kmall-admin/src/main/java/com/kmall/admin/controller/exportPDF/ExportPDFController.java

@@ -1,20 +1,25 @@
 package com.kmall.admin.controller.exportPDF;
 
+import com.kmall.admin.dto.StoreGoodsDto;
 import com.kmall.admin.service.GoodsService;
 import com.kmall.admin.utils.pdf.ViewPDF;
 import com.kmall.api.entity.exportpdf.PDFGoodsDto;
+import com.kmall.common.constant.JxlsXmlTemplateName;
+import com.kmall.common.utils.R;
+import com.kmall.common.utils.excel.ExcelUtil;
 import org.apache.http.HttpResponse;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.multipart.MultipartFile;
 import org.springframework.web.servlet.ModelAndView;
 
 import javax.servlet.http.HttpServletResponse;
 import java.math.BigDecimal;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Objects;
+import java.util.*;
 
 /**
  * @author zhangchuangbiao
@@ -31,6 +36,9 @@ public class ExportPDFController {
     @Value("${font.url}")
     private String fontUrl;
 
+    @Autowired
+    private ExcelUtil excelUtil;
+
 //    @Value("${upload.dir}")
 //    private String uploadDir;
 
@@ -87,6 +95,46 @@ public class ExportPDFController {
 
 
     }
+
+
+
+
+
+
+    /**
+     * 批量生成pdf
+     */
+    @RequestMapping("/batchPrintPdf")
+    @ResponseBody
+    public R batchPrintPdf(@RequestParam("file") MultipartFile file) {
+        List<PDFGoodsDto> PDFGoodsDtoList = new ArrayList<>();//信息
+        try {
+            PDFGoodsDto PDFGoodsDto = new PDFGoodsDto();
+            Map<String, Object> beans = new HashMap<String, Object>();
+            beans.put("PDFGoodsDto", PDFGoodsDto);
+            beans.put("PDFGoodsDtoList", PDFGoodsDtoList);
+            if (file.isEmpty()) {
+                return R.error("文件不能为空!");
+            }
+            excelUtil.readExcel(JxlsXmlTemplateName.PDF_GOODS_DTO_LIST, beans, file.getInputStream());
+        } catch (Exception e) {
+            e.printStackTrace();
+            return R.error("导入失败!");
+        }
+        //上传文件
+        return R.ok("导入成功!").put("PDFGoodsDtoList",PDFGoodsDtoList);
+    }
+
+
+
+
+
+
+
+
+
+
+
 }
 
 

+ 1 - 1
kmall-admin/src/main/java/com/kmall/admin/dao/GoodsDao.java

@@ -61,7 +61,7 @@ public interface GoodsDao extends BaseDao<GoodsEntity> {
      */
     List<GoodsEntity> queryListByBarcode(@Param("prodBarcode")String prodBarcode, @Param("storeId")Integer storeId);
 
-    List<GoodsEntity> queryByName(@Param("goodsName")String goodsName);
+    List<GoodsEntity> queryByName(@Param("storeId")String storeId, @Param("goodsName")String goodsName);
 
 
     List<String> queryNonSyncOmsHsCodeSkuList();

+ 2 - 1
kmall-admin/src/main/java/com/kmall/admin/service/GoodsService.java

@@ -187,10 +187,11 @@ public interface GoodsService {
 
     /**
      * 根据商品名称查询商品
+     * @param storeId
      * @param goodsName
      * @return
      */
-    List<GoodsEntity> queryByName(String goodsName);
+    List<GoodsEntity> queryByName(String storeId, String goodsName);
 
     void syncOmsHsCode();
 

+ 11 - 9
kmall-admin/src/main/java/com/kmall/admin/service/impl/GoodsServiceImpl.java

@@ -620,8 +620,8 @@ public class GoodsServiceImpl implements GoodsService {
     }
 
     @Override
-    public List<GoodsEntity> queryByName(String goodsName) {
-        return goodsDao.queryByName(goodsName);
+    public List<GoodsEntity> queryByName(String storeId, String goodsName) {
+        return goodsDao.queryByName(storeId, goodsName);
     }
 
 
@@ -1876,13 +1876,15 @@ public class GoodsServiceImpl implements GoodsService {
             // 同步过海关商品编码才可以算税率
             if ("1".equals(goodsEntity.getIsSyncHsCode())) {
                 Map<String, Object> goodsDetailMap = calculateGoodsDetail(goodsEntity.getProdBarcode(), storeId);
-                GoodsDetailsDto goods = (GoodsDetailsDto) goodsDetailMap.get("goods");
-                // 顾客给的钱 就是税后价
-                BigDecimal actualPaymentAmount = goods.getActualPaymentAmount(); //随便拿一个门店的当前时间的价格,如果有活动价会使用活动价
-                BigDecimal calculateTax = CalculateTax.calculateTax(goodsEntity, actualPaymentAmount);// 税费
-                BigDecimal goodsRate = calculateTax.divide(actualPaymentAmount,4,BigDecimal.ROUND_HALF_UP);
-                goodsEntity.setGoodsRate(goodsRate);
-                goodsDao.update(goodsEntity);
+                if (Objects.nonNull(goodsDetailMap)) {
+                    GoodsDetailsDto goods = (GoodsDetailsDto) goodsDetailMap.get("goods");
+                    // 顾客给的钱 就是税后价
+                    BigDecimal actualPaymentAmount = goods.getActualPaymentAmount(); //随便拿一个门店的当前时间的价格,如果有活动价会使用活动价
+                    BigDecimal calculateTax = CalculateTax.calculateTax(goodsEntity, actualPaymentAmount);// 税费
+                    BigDecimal goodsRate = calculateTax.divide(actualPaymentAmount, 4, BigDecimal.ROUND_HALF_UP);
+                    goodsEntity.setGoodsRate(goodsRate);
+                    goodsDao.update(goodsEntity);
+                }
             }
         }
     }

+ 23 - 0
kmall-admin/src/main/resources/XmlTemplate/PDFGoodsDtoList.xml

@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<workbook>
+    <worksheet name="Sheet1">
+        <section startRow="0" endRow="1"/>
+        <loop startRow="1" endRow="1" items="PDFGoodsDtoList" var="PDFGoodsDto"
+              varType="com.kmall.api.entity.exportpdf.PDFGoodsDto">
+            <section startRow="1" endRow="1">
+                <mapping row="1" col="0">PDFGoodsDto.storeId</mapping>
+                <mapping row="1" col="1">PDFGoodsDto.sku</mapping>
+                <mapping row="1" col="2">PDFGoodsDto.prodBarcode</mapping>
+                <mapping row="1" col="3">PDFGoodsDto.head</mapping>
+                <mapping row="1" col="4">PDFGoodsDto.isPrintRate</mapping>
+                <mapping row="1" col="5">PDFGoodsDto.type</mapping>
+                <mapping row="1" col="6">PDFGoodsDto.headUrl</mapping>
+            </section>
+            <loopbreakcondition>
+                <rowcheck offset="0">
+                    <cellcheck offset="0"></cellcheck>
+                </rowcheck>
+            </loopbreakcondition>
+        </loop>
+    </worksheet>
+</workbook>

+ 11 - 4
kmall-admin/src/main/resources/mybatis/mapper/GoodsDao.xml

@@ -783,11 +783,18 @@
     </select>
 
     <select id="queryByName" resultType="com.kmall.admin.entity.GoodsEntity">
-        select id,name,sku,prod_barcode
-        from mall_goods
-        where 1=1
+        SELECT DISTINCT
+            g.id,
+            g.NAME,
+            g.sku,
+            g.prod_barcode
+        FROM
+            mall_product_store_rela r
+        LEFT JOIN mall_goods g ON g.id = r.goods_id
+        WHERE
+            r.store_id = #{storeId}
         <if test="goodsName != null and goodsName != ''">
-            and name like concat('%',#{goodsName},'%');
+            AND g.NAME LIKE concat('%',#{goodsName},'%');
         </if>
     </select>
     <select id="queryNonSyncOmsHsCodeSkuList" resultType="java.lang.String">

+ 6 - 0
kmall-admin/src/main/resources/mybatis/mapper/OrderRefundDao.xml

@@ -138,6 +138,12 @@
         <if test="isOnfflineOrder != null and isOnfflineOrder != ''">
             AND o.is_onffline_order = #{isOnfflineOrder}
         </if>
+        <if test="startTime != null and startTime != ''">
+            AND r.create_time >= #{startTime}
+        </if>
+        <if test="endTime != null and endTime != ''">
+            AND r.create_time &lt;= #{endTime}
+        </if>
         <choose>
             <when test="sidx != null and sidx.trim() != ''">
                 order by ${sidx} ${order}

+ 1 - 1
kmall-admin/src/main/resources/mybatis/mapper/PickUpCodeDao.xml

@@ -71,7 +71,7 @@
                 order by ${sidx} ${order}
             </when>
 			<otherwise>
-                order by FIELD(pick_up_code_status,0,2,3,1), pick_up_code_createtime desc
+                order by FIELD(pick_up_code_status,0,2,3,1,5), pick_up_code_createtime desc
 			</otherwise>
         </choose>
 		<if test="offset != null and limit != null">

+ 1 - 1
kmall-admin/src/main/resources/mybatis/mapper/SalesDataUploadDao.xml

@@ -73,7 +73,7 @@
                 order by ${sidx} ${order}
             </when>
 			<otherwise>
-                order by file_id desc
+                order by bill_time DESC, file_id desc
 			</otherwise>
         </choose>
 		<if test="offset != null and limit != null">

+ 1 - 1
kmall-admin/src/main/webapp/WEB-INF/page/sale/salesdataupload.html

@@ -32,7 +32,7 @@
                 <i-button type="error" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</i-button>
                 #end-->
                 <i-button type="error" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</i-button>
-                <i-button type="ghost" @click="upload" icon="ios-cloud-upload-outline">&nbsp;销售数据导入</i-button>
+                <i-button type="ghost" @click="upload" icon="ios-cloud-upload-outline">&nbsp;销售数据上传</i-button>
                 <i-button type="primary" @click="download"><i class="fa fa-cloud-download"></i>&nbsp;下载</i-button>
             </div>
         </Row>

+ 9 - 0
kmall-admin/src/main/webapp/WEB-INF/page/shop/goodsexportpdf.html

@@ -40,6 +40,15 @@
         <div class="row" style="border:0;margin-bottom:10px">
 <!--            <i-button  v-bind:disabled="selectButtonDisabled"  @click="selectLabelHead" >选择标签头</i-button>-->
             <i-button type="primary" @click="exportPdf"><i class="fa fa-cloud-download"></i>&nbsp;标签pdf制作</i-button>
+
+            <i-col style="display: inline-grid;">
+                <Upload :show-upload-list="false" :on-success="uploadExcelSuccess" :on-format-error="uploadExcelFormatError"
+                        :format="['xls','xlsx']"
+                        action="../pdf/batchPrintPdf">
+                    <i-button type="ghost" icon="ios-cloud-upload-outline">标签pdf制作模板导入</i-button>
+                </Upload>
+            </i-col>
+            &nbsp;&nbsp;&nbsp;<a href="../statics/file/pdf_goods_export_yyyy_mm_dd_v1.0.0.xlsx">标签pdf制作模板下载</a>&nbsp;&nbsp;&nbsp;&nbsp;
             <i-col span="3">
                 <i-select v-model="q.storeId" placeholder="门店" filterable label-in-value>
                     <i-option v-for="store in stores" :value="store.id"

+ 6 - 0
kmall-admin/src/main/webapp/WEB-INF/page/shop/orderrefund.html

@@ -12,6 +12,12 @@
                 <i-col span="4">
                     <i-input v-model="q.orderSn" @on-enter="query" placeholder="订单编号"/>
                 </i-col>
+                <i-col span="3">
+                    <Date-picker v-model="q.startTime" placeholder="退款开始时间"/>
+                </i-col>
+                <i-col span="3">
+                    <Date-picker v-model="q.endTime" placeholder="退款结束时间"/>
+                </i-col>
                 <i-button @click="query">查询</i-button>
                 <i-button @click="reloadSearch">重置</i-button>
             </div>

+ 5 - 4
kmall-admin/src/main/webapp/js/sale/sale.js

@@ -612,7 +612,8 @@ let vm = new Vue({
         },2000),
 
         queryGoods: function(){
-            $.get("../goods/queryGoodsName?goodsName=", function (r) {
+            vm.storeId = sessionStorage.getItem("storeId");
+            $.get("../goods/queryGoodsName?storeId="+vm.storeId+"&goodsName=", function (r) {
                 if (r.code == 0) {
                     vm.searchGoods = r.goodsList;
                 } else {
@@ -1338,7 +1339,7 @@ function parsedate(value){
 }
 
 function getPrintContentOrder(ticket) {
-    var content = "<div style=\"width: 300px;font-family: 微软雅黑;font-size: 8px;\">";
+    var content = "<div style=\"width: 270px;font-family: 微软雅黑;font-size: 8px;\">";
     // 打印ogo
     content += "<div style=\"text-align: center;width: 100%;height: 260px;\">";
     content += "<img src='/statics/img/cw_logo2.png' style='width: 100%;height: 100%;' />";
@@ -1359,7 +1360,7 @@ function getPrintContentOrder(ticket) {
     content += "<div style=\"width: 100%;\">";
     content += "交易时间:" + ticket.ticketHead.tradeTime;
     content += "</div>";
-    content += "<div style=\"width: 100%;overflow:hidden;white-space: nowrap;\">--------------------------------------------------</div>";
+    content += "<div style=\"width: 100%;overflow:hidden;white-space: nowrap;\">-------------------------------------------------------</div>";
     //商品信息
     content += "<table style=\"width: 100%;\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
     content += "<tr>";
@@ -1371,7 +1372,7 @@ function getPrintContentOrder(ticket) {
     content += "<td style=\"width: 18%;text-align: right;font-size: 10px;font-weight: bold;\">小计</td>";
     content += "</tr>";
     content += "</table>";
-    content += "<div style=\"width: 100%;overflow:hidden;white-space: nowrap;\">--------------------------------------------------</div>";
+    content += "<div style=\"width: 100%;overflow:hidden;white-space: nowrap;\">-------------------------------------------------------</div>";
     content += "<table style=\"width: 100%;\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
     for (var i=0;i< ticket.goods.length;i++){
         content += "<tr>";

+ 23 - 0
kmall-admin/src/main/webapp/js/shop/goodsexportpdf.js

@@ -108,6 +108,29 @@ let vm = new Vue({
 		},
         barCodeEnter:function () {
             this.exportPdf();
+        },
+        uploadExcelSuccess: function (data) {
+            if(data.code==0){
+                console.log(data)
+                var PDFGoodsDtoList = data.PDFGoodsDtoList;
+                for(var i=0;i<PDFGoodsDtoList.length;i++){
+                    var pdfGoodsDto = PDFGoodsDtoList[i];
+                    window.open("../pdf/printPdf?type="+pdfGoodsDto.type+"&sku="+pdfGoodsDto.sku+"&prodBarcode="
+                        +pdfGoodsDto.prodBarcode+"&head="+pdfGoodsDto.head+"&headUrl="+pdfGoodsDto.headUrl+"&storeId="+pdfGoodsDto.storeId+"&isPrintRate="+pdfGoodsDto.isPrintRate);
+                }
+            }else{
+                console.log(data)
+            }
+        },
+        uploadExcelError: function (data) {
+            console.log(data);
+            alert('上传出现异常,请重试!');
+        },
+        uploadExcelFormatError: function (file) {
+            this.$Notice.warning({
+                title: '文件格式不正确',
+                desc: '文件 ' + file.name + ' 格式不正确,请上传 xls 或 xlsx 格式的文件。'
+            });
         }
 
 	},

+ 12 - 23
kmall-admin/src/main/webapp/js/shop/orderrefund.js

@@ -13,18 +13,18 @@ $(function () {
         datatype: "json",
         colModel: [
 			{label: 'id', name: 'id', index: 'id', key: true, hidden: true},
-			{label: '订单编号', name: 'orderSn', index: 'order_sn',width: 220},
+			{label: '订单编号', name: 'orderSn', index: 'order_sn',width: 220, align: 'center'},
 			{label: '用户名称', name: 'userName', index: 'username', align: 'center' , width: 80},
 			{label: '商户退款单号', name: 'outRefundNo', index: 'out_refund_no', align: 'center' , width: 180},
             {
-                label: '申请时间', name: 'createTime', index: 'create_time',  align: 'center' ,width: 140,
+                label: '退款时间', name: 'createTime', index: 'create_time',  align: 'center' ,width: 140,
                 formatter: function (value) {
                     return transDate(value, 'yyyy-MM-dd hh:mm:ss');
                 }
             },
-			{label: '微信退款单号', name: 'refundId', index: 'refund_id', width: 80, hidden: true},
+			{label: '微信退款单号', name: 'refundId', index: 'refund_id', width: 80, hidden: true, align: 'center'},
 			{
-			    label: '退款类型', name: 'refundType', index: 'refund_type', width: 180,
+			    label: '退款类型', name: 'refundType', index: 'refund_type', width: 180, align: 'center',
                 formatter: function (value) {
                     if (value == '1') {
                         return '用户全额退款';
@@ -34,12 +34,6 @@ $(function () {
                     return value;
                 }
             },
-			{
-			    label: '退款时间', name: 'refundTime', index: 'refund_time',  align: 'center' ,width: 140,
-                formatter: function (value) {
-                    return transDate(value, 'yyyy-MM-dd hh:mm:ss');
-                }
-            },
 			{label: '退款金额', name: 'refundMoney', index: 'refund_money', width: 80, align: 'right'},
 			{
 			    label: '退款状态', name: 'refundStatus', index: 'refund_status', align: 'center' , width: 120,
@@ -58,17 +52,6 @@ $(function () {
                     return value;
                 }
             },
-			{label: '退款原因', name: 'refundReason', index: 'refund_reason', width: 140},
-            {label: '退款操作人', name: 'moderSn', index: 'moderSn', width: 90},
-			{label: '退款入账账户', name: 'refundRecvAccout', index: 'refund_recv_accout', width: 80, hidden: true},
-			{label: '审核人', name: 'approver', index: 'approver', width: 80},
-			{
-			    label: '审核时间', name: 'approvalTime', index: 'approval_time',  align: 'center' ,width: 140,
-                formatter: function (value) {
-                    return transDate(value, 'yyyy-MM-dd hh:mm:ss');
-                }
-            },
-			{label: '审核备注', name: 'approvalRemark', index: 'approval_remark', width: 80},
             {
                 label: '操作', width: 130, sortable: false, align: 'center' ,
                 formatter: function (value, col, row) {
@@ -127,7 +110,9 @@ var vm = new Vue({
 			]
 		},
 		q: {
-            orderSn: ''
+            orderSn: '',
+            startTime: '',
+            endTime: ''
 		}
 	},
 	methods: {
@@ -206,7 +191,11 @@ var vm = new Vue({
 			vm.showList = 0;
             let page = $("#jqGrid").jqGrid('getGridParam', 'page');
 			$("#jqGrid").jqGrid('setGridParam', {
-                postData: {'orderSn': vm.q.orderSn},
+                postData: {
+                    'orderSn': vm.q.orderSn,
+                    'startTime': vm.q.startTime,
+                    'endTime': vm.q.endTime
+                },
                 page: page
             }).trigger("reloadGrid");
             vm.handleReset('formValidate');

BIN
kmall-admin/src/main/webapp/statics/file/pdf_goods_export_yyyy_mm_dd_v1.0.0.xlsx


+ 64 - 1
kmall-api/src/main/java/com/kmall/api/entity/exportpdf/PDFGoodsDto.java

@@ -6,7 +6,7 @@ package com.kmall.api.entity.exportpdf;
  * 2020-09-14 16:35
  */
 public class PDFGoodsDto {
-
+    // , , , , , ,String isPrintRate
     private String productName; // 产品名称
     private String englishName; // 产品英文名称
     private String price; // 价格
@@ -16,6 +16,69 @@ public class PDFGoodsDto {
     private String plu;
     private String barCode;
 
+    private String head;// 是否需要标签头
+    private String type;
+    private String sku;
+    private String storeId;
+    private String headUrl;// 标签头地址
+    private String prodBarcode;// 条形码
+    private String isPrintRate;// 是否打印税率
+
+    public String getHead() {
+        return head;
+    }
+
+    public void setHead(String head) {
+        this.head = head;
+    }
+
+    public String getType() {
+        return type;
+    }
+
+    public void setType(String type) {
+        this.type = type;
+    }
+
+    public String getSku() {
+        return sku;
+    }
+
+    public void setSku(String sku) {
+        this.sku = sku;
+    }
+
+    public String getStoreId() {
+        return storeId;
+    }
+
+    public void setStoreId(String storeId) {
+        this.storeId = storeId;
+    }
+
+    public String getHeadUrl() {
+        return headUrl;
+    }
+
+    public void setHeadUrl(String headUrl) {
+        this.headUrl = headUrl;
+    }
+
+    public String getProdBarcode() {
+        return prodBarcode;
+    }
+
+    public void setProdBarcode(String prodBarcode) {
+        this.prodBarcode = prodBarcode;
+    }
+
+    public String getIsPrintRate() {
+        return isPrintRate;
+    }
+
+    public void setIsPrintRate(String isPrintRate) {
+        this.isPrintRate = isPrintRate;
+    }
 
     public String getProductName() {
         return productName;

+ 2 - 0
kmall-common/src/main/java/com/kmall/common/constant/JxlsXmlTemplateName.java

@@ -16,6 +16,8 @@ public class JxlsXmlTemplateName {
     public static final String SYS_USER_DTO_LIST = "/XmlTemplate/SysUserDtoList.xml";
     //门店商品导入
     public static final String STORE_GOODS_DTO_LIST = "/XmlTemplate/StoreGoodsDtoList.xml";
+    //打印标签批量导入
+    public static final String PDF_GOODS_DTO_LIST = "/XmlTemplate/PDFGoodsDtoList.xml";
     //活动商品价格导入
     public static final String STORE_TOPIC_DTO_LIST = "/XmlTemplate/StoreTopicDtoList.xml";