liujunchi před 3 roky
rodič
revize
a014990b29

+ 2 - 1
cooleshow-mall/mall-admin/src/main/resources/config/mybatis/OmsOrderDao.xml

@@ -17,7 +17,7 @@
                 um.id as userId,
                 um.username as username,
                 um.phone as phone,
-                (select  uop.payment_client_ from user_order_payment uop where uop.order_no_ = o.order_sn order by  uop.id_ desc limit 1) as userType
+                o.platform_type as userType
 
         FROM
         oms_order o
@@ -45,6 +45,7 @@
             OR o.receiver_phone LIKE concat("%",#{queryParam.receiverKeyword},"%")
             )
         </if>
+        order by o.id desc
     </select>
     <update id="delivery">
         UPDATE oms_order

+ 1 - 0
cooleshow-mall/mall-admin/src/main/resources/config/mybatis/OmsOrderReturnApplyDao.xml

@@ -40,6 +40,7 @@
             AND (return_name LIKE concat("%",#{queryParam.receiverKeyword},"%")
             OR return_phone LIKE concat("%",#{queryParam.receiverKeyword},"%"))
         </if>
+        order by id desc
     </select>
     <select id="getDetail" resultMap="returnApplyDetailResultMap">
         SELECT

+ 11 - 0
cooleshow-mall/mall-mbg/src/main/java/com/yonge/cooleshow/mbg/model/OmsOrder.java

@@ -13,6 +13,9 @@ public class OmsOrder implements Serializable {
 
     private Long couponId;
 
+    @ApiModelProperty("下单平台 STUDENT TEACHER")
+    private String platformType;
+
     @ApiModelProperty(value = "订单编号")
     private String orderSn;
 
@@ -141,6 +144,14 @@ public class OmsOrder implements Serializable {
 
     private static final long serialVersionUID = 1L;
 
+    public String getPlatformType() {
+        return platformType;
+    }
+
+    public void setPlatformType(String platformType) {
+        this.platformType = platformType;
+    }
+
     public Long getId() {
         return id;
     }

+ 19 - 4
cooleshow-mall/mall-mbg/src/main/resources/config/mybatis/OmsOrderMapper.xml

@@ -47,6 +47,7 @@
     <result column="receive_time" jdbcType="TIMESTAMP" property="receiveTime" />
     <result column="comment_time" jdbcType="TIMESTAMP" property="commentTime" />
     <result column="modify_time" jdbcType="TIMESTAMP" property="modifyTime" />
+    <result column="platform_type" jdbcType="TIMESTAMP" property="platformType" />
   </resultMap>
   <sql id="Example_Where_Clause">
     <where>
@@ -113,7 +114,7 @@
     integration, growth, promotion_info, bill_type, bill_header, bill_content, bill_receiver_phone, 
     bill_receiver_email, receiver_name, receiver_phone, receiver_post_code, receiver_province, 
     receiver_city, receiver_region, receiver_detail_address, note, confirm_status, delete_status, 
-    use_integration, payment_time, delivery_time, receive_time, comment_time, modify_time,cart_ids
+    use_integration, payment_time, delivery_time, receive_time, comment_time, modify_time,cart_ids,platform_type
   </sql>
   <select id="selectByExample" parameterType="com.yonge.cooleshow.mbg.model.OmsOrderExample" resultMap="BaseResultMap">
     select
@@ -163,7 +164,7 @@
       receiver_detail_address, note, confirm_status, 
       delete_status, use_integration, payment_time, 
       delivery_time, receive_time, comment_time, 
-      modify_time,cart_ids)
+      modify_time,cart_ids,platform_type)
     values (#{memberId,jdbcType=BIGINT}, #{couponId,jdbcType=BIGINT}, #{orderSn,jdbcType=VARCHAR}, 
       #{createTime,jdbcType=TIMESTAMP}, #{memberUsername,jdbcType=VARCHAR}, #{totalAmount,jdbcType=DECIMAL}, 
       #{payAmount,jdbcType=DECIMAL}, #{freightAmount,jdbcType=DECIMAL}, #{promotionAmount,jdbcType=DECIMAL}, 
@@ -178,7 +179,7 @@
       #{receiverDetailAddress,jdbcType=VARCHAR}, #{note,jdbcType=VARCHAR}, #{confirmStatus,jdbcType=INTEGER}, 
       #{deleteStatus,jdbcType=INTEGER}, #{useIntegration,jdbcType=INTEGER}, #{paymentTime,jdbcType=TIMESTAMP}, 
       #{deliveryTime,jdbcType=TIMESTAMP}, #{receiveTime,jdbcType=TIMESTAMP}, #{commentTime,jdbcType=TIMESTAMP}, 
-      #{modifyTime,jdbcType=TIMESTAMP},#{cartIds})
+      #{modifyTime,jdbcType=TIMESTAMP},#{cartIds},#{platformType})
   </insert>
   <insert id="insertSelective" parameterType="com.yonge.cooleshow.mbg.model.OmsOrder">
     <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
@@ -318,6 +319,9 @@
       <if test="cartIds != null">
         cart_ids,
       </if>
+      <if test="platformType != null">
+        platform_type,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
       <if test="memberId != null">
@@ -452,6 +456,9 @@
       <if test="cartIds != null">
         #{cartIds},
       </if>
+      <if test="platformType != null">
+        #{platformType},
+      </if>
     </trim>
   </insert>
   <select id="countByExample" parameterType="com.yonge.cooleshow.mbg.model.OmsOrderExample" resultType="java.lang.Long">
@@ -598,6 +605,9 @@
       <if test="record.cartIds != null">
         cart_ids = #{record.cartIds},
       </if>
+      <if test="record.platformType != null">
+        platform_type = #{record.platformType},
+      </if>
     </set>
     <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
@@ -649,6 +659,7 @@
       receive_time = #{record.receiveTime,jdbcType=TIMESTAMP},
       comment_time = #{record.commentTime,jdbcType=TIMESTAMP},
       cart_ids = #{record.cartIds},
+      platform_type = #{record.platformType},
       modify_time = #{record.modifyTime,jdbcType=TIMESTAMP}
     <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
@@ -787,7 +798,10 @@
         modify_time = #{modifyTime,jdbcType=TIMESTAMP},
       </if>
       <if test="cartIds != null">
-        cart_ids = #{cartIds,jdbcType=TIMESTAMP},
+        cart_ids = #{cartIds},
+      </if>
+      <if test="platformType != null">
+        platform_type = #{platformType},
       </if>
     </set>
     where id = #{id,jdbcType=BIGINT}
@@ -837,6 +851,7 @@
       receive_time = #{receiveTime,jdbcType=TIMESTAMP},
       comment_time = #{commentTime,jdbcType=TIMESTAMP},
       cart_ids = #{cartIds},
+      platform_type = #{platformType},
       modify_time = #{modifyTime,jdbcType=TIMESTAMP}
     where id = #{id,jdbcType=BIGINT}
   </update>

+ 11 - 0
cooleshow-mall/mall-portal/src/main/java/com/yonge/cooleshow/portal/domain/OrderParam.java

@@ -21,6 +21,17 @@ public class OrderParam {
     @ApiModelProperty("被选中的购物车商品ID")
     private List<Long> cartIds;
 
+    @ApiModelProperty("平台类型 STUDENT:学生端  TEACHER:老师端")
+    private String platformType;
+
+    public String getPlatformType() {
+        return platformType;
+    }
+
+    public void setPlatformType(String platformType) {
+        this.platformType = platformType;
+    }
+
     public Long getMemberReceiveAddressId() {
         return memberReceiveAddressId;
     }

+ 1 - 0
cooleshow-mall/mall-portal/src/main/java/com/yonge/cooleshow/portal/service/impl/OmsPortalOrderServiceImpl.java

@@ -211,6 +211,7 @@ public class OmsPortalOrderServiceImpl implements OmsPortalOrderService {
         order.setFreightAmount(new BigDecimal(0));
         order.setPromotionAmount(calcPromotionAmount(orderItemList));
         order.setPromotionInfo(getOrderPromotionInfo(orderItemList));
+        order.setPlatformType(orderParam.getPlatformType());
         if (orderParam.getCouponId() == null) {
             order.setCouponAmount(new BigDecimal(0));
         } else {

+ 5 - 0
cooleshow-mall/mall-portal/src/main/resources/config/mybatis/PortalOrderDao.xml

@@ -59,6 +59,11 @@
               WHEN #{item.productSkuId} THEN stock - #{item.productQuantity}
             </foreach>
             END,
+            sale = CASE id
+            <foreach collection="itemList" item="item">
+                WHEN #{item.productSkuId} THEN pms_sku_stock.sale + #{item.productQuantity}
+            </foreach>
+            END,
             lock_stock = CASE id
             <foreach collection="itemList" item="item">
               WHEN #{item.productSkuId} THEN lock_stock - #{item.productQuantity}

+ 5 - 0
cooleshow-mall/mall-portal/src/main/resources/config/mybatis/PortalProductDao.xml

@@ -104,6 +104,11 @@
             WHEN #{item.productId} THEN stock - #{item.stock}
         </foreach>
         END,
+        sale = CASE id
+        <foreach collection="itemList" item="item">
+            WHEN #{item.productId} THEN sale + #{item.stock}
+        </foreach>
+        END,
         lock_stock = CASE id
         <foreach collection="itemList" item="item">
             WHEN #{item.productId} THEN lock_stock - #{item.stock}