Browse Source

订单新增订单快递批量导入功能

hyq 6 years ago
parent
commit
8fedf0c9be

+ 42 - 9
kmall-admin/src/main/java/com/kmall/admin/controller/OrderController.java

@@ -1,6 +1,9 @@
 package com.kmall.admin.controller;
 
+import com.kmall.admin.dto.OrderExpressDto;
 import com.kmall.admin.entity.*;
+import com.kmall.common.constant.JxlsXmlTemplateName;
+import com.kmall.common.utils.excel.ExcelUtil;
 import com.kmall.manager.manager.wechat.WechatUtil;
 import com.kmall.manager.manager.wechat.WechatGlobalUtil;
 import com.kmall.manager.manager.wechat.wxglobal.dto.WechatGlobalRefundApiResult;
@@ -27,6 +30,7 @@ import org.apache.commons.logging.LogFactory;
 import org.apache.shiro.authz.annotation.RequiresPermissions;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
@@ -59,6 +63,8 @@ public class OrderController {
     private OrderWXPayRecordService orderWXPayRecordService;
     @Autowired
     private PinganResponseService pinganResponseService;
+    @Autowired
+    private ExcelUtil excelUtil;
 
     /**
      * 列表
@@ -782,22 +788,49 @@ public class OrderController {
     }
 
     /**
-     * 订单修改快递
+     * 订单修改已发货的快递信息
      */
     @RequestMapping("/updateExpressInfo")
     @RequiresPermissions("order:updateExpressInfo")
     public Object updateExpressInfo(@RequestBody OrderEntity orderEntity) {
         OrderEntity orderInfo = orderService.queryObject(orderEntity.getId());
         if (orderInfo != null){
-            OrderEntity order = new OrderEntity();
-            order.setId(orderInfo.getId());
-            order.setShippingName(orderEntity.getShippingName());
-            order.setShippingCode(orderEntity.getShippingCode());
-            order.setShippingNo(orderEntity.getShippingNo());
-            order.setModerSn(ShiroUtils.getUserEntity().getUsername());
-            order.setModTime(new Date());
-            orderService.update(order);
+            if(orderInfo.getShippingStatus() == Integer.parseInt(Dict.shippingStatus.item_1.getItem())) {
+                OrderEntity order = new OrderEntity();
+                order.setId(orderInfo.getId());
+                order.setShippingName(orderEntity.getShippingName());
+                order.setShippingCode(orderEntity.getShippingCode());
+                order.setShippingNo(orderEntity.getShippingNo());
+                order.setModerSn(ShiroUtils.getUserEntity().getUsername());
+                order.setModTime(new Date());
+                orderService.update(order);
+            }else{
+                throw new RRException("此订单"+Dict.shippingStatus.valueOf("item_"+orderInfo.getShippingStatus()).getItemName()+"!不能操作");
+            }
+        }
+        return R.ok();
+    }
+
+
+    /**
+     * 上传文件
+     */
+    @RequestMapping("/expressUpload")
+    public R expressUpload(@RequestParam("file") MultipartFile file) {
+        List<OrderExpressDto> orderExpressList = new ArrayList<>();//快递信息
+        try {
+            Map<String, Object> beans = new HashMap<String, Object>();
+            beans.put("OrderExpressList", orderExpressList);
+            if (file.isEmpty()) {
+                return R.error("文件不能为空!");
+            }
+            excelUtil.readExcel(JxlsXmlTemplateName.ORDER_EXPRESS_LIST, beans, file.getInputStream());
+        } catch (Exception e) {
+            e.printStackTrace();
+            return R.error("导入失败!");
         }
+        orderService.uploadExcel(orderExpressList);
+        //上传文件
         return R.ok();
     }
 }

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

@@ -72,4 +72,6 @@ public interface OrderDao extends BaseDao<OrderEntity> {
     List<OrderEntity> queryObjectByMerchOrderSn(@Param("merchOrderSn")String merchOrderSn);
 
     List<OrderEntity> queryExportList(Map<String, Object> map);
+
+    OrderEntity queryObjectByOrderSn(@Param("orderSn")String orderSn);
 }

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

@@ -2,6 +2,7 @@ package com.kmall.admin.dao;
 
 import com.kmall.admin.entity.ShippingEntity;
 import com.kmall.manager.dao.BaseDao;
+import org.apache.ibatis.annotations.Param;
 
 /**
  * Dao
@@ -11,5 +12,5 @@ import com.kmall.manager.dao.BaseDao;
  * @date 2017-09-04 21:42:24
  */
 public interface ShippingDao extends BaseDao<ShippingEntity> {
-
+    ShippingEntity queryObjectByCode(@Param("code")String code);
 }

+ 52 - 0
kmall-admin/src/main/java/com/kmall/admin/dto/OrderExpressDto.java

@@ -0,0 +1,52 @@
+package com.kmall.admin.dto;
+
+import java.io.Serializable;
+
+/**
+ * @author huangyq
+ * @version 1.0
+ * 2019-04-26 10:32
+ */
+public class OrderExpressDto  implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    private String orderSn;
+
+    private String shippingNo;
+
+    private String shippingName;
+
+    private String shippingCode;
+
+    public String getOrderSn() {
+        return orderSn;
+    }
+
+    public void setOrderSn(String orderSn) {
+        this.orderSn = orderSn;
+    }
+
+    public String getShippingNo() {
+        return shippingNo;
+    }
+
+    public void setShippingNo(String shippingNo) {
+        this.shippingNo = shippingNo;
+    }
+
+    public String getShippingName() {
+        return shippingName;
+    }
+
+    public void setShippingName(String shippingName) {
+        this.shippingName = shippingName;
+    }
+
+    public String getShippingCode() {
+        return shippingCode;
+    }
+
+    public void setShippingCode(String shippingCode) {
+        this.shippingCode = shippingCode;
+    }
+}

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

@@ -1,5 +1,6 @@
 package com.kmall.admin.service;
 
+import com.kmall.admin.dto.OrderExpressDto;
 import com.kmall.admin.entity.OfflineCartEntity;
 import com.kmall.admin.entity.OrderEntity;
 import com.kmall.admin.entity.OrderRefundEntity;
@@ -98,4 +99,11 @@ public interface OrderService {
     int confirmPay(Long id, String payFlag,String orderSnWx);
 
     List<OrderEntity> queryExportList(Map<String, Object> map);
+    /**
+     * 导入订单快递信息
+     *
+     * @param orderExpressDtoList
+     * @return
+     */
+    int uploadExcel(List<OrderExpressDto> orderExpressDtoList);
 }

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

@@ -635,7 +635,7 @@ public class GoodsServiceImpl implements GoodsService {
     public int uploadExcel(List<GoodsDto> goodsEntityList,int exportDataType) {
         SysUserEntity user = ShiroUtils.getUserEntity();
         String merchSn = user.getMerchSn();
-        boolean isSuccess = false;
+        boolean isFail = false;
         List<String> failSameSkuList = new ArrayList<>(), failHotGoodsSnList = new ArrayList<>(),
                 failSuppGoodsSnList = new ArrayList<>(),
                 failUnitGoodsSnList = new ArrayList<>(), failNationGoodsSnList = new ArrayList<>(),failProdbarGoodsSnList = new ArrayList<>(),
@@ -694,7 +694,7 @@ public class GoodsServiceImpl implements GoodsService {
                     if(!(Dict.orderBizType.item_02.getItem().equalsIgnoreCase(goodsDto.getGoodsBizType())
                             || Dict.orderBizType.item_10.getItem().equalsIgnoreCase(goodsDto.getGoodsBizType())
                             || Dict.orderBizType.item_00.getItem().equalsIgnoreCase(goodsDto.getGoodsBizType()))){
-                        isSuccess = true;
+                        isFail = true;
                         failTypeGoodsSnList.add(goodsDto.getSku());
                     }
                 }
@@ -705,12 +705,12 @@ public class GoodsServiceImpl implements GoodsService {
 
                     if(!user.getRoleType().equalsIgnoreCase(Dict.roleType.item_1.getItem())) {
                         if (!merchSn.equalsIgnoreCase(thirdMerchantBizEntity.getMerchSn())) {
-                            isSuccess = true;
+                            isFail = true;
                             failMerchUserGoodsSnList.add(goodsDto.getGoodsSn());
                         }
                     }
                 }else{//商户不存在
-                    isSuccess = true;
+                    isFail = true;
                     failMerchGoodsSnList.add(goodsDto.getGoodsSn());
                 }
 
@@ -722,7 +722,7 @@ public class GoodsServiceImpl implements GoodsService {
                 map.put("goodsBizType", goodsDto.getGoodsBizType());
                 List<GoodsEntity> list = querySame(map);
                 if (list != null && list.size() != 0) {
-                    isSuccess = true;
+                    isFail = true;
                     if(goodsDto.getSku()!=null) {
                         failSameSkuList.add(goodsDto.getSku());
                     }
@@ -732,7 +732,7 @@ public class GoodsServiceImpl implements GoodsService {
                 //校验产品条码是否存在
                 List<GoodsEntity> prodbarGoods = goodsDao.queryObjectByProdBarcode(goodsDto.getProdBarcode(),merchSn,null);
                 if(prodbarGoods != null && prodbarGoods.size() > 0){
-                    isSuccess = true;
+                    isFail = true;
                     failProdbarGoodsSnList.add(goodsDto.getGoodsSn());
                 }else{
                     goodsEntity.setProdBarcode(goodsDto.getProdBarcode());
@@ -741,14 +741,14 @@ public class GoodsServiceImpl implements GoodsService {
                 if (Dict.orderBizType.item_02.getItem().equals(goodsDto.getGoodsBizType())
                         || Dict.orderBizType.item_10.getItem().equals(goodsDto.getGoodsBizType())) {
                     if(goodsDto.getIsHotStr().equalsIgnoreCase("1")){
-                        isSuccess = true;
+                        isFail = true;
                         failHotGoodsSnList.add(goodsDto.getGoodsSn());
                     }
                 }
                 if(thirdMerchantBizEntity != null) {
                     SupplierEntity supplierEntity = supplierDao.queryObjectByName(goodsDto.getSupplierName(), thirdMerchantBizEntity.getMerchSn());
                     if (supplierEntity == null) {
-                        isSuccess = true;
+                        isFail = true;
                         failSuppGoodsSnList.add(goodsDto.getGoodsSn());
                     } else {
                         goodsEntity.setSupplierId(supplierEntity.getId());
@@ -757,20 +757,20 @@ public class GoodsServiceImpl implements GoodsService {
                 //商品配置校验
                 /*CategoryEntity categoryEntity = categoryDao.queryObjectByName(goodsDto.getCategoryName(),goodsDto.getMerchSn());
                 if(categoryEntity==null){
-                    isSuccess = true;
+                    isFail = true;
                     failCateGoodsSnList.add(goodsDto.getGoodsSn());
                 }else{
                     if(categoryEntity.getLevel().equalsIgnoreCase("L2")) {
                         goodsEntity.setCategoryId(categoryEntity.getId());
                         goodsEntity.setAttributeCategory(categoryEntity.getParentId());
                     }else{
-                        isSuccess = true;
+                        isFail = true;
                         failCateL2GoodsSnList.add(goodsDto.getGoodsSn());
                     }
                 }
                 BrandEntity brandEntity = brandDao.queryObjectByName(goodsDto.getBrandName(),goodsDto.getMerchSn());
                 if (brandEntity == null) {
-                    isSuccess = true;
+                    isFail = true;
                     failBrandGoodsSnList.add(goodsDto.getGoodsSn());
                 } else {
                     goodsEntity.setBrandId(brandEntity.getId());
@@ -778,7 +778,7 @@ public class GoodsServiceImpl implements GoodsService {
                 //运费
                 FreightEntity freightEntity = freightDao.queryObjectByName(goodsDto.getDefaultFreight(),goodsDto.getMerchSn());
                 if(freightEntity==null){
-                    isSuccess = true;
+                    isFail = true;
                     failFreightGoodsSnList.add(goodsDto.getGoodsSn());
                     failFreightList.add(goodsDto.getDefaultFreight());
                 }else {
@@ -787,7 +787,7 @@ public class GoodsServiceImpl implements GoodsService {
                 if (!Dict.orderBizType.item_11.getItem().equals(goodsDto.getGoodsBizType())) {
                     SysCusUnitCodeEntity sysCusUnitCodeEntity = sysCusUnitCodeDao.queryObjectByName(goodsDto.getUnitName());
                     if (sysCusUnitCodeEntity == null) {
-                        isSuccess = true;
+                        isFail = true;
                         failUnitGoodsSnList.add(goodsDto.getGoodsSn());
                     } else {
                         goodsEntity.setUnitCode(sysCusUnitCodeEntity.getCode());
@@ -795,7 +795,7 @@ public class GoodsServiceImpl implements GoodsService {
                     //原产国
                     SysCusNationCodeEntity sysCusNationCodeEntity = sysCusNationCodeDao.queryObjectByName(goodsDto.getOriCntName());
                     if (sysCusNationCodeEntity == null) {
-                        isSuccess = true;
+                        isFail = true;
                         failNationGoodsSnList.add(goodsDto.getGoodsSn());
                     } else {
                         goodsEntity.setOriCntCode(sysCusNationCodeEntity.getCode());
@@ -824,7 +824,7 @@ public class GoodsServiceImpl implements GoodsService {
                 goodsEntity.setUpdateTime(new Date());
                 goodsEntity.setModTime(new Date());
 
-                if(!isSuccess){
+                if(!isFail){
                     GoodsEntity goods = goodsDao.queryObjectBySn(goodsDto.getGoodsSn());
                     if(goods!=null) {// 修改商品
                         goodsEntity.setId(goods.getId());

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

@@ -1,8 +1,10 @@
 package com.kmall.admin.service.impl;
 
 import com.alibaba.fastjson.JSONObject;
+import com.google.common.collect.ImmutableBiMap;
 import com.google.common.collect.Maps;
 import com.kmall.admin.dao.*;
+import com.kmall.admin.dto.OrderExpressDto;
 import com.kmall.admin.entity.*;
 import com.kmall.admin.entity.OrderProcessRecordEntity;
 import com.kmall.manager.manager.express.sf.properties.SFPropertiesBuilder;
@@ -972,4 +974,97 @@ public class OrderServiceImpl implements OrderService {
     public List<OrderEntity> queryOffilineOrderList(Map<String, Object> map) {
         return orderDao.queryOffilineOrderList(map);
     }
+
+    @Override
+    public int uploadExcel(List<OrderExpressDto> orderExpressDtoList) {
+        SysUserEntity user = ShiroUtils.getUserEntity();
+        boolean isFail = false;
+        List<String> failShippingNameList = new ArrayList<>();
+        List<String> failOrderSnList = new ArrayList<>();
+        List<String> failShippingCodeList = new ArrayList<>();
+        List<String> failCodeSnList = new ArrayList<>();
+        List<String> failNameSnList = new ArrayList<>();
+        List<String> failStatusOrderSnList = new ArrayList<>();
+        if (orderExpressDtoList != null && orderExpressDtoList.size() > 0) {
+            for (int i = 0; i < orderExpressDtoList.size(); i++) {
+                OrderExpressDto orderExpressDto = orderExpressDtoList.get(i);
+                OrderEntity orderEntity = new OrderEntity();
+                Map<String, Object> valideDate = MapBeanUtil.fromObject(orderExpressDto);
+                ImmutableBiMap.Builder builder = new ImmutableBiMap.Builder();
+                builder.put("orderSn", "订单编号");
+                builder.put("shippingNo", "快递单号");
+                builder.put("shippingName", "快递公司");
+                builder.put("shippingCode", "快递简写");
+                R r = ValidatorUtil.isEmpty(builder.build(), valideDate);
+                if (Integer.valueOf(r.get("code").toString()) != 0) {
+                    throw new RRException(r.get("msg").toString());
+                } else {
+                    r = ValidatorUtil.isEmpty(builder.build(), valideDate);
+                    if (Integer.valueOf(r.get("code").toString()) != 0) {
+                        throw new RRException(r.get("msg").toString());
+                    }
+                }
+                OrderEntity order = orderDao.queryObjectByOrderSn(orderExpressDto.getOrderSn());
+                if(order == null){
+                    isFail = true;
+                    failOrderSnList.add(orderExpressDto.getOrderSn());
+                }else{
+                    if(!(order.getOrderStatus() == Integer.parseInt(Dict.orderStatus.item_201.getItem())
+                            && order.getPayStatus() == Integer.parseInt(Dict.payStatus.item_2.getItem()))){
+                        isFail = true;
+                        failStatusOrderSnList.add(orderExpressDto.getOrderSn());
+                    }
+                }
+                ShippingEntity shippingEntity = shippingDao.queryObjectByCode(orderExpressDto.getShippingCode());
+                if(shippingEntity == null){
+                    isFail = true;
+                    failShippingCodeList.add(orderExpressDto.getShippingCode());
+                    failCodeSnList.add(orderExpressDto.getOrderSn());
+                }else{
+                    if(!orderExpressDto.getShippingName().equalsIgnoreCase(shippingEntity.getName())){
+                        isFail = true;
+                        failShippingNameList.add(orderExpressDto.getShippingName());
+                        failNameSnList.add(orderExpressDto.getOrderSn());
+                    }
+                }
+                if(!isFail){//false则有错误的数据
+                    if(order != null) {// 修改商品
+//                        orderEntity.setOrderSn(orderExpressDto.getOrderSn());
+                        orderEntity.setShippingNo(orderExpressDto.getShippingNo());
+                        orderEntity.setShippingCode(orderExpressDto.getShippingCode());
+                        orderEntity.setShippingName(orderExpressDto.getShippingName());
+                        orderEntity.setShippingStatus(Integer.parseInt(Dict.shippingStatus.item_1.getItem()));
+                        orderEntity.setOrderStatus(Integer.parseInt(Dict.orderStatus.item_300.getItem()));
+                        orderEntity.setModerSn(user.getUsername());
+                        orderEntity.setCreateTime(new Date());
+                        orderEntity.setModTime(new Date());
+                        orderEntity.setId(order.getId());
+                        orderDao.update(orderEntity);
+                    }
+                }
+            }
+            if(failOrderSnList != null && failOrderSnList.size() > 0){
+                throw new RRException("导入数据异常,订单编号不存在,不存在的订单编号【"+failOrderSnList+"】,请删除掉再继续操作");
+            }
+            if(failStatusOrderSnList != null && failStatusOrderSnList.size() > 0){
+                throw new RRException("导入数据异常,修改订单快递功能只支持已付款未发货的订单,以下订单编号无效【"+failStatusOrderSnList+"】,请删除掉再继续操作");
+            }
+            if(failShippingCodeList != null && failShippingCodeList.size() > 0){
+                throw new RRException("导入数据异常,快递简写不在可支持的范围中,简写错误的订单编号【"+failCodeSnList+"】,错误的快递简写【"+failShippingCodeList+"】," +
+                        "正确数据可下载订单页面的快递公司简写Excel中查看");
+            }
+            if(failShippingNameList != null && failShippingNameList.size() > 0){
+                throw new RRException("导入数据异常,快递简写对应的快递公司不一致,快递公司错误的订单编号【"+failNameSnList+"】,请修改Excel数据中订单编号对应的快递公司错误信息," +
+                        "正确数据可下载订单页面的快递公司简写Excel中查看");
+            }
+//            if(failFreightGoodsSnList != null && failFreightGoodsSnList.size() > 0){
+//                exportExceptionDataEntity.setExportExceptionData("运费信息请在商城配置》运费模板中维护,运费与商户信息对应,请检查该商品商户信息下的运费是否维护,不存在的商品编码【"+failFreightGoodsSnList+"】,运费【"+failFreightList+"】");
+//                exportExceptionDataDao.save(exportExceptionDataEntity);
+//                throw new RRException("导入数据异常,异常信息请在商品管理》》商品导入异常数据中查看检查");
+//            }
+        }else{
+            throw new RRException("导入数据为空,或者检查商品编码数据是否为空");
+        }
+        return 1;
+    }
 }

+ 20 - 0
kmall-admin/src/main/resources/XmlTemplate/OrderExpressList.xml

@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<workbook>
+    <worksheet name="Sheet1">
+        <section startRow="0" endRow="1"/>
+        <loop startRow="1" endRow="1" items="OrderExpressList" var="OrderExpressDto"
+              varType="com.kmall.admin.dto.OrderExpressDto">
+            <section startRow="1" endRow="1">
+                <mapping row="1" col="0">OrderExpressDto.orderSn</mapping>
+                <mapping row="1" col="1">OrderExpressDto.shippingNo</mapping>
+                <mapping row="1" col="2">OrderExpressDto.shippingName</mapping>
+                <mapping row="1" col="3">OrderExpressDto.shippingCode</mapping>
+            </section>
+            <loopbreakcondition>
+                <rowcheck offset="0">
+                    <cellcheck offset="0"></cellcheck>
+                </rowcheck>
+            </loopbreakcondition>
+        </loop>
+    </worksheet>
+</workbook>

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

@@ -100,6 +100,10 @@
         select * from mall_order a where merch_order_sn = #{merchOrderSn}
     </select>
 
+    <select id="queryObjectByOrderSn" resultType="com.kmall.admin.entity.OrderEntity">
+        select * from mall_order a where order_sn = #{orderSn}
+    </select>
+
     <select id="queryList" resultType="com.kmall.admin.entity.OrderEntity">
         SELECT
         o.order_sn,

+ 9 - 0
kmall-admin/src/main/resources/mybatis/mapper/ShippingDao.xml

@@ -18,6 +18,15 @@
 		where id = #{id}
 	</select>
 
+    <select id="queryObjectByCode" resultType="com.kmall.admin.entity.ShippingEntity">
+        select
+        `id`,
+        `code`,
+        `name`
+        from mall_shipping
+        where code = #{code}
+    </select>
+
     <select id="queryList" resultType="com.kmall.admin.entity.ShippingEntity">
         select
         `id`,

+ 14 - 0
kmall-admin/src/main/webapp/WEB-INF/page/shop/order.html

@@ -76,6 +76,20 @@
                 #if($shiro.hasPermission("order:updateExpressInfo"))
                 <i-button type="info" @click="getExpressInfo">修改快递信息</i-button>
                 #end
+                #if($shiro.hasPermission("order:expressUpload"))
+                <i-col style="display: inline-grid;">
+                    <Upload :show-upload-list="false" :on-success="uploadExcelSuccess" :on-error="uploadExcelError" :on-format-error="uploadExcelFormatError"
+                            :format="['xls','xlsx']"
+                            action="../order/expressUpload">
+                        <i-button type="ghost" icon="ios-cloud-upload-outline">订单快递批量导入</i-button>
+                    </Upload>
+                </i-col>
+                #end
+                #if($shiro.hasPermission("order:down"))
+                &nbsp;&nbsp;&nbsp;&nbsp;
+                <a href="../statics/file/order_express_export_yyyy_mm_dd_v1.0.0.xls">订单快递模板下载</a>&nbsp;&nbsp;&nbsp;&nbsp;
+                <a href="../statics/file/epress_data.xls">快递公司简写数据下载</a>
+                #end
             </div>
         </Row>
         <table id="jqGrid"></table>

+ 37 - 3
kmall-admin/src/main/webapp/js/shop/order.js

@@ -271,9 +271,24 @@ let vm = new Vue({
                 return;
             }
             $.get("../order/infos/" + id, function (r) {
-                vm.order = r.order;
-                vm.showDiv = 8;
-                vm.title = "修改快递信息";
+
+                if(r.order.shippingStatus == 0){
+                    alert('该订单未发货,不能修改');
+                    return;
+                }
+                if(r.order.shippingStatus == 2){
+                    alert('该订单已收货,不能修改');
+                    return;
+                }
+                if(r.order.shippingStatus == 4){
+                    alert('该订单已退货,不能修改');
+                    return;
+                }
+                if(r.order.shippingStatus == 1){
+                    vm.order = r.order;
+                    vm.showDiv = 8;
+                    vm.title = "修改快递信息";
+                }
             });
         },
         updateExpressInfo: function (event) {
@@ -522,6 +537,25 @@ let vm = new Vue({
                     }
                 }
             });*/
+        },
+        uploadExcelSuccess: function (data) {
+            // console.log(data);
+            if(data.code==0){
+                alert('导入成功', function (index) {
+                    $("#jqGrid").trigger("reloadGrid");
+                });
+            }else{
+                alert(data.msg);
+            }
+        },
+        uploadExcelError: function () {
+            alert('上传出现异常,请重试!');
+        },
+        uploadExcelFormatError: function (file) {
+            this.$Notice.warning({
+                title: '文件格式不正确',
+                desc: '文件 ' + file.name + ' 格式不正确,请上传 xls 或 xlsx 格式的文件。'
+            });
         }
     },
     created: function () {

BIN
kmall-admin/src/main/webapp/statics/file/epress_data.xls


BIN
kmall-admin/src/main/webapp/statics/file/order_express_export_yyyy_mm_dd_v1.0.0.xls


+ 34 - 0
kmall-common/src/main/java/com/kmall/common/constant/Dict.java

@@ -1080,4 +1080,38 @@ public class Dict {
             this.itemName = itemName;
         }
     }
+
+    /**
+     * 发货状态0 未发货,1 已发货,2 已收货,4 退货
+     */
+    public enum shippingStatus {
+        item_0("0", "未发货"),
+        item_1("1", "已发货"),
+        item_2("2", "已收货"),
+        item_4("4", "退货");
+
+        private String item;
+        private String itemName;
+
+        shippingStatus(String item, String itemName) {
+            this.item = item;
+            this.itemName = itemName;
+        }
+
+        public String getItem() {
+            return item;
+        }
+
+        public void setItem(String item) {
+            this.item = item;
+        }
+
+        public String getItemName() {
+            return itemName;
+        }
+
+        public void setItemName(String itemName) {
+            this.itemName = itemName;
+        }
+    }
 }