Jelajahi Sumber

优惠券新增商户条件查询,分类查询修改

hyq 6 tahun lalu
induk
melakukan
8224f2b51a

+ 2 - 2
kmall-admin/src/main/resources/mybatis/mapper/ExportExceptionDataDao.xml

@@ -50,10 +50,10 @@
 		from mall_export_exception_data
 		WHERE 1=1
 		<if test="storeId != null and storeId != '' ">
-			AND a.store_id = #{storeId}
+			AND store_id = #{storeId}
 		</if>
 		<if test="merchSn != null and merchSn.trim() != '' ">
-			AND a.merch_sn = #{merchSn}
+			AND merch_sn = #{merchSn}
 		</if>
 		<if test="name != null and name.trim() != ''">
 			AND name LIKE concat('%',#{name},'%')

+ 10 - 3
kmall-admin/src/main/webapp/js/shop/category.js

@@ -35,6 +35,15 @@ TreeGrid.initColumn = function () {
     var columns = [
         {field: 'selectItem', radio: true},
         {title: 'id', field: 'id', align: 'id', width: '50px'},
+        // {title: '类型', field: 'type', align: 'center', valign: 'middle', width: '50px'},
+        {title: '级别', field: 'level', align: 'center', valign: 'middle', width: '50px',formatter: function (item, index) {
+            if (item.level == 'L1') {
+                return '一级分类';
+            } else if (item.level == 'L2') {
+                return '二级分类';
+            }
+            return '-';
+        }},
         {title: '分类名称', field: 'name', align: 'center', valign: 'middle', width: '100px'},
         {title: '描述', field: 'frontDesc', align: 'center', valign: 'middle', width: '150px'},
         {title: '首页展示', field: 'showIndex', align: 'center', valign: 'middle', width: '50px'},
@@ -47,9 +56,7 @@ TreeGrid.initColumn = function () {
             formatter: function (item, index) {
                 return transIsNot(item.show)
             }
-        },
-        // {title: '类型', field: 'type', align: 'center', valign: 'middle', width: '50px'},
-        {title: '级别', field: 'level', align: 'center', valign: 'middle', width: '50px'}]
+        }]
     return columns;
 };
 

+ 1 - 1
kmall-api/src/main/java/com/kmall/api/api/ApiCartController.java

@@ -666,7 +666,7 @@ public class ApiCartController extends ApiBaseAction {
             }
         }
         // 匹配优惠券
-        List<UserCouponVo> couponVos = apiUserCouponService.signUserCouponList(loginUser.getId(),loginUser.getMerchSn(),checkedGoodsAmount);
+        List<UserCouponVo> couponVos = apiUserCouponService.signUserCouponList(loginUser.getId(),getMerchSn(),checkedGoodsAmount);
         return toResponsSuccess(couponVos);
     }
 

+ 2 - 2
kmall-api/src/main/java/com/kmall/api/api/ApiCouponController.java

@@ -104,7 +104,7 @@ public class ApiCouponController extends ApiBaseAction {
         param.put("user_id", loginUser.getId());
         param.put("enabled", true);
         param.put("unUsed", true);
-        param.put("merchSn", loginUser.getMerchSn());
+        param.put("merchSn", getMerchSn());
         List<UserCouponVo> couponVos = apiUserCouponService.queryList(param);
         return toResponsSuccess(couponVos);
     }
@@ -122,7 +122,7 @@ public class ApiCouponController extends ApiBaseAction {
         //
         Map param = new HashMap();
         param.put("coupon_number", coupon_number);
-        param.put("merchSn", loginUser.getMerchSn());
+        param.put("merchSn", getMerchSn());
         List<UserCouponVo> couponVos = apiUserCouponService.queryList(param);
         UserCouponVo userCouponVo = null;
         if (null == couponVos || couponVos.size() == 0) {

+ 15 - 1
kmall-api/src/main/java/com/kmall/api/util/ApiBaseAction.java

@@ -186,7 +186,7 @@ public class ApiBaseAction {
     }
 
     /**
-     * 获取请求的用户Id
+     * 获取请求的门店Id
      *
      * @return 客户端Ip
      */
@@ -199,4 +199,18 @@ public class ApiBaseAction {
         }
         return tokenEntity.getStoreId();
     }
+    /**
+     * 获取请求的商户编号
+     *
+     * @return 客户端Ip
+     */
+    public String getMerchSn() {
+        String token = request.getHeader(AuthorizationInterceptor.LOGIN_TOKEN_KEY);
+        //查询token信息
+        TokenEntity tokenEntity = UserTokenCache.getUserInfoByToken(token);
+        if (tokenEntity == null || tokenEntity.getExpireTime().getTime() < System.currentTimeMillis()) {
+            return null;
+        }
+        return tokenEntity.getMerchSn();
+    }
 }

+ 1 - 1
kmall-api/src/main/resources/mybatis/mapper/ApiUserCouponMapper.xml

@@ -48,7 +48,7 @@
         from mall_user_coupon a  inner join mall_coupon c on a.coupon_id = c.id
         where 1 = 1
         <if test="merchSn != null">
-            and c.merch_sn = #{merchSn}
+            and (c.merch_sn = #{merchSn} or c.is_all=1)
         </if>
         <if test="coupon_number != null">
             and a.coupon_number = #{coupon_number}

+ 1 - 1
wx-mall/pages/cart/cart.js

@@ -311,7 +311,7 @@ Page({
       userInfo: app.globalData.userInfo
     }, 'POST').then(function (res) {
       if (res.errno === 0) {
-        console.log('that.data.mobile:' + res.data.mobile);
+        // console.log('that.data.mobile:' + res.data.mobile);
         if (res.data.mobile == '' || res.data.mobile == null) {
           wx.showModal({
             title: '',

+ 2 - 2
wx-mall/pages/shopping/checkout/checkout.js

@@ -45,7 +45,7 @@ Page({
   },
   bindMultiPickerColumnChange: function (e) {
     let that = this;
-    console.log('修改的列为', e.detail.column, ',值为', e.detail.value);
+    // console.log('修改的列为', e.detail.column, ',值为', e.detail.value);
     var data = {
       multiArray: this.data.multiArray,
       multiIndex: this.data.multiIndex
@@ -97,7 +97,7 @@ Page({
   },
   getCheckoutInfo: function () {
     let that = this;
-    util.request(api.CartCheckout, { userCouponId: that.data.userCouponId }).then(function (res) {
+    util.request(api.CartCheckout, { userCouponId: that.data.userCouponId, merchSn: wx.getStorageSync('merchSn') }).then(function (res) {
       if (res.errno === 0) {
         console.log(res.data);
         that.setData({

+ 2 - 0
wx-mall/pages/shopping/coupon/coupon.wxml

@@ -13,6 +13,8 @@
         <view class="coupon-desc">
           <view>{{ item.add_time }}-{{ item.end_time }}</view>
           <view>{{ null!=item.coupon_txt?item.coupon_txt:"" }}</view>
+          <view style='font-size:24rpx;color:#000;'>{{ item.isAll==1 ? '全场商品可用,不可抵扣运费':'' }}</view>
+          <view style='font-size:24rpx;color:#b4282d;'>{{'满'+item.min_goods_amount+'可用' }}</view>
         </view>
       </view>
     </view>