2
0

2 Коммитууд 3fc5f90c85 ... e263d0e885

Эзэн SHA1 Мессеж Огноо
  BKGin e263d0e885 Merge remote-tracking branch 'origin/master' 6 сар өмнө
  BKGin 69faf86f95 [add] 预约下单 6 сар өмнө

+ 2 - 3
yiqi-admin/src/main/java/com/yiqi/admin/controller/order/OrderClothController.java

@@ -350,9 +350,9 @@ public class OrderClothController extends BaseController {
         if (!ClothTakeWay.DELIVERY.getCode().equals(orderCloth.getSendClothWay())) {
             throw new ServiceException("该订单客户未选择送货上门,无法分配配送员");
         }
-        if (!ClothAppointmentStatus.WAITING_TO_SEND.getCode().equals(orderCloth.getAppointmentStatus())) {
+        if (!ClothOrderStatusType.WAITING_TO_SEND.getCode().equals(orderCloth.getOrderStatus())) {
             throw new ServiceException("当前状态为"
-                    + EnumUtils.getEnumByType(orderCloth.getAppointmentStatus(), ClothAppointmentStatus.class).getInfo()
+                    + EnumUtils.getEnumByType(orderCloth.getOrderStatus(), ClothOrderStatusType.class).getInfo()
                     + ",无法进行取衣操作");
         }
 
@@ -832,7 +832,6 @@ public class OrderClothController extends BaseController {
         orderCloth.buildUpdateData();
         orderCloth.setTakeClothAppUserId(Long.parseLong(deliveryId));
         orderCloth.setOrderStatus(ClothOrderStatusType.WAITING_TO_DOOR.getCode());
-        orderCloth.setAppointmentStatus(ClothAppointmentStatus.WAITING_TO_DOOR.getCode());
         return success(orderClothService.updateById(orderCloth));
     }
 

+ 3 - 1
yiqi-api/src/main/java/com/yiqi/api/controller/order/WeAppOrderClothController.java

@@ -174,7 +174,8 @@ public class WeAppOrderClothController {
         orderCloth.setAppUserId(AuthHolder.userId());
         orderCloth.setDelFlag(DeleteStatus.OK.getCode());
         orderCloth.setOrderStatus(ClothOrderStatusType.APPOINTMENT.getCode());
-        orderCloth.setAppointmentStatus(ClothAppointmentStatus.APPOINTMENT.getCode());
+        // 预约单
+        orderCloth.setIsAppointment(SysBoolType.YES.getCode());
         orderCloth.setOrderNo(orderNoUtils.getClothOrderNo());
         if(ClothOrderType.normal.equals(orderCloth.getOrderType())){
             SysStore sysStore = storeService.selectSysStoreById(orderClothAppointmentDTO.getOrgId());
@@ -193,6 +194,7 @@ public class WeAppOrderClothController {
         orderDelivery.setClothOrderType(ClothOrderDeliveryType.collectCloth.getCode());
         orderDelivery.setCreateTime(DateUtils.getNowDate());
         orderDelivery.setDeliveryStatus(OrderDeliveryStatusEnum.ORIGIN_STATUS.getCode());
+        orderDelivery.setDeliveryWay(ClothOrderDeliveryWay.delivery.getCode());
         orderDeliveryService.save(orderDelivery);
         return R.ok();
     }

+ 4 - 4
yiqi-common/src/main/java/com/yiqi/order/domain/OrderCloth.java

@@ -148,10 +148,10 @@ public class OrderCloth extends BaseEntity
     @ApiModelProperty("预约件数")
     private Integer appointmentCount;
 
-    /** 预约状态(1=待接单,2=待上门,3=已取物,4=待配送,5=配送中,9=已完成,100=已取消) */
-    @Excel(name = "预约状态", readConverterExp = "0=未预约,1=待接单,2=待上门,3=已取物,4=待配送,5=配送中,9=已完成,100=已取消")
-    @ApiModelProperty("预约状态(0=未预约,1=待接单,2=待上门,3=已取物,4=待配送,5=配送中,9=已完成,100=已取消)")
-    private String appointmentStatus;
+    /** 是否预约订单 */
+    @Excel(name = "是否预约订单")
+    @ApiModelProperty("是否预约订单")
+    private String isAppointment;
 
     /** 订单状态(0. 待下单  1. 已下单待送衣   2. 洗衣中   3.衣服已到店待取衣   8. 取衣完成待评价  9.已完成   100. 已取消) */
     @Excel(name = "订单状态", readConverterExp = "0=预约处理中,1=已下单待送衣,2=洗衣中,3=衣服已到店待取衣,8=取衣完成待评价,9=已完成,100=已取消")

+ 7 - 4
yiqi-common/src/main/java/com/yiqi/order/domain/vo/OrderClothAppointmentVO.java

@@ -96,10 +96,13 @@ public class OrderClothAppointmentVO {
     @ApiModelProperty("订单状态(0=预约待取,1=已取货、待门店定价,2=已定价、待支付,3=已支付、待工厂取货,4=工厂已取货、洗衣中,5=洗衣完成、待送店,6=已到店、待送衣,7=送衣中,8=已送达、待评价,9=已完成,100=已取消)")
     private String orderStatus;
 
-    /** 预约状态(1=待接单,2=待上门,3=已取物,4=待配送,5=配送中,9=已完成,100=已取消) */
-    @Excel(name = "预约状态", readConverterExp = "0=未预约,1=待接单,2=待上门,3=已取物,4=待配送,5=配送中,9=已完成,100=已取消")
-    @ApiModelProperty("预约状态(0=未预约,1=待接单,2=待上门,3=已取物,4=待配送,5=配送中,9=已完成,100=已取消)")
-    private String appointmentStatus;
+    /**
+     * 配送状态
+     * {@link com.yiqi.common.enums.OrderDeliveryStatusEnum}
+     */
+    @Excel(name = "配送状态")
+    @ApiModelProperty("配送状态")
+    private String deliveryStatus;
 
     @Excel(name = "支付状态", readConverterExp = "0==待支付,1=支付成功,2=支付失败")
     @ApiModelProperty("支付状态 0:待支付 1: 支付成功 -1:支付失败")

+ 9 - 6
yiqi-core/src/main/java/com/yiqi/order/service/impl/OrderClothServiceImpl.java

@@ -1062,7 +1062,10 @@ public class OrderClothServiceImpl extends ServiceImpl<OrderClothMapper, OrderCl
             orderAppointmentDTO2.setOrgId(SecurityUtils.getLoginUser().getOrgId());
         }
         Integer[] orderStatus = new Integer[]{0};
-        // 虚拟定单状态 1:待接单 2:取衣中 3:待支付 4:待入厂 5:清洗中 6:待上挂 7:待送衣 8:送衣中 99:已完成 100:已取消
+        /**
+         * 虚拟状态对应实际状态
+         * {@link com.yiqi.common.enums.ClothOrderStatusType}
+         */
         switch (orderAppointmentDTO2.getVirtualListStatus()) {
             case 1:
                 // 待接单
@@ -1082,23 +1085,23 @@ public class OrderClothServiceImpl extends ServiceImpl<OrderClothMapper, OrderCl
                 break;
             case 5:
                 // 清洗中
-                orderStatus = new Integer[]{6};
+                orderStatus = new Integer[]{6,7};
                 break;
             case 6:
                 // 待上挂
-                orderStatus = new Integer[]{};
+                orderStatus = new Integer[]{8};
                 break;
             case 7:
                 // 待送衣
-                orderStatus = new Integer[]{8};
+                orderStatus = new Integer[]{9};
                 break;
             case 8:
                 // 送衣中
-                orderStatus = new Integer[]{9};
+                orderStatus = new Integer[]{10};
                 break;
             case 99:
                 // 已完成
-                orderStatus = new Integer[]{10,11};
+                orderStatus = new Integer[]{11,12};
                 break;
             case 100:
                 orderStatus = new Integer[]{100};

+ 4 - 4
yiqi-core/src/main/resources/mapper/order/OrderClothMapper.xml

@@ -244,7 +244,7 @@
         ,o.org_id as orgId,o.source_type as sourceType,org.name as orgName,a.delivery_way as deliveryWay
         from order_cloth o
         left join app_user b on o.take_cloth_app_user_id = b.id
-        left join order_delivery as a on a.order_sn=o.order_no
+        left join order_delivery a on a.order_sn=o.order_no
         <if test="takeClothWay != null  and takeClothWay == '1'.toString()">
             and a.cloth_order_type=0
         </if>
@@ -252,7 +252,7 @@
             and a.cloth_order_type=1
         </if>
         left join sys_org as org on org.id=o.org_id and org.source_type=o.source_type and org.id is not null
-        where o.del_flag='0' and o.order_status != '100'
+        where o.del_flag='0' and o.is_appointment = 'Y' and o.order_status != '100'
         <if test="orderType != null  and orderType != ''">
             and o.order_type=#{orderType}
         </if>
@@ -278,10 +278,10 @@
             and o.order_no = #{orderNo}
         </if>
         <if test="contactName != null  and contactName != ''">
-            and o.contact_name = #{contactName}
+            and a.user_name = #{contactName}
         </if>
         <if test="contactPhone != null  and contactPhone != ''">
-            and o.contact_phone = #{contactPhone}
+            and a.user_phone = #{contactPhone}
         </if>
         <if test="appointmentTime != null  and appointmentTime != ''">
             and o.appointment_time >= DATE_FORMAT(#{appointmentTime},'%Y-%m-%d 00:00:00')