Browse Source

Merge branch 'master' of http://git.ds-bay.com/project/kmall-pt

csk 6 năm trước cách đây
mục cha
commit
180b375fa9
100 tập tin đã thay đổi với 3328 bổ sung673 xóa
  1. 1 1
      README.md
  2. BIN
      cert/apiclient_cert.p12
  3. 26 0
      cert/apiclient_cert.pem
  4. 28 0
      cert/apiclient_key.pem
  5. 18 0
      cert/证书使用说明.txt
  6. 2 1
      kmall-admin/src/main/java/com/kmall/admin/controller/BrandController.java
  7. 2 0
      kmall-admin/src/main/java/com/kmall/admin/controller/CommentController.java
  8. 1 0
      kmall-admin/src/main/java/com/kmall/admin/controller/FootprintController.java
  9. 51 8
      kmall-admin/src/main/java/com/kmall/admin/controller/GoodsController.java
  10. 2 1
      kmall-admin/src/main/java/com/kmall/admin/controller/GoodsSpecificationController.java
  11. 1 1
      kmall-admin/src/main/java/com/kmall/admin/controller/OfflineCartController.java
  12. 124 7
      kmall-admin/src/main/java/com/kmall/admin/controller/OrderController.java
  13. 19 0
      kmall-admin/src/main/java/com/kmall/admin/controller/ProductStoreRelaController.java
  14. 118 2
      kmall-admin/src/main/java/com/kmall/admin/controller/StoreController.java
  15. 143 0
      kmall-admin/src/main/java/com/kmall/admin/controller/ThirdMerchantBizController.java
  16. 1 0
      kmall-admin/src/main/java/com/kmall/admin/controller/UserController.java
  17. 1 0
      kmall-admin/src/main/java/com/kmall/admin/dao/BrandDao.java
  18. 1 0
      kmall-admin/src/main/java/com/kmall/admin/dao/CategoryDao.java
  19. 1 0
      kmall-admin/src/main/java/com/kmall/admin/dao/FreightDao.java
  20. 1 1
      kmall-admin/src/main/java/com/kmall/admin/dao/GoodsDao.java
  21. 2 0
      kmall-admin/src/main/java/com/kmall/admin/dao/OfflineCartDao.java
  22. 8 6
      kmall-admin/src/main/java/com/kmall/admin/dao/OrderDao.java
  23. 12 3
      kmall-admin/src/main/java/com/kmall/admin/dao/ProductDao.java
  24. 2 0
      kmall-admin/src/main/java/com/kmall/admin/dao/ProductStoreRelaDao.java
  25. 19 0
      kmall-admin/src/main/java/com/kmall/admin/dao/ThirdMerchantBizDao.java
  26. 5 5
      kmall-admin/src/main/java/com/kmall/admin/dto/GoodsDto.java
  27. 19 0
      kmall-admin/src/main/java/com/kmall/admin/entity/AttributeEntity.java
  28. 37 0
      kmall-admin/src/main/java/com/kmall/admin/entity/BrandEntity.java
  29. 19 0
      kmall-admin/src/main/java/com/kmall/admin/entity/CategoryEntity.java
  30. 19 0
      kmall-admin/src/main/java/com/kmall/admin/entity/FreightEntity.java
  31. 60 22
      kmall-admin/src/main/java/com/kmall/admin/entity/GoodsEntity.java
  32. 59 2
      kmall-admin/src/main/java/com/kmall/admin/entity/OrderEntity.java
  33. 73 0
      kmall-admin/src/main/java/com/kmall/admin/entity/ProductStoreRelaEntity.java
  34. 9 0
      kmall-admin/src/main/java/com/kmall/admin/entity/StoreEntity.java
  35. 181 0
      kmall-admin/src/main/java/com/kmall/admin/entity/ThirdMerchantBizEntity.java
  36. 1 1
      kmall-admin/src/main/java/com/kmall/admin/service/GoodsService.java
  37. 2 0
      kmall-admin/src/main/java/com/kmall/admin/service/OrderService.java
  38. 3 3
      kmall-admin/src/main/java/com/kmall/admin/service/ProductService.java
  39. 3 0
      kmall-admin/src/main/java/com/kmall/admin/service/ProductStoreRelaService.java
  40. 72 0
      kmall-admin/src/main/java/com/kmall/admin/service/ThirdMerchantBizService.java
  41. 9 7
      kmall-admin/src/main/java/com/kmall/admin/service/impl/CategoryServiceImpl.java
  42. 2 1
      kmall-admin/src/main/java/com/kmall/admin/service/impl/GoodsGroupOpenServiceImpl.java
  43. 149 94
      kmall-admin/src/main/java/com/kmall/admin/service/impl/GoodsServiceImpl.java
  44. 4 3
      kmall-admin/src/main/java/com/kmall/admin/service/impl/OfflineCartServiceImpl.java
  45. 25 18
      kmall-admin/src/main/java/com/kmall/admin/service/impl/OrderServiceImpl.java
  46. 2 2
      kmall-admin/src/main/java/com/kmall/admin/service/impl/ProductServiceImpl.java
  47. 122 26
      kmall-admin/src/main/java/com/kmall/admin/service/impl/ProductStoreRelaServiceImpl.java
  48. 24 0
      kmall-admin/src/main/java/com/kmall/admin/service/impl/StoreServiceImpl.java
  49. 71 0
      kmall-admin/src/main/java/com/kmall/admin/service/impl/ThirdMerchantBizServiceImpl.java
  50. 13 13
      kmall-admin/src/main/resources/XmlTemplate/GeneralGoodsDtoList.xml
  51. 22 22
      kmall-admin/src/main/resources/XmlTemplate/GoodsDtoList.xml
  52. 40 0
      kmall-admin/src/main/resources/conf/cus.properties
  53. 11 11
      kmall-admin/src/main/resources/conf/redis.properties
  54. 7 0
      kmall-admin/src/main/resources/conf/websocket.properties
  55. 7 1
      kmall-admin/src/main/resources/mybatis/mapper/AttributeDao.xml
  56. 59 21
      kmall-admin/src/main/resources/mybatis/mapper/BrandDao.xml
  57. 6 0
      kmall-admin/src/main/resources/mybatis/mapper/CartDao.xml
  58. 24 13
      kmall-admin/src/main/resources/mybatis/mapper/CategoryDao.xml
  59. 4 0
      kmall-admin/src/main/resources/mybatis/mapper/CommentDao.xml
  60. 31 11
      kmall-admin/src/main/resources/mybatis/mapper/FreightDao.xml
  61. 56 60
      kmall-admin/src/main/resources/mybatis/mapper/GoodsDao.xml
  62. 139 5
      kmall-admin/src/main/resources/mybatis/mapper/OrderDao.xml
  63. 1 0
      kmall-admin/src/main/resources/mybatis/mapper/OrderGoodsDao.xml
  64. 2 2
      kmall-admin/src/main/resources/mybatis/mapper/ProductDao.xml
  65. 144 24
      kmall-admin/src/main/resources/mybatis/mapper/ProductStoreRelaDao.xml
  66. 8 4
      kmall-admin/src/main/resources/mybatis/mapper/StoreDao.xml
  67. 167 0
      kmall-admin/src/main/resources/mybatis/mapper/ThirdMerchantBizDao.xml
  68. 2 0
      kmall-admin/src/main/resources/spring/spring-context.xml
  69. 38 0
      kmall-admin/src/main/resources/spring/spring-cus.xml
  70. 2 0
      kmall-admin/src/main/resources/spring/spring-main.xml
  71. 25 0
      kmall-admin/src/main/resources/spring/spring-websocket.xml
  72. 1 1
      kmall-admin/src/main/webapp/WEB-INF/page/shop/ad.html
  73. 29 2
      kmall-admin/src/main/webapp/WEB-INF/page/shop/brand.html
  74. 67 47
      kmall-admin/src/main/webapp/WEB-INF/page/shop/category.html
  75. 44 65
      kmall-admin/src/main/webapp/WEB-INF/page/shop/goods.html
  76. 1 1
      kmall-admin/src/main/webapp/WEB-INF/page/shop/offilineOrderList.html
  77. 17 3
      kmall-admin/src/main/webapp/WEB-INF/page/shop/order.html
  78. 6 0
      kmall-admin/src/main/webapp/WEB-INF/page/shop/shopuser.html
  79. 21 5
      kmall-admin/src/main/webapp/WEB-INF/page/shop/store.html
  80. 85 8
      kmall-admin/src/main/webapp/WEB-INF/page/shop/storeProductStock.html
  81. 69 0
      kmall-admin/src/main/webapp/WEB-INF/page/shop/thirdmerchantbiz.html
  82. 11 11
      kmall-admin/src/main/webapp/WEB-INF/page/sys/main.html
  83. 2 0
      kmall-admin/src/main/webapp/WEB-INF/web.xml
  84. 15 4
      kmall-admin/src/main/webapp/index.html
  85. 2 0
      kmall-admin/src/main/webapp/js/shop/attribute.js
  86. 16 2
      kmall-admin/src/main/webapp/js/shop/brand.js
  87. 13 12
      kmall-admin/src/main/webapp/js/shop/category.js
  88. 2 0
      kmall-admin/src/main/webapp/js/shop/freight.js
  89. 74 52
      kmall-admin/src/main/webapp/js/shop/goods.js
  90. 60 10
      kmall-admin/src/main/webapp/js/shop/order.js
  91. 6 2
      kmall-admin/src/main/webapp/js/shop/orderrefund.js
  92. 7 7
      kmall-admin/src/main/webapp/js/shop/scannShop.js
  93. 49 3
      kmall-admin/src/main/webapp/js/shop/store.js
  94. 186 27
      kmall-admin/src/main/webapp/js/shop/storeProductStock.js
  95. 166 0
      kmall-admin/src/main/webapp/js/shop/thirdmerchantbiz.js
  96. BIN
      kmall-admin/src/main/webapp/statics/file/general_goods_export_yyyy_mm_dd_v1.0.0.xls
  97. BIN
      kmall-admin/src/main/webapp/statics/file/goods_export_yyyy_mm_dd_v1.0.0.xls
  98. 1 0
      kmall-admin/src/main/webapp/statics/mpdswl/CMmUrfS5RI.txt
  99. 4 3
      kmall-api/src/main/java/com/kmall/api/api/ApiAddressController.java
  100. 12 6
      kmall-api/src/main/java/com/kmall/api/api/ApiAuthController.java

+ 1 - 1
README.md

@@ -64,7 +64,7 @@ kmall-pt
 * 将wx-mall导入微信web开发者工具
 
 * 生成环境打包 
-    * mvn clean
+    * mvn clean package
     * mvn package -P prod
     
 ## 打印机设置

BIN
cert/apiclient_cert.p12


+ 26 - 0
cert/apiclient_cert.pem

@@ -0,0 +1,26 @@
+-----BEGIN CERTIFICATE-----
+MIIEZjCCA8+gAwIBAgIEAdngTDANBgkqhkiG9w0BAQUFADCBijELMAkGA1UEBhMC
+Q04xEjAQBgNVBAgTCUd1YW5nZG9uZzERMA8GA1UEBxMIU2hlbnpoZW4xEDAOBgNV
+BAoTB1RlbmNlbnQxDDAKBgNVBAsTA1dYRzETMBEGA1UEAxMKTW1wYXltY2hDQTEf
+MB0GCSqGSIb3DQEJARYQbW1wYXltY2hAdGVuY2VudDAeFw0xODAzMjkwODM3MDRa
+Fw0yODAzMjYwODM3MDRaMIGVMQswCQYDVQQGEwJDTjESMBAGA1UECBMJR3Vhbmdk
+b25nMREwDwYDVQQHEwhTaGVuemhlbjEQMA4GA1UEChMHVGVuY2VudDEOMAwGA1UE
+CxMFTU1QYXkxKTAnBgNVBAMUIOS4ree9keenkeaKgCjmt7HlnLMp5pyJ6ZmQ5YWs
+5Y+4MRIwEAYDVQQEEwkxMDAwNzM3ODYwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw
+ggEKAoIBAQCwnwvwPz1H8Z4lsOJv99gibR7PkrbpnH+zLZrsV1ldsLu41CIGpxs0
+LWCeKbknqb0VyDcdpF8Rx4c7XTgmqz2F+fIAkwV6rabHpZtoIFBBHPPvPzxLqrdy
+6ZQ/SjG52UrmRWQA+s3O8AeoCYh4FiH9lNZWVOZkrbyWh4cOFa5LaqyiTH7FyaSl
+I5G6i0wlVff9fN4433JPbrNlV/bs8UeT3RCEXMKWyFMdw8soEKX3JcmrkVDJv7x+
+DdV1pBcBxCJLNCevVGNca6QZjygZhKbxlMrTnGHvkVYPINv/j8iJM4PUyNJXeCi5
+9433TGf7WryFvupzhvsTSmIeuEtQAEO9AgMBAAGjggFGMIIBQjAJBgNVHRMEAjAA
+MCwGCWCGSAGG+EIBDQQfFh0iQ0VTLUNBIEdlbmVyYXRlIENlcnRpZmljYXRlIjAd
+BgNVHQ4EFgQUQbgBi9nQ2WhO+XxGrUmhnzeb/Zwwgb8GA1UdIwSBtzCBtIAUPgUm
+9iJitBVbiM1kfrDUYqflhnShgZCkgY0wgYoxCzAJBgNVBAYTAkNOMRIwEAYDVQQI
+EwlHdWFuZ2RvbmcxETAPBgNVBAcTCFNoZW56aGVuMRAwDgYDVQQKEwdUZW5jZW50
+MQwwCgYDVQQLEwNXWEcxEzARBgNVBAMTCk1tcGF5bWNoQ0ExHzAdBgkqhkiG9w0B
+CQEWEG1tcGF5bWNoQHRlbmNlbnSCCQC7VJcrvADoVzAOBgNVHQ8BAf8EBAMCBsAw
+FgYDVR0lAQH/BAwwCgYIKwYBBQUHAwIwDQYJKoZIhvcNAQEFBQADgYEAXRK7CjeA
+/bS7RNjxe1U66U8QbmsGpsG71jCvUPNeTROE8KYwjMzpu2itis+vKXnUtpo/vVH5
+i7sJx7/XiZbIVvLQN8dZvc4H1BXoBLKcTr9or0keY7Ld00/U6+xEZRPAv+zECDwO
+nS/tZwam25+rpTHWawP+/APSqS5r9MPgusE=
+-----END CERTIFICATE-----

+ 28 - 0
cert/apiclient_key.pem

@@ -0,0 +1,28 @@
+-----BEGIN PRIVATE KEY-----
+MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCwnwvwPz1H8Z4l
+sOJv99gibR7PkrbpnH+zLZrsV1ldsLu41CIGpxs0LWCeKbknqb0VyDcdpF8Rx4c7
+XTgmqz2F+fIAkwV6rabHpZtoIFBBHPPvPzxLqrdy6ZQ/SjG52UrmRWQA+s3O8Aeo
+CYh4FiH9lNZWVOZkrbyWh4cOFa5LaqyiTH7FyaSlI5G6i0wlVff9fN4433JPbrNl
+V/bs8UeT3RCEXMKWyFMdw8soEKX3JcmrkVDJv7x+DdV1pBcBxCJLNCevVGNca6QZ
+jygZhKbxlMrTnGHvkVYPINv/j8iJM4PUyNJXeCi59433TGf7WryFvupzhvsTSmIe
+uEtQAEO9AgMBAAECggEAYozcRHmE4BfZfn5sWr2YQ91PS9M5bLB+MKRJxYYXv0dV
+95OmSMAFVd/cAWSWg6MadoT4+/kzcuA6fM1O/4SdF5yXg+qFLCao4M1vIXKmVS6q
+jdxi8HWZVu0uYwIrLOAqAsLFQiavn8AfBYwMMbVn0e6yigllZNfsWrHUke9XCYzW
+xuzwu6Tr2V6AsFbmeavJ2tUakIjpZuLi7E/DO3c6KugbAXkZujZfkcG4MHUCPglK
+g50biFJVoapxGKJEycTxHyTFvxAoqT3zoLVsMTt1wzXNeIGwP4wOPZMzp8kJAOU0
+9NlKrVT+rHw1/YHDjF1X3q1eImSG4WH2vRrsGKqtAQKBgQDcEQjlS0rNE3LNH/jY
+25hex67pmJJU/XFKAXuL27QIfaXe2/7AA+ab8S1ujKMi1fzN/iQzlSCtVno7TqAc
+EI9wkT+d6veaHYoBIsI3cM7Hqx0vQyVJC1bJMflnI4zqLM0b0k2s3eGjAI7E3KUm
+PqGiVpg4nNOChzPc8E7sCwJJZQKBgQDNdfamlGLmJHa7bVKc1wapIBTutMZaMwuD
+KHoFK9MTuUl3X4gahVPl01ypp7Zpg4ldQqB6FIuVbVvNNSlMO8rvo7xi/AvcRxFf
+/bzjZSuogu2Mym/BWL7ZorsFjlrnQJP0HtT7bLWFbxH1yMaAFYqIQyoTyyU1aVva
+mIepno2XeQKBgAXBZEwq5e/rHEuFFIsHYzrHWim91cXnQvk+hK6ptlGqh5YGhuka
+sQNPEXMctn+IvS3eAbBfrBUcd+HpMoLJZBb7lYBZztP3Bc71y8KLbr0GGqNLzEPW
+yhRE/FLYOS0+sraRj3p/6xDKSPGZG7CeXrfSL/T7FQUK6C5VEptVxl+JAoGAS7E5
+vQTNqpukYkhUNxPAkG4RSB+xM2m6xAcVbPJIQOvx9Nhs+9hCoFjNunLe8OBUqtbw
+6AjJo7M2LtN2827TxJU9wfm5JN3JuONxwxRykRIrEcNCiKh5JxSccd+P/cH8v+Lb
+9ASImy/gHfxppKZK8whLaB9fBd5ayJ2I3SRcZYECgYAEeDs5s1OxfdXtL0EXUmKP
+5R7MThVKceZ85FHFXQh2r43TY2utqJi2NoW4KRlhG8SgUwHYmxcvnfSZuITtKxsd
+LV56lcQgxhfw20tyP/79+8OYZDwnTIkC0pZtn/OpJb0Lq6861GTaD97XSXuyPPKJ
+L1hE5ZGyide2HTTps7Dk6w==
+-----END PRIVATE KEY-----

+ 18 - 0
cert/证书使用说明.txt

@@ -0,0 +1,18 @@
+欢迎使用微信支付!
+附件中的三份文件(证书pkcs12格式、证书pem格式、证书密钥pem格式),为接口中强制要求时需携带的证书文件。
+证书属于敏感信息,请妥善保管不要泄露和被他人复制。
+不同开发语言下的证书格式不同,以下为说明指引:
+    证书pkcs12格式(apiclient_cert.p12)
+        包含了私钥信息的证书文件,为p12(pfx)格式,由微信支付签发给您用来标识和界定您的身份
+        部分安全性要求较高的API需要使用该证书来确认您的调用身份
+        windows上可以直接双击导入系统,导入过程中会提示输入证书密码,证书密码默认为您的商户ID(如:10010000)
+    证书pem格式(apiclient_cert.pem)
+        从apiclient_cert.p12中导出证书部分的文件,为pem格式,请妥善保管不要泄漏和被他人复制
+        部分开发语言和环境,不能直接使用p12文件,而需要使用pem,所以为了方便您使用,已为您直接提供
+        您也可以使用openssl命令来自己导出:openssl pkcs12 -clcerts -nokeys -in apiclient_cert.p12 -out apiclient_cert.pem
+    证书密钥pem格式(apiclient_key.pem)
+        从apiclient_cert.p12中导出密钥部分的文件,为pem格式
+        部分开发语言和环境,不能直接使用p12文件,而需要使用pem,所以为了方便您使用,已为您直接提供
+        您也可以使用openssl命令来自己导出:openssl pkcs12 -nocerts -in apiclient_cert.p12 -out apiclient_key.pem
+备注说明:  
+        由于绝大部分操作系统已内置了微信支付服务器证书的根CA证书,  2018年3月6日后, 不再提供CA证书文件(rootca.pem)下载 

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

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

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

@@ -2,6 +2,7 @@ package com.kmall.admin.controller;
 
 import com.kmall.admin.entity.CommentEntity;
 import com.kmall.admin.service.CommentService;
+import com.kmall.admin.utils.ParamUtils;
 import com.kmall.common.utils.PageUtils;
 import com.kmall.common.utils.Query;
 import com.kmall.common.utils.R;
@@ -31,6 +32,7 @@ public class CommentController {
     @RequestMapping("/list")
     @RequiresPermissions("comment:list")
     public R list(@RequestParam Map<String, Object> params) {
+        ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", true);
         //查询列表数据
         Query query = new Query(params);
 

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

@@ -92,6 +92,7 @@ public class FootprintController {
      */
     @RequestMapping("/queryTotal")
     public R queryTotal(@RequestParam Map<String, Object> params) {
+        ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", false);
         int hitCount = footprintService.queryTotal(params);
 
         return R.ok().put("hitCount", hitCount);

+ 51 - 8
kmall-admin/src/main/java/com/kmall/admin/controller/GoodsController.java

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

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

@@ -1,5 +1,6 @@
 package com.kmall.admin.controller;
 
+import com.google.common.collect.Maps;
 import com.kmall.admin.entity.GoodsSpecificationEntity;
 import com.kmall.admin.entity.SpecificationEntity;
 import com.kmall.admin.service.GoodsSpecificationService;
@@ -103,7 +104,7 @@ public class GoodsSpecificationController {
                 }
             }
         }
-        Map param = new HashMap();
+        Map param = Maps.newHashMap();
         param.put("ids", goodsSpecificationIds);
         List<SpecificationEntity> specificationEntityList = specificationService.queryList(param);
         Collections.sort(specificationEntityList, new Comparator<SpecificationEntity>() {

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

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

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

@@ -1,5 +1,7 @@
 package com.kmall.admin.controller;
 
+import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
 import com.kmall.admin.entity.*;
 import com.kmall.admin.service.*;
 import com.kmall.admin.service.OrderExceptionRecordService;
@@ -9,6 +11,8 @@ import com.kmall.admin.utils.ParamUtils;
 import com.kmall.common.constant.Dict;
 import com.kmall.common.entity.SysUserEntity;
 import com.kmall.common.utils.*;
+import com.kmall.common.utils.excel.ExcelExport;
+import com.kmall.common.utils.excel.ExcelUtil;
 import com.kmall.common.utils.pingan.PinganUtil;
 import com.kmall.common.utils.pingan.dto.PinganResponseDto;
 import com.kmall.common.utils.print.ticket.item.Ticket;
@@ -20,16 +24,19 @@ import com.kmall.common.utils.wechat.wxglobal.WechatGlobalUtil;
 import com.kmall.common.utils.wechat.wxglobal.dto.WechatGlobalRefundApiResult;
 import net.sf.json.JSONObject;
 import org.apache.commons.lang3.StringUtils;
-import org.apache.log4j.Logger;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 import org.apache.shiro.authz.annotation.RequiresPermissions;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
 import java.math.BigDecimal;
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
-import java.util.Objects;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.*;
 
 
 /**
@@ -40,7 +47,7 @@ import java.util.Objects;
 @RestController
 @RequestMapping("order")
 public class OrderController {
-    private Logger logger = Logger.getLogger(OrderController.class);
+    private Log logger = LogFactory.getLog(OrderController.class);
     @Autowired
     private OrderService orderService;
     @Autowired
@@ -66,6 +73,26 @@ public class OrderController {
         //查询列表数据
         Query query = new Query(params);
         query.put("isOnfiilineOrder", Dict.isOnfflineOrder.item_0.getItem());
+        String startTime = (String) params.get("startTime");
+        String endTime = (String) params.get("endTime");
+        if(org.apache.commons.lang.StringUtils.isNotEmpty(startTime)) {
+            try {
+                startTime = new String(startTime.getBytes("iso-8859-1"), "utf-8");
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+            startTime = getDate(startTime);
+            query.put("startTime", startTime + " 00:00:00");
+        }
+        if(org.apache.commons.lang.StringUtils.isNotEmpty(endTime)) {
+            try {
+                endTime = new String(endTime.getBytes("iso-8859-1"), "utf-8");
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+            endTime = getDate(endTime);
+            query.put("endTime", endTime + " 59:59:59");
+        }
         List<OrderEntity> orderList = orderService.queryList(query);
         int total = orderService.queryTotal(query);
 
@@ -73,7 +100,6 @@ public class OrderController {
 
         return R.ok().put("page", pageUtil);
     }
-
     /**
      * 信息
      */
@@ -520,6 +546,7 @@ public class OrderController {
      */
     @RequestMapping("/getUserOrderInfo")
     public R getUserOrderInfo(@RequestParam Map<String, Object> params) {
+        ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", false);
         int result = orderService.getUserOrderInfo(params);
 
         return R.ok().put("result", result);
@@ -672,4 +699,94 @@ public class OrderController {
         }
         return r;
     }
+    /**
+     * 订单导出请求
+     */
+    @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);
+        //查询列表数据
+        params.put("isOnfiilineOrder", Dict.isOnfflineOrder.item_0.getItem());
+
+        String startTime = (String) params.get("startTime");
+        String endTime = (String) params.get("endTime");
+        if(org.apache.commons.lang.StringUtils.isNotEmpty(startTime)) {
+            try {
+                startTime = new String(startTime.getBytes("iso-8859-1"), "utf-8");
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+            startTime = getDate(startTime);
+            params.put("startTime", startTime + " 00:00:00");
+        }
+        if(org.apache.commons.lang.StringUtils.isNotEmpty(endTime)) {
+            try {
+                endTime = new String(endTime.getBytes("iso-8859-1"), "utf-8");
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+            endTime = getDate(endTime);
+            params.put("endTime", endTime + " 59:59:59");
+        }
+
+        List<OrderEntity> orderList = orderService.queryExportList(params);
+
+        ExcelExport ee = new ExcelExport("订单信息");
+
+        String[] header = new String[]{"订单编号","商户订单编号", "订单状态", "SKU", "商品名称", "数量", "销售价", "实际支付金额", "保税模式", "快递公司名称", "快递单编号", "海关清单编号", "收货人姓名", "收件人手机", "收件人省份", "收件人城市", "收件人区县", "收件人地址", "下单时间", "支付流水号"};
+
+        List<Map<String, Object>> list = new ArrayList<>();
+        if (orderList != null && orderList.size() != 0) {
+            for (OrderEntity orderEntity : orderList) {
+                LinkedHashMap<String, Object> map = new LinkedHashMap<>();
+                Integer orderStatus = orderEntity.getOrderStatus();
+                String orderBizType = orderEntity.getOrderBizType();
+
+                map.put("OrderSn", orderEntity.getOrderSn());
+                map.put("MerchOrderSn", orderEntity.getMerchOrderSn());
+                map.put("OrderStatus", StringUtils.isEmpty(orderStatus.toString())? "":Dict.orderStatus.valueOf("item_"+ orderStatus).getItemName());
+                map.put("SKU", orderEntity.getSku());
+                map.put("GoodsName", orderEntity.getGoodsName());
+                map.put("Number", orderEntity.getNumber());
+                map.put("RetailPrice", orderEntity.getRetailPrice());
+                map.put("ActualPrice", orderEntity.getActualPrice());
+
+                map.put("OrderBizType", StringUtils.isEmpty(orderBizType)? "":Dict.orderBizType.valueOf("item_"+orderBizType).getItemName());
+                map.put("ShippingName", orderEntity.getShippingName());
+                map.put("ShippingNo", orderEntity.getShippingNo());
+                map.put("InvtNo", orderEntity.getOrderProcessRecord()==null?"":orderEntity.getOrderProcessRecord().getInvtNo());
+                map.put("Consignee", orderEntity.getConsignee());
+                map.put("Mobile", orderEntity.getMobile());
+                map.put("Province", orderEntity.getProvince());
+                map.put("City", orderEntity.getCity());
+                map.put("District", orderEntity.getDistrict());
+                map.put("Address", orderEntity.getAddress());
+
+                map.put("OrderStartTime", orderEntity.getOrderProcessRecord()==null?"":DateUtils.format(orderEntity.getOrderProcessRecord().getAddOrderStartTime(),"yyyy-MM-dd HH:mm:ss"));
+                map.put("PayId", orderEntity.getPayTransactionId());
+
+                list.add(map);
+            }
+        }
+
+        ee.addSheetByMap("订单信息", list, header);
+        ee.export(response);
+        return R.ok();
+    }
+
+    private String getDate(String datdString){
+        datdString = datdString.replace("GMT", "").replaceAll("\\(.*\\)", "");
+        //将字符串转化为date类型,格式2016-10-12
+        SimpleDateFormat format = new SimpleDateFormat("EEE MMM dd yyyy HH:mm:ss z", Locale.ENGLISH);
+        Date dateTrans = null;
+        try {
+            dateTrans = format.parse(datdString);
+            return new SimpleDateFormat("yyyy-MM-dd").format(dateTrans);
+        } catch (ParseException e) {
+            e.printStackTrace();
+        }
+        return datdString;
+    }
+
 }

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

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

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

@@ -4,16 +4,41 @@ import com.google.common.collect.ImmutableBiMap;
 import com.kmall.admin.entity.StoreEntity;
 import com.kmall.admin.service.StoreService;
 import com.kmall.admin.utils.ParamUtils;
+import com.kmall.api.service.pay.wxpay.WxPayPropertiesBuilder;
 import com.kmall.common.entity.SysUserEntity;
+import com.kmall.common.fileserver.util.FileManager;
 import com.kmall.common.utils.*;
+import com.kmall.common.utils.wechat.AccessToken;
+import com.kmall.common.utils.wxtemplate.WxTemplateUtil;
+import org.apache.commons.fileupload.FileItem;
+import org.apache.commons.fileupload.disk.DiskFileItem;
+import org.apache.commons.io.IOUtils;
+import org.apache.http.HttpEntity;
+import org.apache.http.entity.ContentType;
+import org.apache.http.util.EntityUtils;
 import org.apache.shiro.authz.annotation.RequiresPermissions;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.*;
 
+import java.io.*;
+import java.nio.file.Files;
 import java.util.List;
 import java.util.Map;
 
+import java.util.HashMap;
+
+import org.apache.http.HttpResponse;
+import org.apache.http.client.methods.HttpPost;
+import org.apache.http.entity.StringEntity;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.HttpClientBuilder;
+import org.apache.http.protocol.HTTP;
+
+import com.alibaba.fastjson.JSON;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.multipart.commons.CommonsMultipartFile;
+
 /**
  * Controller
  *
@@ -79,7 +104,8 @@ public class StoreController {
         builder.put("storeName", "门店名称");
         builder.put("storeNumber", "门店编号");
         builder.put("thirdPartyMerchCode", "第三方商户编号");
-        builder.put("thirdPartyMerchName", "第三方商户名称");
+//        builder.put("thirdPartyMerchName", "第三方商户名称");
+        builder.put("exprAgreementType", "第三方商户快递协议类型");
         builder.put("latitude", "纬度");
         builder.put("longitude", "经度");
         R r = ValidatorUtil.isEmpty(builder.build(), valideDate);
@@ -108,7 +134,8 @@ public class StoreController {
         builder.put("storeName", "门店名称");
         builder.put("storeNumber", "门店编号");
         builder.put("thirdPartyMerchCode", "第三方商户编号");
-        builder.put("thirdPartyMerchName", "第三方商户名称");
+//        builder.put("thirdPartyMerchName", "第三方商户名称");
+        builder.put("exprAgreementType", "第三方商户快递协议类型");
         builder.put("latitude", "纬度");
         builder.put("longitude", "经度");
         R r = ValidatorUtil.isEmpty(builder.build(), valideDate);
@@ -159,4 +186,93 @@ public class StoreController {
         List<StoreEntity> list = storeService.queryList(params);
         return R.ok().put("list", list);
     }
+
+    @RequestMapping("/qrcodeCanvas/{storeId}")
+    @RequiresPermissions("store:qrcodeCanvas")
+    @ResponseBody
+    public R qrcodeCanvas(@PathVariable("storeId") Integer storeId) {
+        StoreEntity store = storeService.queryObject(storeId);
+        if(store==null){
+            throw new RRException("门店信息不存在");
+        }
+        AccessToken accessToken = WxTemplateUtil.getAccessToken(WxPayPropertiesBuilder.instance().getAppId(),WxPayPropertiesBuilder.instance().getSecret());
+        if(accessToken == null){
+            throw new RRException("token获取失败");
+        }
+        String token = accessToken.getToken();
+
+        //构建请求参数
+        Map<Object, Object> params = new HashMap<Object, Object>();
+        params.put("scene", store.getId());//参数
+        params.put("page", "pages/index/index");//页面
+        params.put("width", 430);
+        String mapToXml = JSON.toJSONString(params);
+
+        try {
+            CloseableHttpClient httpClient = HttpClientBuilder.create().build();
+
+            HttpPost httpPost = new HttpPost("https://api.weixin.qq.com/wxa/getwxacodeunlimit?access_token="+token);
+            httpPost.addHeader(HTTP.CONTENT_TYPE, "application/json");
+            StringEntity entity = new StringEntity(mapToXml);
+            entity.setContentType("image/png");
+
+            httpPost.setEntity(entity);
+            HttpResponse response = httpClient.execute(httpPost);
+            InputStream inputStream = response.getEntity().getContent();
+
+            String fileName = System.currentTimeMillis()+"_"+storeId+".png";
+            String dirName = "\\upload";
+            File dirFile = new File(dirName);
+            //删除之前的图片文件夹
+            deleteFile(dirFile);
+            if(!dirFile.exists()){
+                dirFile.mkdirs();
+            }
+
+            File file = new File(dirName, fileName);// 可以是任何图片格式.jpg,.png等
+            FileOutputStream fos = new FileOutputStream(file);
+            if (inputStream != null) {
+                try {
+                    byte[] b = new byte[1024];
+                    int nRead = 0;
+                    while ((nRead = inputStream.read(b)) != -1) {
+                        fos.write(b, 0, nRead);
+                    }
+                } catch (Exception e) {
+                    e.printStackTrace();
+                } finally {
+
+                    try {
+                        fos.flush();
+                        fos.close();
+                    } catch (IOException e) {
+                        e.printStackTrace();
+                    }
+                }
+            }
+            FileItem fileItem = new DiskFileItem("mainFile", Files.probeContentType(file.toPath()), false,
+                    file.getName(), (int) file.length(), file.getParentFile());
+            try (InputStream input = new FileInputStream(file); OutputStream os = fileItem.getOutputStream();) {
+                IOUtils.copy(input, os);
+                MultipartFile multipartFile = new CommonsMultipartFile(fileItem);
+                String url = FileManager.upload(multipartFile);
+                return R.ok().put("url", url);
+            }
+        }catch (Exception e){
+            e.printStackTrace();
+        }
+        return R.ok().put("url", "");
+    }
+
+    private void deleteFile(File dirFile){
+        if(dirFile.exists()){
+            if(dirFile.isFile()){
+                dirFile.delete();
+            }else {
+                for(File file:dirFile.listFiles()){
+                    deleteFile(file);
+                }
+            }
+        }
+    }
 }

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

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

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

@@ -112,6 +112,7 @@ public class UserController {
      */
     @RequestMapping("/queryTotal")
     public R queryTotal(@RequestParam Map<String, Object> params) {
+        ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", false);
         int sum = userService.queryTotal(params);
 
         return R.ok().put("userSum", sum);

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

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

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

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

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

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

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

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

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

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

+ 8 - 6
kmall-admin/src/main/java/com/kmall/admin/dao/OrderDao.java

@@ -28,46 +28,48 @@ public interface OrderDao extends BaseDao<OrderEntity> {
      *
      * @return
      */
-    int getYfkOrderUserSum();
+    int getYfkOrderUserSum(Map<String, Object> map);
 
     /**
      * 有订单会员数
      *
      * @return
      */
-    int getOderUserSum();
+    int getOderUserSum(Map<String, Object> map);
 
     /**
      * 今日订单数
      *
      * @return
      */
-    int getTodayUserOrder();
+    int getTodayUserOrder(Map<String, Object> map);
 
     /**
      * 今日会员购物总额
      *
      * @return
      */
-    int getTodayUserSales();
+    int getTodayUserSales(Map<String, Object> map);
 
     /**
      * 总收入
      *
      * @return
      */
-    int getIncomeSum();
+    int getIncomeSum(Map<String, Object> map);
 
     /**
      * 已支付订单数
      *
      * @return
      */
-    int getPayedOrderCount();
+    int getPayedOrderCount(Map<String, Object> map);
 
     Double getTotalActualPrice(@Param("merchOrderSn")String merchOrderSn);
 
     List<OrderEntity> queryOffilineOrderList(Map<String, Object> map);
 
     List<OrderEntity> queryObjectByMerchOrderSn(@Param("merchOrderSn")String merchOrderSn);
+
+    List<OrderEntity> queryExportList(Map<String, Object> map);
 }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

+ 59 - 2
kmall-admin/src/main/java/com/kmall/admin/entity/OrderEntity.java

@@ -13,8 +13,7 @@ import java.util.List;
  * @email
  * @date 2017-08-13 10:41:09
  */
-public class OrderEntity
-        implements Serializable {
+public class OrderEntity implements Serializable {
     private static final long serialVersionUID = 1L;
 
     //主键
@@ -134,6 +133,56 @@ public class OrderEntity
 
     private String orderSnWx;
 
+    private String isMergePay;
+    //商品名称
+    private String goodsName;
+    //商品数量
+    private Integer number;
+    //零售价格
+    private BigDecimal retailPrice;
+
+    private String payTransactionId;
+
+    public String getPayTransactionId() {
+        return payTransactionId;
+    }
+
+    public void setPayTransactionId(String payTransactionId) {
+        this.payTransactionId = payTransactionId;
+    }
+
+    public String getGoodsName() {
+        return goodsName;
+    }
+
+    public void setGoodsName(String goodsName) {
+        this.goodsName = goodsName;
+    }
+
+    public Integer getNumber() {
+        return number;
+    }
+
+    public void setNumber(Integer number) {
+        this.number = number;
+    }
+
+    public BigDecimal getRetailPrice() {
+        return retailPrice;
+    }
+
+    public void setRetailPrice(BigDecimal retailPrice) {
+        this.retailPrice = retailPrice;
+    }
+
+    public String getIsMergePay() {
+        return isMergePay;
+    }
+
+    public void setIsMergePay(String isMergePay) {
+        this.isMergePay = isMergePay;
+    }
+
     public String getOrderSnWx() {
         return orderSnWx;
     }
@@ -788,5 +837,13 @@ public class OrderEntity
         this.payRecordList = payRecordList;
     }
 
+    private OrderProcessRecordEntity orderProcessRecord;
 
+    public OrderProcessRecordEntity getOrderProcessRecord() {
+        return orderProcessRecord;
+    }
+
+    public void setOrderProcessRecord(OrderProcessRecordEntity orderProcessRecord) {
+        this.orderProcessRecord = orderProcessRecord;
+    }
 }

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

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

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

@@ -76,6 +76,15 @@ public class StoreEntity implements Serializable {
 
     private String thirdPartyMerchCode;
     private String thirdPartyMerchName;
+    private String exprAgreementType;
+
+    public String getExprAgreementType() {
+        return exprAgreementType;
+    }
+
+    public void setExprAgreementType(String exprAgreementType) {
+        this.exprAgreementType = exprAgreementType;
+    }
 
     public String getThirdPartyMerchCode() {
         return thirdPartyMerchCode;

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

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

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

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

+ 2 - 0
kmall-admin/src/main/java/com/kmall/admin/service/OrderService.java

@@ -96,4 +96,6 @@ public interface OrderService {
     Map orderSubmit(List<OfflineCartEntity> offlineCartEntityList,SysUserEntity user);
 
     int confirmPay(Long id, String payFlag,String orderSnWx);
+
+    List<OrderEntity> queryExportList(Map<String, Object> map);
 }

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

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

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

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

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

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

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

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

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

@@ -1,5 +1,6 @@
 package com.kmall.admin.service.impl;
 
+import com.google.common.collect.Maps;
 import com.kmall.admin.dao.GoodsGroupOpenDao;
 import com.kmall.admin.dao.GoodsGroupOpenDetailDao;
 import com.kmall.admin.dao.OrderDao;
@@ -83,7 +84,7 @@ public class GoodsGroupOpenServiceImpl implements GoodsGroupOpenService {
         groupOpenEntity.setAttendStatus(3);
         goodsGroupOpenDao.update(groupOpenEntity);
         // 更新团购明细
-        Map detailMap = new HashMap();
+        Map detailMap = Maps.newHashMap();
         detailMap.put("openId", id);
         List<GoodsGroupOpenDetailEntity> openDetailEntityList = goodsGroupOpenDetailDao.queryList(detailMap);
         if (null != openDetailEntityList && openDetailEntityList.size() > 0) {

+ 149 - 94
kmall-admin/src/main/java/com/kmall/admin/service/impl/GoodsServiceImpl.java

@@ -1,6 +1,7 @@
 package com.kmall.admin.service.impl;
 
 import com.google.common.collect.ImmutableBiMap;
+import com.google.common.collect.Maps;
 import com.kmall.admin.dao.*;
 import com.kmall.admin.dto.GoodsDto;
 import com.kmall.admin.entity.*;
@@ -58,24 +59,28 @@ public class GoodsServiceImpl implements GoodsService {
     private MerchDao merchDao;
     @Autowired
     private ExportExceptionDataDao exportExceptionDataDao;
+    @Autowired
+    private CartDao cartDao;
+    @Autowired
+    private ThirdMerchantBizDao thirdMerchantBizDao;
 
     @Override
     public GoodsEntity queryObject(Integer id) {
         Map<String, Object> map = new HashMap<String, Object>();
         map.put("goodsId", id);
-        List<GoodsAttributeEntity> attributeEntities = goodsAttributeDao.queryList(map);
+//        List<GoodsAttributeEntity> attributeEntities = goodsAttributeDao.queryList(map);
         List<ProductEntity> productEntityList = productDao.queryList(map);
         GoodsEntity entity = goodsDao.queryObject(id);
-        entity.setAttributeEntityList(attributeEntities);
+//        entity.setAttributeEntityList(attributeEntities);
         entity.setProductEntityList(productEntityList);
         return entity;
     }
 
     @Override
-    public GoodsEntity queryObjectByProdBarcodeAndBizType(String prodBarcode){
+    public GoodsEntity queryObjectByProdBarcodeAndBizType(String prodBarcode, Integer storeId){
         Map<String, Object> map = new HashMap<String, Object>();
         map.put("prodBarcode", prodBarcode);
-        GoodsEntity entity = goodsDao.queryObjectByProdBarcodeAndBizType(prodBarcode);
+        GoodsEntity entity = goodsDao.queryObjectByProdBarcodeAndBizType(prodBarcode, storeId);
         return entity;
     }
     @Override
@@ -99,16 +104,17 @@ public class GoodsServiceImpl implements GoodsService {
         Map<String, Object> valideDate = MapBeanUtil.fromObject(goods);
         ImmutableBiMap.Builder builder = new ImmutableBiMap.Builder();
         builder.put("merchSn", "商户编号");
-        builder.put("attributeCategory", "商品分类");
-        builder.put("categoryId", "商品二级分类");
+        builder.put("thirdPartyMerchCode", "第三方商户编号");
+//        builder.put("attributeCategory", "商品分类");
+//        builder.put("categoryId", "商品二级分类");
         builder.put("goodsSn", "商品编码");
         builder.put("name", "商品名称");
         builder.put("goodsUnit", "商品单位");
         builder.put("prodBarcode", "产品条码");
         builder.put("goodsBizType", "货品业务类型");
-        builder.put("brandId", "品牌");
+//        builder.put("brandId", "品牌");
         builder.put("supplierId", "供应商");
-        builder.put("freightId", "运费模版");
+//        builder.put("freightId", "运费模版");
         builder.put("primaryPicUrl", "商品主图");
         builder.put("listPicUrl", "商品列表图");
         builder.put("goodsDesc", "商品描述");
@@ -123,7 +129,7 @@ public class GoodsServiceImpl implements GoodsService {
                 // 海关信息,普通货物可不添加
                 builder.put("sku", "SKU");
                 builder.put("goodsRate", "商品税率");
-                builder.put("retailPrice", "零售价");
+//                builder.put("retailPrice", "零售价");
                 builder.put("brand", "产品品牌");
                 builder.put("unitCode", "计量单位代码");
                 builder.put("cusGoodsCode", "海关商品编码");
@@ -164,7 +170,7 @@ public class GoodsServiceImpl implements GoodsService {
                 || Dict.orderBizType.item_10.getItem().equals(goods.getGoodsBizType())) {
             goods.setIsHot(0);
         }
-        goods.setAttributeCategory(categoryDao.queryObject(goods.getCategoryId()).getParentId());
+//        goods.setAttributeCategory(categoryDao.queryObject(goods.getCategoryId()).getParentId());
         goods.setAddTime(new Date());
         goods.setIsDelete(Integer.parseInt(Dict.isDelete.item_0.getItem()));
         goods.setIsNew(0);
@@ -195,7 +201,7 @@ public class GoodsServiceImpl implements GoodsService {
             galleryEntity.setFileType("1");//视频
             goodsGalleryDao.save(galleryEntity);
         }
-
+/*
         // 添加商品参数
         List<GoodsAttributeEntity> attributeEntityList = goods.getAttributeEntityList();
         if (attributeEntityList != null && attributeEntityList.size() > 0) {
@@ -212,7 +218,7 @@ public class GoodsServiceImpl implements GoodsService {
                     }
                 }
             }
-        }
+        }*/
 
         // 添加产品
         ProductEntity product = new ProductEntity();
@@ -240,16 +246,17 @@ public class GoodsServiceImpl implements GoodsService {
         Map<String, Object> valideDate = MapBeanUtil.fromObject(goods);
         ImmutableBiMap.Builder builder = new ImmutableBiMap.Builder();
         builder.put("merchSn", "商户编号");
-        builder.put("attributeCategory", "商品分类");
-        builder.put("categoryId", "商品二级分类");
+        builder.put("thirdPartyMerchCode", "第三方商户编号");
+//        builder.put("attributeCategory", "商品分类");
+//        builder.put("categoryId", "商品二级分类");
         builder.put("goodsSn", "商品编码");
         builder.put("name", "商品名称");
         builder.put("goodsUnit", "商品单位");
         builder.put("prodBarcode", "产品条码");
         builder.put("goodsBizType", "货品业务类型");
-        builder.put("brandId", "品牌");
+//        builder.put("brandId", "品牌");
         builder.put("supplierId", "供应商");
-        builder.put("freightId", "运费模版");
+//        builder.put("freightId", "运费模版");
         builder.put("primaryPicUrl", "商品主图");
         builder.put("listPicUrl", "商品列表图");
         builder.put("goodsDesc", "商品描述");
@@ -265,7 +272,7 @@ public class GoodsServiceImpl implements GoodsService {
                 // 海关信息,普通货物可不添加
                 builder.put("sku", "SKU");
                 builder.put("goodsRate", "商品税率");
-                builder.put("retailPrice", "零售价");
+//                builder.put("retailPrice", "零售价");
                 builder.put("brand", "产品品牌");
                 builder.put("unitCode", "计量单位代码");
                 builder.put("cusGoodsCode", "海关商品编码");
@@ -306,7 +313,7 @@ public class GoodsServiceImpl implements GoodsService {
                 || Dict.orderBizType.item_10.getItem().equals(goods.getGoodsBizType())) {
             goods.setIsHot(0);
         }
-        goods.setAttributeCategory(categoryDao.queryObject(goods.getCategoryId()).getParentId());
+//        goods.setAttributeCategory(categoryDao.queryObject(goods.getCategoryId()).getParentId());
         goods.setIsDelete(Integer.parseInt(Dict.isDelete.item_0.getItem()));
         goods.setIsNew(0);
         goods.setUpdateUserId(user.getUserId());
@@ -317,17 +324,57 @@ public class GoodsServiceImpl implements GoodsService {
         goodsDao.update(goods);
 
         // 保税商品修改各个门店商品价格
-        if (!Dict.orderBizType.item_11.getItem().equals(goods.getGoodsBizType())) {
-            List<ProductStoreRelaEntity> productStoreRelaEntityList = productStoreRelaDao.queryByGoodsId(goods.getId());
-            if (productStoreRelaEntityList != null && productStoreRelaEntityList.size() > 0) {
-                for (ProductStoreRelaEntity productStoreRela : productStoreRelaEntityList) {
-                    productStoreRela.setRetailPrice(goods.getRetailPrice());
-                    productStoreRela.setMarketPrice(goods.getMarketPrice());
+        List<ProductStoreRelaEntity> productStoreRelaEntityList = productStoreRelaDao.queryByGoodsId(goods.getId());
+        if (productStoreRelaEntityList != null && productStoreRelaEntityList.size() > 0) {
+            for (ProductStoreRelaEntity productStoreRela : productStoreRelaEntityList) {
+                //修改该商品的所属商户信息,如在该商户门店中有该上架的商品信息,则提示该商品不能修改
+                /*if(org.apache.commons.lang3.StringUtils.isNotEmpty(productStoreRela.getMerchSn()) && productStoreRela.getMerchSn().equalsIgnoreCase(goods.getMerchSn())
+                        && goods.getIsOnSale() == Integer.parseInt(Dict.isOnSale.item_1.getItem())) {
+                    if (goods.getRetailPrice() != null) {
+                        productStoreRela.setRetailPrice(goods.getRetailPrice());
+                    }
+                    if (goods.getMarketPrice() != null) {
+                        productStoreRela.setMarketPrice(goods.getMarketPrice());
+                    }
                     productStoreRelaDao.update(productStoreRela);
+                }else {
+                    if (goods.getIsOnSale() == Integer.parseInt(Dict.isOnSale.item_0.getItem())) {
+                        if (goods.getRetailPrice() != null) {
+                            productStoreRela.setRetailPrice(goods.getRetailPrice());
+                        }
+                        if (goods.getMarketPrice() != null) {
+                            productStoreRela.setMarketPrice(goods.getMarketPrice());
+                        }
+                        productStoreRela.setMerchSn("");
+                        productStoreRelaDao.update(productStoreRela);
+                    } else {
+                        throw new RRException("商品编码为【" + goods.getGoodsSn() + "】的商品已上架在商户编号为【" + productStoreRela.getMerchSn() + "】的门店中,可先将该商品下架后再进行修改!");
+                    }
+                }*/
+                if(org.apache.commons.lang3.StringUtils.isNotEmpty(productStoreRela.getMerchSn()) && productStoreRela.getMerchSn().equalsIgnoreCase(goods.getMerchSn())
+                        && goods.getIsOnSale() == Integer.parseInt(Dict.isOnSale.item_1.getItem())) {
+                }else {
+                    if (goods.getIsOnSale() != Integer.parseInt(Dict.isOnSale.item_0.getItem())) {
+                        throw new RRException("商品编码为【" + goods.getGoodsSn() + "】的商品已上架在商户编号为【" + productStoreRela.getMerchSn() + "】的门店中,可先将该商品下架后再进行修改!");
+                    }
                 }
             }
         }
 
+        Map cartMap = Maps.newHashMap();
+        cartMap.put("goodsId",goods.getId());
+        List<CartEntity> cartList = cartDao.queryList(cartMap);
+        if (cartList != null && cartList.size() > 0) {
+            for (CartEntity cartEntity : cartList) {
+//                cartEntity.setRetailPrice(goods.getRetailPrice());
+//                cartEntity.setMarketPrice(goods.getMarketPrice());
+                cartEntity.setSku(goods.getSku());
+                cartEntity.setGoodsName(goods.getName());
+                cartEntity.setGoodsSn(goods.getGoodsSn());
+                cartDao.update(cartEntity);
+            }
+        }
+
         // 修改商品轮播图
         goodsGalleryDao.deleteByGoodsId(goods.getId());
         for (int i=0;i<galleryEntityList.size();i++) {
@@ -348,8 +395,7 @@ public class GoodsServiceImpl implements GoodsService {
             goodsGalleryDao.save(galleryEntity);
         }
 
-
-        // 修改商品参数
+        /*// 修改商品参数
         List<GoodsAttributeEntity> attributeEntityList = goods.getAttributeEntityList();
         if (attributeEntityList != null && attributeEntityList.size() > 0) {
             for (GoodsAttributeEntity item : attributeEntityList) {
@@ -370,10 +416,10 @@ public class GoodsServiceImpl implements GoodsService {
                     goodsAttributeDao.delete(item.getId());
                 }
             }
-        }
+        }*/
 
         // 修改产品
-        ProductEntity product = productDao.queryObjectBySn(goods.getGoodsSn());
+        ProductEntity product = productDao.queryObjectByGoodsId(String.valueOf(goods.getId()));
 
         GoodsSpecificationEntity goodsSpecification = new GoodsSpecificationEntity();
         // 保税商品,普通货物暂不添加商品规格
@@ -409,7 +455,7 @@ public class GoodsServiceImpl implements GoodsService {
         goodsEntity.setIsOnSale(Integer.parseInt(Dict.isOnSale.item_0.getItem()));
         goodsEntity.setUpdateUserId(user.getUserId());
         goodsEntity.setUpdateTime(new Date());
-        Map params = new HashMap();
+        Map params = Maps.newHashMap();
         params.put("goodsId", id);
         List<GoodsGroupEntity> groupVos = goodsGroupDao.queryList(params);
         if (null != groupVos && groupVos.size() > 0) {
@@ -508,33 +554,37 @@ public class GoodsServiceImpl implements GoodsService {
         SysUserEntity user = ShiroUtils.getUserEntity();
         String merchSn = user.getMerchSn();
         boolean isSuccess = false;
-        List<String> failSameSkuList = new ArrayList<>(), failHotGoodsSnList = new ArrayList<>(), failCateGoodsSnList = new ArrayList<>(),
-                failBrandGoodsSnList = new ArrayList<>(), failFreightGoodsSnList = new ArrayList<>(), failSuppGoodsSnList = new ArrayList<>(),
+        List<String> failSameSkuList = new ArrayList<>(), failHotGoodsSnList = new ArrayList<>(),
+                failSuppGoodsSnList = new ArrayList<>(),
                 failUnitGoodsSnList = new ArrayList<>(), failNationGoodsSnList = new ArrayList<>(),failProdbarGoodsSnList = new ArrayList<>(),
-                failCateL2GoodsSnList = new ArrayList<>(), failTypeGoodsSnList = new ArrayList<>(), failMerchGoodsSnList = new ArrayList<>(),
+                 failTypeGoodsSnList = new ArrayList<>(), failMerchGoodsSnList = new ArrayList<>(),
+//                failCateL2GoodsSnList = new ArrayList<>(),
+//                failCateGoodsSnList = new ArrayList<>(),
+//                failBrandGoodsSnList = new ArrayList<>(),
+//                failFreightGoodsSnList = new ArrayList<>(),
                 failMerchUserGoodsSnList = new ArrayList<>();
         List<String> failGoodsSnList = new ArrayList<>();
         List<String> failGoodsTypeList = new ArrayList<>();
-        List<String> failFreightList = new ArrayList<>();
+//        List<String> failFreightList = new ArrayList<>();
         if (goodsEntityList != null && goodsEntityList.size() > 0) {
             for (int i = 0; i < goodsEntityList.size(); i++) {
                 GoodsDto goodsDto = goodsEntityList.get(i);
                 GoodsEntity goodsEntity = new GoodsEntity();
                 Map<String, Object> valideDate = MapBeanUtil.fromObject(goodsDto);
                 ImmutableBiMap.Builder builder = new ImmutableBiMap.Builder();
-                builder.put("merchSn", "商户编号");
                 builder.put("goodsSn", "商品编码");
-                builder.put("categoryName", "商品分类");
+                builder.put("thirdPartyMerchCode", "第三方商户代码");
+//                builder.put("categoryName", "商品分类");
                 builder.put("goodsBizType", "货品业务类型");
                 builder.put("name", "商品名称");
-                builder.put("brandName", "商品品牌名称");
-                builder.put("defaultFreight", "运费");
+//                builder.put("brandName", "商品品牌名称");
+//                builder.put("defaultFreight", "运费");
                 builder.put("isOnSaleStr", "上架");
                 builder.put("goodsUnit", "商品单位");
                 builder.put("isHotStr", "热销");
                 builder.put("prodBarcode", "产品条码");
-                builder.put("marketPrice", "市场价");
-                builder.put("retailPrice", "零售价");
+//                builder.put("marketPrice", "市场价");
+//                builder.put("retailPrice", "零售价");
                 builder.put("supplierName", "供应商");
                 R r = ValidatorUtil.isEmpty(builder.build(), valideDate);
                 if (Integer.valueOf(r.get("code").toString()) != 0) {
@@ -566,15 +616,17 @@ public class GoodsServiceImpl implements GoodsService {
                         failTypeGoodsSnList.add(goodsDto.getSku());
                     }
                 }
-                if(!user.getRoleType().equalsIgnoreCase(Dict.roleType.item_1.getItem())) {
-                    if (!merchSn.equalsIgnoreCase(goodsDto.getMerchSn())) {
-                        isSuccess = true;
-                        failMerchUserGoodsSnList.add(goodsDto.getGoodsSn());
+                ThirdMerchantBizEntity thirdMerchantBizEntity = thirdMerchantBizDao.getThirdMerchangByCode(goodsDto.getThirdPartyMerchCode());
+                if(thirdMerchantBizEntity != null){
+                    goodsEntity.setMerchSn(thirdMerchantBizEntity.getMerchSn());
+                    goodsEntity.setThirdPartyMerchCode(thirdMerchantBizEntity.getThirdPartyMerchCode());
+
+                    if(!user.getRoleType().equalsIgnoreCase(Dict.roleType.item_1.getItem())) {
+                        if (!merchSn.equalsIgnoreCase(thirdMerchantBizEntity.getMerchSn())) {
+                            isSuccess = true;
+                            failMerchUserGoodsSnList.add(goodsDto.getGoodsSn());
+                        }
                     }
-                }
-                MerchEntity merchEntity = merchDao.findByMerchSn(goodsDto.getMerchSn());
-                if(merchEntity != null){
-                    goodsEntity.setMerchSn(merchEntity.getMerchSn());
                 }else{//商户不存在
                     isSuccess = true;
                     failMerchGoodsSnList.add(goodsDto.getGoodsSn());
@@ -611,8 +663,17 @@ public class GoodsServiceImpl implements GoodsService {
                         failHotGoodsSnList.add(goodsDto.getGoodsSn());
                     }
                 }
+                if(thirdMerchantBizEntity != null) {
+                    SupplierEntity supplierEntity = supplierDao.queryObjectByName(goodsDto.getSupplierName(), thirdMerchantBizEntity.getMerchSn());
+                    if (supplierEntity == null) {
+                        isSuccess = true;
+                        failSuppGoodsSnList.add(goodsDto.getGoodsSn());
+                    } else {
+                        goodsEntity.setSupplierId(supplierEntity.getId());
+                    }
+                }
                 //商品配置校验
-                CategoryEntity categoryEntity = categoryDao.queryObjectByName(goodsDto.getCategoryName(),goodsDto.getMerchSn());
+                /*CategoryEntity categoryEntity = categoryDao.queryObjectByName(goodsDto.getCategoryName(),goodsDto.getMerchSn());
                 if(categoryEntity==null){
                     isSuccess = true;
                     failCateGoodsSnList.add(goodsDto.getGoodsSn());
@@ -640,15 +701,8 @@ public class GoodsServiceImpl implements GoodsService {
                     failFreightList.add(goodsDto.getDefaultFreight());
                 }else {
                     goodsEntity.setFreightId(freightEntity.getId());
-                }
+                }*/
                 if (!Dict.orderBizType.item_11.getItem().equals(goodsDto.getGoodsBizType())) {
-                    SupplierEntity supplierEntity = supplierDao.queryObjectByName(goodsDto.getSupplierName(),goodsDto.getMerchSn());
-                    if (supplierEntity == null) {
-                        isSuccess = true;
-                        failSuppGoodsSnList.add(goodsDto.getGoodsSn());
-                    } else {
-                        goodsEntity.setSupplierId(supplierEntity.getId());
-                    }
                     SysCusUnitCodeEntity sysCusUnitCodeEntity = sysCusUnitCodeDao.queryObjectByName(goodsDto.getUnitName());
                     if (sysCusUnitCodeEntity == null) {
                         isSuccess = true;
@@ -668,8 +722,8 @@ public class GoodsServiceImpl implements GoodsService {
                 }
                 goodsEntity.setIsOnSale(Integer.parseInt(goodsDto.getIsOnSaleStr()));
                 goodsEntity.setIsHot(Integer.parseInt(goodsDto.getIsHotStr()));
-                goodsEntity.setRetailPrice(BigDecimal.valueOf(Integer.valueOf(goodsDto.getRetailPrice())));
-                goodsEntity.setMarketPrice(BigDecimal.valueOf(Integer.valueOf(goodsDto.getMarketPrice())));
+//                goodsEntity.setRetailPrice(BigDecimal.valueOf(Integer.valueOf(goodsDto.getRetailPrice())));
+//                goodsEntity.setMarketPrice(BigDecimal.valueOf(Integer.valueOf(goodsDto.getMarketPrice())));
                 goodsEntity.setGoodsSn(goodsDto.getGoodsSn());
                 goodsEntity.setSku(goodsDto.getSku());
                 goodsEntity.setName(goodsDto.getName());
@@ -696,41 +750,42 @@ public class GoodsServiceImpl implements GoodsService {
                     }else{
                         goodsDao.save(goodsEntity);
                     }
-                    // 保税商品修改各个门店商品价格
-                    if (!Dict.orderBizType.item_11.getItem().equals(goodsDto.getGoodsBizType())) {
-                        List<ProductStoreRelaEntity> productStoreRelaEntityList = productStoreRelaDao.queryByGoodsId(goodsDto.getId());
-                        if (productStoreRelaEntityList != null && productStoreRelaEntityList.size() > 0) {
-                            for (ProductStoreRelaEntity productStoreRela : productStoreRelaEntityList) {
-                                productStoreRela.setMarketPrice(goodsEntity.getMarketPrice());
-                                productStoreRela.setRetailPrice(goodsEntity.getRetailPrice());
-                                productStoreRelaDao.update(productStoreRela);
-                            }
-                        }
-                    }
+//                    // 保税商品修改各个门店商品价格
+//                    if (!Dict.orderBizType.item_11.getItem().equals(goodsDto.getGoodsBizType())) {
+//                        List<ProductStoreRelaEntity> productStoreRelaEntityList = productStoreRelaDao.queryByGoodsId(goodsDto.getId());
+//                        if (productStoreRelaEntityList != null && productStoreRelaEntityList.size() > 0) {
+//                            for (ProductStoreRelaEntity productStoreRela : productStoreRelaEntityList) {
+//                                productStoreRela.setMarketPrice(goodsEntity.getMarketPrice());
+//                                productStoreRela.setRetailPrice(goodsEntity.getRetailPrice());
+//                                productStoreRelaDao.update(productStoreRela);
+//                            }
+//                        }
+//                    }
                     // 修改产品
-                    ProductEntity product = productDao.queryObjectBySn(goodsDto.getGoodsSn());
+                    ProductEntity product = productDao.queryObjectByGoodsId(String.valueOf(goodsEntity.getId()));
 
                     GoodsSpecificationEntity goodsSpecification = new GoodsSpecificationEntity();
                     // 保税商品,普通货物暂不添加商品规格
                     if (!Dict.orderBizType.item_11.getItem().equals(goodsDto.getGoodsBizType())) {
                         // 添加商品规格
                         GoodsSpecificationEntity specificationEntity = goodsSpecificationDao.queryByGoodsId(goodsEntity.getId());
-                        if(specificationEntity ==null) {
+                        if(specificationEntity == null) {
                             goodsSpecification.setGoodsId(goodsEntity.getId());
                             goodsSpecification.setValue(goodsEntity.getCiqProdModel());
                             goodsSpecification.setSpecificationId(1);
                             goodsSpecificationDao.save(goodsSpecification);
                         }else {
                             goodsSpecification.setValue(goodsDto.getCiqProdModel());
+                            goodsSpecification.setId(specificationEntity.getId());
                             goodsSpecificationDao.update(goodsSpecification);
                         }
+                        product.setGoodsSpecificationNameValue(goodsSpecification.getValue());
+                        product.setGoodsSpecificationIds(goodsSpecification.getId().toString());
                     }
 
                     if(product == null){
                         product = new ProductEntity();
                         product.setGoodsSn(goodsDto.getGoodsSn());
-                        product.setGoodsSpecificationNameValue(goodsSpecification.getValue());
-                        product.setGoodsSpecificationIds(goodsSpecification.getId().toString());
                         product.setGoodsId(goodsEntity.getId());
                         product.setGoodsDefault(0);
                         product.setGoodsNumber(goodsEntity.getGoodsNumber());
@@ -760,7 +815,7 @@ public class GoodsServiceImpl implements GoodsService {
                 throw new RRException("导入数据异常,异常信息请在商品管理》》商品导入异常数据中查看检查");
             }
             if(failMerchGoodsSnList != null && failMerchGoodsSnList.size() > 0){
-                exportExceptionDataEntity.setExportExceptionData("商户编号不存在,请检查商品编码【"+failMerchGoodsSnList+"】的商品信息,请先维护用户商户编号信息再继续操作!");
+                exportExceptionDataEntity.setExportExceptionData("第三方商户代码不存在,请在商城配置》第三方商户管理中维护,请检查商品编码【"+failMerchGoodsSnList+"】的商品信息,请先维护再继续操作!");
                 exportExceptionDataDao.save(exportExceptionDataEntity);
                 throw new RRException("导入数据异常,异常信息请在商品管理》》商品导入异常数据中查看检查");
             }
@@ -792,26 +847,26 @@ public class GoodsServiceImpl implements GoodsService {
                 exportExceptionDataDao.save(exportExceptionDataEntity);
                 throw new RRException("导入数据异常,异常信息请在商品管理》》商品导入异常数据中查看检查");
             }
-            if(failCateGoodsSnList != null && failCateGoodsSnList.size() > 0){
-                exportExceptionDataEntity.setExportExceptionData("分类信息请在商城配置》商品分类中维护,商品分类与商户信息对应,请检查该商品商户信息下的分类是否维护,不存在的商品编码【"+failCateGoodsSnList+"】");
-                exportExceptionDataDao.save(exportExceptionDataEntity);
-                throw new RRException("导入数据异常,异常信息请在商品管理》》商品导入异常数据中查看检查");
-            }
-            if(failCateL2GoodsSnList != null && failCateL2GoodsSnList.size() > 0){
-                exportExceptionDataEntity.setExportExceptionData("分类信息请在商城配置》商品分类中查看,商品分类必须为二级分类,不存在的商品编码【"+failCateL2GoodsSnList+"】");
-                exportExceptionDataDao.save(exportExceptionDataEntity);
-                throw new RRException("导入数据异常,异常信息请在商品管理》》商品导入异常数据中查看检查");
-            }
-            if(failBrandGoodsSnList != null && failBrandGoodsSnList.size() > 0){
-                exportExceptionDataEntity.setExportExceptionData("品牌信息请在商城配置》品牌制造商中维护,品牌与商户信息对应,请检查该商品商户信息下的品牌是否维护,不存在的商品编码【" + failBrandGoodsSnList + "】");
-                exportExceptionDataDao.save(exportExceptionDataEntity);
-                throw new RRException("导入数据异常,异常信息请在商品管理》》商品导入异常数据中查看检查");
-            }
-            if(failFreightGoodsSnList != null && failFreightGoodsSnList.size() > 0){
-                exportExceptionDataEntity.setExportExceptionData("运费信息请在商城配置》运费模板中维护,运费与商户信息对应,请检查该商品商户信息下的运费是否维护,不存在的商品编码【"+failFreightGoodsSnList+"】,运费【"+failFreightList+"】");
-                exportExceptionDataDao.save(exportExceptionDataEntity);
-                throw new RRException("导入数据异常,异常信息请在商品管理》》商品导入异常数据中查看检查");
-            }
+//            if(failCateGoodsSnList != null && failCateGoodsSnList.size() > 0){
+//                exportExceptionDataEntity.setExportExceptionData("分类信息请在商城配置》商品分类中维护,商品分类与商户信息对应,请检查该商品商户信息下的分类是否维护,不存在的商品编码【"+failCateGoodsSnList+"】");
+//                exportExceptionDataDao.save(exportExceptionDataEntity);
+//                throw new RRException("导入数据异常,异常信息请在商品管理》》商品导入异常数据中查看检查");
+//            }
+//            if(failCateL2GoodsSnList != null && failCateL2GoodsSnList.size() > 0){
+//                exportExceptionDataEntity.setExportExceptionData("分类信息请在商城配置》商品分类中查看,商品分类必须为二级分类,不存在的商品编码【"+failCateL2GoodsSnList+"】");
+//                exportExceptionDataDao.save(exportExceptionDataEntity);
+//                throw new RRException("导入数据异常,异常信息请在商品管理》》商品导入异常数据中查看检查");
+//            }
+//            if(failBrandGoodsSnList != null && failBrandGoodsSnList.size() > 0){
+//                exportExceptionDataEntity.setExportExceptionData("品牌信息请在商城配置》品牌制造商中维护,品牌与商户信息对应,请检查该商品商户信息下的品牌是否维护,不存在的商品编码【" + failBrandGoodsSnList + "】");
+//                exportExceptionDataDao.save(exportExceptionDataEntity);
+//                throw new RRException("导入数据异常,异常信息请在商品管理》》商品导入异常数据中查看检查");
+//            }
+//            if(failFreightGoodsSnList != null && failFreightGoodsSnList.size() > 0){
+//                exportExceptionDataEntity.setExportExceptionData("运费信息请在商城配置》运费模板中维护,运费与商户信息对应,请检查该商品商户信息下的运费是否维护,不存在的商品编码【"+failFreightGoodsSnList+"】,运费【"+failFreightList+"】");
+//                exportExceptionDataDao.save(exportExceptionDataEntity);
+//                throw new RRException("导入数据异常,异常信息请在商品管理》》商品导入异常数据中查看检查");
+//            }
             if(failSuppGoodsSnList != null && failSuppGoodsSnList.size() > 0){
                 exportExceptionDataEntity.setExportExceptionData("供应商信息请在商城配置》商品供应商中维护,供应商与商户信息对应,请检查该商品商户信息下的供应商是否维护,不存在的商品编码【" + failSuppGoodsSnList + "】");
                 exportExceptionDataDao.save(exportExceptionDataEntity);

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

@@ -1,5 +1,6 @@
 package com.kmall.admin.service.impl;
 
+import com.google.common.collect.Maps;
 import com.kmall.admin.dao.OfflineCartDao;
 import com.kmall.admin.entity.GoodsEntity;
 import com.kmall.admin.entity.OfflineCartEntity;
@@ -84,8 +85,8 @@ public class OfflineCartServiceImpl implements OfflineCartService {
             cartEntity.setProdBarcode(goods.getProdBarcode());
             cartEntity.setSku(goods.getSku());
             cartEntity.setProductId(Integer.parseInt(goods.getProductId()));
-            cartEntity.setMarketPrice(goods.getMarketPrice());
-            cartEntity.setRetailPrice(goods.getRetailPrice());
+            cartEntity.setMarketPrice(goods.getStoreMarketPrice());
+            cartEntity.setRetailPrice(goods.getStoreRetailPrice());
             cartEntity.setNumber(1);
             cartEntity.setStockNum(Integer.parseInt(goods.getStockNum()));
             cartEntity.setListPicUrl(goods.getListPicUrl());
@@ -93,7 +94,7 @@ public class OfflineCartServiceImpl implements OfflineCartService {
             cartEntity.setCreateTime(new Date());
             save(cartEntity);
         }
-        Map map= new HashMap();
+        Map map= Maps.newHashMap();
         map.put("userId",user.getUserId());
         map.put("storeId",goods.getStoreId());
         return offlineCartDao.queryOfflineCartByBizType(map);

+ 25 - 18
kmall-admin/src/main/java/com/kmall/admin/service/impl/OrderServiceImpl.java

@@ -1,6 +1,7 @@
 package com.kmall.admin.service.impl;
 
 import com.alibaba.fastjson.JSONObject;
+import com.google.common.collect.Maps;
 import com.kmall.admin.dao.*;
 import com.kmall.admin.entity.*;
 import com.kmall.admin.entity.OrderProcessRecordEntity;
@@ -10,12 +11,9 @@ import com.kmall.api.service.merch.OmsMerchPropertiesBuilder;
 import com.kmall.api.util.CommonUtil;
 import com.kmall.common.entity.SysUserEntity;
 import com.kmall.common.service.print.ticket.PrintTicketPropertiesBuilder;
-import com.kmall.common.utils.Constant;
-import com.kmall.common.utils.ShiroUtils;
+import com.kmall.common.utils.*;
 import com.kmall.common.utils.print.ticket.TicketPrintUtil;
 import com.kmall.common.utils.print.ticket.item.*;
-import com.kmall.common.utils.RRException;
-import com.kmall.common.utils.StringUtils;
 import com.kmall.common.utils.express.kdn.KdniaoUtil;
 import com.kmall.common.utils.wechat.WechatRefundApiResult;
 import com.kmall.common.utils.wechat.wxglobal.dto.WechatGlobalRefundApiResult;
@@ -29,8 +27,7 @@ import java.util.*;
 
 
 @Service("orderService")
-public class OrderServiceImpl
-        implements OrderService {
+public class OrderServiceImpl implements OrderService {
     @Autowired
     private OrderDao orderDao;
     @Autowired
@@ -464,21 +461,21 @@ public class OrderServiceImpl
     }
 
     @Override
-    public int getUserOrderInfo(Map<String, Object> params) {
+    public int getUserOrderInfo(Map<String, Object> map) {
         int result = 0;
-        String type = (String) params.get("type");
+        String type = (String) map.get("type");
         if ("yfkOrderUserSum".equals(type)) {
-            result = orderDao.getYfkOrderUserSum();
+            result = orderDao.getYfkOrderUserSum(map);
         } else if ("oderUserSum".equals(type)) {
-            result = orderDao.getOderUserSum();
+            result = orderDao.getOderUserSum(map);
         } else if ("todayUserOrder".equals(type)) {
-            result = orderDao.getTodayUserOrder();
+            result = orderDao.getTodayUserOrder(map);
         } else if ("todayUserSales".equals(type)) {
-            result = orderDao.getTodayUserSales();
+            result = orderDao.getTodayUserSales(map);
         } else if ("incomeSum".equals(type)) {
-            result = orderDao.getIncomeSum();
+            result = orderDao.getIncomeSum(map);
         } else if ("payedOrderCount".equals(type)) {
-            result = orderDao.getPayedOrderCount();
+            result = orderDao.getPayedOrderCount(map);
         }
         return result;
     }
@@ -500,7 +497,7 @@ public class OrderServiceImpl
             }
         }
 
-        Map logisticsInfo = new HashMap();
+        Map logisticsInfo = Maps.newHashMap();
         List<WuliuEntity> wuliuEntityList = new ArrayList<>();
         OrderProcessRecordEntity orderProcessRecordEntity =
                 orderProcessRecordDao.queryObjectByOrderSn(orderEntity.getOrderSn());
@@ -606,7 +603,7 @@ public class OrderServiceImpl
     @Transactional
     @Override
     public Map orderSubmit(List<OfflineCartEntity> offlineCartList, SysUserEntity user) {
-        Map resultObj = new HashMap();
+        Map resultObj = Maps.newHashMap();
         try {
             if (user == null) {
                 resultObj.put("errno", 400);
@@ -626,7 +623,7 @@ public class OrderServiceImpl
             Long userId = user.getUserId();
             Integer storeId = user.getStoreId();
             //获取要购买的商品
-            Map param = new HashMap();
+            Map param = Maps.newHashMap();
             param.put("userId", userId);
             param.put("storeId", storeId);
             if (null == offlineCartList && offlineCartList.size() == 0) {
@@ -684,7 +681,7 @@ public class OrderServiceImpl
                 }
                 //清空预订单商品临时表
                 offlineCartDao.deleteByUserId(userId);
-                Map orderInfoMap = new HashMap();
+                Map orderInfoMap = Maps.newHashMap();
                 orderInfoMap.put("orderInfo", order);
                 resultObj.put("errno", 0);
                 resultObj.put("errmsg", "订单提交成功");
@@ -834,6 +831,16 @@ public class OrderServiceImpl
     }
 
     @Override
+    public List<OrderEntity> queryExportList(Map<String, Object> map) {
+        List<OrderEntity> list = orderDao.queryExportList(map);
+        for (OrderEntity order : list) {
+            OrderProcessRecordEntity orderProcessRecord = orderProcessRecordDao.queryObjectByOrderSn(order.getOrderSn());
+            order.setOrderProcessRecord(orderProcessRecord);
+        }
+        return list;
+    }
+
+    @Override
     public List<OrderEntity> queryOffilineOrderList(Map<String, Object> map) {
         return orderDao.queryOffilineOrderList(map);
     }

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

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

+ 122 - 26
kmall-admin/src/main/java/com/kmall/admin/service/impl/ProductStoreRelaServiceImpl.java

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

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

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

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

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

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

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

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

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

+ 40 - 0
kmall-admin/src/main/resources/conf/cus.properties

@@ -0,0 +1,40 @@
+########## 海关 配置 ##########
+
+# [dev, prod]
+cus.env = dev
+
+# 开发环境
+# 企业返回海关实时数据接口地址
+cus.dev.payDateUrl=https://swapptest.singlewindow.cn/ceb2grab/grab/realTimeDataUpload
+# 电商平台代码, 中网科技(深圳)有限公司
+cus.dev.ebpCode=4403160Z3Y
+# 支付企业代码, 财付通支付科技有限公司
+cus.dev.payCode=440316T004
+# 收款账号
+cus.dev.recpAccount=20000032506200012146872
+# 收款企业代码(境内企业为统一社会信用代码;境外企业可不填写)
+cus.dev.recpCode=91440300MA5DGG1J0R
+# 收款企业名称
+cus.dev.recpName=中网科技(深圳)有限公司
+# 商品展示链接地址
+cus.dev.itemLink=http://qhdswl.f3322.net:9002/api/goods/detail
+# 定时器请求地址
+cus.dev.sendUrl=http://qhdswl.f3322.net:9002/cus/send
+
+# 生产环境
+# 企业返回海关实时数据接口地址
+cus.prod.payDateUrl=https://customs.chinaport.gov.cn/ceb2grab/grab/realTimeDataUpload
+#电商平台代码, 中网科技(深圳)有限公司
+cus.prod.ebpCode=4403160Z3Y
+#支付企业代码, 财付通支付科技有限公司
+cus.prod.payCode=440316T004
+# 收款账号
+cus.prod.recpAccount=20000032506200012146872
+# 收款企业代码(境内企业为统一社会信用代码;境外企业可不填写)
+cus.prod.recpCode=91440300MA5DGG1J0R
+# 收款企业名称
+cus.prod.recpName=中网科技(深圳)有限公司
+# 商品展示链接地址
+cus.prod.itemLink=https://mp.k1net.cn/api/goods/detail
+# 定时器请求地址
+cus.prod.sendUrl=https://mp.k1net.cn/cus/send

+ 11 - 11
kmall-admin/src/main/resources/conf/redis.properties

@@ -13,20 +13,20 @@ redis.dev.pool.maxTotal=10000
 redis.dev.pool.testOnBorrow=true
 
 
-# 中网生产环境
-redis.prod.keyPrefix=platform
-redis.prod.host=183.3.221.143
-redis.prod.port=6379
-redis.prod.pool.maxIdle=200
-redis.prod.pool.maxWait=1000
-redis.prod.pool.maxTotal=10000
-redis.prod.pool.testOnBorrow=true
-
-## 中网国际生产环境
+## 中网生产环境
 #redis.prod.keyPrefix=platform
-#redis.prod.host=183.62.225.124
+#redis.prod.host=183.3.221.143
 #redis.prod.port=6379
 #redis.prod.pool.maxIdle=200
 #redis.prod.pool.maxWait=1000
 #redis.prod.pool.maxTotal=10000
 #redis.prod.pool.testOnBorrow=true
+
+# 中网国际生产环境
+redis.prod.keyPrefix=platform
+redis.prod.host=183.62.225.124
+redis.prod.port=6379
+redis.prod.pool.maxIdle=200
+redis.prod.pool.maxWait=1000
+redis.prod.pool.maxTotal=10000
+redis.prod.pool.testOnBorrow=true

+ 7 - 0
kmall-admin/src/main/resources/conf/websocket.properties

@@ -0,0 +1,7 @@
+########## websocket 配置 ##########
+
+websocket.wsUrl=ws://qhdswl.f3322.net:61232
+websocket.cusSignMethod=cus-sec_SpcSignDataAsPEM
+websocket.opCardPwd=88888888
+websocket.cardNo=012fa6a7
+websocket.id=1

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

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

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

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

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

@@ -46,6 +46,9 @@
         <if test="merchSn != null and merchSn.trim() != ''">
             and d.merch_sn = #{merchSn}
         </if>
+        <if test="goodsId != null">
+            and a.goods_id = #{goodsId}
+        </if>
         <if test="userId != null">
             AND a.user_id = #{userId}
         </if>
@@ -76,6 +79,9 @@
         <if test="merchSn != null and merchSn.trim() != ''">
             and d.merch_sn = #{merchSn}
         </if>
+        <if test="goodsId != null">
+            and a.goods_id = #{goodsId}
+        </if>
         <if test="userId != null">
             AND mall_cart.user_id = #{userId}
         </if>

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

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

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

@@ -57,6 +57,7 @@
         mall_goods.name value_name
         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
         WHERE 1=1
         <if test="userName != null and userName.trim() != ''">
             AND mall_user.username LIKE concat('%',#{userName},'%')
@@ -64,6 +65,9 @@
         <if test="valueName != null and valueName.trim() != ''">
             AND mall_goods.name LIKE concat('%',#{valueName},'%')
         </if>
+        <if test="storeId != null and storeId != ''">
+            AND o.store_id = #{storeId}
+        </if>
         <if test="status != null">
             AND mall_comment.status = #{status}
         </if>

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

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

+ 56 - 60
kmall-admin/src/main/resources/mybatis/mapper/GoodsDao.xml

@@ -6,11 +6,11 @@
     <resultMap type="com.kmall.admin.entity.GoodsEntity" id="goodsMap">
         <result property="id" column="id"/>
         <result property="merchSn" column="merch_sn"/>
-        <result property="categoryId" column="category_id"/>
+        <!--<result property="categoryId" column="category_id"/>-->
         <result property="goodsSn" column="goods_sn"/>
         <result property="name" column="name"/>
-        <result property="brandId" column="brand_id"/>
-        <result property="freightId" column="freight_id"/>
+        <!--<result property="brandId" column="brand_id"/>-->
+        <!--<result property="freightId" column="freight_id"/>-->
         <result property="brand" column="brand"/>
         <result property="goodsNumber" column="goods_number"/>
         <result property="keywords" column="keywords"/>
@@ -20,14 +20,14 @@
         <result property="addTime" column="add_time"/>
         <result property="sortOrder" column="sort_order"/>
         <result property="isDelete" column="is_delete"/>
-        <result property="attributeCategory" column="attribute_category"/>
+        <!--<result property="attributeCategory" column="attribute_category"/>-->
         <result property="counterPrice" column="counter_price"/>
         <result property="extraPrice" column="extra_price"/>
         <result property="isNew" column="is_new"/>
         <result property="goodsUnit" column="goods_unit"/>
         <result property="primaryPicUrl" column="primary_pic_url"/>
         <result property="listPicUrl" column="list_pic_url"/>
-        <result property="retailPrice" column="retail_price"/>
+        <!--<result property="retailPrice" column="retail_price"/>-->
         <result property="sellVolume" column="sell_volume"/>
         <result property="primaryProductId" column="primary_product_id"/>
         <result property="unitPrice" column="unit_price"/>
@@ -37,7 +37,7 @@
         <result property="isAppExclusive" column="is_app_exclusive"/>
         <result property="isLimited" column="is_limited"/>
         <result property="isHot" column="is_hot"/>
-        <result property="marketPrice" column="market_price"/>
+        <!--<result property="marketPrice" column="market_price"/>-->
         <result property="goodsType" column="goodsType"/>
         <result property="sku" column="sku"/>
         <result property="goodsBizType" column="goods_biz_type"/>
@@ -59,6 +59,10 @@
         <result property="storeName" column="store_name"/>
         <result property="productId" column="productId"/>
         <result property="storeId" column="storeId"/>
+        <result column="merch_name" property="merchName" />
+        <result column="storeMarketPrice" property="storeMarketPrice" />
+        <result column="storeRetailPrice" property="storeRetailPrice" />
+        <result column="third_party_merch_code" property="thirdPartyMerchCode" />
     </resultMap>
 
     <select id="queryObject" resultType="com.kmall.admin.entity.GoodsEntity">
@@ -74,12 +78,12 @@
 
     <select id="queryObjectByProdBarcodeAndBizType" resultType="com.kmall.admin.entity.GoodsEntity">
         SELECT
-            a.id,a.sku,a.goods_sn,a.name,a.list_pic_url,a.prod_barcode,r.market_price,r.retail_price,r.stock_num,s.store_name,r.product_id,s.id 'storeId'
+            a.id,a.sku,a.goods_sn,a.name,a.list_pic_url,a.prod_barcode,r.market_price storeMarketPrice,r.retail_price storeRetailPrice ,r.stock_num,s.store_name,r.product_id,s.id 'storeId'
         FROM
             mall_goods a
         LEFT JOIN mall_product_store_rela r ON r.goods_id = a.id
         inner join mall_store s on r.store_id=s.id
-        where a.prod_barcode = #{prodBarcode} and a.goods_biz_type = 11
+        where a.prod_barcode = #{prodBarcode} and a.goods_biz_type = 11 and r.store_id = #{storeId}
     </select>
 
     <select id="queryObjectByProdBarcode" resultType="com.kmall.admin.entity.GoodsEntity">
@@ -110,28 +114,30 @@
     <select id="queryList" resultType="com.kmall.admin.entity.GoodsEntity">
         select
         mall_goods.*,
-        mall_category.name category_name,
-        mall_brand.name brand_name,
-        mall_freight.name freight_name,
-        case when mall_goods_group.id > 0 then 2 else 0 end as goodsType
+        case when mall_goods_group.id > 0 then 2 else 0 end as goodsType,
+        m.merch_name merchName
         from mall_goods
-        LEFT JOIN mall_category ON mall_goods.category_id = mall_category.id
-        LEFT JOIN mall_brand ON mall_brand.id = mall_goods.brand_id
+        left join mall_merch m on mall_goods.merch_sn = m.merch_sn
         left join mall_goods_group on mall_goods_group.goods_id = mall_goods.id and mall_goods_group.open_status != 3
-        left join mall_freight on mall_goods.freight_id = mall_freight.id
         WHERE 1=1
         <!--  数据过滤  -->
         ${filterSql}
         <if test="merchSn != null and merchSn.trim() != ''">
             AND mall_goods.merch_sn = #{merchSn}
         </if>
+        <if test="prodBarcode != null and prodBarcode.trim() != ''">
+            AND mall_goods.prod_barcode = #{prodBarcode}
+        </if>
+        <if test="thirdPartyMerchCode != null and thirdPartyMerchCode.trim() != ''">
+            AND mall_goods.third_party_merch_code = #{thirdPartyMerchCode}
+        </if>
         <if test="goodsSn != null and goodsSn != ''">
             AND mall_goods.goods_sn like concat('%',#{goodsSn},'%')
         </if>
         <if test="name != null and name != ''">
             AND mall_goods.name LIKE concat('%',#{name},'%')
         </if>
-        <if test="freightId != null and freightId != ''">
+        <!--<if test="freightId != null and freightId != ''">
             AND mall_goods.freight_id = #{freightId}
         </if>
         <if test="brandId != null and brandId != ''">
@@ -139,22 +145,29 @@
         </if>
         <if test="categoryId != null and categoryId != ''">
             AND mall_goods.category_id = #{categoryId}
-        </if>
+        </if>-->
         <if test="sku != null and sku != ''">
             AND mall_goods.sku LIKE concat('%',#{sku},'%')
         </if>
-        <if test="category != null and category != ''">
+        <!--<if test="category != null and category != ''">
             AND mall_goods.category_id IN (select id from mall_category where parent_id = #{category})
         </if>
         <if test="categoryTwo != null and categoryTwo != ''">
             AND mall_goods.category_id = #{categoryTwo}
-        </if>
-        <if test="isDelete != null and isDelete != ''">
+        </if>-->
+        <if test="isDelete != null">
             AND mall_goods.is_Delete = #{isDelete}
         </if>
+        <if test="isOnSale != null">
+            AND mall_goods.is_on_sale = #{isOnSale}
+        </if>
         <if test="goodsBizType != null and goodsBizType != ''">
             AND mall_goods.goods_biz_type = #{goodsBizType}
         </if>
+        <if test="storeId != null and storeId != ''">
+            AND mall_goods.id not in (select goods_id from mall_product_store_rela where store_id = #{storeId})
+        </if>
+
         <choose>
             <when test="sidx != null and sidx.trim() != ''">
                 order by ${sidx} ${order}
@@ -171,15 +184,9 @@
     <select id="querySame" resultType="com.kmall.admin.entity.GoodsEntity">
         select
         mall_goods.*,
-        mall_category.name category_name,
-        mall_brand.name brand_name,
-        mall_freight.name freight_name,
         case when mall_goods_group.id > 0 then 2 else 0 end as goodsType
         from mall_goods
-        LEFT JOIN mall_category ON mall_goods.category_id = mall_category.id
-        LEFT JOIN mall_brand ON mall_brand.id = mall_goods.brand_id
         left join mall_goods_group on mall_goods_group.goods_id = mall_goods.id and mall_goods_group.open_status != 3
-        left join mall_freight on mall_goods.freight_id = mall_freight.id
         WHERE 1=1
         <!--  数据过滤  -->
         ${filterSql}
@@ -203,45 +210,49 @@
     </select>
 
     <select id="queryTotal" resultType="int">
-        select count(*) from mall_goods WHERE 1=1
+        select count(*) from mall_goods
+        left join mall_merch m on mall_goods.merch_sn = m.merch_sn
+        left join mall_goods_group on mall_goods_group.goods_id = mall_goods.id and mall_goods_group.open_status != 3
+        WHERE 1=1
         <!--  数据过滤  -->
         ${filterSql}
         <if test="merchSn != null and merchSn.trim() != ''">
             AND mall_goods.merch_sn = #{merchSn}
         </if>
+        <if test="prodBarcode != null and prodBarcode.trim() != ''">
+            AND mall_goods.prod_barcode = #{prodBarcode}
+        </if>
+        <if test="thirdPartyMerchCode != null and thirdPartyMerchCode.trim() != ''">
+            AND mall_goods.third_party_merch_code = #{thirdPartyMerchCode}
+        </if>
         <if test="goodsSn != null and goodsSn != ''">
             AND mall_goods.goods_sn like concat('%',#{goodsSn},'%')
         </if>
         <if test="name != null and name != ''">
             AND mall_goods.name LIKE concat('%',#{name},'%')
         </if>
-        <if test="freightId != null and freightId != ''">
-            AND mall_goods.freight_id = #{freightId}
-        </if>
-        <if test="brandId != null and brandId != ''">
-            AND mall_goods.brand_id = #{brandId}
-        </if>
-        <if test="categoryId != null and categoryId != ''">
-            AND mall_goods.category_id = #{categoryId}
-        </if>
         <if test="sku != null and sku != ''">
             AND mall_goods.sku LIKE concat('%',#{sku},'%')
         </if>
-        <if test="category != null and category != ''">
-            AND mall_goods.category_id IN (select id from mall_category where parent_id = #{category})
+        <if test="isDelete != null">
+            AND mall_goods.is_Delete = #{isDelete}
         </if>
-        <if test="categoryTwo != null and categoryTwo != ''">
-            AND mall_goods.category_id = #{categoryTwo}
+        <if test="isOnSale != null">
+            AND mall_goods.is_on_sale = #{isOnSale}
         </if>
-        <if test="isDelete != null and isDelete != ''">
-            AND mall_goods.is_Delete = #{isDelete}
+        <if test="goodsBizType != null and goodsBizType != ''">
+            AND mall_goods.goods_biz_type = #{goodsBizType}
+        </if>
+        <if test="storeId != null and storeId != ''">
+            AND mall_goods.id not in (select goods_id from mall_product_store_rela where store_id = #{storeId})
         </if>
+
     </select>
 
     <insert id="save" parameterType="com.kmall.admin.entity.GoodsEntity" useGeneratedKeys="true" keyProperty="id">
         insert into mall_goods(
             `merch_sn`,
-			`category_id`,
+            third_party_merch_code,
             `supplier_id`,
 			`goods_sn`,
 			`prod_barcode`,
@@ -249,9 +260,7 @@
 			`goods_biz_type`,
 			`name`,
 			`unit_code`,
-			`brand_id`,
 			`brand`,
-			`freight_id`,
 			`goods_number`,
 			`keywords`,
 			`goods_brief`,
@@ -265,7 +274,6 @@
 			`add_time`,
 			`sort_order`,
 			`is_delete`,
-			`attribute_category`,
 			`counter_price`,
 			`extra_price`,
 			`is_new`,
@@ -273,7 +281,6 @@
 			`primary_pic_url`,
 			`list_pic_url`,
 			`goods_rate`,
-			`retail_price`,
 			`sell_volume`,
 			`primary_product_id`,
 			`unit_price`,
@@ -283,7 +290,6 @@
 			`is_app_exclusive`,
 			`is_limited`,
 			`is_hot`,
-			`market_price`,
 			`creater_sn`,
 			`create_time`,
 			`moder_sn`,
@@ -291,7 +297,7 @@
 			`tstm`)
 		values(
 			#{merchSn},
-			#{categoryId},
+            #{thirdPartyMerchCode},
             #{supplierId},
 			#{goodsSn},
 			#{prodBarcode},
@@ -299,9 +305,7 @@
 			#{goodsBizType},
 			#{name},
 			#{unitCode},
-			#{brandId},
 			#{brand},
-			#{freightId},
 			#{goodsNumber},
 			#{keywords},
 			#{goodsBrief},
@@ -315,7 +319,6 @@
 			#{addTime},
 			#{sortOrder},
 			#{isDelete},
-			#{attributeCategory},
 			#{counterPrice},
 			#{extraPrice},
 			#{isNew},
@@ -323,7 +326,6 @@
 			#{primaryPicUrl},
 			#{listPicUrl},
 			#{goodsRate},
-			#{retailPrice},
 			#{sellVolume},
 			#{primaryProductId},
 			#{unitPrice},
@@ -333,7 +335,6 @@
 			#{isAppExclusive},
 			#{isLimited},
 			#{isHot},
-			#{marketPrice},
 			#{createrSn},
 			#{createTime},
 			#{moderSn},
@@ -345,7 +346,7 @@
         update mall_goods
         <set>
             <if test="merchSn != null">`merch_sn` = #{merchSn}, </if>
-            <if test="categoryId != null">`category_id` = #{categoryId}, </if>
+            <if test="thirdPartyMerchCode != null">`third_party_merch_code` = #{thirdPartyMerchCode}, </if>
             <if test="supplierId != null">`supplier_id` = #{supplierId}, </if>
             <if test="goodsSn != null">`goods_sn` = #{goodsSn}, </if>
             <if test="prodBarcode != null">`prod_barcode` = #{prodBarcode}, </if>
@@ -353,9 +354,7 @@
             <if test="goodsBizType != null">`goods_biz_type` = #{goodsBizType}, </if>
             <if test="name != null">`name` = #{name}, </if>
             <if test="unitCode != null">`unit_code` = #{unitCode}, </if>
-            <if test="brandId != null">`brand_id` = #{brandId}, </if>
             <if test="brand != null">`brand` = #{brand}, </if>
-            <if test="freightId != null">`freight_id` = #{freightId}, </if>
             <if test="goodsNumber != null">`goods_number` = #{goodsNumber}, </if>
             <if test="keywords != null">`keywords` = #{keywords}, </if>
             <if test="goodsBrief != null">`goods_brief` = #{goodsBrief}, </if>
@@ -369,7 +368,6 @@
             <if test="addTime != null">`add_time` = #{addTime}, </if>
             <if test="sortOrder != null">`sort_order` = #{sortOrder}, </if>
             <if test="isDelete != null">`is_delete` = #{isDelete}, </if>
-            <if test="attributeCategory != null">`attribute_category` = #{attributeCategory}, </if>
             <if test="counterPrice != null">`counter_price` = #{counterPrice}, </if>
             <if test="extraPrice != null">`extra_price` = #{extraPrice}, </if>
             <if test="isNew != null">`is_new` = #{isNew}, </if>
@@ -377,7 +375,6 @@
             <if test="primaryPicUrl != null">`primary_pic_url` = #{primaryPicUrl}, </if>
             <if test="listPicUrl != null">`list_pic_url` = #{listPicUrl}, </if>
             <if test="goodsRate != null">`goods_rate` = #{goodsRate}, </if>
-            <if test="retailPrice != null">`retail_price` = #{retailPrice}, </if>
             <if test="sellVolume != null">`sell_volume` = #{sellVolume}, </if>
             <if test="primaryProductId != null">`primary_product_id` = #{primaryProductId}, </if>
             <if test="unitPrice != null">`unit_price` = #{unitPrice}, </if>
@@ -387,7 +384,6 @@
             <if test="isAppExclusive != null">`is_app_exclusive` = #{isAppExclusive}, </if>
             <if test="isLimited != null">`is_limited` = #{isLimited}, </if>
             <if test="isHot != null">`is_hot` = #{isHot}, </if>
-            <if test="marketPrice != null">`market_price` = #{marketPrice}, </if>
             <if test="createrSn != null">`creater_sn` = #{createrSn}, </if>
             <if test="createTime != null">`create_time` = #{createTime}, </if>
             <if test="moderSn != null">`moder_sn` = #{moderSn}, </if>

+ 139 - 5
kmall-admin/src/main/resources/mybatis/mapper/OrderDao.xml

@@ -6,6 +6,7 @@
     <!-- 可根据自己的需求,是否要使用 -->
     <resultMap type="com.kmall.admin.entity.OrderEntity" id="orderMap">
         <result property="id" column="id"/>
+        <result property="merchOrderSn" column="merch_order_sn"/>
         <result property="orderSn" column="order_sn"/>
         <result property="userId" column="user_id"/>
         <result property="orderStatus" column="order_status"/>
@@ -58,6 +59,8 @@
         <result property="modTime" column="mod_time"/>
         <result property="isOnfflineOrder" column="is_onffline_order"/>
         <result property="orderSnWx" column="order_sn_wx"/>
+        <result property="isMergePay" column="is_merge_pay"/>
+        <result property="payTransactionId" column="pay_transaction_id"/>
     </resultMap>
 
     <select id="queryObject" resultType="com.kmall.admin.entity.OrderEntity">
@@ -101,9 +104,87 @@
         LEFT JOIN mall_user u ON o.user_id = u.id
         LEFT JOIN mall_order_process_record p ON o.order_sn = p.order_sn
         WHERE 1=1
+        <if test="startTime != null and startTime != ''">
+            AND o.add_time <![CDATA[ >  ]]> #{startTime}
+        </if>
+        <if test="endTime != null and endTime != ''">
+            AND o.add_time <![CDATA[ <  ]]> #{endTime}
+        </if>
         <if test="storeId != null and storeId != ''">
             AND o.store_id = #{storeId}
         </if>
+        <if test="merchOrderSn != null and merchOrderSn.trim() != ''">
+            AND o.merch_order_sn = #{merchOrderSn}
+        </if>
+        <if test="merchSn != null and merchSn.trim() != ''">
+            AND o.merch_sn = #{merchSn}
+        </if>
+        <if test="orderSn != null and orderSn.trim() != ''">
+            AND o.order_sn LIKE concat('%',#{orderSn},'%')
+        </if>
+        <if test="shippingStatus != null">
+            AND o.shipping_status = #{shippingStatus}
+        </if>
+        <if test="payStatus != null">
+            AND o.pay_status = #{payStatus}
+        </if>
+        <if test="orderStatus != null and orderStatus.trim() != ''">
+            AND o.order_status = #{orderStatus}
+        </if>
+        <if test="shippingId != null and shippingId != 0">
+            AND o.shipping_id = #{shippingId}
+        </if>
+        <if test="orderType != null and orderType.trim() != ''">
+            AND o.order_type = #{orderType}
+        </if>
+        <if test="isOnfiilineOrder != null">
+            AND o.is_onffline_order = #{isOnfiilineOrder}
+        </if>
+        <if test="ids != null and ids.trim() != ''">
+            AND o.id in (${ids})
+        </if>
+        <choose>
+            <when test="sidx != null and sidx.trim() != ''">
+                order by ${sidx} ${order}
+            </when>
+            <otherwise>
+                order by id desc
+            </otherwise>
+        </choose>
+        <if test="offset != null and limit != null">
+            limit #{offset}, #{limit}
+        </if>
+    </select>
+
+    <select id="queryExportList" resultType="com.kmall.admin.entity.OrderEntity">
+        SELECT
+            o.*,
+            u.username AS username,
+            p.is_payment_send,
+            p.is_ele_order_send,
+            p.is_customs_send,
+            g.sku,
+            g.goods_name,
+            g.number,
+            g.retail_price
+        FROM
+          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_order_goods g on o.id = g.order_id
+        WHERE 1=1
+        <if test="startTime != null and startTime != ''">
+            AND o.add_time <![CDATA[ >  ]]> #{startTime}
+        </if>
+        <if test="endTime != null and endTime != ''">
+            AND o.add_time <![CDATA[ <  ]]> #{endTime}
+        </if>
+        <if test="storeId != null and storeId != ''">
+            AND o.store_id = #{storeId}
+        </if>
+        <if test="merchOrderSn != null and merchOrderSn.trim() != ''">
+            AND o.merch_order_sn = #{merchOrderSn}
+        </if>
         <if test="merchSn != null and merchSn.trim() != ''">
             AND o.merch_sn = #{merchSn}
         </if>
@@ -146,9 +227,18 @@
 
     <select id="queryTotal" resultType="int">
         select count(*) from mall_order o WHERE 1=1
+        <if test="startTime != null and startTime != ''">
+            AND o.add_time <![CDATA[ >  ]]> #{startTime}
+        </if>
+        <if test="endTime != null and endTime != ''">
+            AND o.add_time <![CDATA[ <  ]]> #{endTime}
+        </if>
         <if test="storeId != null and storeId != ''">
             AND o.store_id = #{storeId}
         </if>
+        <if test="merchOrderSn != null and merchOrderSn.trim() != ''">
+            AND o.merch_order_sn = #{merchOrderSn}
+        </if>
         <if test="merchSn != null and merchSn.trim() != ''">
             AND o.merch_sn = #{merchSn}
         </if>
@@ -396,21 +486,65 @@
     </update>
 
     <select id="getYfkOrderUserSum" resultType="int">
-        select count(1) from (select user_id,count(user_id) as counts from mall_order where pay_status = 2 group by user_id) u
+        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
+        where pay_status = 2
+        <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>
+        group by o.user_id) u
     </select>
     <select id="getOderUserSum" resultType="int">
-        select count(1) from (select user_id,count(user_id) as counts from mall_order group by user_id) u
+        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
+        where 1=1
+        <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>
+        group by o.user_id) u
     </select>
     <select id="getTodayUserOrder" resultType="int">
-        select count(1) from mall_order where pay_status = 2 and pay_time > date_format(sysdate(), '%Y-%m-%d')
+        select count(1) from mall_order o 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>
+
     </select>
     <select id="getTodayUserSales" resultType="int">
-        select ifnull(sum(actual_price),0) from mall_order where pay_status = 2 and pay_time > date_format(sysdate(), '%Y-%m-%d')
+        select ifnull(sum(actual_price),0) from mall_order o 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>
+
     </select>
     <select id="getIncomeSum" resultType="int">
         select ifnull(sum(actual_price),0) from mall_order where pay_status = 2
+        <if test="storeId != null and storeId != ''">
+            AND store_id = #{storeId}
+        </if>
+        <if test="merchSn != null and merchSn.trim() != ''">
+            AND merch_sn = #{merchSn}
+        </if>
     </select>
     <select id="getPayedOrderCount" resultType="int">
-        select count(1) from mall_order where pay_status = 2
+        select count(1) from mall_order where pay_status = 2 and is_onffline_order = 0
+        <if test="storeId != null and storeId != ''">
+            AND store_id = #{storeId}
+        </if>
+        <if test="merchSn != null and merchSn.trim() != ''">
+            AND merch_sn = #{merchSn}
+        </if>
     </select>
 </mapper>

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

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

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

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

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

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

+ 8 - 4
kmall-admin/src/main/resources/mybatis/mapper/StoreDao.xml

@@ -25,6 +25,7 @@
 
 		<result property="thirdPartyMerchCode" column="third_party_merch_code"/>
 		<result property="thirdPartyMerchName" column="third_party_merch_name"/>
+		<result property="exprAgreementType" column="expr_agreement_type"/>
     </resultMap>
 
 	<select id="queryObject" resultType="com.kmall.admin.entity.StoreEntity">
@@ -40,7 +41,7 @@
 			`county_name`,
 			`latitude`,
 			`longitude`,
-			`cover_radius`,
+			`cover_radius`,expr_agreement_type,
 			`remark`,merch_sn, merch_name, creater_sn, create_time,third_party_merch_code,third_party_merch_name,
 		moder_sn, mod_time, tstm
 		from mall_store
@@ -60,7 +61,7 @@
 		`county_name`,
 		`latitude`,
 		`longitude`,
-		`cover_radius`,
+		`cover_radius`,expr_agreement_type,
 		`remark`,merch_sn, merch_name, creater_sn, create_time,third_party_merch_code,third_party_merch_name,
     moder_sn, mod_time, tstm
 		from mall_store
@@ -81,7 +82,7 @@
     		`latitude`,
     		`longitude`,
     		`cover_radius`,
-    		`remark`,merch_sn, merch_name, creater_sn, create_time,third_party_merch_code,third_party_merch_name,
+    		`remark`,merch_sn, merch_name, creater_sn, create_time,third_party_merch_code,third_party_merch_name,expr_agreement_type,
 		moder_sn, mod_time, tstm
 		from mall_store
 		WHERE 1=1
@@ -126,7 +127,7 @@
 			AND id = #{id}
 		</if>
 	</select>
-	 
+
 	<insert id="save" parameterType="com.kmall.admin.entity.StoreEntity" useGeneratedKeys="true" keyProperty="id">
 		insert into mall_store(
 			`merch_sn`,
@@ -143,6 +144,7 @@
 			`remark`,
 			third_party_merch_code,
 			third_party_merch_name,
+			expr_agreement_type,
 			creater_sn,
 			create_time,
 			moder_sn,
@@ -163,6 +165,7 @@
 			#{remark},
 			#{thirdPartyMerchCode},
 			#{thirdPartyMerchName},
+			#{exprAgreementType},
 			#{createrSn},
 			#{createTime},
 			#{moderSn},
@@ -189,6 +192,7 @@
 			<if test="createTime != null" >create_time = #{createTime},</if>
 			<if test="thirdPartyMerchCode != null" >third_party_merch_code = #{thirdPartyMerchCode},</if>
 			<if test="thirdPartyMerchName != null" >third_party_merch_name = #{thirdPartyMerchName},</if>
+			<if test="exprAgreementType != null" >expr_agreement_type = #{exprAgreementType},</if>
 			<if test="moderSn != null" >moder_sn = #{moderSn},</if>
 			<if test="modTime != null" >mod_time = #{modTime},</if>
 			<if test="tstm != null" >tstm = #{tstm},</if>

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

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

+ 2 - 0
kmall-admin/src/main/resources/spring/spring-context.xml

@@ -25,11 +25,13 @@
                 <value>classpath:conf/db.properties</value>
                 <value>classpath:conf/express-kdn.properties</value>
                 <value>classpath:conf/redis.properties</value>
+                <value>classpath:conf/cus.properties</value>
                 <value>classpath:conf/servlet.properties</value>
                 <value>classpath:conf/wx-mp.properties</value>
                 <value>classpath:conf/wx-global.properties</value>
                 <value>classpath:conf/pingan-pay.properties</value>
                 <value>classpath:conf/oms-merch.properties</value>
+                <value>classpath:conf/websocket.properties</value>
                 <value>classpath:conf/print-ticket.properties</value>
                 <value>classpath:conf/common.properties</value>
                 <value>classpath:conf/fastdfs.properties</value>

+ 38 - 0
kmall-admin/src/main/resources/spring/spring-cus.xml

@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xmlns:aop="http://www.springframework.org/schema/aop"
+       xmlns:mvc="http://www.springframework.org/schema/mvc"
+       xsi:schemaLocation="
+        http://www.springframework.org/schema/beans 
+        http://www.springframework.org/schema/beans/spring-beans-4.2.xsd
+        http://www.springframework.org/schema/context
+        http://www.springframework.org/schema/context/spring-context-4.2.xsd
+     	http://www.springframework.org/schema/aop
+     	http://www.springframework.org/schema/aop/spring-aop-4.2.xsd
+		http://www.springframework.org/schema/mvc
+     	http://www.springframework.org/schema/mvc/spring-mvc-4.2.xsd">
+
+    <bean id="cusProdProperties" class="com.kmall.common.utils.pay.data.open.cus.CusProdProperties">
+        <property name="payDateUrl" value="${cus.prod.payDateUrl}"/>
+        <property name="ebpCode" value="${cus.prod.ebpCode}"/>
+        <property name="payCode" value="${cus.prod.payCode}"/>
+        <property name="recpAccount" value="${cus.prod.recpAccount}"/>
+        <property name="recpCode" value="${cus.prod.recpCode}"/>
+        <property name="recpName" value="${cus.prod.recpName}"/>
+        <property name="itemLink" value="${cus.prod.itemLink}"/>
+        <property name="sendUrl" value="${cus.prod.sendUrl}"/>
+    </bean>
+
+    <bean id="cusDevProperties" class="com.kmall.common.utils.pay.data.open.cus.CusDevProperties">
+        <property name="payDateUrl" value="${cus.dev.payDateUrl}"/>
+        <property name="ebpCode" value="${cus.dev.ebpCode}"/>
+        <property name="payCode" value="${cus.dev.payCode}"/>
+        <property name="recpAccount" value="${cus.dev.recpAccount}"/>
+        <property name="recpCode" value="${cus.dev.recpCode}"/>
+        <property name="recpName" value="${cus.dev.recpName}"/>
+        <property name="itemLink" value="${cus.dev.itemLink}"/>
+        <property name="sendUrl" value="${cus.dev.sendUrl}"/>
+    </bean>
+</beans>

+ 2 - 0
kmall-admin/src/main/resources/spring/spring-main.xml

@@ -16,12 +16,14 @@
 
     <import resource="spring-mvc.xml"/>
     <import resource="spring-redis.xml"/>
+    <import resource="spring-cus.xml"/>
     <import resource="spring-express-kdn.xml"/>
     <import resource="spring-wx-pay.xml"/>
     <import resource="spring-wx-global-pay.xml"/>
     <import resource="spring-pingan-pay.xml"/>
     <import resource="spring-jdbc.xml"/>
     <import resource="spring-oms-merch.xml"/>
+    <import resource="spring-websocket.xml"/>
     <import resource="spring-print-ticket.xml"/>
     <import resource="spring-common.xml"/>
 

+ 25 - 0
kmall-admin/src/main/resources/spring/spring-websocket.xml

@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xmlns:aop="http://www.springframework.org/schema/aop"
+       xmlns:mvc="http://www.springframework.org/schema/mvc"
+       xsi:schemaLocation="
+        http://www.springframework.org/schema/beans 
+        http://www.springframework.org/schema/beans/spring-beans-4.2.xsd
+        http://www.springframework.org/schema/context
+        http://www.springframework.org/schema/context/spring-context-4.2.xsd
+     	http://www.springframework.org/schema/aop
+     	http://www.springframework.org/schema/aop/spring-aop-4.2.xsd
+		http://www.springframework.org/schema/mvc
+     	http://www.springframework.org/schema/mvc/spring-mvc-4.2.xsd">
+
+
+    <bean id="websocketProperties" class="com.kmall.common.utils.pay.data.open.websocket.WebsocketProperties">
+        <property name="wsUrl" value="${websocket.wsUrl}"/>
+        <property name="cusSignMethod" value="${websocket.cusSignMethod}"/>
+        <property name="opCardPwd" value="${websocket.opCardPwd}"/>
+        <property name="cardNo" value="${websocket.cardNo}"/>
+        <property name="id" value="${websocket.id}"/>
+    </bean>
+</beans>

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

@@ -81,7 +81,7 @@
             </Row>
             <Row>
                 <i-col span="16" style="margin-top: -20px;">
-                    <span style="margin-left: 80px;color: red;font-size: 12px;">尺寸建议750*280像素以内,大小2M以下</span>
+                    <span style="margin-left: 80px;color: red;font-size: 12px;">尺寸建议750*400像素以内,大小2M以下</span>
                 </i-col>
             </Row>
             <Form-item label="内容" prop="content">

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

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

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

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

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

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

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

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

+ 17 - 3
kmall-admin/src/main/webapp/WEB-INF/page/shop/order.html

@@ -9,10 +9,13 @@
     <div v-show="showDiv == 1">
         <Row :gutter="16">
             <div class="search-group">
-                <i-col span="4">
+                <i-col span="3">
                     <i-input v-model="q.orderSn" @on-enter="query" placeholder="订单号"/>
                 </i-col>
-                <i-col span="4">
+                <i-col span="3">
+                    <i-input v-model="q.merchOrderSn" @on-enter="query" placeholder="商户订单号"/>
+                </i-col>
+                <i-col span="3">
                     <i-select v-model="q.orderStatus" placeholder="订单状态">
                         <i-option value="0">待付款</i-option>
                         <i-option value="101">订单已取消</i-option>
@@ -21,7 +24,7 @@
                         <i-option value="300">订单已发货</i-option>
                         <i-option value="301">用户确认收货</i-option>
                         <i-option value="401">退款</i-option>
-                        <i-option value="402">完成</i-option>
+                        <!--<i-option value="402">完成</i-option>-->
                     </i-select>
                 </i-col>
                 <!--<i-col span="4">
@@ -30,10 +33,19 @@
                         <i-option value="2">团购订单</i-option>
                     </i-select>
                 </i-col>-->
+                <i-col span="3">
+                    <Date-picker v-model="q.startTime" placeholder="创建订单开始时间"/>
+                </i-col>
+                <i-col span="3">
+                    <Date-picker v-model="q.endTime" placeholder="创建订单结束时间"/>
+                </i-col>
                 <i-button @click="query">查询</i-button>
                 <i-button @click="reloadSearch">重置</i-button>
             </div>
             <div class="buttons-group">
+                #if($shiro.hasPermission("order:export"))
+                <i-button type="primary" @click="exportOrder"><i class="fa fa-cloud-download"></i>&nbsp;导出</i-button>
+                #end
                 #if($shiro.hasPermission("order:getProcess"))
                 <i-button type="success" @click="getProcess">查看清关信息</i-button>
                 #end
@@ -43,7 +55,9 @@
                 #if($shiro.hasPermission("order:confirm"))
                 <i-button type="error" @click="confirm">确认收货</i-button>
                 #end
+                #if($shiro.hasPermission("shop:comment"))
                 <i-button type="info" @click="openComment">评价</i-button>
+                #end
             </div>
         </Row>
         <table id="jqGrid"></table>

+ 6 - 0
kmall-admin/src/main/webapp/WEB-INF/page/shop/shopuser.html

@@ -27,9 +27,15 @@
                 #if($shiro.hasPermission("user:export"))
                 <i-button type="info" @click="exportUser"><i class="fa fa-cloud-download"></i>&nbsp;导出</i-button>
                 #end
+                #if($shiro.hasPermission("shop:usercoupon"))
                 <i-button type="primary" @click="coupon"><i class="fa fa-cc-visa"></i>&nbsp;优惠券</i-button>
+                #end
+                #if($shiro.hasPermission("shop:cart"))
                 <i-button type="primary" @click="shopCart"><i class="fa fa-shopping-cart"></i>&nbsp;购物车</i-button>
+                #end
+                #if($shiro.hasPermission("shop:address"))
                 <i-button type="primary" @click="address"><i class="fa fa-map"></i>&nbsp;收货地址</i-button>
+                #end
             </div>
         </Row>
         <table id="jqGrid"></table>

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

@@ -38,7 +38,7 @@
         <p slot="title">{{title}}</p>
         <i-form ref="formValidate" :model="store" :rules="ruleValidate" :label-width="80">
             <Form-item label="商户编号" prop="merchSn">
-                <i-select v-model="store.merchSn" filterable placeholder="商户编号" label-in-value>
+                <i-select v-model="store.merchSn" filterable placeholder="商户编号" @on-change="showMerchInfo"  label-in-value>
                     <i-option v-for="merch in merchList" :value="merch.merchSn" :key="merch.merchSn">{{merch.merchName}}</i-option>
                 </i-select>
             </Form-item>
@@ -48,12 +48,22 @@
             <Form-item label="门店编号" prop="storeNumber">
                 <i-input v-model="store.storeNumber" placeholder="门店编号"/>
             </Form-item>
-            <Form-item label="第三方商户编号" prop="thirdPartyMerchCode">
-                <i-input v-model="store.thirdPartyMerchCode" placeholder="第三方商户编号"/>
+            <Form-item label="第三方商户编号" prop="merchSn">
+                <i-select v-model="store.thirdPartyMerchCode" placeholder="第三方商户编号" label-in-value>
+                    <i-option v-for="thirdMerchant in thirdMerchantBizList" :value="thirdMerchant.thirdPartyMerchCode" :key="thirdMerchant.thirdPartyMerchCode">{{thirdMerchant.thirdPartyMerchName}}</i-option>
+                </i-select>
             </Form-item>
-            <Form-item label="第三方商户名称" prop="thirdPartyMerchName">
-                <i-input v-model="store.thirdPartyMerchName" placeholder="第三方商户名称"/>
+            <Form-item label="第三方商户快递协议类型" prop="exprAgreementType">
+                <Radio-group v-model="store.exprAgreementType">
+                    <Radio label="00">
+                        <span>e码头</span>
+                    </Radio>
+                    <Radio label="01">
+                        <span>商户自谈</span>
+                    </Radio>
+                </Radio-group>
             </Form-item>
+
             <Form-item label="门店地址" prop="storeAddress">
                 <i-input v-model="store.storeAddress" placeholder="门店地址"/>
             </Form-item>
@@ -88,6 +98,12 @@
         </i-form>
     </Card>
 </div>
+<div id="qrcode" style="display: none;padding: 10px;">
+    <div id="qrcodeCanvas" style="margin: 20px 0 0 55px"></div>
+</div>
+<div id="qrcImg" style="display:none">
+    <img class="qrcImg align-center" height="300px" width="300px" src="">
+</div>
 
 <script src="${rc.contextPath}/js/shop/store.js?_${date.systemTime}"></script>
 </body>

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

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

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

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

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

@@ -115,11 +115,11 @@
             <th colspan="5">会员购买率:<span style="color: red;">{{hygml}}%</span>(会员购买率=已付款订单会员数÷会员总数)</th>
         </tr>
         <tr style='text-align: center;'>
-            <th>会员总数</th>
-            <th>已付款订单会员数</th>
-            <th>有订单会员数</th>
-            <th>今日订单数</th>
-            <th>今日会员购物总额</th>
+            <th style="text-align: center;">会员总数</th>
+            <th style="text-align: center;">已付款订单会员数</th>
+            <th style="text-align: center;">有订单会员数</th>
+            <th style="text-align: center;">今日订单数</th>
+            <th style="text-align: center;">今日会员购物总额</th>
         </tr>
         <tr style='text-align: center;'>
             <td>{{userSum}}</td>
@@ -132,12 +132,12 @@
 
     <table class="table table-hover table-responsive table-bordered">
         <tr>
-            <th colspan="3">每会员平均订单数及购物额(每会员平均订单数=有订单会员数÷会员总数)</th>
+            <th colspan="3">每会员平均订单数及购物额</th>
         </tr>
         <tr style='text-align: center;'>
-            <th>总收入</th>
-            <th>每会员订单数</th>
-            <th>每会员购物数</th>
+            <th style="text-align: center;">总收入</th>
+            <th style="text-align: center;">每会员平均订单数(有订单会员数÷会员总数)</th>
+            <th style="text-align: center;">每会员平均购物数(已支付订单数量÷有订单会员数)</th>
         </tr>
         <tr style='text-align: center;'>
             <td>{{incomeSum}}</td>
@@ -329,8 +329,8 @@
         updated: function () {
             let vue = this;
             vue.hygml = (vue.yfkOrderUserSum / vue.userSum * 100).toFixed(4);
-            vue.mhydds = (vue.oderUserSum / vue.userSum).toFixed(4);
-            vue.mhygws = (vue.payedOrderCount / vue.oderUserSum).toFixed(4);
+            vue.mhydds = (vue.oderUserSum / vue.userSum).toFixed(2);
+            vue.mhygws = (vue.payedOrderCount / vue.oderUserSum).toFixed(2);
             vue.average1000 = (vue.orderSum / vue.hitCount * 1000).toFixed(4);
             vue.averageSales1000 = (vue.incomeSum / vue.hitCount * 1000).toFixed(4);
         }

+ 2 - 0
kmall-admin/src/main/webapp/WEB-INF/web.xml

@@ -11,11 +11,13 @@
             classpath:spring/spring-mvc.xml,
             classpath:spring/spring-express-kdn.xml,
             classpath:spring/spring-redis.xml,
+            classpath:spring/spring-cus.xml,
             classpath:spring/spring-wx-pay.xml,
             classpath:spring/spring-wx-global-pay.xml,
             classpath:spring/spring-pingan-pay.xml,
             classpath:spring/spring-jdbc.xml,,
             classpath:spring/spring-oms-merch.xml,
+            classpath:spring/spring-websocket.xml,
             classpath:spring/spring-print-ticket.xml,
             classpath:spring/spring-common.xml,
             classpath*:kmall-*.xml

+ 15 - 4
kmall-admin/src/main/webapp/index.html

@@ -31,10 +31,9 @@
             <ul class="nav" id="side-menu">
                 <li class="nav-header">
                     <div class="dropdown profile-element"
-                         style="text-align: center;font-size: 18px;font-weight: 600;color: white;">
-                        中网管理后台
+                         style="text-align: center;font-size: 18px;font-weight: 600;color: white;">{{user.roleType == 1 ? '中网管理后台':''}}{{user.roleType == 2 ? store.storeName:''}}{{user.roleType == 3 ? user.merchName:''}}
                     </div>
-                    <div class="logo-element">ZW
+                    <div class="logo-element">{{user.username}}
                     </div>
                 </li>
                 <menu-item :item="item" v-for="item in menuList"></menu-item>
@@ -258,6 +257,9 @@
 <script src="statics/plugins/slimscroll/jquery.slimscroll.min.js"></script>
 <script src="js/common.js"></script>
 <script>
+    $(function () {
+        vm.getUser();
+    });
     //生成菜单
     var menuItem = Vue.extend({
         name: 'menu-item',
@@ -285,7 +287,8 @@
             password: '',
             newPassword: '',
             menuList: {},
-            user: {}
+            user: {},
+            store: {}
         },
         methods: {
             getMenuList: function (event) {
@@ -296,6 +299,14 @@
             getUser: function () {
                 $.getJSON("sys/user/info?_" + $.now(), function (r) {
                     vm.user = r.user;
+                    if(r.user.storeId){
+                        vm.getStore(r.user.storeId);
+                    }
+                });
+            },
+            getStore: function (id) {
+                $.get("store/info/" + id, function (r) {
+                    vm.store = r.store;
                 });
             },
             updatePassword: function () {

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

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

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

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

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

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

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

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

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

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

+ 60 - 10
kmall-admin/src/main/webapp/js/shop/order.js

@@ -2,7 +2,9 @@ $(function () {
     let shippingStatus = getQueryString("shippingStatus");
     let payStatus = getQueryString("payStatus");
     let orderStatus = getQueryString("orderStatus");
-    let orderType = getQueryString("orderType");
+    let merchOrderSn = getQueryString("merchOrderSn");
+    let startTime = getQueryString("startTime");
+    let endTime = getQueryString("endTime");
     let url = '../order/list?1';
     if (shippingStatus) {
         url += '&shippingStatus=' + shippingStatus;
@@ -13,8 +15,14 @@ $(function () {
     if (orderStatus) {
         url += '&orderStatus=' + orderStatus;
     }
-    if (orderType) {
-        url += '&orderType=' + orderType;
+    if (merchOrderSn) {
+        url += '&merchOrderSn=' + merchOrderSn;
+    }
+    if (startTime) {
+        url += '&startTime=' + startTime;
+    }
+    if (endTime) {
+        url += '&endTime=' + endTime;
     }
     $("#jqGrid").jqGrid({
         url: url,
@@ -23,6 +31,19 @@ $(function () {
             {label: 'id', name: 'id', index: 'id', key: true, hidden: true},
             {label: '订单号', name: 'orderSn', index: 'order_sn', width: 100},
             {label: '会员', name: 'userName', index: 'user_name', width: 80},
+            {label: '支付类型', name: 'isMergePay', index: 'is_merge_pay', width: 60,
+                formatter: function (value) {
+                    if (value == '2') {
+                        return '合并支付';
+                    }else if (value == '1') {
+                        return '合并支付';
+                    } else if (value == '0') {
+                        return '单笔支付';
+                    }
+                    return '-';
+                }
+            },
+            {label: '商户订单号', name: 'merchOrderSn', index: 'merchOrderSn', width: 140},
             {
                 label: '订单业务类型', name: 'orderBizType', index: 'order_biz_type', width: 80,
                 formatter: function (value) {
@@ -93,9 +114,9 @@ $(function () {
                     return value;
                 }
             },
-            {label: '收货人', name: 'consignee', index: 'consignee', width: 80},
-            {label: '收货地址', name: 'address', index: 'address', width: 80},
-            {label: '联系电话', name: 'mobile', index: 'mobile', width: 80},
+            // {label: '收货人', name: 'consignee', index: 'consignee', width: 80},
+            // {label: '收货地址', name: 'address', index: 'address', width: 80},
+            // {label: '联系电话', name: 'mobile', index: 'mobile', width: 80},
             {label: '实际支付', name: 'actualPrice', index: 'actual_price', width: 60},
             {label: '订单总价', name: 'orderPrice', index: 'order_price', width: 60},
             {
@@ -127,10 +148,12 @@ $(function () {
                 formatter: function (value, col, row) {
                     let htmlStr = '<button class="btn btn-outline btn-info" onclick="vm.lookDetail(' + row.id + ')"><i class="fa fa-info-circle"></i>详情</button>&nbsp;';
                     //订单状态: 0订单创建成功等待付款, 101订单已取消, 102订单已删除,201订单已付款,等待发货,300订单已发货, 301用户确认收货,401 没有发货,退款 402 已收货,退款退货
-                    if (hasPermission('order:refund')) {
+                    if(hasPermission('order:printMsg')){
                         if (row.orderStatus == 300 && (row.orderBizType == '10' || row.orderBizType == '02')) {
                             htmlStr += '<button class="btn btn-outline btn-primary" onclick="vm.printDetail(' + row.id + ')"><i class="fa fa-print"></i>打印</button>&nbsp;';
                         }
+                    }
+                    if (hasPermission('order:refund')) {
                         if (row.orderStatus == 0) {
                             htmlStr += '<button class="btn btn-outline btn-danger" onclick="vm.cancelUpdate(' + row.id + ')"><i class="fa fa-times-circle-o"></i>&nbsp;取消</button>&nbsp;';
                         }
@@ -180,7 +203,9 @@ let vm = new Vue({
         q: {
             orderSn: '',
             orderStatus: '',
-            orderType: ''
+            merchOrderSn: '',
+            startTime: '',
+            endTime: ''
         },
         refundMoney: 0,
         shipping: {},
@@ -302,7 +327,9 @@ let vm = new Vue({
                 postData: {
                     'orderSn': vm.q.orderSn,
                     'orderStatus': vm.q.orderStatus,
-                    'orderType': vm.q.orderType
+                    'merchOrderSn': vm.q.merchOrderSn,
+                    'startTime': vm.q.startTime,
+                    'endTime': vm.q.endTime
                 },
                 page: page
             }).trigger("reloadGrid");
@@ -311,7 +338,9 @@ let vm = new Vue({
             vm.q = {
                 orderSn: '',
                 orderStatus: '',
-                orderType: ''
+                merchOrderSn: '',
+                startTime: '',
+                endTime: ''
             };
         },
         lookDetail: function (rowId) { //第三步:定义编辑操作
@@ -409,6 +438,27 @@ let vm = new Vue({
                     }
                 }
             });
+        },
+        exportOrder: function() {
+            var params = {};
+            params.orderSn = vm.q.orderSn, params.orderStatus = vm.q.orderStatus, params.merchOrderSn = vm.q.merchOrderSn
+                , params.startTime = vm.q.startTime, params.endTime = vm.q.endTime;
+
+            exportFile('#rrapp', '../order/export', params);
+            /*$.ajax({
+                type: "get",
+                url: '../order/export',
+                data: params,
+                success: function (r) {
+                    if (r.code === 0) {
+                        alert('导出成功', function (index) {
+                            vm.reload();
+                        });
+                    } else {
+                        alert(r.msg);
+                    }
+                }
+            });*/
         }
     },
     created: function () {

+ 6 - 2
kmall-admin/src/main/webapp/js/shop/orderrefund.js

@@ -65,8 +65,12 @@ $(function () {
                     let htmlStr = '<button class="btn btn-outline btn-info" onclick="vm.lookDetail(' + row.id + ')"><i class="fa fa-info-circle"></i>详情</button>&nbsp;';
                     if (hasPermission('order:refund')) {
                         if (row.refundStatus == 1) {
-                            htmlStr += '<button class="btn btn-outline btn-primary" onclick="vm.refundUpdate(' + row.orderId + ', ' + row.id + ')"><i class="fa fa-check-circle"></i>&nbsp;退款</button>&nbsp;' +
-                                '<button class="btn btn-outline btn-danger" onclick="vm.approval(' + row.id + ')"><i class="fa fa-times-circle-o"></i>审核</button>&nbsp;';
+                            if (hasPermission('order:refund')) {
+                                htmlStr += '<button class="btn btn-outline btn-primary" onclick="vm.refundUpdate(' + row.orderId + ', ' + row.id + ')"><i class="fa fa-check-circle"></i>&nbsp;退款</button>&nbsp;';
+                            }
+                            if(hasPermission('orderrefund:info')){
+                                htmlStr +='<button class="btn btn-outline btn-danger" onclick="vm.approval(' + row.id + ')"><i class="fa fa-times-circle-o"></i>审核</button>&nbsp;';
+                            }
                         }
                     }
                     return htmlStr;

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

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

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

@@ -17,7 +17,14 @@ $(function () {
             {label: '纬度', name: 'latitude', index: 'latitude', width: 80},
             {label: '经度', name: 'longitude', index: 'longitude', width: 80},
             {label: '配送半径(km)', name: 'coverRadius', index: 'cover_radius', width: 80},
-            {label: '备注', name: 'remark', index: 'remark', width: 80}],
+            {label: '备注', name: 'remark', index: 'remark', width: 80},
+            {
+                label: '操作', width: 60, align: 'center', sortable: false, formatter: function (value, col, row) {
+                    let htmlStr = "<button class='btn btn-outline btn-primary' " +
+                        "onclick='vm.qrcodeCanvas(" + row.id + ")'><i class='fa fa-qrcode'></i>二维码</button>";
+                    return htmlStr;
+                }
+            }],
         viewrecords: true,
         height: 385,
         rowNum: 10,
@@ -68,7 +75,8 @@ let vm = new Vue({
             storeName: '',
             storeNumber: ''
         },
-        merchList: []
+        merchList: [],
+        thirdMerchantBizList: []
     },
     methods: {
         query: function () {
@@ -77,7 +85,7 @@ let vm = new Vue({
         add: function () {
             vm.showList = false;
             vm.title = "新增";
-            vm.store = {};
+            vm.store = {exprAgreementType:'00'};
             vm.merchList = [];
             vm.getMerchList();
         },
@@ -88,6 +96,8 @@ let vm = new Vue({
             }
             vm.showList = false;
             vm.title = "修改";
+            vm.merchList = [];
+            vm.thirdMerchantBizList = [];
 
             vm.getInfo(id);
             vm.getMerchList();
@@ -134,14 +144,24 @@ let vm = new Vue({
                 });
             });
         },
+        showMerchInfo:function(opt){
+            var merchSn = opt.value;
+            vm.getThirdMerchantBizList(merchSn);
+        },
         getMerchList: function() {
             $.get("../merch/queryAll", function (r) {
                 vm.merchList = r.list;
             });
         },
+        getThirdMerchantBizList: function(merchSn) {
+            $.get("../thirdmerchantbiz/queryAll?merchSn=" + merchSn, function (r) {
+                vm.thirdMerchantBizList = r.list;
+            });
+        },
         getInfo: function (id) {
             $.get("../store/info/" + id, function (r) {
                 vm.store = r.store;
+                vm.getThirdMerchantBizList(r.store.merchSn);
             });
         },
         reloadSearch: function () {
@@ -160,6 +180,32 @@ let vm = new Vue({
             }).trigger("reloadGrid");
             vm.handleReset('formValidate');
         },
+        qrcodeCanvas: function(storeId) {
+            $("#qrcodeCanvas").html("");
+            $.get("../store/qrcodeCanvas/" + storeId, function (r) {
+                console.log(r.url);
+                var qrcSrc = r.url;
+                $("#qrcImg .qrcImg").attr("src", qrcSrc);
+                // $("#qrcImg").show();//隐藏canvas部分
+
+                $("#qrcodeCanvas").html($("#qrcImg").html());
+
+                openWindow({
+                    title: "二维码",
+                    area: ['450px', '450px'],
+                    content: jQuery("#qrcode"),
+                    btn: ["打印"],
+                    btn1: function (index) {
+                        $("#qrcImg").show();
+                        $("#qrcImg").print({});
+                        $("#qrcImg").hide();
+                        layer.close(index);
+                    }
+                });
+            });
+
+            $("#qrcImg").hide();
+        },
         handleSubmit: function (name) {
             handleSubmitValidate(this, name, function () {
                 vm.saveOrUpdate()

+ 186 - 27
kmall-admin/src/main/webapp/js/shop/storeProductStock.js

@@ -4,10 +4,12 @@ $(function () {
         datatype: "json",
         colModel: [
             {label: 'ID', name: 'id', index: 'id', hidden: true, key: true},
-            {label: '门店', name: 'storeName', index: 'storeName'},
-            {label: '商品类型', name: 'categoryName', index: 'categoryName', width: 80},
+            {label: '商品商户编号', name: 'goods_merch_sn', index: 'goods_merch_sn', hidden: true},
+            {label: '所属商户', name: 'merchName', index: 'merchName', width: 100, align: 'center'},
+            {label: '所属门店', name: 'storeName', index: 'storeName', width: 80, align: 'center'},
+            {label: '商品类型', name: 'categoryName', index: 'categoryName', width: 80, align: 'center'},
             {
-                label: '货品业务类型', name: 'goodsBizType', index: 'goods_biz_type', width: 70,
+                label: '货品业务类型', name: 'goodsBizType', index: 'goods_biz_type', width: 70, align: 'center',
                 formatter: function (value) {
                     if (value == '00') {
                         return '保税备货';
@@ -19,19 +21,19 @@ $(function () {
                     return '普通货物';
                 }
             },
-            {label: '商品编码', name: 'goodsSn', index: 'goodsSn'},
-            {label: '名称', name: 'goodsName', index: 'goodsName', width: 160},
-            {label: '产品编码', name: 'productSn', index: 'productSn'},
-            {label: '库存', name: 'stockNum', index: 'stockNum', width: 80},
-            {label: '零售价格', name: 'retailPrice', index: 'retailPrice', width: 80},
-            // {label: '市场价', name: 'marketPrice', index: 'marketPrice', width: 80},
+            {label: '商品编码', name: 'goodsSn', index: 'goodsSn', width: 80, align: 'center'},
+            {label: '名称', name: 'goodsName', index: 'goodsName', width: 160, align: 'left'},
+            {label: '产品编码', name: 'productSn', index: 'productSn', width: 80, align: 'center'},
+            {label: '库存', name: 'stockNum', index: 'stockNum', width: 80, align: 'center'},
+            {label: '零售价格', name: 'retailPrice', index: 'retailPrice', width: 80, align: 'center'},
+            {label: '市场价', name: 'marketPrice', index: 'marketPrice', width: 80, align: 'center'},
             // {label: '库存价格', name: 'stockPrice', index: 'stockPrice', width: 80},
             {
                 label: '销售量',
                 name: 'sellVolume',
                 index: 'a.sell_volume',
                 width: 80,
-                sortable: true,
+                sortable: true, align: 'center',
                 onSortCol: function (index, colindex, sortorder) {
                     //列排序事件
                     jQuery("#jqGrid").jqGrid('setGridParam', {page: $('#XtoPage').val()});
@@ -41,7 +43,8 @@ $(function () {
                 label: '操作', width: 60, align: 'center', sortable: false, formatter: function (value, col, row) {
                 let htmlStr = '';
                 if (row.goodsBizType == '02' || row.goodsBizType == '10') {
-                    htmlStr = '<button class="btn btn-outline btn-primary" onclick="vm.qrcodeCanvas(' + row.goodsId + ')"><i class="fa fa-qrcode"></i>二维码</button>';
+                    htmlStr = "<button class='btn btn-outline btn-primary' " +
+                        "onclick='vm.qrcodeCanvas(" + row.goodsId + ",\""+ row.storeId +"\",\""+row.goodsMerchSn+"\",\""+row.merchSn+"\")'><i class='fa fa-qrcode'></i>二维码</button>";
                 }
                 return htmlStr;
             }
@@ -111,7 +114,7 @@ var vm = new Vue({
         uploadList: [],
         imgName: '',
         visible: false,
-        productStoreRela: { stockNum: '', retailPrice: '', marketPrice: '' },
+        productStoreRela: { stockNum: '', retailPrice: '', marketPrice: '', categoryId:'', brandId:'', specification:'', storeId:'', goodsBizType:'' },
         ruleValidate: {
             /*storeId: [
                 {required: true, message: '门店不能为空'}
@@ -121,35 +124,77 @@ var vm = new Vue({
             storeId: '',
             goodsName: '',
             productSn: '',
-            goodsSn: ''
+            goodsSn: '', category: '', categoryTwo: '', goodsBizType:''
         },
         stores: [],
         macros: [],//商品单位
         goodss: {},
         products: [],
-        showInput: false
+        showInput: false,
+        showInputSpecification: false,
+        categories: [],//一级分类
+        categoriesTwo: [],
+        brands: [],
+        attributeEntityList: [{'id': '', 'goodsId': '', 'attributeId': '', 'value': '', 'isDelete': 0}],
+        attributes: [],
+        queryCategories: [],//一级分类
+        queryCategoriesTwo: [],
+        categoryId: '',
+        freights: [],
+        storeId: 0,
+        specification: '',
+        isOperator: ''
     },
     methods: {
         changeGoods: function (opt) {
             var goodsId = opt.value;
             if (null != goodsId && '' != goodsId) {
                 $.get("../goods/info/" + goodsId, function (r) {
+                    vm.showInput = true;
+                    // console.log(r.goods.goodsBizType);
                     if (r.goods.goodsBizType == 11) {
-                        vm.showInput = true;
-                        vm.productStoreRela.retailPrice = r.goods.retailPrice;
-                        vm.productStoreRela.marketPrice = r.goods.marketPrice;
+                        vm.showInputSpecification = true;
                     } else {
-                        vm.showInput = false;
+                        vm.showInputSpecification = false;
                     }
                 });
+                // $.get("../productstorerela/infoByGoodsId?goodsId=" + goodsId + "&storeId=" + vm.storeId, function (r) {
+                //     vm.productStoreRela = r.productStoreRela;
+                //     vm.showInput = true;
+                //     if (r.productStoreRela.goodsBizType == 11) {
+                //         vm.showInputSpecification = true;
+                //     }else{
+                //         vm.showInputSpecification = false;
+                //     }
+                //
+                //     vm.categoryId = r.productStoreRela.categoryId;
+                //     var opt = {};
+                //     opt.value = vm.productStoreRela.attributeCategory;
+                //     vm.changeCategories(opt);
+                //     // if (r.productStoreRela.attributeEntityList.length > 0) {
+                //     //     vm.attributeEntityList = r.productStoreRela.attributeEntityList;
+                //     // } else {
+                //     //     vm.attributeEntityList = [{'id': '', 'goodsId': '', 'attributeId': '', 'value': '', 'isDelete': 0}];
+                //     // }
+                //     // console.log(r.goods.retailPrice);
+                //     // console.log(r.goods.marketPrice);
+                //     // vm.productStoreRela.retailPrice = r.goods.retailPrice;
+                //     // vm.productStoreRela.marketPrice = r.goods.marketPrice;
+                // });
             }
         },
+        changeQueryCategories: function (opt) {
+            var value = opt.value;
+            $.get("../category/getCategorySelectByParent?parentId=" + value, function (r) {
+                vm.queryCategoriesTwo = r.list;
+            });
+        },
         reloadSearch: function () {
             vm.q = {
                 storeId: '',
                 goodsName: '',
                 productSn: '',
-                goodsSn: ''
+                goodsSn: '', category: '', categoryTwo: '', goodsBizType:''
             }
             vm.reload();
         },
@@ -159,10 +204,15 @@ var vm = new Vue({
         add: function (event) {
             vm.showList = false;
             vm.title = "新增";
+            vm.isOperator = 'add';
             vm.uploadList = [];
-            vm.productStoreRela = { stockNum: '', retailPrice: '', marketPrice: '' };
+            vm.freights = [];
+            vm.brands = [];
+            vm.productStoreRela = { stockNum: '', retailPrice: '', marketPrice: '', categoryId:'', brandId:'',specification:'', storeId:'' };
+            vm.attributeEntityList = [{'id': '', 'goodsId': '', 'attributeId': '', 'value': '', 'isDelete': 0}];
             vm.getMacro();
             vm.showInput = false;
+            vm.showInputSpecification = false;
         },
         update: function (event) {
             var id = getSelectedRow();
@@ -171,12 +221,20 @@ var vm = new Vue({
             }
             vm.showList = false;
             vm.title = "修改";
+            vm.isOperator = 'update';
             vm.uploadList = [];
             vm.getInfo(id);
+            var opt = {};
+            opt.value = vm.productStoreRela.categoryId;
+            opt.flag = 1;
+            vm.getAttributes(opt);
             vm.getMacro();
-            vm.showInput = false;
             if (vm.productStoreRela.goodsBizType == 11) {
                 vm.showInput = true;
+                vm.showInputSpecification = true;
+            }else{
+                vm.showInput = false;
+                vm.showInputSpecification = false;
             }
         },
         /**
@@ -189,6 +247,8 @@ var vm = new Vue({
         },
         saveOrUpdate: function (event) {
             var url = vm.productStoreRela.id == null ? "../productstorerela/save" : "../productstorerela/update";
+            console.log(vm.attributeEntityList);
+            vm.productStoreRela.attributeEntityList = vm.attributeEntityList;
             $.ajax({
                 type: "POST",
                 url: url,
@@ -231,21 +291,109 @@ var vm = new Vue({
         getInfo: function (id) {
             $.get("../productstorerela/info/" + id, function (r) {
                 vm.productStoreRela = r.productStoreRela;
+                vm.categoryId = r.productStoreRela.categoryId;
+                // vm.getCategory();
+                var opt = {};
+                opt.value = vm.productStoreRela.attributeCategory;
+                vm.changeCategories(opt);
+                if (r.productStoreRela.attributeEntityList.length > 0) {
+                    vm.attributeEntityList = r.productStoreRela.attributeEntityList;
+                } else {
+                    vm.attributeEntityList = [{'id': '', 'goodsId': '', 'attributeId': '', 'value': '', 'isDelete': 0}];
+                }
+                vm.specification = vm.productStoreRela.specification;
+                vm.storeId = vm.productStoreRela.storeId;
             });
         },
         getGoods: function (opt) {
-
             var storeId = opt.value;
             var merchSn = "";
             for (var i = 0; i < vm.stores.length; i ++ ) {
                 if(vm.stores[i].id == storeId)
                     merchSn = vm.stores[i].merchSn;
             }
+            vm.storeId = storeId;
 
-            $.get("../goods/queryAll?merchSn=" + merchSn, function (r) {
-                vm.goodss = r.list;
+            console.log(vm.isOperator);
+            if(vm.isOperator == 'add'){
+                $.get("../goods/queryAll?merchSn=" + merchSn + "&storeId=" +storeId, function (r) {
+                    vm.goodss = r.list;
+                });
+            }else{
+                $.get("../goods/queryAll?merchSn=" + merchSn, function (r) {
+                    vm.goodss = r.list;
+                });
+            }
+            vm.getCategories(storeId);
+            vm.getFreights(storeId);
+        },
+        changeCategories: function (opt) {
+            var value = opt.value;
+            vm.getBrand(value);
+            if(value){
+                $.get("../category/getCategorySelectByParent?isShow=1&parentId=" + value, function (r) {
+                    vm.categoriesTwo = r.list;
+                });
+            }
+        },
+        getCategoryByStore: function (opt) {
+            var value = opt.value;
+            vm.getCategories(value);
+            vm.getFreights(value);
+        },
+        getCategories: function (storeId) {
+            $.get("../category/getCategorySelect?isShow=1&storeId=" + storeId, function (r) {
+                vm.categories = r.list;
             });
         },
+        getBrand: function (categoryId) {
+            $.get("../brand/queryAll?categoryId=" + categoryId, function (r) {
+                vm.brands = r.list;
+            });
+        },
+        getAttributes: function (opt) {
+            var value = opt.value;
+            if(value){
+                $.get("../attribute/query?attributeCategoryId=" + value + "&storeId="+vm.storeId, function (r) {
+                    vm.attributes = r.list;
+                });
+
+                if (opt.flag != 1 && !(value === vm.categoryId)) {
+                    if (vm.attributeEntityList.length > 0 && vm.attributeEntityList[0].attributeId != '') {
+                        for (var i = 0; i < vm.attributeEntityList.length; i++) {
+                            if (!(vm.attributeEntityList[0].attributeId === '')) {
+                                vm.attributeEntityList[i].isDelete = 1;
+                            }
+                        }
+
+                        var goodsId = '';
+                        if (vm.goodss) {
+                            goodsId = vm.goodss.id;
+                        }
+                        vm.attributeEntityList.unshift({'id': '', 'goodsId': goodsId, 'attributeId': '', 'value': '', 'isDelete': 0});
+                    }
+                }
+            }
+        },
+        getFreights: function(storeId) {
+            $.get("../freight/queryAll?storeId=" + storeId, function (r) {
+                vm.freights = r.list;
+            });
+        },
+        addAttrRow: function () {
+            let goodsId = '';
+            if (vm.goods) {
+                goodsId = vm.goods.id;
+            }
+            vm.attributeEntityList.push({'id': '', 'goodsId': goodsId, 'attributeId': '', 'value': '', 'isDelete': 0});
+        },
+        delAttrRow: function (index) {
+            //最后一行时禁止删除
+            if (vm.attributeEntityList.length == 1) {
+                return;
+            }
+            vm.attributeEntityList[index].isDelete = 1;
+        },
         reload: function (event) {
             vm.showList = true;
             var page = $("#jqGrid").jqGrid('getGridParam', 'page');
@@ -254,7 +402,7 @@ var vm = new Vue({
                     storeId: vm.q.storeId,
                     goodsName: vm.q.goodsName,
                     goodsSn: vm.q.goodsSn,
-                    productSn: vm.q.productSn
+                    productSn: vm.q.productSn, category: vm.q.category, categoryTwo: vm.q.categoryTwo, goodsBizType:vm.q.goodsBizType
                 },
                 page: page
             }).trigger("reloadGrid");
@@ -312,11 +460,15 @@ var vm = new Vue({
         handleReset: function (name) {
             handleResetForm(this, name);
         },
-        qrcodeCanvas: function(id) {
+        qrcodeCanvas: function(id,storeId,goodsMerchSn,merchSn) {
+            if(merchSn != goodsMerchSn){
+                alert("商品所属商户与门店商品所属商户不一致,请修改为一致后再生成二维码!");
+                return;
+            }
             $("#qrcodeCanvas").html("");
             $("#qrcodeCanvas").qrcode({
                 render : "canvas",    //设置渲染方式,有table和canvas,使用canvas方式渲染性能相对来说比较好
-                text : "emato../goods/goods?id=" + id,    //扫描二维码后显示的内容,可以直接填一个网址,扫描二维码后自动跳向该链接
+                text : "emato../goods/goods?id=" + id +"&storeId="+storeId,    //扫描二维码后显示的内容,可以直接填一个网址,扫描二维码后自动跳向该链接
                 width : "100",               //二维码的宽度
                 height : "100",              //二维码的高度
                 background : "#ffffff",       //二维码的后景色
@@ -325,6 +477,7 @@ var vm = new Vue({
             });
 
             var qrcSrc = $("canvas")[0].toDataURL();
+            console.log(qrcSrc);
             $("#qrcImg .qrcImg").attr("src", qrcSrc);
             var upLogSrc = "../../statics/img/logo.jpg";
             $("#qrcImg .upLogo").attr("src", upLogSrc);
@@ -347,8 +500,14 @@ var vm = new Vue({
         }
     },
     mounted() {
+        $.get("../category/getCategorySelect", function (r) {
+            vm.queryCategories = r.list;
+        });
         $.get("../store/queryAll", function (r) {
             vm.stores = r.list;
         });
+        $.get("../sys/macro/queryMacrosByValue?value=goodsBizType", function (r) {
+            vm.macros = r.list;
+        });
     }
 });

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

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

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


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


+ 1 - 0
kmall-admin/src/main/webapp/statics/mpdswl/CMmUrfS5RI.txt

@@ -0,0 +1 @@
+cf0d165db21e8f2f26803b15bdd53b0c

+ 4 - 3
kmall-api/src/main/java/com/kmall/api/api/ApiAddressController.java

@@ -1,6 +1,7 @@
 package com.kmall.api.api;
 
 import com.alibaba.fastjson.JSONObject;
+import com.google.common.collect.Maps;
 import com.kmall.api.annotation.IgnoreAuth;
 import com.kmall.api.annotation.LoginUser;
 import com.kmall.api.entity.AddressVo;
@@ -40,7 +41,7 @@ public class ApiAddressController extends ApiBaseAction {
      */
     @GetMapping("list")
     public Object list(@LoginUser UserVo loginUser) {
-        Map param = new HashMap();
+        Map param = Maps.newHashMap();
         param.put("user_id", loginUser.getId());
         List<AddressVo> addressEntities = addressService.queryList(param);
         return toResponsSuccess(addressEntities);
@@ -88,7 +89,7 @@ public class ApiAddressController extends ApiBaseAction {
         }
         // 更新默认
         if (entity.getIsDefault() == 1) {
-            Map params = new HashMap();
+            Map params = Maps.newHashMap();
             params.put("user_id", entity.getUserId());
             params.put("is_default", 1);
             List<AddressVo> addressVoList = addressService.queryList(params);
@@ -142,7 +143,7 @@ public class ApiAddressController extends ApiBaseAction {
             }
         }
         //
-        Map params = new HashMap();
+        Map params = Maps.newHashMap();
         params.put("user_id", entity.getUserId());
         List<AddressVo> addressVoList = addressService.queryList(params);
         if (null != addressVoList) {

+ 12 - 6
kmall-api/src/main/java/com/kmall/api/api/ApiAuthController.java

@@ -1,6 +1,7 @@
 package com.kmall.api.api;
 
 import com.alibaba.fastjson.JSONObject;
+import com.google.common.collect.Maps;
 import com.kmall.api.annotation.IgnoreAuth;
 import com.kmall.api.entity.*;
 import com.kmall.api.service.ApiMerchUserService;
@@ -12,6 +13,8 @@ import com.kmall.api.util.ApiUserUtils;
 import com.kmall.api.util.CommonUtil;
 import com.qiniu.util.StringUtils;
 import org.apache.commons.collections.MapUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 import org.apache.log4j.Logger;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
@@ -32,7 +35,7 @@ import java.util.Map;
 @RestController
 @RequestMapping("/api/auth")
 public class ApiAuthController extends ApiBaseAction {
-    private Logger logger = Logger.getLogger(getClass());
+    private Log logger = LogFactory.getLog(ApiAuthController.class);
     @Autowired
     private ApiUserService userService;
     @Autowired
@@ -48,7 +51,7 @@ public class ApiAuthController extends ApiBaseAction {
     @IgnoreAuth
     @PostMapping("login_by_weixin")
     public Object loginByWeixin() {
-        Map<String, Object> resultObj = new HashMap();
+        Map<String, Object> resultObj = Maps.newHashMap();
         JSONObject jsonParam = this.getJsonRequest();
         FullUserInfo fullUserInfo = null;
         Long storeId = jsonParam.getLong("storeId");
@@ -137,8 +140,11 @@ public class ApiAuthController extends ApiBaseAction {
      */
     @GetMapping("nearbyList")
     @IgnoreAuth
-    public Object nearbyList(@RequestParam BigDecimal latitude, @RequestParam BigDecimal longitude) {
-        Map param = new HashMap();
+    public Object nearbyList(@RequestParam BigDecimal latitude, @RequestParam BigDecimal longitude,@RequestParam String storeId) {
+        Map param = Maps.newHashMap();
+        if(org.apache.commons.lang3.StringUtils.isNotEmpty(storeId)){
+            param.put("storeId", storeId);
+        }
         param.put("latitude", latitude);
         param.put("longitude", longitude);
         List<StoreVo> storeVoList = apiStoreService.queryNearbyList(param);
@@ -154,7 +160,7 @@ public class ApiAuthController extends ApiBaseAction {
     @GetMapping("storeListByCity")
     @IgnoreAuth
     public Object storeListByCity(@RequestParam String provinceName, @RequestParam String cityName, @RequestParam String countyName) {
-        Map param = new HashMap();
+        Map param = Maps.newHashMap();
         param.put("province_name", provinceName);
         param.put("city_name", cityName);
         param.put("county_name", countyName);
@@ -173,7 +179,7 @@ public class ApiAuthController extends ApiBaseAction {
         Long storeId = jsonParam.getLong("storeId");
         String merchSn = (String)jsonParam.get("merchSn");
         //
-        Map<String, Object> resultObj = new HashMap();
+        Map<String, Object> resultObj = Maps.newHashMap();
         Map<String, Object> tokenMap = tokenService.createAndUpdateToken(openId, storeId,getUserId(),merchSn);
         String token = MapUtils.getString(tokenMap, "token");
         resultObj.put("token", token);

Một số tệp đã không được hiển thị bởi vì quá nhiều tập tin thay đổi trong này khác