1
0
Selaa lähdekoodia

Merge branch 'master' of hyq/kmall-pt into master

黄亚琴 6 vuotta sitten
vanhempi
commit
095cbcd478
100 muutettua tiedostoa jossa 2708 lisäystä ja 705 poistoa
  1. 2 1
      kmall-admin/src/main/java/com/kmall/admin/controller/BrandController.java
  2. 32 5
      kmall-admin/src/main/java/com/kmall/admin/controller/GoodsController.java
  3. 1 1
      kmall-admin/src/main/java/com/kmall/admin/controller/OfflineCartController.java
  4. 62 4
      kmall-admin/src/main/java/com/kmall/admin/controller/OrderController.java
  5. 19 0
      kmall-admin/src/main/java/com/kmall/admin/controller/ProductStoreRelaController.java
  6. 2 2
      kmall-admin/src/main/java/com/kmall/admin/controller/StoreController.java
  7. 134 0
      kmall-admin/src/main/java/com/kmall/admin/controller/ThirdMerchantBizController.java
  8. 1 0
      kmall-admin/src/main/java/com/kmall/admin/dao/BrandDao.java
  9. 1 0
      kmall-admin/src/main/java/com/kmall/admin/dao/CategoryDao.java
  10. 1 0
      kmall-admin/src/main/java/com/kmall/admin/dao/FreightDao.java
  11. 1 1
      kmall-admin/src/main/java/com/kmall/admin/dao/GoodsDao.java
  12. 2 0
      kmall-admin/src/main/java/com/kmall/admin/dao/OfflineCartDao.java
  13. 12 3
      kmall-admin/src/main/java/com/kmall/admin/dao/ProductDao.java
  14. 2 0
      kmall-admin/src/main/java/com/kmall/admin/dao/ProductStoreRelaDao.java
  15. 19 0
      kmall-admin/src/main/java/com/kmall/admin/dao/ThirdMerchantBizDao.java
  16. 5 5
      kmall-admin/src/main/java/com/kmall/admin/dto/GoodsDto.java
  17. 19 0
      kmall-admin/src/main/java/com/kmall/admin/entity/AttributeEntity.java
  18. 37 0
      kmall-admin/src/main/java/com/kmall/admin/entity/BrandEntity.java
  19. 19 0
      kmall-admin/src/main/java/com/kmall/admin/entity/CategoryEntity.java
  20. 19 0
      kmall-admin/src/main/java/com/kmall/admin/entity/FreightEntity.java
  21. 51 22
      kmall-admin/src/main/java/com/kmall/admin/entity/GoodsEntity.java
  22. 10 0
      kmall-admin/src/main/java/com/kmall/admin/entity/OrderEntity.java
  23. 53 0
      kmall-admin/src/main/java/com/kmall/admin/entity/ProductStoreRelaEntity.java
  24. 181 0
      kmall-admin/src/main/java/com/kmall/admin/entity/ThirdMerchantBizEntity.java
  25. 1 1
      kmall-admin/src/main/java/com/kmall/admin/service/GoodsService.java
  26. 3 3
      kmall-admin/src/main/java/com/kmall/admin/service/ProductService.java
  27. 3 0
      kmall-admin/src/main/java/com/kmall/admin/service/ProductStoreRelaService.java
  28. 72 0
      kmall-admin/src/main/java/com/kmall/admin/service/ThirdMerchantBizService.java
  29. 9 7
      kmall-admin/src/main/java/com/kmall/admin/service/impl/CategoryServiceImpl.java
  30. 109 90
      kmall-admin/src/main/java/com/kmall/admin/service/impl/GoodsServiceImpl.java
  31. 2 2
      kmall-admin/src/main/java/com/kmall/admin/service/impl/OfflineCartServiceImpl.java
  32. 2 2
      kmall-admin/src/main/java/com/kmall/admin/service/impl/ProductServiceImpl.java
  33. 103 25
      kmall-admin/src/main/java/com/kmall/admin/service/impl/ProductStoreRelaServiceImpl.java
  34. 24 0
      kmall-admin/src/main/java/com/kmall/admin/service/impl/StoreServiceImpl.java
  35. 71 0
      kmall-admin/src/main/java/com/kmall/admin/service/impl/ThirdMerchantBizServiceImpl.java
  36. 13 13
      kmall-admin/src/main/resources/XmlTemplate/GeneralGoodsDtoList.xml
  37. 22 22
      kmall-admin/src/main/resources/XmlTemplate/GoodsDtoList.xml
  38. 7 1
      kmall-admin/src/main/resources/mybatis/mapper/AttributeDao.xml
  39. 59 21
      kmall-admin/src/main/resources/mybatis/mapper/BrandDao.xml
  40. 24 13
      kmall-admin/src/main/resources/mybatis/mapper/CategoryDao.xml
  41. 31 11
      kmall-admin/src/main/resources/mybatis/mapper/FreightDao.xml
  42. 31 57
      kmall-admin/src/main/resources/mybatis/mapper/GoodsDao.xml
  43. 19 0
      kmall-admin/src/main/resources/mybatis/mapper/OrderDao.xml
  44. 1 0
      kmall-admin/src/main/resources/mybatis/mapper/OrderGoodsDao.xml
  45. 2 2
      kmall-admin/src/main/resources/mybatis/mapper/ProductDao.xml
  46. 139 24
      kmall-admin/src/main/resources/mybatis/mapper/ProductStoreRelaDao.xml
  47. 167 0
      kmall-admin/src/main/resources/mybatis/mapper/ThirdMerchantBizDao.xml
  48. 29 2
      kmall-admin/src/main/webapp/WEB-INF/page/shop/brand.html
  49. 67 47
      kmall-admin/src/main/webapp/WEB-INF/page/shop/category.html
  50. 33 65
      kmall-admin/src/main/webapp/WEB-INF/page/shop/goods.html
  51. 1 1
      kmall-admin/src/main/webapp/WEB-INF/page/shop/offilineOrderList.html
  52. 10 4
      kmall-admin/src/main/webapp/WEB-INF/page/shop/order.html
  53. 5 6
      kmall-admin/src/main/webapp/WEB-INF/page/shop/store.html
  54. 85 8
      kmall-admin/src/main/webapp/WEB-INF/page/shop/storeProductStock.html
  55. 69 0
      kmall-admin/src/main/webapp/WEB-INF/page/shop/thirdmerchantbiz.html
  56. 2 0
      kmall-admin/src/main/webapp/js/shop/attribute.js
  57. 16 2
      kmall-admin/src/main/webapp/js/shop/brand.js
  58. 13 12
      kmall-admin/src/main/webapp/js/shop/category.js
  59. 2 0
      kmall-admin/src/main/webapp/js/shop/freight.js
  60. 59 45
      kmall-admin/src/main/webapp/js/shop/goods.js
  61. 19 4
      kmall-admin/src/main/webapp/js/shop/order.js
  62. 7 7
      kmall-admin/src/main/webapp/js/shop/scannShop.js
  63. 14 1
      kmall-admin/src/main/webapp/js/shop/store.js
  64. 169 18
      kmall-admin/src/main/webapp/js/shop/storeProductStock.js
  65. 166 0
      kmall-admin/src/main/webapp/js/shop/thirdmerchantbiz.js
  66. BIN
      kmall-admin/src/main/webapp/statics/file/general_goods_export_yyyy_mm_dd_v1.0.0.xls
  67. BIN
      kmall-admin/src/main/webapp/statics/file/goods_export_yyyy_mm_dd_v1.0.0.xls
  68. 18 18
      kmall-api/src/main/java/com/kmall/api/api/ApiCartController.java
  69. 14 1
      kmall-api/src/main/java/com/kmall/api/api/ApiCatalogController.java
  70. 36 14
      kmall-api/src/main/java/com/kmall/api/api/ApiGoodsController.java
  71. 1 1
      kmall-api/src/main/java/com/kmall/api/api/ApiIndexController.java
  72. 2 2
      kmall-api/src/main/java/com/kmall/api/dao/ApiCartMapper.java
  73. 1 1
      kmall-api/src/main/java/com/kmall/api/dao/ApiFreightMapper.java
  74. 10 0
      kmall-api/src/main/java/com/kmall/api/entity/BrandVo.java
  75. 5 5
      kmall-api/src/main/java/com/kmall/api/service/ApiCartService.java
  76. 2 2
      kmall-api/src/main/java/com/kmall/api/service/ApiFreightService.java
  77. 2 2
      kmall-api/src/main/java/com/kmall/api/service/ApiGoodsGroupOpenService.java
  78. 9 9
      kmall-api/src/main/java/com/kmall/api/service/ApiOrderService.java
  79. 9 1
      kmall-api/src/main/resources/mybatis/mapper/ApiBrandMapper.xml
  80. 4 4
      kmall-api/src/main/resources/mybatis/mapper/ApiCartMapper.xml
  81. 1 1
      kmall-api/src/main/resources/mybatis/mapper/ApiFreightMapper.xml
  82. 61 28
      kmall-api/src/main/resources/mybatis/mapper/ApiGoodsMapper.xml
  83. 7 6
      kmall-common/src/main/java/com/kmall/common/controller/SysRoleController.java
  84. 6 2
      kmall-common/src/main/java/com/kmall/common/controller/SysUserController.java
  85. 1 0
      kmall-schedule/src/main/java/com/kmall/schedule/service/QzOrderService.java
  86. 4 2
      kmall-schedule/src/main/resources/mybatis/mapper/QzOrderMapper.xml
  87. 4 3
      wx-mall/config/api.js
  88. 2 2
      wx-mall/lib/wxParse/wxParse.wxml
  89. 9 0
      wx-mall/lib/wxParse/wxParse.wxss
  90. 40 10
      wx-mall/pages/cart/cart.js
  91. 8 8
      wx-mall/pages/cart/cart.wxml
  92. 21 5
      wx-mall/pages/catalog/catalog.js
  93. 13 0
      wx-mall/pages/catalog/catalog.wxml
  94. 5 4
      wx-mall/pages/catalog/catalog.wxss
  95. 4 1
      wx-mall/pages/goods/goods.js
  96. 3 3
      wx-mall/pages/goods/goods.wxml
  97. 12 1
      wx-mall/pages/goods/goods.wxss
  98. 21 4
      wx-mall/pages/index/index.js
  99. 2 1
      wx-mall/pages/index/index.json
  100. 6 4
      wx-mall/pages/index/index.wxml

+ 2 - 1
kmall-admin/src/main/java/com/kmall/admin/controller/BrandController.java

@@ -67,12 +67,12 @@ public class BrandController {
         ImmutableBiMap.Builder builder = new ImmutableBiMap.Builder();
         builder.put("merchSn", "商户");
         builder.put("storeId", "门店");
+        builder.put("categoryId", "分类");
         R r = ValidatorUtil.isEmpty(builder.build(), valideDate);
         if (Integer.valueOf(r.get("code").toString()) != 0) {
             throw new RRException(r.get("msg").toString());
         }
 
-
         brandService.save(brand);
 
         return R.ok();
@@ -89,6 +89,7 @@ public class BrandController {
         ImmutableBiMap.Builder builder = new ImmutableBiMap.Builder();
         builder.put("merchSn", "商户");
         builder.put("storeId", "门店");
+        builder.put("categoryId", "分类");
         R r = ValidatorUtil.isEmpty(builder.build(), valideDate);
         if (Integer.valueOf(r.get("code").toString()) != 0) {
             throw new RRException(r.get("msg").toString());

+ 32 - 5
kmall-admin/src/main/java/com/kmall/admin/controller/GoodsController.java

@@ -3,18 +3,18 @@ package com.kmall.admin.controller;
 import com.kmall.admin.dto.GoodsDto;
 import com.kmall.admin.entity.GoodsEntity;
 import com.kmall.admin.entity.GoodsGalleryEntity;
+import com.kmall.admin.entity.StoreEntity;
 import com.kmall.admin.service.GoodsGalleryService;
 import com.kmall.admin.service.GoodsService;
 import com.kmall.admin.service.OfflineCartService;
+import com.kmall.admin.service.StoreService;
 import com.kmall.admin.utils.ParamUtils;
 import com.kmall.common.constant.Dict;
 import com.kmall.common.constant.JxlsXmlTemplateName;
 import com.kmall.common.entity.SysUserEntity;
-import com.kmall.common.utils.PageUtils;
-import com.kmall.common.utils.Query;
-import com.kmall.common.utils.R;
-import com.kmall.common.utils.ShiroUtils;
+import com.kmall.common.utils.*;
 import com.kmall.common.utils.excel.ExcelUtil;
+import org.apache.commons.lang3.StringUtils;
 import org.apache.shiro.authz.annotation.RequiresPermissions;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
@@ -40,6 +40,8 @@ public class GoodsController {
     private OfflineCartService offlineCartService;
     @Autowired
     private ExcelUtil excelUtil;
+    @Autowired
+    private StoreService storeService;
 
     /**
      * 查看列表
@@ -49,6 +51,23 @@ public class GoodsController {
     public R list(@RequestParam Map<String, Object> params) {
 
         ParamUtils.setQueryPowerByRoleType(params, null, "merchSn", true);
+        if (Dict.roleType.item_2.getItem().equals(ShiroUtils.getUserEntity().getRoleType())) {
+            StoreEntity storeEntity = storeService.queryObject(ShiroUtils.getUserEntity().getStoreId());
+            if(StringUtils.isNotEmpty(storeEntity.getThirdPartyMerchCode())) {
+                params.put("thirdPartyMerchCode", storeEntity.getThirdPartyMerchCode());
+            }else{
+                throw new RRException("请维护门店信息中的第三方商户编号信息!再进行商品查看");
+            }
+        }
+        String goodsName = (String) params.get("goodsName");
+        if(org.apache.commons.lang3.StringUtils.isNotEmpty(goodsName)){
+            try{
+                goodsName = new String(goodsName.getBytes("iso-8859-1"),"utf-8");
+            }catch (Exception e){
+                e.printStackTrace();
+            }
+            params.put("goodsName", goodsName);
+        }
         //查询列表数据
         Query query = new Query(params);
 
@@ -116,6 +135,14 @@ public class GoodsController {
     @RequestMapping("/queryAll")
     public R queryAll(@RequestParam Map<String, Object> params) {
         ParamUtils.setQueryPowerByRoleType(params, null, "merchSn", true);
+        if (Dict.roleType.item_2.getItem().equals(ShiroUtils.getUserEntity().getRoleType())) {
+            StoreEntity storeEntity = storeService.queryObject(ShiroUtils.getUserEntity().getStoreId());
+            if(StringUtils.isNotEmpty(storeEntity.getThirdPartyMerchCode())) {
+                params.put("thirdPartyMerchCode", storeEntity.getThirdPartyMerchCode());
+            }else{
+                throw new RRException("请维护门店信息中的第三方商户编号信息!再进行商品查看");
+            }
+        }
         params.put("isDelete", Integer.parseInt(Dict.isDelete.item_0.getItem()));
         params.put("isOnSale", Integer.parseInt(Dict.isOnSale.item_1.getItem()));
         List<GoodsEntity> list = goodsService.queryList(params);
@@ -272,7 +299,7 @@ public class GoodsController {
         if (!user.getRoleType().equalsIgnoreCase("2")) {
             return R.error("该操作只允许店员账户操作");
         }
-        GoodsEntity goods = goodsService.queryObjectByProdBarcodeAndBizType(prodBarcode);
+        GoodsEntity goods = goodsService.queryObjectByProdBarcodeAndBizType(prodBarcode, user.getStoreId());
         if(goods == null) {
             return R.error("商品信息不存在");
         }

+ 1 - 1
kmall-admin/src/main/java/com/kmall/admin/controller/OfflineCartController.java

@@ -118,7 +118,7 @@ public class OfflineCartController {
         offlineCartService.deleteByUserId(user.getUserId());
         List<OfflineCartEntity> cartEntityList = new ArrayList<>();
         for (OfflineCartEntity cartEntity:offlineCartEntityList) {
-            GoodsEntity goods = goodsService.queryObjectByProdBarcodeAndBizType(cartEntity.getProdBarcode());
+            GoodsEntity goods = goodsService.queryObjectByProdBarcodeAndBizType(cartEntity.getProdBarcode(), user.getStoreId());
             cartEntityList = offlineCartService.offlineGoodsCart(goods);
         }
 

+ 62 - 4
kmall-admin/src/main/java/com/kmall/admin/controller/OrderController.java

@@ -34,6 +34,8 @@ import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
 import java.math.BigDecimal;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
 import java.util.*;
 
 
@@ -71,6 +73,26 @@ public class OrderController {
         //查询列表数据
         Query query = new Query(params);
         query.put("isOnfiilineOrder", Dict.isOnfflineOrder.item_0.getItem());
+        String startTime = (String) params.get("startTime");
+        String endTime = (String) params.get("endTime");
+        if(org.apache.commons.lang.StringUtils.isNotEmpty(startTime)) {
+            try {
+                startTime = new String(startTime.getBytes("iso-8859-1"), "utf-8");
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+            startTime = getDate(startTime);
+            query.put("startTime", startTime + " 00:00:00");
+        }
+        if(org.apache.commons.lang.StringUtils.isNotEmpty(endTime)) {
+            try {
+                endTime = new String(endTime.getBytes("iso-8859-1"), "utf-8");
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+            endTime = getDate(endTime);
+            query.put("endTime", endTime + " 59:59:59");
+        }
         List<OrderEntity> orderList = orderService.queryList(query);
         int total = orderService.queryTotal(query);
 
@@ -78,7 +100,6 @@ public class OrderController {
 
         return R.ok().put("page", pageUtil);
     }
-
     /**
      * 信息
      */
@@ -686,11 +707,33 @@ public class OrderController {
         ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", false);
         //查询列表数据
         params.put("isOnfiilineOrder", Dict.isOnfflineOrder.item_0.getItem());
+
+        String startTime = (String) params.get("startTime");
+        String endTime = (String) params.get("endTime");
+        if(org.apache.commons.lang.StringUtils.isNotEmpty(startTime)) {
+            try {
+                startTime = new String(startTime.getBytes("iso-8859-1"), "utf-8");
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+            startTime = getDate(startTime);
+            params.put("startTime", startTime + " 00:00:00");
+        }
+        if(org.apache.commons.lang.StringUtils.isNotEmpty(endTime)) {
+            try {
+                endTime = new String(endTime.getBytes("iso-8859-1"), "utf-8");
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+            endTime = getDate(endTime);
+            params.put("endTime", endTime + " 59:59:59");
+        }
+
         List<OrderEntity> orderList = orderService.queryExportList(params);
 
         ExcelExport ee = new ExcelExport("订单信息");
 
-        String[] header = new String[]{"订单编号","商户订单编号", "订单状态", "实际支付金额", "SKU", "商品名称", "数量", "销售价", "保税模式", "快递公司名称", "快递单编号", "海关清单编号", "收货人姓名", "收件人手机", "收件人省份", "收件人城市", "收件人区县", "收件人地址", "下单时间"};
+        String[] header = new String[]{"订单编号","商户订单编号", "订单状态", "SKU", "商品名称", "数量", "销售价", "实际支付金额", "保税模式", "快递公司名称", "快递单编号", "海关清单编号", "收货人姓名", "收件人手机", "收件人省份", "收件人城市", "收件人区县", "收件人地址", "下单时间", "支付流水号"};
 
         List<Map<String, Object>> list = new ArrayList<>();
         if (orderList != null && orderList.size() != 0) {
@@ -702,11 +745,11 @@ public class OrderController {
                 map.put("OrderSn", orderEntity.getOrderSn());
                 map.put("MerchOrderSn", orderEntity.getMerchOrderSn());
                 map.put("OrderStatus", StringUtils.isEmpty(orderStatus.toString())? "":Dict.orderStatus.valueOf("item_"+ orderStatus).getItemName());
-                map.put("ActualPrice", orderEntity.getActualPrice());
                 map.put("SKU", orderEntity.getSku());
                 map.put("GoodsName", orderEntity.getGoodsName());
                 map.put("Number", orderEntity.getNumber());
                 map.put("RetailPrice", orderEntity.getRetailPrice());
+                map.put("ActualPrice", orderEntity.getActualPrice());
 
                 map.put("OrderBizType", StringUtils.isEmpty(orderBizType)? "":Dict.orderBizType.valueOf("item_"+orderBizType).getItemName());
                 map.put("ShippingName", orderEntity.getShippingName());
@@ -719,7 +762,8 @@ public class OrderController {
                 map.put("District", orderEntity.getDistrict());
                 map.put("Address", orderEntity.getAddress());
 
-                map.put("OrderStartTime", DateUtils.format(orderEntity.getOrderProcessRecord().getAddOrderStartTime(),"yyyy-MM-dd HH:mm:ss"));
+                map.put("OrderStartTime", orderEntity.getOrderProcessRecord()==null?"":DateUtils.format(orderEntity.getOrderProcessRecord().getAddOrderStartTime(),"yyyy-MM-dd HH:mm:ss"));
+                map.put("PayId", orderEntity.getPayTransactionId());
 
                 list.add(map);
             }
@@ -730,4 +774,18 @@ public class OrderController {
         return R.ok();
     }
 
+    private String getDate(String datdString){
+        datdString = datdString.replace("GMT", "").replaceAll("\\(.*\\)", "");
+        //将字符串转化为date类型,格式2016-10-12
+        SimpleDateFormat format = new SimpleDateFormat("EEE MMM dd yyyy HH:mm:ss z", Locale.ENGLISH);
+        Date dateTrans = null;
+        try {
+            dateTrans = format.parse(datdString);
+            return new SimpleDateFormat("yyyy-MM-dd").format(dateTrans);
+        } catch (ParseException e) {
+            e.printStackTrace();
+        }
+        return datdString;
+    }
+
 }

+ 19 - 0
kmall-admin/src/main/java/com/kmall/admin/controller/ProductStoreRelaController.java

@@ -38,6 +38,15 @@ public class ProductStoreRelaController {
     @ResponseBody
     public R list(@RequestParam Map<String, Object> params) {
         ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", false);
+        String goodsName = (String) params.get("goodsName");
+        if(org.apache.commons.lang3.StringUtils.isNotEmpty(goodsName)){
+            try{
+                goodsName = new String(goodsName.getBytes("iso-8859-1"),"utf-8");
+            }catch (Exception e){
+                e.printStackTrace();
+            }
+            params.put("goodsName", goodsName);
+        }
         //查询列表数据
         Query query = new Query(params);
 
@@ -59,6 +68,16 @@ public class ProductStoreRelaController {
 
         return R.ok().put("productStoreRela", productStoreRela);
     }
+    /**
+     * 根据商品id查看信息
+     */
+    @RequestMapping("/infoByGoodsId")
+    @ResponseBody
+    public R infoByGoodsId(@RequestParam Map<String, Object> params) {
+        ProductStoreRelaEntity productStoreRela = productStoreRelaService.queryObjectByStoreAndGoodsId(params);
+
+        return R.ok().put("productStoreRela", productStoreRela);
+    }
 
     /**
      * 保存

+ 2 - 2
kmall-admin/src/main/java/com/kmall/admin/controller/StoreController.java

@@ -104,7 +104,7 @@ public class StoreController {
         builder.put("storeName", "门店名称");
         builder.put("storeNumber", "门店编号");
         builder.put("thirdPartyMerchCode", "第三方商户编号");
-        builder.put("thirdPartyMerchName", "第三方商户名称");
+//        builder.put("thirdPartyMerchName", "第三方商户名称");
         builder.put("exprAgreementType", "第三方商户快递协议类型");
         builder.put("latitude", "纬度");
         builder.put("longitude", "经度");
@@ -134,7 +134,7 @@ public class StoreController {
         builder.put("storeName", "门店名称");
         builder.put("storeNumber", "门店编号");
         builder.put("thirdPartyMerchCode", "第三方商户编号");
-        builder.put("thirdPartyMerchName", "第三方商户名称");
+//        builder.put("thirdPartyMerchName", "第三方商户名称");
         builder.put("exprAgreementType", "第三方商户快递协议类型");
         builder.put("latitude", "纬度");
         builder.put("longitude", "经度");

+ 134 - 0
kmall-admin/src/main/java/com/kmall/admin/controller/ThirdMerchantBizController.java

@@ -0,0 +1,134 @@
+package com.kmall.admin.controller;
+
+import java.util.List;
+import java.util.Map;
+
+import com.kmall.admin.entity.StoreEntity;
+import com.kmall.admin.entity.ThirdMerchantBizEntity;
+import com.kmall.admin.service.StoreService;
+import com.kmall.admin.service.ThirdMerchantBizService;
+import com.kmall.admin.utils.ParamUtils;
+import com.kmall.common.constant.Dict;
+import com.kmall.common.entity.SysUserEntity;
+import com.kmall.common.utils.*;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.*;
+
+/**
+ * 第三方商户表Controller
+ *
+ * @author emato
+ * @email admin@qhdswl.com
+ * @date 2019-02-15 11:43:32
+ */
+@Controller
+@RequestMapping("thirdmerchantbiz")
+public class ThirdMerchantBizController {
+    @Autowired
+    private ThirdMerchantBizService thirdMerchantBizService;
+    @Autowired
+    private StoreService storeService;
+
+    /**
+     * 查看列表
+     */
+    @RequestMapping("/list")
+    @RequiresPermissions("thirdmerchantbiz:list")
+    @ResponseBody
+    public R list(@RequestParam Map<String, Object> params) {
+        //查询列表数据
+        Query query = new Query(params);
+
+        List<ThirdMerchantBizEntity> thirdMerchantBizList = thirdMerchantBizService.queryList(query);
+        int total = thirdMerchantBizService.queryTotal(query);
+
+        PageUtils pageUtil = new PageUtils(thirdMerchantBizList, total, query.getLimit(), query.getPage());
+
+        return R.ok().put("page", pageUtil);
+    }
+
+    /**
+     * 查看信息
+     */
+    @RequestMapping("/info/{thirdMerchSn}")
+    @RequiresPermissions("thirdmerchantbiz:info")
+    @ResponseBody
+    public R info(@PathVariable("thirdMerchSn") Integer thirdMerchSn) {
+        ThirdMerchantBizEntity thirdMerchantBiz = thirdMerchantBizService.queryObject(thirdMerchSn);
+
+        return R.ok().put("thirdMerchantBiz", thirdMerchantBiz);
+    }
+
+    /**
+     * 保存
+     */
+    @RequestMapping("/save")
+    @RequiresPermissions("thirdmerchantbiz:save")
+    @ResponseBody
+    public R save(@RequestBody ThirdMerchantBizEntity thirdMerchantBiz) {
+        SysUserEntity user = ShiroUtils.getUserEntity();
+        if(user != null) {
+            thirdMerchantBiz.setCreaterSn(user.getUserId().toString());
+            thirdMerchantBiz.setModerSn(user.getUserId().toString());
+        }else {
+            throw new RRException("登陆用户失效,请重新登陆!");
+        }
+        thirdMerchantBizService.save(thirdMerchantBiz);
+
+        return R.ok();
+    }
+
+    /**
+     * 修改
+     */
+    @RequestMapping("/update")
+    @RequiresPermissions("thirdmerchantbiz:update")
+    @ResponseBody
+    public R update(@RequestBody ThirdMerchantBizEntity thirdMerchantBiz) {
+        SysUserEntity user = ShiroUtils.getUserEntity();
+        if(user != null) {
+            thirdMerchantBiz.setCreaterSn(user.getUserId().toString());
+            thirdMerchantBiz.setModerSn(user.getUserId().toString());
+        }else {
+            throw new RRException("登陆用户失效,请重新登陆!");
+        }
+        thirdMerchantBizService.update(thirdMerchantBiz);
+
+        return R.ok();
+    }
+
+    /**
+     * 删除
+     */
+    @RequestMapping("/delete")
+    @RequiresPermissions("thirdmerchantbiz:delete")
+    @ResponseBody
+    public R delete(@RequestBody Integer[]thirdMerchSns) {
+        thirdMerchantBizService.deleteBatch(thirdMerchSns);
+
+        return R.ok();
+    }
+
+    /**
+     * 查看所有列表
+     */
+    @RequestMapping("/queryAll")
+    @ResponseBody
+    public R queryAll(@RequestParam Map<String, Object> params) {
+        ParamUtils.setQueryPowerByRoleType(params, null, "merchSn", true);
+        if (Dict.roleType.item_2.getItem().equals(ShiroUtils.getUserEntity().getRoleType())) {
+            StoreEntity storeEntity = storeService.queryObject(ShiroUtils.getUserEntity().getStoreId());
+            if(StringUtils.isNotEmpty(storeEntity.getThirdPartyMerchCode())) {
+                params.put("thirdPartyMerchCode", storeEntity.getThirdPartyMerchCode());
+            }else{
+                throw new RRException("请维护门店信息中的第三方商户编号信息!再进行商品查看");
+            }
+        }
+        List<ThirdMerchantBizEntity> list = thirdMerchantBizService.queryList(params);
+
+        return R.ok().put("list", list);
+    }
+}

+ 1 - 0
kmall-admin/src/main/java/com/kmall/admin/dao/BrandDao.java

@@ -15,4 +15,5 @@ import java.util.List;
  */
 public interface BrandDao extends BaseDao<BrandEntity> {
     BrandEntity queryObjectByName(@Param("brandName")String brandName,@Param("merchSn")String merchSn);
+    List<BrandEntity> queryObjectByStoreId(@Param("storeId") Long storeId);
 }

+ 1 - 0
kmall-admin/src/main/java/com/kmall/admin/dao/CategoryDao.java

@@ -15,5 +15,6 @@ import java.util.List;
  */
 public interface CategoryDao extends BaseDao<CategoryEntity> {
     CategoryEntity queryObjectByName(@Param("cateGoryName") String cateGoryName,@Param("merchSn")String merchSn);
+    List<CategoryEntity> queryObjectByStoreId(@Param("storeId") Long storeId);
 
 }

+ 1 - 0
kmall-admin/src/main/java/com/kmall/admin/dao/FreightDao.java

@@ -21,4 +21,5 @@ public interface FreightDao extends BaseDao<FreightEntity> {
     List<FreightEntity> queryEntity(Map<String, Object> map);
 
     FreightEntity queryObjectByName(@Param("defaultFreight")String defaultFreight,@Param("merchSn")String merchSn);
+    List<FreightEntity> queryObjectByStoreId(@Param("storeId") Long storeId);
 }

+ 1 - 1
kmall-admin/src/main/java/com/kmall/admin/dao/GoodsDao.java

@@ -19,7 +19,7 @@ public interface GoodsDao extends BaseDao<GoodsEntity> {
 
     GoodsEntity queryObjectBySn(String goodsSn);
 
-    GoodsEntity queryObjectByProdBarcodeAndBizType(String goodsSn);
+    GoodsEntity queryObjectByProdBarcodeAndBizType(@Param("prodBarcode")String prodBarcode, @Param("storeId")Integer storeId);
 
     List<GoodsEntity> querySame(Map<String, Object> map);
 

+ 2 - 0
kmall-admin/src/main/java/com/kmall/admin/dao/OfflineCartDao.java

@@ -3,6 +3,7 @@ package com.kmall.admin.dao;
 import com.kmall.admin.entity.OfflineCartEntity;
 import com.kmall.common.dao.BaseDao;
 import org.apache.ibatis.annotations.Param;
+import org.springframework.stereotype.Component;
 
 import java.util.List;
 import java.util.Map;
@@ -14,6 +15,7 @@ import java.util.Map;
  * @email admin@qhdswl.com
  * @date 2018-11-29 15:14:59
  */
+@Component
 public interface OfflineCartDao extends BaseDao<OfflineCartEntity> {
 
     OfflineCartEntity queryObjectByGoodsIdAndType(@Param("goodsId") Integer goodsId, @Param("userId")Long userId);

+ 12 - 3
kmall-admin/src/main/java/com/kmall/admin/dao/ProductDao.java

@@ -22,10 +22,19 @@ public interface ProductDao extends BaseDao<ProductEntity> {
     int deleteByGoodsId(Integer goodsId);
 
     /**
-     * 根据编码查询产品
+     * 根据id查询产品
      *
-     * @param goodsSn
+     * @param goodsId
      * @return
      */
-    ProductEntity queryObjectBySn(@Param("goodsSn") String goodsSn);
+    ProductEntity queryObjectByGoodsId(@Param("goodsId") String goodsId);
+
+//    /**
+//     * 根据编码查询产品
+//     *
+//     * @param goodsSn
+//     * @return
+//     */
+//    ProductEntity queryObjectBySn(@Param("goodsSn") String goodsSn);
+
 }

+ 2 - 0
kmall-admin/src/main/java/com/kmall/admin/dao/ProductStoreRelaDao.java

@@ -18,6 +18,8 @@ public interface ProductStoreRelaDao extends BaseDao<ProductStoreRelaEntity> {
 
     int deleteByGoodsId(Integer goodsId);
 
+    ProductStoreRelaEntity queryObjectByStoreAndGoodsId(Map<String, Object> params);
+
     ProductStoreRelaEntity queryByStoreIdProductId(@Param("storeId") Long storeId, @Param("productId") Long productId);
 
     ProductStoreRelaEntity queryByGoodsIdAndStoreId(@Param("storeId") Long storeId, @Param("goodsId") Long goodsId);

+ 19 - 0
kmall-admin/src/main/java/com/kmall/admin/dao/ThirdMerchantBizDao.java

@@ -0,0 +1,19 @@
+package com.kmall.admin.dao;
+
+import com.kmall.admin.entity.ThirdMerchantBizEntity;
+import com.kmall.common.dao.BaseDao;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * 第三方商户表Dao
+ *
+ * @author emato
+ * @email admin@qhdswl.com
+ * @date 2019-02-15 11:43:32
+ */
+public interface ThirdMerchantBizDao extends BaseDao<ThirdMerchantBizEntity> {
+    List<ThirdMerchantBizEntity> findByMerchSn(String merchSn);
+    ThirdMerchantBizEntity getThirdMerchangByCode(@Param("thirdMerchantCode")String thirdMerchantCode);
+}

+ 5 - 5
kmall-admin/src/main/java/com/kmall/admin/dto/GoodsDto.java

@@ -115,14 +115,14 @@ public class GoodsDto implements Serializable {
     //热销
     private String isHotStr;
 
-    private String merchSn;
+    private String thirdPartyMerchCode;
 
-    public String getMerchSn() {
-        return merchSn;
+    public String getThirdPartyMerchCode() {
+        return thirdPartyMerchCode;
     }
 
-    public void setMerchSn(String merchSn) {
-        this.merchSn = merchSn;
+    public void setThirdPartyMerchCode(String thirdPartyMerchCode) {
+        this.thirdPartyMerchCode = thirdPartyMerchCode;
     }
 
     public Integer getStoreId() {

+ 19 - 0
kmall-admin/src/main/java/com/kmall/admin/entity/AttributeEntity.java

@@ -37,6 +37,25 @@ public class AttributeEntity implements Serializable {
 
     private String merchSn;
 
+    private String storeName;
+    private String merchName;
+
+    public String getStoreName() {
+        return storeName;
+    }
+
+    public void setStoreName(String storeName) {
+        this.storeName = storeName;
+    }
+
+    public String getMerchName() {
+        return merchName;
+    }
+
+    public void setMerchName(String merchName) {
+        this.merchName = merchName;
+    }
+
     public Integer getStoreId() {
         return storeId;
     }

+ 37 - 0
kmall-admin/src/main/java/com/kmall/admin/entity/BrandEntity.java

@@ -44,6 +44,43 @@ public class BrandEntity implements Serializable {
 
     private String merchSn;
 
+    private String storeName;
+    private String merchName;
+    private Integer categoryId;
+    private String categoryName;
+
+    public String getCategoryName() {
+        return categoryName;
+    }
+
+    public void setCategoryName(String categoryName) {
+        this.categoryName = categoryName;
+    }
+
+    public Integer getCategoryId() {
+        return categoryId;
+    }
+
+    public void setCategoryId(Integer categoryId) {
+        this.categoryId = categoryId;
+    }
+
+    public String getStoreName() {
+        return storeName;
+    }
+
+    public void setStoreName(String storeName) {
+        this.storeName = storeName;
+    }
+
+    public String getMerchName() {
+        return merchName;
+    }
+
+    public void setMerchName(String merchName) {
+        this.merchName = merchName;
+    }
+
     public Integer getStoreId() {
         return storeId;
     }

+ 19 - 0
kmall-admin/src/main/java/com/kmall/admin/entity/CategoryEntity.java

@@ -50,6 +50,25 @@ public class CategoryEntity extends Tree<CategoryEntity> {
 
     private String merchSn;
 
+    private String storeName;
+    private String merchName;
+
+    public String getStoreName() {
+        return storeName;
+    }
+
+    public void setStoreName(String storeName) {
+        this.storeName = storeName;
+    }
+
+    public String getMerchName() {
+        return merchName;
+    }
+
+    public void setMerchName(String merchName) {
+        this.merchName = merchName;
+    }
+
     public Integer getStoreId() {
         return storeId;
     }

+ 19 - 0
kmall-admin/src/main/java/com/kmall/admin/entity/FreightEntity.java

@@ -45,8 +45,27 @@ public class FreightEntity implements Serializable {
 
     private String merchSn;
 
+    private String storeName;
+    private String merchName;
+
     private List<FreightItemEntity> freightItemEntityList;
 
+    public String getStoreName() {
+        return storeName;
+    }
+
+    public void setStoreName(String storeName) {
+        this.storeName = storeName;
+    }
+
+    public String getMerchName() {
+        return merchName;
+    }
+
+    public void setMerchName(String merchName) {
+        this.merchName = merchName;
+    }
+
     public Integer getStoreId() {
         return storeId;
     }

+ 51 - 22
kmall-admin/src/main/java/com/kmall/admin/entity/GoodsEntity.java

@@ -64,7 +64,7 @@ public class GoodsEntity implements Serializable {
     //商品税率
     private BigDecimal goodsRate;
     //零售价格
-    private BigDecimal retailPrice;
+//    private BigDecimal retailPrice;
     //销售量
     private Integer sellVolume;
     //主sku product_id
@@ -86,8 +86,12 @@ public class GoodsEntity implements Serializable {
     //热销
     private Integer isHot;
     //市场价
-    private BigDecimal marketPrice;
+//    private BigDecimal marketPrice;
 
+    //零售价格
+    private BigDecimal storeRetailPrice;
+    //市场价
+    private BigDecimal storeMarketPrice;
     /**
      * 产品条码
      */
@@ -175,6 +179,31 @@ public class GoodsEntity implements Serializable {
     //商户编号
     private String merchSn;
     private String merchName;
+    private String thirdPartyMerchCode;
+
+    public String getThirdPartyMerchCode() {
+        return thirdPartyMerchCode;
+    }
+
+    public void setThirdPartyMerchCode(String thirdPartyMerchCode) {
+        this.thirdPartyMerchCode = thirdPartyMerchCode;
+    }
+
+    public BigDecimal getStoreRetailPrice() {
+        return storeRetailPrice;
+    }
+
+    public void setStoreRetailPrice(BigDecimal storeRetailPrice) {
+        this.storeRetailPrice = storeRetailPrice;
+    }
+
+    public BigDecimal getStoreMarketPrice() {
+        return storeMarketPrice;
+    }
+
+    public void setStoreMarketPrice(BigDecimal storeMarketPrice) {
+        this.storeMarketPrice = storeMarketPrice;
+    }
 
     public String getMerchName() {
         return merchName;
@@ -641,19 +670,19 @@ public class GoodsEntity implements Serializable {
         this.goodsRate = goodsRate;
     }
 
-    /**
-     * 设置:零售价格
-     */
-    public void setRetailPrice(BigDecimal retailPrice) {
-        this.retailPrice = retailPrice;
-    }
-
-    /**
-     * 获取:零售价格
-     */
-    public BigDecimal getRetailPrice() {
-        return retailPrice;
-    }
+//    /**
+//     * 设置:零售价格
+//     */
+//    public void setRetailPrice(BigDecimal retailPrice) {
+//        this.retailPrice = retailPrice;
+//    }
+//
+//    /**
+//     * 获取:零售价格
+//     */
+//    public BigDecimal getRetailPrice() {
+//        return retailPrice;
+//    }
 
     /**
      * 设置:销售量
@@ -781,13 +810,13 @@ public class GoodsEntity implements Serializable {
         return isHot;
     }
 
-    public BigDecimal getMarketPrice() {
-        return marketPrice;
-    }
-
-    public void setMarketPrice(BigDecimal marketPrice) {
-        this.marketPrice = marketPrice;
-    }
+//    public BigDecimal getMarketPrice() {
+//        return marketPrice;
+//    }
+//
+//    public void setMarketPrice(BigDecimal marketPrice) {
+//        this.marketPrice = marketPrice;
+//    }
 
     public List<GoodsAttributeEntity> getAttributeEntityList() {
         return attributeEntityList;

+ 10 - 0
kmall-admin/src/main/java/com/kmall/admin/entity/OrderEntity.java

@@ -141,6 +141,16 @@ public class OrderEntity implements Serializable {
     //零售价格
     private BigDecimal retailPrice;
 
+    private String payTransactionId;
+
+    public String getPayTransactionId() {
+        return payTransactionId;
+    }
+
+    public void setPayTransactionId(String payTransactionId) {
+        this.payTransactionId = payTransactionId;
+    }
+
     public String getGoodsName() {
         return goodsName;
     }

+ 53 - 0
kmall-admin/src/main/java/com/kmall/admin/entity/ProductStoreRelaEntity.java

@@ -4,7 +4,9 @@ import com.kmall.common.utils.Constant;
 
 import java.io.Serializable;
 import java.math.BigDecimal;
+import java.util.ArrayList;
 import java.util.Date;
+import java.util.List;
 
 /**
  * 实体
@@ -87,6 +89,57 @@ public class ProductStoreRelaEntity implements Serializable {
 
     private String goodsMerchSn;
 
+    private Integer categoryId;
+
+    private Integer brandId;
+
+    private Integer freightId;
+
+    //属性类别
+    private Integer attributeCategory;
+
+    List<GoodsAttributeEntity> attributeEntityList = new ArrayList<>();
+
+    public Integer getFreightId() {
+        return freightId;
+    }
+
+    public void setFreightId(Integer freightId) {
+        this.freightId = freightId;
+    }
+
+    public Integer getCategoryId() {
+        return categoryId;
+    }
+
+    public void setCategoryId(Integer categoryId) {
+        this.categoryId = categoryId;
+    }
+
+    public Integer getBrandId() {
+        return brandId;
+    }
+
+    public void setBrandId(Integer brandId) {
+        this.brandId = brandId;
+    }
+
+    public Integer getAttributeCategory() {
+        return attributeCategory;
+    }
+
+    public void setAttributeCategory(Integer attributeCategory) {
+        this.attributeCategory = attributeCategory;
+    }
+
+    public List<GoodsAttributeEntity> getAttributeEntityList() {
+        return attributeEntityList;
+    }
+
+    public void setAttributeEntityList(List<GoodsAttributeEntity> attributeEntityList) {
+        this.attributeEntityList = attributeEntityList;
+    }
+
     public String getGoodsMerchSn() {
         return goodsMerchSn;
     }

+ 181 - 0
kmall-admin/src/main/java/com/kmall/admin/entity/ThirdMerchantBizEntity.java

@@ -0,0 +1,181 @@
+package com.kmall.admin.entity;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 第三方商户表实体
+ * 表名 third_merchant_biz
+ *
+ * @author emato
+ * @email admin@qhdswl.com
+ * @date 2019-02-15 11:43:32
+ */
+public class ThirdMerchantBizEntity implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 第三方商户编号,主键编号
+     */
+    private Integer thirdMerchSn;
+
+    private String merchSn;
+    /**
+     * 第三方商户代码
+     */
+    private String thirdPartyMerchCode;
+    /**
+     * 第三方商户名称
+     */
+    private String thirdPartyMerchName;
+    /**
+     * 是否有效,0:有效,1:无效
+     */
+    private String isValid;
+    /**
+     * 创建人序号
+     */
+    private String createrSn;
+    /**
+     * 创建时间,yyyy-MM-dd HH:mm:ss
+     */
+    private Date createTime;
+    /**
+     * 
+     */
+    private String moderSn;
+    /**
+     * 修改时间,yyyy-MM-dd HH:mm:ss
+     */
+    private Date modTime;
+    /**
+     * 时间戳
+     */
+    private Date tstm;
+
+    public String getMerchSn() {
+        return merchSn;
+    }
+
+    public void setMerchSn(String merchSn) {
+        this.merchSn = merchSn;
+    }
+
+    /**
+     * 设置:第三方商户编号,主键编号
+     */
+    public void setThirdMerchSn(Integer thirdMerchSn) {
+        this.thirdMerchSn = thirdMerchSn;
+    }
+
+    /**
+     * 获取:第三方商户编号,主键编号
+     */
+    public Integer getThirdMerchSn() {
+        return thirdMerchSn;
+    }
+    /**
+     * 设置:第三方商户代码
+     */
+    public void setThirdPartyMerchCode(String thirdPartyMerchCode) {
+        this.thirdPartyMerchCode = thirdPartyMerchCode;
+    }
+
+    /**
+     * 获取:第三方商户代码
+     */
+    public String getThirdPartyMerchCode() {
+        return thirdPartyMerchCode;
+    }
+    /**
+     * 设置:第三方商户名称
+     */
+    public void setThirdPartyMerchName(String thirdPartyMerchName) {
+        this.thirdPartyMerchName = thirdPartyMerchName;
+    }
+
+    /**
+     * 获取:第三方商户名称
+     */
+    public String getThirdPartyMerchName() {
+        return thirdPartyMerchName;
+    }
+    /**
+     * 设置:是否有效,0:有效,1:无效
+     */
+    public void setIsValid(String isValid) {
+        this.isValid = isValid;
+    }
+
+    /**
+     * 获取:是否有效,0:有效,1:无效
+     */
+    public String getIsValid() {
+        return isValid;
+    }
+    /**
+     * 设置:创建人序号
+     */
+    public void setCreaterSn(String createrSn) {
+        this.createrSn = createrSn;
+    }
+
+    /**
+     * 获取:创建人序号
+     */
+    public String getCreaterSn() {
+        return createrSn;
+    }
+    /**
+     * 设置:创建时间,yyyy-MM-dd HH:mm:ss
+     */
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    /**
+     * 获取:创建时间,yyyy-MM-dd HH:mm:ss
+     */
+    public Date getCreateTime() {
+        return createTime;
+    }
+    /**
+     * 设置:
+     */
+    public void setModerSn(String moderSn) {
+        this.moderSn = moderSn;
+    }
+
+    /**
+     * 获取:
+     */
+    public String getModerSn() {
+        return moderSn;
+    }
+    /**
+     * 设置:修改时间,yyyy-MM-dd HH:mm:ss
+     */
+    public void setModTime(Date modTime) {
+        this.modTime = modTime;
+    }
+
+    /**
+     * 获取:修改时间,yyyy-MM-dd HH:mm:ss
+     */
+    public Date getModTime() {
+        return modTime;
+    }
+    /**
+     * 设置:时间戳
+     */
+    public void setTstm(Date tstm) {
+        this.tstm = tstm;
+    }
+
+    /**
+     * 获取:时间戳
+     */
+    public Date getTstm() {
+        return tstm;
+    }
+}

+ 1 - 1
kmall-admin/src/main/java/com/kmall/admin/service/GoodsService.java

@@ -25,7 +25,7 @@ public interface GoodsService {
      */
     GoodsEntity queryObject(Integer id);
 
-    GoodsEntity queryObjectByProdBarcodeAndBizType(String prodBarcode);
+    GoodsEntity queryObjectByProdBarcodeAndBizType(String prodBarcode, Integer storeId);
     /**
      * 分页查询
      *

+ 3 - 3
kmall-admin/src/main/java/com/kmall/admin/service/ProductService.java

@@ -23,12 +23,12 @@ public interface ProductService {
     ProductEntity queryObject(Integer id);
 
     /**
-     * 根据编码查询产品
+     * 根据查询产品
      *
-     * @param goodsSn
+     * @param goodsId
      * @return 实体
      */
-    ProductEntity queryObjectBySn(String goodsSn);
+    ProductEntity queryObjectByGoodsId(String goodsId);
 
     /**
      * 分页查询

+ 3 - 0
kmall-admin/src/main/java/com/kmall/admin/service/ProductStoreRelaService.java

@@ -22,6 +22,9 @@ public interface ProductStoreRelaService {
      */
     ProductStoreRelaEntity queryObject(Integer id);
 
+    ProductStoreRelaEntity queryObjectByStoreAndGoodsId(Map<String, Object> params);
+
+
     ProductStoreRelaEntity queryByStoreIdProductId(Long storeId, Long productId);
 
     /**

+ 72 - 0
kmall-admin/src/main/java/com/kmall/admin/service/ThirdMerchantBizService.java

@@ -0,0 +1,72 @@
+package com.kmall.admin.service;
+
+import com.kmall.admin.entity.ThirdMerchantBizEntity;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 第三方商户表Service接口
+ *
+ * @author emato
+ * @email admin@qhdswl.com
+ * @date 2019-02-15 11:43:32
+ */
+public interface ThirdMerchantBizService {
+
+    /**
+     * 根据主键查询实体
+     *
+     * @param thirdMerchSn 主键
+     * @return 实体
+     */
+    ThirdMerchantBizEntity queryObject(Integer thirdMerchSn);
+
+    /**
+     * 分页查询
+     *
+     * @param map 参数
+     * @return list
+     */
+    List<ThirdMerchantBizEntity> queryList(Map<String, Object> map);
+
+    /**
+     * 分页统计总数
+     *
+     * @param map 参数
+     * @return 总数
+     */
+    int queryTotal(Map<String, Object> map);
+
+    /**
+     * 保存实体
+     *
+     * @param thirdMerchantBiz 实体
+     * @return 保存条数
+     */
+    int save(ThirdMerchantBizEntity thirdMerchantBiz);
+
+    /**
+     * 根据主键更新实体
+     *
+     * @param thirdMerchantBiz 实体
+     * @return 更新条数
+     */
+    int update(ThirdMerchantBizEntity thirdMerchantBiz);
+
+    /**
+     * 根据主键删除
+     *
+     * @param thirdMerchSn
+     * @return 删除条数
+     */
+    int delete(Integer thirdMerchSn);
+
+    /**
+     * 根据主键批量删除
+     *
+     * @param thirdMerchSns
+     * @return 删除条数
+     */
+    int deleteBatch(Integer[] thirdMerchSns);
+}

+ 9 - 7
kmall-admin/src/main/java/com/kmall/admin/service/impl/CategoryServiceImpl.java

@@ -3,8 +3,10 @@ package com.kmall.admin.service.impl;
 import com.google.common.collect.ImmutableBiMap;
 import com.kmall.admin.dao.CategoryDao;
 import com.kmall.admin.dao.GoodsDao;
+import com.kmall.admin.dao.ProductStoreRelaDao;
 import com.kmall.admin.entity.CategoryEntity;
 import com.kmall.admin.entity.GoodsEntity;
+import com.kmall.admin.entity.ProductStoreRelaEntity;
 import com.kmall.admin.service.CategoryService;
 import com.kmall.common.constant.Dict;
 import com.kmall.common.utils.MapBeanUtil;
@@ -30,7 +32,7 @@ public class CategoryServiceImpl implements CategoryService {
     @Autowired
     private CategoryDao categoryDao;
     @Autowired
-    private GoodsDao goodsDao;
+    private ProductStoreRelaDao productStoreRelaDao;
 
     @Override
     public CategoryEntity queryObject(Integer id) {
@@ -104,9 +106,9 @@ public class CategoryServiceImpl implements CategoryService {
                         map.clear();
                         map.put("categoryId", categoryEntity.getId());
                         map.put("isDelete", Dict.isDelete.item_1.getItem());
-                        List<GoodsEntity> goodsEntityList = goodsDao.queryList(map);
-                        if (goodsEntityList != null) {
-                            goodsTotal += goodsEntityList.size();
+                        List<ProductStoreRelaEntity> storeRelaEntityList = productStoreRelaDao.queryList(map);
+                        if (storeRelaEntityList != null) {
+                            goodsTotal += storeRelaEntityList.size();
                         }
                     }
 
@@ -121,9 +123,9 @@ public class CategoryServiceImpl implements CategoryService {
             } else{
                 map.clear();
                 map.put("categoryId",id);
-                List<GoodsEntity> goodsEntityList = goodsDao.queryList(map);
-                if (goodsEntityList != null && goodsEntityList.size() > 0) {
-                    throw new RRException("【" + category.getName() + "】商品类型下还有【" + goodsEntityList.size() + "】个商品,无法删除!");
+                List<ProductStoreRelaEntity> storeRelaEntityList = productStoreRelaDao.queryList(map);
+                if (storeRelaEntityList != null && storeRelaEntityList.size() > 0) {
+                    throw new RRException("【" + category.getName() + "】商品类型下还有【" + storeRelaEntityList.size() + "】个商品,无法删除!");
                 }
             }
 

+ 109 - 90
kmall-admin/src/main/java/com/kmall/admin/service/impl/GoodsServiceImpl.java

@@ -60,24 +60,26 @@ public class GoodsServiceImpl implements GoodsService {
     private ExportExceptionDataDao exportExceptionDataDao;
     @Autowired
     private CartDao cartDao;
+    @Autowired
+    private ThirdMerchantBizDao thirdMerchantBizDao;
 
     @Override
     public GoodsEntity queryObject(Integer id) {
         Map<String, Object> map = new HashMap<String, Object>();
         map.put("goodsId", id);
-        List<GoodsAttributeEntity> attributeEntities = goodsAttributeDao.queryList(map);
+//        List<GoodsAttributeEntity> attributeEntities = goodsAttributeDao.queryList(map);
         List<ProductEntity> productEntityList = productDao.queryList(map);
         GoodsEntity entity = goodsDao.queryObject(id);
-        entity.setAttributeEntityList(attributeEntities);
+//        entity.setAttributeEntityList(attributeEntities);
         entity.setProductEntityList(productEntityList);
         return entity;
     }
 
     @Override
-    public GoodsEntity queryObjectByProdBarcodeAndBizType(String prodBarcode){
+    public GoodsEntity queryObjectByProdBarcodeAndBizType(String prodBarcode, Integer storeId){
         Map<String, Object> map = new HashMap<String, Object>();
         map.put("prodBarcode", prodBarcode);
-        GoodsEntity entity = goodsDao.queryObjectByProdBarcodeAndBizType(prodBarcode);
+        GoodsEntity entity = goodsDao.queryObjectByProdBarcodeAndBizType(prodBarcode, storeId);
         return entity;
     }
     @Override
@@ -101,16 +103,17 @@ public class GoodsServiceImpl implements GoodsService {
         Map<String, Object> valideDate = MapBeanUtil.fromObject(goods);
         ImmutableBiMap.Builder builder = new ImmutableBiMap.Builder();
         builder.put("merchSn", "商户编号");
-        builder.put("attributeCategory", "商品分类");
-        builder.put("categoryId", "商品二级分类");
+        builder.put("thirdPartyMerchCode", "第三方商户编号");
+//        builder.put("attributeCategory", "商品分类");
+//        builder.put("categoryId", "商品二级分类");
         builder.put("goodsSn", "商品编码");
         builder.put("name", "商品名称");
         builder.put("goodsUnit", "商品单位");
         builder.put("prodBarcode", "产品条码");
         builder.put("goodsBizType", "货品业务类型");
-        builder.put("brandId", "品牌");
+//        builder.put("brandId", "品牌");
         builder.put("supplierId", "供应商");
-        builder.put("freightId", "运费模版");
+//        builder.put("freightId", "运费模版");
         builder.put("primaryPicUrl", "商品主图");
         builder.put("listPicUrl", "商品列表图");
         builder.put("goodsDesc", "商品描述");
@@ -125,7 +128,7 @@ public class GoodsServiceImpl implements GoodsService {
                 // 海关信息,普通货物可不添加
                 builder.put("sku", "SKU");
                 builder.put("goodsRate", "商品税率");
-                builder.put("retailPrice", "零售价");
+//                builder.put("retailPrice", "零售价");
                 builder.put("brand", "产品品牌");
                 builder.put("unitCode", "计量单位代码");
                 builder.put("cusGoodsCode", "海关商品编码");
@@ -166,7 +169,7 @@ public class GoodsServiceImpl implements GoodsService {
                 || Dict.orderBizType.item_10.getItem().equals(goods.getGoodsBizType())) {
             goods.setIsHot(0);
         }
-        goods.setAttributeCategory(categoryDao.queryObject(goods.getCategoryId()).getParentId());
+//        goods.setAttributeCategory(categoryDao.queryObject(goods.getCategoryId()).getParentId());
         goods.setAddTime(new Date());
         goods.setIsDelete(Integer.parseInt(Dict.isDelete.item_0.getItem()));
         goods.setIsNew(0);
@@ -197,7 +200,7 @@ public class GoodsServiceImpl implements GoodsService {
             galleryEntity.setFileType("1");//视频
             goodsGalleryDao.save(galleryEntity);
         }
-
+/*
         // 添加商品参数
         List<GoodsAttributeEntity> attributeEntityList = goods.getAttributeEntityList();
         if (attributeEntityList != null && attributeEntityList.size() > 0) {
@@ -214,7 +217,7 @@ public class GoodsServiceImpl implements GoodsService {
                     }
                 }
             }
-        }
+        }*/
 
         // 添加产品
         ProductEntity product = new ProductEntity();
@@ -242,16 +245,17 @@ public class GoodsServiceImpl implements GoodsService {
         Map<String, Object> valideDate = MapBeanUtil.fromObject(goods);
         ImmutableBiMap.Builder builder = new ImmutableBiMap.Builder();
         builder.put("merchSn", "商户编号");
-        builder.put("attributeCategory", "商品分类");
-        builder.put("categoryId", "商品二级分类");
+        builder.put("thirdPartyMerchCode", "第三方商户编号");
+//        builder.put("attributeCategory", "商品分类");
+//        builder.put("categoryId", "商品二级分类");
         builder.put("goodsSn", "商品编码");
         builder.put("name", "商品名称");
         builder.put("goodsUnit", "商品单位");
         builder.put("prodBarcode", "产品条码");
         builder.put("goodsBizType", "货品业务类型");
-        builder.put("brandId", "品牌");
+//        builder.put("brandId", "品牌");
         builder.put("supplierId", "供应商");
-        builder.put("freightId", "运费模版");
+//        builder.put("freightId", "运费模版");
         builder.put("primaryPicUrl", "商品主图");
         builder.put("listPicUrl", "商品列表图");
         builder.put("goodsDesc", "商品描述");
@@ -267,7 +271,7 @@ public class GoodsServiceImpl implements GoodsService {
                 // 海关信息,普通货物可不添加
                 builder.put("sku", "SKU");
                 builder.put("goodsRate", "商品税率");
-                builder.put("retailPrice", "零售价");
+//                builder.put("retailPrice", "零售价");
                 builder.put("brand", "产品品牌");
                 builder.put("unitCode", "计量单位代码");
                 builder.put("cusGoodsCode", "海关商品编码");
@@ -308,7 +312,7 @@ public class GoodsServiceImpl implements GoodsService {
                 || Dict.orderBizType.item_10.getItem().equals(goods.getGoodsBizType())) {
             goods.setIsHot(0);
         }
-        goods.setAttributeCategory(categoryDao.queryObject(goods.getCategoryId()).getParentId());
+//        goods.setAttributeCategory(categoryDao.queryObject(goods.getCategoryId()).getParentId());
         goods.setIsDelete(Integer.parseInt(Dict.isDelete.item_0.getItem()));
         goods.setIsNew(0);
         goods.setUpdateUserId(user.getUserId());
@@ -323,7 +327,7 @@ public class GoodsServiceImpl implements GoodsService {
         if (productStoreRelaEntityList != null && productStoreRelaEntityList.size() > 0) {
             for (ProductStoreRelaEntity productStoreRela : productStoreRelaEntityList) {
                 //修改该商品的所属商户信息,如在该商户门店中有该上架的商品信息,则提示该商品不能修改
-                if(org.apache.commons.lang3.StringUtils.isNotEmpty(productStoreRela.getMerchSn()) && productStoreRela.getMerchSn().equalsIgnoreCase(goods.getMerchSn())
+                /*if(org.apache.commons.lang3.StringUtils.isNotEmpty(productStoreRela.getMerchSn()) && productStoreRela.getMerchSn().equalsIgnoreCase(goods.getMerchSn())
                         && goods.getIsOnSale() == Integer.parseInt(Dict.isOnSale.item_1.getItem())) {
                     if (goods.getRetailPrice() != null) {
                         productStoreRela.setRetailPrice(goods.getRetailPrice());
@@ -345,6 +349,13 @@ public class GoodsServiceImpl implements GoodsService {
                     } else {
                         throw new RRException("商品编码为【" + goods.getGoodsSn() + "】的商品已上架在商户编号为【" + productStoreRela.getMerchSn() + "】的门店中,可先将该商品下架后再进行修改!");
                     }
+                }*/
+                if(org.apache.commons.lang3.StringUtils.isNotEmpty(productStoreRela.getMerchSn()) && productStoreRela.getMerchSn().equalsIgnoreCase(goods.getMerchSn())
+                        && goods.getIsOnSale() == Integer.parseInt(Dict.isOnSale.item_1.getItem())) {
+                }else {
+                    if (goods.getIsOnSale() != Integer.parseInt(Dict.isOnSale.item_0.getItem())) {
+                        throw new RRException("商品编码为【" + goods.getGoodsSn() + "】的商品已上架在商户编号为【" + productStoreRela.getMerchSn() + "】的门店中,可先将该商品下架后再进行修改!");
+                    }
                 }
             }
         }
@@ -354,8 +365,8 @@ public class GoodsServiceImpl implements GoodsService {
         List<CartEntity> cartList = cartDao.queryList(cartMap);
         if (cartList != null && cartList.size() > 0) {
             for (CartEntity cartEntity : cartList) {
-                cartEntity.setRetailPrice(goods.getRetailPrice());
-                cartEntity.setMarketPrice(goods.getMarketPrice());
+//                cartEntity.setRetailPrice(goods.getRetailPrice());
+//                cartEntity.setMarketPrice(goods.getMarketPrice());
                 cartEntity.setSku(goods.getSku());
                 cartEntity.setGoodsName(goods.getName());
                 cartEntity.setGoodsSn(goods.getGoodsSn());
@@ -383,8 +394,7 @@ public class GoodsServiceImpl implements GoodsService {
             goodsGalleryDao.save(galleryEntity);
         }
 
-
-        // 修改商品参数
+        /*// 修改商品参数
         List<GoodsAttributeEntity> attributeEntityList = goods.getAttributeEntityList();
         if (attributeEntityList != null && attributeEntityList.size() > 0) {
             for (GoodsAttributeEntity item : attributeEntityList) {
@@ -405,10 +415,10 @@ public class GoodsServiceImpl implements GoodsService {
                     goodsAttributeDao.delete(item.getId());
                 }
             }
-        }
+        }*/
 
         // 修改产品
-        ProductEntity product = productDao.queryObjectBySn(goods.getGoodsSn());
+        ProductEntity product = productDao.queryObjectByGoodsId(String.valueOf(goods.getId()));
 
         GoodsSpecificationEntity goodsSpecification = new GoodsSpecificationEntity();
         // 保税商品,普通货物暂不添加商品规格
@@ -543,33 +553,37 @@ public class GoodsServiceImpl implements GoodsService {
         SysUserEntity user = ShiroUtils.getUserEntity();
         String merchSn = user.getMerchSn();
         boolean isSuccess = false;
-        List<String> failSameSkuList = new ArrayList<>(), failHotGoodsSnList = new ArrayList<>(), failCateGoodsSnList = new ArrayList<>(),
-                failBrandGoodsSnList = new ArrayList<>(), failFreightGoodsSnList = new ArrayList<>(), failSuppGoodsSnList = new ArrayList<>(),
+        List<String> failSameSkuList = new ArrayList<>(), failHotGoodsSnList = new ArrayList<>(),
+                failSuppGoodsSnList = new ArrayList<>(),
                 failUnitGoodsSnList = new ArrayList<>(), failNationGoodsSnList = new ArrayList<>(),failProdbarGoodsSnList = new ArrayList<>(),
-                failCateL2GoodsSnList = new ArrayList<>(), failTypeGoodsSnList = new ArrayList<>(), failMerchGoodsSnList = new ArrayList<>(),
+                 failTypeGoodsSnList = new ArrayList<>(), failMerchGoodsSnList = new ArrayList<>(),
+//                failCateL2GoodsSnList = new ArrayList<>(),
+//                failCateGoodsSnList = new ArrayList<>(),
+//                failBrandGoodsSnList = new ArrayList<>(),
+//                failFreightGoodsSnList = new ArrayList<>(),
                 failMerchUserGoodsSnList = new ArrayList<>();
         List<String> failGoodsSnList = new ArrayList<>();
         List<String> failGoodsTypeList = new ArrayList<>();
-        List<String> failFreightList = new ArrayList<>();
+//        List<String> failFreightList = new ArrayList<>();
         if (goodsEntityList != null && goodsEntityList.size() > 0) {
             for (int i = 0; i < goodsEntityList.size(); i++) {
                 GoodsDto goodsDto = goodsEntityList.get(i);
                 GoodsEntity goodsEntity = new GoodsEntity();
                 Map<String, Object> valideDate = MapBeanUtil.fromObject(goodsDto);
                 ImmutableBiMap.Builder builder = new ImmutableBiMap.Builder();
-                builder.put("merchSn", "商户编号");
                 builder.put("goodsSn", "商品编码");
-                builder.put("categoryName", "商品分类");
+                builder.put("thirdPartyMerchCode", "第三方商户代码");
+//                builder.put("categoryName", "商品分类");
                 builder.put("goodsBizType", "货品业务类型");
                 builder.put("name", "商品名称");
-                builder.put("brandName", "商品品牌名称");
-                builder.put("defaultFreight", "运费");
+//                builder.put("brandName", "商品品牌名称");
+//                builder.put("defaultFreight", "运费");
                 builder.put("isOnSaleStr", "上架");
                 builder.put("goodsUnit", "商品单位");
                 builder.put("isHotStr", "热销");
                 builder.put("prodBarcode", "产品条码");
-                builder.put("marketPrice", "市场价");
-                builder.put("retailPrice", "零售价");
+//                builder.put("marketPrice", "市场价");
+//                builder.put("retailPrice", "零售价");
                 builder.put("supplierName", "供应商");
                 R r = ValidatorUtil.isEmpty(builder.build(), valideDate);
                 if (Integer.valueOf(r.get("code").toString()) != 0) {
@@ -601,15 +615,17 @@ public class GoodsServiceImpl implements GoodsService {
                         failTypeGoodsSnList.add(goodsDto.getSku());
                     }
                 }
-                if(!user.getRoleType().equalsIgnoreCase(Dict.roleType.item_1.getItem())) {
-                    if (!merchSn.equalsIgnoreCase(goodsDto.getMerchSn())) {
-                        isSuccess = true;
-                        failMerchUserGoodsSnList.add(goodsDto.getGoodsSn());
+                ThirdMerchantBizEntity thirdMerchantBizEntity = thirdMerchantBizDao.getThirdMerchangByCode(goodsDto.getThirdPartyMerchCode());
+                if(thirdMerchantBizEntity != null){
+                    goodsEntity.setMerchSn(thirdMerchantBizEntity.getMerchSn());
+                    goodsEntity.setThirdPartyMerchCode(thirdMerchantBizEntity.getThirdPartyMerchCode());
+
+                    if(!user.getRoleType().equalsIgnoreCase(Dict.roleType.item_1.getItem())) {
+                        if (!merchSn.equalsIgnoreCase(thirdMerchantBizEntity.getMerchSn())) {
+                            isSuccess = true;
+                            failMerchUserGoodsSnList.add(goodsDto.getGoodsSn());
+                        }
                     }
-                }
-                MerchEntity merchEntity = merchDao.findByMerchSn(goodsDto.getMerchSn());
-                if(merchEntity != null){
-                    goodsEntity.setMerchSn(merchEntity.getMerchSn());
                 }else{//商户不存在
                     isSuccess = true;
                     failMerchGoodsSnList.add(goodsDto.getGoodsSn());
@@ -646,8 +662,17 @@ public class GoodsServiceImpl implements GoodsService {
                         failHotGoodsSnList.add(goodsDto.getGoodsSn());
                     }
                 }
+                if(thirdMerchantBizEntity != null) {
+                    SupplierEntity supplierEntity = supplierDao.queryObjectByName(goodsDto.getSupplierName(), thirdMerchantBizEntity.getMerchSn());
+                    if (supplierEntity == null) {
+                        isSuccess = true;
+                        failSuppGoodsSnList.add(goodsDto.getGoodsSn());
+                    } else {
+                        goodsEntity.setSupplierId(supplierEntity.getId());
+                    }
+                }
                 //商品配置校验
-                CategoryEntity categoryEntity = categoryDao.queryObjectByName(goodsDto.getCategoryName(),goodsDto.getMerchSn());
+                /*CategoryEntity categoryEntity = categoryDao.queryObjectByName(goodsDto.getCategoryName(),goodsDto.getMerchSn());
                 if(categoryEntity==null){
                     isSuccess = true;
                     failCateGoodsSnList.add(goodsDto.getGoodsSn());
@@ -675,15 +700,8 @@ public class GoodsServiceImpl implements GoodsService {
                     failFreightList.add(goodsDto.getDefaultFreight());
                 }else {
                     goodsEntity.setFreightId(freightEntity.getId());
-                }
+                }*/
                 if (!Dict.orderBizType.item_11.getItem().equals(goodsDto.getGoodsBizType())) {
-                    SupplierEntity supplierEntity = supplierDao.queryObjectByName(goodsDto.getSupplierName(),goodsDto.getMerchSn());
-                    if (supplierEntity == null) {
-                        isSuccess = true;
-                        failSuppGoodsSnList.add(goodsDto.getGoodsSn());
-                    } else {
-                        goodsEntity.setSupplierId(supplierEntity.getId());
-                    }
                     SysCusUnitCodeEntity sysCusUnitCodeEntity = sysCusUnitCodeDao.queryObjectByName(goodsDto.getUnitName());
                     if (sysCusUnitCodeEntity == null) {
                         isSuccess = true;
@@ -703,8 +721,8 @@ public class GoodsServiceImpl implements GoodsService {
                 }
                 goodsEntity.setIsOnSale(Integer.parseInt(goodsDto.getIsOnSaleStr()));
                 goodsEntity.setIsHot(Integer.parseInt(goodsDto.getIsHotStr()));
-                goodsEntity.setRetailPrice(BigDecimal.valueOf(Integer.valueOf(goodsDto.getRetailPrice())));
-                goodsEntity.setMarketPrice(BigDecimal.valueOf(Integer.valueOf(goodsDto.getMarketPrice())));
+//                goodsEntity.setRetailPrice(BigDecimal.valueOf(Integer.valueOf(goodsDto.getRetailPrice())));
+//                goodsEntity.setMarketPrice(BigDecimal.valueOf(Integer.valueOf(goodsDto.getMarketPrice())));
                 goodsEntity.setGoodsSn(goodsDto.getGoodsSn());
                 goodsEntity.setSku(goodsDto.getSku());
                 goodsEntity.setName(goodsDto.getName());
@@ -731,41 +749,42 @@ public class GoodsServiceImpl implements GoodsService {
                     }else{
                         goodsDao.save(goodsEntity);
                     }
-                    // 保税商品修改各个门店商品价格
-                    if (!Dict.orderBizType.item_11.getItem().equals(goodsDto.getGoodsBizType())) {
-                        List<ProductStoreRelaEntity> productStoreRelaEntityList = productStoreRelaDao.queryByGoodsId(goodsDto.getId());
-                        if (productStoreRelaEntityList != null && productStoreRelaEntityList.size() > 0) {
-                            for (ProductStoreRelaEntity productStoreRela : productStoreRelaEntityList) {
-                                productStoreRela.setMarketPrice(goodsEntity.getMarketPrice());
-                                productStoreRela.setRetailPrice(goodsEntity.getRetailPrice());
-                                productStoreRelaDao.update(productStoreRela);
-                            }
-                        }
-                    }
+//                    // 保税商品修改各个门店商品价格
+//                    if (!Dict.orderBizType.item_11.getItem().equals(goodsDto.getGoodsBizType())) {
+//                        List<ProductStoreRelaEntity> productStoreRelaEntityList = productStoreRelaDao.queryByGoodsId(goodsDto.getId());
+//                        if (productStoreRelaEntityList != null && productStoreRelaEntityList.size() > 0) {
+//                            for (ProductStoreRelaEntity productStoreRela : productStoreRelaEntityList) {
+//                                productStoreRela.setMarketPrice(goodsEntity.getMarketPrice());
+//                                productStoreRela.setRetailPrice(goodsEntity.getRetailPrice());
+//                                productStoreRelaDao.update(productStoreRela);
+//                            }
+//                        }
+//                    }
                     // 修改产品
-                    ProductEntity product = productDao.queryObjectBySn(goodsDto.getGoodsSn());
+                    ProductEntity product = productDao.queryObjectByGoodsId(String.valueOf(goodsEntity.getId()));
 
                     GoodsSpecificationEntity goodsSpecification = new GoodsSpecificationEntity();
                     // 保税商品,普通货物暂不添加商品规格
                     if (!Dict.orderBizType.item_11.getItem().equals(goodsDto.getGoodsBizType())) {
                         // 添加商品规格
                         GoodsSpecificationEntity specificationEntity = goodsSpecificationDao.queryByGoodsId(goodsEntity.getId());
-                        if(specificationEntity ==null) {
+                        if(specificationEntity == null) {
                             goodsSpecification.setGoodsId(goodsEntity.getId());
                             goodsSpecification.setValue(goodsEntity.getCiqProdModel());
                             goodsSpecification.setSpecificationId(1);
                             goodsSpecificationDao.save(goodsSpecification);
                         }else {
                             goodsSpecification.setValue(goodsDto.getCiqProdModel());
+                            goodsSpecification.setId(specificationEntity.getId());
                             goodsSpecificationDao.update(goodsSpecification);
                         }
+                        product.setGoodsSpecificationNameValue(goodsSpecification.getValue());
+                        product.setGoodsSpecificationIds(goodsSpecification.getId().toString());
                     }
 
                     if(product == null){
                         product = new ProductEntity();
                         product.setGoodsSn(goodsDto.getGoodsSn());
-                        product.setGoodsSpecificationNameValue(goodsSpecification.getValue());
-                        product.setGoodsSpecificationIds(goodsSpecification.getId().toString());
                         product.setGoodsId(goodsEntity.getId());
                         product.setGoodsDefault(0);
                         product.setGoodsNumber(goodsEntity.getGoodsNumber());
@@ -795,7 +814,7 @@ public class GoodsServiceImpl implements GoodsService {
                 throw new RRException("导入数据异常,异常信息请在商品管理》》商品导入异常数据中查看检查");
             }
             if(failMerchGoodsSnList != null && failMerchGoodsSnList.size() > 0){
-                exportExceptionDataEntity.setExportExceptionData("商户编号不存在,请检查商品编码【"+failMerchGoodsSnList+"】的商品信息,请先维护用户商户编号信息再继续操作!");
+                exportExceptionDataEntity.setExportExceptionData("第三方商户代码不存在,请在商城配置》第三方商户管理中维护,请检查商品编码【"+failMerchGoodsSnList+"】的商品信息,请先维护再继续操作!");
                 exportExceptionDataDao.save(exportExceptionDataEntity);
                 throw new RRException("导入数据异常,异常信息请在商品管理》》商品导入异常数据中查看检查");
             }
@@ -827,26 +846,26 @@ public class GoodsServiceImpl implements GoodsService {
                 exportExceptionDataDao.save(exportExceptionDataEntity);
                 throw new RRException("导入数据异常,异常信息请在商品管理》》商品导入异常数据中查看检查");
             }
-            if(failCateGoodsSnList != null && failCateGoodsSnList.size() > 0){
-                exportExceptionDataEntity.setExportExceptionData("分类信息请在商城配置》商品分类中维护,商品分类与商户信息对应,请检查该商品商户信息下的分类是否维护,不存在的商品编码【"+failCateGoodsSnList+"】");
-                exportExceptionDataDao.save(exportExceptionDataEntity);
-                throw new RRException("导入数据异常,异常信息请在商品管理》》商品导入异常数据中查看检查");
-            }
-            if(failCateL2GoodsSnList != null && failCateL2GoodsSnList.size() > 0){
-                exportExceptionDataEntity.setExportExceptionData("分类信息请在商城配置》商品分类中查看,商品分类必须为二级分类,不存在的商品编码【"+failCateL2GoodsSnList+"】");
-                exportExceptionDataDao.save(exportExceptionDataEntity);
-                throw new RRException("导入数据异常,异常信息请在商品管理》》商品导入异常数据中查看检查");
-            }
-            if(failBrandGoodsSnList != null && failBrandGoodsSnList.size() > 0){
-                exportExceptionDataEntity.setExportExceptionData("品牌信息请在商城配置》品牌制造商中维护,品牌与商户信息对应,请检查该商品商户信息下的品牌是否维护,不存在的商品编码【" + failBrandGoodsSnList + "】");
-                exportExceptionDataDao.save(exportExceptionDataEntity);
-                throw new RRException("导入数据异常,异常信息请在商品管理》》商品导入异常数据中查看检查");
-            }
-            if(failFreightGoodsSnList != null && failFreightGoodsSnList.size() > 0){
-                exportExceptionDataEntity.setExportExceptionData("运费信息请在商城配置》运费模板中维护,运费与商户信息对应,请检查该商品商户信息下的运费是否维护,不存在的商品编码【"+failFreightGoodsSnList+"】,运费【"+failFreightList+"】");
-                exportExceptionDataDao.save(exportExceptionDataEntity);
-                throw new RRException("导入数据异常,异常信息请在商品管理》》商品导入异常数据中查看检查");
-            }
+//            if(failCateGoodsSnList != null && failCateGoodsSnList.size() > 0){
+//                exportExceptionDataEntity.setExportExceptionData("分类信息请在商城配置》商品分类中维护,商品分类与商户信息对应,请检查该商品商户信息下的分类是否维护,不存在的商品编码【"+failCateGoodsSnList+"】");
+//                exportExceptionDataDao.save(exportExceptionDataEntity);
+//                throw new RRException("导入数据异常,异常信息请在商品管理》》商品导入异常数据中查看检查");
+//            }
+//            if(failCateL2GoodsSnList != null && failCateL2GoodsSnList.size() > 0){
+//                exportExceptionDataEntity.setExportExceptionData("分类信息请在商城配置》商品分类中查看,商品分类必须为二级分类,不存在的商品编码【"+failCateL2GoodsSnList+"】");
+//                exportExceptionDataDao.save(exportExceptionDataEntity);
+//                throw new RRException("导入数据异常,异常信息请在商品管理》》商品导入异常数据中查看检查");
+//            }
+//            if(failBrandGoodsSnList != null && failBrandGoodsSnList.size() > 0){
+//                exportExceptionDataEntity.setExportExceptionData("品牌信息请在商城配置》品牌制造商中维护,品牌与商户信息对应,请检查该商品商户信息下的品牌是否维护,不存在的商品编码【" + failBrandGoodsSnList + "】");
+//                exportExceptionDataDao.save(exportExceptionDataEntity);
+//                throw new RRException("导入数据异常,异常信息请在商品管理》》商品导入异常数据中查看检查");
+//            }
+//            if(failFreightGoodsSnList != null && failFreightGoodsSnList.size() > 0){
+//                exportExceptionDataEntity.setExportExceptionData("运费信息请在商城配置》运费模板中维护,运费与商户信息对应,请检查该商品商户信息下的运费是否维护,不存在的商品编码【"+failFreightGoodsSnList+"】,运费【"+failFreightList+"】");
+//                exportExceptionDataDao.save(exportExceptionDataEntity);
+//                throw new RRException("导入数据异常,异常信息请在商品管理》》商品导入异常数据中查看检查");
+//            }
             if(failSuppGoodsSnList != null && failSuppGoodsSnList.size() > 0){
                 exportExceptionDataEntity.setExportExceptionData("供应商信息请在商城配置》商品供应商中维护,供应商与商户信息对应,请检查该商品商户信息下的供应商是否维护,不存在的商品编码【" + failSuppGoodsSnList + "】");
                 exportExceptionDataDao.save(exportExceptionDataEntity);

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

@@ -84,8 +84,8 @@ public class OfflineCartServiceImpl implements OfflineCartService {
             cartEntity.setProdBarcode(goods.getProdBarcode());
             cartEntity.setSku(goods.getSku());
             cartEntity.setProductId(Integer.parseInt(goods.getProductId()));
-            cartEntity.setMarketPrice(goods.getMarketPrice());
-            cartEntity.setRetailPrice(goods.getRetailPrice());
+            cartEntity.setMarketPrice(goods.getStoreMarketPrice());
+            cartEntity.setRetailPrice(goods.getStoreRetailPrice());
             cartEntity.setNumber(1);
             cartEntity.setStockNum(Integer.parseInt(goods.getStockNum()));
             cartEntity.setListPicUrl(goods.getListPicUrl());

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

@@ -31,8 +31,8 @@ public class ProductServiceImpl implements ProductService {
     }
 
     @Override
-    public ProductEntity queryObjectBySn(String goodsSn) {
-        return productDao.queryObjectBySn(goodsSn);
+    public ProductEntity queryObjectByGoodsId(String goodsId) {
+        return productDao.queryObjectByGoodsId(goodsId);
     }
 
     @Override

+ 103 - 25
kmall-admin/src/main/java/com/kmall/admin/service/impl/ProductStoreRelaServiceImpl.java

@@ -37,10 +37,32 @@ public class ProductStoreRelaServiceImpl implements ProductStoreRelaService {
     private GoodsGalleryDao goodsGalleryDao;
     @Autowired
     private CartDao cartDao;
+    @Autowired
+    private BrandDao brandDao;
+    @Autowired
+    private FreightDao freightDao;
+    @Autowired
+    private CategoryDao categoryDao;
+    @Autowired
+    private GoodsAttributeDao goodsAttributeDao;
+    @Autowired
+    private AttributeDao attributeDao;
 
     @Override
     public ProductStoreRelaEntity queryObject(Integer id) {
-        return productStoreRelaDao.queryObject(id);
+        ProductStoreRelaEntity productStoreRelaEntity = productStoreRelaDao.queryObject(id);
+
+        Map<String, Object> map = new HashMap<String, Object>();
+        map.put("goodsId", productStoreRelaEntity.getGoodsId());
+        List<GoodsAttributeEntity> attributeEntities = goodsAttributeDao.queryList(map);
+        productStoreRelaEntity.setAttributeEntityList(attributeEntities);
+
+        return productStoreRelaEntity;
+    }
+
+    @Override
+    public ProductStoreRelaEntity queryObjectByStoreAndGoodsId(Map<String, Object> params){
+        return productStoreRelaDao.queryObjectByStoreAndGoodsId(params);
     }
 
     @Override
@@ -66,6 +88,10 @@ public class ProductStoreRelaServiceImpl implements ProductStoreRelaService {
         builder.put("storeId", "门店");
         builder.put("goodsId", "商品");
         builder.put("stockNum", "库存");
+        builder.put("attributeCategory", "一级分类");
+        builder.put("categoryId", "二级分类");
+        builder.put("brandId", "品牌");
+        builder.put("freightId", "运费模版");
 
         R r = ValidatorUtil.isEmpty(builder.build(), valideDate);
         if (Integer.valueOf(r.get("code").toString()) != 0) {
@@ -75,13 +101,15 @@ public class ProductStoreRelaServiceImpl implements ProductStoreRelaService {
             if (Dict.orderBizType.item_11.getItem().equals(goodsEntity.getGoodsBizType())) {
                 // 普通商品校验商品规格
                 builder.put("specification", "规格");
-                builder.put("retailPrice", "零售价");
-                builder.put("marketPrice", "市场价");
             }
+            builder.put("retailPrice", "零售价");
+            builder.put("marketPrice", "市场价");
             r = ValidatorUtil.isEmpty(builder.build(), valideDate);
             if (Integer.valueOf(r.get("code").toString()) != 0) {
                 throw new RRException(r.get("msg").toString());
             }
+
+            //商品配置校验
             if(!StringUtils.isNotEmpty(goodsEntity.getListPicUrl())){
                 throw new RRException("该商品列表图不能为空!请先在商品管理》所有商品中维护商品编号为【"+goodsEntity.getGoodsSn()+"】的商品列表图信息,再来操作门店商品数据");
             }
@@ -93,7 +121,9 @@ public class ProductStoreRelaServiceImpl implements ProductStoreRelaService {
                 throw new RRException("该商品轮播图不能为空!请先在商品管理》所有商品中维护商品编号为【"+goodsEntity.getGoodsSn()+"】的商品详情轮播图信息,再来操作门店商品数据");
             }
         }
-
+        if(!goodsEntity.getMerchSn().equalsIgnoreCase(productStoreRela.getMerchSn())) {
+            throw new RRException("该商品所属商户不属于该门店所属商户!");
+        }
         Map<String, Object> map = new HashMap();
         map.put("goodsId", goodsEntity.getId());
         map.put("storeId", productStoreRela.getStoreId());
@@ -103,14 +133,15 @@ public class ProductStoreRelaServiceImpl implements ProductStoreRelaService {
         }
 
         SysUserEntity user = ShiroUtils.getUserEntity();
-        ProductEntity product = productDao.queryObjectBySn(goodsEntity.getGoodsSn());
-        if (Dict.orderBizType.item_11.getItem().equals(goodsEntity.getGoodsBizType())) {
-            GoodsEntity goods = new GoodsEntity();
-            goods.setRetailPrice(productStoreRela.getRetailPrice());
-            goods.setMarketPrice(productStoreRela.getMarketPrice());
-            goods.setId(goodsEntity.getId());
-            goodsDao.update(goods);
+        ProductEntity product = productDao.queryObjectByGoodsId(String.valueOf(goodsEntity.getId()));
+
+//        GoodsEntity goods = new GoodsEntity();
+//        goods.setRetailPrice(productStoreRela.getRetailPrice());
+//        goods.setMarketPrice(productStoreRela.getMarketPrice());
+//        goods.setId(goodsEntity.getId());
+//        goodsDao.update(goods);
 
+        if (Dict.orderBizType.item_11.getItem().equals(goodsEntity.getGoodsBizType())) {
             GoodsSpecificationEntity goodsSpecificationEntity = goodsSpecificationDao.queryByGoodsId(goodsEntity.getId());
             if(goodsSpecificationEntity != null){
                 goodsSpecificationDao.delete(goodsSpecificationEntity.getId());
@@ -121,17 +152,34 @@ public class ProductStoreRelaServiceImpl implements ProductStoreRelaService {
             goodsSpecification.setValue(productStoreRela.getSpecification());
             goodsSpecification.setSpecificationId(1);
             goodsSpecificationDao.save(goodsSpecification);
-
             // 修改产品
             product.setGoodsSpecificationIds(goodsSpecification.getId().toString());
             product.setGoodsSpecificationNameValue(goodsSpecification.getValue());
             productDao.update(product);
-
-        } else {
+        }/* else {
             productStoreRela.setRetailPrice(goodsEntity.getRetailPrice());
             productStoreRela.setMarketPrice(goodsEntity.getMarketPrice());
+        }*/
+
+        // 添加商品参数
+        List<GoodsAttributeEntity> attributeEntityList = productStoreRela.getAttributeEntityList();
+        if (attributeEntityList != null && attributeEntityList.size() > 0) {
+            for (GoodsAttributeEntity item : attributeEntityList) {
+                if (item.getIsDelete() == 0) {
+                    if (item.getId() == null && item.getAttributeId() != null && com.kmall.common.utils.StringUtils.isNotEmpty(item.getValue())) {
+                        item.setGoodsId(goodsEntity.getId());
+                        item.setMerchSn(goodsEntity.getMerchSn());
+                        goodsAttributeDao.save(item);
+                    } else if (item.getId() == null && item.getAttributeId() != null && com.kmall.common.utils.StringUtils.isNullOrEmpty(item.getValue())) {
+                        throw new RRException("商品属性【" + attributeDao.queryObject(item.getAttributeId()).getName() + "】值不能为空!");
+                    } else if (item.getId() == null && item.getAttributeId() == null) {
+                        continue;
+                    }
+                }
+            }
         }
 
+        productStoreRela.setAttributeCategory(categoryDao.queryObject(productStoreRela.getCategoryId()).getParentId());
         productStoreRela.setProductId(product.getId());
         productStoreRela.setGoodsBizType(goodsEntity.getGoodsBizType());
         productStoreRela.setSku(goodsEntity.getSku());
@@ -139,6 +187,7 @@ public class ProductStoreRelaServiceImpl implements ProductStoreRelaService {
         productStoreRela.setCreateTime(new Date());
         productStoreRela.setModerSn(user.getUserId().toString());
         productStoreRela.setModTime(new Date());
+        productStoreRela.setGoodsBizType(goodsEntity.getGoodsBizType());
         return productStoreRelaDao.save(productStoreRela);
     }
 
@@ -154,6 +203,10 @@ public class ProductStoreRelaServiceImpl implements ProductStoreRelaService {
         builder.put("storeId", "门店");
         builder.put("goodsId", "商品");
         builder.put("stockNum", "库存");
+        builder.put("attributeCategory", "一级分类");
+        builder.put("categoryId", "二级分类");
+        builder.put("brandId", "品牌");
+        builder.put("freightId", "运费模版");
 
         R r = ValidatorUtil.isEmpty(builder.build(), valideDate);
         if (Integer.valueOf(r.get("code").toString()) != 0) {
@@ -163,15 +216,19 @@ public class ProductStoreRelaServiceImpl implements ProductStoreRelaService {
             if (Dict.orderBizType.item_11.getItem().equals(goodsEntity.getGoodsBizType())) {
                 // 普通商品校验商品规格
                 builder.put("specification", "规格");
-                builder.put("retailPrice", "零售价");
-                builder.put("marketPrice", "市场价");
             }
+            builder.put("retailPrice", "零售价");
+            builder.put("marketPrice", "市场价");
             r = ValidatorUtil.isEmpty(builder.build(), valideDate);
             if (Integer.valueOf(r.get("code").toString()) != 0) {
                 throw new RRException(r.get("msg").toString());
             }
         }
 
+        if(!goodsEntity.getMerchSn().equalsIgnoreCase(productStoreRela.getMerchSn())) {
+            throw new RRException("该商品所属商户不属于该门店所属商户!");
+        }
+
         Map<String, Object> map = new HashMap();
         map.put("goodsId", goodsEntity.getId());
         map.put("storeId", productStoreRela.getStoreId());
@@ -182,26 +239,45 @@ public class ProductStoreRelaServiceImpl implements ProductStoreRelaService {
         }
 
         SysUserEntity user = ShiroUtils.getUserEntity();
+//        GoodsEntity goods = new GoodsEntity();
+//        goods.setRetailPrice(productStoreRela.getRetailPrice());
+//        goods.setMarketPrice(productStoreRela.getMarketPrice());
+//        goods.setId(goodsEntity.getId());
+//        goodsDao.update(goods);
         if (Dict.orderBizType.item_11.getItem().equals(goodsEntity.getGoodsBizType())) {
-            GoodsEntity goods = new GoodsEntity();
-            goods.setRetailPrice(productStoreRela.getRetailPrice());
-            goods.setMarketPrice(productStoreRela.getMarketPrice());
-            goods.setId(goodsEntity.getId());
-            goodsDao.update(goods);
             // 添加商品规格
             GoodsSpecificationEntity goodsSpecification = goodsSpecificationDao.queryByGoodsId(goodsEntity.getId());
             goodsSpecification.setValue(productStoreRela.getSpecification());
             goodsSpecificationDao.update(goodsSpecification);
 
             // 修改产品
-            ProductEntity product = productDao.queryObjectBySn(goodsEntity.getGoodsSn());
+            ProductEntity product = productDao.queryObjectByGoodsId(String.valueOf(goodsEntity.getId()));
             product.setGoodsSpecificationIds(goodsSpecification.getId().toString());
             product.setGoodsSpecificationNameValue(goodsSpecification.getValue());
             productDao.update(product);
-        } else {
-            productStoreRela.setRetailPrice(goodsEntity.getRetailPrice());
         }
-
+        // 修改商品参数
+        List<GoodsAttributeEntity> attributeEntityList = productStoreRela.getAttributeEntityList();
+        if (attributeEntityList != null && attributeEntityList.size() > 0) {
+            for (GoodsAttributeEntity item : attributeEntityList) {
+                if (item.getIsDelete() == 0) {
+                    if (item.getId() != null) {
+                        item.setMerchSn(goodsEntity.getMerchSn());
+                        goodsAttributeDao.update(item);
+                    } else if (item.getId() == null && item.getAttributeId() != null && com.kmall.common.utils.StringUtils.isNotEmpty(item.getValue())) {
+                        item.setMerchSn(goodsEntity.getMerchSn());
+                        item.setGoodsId(goodsEntity.getId());
+                        goodsAttributeDao.save(item);
+                    } else if (item.getId() == null && item.getAttributeId() != null && com.kmall.common.utils.StringUtils.isNullOrEmpty(item.getValue())) {
+                        throw new RRException("商品属性【" + attributeDao.queryObject(item.getAttributeId()).getName() + "】值不能为空!");
+                    } else if (item.getId() == null && item.getAttributeId() == null) {
+                        continue;
+                    }
+                } else if (item.getIsDelete() == 1) {
+                    goodsAttributeDao.delete(item.getId());
+                }
+            }
+        }
         Map cartMap = new HashMap();
         cartMap.put("goodsId",goodsEntity.getId());
         List<CartEntity> cartList = cartDao.queryList(cartMap);
@@ -217,8 +293,10 @@ public class ProductStoreRelaServiceImpl implements ProductStoreRelaService {
             }
         }
 
+        productStoreRela.setAttributeCategory(categoryDao.queryObject(productStoreRela.getCategoryId()).getParentId());
         productStoreRela.setModerSn(user.getUserId().toString());
         productStoreRela.setModTime(new Date());
+        productStoreRela.setGoodsBizType(goodsEntity.getGoodsBizType());
         return productStoreRelaDao.update(productStoreRela);
     }
 

+ 24 - 0
kmall-admin/src/main/java/com/kmall/admin/service/impl/StoreServiceImpl.java

@@ -2,8 +2,10 @@ package com.kmall.admin.service.impl;
 
 import com.kmall.admin.dao.MerchDao;
 import com.kmall.admin.dao.StoreDao;
+import com.kmall.admin.dao.ThirdMerchantBizDao;
 import com.kmall.admin.entity.MerchEntity;
 import com.kmall.admin.entity.StoreEntity;
+import com.kmall.admin.entity.ThirdMerchantBizEntity;
 import com.kmall.admin.service.StoreService;
 import com.kmall.api.service.merch.OmsMerchPropertiesBuilder;
 import com.kmall.common.utils.RRException;
@@ -27,6 +29,8 @@ public class StoreServiceImpl implements StoreService {
     private StoreDao storeDao;
     @Autowired
     private MerchDao merchDao;
+    @Autowired
+    private ThirdMerchantBizDao thirdMerchantBizDao;
 
     @Override
     public StoreEntity queryObject(Integer id) {
@@ -57,6 +61,16 @@ public class StoreServiceImpl implements StoreService {
                 throw new RRException("商户编号不存在,请先维护用户商户编号信息再来操作");
             }
         }
+        if(StringUtils.isEmpty(store.getThirdPartyMerchCode())){
+            throw new RRException("第三方商户编号不能为空");
+        }else{
+            ThirdMerchantBizEntity thirdMerchantBizEntity = thirdMerchantBizDao.getThirdMerchangByCode(store.getThirdPartyMerchCode());
+            if(thirdMerchantBizEntity != null){
+                store.setThirdPartyMerchName(thirdMerchantBizEntity.getThirdPartyMerchName());
+            }else{
+                throw new RRException("第三方商户编号【"+store.getThirdPartyMerchCode()+"】不存在,请先维护第三方商户信息再来操作");
+            }
+        }
         return storeDao.save(store);
     }
 
@@ -72,6 +86,16 @@ public class StoreServiceImpl implements StoreService {
                 throw new RRException("商户编号不存在,请先维护用户商户编号信息再来操作");
             }
         }
+        if(StringUtils.isEmpty(store.getThirdPartyMerchCode())){
+            throw new RRException("第三方商户编号不能为空");
+        }else{
+            ThirdMerchantBizEntity thirdMerchantBizEntity = thirdMerchantBizDao.getThirdMerchangByCode(store.getThirdPartyMerchCode());
+            if(thirdMerchantBizEntity != null){
+                store.setThirdPartyMerchName(thirdMerchantBizEntity.getThirdPartyMerchName());
+            }else{
+                throw new RRException("第三方商户编号【"+store.getThirdPartyMerchCode()+"】不存在,请先维护第三方商户信息再来操作");
+            }
+        }
         return storeDao.update(store);
     }
 

+ 71 - 0
kmall-admin/src/main/java/com/kmall/admin/service/impl/ThirdMerchantBizServiceImpl.java

@@ -0,0 +1,71 @@
+package com.kmall.admin.service.impl;
+
+import com.kmall.admin.dao.ThirdMerchantBizDao;
+import com.kmall.admin.entity.ThirdMerchantBizEntity;
+import com.kmall.admin.service.ThirdMerchantBizService;
+import com.kmall.common.utils.RRException;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 第三方商户表Service实现类
+ *
+ * @author emato
+ * @email admin@qhdswl.com
+ * @date 2019-02-15 11:43:32
+ */
+@Service("thirdMerchantBizService")
+public class ThirdMerchantBizServiceImpl implements ThirdMerchantBizService {
+    @Autowired
+    private ThirdMerchantBizDao thirdMerchantBizDao;
+
+    @Override
+    public ThirdMerchantBizEntity queryObject(Integer thirdMerchSn) {
+        return thirdMerchantBizDao.queryObject(thirdMerchSn);
+    }
+
+    @Override
+    public List<ThirdMerchantBizEntity> queryList(Map<String, Object> map) {
+        return thirdMerchantBizDao.queryList(map);
+    }
+
+    @Override
+    public int queryTotal(Map<String, Object> map) {
+        return thirdMerchantBizDao.queryTotal(map);
+    }
+
+    @Override
+    public int save(ThirdMerchantBizEntity thirdMerchantBiz) {
+        ThirdMerchantBizEntity thirdMerchantBizEntity = thirdMerchantBizDao.getThirdMerchangByCode(thirdMerchantBiz.getThirdPartyMerchCode());
+        if(thirdMerchantBizEntity != null){
+            throw new RRException("第三方商户编号为【"+thirdMerchantBiz.getThirdPartyMerchCode()+"】的第三方商户信息已存在");
+        }
+        thirdMerchantBiz.setCreateTime(new Date());
+        thirdMerchantBiz.setModTime(new Date());
+        return thirdMerchantBizDao.save(thirdMerchantBiz);
+    }
+
+    @Override
+    public int update(ThirdMerchantBizEntity thirdMerchantBiz) {
+        ThirdMerchantBizEntity thirdMerchantBizEntity = thirdMerchantBizDao.getThirdMerchangByCode(thirdMerchantBiz.getThirdPartyMerchCode());
+        if (thirdMerchantBizEntity != null && !thirdMerchantBizEntity.getThirdMerchSn().equals(thirdMerchantBiz.getThirdMerchSn())) {
+            throw new RRException("第三方商户编号为【"+thirdMerchantBiz.getThirdPartyMerchCode()+"】的第三方商户信息已存在");
+        }
+        thirdMerchantBiz.setModTime(new Date());
+        return thirdMerchantBizDao.update(thirdMerchantBiz);
+    }
+
+    @Override
+    public int delete(Integer thirdMerchSn) {
+        return thirdMerchantBizDao.delete(thirdMerchSn);
+    }
+
+    @Override
+    public int deleteBatch(Integer[]thirdMerchSns) {
+        return thirdMerchantBizDao.deleteBatch(thirdMerchSns);
+    }
+}

+ 13 - 13
kmall-admin/src/main/resources/XmlTemplate/GeneralGoodsDtoList.xml

@@ -6,19 +6,19 @@
               varType="com.kmall.admin.dto.GoodsDto">
             <section startRow="1" endRow="1">
                 <mapping row="1" col="0">GoodsDto.goodsSn</mapping>
-                <mapping row="1" col="1">GoodsDto.merchSn</mapping>
-                <mapping row="1" col="2">GoodsDto.categoryName</mapping>
-                <mapping row="1" col="3">GoodsDto.goodsBizType</mapping>
-                <mapping row="1" col="4">GoodsDto.name</mapping>
-                <mapping row="1" col="5">GoodsDto.prodBarcode</mapping>
-                <mapping row="1" col="6">GoodsDto.supplierName</mapping>
-                <mapping row="1" col="7">GoodsDto.brandName</mapping>
-                <mapping row="1" col="8">GoodsDto.defaultFreight</mapping>
-                <mapping row="1" col="9">GoodsDto.isOnSaleStr</mapping>
-                <mapping row="1" col="10">GoodsDto.goodsUnit</mapping>
-                <mapping row="1" col="11">GoodsDto.isHotStr</mapping>
-                <mapping row="1" col="12">GoodsDto.marketPrice</mapping>
-                <mapping row="1" col="13">GoodsDto.retailPrice</mapping>
+                <mapping row="1" col="1">GoodsDto.thirdPartyMerchCode</mapping>
+                <!--<mapping row="1" col="2">GoodsDto.categoryName</mapping>-->
+                <mapping row="1" col="2">GoodsDto.goodsBizType</mapping>
+                <mapping row="1" col="3">GoodsDto.name</mapping>
+                <mapping row="1" col="4">GoodsDto.prodBarcode</mapping>
+                <mapping row="1" col="5">GoodsDto.supplierName</mapping>
+                <!--<mapping row="1" col="7">GoodsDto.brandName</mapping>-->
+                <!--<mapping row="1" col="8">GoodsDto.defaultFreight</mapping>-->
+                <mapping row="1" col="6">GoodsDto.isOnSaleStr</mapping>
+                <mapping row="1" col="7">GoodsDto.goodsUnit</mapping>
+                <mapping row="1" col="8">GoodsDto.isHotStr</mapping>
+                <!--<mapping row="1" col="12">GoodsDto.marketPrice</mapping>-->
+                <!--<mapping row="1" col="13">GoodsDto.retailPrice</mapping>-->
             </section>
             <loopbreakcondition>
                 <rowcheck offset="0">

+ 22 - 22
kmall-admin/src/main/resources/XmlTemplate/GoodsDtoList.xml

@@ -6,28 +6,28 @@
               varType="com.kmall.admin.dto.GoodsDto">
             <section startRow="1" endRow="1">
                 <mapping row="1" col="0">GoodsDto.goodsSn</mapping>
-                <mapping row="1" col="1">GoodsDto.merchSn</mapping>
-                <mapping row="1" col="2">GoodsDto.categoryName</mapping>
-                <mapping row="1" col="3">GoodsDto.goodsBizType</mapping>
-                <mapping row="1" col="4">GoodsDto.name</mapping>
-                <mapping row="1" col="5">GoodsDto.prodBarcode</mapping>
-                <mapping row="1" col="6">GoodsDto.supplierName</mapping>
-                <mapping row="1" col="7">GoodsDto.sku</mapping>
-                <mapping row="1" col="8">GoodsDto.brandName</mapping>
-                <mapping row="1" col="9">GoodsDto.defaultFreight</mapping>
-                <mapping row="1" col="10">GoodsDto.isOnSaleStr</mapping>
-                <mapping row="1" col="11">GoodsDto.goodsUnit</mapping>
-                <mapping row="1" col="12">GoodsDto.isHotStr</mapping>
-                <mapping row="1" col="13">GoodsDto.cusGoodsCode</mapping>
-                <mapping row="1" col="14">GoodsDto.ciqProdModel</mapping>
-                <mapping row="1" col="15">GoodsDto.goodsRate</mapping>
-                <mapping row="1" col="16">GoodsDto.marketPrice</mapping>
-                <mapping row="1" col="17">GoodsDto.retailPrice</mapping>
-                <mapping row="1" col="18">GoodsDto.brand</mapping>
-                <mapping row="1" col="19">GoodsDto.unitName</mapping>
-                <mapping row="1" col="20">GoodsDto.oriCntName</mapping>
-                <mapping row="1" col="21">GoodsDto.cusDeclEle</mapping>
-                <mapping row="1" col="22">GoodsDto.cusRecCode</mapping>
+                <mapping row="1" col="1">GoodsDto.thirdPartyMerchCode</mapping>
+                <!--<mapping row="1" col="2">GoodsDto.categoryName</mapping>-->
+                <mapping row="1" col="2">GoodsDto.goodsBizType</mapping>
+                <mapping row="1" col="3">GoodsDto.name</mapping>
+                <mapping row="1" col="4">GoodsDto.prodBarcode</mapping>
+                <mapping row="1" col="5">GoodsDto.supplierName</mapping>
+                <mapping row="1" col="6">GoodsDto.sku</mapping>
+                <!--<mapping row="1" col="8">GoodsDto.brandName</mapping>-->
+                <!--<mapping row="1" col="7">GoodsDto.defaultFreight</mapping>-->
+                <mapping row="1" col="7">GoodsDto.isOnSaleStr</mapping>
+                <mapping row="1" col="8">GoodsDto.goodsUnit</mapping>
+                <mapping row="1" col="9">GoodsDto.isHotStr</mapping>
+                <mapping row="1" col="10">GoodsDto.cusGoodsCode</mapping>
+                <mapping row="1" col="11">GoodsDto.ciqProdModel</mapping>
+                <mapping row="1" col="12">GoodsDto.goodsRate</mapping>
+                <!--<mapping row="1" col="16">GoodsDto.marketPrice</mapping>-->
+                <!--<mapping row="1" col="17">GoodsDto.retailPrice</mapping>-->
+                <mapping row="1" col="13">GoodsDto.brand</mapping>
+                <mapping row="1" col="14">GoodsDto.unitName</mapping>
+                <mapping row="1" col="15">GoodsDto.oriCntName</mapping>
+                <mapping row="1" col="16">GoodsDto.cusDeclEle</mapping>
+                <mapping row="1" col="17">GoodsDto.cusRecCode</mapping>
             </section>
             <loopbreakcondition>
                 <rowcheck offset="0">

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

@@ -12,6 +12,8 @@
         <result property="inputType" column="input_type"/>
         <result property="value" column="value"/>
         <result property="sortOrder" column="sort_order"/>
+        <result property="storeName" column="storeName"/>
+        <result column="merchName" property="merchName" />
     </resultMap>
 
     <select id="queryObject" resultType="com.kmall.admin.entity.AttributeEntity">
@@ -38,9 +40,13 @@
         a.input_type,
         a.VALUE,
         a.sort_order,
-        c.NAME category_name
+        c.NAME category_name,
+        s.store_name storeName,
+        m.merch_name merchName
         FROM mall_attribute a
         LEFT JOIN mall_category c ON a.attribute_category_id = c.id
+        left join mall_store s on a.store_id = s.id
+        left join mall_merch m on a.merch_sn = m.merch_sn
         WHERE 1=1
         <if test="storeId != null and storeId != ''">
             AND a.store_id = #{storeId}

+ 59 - 21
kmall-admin/src/main/resources/mybatis/mapper/BrandDao.xml

@@ -18,6 +18,10 @@
         <result property="isNew" column="is_new"/>
         <result property="newPicUrl" column="new_pic_url"/>
         <result property="newSortOrder" column="new_sort_order"/>
+        <result property="storeName" column="storeName"/>
+        <result column="merchName" property="merchName" />
+        <result column="category_id" property="categoryId" />
+        <result column="categoryName" property="categoryName" />
     </resultMap>
 
     <select id="queryObject" resultType="com.kmall.admin.entity.BrandEntity">
@@ -35,7 +39,8 @@
 			`app_list_pic_url`,
 			`is_new`,
 			`new_pic_url`,
-			`new_sort_order`
+			`new_sort_order`,
+			category_id
 		from mall_brand
 		where id = #{id}
 	</select>
@@ -55,37 +60,61 @@
         `app_list_pic_url`,
         `is_new`,
         `new_pic_url`,
-        `new_sort_order`
-        from mall_brand
+        `new_sort_order`,
+        b.category_id
+        s.store_name storeName,
+        m.merch_name merchName
+        from mall_brand b
+        left join mall_store s on b.store_id = s.id
+        left join mall_merch m on b.merch_sn = m.merch_sn
         where `name` = #{brandName}
         <if test="merchSn != null and merchSn.trim() != ''">
-            AND merch_sn = #{merchSn}
+            AND b.merch_sn = #{merchSn}
+        </if>
+        <if test="categoryId != null">
+            AND b.category_id = #{categoryId}
         </if>
     </select>
 
+    <select id="queryObjectByStoreId" resultType="com.kmall.admin.entity.BrandEntity">
+        select *
+        from mall_brand
+        where store_id = #{storeId}
+    </select>
+
     <select id="queryList" resultType="com.kmall.admin.entity.BrandEntity">
         select
-        `id`,
-        `name`,
-        `store_id`,
-        `merch_sn`,
+        b.id,
+        b.name,
+        b.store_id,
+        b.merch_sn,
         `list_pic_url`,
         `simple_desc`,
         `pic_url`,
-        `sort_order`,
-        `is_show`,
+        b.sort_order,
+        b.is_show,
         `floor_price`,
         `app_list_pic_url`,
-        `is_new`,
+        b.is_new,
         `new_pic_url`,
-        `new_sort_order`
-        from mall_brand
+        b.new_sort_order,
+        s.store_name storeName,
+        m.merch_name merchName,
+        cg.name categoryName,
+        b.category_id
+        from mall_brand b
+        left join mall_store s on b.store_id = s.id
+        left join mall_merch m on b.merch_sn = m.merch_sn
+        LEFT JOIN mall_category cg ON b.category_id = cg.id
         WHERE 1=1
+        <if test="categoryId != null and categoryId != ''">
+            AND b.category_id = #{categoryId}
+        </if>
         <if test="storeId != null and storeId != ''">
-            AND store_id = #{storeId}
+            AND b.store_id = #{storeId}
         </if>
         <if test="merchSn != null and merchSn.trim() != ''">
-            AND merch_sn = #{merchSn}
+            AND b.merch_sn = #{merchSn}
         </if>
         <if test="name != null and name.trim() != ''">
             AND name LIKE concat('%',#{name},'%')
@@ -95,7 +124,7 @@
                 order by ${sidx} ${order}
             </when>
             <otherwise>
-                order by id desc
+                order by b.id desc
             </otherwise>
         </choose>
         <if test="offset != null and limit != null">
@@ -104,13 +133,19 @@
     </select>
 
     <select id="queryTotal" resultType="int">
-        select count(*) from mall_brand
+        select count(*) from mall_brand b
+        left join mall_store s on b.store_id = s.id
+        left join mall_merch m on b.merch_sn = m.merch_sn
+        LEFT JOIN mall_category cg ON b.category_id = cg.id
         WHERE 1=1
+        <if test="categoryId != null and categoryId != ''">
+            AND b.category_id = #{categoryId}
+        </if>
         <if test="storeId != null and storeId != ''">
-            AND store_id = #{storeId}
+            AND b.store_id = #{storeId}
         </if>
         <if test="merchSn != null and merchSn.trim() != ''">
-            AND merch_sn = #{merchSn}
+            AND b.merch_sn = #{merchSn}
         </if>
         <if test="name != null and name.trim() != ''">
             AND name LIKE concat('%',#{name},'%')
@@ -131,7 +166,8 @@
 			`app_list_pic_url`,
 			`is_new`,
 			`new_pic_url`,
-			`new_sort_order`)
+			`new_sort_order`,
+            category_id)
 		values(
 			#{name},
 			#{storeId},
@@ -145,7 +181,8 @@
 			#{appListPicUrl},
 			#{isNew},
 			#{newPicUrl},
-			#{newSortOrder})
+			#{newSortOrder},
+            #{categoryId})
 	</insert>
 
     <update id="update" parameterType="com.kmall.admin.entity.BrandEntity">
@@ -163,6 +200,7 @@
             <if test="appListPicUrl != null">`app_list_pic_url` = #{appListPicUrl},</if>
             <if test="isNew != null">`is_new` = #{isNew},</if>
             <if test="newPicUrl != null">`new_pic_url` = #{newPicUrl},</if>
+            <if test="categoryId != null">`category_id` = #{categoryId},</if>
             <if test="newSortOrder != null">`new_sort_order` = #{newSortOrder}</if>
         </set>
         where id = #{id}

+ 24 - 13
kmall-admin/src/main/resources/mybatis/mapper/CategoryDao.xml

@@ -21,6 +21,8 @@
         <result property="level" column="level"/>
         <result property="type" column="type"/>
         <result property="frontName" column="front_name"/>
+		<result property="storeName" column="storeName"/>
+		<result column="merchName" property="merchName" />
     </resultMap>
 
 	<select id="queryObject" resultType="com.kmall.admin.entity.CategoryEntity">
@@ -73,18 +75,23 @@
 		</if> and is_show = 1
 	</select>
 
+	<select id="queryObjectByStoreId" resultType="com.kmall.admin.entity.CategoryEntity">
+		select *
+		from mall_category
+		where store_id = #{storeId}
+	</select>
+
 	<select id="queryList" resultType="com.kmall.admin.entity.CategoryEntity">
 		select
-    		`id`,
-    		`name`,
-			`store_id`,
-			`merch_sn`,
+    		b.id,
+    		b.name,
+			b.store_id,
+			b.merch_sn,
     		`keywords`,
     		`front_desc`,
     		`parent_id`,
-    		`sort_order`,
+    		b.sort_order,
     		`show_index`,
-    		`is_show`,
     		`banner_url`,
     		`icon_url`,
     		`img_url`,
@@ -92,23 +99,27 @@
     		`level`,
     		`type`,
     		`front_name`,
-			`is_show` as `show`
-		from mall_category
+			b.is_show as `show`,
+		s.store_name storeName,
+		m.merch_name merchName
+		from mall_category b
+		left join mall_store s on b.store_id = s.id
+		left join mall_merch m on b.merch_sn = m.merch_sn
 		WHERE 1=1
 		<if test="storeId != null and storeId != ''">
-			AND store_id = #{storeId}
+			AND b.store_id = #{storeId}
 		</if>
 		<if test="merchSn != null and merchSn.trim() != ''">
-			AND merch_sn = #{merchSn}
+			AND b.merch_sn = #{merchSn}
 		</if>
 		<if test="name != null and name.trim() != ''">
-			AND `name` LIKE concat('%',#{name},'%')
+			AND b.name LIKE concat('%',#{name},'%')
 		</if>
 		<if test="parentId != null and parentId != ''">
 			AND `parent_id` = #{parentId}
 		</if>
 		<if test="isShow != null and isShow != ''">
-			AND `is_show` = #{isShow}
+			AND b.is_show = #{isShow}
 		</if>
 		<if test="isL2 != null and isL2 != ''">
 			AND `parent_id` != #{isL2}
@@ -118,7 +129,7 @@
                 order by ${sidx} ${order}
             </when>
 			<otherwise>
-                order by sort_order
+                order by b.sort_order
 			</otherwise>
         </choose>
 		<if test="offset != null and limit != null">

+ 31 - 11
kmall-admin/src/main/resources/mybatis/mapper/FreightDao.xml

@@ -12,6 +12,8 @@
 		<result property="pricingManner" column="pricing_manner"/>
 		<result property="defaultFreight" column="default_freight"/>
 		<result property="isDefault" column="is_default"/>
+		<result property="storeName" column="storeName"/>
+		<result column="merchName" property="merchName" />
     </resultMap>
 
 	<select id="queryObject" resultType="com.kmall.admin.entity.FreightEntity">
@@ -45,36 +47,54 @@
 		</if>
 	</select>
 
+	<select id="queryObjectByStoreId" resultType="com.kmall.admin.entity.FreightEntity">
+		select
+		`id`,
+		`name`,
+		`store_id`,
+		`merch_sn`,
+		`template_type`,
+		`pricing_manner`,
+		`default_freight`,
+		`is_default`
+		from mall_freight
+		where store_id = #{storeId}
+	</select>
+
 	<select id="queryList" resultType="com.kmall.admin.entity.FreightEntity">
 		select
-    		`id`,
-    		`name`,
-			`store_id`,
-			`merch_sn`,
+    		b.id,
+    		b.name,
+			b.store_id,
+			b.merch_sn,
     		`template_type`,
     		`pricing_manner`,
 			`default_freight`,
-    		`is_default`
-		from mall_freight
+    		`is_default`,
+		s.store_name storeName,
+		m.merch_name merchName
+		from mall_freight b
+		left join mall_store s on b.store_id = s.id
+		left join mall_merch m on b.merch_sn = m.merch_sn
 		WHERE 1=1
 		<if test="storeId != null and storeId != ''">
-			AND store_id = #{storeId}
+			AND b.store_id = #{storeId}
 		</if>
 		<if test="merchSn != null and merchSn.trim() != ''">
-			AND merch_sn = #{merchSn}
+			AND b.merch_sn = #{merchSn}
 		</if>
 		<if test="name != null and name.trim() != ''">
-			AND name LIKE concat('%',#{name},'%')
+			AND b.name LIKE concat('%',#{name},'%')
 		</if>
 		<if test="id != null and id != ''">
-			AND id LIKE concat('%',#{id},'%')
+			AND b.id LIKE concat('%',#{id},'%')
 		</if>
         <choose>
             <when test="sidx != null and sidx.trim() != ''">
                 order by ${sidx} ${order}
             </when>
 			<otherwise>
-                order by id desc
+                order by b.id desc
 			</otherwise>
         </choose>
 		<if test="offset != null and limit != null">

+ 31 - 57
kmall-admin/src/main/resources/mybatis/mapper/GoodsDao.xml

@@ -6,11 +6,11 @@
     <resultMap type="com.kmall.admin.entity.GoodsEntity" id="goodsMap">
         <result property="id" column="id"/>
         <result property="merchSn" column="merch_sn"/>
-        <result property="categoryId" column="category_id"/>
+        <!--<result property="categoryId" column="category_id"/>-->
         <result property="goodsSn" column="goods_sn"/>
         <result property="name" column="name"/>
-        <result property="brandId" column="brand_id"/>
-        <result property="freightId" column="freight_id"/>
+        <!--<result property="brandId" column="brand_id"/>-->
+        <!--<result property="freightId" column="freight_id"/>-->
         <result property="brand" column="brand"/>
         <result property="goodsNumber" column="goods_number"/>
         <result property="keywords" column="keywords"/>
@@ -20,14 +20,14 @@
         <result property="addTime" column="add_time"/>
         <result property="sortOrder" column="sort_order"/>
         <result property="isDelete" column="is_delete"/>
-        <result property="attributeCategory" column="attribute_category"/>
+        <!--<result property="attributeCategory" column="attribute_category"/>-->
         <result property="counterPrice" column="counter_price"/>
         <result property="extraPrice" column="extra_price"/>
         <result property="isNew" column="is_new"/>
         <result property="goodsUnit" column="goods_unit"/>
         <result property="primaryPicUrl" column="primary_pic_url"/>
         <result property="listPicUrl" column="list_pic_url"/>
-        <result property="retailPrice" column="retail_price"/>
+        <!--<result property="retailPrice" column="retail_price"/>-->
         <result property="sellVolume" column="sell_volume"/>
         <result property="primaryProductId" column="primary_product_id"/>
         <result property="unitPrice" column="unit_price"/>
@@ -37,7 +37,7 @@
         <result property="isAppExclusive" column="is_app_exclusive"/>
         <result property="isLimited" column="is_limited"/>
         <result property="isHot" column="is_hot"/>
-        <result property="marketPrice" column="market_price"/>
+        <!--<result property="marketPrice" column="market_price"/>-->
         <result property="goodsType" column="goodsType"/>
         <result property="sku" column="sku"/>
         <result property="goodsBizType" column="goods_biz_type"/>
@@ -60,6 +60,9 @@
         <result property="productId" column="productId"/>
         <result property="storeId" column="storeId"/>
         <result column="merch_name" property="merchName" />
+        <result column="storeMarketPrice" property="storeMarketPrice" />
+        <result column="storeRetailPrice" property="storeRetailPrice" />
+        <result column="third_party_merch_code" property="thirdPartyMerchCode" />
     </resultMap>
 
     <select id="queryObject" resultType="com.kmall.admin.entity.GoodsEntity">
@@ -75,12 +78,12 @@
 
     <select id="queryObjectByProdBarcodeAndBizType" resultType="com.kmall.admin.entity.GoodsEntity">
         SELECT
-            a.id,a.sku,a.goods_sn,a.name,a.list_pic_url,a.prod_barcode,r.market_price,r.retail_price,r.stock_num,s.store_name,r.product_id,s.id 'storeId'
+            a.id,a.sku,a.goods_sn,a.name,a.list_pic_url,a.prod_barcode,r.market_price storeMarketPrice,r.retail_price storeRetailPrice ,r.stock_num,s.store_name,r.product_id,s.id 'storeId'
         FROM
             mall_goods a
         LEFT JOIN mall_product_store_rela r ON r.goods_id = a.id
         inner join mall_store s on r.store_id=s.id
-        where a.prod_barcode = #{prodBarcode} and a.goods_biz_type = 11
+        where a.prod_barcode = #{prodBarcode} and a.goods_biz_type = 11 and r.store_id = #{storeId}
     </select>
 
     <select id="queryObjectByProdBarcode" resultType="com.kmall.admin.entity.GoodsEntity">
@@ -111,30 +114,30 @@
     <select id="queryList" resultType="com.kmall.admin.entity.GoodsEntity">
         select
         mall_goods.*,
-        mall_category.name category_name,
-        mall_brand.name brand_name,
-        mall_freight.name freight_name,
         case when mall_goods_group.id > 0 then 2 else 0 end as goodsType,
         m.merch_name merchName
         from mall_goods
         left join mall_merch m on mall_goods.merch_sn = m.merch_sn
-        LEFT JOIN mall_category ON mall_goods.category_id = mall_category.id
-        LEFT JOIN mall_brand ON mall_brand.id = mall_goods.brand_id
         left join mall_goods_group on mall_goods_group.goods_id = mall_goods.id and mall_goods_group.open_status != 3
-        left join mall_freight on mall_goods.freight_id = mall_freight.id
         WHERE 1=1
         <!--  数据过滤  -->
         ${filterSql}
         <if test="merchSn != null and merchSn.trim() != ''">
             AND mall_goods.merch_sn = #{merchSn}
         </if>
+        <if test="prodBarcode != null and prodBarcode.trim() != ''">
+            AND mall_goods.prod_barcode = #{prodBarcode}
+        </if>
+        <if test="thirdPartyMerchCode != null and thirdPartyMerchCode.trim() != ''">
+            AND mall_goods.third_party_merch_code = #{thirdPartyMerchCode}
+        </if>
         <if test="goodsSn != null and goodsSn != ''">
             AND mall_goods.goods_sn like concat('%',#{goodsSn},'%')
         </if>
         <if test="name != null and name != ''">
             AND mall_goods.name LIKE concat('%',#{name},'%')
         </if>
-        <if test="freightId != null and freightId != ''">
+        <!--<if test="freightId != null and freightId != ''">
             AND mall_goods.freight_id = #{freightId}
         </if>
         <if test="brandId != null and brandId != ''">
@@ -142,16 +145,16 @@
         </if>
         <if test="categoryId != null and categoryId != ''">
             AND mall_goods.category_id = #{categoryId}
-        </if>
+        </if>-->
         <if test="sku != null and sku != ''">
             AND mall_goods.sku LIKE concat('%',#{sku},'%')
         </if>
-        <if test="category != null and category != ''">
+        <!--<if test="category != null and category != ''">
             AND mall_goods.category_id IN (select id from mall_category where parent_id = #{category})
         </if>
         <if test="categoryTwo != null and categoryTwo != ''">
             AND mall_goods.category_id = #{categoryTwo}
-        </if>
+        </if>-->
         <if test="isDelete != null">
             AND mall_goods.is_Delete = #{isDelete}
         </if>
@@ -161,6 +164,10 @@
         <if test="goodsBizType != null and goodsBizType != ''">
             AND mall_goods.goods_biz_type = #{goodsBizType}
         </if>
+        <if test="storeId != null and storeId != ''">
+            AND mall_goods.id not in (select goods_id from mall_product_store_rela where store_id = #{storeId})
+        </if>
+
         <choose>
             <when test="sidx != null and sidx.trim() != ''">
                 order by ${sidx} ${order}
@@ -177,15 +184,9 @@
     <select id="querySame" resultType="com.kmall.admin.entity.GoodsEntity">
         select
         mall_goods.*,
-        mall_category.name category_name,
-        mall_brand.name brand_name,
-        mall_freight.name freight_name,
         case when mall_goods_group.id > 0 then 2 else 0 end as goodsType
         from mall_goods
-        LEFT JOIN mall_category ON mall_goods.category_id = mall_category.id
-        LEFT JOIN mall_brand ON mall_brand.id = mall_goods.brand_id
         left join mall_goods_group on mall_goods_group.goods_id = mall_goods.id and mall_goods_group.open_status != 3
-        left join mall_freight on mall_goods.freight_id = mall_freight.id
         WHERE 1=1
         <!--  数据过滤  -->
         ${filterSql}
@@ -215,30 +216,18 @@
         <if test="merchSn != null and merchSn.trim() != ''">
             AND mall_goods.merch_sn = #{merchSn}
         </if>
+        <if test="thirdPartyMerchCode != null and thirdPartyMerchCode.trim() != ''">
+            AND mall_goods.third_party_merch_code = #{thirdPartyMerchCode}
+        </if>
         <if test="goodsSn != null and goodsSn != ''">
             AND mall_goods.goods_sn like concat('%',#{goodsSn},'%')
         </if>
         <if test="name != null and name != ''">
             AND mall_goods.name LIKE concat('%',#{name},'%')
         </if>
-        <if test="freightId != null and freightId != ''">
-            AND mall_goods.freight_id = #{freightId}
-        </if>
-        <if test="brandId != null and brandId != ''">
-            AND mall_goods.brand_id = #{brandId}
-        </if>
-        <if test="categoryId != null and categoryId != ''">
-            AND mall_goods.category_id = #{categoryId}
-        </if>
         <if test="sku != null and sku != ''">
             AND mall_goods.sku LIKE concat('%',#{sku},'%')
         </if>
-        <if test="category != null and category != ''">
-            AND mall_goods.category_id IN (select id from mall_category where parent_id = #{category})
-        </if>
-        <if test="categoryTwo != null and categoryTwo != ''">
-            AND mall_goods.category_id = #{categoryTwo}
-        </if>
         <if test="isDelete != null and isDelete != ''">
             AND mall_goods.is_Delete = #{isDelete}
         </if>
@@ -247,7 +236,7 @@
     <insert id="save" parameterType="com.kmall.admin.entity.GoodsEntity" useGeneratedKeys="true" keyProperty="id">
         insert into mall_goods(
             `merch_sn`,
-			`category_id`,
+            third_party_merch_code,
             `supplier_id`,
 			`goods_sn`,
 			`prod_barcode`,
@@ -255,9 +244,7 @@
 			`goods_biz_type`,
 			`name`,
 			`unit_code`,
-			`brand_id`,
 			`brand`,
-			`freight_id`,
 			`goods_number`,
 			`keywords`,
 			`goods_brief`,
@@ -271,7 +258,6 @@
 			`add_time`,
 			`sort_order`,
 			`is_delete`,
-			`attribute_category`,
 			`counter_price`,
 			`extra_price`,
 			`is_new`,
@@ -279,7 +265,6 @@
 			`primary_pic_url`,
 			`list_pic_url`,
 			`goods_rate`,
-			`retail_price`,
 			`sell_volume`,
 			`primary_product_id`,
 			`unit_price`,
@@ -289,7 +274,6 @@
 			`is_app_exclusive`,
 			`is_limited`,
 			`is_hot`,
-			`market_price`,
 			`creater_sn`,
 			`create_time`,
 			`moder_sn`,
@@ -297,7 +281,7 @@
 			`tstm`)
 		values(
 			#{merchSn},
-			#{categoryId},
+            #{thirdPartyMerchCode},
             #{supplierId},
 			#{goodsSn},
 			#{prodBarcode},
@@ -305,9 +289,7 @@
 			#{goodsBizType},
 			#{name},
 			#{unitCode},
-			#{brandId},
 			#{brand},
-			#{freightId},
 			#{goodsNumber},
 			#{keywords},
 			#{goodsBrief},
@@ -321,7 +303,6 @@
 			#{addTime},
 			#{sortOrder},
 			#{isDelete},
-			#{attributeCategory},
 			#{counterPrice},
 			#{extraPrice},
 			#{isNew},
@@ -329,7 +310,6 @@
 			#{primaryPicUrl},
 			#{listPicUrl},
 			#{goodsRate},
-			#{retailPrice},
 			#{sellVolume},
 			#{primaryProductId},
 			#{unitPrice},
@@ -339,7 +319,6 @@
 			#{isAppExclusive},
 			#{isLimited},
 			#{isHot},
-			#{marketPrice},
 			#{createrSn},
 			#{createTime},
 			#{moderSn},
@@ -351,7 +330,7 @@
         update mall_goods
         <set>
             <if test="merchSn != null">`merch_sn` = #{merchSn}, </if>
-            <if test="categoryId != null">`category_id` = #{categoryId}, </if>
+            <if test="thirdPartyMerchCode != null">`third_party_merch_code` = #{thirdPartyMerchCode}, </if>
             <if test="supplierId != null">`supplier_id` = #{supplierId}, </if>
             <if test="goodsSn != null">`goods_sn` = #{goodsSn}, </if>
             <if test="prodBarcode != null">`prod_barcode` = #{prodBarcode}, </if>
@@ -359,9 +338,7 @@
             <if test="goodsBizType != null">`goods_biz_type` = #{goodsBizType}, </if>
             <if test="name != null">`name` = #{name}, </if>
             <if test="unitCode != null">`unit_code` = #{unitCode}, </if>
-            <if test="brandId != null">`brand_id` = #{brandId}, </if>
             <if test="brand != null">`brand` = #{brand}, </if>
-            <if test="freightId != null">`freight_id` = #{freightId}, </if>
             <if test="goodsNumber != null">`goods_number` = #{goodsNumber}, </if>
             <if test="keywords != null">`keywords` = #{keywords}, </if>
             <if test="goodsBrief != null">`goods_brief` = #{goodsBrief}, </if>
@@ -375,7 +352,6 @@
             <if test="addTime != null">`add_time` = #{addTime}, </if>
             <if test="sortOrder != null">`sort_order` = #{sortOrder}, </if>
             <if test="isDelete != null">`is_delete` = #{isDelete}, </if>
-            <if test="attributeCategory != null">`attribute_category` = #{attributeCategory}, </if>
             <if test="counterPrice != null">`counter_price` = #{counterPrice}, </if>
             <if test="extraPrice != null">`extra_price` = #{extraPrice}, </if>
             <if test="isNew != null">`is_new` = #{isNew}, </if>
@@ -383,7 +359,6 @@
             <if test="primaryPicUrl != null">`primary_pic_url` = #{primaryPicUrl}, </if>
             <if test="listPicUrl != null">`list_pic_url` = #{listPicUrl}, </if>
             <if test="goodsRate != null">`goods_rate` = #{goodsRate}, </if>
-            <if test="retailPrice != null">`retail_price` = #{retailPrice}, </if>
             <if test="sellVolume != null">`sell_volume` = #{sellVolume}, </if>
             <if test="primaryProductId != null">`primary_product_id` = #{primaryProductId}, </if>
             <if test="unitPrice != null">`unit_price` = #{unitPrice}, </if>
@@ -393,7 +368,6 @@
             <if test="isAppExclusive != null">`is_app_exclusive` = #{isAppExclusive}, </if>
             <if test="isLimited != null">`is_limited` = #{isLimited}, </if>
             <if test="isHot != null">`is_hot` = #{isHot}, </if>
-            <if test="marketPrice != null">`market_price` = #{marketPrice}, </if>
             <if test="createrSn != null">`creater_sn` = #{createrSn}, </if>
             <if test="createTime != null">`create_time` = #{createTime}, </if>
             <if test="moderSn != null">`moder_sn` = #{moderSn}, </if>

+ 19 - 0
kmall-admin/src/main/resources/mybatis/mapper/OrderDao.xml

@@ -60,6 +60,7 @@
         <result property="isOnfflineOrder" column="is_onffline_order"/>
         <result property="orderSnWx" column="order_sn_wx"/>
         <result property="isMergePay" column="is_merge_pay"/>
+        <result property="payTransactionId" column="pay_transaction_id"/>
     </resultMap>
 
     <select id="queryObject" resultType="com.kmall.admin.entity.OrderEntity">
@@ -103,6 +104,12 @@
         LEFT JOIN mall_user u ON o.user_id = u.id
         LEFT JOIN mall_order_process_record p ON o.order_sn = p.order_sn
         WHERE 1=1
+        <if test="startTime != null and startTime != ''">
+            AND o.add_time <![CDATA[ >  ]]> #{startTime}
+        </if>
+        <if test="endTime != null and endTime != ''">
+            AND o.add_time <![CDATA[ <  ]]> #{endTime}
+        </if>
         <if test="storeId != null and storeId != ''">
             AND o.store_id = #{storeId}
         </if>
@@ -166,6 +173,12 @@
         LEFT JOIN mall_order_process_record p ON o.order_sn = p.order_sn
         Left join mall_order_goods g on o.id = g.order_id
         WHERE 1=1
+        <if test="startTime != null and startTime != ''">
+            AND o.add_time <![CDATA[ >  ]]> #{startTime}
+        </if>
+        <if test="endTime != null and endTime != ''">
+            AND o.add_time <![CDATA[ <  ]]> #{endTime}
+        </if>
         <if test="storeId != null and storeId != ''">
             AND o.store_id = #{storeId}
         </if>
@@ -214,6 +227,12 @@
 
     <select id="queryTotal" resultType="int">
         select count(*) from mall_order o WHERE 1=1
+        <if test="startTime != null and startTime != ''">
+            AND o.add_time <![CDATA[ >  ]]> #{startTime}
+        </if>
+        <if test="endTime != null and endTime != ''">
+            AND o.add_time <![CDATA[ <  ]]> #{endTime}
+        </if>
         <if test="storeId != null and storeId != ''">
             AND o.store_id = #{storeId}
         </if>

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

@@ -18,6 +18,7 @@
         <result property="isReal" column="is_real"/>
         <result property="goodsSpecificationIds" column="goods_specification_ids"/>
         <result property="listPicUrl" column="list_pic_url"/>
+        <result property="sku" column="sku"/>
     </resultMap>
 
     <select id="queryObject" resultType="com.kmall.admin.entity.OrderGoodsEntity">

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

@@ -26,11 +26,11 @@
 		where id = #{id}
 	</select>
 
-    <select id="queryObjectBySn" resultType="com.kmall.admin.entity.ProductEntity">
+    <select id="queryObjectByGoodsId" resultType="com.kmall.admin.entity.ProductEntity">
         select
         *
         from mall_product
-        where goods_sn = #{goodsSn}
+        where goods_id = #{goodsId}
     </select>
 
     <select id="queryList" resultType="com.kmall.admin.entity.ProductEntity">

+ 139 - 24
kmall-admin/src/main/resources/mybatis/mapper/ProductStoreRelaDao.xml

@@ -31,6 +31,12 @@
         <result column="list_pic_url" property="listPicUrl" />
         <result column="merch_name" property="merchName" />
         <result column="goods_merch_sn" property="goodsMerchSn" />
+
+        <result column="category_id" property="categoryId" />
+        <result column="attribute_category" property="attributeCategory" />
+        <result column="brand_id" property="brandId" />
+        <result column="freight_id" property="freightId" />
+
     </resultMap>
 
     <select id="queryObject" resultType="com.kmall.admin.entity.ProductStoreRelaEntity">
@@ -57,12 +63,16 @@
             b.NAME goodsName,
             cg.NAME categoryName,
             s.store_name storeName,
-            gs.value as specification
+            gs.value as specification,
+            a.category_id,
+            a.attribute_category,
+            a.brand_id,
+            a.freight_id
         FROM
             mall_product_store_rela a
             LEFT JOIN mall_goods b ON a.goods_id = b.id
             LEFT JOIN mall_product c ON a.product_id = c.id
-            LEFT JOIN mall_category cg ON b.category_id = cg.id
+            LEFT JOIN mall_category cg ON a.category_id = cg.id
             LEFT JOIN mall_store s ON a.store_id = s.id
             left join mall_goods_specification gs on gs.goods_id = a.goods_id
 		where a.id = #{id}
@@ -70,30 +80,55 @@
 
     <select id="queryByStoreIdProductId" resultType="com.kmall.admin.entity.ProductStoreRelaEntity">
         select
-        a.`id`,
-        a.`store_id`,
-        a.`merch_sn`,
-        a.`product_id`,
-        a.`stock_num`,
-        a.`goods_id`,
-        a.`retail_price`,
-        a.`market_price`,
-        a.`stock_price`,
-        a.`sell_volume`,
-        a.sku,a.goods_biz_type, a.creater_sn, a.create_time, a.moder_sn, a.mod_time, a.tstm,
-        b.goods_sn goodsSn,
-        c.goods_sn productSn,
-        b.name goodsName,
-        cg.name categoryName,
-        s.store_name storeName
+            a.`id`,
+            a.`store_id`,
+            a.`merch_sn`,
+            a.`product_id`,
+            a.`stock_num`,
+            a.`goods_id`,
+            a.`retail_price`,
+            a.`market_price`,
+            a.`stock_price`,
+            a.`sell_volume`,
+            a.sku,a.goods_biz_type, a.creater_sn, a.create_time, a.moder_sn, a.mod_time, a.tstm,
+            b.goods_sn goodsSn,
+            c.goods_sn productSn,
+            b.name goodsName,
+            cg.name categoryName,
+            s.store_name storeName,
+            a.category_id,
+            a.attribute_category,
+            a.brand_id,
+            a.freight_id
         from mall_product_store_rela a
         left join mall_goods b on a.goods_id = b.id
         left join mall_product c on a.product_id = c.id
-        LEFT JOIN mall_category cg ON b.category_id = cg.id
+        LEFT JOIN mall_category cg ON a.category_id = cg.id
         left join mall_store s on a.store_id = s.id
         where a.store_id = #{storeId} and a.product_id = #{productId}
     </select>
 
+    <select id="queryObjectByStoreAndGoodsId" resultType="com.kmall.admin.entity.ProductStoreRelaEntity">
+        select
+            a.`id`,
+            a.`store_id`,
+            a.`merch_sn`,
+            a.`product_id`,
+            a.`stock_num`,
+            a.`goods_id`,
+            a.`retail_price`,
+            a.`market_price`,
+            a.`stock_price`,
+            a.`sell_volume`,
+            a.sku,a.goods_biz_type, a.creater_sn, a.create_time, a.moder_sn, a.mod_time, a.tstm,
+            a.category_id,
+            a.attribute_category,
+            a.brand_id,
+            a.freight_id
+        from mall_product_store_rela a
+        where a.store_id = #{storeId} and a.goods_id = #{goodsId}
+    </select>
+
     <select id="queryList" resultType="com.kmall.admin.entity.ProductStoreRelaEntity">
         select
         a.`id`,
@@ -114,14 +149,30 @@
         cg.name categoryName,
         s.store_name storeName,
         m.merch_name,
-        b.merch_sn goods_merch_sn
+        b.merch_sn goods_merch_sn,
+        a.category_id,
+        a.attribute_category,
+        a.brand_id,
+        a.freight_id
         from mall_product_store_rela a
         left join mall_goods b on a.goods_id = b.id
         left join mall_merch m on a.merch_sn = m.merch_sn
         left join mall_product c on a.product_id = c.id
-        LEFT JOIN mall_category cg ON b.category_id = cg.id
+        LEFT JOIN mall_category cg ON a.category_id = cg.id
         left join mall_store s on a.store_id = s.id
         WHERE 1=1 and b.is_delete = 0
+        <if test="categoryId != null and categoryId != '' ">
+            AND a.category_id = #{categoryId}
+        </if>
+        <if test="brandId != null and brandId != '' ">
+            AND a.brand_id = #{brandId}
+        </if>
+        <if test="category != null and category != ''">
+            AND a.category_id IN (select id from mall_category where parent_id = #{category})
+        </if>
+        <if test="categoryTwo != null and categoryTwo != ''">
+            AND a.category_id = #{categoryTwo}
+        </if>
         <if test="storeId != null and storeId != '' ">
             AND a.store_id = #{storeId}
         </if>
@@ -179,16 +230,32 @@
         c.goods_sn productSn,
         b.name goodsName,
         cg.name categoryName,
-        s.store_name storeName
+        s.store_name storeName,
+        a.category_id,
+        a.attribute_category,
+        a.brand_id,
+        a.freight_id
         from mall_product_store_rela a
         left join mall_goods b on a.goods_id = b.id
         left join mall_product c on a.product_id = c.id
-        LEFT JOIN mall_category cg ON b.category_id = cg.id
+        LEFT JOIN mall_category cg ON a.category_id = cg.id
         left join mall_store s on a.store_id = s.id
         WHERE 1=1 and b.is_delete = 0
         <if test="goodsId != null">
             AND b.id = #{goodsId}
         </if>
+        <if test="categoryId != null and categoryId != '' ">
+            AND a.category_id = #{categoryId}
+        </if>
+        <if test="brandId != null and brandId != '' ">
+            AND a.brand_id = #{brandId}
+        </if>
+        <if test="category != null and category != ''">
+            AND a.category_id IN (select id from mall_category where parent_id = #{category})
+        </if>
+        <if test="categoryTwo != null and categoryTwo != ''">
+            AND a.category_id = #{categoryTwo}
+        </if>
         <if test="storeId != null and storeId != '' ">
             AND a.store_id = #{storeId}
         </if>
@@ -216,12 +283,24 @@
         from mall_product_store_rela a
         left join mall_goods b on a.goods_id = b.id
         left join mall_product c on a.product_id = c.id
-        LEFT JOIN mall_category cg ON b.category_id = cg.id
+        LEFT JOIN mall_category cg ON a.category_id = cg.id
         left join mall_store s on a.store_id = s.id
         WHERE 1=1 and b.is_delete = 0
         <if test="storeId != null and storeId != '' ">
             AND a.store_id = #{storeId}
         </if>
+        <if test="categoryId != null and categoryId != '' ">
+            AND a.category_id = #{categoryId}
+        </if>
+        <if test="brandId != null and brandId != '' ">
+            AND a.brand_id = #{brandId}
+        </if>
+        <if test="category != null and category != ''">
+            AND a.category_id IN (select id from mall_category where parent_id = #{category})
+        </if>
+        <if test="categoryTwo != null and categoryTwo != ''">
+            AND a.category_id = #{categoryTwo}
+        </if>
         <if test="merchSn != null and merchSn.trim() != '' ">
             AND a.merch_sn = #{merchSn}
         </if>
@@ -267,6 +346,18 @@
         <if test="goodsBizType != null" >
             goods_biz_type,
         </if>
+        <if test="categoryId != null" >
+            category_id,
+        </if>
+        <if test="attributeCategory != null" >
+            attribute_category,
+        </if>
+        <if test="brandId != null" >
+            brand_id,
+        </if>
+        <if test="freightId != null" >
+            freight_id,
+        </if>
         <if test="createrSn != null" >
             creater_sn,
         </if>
@@ -297,6 +388,18 @@
         <if test="goodsBizType != null" >
             #{goodsBizType,jdbcType=CHAR},
         </if>
+        <if test="categoryId != null" >
+            #{categoryId,jdbcType=CHAR},
+        </if>
+        <if test="attributeCategory != null" >
+            #{attributeCategory,jdbcType=CHAR},
+        </if>
+        <if test="brandId != null" >
+            #{brandId,jdbcType=CHAR},
+        </if>
+        <if test="freightId != null" >
+            #{freightId,jdbcType=CHAR},
+        </if>
         <if test="createrSn != null" >
             #{createrSn,jdbcType=VARCHAR},
         </if>
@@ -331,6 +434,18 @@
             <if test="goodsBizType != null" >
                 goods_biz_type = #{goodsBizType,jdbcType=CHAR},
             </if>
+            <if test="categoryId != null" >
+                category_id = #{categoryId,jdbcType=CHAR},
+            </if>
+            <if test="attributeCategory != null" >
+                attribute_category = #{attributeCategory,jdbcType=CHAR},
+            </if>
+            <if test="brandId != null" >
+                brand_id = #{brandId,jdbcType=CHAR},
+            </if>
+            <if test="freightId != null" >
+                freight_id = #{freightId,jdbcType=CHAR},
+            </if>
             <if test="createrSn != null" >
                 creater_sn = #{createrSn,jdbcType=VARCHAR},
             </if>

+ 167 - 0
kmall-admin/src/main/resources/mybatis/mapper/ThirdMerchantBizDao.xml

@@ -0,0 +1,167 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+
+<mapper namespace="com.kmall.admin.dao.ThirdMerchantBizDao">
+
+    <resultMap type="com.kmall.admin.entity.ThirdMerchantBizEntity" id="thirdMerchantBizMap">
+        <result property="thirdMerchSn" column="third_merch_sn"/>
+		<result property="merchSn" column="merch_sn"/>
+        <result property="thirdPartyMerchCode" column="third_party_merch_code"/>
+        <result property="thirdPartyMerchName" column="third_party_merch_name"/>
+        <result property="isValid" column="is_valid"/>
+        <result property="createrSn" column="creater_sn"/>
+        <result property="createTime" column="create_time"/>
+        <result property="moderSn" column="moder_sn"/>
+        <result property="modTime" column="mod_time"/>
+        <result property="tstm" column="tstm"/>
+    </resultMap>
+
+	<select id="queryObject" resultType="com.kmall.admin.entity.ThirdMerchantBizEntity">
+		select
+			`third_merch_sn`,
+            `merch_sn`,
+			`third_party_merch_code`,
+			`third_party_merch_name`,
+			`is_valid`,
+			`creater_sn`,
+			`create_time`,
+			`moder_sn`,
+			`mod_time`,
+			`tstm`
+		from third_merchant_biz
+		where third_merch_sn = #{id}
+	</select>
+
+	<select id="findByMerchSn" resultType="com.kmall.admin.entity.ThirdMerchantBizEntity">
+		select
+		`third_merch_sn`,
+		`merch_sn`,
+		`third_party_merch_code`,
+		`third_party_merch_name`,
+		`is_valid`,
+		`creater_sn`,
+		`create_time`,
+		`moder_sn`,
+		`mod_time`,
+		`tstm`
+		from third_merchant_biz
+		where merch_sn = #{value}
+	</select>
+
+	<select id="getThirdMerchangByCode" resultType="com.kmall.admin.entity.ThirdMerchantBizEntity">
+		select
+		`third_merch_sn`,
+		`merch_sn`,
+		`third_party_merch_code`,
+		`third_party_merch_name`,
+		`is_valid`,
+		`creater_sn`,
+		`create_time`,
+		`moder_sn`,
+		`mod_time`,
+		`tstm`
+		from third_merchant_biz
+		where third_party_merch_code = #{thirdMerchantCode}
+	</select>
+
+	<select id="queryList" resultType="com.kmall.admin.entity.ThirdMerchantBizEntity">
+		select
+    		`third_merch_sn`,
+			`merch_sn`,
+    		`third_party_merch_code`,
+    		`third_party_merch_name`,
+    		`is_valid`,
+    		`creater_sn`,
+    		`create_time`,
+    		`moder_sn`,
+    		`mod_time`,
+    		`tstm`
+		from third_merchant_biz
+		WHERE 1=1
+		<if test="name != null and name.trim() != ''">
+			AND name LIKE concat('%',#{name},'%')
+		</if>
+		<if test="merchSn != null and merchSn.trim() != ''">
+			and merch_sn = #{merchSn}
+		</if>
+		<if test="thirdPartyMerchCode != null and thirdPartyMerchCode.trim() != ''">
+			and third_party_merch_code = #{thirdPartyMerchCode}
+		</if>
+        <choose>
+            <when test="sidx != null and sidx.trim() != ''">
+                order by ${sidx} ${order}
+            </when>
+			<otherwise>
+                order by third_merch_sn desc
+			</otherwise>
+        </choose>
+		<if test="offset != null and limit != null">
+			limit #{offset}, #{limit}
+		</if>
+	</select>
+	
+ 	<select id="queryTotal" resultType="int">
+		select count(*) from third_merchant_biz
+		WHERE 1=1
+        <if test="name != null and name.trim() != ''">
+            AND name LIKE concat('%',#{name},'%')
+        </if>
+		<if test="merchSn != null and merchSn.trim() != ''">
+			and merch_sn = #{merchSn}
+		</if>
+		<if test="thirdPartyMerchCode != null and thirdPartyMerchCode.trim() != ''">
+			and third_party_merch_code = #{thirdPartyMerchCode}
+		</if>
+	</select>
+	 
+	<insert id="save" parameterType="com.kmall.admin.entity.ThirdMerchantBizEntity" useGeneratedKeys="true" keyProperty="thirdMerchSn">
+		insert into third_merchant_biz(
+			`merch_sn`,
+			`third_party_merch_code`,
+			`third_party_merch_name`,
+			`is_valid`,
+			`creater_sn`,
+			`create_time`,
+			`moder_sn`,
+			`mod_time`,
+			`tstm`)
+		values(
+			#{merchSn},
+			#{thirdPartyMerchCode},
+			#{thirdPartyMerchName},
+			#{isValid},
+			#{createrSn},
+			#{createTime},
+			#{moderSn},
+			#{modTime},
+			#{tstm})
+	</insert>
+	 
+	<update id="update" parameterType="com.kmall.admin.entity.ThirdMerchantBizEntity">
+		update third_merchant_biz 
+		<set>
+			<if test="merchSn != null">`merch_sn` = #{merchSn},</if>
+			<if test="thirdPartyMerchCode != null">`third_party_merch_code` = #{thirdPartyMerchCode}, </if>
+			<if test="thirdPartyMerchName != null">`third_party_merch_name` = #{thirdPartyMerchName}, </if>
+			<if test="isValid != null">`is_valid` = #{isValid}, </if>
+			<if test="createrSn != null">`creater_sn` = #{createrSn}, </if>
+			<if test="createTime != null">`create_time` = #{createTime}, </if>
+			<if test="moderSn != null">`moder_sn` = #{moderSn}, </if>
+			<if test="modTime != null">`mod_time` = #{modTime}, </if>
+			<if test="tstm != null">`tstm` = #{tstm}</if>
+		</set>
+		where third_merch_sn = #{thirdMerchSn}
+	</update>
+	
+	<delete id="delete">
+		delete from third_merchant_biz where third_merch_sn = #{value}
+	</delete>
+	
+	<delete id="deleteBatch">
+		delete from third_merchant_biz where third_merch_sn in 
+		<foreach item="thirdMerchSn" collection="array" open="(" separator="," close=")">
+			#{thirdMerchSn}
+		</foreach>
+	</delete>
+
+</mapper>

+ 29 - 2
kmall-admin/src/main/webapp/WEB-INF/page/shop/brand.html

@@ -39,10 +39,17 @@
                 </i-select>
             </Form-item>
             <Form-item label="门店" prop="storeId">
-                <i-select v-model="brand.storeId" filterable placeholder="门店" label-in-value>
+                <i-select v-model="brand.storeId" filterable placeholder="门店" @on-change="getCategoryByStore" label-in-value>
                     <i-option v-for="store in storeList" :value="store.id" :key="store.id">{{store.storeName}}</i-option>
                 </i-select>
-            </Form-item>
+            </Form-item><Form-item label="商品类型" prop="categoryId" style="height: 30px;">
+            <i-select v-model="brand.categoryId" placeholder="商品分类"
+                      label-in-value style="width: 268px;height: 30px;">
+                <i-option v-for="category in categories" :value="category.id"
+                          :key="category.id">{{category.name}}
+                </i-option>
+            </i-select>
+        </Form-item>
             <Form-item label="品牌名称" prop="name">
                 <i-input v-model="brand.name" placeholder="品牌名称"/>
             </Form-item>
@@ -69,6 +76,11 @@
                     </Form-item>
                 </i-col>
             </Row>
+            <Row>
+                <i-col span="16" style="margin-top: -30px;">
+                    <span style="margin-left: 100px;color: red;font-size: 12px;">* 图片尺寸建议760*484像素以内,大小2M以下</span>
+                </i-col>
+            </Row>
             <Form-item label="描述" prop="simpleDesc">
                 <i-input type="textarea" v-model="brand.simpleDesc" placeholder="描述"/>
             </Form-item>
@@ -95,6 +107,11 @@
                     </Form-item>
                 </i-col>
             </Row>
+            <Row>
+                <i-col span="16" style="margin-top: -30px;">
+                    <span style="margin-left: 100px;color: red;font-size: 12px;">* 图片尺寸建议760*484像素以内,大小2M以下</span>
+                </i-col>
+            </Row>
             <Form-item label="排序" prop="sortOrder">
                 <Input-number :min="0" :step="1" v-model="brand.sortOrder" placeholder="排序" style="width: 188px;"/>
             </Form-item>
@@ -134,6 +151,11 @@
                     </Form-item>
                 </i-col>
             </Row>
+            <Row>
+                <i-col span="16" style="margin-top: -30px;">
+                    <span style="margin-left: 100px;color: red;font-size: 12px;">* app显示图片尺寸建议760*484像素以内,大小2M以下</span>
+                </i-col>
+            </Row>
             <Form-item label="新品牌" prop="isNew">
                 <Radio-group v-model="brand.isNew">
                     <Radio label="1">
@@ -167,6 +189,11 @@
                     </Form-item>
                 </i-col>
             </Row>
+            <Row>
+                <i-col span="16" style="margin-top: -30px;">
+                    <span style="margin-left: 100px;color: red;font-size: 12px;">* 新品牌图片尺寸建议760*484像素以内,大小2M以下</span>
+                </i-col>
+            </Row>
             <Form-item label="新品牌排序" prop="newSortOrder">
                 <Input-number :min="0" :step="1" v-model="brand.newSortOrder" placeholder="新品牌排序"
                               style="width: 188px;"/>

+ 67 - 47
kmall-admin/src/main/webapp/WEB-INF/page/shop/category.html

@@ -86,33 +86,38 @@
                     </Radio>
                 </Radio-group>
             </Form-item>
+            <!--<Row>-->
+                <!--<i-col span="16">-->
+                    <!--<Form-item label="banner图片" prop="bannerUrl">-->
+                        <!--<i-input v-model="category.bannerUrl" placeholder="banner图片" readonly/>-->
+                    <!--</Form-item>-->
+                <!--</i-col>-->
+                <!--<i-col span="4">-->
+                    <!--<Form-item :label-width="1">-->
+                        <!--<Upload style="width: 300px;" action="../sys/oss/upload" :format="['jpg','jpeg','png']"-->
+                                <!--max-size="2048"-->
+                                <!--:on-success="handleSuccessBannerUrl" :on-format-error="handleFormatError"-->
+                                <!--:show-upload-list="false"-->
+                                <!--:on-exceeded-size="handleMaxSize">-->
+                            <!--<i-button icon="ios-cloud-upload-outline">上传图片</i-button>-->
+                        <!--</Upload>-->
+                    <!--</Form-item>-->
+                <!--</i-col>-->
+                <!--<i-col span="4">-->
+                    <!--<Form-item :label-width="1">-->
+                        <!--<i-button icon="eye" @click="eyeImageBannerUrl">预览图片</i-button>-->
+                    <!--</Form-item>-->
+                <!--</i-col>-->
+            <!--</Row>-->
+            <!--<Row>-->
+                <!--<i-col span="16" style="margin-top: -30px;">-->
+                    <!--<span style="margin-left: 100px;color: red;font-size: 12px;">* 尺寸建议320*105像素以内,大小2M以下</span>-->
+                <!--</i-col>-->
+            <!--</Row>-->
             <Row>
                 <i-col span="16">
-                    <Form-item label="banner图片" prop="bannerUrl">
-                        <i-input v-model="category.bannerUrl" placeholder="banner图片" readonly/>
-                    </Form-item>
-                </i-col>
-                <i-col span="4">
-                    <Form-item :label-width="1">
-                        <Upload style="width: 300px;" action="../sys/oss/upload" :format="['jpg','jpeg','png']"
-                                max-size="2048"
-                                :on-success="handleSuccessBannerUrl" :on-format-error="handleFormatError"
-                                :show-upload-list="false"
-                                :on-exceeded-size="handleMaxSize">
-                            <i-button icon="ios-cloud-upload-outline">上传图片</i-button>
-                        </Upload>
-                    </Form-item>
-                </i-col>
-                <i-col span="4">
-                    <Form-item :label-width="1">
-                        <i-button icon="eye" @click="eyeImageBannerUrl">预览图片</i-button>
-                    </Form-item>
-                </i-col>
-            </Row>
-            <Row>
-                <i-col span="16">
-                    <Form-item label="icon链接" prop="iconUrl">
-                        <i-input v-model="category.iconUrl" placeholder="icon链接" readonly/>
+                    <Form-item label="首页icon" prop="iconUrl">
+                        <i-input v-model="category.iconUrl" placeholder="首页icon" readonly/>
                     </Form-item>
                 </i-col>
                 <i-col span="4">
@@ -133,32 +138,42 @@
                 </i-col>
             </Row>
             <Row>
-                <i-col span="16">
-                    <Form-item label="图片" prop="imgUrl">
-                        <i-input v-model="category.imgUrl" placeholder="图片" readonly/>
-                    </Form-item>
-                </i-col>
-                <i-col span="4">
-                    <Form-item :label-width="1">
-                        <Upload style="width: 300px;" action="../sys/oss/upload" :format="['jpg','jpeg','png']"
-                                max-size="2048"
-                                :on-success="handleSuccessImgUrl" :on-format-error="handleFormatError"
-                                :show-upload-list="false"
-                                :on-exceeded-size="handleMaxSize">
-                            <i-button icon="ios-cloud-upload-outline">上传图片</i-button>
-                        </Upload>
-                    </Form-item>
-                </i-col>
-                <i-col span="4">
-                    <Form-item :label-width="1">
-                        <i-button icon="eye" @click="eyeImageImgUrl">预览图片</i-button>
-                    </Form-item>
+                <i-col span="16" style="margin-top: -30px;">
+                    <span style="margin-left: 100px;color: red;font-size: 12px;">* 尺寸建议90*90像素以内,大小2M以下</span>
                 </i-col>
             </Row>
+            <!--<Row>-->
+                <!--<i-col span="16">-->
+                    <!--<Form-item label="图片" prop="imgUrl">-->
+                        <!--<i-input v-model="category.imgUrl" placeholder="图片" readonly/>-->
+                    <!--</Form-item>-->
+                <!--</i-col>-->
+                <!--<i-col span="4">-->
+                    <!--<Form-item :label-width="1">-->
+                        <!--<Upload style="width: 300px;" action="../sys/oss/upload" :format="['jpg','jpeg','png']"-->
+                                <!--max-size="2048"-->
+                                <!--:on-success="handleSuccessImgUrl" :on-format-error="handleFormatError"-->
+                                <!--:show-upload-list="false"-->
+                                <!--:on-exceeded-size="handleMaxSize">-->
+                            <!--<i-button icon="ios-cloud-upload-outline">上传图片</i-button>-->
+                        <!--</Upload>-->
+                    <!--</Form-item>-->
+                <!--</i-col>-->
+                <!--<i-col span="4">-->
+                    <!--<Form-item :label-width="1">-->
+                        <!--<i-button icon="eye" @click="eyeImageImgUrl">预览图片</i-button>-->
+                    <!--</Form-item>-->
+                <!--</i-col>-->
+            <!--</Row>-->
+            <!--<Row>-->
+                <!--<i-col span="16" style="margin-top: -30px;">-->
+                    <!--<span style="margin-left: 100px;color: red;font-size: 12px;">* 尺寸建议320*105像素以内,大小2M以下</span>-->
+                <!--</i-col>-->
+            <!--</Row>-->
             <Row>
                 <i-col span="16">
-                    <Form-item label="手机banner" prop="wapBannerUrl">
-                        <i-input v-model="category.wapBannerUrl" placeholder="手机banner" readonly/>
+                    <Form-item label="分类banner" prop="wapBannerUrl">
+                        <i-input v-model="category.wapBannerUrl" placeholder="分类banner" readonly/>
                     </Form-item>
                 </i-col>
                 <i-col span="4">
@@ -178,6 +193,11 @@
                     </Form-item>
                 </i-col>
             </Row>
+            <Row>
+                <i-col span="16" style="margin-top: -30px;">
+                    <span style="margin-left: 100px;color: red;font-size: 12px;">* 一级分类图片尺寸建议720*246像素以内,二级分类图片尺寸建议250*250像素以内,大小2M以下</span>
+                </i-col>
+            </Row>
             <!--<Form-item label="类型" prop="type">-->
             <!--<Radio-group v-model="category.type">-->
             <!--<Radio label="0">-->

+ 33 - 65
kmall-admin/src/main/webapp/WEB-INF/page/shop/goods.html

@@ -67,13 +67,23 @@
                     <i-input v-model="q.goodsSn" @on-enter="query" placeholder="商品编码"/>
                 </i-col>
                 <i-col span="3">
+                    <i-input v-model="q.prodBarcode" @on-enter="query" placeholder="产品条码"/>
+                </i-col>
+                <i-col span="3">
                     <i-input v-model="q.name" @on-enter="query" placeholder="名称"/>
                 </i-col>
                 <i-col span="3">
+                    <i-select v-model="q.goodsBizType" placeholder="货品业务类型"
+                              label-in-value>
+                        <i-option v-for="macro in macros" :value="macro.value" :key="macro.id">{{macro.name}}
+                        </i-option>
+                    </i-select>
+                </i-col><!--
+                <i-col span="3">
                     <i-select v-model="q.category" placeholder="商品分类" filterable @on-change="changeQueryCategories"
                               label-in-value>
                         <i-option v-for="category in queryCategories" :value="category.id"
-                                  :key="category.id">{{category.name}}
+                                  :key="categoqry.id">{{category.name}}
                         </i-option>
                     </i-select>
                 </i-col>
@@ -83,7 +93,7 @@
                                   :key="category.id">{{category.name}}
                         </i-option>
                     </i-select>
-                </i-col>
+                </i-col>-->
                 <i-button @click="query">查询</i-button>
                 <i-button @click="reloadSearch">重置</i-button>
             </div>
@@ -121,8 +131,8 @@
                 </i-col>
                 #end
                 &nbsp;&nbsp;&nbsp;&nbsp;
-                <a href="file/goods_export_yyyy_mm_dd_v1.0.0.xls">商品模板下载</a>&nbsp;&nbsp;&nbsp;&nbsp;
-                <a href="file/general_goods_export_yyyy_mm_dd_v1.0.0.xls">普货商品模板下载</a>
+                <a href="../statics/file/goods_export_yyyy_mm_dd_v1.0.0.xls">商品模板下载</a>&nbsp;&nbsp;&nbsp;&nbsp;
+                <a href="../statics/file/general_goods_export_yyyy_mm_dd_v1.0.0.xls">普货商品模板下载</a>
             </div>
         </Row>
         <table id="jqGrid"></table>
@@ -140,26 +150,16 @@
                     </i-col>
                 </Row>
                 <!--<i-form ref="formValidate" :model="goods" :rules="ruleValidate" :label-width="80">-->
-                    <Form-item label="商户" prop="merchSn">
+                <Form-item label="商户" prop="merchSn">
                         <i-select v-model="goods.merchSn" filterable placeholder="商户" @on-change="showMerchInfo" label-in-value>
                             <i-option v-for="merch in merchList" :value="merch.merchSn" :key="merch.merchSn">{{merch.merchName}}</i-option>
                         </i-select>
                     </Form-item>
-                    <Form-item label="商品类型" prop="categoryId" style="height: 30px;">
-                        <!--<i-input v-model="goods.categoryName" @on-click="categoryTree" icon="eye" readonly="readonly" placeholder="商品类型"/>-->
-                        <i-select v-model="goods.attributeCategory" placeholder="商品分类" @on-change="changeCategories"
-                                  label-in-value style="width: 268px;height: 30px;">
-                            <i-option v-for="category in categories" :value="category.id"
-                                      :key="category.id">{{category.name}}
-                            </i-option>
-                        </i-select>
-                        <i-select v-model="goods.categoryId" placeholder="商品二级分类" @on-change="getAttributes"
-                                  label-in-value style="width: 268px;height: 30px;">
-                            <i-option v-for="category in categoriesTwo" :value="category.id"
-                                      :key="category.id">{{category.name}}
-                            </i-option>
-                        </i-select>
-                    </Form-item>
+                <Form-item label="第三方商户" prop="merchSn">
+                    <i-select v-model="goods.thirdPartyMerchCode" placeholder="第三方商户" label-in-value>
+                        <i-option v-for="thirdMerchant in thirdMerchantBizList" :value="thirdMerchant.thirdPartyMerchCode" :key="thirdMerchant.thirdPartyMerchCode">{{thirdMerchant.thirdPartyMerchName}}</i-option>
+                    </i-select>
+                </Form-item>
                     <Form-item label="商品编码" prop="goodsSn">
                         <i-input v-model="goods.goodsSn" placeholder="商品编码"/>
                     </Form-item>
@@ -188,13 +188,6 @@
                             </i-option>
                         </i-select>
                     </Form-item>
-                    <Form-item label="品牌" prop="brandId">
-                        <i-select v-model="goods.brandId" placeholder="品牌"
-                                  label-in-value style="width: 268px;">
-                            <i-option v-for="brand in brands" :value="brand.id" :key="brand.id">{{brand.name}}
-                            </i-option>
-                        </i-select>
-                    </Form-item>
                 <Form-item label="供应商" prop="supplierId">
                     <i-select v-model="goods.supplierId" placeholder="供应商"
                               label-in-value style="width: 268px;">
@@ -202,19 +195,19 @@
                         </i-option>
                     </i-select>
                 </Form-item>
-                    <Form-item label="运费模版" prop="freightId">
+                    <!--<Form-item label="运费模版" prop="freightId">
                         <i-select v-model="goods.freightId" placeholder="运费模版"
                                   label-in-value style="width: 268px;">
                             <i-option v-for="freight in freights" :value="freight.id" :key="freight.id">{{freight.name}}
                             </i-option>
                         </i-select>
-                    </Form-item>
-                    <Form-item label="市场价" prop="marketPrice">
-                        <Input-number :min="0.01" :step="0.01" v-model="goods.marketPrice" placeholder="市场价" style="width: 268px;"/>
-                    </Form-item>
-                    <Form-item label="零售价" prop="retailPrice">
-                        <Input-number :min="0.01" :step="0.01" v-model="goods.retailPrice" placeholder="零售价" style="width: 268px;"/>
-                    </Form-item>
+                    </Form-item>-->
+                    <!--<Form-item label="市场价" prop="marketPrice">-->
+                        <!--<Input-number :min="0.01" :step="0.01" v-model="goods.marketPrice" placeholder="市场价" style="width: 268px;"/>-->
+                    <!--</Form-item>-->
+                    <!--<Form-item label="零售价" prop="retailPrice">-->
+                        <!--<Input-number :min="0.01" :step="0.01" v-model="goods.retailPrice" placeholder="零售价" style="width: 268px;"/>-->
+                    <!--</Form-item>-->
                     <Form-item label="商品税率(0.00)" prop="goodsRate">
                         <Input-number :min="0.001" :step="0.001" v-model="goods.goodsRate" placeholder="商品税率" style="width: 268px;"/>
                     </Form-item>
@@ -412,36 +405,11 @@
                 </template>
                 <div id="goodsDesc"></div>
             </Tab-Pane>
-            <Tab-Pane label="参数" name="name5">
-                <!--<i-form ref="formValidate" :model="goods" :rules="ruleValidate" :label-width="80">-->
-                    <div v-for="(item,index) in attributeEntityList" v-show="item.isDelete==0">
-                        <div class="row">
-                            <div class="col-md-3">
-                                <label class="ivu-form-item-label">属性:</label>
-                                <div class="col-md-7 input-icon right">
-                                    <i-select v-model="item.attributeId" filterable>
-                                        <i-option v-for="attribute in attributes" :value="attribute.id"
-                                                  :key="attribute.id">{{attribute.name}}
-                                        </i-option>
-                                    </i-select>
-                                </div>
-                            </div>
-                            <div class="col-md-3">
-                                <label class="ivu-form-item-label">属性值:</label>
-                                <div class="col-md-7 input-icon right">
-                                    <i-input type="text" v-model="item.value"/>
-                                </div>
-                            </div>
-                            <button v-if="index == 0" class="btn btn-primary btn-sm" type="button" @click="addAttrRow">
-                                <i class="fa fa-plus"></i>
-                            </button>
-                            <button class="btn red btn-sm" type="button" @click="delAttrRow(index)">
-                                <i class="fa fa-trash-o"></i>
-                            </button>
-                        </div>
-                    </div>
-                <!--</i-form>-->
-            </Tab-Pane>
+            <!--<Tab-Pane label="参数" name="name5">-->
+                <!--&lt;!&ndash;<i-form ref="formValidate" :model="goods" :rules="ruleValidate" :label-width="80">&ndash;&gt;-->
+                    <!---->
+                <!--&lt;!&ndash;</i-form>&ndash;&gt;-->
+            <!--</Tab-Pane>-->
             <Tab-Pane label="其他信息" name="name6">
                 <!--<i-form ref="formValidate" :model="goods" :rules="ruleValidate" :label-width="80">-->
                     <Form-item label="排序" prop="sortOrder">

+ 1 - 1
kmall-admin/src/main/webapp/WEB-INF/page/shop/offilineOrderList.html

@@ -21,7 +21,7 @@
                         <i-option value="300">订单已发货</i-option>
                         <i-option value="301">用户确认收货</i-option>
                         <i-option value="401">退款</i-option>
-                        <i-option value="402">完成</i-option>
+                        <!--<i-option value="402">完成</i-option>-->
                     </i-select>
                 </i-col>
                 <!--<i-col span="4">

+ 10 - 4
kmall-admin/src/main/webapp/WEB-INF/page/shop/order.html

@@ -9,13 +9,13 @@
     <div v-show="showDiv == 1">
         <Row :gutter="16">
             <div class="search-group">
-                <i-col span="4">
+                <i-col span="3">
                     <i-input v-model="q.orderSn" @on-enter="query" placeholder="订单号"/>
                 </i-col>
-                <i-col span="4">
+                <i-col span="3">
                     <i-input v-model="q.merchOrderSn" @on-enter="query" placeholder="商户订单号"/>
                 </i-col>
-                <i-col span="4">
+                <i-col span="3">
                     <i-select v-model="q.orderStatus" placeholder="订单状态">
                         <i-option value="0">待付款</i-option>
                         <i-option value="101">订单已取消</i-option>
@@ -24,7 +24,7 @@
                         <i-option value="300">订单已发货</i-option>
                         <i-option value="301">用户确认收货</i-option>
                         <i-option value="401">退款</i-option>
-                        <i-option value="402">完成</i-option>
+                        <!--<i-option value="402">完成</i-option>-->
                     </i-select>
                 </i-col>
                 <!--<i-col span="4">
@@ -33,6 +33,12 @@
                         <i-option value="2">团购订单</i-option>
                     </i-select>
                 </i-col>-->
+                <i-col span="3">
+                    <Date-picker v-model="q.startTime" placeholder="创建订单开始时间"/>
+                </i-col>
+                <i-col span="3">
+                    <Date-picker v-model="q.endTime" placeholder="创建订单结束时间"/>
+                </i-col>
                 <i-button @click="query">查询</i-button>
                 <i-button @click="reloadSearch">重置</i-button>
             </div>

+ 5 - 6
kmall-admin/src/main/webapp/WEB-INF/page/shop/store.html

@@ -38,7 +38,7 @@
         <p slot="title">{{title}}</p>
         <i-form ref="formValidate" :model="store" :rules="ruleValidate" :label-width="80">
             <Form-item label="商户编号" prop="merchSn">
-                <i-select v-model="store.merchSn" filterable placeholder="商户编号" label-in-value>
+                <i-select v-model="store.merchSn" filterable placeholder="商户编号" @on-change="showMerchInfo"  label-in-value>
                     <i-option v-for="merch in merchList" :value="merch.merchSn" :key="merch.merchSn">{{merch.merchName}}</i-option>
                 </i-select>
             </Form-item>
@@ -48,11 +48,10 @@
             <Form-item label="门店编号" prop="storeNumber">
                 <i-input v-model="store.storeNumber" placeholder="门店编号"/>
             </Form-item>
-            <Form-item label="第三方商户编号" prop="thirdPartyMerchCode">
-                <i-input v-model="store.thirdPartyMerchCode" placeholder="第三方商户编号"/>
-            </Form-item>
-            <Form-item label="第三方商户名称" prop="thirdPartyMerchName">
-                <i-input v-model="store.thirdPartyMerchName" placeholder="第三方商户名称"/>
+            <Form-item label="第三方商户编号" prop="merchSn">
+                <i-select v-model="store.thirdPartyMerchCode" placeholder="第三方商户编号" label-in-value>
+                    <i-option v-for="thirdMerchant in thirdMerchantBizList" :value="thirdMerchant.thirdPartyMerchCode" :key="thirdMerchant.thirdPartyMerchCode">{{thirdMerchant.thirdPartyMerchName}}</i-option>
+                </i-select>
             </Form-item>
             <Form-item label="第三方商户快递协议类型" prop="exprAgreementType">
                 <Radio-group v-model="store.exprAgreementType">

+ 85 - 8
kmall-admin/src/main/webapp/WEB-INF/page/shop/storeProductStock.html

@@ -51,19 +51,41 @@
     <div v-show="showList">
         <Row :gutter="16">
             <div class="search-group">
-                <i-col span="4">
+                <i-col span="3">
                     <i-select v-model="q.storeId" placeholder="门店" filterable label-in-value>
                         <i-option v-for="store in stores" :value="store.id"
                                   :key="store.id">{{store.storeName}}
                         </i-option>
                     </i-select>
                 </i-col>
-                <i-col span="4">
+                <i-col span="3">
                     <i-input v-model="q.goodsName" @on-enter="query" placeholder="名称"/>
                 </i-col>
-                <i-col span="4">
+                <i-col span="3">
                     <i-input v-model="q.goodsSn" @on-enter="query" placeholder="商品编码"/>
                 </i-col>
+                <i-col span="3">
+                    <i-select v-model="q.category" placeholder="商品分类" filterable @on-change="changeQueryCategories"
+                              label-in-value>
+                        <i-option v-for="category in queryCategories" :value="category.id"
+                                  :key="category.id">{{category.name}}
+                        </i-option>
+                    </i-select>
+                </i-col>
+                <i-col span="3">
+                    <i-select v-model="q.categoryTwo" placeholder="商品二级分类" filterable label-in-value>
+                        <i-option v-for="category in queryCategoriesTwo" :value="category.id"
+                                  :key="category.id">{{category.name}}
+                        </i-option>
+                    </i-select>
+                </i-col>
+                <i-col span="3">
+                    <i-select v-model="q.goodsBizType" placeholder="货品业务类型"
+                              label-in-value>
+                        <i-option v-for="macro in macros" :value="macro.value" :key="macro.id">{{macro.name}}
+                        </i-option>
+                    </i-select>
+                </i-col>
                 <!--<i-col span="4">
                     <i-input v-model="q.productSn" @on-enter="query" placeholder="规格编码"/>
                 </i-col>-->
@@ -114,19 +136,74 @@
                 <Input-number :min="0" :step="1" v-model="productStoreRela.stockNum" placeholder="总库存"
                               style="width: 268px;"/>
             </Form-item>
-            <Form-item v-if="showInput" label="规格" prop="specification">
-                <i-input v-model="productStoreRela.specification" placeholder="规格"/>
+            <Form-item v-if="showInput" label="商品类型" prop="categoryId" style="height: 30px;">
+                <!--<i-input v-model="goods.categoryName" @on-click="categoryTree" icon="eye" readonly="readonly" placeholder="商品类型"/>-->
+                <i-select v-model="productStoreRela.attributeCategory" placeholder="商品分类" @on-change="changeCategories"
+                          label-in-value style="width: 268px;height: 30px;">
+                    <i-option v-for="category in categories" :value="category.id"
+                              :key="category.id">{{category.name}}
+                    </i-option>
+                </i-select>
+                <i-select v-model="productStoreRela.categoryId" placeholder="商品二级分类" @on-change="getAttributes"
+                          label-in-value style="width: 268px;height: 30px;">
+                    <i-option v-for="category in categoriesTwo" :value="category.id"
+                              :key="category.id">{{category.name}}
+                    </i-option>
+                </i-select>
+            </Form-item>
+            <Form-item v-if="showInput" label="品牌" prop="brandId">
+                <i-select v-model="productStoreRela.brandId" placeholder="品牌"
+                          label-in-value style="width: 268px;">
+                    <i-option v-for="brand in brands" :value="brand.id" :key="brand.id">{{brand.name}}
+                    </i-option>
+                </i-select>
+            </Form-item>
+            <Form-item v-if="showInput" label="运费模版" prop="freightId">
+                <i-select v-model="productStoreRela.freightId" placeholder="运费模版"
+                          label-in-value style="width: 268px;">
+                    <i-option v-for="freight in freights" :value="freight.id" :key="freight.id">{{freight.name}}
+                    </i-option>
+                </i-select>
+            </Form-item>
+            <Form-item v-if="showInputSpecification" label="规格" prop="specification">
+                <i-input v-model="specification" placeholder="规格" style="width: 268px;"/>
             </Form-item>
             <Form-item  v-if="showInput" label="零售价" prop="retailPrice">
                 <Input-number :min="0.01" :step="0.01" v-model="productStoreRela.retailPrice" placeholder="零售价格"
                               style="width: 268px;"/>
             </Form-item>
-            <Form-item  v-if="showInput" label="市场价" prop="marketPrice">
-                <Input-number :min="0.01" :step="0.01" v-model="productStoreRela.marketPrice" placeholder="零售价格"
+            <Form-item v-if="showInput" label="市场价" prop="marketPrice">
+                <Input-number :min="0.01" :step="0.01" v-model="productStoreRela.marketPrice" placeholder="市场价"
                               style="width: 268px;"/>
             </Form-item>
+            <div v-if="showInput" v-for="(item,index) in attributeEntityList" v-show="item.isDelete==0" style="margin-left: 16px;">
+                <div class="row">
+                    <div class="col-md-3">
+                        <label class="ivu-form-item-label">属性:</label>
+                        <div class="col-md-7 input-icon right">
+                            <i-select v-model="item.attributeId" filterable>
+                                <i-option v-for="attribute in attributes" :value="attribute.id"
+                                          :key="attribute.id">{{attribute.name}}
+                                </i-option>
+                            </i-select>
+                        </div>
+                    </div>
+                    <div class="col-md-3">
+                        <label class="ivu-form-item-label">属性值:</label>
+                        <div class="col-md-7 input-icon right">
+                            <i-input type="text" v-model="item.value"/>
+                        </div>
+                    </div>
+                    <button v-if="index == 0" class="btn btn-primary btn-sm" type="button" @click="addAttrRow">
+                        <i class="fa fa-plus"></i>
+                    </button>
+                    <button class="btn red btn-sm" type="button" @click="delAttrRow(index)">
+                        <i class="fa fa-trash-o"></i>
+                    </button>
+                </div>
+            </div>
         </i-form>
-        <div style="padding-left: 20px">
+        <div style="padding-left: 20px;padding-top: 20px">
             <i-button type="primary" @click="handleSubmit('formValidate')">提交</i-button>
             <i-button type="warning" @click="reload" style="margin-left: 8px"/>
             返回</i-button>

+ 69 - 0
kmall-admin/src/main/webapp/WEB-INF/page/shop/thirdmerchantbiz.html

@@ -0,0 +1,69 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <title>第三方商户表</title>
+    #parse("sys/header.html")
+</head>
+<body>
+<div id="rrapp" v-cloak>
+	<div v-show="showList">
+        <Row :gutter="16">
+            <div class="search-group">
+                <i-col span="4">
+                    <i-input v-model="q.name" @on-enter="query" placeholder="名称"/>
+                </i-col>
+                <i-button @click="query">查询</i-button>
+                <i-button @click="reloadSearch">重置</i-button>
+            </div>
+            <div class="buttons-group">
+                #if($shiro.hasPermission("thirdmerchantbiz:save"))
+                <i-button type="info" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</i-button>
+                #end
+                #if($shiro.hasPermission("thirdmerchantbiz:update"))
+                <i-button type="warning" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</i-button>
+                #end
+                #if($shiro.hasPermission("thirdmerchantbiz:delete"))
+                <i-button type="error" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</i-button>
+                #end
+            </div>
+        </Row>
+	    <table id="jqGrid"></table>
+	    <div id="jqGridPager"></div>
+    </div>
+
+    <Card v-show="!showList">
+        <p slot="title">{{title}}</p>
+		<i-form ref="formValidate" :model="thirdMerchantBiz" :rules="ruleValidate" :label-width="80">
+            <Form-item label="商户" prop="merchSn">
+                <i-select v-model="thirdMerchantBiz.merchSn" filterable placeholder="商户" label-in-value>
+                    <i-option v-for="merch in merchList" :value="merch.merchSn" :key="merch.merchSn">{{merch.merchName}}</i-option>
+                </i-select>
+            </Form-item>
+            <Form-item label="第三方商户代码" prop="thirdPartyMerchCode">
+                <i-input v-model="thirdMerchantBiz.thirdPartyMerchCode" placeholder="第三方商户代码"/>
+            </Form-item>
+            <Form-item label="第三方商户名称" prop="thirdPartyMerchName">
+                <i-input v-model="thirdMerchantBiz.thirdPartyMerchName" placeholder="第三方商户名称"/>
+            </Form-item>
+            <Form-item label="是否有效" prop="isValid">
+                <Radio-group v-model="thirdMerchantBiz.isValid">
+                    <Radio label="1">
+                        <span>无效</span>
+                    </Radio>
+                    <Radio label="0">
+                        <span>有效</span>
+                    </Radio>
+                </Radio-group>
+            </Form-item>
+            <Form-item>
+                <i-button type="primary" @click="handleSubmit('formValidate')">提交</i-button>
+                <i-button type="warning" @click="reload" style="margin-left: 8px"/>返回</i-button>
+                <i-button type="ghost" @click="handleReset('formValidate')" style="margin-left: 8px">重置</i-button>
+            </Form-item>
+        </i-form>
+	</Card>
+</div>
+
+<script src="${rc.contextPath}/js/shop/thirdmerchantbiz.js?_${date.systemTime}"></script>
+</body>
+</html>

+ 2 - 0
kmall-admin/src/main/webapp/js/shop/attribute.js

@@ -4,6 +4,8 @@ $(function () {
         datatype: "json",
         colModel: [
             {label: 'id', name: 'id', index: 'id', key: true, hidden: true},
+            {label: '所属商户', name: 'merchName', index: 'merchName', width: 100, align: 'center'},
+            {label: '所属门店', name: 'storeName', index: 'storeName', width: 80, align: 'center'},
             {label: '所属分类', name: 'categoryName', index: 'attribute_category_id', width: 80},
             {label: '名称', name: 'name', index: 'name', width: 80},
             // {label: '类型', name: 'inputType', index: 'input_type', width: 80},

+ 16 - 2
kmall-admin/src/main/webapp/js/shop/brand.js

@@ -4,7 +4,11 @@ $(function () {
         datatype: "json",
         colModel: [{
             label: 'id', name: 'id', index: 'id', key: true, hidden: true
-        }, {
+        },
+            {label: '所属商户', name: 'merchName', index: 'merchName', width: 100, align: 'center'},
+            {label: '所属门店', name: 'storeName', index: 'storeName', width: 80, align: 'center'},
+            {label: '所属分类', name: 'categoryName', index: 'categoryName', width: 60, align: 'center'},
+            {
             label: '品牌名称', name: 'name', index: 'name', width: 80
         }, {
             label: '图片', name: 'listPicUrl', index: 'list_pic_url', width: 80, formatter: function (value) {
@@ -101,7 +105,8 @@ var vm = new Vue({
             name: ''
         },
         storeList: [],
-        merchList: []
+        merchList: [],
+        categories: []//一级分类
     },
     methods: {
         query: function () {
@@ -183,11 +188,20 @@ var vm = new Vue({
                 vm.storeList = r.list;
             });
         },
+        getCategoryByStore: function (opt) {
+            var value = opt.value;
+            vm.getCategories(value);
+        },
         getMerchList: function() {
             $.get("../merch/queryAll", function (r) {
                 vm.merchList = r.list;
             });
         },
+        getCategories: function (storeId) {
+            $.get("../category/getCategorySelect?isShow=1&storeId=" + storeId, function (r) {
+                vm.categories = r.list;
+            });
+        },
         reload: function (event) {
             vm.showList = true;
             var page = $("#jqGrid").jqGrid('getGridParam', 'page');

+ 13 - 12
kmall-admin/src/main/webapp/js/shop/category.js

@@ -45,7 +45,8 @@ TreeGrid.initColumn = function () {
             return '-';
         }},
         {title: '分类名称', field: 'name', align: 'center', valign: 'middle', width: '60px'},
-        {title: '商户编号', field: 'merchSn', align: 'center', valign: 'middle', width: '100px'},
+        {title: '所属商户', field: 'merchName',  width: '100px', align: 'center'},
+        {title: '所属门店', field: 'storeName', width: '80px', align: 'center'},
         {title: '描述', field: 'frontDesc', align: 'center', valign: 'middle', width: '150px'},
         {title: '首页排序', field: 'sortOrder', align: 'center', valign: 'middle', width: '50px'},
         {
@@ -74,21 +75,21 @@ var vm = new Vue({
             frontDesc: [
                 {required: true, message: '描述不能为空', trigger: 'blur'}
             ],
-            bannerUrl: [
-                {required: true, message: 'banner图片不能为空', trigger: 'blur'}
-            ],
+            // bannerUrl: [
+            //     {required: true, message: 'banner图片不能为空', trigger: 'blur'}
+            // ],
             iconUrl: [
-                {required: true, message: 'icon链接不能为空', trigger: 'blur'}
-            ],
-            imgUrl: [
-                {required: true, message: '图片不能为空', trigger: 'blur'}
+                {required: true, message: '首页icon不能为空', trigger: 'blur'}
             ],
+            // imgUrl: [
+            //     {required: true, message: '图片不能为空', trigger: 'blur'}
+            // ],
             wapBannerUrl: [
-                {required: true, message: '手机banner不能为空', trigger: 'blur'}
-            ],
-            frontName: [
-                {required: true, message: 'frontName不能为空', trigger: 'blur'}
+                {required: true, message: '分类banner不能为空', trigger: 'blur'}
             ]
+            // frontName: [
+            //     {required: true, message: 'frontName不能为空', trigger: 'blur'}
+            // ]
         },
         q: {
             name: ''

+ 2 - 0
kmall-admin/src/main/webapp/js/shop/freight.js

@@ -4,6 +4,8 @@ $(function () {
         datatype: "json",
         colModel: [
             {label: 'ID', name: 'id', index: 'id', hidden: true, key: true},
+            {label: '所属商户', name: 'merchName', index: 'merchName', width: 100, align: 'center'},
+            {label: '所属门店', name: 'storeName', index: 'storeName', width: 80, align: 'center'},
             {label: '模版名称', name: 'name', index: 'name'},
             {
                 label: '模版类型', name: 'templateType', index: 'template_type', width: 100,

+ 59 - 45
kmall-admin/src/main/webapp/js/shop/goods.js

@@ -5,9 +5,11 @@ $(function () {
         colModel: [
             {label: 'ID', name: 'id', index: 'id', hidden: true, key: true},
             {label: '商户名称', name: 'merchName', index: 'merchName', width: 100, align: 'center'},
+            {label: '第三方商户编号', name: 'thirdPartyMerchCode', index: 'thirdPartyMerchCode', width: 60, align: 'center'},
             {label: '商品编码', name: 'goodsSn', index: 'goods_Sn', width: 60, align: 'center'},
             {label: 'SKU', name: 'sku', index: 'sku', width: 80, align: 'center'},
-            {label: '商品类型', name: 'categoryName', index: 'category_id', width: 40, align: 'center'},
+            {label: '产品条码', name: 'prodBarcode', index: 'prod_barcode', width: 60, align: 'center'},
+            // {label: '商品类型', name: 'categoryName', index: 'category_id', width: 40, align: 'center'},
             {label: '名称', name: 'name', index: 'name', width: 160, align: 'center'},
             {
                 label: '货品业务类型', name: 'goodsBizType', index: 'goods_biz_type', width: 70, align: 'center',
@@ -22,20 +24,20 @@ $(function () {
                     return '普通货物';
                 }
             },
-            {label: '零售价格', name: 'retailPrice', index: 'retail_price', width: 80, align: 'center'},
-            {label: '市场价', name: 'marketPrice', index: 'market_price', width: 80, align: 'center'},
+            // {label: '零售价格', name: 'retailPrice', index: 'retail_price', width: 80, align: 'center'},
+            // {label: '市场价', name: 'marketPrice', index: 'market_price', width: 80, align: 'center'},
             {
                 label: '上架', name: 'isOnSale', index: 'is_on_sale', width: 40, align: 'center',
                 formatter: function (value) {
                     return transIsNot(value);
                 }
             },
-            /*{
+            {
                 label: '热销', name: 'isHot', index: 'is_hot', width: 80, formatter: function (value) {
                 return transIsNot(value);
             }
             },
-            {
+            /*{
                 label: '活动', name: 'goodsType', index: 'goodsType', width: 80,
                 formatter: function (value) {
                     if (value == 2) {
@@ -123,26 +125,27 @@ var vm = new Vue({
                 {required: true, message: '名称不能为空', trigger: 'blur'}
             ]*/
         },
-        q: {name: '', goodsSn: '', category: '', categoryTwo: '', merchSn: ''},
+        q: {name: '', goodsSn: '', prodBarcode: '',goodsBizType:'', merchSn: ''},
         attributes: [],
         attributeEntityList: [{'id': '', 'goodsId': '', 'attributeId': '', 'value': '', 'isDelete': 0}],
         productEntityList: [{'id': '', 'goodsId': '', 'goodsSpecificationIds': '', 'goodsSpecificationNameValue': '', 'goodsSn': '', 'goodsNumber': '', 'isDelete': 0, 'goodsDefault': 0}],
-        queryCategories: [],//一级分类
-        queryCategoriesTwo: [],
+        /*queryCategories: [],//一级分类
+        queryCategoriesTwo: [],*/
         queryMerch: [],
-        categories: [],//一级分类
-        categoriesTwo: [],
+        /*categories: [],//一级分类
+        categoriesTwo: [],*/
         macros: [],//商品单位
-        attributeCategories: [],//属性类别
+        // attributeCategories: [],//属性类别
         specifications: [],
-        brands: [],
-        freights: [],
+        // brands: [],
+        // freights: [],
         showInput: true,
-        categoryId: '',
+        // categoryId: '',
         cusUnitCodeList: [],
         cusNationCodeList: [],
         merchList: [],
-        suppliers: []
+        suppliers: [],
+        thirdMerchantBizList: []
     },
     methods: {
         delSpeRow: function (index) {
@@ -159,7 +162,7 @@ var vm = new Vue({
             }
             vm.productEntityList.push({'id': '', 'goodsId': '', 'goodsSpecificationIds': '', 'goodsSpecificationNameValue': '', 'goodsSn': '', 'goodsNumber': '', 'isDelete': 0, 'goodsDefault': 0});
         },
-        delAttrRow: function (index) {
+        /*delAttrRow: function (index) {
             //最后一行时禁止删除
             if (vm.attributeEntityList.length == 1) {
                 return;
@@ -172,13 +175,13 @@ var vm = new Vue({
                 goodsId = vm.goods.id;
             }
             vm.attributeEntityList.push({'id': '', 'goodsId': goodsId, 'attributeId': '', 'value': '', 'isDelete': 0});
-        },
+        },*/
         reloadSearch: function () {
             vm.q = {
                 name: '',
                 goodsSn: '',
-                category: '',
-                categoryTwo: '',
+                prodBarcode: '',
+                goodsBizType: '',
                 merchSn: ''
             }
         },
@@ -194,10 +197,10 @@ var vm = new Vue({
             vm.getCategory();
             vm.macros = [];
             vm.brands = [];
-            vm.freights = [];
+            // vm.freights = [];
             vm.cusUnitCodeList = [];
             vm.cusNationCodeList = [];
-            vm.attributeEntityList = [{'id': '', 'goodsId': '', 'attributeId': '', 'value': '', 'isDelete': 0}];
+            // vm.attributeEntityList = [{'id': '', 'goodsId': '', 'attributeId': '', 'value': '', 'isDelete': 0}];
             vm.getMacro();
             vm.getCusUnitCodeList();
             vm.getCusNationCode();
@@ -212,11 +215,12 @@ var vm = new Vue({
             vm.showList = false;
             vm.title = "修改";
             vm.uploadList = [];
-            vm.getInfo(id);
+            vm.getInfo(id);/*
             var opt = {};
             opt.value = vm.goods.categoryId;
             opt.flag = 1;
-            vm.getAttributes(opt);
+            vm.getAttributes(opt);*/
+            vm.thirdMerchantBizList = [];
             vm.getMacro();
             vm.getCusUnitCodeList();
             vm.getCusNationCode();
@@ -232,12 +236,12 @@ var vm = new Vue({
             $.get("../sys/macro/queryMacrosByValue?value=goodsBizType", function (r) {
                 vm.macros = r.list;
             });
-        },
+        },/*
         getBrand: function (merchSn) {
             $.get("../brand/queryAll?merchSn=" + merchSn, function (r) {
                 vm.brands = r.list;
             });
-        },
+        },*/
         getSuppliers: function (merchSn) {
             $.get("../supplier/queryAll?merchSn=" + merchSn, function (r) {
                 vm.suppliers = r.list;
@@ -252,12 +256,12 @@ var vm = new Vue({
             $.get("../syscusnationcode/queryAll", function (r) {
                 vm.cusNationCodeList = r.list;
             });
-        },
+        },/*
         getFreights: function(merchSn) {
             $.get("../freight/queryAll?merchSn=" + merchSn, function (r) {
                 vm.freights = r.list;
             });
-        },
+        },*/
         getGoodsGallery: function (id) {//获取商品顶部轮播图
             $.get("../goodsgallery/queryAll?goodsId=" + id, function (r) {
                 vm.uploadList = r.list;
@@ -268,11 +272,16 @@ var vm = new Vue({
                 vm.merchList = r.list;
             });
         },
+        getThirdMerchantBizList: function(merchSn) {
+            $.get("../thirdmerchantbiz/queryAll?merchSn=" + merchSn, function (r) {
+                vm.thirdMerchantBizList = r.list;
+            });
+        },
         saveOrUpdate: function (event) {
             var url = vm.goods.id == null ? "../goods/save" : "../goods/update";
             vm.goods.goodsDesc = $('#goodsDesc').editable('getHTML');
             vm.goods.goodsImgList = vm.uploadList;
-            vm.goods.attributeEntityList = vm.attributeEntityList;
+            // vm.goods.attributeEntityList = vm.attributeEntityList;
             vm.goods.productEntityList = vm.productEntityList;
             $.ajax({
                 type: "POST",
@@ -386,7 +395,7 @@ var vm = new Vue({
         getInfo: function (id) {
             $.get("../goods/info/" + id, function (r) {
                 vm.goods = r.goods;
-                vm.categoryId = r.goods.categoryId;
+                /*vm.categoryId = r.goods.categoryId;
                 // vm.getCategory();
                 var opt = {};
                 opt.value = vm.goods.attributeCategory;
@@ -400,7 +409,7 @@ var vm = new Vue({
                     vm.productEntityList = r.goods.productEntityList;
                 } else {
                     vm.productEntityList = [{'id': '', 'goodsId': '', 'goodsSpecificationIds': '', 'goodsSpecificationNameValue': '', 'goodsSn': '', 'goodsNumber': '', 'isDelete': 0, 'goodsDefault': 0}];
-                }
+                }*/
 
                 $('#goodsDesc').editable('setHTML', vm.goods.goodsDesc);
             });
@@ -415,8 +424,8 @@ var vm = new Vue({
                 postData: {
                     'name': vm.q.name,
                     'goodsSn': vm.q.goodsSn,
-                    'category': vm.q.category,
-                    'categoryTwo': vm.q.categoryTwo,
+                    'prodBarcode': vm.q.prodBarcode,
+                    'goodsBizType': vm.q.goodsBizType,
                     'merchSn': vm.q.merchSn
                 },
                 page: page
@@ -470,7 +479,7 @@ var vm = new Vue({
             this.imgName = name;
             this.visible = true;
         },
-        changeQueryCategories: function (opt) {
+        /*changeQueryCategories: function (opt) {
             var value = opt.value;
             $.get("../category/getCategorySelectByParent?parentId=" + value, function (r) {
                 vm.queryCategoriesTwo = r.list;
@@ -504,9 +513,9 @@ var vm = new Vue({
             $.get("../category/getCategorySelectByParent?isShow=1&parentId=" + value, function (r) {
                 vm.categoriesTwo = r.list;
             });
-        },
+        },*/
         uploadExcelSuccess: function (data) {
-            console.log(data);
+            // console.log(data);
             if(data.code==0){
                 alert('导入成功', function (index) {
                     $("#jqGrid").trigger("reloadGrid");
@@ -605,25 +614,30 @@ var vm = new Vue({
         },
         showMerchInfo:function(opt){
             var merchSn = opt.value;
-            vm.getCategories(merchSn);
-            vm.getFreights(merchSn);
-            vm.getBrand(merchSn);
+            // vm.getCategories(merchSn);
+            // vm.getFreights(merchSn);
+            // vm.getBrand(merchSn);
             vm.getSuppliers(merchSn);
+            vm.getThirdMerchantBizList(merchSn);
         },
-        getCategories: function (merchSn) {
-            $.get("../category/getCategorySelect?isShow=1&merchSn=" + merchSn, function (r) {
-                vm.categories = r.list;
-            });
-        },
+        // getCategories: function (merchSn) {
+        //     $.get("../category/getCategorySelect?isShow=1&merchSn=" + merchSn, function (r) {
+        //         vm.categories = r.list;
+        //     });
+        // }
     },
     mounted() {
         // this.uploadList = this.$refs.upload.fileList;
-        $.get("../category/getCategorySelect", function (r) {
+        /*$.get("../category/getCategorySelect", function (r) {
             vm.queryCategories = r.list;
-        });
+        });*/
         $.get("../merch/queryAll", function (r) {
             vm.queryMerch = r.list;
         });
 
+        $.get("../sys/macro/queryMacrosByValue?value=goodsBizType", function (r) {
+            vm.macros = r.list;
+        });
+
     }
 });

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

@@ -3,6 +3,8 @@ $(function () {
     let payStatus = getQueryString("payStatus");
     let orderStatus = getQueryString("orderStatus");
     let merchOrderSn = getQueryString("merchOrderSn");
+    let startTime = getQueryString("startTime");
+    let endTime = getQueryString("endTime");
     let url = '../order/list?1';
     if (shippingStatus) {
         url += '&shippingStatus=' + shippingStatus;
@@ -16,6 +18,12 @@ $(function () {
     if (merchOrderSn) {
         url += '&merchOrderSn=' + merchOrderSn;
     }
+    if (startTime) {
+        url += '&startTime=' + startTime;
+    }
+    if (endTime) {
+        url += '&endTime=' + endTime;
+    }
     $("#jqGrid").jqGrid({
         url: url,
         datatype: "json",
@@ -193,7 +201,9 @@ let vm = new Vue({
         q: {
             orderSn: '',
             orderStatus: '',
-            merchOrderSn: ''
+            merchOrderSn: '',
+            startTime: '',
+            endTime: ''
         },
         refundMoney: 0,
         shipping: {},
@@ -315,7 +325,9 @@ let vm = new Vue({
                 postData: {
                     'orderSn': vm.q.orderSn,
                     'orderStatus': vm.q.orderStatus,
-                    'merchOrderSn': vm.q.merchOrderSn
+                    'merchOrderSn': vm.q.merchOrderSn,
+                    'startTime': vm.q.startTime,
+                    'endTime': vm.q.endTime
                 },
                 page: page
             }).trigger("reloadGrid");
@@ -324,7 +336,9 @@ let vm = new Vue({
             vm.q = {
                 orderSn: '',
                 orderStatus: '',
-                merchOrderSn: ''
+                merchOrderSn: '',
+                startTime: '',
+                endTime: ''
             };
         },
         lookDetail: function (rowId) { //第三步:定义编辑操作
@@ -425,7 +439,8 @@ let vm = new Vue({
         },
         exportOrder: function() {
             var params = {};
-            params.orderSn = vm.q.orderSn, params.orderStatus = vm.q.orderStatus, params.merchOrderSn = vm.q.merchOrderSn;
+            params.orderSn = vm.q.orderSn, params.orderStatus = vm.q.orderStatus, params.merchOrderSn = vm.q.merchOrderSn
+                , params.startTime = vm.q.startTime, params.endTime = vm.q.endTime;
 
             exportFile('#rrapp', '../order/export', params);
             /*$.ajax({

+ 7 - 7
kmall-admin/src/main/webapp/js/shop/scannShop.js

@@ -12,7 +12,7 @@ $(function () {
                 {name : 'storeName',index : 'storeName',width : 90, align: 'center'},
                 {name: 'sku', index: 'sku', width: 80, align: 'center'},
                 {name: 'goodsName', index: 'name', width: 160, align: 'center'},
-                {name: 'retailPrice', index: 'retailPrice', width: 60, align: 'center'},
+                {name: 'storeRetailPrice', index: 'storeRetailPrice', width: 60, align: 'center'},
                 {name: 'number', index: 'nums', width: 60, align: 'center'},
                 {name: 'stockNum', index: 'stockNum', width: 60, align: 'center'},
                 {name: 'listPicUrl', index: 'listPicUrl', width: 80, align: 'center'}
@@ -28,7 +28,7 @@ $(function () {
     //         {label: '门店', name: 'storeName', index: 'storeName', width: 60, align: 'center'},
     //         {label: 'SKU', name: 'sku', index: 'sku', width: 80, align: 'center'},
     //         {label: '名称', name: 'goodsName', index: 'goodsName', width: 160, align: 'center'},
-    //         {label: '零售价格', name: 'retailPrice', index: 'retail_price', width: 80, align: 'center'},
+    //         {label: '零售价格', name: 'storeRetailPrice', index: 'retail_price', width: 80, align: 'center'},
     //         {label: '数量', name: 'number', index: 'number', width: 80, align: 'center'},
     //         {label: '库存', name: 'stockNum', index: 'stockNum', width: 80, align: 'center'},
     //         {
@@ -79,8 +79,8 @@ var vm = new Vue({
         showList: true,
         title: null,
         uploadList: [],
-        offlineCartList: [{'id': '', 'prodBarcode': '', 'storeName': '', 'SKU': '', 'goodsName': '', 'retailPrice':'', 'number':'','stockNum':'','listPicUrl':''}],
-        offlineCart:{'id': '', 'prodBarcode': '', 'storeName': '', 'SKU': '', 'goodsName': '', 'retailPrice':'', 'number':'','stockNum':'','listPicUrl':''},
+        offlineCartList: [{'id': '', 'prodBarcode': '', 'storeName': '', 'SKU': '', 'goodsName': '', 'storeRetailPrice':'', 'number':'','stockNum':'','listPicUrl':''}],
+        offlineCart:{'id': '', 'prodBarcode': '', 'storeName': '', 'SKU': '', 'goodsName': '', 'storeRetailPrice':'', 'number':'','stockNum':'','listPicUrl':''},
         imgName: '',
         visible: false,
         ruleValidate: {
@@ -110,7 +110,7 @@ var vm = new Vue({
             for(var i = 0;i < ids.length ;i ++) {
                 var rowData = $("#jqGrid").jqGrid('getRowData', ids[i]);
                 vm.offlineCartList.push(rowData);
-                totalPrice = (rowData.number * rowData.retailPrice)+totalPrice;
+                totalPrice = (rowData.number * rowData.storeRetailPrice)+totalPrice;
             }
             totalPrice = totalPrice.toFixed(2);
             vm.goodsTotalPrice = totalPrice;
@@ -154,7 +154,7 @@ var vm = new Vue({
                 if (r.code === 0) {
                     vm.goods = r.goods;
                     var mydata = {id : vm.goods.id,prodBarcode : vm.goods.prodBarcode,storeName:vm.goods.storeName,sku : vm.goods.sku,goodsName : vm.goods.name,
-                            retailPrice : vm.goods.retailPrice,number:1,stockNum : vm.goods.stockNum,listPicUrl : transImg(vm.goods.listPicUrl)};
+                        storeRetailPrice : vm.goods.storeRetailPrice,number:1,stockNum : vm.goods.stockNum,listPicUrl : transImg(vm.goods.listPicUrl)};
                     vm.count = vm.count+1;
                     // var ids = $("#jqGrid").jqGrid('getDataIDs');
                     // if(ids!=""){
@@ -267,7 +267,7 @@ var vm = new Vue({
             // var ids = $("#jqGrid").jqGrid('getGridParam', 'selarrrow');//获取 多行数据
             // for(var i = 0;i < ids.length ;i ++) {
             //     var rowData = $("#jqGrid").jqGrid('getRowData', ids[i]);
-            //     totalPrice = (rowData.nums * rowData.retailPrice)+totalPrice;
+            //     totalPrice = (rowData.nums * rowData.storeRetailPrice)+totalPrice;
             // }
             // vm.goodsTotalPrice = totalPrice;
             // vm.applyPrice = totalPrice;

+ 14 - 1
kmall-admin/src/main/webapp/js/shop/store.js

@@ -75,7 +75,8 @@ let vm = new Vue({
             storeName: '',
             storeNumber: ''
         },
-        merchList: []
+        merchList: [],
+        thirdMerchantBizList: []
     },
     methods: {
         query: function () {
@@ -95,6 +96,8 @@ let vm = new Vue({
             }
             vm.showList = false;
             vm.title = "修改";
+            vm.merchList = [];
+            vm.thirdMerchantBizList = [];
 
             vm.getInfo(id);
             vm.getMerchList();
@@ -141,14 +144,24 @@ let vm = new Vue({
                 });
             });
         },
+        showMerchInfo:function(opt){
+            var merchSn = opt.value;
+            vm.getThirdMerchantBizList(merchSn);
+        },
         getMerchList: function() {
             $.get("../merch/queryAll", function (r) {
                 vm.merchList = r.list;
             });
         },
+        getThirdMerchantBizList: function(merchSn) {
+            $.get("../thirdmerchantbiz/queryAll?merchSn=" + merchSn, function (r) {
+                vm.thirdMerchantBizList = r.list;
+            });
+        },
         getInfo: function (id) {
             $.get("../store/info/" + id, function (r) {
                 vm.store = r.store;
+                vm.getThirdMerchantBizList(r.store.merchSn);
             });
         },
         reloadSearch: function () {

+ 169 - 18
kmall-admin/src/main/webapp/js/shop/storeProductStock.js

@@ -5,8 +5,8 @@ $(function () {
         colModel: [
             {label: 'ID', name: 'id', index: 'id', hidden: true, key: true},
             {label: '商品商户编号', name: 'goods_merch_sn', index: 'goods_merch_sn', hidden: true},
-            {label: '商户名称', name: 'merchName', index: 'merchName', width: 100, align: 'center'},
-            {label: '门店', name: 'storeName', index: 'storeName', width: 80, align: 'center'},
+            {label: '所属商户', name: 'merchName', index: 'merchName', width: 100, align: 'center'},
+            {label: '所属门店', name: 'storeName', index: 'storeName', width: 80, align: 'center'},
             {label: '商品类型', name: 'categoryName', index: 'categoryName', width: 80, align: 'center'},
             {
                 label: '货品业务类型', name: 'goodsBizType', index: 'goods_biz_type', width: 70, align: 'center',
@@ -21,12 +21,12 @@ $(function () {
                     return '普通货物';
                 }
             },
-            {label: '商品编码', name: 'goodsSn', index: 'goodsSn', align: 'center'},
+            {label: '商品编码', name: 'goodsSn', index: 'goodsSn', width: 80, align: 'center'},
             {label: '名称', name: 'goodsName', index: 'goodsName', width: 160, align: 'left'},
             {label: '产品编码', name: 'productSn', index: 'productSn', width: 80, align: 'center'},
             {label: '库存', name: 'stockNum', index: 'stockNum', width: 80, align: 'center'},
             {label: '零售价格', name: 'retailPrice', index: 'retailPrice', width: 80, align: 'center'},
-            // {label: '市场价', name: 'marketPrice', index: 'marketPrice', width: 80},
+            {label: '市场价', name: 'marketPrice', index: 'marketPrice', width: 80, align: 'center'},
             // {label: '库存价格', name: 'stockPrice', index: 'stockPrice', width: 80},
             {
                 label: '销售量',
@@ -114,7 +114,7 @@ var vm = new Vue({
         uploadList: [],
         imgName: '',
         visible: false,
-        productStoreRela: { stockNum: '', retailPrice: '', marketPrice: '' },
+        productStoreRela: { stockNum: '', retailPrice: '', marketPrice: '', categoryId:'', brandId:'', specification:'', storeId:'', goodsBizType:'' },
         ruleValidate: {
             /*storeId: [
                 {required: true, message: '门店不能为空'}
@@ -124,35 +124,77 @@ var vm = new Vue({
             storeId: '',
             goodsName: '',
             productSn: '',
-            goodsSn: ''
+            goodsSn: '', category: '', categoryTwo: '', goodsBizType:''
         },
         stores: [],
         macros: [],//商品单位
         goodss: {},
         products: [],
-        showInput: false
+        showInput: false,
+        showInputSpecification: false,
+        categories: [],//一级分类
+        categoriesTwo: [],
+        brands: [],
+        attributeEntityList: [{'id': '', 'goodsId': '', 'attributeId': '', 'value': '', 'isDelete': 0}],
+        attributes: [],
+        queryCategories: [],//一级分类
+        queryCategoriesTwo: [],
+        categoryId: '',
+        freights: [],
+        storeId: 0,
+        specification: '',
+        isOperator: ''
     },
     methods: {
         changeGoods: function (opt) {
             var goodsId = opt.value;
             if (null != goodsId && '' != goodsId) {
                 $.get("../goods/info/" + goodsId, function (r) {
+                    vm.showInput = true;
+                    // console.log(r.goods.goodsBizType);
                     if (r.goods.goodsBizType == 11) {
-                        vm.showInput = true;
-                        vm.productStoreRela.retailPrice = r.goods.retailPrice;
-                        vm.productStoreRela.marketPrice = r.goods.marketPrice;
+                        vm.showInputSpecification = true;
                     } else {
-                        vm.showInput = false;
+                        vm.showInputSpecification = false;
                     }
                 });
+                // $.get("../productstorerela/infoByGoodsId?goodsId=" + goodsId + "&storeId=" + vm.storeId, function (r) {
+                //     vm.productStoreRela = r.productStoreRela;
+                //     vm.showInput = true;
+                //     if (r.productStoreRela.goodsBizType == 11) {
+                //         vm.showInputSpecification = true;
+                //     }else{
+                //         vm.showInputSpecification = false;
+                //     }
+                //
+                //     vm.categoryId = r.productStoreRela.categoryId;
+                //     var opt = {};
+                //     opt.value = vm.productStoreRela.attributeCategory;
+                //     vm.changeCategories(opt);
+                //     // if (r.productStoreRela.attributeEntityList.length > 0) {
+                //     //     vm.attributeEntityList = r.productStoreRela.attributeEntityList;
+                //     // } else {
+                //     //     vm.attributeEntityList = [{'id': '', 'goodsId': '', 'attributeId': '', 'value': '', 'isDelete': 0}];
+                //     // }
+                //     // console.log(r.goods.retailPrice);
+                //     // console.log(r.goods.marketPrice);
+                //     // vm.productStoreRela.retailPrice = r.goods.retailPrice;
+                //     // vm.productStoreRela.marketPrice = r.goods.marketPrice;
+                // });
             }
         },
+        changeQueryCategories: function (opt) {
+            var value = opt.value;
+            $.get("../category/getCategorySelectByParent?parentId=" + value, function (r) {
+                vm.queryCategoriesTwo = r.list;
+            });
+        },
         reloadSearch: function () {
             vm.q = {
                 storeId: '',
                 goodsName: '',
                 productSn: '',
-                goodsSn: ''
+                goodsSn: '', category: '', categoryTwo: '', goodsBizType:''
             }
             vm.reload();
         },
@@ -162,10 +204,15 @@ var vm = new Vue({
         add: function (event) {
             vm.showList = false;
             vm.title = "新增";
+            vm.isOperator = 'add';
             vm.uploadList = [];
-            vm.productStoreRela = { stockNum: '', retailPrice: '', marketPrice: '' };
+            vm.freights = [];
+            vm.brands = [];
+            vm.productStoreRela = { stockNum: '', retailPrice: '', marketPrice: '', categoryId:'', brandId:'',specification:'', storeId:'' };
+            vm.attributeEntityList = [{'id': '', 'goodsId': '', 'attributeId': '', 'value': '', 'isDelete': 0}];
             vm.getMacro();
             vm.showInput = false;
+            vm.showInputSpecification = false;
         },
         update: function (event) {
             var id = getSelectedRow();
@@ -174,12 +221,20 @@ var vm = new Vue({
             }
             vm.showList = false;
             vm.title = "修改";
+            vm.isOperator = 'update';
             vm.uploadList = [];
             vm.getInfo(id);
+            var opt = {};
+            opt.value = vm.productStoreRela.categoryId;
+            opt.flag = 1;
+            vm.getAttributes(opt);
             vm.getMacro();
-            vm.showInput = false;
             if (vm.productStoreRela.goodsBizType == 11) {
                 vm.showInput = true;
+                vm.showInputSpecification = true;
+            }else{
+                vm.showInput = false;
+                vm.showInputSpecification = false;
             }
         },
         /**
@@ -192,6 +247,8 @@ var vm = new Vue({
         },
         saveOrUpdate: function (event) {
             var url = vm.productStoreRela.id == null ? "../productstorerela/save" : "../productstorerela/update";
+            console.log(vm.attributeEntityList);
+            vm.productStoreRela.attributeEntityList = vm.attributeEntityList;
             $.ajax({
                 type: "POST",
                 url: url,
@@ -234,21 +291,109 @@ var vm = new Vue({
         getInfo: function (id) {
             $.get("../productstorerela/info/" + id, function (r) {
                 vm.productStoreRela = r.productStoreRela;
+                vm.categoryId = r.productStoreRela.categoryId;
+                // vm.getCategory();
+                var opt = {};
+                opt.value = vm.productStoreRela.attributeCategory;
+                vm.changeCategories(opt);
+                if (r.productStoreRela.attributeEntityList.length > 0) {
+                    vm.attributeEntityList = r.productStoreRela.attributeEntityList;
+                } else {
+                    vm.attributeEntityList = [{'id': '', 'goodsId': '', 'attributeId': '', 'value': '', 'isDelete': 0}];
+                }
+                vm.specification = vm.productStoreRela.specification;
+                vm.storeId = vm.productStoreRela.storeId;
             });
         },
         getGoods: function (opt) {
-
             var storeId = opt.value;
             var merchSn = "";
             for (var i = 0; i < vm.stores.length; i ++ ) {
                 if(vm.stores[i].id == storeId)
                     merchSn = vm.stores[i].merchSn;
             }
+            vm.storeId = storeId;
 
-            $.get("../goods/queryAll?merchSn=" + merchSn, function (r) {
-                vm.goodss = r.list;
+            console.log(vm.isOperator);
+            if(vm.isOperator == 'add'){
+                $.get("../goods/queryAll?merchSn=" + merchSn + "&storeId=" +storeId, function (r) {
+                    vm.goodss = r.list;
+                });
+            }else{
+                $.get("../goods/queryAll?merchSn=" + merchSn, function (r) {
+                    vm.goodss = r.list;
+                });
+            }
+            vm.getCategories(storeId);
+            vm.getFreights(storeId);
+        },
+        changeCategories: function (opt) {
+            var value = opt.value;
+            vm.getBrand(value);
+            if(value){
+                $.get("../category/getCategorySelectByParent?isShow=1&parentId=" + value, function (r) {
+                    vm.categoriesTwo = r.list;
+                });
+            }
+        },
+        getCategoryByStore: function (opt) {
+            var value = opt.value;
+            vm.getCategories(value);
+            vm.getFreights(value);
+        },
+        getCategories: function (storeId) {
+            $.get("../category/getCategorySelect?isShow=1&storeId=" + storeId, function (r) {
+                vm.categories = r.list;
             });
         },
+        getBrand: function (categoryId) {
+            $.get("../brand/queryAll?categoryId=" + categoryId, function (r) {
+                vm.brands = r.list;
+            });
+        },
+        getAttributes: function (opt) {
+            var value = opt.value;
+            if(value){
+                $.get("../attribute/query?attributeCategoryId=" + value + "&storeId="+vm.storeId, function (r) {
+                    vm.attributes = r.list;
+                });
+
+                if (opt.flag != 1 && !(value === vm.categoryId)) {
+                    if (vm.attributeEntityList.length > 0 && vm.attributeEntityList[0].attributeId != '') {
+                        for (var i = 0; i < vm.attributeEntityList.length; i++) {
+                            if (!(vm.attributeEntityList[0].attributeId === '')) {
+                                vm.attributeEntityList[i].isDelete = 1;
+                            }
+                        }
+
+                        var goodsId = '';
+                        if (vm.goodss) {
+                            goodsId = vm.goodss.id;
+                        }
+                        vm.attributeEntityList.unshift({'id': '', 'goodsId': goodsId, 'attributeId': '', 'value': '', 'isDelete': 0});
+                    }
+                }
+            }
+        },
+        getFreights: function(storeId) {
+            $.get("../freight/queryAll?storeId=" + storeId, function (r) {
+                vm.freights = r.list;
+            });
+        },
+        addAttrRow: function () {
+            let goodsId = '';
+            if (vm.goods) {
+                goodsId = vm.goods.id;
+            }
+            vm.attributeEntityList.push({'id': '', 'goodsId': goodsId, 'attributeId': '', 'value': '', 'isDelete': 0});
+        },
+        delAttrRow: function (index) {
+            //最后一行时禁止删除
+            if (vm.attributeEntityList.length == 1) {
+                return;
+            }
+            vm.attributeEntityList[index].isDelete = 1;
+        },
         reload: function (event) {
             vm.showList = true;
             var page = $("#jqGrid").jqGrid('getGridParam', 'page');
@@ -257,7 +402,7 @@ var vm = new Vue({
                     storeId: vm.q.storeId,
                     goodsName: vm.q.goodsName,
                     goodsSn: vm.q.goodsSn,
-                    productSn: vm.q.productSn
+                    productSn: vm.q.productSn, category: vm.q.category, categoryTwo: vm.q.categoryTwo, goodsBizType:vm.q.goodsBizType
                 },
                 page: page
             }).trigger("reloadGrid");
@@ -355,8 +500,14 @@ var vm = new Vue({
         }
     },
     mounted() {
+        $.get("../category/getCategorySelect", function (r) {
+            vm.queryCategories = r.list;
+        });
         $.get("../store/queryAll", function (r) {
             vm.stores = r.list;
         });
+        $.get("../sys/macro/queryMacrosByValue?value=goodsBizType", function (r) {
+            vm.macros = r.list;
+        });
     }
 });

+ 166 - 0
kmall-admin/src/main/webapp/js/shop/thirdmerchantbiz.js

@@ -0,0 +1,166 @@
+$(function () {
+    $("#jqGrid").jqGrid({
+        url: '../thirdmerchantbiz/list',
+        datatype: "json",
+        colModel: [
+			{label: 'thirdMerchSn', name: 'thirdMerchSn', index: 'third_merch_sn', key: true, hidden: true},
+            {label: '商户编号', name: 'merchSn', index: 'merch_sn', width: 80, align: 'center'},
+			{label: '第三方商户代码', name: 'thirdPartyMerchCode', index: 'third_party_merch_code', width: 80, align: 'center'},
+			{label: '第三方商户名称', name: 'thirdPartyMerchName', index: 'third_party_merch_name', width: 80, align: 'center'},
+			{label: '是否有效', name: 'isValid', index: 'is_valid', width: 80, align: 'center',
+                formatter: function (value) {
+                    if (value == '0') {
+                        return '有效';
+                    } else if (value == '1') {
+                        return '无效';
+                    }
+                    return '';
+                }},
+			{label: '创建时间', name: 'createTime', index: 'create_time', width: 80, align: 'center',
+                formatter: function (value) {
+                    return transDate(value, 'yyyy-MM-dd hh:mm:ss');
+                }},
+			{label: '修改时间', name: 'modTime', index: 'mod_time', width: 80, align: 'center',
+                formatter: function (value) {
+                    return transDate(value, 'yyyy-MM-dd hh:mm:ss');
+                }}],
+		viewrecords: true,
+        height: 385,
+        rowNum: 10,
+        rowList: [10, 30, 50],
+        rownumbers: true,
+        rownumWidth: 25,
+        autowidth: true,
+        multiselect: true,
+        pager: "#jqGridPager",
+        jsonReader: {
+            root: "page.list",
+            page: "page.currPage",
+            total: "page.totalPage",
+            records: "page.totalCount"
+        },
+        prmNames: {
+            page: "page",
+            rows: "limit",
+            order: "order"
+        },
+        gridComplete: function () {
+            $("#jqGrid").closest(".ui-jqgrid-bdiv").css({"overflow-x": "hidden"});
+        }
+    });
+});
+
+let vm = new Vue({
+	el: '#rrapp',
+	data: {
+        showList: true,
+        title: null,
+		thirdMerchantBiz: {isValid: ''},
+		ruleValidate: {
+			name: [
+				{required: true, message: '名称不能为空', trigger: 'blur'}
+			]
+		},
+		q: {
+		    name: ''
+		},
+        merchList: [],
+	},
+	methods: {
+		query: function () {
+			vm.reload();
+		},
+		add: function () {
+			vm.showList = false;
+			vm.title = "新增";
+            vm.getMerchList();
+			vm.thirdMerchantBiz = {isValid: 0};
+		},
+		update: function (event) {
+            let thirdMerchSn = getSelectedRow();
+			if (thirdMerchSn == null) {
+				return;
+			}
+			vm.showList = false;
+            vm.title = "修改";
+            vm.getMerchList();
+
+            vm.getInfo(thirdMerchSn)
+		},
+		saveOrUpdate: function (event) {
+            let url = vm.thirdMerchantBiz.thirdMerchSn == null ? "../thirdmerchantbiz/save" : "../thirdmerchantbiz/update";
+			$.ajax({
+				type: "POST",
+			    url: url,
+			    contentType: "application/json",
+			    data: JSON.stringify(vm.thirdMerchantBiz),
+                success: function (r) {
+                    if (r.code === 0) {
+                        alert('操作成功', function (index) {
+                            vm.reload();
+                        });
+                    } else {
+                        alert(r.msg);
+                    }
+                }
+			});
+		},
+		del: function (event) {
+            let thirdMerchSns = getSelectedRows();
+			if (thirdMerchSns == null){
+				return;
+			}
+
+			confirm('确定要删除选中的记录?', function () {
+				$.ajax({
+					type: "POST",
+				    url: "../thirdmerchantbiz/delete",
+				    contentType: "application/json",
+				    data: JSON.stringify(thirdMerchSns),
+				    success: function (r) {
+						if (r.code == 0) {
+							alert('操作成功', function (index) {
+								$("#jqGrid").trigger("reloadGrid");
+							});
+						} else {
+							alert(r.msg);
+						}
+					}
+				});
+			});
+		},
+        getMerchList: function() {
+            $.get("../merch/queryAll", function (r) {
+                vm.merchList = r.list;
+            });
+        },
+		getInfo: function(thirdMerchSn){
+			$.get("../thirdmerchantbiz/info/"+thirdMerchSn, function (r) {
+                vm.thirdMerchantBiz = r.thirdMerchantBiz;
+            });
+		},
+        reloadSearch: function() {
+            vm.q = {
+                name: ''
+            }
+            vm.reload();
+		},
+		reload: function (event) {
+			vm.showList = true;
+            let page = $("#jqGrid").jqGrid('getGridParam', 'page');
+			$("#jqGrid").jqGrid('setGridParam', {
+                postData: {'name': vm.q.name},
+                page: page
+            }).trigger("reloadGrid");
+            vm.handleReset('formValidate');
+		},
+        handleSubmit: function (name) {
+            handleSubmitValidate(this, name, function () {
+                vm.saveOrUpdate()
+            });
+        },
+        handleReset: function (name) {
+            handleResetForm(this, name);
+        }
+	}
+});

BIN
kmall-admin/src/main/webapp/WEB-INF/page/shop/file/general_goods_export_yyyy_mm_dd_v1.0.0.xls → kmall-admin/src/main/webapp/statics/file/general_goods_export_yyyy_mm_dd_v1.0.0.xls


BIN
kmall-admin/src/main/webapp/WEB-INF/page/shop/file/goods_export_yyyy_mm_dd_v1.0.0.xls → kmall-admin/src/main/webapp/statics/file/goods_export_yyyy_mm_dd_v1.0.0.xls


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

@@ -238,7 +238,7 @@ public class ApiCartController extends ApiBaseAction {
         Integer number = jsonParam.getInteger("number");
         String checkCart = jsonParam.getString("checkCart");
         //判断商品是否可以购买
-        GoodsVo goodsInfo = goodsService.queryObject(goodsId);
+        GoodsVo goodsInfo = goodsService.queryObjectByStoreId(goodsId, getStoreId());
         if (null == goodsInfo || goodsInfo.getIs_delete() == 1 || goodsInfo.getIs_on_sale() == 0) {
             return toResponsFail("商品已下架");
         }
@@ -311,7 +311,7 @@ public class ApiCartController extends ApiBaseAction {
         Long goodsId = jsonParam.getLong("goodsId");
         String checkCart = jsonParam.getString("checkCart");
         //判断商品是否可以购买
-        GoodsVo goodsInfo = goodsService.queryObject(goodsId);
+        GoodsVo goodsInfo = goodsService.queryObjectByStoreId(goodsId, getStoreId());
         if (null == goodsInfo || goodsInfo.getIs_delete() == 1 || goodsInfo.getIs_on_sale() == 0) {
             return toResponsFail("商品已下架");
         }
@@ -335,7 +335,7 @@ public class ApiCartController extends ApiBaseAction {
         List<OrderGoodsVo> orderGoodsVos = apiOrderGoodsService.queryList(params);
         for (OrderGoodsVo goodsVo : orderGoodsVos) {
             //判断商品是否可以购买
-            GoodsVo goodsInfo = goodsService.queryObject(goodsVo.getGoods_id());
+            GoodsVo goodsInfo = goodsService.queryObjectByStoreId(goodsVo.getGoods_id(), getStoreId());
             if (null == goodsInfo || goodsInfo.getIs_delete() == 1 || goodsInfo.getIs_on_sale() == 0) {
                 return toResponsFail("商品已下架");
             }
@@ -492,25 +492,25 @@ public class ApiCartController extends ApiBaseAction {
     @PostMapping("checked")
     public Object checked(@LoginUser UserVo loginUser) {
         JSONObject jsonParam = getJsonRequest();
-        String productIds = jsonParam.getString("productIds");
+        String goodsIds = jsonParam.getString("goodsIds");
         Integer isChecked = jsonParam.getInteger("isChecked");
         String goodsBizType = jsonParam.getString("goodsBizType");
         String checkCart = jsonParam.getString("checkCart");
-        String[] productIdArray = null;
+        String[] goodsIdArray = null;
         if(StringUtils.isNullOrEmpty(goodsBizType)) {
-            if (StringUtils.isNullOrEmpty(productIds)) {//点击全选时
+            if (StringUtils.isNullOrEmpty(goodsIds)) {//点击全选时
                 return this.toResponsFail("删除出错");
             }
-            productIdArray = productIds.split(",");
+            goodsIdArray = goodsIds.split(",");
         }else{
             //根据业务类型查询购物车
             List<CartVo> cartVoList = cartService.queryCartByGoodsBizType(goodsBizType);
-            productIdArray = new String[cartVoList.size()];
+            goodsIdArray = new String[cartVoList.size()];
             for (int i = 0;i< cartVoList.size();i++){
-                productIdArray[i] =cartVoList.get(i).getProduct_id()+"";
+                goodsIdArray[i] =cartVoList.get(i).getGoods_id()+"";
             }
         }
-        cartService.updateCheck(productIdArray, isChecked, loginUser.getId(), getStoreId());
+        cartService.updateCheck(goodsIdArray, isChecked, loginUser.getId(), getStoreId());
         return toResponsSuccess(getCart(checkCart));
     }
 
@@ -602,38 +602,38 @@ public class ApiCartController extends ApiBaseAction {
         for (CartVo vo: checkedGoodsList) {
             if(org.apache.commons.lang.StringUtils.isEmpty(checkCart)){
                 if(vo.getGoodsBizType().equalsIgnoreCase(Dict.orderBizType.item_00.getItem())){
-                    FreightEntity freightEntity = apiFreightService.queryObjectByGoodsId(vo.getGoods_id());
+                    FreightEntity freightEntity = apiFreightService.queryObjectByGoodsId(vo.getGoods_id(), getStoreId());
                     freightPrice00 = freightEntity!=null ? freightEntity.getDefaultFreight().add(freightPrice00) : freightPrice00;
                 }
                 if(vo.getGoodsBizType().equalsIgnoreCase(Dict.orderBizType.item_02.getItem())){
-                    FreightEntity freightEntity = apiFreightService.queryObjectByGoodsId(vo.getGoods_id());
+                    FreightEntity freightEntity = apiFreightService.queryObjectByGoodsId(vo.getGoods_id(), getStoreId());
                     freightPrice02 = freightEntity!=null ? freightEntity.getDefaultFreight().add(freightPrice02) : freightPrice02;
                 }
                 if(vo.getGoodsBizType().equalsIgnoreCase(Dict.orderBizType.item_10.getItem())){
-                    FreightEntity freightEntity = apiFreightService.queryObjectByGoodsId(vo.getGoods_id());
+                    FreightEntity freightEntity = apiFreightService.queryObjectByGoodsId(vo.getGoods_id(), getStoreId());
                     freightPrice10 = freightEntity!=null ? freightEntity.getDefaultFreight().add(freightPrice10) : freightPrice10;
                 }
                 if (vo.getGoodsBizType().equalsIgnoreCase(Dict.orderBizType.item_11.getItem())) {
-                    FreightEntity freightEntity = apiFreightService.queryObjectByGoodsId(vo.getGoods_id());
+                    FreightEntity freightEntity = apiFreightService.queryObjectByGoodsId(vo.getGoods_id(), getStoreId());
                     freightPrice11 = freightEntity != null ? freightEntity.getDefaultFreight().add(freightPrice11) : freightPrice11;
                 }
             }else{
                 if(Dict.orderBizType.item_11.getItem().equalsIgnoreCase(checkCart)) {
                     if (vo.getGoodsBizType().equalsIgnoreCase(Dict.orderBizType.item_11.getItem())) {
-                        FreightEntity freightEntity = apiFreightService.queryObjectByGoodsId(vo.getGoods_id());
+                        FreightEntity freightEntity = apiFreightService.queryObjectByGoodsId(vo.getGoods_id(), getStoreId());
                         freightPrice11 = freightEntity != null ? freightEntity.getDefaultFreight().add(freightPrice11) : freightPrice11;
                     }
                 }else{
                     if(vo.getGoodsBizType().equalsIgnoreCase(Dict.orderBizType.item_00.getItem())){
-                        FreightEntity freightEntity = apiFreightService.queryObjectByGoodsId(vo.getGoods_id());
+                        FreightEntity freightEntity = apiFreightService.queryObjectByGoodsId(vo.getGoods_id(), getStoreId());
                         freightPrice00 = freightEntity!=null ? freightEntity.getDefaultFreight().add(freightPrice00) : freightPrice00;
                     }
                     if(vo.getGoodsBizType().equalsIgnoreCase(Dict.orderBizType.item_02.getItem())){
-                        FreightEntity freightEntity = apiFreightService.queryObjectByGoodsId(vo.getGoods_id());
+                        FreightEntity freightEntity = apiFreightService.queryObjectByGoodsId(vo.getGoods_id(), getStoreId());
                         freightPrice02 = freightEntity!=null ? freightEntity.getDefaultFreight().add(freightPrice02) : freightPrice02;
                     }
                     if(vo.getGoodsBizType().equalsIgnoreCase(Dict.orderBizType.item_10.getItem())){
-                        FreightEntity freightEntity = apiFreightService.queryObjectByGoodsId(vo.getGoods_id());
+                        FreightEntity freightEntity = apiFreightService.queryObjectByGoodsId(vo.getGoods_id(), getStoreId());
                         freightPrice10 = freightEntity!=null ? freightEntity.getDefaultFreight().add(freightPrice10) : freightPrice10;
                     }
                 }

+ 14 - 1
kmall-api/src/main/java/com/kmall/api/api/ApiCatalogController.java

@@ -2,8 +2,10 @@ package com.kmall.api.api;
 
 import com.kmall.api.annotation.IgnoreAuth;
 import com.kmall.api.annotation.LoginUser;
+import com.kmall.api.entity.BrandVo;
 import com.kmall.api.entity.CategoryVo;
 import com.kmall.api.entity.UserVo;
+import com.kmall.api.service.ApiBrandService;
 import com.kmall.api.service.ApiCategoryService;
 import com.kmall.api.util.ApiBaseAction;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -26,6 +28,8 @@ import java.util.Map;
 public class ApiCatalogController extends ApiBaseAction {
     @Autowired
     private ApiCategoryService categoryService;
+    @Autowired
+    private ApiBrandService brandService;
 
     /**
      * 获取分类栏目数据
@@ -59,9 +63,13 @@ public class ApiCatalogController extends ApiBaseAction {
             params.put("parent_id", currentCategory.getId());
             currentCategory.setSubCategoryList(categoryService.queryListByParentId(params));
         }
-
         resultObj.put("categoryList", data);
         resultObj.put("currentCategory", currentCategory);
+        Map brandMap = new HashMap();
+        brandMap.put("categoryId", currentCategory.getId());
+        List<BrandVo> brandVoList = brandService.queryList(brandMap);
+
+        resultObj.put("brandList", brandVoList);
         return toResponsSuccess(resultObj);
     }
 
@@ -83,6 +91,11 @@ public class ApiCatalogController extends ApiBaseAction {
             currentCategory.setSubCategoryList(categoryService.queryList(params));
         }
         resultObj.put("currentCategory", currentCategory);
+        Map brandMap = new HashMap();
+        brandMap.put("categoryId", currentCategory.getId());
+        List<BrandVo> brandVoList = brandService.queryList(brandMap);
+
+        resultObj.put("brandList", brandVoList);
         return toResponsSuccess(resultObj);
     }
 }

+ 36 - 14
kmall-api/src/main/java/com/kmall/api/api/ApiGoodsController.java

@@ -91,7 +91,7 @@ public class ApiGoodsController extends ApiBaseAction {
     public Object sku(@LoginUser UserVo loginUser, Long goodsId) {
         Map<String, Object> resultObj = new HashMap();
         //
-        GoodsVo goodsVo = goodsService.queryObject(goodsId);
+        GoodsVo goodsVo = goodsService.queryObjectByStoreId(goodsId, getStoreId());
         //
         List<Map> goodsSpecificationEntityList = goodsSpecificationService.queryByGoodsIdGroupByNames(goodsId);
         //
@@ -100,7 +100,7 @@ public class ApiGoodsController extends ApiBaseAction {
         param.put("store_id", getStoreId());
         List<ProductVo> productEntityList = productService.queryList(param);
 
-        CartVo cartVo = cartService.queryObjectByGoodsIdAndUserId(goodsId,getUserId());
+        CartVo cartVo = cartService.queryObjectByGoodsIdAndUserId(goodsId, getUserId(), getStoreId());
         if(cartVo == null){
             resultObj.put("cartNumber", 0);
         }else{
@@ -210,7 +210,7 @@ public class ApiGoodsController extends ApiBaseAction {
         cartMap.put("goods_id",info.getId());
         List<CartVo> cartVoList = cartService.queryList(cartMap);
 
-        FreightEntity freightEntity = apiFreightService.queryObjectByGoodsId(info.getId());
+        FreightEntity freightEntity = apiFreightService.queryObjectByGoodsId(info.getId(), getStoreId());
         //
         resultObj.put("info", info);
 
@@ -291,6 +291,26 @@ public class ApiGoodsController extends ApiBaseAction {
     }
 
     /**
+     *  获取品牌下的商品
+     */
+    @IgnoreAuth
+    @GetMapping("brand")
+    public Object brand(@LoginUser UserVo loginUser, Integer id) {
+        Map<String, Object> resultObj = new HashMap();
+        //
+        BrandVo currentBrand = apiBrandService.queryObject(id);
+        //
+        CategoryVo parentCategory = categoryService.queryObject(currentBrand.getCategoryId());
+        Map params = new HashMap();
+        params.put("categoryId", currentBrand.getCategoryId());
+        List<BrandVo> brandList = apiBrandService.queryList(params);
+        //
+        resultObj.put("currentBrand", currentBrand);
+        resultObj.put("brandList", brandList);
+        return toResponsSuccess(resultObj);
+    }
+
+    /**
      *   获取商品列表
      */
     @GetMapping("list")
@@ -300,13 +320,15 @@ public class ApiGoodsController extends ApiBaseAction {
                                page, @RequestParam(value = "size", defaultValue = "10") Integer size,
                        String sort, String order) {
         Map params = new HashMap();
-        try{
-            keyword = new String(keyword.getBytes("iso-8859-1"),"utf-8");
-        }catch (Exception e){
-            logger.error("error:", e);
+        if(org.apache.commons.lang3.StringUtils.isNotEmpty(keyword)){
+            try{
+                keyword = new String(keyword.getBytes("iso-8859-1"),"utf-8");
+            }catch (Exception e){
+                logger.error("error:", e);
+            }
+            params.put("keyword", keyword);
         }
         params.put("brand_id", brandId);
-        params.put("keyword", keyword);
         params.put("is_new", isNew);
         params.put("is_hot", isHot);
         params.put("page", page);
@@ -341,7 +363,7 @@ public class ApiGoodsController extends ApiBaseAction {
         rootCategory.setChecked(false);
         filterCategory.add(rootCategory);
         //
-        params.put("fields", "a.category_id");
+        params.put("fields", "psr1.category_id");
         params.put("limit", 1);
         List<GoodsVo> goodsVoList = goodsService.queryList(params);
         params.put("limit", size);
@@ -412,15 +434,15 @@ public class ApiGoodsController extends ApiBaseAction {
         rootCategory.setChecked(false);
         filterCategory.add(rootCategory);
         //
-        params.put("fields", "a.category_id");
+        params.put("fields", "psr1.category_id");
         params.put("is_hot", "1");
         params.put("store_id", store_id);
 
-        List<GoodsVo> categoryEntityList = goodsService.queryList(params);
+        List<GoodsVo> goodsEntityList = goodsService.queryList(params);
         params.remove("fields");
-        if (null != categoryEntityList && categoryEntityList.size() > 0) {
+        if (null != goodsEntityList && goodsEntityList.size() > 0) {
             List<Integer> categoryIds = new ArrayList();
-            for (GoodsVo goodsVo : categoryEntityList) {
+            for (GoodsVo goodsVo : goodsEntityList) {
                 if (null == goodsVo || null == goodsVo.getCategory_id()) {
                     continue;
                 }
@@ -528,7 +550,7 @@ public class ApiGoodsController extends ApiBaseAction {
         List<Integer> relatedGoods = new ArrayList();
         if (null == relatedGoodsIds || relatedGoods.size() < 1) {
             //查找同分类下的商品
-            GoodsVo goodsCategory = goodsService.queryObject(id);
+            GoodsVo goodsCategory = goodsService.queryObjectByStoreId(id, getStoreId());
             if (null != goodsCategory) {
                 Map paramRelated = new HashMap();
                 paramRelated.put("store_id", getStoreId());

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

@@ -87,7 +87,7 @@ public class ApiIndexController extends ApiBaseAction {
         param.put("fields", "distinct a.id,a.name,a.goods_brief,a.list_pic_url,psr1.retail_price,psr1.market_price,b.id as product_id,psr1.stock_num");
         param.put("is_hot", "1");
         param.put("offset", 0);
-        param.put("limit", 3);
+        param.put("limit", 20);
         param.put("is_delete", 0);
         param.put("store_id", storeId);
         List<GoodsVo> hotGoods = goodsService.queryHotGoodsList(param);

+ 2 - 2
kmall-api/src/main/java/com/kmall/api/dao/ApiCartMapper.java

@@ -15,7 +15,7 @@ import java.util.Map;
  */
 @Component
 public interface ApiCartMapper extends BaseDao<CartVo> {
-    void updateCheck(@Param("productIds") String[] productIds,
+    void updateCheck(@Param("goodsIds") String[] goodsIds,
                      @Param("isChecked") Integer isChecked, @Param("user_id") Long userId, @Param("store_id") Long store_id);
 
     void deleteByProductIds(@Param("productIds") String[] productIds, @Param("store_id") Long store_id);
@@ -26,5 +26,5 @@ public interface ApiCartMapper extends BaseDao<CartVo> {
 
     List<CartVo> queryValidCartList(Map<String, Object> map);
 
-    CartVo queryObjectByGoodsIdAndUserId(@Param("goods_id")Long goods_id,@Param("user_id")Long user_id);
+    CartVo queryObjectByGoodsIdAndUserId(@Param("goods_id")Long goods_id,@Param("user_id")Long user_id,@Param("storeId")Long storeId);
 }

+ 1 - 1
kmall-api/src/main/java/com/kmall/api/dao/ApiFreightMapper.java

@@ -14,6 +14,6 @@ import org.springframework.stereotype.Component;
  */
 @Component
 public interface ApiFreightMapper extends BaseDao<FreightEntity> {
-    FreightEntity queryObjectByGoodsId(@Param("goodsId") Long goodsId);
+    FreightEntity queryObjectByGoodsId(@Param("goodsId") Long goodsId,@Param("storeId")Long storeId);
 
 }

+ 10 - 0
kmall-api/src/main/java/com/kmall/api/entity/BrandVo.java

@@ -37,6 +37,16 @@ public class BrandVo implements Serializable {
     //排序
     private Integer new_sort_order;
 
+    private Integer categoryId;
+
+    public Integer getCategoryId() {
+        return categoryId;
+    }
+
+    public void setCategoryId(Integer categoryId) {
+        this.categoryId = categoryId;
+    }
+
     public Integer getId() {
         return id;
     }

+ 5 - 5
kmall-api/src/main/java/com/kmall/api/service/ApiCartService.java

@@ -34,8 +34,8 @@ public class ApiCartService {
         return cartDao.queryObject(id);
     }
 
-    public CartVo queryObjectByGoodsIdAndUserId(Long goods_id,Long user_id) {
-        return cartDao.queryObjectByGoodsIdAndUserId(goods_id,user_id);
+    public CartVo queryObjectByGoodsIdAndUserId(Long goods_id,Long user_id,Long storeId) {
+        return cartDao.queryObjectByGoodsIdAndUserId(goods_id,user_id,storeId);
     }
 
 
@@ -117,8 +117,8 @@ public class ApiCartService {
         cartDao.deleteBatch(ids);
     }
 
-    public void updateCheck(String[] productIds, Integer isChecked, Long userId, Long storeId) {
-        cartDao.updateCheck(productIds, isChecked, userId, storeId);
+    public void updateCheck(String[] goodsIds, Integer isChecked, Long userId, Long storeId) {
+        cartDao.updateCheck(goodsIds, isChecked, userId, storeId);
     }
 
     public void deleteByProductIds(String[] productIds, Long storeId) {
@@ -152,7 +152,7 @@ public class ApiCartService {
             resultObj.put("errmsg", "库存不足,仅剩余" + productVo.getStock_num());
             return resultObj;
         }
-        GoodsVo goodsVo = apiGoodsMapper.queryObject(goods_id);
+        GoodsVo goodsVo = apiGoodsMapper.queryObjectByStoreId(goods_id, store_id);
         CartVo cartInfo = new CartVo();
         cartInfo.setGoods_id(productVo.getGoods_id());
         cartInfo.setProduct_id(productVo.getId());

+ 2 - 2
kmall-api/src/main/java/com/kmall/api/service/ApiFreightService.java

@@ -56,7 +56,7 @@ public class ApiFreightService {
     }
 
 
-    public FreightEntity queryObjectByGoodsId(Long id) {
-        return freightDao.queryObjectByGoodsId(id);
+    public FreightEntity queryObjectByGoodsId(Long id,Long storeId) {
+        return freightDao.queryObjectByGoodsId(id,storeId);
     }
 }

+ 2 - 2
kmall-api/src/main/java/com/kmall/api/service/ApiGoodsGroupOpenService.java

@@ -82,7 +82,7 @@ public class ApiGoodsGroupOpenService {
         Map resultObj = new HashMap();
         // 开团
         GoodsGroupVo groupVo = apiGoodsGroupMapper.queryObject(groupId);
-        GoodsVo goodsVo = apiGoodsMapper.queryObject(groupVo.getGoods_id());
+        GoodsVo goodsVo = apiGoodsMapper.queryObjectByStoreId(groupVo.getGoods_id(), storeId);
         GoodsGroupOpenVo openVo = new GoodsGroupOpenVo();
         openVo.setUser_id(userId);
         openVo.setGroup_id(groupId);
@@ -204,7 +204,7 @@ public class ApiGoodsGroupOpenService {
         openDetailVo.setAttend_time(new Date());
         apiGoodsGroupOpenDetailMapper.save(openDetailVo);
         //
-        GoodsVo goodsVo = apiGoodsMapper.queryObject(groupVo.getGoods_id());
+        GoodsVo goodsVo = apiGoodsMapper.queryObjectByStoreId(groupVo.getGoods_id(), 0l);
         //统计商品总价
         BigDecimal orderTotalPrice = groupVo.getRetail_min_price().multiply(new BigDecimal(number)); //订单的总价
         AddressVo addressVo = apiAddressMapper.queryObject(addressId);

+ 9 - 9
kmall-api/src/main/java/com/kmall/api/service/ApiOrderService.java

@@ -231,45 +231,45 @@ public class ApiOrderService {
             //订单业务类型:00:保税备货, 02:保税展示补货,10:保税展示跨境,11:普通商品
             if(org.apache.commons.lang.StringUtils.isEmpty(checkCart)){
                 if(Dict.orderBizType.item_11.getItem().equalsIgnoreCase(goodsItem.getGoodsBizType())){
-                    FreightEntity freightEntity = apiFreightService.queryObjectByGoodsId(goodsItem.getGoods_id());
+                    FreightEntity freightEntity = apiFreightService.queryObjectByGoodsId(goodsItem.getGoods_id(), storeId);
                     freightPrice11 = freightEntity!=null ? freightEntity.getDefaultFreight().add(freightPrice11) : freightPrice11;//查询商品运费信息
                     isBizType11 =true;
                 }
                 if(Dict.orderBizType.item_00.getItem().equalsIgnoreCase(goodsItem.getGoodsBizType())){
-                    FreightEntity freightEntity = apiFreightService.queryObjectByGoodsId(goodsItem.getGoods_id());
+                    FreightEntity freightEntity = apiFreightService.queryObjectByGoodsId(goodsItem.getGoods_id(), storeId);
                     freightPrice00 = freightEntity!=null ? freightEntity.getDefaultFreight().add(freightPrice00) : freightPrice00;//查询商品运费信息
                     isBizType00 =true;
                 }
                 if(Dict.orderBizType.item_02.getItem().equalsIgnoreCase(goodsItem.getGoodsBizType())){
-                    FreightEntity freightEntity = apiFreightService.queryObjectByGoodsId(goodsItem.getGoods_id());
+                    FreightEntity freightEntity = apiFreightService.queryObjectByGoodsId(goodsItem.getGoods_id(), storeId);
                     freightPrice02 = freightEntity!=null ? freightEntity.getDefaultFreight().add(freightPrice02) : freightPrice02;//查询商品运费信息
                     isBizType02 =true;
                 }
                 if(Dict.orderBizType.item_10.getItem().equalsIgnoreCase(goodsItem.getGoodsBizType())){
-                    FreightEntity freightEntity = apiFreightService.queryObjectByGoodsId(goodsItem.getGoods_id());
+                    FreightEntity freightEntity = apiFreightService.queryObjectByGoodsId(goodsItem.getGoods_id(), storeId);
                     freightPrice10 = freightEntity!=null ? freightEntity.getDefaultFreight().add(freightPrice10) : freightPrice10;//查询商品运费信息
                     isBizType10 =true;
                 }
             }else{
                 if(checkCart.equalsIgnoreCase(Dict.orderBizType.item_11.getItem())){
                     if(Dict.orderBizType.item_11.getItem().equalsIgnoreCase(goodsItem.getGoodsBizType())){
-                        FreightEntity freightEntity = apiFreightService.queryObjectByGoodsId(goodsItem.getGoods_id());
+                        FreightEntity freightEntity = apiFreightService.queryObjectByGoodsId(goodsItem.getGoods_id(), storeId);
                         freightPrice11 = freightEntity!=null ? freightEntity.getDefaultFreight().add(freightPrice11) : freightPrice11;//查询商品运费信息
                         isBizType11 =true;
                     }
                 }else{
                     if(Dict.orderBizType.item_00.getItem().equalsIgnoreCase(goodsItem.getGoodsBizType())){
-                        FreightEntity freightEntity = apiFreightService.queryObjectByGoodsId(goodsItem.getGoods_id());
+                        FreightEntity freightEntity = apiFreightService.queryObjectByGoodsId(goodsItem.getGoods_id(), storeId);
                         freightPrice00 = freightEntity!=null ? freightEntity.getDefaultFreight().add(freightPrice00) : freightPrice00;//查询商品运费信息
                         isBizType00 =true;
                     }
                     if(Dict.orderBizType.item_02.getItem().equalsIgnoreCase(goodsItem.getGoodsBizType())){
-                        FreightEntity freightEntity = apiFreightService.queryObjectByGoodsId(goodsItem.getGoods_id());
+                        FreightEntity freightEntity = apiFreightService.queryObjectByGoodsId(goodsItem.getGoods_id(), storeId);
                         freightPrice02 = freightEntity!=null ? freightEntity.getDefaultFreight().add(freightPrice02) : freightPrice02;//查询商品运费信息
                         isBizType02 =true;
                     }
                     if(Dict.orderBizType.item_10.getItem().equalsIgnoreCase(goodsItem.getGoodsBizType())){
-                        FreightEntity freightEntity = apiFreightService.queryObjectByGoodsId(goodsItem.getGoods_id());
+                        FreightEntity freightEntity = apiFreightService.queryObjectByGoodsId(goodsItem.getGoods_id(), storeId);
                         freightPrice10 = freightEntity!=null ? freightEntity.getDefaultFreight().add(freightPrice10) : freightPrice10;//查询商品运费信息
                         isBizType10 =true;
                     }
@@ -329,7 +329,7 @@ public class ApiOrderService {
                 for (CartVo goodsItem : checkedGoodsList) {
                     //统计商品总价
                     if (orderInfo.getOrderBizType().equalsIgnoreCase(goodsItem.getGoodsBizType())) {
-                        GoodsVo goodsVo = apiGoodsMapper.queryObject(goodsItem.getGoods_id());
+                        GoodsVo goodsVo = apiGoodsMapper.queryObjectByStoreId(goodsItem.getGoods_id(), storeId);
                         if(goodsVo==null){
                             throw new RRException("订单提交失败:商品不存在");
                         }

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

@@ -17,6 +17,7 @@
         <result property="is_new" column="is_new"/>
         <result property="new_pic_url" column="new_pic_url"/>
         <result property="new_sort_order" column="new_sort_order"/>
+        <result column="category_id" property="categoryId" />
     </resultMap>
 
     <select id="queryObject" resultMap="brandMap">
@@ -31,7 +32,14 @@
         <if test="fields == null or fields == ''">
             *
         </if>
-        from mall_brand
+        from mall_brand where 1=1
+        <if test="merchSn != null and merchSn.trim() != ''">
+            AND merch_sn = #{merchSn}
+        </if>
+        <if test="categoryId != null">
+            AND category_id = #{categoryId}
+        </if>
+
         <choose>
             <when test="sidx != null and sidx.trim() != ''">
                 order by ${sidx} ${order}

+ 4 - 4
kmall-api/src/main/resources/mybatis/mapper/ApiCartMapper.xml

@@ -44,7 +44,7 @@
         <include refid="Base_Column_List" /> from mall_cart where goods_biz_type = #{goodsBizType}
     </select>
     <select id="queryObjectByGoodsIdAndUserId" resultMap="cartMap">
-        SELECT * FROM `mall_cart` where goods_id =#{goods_id} and user_id =#{user_id}
+        SELECT * FROM `mall_cart` where goods_id =#{goods_id} and user_id =#{user_id} and store_id = #{storeId}
     </select>
 
     <select id="queryList" resultMap="cartMap">
@@ -386,9 +386,9 @@
     <update id="updateCheck">
         update mall_cart
         set `checked` = #{isChecked}
-        where product_id in
-        <foreach item="product_id" collection="productIds" open="(" separator="," close=")">
-            #{product_id}
+        where goods_id in
+        <foreach item="goods_id" collection="goodsIds" open="(" separator="," close=")">
+            #{goods_id}
         </foreach>
         and user_id = #{user_id} and store_id = #{store_id}
     </update>

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

@@ -24,7 +24,7 @@
 		where id = #{id}
 	</select>
 	<select id="queryObjectByGoodsId" resultType="com.kmall.api.entity.FreightEntity">
-		select f.* from mall_freight f  inner join mall_goods g on g.freight_id = f.id where g.id=#{goodsId}
+		select f.* from mall_freight f  inner join mall_product_store_rela g  on g.freight_id = f.id  where g.goods_id=#{goodsId} and g.store_id = #{storeId}
 	</select>
 
 	<select id="queryList" resultType="com.kmall.api.entity.FreightEntity">

+ 61 - 28
kmall-api/src/main/resources/mybatis/mapper/ApiGoodsMapper.xml

@@ -52,8 +52,8 @@
     </resultMap>
 
     <sql id="Base_Column_List" >
-        id, category_id, goods_sn, sku, goods_biz_type, name, brand_id, goods_number, keywords,
-        goods_brief, is_on_sale, add_time, sort_order, is_delete, attribute_category, counter_price,
+        id,  goods_sn, sku, goods_biz_type, name,  goods_number, keywords,
+        goods_brief, is_on_sale, add_time, sort_order, is_delete, counter_price,
         extra_price, is_new, goods_unit, primary_pic_url, list_pic_url, retail_price, sell_volume,
         primary_product_id, unit_price, promotion_desc, promotion_tag, app_exclusive_price,
         is_app_exclusive, is_limited, is_hot, market_price, creater_sn, create_time, moder_sn,
@@ -61,18 +61,51 @@
     </sql>
 
     <select id="queryObject" resultMap="goodsMap">
-		select *
-        from mall_goods
-		where id = #{value}
+		select a.id,
+        psr1.category_id,
+        a.goods_sn,
+        a.name,
+        psr1.brand_id,
+        a.goods_number,
+        a.keywords,
+        a.goods_brief,
+        a.is_on_sale,
+        a.add_time,
+        a.sort_order,
+        a.is_delete,
+        psr1.attribute_category,
+        a.counter_price,
+        a.extra_price,
+        a.is_new,
+        a.goods_unit,
+        a.primary_pic_url,
+        a.list_pic_url,
+        psr1.retail_price,
+        a.sell_volume,
+        a.primary_product_id,
+        a.unit_price,
+        a.promotion_desc,
+        a.promotion_tag,
+        a.app_exclusive_price,
+        a.is_app_exclusive,
+        a.is_limited,
+        a.is_hot,
+        a.merch_sn,
+        psr1.store_id,
+        psr1.market_price,
+        psr1.stock_num,
+        a.goods_desc,a.goods_biz_type,a.goods_rate
+        from mall_goods a LEFT JOIN mall_product_store_rela psr1 ON a.id = psr1.goods_id and a.merch_sn = psr1.merch_sn
+		where a.id = #{value}
 	</select>
 
     <select id="queryObjectByStoreId" resultMap="goodsMap">
         select
         a.id,
-        a.category_id,
+        psr1.category_id,
         a.goods_sn,
         a.name,
-        a.brand_id,
+        psr1.brand_id,
         a.goods_number,
         a.keywords,
         a.goods_brief,
@@ -80,7 +113,7 @@
         a.add_time,
         a.sort_order,
         a.is_delete,
-        a.attribute_category,
+        psr1.attribute_category,
         a.counter_price,
         a.extra_price,
         a.is_new,
@@ -116,11 +149,11 @@
         <if test="fields == null or fields == ''">
             a.*
         </if>
-        ,psr1.stock_num
+        ,psr1.stock_num,psr1.category_id,psr1.brand_id,psr1.attribute_category
         from mall_goods a
         LEFT JOIN mall_product_store_rela psr1 ON a.id = psr1.goods_id and a.merch_sn = psr1.merch_sn
         LEFT JOIN mall_product b ON b.id = psr1.product_id
-        left join mall_category c on a.category_id = c.id
+        left join mall_category c on psr1.category_id = c.id
         where 1 = 1 and a.is_delete != 1 and psr1.stock_num > 0 and a.is_on_sale = 1
         <if test="is_new != null and is_new != ''">
             and a.is_new = #{is_new}
@@ -129,10 +162,10 @@
             and a.is_hot = #{is_hot}
         </if>
         <if test="brand_id != null and brand_id != ''">
-            and a.brand_id = #{brand_id}
+            and psr1.brand_id = #{brand_id}
         </if>
         <if test="category_id != null and category_id != ''">
-            and a.category_id = #{category_id}
+            and psr1.category_id = #{category_id}
         </if>
         <if test="keyword != null">
             and a.name like concat('%',#{keyword},'%')
@@ -147,13 +180,13 @@
             and a.goods_biz_type in ('00','11')
         </if>
         <if test="categoryIds != null">
-            and a.category_id in
+            and psr1.category_id in
             <foreach item="item" collection="categoryIds" open="(" separator="," close=")">
                 #{item}
             </foreach>
         </if>
         <if test="category_parent_id != null and category_parent_id != null">
-            and FIND_IN_SET(a.category_id, getCategoryChildLst(#{category_parent_id}))
+            and FIND_IN_SET(psr1.category_id, getCategoryChildLst(#{category_parent_id}))
         </if>
         <if test="goods_ids != null">
             and a.id in
@@ -184,7 +217,7 @@
             ${fields}
         </if>
         <if test="fields == null or fields == ''">
-            a.*,b.id as product_id
+            a.*,b.id as product_id,psr1.category_id,psr1.brand_id,psr1.attribute_category
         </if>
         from mall_goods a
         LEFT JOIN mall_product_store_rela psr1 ON a.id = psr1.goods_id and a.merch_sn = psr1.merch_sn
@@ -197,22 +230,22 @@
             and a.is_hot = #{is_hot}
         </if>
         <if test="brand_id != null and brand_id != ''">
-            and a.brand_id = #{brand_id}
+            and psr1.brand_id = #{brand_id}
         </if>
         <if test="category_id != null and category_id != ''">
-            and a.category_id = #{category_id}
+            and psr1.category_id = #{category_id}
         </if>
         <if test="keyword != null">
             and a.keywords like concat('%',#{keyword},'%')
         </if>
         <if test="categoryIds != null">
-            and a.category_id in
+            and psr1.category_id in
             <foreach item="item" collection="categoryIds" open="(" separator="," close=")">
                 #{item}
             </foreach>
         </if>
         <if test="category_parent_id != null and category_parent_id != null">
-            and FIND_IN_SET(a.category_id, getCategoryChildLst(#{category_parent_id}))
+            and FIND_IN_SET(psr1.category_id, getCategoryChildLst(#{category_parent_id}))
         </if>
         <if test="goods_ids != null">
             and a.id in
@@ -237,7 +270,7 @@
     </select>
 
     <select id="queryCatalogProductList" resultMap="goodsMap">
-        select a.id, a.name, a.list_pic_url, psr1.market_price, psr1.retail_price, a.goods_brief, b.id AS product_id,psr1.stock_num
+        select a.id, a.name, a.list_pic_url,psr1.category_id,psr1.brand_id,psr1.attribute_category , psr1.market_price, psr1.retail_price, a.goods_brief, b.id AS product_id,psr1.stock_num
         <if test="is_group != null and is_group == true">
            ,gg.id as group_id
         </if>
@@ -257,13 +290,13 @@
             and a.is_hot = #{is_hot}
         </if>
         <if test="brand_id != null and brand_id != ''">
-            and a.brand_id = #{brand_id}
+            and psr1.brand_id = #{brand_id}
         </if>
         <if test="name != null and name != ''">
             and a.'name' like concat('%',#{keyword},'%')
         </if>
         <if test="category_id != null and category_id != ''">
-            and a.category_id = #{category_id}
+            and psr1.category_id = #{category_id}
         </if>
         <if test="keyword != null">
             and a.keywords like concat('%',#{keyword},'%')
@@ -272,13 +305,13 @@
             and gg.id is not null
         </if>
         <if test="categoryIds != null">
-            and a.category_id in
+            and psr1.category_id in
             <foreach item="item" collection="categoryIds" open="(" separator="," close=")">
                 #{item}
             </foreach>
         </if>
         <if test="category_parent_id != null and category_parent_id != null">
-            and FIND_IN_SET(a.category_id, getCategoryChildLst(#{category_parent_id}))
+            and FIND_IN_SET(psr1.category_id, getCategoryChildLst(#{category_parent_id}))
         </if>
         <if test="goods_ids != null">
             and a.id in
@@ -323,10 +356,10 @@
             and a.is_hot = #{is_hot}
         </if>
         <if test="brand_id != null and brand_id != ''">
-            and a.brand_id = #{brand_id}
+            and s.brand_id = #{brand_id}
         </if>
         <if test="category_id != null and category_id != ''">
-            and a.category_id = #{category_id}
+            and s.category_id = #{category_id}
         </if>
         <if test="keyword != null">
             and a.name like concat('%',#{keyword},'%')
@@ -335,13 +368,13 @@
             and a.is_delete = #{is_delete}
         </if>
         <if test="categoryIds != null">
-            and a.category_id in
+            and s.category_id in
             <foreach item="item" collection="categoryIds" open="(" separator="," close=")">
                 #{item}
             </foreach>
         </if>
         <if test="category_parent_id != null and category_parent_id != null">
-            and FIND_IN_SET(a.category_id, getCategoryChildLst(#{category_parent_id}))
+            and FIND_IN_SET(s.category_id, getCategoryChildLst(#{category_parent_id}))
         </if>
         <if test="goods_ids != null">
             and a.id in

+ 7 - 6
kmall-common/src/main/java/com/kmall/common/controller/SysRoleController.java

@@ -1,14 +1,12 @@
 package com.kmall.common.controller;
 
 import com.kmall.common.annotation.SysLog;
+import com.kmall.common.constant.Dict;
 import com.kmall.common.entity.SysRoleEntity;
 import com.kmall.common.service.SysRoleDeptService;
 import com.kmall.common.service.SysRoleMenuService;
 import com.kmall.common.service.SysRoleService;
-import com.kmall.common.utils.Constant;
-import com.kmall.common.utils.PageUtils;
-import com.kmall.common.utils.Query;
-import com.kmall.common.utils.R;
+import com.kmall.common.utils.*;
 import com.kmall.common.validator.ValidatorUtils;
 import org.apache.shiro.authz.annotation.RequiresPermissions;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -64,8 +62,11 @@ public class SysRoleController extends AbstractController {
     public R select() {
         Map<String, Object> map = new HashMap<>();
 
-        //如果不是超级管理员,则只查询自己所拥有的角色列表
-        if (getUserId() != Constant.SUPER_ADMIN) {
+//        //如果不是超级管理员,则只查询自己所拥有的角色列表
+//        if (getUserId() != Constant.SUPER_ADMIN) {
+//            map.put("createUserId", getUserId());
+//        }
+        if(!ShiroUtils.getUserEntity().getRoleType().equalsIgnoreCase(Dict.roleType.item_1.getItem())){
             map.put("createUserId", getUserId());
         }
         List<SysRoleEntity> list = sysRoleService.queryList(map);

+ 6 - 2
kmall-common/src/main/java/com/kmall/common/controller/SysUserController.java

@@ -1,6 +1,7 @@
 package com.kmall.common.controller;
 
 import com.kmall.common.annotation.SysLog;
+import com.kmall.common.constant.Dict;
 import com.kmall.common.entity.SysUserEntity;
 import com.kmall.common.service.SysUserRoleService;
 import com.kmall.common.service.SysUserService;
@@ -39,8 +40,11 @@ public class SysUserController extends AbstractController {
     @RequestMapping("/list")
     @RequiresPermissions("sys:user:list")
     public R list(@RequestParam Map<String, Object> params) {
-        //只有超级管理员,才能查看所有管理员列表
-        if (getUserId() != Constant.SUPER_ADMIN) {
+//        //只有超级管理员,才能查看所有管理员列表
+//        if (getUserId() != Constant.SUPER_ADMIN) {
+//            params.put("createUserId", getUserId());
+//        }
+        if(!ShiroUtils.getUserEntity().getRoleType().equalsIgnoreCase(Dict.roleType.item_1.getItem())){
             params.put("createUserId", getUserId());
         }
 

+ 1 - 0
kmall-schedule/src/main/java/com/kmall/schedule/service/QzOrderService.java

@@ -1142,6 +1142,7 @@ public class QzOrderService {
                 param.put("valueName", goodsName);
                 param.put("createTime", new Date());
                 param.put("modTime", new Date());
+                param.put("addTime", System.currentTimeMillis() / 1000);
                 qzOrderMapper.insertComment(param);//新增评论
             }
             qzOrderMapper.updateReceiptOrderByCommentCount();//修改评论数量

+ 4 - 2
kmall-schedule/src/main/resources/mybatis/mapper/QzOrderMapper.xml

@@ -153,7 +153,7 @@
         order_status='301' and shipping_status ='2' and comment_count=0 AND confirm_time <![CDATA[ < ]]> DATE_ADD(now(),INTERVAL -30 DAY)
     </update>
 
-    <update id="insertComment" parameterType="map">
+    <insert id="insertComment" parameterType="map">
         insert into mall_comment(
         `type_id`,
         `value_id`,
@@ -167,6 +167,7 @@
         `value_name`,
         `goods_level`,
         `create_time`,
+        add_time,
         `mod_time`)
         values(
         #{typeId},
@@ -181,8 +182,9 @@
         #{valueName},
         #{goodsLevel},
         #{createTime},
+        #{addTime},
         #{modTime})
-    </update>
+    </insert>
 
     <insert id="insertPinganResponseDto" parameterType="map">
         insert into pingan_response(

+ 4 - 3
wx-mall/config/api.js

@@ -2,13 +2,13 @@
 //var NewApiRootUrl = 'http://localhost:8080/api/';
 //var NewApiRootUrl = 'http://192.168.1.138:8080/api/';
 // var NewApiRootUrl = 'http://qhdswl.f3322.net:9001/platform-framework/api/';//hyq
-var NewApiRootUrl = 'http://qhdswl.f3322.net:9002/api/';
+// var NewApiRootUrl = 'http://qhdswl.f3322.net:9003/api/';
 
 //测试环境
-//var NewApiRootUrl = 'https://mp-test.k1net.cn/api/';
+// var NewApiRootUrl = 'https://mp-test.k1net.cn/api/';
 
 //生产环境
-//var NewApiRootUrl = 'https://mp.k1net.cn/api/';
+var NewApiRootUrl = 'https://mp.k1net.cn/api/';
 
 module.exports = {
 
@@ -29,6 +29,7 @@ module.exports = {
     GoodsCount: NewApiRootUrl + 'goods/count',  //统计商品总数
     GoodsList: NewApiRootUrl + 'goods/list',  //获得商品列表
     GoodsCategory: NewApiRootUrl + 'goods/category',  //获得分类数据
+    GoodsCategoryBrand: NewApiRootUrl + 'goods/brand',  //获得分类品牌数据
     GoodsDetail: NewApiRootUrl + 'goods/detail',  //获得商品的详情
     GoodsHot: NewApiRootUrl + 'goods/hot',  //热门
     GoodsRelated: NewApiRootUrl + 'goods/related',  //商品详情页的关联商品(大家都在看)

+ 2 - 2
wx-mall/lib/wxParse/wxParse.wxml

@@ -19,7 +19,7 @@
 </template>
 
 <template name="wxParseImg">
-    <image class="{{item.classStr}} wxParse-{{item.tag}}" data-from="{{item.from}}" data-src="{{item.attr.src}}"  data-idx="{{item.imgIndex}}"  src="{{item.attr.src}}" mode="aspectFit" bindload="wxParseImgLoad" bindtap="wxParseImgTap" style="width:{{item.width}}px;height:{{item.height}}px;{{item.attr.style}}"   />
+    <image lazy-load="true" class="{{item.classStr}} wxParse-{{item.tag}}" data-from="{{item.from}}" data-src="{{item.attr.src}}"  data-idx="{{item.imgIndex}}"  src="{{item.attr.src}}" mode="aspectFit" bindload="wxParseImgLoad" bindtap="wxParseImgTap" style="width:{{item.width}}px;height:{{item.height}}px;{{item.attr.style}}"   />
 </template>
 
 <template name="WxEmojiView">
@@ -27,7 +27,7 @@
     <block wx:for="{{item.textArray}}" wx:key="">
       <block class="{{item.text == '\\n' ? 'wxParse-hide':''}}" wx:if="{{item.node == 'text'}}">{{item.text}}</block>
       <block wx:elif="{{item.node == 'element'}}">
-        <image class="wxEmoji" src="{{item.baseSrc}}{{item.text}}" />
+        <image lazy-load="true" class="wxEmoji" src="{{item.baseSrc}}{{item.text}}" />
       </block>
     </block>
   </view>

+ 9 - 0
wx-mall/lib/wxParse/wxParse.wxss

@@ -9,6 +9,15 @@
  * for: 微信小程序富文本解析
  * detail : http://weappdev.com/t/wxparse-alpha0-1-html-markdown/184
  */
+ @keyframes fadeIn {
+  0% {
+    opacity: 0;
+  }
+  100% {
+    opacity: 1;
+  }
+}
+
 
 .wxParse{
     margin: 0 5px;

+ 40 - 10
wx-mall/pages/cart/cart.js

@@ -201,11 +201,16 @@ Page({
   },
   checkedItem: function(event) {
     let itemIndex = event.target.dataset.itemIndex;
+    let goodsBizType = event.target.dataset.goodsBizType;
+    let goodsId = event.target.dataset.goodsId;
+    let checked = event.target.dataset.checked;
     let that = this;
-
+    // console.log(goodsBizType);
+    // console.log(goodsId);
+    // console.log(that.data.cartGoods[itemIndex].checked);
     util.request(api.CartChecked, {
-      productIds: that.data.cartGoods[itemIndex].product_id,
-      isChecked: that.data.cartGoods[itemIndex].checked ? 0 : 1,
+      goodsIds: goodsId,
+      isChecked: checked ? 0 : 1,
       checkCart: that.data.checkCart
     }, 'POST').then(function(res) {
       if (res.errno === 0) {
@@ -222,16 +227,15 @@ Page({
         checkedGoodsCount += v.number;
       }
     });
-    console.log(checkedGoodsCount);
     return checkedGoodsCount;
   },
   checkedAll: function() {
     let that = this;
-    var productIds = this.data.cartGoods.map(function(v) {
-      return v.product_id;
+    var goodsIds = this.data.cartGoods.map(function(v) {
+      return v.goodsIds;
     });
     util.request(api.CartChecked, {
-      productIds: productIds.join(','),
+      goodsIds: goodsIds.join(','),
       isChecked: that.isCheckedAll() ? 0 : 1
     }, 'POST').then(function(res) {
       if (res.errno === 0) {
@@ -244,26 +248,52 @@ Page({
     let that = this;
     let goodsBizType = e.target.dataset.goodsBizType;
     let isCheckedTypeStatu;
+    let checkCart;
     if (goodsBizType == '00') {
       isCheckedTypeStatu = that.isCheckedTypeStatus00();
+      checkCart = '00';
     }
     if (goodsBizType == '02') {
       isCheckedTypeStatu = that.isCheckedTypeStatus02();
+      checkCart = '00';
     }
     if (goodsBizType == '10') {
       isCheckedTypeStatu = that.isCheckedTypeStatus10();
+      checkCart = '00';
     }
     if (goodsBizType == '11') {
       isCheckedTypeStatu = that.isCheckedTypeStatus11();
+      checkCart = '11';
     }
     util.request(api.CartChecked, {
       isChecked: isCheckedTypeStatu ? 0 : 1,
-      goodsBizType: goodsBizType
+      goodsBizType: goodsBizType, 
+      checkCart: checkCart
     }, 'POST').then(function(res) {
       if (res.errno === 0) {
-        that.setCommonData(res);
+        // that.setCommonData(res);
+        that.setData({
+          validCartList: res.data.validCartList,
+          couponInfoList: res.data.couponInfoList,
+        });
+        if (goodsBizType == '11') {
+          that.setData({
+            cartGoods: res.data.cartList,
+            cartTotal: res.data.cartTotal,
+            cartGoods11: res.data.cart11List,
+            total11: res.data.total11
+          });
+        } else {
+          that.setData({
+            cartGoods: res.data.cartList,
+            cartTotal: res.data.cartTotal,
+            cartGoods00: res.data.cart00List,
+            cartGoods02: res.data.cart02List,
+            cartGoods10: res.data.cart10List,
+            total00: res.data.total00
+          });
+        }
       }
-
       if (goodsBizType == '00') {
         that.setData({
           checkedTypeStatus00: that.isCheckedTypeStatus00()

+ 8 - 8
wx-mall/pages/cart/cart.wxml

@@ -43,8 +43,8 @@
           <view wx:if="{{cartGoods00.length != 0}}" class="checkbox-biz-type {{checkedTypeStatus00 ? 'checked' : ''}}" bindtap="checkedAllGoodType" data-goods-Biz-Type="00">
           <image src="../../../static/images/service-bao.png" class="search-icon-shop"></image>
           <text class="title-name ">保税仓</text></view>
-          <view class="item" wx:for="{{cartGoods}}" wx:if="{{item.goodsBizType == 00}}" wx:key="{{item.id}}">
-            <view class="checkbox {{item.checked ? 'checked' : ''}}" bindtap="checkedItem" data-item-index="{{index}}"></view>
+          <view class="item" wx:for="{{cartGoods00}}" wx:if="{{item.goodsBizType == 00}}" wx:key="{{item.id}}">
+            <view class="checkbox {{item.checked ? 'checked' : ''}}" bindtap="checkedItem" data-item-index="{{index}}"  data-goods-Biz-Type="00" data-goods-Id="{{item.goods_id}}" data-checked="{{item.checked}}"></view>
             <view class="cart-goods">
               <navigator url="/pages/goods/goods?id={{item.goods_id}}">
                 <image class="img" src="{{item.list_pic_url}}"></image>
@@ -83,8 +83,8 @@
           <text class="title-name">保税展示</text>
         </view>
 
-          <view class="item" wx:for="{{cartGoods}}" wx:if="{{item.goodsBizType == 02}}" wx:key="{{item.id}}">
-            <view class="checkbox {{item.checked ? 'checked' : ''}}" bindtap="checkedItem" data-item-index="{{index}}"></view>
+          <view class="item" wx:for="{{cartGoods02}}" wx:if="{{item.goodsBizType == 02}}" wx:key="{{item.id}}">
+            <view class="checkbox {{item.checked ? 'checked' : ''}}" bindtap="checkedItem" data-item-index="{{index}}" data-goods-Biz-Type="00" data-goods-Id="{{item.goods_id}}" data-checked="{{item.checked}}"></view>
             <view class="cart-goods">
               <navigator url="/pages/goods/goods?id={{item.goods_id}}">
                 <image class="img" src="{{item.list_pic_url}}"></image>
@@ -124,8 +124,8 @@
             <text class="title-name">现场速递</text>
           </view>
 
-          <view class="item" wx:for="{{cartGoods}}" wx:if="{{item.goodsBizType == 10}}" wx:key="{{item.id}}">
-            <view class="checkbox {{item.checked ? 'checked' : ''}}" bindtap="checkedItem" data-item-index="{{index}}"></view>
+          <view class="item" wx:for="{{cartGoods10}}" wx:if="{{item.goodsBizType == 10}}" wx:key="{{item.id}}">
+            <view class="checkbox {{item.checked ? 'checked' : ''}}" bindtap="checkedItem" data-item-index="{{index}}" data-goods-Biz-Type="00" data-goods-Id="{{item.goods_id}}" data-checked="{{item.checked}}"></view>
             <view class="cart-goods">
               <navigator url="/pages/goods/goods?id={{item.goods_id}}">
                 <image class="img" src="{{item.list_pic_url}}"></image>
@@ -165,8 +165,8 @@
             <text class="title-name">普通商品</text>
           </view>
 
-          <view class="item" wx:for="{{cartGoods}}" wx:if="{{item.goodsBizType == 11}}" wx:key="{{item.id}}">
-            <view class="checkbox {{item.checked ? 'checked' : ''}}" bindtap="checkedItem" data-item-index="{{index}}"></view>
+          <view class="item" wx:for="{{cartGoods11}}" wx:if="{{item.goodsBizType == 11}}" wx:key="{{item.id}}">
+            <view class="checkbox {{item.checked ? 'checked' : ''}}" bindtap="checkedItem" data-item-index="{{index}}" data-goods-Biz-Type="00" data-goods-Id="{{item.goods_id}}" data-checked="{{item.checked}}"></view>
             <view class="cart-goods">
               <navigator url="/pages/goods/goods?id={{item.goods_id}}">
                 <image class="img" src="{{item.list_pic_url}}"></image>

+ 21 - 5
wx-mall/pages/catalog/catalog.js

@@ -8,6 +8,7 @@ Page({
     navList: [],
     categoryList: [],
     currentCategory: {},
+    brandList:[],
     scrollLeft: 0,
     scrollTop: 0,
     goodsCount: 0,
@@ -65,9 +66,11 @@ Page({
       if (!wx.getStorageSync('currentCategory')) {
         that.setData({
           navList: res.data.categoryList,
-          currentCategory: res.data.currentCategory
+          currentCategory: res.data.currentCategory,
+          brandList: res.data.brandList
         });
         wx.setStorageSync('currentCategory', res.data.currentCategory);
+        // console.log(that.data.brandList);
       } else {
         if (that.data.currentCategory && that.data.currentCategory.id > 0) {
           that.setData({
@@ -76,7 +79,8 @@ Page({
         } else {
           that.setData({
             navList: res.data.categoryList,
-            currentCategory: res.data.currentCategory
+            currentCategory: res.data.currentCategory,
+            brandList: res.data.brandList
           });
         }
       }
@@ -93,9 +97,10 @@ Page({
     util.request(api.CatalogCurrent, { id: id })
       .then(function (res) {
         that.setData({
-          currentCategory: res.data.currentCategory
+          currentCategory: res.data.currentCategory,
+          brandList: res.data.brandList
         });
-        console.log(that.data.currentCategory);
+        // console.log(res.data.brandList);
         that.getGoodsList();
       });
   },
@@ -364,6 +369,17 @@ Page({
     wx.navigateTo({
       url: '/pages/category/category?id=' + replyType + '&&goodsBizType=' + that.data.goodsBizType + '&&currentIndex=' + currentIndex
     })
-
+  },
+  sercherCategoryByBrand: function (e) {
+    var that = this;
+    let url = '';
+    var replyType = e.currentTarget.dataset.replyType;
+    var currentIndex = e.currentTarget.dataset.currentIndex;
+    console.log('replyType:' + replyType);
+    console.log('goodsBizType:' + that.data.goodsBizType);
+    // 跳转页面
+    wx.navigateTo({
+      url: '/pages/categoryBrand/categoryBrand?brandId=' + replyType + '&&goodsBizType=' + that.data.goodsBizType + '&&currentIndex=' + currentIndex
+    })
   }
 })

+ 13 - 0
wx-mall/pages/catalog/catalog.wxml

@@ -95,6 +95,19 @@
           <text class="txt">{{item.name?item.name:""}}</text>
         </navigator>
       </view>
+
+      <view class="hd" wx:if="{{currentCategory}}">
+        <text class="line"></text>
+        <text class="txt">{{currentCategory.name?currentCategory.name:""}}品牌</text>
+        <text class="line"></text>
+      </view>
+      <view class="bd">
+        <navigator bindtap="sercherCategoryByBrand" data-reply-Type="{{item.id}}" data-current-Index="{{index}}" class="item {{(index+1) % 3 == 0 ? 'last' : ''}}" wx:for="{{brandList}}" wx:key="{{item.id}}">
+          <image class="icon" wx:if="{{item.app_list_pic_url}}" src="{{item.app_list_pic_url}}"></image>
+          <text class="txt">{{item.name?item.name:""}}</text>
+        </navigator>
+      </view>
+      
       <view class="sort" wx:if="{{goodsList.length > 0 }}">
         <view class="sort-box">
           <view class="item {{currentSortType == 'default' ? 'active' : ''}}" bindtap="openSortFilter" id="defaultSort">

+ 5 - 4
wx-mall/pages/catalog/catalog.wxss

@@ -134,12 +134,13 @@ page {
   height: auto;
   width: 100%;
   overflow: hidden;
+  text-align:center;
 }
 
 .catalog .bd .item {
   display: block;
   float: left;
-  height: 246rpx;
+  /* height: 246rpx; */
   /* width: 170rpx; */
   margin-right: 54rpx;
 }
@@ -149,14 +150,14 @@ page {
 }
 
 .catalog .bd .item .icon {
-  height: 144rpx;
-  width: 144rpx;
+  height: 90rpx;
+  width: 100rpx;
 }
 
 .catalog .bd .item .txt {
   display: block;
   text-align: center;
-  font-size: 24rpx;
+  font-size: 22rpx;
   color: #333;
   height: 72rpx;
   width: 144rpx;

+ 4 - 1
wx-mall/pages/goods/goods.js

@@ -248,7 +248,10 @@ Page({
           mask: true
         });
       } else {
-        util.showErrorToast(res.errmsg)
+        wx.showToast({
+          title: res.errmsg,
+          icon: 'none'
+        })
       }
     });
   },

+ 3 - 3
wx-mall/pages/goods/goods.wxml

@@ -54,7 +54,7 @@
                   </view>
 
                 <view style="width: 750rpx;height: calc(9 * 750rpx / 16);" hidden="{{imgHiddenName}}">
-                  <image class="model-img" style="width: 750rpx;height: calc(9 * 750rpx / 16);background-size:650rpx 321rpx;" mode="aspectFill" src="{{gallery[1].img_url}}" background-size="cover"></image>
+                  <image lazy-load="true" class="model-img" style="width: 750rpx;height: calc(9 * 750rpx / 16);background-size:650rpx 321rpx;" mode="aspectFill" src="{{gallery[1].img_url}}" background-size="cover"></image>
                   <view class="model-btn">
                     <view class="play-icon"></view>
                   </view>
@@ -62,7 +62,7 @@
               </view>
               <!-- 视频播放结束 -->
               <view wx:else >
-                <image src="{{item.img_url}}" class="imageClass" mode='aspectFill' catchtap='preview' data-url="{{item.img_url}}"/>
+                <image lazy-load="true" src="{{item.img_url}}?x-oss-process=image/resize,h_500" class="imageClass" mode='aspectFill' catchtap='preview' data-url="{{item.img_url}}"/>
               </view>
               </view>
               
@@ -206,7 +206,7 @@
     </view>
     <view class="detail"  bindtap="hideSwitchAttrPop">
       <view class="t">商品详情</view>
-      <import src="../../lib/wxParse/wxParse.wxml" />
+      <import src="../../lib/wxParse/wxParse.wxml"/>
       <template is="wxParse" data="{{wxParseData:goodsDetail.nodes}}" />
     </view>
 

+ 12 - 1
wx-mall/pages/goods/goods.wxss

@@ -1,3 +1,12 @@
+@keyframes fadeIn {
+  0% {
+    opacity: 0;
+  }
+  100% {
+    opacity: 1;
+  }
+}
+
 .container {
   margin-bottom: 100rpx;
 }
@@ -565,7 +574,8 @@
   height: auto;
   overflow: hidden;
 
-  padding: 0 31.25rpx 25rpx 31.25rpx;
+  /* padding: 0 31.25rpx 25rpx 31.25rpx; */
+  padding: 0 3rpx 2rpx 3rpx;
   background: #fff;
 }
 
@@ -1135,4 +1145,5 @@
   height: 104rpx;
   line-height: 104rpx;
   font-size: 38.5rpx;
+  margin-left:20rpx;
 }

+ 21 - 4
wx-mall/pages/index/index.js

@@ -140,7 +140,7 @@ Page({
     let that = this;
     if (wx.getStorageSync('storeId')) {
       // console.log(wx.getStorageSync('userId'));
-      console.log(wx.getStorageSync('storeId'));
+      // console.log(wx.getStorageSync('storeId'));
       // console.log(wx.getStorageSync('merchSn'));
       if (wx.getStorageSync('userId')){
         wx.request({
@@ -170,7 +170,7 @@ Page({
   // 同步门店
   syncStore: function () {
     let that = this;
-    console.log(wx.getStorageSync('merchSn'));
+    // console.log(wx.getStorageSync('merchSn'));
     //获取附件门店信息
     util.getLocation((lng, lat) => {
       wx.setStorageSync('location', JSON.stringify({ lng, lat }));
@@ -180,7 +180,10 @@ Page({
         wx.removeStorageSync('nearStoreList');
         wx.removeStorageSync('storeId');
         wx.removeStorageSync('storeVo');
-        wx.removeStorageSync('currentCategory');
+        // console.log('sasas:' + wx.getStorageSync('currentCategory'));
+        if (!wx.getStorageSync('currentCategory')) {
+          wx.removeStorageSync('currentCategory');
+        }
         if (!nlist.length) {
           wx.removeStorageSync('nearStoreList');
         } else {
@@ -414,5 +417,19 @@ Page({
       }
 
     })
-  }
+  }, 
+  imgOnLoad: function (e) {
+    let that = this;
+    // console.log('图片加载完成');
+    // var realthumb = e.target.dataset.thumb;
+    // let list = that.data.list
+    // for (var i = 0; i < list.length; i++) {
+    //   if (list[i].thumb == realthumb) {
+    //     list[i].loaded = true
+    //   }
+    //   that.setData({
+    //     list: list
+    //   })
+    // }
+  },
 })

+ 2 - 1
wx-mall/pages/index/index.json

@@ -1 +1,2 @@
-{}
+{
+  "navigationBarTitleText": "前海跨境电商"}

+ 6 - 4
wx-mall/pages/index/index.wxml

@@ -31,7 +31,7 @@
   <swiper class="banner" indicator-dots="true" autoplay="true" interval="15000" duration="750">
     <swiper-item wx:for="{{banner}}" wx:key="{{item.id}}">
       <navigator url="{{item.link}}">
-        <image class="swiper-item" src="{{item.imageUrl}}" background-size="cover"></image>
+        <image class="swiper-item" src="{{item.imageUrl}}" bindload="imgOnLoad"  mode="aspectFill" background-size="cover"></image>
       </navigator>
     </swiper-item>
   </swiper>
@@ -160,9 +160,11 @@
     </view>
     <view class="b">
       <view class="item" wx:for="{{hotGoods}}" wx:for-index="index" wx:for-item="item" wx:key="{{item.id}}">
-        <navigator url="/pages/goods/goods?id={{item.id}}">
-          <image class="img" src="{{item.list_pic_url}}"></image>
-        </navigator>
+        <view class="c">
+          <navigator url="/pages/goods/goods?id={{item.id}}">
+            <image class="img" src="{{item.list_pic_url}}" mode="aspectFill"></image>
+          </navigator>
+        </view>
         <view class="right">
           <view class="text">
             <navigator url="/pages/goods/goods?id={{item.id}}">

Kaikkia tiedostoja ei voida näyttää, sillä liian monta tiedostoa muuttui tässä diffissä