1
0
dq 6 лет назад
Родитель
Сommit
dec56b32de

+ 20 - 5
kmall-admin/src/main/java/com/kmall/admin/controller/AttributeController.java

@@ -1,10 +1,9 @@
 package com.kmall.admin.controller;
 
+import com.google.common.collect.ImmutableBiMap;
 import com.kmall.admin.entity.AttributeEntity;
 import com.kmall.admin.service.AttributeService;
-import com.kmall.common.utils.PageUtils;
-import com.kmall.common.utils.Query;
-import com.kmall.common.utils.R;
+import com.kmall.common.utils.*;
 import org.apache.shiro.authz.annotation.RequiresPermissions;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
@@ -60,8 +59,16 @@ public class AttributeController {
     @RequestMapping("/save")
     @RequiresPermissions("attribute:save")
     public R save(@RequestBody AttributeEntity attribute) {
-        attributeService.save(attribute);
+        Map<String, Object> valideDate = MapBeanUtil.fromObject(attribute);
+        ImmutableBiMap.Builder builder = new ImmutableBiMap.Builder();
+        builder.put("name", "名称");
+        builder.put("attributeCategoryId", "所属分类");
+        R r = ValidatorUtil.isEmpty(builder.build(), valideDate);
+        if (Integer.valueOf(r.get("code").toString()) != 0) {
+            throw new RRException(r.get("msg").toString());
+        }
 
+        attributeService.save(attribute);
         return R.ok();
     }
 
@@ -71,8 +78,16 @@ public class AttributeController {
     @RequestMapping("/update")
     @RequiresPermissions("attribute:update")
     public R update(@RequestBody AttributeEntity attribute) {
-        attributeService.update(attribute);
+        Map<String, Object> valideDate = MapBeanUtil.fromObject(attribute);
+        ImmutableBiMap.Builder builder = new ImmutableBiMap.Builder();
+        builder.put("name", "名称");
+        builder.put("attributeCategoryId", "所属分类");
+        R r = ValidatorUtil.isEmpty(builder.build(), valideDate);
+        if (Integer.valueOf(r.get("code").toString()) != 0) {
+            throw new RRException(r.get("msg").toString());
+        }
 
+        attributeService.update(attribute);
         return R.ok();
     }
 

+ 2 - 3
kmall-admin/src/main/java/com/kmall/admin/service/impl/GoodsServiceImpl.java

@@ -93,8 +93,6 @@ public class GoodsServiceImpl implements GoodsService {
         builder.put("goodsUnit", "商品单位");
         builder.put("primaryPicUrl", "商品主图");
         builder.put("listPicUrl", "商品列表图");
-        builder.put("goodsRate", "商品税率");
-        builder.put("retailPrice", "零售价格");
         builder.put("isHot", "热销");
 
         R r = ValidatorUtil.isEmpty(builder.build(), valideDate);
@@ -104,6 +102,7 @@ public class GoodsServiceImpl implements GoodsService {
             if (!Dict.orderBizType.item_11.getItem().equals(goods.getGoodsBizType())) {
                 // 海关信息,普通货物可不添加
                 builder.put("sku", "SKU");
+                builder.put("goodsRate", "商品税率");
                 builder.put("retailPrice", "零售价");
                 builder.put("prodBarcode", "产品编码");
                 builder.put("brand", "产品品牌");
@@ -216,7 +215,6 @@ public class GoodsServiceImpl implements GoodsService {
         builder.put("goodsUnit", "商品单位");
         builder.put("primaryPicUrl", "商品主图");
         builder.put("listPicUrl", "商品列表图");
-        builder.put("goodsRate", "商品税率");
         builder.put("isHot", "热销");
 
 
@@ -227,6 +225,7 @@ public class GoodsServiceImpl implements GoodsService {
             if (!Dict.orderBizType.item_11.getItem().equals(goods.getGoodsBizType())) {
                 // 海关信息,普通货物可不添加
                 builder.put("sku", "SKU");
+                builder.put("goodsRate", "商品税率");
                 builder.put("retailPrice", "零售价");
                 builder.put("prodBarcode", "产品编码");
                 builder.put("brand", "产品品牌");

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

@@ -30,7 +30,7 @@
         mall_address.county_Name,
         mall_address.detail_Info,
         mall_address.is_default,
-        mall_user.username shop_user_name
+        mall_user.nickname shop_user_name
         from mall_address LEFT JOIN mall_user ON mall_address.user_id = mall_user.id
         where mall_address.id = #{id}
     </select>
@@ -48,7 +48,7 @@
         mall_address.county_Name,
         mall_address.detail_Info,
         mall_address.is_default,
-        mall_user.username shop_user_name
+        mall_user.nickname shop_user_name
         from mall_address LEFT JOIN mall_user ON mall_address.user_id = mall_user.id
         WHERE 1=1
         <if test="userId != null">

+ 1 - 1
kmall-admin/src/main/resources/mybatis/mapper/CartDao.xml

@@ -27,7 +27,7 @@
 	</select>
 
     <select id="queryList" resultMap="cartMap">
-        select a.* ,b.username as user_name
+        select a.* ,b.nickname as user_name
         from mall_cart a
         left join mall_user b on a.user_id = b.id
         where 1=1

+ 1 - 1
kmall-admin/src/main/resources/mybatis/mapper/FootprintDao.xml

@@ -18,7 +18,7 @@
 	</select>
 
     <select id="queryList" resultMap="footprintMap">
-        select a.* ,b.username as user_name,c.name as goods_name
+        select a.* ,b.nickname as user_name,c.name as goods_name
         from mall_footprint a
         left join mall_user b on a.user_id = b.id
         left join mall_goods c on a.goods_id = c.id

+ 1 - 1
kmall-admin/src/main/resources/mybatis/mapper/SearchHistoryDao.xml

@@ -18,7 +18,7 @@
 	</select>
 
     <select id="queryList" resultMap="searchHistoryMap">
-        select a.* ,b.username as user_name
+        select a.* ,b.nickname as user_name
         from mall_search_history a
         left join mall_user b on a.user_id = b.id
         <choose>

+ 3 - 8
kmall-admin/src/main/webapp/js/shop/attribute.js

@@ -43,12 +43,9 @@ var vm = new Vue({
         title: null,
         attribute: { sortOrder: '' },
         ruleValidate: {
-            name: [
+            /*name: [
                 {required: true, message: '名称不能为空', trigger: 'blur'}
-            ],
-            attributeCategoryId: [
-                {required: true, message: '所属分类不能为空', trigger: 'blur'}
-            ]
+            ]*/
         },
         q: {
             name: '',
@@ -141,9 +138,7 @@ var vm = new Vue({
             });
         },
         handleSubmit: function (name) {
-            handleSubmitValidate(this, name, function () {
-                vm.saveOrUpdate()
-            });
+            vm.saveOrUpdate();
         },
         handleReset: function (name) {
             handleResetForm(this, name);

+ 8 - 4
kmall-admin/src/main/webapp/js/shop/order.js

@@ -42,21 +42,23 @@ $(function () {
                 label: '订单状态', name: 'orderStatus', index: 'order_status', width: 80,
                 formatter: function (value) {
                     if (value == '0') {
-                        return '待付款';
+                        return '订单创建成功等待付款';
+                    } else if (value == '100') {
+                        return '订单付款中';
                     } else if (value == '101') {
                         return '订单已取消';
                     } else if (value == '102') {
                         return '订单已删除';
                     } else if (value == '201') {
-                        return '订单已付款';
+                        return '订单已付款,等待发货';
                     } else if (value == '300') {
                         return '订单已发货';
                     } else if (value == '301') {
                         return '用户确认收货';
                     } else if (value == '401') {
-                        return '退款';
+                        return '没有发货,退款';
                     } else if (value == '402') {
-                        return '完成';
+                        return '已收货,退款退货';
                     }
                     return value;
                 }
@@ -70,6 +72,8 @@ $(function () {
                         return '付款中';
                     } else if (value == '2') {
                         return '已付款';
+                    } else if (value == '3') {
+                        return '退款中';
                     } else if (value == '4') {
                         return '退款';
                     }

+ 16 - 6
wx-mall/pages/map/map.js

@@ -110,23 +110,33 @@ Page({
         wx.setStorageSync('storeId', storeId);
         var item = "";
         for (var i = 0; i < that.data.nearStoreList.length; i++) {
-          if (storeId == that.data.nearStoreList[i].id) {
+          if (storeId === that.data.nearStoreList[i].id) {
             item = that.data.nearStoreList[i];
             wx.setStorageSync('storeVo', JSON.stringify(item));
+            break;
           }
         }
+
         var pages = getCurrentPages();
         var currPage = pages[pages.length - 1];  //当前页面
         var prevPage = pages[pages.length - 2]; //上一个页面
+        if (item === "") {
+          wx.removeStorageSync('nearStoreList');
+          wx.removeStorageSync('storeId');
+          wx.removeStorageSync('storeVo');
+          that.setData({
+            storeName: '附近暂无门店'
+          })
+        } else {
+          //直接调用上一个页面的setData()方法,把数据存到上一个页面中去
+          prevPage.setData({
+            storeName: item.storeName
+          })
+        }
 
-        //直接调用上一个页面的setData()方法,把数据存到上一个页面中去
-        prevPage.setData({
-          storeName: item.storeName
-        })
         prevPage.getIndexData();
         prevPage.enableActivity();
         prevPage.getGroupData();
-
         wx.navigateBack()
       }
     })