6 kuukautta sitten
vanhempi
commit
6c0a8abe7a
19 muutettua tiedostoa jossa 528 lisäystä ja 88 poistoa
  1. 40 0
      08.src/Xingxi/xingxi-admin/src/main/java/com/xingxi/web/controller/business/order/controller/OrderDeliveryController.java
  2. 30 5
      08.src/Xingxi/xingxi-admin/src/main/java/com/xingxi/web/controller/business/order/controller/VendorOrderController.java
  3. 23 0
      08.src/Xingxi/xingxi-admin/src/main/java/com/xingxi/web/controller/business/order/domain/OrderDeliveryVo.java
  4. 2 2
      08.src/Xingxi/xingxi-admin/src/main/java/com/xingxi/web/controller/business/order/domain/OrderVo.java
  5. 2 1
      08.src/Xingxi/xingxi-admin/src/main/java/com/xingxi/web/controller/business/order/domain/VendorOrderDetailVo.java
  6. 32 0
      08.src/Xingxi/xingxi-admin/src/main/java/com/xingxi/web/controller/business/order/mapper/OrderDeliveryVoMapper.java
  7. 8 0
      08.src/Xingxi/xingxi-admin/src/main/java/com/xingxi/web/controller/business/order/mapper/OrderDetailVoMapper.java
  8. 31 0
      08.src/Xingxi/xingxi-admin/src/main/java/com/xingxi/web/controller/business/order/service/IOrderDeliveryVoService.java
  9. 8 0
      08.src/Xingxi/xingxi-admin/src/main/java/com/xingxi/web/controller/business/order/service/IOrderDetailVoService.java
  10. 52 0
      08.src/Xingxi/xingxi-admin/src/main/java/com/xingxi/web/controller/business/order/service/impl/OrderDeliveryVoServiceImpl.java
  11. 34 17
      08.src/Xingxi/xingxi-admin/src/main/java/com/xingxi/web/controller/business/order/service/impl/OrderDetailVoServiceImpl.java
  12. 23 1
      08.src/Xingxi/xingxi-admin/src/main/java/com/xingxi/web/controller/master/product/controller/ProdController.java
  13. 96 0
      08.src/Xingxi/xingxi-admin/src/main/resources/mapper/OrderDeliveryVoMapper.xml
  14. 86 11
      08.src/Xingxi/xingxi-admin/src/main/resources/mapper/OrderDetailVoMapper.xml
  15. 1 2
      08.src/Xingxi/xingxi-admin/src/main/resources/templates/business/order/order.html
  16. 57 41
      08.src/Xingxi/xingxi-admin/src/main/resources/templates/business/vendorOrder/vendorOrder.html
  17. 0 1
      08.src/Xingxi/xingxi-common/src/main/java/com/xingxi/common/enums/EOrderDeliveryStatus.java
  18. 2 6
      08.src/Xingxi/xingxi-system/src/main/java/com/xingxi/business/Order/domain/OrderDetail.java
  19. 1 1
      08.src/Xingxi/xingxi-system/src/main/resources/mapper/business/OrderDeliveryMapper.xml

+ 40 - 0
08.src/Xingxi/xingxi-admin/src/main/java/com/xingxi/web/controller/business/order/controller/OrderDeliveryController.java

@@ -0,0 +1,40 @@
+package com.xingxi.web.controller.business.order.controller;
+
+import com.xingxi.common.core.controller.BaseController;
+import com.xingxi.common.core.domain.AjaxResult;
+import com.xingxi.common.enums.EDelFlag;
+import com.xingxi.web.controller.business.order.domain.OrderDeliveryVo;
+import com.xingxi.web.controller.business.order.service.IOrderDeliveryVoService;
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+import javax.annotation.Resource;
+import java.util.List;
+
+/**
+ * 订单 操作处理
+ *
+ * @author hocy
+ * @date 2020-01-17
+ */
+@Controller
+@RequestMapping("/business/orderDelivery")
+public class OrderDeliveryController extends BaseController {
+    @Resource
+    private IOrderDeliveryVoService orderDeliveryVoService;
+
+    /**
+     * 查询订单 列表
+     */
+    @RequiresPermissions("business:orderDelivery:view")
+    @PostMapping("/showOrderDelivery")
+    @ResponseBody
+    public AjaxResult showOrderDelivery(OrderDeliveryVo orderDeliveryVo) {
+        orderDeliveryVo.setDelFlag(EDelFlag.NO.getVal());
+        List<OrderDeliveryVo> list = orderDeliveryVoService.selectOrderDeliveryVoList(orderDeliveryVo);
+        return AjaxResult.success(list);
+    }
+}

+ 30 - 5
08.src/Xingxi/xingxi-admin/src/main/java/com/xingxi/web/controller/business/order/controller/VendorOrderController.java

@@ -2,13 +2,14 @@ package com.xingxi.web.controller.business.order.controller;
 
 import com.xingxi.business.Order.domain.OrderDeliveryExpr;
 import com.xingxi.business.Order.service.IOrderDeliveryExprService;
-import com.xingxi.business.Order.service.IOrderDeliveryService;
 import com.xingxi.common.annotation.Log;
 import com.xingxi.common.core.controller.BaseController;
 import com.xingxi.common.core.domain.AjaxResult;
 import com.xingxi.common.core.page.TableDataInfo;
+import com.xingxi.common.core.text.Convert;
 import com.xingxi.common.enums.BusinessType;
 import com.xingxi.common.enums.EDelFlag;
+import com.xingxi.common.enums.EOrderDeliveryStatus;
 import com.xingxi.common.enums.ERoleKey;
 import com.xingxi.common.utils.ShiroUtils;
 import com.xingxi.common.utils.poi.ExcelUtil;
@@ -16,6 +17,7 @@ import com.xingxi.web.controller.business.order.domain.OrderDetailVo;
 import com.xingxi.web.controller.business.order.domain.OrderVo;
 import com.xingxi.web.controller.business.order.domain.VendorOrderDetailVo;
 import com.xingxi.web.controller.business.order.service.IOrderDeliveryExprVoService;
+import com.xingxi.web.controller.business.order.service.IOrderDeliveryVoService;
 import com.xingxi.web.controller.business.order.service.IOrderDetailVoService;
 import com.xingxi.web.controller.business.order.service.IOrderVoService;
 import org.apache.shiro.authz.annotation.RequiresPermissions;
@@ -26,6 +28,7 @@ import org.springframework.web.multipart.MultipartFile;
 
 import javax.annotation.Resource;
 import java.util.List;
+import java.util.Map;
 
 /**
  * 订单 操作处理
@@ -43,7 +46,7 @@ public class VendorOrderController extends BaseController {
     @Resource
     private IOrderDetailVoService orderDetailVoService;
     @Resource
-    private IOrderDeliveryService orderDeliveryService;
+    private IOrderDeliveryVoService orderDeliveryVoService;
     @Resource
     private IOrderDeliveryExprService orderDeliveryExprService;
     @Resource
@@ -68,6 +71,28 @@ public class VendorOrderController extends BaseController {
         }
         orderVo.setDelFlag(EDelFlag.NO.getVal());
         List<VendorOrderDetailVo> list = orderDetailVoService.selectVendorOrderVoList(orderVo);
+        if (list.size() > 0) {
+            StringBuilder sb = new StringBuilder();
+            for (VendorOrderDetailVo vendorOrderDetailVo: list) {
+                if (sb.toString().length() == 0) {
+                    sb.append(vendorOrderDetailVo.getOrderDetailId());
+                } else {
+                    sb.append(",").append(vendorOrderDetailVo.getOrderDetailId());
+                }
+            }
+            Map<Long, String> deliveryPending = orderDeliveryVoService.selectDeliveryByOrderDetailId(Convert.toStrArray(sb.toString()), EOrderDeliveryStatus.PENDING.getVal());
+            Map<Long, String> deliveryDelivered = orderDeliveryVoService.selectDeliveryByOrderDetailId(Convert.toStrArray(sb.toString()), EOrderDeliveryStatus.DELIVERED.getVal());
+            Map<Long, String> deliveryReceived = orderDeliveryVoService.selectDeliveryByOrderDetailId(Convert.toStrArray(sb.toString()), EOrderDeliveryStatus.RECEIVED.getVal());
+            for (VendorOrderDetailVo vendorOrderDetailVo: list) {
+                if (deliveryPending.containsKey(vendorOrderDetailVo.getOrderDetailId())) {
+                    vendorOrderDetailVo.setOrderDeliveryStatus(deliveryPending.get(vendorOrderDetailVo.getOrderDetailId()));
+                } else if (deliveryDelivered.containsKey(vendorOrderDetailVo.getOrderDetailId())) {
+                    vendorOrderDetailVo.setOrderDeliveryStatus(deliveryDelivered.get(vendorOrderDetailVo.getOrderDetailId()));
+                } else if (deliveryReceived.containsKey(vendorOrderDetailVo.getOrderDetailId())) {
+                    vendorOrderDetailVo.setOrderDeliveryStatus(deliveryReceived.get(vendorOrderDetailVo.getOrderDetailId()));
+                }
+            }
+        }
         return getDataTable(list);
     }
 
@@ -163,9 +188,9 @@ public class VendorOrderController extends BaseController {
             orderVo.setSellerId(ShiroUtils.getUserId());
         }
         orderVo.setDelFlag(EDelFlag.NO.getVal());
-        List<VendorOrderDetailVo> list = orderDetailVoService.selectVendorOrderVoList(orderVo);
+        List<VendorOrderDetailVo> list = orderDetailVoService.exportVendorOrderVoList(orderVo);
         ExcelUtil<VendorOrderDetailVo> util = new ExcelUtil<>(VendorOrderDetailVo.class);
-        return util.exportExcel(list, "发货订单详细");
+        return util.exportExcel(list, "拣货单");
     }
 
     /**
@@ -173,7 +198,7 @@ public class VendorOrderController extends BaseController {
      */
     @PostMapping("/importData")
     @ResponseBody
-    public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception {
+    public AjaxResult importData(MultipartFile file) throws Exception {
         ExcelUtil<VendorOrderDetailVo> util = new ExcelUtil<>(VendorOrderDetailVo.class);
         List<VendorOrderDetailVo> updateDataList = util.importExcel(file.getInputStream());
         String message = orderDetailVoService.importVendorOrderDetailList(updateDataList);

+ 23 - 0
08.src/Xingxi/xingxi-admin/src/main/java/com/xingxi/web/controller/business/order/domain/OrderDeliveryVo.java

@@ -0,0 +1,23 @@
+package com.xingxi.web.controller.business.order.domain;
+
+import com.xingxi.business.Order.domain.OrderDelivery;
+import lombok.Data;
+import lombok.ToString;
+
+/**
+ * 订单 表 t_order
+ *
+ * @author xingxi
+ * @date 2025-05-20
+ */
+@Data
+@ToString(callSuper = true)
+public class OrderDeliveryVo extends OrderDelivery {
+    private static final long serialVersionUID = 1L;
+    // 快递单号
+    private String expressNo;
+    // 发货时间
+    private String deliveryTime;
+    // 确认收货时间
+    private String confirmTime;
+}

+ 2 - 2
08.src/Xingxi/xingxi-admin/src/main/java/com/xingxi/web/controller/business/order/domain/OrderVo.java

@@ -27,6 +27,6 @@ public class OrderVo extends Order {
     // 快递单号
     private String expressNo;
     // 选中的发单ID
-    private String selectedOrderDeliveryIds;
-    private String[] orderDeliveryIds;
+    private String selectedOrderDetailIds;
+    private String[] orderDetailIds;
 }

+ 2 - 1
08.src/Xingxi/xingxi-admin/src/main/java/com/xingxi/web/controller/business/order/domain/VendorOrderDetailVo.java

@@ -46,6 +46,7 @@ public class VendorOrderDetailVo extends OrderDetail {
     // 商品分类名称
     private String className;
     // 快递单号
+    @Excel(name = "发单编号")
     private Long orderDeliveryId;
     // 发货时间
     private Date deliveryTime;
@@ -53,6 +54,6 @@ public class VendorOrderDetailVo extends OrderDetail {
     private Date confirmTime;
     // 发货单状态
     private String orderDeliveryStatus;
-    @Excel(name = "快递单号")
+    @Excel(name = "快递单号", cellType=Excel.ColumnType.STRING)
     private String expressNo;
 }

+ 32 - 0
08.src/Xingxi/xingxi-admin/src/main/java/com/xingxi/web/controller/business/order/mapper/OrderDeliveryVoMapper.java

@@ -0,0 +1,32 @@
+package com.xingxi.web.controller.business.order.mapper;
+
+import com.xingxi.business.Order.domain.OrderDelivery;
+import com.xingxi.web.controller.business.order.domain.OrderDeliveryVo;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * 订单商品快递明细Mapper接口
+ *
+ * @author xingxi
+ * @date 2025-03-06
+ */
+public interface OrderDeliveryVoMapper {
+    /**
+     * 查询订单明细发货状态
+     *
+     * @param orderDetailIds 订单明细编号集合
+     * @param deliveryStatus 发货状态
+     * @return 更新行数
+     */
+    List<OrderDelivery> selectDeliveryByOrderDetailId(@Param("orderDetailIds") String[] orderDetailIds, @Param("deliveryStatus") String deliveryStatus);
+
+    /**
+     * 查询发货单明细Vo
+     *
+     * @param orderDeliveryVo 发货单明细Vo 对象
+     * @return 发货单明细Vo集合
+     */
+    List<OrderDeliveryVo> selectOrderDeliveryVoList(OrderDeliveryVo orderDeliveryVo);
+}

+ 8 - 0
08.src/Xingxi/xingxi-admin/src/main/java/com/xingxi/web/controller/business/order/mapper/OrderDetailVoMapper.java

@@ -38,4 +38,12 @@ public interface OrderDetailVoMapper {
      * @return 订单详细Vo 集合
      */
     List<VendorOrderDetailVo> selectVendorOrderVoList(OrderVo orderVo);
+
+    /**
+     * 导出订单详细Vo 列表
+     *
+     * @param orderVo 订单Vo
+     * @return 订单详细Vo 集合
+     */
+    List<VendorOrderDetailVo> exportVendorOrderVoList(OrderVo orderVo);
 }

+ 31 - 0
08.src/Xingxi/xingxi-admin/src/main/java/com/xingxi/web/controller/business/order/service/IOrderDeliveryVoService.java

@@ -0,0 +1,31 @@
+package com.xingxi.web.controller.business.order.service;
+
+import com.xingxi.web.controller.business.order.domain.OrderDeliveryVo;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 发货单明细Service接口
+ *
+ * @author xingxi
+ * @date 2025-03-06
+ */
+public interface IOrderDeliveryVoService {
+    /**
+     * 查询订单明细发货状态
+     *
+     * @param orderDetails 订单明细编号集合
+     * @param deliveryStatus 发货状态
+     * @return 更新行数
+     */
+    Map<Long, String> selectDeliveryByOrderDetailId(String[] orderDetails, String deliveryStatus);
+
+    /**
+     * 查询发货单明细Vo
+     *
+     * @param orderDeliveryVo 发货单明细Vo 对象
+     * @return 发货单明细Vo集合
+     */
+    List<OrderDeliveryVo> selectOrderDeliveryVoList(OrderDeliveryVo orderDeliveryVo);
+}

+ 8 - 0
08.src/Xingxi/xingxi-admin/src/main/java/com/xingxi/web/controller/business/order/service/IOrderDetailVoService.java

@@ -38,6 +38,14 @@ public interface IOrderDetailVoService {
     List<VendorOrderDetailVo> selectVendorOrderVoList(OrderVo orderVo);
 
     /**
+     * 导出供应商发货用订单明细
+     *
+     * @param orderVo 订单Vo
+     * @return 发货单Vo 集合
+     */
+    List<VendorOrderDetailVo> exportVendorOrderVoList(OrderVo orderVo);
+
+    /**
      * 导入发货单明细
      *
      * @param vendorOrderDetailVoList 发货单明细VO列表

+ 52 - 0
08.src/Xingxi/xingxi-admin/src/main/java/com/xingxi/web/controller/business/order/service/impl/OrderDeliveryVoServiceImpl.java

@@ -0,0 +1,52 @@
+package com.xingxi.web.controller.business.order.service.impl;
+
+import com.xingxi.business.Order.domain.OrderDelivery;
+import com.xingxi.web.controller.business.order.domain.OrderDeliveryVo;
+import com.xingxi.web.controller.business.order.mapper.OrderDeliveryVoMapper;
+import com.xingxi.web.controller.business.order.service.IOrderDeliveryVoService;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 发货单明细Service业务层处理
+ *
+ * @author xingxi
+ * @date 2025-03-06
+ */
+@Service
+public class OrderDeliveryVoServiceImpl implements IOrderDeliveryVoService {
+    @Resource
+    private OrderDeliveryVoMapper orderDeliveryVoMapper;
+
+    /**
+     * 查询订单明细发货状态
+     *
+     * @param orderDetails 订单明细编号集合
+     * @param deliveryStatus 发货状态
+     * @return 检索结果
+     */
+    @Override
+    public Map<Long, String> selectDeliveryByOrderDetailId(String[] orderDetails, String deliveryStatus) {
+        List<OrderDelivery> resultList = orderDeliveryVoMapper.selectDeliveryByOrderDetailId(orderDetails, deliveryStatus);
+        Map<Long, String> resultMap = new HashMap<>();
+        for (OrderDelivery orderDelivery : resultList) {
+            resultMap.put(orderDelivery.getOrderDetailId(), orderDelivery.getOrderDeliveryStatus());
+        }
+        return resultMap;
+    }
+
+    /**
+     * 查询发货单明细Vo
+     *
+     * @param orderDeliveryVo 发货单明细Vo 对象
+     * @return 发货单明细Vo集合
+     */
+    @Override
+    public List<OrderDeliveryVo> selectOrderDeliveryVoList(OrderDeliveryVo orderDeliveryVo) {
+        return orderDeliveryVoMapper.selectOrderDeliveryVoList(orderDeliveryVo);
+    }
+}

+ 34 - 17
08.src/Xingxi/xingxi-admin/src/main/java/com/xingxi/web/controller/business/order/service/impl/OrderDetailVoServiceImpl.java

@@ -6,6 +6,7 @@ import com.xingxi.business.Order.mapper.OrderDeliveryExprMapper;
 import com.xingxi.business.Order.mapper.OrderDeliveryMapper;
 import com.xingxi.common.core.text.Convert;
 import com.xingxi.common.enums.EDelFlag;
+import com.xingxi.common.enums.EOrderDeliveryStatus;
 import com.xingxi.common.exception.BusinessException;
 import com.xingxi.common.utils.DateUtils;
 import com.xingxi.common.utils.ShiroUtils;
@@ -70,11 +71,22 @@ public class OrderDetailVoServiceImpl implements IOrderDetailVoService {
      */
     @Override
     public List<VendorOrderDetailVo> selectVendorOrderVoList(OrderVo orderVo) {
-        orderVo.setOrderDeliveryIds(Convert.toStrArray(orderVo.getSelectedOrderDeliveryIds()));
         return orderDetailVoMapper.selectVendorOrderVoList(orderVo);
     }
 
     /**
+     * 导出供应商发货用订单明细
+     *
+     * @param orderVo 订单Vo
+     * @return 发货单Vo 集合
+     */
+    @Override
+    public List<VendorOrderDetailVo> exportVendorOrderVoList(OrderVo orderVo) {
+        orderVo.setOrderDetailIds(Convert.toStrArray(orderVo.getSelectedOrderDetailIds()));
+        return orderDetailVoMapper.exportVendorOrderVoList(orderVo);
+    }
+
+    /**
      * 导入发货单明细
      *
      * @param vendorOrderDetailVoList 发货单明细VO列表
@@ -96,28 +108,33 @@ public class OrderDetailVoServiceImpl implements IOrderDetailVoService {
                 // 验证数据存在
                 OrderDelivery checkObject = orderDeliveryMapper.selectOrderDeliveryByOrderDeliveryId(vendorOrderDetailVo.getOrderDeliveryId());
                 if (checkObject != null) {
-                    orderDeliveryExprVoMapper.deleteOrderDeliveryExprByOrderDeliveryId(vendorOrderDetailVo.getOrderDeliveryId());
-                    String[] expressNos = Convert.toStrArray(vendorOrderDetailVo.getExpressNo());
-                    for (String expressNo : expressNos) {
-                        OrderDeliveryExpr orderDeliveryExpr = new OrderDeliveryExpr();
-                        orderDeliveryExpr.setOrderDetailId(checkObject.getOrderDetailId());
-                        orderDeliveryExpr.setOrderDeliveryId(checkObject.getOrderDeliveryId());
-                        orderDeliveryExpr.setExpressNo(expressNo);
-                        orderDeliveryExpr.setDelFlag(EDelFlag.NO.getVal());
-                        orderDeliveryExpr.setDeliveryTime(nowDate);
-                        orderDeliveryExpr.setUpdateUser(ShiroUtils.getLoginName());
-                        orderDeliveryExpr.setUpdateTime(nowDate);
-                        orderDeliveryExprMapper.insertOrderDeliveryExpr(orderDeliveryExpr);
+                    if (EOrderDeliveryStatus.RECEIVED.getVal().equals(checkObject.getOrderDeliveryStatus())) {
+                        failureNum++;
+                        failureMsg.append("<br/>" + failureNum + "、发货单编号 " + vendorOrderDetailVo.getOrderDeliveryId() + " 已发货,不能导入。");
+                    } else {
+                        orderDeliveryExprVoMapper.deleteOrderDeliveryExprByOrderDeliveryId(vendorOrderDetailVo.getOrderDeliveryId());
+                        String[] expressNos = Convert.toStrArray(vendorOrderDetailVo.getExpressNo());
+                        for (String expressNo : expressNos) {
+                            OrderDeliveryExpr orderDeliveryExpr = new OrderDeliveryExpr();
+                            orderDeliveryExpr.setOrderDetailId(checkObject.getOrderDetailId());
+                            orderDeliveryExpr.setOrderDeliveryId(checkObject.getOrderDeliveryId());
+                            orderDeliveryExpr.setExpressNo(expressNo);
+                            orderDeliveryExpr.setDelFlag(EDelFlag.NO.getVal());
+                            orderDeliveryExpr.setDeliveryTime(nowDate);
+                            orderDeliveryExpr.setUpdateUser(ShiroUtils.getLoginName());
+                            orderDeliveryExpr.setUpdateTime(nowDate);
+                            orderDeliveryExprMapper.insertOrderDeliveryExpr(orderDeliveryExpr);
+                        }
+                        successNum++;
+                        successMsg.append("<br/>" + successNum + "、发货单编号 " + vendorOrderDetailVo.getOrderDeliveryId() + " 导入成功");
                     }
-                    successNum++;
-                    successMsg.append("<br/>" + successNum + "、发货单明细编号 " + vendorOrderDetailVo.getOrderDeliveryId() + " 导入成功");
                 } else {
                     failureNum++;
-                    failureMsg.append("<br/>" + failureNum + "、发货单明细编号 " + vendorOrderDetailVo.getOrderDeliveryId() + " 已存在");
+                    failureMsg.append("<br/>" + failureNum + "、发货单编号 " + vendorOrderDetailVo.getOrderDeliveryId() + " 已存在");
                 }
             } catch (Exception e) {
                 failureNum++;
-                String msg = "<br/>" + failureNum + "、发货单明细编号 " + vendorOrderDetailVo.getOrderDeliveryId() + " 导入失败:";
+                String msg = "<br/>" + failureNum + "、发货单编号 " + vendorOrderDetailVo.getOrderDeliveryId() + " 导入失败:";
                 failureMsg.append(msg + e.getMessage());
             }
         }

+ 23 - 1
08.src/Xingxi/xingxi-admin/src/main/java/com/xingxi/web/controller/master/product/controller/ProdController.java

@@ -6,9 +6,13 @@ import com.xingxi.common.core.domain.AjaxResult;
 import com.xingxi.common.core.page.TableDataInfo;
 import com.xingxi.common.enums.BusinessType;
 import com.xingxi.common.enums.EProdStatus;
+import com.xingxi.common.exception.BusinessException;
 import com.xingxi.common.utils.poi.ExcelUtil;
 import com.xingxi.master.product.domain.Prod;
+import com.xingxi.web.controller.master.product.domain.ProdAttrPriceVo;
+import com.xingxi.web.controller.master.product.domain.ProdAttrVo;
 import com.xingxi.web.controller.master.product.domain.ProdVo;
+import com.xingxi.web.controller.master.product.service.IProdAttrPriceVoService;
 import com.xingxi.web.controller.master.product.service.IProdAttrVoService;
 import com.xingxi.web.controller.master.product.service.IProdVoService;
 import org.apache.shiro.authz.annotation.RequiresPermissions;
@@ -32,6 +36,10 @@ public class ProdController extends BaseController {
 
     @Resource
     private IProdVoService prodVoService;
+    @Resource
+    private IProdAttrVoService prodAttrVoService;
+    @Resource
+    private IProdAttrPriceVoService prodAttrPriceVoService;
 
     @RequiresPermissions("master:product:view")
     @GetMapping()
@@ -123,7 +131,21 @@ public class ProdController extends BaseController {
     @RequiresPermissions("master:product:approve")
     @PostMapping("/submitt")
     @ResponseBody
-    public AjaxResult submitt(Prod prod) {
+    public AjaxResult submitProd(Prod prod) {
+        ProdAttrVo cond = new ProdAttrVo();
+        cond.setProdId(prod.getId());
+        List<ProdAttrVo> checkList = prodAttrVoService.selectProdAttrVoList(cond);
+        if (checkList.size() < 1) {
+            throw new BusinessException("商品的属性未配置,请配置后再提交!");
+        }
+        for (ProdAttrVo prodAttr : checkList) {
+            ProdAttrPriceVo attrPriceCond = new ProdAttrPriceVo();
+            attrPriceCond.setProdId(prodAttr.getProdId());
+            attrPriceCond.setProdAttrId(prodAttr.getProdAttrId());
+            if (prodAttrPriceVoService.selectProdAttrPriceVo(attrPriceCond) == null) {
+                throw new BusinessException("商品的价格未配置,请配置后再提交!");
+            }
+        }
         prod.setProdStatus(EProdStatus.SUBMITTED.getVal());
         return toAjax(prodVoService.updateProd(prod));
     }

+ 96 - 0
08.src/Xingxi/xingxi-admin/src/main/resources/mapper/OrderDeliveryVoMapper.xml

@@ -0,0 +1,96 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.xingxi.web.controller.business.order.mapper.OrderDeliveryVoMapper">
+    <resultMap type="OrderDelivery" id="OrderDeliveryResult">
+        <result property="orderDeliveryId"      column="orderDeliveryId"        />
+        <result property="orderId"              column="orderId"                />
+        <result property="orderDetailId"        column="orderDetailId"          />
+        <result property="orderDeliveryStatus"  column="orderDeliveryStatus"    />
+        <result property="prodId"               column="prodId"                 />
+        <result property="prodName"             column="prodName"               />
+        <result property="prodAttrId"           column="prodAttrId"             />
+        <result property="prodAttrName"         column="prodAttrName"           />
+        <result property="vendorId"             column="vendorId"               />
+        <result property="quantity"             column="quantity"               />
+        <result property="delFlag"              column="delFlag"                />
+        <result property="createUser"           column="createUser"             />
+        <result property="createTime"           column="createTime"             />
+        <result property="updateUser"           column="updateUser"             />
+        <result property="updateTime"           column="updateTime"             />
+    </resultMap>
+
+    <resultMap type="OrderDeliveryVo" id="OrderDeliveryVoResult">
+        <result property="orderDeliveryId"      column="orderDeliveryId"        />
+        <result property="orderId"              column="orderId"                />
+        <result property="orderDetailId"        column="orderDetailId"          />
+        <result property="orderDeliveryStatus"  column="orderDeliveryStatus"    />
+        <result property="prodId"               column="prodId"                 />
+        <result property="prodName"             column="prodName"               />
+        <result property="prodAttrId"           column="prodAttrId"             />
+        <result property="prodAttrName"         column="prodAttrName"           />
+        <result property="vendorId"             column="vendorId"               />
+        <result property="quantity"             column="quantity"               />
+        <result property="delFlag"              column="delFlag"                />
+        <result property="createUser"           column="createUser"             />
+        <result property="createTime"           column="createTime"             />
+        <result property="updateUser"           column="updateUser"             />
+        <result property="updateTime"           column="updateTime"             />
+        <result property="expressNo"            column="expressNo"              />
+        <result property="deliveryTime"         column="deliveryTime"           />
+        <result property="confirmTime"          column="confirmTime"            />
+    </resultMap>
+
+    <select id="selectDeliveryByOrderDetailId" resultMap="OrderDeliveryResult">
+        select t_order_delivery.orderDeliveryId
+             , t_order_delivery.orderId
+             , t_order_delivery.orderDetailId
+             , t_order_delivery.orderDeliveryStatus
+             , t_order_delivery.prodId
+             , t_order_delivery.prodName
+             , t_order_delivery.prodAttrId
+             , t_order_delivery.prodAttrName
+             , t_order_delivery.vendorId
+             , t_order_delivery.quantity
+             , t_order_delivery.delFlag
+             , t_order_delivery.createUser
+             , t_order_delivery.createTime
+             , t_order_delivery.updateTime
+        from t_order_delivery
+        where exists(
+            select 1
+            from t_order_delivery status
+            where status.orderDetailId = t_order_delivery.orderDetailId
+            <if test="deliveryStatus != null and deliveryStatus != '' ">
+               and status.orderDeliveryStatus = #{deliveryStatus}
+            </if>
+        )
+        and t_order_delivery.orderDetailId in
+        <foreach collection="orderDetailIds" item="orderDetailId" open="(" separator="," close=")">
+            #{orderDetailId}
+        </foreach>
+    </select>
+
+    <select id="selectOrderDeliveryVoList" resultMap="OrderDeliveryVoResult">
+        select t_order_delivery.orderDeliveryId
+        , t_order_delivery.orderId
+        , t_order_delivery.orderDetailId
+        , t_order_delivery.orderDeliveryStatus
+        , t_order_delivery.prodId
+        , t_order_delivery.prodName
+        , t_order_delivery.prodAttrId
+        , t_order_delivery.prodAttrName
+        , t_order_delivery.vendorId
+        , t_order_delivery.quantity
+        , t_order_delivery.delFlag
+        , t_order_delivery.createUser
+        , t_order_delivery.createTime
+        , t_order_delivery.updateTime
+        , ifNull(t_order_delivery_expr.expressNo, '') as expressNo
+        , ifNull(t_order_delivery_expr.deliveryTime, '') as deliveryTime
+        , ifNull(t_order_delivery_expr.confirmTime, '') as confirmTime
+        from t_order_delivery
+        inner join t_order_delivery_expr on t_order_delivery_expr.orderDetailId = t_order_delivery.orderDetailId
+        and t_order_delivery_expr.orderDeliveryId = t_order_delivery.orderDeliveryId
+        where t_order_delivery.orderDetailId = #{orderDetailId}
+    </select>
+</mapper>

+ 86 - 11
08.src/Xingxi/xingxi-admin/src/main/resources/mapper/OrderDetailVoMapper.xml

@@ -129,6 +129,10 @@
              , t_order.remark
              , t_order_detail.orderDetailId
              , t_order_detail.orderDetailStatus
+             , t_order_detail.prodId
+             , t_order_detail.prodName
+             , t_order_detail.prodAttrId
+             , t_order_detail.prodAttrName
              , t_order_detail.vendorId
              , t_order_detail.quantity
              , t_order_detail.afterSalesQty
@@ -138,12 +142,6 @@
              , t_order_detail.payAmount
              , t_order_detail.confirmTime
              , t_order_detail.finishTime
-             , t_order_delivery.orderDeliveryId
-             , t_order_delivery.orderDeliveryStatus
-             , t_order_delivery.prodId
-             , t_order_delivery.prodName
-             , t_order_delivery.prodAttrId
-             , t_order_delivery.prodAttrName
              , m_merchant.mercName as sellerName
              , m_merchant.mobile as sellerMobile
              , sys_user.user_name as buyerName
@@ -156,8 +154,85 @@
                                           and m_merchant_prod.prodAttrId = t_order_detail.prodAttrId
         inner join m_prod on m_prod.id = t_order_detail.prodId
         inner join m_prod_class on m_prod_class.prodClassId = m_prod.prodClassId
+        <where>
+            <if test="orderId != null "> and t_order.orderId = #{orderId}</if>
+            <if test="orderNo != null and orderNo != ''"> and t_order.orderNo like concat('%', #{orderNo}, '%')</if>
+            <if test="orderDetailStatus != null and orderDetailStatus != ''"> and t_order_detail.orderDetailStatus = #{orderDetailStatus}</if>
+            <if test="recProv != null and recProv != ''"> and t_order.recProv like concat('%', #{recProv}, '%')</if>
+            <if test="recCity != null and recCity != ''"> and t_order.recCity like concat('%', #{recCity}, '%')</if>
+            <if test="recDistrict != null and recDistrict != ''"> and t_order.recDistrict like concat('%', #{recDistrict}, '%')</if>
+            <if test="recName != null and recName != ''"> and t_order.recName like concat('%', #{recName}, '%')</if>
+            <if test="recMobile != null and recMobile != ''"> and t_order.recMobile like concat('%', #{recMobile}, '%')</if>
+            <if test="params.orderTimeFrom != null and params.orderTimeFrom != ''"><!-- 开始时间检索 -->
+                and date_format(t_order.orderTime,'%y%m%d') &gt;= date_format(#{params.orderTimeFrom},'%y%m%d')
+            </if>
+            <if test="params.orderTimeTo != null and params.orderTimeTo != ''"><!-- 结束时间检索 -->
+                and date_format(t_order.orderTime,'%y%m%d') &lt;= date_format(#{params.orderTimeTo},'%y%m%d')
+            </if>
+            <if test="params.cancelTimeFrom != null and params.cancelTimeFrom != ''"><!-- 开始时间检索 -->
+                and date_format(t_order.cancelTime,'%y%m%d') &gt;= date_format(#{params.cancelTimeFrom},'%y%m%d')
+            </if>
+            <if test="params.cancelTimeTo != null and params.cancelTimeTo != ''"><!-- 结束时间检索 -->
+                and date_format(t_order.cancelTime,'%y%m%d') &lt;= date_format(#{params.cancelTimeTo},'%y%m%d')
+            </if>
+            <if test="buyerName != null and buyerName != ''"> and sys_user.user_name like concat('%', #{buyerName}, '%')</if>
+            <if test="sellerName != null and sellerName != ''"> and m_merchant.mercName like concat('%', #{sellerName}, '%')</if>
+            <if test="prodName != null and prodName != '' "> and t_order_delivery.prodName like concat('%', #{prodName}, '%')</if>
+            <if test="expressNo != null and expressNo != '' ">
+                and exists(select t_order_detail.orderDetailid from t_order_detail
+                inner join t_order_delivery on t_order_delivery.orderDetailId = t_order_detail.orderDetailId and t_order_delivery.orderId = t_order_detail.orderId
+                inner join t_order_delivery_expr on t_order_delivery_expr.orderDetailId = t_order_detail.orderDetailId and t_order_delivery_expr.orderDeliveryId = t_order_delivery.orderDeliveryId
+                where t_order.orderid = t_order_detail.orderid
+                and t_order_delivery_expr.expressNo like concat('%', #{expressNo}, '%')
+                )
+            </if>
+            and t_order.delFlag = '0'
+        </where>
+        order by t_order.orderTime, t_order.orderId, t_order_detail.orderDetailId
+    </select>
+
+    <select id="exportVendorOrderVoList" parameterType="OrderVo" resultMap="VendorOrderDetailVoResult">
+        select t_order.orderId
+        , t_order.orderNo
+        , t_order.orderTime
+        , t_order.recProv
+        , t_order.recCity
+        , t_order.recDistrict
+        , t_order.recAddress
+        , t_order.recName
+        , t_order.recMobile
+        , t_order.remark
+        , t_order_detail.orderDetailId
+        , t_order_detail.orderDetailStatus
+        , t_order_detail.prodId
+        , t_order_detail.prodName
+        , t_order_detail.vendorId
+        , t_order_detail.quantity
+        , t_order_detail.afterSalesQty
+        , t_order_detail.refundQty
+        , t_order_detail.price
+        , t_order_detail.orderAmount
+        , t_order_detail.payAmount
+        , t_order_detail.confirmTime
+        , t_order_detail.finishTime
+        , t_order_delivery.orderDeliveryId
+        , t_order_delivery.orderDeliveryStatus
+        , t_order_delivery.prodAttrId
+        , t_order_delivery.prodAttrName
+        , m_merchant.mercName as sellerName
+        , m_merchant.mobile as sellerMobile
+        , sys_user.user_name as buyerName
+        , m_prod_class.className as className
+        from t_order
+        inner join m_merchant on m_merchant.mercId = t_order.sellerId
+        inner join sys_user on sys_user.user_id = t_order.buyerId
+        inner join t_order_detail on t_order_detail.orderId = t_order.orderId and t_order_detail.delFlag = '0'
+        inner join m_merchant_prod on m_merchant_prod.mercId = t_order.sellerId and m_merchant_prod.prodId = t_order_detail.prodId
+        and m_merchant_prod.prodAttrId = t_order_detail.prodAttrId
+        inner join m_prod on m_prod.id = t_order_detail.prodId
+        inner join m_prod_class on m_prod_class.prodClassId = m_prod.prodClassId
         inner join t_order_delivery on t_order_delivery.orderDetailId = t_order_detail.orderDetailId and t_order_delivery.orderId = t_order_delivery.orderId
-                                          and t_order_delivery.delFlag = '0'
+        and t_order_delivery.delFlag = '0'
         <where>
             <if test="orderId != null "> and t_order.orderId = #{orderId}</if>
             <if test="orderNo != null and orderNo != ''"> and t_order.orderNo like concat('%', #{orderNo}, '%')</if>
@@ -190,10 +265,10 @@
                 and t_order_delivery_expr.expressNo like concat('%', #{expressNo}, '%')
                 )
             </if>
-            <if test="selectedOrderDeliveryIds != null and selectedOrderDeliveryIds != '' ">
-                and t_order_delivery.orderDeliveryId in
-                <foreach collection="orderDeliveryIds" item="deliveryId" open="(" separator="," close=")">
-                    #{deliveryId}
+            <if test="selectedOrderDetailIds != null and selectedOrderDetailIds != '' ">
+                and t_order_delivery.orderDetailId in
+                <foreach collection="orderDetailIds" item="orderDetailId" open="(" separator="," close=")">
+                    #{orderDetailId}
                 </foreach>
             </if>
             and t_order.delFlag = '0'

+ 1 - 2
08.src/Xingxi/xingxi-admin/src/main/resources/templates/business/order/order.html

@@ -80,7 +80,6 @@
 	<script th:src="@{/ruoyi/js/currency.js}"></script>
 	<th:block th:include="include :: footer" />
     <script th:inline="javascript">
-		var editFlag = [[${@permission.hasPermi('platform:order:edit')}]];
         var prefix = ctx + "business/order";
         var datas = [[${@dict.getType('order_status')}]];
 
@@ -185,6 +184,6 @@
 			};
 			$.table.init(options);
 		});
-    </script>
+	</script>
 </body>
 </html>

+ 57 - 41
08.src/Xingxi/xingxi-admin/src/main/resources/templates/business/vendorOrder/vendorOrder.html

@@ -61,20 +61,17 @@
 					</div>
                 </form>
             </div>
-            
             <div class="btn-group-sm" id="toolbar" role="group">
-				<a class="btn btn-warning multiple" id="btnPrintPickForm" onclick="printPickForm()">
-					<i class="glyphicon glyphicon-baby-formula"></i> 打印拣货单
-				</a>
 				<a class="btn btn-info" id="btnExportOrderDetail" onclick="exportOrderDetail()">
-					<i class="glyphicon glyphicon-check"></i> 导出订单明细
+					<i class="glyphicon glyphicon-check"></i> 打印拣货单
 				</a>
-				<a class="btn btn-success" id="btnImportOrderDetail" onclick="importOrderDetail()">
+				<a class="btn btn-success" id="btnImportOrderDetail" onclick="$.table.importExcel()">
 					<i class="glyphicon glyphicon-check"></i> 导入物流单号
 				</a>
             </div>
             <div class="col-sm-12 select-table table-striped">
                 <table id="bootstrap-table" data-mobile-responsive="true"></table>
+				<input type="hidden" id="tempJSONString">
             </div>
         </div>
     </div>
@@ -100,6 +97,17 @@
 			</form>
 		</div>
 	</script>
+	<!-- 导入区域 -->
+	<script id="importTpl" type="text/template">
+		<form enctype="multipart/form-data" class="mt20 mb10">
+			<div class="col-xs-offset-1">
+				<input type="file" id="file" name="file"/>
+				<font color="red" class="pull-left mt10">
+					提示:仅允许导入“xls”或“xlsx”格式文件!
+				</font>
+			</div>
+		</form>
+	</script>
 	<script th:src="@{/js/datatimeTool.js}"></script>
 	<script th:src="@{/ruoyi/js/currency.js}"></script>
 	<th:block th:include="include :: footer" />
@@ -121,10 +129,14 @@
 				updateUrl: prefix + "/edit/{id}",
 				removeUrl: prefix + "/remove",
 				exportUrl: prefix + "/export",
-				modalName: "订单明细选择",
+				importUrl: prefix + "/importData",
+				importTemplateUrl: prefix + "/importTemplate",
+				modalName: "订单明细",
 				showSearch: false,
 				showColumns: false,
 				clickToSelect: true,
+				detailView: true,
+				detailFormatter: extendFormatter,
 				pageSize: 25,
 				columns: [
 					{
@@ -197,16 +209,6 @@
 						sortable: false
 					},
 					{
-						field : 'deliveryTime',
-						title : '发货时间',
-						sortable: false
-					},
-					{
-						field : 'confirmTime',
-						title : '确认收货时间',
-						sortable: false
-					},
-					{
 						field : 'cancelTime',
 						title : '取消时间',
 						sortable: false
@@ -233,6 +235,42 @@
 			$.table.init(options);
 		});
 
+		function extendFormatter(index, row) {
+			var url = ctx + "business/orderDelivery/showOrderDelivery";
+			var data = {
+				"orderDetailId": row.orderDetailId
+			};
+			$.ajaxSettings.async = false;
+			$.post(url, data, function(result) {
+				if (result.code === web_status.SUCCESS) {
+					$("#tempJSONString").val(JSON.stringify(result.data));
+				}
+			});
+			$.ajaxSettings.async = true;
+			var html = [];
+			var returnData = JSON.parse($("#tempJSONString").val());
+			if (returnData.length > 0) {
+				html.push('<table style="border: 1px solid black;">');
+				html.push('<colgroup>');
+				html.push('<col style="width: 200px">');
+				html.push('<col style="width: 300px">');
+				html.push('<col style="width: 300px">');
+				html.push('</colgroup>');
+				html.push('<tr>');
+				html.push('<td>快递单号</td>');
+				html.push('<td>发货时间</td>');
+				html.push('<td>确认收货时间</td>');
+				html.push('</tr><tr>');
+				returnData.forEach((orderDelivery, index) => {
+					html.push('<td>' + orderDelivery.expressNo + '</td>');
+					html.push('<td>' + orderDelivery.deliveryTime + '</td>');
+					html.push('<td>' + orderDelivery.confirmTime + '</td>');
+				});
+				html.push('</tr></table>');
+			}
+			return html.join('');
+		}
+
 		function deliverProd(orderDetailId, orderDeliveryId) {
 			var content = $('#divInputExpressNo').html();
 			layer.open({
@@ -352,10 +390,9 @@
 		}
 
 		function exportOrderDetail() {
-			$.modal.confirm("确定导出所选择的订单明细吗?", function() {
+			$.modal.confirm("确定打印所选择的发单明细吗?", function() {
 				var dataParam = $("#searchConditionForm").serializeArray();
-				dataParam.push({"name":"selectedOrderDeliveryIds", "value": $.table.selectColumns("orderDeliveryId").join()});
-				console.log(JSON.stringify(dataParam));
+				dataParam.push({"name":"selectedOrderDetailIds", "value": $.table.selectColumns("orderDetailId").join()});
 				$.post(table.options.exportUrl, dataParam, function (result) {
 					if (result.code === web_status.SUCCESS) {
 						window.location.href = ctx + "common/download?fileName=" + encodeURI(result.msg) + "&delete=" + true;
@@ -368,27 +405,6 @@
 				});
 			});
 		}
-
-		function printPickForm() {
-			var confirmMsg = "确认打印拣货单吗?";
-
-			$.modal.confirm(confirmMsg, function() {
-				var exportUrl = prefix + "/export";
-				var data = {
-					"detailIds" : $.table.selectColumns("id").join()
-				};
-				// $.post(exportUrl, data, function(result) {
-				// 	if (result.code === web_status.SUCCESS) {
-				// 		window.location.href = ctx + "common/download?fileName=" + encodeURI(result.msg) + "&delete=" + true;
-				// 	} else if (result.code === web_status.WARNING) {
-				// 		$.modal.alertWarning(result.msg)
-				// 	} else {
-				// 		$.modal.alertError(result.msg);
-				// 	}
-				// 	$.modal.closeLoading();
-				// });
-			})
-		}
     </script>
 </body>
 </html>

+ 0 - 1
08.src/Xingxi/xingxi-common/src/main/java/com/xingxi/common/enums/EOrderDeliveryStatus.java

@@ -13,7 +13,6 @@ import lombok.Getter;
 @Getter
 public enum EOrderDeliveryStatus {
     PENDING("PENDING", "未发货"),
-    PARTDELIVERED("PARTDELIVERED", "部分发货"),
     DELIVERED("DELIVERED", "已发货"),
     RECEIVED("RECEIVED", "已收货");
 

+ 2 - 6
08.src/Xingxi/xingxi-system/src/main/java/com/xingxi/business/Order/domain/OrderDetail.java

@@ -33,7 +33,6 @@ public class OrderDetail extends BaseEntity {
     private String orderDetailStatus;
 
     // 商品ID
-    @Excel(name = "商品ID")
     private Long prodId;
 
     // 商品名
@@ -41,11 +40,11 @@ public class OrderDetail extends BaseEntity {
     private String prodName;
 
     // 属性组合编号
-    @Excel(name = "属性组合编号")
+    @Excel(name = "属性编号")
     private Long prodAttrId;
 
     // 属性组合名称
-    @Excel(name = "属性组合名称")
+    @Excel(name = "属性名称")
     private String prodAttrName;
 
     // 供应商ID
@@ -62,15 +61,12 @@ public class OrderDetail extends BaseEntity {
     private Integer returnQty;
 
     // 购买单价
-    @Excel(name = "购买单价")
     private BigDecimal price;
 
     // 总金额
-    @Excel(name = "总金额")
     private BigDecimal orderAmount;
 
     // 支付金额
-    @Excel(name = "支付金额")
     private BigDecimal payAmount;
 
     // 确认收货时间

+ 1 - 1
08.src/Xingxi/xingxi-system/src/main/resources/mapper/business/OrderDeliveryMapper.xml

@@ -5,7 +5,7 @@
         <result property="orderDeliveryId"    column="orderDeliveryId"    />
         <result property="orderId"    column="orderId"    />
         <result property="orderDetailId"    column="orderDetailId"    />
-        <result property="orderDeliveryStatus"    column="orderDeliveryStatus"    />
+        <result property="orderDeliveryStatus"  column="orderDeliveryStatus"    />
         <result property="prodId"    column="prodId"    />
         <result property="prodName"    column="prodName"    />
         <result property="prodAttrId"    column="prodAttrId"    />