فهرست منبع

20190720取消订单

suochencheng 6 سال پیش
والد
کامیت
fcead73d5c

+ 8 - 2
src/main/java/com/izouma/awesomeadmin/dao/UserOrderDetailMapper.xml

@@ -51,7 +51,11 @@
 
     <sql id="Base_Column_List">
         <!--generatedStart-->
-        id, del_flag, update_time, update_user, create_time, create_user, user_id, order_code, store_id, type_flag, product_id, product_name, down_payment, unit_price, quantity, off_price, coupon_price, total_price, deal_price, pay_mode, pay_time, remark, show_flag, status_flag, fee, coin, point, cash, user_address_id, service_id, message, use_type, order_id, tail_money, book_photo_time, photo_time, book_select_time, select_time, book_check_time, check_time, book_access_time, access_time, comment_time        <!--generatedEnd-->
+        id, del_flag, update_time, update_user, create_time, create_user, user_id, order_code, store_id, type_flag,
+        product_id, product_name, down_payment, unit_price, quantity, off_price, coupon_price, total_price, deal_price,
+        pay_mode, pay_time, remark, show_flag, status_flag, fee, coin, point, cash, user_address_id, service_id,
+        message, use_type, order_id, tail_money, book_photo_time, photo_time, book_select_time, select_time,
+        book_check_time, check_time, book_access_time, access_time, comment_time        <!--generatedEnd-->
     </sql>
 
     <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer">
@@ -480,6 +484,9 @@
         <if test="idStr != null and !&quot;&quot;.equals(idStr)">
             id IN (${idStr})
         </if>
+        <if test="orderId != null and !&quot;&quot;.equals(orderId)">
+            AND order_id = #{orderId}
+        </if>
     </update>
 
     <select id="queryUserOrderDetailByPage" parameterType="java.util.Map"
@@ -1092,7 +1099,6 @@
     <resultMap id="AllInfoForGetOne" type="com.izouma.awesomeadmin.model.UserOrderDetail" extends="BaseResultMap">
 
 
-
         <association property="productInfo"
                      javaType="com.izouma.awesomeadmin.model.ProductInfo"
                      select="com.izouma.awesomeadmin.dao.ProductInfoMapper.queryProductInfo"

+ 1 - 8
src/main/java/com/izouma/awesomeadmin/dao/UserOrderMapper.xml

@@ -473,14 +473,7 @@
     </update>
     <select id="queryUserOrderByPage" parameterType="java.util.Map" resultMap="AllInfoForGetOne">
         select
-        <include refid="Base_Column_List"/>,(SELECT
-        COUNT(1)
-        FROM
-        product_comment
-        WHERE
-        product_comment.del_flag = 'N'
-        AND product_comment.order_id = user_order.id
-        AND product_comment.type_flag = 1) as commentFlag
+        <include refid="Base_Column_List"/>
         from user_order
         <where>
             and del_flag = 'N'

+ 4 - 15
src/main/java/com/izouma/awesomeadmin/service/impl/UserOrderServiceImpl.java

@@ -702,23 +702,12 @@ public class UserOrderServiceImpl implements UserOrderService {
                     record.setStatusFlag(AppConstant.OrderStatus.CANCEL);
                     userOrderMapper.updateByPrimaryKeySelective(record);
 
-                    /**
-                     * 获取产品信息
-                     */
-                    ProductInfo productInfo = new ProductInfo();
-                    productInfo.setId(userOrder.getProductId());
-
-                    productInfo = productInfoMapper.queryProductInfo(productInfo);
 
-                    //取消加库存库存。
-                    if (productInfo != null) {
-                        ProductInfo updateProduct = new ProductInfo();
+                    UserOrderDetail userOrderDetail = new UserOrderDetail();
 
-                        updateProduct.setId(productInfo.getId());
-                        updateProduct.setInventory(productInfo.getInventory() + userOrder.getQuantity());
-                        updateProduct.setSalesVolume(productInfo.getSalesVolume() - userOrder.getQuantity());
-                        productInfoMapper.updateByPrimaryKeySelective(updateProduct);
-                    }
+                    userOrderDetail.setOrderId(record.getId());
+                    userOrderDetail.setStatusFlag(AppConstant.OrderStatus.CANCEL);
+                    userOrderDetailMapper.updateByPrimaryKeySelective(userOrderDetail);
 
 
                     /**