Browse Source

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

黄亚琴 6 years ago
parent
commit
ec8ffb2ac1
66 changed files with 618 additions and 260 deletions
  1. 2 2
      kmall-admin/src/main/java/com/kmall/admin/controller/AdController.java
  2. 1 1
      kmall-admin/src/main/java/com/kmall/admin/controller/AddressController.java
  3. 3 3
      kmall-admin/src/main/java/com/kmall/admin/controller/AttributeController.java
  4. 2 2
      kmall-admin/src/main/java/com/kmall/admin/controller/BrandController.java
  5. 1 1
      kmall-admin/src/main/java/com/kmall/admin/controller/CartController.java
  6. 7 8
      kmall-admin/src/main/java/com/kmall/admin/controller/CategoryController.java
  7. 1 1
      kmall-admin/src/main/java/com/kmall/admin/controller/CollectController.java
  8. 19 1
      kmall-admin/src/main/java/com/kmall/admin/controller/CommentController.java
  9. 2 2
      kmall-admin/src/main/java/com/kmall/admin/controller/CouponController.java
  10. 3 10
      kmall-admin/src/main/java/com/kmall/admin/controller/ExportExceptionDataController.java
  11. 3 10
      kmall-admin/src/main/java/com/kmall/admin/controller/FeedbackController.java
  12. 2 2
      kmall-admin/src/main/java/com/kmall/admin/controller/FootprintController.java
  13. 2 2
      kmall-admin/src/main/java/com/kmall/admin/controller/FreightController.java
  14. 4 36
      kmall-admin/src/main/java/com/kmall/admin/controller/GoodsController.java
  15. 3 10
      kmall-admin/src/main/java/com/kmall/admin/controller/GoodsIssueController.java
  16. 3 10
      kmall-admin/src/main/java/com/kmall/admin/controller/HelpIssueController.java
  17. 2 2
      kmall-admin/src/main/java/com/kmall/admin/controller/MerchController.java
  18. 3 0
      kmall-admin/src/main/java/com/kmall/admin/controller/MngChangeController.java
  19. 6 6
      kmall-admin/src/main/java/com/kmall/admin/controller/OrderController.java
  20. 2 2
      kmall-admin/src/main/java/com/kmall/admin/controller/OrderRefundController.java
  21. 2 2
      kmall-admin/src/main/java/com/kmall/admin/controller/ProductStoreRelaController.java
  22. 1 1
      kmall-admin/src/main/java/com/kmall/admin/controller/SearchHistoryController.java
  23. 16 3
      kmall-admin/src/main/java/com/kmall/admin/controller/StoreController.java
  24. 3 0
      kmall-admin/src/main/java/com/kmall/admin/controller/StoreMngChangeController.java
  25. 11 2
      kmall-admin/src/main/java/com/kmall/admin/controller/SupplierController.java
  26. 2 0
      kmall-admin/src/main/java/com/kmall/admin/controller/SysOssController.java
  27. 2 2
      kmall-admin/src/main/java/com/kmall/admin/controller/SysSmsLogController.java
  28. 8 22
      kmall-admin/src/main/java/com/kmall/admin/controller/ThirdMerchantBizController.java
  29. 2 2
      kmall-admin/src/main/java/com/kmall/admin/controller/UserController.java
  30. 10 0
      kmall-admin/src/main/java/com/kmall/admin/entity/CouponEntity.java
  31. 9 0
      kmall-admin/src/main/java/com/kmall/admin/entity/OrderRefundEntity.java
  32. 10 0
      kmall-admin/src/main/java/com/kmall/admin/entity/SupplierEntity.java
  33. 22 0
      kmall-admin/src/main/java/com/kmall/admin/fromcomm/entity/SysUserEntity.java
  34. 21 4
      kmall-admin/src/main/java/com/kmall/admin/fromcomm/service/impl/SysUserServiceImpl.java
  35. 25 22
      kmall-admin/src/main/java/com/kmall/admin/utils/ParamUtils.java
  36. 12 4
      kmall-admin/src/main/resources/mybatis/mapper/AdDao.xml
  37. 8 0
      kmall-admin/src/main/resources/mybatis/mapper/AddressDao.xml
  38. 7 0
      kmall-admin/src/main/resources/mybatis/mapper/AttributeDao.xml
  39. 6 0
      kmall-admin/src/main/resources/mybatis/mapper/BrandDao.xml
  40. 8 0
      kmall-admin/src/main/resources/mybatis/mapper/CartDao.xml
  41. 14 7
      kmall-admin/src/main/resources/mybatis/mapper/CategoryDao.xml
  42. 7 0
      kmall-admin/src/main/resources/mybatis/mapper/CollectDao.xml
  43. 9 0
      kmall-admin/src/main/resources/mybatis/mapper/CommentDao.xml
  44. 20 14
      kmall-admin/src/main/resources/mybatis/mapper/CouponDao.xml
  45. 8 0
      kmall-admin/src/main/resources/mybatis/mapper/FootprintDao.xml
  46. 12 5
      kmall-admin/src/main/resources/mybatis/mapper/FreightDao.xml
  47. 19 4
      kmall-admin/src/main/resources/mybatis/mapper/MngChangeDao.xml
  48. 50 11
      kmall-admin/src/main/resources/mybatis/mapper/OrderDao.xml
  49. 9 0
      kmall-admin/src/main/resources/mybatis/mapper/OrderRefundDao.xml
  50. 9 0
      kmall-admin/src/main/resources/mybatis/mapper/ProductStoreRelaDao.xml
  51. 8 0
      kmall-admin/src/main/resources/mybatis/mapper/SearchHistoryDao.xml
  52. 6 0
      kmall-admin/src/main/resources/mybatis/mapper/StoreDao.xml
  53. 18 4
      kmall-admin/src/main/resources/mybatis/mapper/StoreMngChangeDao.xml
  54. 25 6
      kmall-admin/src/main/resources/mybatis/mapper/SupplierDao.xml
  55. 13 4
      kmall-admin/src/main/resources/mybatis/mapper/SysSmsLogDao.xml
  56. 6 1
      kmall-admin/src/main/resources/mybatis/mapper/SysUserDao.xml
  57. 18 10
      kmall-admin/src/main/resources/mybatis/mapper/UserDao.xml
  58. 1 1
      kmall-admin/src/main/webapp/WEB-INF/page/shop/goods.html
  59. 6 1
      kmall-admin/src/main/webapp/WEB-INF/page/shop/supplier.html
  60. 11 4
      kmall-admin/src/main/webapp/WEB-INF/page/sys/user.html
  61. 1 1
      kmall-admin/src/main/webapp/index.html
  62. 3 3
      kmall-admin/src/main/webapp/js/shop/goods.js
  63. 14 1
      kmall-admin/src/main/webapp/js/shop/supplier.js
  64. 71 5
      kmall-admin/src/main/webapp/js/sys/user.js
  65. 1 1
      kmall-admin/src/main/webapp/login.html
  66. 3 2
      kmall-common/src/main/java/com/kmall/common/constant/Dict.java

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

@@ -33,7 +33,7 @@ public class AdController {
     @RequiresPermissions("ad:list")
     public R list(@RequestParam Map<String, Object> params) {
 
-        ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", false);
+        ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", "thirdPartyMerchCode");
 
         //查询列表数据
         Query query = new Query(params);
@@ -97,7 +97,7 @@ public class AdController {
     @RequestMapping("/queryAll")
     public R queryAll(@RequestParam Map<String, Object> params) {
 
-        ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", false);
+        ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", "thirdPartyMerchCode");
 
         List<AdEntity> list = adService.queryList(params);
 

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

@@ -32,7 +32,7 @@ public class AddressController {
     @RequestMapping("/list")
     @RequiresPermissions("address:list")
     public R list(@RequestParam Map<String, Object> params) {
-        ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", false);
+        ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", "thirdPartyMerchCode");
         //查询列表数据
         Query query = new Query(params);
 

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

@@ -32,7 +32,7 @@ public class AttributeController {
     @RequiresPermissions("attribute:list")
     public R list(@RequestParam Map<String, Object> params) {
 
-        ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", false);
+        ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", "thirdPartyMerchCode");
 
         //查询列表数据
         Query query = new Query(params);
@@ -116,7 +116,7 @@ public class AttributeController {
     @RequestMapping("/queryAll")
     public R queryAll(@RequestParam Map<String, Object> params) {
 
-        ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", false);
+        ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", "thirdPartyMerchCode");
 
         List<AttributeEntity> list = attributeService.queryList(params);
 
@@ -126,7 +126,7 @@ public class AttributeController {
     @RequestMapping("/query")
     public R query(@RequestParam Map<String, Object> params) {
 
-        ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", false);
+        ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", "thirdPartyMerchCode");
 
         List<AttributeEntity> list = attributeService.queryList(params);
 

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

@@ -32,7 +32,7 @@ public class BrandController {
     @RequiresPermissions("brand:list")
     public R list(@RequestParam Map<String, Object> params) {
 
-        ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", false);
+        ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", "thirdPartyMerchCode");
 
         //查询列表数据
         Query query = new Query(params);
@@ -117,7 +117,7 @@ public class BrandController {
     @RequestMapping("/queryAll")
     public R queryAll(@RequestParam Map<String, Object> params) {
 
-        ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", false);
+        ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", "thirdPartyMerchCode");
 
         List<BrandEntity> list = brandService.queryList(params);
 

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

@@ -33,7 +33,7 @@ public class CartController {
 	@RequestMapping("/list")
 	@RequiresPermissions("cart:list")
 	public R list(@RequestParam Map<String, Object> params){
-		ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", false);
+		ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", "thirdPartyMerchCode");
 		//查询列表数据
         Query query = new Query(params);
 

+ 7 - 8
kmall-admin/src/main/java/com/kmall/admin/controller/CategoryController.java

@@ -32,8 +32,7 @@ public class CategoryController {
     @RequestMapping("/list")
     @RequiresPermissions("category:list")
     public R list(@RequestParam Map<String, Object> params) {
-        ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", false);
-
+        ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", "thirdPartyMerchCode");
         //查询列表数据
         Query query = new Query(params);
 
@@ -95,7 +94,7 @@ public class CategoryController {
     @RequestMapping("/queryAll")
     public R queryAll(@RequestParam Map<String, Object> params) {
 
-        ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", false);
+        ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", "thirdPartyMerchCode");
 
         List<CategoryEntity> list = categoryService.queryList(params);
         //添加顶级菜单
@@ -115,7 +114,7 @@ public class CategoryController {
     public R getAreaTree() {
 
         Map<String, Object> map = new HashMap<>();
-        ParamUtils.setQueryPowerByRoleType(map, "storeId", "merchSn", false);
+        ParamUtils.setQueryPowerByRoleType(map, "storeId", "merchSn", "thirdPartyMerchCode");
 
         List<CategoryEntity> list = categoryService.queryList(map);
         for (CategoryEntity sysRegionEntity : list) {
@@ -135,7 +134,7 @@ public class CategoryController {
     @RequestMapping("/getCategorySelect")
     public R getCategorySelect(@RequestParam Map<String, Object> map) {
         map.put("parentId", "0");
-        ParamUtils.setQueryPowerByRoleType(map, "storeId", "merchSn", false);
+        ParamUtils.setQueryPowerByRoleType(map, "storeId", "merchSn", "thirdPartyMerchCode");
         List<CategoryEntity> list = categoryService.queryList(map);
         return R.ok().put("list", list);
     }
@@ -150,7 +149,7 @@ public class CategoryController {
         String parentId = map.get("parentId").toString();
         List<CategoryEntity> list = new ArrayList<>();
         if (StringUtils.isNotEmpty(parentId)) {
-            ParamUtils.setQueryPowerByRoleType(map, "storeId", "merchSn", false);
+            ParamUtils.setQueryPowerByRoleType(map, "storeId", "merchSn", "thirdPartyMerchCode");
 
             list = categoryService.queryList(map);
         }
@@ -161,7 +160,7 @@ public class CategoryController {
     @RequestMapping("/query")
     public R query(@RequestParam Map<String, Object> params) {
 
-        ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", false);
+        ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", "thirdPartyMerchCode");
 
         params.put("isShow", 1);
         List<CategoryEntity> list = categoryService.queryList(params);
@@ -177,7 +176,7 @@ public class CategoryController {
 
     @RequestMapping("/getCategory")
     public R getCategory(@RequestParam Map<String, Object> map) {
-        ParamUtils.setQueryPowerByRoleType(map, "storeId", "merchSn", false);
+        ParamUtils.setQueryPowerByRoleType(map, "storeId", "merchSn", "thirdPartyMerchCode");
 
         List<CategoryEntity> list = categoryService.queryList(map);
         return R.ok().put("list", list);

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

@@ -34,7 +34,7 @@ public class CollectController {
 	@RequiresPermissions("collect:list")
 	public R list(@RequestParam Map<String, Object> params){
 
-		ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", false);
+		ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", "thirdPartyMerchCode");
 		//查询列表数据
         Query query = new Query(params);
 

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

@@ -32,7 +32,25 @@ public class CommentController {
     @RequestMapping("/list")
     @RequiresPermissions("comment:list")
     public R list(@RequestParam Map<String, Object> params) {
-        ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", true);
+        ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", "thirdPartyMerchCode");
+        String valueName = (String) params.get("valueName");
+        if(org.apache.commons.lang3.StringUtils.isNotEmpty(valueName)){
+            try{
+                valueName = new String(valueName.getBytes("iso-8859-1"),"utf-8");
+            }catch (Exception e){
+                e.printStackTrace();
+            }
+            params.put("valueName", valueName);
+        }
+        String userName = (String) params.get("userName");
+        if(org.apache.commons.lang3.StringUtils.isNotEmpty(userName)){
+            try{
+                userName = new String(userName.getBytes("iso-8859-1"),"utf-8");
+            }catch (Exception e){
+                e.printStackTrace();
+            }
+            params.put("userName", userName);
+        }
         //查询列表数据
         Query query = new Query(params);
 

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

@@ -33,7 +33,7 @@ public class CouponController {
     @RequiresPermissions("coupon:list")
     public R list(@RequestParam Map<String, Object> params) {
 
-        ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", false);
+        ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", "thirdPartyMerchCode");
 
         //查询列表数据
         Query query = new Query(params);
@@ -97,7 +97,7 @@ public class CouponController {
     @RequestMapping("/queryAll")
     public R queryAll(@RequestParam Map<String, Object> params) {
 
-        ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", false);
+        ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", "thirdPartyMerchCode");
 
         List<CouponEntity> list = couponService.queryList(params);
 

+ 3 - 10
kmall-admin/src/main/java/com/kmall/admin/controller/ExportExceptionDataController.java

@@ -5,6 +5,7 @@ import java.util.Map;
 
 import com.kmall.admin.entity.ExportExceptionDataEntity;
 import com.kmall.admin.service.ExportExceptionDataService;
+import com.kmall.admin.utils.ParamUtils;
 import com.kmall.common.constant.Dict;
 import com.kmall.admin.fromcomm.entity.SysUserEntity;
 import com.kmall.common.utils.PageUtils;
@@ -36,15 +37,7 @@ public class ExportExceptionDataController {
     @RequiresPermissions("exportexceptiondata:list")
     @ResponseBody
     public R list(@RequestParam Map<String, Object> params) {
-        SysUserEntity user = ShiroUtils.getUserEntity();
-        if (user != null) {
-            if (Dict.roleType.item_2.getItem().equals(user.getRoleType())) {
-                params.put("storeId", user.getStoreId());
-                params.put("merchSn", user.getMerchSn());
-            } else if (Dict.roleType.item_3.getItem().equals(user.getRoleType())) {
-                params.put("merchSn", user.getMerchSn());
-            }
-        }
+        ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", "thirdPartyMerchCode");
         //查询列表数据
         Query query = new Query(params);
 
@@ -74,7 +67,7 @@ public class ExportExceptionDataController {
     @RequestMapping("/queryAll")
     @ResponseBody
     public R queryAll(@RequestParam Map<String, Object> params) {
-
+        ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", "thirdPartyMerchCode");
         List<ExportExceptionDataEntity> list = exportExceptionDataService.queryList(params);
 
         return R.ok().put("list", list);

+ 3 - 10
kmall-admin/src/main/java/com/kmall/admin/controller/FeedbackController.java

@@ -2,6 +2,7 @@ package com.kmall.admin.controller;
 
 import com.kmall.admin.entity.FeedbackEntity;
 import com.kmall.admin.service.FeedbackService;
+import com.kmall.admin.utils.ParamUtils;
 import com.kmall.common.constant.Dict;
 import com.kmall.admin.fromcomm.entity.SysUserEntity;
 import com.kmall.common.utils.PageUtils;
@@ -34,15 +35,7 @@ public class FeedbackController {
     @RequestMapping("/list")
     @RequiresPermissions("feedback:list")
     public R list(@RequestParam Map<String, Object> params) {
-        SysUserEntity user = ShiroUtils.getUserEntity();
-        if (user != null) {
-            if (Dict.roleType.item_2.getItem().equals(user.getRoleType())) {
-                params.put("storeId", user.getStoreId());
-                params.put("merchSn", user.getMerchSn());
-            } else if (Dict.roleType.item_3.getItem().equals(user.getRoleType())) {
-                params.put("merchSn", user.getMerchSn());
-            }
-        }
+        ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", "thirdPartyMerchCode");
         //查询列表数据
         Query query = new Query(params);
 
@@ -103,7 +96,7 @@ public class FeedbackController {
      */
     @RequestMapping("/queryAll")
     public R queryAll(@RequestParam Map<String, Object> params) {
-
+        ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", "thirdPartyMerchCode");
         List<FeedbackEntity> list = feedbackService.queryList(params);
 
         return R.ok().put("list", list);

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

@@ -31,7 +31,7 @@ public class FootprintController {
     @RequestMapping("/list")
     @RequiresPermissions("footprint:list")
     public R list(@RequestParam Map<String, Object> params) {
-        ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", false);
+        ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", "thirdPartyMerchCode");
         //查询列表数据
         Query query = new Query(params);
 
@@ -92,7 +92,7 @@ public class FootprintController {
      */
     @RequestMapping("/queryTotal")
     public R queryTotal(@RequestParam Map<String, Object> params) {
-        ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", false);
+        ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", "thirdPartyMerchCode");
         int hitCount = footprintService.queryTotal(params);
 
         return R.ok().put("hitCount", hitCount);

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

@@ -32,7 +32,7 @@ public class FreightController {
     @RequestMapping("/list")
     @RequiresPermissions("freight:list")
     public R list(@RequestParam Map<String, Object> params) {
-        ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", false);
+        ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", "thirdPartyMerchCode");
         //查询列表数据
         Query query = new Query(params);
 
@@ -135,7 +135,7 @@ public class FreightController {
     @RequestMapping("/queryAll")
     public R queryAll(@RequestParam Map<String, Object> params) {
 
-        ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", false);
+        ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", "thirdPartyMerchCode");
 
         List<FreightEntity> list = freightService.queryList(params);
 

+ 4 - 36
kmall-admin/src/main/java/com/kmall/admin/controller/GoodsController.java

@@ -50,15 +50,7 @@ public class GoodsController {
     @RequestMapping("/list")
     @RequiresPermissions("goods:list")
     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("请维护门店信息中的第三方商户编号信息!再进行商品查看");
-            }
-        }
+        ParamUtils.setQueryPowerByRoleType(params, null, "merchSn", "thirdPartyMerchCode");
         String goodsName = (String) params.get("name");
         if(org.apache.commons.lang3.StringUtils.isNotEmpty(goodsName)){
             try{
@@ -134,15 +126,7 @@ 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("请维护门店信息中的第三方商户编号信息!再进行商品查看");
-            }
-        }
+        ParamUtils.setQueryPowerByRoleType(params, null, "merchSn", "thirdPartyMerchCode");
         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);
@@ -158,15 +142,7 @@ public class GoodsController {
      */
     @RequestMapping("/historyList")
     public R historyList(@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("请维护门店信息中的第三方商户编号信息!再进行商品查看");
-            }
-        }
+        ParamUtils.setQueryPowerByRoleType(params, null, "merchSn", "thirdPartyMerchCode");
         //查询列表数据
         Query query = new Query(params);
 
@@ -195,15 +171,7 @@ public class GoodsController {
      */
     @RequestMapping("/queryTotal")
     public R queryTotal(@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("请维护门店信息中的第三方商户编号信息!再进行商品查看");
-            }
-        }
+        ParamUtils.setQueryPowerByRoleType(params, null, "merchSn", "thirdPartyMerchCode");
         params.put("isDelete", 0);
         int sum = goodsService.queryTotal(params);
         return R.ok().put("goodsSum", sum);

+ 3 - 10
kmall-admin/src/main/java/com/kmall/admin/controller/GoodsIssueController.java

@@ -3,6 +3,7 @@ package com.kmall.admin.controller;
 import com.google.common.collect.ImmutableBiMap;
 import com.kmall.admin.entity.GoodsIssueEntity;
 import com.kmall.admin.service.GoodsIssueService;
+import com.kmall.admin.utils.ParamUtils;
 import com.kmall.admin.utils.ShiroUtils;
 import com.kmall.common.constant.Dict;
 import com.kmall.admin.fromcomm.entity.SysUserEntity;
@@ -33,15 +34,7 @@ public class GoodsIssueController {
     @RequestMapping("/list")
     @RequiresPermissions("goodsissue:list")
     public R list(@RequestParam Map<String, Object> params) {
-        SysUserEntity user = ShiroUtils.getUserEntity();
-        if (user != null) {
-            if (Dict.roleType.item_2.getItem().equals(user.getRoleType())) {
-                params.put("storeId", user.getStoreId());
-                params.put("merchSn", user.getMerchSn());
-            } else if (Dict.roleType.item_3.getItem().equals(user.getRoleType())) {
-                params.put("merchSn", user.getMerchSn());
-            }
-        }
+        ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", "thirdPartyMerchCode");
         //查询列表数据
         Query query = new Query(params);
         List<GoodsIssueEntity> goodsIssueList = goodsIssueService.queryList(query);
@@ -117,7 +110,7 @@ public class GoodsIssueController {
      */
     @RequestMapping("/queryAll")
     public R queryAll(@RequestParam Map<String, Object> params) {
-
+        ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", "thirdPartyMerchCode");
         List<GoodsIssueEntity> list = goodsIssueService.queryList(params);
 
         return R.ok().put("list", list);

+ 3 - 10
kmall-admin/src/main/java/com/kmall/admin/controller/HelpIssueController.java

@@ -3,6 +3,7 @@ package com.kmall.admin.controller;
 import com.google.common.collect.ImmutableBiMap;
 import com.kmall.admin.entity.HelpIssueEntity;
 import com.kmall.admin.service.HelpIssueService;
+import com.kmall.admin.utils.ParamUtils;
 import com.kmall.admin.utils.ShiroUtils;
 import com.kmall.common.constant.Dict;
 import com.kmall.admin.fromcomm.entity.SysUserEntity;
@@ -35,15 +36,7 @@ public class HelpIssueController {
     @RequiresPermissions("helpissue:list")
     @ResponseBody
     public R list(@RequestParam Map<String, Object> params) {
-        SysUserEntity user = ShiroUtils.getUserEntity();
-        if (user != null) {
-            if (Dict.roleType.item_2.getItem().equals(user.getRoleType())) {
-                params.put("storeId", user.getStoreId());
-                params.put("merchSn", user.getMerchSn());
-            } else if (Dict.roleType.item_3.getItem().equals(user.getRoleType())) {
-                params.put("merchSn", user.getMerchSn());
-            }
-        }
+        ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", "thirdPartyMerchCode");
         //查询列表数据
         Query query = new Query(params);
 
@@ -127,7 +120,7 @@ public class HelpIssueController {
     @RequestMapping("/queryAll")
     @ResponseBody
     public R queryAll(@RequestParam Map<String, Object> params) {
-
+        ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", "thirdPartyMerchCode");
         List<HelpIssueEntity> list = helpIssueService.queryList(params);
 
         return R.ok().put("list", list);

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

@@ -34,7 +34,7 @@ public class MerchController {
     @RequiresPermissions("merch:list")
     @ResponseBody
     public R list(@RequestParam Map<String, Object> params) {
-        ParamUtils.setQueryPowerByRoleType(params, null, "roleMerchSn", true);
+        ParamUtils.setQueryPowerByRoleType(params, null, "roleMerchSn", null);
 
         //查询列表数据
         Query query = new Query(params);
@@ -102,7 +102,7 @@ public class MerchController {
     @ResponseBody
     public R queryAll(@RequestParam Map<String, Object> params) {
 
-        ParamUtils.setQueryPowerByRoleType(params, null, "roleMerchSn", true);
+        ParamUtils.setQueryPowerByRoleType(params, null, "roleMerchSn", null);
 
         List<MerchEntity> list = merchService.queryList(params);
 

+ 3 - 0
kmall-admin/src/main/java/com/kmall/admin/controller/MngChangeController.java

@@ -5,6 +5,7 @@ import java.util.Map;
 
 import com.kmall.admin.entity.MngChangeEntity;
 import com.kmall.admin.service.MngChangeService;
+import com.kmall.admin.utils.ParamUtils;
 import com.kmall.common.utils.PageUtils;
 import com.kmall.common.utils.Query;
 import com.kmall.common.utils.R;
@@ -33,6 +34,7 @@ public class MngChangeController {
     @RequiresPermissions("mngchange:list")
     @ResponseBody
     public R list(@RequestParam Map<String, Object> params) {
+        ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", "thirdPartyMerchCode");
         //查询列表数据
         Query query = new Query(params);
 
@@ -98,6 +100,7 @@ public class MngChangeController {
     @RequestMapping("/queryAll")
     @ResponseBody
     public R queryAll(@RequestParam Map<String, Object> params) {
+        ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", "thirdPartyMerchCode");
 
         List<MngChangeEntity> list = mngChangeService.queryList(params);
 

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

@@ -66,7 +66,7 @@ public class OrderController {
     @RequestMapping("/list")
     @RequiresPermissions("order:list")
     public R list(@RequestParam Map<String, Object> params) {
-        ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", false);
+        ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", "thirdPartyMerchCode");
         //查询列表数据
         Query query = new Query(params);
         query.put("isOnfiilineOrder", Dict.isOnfflineOrder.item_0.getItem());
@@ -155,7 +155,7 @@ public class OrderController {
      */
     @RequestMapping("/queryAll")
     public R queryAll(@RequestParam Map<String, Object> params) {
-        ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", false);
+        ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", "thirdPartyMerchCode");
         List<OrderEntity> list = orderService.queryList(params);
 
         return R.ok().put("list", list);
@@ -166,7 +166,7 @@ public class OrderController {
      */
     @RequestMapping("/queryTotal")
     public R queryTotal(@RequestParam Map<String, Object> params) {
-        ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", false);
+        ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", "thirdPartyMerchCode");
         int sum = orderService.queryTotal(params);
 
         return R.ok().put("sum", sum);
@@ -543,7 +543,7 @@ public class OrderController {
      */
     @RequestMapping("/getUserOrderInfo")
     public R getUserOrderInfo(@RequestParam Map<String, Object> params) {
-        ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", false);
+        ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", "thirdPartyMerchCode");
         int result = orderService.getUserOrderInfo(params);
 
         return R.ok().put("result", result);
@@ -583,7 +583,7 @@ public class OrderController {
     @RequestMapping("/offilineOrderList")
     @RequiresPermissions("order:offilineOrderList")
     public R offilineOrderList(@RequestParam Map<String, Object> params) {
-        ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", false);
+        ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", "thirdPartyMerchCode");
         //查询列表数据
         Query query = new Query(params);
         query.put("isOnfiilineOrder", Dict.isOnfflineOrder.item_1.getItem());
@@ -702,7 +702,7 @@ public class OrderController {
     @RequiresPermissions(value = {"order:export"})
     @RequestMapping(value = "export")
     public Object export(@RequestParam Map<String, Object> params, HttpServletResponse response, HttpServletRequest request) {
-        ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", false);
+        ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", "thirdPartyMerchCode");
         //查询列表数据
         params.put("isOnfiilineOrder", Dict.isOnfflineOrder.item_0.getItem());
 

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

@@ -39,7 +39,7 @@ public class OrderRefundController {
     @RequiresPermissions("orderrefund:list")
     @ResponseBody
     public R list(@RequestParam Map<String, Object> params) {
-        ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", false);
+        ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", "thirdPartyMerchCode");
         //查询列表数据
         Query query = new Query(params);
 
@@ -116,7 +116,7 @@ public class OrderRefundController {
     @RequestMapping("/queryAll")
     @ResponseBody
     public R queryAll(@RequestParam Map<String, Object> params) {
-        ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", false);
+        ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", "thirdPartyMerchCode");
         List<OrderRefundEntity> list = orderRefundService.queryList(params);
 
         return R.ok().put("list", list);

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

@@ -41,7 +41,7 @@ public class ProductStoreRelaController {
     @RequestMapping("/list")
     @ResponseBody
     public R list(@RequestParam Map<String, Object> params) {
-        ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", false);
+        ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", "thirdPartyMerchCode");
         String goodsName = (String) params.get("goodsName");
         if(org.apache.commons.lang3.StringUtils.isNotEmpty(goodsName)){
             try{
@@ -152,7 +152,7 @@ public class ProductStoreRelaController {
     @RequestMapping("/queryAll")
     @ResponseBody
     public R queryAll(@RequestParam Map<String, Object> params) {
-        ParamUtils.setQueryPowerByRoleType(params, "id", "merchSn", false);
+        ParamUtils.setQueryPowerByRoleType(params, "id", "merchSn", "thirdPartyMerchCode");
 
         List<ProductStoreRelaEntity> list = productStoreRelaService.queryList(params);
 

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

@@ -31,7 +31,7 @@ public class SearchHistoryController {
     @RequestMapping("/list")
     @RequiresPermissions("searchhistory:list")
     public R list(@RequestParam Map<String, Object> params) {
-        ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", false);
+        ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", "thirdPartyMerchCode");
         //查询列表数据
         Query query = new Query(params);
 

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

@@ -58,7 +58,7 @@ public class StoreController {
     @ResponseBody
     public R list(@RequestParam Map<String, Object> params) {
 
-        ParamUtils.setQueryPowerByRoleType(params, "id", "merchSn", false);
+        ParamUtils.setQueryPowerByRoleType(params, "id", "merchSn", "thirdPartyMerchCode");
 
         String storeName = (String) params.get("storeName");
         if(org.apache.commons.lang3.StringUtils.isNotEmpty(storeName)){
@@ -174,7 +174,7 @@ public class StoreController {
     @ResponseBody
     public R queryAll(@RequestParam Map<String, Object> params) {
 
-        ParamUtils.setQueryPowerByRoleType(params, "id", "merchSn", false);
+        ParamUtils.setQueryPowerByRoleType(params, "id", "merchSn", "thirdPartyMerchCode");
 
         List<StoreEntity> list = storeService.queryList(params);
 
@@ -189,7 +189,20 @@ public class StoreController {
     @ResponseBody
     public R getStoresByMerch(@RequestParam Map<String, Object> params) {
 
-        ParamUtils.setQueryPowerByRoleType(params, "id", "merchSn", false);
+        ParamUtils.setQueryPowerByRoleType(params, "id", "merchSn", "thirdPartyMerchCode");
+
+        List<StoreEntity> list = storeService.queryList(params);
+        return R.ok().put("list", list);
+    }
+
+    /**
+     * 根据第三方商户查看所有列表
+     */
+    @RequestMapping("/getStoresByThirdMerch")
+    @ResponseBody
+    public R getStoresByThirdMerch(@RequestParam Map<String, Object> params) {
+
+        ParamUtils.setQueryPowerByRoleType(params, "id", "merchSn", "thirdPartyMerchCode");
 
         List<StoreEntity> list = storeService.queryList(params);
         return R.ok().put("list", list);

+ 3 - 0
kmall-admin/src/main/java/com/kmall/admin/controller/StoreMngChangeController.java

@@ -5,6 +5,7 @@ import java.util.Map;
 
 import com.kmall.admin.entity.StoreMngChangeEntity;
 import com.kmall.admin.service.StoreMngChangeService;
+import com.kmall.admin.utils.ParamUtils;
 import com.kmall.common.utils.PageUtils;
 import com.kmall.common.utils.Query;
 import com.kmall.common.utils.R;
@@ -33,6 +34,7 @@ public class StoreMngChangeController {
     @RequiresPermissions("storemngchange:list")
     @ResponseBody
     public R list(@RequestParam Map<String, Object> params) {
+        ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", "thirdPartyMerchCode");
         //查询列表数据
         Query query = new Query(params);
 
@@ -98,6 +100,7 @@ public class StoreMngChangeController {
     @RequestMapping("/queryAll")
     @ResponseBody
     public R queryAll(@RequestParam Map<String, Object> params) {
+        ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", "thirdPartyMerchCode");
 
         List<StoreMngChangeEntity> list = storeMngChangeService.queryList(params);
 

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

@@ -34,7 +34,16 @@ public class SupplierController {
     @RequiresPermissions("supplier:list")
     @ResponseBody
     public R list(@RequestParam Map<String, Object> params) {
-        ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", false);
+        ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", "thirdPartyMerchCode");
+        String name = (String) params.get("name");
+        if(org.apache.commons.lang3.StringUtils.isNotEmpty(name)){
+            try{
+                name = new String(name.getBytes("iso-8859-1"),"utf-8");
+            }catch (Exception e){
+                e.printStackTrace();
+            }
+            params.put("name", name);
+        }
         //查询列表数据
         Query query = new Query(params);
 
@@ -99,7 +108,7 @@ public class SupplierController {
     @RequestMapping("/queryAll")
     @ResponseBody
     public R queryAll(@RequestParam Map<String, Object> params) {
-        ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", false);
+        ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", "thirdPartyMerchCode");
         List<SupplierEntity> list = supplierService.queryList(params);
 
         return R.ok().put("list", list);

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

@@ -107,6 +107,8 @@ public class SysOssController {
         if (file.isEmpty()) {
             throw new RRException("上传文件不能为空");
         }
+//        String name = file.getOriginalFilename();
+//        Thumbnails.of(name).size(200, 200).keepAspectRatio(false).allowOverwrite(true).toFile(name);
         //上传文件
         String url = FileManager.upload(file);
 

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

@@ -38,7 +38,7 @@ public class SysSmsLogController {
     @ResponseBody
     public R list(@RequestParam Map<String, Object> params) {
 
-        ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", false);
+        ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", "thirdPartyMerchCode");
 
         //查询列表数据
         Query query = new Query(params);
@@ -106,7 +106,7 @@ public class SysSmsLogController {
     @ResponseBody
     public R queryAll(@RequestParam Map<String, Object> params) {
 
-        ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", false);
+        ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", "thirdPartyMerchCode");
 
         List<SysSmsLogEntity> list = smsLogService.queryList(params);
 

+ 8 - 22
kmall-admin/src/main/java/com/kmall/admin/controller/ThirdMerchantBizController.java

@@ -33,6 +33,8 @@ public class ThirdMerchantBizController {
     private ThirdMerchantBizService thirdMerchantBizService;
     @Autowired
     private StoreService storeService;
+    private String  ISO = "iso-8859-1";
+    private String  UTF = "utf-8";
 
     /**
      * 查看列表
@@ -41,24 +43,16 @@ public class ThirdMerchantBizController {
     @RequiresPermissions("thirdmerchantbiz:list")
     @ResponseBody
     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("请维护门店信息中的第三方商户编号信息!再进行商品查看");
-            }
-        }
+        ParamUtils.setQueryPowerByRoleType(params, null, "merchSn", "thirdPartyMerchCode");
 
-        String goodsName = (String) params.get("name");
-        if(org.apache.commons.lang3.StringUtils.isNotEmpty(goodsName)){
+        String thirdPartyName = (String) params.get("name");
+        if(org.apache.commons.lang3.StringUtils.isNotEmpty(thirdPartyName)){
             try{
-                goodsName = new String(goodsName.getBytes("iso-8859-1"),"utf-8");
+                thirdPartyName = new String(thirdPartyName.getBytes(ISO), UTF);
             }catch (Exception e){
                 e.printStackTrace();
             }
-            params.put("name", goodsName);
+            params.put("name", thirdPartyName);
         }
         //查询列表数据
         Query query = new Query(params);
@@ -172,15 +166,7 @@ public class ThirdMerchantBizController {
     @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("请维护门店信息中的第三方商户编号信息!再进行商品查看");
-            }
-        }
+        ParamUtils.setQueryPowerByRoleType(params, null, "merchSn", "thirdPartyMerchCode");
         List<ThirdMerchantBizEntity> list = thirdMerchantBizService.queryList(params);
 
         return R.ok().put("list", list);

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

@@ -37,7 +37,7 @@ public class UserController {
     @RequiresPermissions("user:list")
     public R list(@RequestParam Map<String, Object> params) {
 
-        ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", false);
+        ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", "thirdPartyMerchCode");
         //查询列表数据
         Query query = new Query(params);
 
@@ -110,7 +110,7 @@ public class UserController {
      */
     @RequestMapping("/queryTotal")
     public R queryTotal(@RequestParam Map<String, Object> params) {
-        ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", false);
+        ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", "thirdPartyMerchCode");
         int sum = userService.queryTotal(params);
 
         return R.ok().put("userSum", sum);

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

@@ -45,6 +45,16 @@ public class CouponEntity implements Serializable {
 
     private String merchSn;
 
+    private String thirdPartyMerchCode;
+
+    public String getThirdPartyMerchCode() {
+        return thirdPartyMerchCode;
+    }
+
+    public void setThirdPartyMerchCode(String thirdPartyMerchCode) {
+        this.thirdPartyMerchCode = thirdPartyMerchCode;
+    }
+
     public Integer getStoreId() {
         return storeId;
     }

+ 9 - 0
kmall-admin/src/main/java/com/kmall/admin/entity/OrderRefundEntity.java

@@ -149,6 +149,15 @@ public class OrderRefundEntity implements Serializable {
     private String rate;
 
     private String isOnfflineOrder;
+    private String thirdPartyMerchCode;
+
+    public String getThirdPartyMerchCode() {
+        return thirdPartyMerchCode;
+    }
+
+    public void setThirdPartyMerchCode(String thirdPartyMerchCode) {
+        this.thirdPartyMerchCode = thirdPartyMerchCode;
+    }
 
     public String getIsOnfflineOrder() {
         return isOnfflineOrder;

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

@@ -43,6 +43,16 @@ public class SupplierEntity implements Serializable {
      */
     private String isShow;
 
+    private String thirdPartyMerchCode;
+
+    public String getThirdPartyMerchCode() {
+        return thirdPartyMerchCode;
+    }
+
+    public void setThirdPartyMerchCode(String thirdPartyMerchCode) {
+        this.thirdPartyMerchCode = thirdPartyMerchCode;
+    }
+
     /**
      * 设置:主键
      */

+ 22 - 0
kmall-admin/src/main/java/com/kmall/admin/fromcomm/entity/SysUserEntity.java

@@ -87,6 +87,28 @@ public class SysUserEntity
     private String roleType;
 
     private Set<String> permsSet;
+    /**
+     * 第三方商户代码
+     */
+    private String thirdPartyMerchCode;
+
+    private String storeName;
+
+    public String getStoreName() {
+        return storeName;
+    }
+
+    public void setStoreName(String storeName) {
+        this.storeName = storeName;
+    }
+
+    public String getThirdPartyMerchCode() {
+        return thirdPartyMerchCode;
+    }
+
+    public void setThirdPartyMerchCode(String thirdPartyMerchCode) {
+        this.thirdPartyMerchCode = thirdPartyMerchCode;
+    }
 
     public String getMerchName() {
         return merchName;

+ 21 - 4
kmall-admin/src/main/java/com/kmall/admin/fromcomm/service/impl/SysUserServiceImpl.java

@@ -7,6 +7,7 @@ import com.kmall.admin.fromcomm.entity.SysUserEntity;
 import com.kmall.admin.fromcomm.service.SysRoleService;
 import com.kmall.admin.fromcomm.service.SysUserRoleService;
 import com.kmall.admin.fromcomm.service.SysUserService;
+import com.kmall.common.constant.Dict;
 import com.kmall.common.utils.*;
 import org.apache.commons.lang.StringUtils;
 import org.apache.shiro.crypto.hash.Sha256Hash;
@@ -83,11 +84,19 @@ public class SysUserServiceImpl implements SysUserService {
         if (Integer.valueOf(r.get("code").toString()) != 0) {
             throw new RRException(r.get("msg").toString());
         } else {
-            if ("2".equals(user.getRoleType())) {
+            if (Dict.roleType.item_2.getItem().equalsIgnoreCase(user.getRoleType())) {
                 builder.put("merchSn", "商户");
+                builder.put("thirdPartyMerchCode", "第三方商户");
                 builder.put("storeId", "门店");
-            }else if ("3".equals(user.getRoleType())) {
+            }else if (Dict.roleType.item_3.getItem().equalsIgnoreCase(user.getRoleType())) {
                 builder.put("merchSn", "商户");
+            }else if (Dict.roleType.item_4.getItem().equalsIgnoreCase(user.getRoleType())) {
+                builder.put("merchSn", "商户");
+                builder.put("thirdPartyMerchCode", "第三方商户");
+            }else if (Dict.roleType.item_1.getItem().equalsIgnoreCase(user.getRoleType())) {
+                user.setMerchSn(null);
+                user.setThirdPartyMerchCode(null);
+                user.setStoreId(null);
             }
             r = ValidatorUtil.isEmpty(builder.build(), valideDate);
             if (Integer.valueOf(r.get("code").toString()) != 0) {
@@ -130,11 +139,19 @@ public class SysUserServiceImpl implements SysUserService {
         if (Integer.valueOf(r.get("code").toString()) != 0) {
             throw new RRException(r.get("msg").toString());
         } else {
-            if ("2".equals(user.getRoleType())) {
+            if (Dict.roleType.item_2.getItem().equalsIgnoreCase(user.getRoleType())) {
                 builder.put("merchSn", "商户");
+                builder.put("thirdPartyMerchCode", "第三方商户");
                 builder.put("storeId", "门店");
-            }else if ("3".equals(user.getRoleType())) {
+            }else if (Dict.roleType.item_3.getItem().equalsIgnoreCase(user.getRoleType())) {
+                builder.put("merchSn", "商户");
+            }else if (Dict.roleType.item_4.getItem().equalsIgnoreCase(user.getRoleType())) {
                 builder.put("merchSn", "商户");
+                builder.put("thirdPartyMerchCode", "第三方商户");
+            }else if (Dict.roleType.item_1.getItem().equalsIgnoreCase(user.getRoleType())) {
+                user.setMerchSn(null);
+                user.setStoreId(null);
+                user.setThirdPartyMerchCode(null);
             }
             r = ValidatorUtil.isEmpty(builder.build(), valideDate);
             if (Integer.valueOf(r.get("code").toString()) != 0) {

+ 25 - 22
kmall-admin/src/main/java/com/kmall/admin/utils/ParamUtils.java

@@ -3,6 +3,7 @@ package com.kmall.admin.utils;
 import com.kmall.common.constant.Dict;
 import com.kmall.admin.fromcomm.entity.SysUserEntity;
 import com.kmall.common.utils.RRException;
+import org.apache.commons.lang3.StringUtils;
 
 import java.util.Map;
 
@@ -17,37 +18,39 @@ public class ParamUtils {
      * @param params   查询参数
      * @param storeKey 当用户是门店时,放入的key,值为门店id
      * @param merchKey 当用户是商户时,放入的key,值为商户编号
-     * @param bothSet  为true时,不管是门店还是商户都只设置storeKey和merchKey中不为null的值
+     * @param thirdMerchKey  当用户是商户时,放入的key,值为第三方商户编号
      */
-    public static void setQueryPowerByRoleType(Map params, String storeKey, String merchKey, boolean bothSet) {
+    public static void setQueryPowerByRoleType(Map params, String storeKey, String merchKey, String thirdMerchKey) {
         SysUserEntity user = ShiroUtils.getUserEntity();
         if (user == null) {
             throw new RRException("用户登录超时,请重新登录");
         }
-
-        if (bothSet) {
-            if (Dict.roleType.item_2.getItem().equals(user.getRoleType()) ||
-                Dict.roleType.item_3.getItem().equals(user.getRoleType())) {
-                if (storeKey == null && merchKey == null) {
-                    throw new RRException("参数错误");
-                }
-
-                if (storeKey != null && merchKey != null) {
-                    throw new RRException("参数错误");
-                }
-
-                if (storeKey != null) {
-                    params.put(storeKey, user.getStoreId());
-                } else if (merchKey != null) {
-                    params.put(merchKey, user.getMerchSn());
-                }
+        if (Dict.roleType.item_2.getItem().equals(user.getRoleType())) {
+            if (storeKey == null) {
+                throw new RRException("参数错误");
+            }
+            if(StringUtils.isNotEmpty(merchKey)){
+                params.put(merchKey, user.getMerchSn());
+            }
+            if(StringUtils.isNotEmpty(thirdMerchKey)){
+                params.put(thirdMerchKey, user.getThirdPartyMerchCode());
             }
-        } else {
-            if (Dict.roleType.item_2.getItem().equals(user.getRoleType())) {
+            if(StringUtils.isNotEmpty(storeKey)){
                 params.put(storeKey, user.getStoreId());
-            } else if (Dict.roleType.item_3.getItem().equals(user.getRoleType())) {
+            }
+        }
+        if (Dict.roleType.item_3.getItem().equals(user.getRoleType())) {
+            if(StringUtils.isNotEmpty(merchKey)){
+                params.put(merchKey, user.getMerchSn());
+            }
+        }
+        if (Dict.roleType.item_4.getItem().equals(user.getRoleType())) {
+            if(StringUtils.isNotEmpty(merchKey)){
                 params.put(merchKey, user.getMerchSn());
             }
+            if(StringUtils.isNotEmpty(thirdMerchKey)){
+                params.put(thirdMerchKey, user.getThirdPartyMerchCode());
+            }
         }
     }
 }

+ 12 - 4
kmall-admin/src/main/resources/mybatis/mapper/AdDao.xml

@@ -52,12 +52,16 @@
         mall_ad.enabled,
         mall_ad_position.name ad_Position_Name
         from mall_ad LEFT JOIN mall_ad_position on mall_ad.ad_position_id = mall_ad_position.id
+        left join mall_store s on mall_ad.store_id = s.id
         where 1=1
         <if test="storeId != null and storeId != ''">
-            AND store_id = #{storeId}
+            AND mall_ad.store_id = #{storeId}
         </if>
         <if test="merchSn != null and merchSn.trim() != ''">
-            AND merch_sn = #{merchSn}
+            AND mall_ad.merch_sn = #{merchSn}
+        </if>
+        <if test="thirdPartyMerchCode != null and thirdPartyMerchCode.trim() != ''">
+            AND s.third_party_merch_code = #{thirdPartyMerchCode}
         </if>
         <if test="name != null and name.trim() != ''">
             AND mall_ad.name LIKE concat('%',#{name},'%')
@@ -77,12 +81,16 @@
 
     <select id="queryTotal" resultType="int">
 		select count(*) from mall_ad
+        left join mall_store s on mall_ad.store_id = s.id
 		WHERE 1=1
         <if test="storeId != null and storeId != ''">
-            AND store_id = #{storeId}
+            AND mall_ad.store_id = #{storeId}
         </if>
         <if test="merchSn != null and merchSn.trim() != ''">
-            AND merch_sn = #{merchSn}
+            AND mall_ad.merch_sn = #{merchSn}
+        </if>
+        <if test="thirdPartyMerchCode != null and thirdPartyMerchCode.trim() != ''">
+            AND s.third_party_merch_code = #{thirdPartyMerchCode}
         </if>
         <if test="name != null and name.trim() != ''">
             AND name LIKE concat('%',#{name},'%')

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

@@ -52,6 +52,7 @@
         from mall_address
         LEFT JOIN mall_user ON mall_address.user_id = mall_user.id
         LEFT JOIN mall_merch_user d ON mall_address.user_id=d.user_id
+        left join mall_store s on d.store_id = s.id
         WHERE 1=1
         <if test="storeId != null">
             and d.store_id = #{storeId}
@@ -59,6 +60,9 @@
         <if test="merchSn != null and merchSn.trim() != ''">
             and d.merch_sn = #{merchSn}
         </if>
+        <if test="thirdPartyMerchCode != null and thirdPartyMerchCode.trim() != ''">
+            AND s.third_party_merch_code = #{thirdPartyMerchCode}
+        </if>
         <if test="userId != null">
             AND mall_address.user_id = #{userId}
         </if>
@@ -85,6 +89,7 @@
         select count(distinct a.id)
         from mall_address a
         LEFT JOIN mall_merch_user d ON a.user_id=d.user_id
+        left join mall_store s on d.store_id = s.id
         where 1=1
         <if test="storeId != null">
             and d.store_id = #{storeId}
@@ -92,6 +97,9 @@
         <if test="merchSn != null and merchSn.trim() != ''">
             and d.merch_sn = #{merchSn}
         </if>
+        <if test="thirdPartyMerchCode != null and thirdPartyMerchCode.trim() != ''">
+            AND s.third_party_merch_code = #{thirdPartyMerchCode}
+        </if>
         <if test="userId != null">
             AND mall_address.user_id = #{userId}
         </if>

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

@@ -54,6 +54,9 @@
         <if test="merchSn != null and merchSn.trim() != ''">
             AND a.merch_sn = #{merchSn}
         </if>
+        <if test="thirdPartyMerchCode != null and thirdPartyMerchCode.trim() != ''">
+            AND s.third_party_merch_code = #{thirdPartyMerchCode}
+        </if>
         <if test="name != null and name.trim() != ''">
             AND a.name LIKE concat('%', #{name},'%')
         </if>
@@ -79,6 +82,7 @@
     <select id="queryTotal" resultType="int">
 		select count(*) 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
         WHERE 1=1
         <if test="storeId != null and storeId != ''">
             AND a.store_id = #{storeId}
@@ -86,6 +90,9 @@
         <if test="merchSn != null and merchSn.trim() != ''">
             AND a.merch_sn = #{merchSn}
         </if>
+        <if test="thirdPartyMerchCode != null and thirdPartyMerchCode.trim() != ''">
+            AND s.third_party_merch_code = #{thirdPartyMerchCode}
+        </if>
         <if test="name != null and name.trim() != ''">
             AND a.name LIKE concat('%', #{name},'%')
         </if>

+ 6 - 0
kmall-admin/src/main/resources/mybatis/mapper/BrandDao.xml

@@ -116,6 +116,9 @@
         <if test="merchSn != null and merchSn.trim() != ''">
             AND b.merch_sn = #{merchSn}
         </if>
+        <if test="thirdPartyMerchCode != null and thirdPartyMerchCode.trim() != ''">
+            AND s.third_party_merch_code = #{thirdPartyMerchCode}
+        </if>
         <if test="name != null and name.trim() != ''">
             AND name LIKE concat('%',#{name},'%')
         </if>
@@ -147,6 +150,9 @@
         <if test="merchSn != null and merchSn.trim() != ''">
             AND b.merch_sn = #{merchSn}
         </if>
+        <if test="thirdPartyMerchCode != null and thirdPartyMerchCode.trim() != ''">
+            AND s.third_party_merch_code = #{thirdPartyMerchCode}
+        </if>
         <if test="name != null and name.trim() != ''">
             AND name LIKE concat('%',#{name},'%')
         </if>

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

@@ -39,6 +39,7 @@
         from mall_cart a
         left join mall_user b on a.user_id = b.id
         LEFT JOIN mall_merch_user d ON a.user_id=d.user_id
+        left join mall_store s on d.store_id = s.id
         where 1=1
         <if test="storeId != null">
             and d.store_id = #{storeId}
@@ -46,6 +47,9 @@
         <if test="merchSn != null and merchSn.trim() != ''">
             and d.merch_sn = #{merchSn}
         </if>
+        <if test="thirdPartyMerchCode != null and thirdPartyMerchCode.trim() != ''">
+            AND s.third_party_merch_code = #{thirdPartyMerchCode}
+        </if>
         <if test="goodsId != null">
             and a.goods_id = #{goodsId}
         </if>
@@ -72,6 +76,7 @@
 		select count(distinct a.id)
         from mall_cart a
         LEFT JOIN mall_merch_user d ON a.user_id=d.user_id
+        left join mall_store s on d.store_id = s.id
         where 1=1
         <if test="storeId != null">
             and d.store_id = #{storeId}
@@ -85,6 +90,9 @@
         <if test="userId != null">
             AND mall_cart.user_id = #{userId}
         </if>
+        <if test="thirdPartyMerchCode != null and thirdPartyMerchCode.trim() != ''">
+            AND s.third_party_merch_code = #{thirdPartyMerchCode}
+        </if>
 	</select>
 
     <insert id="save" parameterType="com.kmall.admin.entity.CartEntity" useGeneratedKeys="true" keyProperty="id">

+ 14 - 7
kmall-admin/src/main/resources/mybatis/mapper/CategoryDao.xml

@@ -112,6 +112,9 @@
 		<if test="merchSn != null and merchSn.trim() != ''">
 			AND b.merch_sn = #{merchSn}
 		</if>
+		<if test="thirdPartyMerchCode != null and thirdPartyMerchCode.trim() != ''">
+			AND s.third_party_merch_code = #{thirdPartyMerchCode}
+		</if>
 		<if test="name != null and name.trim() != ''">
 			AND b.name LIKE concat('%',#{name},'%')
 		</if>
@@ -138,25 +141,29 @@
 	</select>
 	
  	<select id="queryTotal" resultType="int">
-		select count(*) from mall_category
+		select count(*) from mall_category b
+		left join mall_store s on b.store_id = s.id
 		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="thirdPartyMerchCode != null and thirdPartyMerchCode.trim() != ''">
+			AND s.third_party_merch_code = #{thirdPartyMerchCode}
 		</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}
+			AND b.`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}
+			AND b.`parent_id` != #{isL2}
 		</if>
 	</select>
 	 

+ 7 - 0
kmall-admin/src/main/resources/mybatis/mapper/CollectDao.xml

@@ -33,6 +33,9 @@
         <if test="merchSn != null and merchSn.trim() != ''">
             and d.merch_sn = #{merchSn}
         </if>
+        <if test="thirdPartyMerchCode != null and thirdPartyMerchCode.trim() != ''">
+            AND c.third_party_merch_code = #{thirdPartyMerchCode}
+        </if>
         <if test="name != null and name != ''">
             AND b.username LIKE concat('%',#{name},'%')
         </if>
@@ -52,6 +55,7 @@
     <select id="queryTotal" resultType="int">
 		select count(distinct a.id) from mall_collect a
         left join mall_user b on a.user_id = b.id
+        left join mall_goods c on a.value_id = c.id
         LEFT JOIN mall_merch_user d ON a.user_id=d.user_id
         WHERE 1=1
         <if test="storeId != null">
@@ -60,6 +64,9 @@
         <if test="merchSn != null and merchSn.trim() != ''">
             and d.merch_sn = #{merchSn}
         </if>
+        <if test="thirdPartyMerchCode != null and thirdPartyMerchCode.trim() != ''">
+            AND c.third_party_merch_code = #{thirdPartyMerchCode}
+        </if>
         <if test="name != null and name != ''">
             AND b.username LIKE concat('%',#{name},'%')
         </if>

+ 9 - 0
kmall-admin/src/main/resources/mybatis/mapper/CommentDao.xml

@@ -58,6 +58,7 @@
         from mall_comment LEFT JOIN mall_user ON mall_comment.user_id = mall_user.id
         LEFT JOIN mall_goods ON mall_comment.value_id = mall_goods.id
         left join mall_order o on mall_comment.order_id = o.id
+        left join mall_store s on o.store_id = s.id
         WHERE 1=1
         <if test="userName != null and userName.trim() != ''">
             AND mall_user.username LIKE concat('%',#{userName},'%')
@@ -68,6 +69,9 @@
         <if test="storeId != null and storeId != ''">
             AND o.store_id = #{storeId}
         </if>
+        <if test="thirdPartyMerchCode != null and thirdPartyMerchCode.trim() != ''">
+            AND s.third_party_merch_code = #{thirdPartyMerchCode}
+        </if>
         <if test="status != null">
             AND mall_comment.status = #{status}
         </if>
@@ -93,6 +97,8 @@
     <select id="queryTotal" resultType="int">
         select count(*) from mall_comment LEFT JOIN mall_user ON mall_comment.user_id = mall_user.id
         LEFT JOIN mall_goods ON mall_comment.value_id = mall_goods.id
+        left join mall_order o on mall_comment.order_id = o.id
+        left join mall_store s on o.store_id = s.id
         WHERE 1=1
         <if test="userName != null and userName.trim() != ''">
             AND mall_user.username LIKE concat('%',#{userName},'%')
@@ -100,6 +106,9 @@
         <if test="valueName != null and valueName.trim() != ''">
             AND mall_goods.name LIKE concat('%',#{valueName},'%')
         </if>
+        <if test="thirdPartyMerchCode != null and thirdPartyMerchCode.trim() != ''">
+            AND s.third_party_merch_code = #{thirdPartyMerchCode}
+        </if>
         <if test="status != null">
             AND mall_comment.status = #{status}
         </if>

+ 20 - 14
kmall-admin/src/main/resources/mybatis/mapper/CouponDao.xml

@@ -18,6 +18,7 @@
         <result property="useEndDate" column="use_end_date"/>
         <result property="minGoodsAmount" column="min_goods_amount"/>
         <result property="isAll" column="is_all"/>
+        <result property="thirdPartyMerchCode" column="thirdPartyMerchCode"/>
     </resultMap>
 
     <sql id="conditions">
@@ -32,6 +33,9 @@
             <if test="merchSn != null and merchSn.trim() != ''">
                 AND (a.merch_sn = #{merchSn} OR a.is_all = 1)
             </if>
+            <if test="thirdPartyMerchCode != null and thirdPartyMerchCode.trim() != ''">
+                AND s.third_party_merch_code = #{thirdPartyMerchCode}
+            </if>
         </where>
     </sql>
 
@@ -57,21 +61,22 @@
 
     <select id="queryList" resultType="com.kmall.admin.entity.CouponEntity">
         select
-        `id`,
-        `name`,
-        `store_id`,
-        `merch_sn`,
-        `type_money`,
-        `send_type`,
-        `min_amount`,
-        `max_amount`,
-        `send_start_date`,
-        `send_end_date`,
-        `use_start_date`,
-        `use_end_date`,
-        `min_goods_amount`,
-        `is_all`
+        a.`id`,
+        a.`name`,
+        a.`store_id`,
+        a.`merch_sn`,
+        a.`type_money`,
+        a.`send_type`,
+        a.`min_amount`,
+        a.`max_amount`,
+        a.`send_start_date`,
+        a.`send_end_date`,
+        a.`use_start_date`,
+        a.`use_end_date`,
+        a.`min_goods_amount`,
+        a.`is_all`
         from mall_coupon a
+        left join mall_store s on a.store_id = s.id
         <include refid="conditions"/>
         <choose>
             <when test="sidx != null and sidx.trim() != ''">
@@ -88,6 +93,7 @@
 
     <select id="queryTotal" resultType="int">
 		select count(*) from mall_coupon a
+        left join mall_store s on a.store_id = s.id
         <include refid="conditions"/>
 	</select>
 

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

@@ -24,7 +24,11 @@
         left join mall_user b on a.user_id = b.id
         left join mall_goods c on a.goods_id = c.id
         LEFT JOIN mall_merch_user d ON a.user_id=d.user_id
+        left join mall_store s on d.store_id = s.id
         WHERE 1=1
+        <if test="thirdPartyMerchCode != null and thirdPartyMerchCode.trim() != ''">
+            AND s.third_party_merch_code = #{thirdPartyMerchCode}
+        </if>
         <if test="storeId != null">
             and d.store_id = #{storeId}
         </if>
@@ -51,7 +55,11 @@
 		select count(distinct a.id) from mall_footprint a
         left join mall_user b on a.user_id = b.id
         LEFT JOIN mall_merch_user d ON a.user_id=d.user_id
+        left join mall_store s on d.store_id = s.id
         WHERE 1=1
+        <if test="thirdPartyMerchCode != null and thirdPartyMerchCode.trim() != ''">
+            AND s.third_party_merch_code = #{thirdPartyMerchCode}
+        </if>
         <if test="storeId != null">
             and d.store_id = #{storeId}
         </if>

+ 12 - 5
kmall-admin/src/main/resources/mybatis/mapper/FreightDao.xml

@@ -83,6 +83,9 @@
 		<if test="merchSn != null and merchSn.trim() != ''">
 			AND b.merch_sn = #{merchSn}
 		</if>
+		<if test="thirdPartyMerchCode != null and thirdPartyMerchCode.trim() != ''">
+			AND s.third_party_merch_code = #{thirdPartyMerchCode}
+		</if>
 		<if test="name != null and name.trim() != ''">
 			AND b.name LIKE concat('%',#{name},'%')
 		</if>
@@ -140,19 +143,23 @@
 	</select>
 	
  	<select id="queryTotal" resultType="int">
-		select count(*) from mall_freight
+		select count(*) from mall_freight b
+		left join mall_store s on b.store_id = s.id
 		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="thirdPartyMerchCode != null and thirdPartyMerchCode.trim() != ''">
+			AND s.third_party_merch_code = #{thirdPartyMerchCode}
 		</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 NOT LIKE concat('%',#{id},'%')
+			AND b.id NOT LIKE concat('%',#{id},'%')
 		</if>
 	</select>
 	 

+ 19 - 4
kmall-admin/src/main/resources/mybatis/mapper/MngChangeDao.xml

@@ -92,6 +92,9 @@
 		<if test="storeId != null and storeId != ''">
 			AND c.store_id = #{storeId}
 		</if>
+		<if test="thirdPartyMerchCode != null and thirdPartyMerchCode.trim() != ''">
+			AND g.third_party_merch_code = #{thirdPartyMerchCode}
+		</if>
 		<if test="changeType != null and changeType != ''">
 			AND c.change_type = #{changeType}
 		</if>
@@ -109,11 +112,23 @@
 	</select>
 	
  	<select id="queryTotal" resultType="int">
-		select count(*) from mall_mng_change
+		select count(*) from mall_mng_change c left join mall_merch m on c.merch_sn = m.merch_sn
+		left join third_merchant_biz mb on c.third_party_merch_code = mb.third_party_merch_code
+		left join mall_goods g on c.goods_id = g.id
 		WHERE 1=1
-        <if test="name != null and name.trim() != ''">
-            AND name LIKE concat('%',#{name},'%')
-        </if>
+
+		<if test="goodsId != null and goodsId != ''">
+			AND c.goods_id = #{goodsId}
+		</if>
+		<if test="storeId != null and storeId != ''">
+			AND c.store_id = #{storeId}
+		</if>
+		<if test="thirdPartyMerchCode != null and thirdPartyMerchCode.trim() != ''">
+			AND g.third_party_merch_code = #{thirdPartyMerchCode}
+		</if>
+		<if test="changeType != null and changeType != ''">
+			AND c.change_type = #{changeType}
+		</if>
 	</select>
 	 
 	<insert id="save" parameterType="com.kmall.admin.entity.MngChangeEntity">

+ 50 - 11
kmall-admin/src/main/resources/mybatis/mapper/OrderDao.xml

@@ -103,6 +103,7 @@
         mall_order o
         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
+        left join mall_store s on o.store_id = s.id
         WHERE 1=1
         <if test="startTime != null and startTime != ''">
             AND o.add_time <![CDATA[ >  ]]> #{startTime}
@@ -113,6 +114,9 @@
         <if test="storeId != null and storeId != ''">
             AND o.store_id = #{storeId}
         </if>
+        <if test="thirdPartyMerchCode != null and thirdPartyMerchCode.trim() != ''">
+            AND s.third_party_merch_code = #{thirdPartyMerchCode}
+        </if>
         <if test="merchOrderSn != null and merchOrderSn.trim() != ''">
             AND o.merch_order_sn = #{merchOrderSn}
         </if>
@@ -172,6 +176,7 @@
         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
         Left join mall_order_goods g on o.id = g.order_id
+        left join mall_store s on o.store_id = s.id
         WHERE 1=1
         <if test="startTime != null and startTime != ''">
             AND o.add_time <![CDATA[ >  ]]> #{startTime}
@@ -182,6 +187,9 @@
         <if test="storeId != null and storeId != ''">
             AND o.store_id = #{storeId}
         </if>
+        <if test="thirdPartyMerchCode != null and thirdPartyMerchCode.trim() != ''">
+            AND s.third_party_merch_code = #{thirdPartyMerchCode}
+        </if>
         <if test="merchOrderSn != null and merchOrderSn.trim() != ''">
             AND o.merch_order_sn = #{merchOrderSn}
         </if>
@@ -226,7 +234,8 @@
     </select>
 
     <select id="queryTotal" resultType="int">
-        select count(*) from mall_order o WHERE 1=1
+        select count(*) from mall_order o
+        left join mall_store s on o.store_id = s.id WHERE 1=1
         <if test="startTime != null and startTime != ''">
             AND o.add_time <![CDATA[ >  ]]> #{startTime}
         </if>
@@ -236,6 +245,9 @@
         <if test="storeId != null and storeId != ''">
             AND o.store_id = #{storeId}
         </if>
+        <if test="thirdPartyMerchCode != null and thirdPartyMerchCode.trim() != ''">
+            AND s.third_party_merch_code = #{thirdPartyMerchCode}
+        </if>
         <if test="merchOrderSn != null and merchOrderSn.trim() != ''">
             AND o.merch_order_sn = #{merchOrderSn}
         </if>
@@ -278,6 +290,7 @@
         mall_order o
         LEFT JOIN sys_user u ON o.user_id = u.user_id
         LEFT JOIN mall_order_process_record p ON o.order_sn = p.order_sn
+        left join mall_store s on o.store_id = s.id
         WHERE 1=1
         <if test="storeId != null and storeId != ''">
             AND o.store_id = #{storeId}
@@ -285,6 +298,9 @@
         <if test="merchSn != null and merchSn.trim() != ''">
             AND o.merch_sn = #{merchSn}
         </if>
+        <if test="thirdPartyMerchCode != null and thirdPartyMerchCode.trim() != ''">
+            AND s.third_party_merch_code = #{thirdPartyMerchCode}
+        </if>
         <if test="orderSn != null and orderSn.trim() != ''">
             AND o.order_sn LIKE concat('%',#{orderSn},'%')
         </if>
@@ -488,6 +504,7 @@
     <select id="getYfkOrderUserSum" resultType="int">
         select count(1) from (select o.user_id,count(o.user_id) as counts from mall_order o
         inner join mall_merch_user mu on o.user_id=mu.user_id and o.merch_sn=mu.merch_sn and o.store_id=mu.store_id
+        left join mall_store s on o.store_id = s.id
         where pay_status = 2
         <if test="storeId != null and storeId != ''">
             AND o.store_id = #{storeId}
@@ -495,11 +512,15 @@
         <if test="merchSn != null and merchSn.trim() != ''">
             AND o.merch_sn = #{merchSn}
         </if>
+        <if test="thirdPartyMerchCode != null and thirdPartyMerchCode.trim() != ''">
+            AND s.third_party_merch_code = #{thirdPartyMerchCode}
+        </if>
         group by o.user_id) u
     </select>
     <select id="getOderUserSum" resultType="int">
         select count(1) from (select o.user_id,count(o.user_id) as counts from mall_order o
         inner join mall_merch_user mu on o.user_id=mu.user_id and o.merch_sn=mu.merch_sn and o.store_id=mu.store_id
+        left join mall_store s on o.store_id = s.id
         where 1=1
         <if test="storeId != null and storeId != ''">
             AND o.store_id = #{storeId}
@@ -507,44 +528,62 @@
         <if test="merchSn != null and merchSn.trim() != ''">
             AND o.merch_sn = #{merchSn}
         </if>
+        <if test="thirdPartyMerchCode != null and thirdPartyMerchCode.trim() != ''">
+            AND s.third_party_merch_code = #{thirdPartyMerchCode}
+        </if>
         group by o.user_id) u
     </select>
     <select id="getTodayUserOrder" resultType="int">
-        select count(1) from mall_order o where pay_status = 2 and pay_time > date_format(sysdate(), '%Y-%m-%d')
+        select count(1) from mall_order o
+        left join mall_store s on o.store_id = s.id
+        where pay_status = 2 and pay_time > date_format(sysdate(), '%Y-%m-%d')
         <if test="storeId != null and storeId != ''">
             AND o.store_id = #{storeId}
         </if>
         <if test="merchSn != null and merchSn.trim() != ''">
             AND o.merch_sn = #{merchSn}
         </if>
-
+        <if test="thirdPartyMerchCode != null and thirdPartyMerchCode.trim() != ''">
+            AND s.third_party_merch_code = #{thirdPartyMerchCode}
+        </if>
     </select>
     <select id="getTodayUserSales" resultType="int">
-        select ifnull(sum(actual_price),0) from mall_order o where pay_status = 2 and pay_time > date_format(sysdate(), '%Y-%m-%d')
+        select ifnull(sum(o.actual_price),0) from mall_order o
+        left join mall_store s on o.store_id = s.id  where o.pay_status = 2 and o.pay_time > date_format(sysdate(), '%Y-%m-%d')
         <if test="storeId != null and storeId != ''">
             AND o.store_id = #{storeId}
         </if>
         <if test="merchSn != null and merchSn.trim() != ''">
             AND o.merch_sn = #{merchSn}
         </if>
-
+        <if test="thirdPartyMerchCode != null and thirdPartyMerchCode.trim() != ''">
+            AND s.third_party_merch_code = #{thirdPartyMerchCode}
+        </if>
     </select>
     <select id="getIncomeSum" resultType="int">
-        select ifnull(sum(actual_price),0) from mall_order where pay_status = 2
+        select ifnull(sum(actual_price),0) from mall_order o
+        left join mall_store s on o.store_id = s.id where o.pay_status = 2
         <if test="storeId != null and storeId != ''">
-            AND store_id = #{storeId}
+            AND o.store_id = #{storeId}
         </if>
         <if test="merchSn != null and merchSn.trim() != ''">
-            AND merch_sn = #{merchSn}
+            AND o.merch_sn = #{merchSn}
+        </if>
+        <if test="thirdPartyMerchCode != null and thirdPartyMerchCode.trim() != ''">
+            AND s.third_party_merch_code = #{thirdPartyMerchCode}
         </if>
     </select>
     <select id="getPayedOrderCount" resultType="int">
-        select count(1) from mall_order where pay_status = 2 and is_onffline_order = 0
+        select count(1) from mall_order o
+        left join mall_store s on o.store_id = s.id  where o.pay_status = 2 and o.is_onffline_order = 0
         <if test="storeId != null and storeId != ''">
-            AND store_id = #{storeId}
+            AND o.store_id = #{storeId}
         </if>
         <if test="merchSn != null and merchSn.trim() != ''">
-            AND merch_sn = #{merchSn}
+            AND o.merch_sn = #{merchSn}
+        </if>
+        <if test="thirdPartyMerchCode != null and thirdPartyMerchCode.trim() != ''">
+            AND s.third_party_merch_code = #{thirdPartyMerchCode}
         </if>
     </select>
 </mapper>

+ 9 - 0
kmall-admin/src/main/resources/mybatis/mapper/OrderRefundDao.xml

@@ -38,6 +38,7 @@
         <result property="cashRefundFee" column="cash_refund_fee"/>
         <result property="cashRefundFeeType" column="cash_refund_fee_type"/>
         <result property="rate" column="rate"/>
+        <result property="thirdPartyMerchCode" column="thirdPartyMerchCode"/>
     </resultMap>
 
     <select id="queryObject" resultType="com.kmall.admin.entity.OrderRefundEntity">
@@ -96,6 +97,7 @@
         from mall_order_refund r
         left join mall_order o on r.order_id = o.id
         left join mall_user u on o.user_id = u.id
+        left join mall_store s on s.id = o.store_id
         WHERE 1=1
         <if test="orderSn != null and orderSn.trim() != ''">
             AND o.order_sn LIKE concat('%',#{orderSn},'%')
@@ -103,6 +105,9 @@
         <if test="userName != null and userName.trim() != ''">
             AND u.username LIKE concat('%',#{userName},'%')
         </if>
+        <if test="thirdPartyMerchCode != null and thirdPartyMerchCode.trim() != ''">
+            AND s.third_party_merch_code = #{thirdPartyMerchCode}
+        </if>
         <if test="orderId != null">
             AND o.id = #{orderId}
         </if>
@@ -148,6 +153,7 @@
         from mall_order_refund r
         left join mall_order o on r.order_id = o.id
         left join mall_user u on o.user_id = u.id
+        left join mall_store s on s.id = o.store_id
         WHERE 1=1
         <if test="orderSn != null and orderSn.trim() != ''">
             AND o.order_sn LIKE concat('%',#{orderSn},'%')
@@ -155,6 +161,9 @@
         <if test="userName != null and userName.trim() != ''">
             AND u.username LIKE concat('%',#{userName},'%')
         </if>
+        <if test="thirdPartyMerchCode != null and thirdPartyMerchCode.trim() != ''">
+            AND s.third_party_merch_code = #{thirdPartyMerchCode}
+        </if>
         <if test="storeId != null and storeId != ''">
             AND o.store_id = #{storeId}
         </if>

+ 9 - 0
kmall-admin/src/main/resources/mybatis/mapper/ProductStoreRelaDao.xml

@@ -190,6 +190,9 @@
         <if test="merchSn != null and merchSn.trim() != '' ">
             AND a.merch_sn = #{merchSn}
         </if>
+        <if test="thirdPartyMerchCode != null and thirdPartyMerchCode.trim() != ''">
+            AND s.third_party_merch_code = #{thirdPartyMerchCode}
+        </if>
         <if test="goodsId != null">
             AND a.goods_id = #{goodsId}
         </if>
@@ -273,6 +276,9 @@
         <if test="merchSn != null and merchSn.trim() != '' ">
             AND a.merch_sn = #{merchSn}
         </if>
+        <if test="thirdPartyMerchCode != null and thirdPartyMerchCode.trim() != ''">
+            AND s.third_party_merch_code = #{thirdPartyMerchCode}
+        </if>
         <if test="id != null">
             AND a.id != #{id}
         </if>
@@ -316,6 +322,9 @@
         <if test="merchSn != null and merchSn.trim() != '' ">
             AND a.merch_sn = #{merchSn}
         </if>
+        <if test="thirdPartyMerchCode != null and thirdPartyMerchCode.trim() != ''">
+            AND s.third_party_merch_code = #{thirdPartyMerchCode}
+        </if>
         <if test="goodsId != null">
             AND a.goods_id = #{goodsId}
         </if>

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

@@ -22,6 +22,7 @@
         from mall_search_history a
         left join mall_user b on a.user_id = b.id
         LEFT JOIN mall_merch_user d ON a.user_id=d.user_id
+        left join mall_store s on d.store_id = s.id
         where 1=1
         <if test="storeId != null">
             and d.store_id = #{storeId}
@@ -29,6 +30,9 @@
         <if test="merchSn != null and merchSn.trim() != ''">
             and d.merch_sn = #{merchSn}
         </if>
+        <if test="thirdPartyMerchCode != null and thirdPartyMerchCode.trim() != ''">
+            AND s.third_party_merch_code = #{thirdPartyMerchCode}
+        </if>
         <choose>
             <when test="sidx != null and sidx.trim() != ''">
                 order by ${sidx} ${order}
@@ -46,6 +50,7 @@
 		select count(distinct a.id)
 		from mall_search_history a
         LEFT JOIN mall_merch_user d ON a.user_id=d.user_id
+        left join mall_store s on d.store_id = s.id
         where 1=1
         <if test="storeId != null">
             and d.store_id = #{storeId}
@@ -53,6 +58,9 @@
         <if test="merchSn != null and merchSn.trim() != ''">
             and d.merch_sn = #{merchSn}
         </if>
+        <if test="thirdPartyMerchCode != null and thirdPartyMerchCode.trim() != ''">
+            AND s.third_party_merch_code = #{thirdPartyMerchCode}
+        </if>
 	</select>
 
     <insert id="save" parameterType="com.kmall.admin.entity.SearchHistoryEntity" useGeneratedKeys="true" keyProperty="id">

+ 6 - 0
kmall-admin/src/main/resources/mybatis/mapper/StoreDao.xml

@@ -95,6 +95,9 @@
 		<if test="storeNumber != null and storeNumber.trim() != ''">
 			AND storeNumber LIKE concat('%',#{store_number},'%')
 		</if>
+		<if test="thirdPartyMerchCode != null and thirdPartyMerchCode.trim() != ''">
+			AND third_party_merch_code = #{thirdPartyMerchCode}
+		</if>
 		<if test="id != null">
 			AND id = #{id}
 		</if>
@@ -123,6 +126,9 @@
 		<if test="storeNumber != null and storeNumber.trim() != ''">
 			AND storeNumber LIKE concat('%',#{store_number},'%')
 		</if>
+		<if test="thirdPartyMerchCode != null and thirdPartyMerchCode.trim() != ''">
+			AND third_party_merch_code = #{thirdPartyMerchCode}
+		</if>
 		<if test="id != null">
 			AND id = #{id}
 		</if>

+ 18 - 4
kmall-admin/src/main/resources/mybatis/mapper/StoreMngChangeDao.xml

@@ -95,6 +95,9 @@
 		<if test="changeType != null and changeType != ''">
 			AND c.change_type = #{changeType}
 		</if>
+		<if test="thirdPartyMerchCode != null and thirdPartyMerchCode.trim() != ''">
+			AND s.third_party_merch_code = #{thirdPartyMerchCode}
+		</if>
         <choose>
             <when test="sidx != null and sidx.trim() != ''">
                 order by ${sidx} ${order}
@@ -109,11 +112,22 @@
 	</select>
 	
  	<select id="queryTotal" resultType="int">
-		select count(*) from mall_store_mng_change
+		select count(*) from mall_store_mng_change c left join mall_merch m on c.merch_sn = m.merch_sn
+		left join mall_store s on s.id = c.store_id
+		left join mall_goods g on c.goods_id = g.id
 		WHERE 1=1
-        <if test="name != null and name.trim() != ''">
-            AND name LIKE concat('%',#{name},'%')
-        </if>
+		<if test="goodsId != null and goodsId != ''">
+			AND c.goods_id = #{goodsId}
+		</if>
+		<if test="storeId != null and storeId != ''">
+			AND c.store_id = #{storeId}
+		</if>
+		<if test="changeType != null and changeType != ''">
+			AND c.change_type = #{changeType}
+		</if>
+		<if test="thirdPartyMerchCode != null and thirdPartyMerchCode.trim() != ''">
+			AND s.third_party_merch_code = #{thirdPartyMerchCode}
+		</if>
 	</select>
 	 
 	<insert id="save" parameterType="com.kmall.admin.entity.StoreMngChangeEntity">

+ 25 - 6
kmall-admin/src/main/resources/mybatis/mapper/SupplierDao.xml

@@ -11,6 +11,7 @@
         <result property="childSupplierFlag" column="child_supplier_flag"/>
         <result property="sortOrder" column="sort_order"/>
         <result property="isShow" column="is_show"/>
+		<result property="thirdPartyMerchCode" column="third_party_merch_code"/>
     </resultMap>
 
 	<select id="queryObject" resultType="com.kmall.admin.entity.SupplierEntity">
@@ -21,7 +22,8 @@
 			`child_supplier_name`,
 			`child_supplier_flag`,
 			`sort_order`,
-			`is_show`
+			`is_show`,
+			third_party_merch_code
 		from mall_supplier
 		where id = #{id}
 	</select>
@@ -34,12 +36,16 @@
 		`child_supplier_name`,
 		`child_supplier_flag`,
 		`sort_order`,
-		`is_show`
+		`is_show`,
+		third_party_merch_code
 		from mall_supplier
 		where child_supplier_name = #{supplierName}
 		<if test="merchSn != null and merchSn.trim() != ''">
 			AND level_merch_sn = #{merchSn}
 		</if>
+		<if test="thirdPartyMerchCode != null and thirdPartyMerchCode.trim() != ''">
+			AND third_party_merch_code = #{thirdPartyMerchCode}
+		</if>
 	</select>
 
 	<select id="queryList" resultType="com.kmall.admin.entity.SupplierEntity">
@@ -50,12 +56,18 @@
     		`child_supplier_name`,
     		`child_supplier_flag`,
     		`sort_order`,
-    		`is_show`
+    		`is_show`,third_party_merch_code
 		from mall_supplier
 		WHERE 1=1
+		<if test="name != null and name.trim() != ''">
+			AND child_supplier_name like concat('%',#{name},'%')
+		</if>
 		<if test="merchSn != null and merchSn.trim() != ''">
 			AND level_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}
@@ -72,9 +84,15 @@
  	<select id="queryTotal" resultType="int">
 		select count(*) from mall_supplier
 		WHERE 1=1
+		<if test="name != null and name.trim() != ''">
+			AND child_supplier_name like concat('%',#{name},'%')
+		</if>
 		<if test="merchSn != null and merchSn.trim() != ''">
 			AND level_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.SupplierEntity">
@@ -84,14 +102,14 @@
 			`child_supplier_name`,
 			`child_supplier_flag`,
 			`sort_order`,
-			`is_show`)
+			`is_show`,third_party_merch_code)
 		values(
 			#{levelMerchSn},
 			#{levelMerchFlag},
 			#{childSupplierName},
 			#{childSupplierFlag},
 			#{sortOrder},
-			#{isShow})
+			#{isShow},#{thirdPartyMerchCode})
 	</insert>
 	 
 	<update id="update" parameterType="com.kmall.admin.entity.SupplierEntity">
@@ -102,7 +120,8 @@
 			<if test="childSupplierName != null">`child_supplier_name` = #{childSupplierName}, </if>
 			<if test="childSupplierFlag != null">`child_supplier_flag` = #{childSupplierFlag}, </if>
 			<if test="sortOrder != null">`sort_order` = #{sortOrder}, </if>
-			<if test="isShow != null">`is_show` = #{isShow}</if>
+			<if test="isShow != null">`is_show` = #{isShow},</if>
+			<if test="thirdPartyMerchCode != null">`third_party_merch_code` = #{thirdPartyMerchCode}</if>
 		</set>
 		where id = #{id}
 	</update>

+ 13 - 4
kmall-admin/src/main/resources/mybatis/mapper/SysSmsLogDao.xml

@@ -68,13 +68,18 @@
         mall_user.nickname user_name
         from sys_sms_log
         LEFT JOIN mall_user ON mall_user.id = sys_sms_log.user_id
+        left join mall_store s on sys_sms_log.store_id = s.id
         WHERE 1=1
         <if test="storeId != null and storeId != ''">
-            AND store_id = #{storeId}
+            AND sys_sms_log.store_id = #{storeId}
         </if>
         <if test="merchSn != null and merchSn.trim() != ''">
-            AND merch_sn = #{merchSn}
+            AND sys_sms_log.merch_sn = #{merchSn}
         </if>
+        <if test="thirdPartyMerchCode != null and thirdPartyMerchCode.trim() != ''">
+            AND s.third_party_merch_code = #{thirdPartyMerchCode}
+        </if>
+
         <if test="sendId != null and sendId != ''">
             AND sys_sms_log.send_id LIKE concat('%',#{sendId},'%')
         </if>
@@ -93,16 +98,20 @@
 
     <select id="queryTotal" resultType="int">
         select count(*) from sys_sms_log
+        left join mall_store s on sys_sms_log.store_id = s.id
         WHERE 1=1
         <if test="storeId != null and storeId != ''">
-            AND store_id = #{storeId}
+            AND sys_sms_log.store_id = #{storeId}
         </if>
         <if test="merchSn != null and merchSn.trim() != ''">
-            AND merch_sn = #{merchSn}
+            AND sys_sms_log.merch_sn = #{merchSn}
         </if>
         <if test="sendId != null and sendId != ''">
             AND send_id LIKE concat('%',#{sendId},'%')
         </if>
+        <if test="thirdPartyMerchCode != null and thirdPartyMerchCode.trim() != ''">
+            AND s.third_party_merch_code = #{thirdPartyMerchCode}
+        </if>
     </select>
 
     <insert id="save" parameterType="com.kmall.manager.entity.SysSmsLogEntity">

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

@@ -15,11 +15,13 @@
 	<select id="queryList" resultType="com.kmall.admin.fromcomm.entity.SysUserEntity">
 		SELECT
 		u.*,
-		( SELECT d.NAME FROM sys_dept d WHERE d.dept_id = u.dept_id ) deptName,
+		( SELECT d.NAME FROM sys_dept d WHERE d.dept_id = u.dept_id ) deptName,m.merch_name merchName,s.store_name storeName,
 		ur.role_id
 		FROM
 		sys_user u
 		LEFT JOIN sys_user_role ur ON u.user_id = ur.user_id
+		left join mall_merch m on m.merch_sn = u.merch_sn
+		left join mall_store s on s.id = u.store_id
 		<where>
 			<if test="createUserId != null">
 				and `create_user_id` = #{createUserId} 
@@ -88,6 +90,7 @@
 			`dept_id`,
 			`store_id`,
 			`merch_sn`,
+			third_party_merch_code,
 			`role_type`,
 			`create_time`
 		)
@@ -103,6 +106,7 @@
 			#{deptId},
 			#{storeId},
 			#{merchSn},
+			#{thirdPartyMerchCode},
 			#{roleType},
 			#{createTime}
 		)
@@ -118,6 +122,7 @@
 			<if test="deptId != null">`dept_id` = #{deptId}, </if>
 			<if test="storeId != null">`store_id` = #{storeId}, </if>
 			<if test="merchSn != null">`merch_sn` = #{merchSn}, </if>
+			<if test="thirdPartyMerchCode != null">`third_party_merch_code` = #{thirdPartyMerchCode}, </if>
 			<if test="roleType != null">`role_type` = #{roleType}, </if>
 		</set>
 		where user_id = #{userId} 

+ 18 - 10
kmall-admin/src/main/resources/mybatis/mapper/UserDao.xml

@@ -32,20 +32,24 @@
         mall_user.*,
         mall_user_level.name levelName
         from mall_user
-        LEFT JOIN mall_merch_user ON mall_user.id=mall_merch_user.user_id
+        LEFT JOIN mall_merch_user mu ON mall_user.id=mu.user_id
         LEFT JOIN mall_user_level ON mall_user.user_level_id=mall_user_level.id
+        left join mall_store s on mu.store_id = s.id
         WHERE 1=1
-        <if test="storeId != null">
-            and store_id = #{storeId}
+        <if test="storeId != null and storeId != ''">
+            and mu.store_id = #{storeId}
         </if>
         <if test="merchSn != null and merchSn.trim() != ''">
-            and merch_sn = #{merchSn}
+            and mu.merch_sn = #{merchSn}
+        </if>
+        <if test="thirdPartyMerchCode != null and thirdPartyMerchCode.trim() != ''">
+            AND s.third_party_merch_code = #{thirdPartyMerchCode}
         </if>
         <if test="username != null and username.trim() != ''">
-            and username like concat('%',#{username},'%')
+            and mall_user.username like concat('%',#{username},'%')
         </if>
         <if test="mobile != null and mobile.trim() != ''">
-            and mobile like concat('%',#{mobile},'%')
+            and mall_user.mobile like concat('%',#{mobile},'%')
         </if>
         <choose>
             <when test="sidx != null and sidx.trim() != ''">
@@ -62,14 +66,18 @@
 
     <select id="queryTotal" resultType="int">
         select count(distinct mall_user.id) from mall_user
-        LEFT JOIN mall_merch_user ON mall_user.id=mall_merch_user.user_id
+        LEFT JOIN mall_merch_user mu ON mall_user.id=mu.user_id
         LEFT JOIN mall_user_level ON mall_user.user_level_id=mall_user_level.id
+        left join mall_store s on mu.store_id = s.id
         WHERE 1=1
-        <if test="storeId != null">
-            and store_id = #{storeId}
+        <if test="storeId != null and storeId != ''">
+            and mu.store_id = #{storeId}
         </if>
         <if test="merchSn != null and merchSn.trim() != ''">
-            and merch_sn = #{merchSn}
+            and mu.merch_sn = #{merchSn}
+        </if>
+        <if test="thirdPartyMerchCode != null and thirdPartyMerchCode.trim() != ''">
+            AND s.third_party_merch_code = #{thirdPartyMerchCode}
         </if>
         <if test="username != null and username.trim() != ''">
             and username like concat('%',#{username},'%')

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

@@ -161,7 +161,7 @@
                             <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="merchSn">
+                <Form-item label="第三方商户" prop="thirdPartyMerchCode">
                     <i-select v-model="goods.thirdPartyMerchCode" placeholder="第三方商户" @on-change="showStockShare" label-in-value>
                         <i-option v-for="thirdMerchant in thirdMerchantBizList" :value="thirdMerchant.thirdPartyMerchCode" :key="thirdMerchant.thirdPartyMerchCode">{{thirdMerchant.thirdPartyMerchName}}</i-option>
                     </i-select>

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

@@ -35,10 +35,15 @@
         <p slot="title">{{title}}</p>
 		<i-form ref="formValidate" :model="supplier" :rules="ruleValidate" :label-width="150">
             <Form-item label="一级商户编号" prop="levelMerchSn">
-                <i-select v-model="supplier.levelMerchSn" filterable placeholder="一级商户编号" label-in-value>
+                <i-select v-model="supplier.levelMerchSn" 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="merchSn">
+                <i-select v-model="supplier.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="levelMerchFlag">-->
                 <!--<i-input v-model="supplier.levelMerchFlag" placeholder="一级商户标识" readonly/>-->

+ 11 - 4
kmall-admin/src/main/webapp/WEB-INF/page/sys/user.html

@@ -52,19 +52,26 @@
                 </i-select>
             </Form-item>
             <Form-item label="数据角色类型" prop="roleType">
-                <Radio-group v-model="user.roleType">
+                <Radio-group v-model="user.roleType" @on-change="changeRole">
                     <Radio label="1">操作员</Radio>
                     <Radio label="2">店员</Radio>
                     <Radio label="3">商户管理员</Radio>
+                    <Radio label="4">第三方商户管理员</Radio>
                 </Radio-group>
             </Form-item>
-            <Form-item label="商户" prop="merchSn">
+            <Form-item label="商户" prop="merchSn" v-show="isMerchShow">
                 <i-select v-model="user.merchSn" filterable placeholder="商户" @on-change="getStoresByMerch" 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="storeId">
-                <i-select v-model="user.storeId" filterable placeholder="门店" label-in-value>
+            <Form-item label="第三方商户" prop="thirdPartyMerchCode" v-show="isThirdMerchShow">
+                <i-select v-model="user.thirdPartyMerchCode" filterable placeholder="商户" @on-change="getStoresByThirdMerch" 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="storeId" v-show="isStoreShow">
+                <i-select v-model="user.storeId" placeholder="门店" label-in-value>
                     <i-option v-for="store in storeList" :value="store.id" :key="store.id">{{store.storeName}}</i-option>
                 </i-select>
             </Form-item>

+ 1 - 1
kmall-admin/src/main/webapp/index.html

@@ -90,7 +90,7 @@
                     data-id="main" seamless></iframe>
         </div>
         <div class="footer">
-            <div class="pull-right">&copy; 2017-2017 <a href="http://fly2you.cn" target="_blank">中网科技(深圳)有限公司</a>
+            <div class="pull-right">&copy; 2017-2017 <a href="#" target="_blank">中网科技(深圳)有限公司</a>
             </div>
         </div>
     </div>

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

@@ -265,8 +265,8 @@ var vm = new Vue({
                 vm.brands = r.list;
             });
         },*/
-        getSuppliers: function (merchSn) {
-            $.get("../supplier/queryAll?merchSn=" + merchSn, function (r) {
+        getSuppliers: function (thirdMerchantCode) {
+            $.get("../supplier/queryAll?thirdPartyMerchCode=" + thirdMerchantCode, function (r) {
                 vm.suppliers = r.list;
             });
         },
@@ -503,6 +503,7 @@ var vm = new Vue({
                     vm.goods.goodsNumber= '';
                 }
             });
+            vm.getSuppliers(thirdMerchantCode);
         },
         changeGoodsBizType: function(opt) {
             var goodsBizType = opt.value;
@@ -663,7 +664,6 @@ var vm = new Vue({
             // vm.getCategories(merchSn);
             // vm.getFreights(merchSn);
             // vm.getBrand(merchSn);
-            vm.getSuppliers(merchSn);
             vm.getThirdMerchantBizList(merchSn);
         },
         // getCategories: function (merchSn) {

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

@@ -6,6 +6,7 @@ $(function () {
 			{label: 'id', name: 'id', index: 'id', key: true, hidden: true},
 			{label: '一级商户编号', name: 'levelMerchSn', index: 'level_merch_sn', width: 80, align: 'center'},
 			{label: '一级商户标识', name: 'levelMerchFlag', index: 'level_merch_flag', width: 80, align: 'center'},
+            {label: '所属第三方商户', name: 'thirdPartyMerchCode', index: 'thirdPartyMerchCode', width: 80, align: 'center'},
 			{label: '二级供货商名称', name: 'childSupplierName', index: 'child_supplier_sn', width: 80, align: 'center'},
 			{label: '二级供货商标识', name: 'childSupplierFlag', index: 'child_supplier_flag', width: 80, align: 'center'},
 			{label: '排序', name: 'sortOrder', index: 'sort_order', width: 80, align: 'center'},
@@ -57,7 +58,8 @@ let vm = new Vue({
 		q: {
 		    name: ''
 		},
-        merchList: []
+        merchList: [],
+        thirdMerchantBizList: []
 	},
 	methods: {
 		query: function () {
@@ -68,6 +70,7 @@ let vm = new Vue({
 			vm.title = "新增";
 			vm.supplier = {isShow:0};
             vm.merchList = [];
+            vm.thirdMerchantBizList = [];
             vm.getMerchList();
 		},
 		update: function (event) {
@@ -77,10 +80,20 @@ let vm = new Vue({
 			}
 			vm.showList = false;
             vm.title = "修改";
+            vm.thirdMerchantBizList = [];
 
             vm.getInfo(id);
             vm.getMerchList();
 		},
+        showMerchInfo:function(opt){
+            var merchSn = opt.value;
+            vm.getThirdMerchantBizList(merchSn);
+        },
+        getThirdMerchantBizList: function(merchSn) {
+            $.get("../thirdmerchantbiz/queryAll?merchSn=" + merchSn, function (r) {
+                vm.thirdMerchantBizList = r.list;
+            });
+        },
 		saveOrUpdate: function (event) {
             let url = vm.supplier.id == null ? "../supplier/save" : "../supplier/update";
 			$.ajax({

+ 71 - 5
kmall-admin/src/main/webapp/js/sys/user.js

@@ -5,7 +5,33 @@ $(function () {
         colModel: [
             {label: '用户ID', name: 'userId', index: "user_id", key: true, hidden: true},
             {label: '用户名', name: 'username', width: 75},
-            // {label: '所属部门', name: 'deptName', width: 75},
+            {label: '所属商户', name: 'merchName', width: 75,
+                formatter: function (value) {
+                    if (value == '' || value == null) {
+                        return '-';
+                    }else {
+                        return value;
+                    }
+                }
+            },
+            {label: '所属第三方商户', name: 'thirdPartyMerchCode', width: 75,
+                formatter: function (value) {
+                    if (value == '' || value == null) {
+                        return '-';
+                    }else {
+                        return value;
+                    }
+                }
+            },
+            {label: '所属门店', name: 'storeName', width: 75,
+                formatter: function (value) {
+                    if (value == '' || value == null) {
+                        return '-';
+                    }else {
+                        return value;
+                    }
+                }
+            },
             {label: '邮箱', name: 'email', width: 90},
             {label: '手机号', name: 'mobile', width: 100},
             {
@@ -89,7 +115,11 @@ var vm = new Vue({
             ]*/
         },
         storeList: [],
-        merchList: []
+        merchList: [],
+        thirdMerchantBizList: [],
+        isMerchShow:false,
+        isStoreShow:false,
+        isThirdMerchShow:false
     },
     methods: {
         query: function () {
@@ -102,12 +132,37 @@ var vm = new Vue({
             vm.user = {status: 1, roleIdList: [], deptId: '', deptName: '', storeId: '', roleType: 2,merchSn:''};
             vm.storeList = [];
             vm.merchList = [];
+            vm.thirdMerchantBizList = [];
             //获取角色信息
             this.getRoleList();
             // vm.getDept();
             //vm.getStoreList();
+            vm.changeRole(2);
             vm.getMerchList();
         },
+        changeRole:function (opt) {
+           var value = opt;
+           if(value == 1){
+               vm.isMerchShow = false;
+               vm.isStoreShow = false;
+               vm.isThirdMerchShow = false;
+           }
+           if(value == 2){//店员
+               vm.isMerchShow = true;
+               vm.isThirdMerchShow = true;
+               vm.isStoreShow = true;
+           }
+            if(value == 3){//一级商户
+                vm.isMerchShow = true;
+                vm.isThirdMerchShow = false;
+                vm.isStoreShow = false;
+            }
+            if(value == 4){//第三方商户
+                vm.isMerchShow = true;
+                vm.isThirdMerchShow = true;
+                vm.isStoreShow = false;
+            }
+        },
         getStoreList: function() {
             $.get("../store/queryAll", function (r) {
                 vm.storeList = r.list;
@@ -115,9 +170,7 @@ var vm = new Vue({
         },
         getStoresByMerch: function (opt) {
             var value = opt.value;
-            $.get("../store/getStoresByMerch?merchSn=" + value, function (r) {
-                vm.storeList = r.list;
-            });
+            vm.getThirdMerchantBizList(value);
         },
         getMerchList: function() {
             $.get("../merch/queryAll", function (r) {
@@ -143,6 +196,7 @@ var vm = new Vue({
 
             vm.showList = false;
             vm.title = "修改";
+            vm.thirdMerchantBizList = [];
 
             $.get("../sys/user/info/" + userId, function (r) {
                 vm.user = r.user;
@@ -150,6 +204,7 @@ var vm = new Vue({
                 // vm.getStoreList();
                 vm.getStoresByMerchAndUpd(r.user.merchSn);
                 vm.getRoleList();
+                vm.changeRole(r.user.roleType);
                 vm.getMerchList();
                 // vm.getDept();
             });
@@ -160,6 +215,17 @@ var vm = new Vue({
                 vm.storeList = r.list;
             });
         },
+        getStoresByThirdMerch:function (opt) {
+            var value = opt.value;
+            $.get("../store/getStoresByThirdMerch?thirdPartyMerchCode=" + value, function (r) {
+                vm.storeList = r.list;
+            });
+        },
+        getThirdMerchantBizList: function(merchSn) {
+            $.get("../thirdmerchantbiz/queryAll?merchSn=" + merchSn, function (r) {
+                vm.thirdMerchantBizList = r.list;
+            });
+        },
         del: function () {
             var userIds = getSelectedRows();
             if (userIds == null) {

+ 1 - 1
kmall-admin/src/main/webapp/login.html

@@ -74,7 +74,7 @@
     </div>
     <div class="signup-footer">
         <div class="pull-left" style="margin-left: 520px;">
-            2018~2018 &copy; <a href="http://fly2you.cn" target="_blank">中网科技(深圳)有限公司
+            2018~2018 &copy; <a href="#" target="_blank">中网科技(深圳)有限公司</a>
         </div>
     </div>
 </div>

+ 3 - 2
kmall-common/src/main/java/com/kmall/common/constant/Dict.java

@@ -621,12 +621,13 @@ public class Dict {
     }
 
     /**
-     * 角色类型:1:操作员;2:店员;3:商户管理员
+     * 角色类型:1:操作员;2:店员;3:商户管理员 4:第三方商户管理员
      */
     public enum roleType {
         item_1("1", "操作员"),
         item_2("2", "店员"),
-        item_3("3", "商户管理员");
+        item_3("3", "商户管理员"),
+        item_4("4", "第三方商户管理员");
 
         private String item;
         private String itemName;