Browse Source

初始化仓库

chao 4 years ago
parent
commit
d8fa6f151e
100 changed files with 9628 additions and 4 deletions
  1. 12 4
      .gitignore
  2. 72 0
      LICENSE
  3. 1 0
      README.md
  4. 56 0
      db/activity.sql
  5. 193 0
      db/app-project.sql
  6. 166 0
      db/brand.sql
  7. 24 0
      db/hehe.sql
  8. 105 0
      db/info.sql
  9. 989 0
      db/sys.sql
  10. 46 0
      db/大宗采购6.1.sql
  11. 5 0
      db/库分期.sql
  12. BIN
      doc/1.介绍与安装.docx
  13. BIN
      doc/2.文件结构与配置.docx
  14. BIN
      doc/3.内置组件的应用.docx
  15. BIN
      doc/4.代码生成器的应用.docx
  16. BIN
      doc/5.硕正WEB组件的应用.docx
  17. BIN
      doc/6.工作流的应用实例.docx
  18. BIN
      doc/7.手机端基础接口文档.docx
  19. BIN
      doc/8.内容管理模块功能说明.docx
  20. BIN
      doc/jeesite_help.chm
  21. 55 0
      doc/接口.txt
  22. 932 0
      pom.xml
  23. 18 0
      src/main/java/com/caimei/modules/activity/dao/FreeShippingDao.java
  24. 15 0
      src/main/java/com/caimei/modules/activity/dao/FreeShippingTypeDao.java
  25. 15 0
      src/main/java/com/caimei/modules/activity/dao/LaserDao.java
  26. 165 0
      src/main/java/com/caimei/modules/activity/entity/FreeShipping.java
  27. 113 0
      src/main/java/com/caimei/modules/activity/entity/FreeShippingType.java
  28. 62 0
      src/main/java/com/caimei/modules/activity/entity/Laser.java
  29. 41 0
      src/main/java/com/caimei/modules/activity/model/FreeShippingCount.java
  30. 58 0
      src/main/java/com/caimei/modules/activity/service/FreeShippingService.java
  31. 87 0
      src/main/java/com/caimei/modules/activity/service/FreeShippingTypeService.java
  32. 70 0
      src/main/java/com/caimei/modules/activity/service/LaserService.java
  33. 112 0
      src/main/java/com/caimei/modules/activity/web/FreeShippingController.java
  34. 80 0
      src/main/java/com/caimei/modules/activity/web/FreeShippingTypeController.java
  35. 111 0
      src/main/java/com/caimei/modules/activity/web/LaserController.java
  36. 18 0
      src/main/java/com/caimei/modules/advisory/dao/CmAdvisoryDao.java
  37. 84 0
      src/main/java/com/caimei/modules/advisory/entity/CmAdvisory.java
  38. 73 0
      src/main/java/com/caimei/modules/advisory/service/CmAdvisoryService.java
  39. 79 0
      src/main/java/com/caimei/modules/advisory/web/CmAdvisoryController.java
  40. 17 0
      src/main/java/com/caimei/modules/banner/dao/CrmBannerDao.java
  41. 83 0
      src/main/java/com/caimei/modules/banner/entity/CrmBanner.java
  42. 77 0
      src/main/java/com/caimei/modules/banner/service/CrmBannerService.java
  43. 159 0
      src/main/java/com/caimei/modules/banner/web/CrmBannerController.java
  44. 53 0
      src/main/java/com/caimei/modules/basesetting/dao/AddressDao.java
  45. 29 0
      src/main/java/com/caimei/modules/basesetting/dao/HelpPageDao.java
  46. 32 0
      src/main/java/com/caimei/modules/basesetting/dao/KeywordDao.java
  47. 130 0
      src/main/java/com/caimei/modules/basesetting/entity/Address.java
  48. 33 0
      src/main/java/com/caimei/modules/basesetting/entity/BaseType.java
  49. 63 0
      src/main/java/com/caimei/modules/basesetting/entity/City.java
  50. 102 0
      src/main/java/com/caimei/modules/basesetting/entity/Helppage.java
  51. 63 0
      src/main/java/com/caimei/modules/basesetting/entity/Keyword.java
  52. 73 0
      src/main/java/com/caimei/modules/basesetting/entity/Province.java
  53. 86 0
      src/main/java/com/caimei/modules/basesetting/entity/Town.java
  54. 225 0
      src/main/java/com/caimei/modules/basesetting/service/AddressService.java
  55. 49 0
      src/main/java/com/caimei/modules/basesetting/service/HelpPageService.java
  56. 72 0
      src/main/java/com/caimei/modules/basesetting/service/KeywordService.java
  57. 97 0
      src/main/java/com/caimei/modules/basesetting/web/AddressController.java
  58. 97 0
      src/main/java/com/caimei/modules/basesetting/web/AreaSetController.java
  59. 106 0
      src/main/java/com/caimei/modules/basesetting/web/HelpPageController.java
  60. 104 0
      src/main/java/com/caimei/modules/basesetting/web/KeyWordController.java
  61. 26 0
      src/main/java/com/caimei/modules/brand/dao/BrandAgentDao.java
  62. 33 0
      src/main/java/com/caimei/modules/brand/dao/BrandIdentificationCodeDao.java
  63. 33 0
      src/main/java/com/caimei/modules/brand/dao/BrandProductDao.java
  64. 21 0
      src/main/java/com/caimei/modules/brand/dao/BrandProductsDao.java
  65. 26 0
      src/main/java/com/caimei/modules/brand/dao/BrandPurchaserDao.java
  66. 26 0
      src/main/java/com/caimei/modules/brand/dao/BrandSupplierDao.java
  67. 19 0
      src/main/java/com/caimei/modules/brand/dao/CmBrandDao.java
  68. 10 0
      src/main/java/com/caimei/modules/brand/dao/ProductModelDao.java
  69. 10 0
      src/main/java/com/caimei/modules/brand/dao/ShopModelDao.java
  70. 131 0
      src/main/java/com/caimei/modules/brand/entity/BrandAgent.java
  71. 89 0
      src/main/java/com/caimei/modules/brand/entity/BrandAndProductType.java
  72. 65 0
      src/main/java/com/caimei/modules/brand/entity/BrandIdentificationCode.java
  73. 258 0
      src/main/java/com/caimei/modules/brand/entity/BrandProduct.java
  74. 137 0
      src/main/java/com/caimei/modules/brand/entity/BrandProducts.java
  75. 103 0
      src/main/java/com/caimei/modules/brand/entity/BrandPurchaser.java
  76. 159 0
      src/main/java/com/caimei/modules/brand/entity/BrandSupplier.java
  77. 142 0
      src/main/java/com/caimei/modules/brand/entity/CmBrand.java
  78. 41 0
      src/main/java/com/caimei/modules/brand/model/ProductModel.java
  79. 40 0
      src/main/java/com/caimei/modules/brand/model/ShopModel.java
  80. 58 0
      src/main/java/com/caimei/modules/brand/service/BrandAgentService.java
  81. 93 0
      src/main/java/com/caimei/modules/brand/service/BrandIdentificationCodeService.java
  82. 264 0
      src/main/java/com/caimei/modules/brand/service/BrandProductService.java
  83. 179 0
      src/main/java/com/caimei/modules/brand/service/BrandProductsService.java
  84. 78 0
      src/main/java/com/caimei/modules/brand/service/BrandPurchaserService.java
  85. 84 0
      src/main/java/com/caimei/modules/brand/service/BrandSupplierService.java
  86. 55 0
      src/main/java/com/caimei/modules/brand/service/CmBrandService.java
  87. 15 0
      src/main/java/com/caimei/modules/brand/service/ProductModelService.java
  88. 15 0
      src/main/java/com/caimei/modules/brand/service/ShopModelService.java
  89. 108 0
      src/main/java/com/caimei/modules/brand/utils/ImageMarkLogoByIcon.java
  90. 98 0
      src/main/java/com/caimei/modules/brand/utils/ImagePathUtils.java
  91. 124 0
      src/main/java/com/caimei/modules/brand/web/BrandAgentController.java
  92. 93 0
      src/main/java/com/caimei/modules/brand/web/BrandIdentificationCodeController.java
  93. 396 0
      src/main/java/com/caimei/modules/brand/web/BrandProductController.java
  94. 163 0
      src/main/java/com/caimei/modules/brand/web/BrandProductsController.java
  95. 127 0
      src/main/java/com/caimei/modules/brand/web/BrandPurchaserController.java
  96. 136 0
      src/main/java/com/caimei/modules/brand/web/BrandSupplierController.java
  97. 512 0
      src/main/java/com/caimei/modules/brand/web/CmBrandController.java
  98. 15 0
      src/main/java/com/caimei/modules/bulkpurchase/dao/BpClauseDao.java
  99. 24 0
      src/main/java/com/caimei/modules/bulkpurchase/dao/BpOrderCirculationDao.java
  100. 15 0
      src/main/java/com/caimei/modules/bulkpurchase/dao/BpOrderProductRemarkDao.java

+ 12 - 4
.gitignore

@@ -1,13 +1,21 @@
-# ---> Java
-*.class
+/target/**/
+!target/*.war
+!/target/*.war
+!.mvn/wrapper/maven-wrapper.jar
+!**/src/main/**
+!**/src/test/**
 
 # Mobile Tools for Java (J2ME)
 .mtj.tmp/
 
 # Package Files #
-*.jar
-*.war
+*.class
 *.ear
+userfiles
+libraries
+*.externalToolBuilders
+.idea
+*.iml
 
 # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
 hs_err_pid*

+ 72 - 0
LICENSE

@@ -0,0 +1,72 @@
+Apache License 
+Version 2.0, January 2004 
+http://www.apache.org/licenses/
+TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+1. Definitions.
+
+"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
+
+"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
+
+"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
+
+"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
+
+"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
+
+"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
+
+"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
+
+"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
+
+"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
+
+"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
+
+2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
+
+3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
+
+4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
+
+(a) You must give any other recipients of the Work or Derivative Works a copy of this License; and
+
+(b) You must cause any modified files to carry prominent notices stating that You changed the files; and
+
+(c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
+
+(d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.
+
+You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
+
+5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
+
+6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
+
+7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
+
+8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
+
+9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
+
+END OF TERMS AND CONDITIONS
+
+APPENDIX: How to apply the Apache License to your work.
+
+To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives.
+
+Copyright [yyyy] [name of copyright owner]
+
+Licensed under the Apache License, Version 2.0 (the "License"); 
+you may not use this file except in compliance with the License. 
+You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software 
+distributed under the License is distributed on an "AS IS" BASIS, 
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
+See the License for the specific language governing permissions and 
+limitations under the License.

+ 1 - 0
README.md

@@ -1,2 +1,3 @@
 # caimei-caimei365-manager
 
+采美后台管理

+ 56 - 0
db/activity.sql

@@ -0,0 +1,56 @@
+/*
+Source Server Version : 50173
+
+Target Server Type    : MYSQL
+Target Server Version : 50173
+File Encoding         : 65001
+
+Date: 2016-06-01 13:32:32
+*/
+
+SET FOREIGN_KEY_CHECKS=0;
+
+-- ----------------------------
+-- Table structure for activity_free_shipping
+-- ----------------------------
+DROP TABLE IF EXISTS `activity_free_shipping`;
+CREATE TABLE `activity_free_shipping` (
+  `id` bigint(11) NOT NULL AUTO_INCREMENT,
+  `type_id` bigint(11) DEFAULT NULL COMMENT '包邮券类型',
+  `user_id` bigint(11) DEFAULT NULL COMMENT '用户',
+  `club_id` bigint(11) DEFAULT NULL COMMENT '会所',
+  `status` varchar(1) DEFAULT '0' COMMENT '使用状态 0未使用 1已使用',
+  `enabled_status` varchar(1) DEFAULT '1' COMMENT '启用/禁用状态',
+  `create_date` datetime DEFAULT NULL COMMENT '创建时间/领取时间',
+  PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='包邮券基础表';
+
+-- ----------------------------
+-- Records of activity_free_shipping
+-- ----------------------------
+
+-- ----------------------------
+-- Table structure for activity_free_shipping_type
+-- ----------------------------
+DROP TABLE IF EXISTS `activity_free_shipping_type`;
+CREATE TABLE `activity_free_shipping_type` (
+  `id` bigint(11) NOT NULL AUTO_INCREMENT,
+  `scope` varchar(100) DEFAULT NULL,
+  `number` int(11) DEFAULT NULL COMMENT '可使用数量',
+  `start_time` datetime DEFAULT NULL COMMENT '有效期开始时间',
+  `end_time` datetime DEFAULT NULL COMMENT '有效期截止时间',
+  `info` text COMMENT '使用须知',
+  `images` text COMMENT '网站端图片',
+  `crm_images` text COMMENT 'CRM端图片',
+  `status` varchar(1) DEFAULT '1' COMMENT '可领取状态 0否 1是',
+  `enabled_status` varchar(1) DEFAULT '1' COMMENT '可使用状态 0否 1是',
+  `update_by` bigint(11) DEFAULT NULL COMMENT '最后更新人',
+  `update_date` datetime DEFAULT NULL COMMENT '最后更新时间',
+  PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='包邮券类型表';
+
+-- ----------------------------
+-- Records of activity_free_shipping_type
+-- ----------------------------
+INSERT INTO `activity_free_shipping_type` VALUES ('1', '全品类', '0', '2016-05-29 00:00:00', '2016-05-30 23:59:59', '<p>\r\n	<i class="shuoming">1、在提交订单时勾选<span style="color:#ff0000;">【使用包邮券】</span>,支付订单时使用; </i></p>\r\n<p>\r\n	<i class="shuoming">2、本券仅限于“采美365官方网站”或“采美365”公众号内采购使用;</i></p>\r\n<p>\r\n	<i class="shuoming">3、本券仅限会所身份用户领取及使用;</i></p>\r\n<p>\r\n	<i class="shuoming">4、每个会所身份最多只能拥有一张优惠券,使用并支付后,系统赠送一张包邮券;</i></p>\r\n<p>\r\n	<i class="shuoming">5、包邮区域仅限广东省内XX快递可配送范围;</i></p>\r\n<p>\r\n	<i class="shuoming">6、深圳采美科技有限公司拥有最终解释权。</i></p>', '', '', '1', '1', '1', '2016-06-01 11:44:00');
+INSERT INTO `activity_free_shipping_type` VALUES ('2', '自营类', '2', '2016-06-02 09:47:54', '2016-06-09 09:47:59', null, null, null, '0', '0', '1', '2016-06-01 09:48:12');

+ 193 - 0
db/app-project.sql

@@ -0,0 +1,193 @@
+DROP TABLE IF EXISTS project;
+CREATE TABLE `project` (
+  `id` bigint(11) NOT NULL AUTO_INCREMENT,
+  `name` varchar(100) DEFAULT '' COMMENT '项目名称',
+  `type` char(1) DEFAULT '' COMMENT '项目类型',
+  `priority` int(11) DEFAULT '0' COMMENT '优先级',
+  `shareNum` int(11) DEFAULT '0' COMMENT '分享数',
+  `enabledStatus` char(1) DEFAULT '0' COMMENT '启用/禁用状态',
+  `createBy` bigint(11) DEFAULT NULL COMMENT '创建人',
+  `createDate` datetime DEFAULT NULL COMMENT '创建日期',
+  `updateBy` bigint(11) DEFAULT NULL COMMENT '最后更新人',
+  `updateDate` datetime DEFAULT NULL COMMENT '最后更新时间',
+  PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='项目信息基础表';
+
+DROP TABLE IF EXISTS project_info;
+CREATE TABLE `project_info` (
+  `projectId` bigint(11) NOT NULL COMMENT '项目ID',
+  `infoId` bigint(11) DEFAULT NULL COMMENT '信息中心文章ID'
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='项目信息-相关文章关系表';
+
+DROP TABLE IF EXISTS project_appointment;
+CREATE TABLE `project_appointment` (
+  `id` bigint(11) NOT NULL AUTO_INCREMENT,
+  `projectId` bigint(11) DEFAULT NULL COMMENT '预约项目ID',
+  `appointmentClubName` varchar(100) DEFAULT '' COMMENT '预约会所名称',
+  `contactWay` varchar(50) DEFAULT '' COMMENT '联系方式',
+  `openid` varchar(100) DEFAULT '',
+  `createDate` datetime DEFAULT NULL COMMENT '创建时间/预约时间',
+  `remarks` varchar(255) DEFAULT '' COMMENT '备注',
+  PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='项目预约信息表';
+
+DROP TABLE IF EXISTS project_terminal;
+CREATE TABLE `project_terminal` (
+  `id` bigint(11) NOT NULL,
+  `images` text COMMENT '图片',
+  `updateBy` bigint(11) DEFAULT NULL COMMENT '最后修改人',
+  `updateDate` datetime DEFAULT NULL COMMENT '最后修改时间',
+  PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='项目终端资料表';
+
+DROP TABLE IF EXISTS project_terminal_info;
+CREATE TABLE `project_terminal_info` (
+  `terminalId` bigint(11) DEFAULT NULL COMMENT '终端资料ID',
+  `infoId` bigint(11) DEFAULT NULL COMMENT '信息中心文章ID'
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='终端资料-相关文章关系表';
+
+DROP TABLE IF EXISTS project_company;
+CREATE TABLE `project_company` (
+  `id` bigint(11) NOT NULL AUTO_INCREMENT,
+  `name` varchar(100) DEFAULT '' COMMENT '公司名称',
+  `area` varchar(100) DEFAULT '' COMMENT '区域',
+  `scale` varchar(100) DEFAULT '' COMMENT '规模',
+  `cooperationWay` varchar(100) DEFAULT '' COMMENT '合作方式',
+  `maxPerformance` varchar(100) DEFAULT '' COMMENT '最大业绩',
+  `divideScale` varchar(100) DEFAULT '' COMMENT '分成比例',
+  `starClub` varchar(100) DEFAULT '' COMMENT '明星会所',
+  `hotProject` varchar(100) DEFAULT '' COMMENT '热销项目',
+  `shareNum` bigint(11) DEFAULT '0' COMMENT '分享数',
+  `enabledStatus` char(1) DEFAULT '' COMMENT '启用/禁用状态',
+  `createBy` bigint(11) DEFAULT NULL COMMENT '创建人',
+  `createDate` datetime DEFAULT NULL COMMENT '创建时间',
+  `updateBy` bigint(11) DEFAULT NULL COMMENT '最后更新人',
+  `updateDate` datetime DEFAULT NULL COMMENT '最后更新时间',
+  PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='项目公司表';
+
+DROP TABLE IF EXISTS project_company_pro;
+CREATE TABLE `project_company_pro` (
+  `id` bigint(11) NOT NULL AUTO_INCREMENT,
+  `companyId` bigint(11) DEFAULT NULL COMMENT '项目公司id',
+  `projectId` bigint(11) DEFAULT NULL COMMENT '项目id',
+  `experiencePrice` decimal(11,2) DEFAULT '0.00' COMMENT '体验价',
+  `enabledStatus` char(1) DEFAULT NULL COMMENT '启用/禁用状态',
+  `createBy` bigint(11) DEFAULT NULL COMMENT '创建人',
+  `createDate` datetime DEFAULT NULL COMMENT '创建时间',
+  `updateBy` bigint(11) DEFAULT NULL COMMENT '最后更新人',
+  `updateDate` datetime DEFAULT NULL COMMENT '最后更新时间',
+  PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='公司项目表';
+
+DROP TABLE IF EXISTS project_company_pro_clubcase;
+CREATE TABLE `project_company_pro_clubcase` (
+  `id` bigint(11) NOT NULL AUTO_INCREMENT,
+  `companyProId` bigint(11) DEFAULT NULL COMMENT '公司项目id',
+  `clubName` varchar(100) DEFAULT '' COMMENT '会所名称',
+  `performance` varchar(100) DEFAULT '' COMMENT '业绩',
+  PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='公司项目会所案例表';
+
+DROP TABLE IF EXISTS project_company_pro_marketing;
+CREATE TABLE `project_company_pro_marketing` (
+  `id` bigint(11) NOT NULL AUTO_INCREMENT,
+  `companyProId` bigint(11) DEFAULT NULL COMMENT '公司项目id',
+  `name` varchar(100) DEFAULT '' COMMENT '名称',
+  `price` varchar(100) DEFAULT '' COMMENT '价格',
+  PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='公司项目营销方案表';
+
+
+DROP TABLE IF EXISTS project_company_pro_marketingconference;
+CREATE TABLE `project_company_pro_marketingconference` (
+  `id` bigint(11) NOT NULL AUTO_INCREMENT,
+  `companyProId` bigint(11) DEFAULT NULL COMMENT '公司项目ID',
+  `companyId` bigint(11) DEFAULT NULL COMMENT '项目公司id',
+  `title` varchar(200) DEFAULT '' COMMENT '标题',
+  `startTime` datetime DEFAULT NULL COMMENT '开始时间',
+  `endTime` datetime DEFAULT NULL COMMENT '结束时间',
+  `priority` int(11) DEFAULT '0' COMMENT '优先级',
+  `province` varchar(20) DEFAULT '' COMMENT '省、直辖市',
+  `city` varchar(20) DEFAULT '' COMMENT '市',
+  `town` varchar(20) DEFAULT '' COMMENT '县、区',
+  `address` varchar(200) DEFAULT '' COMMENT '详细地址',
+  `enabledStatus` char(1) DEFAULT '' COMMENT '启用/禁用状态',
+  `createBy` bigint(11) DEFAULT NULL COMMENT '创建人',
+  `createDate` datetime DEFAULT NULL COMMENT '创建时间',
+  `updateBy` bigint(11) DEFAULT NULL COMMENT '最后更新人',
+  `updateDate` datetime DEFAULT NULL COMMENT '最后更新时间',
+  PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='公司项目会销表';
+
+DROP TABLE IF EXISTS project_company_pro_image;
+CREATE TABLE project_company_pro_image (
+    id int(11) NOT NULL AUTO_INCREMENT, 
+    companyProId int(11) DEFAULT NULL COMMENT '公司项目id',          
+    title varchar(100) DEFAULT '' COMMENT '图片标题',                
+    url varchar(100) DEFAULT '' COMMENT '图片地址',              
+    PRIMARY KEY (id)                  
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='公司项目相关图片表'; 
+/*****************************以上脚本已执行 2016年7月21日16:38:46**********************************/
+
+ALTER TABLE `project`
+ADD COLUMN `part`  varchar(50) NULL DEFAULT '' COMMENT '部位分类' AFTER `shareNum`,
+ADD COLUMN `function`  varchar(50) NULL DEFAULT '' COMMENT '功能分类' AFTER `part`;
+
+DROP TABLE IF EXISTS `project_apparatus`;
+CREATE TABLE `project_apparatus` (
+  `id` bigint(11) NOT NULL AUTO_INCREMENT,
+  `name` varchar(100) DEFAULT '' COMMENT '名称',
+  `price` decimal(11,2) DEFAULT NULL,
+  `images` text COMMENT '图片',
+  `details` text COMMENT '详情',
+  `enabledStatus` char(1) DEFAULT '1' COMMENT '启用/禁用状态',
+  `createBy` bigint(11) DEFAULT NULL COMMENT '创建人',
+  `createDate` datetime DEFAULT NULL COMMENT '添加时间',
+  `updateBy` bigint(11) DEFAULT NULL COMMENT '最后更新人',
+  `updateDate` datetime DEFAULT NULL COMMENT '最后更新时间',
+  PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='仪器信息表';
+
+DROP TABLE IF EXISTS `project_apparatus_appointment`;
+CREATE TABLE `project_apparatus_appointment` (
+  `id` bigint(11) NOT NULL AUTO_INCREMENT,
+  `apparatusId` bigint(11) DEFAULT NULL COMMENT '预约仪器ID',
+  `contactName` varchar(100) DEFAULT '' COMMENT '联系名称',
+  `contactWay` varchar(50) DEFAULT '' COMMENT '联系方式',
+  `message` varchar(50) DEFAULT '' COMMENT '留言信息',
+  `openid` varchar(100) DEFAULT '',
+  `createDate` datetime DEFAULT NULL COMMENT '创建时间/留言时间',
+  `remarks` varchar(255) DEFAULT '' COMMENT '备注',
+  PRIMARY KEY (`id`)
+) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8 COMMENT='仪器预约信息表';
+
+DROP TABLE IF EXISTS `project_company_apparatus`;
+CREATE TABLE `project_company_apparatus` (
+  `id` bigint(11) NOT NULL AUTO_INCREMENT,
+  `companyId` bigint(11) DEFAULT NULL COMMENT '项目公司id',
+  `apparatusId` bigint(11) DEFAULT NULL COMMENT '仪器ID',
+  `enabledStatus` char(1) DEFAULT '1' COMMENT '启用/禁用状态 1启用 0停用',
+  `createBy` bigint(11) DEFAULT NULL COMMENT '创建人',
+  `createDate` datetime DEFAULT NULL COMMENT '创建时间',
+  `updateBy` bigint(11) DEFAULT NULL COMMENT '最后更新人',
+  `updateDate` datetime DEFAULT NULL COMMENT '最后更新时间',
+  PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='公司仪器信息表';
+
+DROP TABLE IF EXISTS `project_company_apparatus_pro`;
+CREATE TABLE `project_company_apparatus_pro` (
+  `companyApparatusId` bigint(11) DEFAULT NULL COMMENT '公司仪器ID',
+  `companyProId` bigint(20) DEFAULT NULL COMMENT '公司项目id'
+) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 COMMENT='公司仪器-公司项目表';
+
+ALTER TABLE `project_appointment`
+ADD COLUMN `message`  varchar(50) NULL DEFAULT '' COMMENT '留言信息' AFTER `contactWay`;
+---------------------------------以上已执行---------------------------------------------------------------------------
+ALTER TABLE `project_apparatus_appointment`
+ADD COLUMN `userId`  bigint(11) NULL COMMENT '用户ID' AFTER `remarks`,
+ADD COLUMN `userName`  varchar(100) NULL DEFAULT '' COMMENT '用户名' AFTER `userId`;
+
+ALTER TABLE `project_appointment`
+ADD COLUMN `userId`  bigint(11) NULL COMMENT '用户ID' AFTER `remarks`,
+ADD COLUMN `userName`  varchar(100) NULL DEFAULT '' COMMENT '用户名' AFTER `userId`;

+ 166 - 0
db/brand.sql

@@ -0,0 +1,166 @@
+/*
+Navicat MySQL Data Transfer
+
+Source Database       : caimei
+
+Target Server Type    : MYSQL
+Target Server Version : 50173
+File Encoding         : 65001
+
+Date: 2016-05-19 09:41:21
+*/
+
+SET FOREIGN_KEY_CHECKS=0;
+
+-- ----------------------------
+-- Table structure for brand_agent
+-- ----------------------------
+DROP TABLE IF EXISTS `brand_agent`;
+CREATE TABLE `brand_agent` (
+  `id` bigint(11) NOT NULL AUTO_INCREMENT,
+  `name` varchar(100) DEFAULT NULL COMMENT '代理商名称',
+  `business_license` varchar(100) DEFAULT NULL COMMENT '营业执照注册号',
+  `business_address` varchar(200) DEFAULT NULL COMMENT '公司注册地址',
+  `business_phone` varchar(20) DEFAULT NULL COMMENT '公司电话',
+  `legal_representaive` varchar(20) DEFAULT NULL COMMENT '公司法人',
+  `registered_capital` varchar(64) DEFAULT NULL COMMENT '注册资本',
+  `enterprise_type` varchar(1) DEFAULT NULL COMMENT '公司类型',
+  `business_scope` text COMMENT '经营范围',
+  `enabled_status` varchar(1) DEFAULT NULL COMMENT '状态 0停用 1启用',
+  `create_by` bigint(11) DEFAULT NULL COMMENT '创建人',
+  `create_date` datetime DEFAULT NULL COMMENT '创建时间',
+  `update_by` bigint(11) DEFAULT NULL COMMENT '最后更新人',
+  `update_date` datetime DEFAULT NULL COMMENT '最后更新时间',
+  PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='品牌联盟代理商信息表';
+
+-- ----------------------------
+-- Records of brand_agent
+-- ----------------------------
+
+-- ----------------------------
+-- Table structure for brand_message
+-- ----------------------------
+DROP TABLE IF EXISTS `brand_message`;
+CREATE TABLE `brand_message` (
+  `brandMessageID` int(11) NOT NULL AUTO_INCREMENT COMMENT '留言ID',
+  `supplier` varchar(100) DEFAULT NULL COMMENT '厂家名称',
+  `contacts` varchar(100) NOT NULL COMMENT '联系人',
+  `telephone` varchar(100) NOT NULL COMMENT '联系电话',
+  `title` varchar(64) DEFAULT NULL COMMENT '标题',
+  `content` text COMMENT '留言内容',
+  `createTime` datetime DEFAULT NULL COMMENT '创建时间',
+  PRIMARY KEY (`brandMessageID`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='扫码失败留言';
+
+-- ----------------------------
+-- Records of brand_message
+-- ----------------------------
+
+-- ----------------------------
+-- Table structure for brand_product
+-- ----------------------------
+DROP TABLE IF EXISTS `brand_product`;
+CREATE TABLE `brand_product` (
+  `id` bigint(11) NOT NULL AUTO_INCREMENT,
+  `productID` bigint(11) DEFAULT NULL COMMENT '网站商品id',
+  `supplier_id` bigint(11) NOT NULL COMMENT '供应商id',
+  `agent_id` bigint(11) DEFAULT NULL COMMENT '代理商id',
+  `purchaser_id` bigint(11) DEFAULT NULL COMMENT '购买者id',
+  `file_number` varchar(100) DEFAULT NULL COMMENT '档案编号',
+  `license_start_date` date DEFAULT NULL COMMENT '证书有效开始日期',
+  `license_end_date` date DEFAULT NULL COMMENT '证书有效截止日期',
+  `name` varchar(100) DEFAULT NULL COMMENT '商品名称(进入页)',
+  `license_name` varchar(100) DEFAULT NULL COMMENT '商品名称(证书)',
+  `SN` varchar(100) DEFAULT NULL COMMENT '商品SN码',
+  `factory_date` date DEFAULT NULL COMMENT '出厂日期',
+  `service_life` int(9) DEFAULT NULL COMMENT '使用期限',
+  `purpose` text COMMENT '商品用途',
+  `images` text COMMENT '商品图片,多个图片用 | 隔开',
+  `large_images` text COMMENT '商品图片大图,多个以|隔开',
+  `parameter` text COMMENT '产品参数',
+  `parameter_images` text COMMENT '参数图片,多个图片用 | 隔开',
+  `parameter_large_images` text COMMENT '参数大图片,多个图片用 | 隔开',
+  `enabled_status` varchar(1) DEFAULT NULL COMMENT '状态 0停用 1启用',
+  `scan_num` int(9) DEFAULT NULL COMMENT '扫码人数',
+  `query_num` int(9) DEFAULT NULL COMMENT '查看商品人数',
+  `show_agent` varchar(1) DEFAULT '0' COMMENT '是否显示代理商0 否 1是',
+  `show_purchaser` varchar(1) DEFAULT '0' COMMENT '是否显示购买者 0否 1是',
+  `create_by` bigint(11) DEFAULT NULL COMMENT '创建人',
+  `create_date` datetime DEFAULT NULL COMMENT '创建时间',
+  `update_by` bigint(11) DEFAULT NULL COMMENT '最后更新人',
+  `update_date` datetime DEFAULT NULL COMMENT '最后更新时间',
+  `identification_code` varchar(8) DEFAULT NULL COMMENT '标识码:8位随机不重复',
+  PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='品牌联盟商品信息表';
+
+-- ----------------------------
+-- Records of brand_product
+-- ----------------------------
+
+-- ----------------------------
+-- Table structure for brand_purchaser
+-- ----------------------------
+DROP TABLE IF EXISTS `brand_purchaser`;
+CREATE TABLE `brand_purchaser` (
+  `id` bigint(11) NOT NULL AUTO_INCREMENT,
+  `name` varchar(100) DEFAULT NULL COMMENT '购买者名称',
+  `purchase_date` datetime DEFAULT NULL COMMENT '购买日期',
+  `intro` text COMMENT '简介',
+  `publicty_material_images` text COMMENT '宣传资料图片,用 | 隔开',
+  `enabled_status` varchar(1) DEFAULT NULL COMMENT '状态 0停用 1启用',
+  `create_by` bigint(11) DEFAULT NULL COMMENT '创建人',
+  `create_date` datetime DEFAULT NULL COMMENT '创建时间',
+  `update_by` bigint(11) DEFAULT NULL COMMENT '最后更新人',
+  `update_date` datetime DEFAULT NULL COMMENT '最后更新时间',
+  `large_images` text COMMENT '宣传资料大图,多个以|隔开',
+  PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='品牌联盟购买者信息表';
+
+-- ----------------------------
+-- Records of brand_purchaser
+-- ----------------------------
+
+-- ----------------------------
+-- Table structure for brand_supplier
+-- ----------------------------
+DROP TABLE IF EXISTS `brand_supplier`;
+CREATE TABLE `brand_supplier` (
+  `id` bigint(11) NOT NULL AUTO_INCREMENT,
+  `shopID` bigint(11) DEFAULT NULL COMMENT '网站供应商id',
+  `LOGO` varchar(100) DEFAULT NULL COMMENT '供应商LOGO',
+  `name` varchar(100) DEFAULT NULL COMMENT '供应商名称',
+  `business_license` varchar(100) DEFAULT NULL COMMENT '营业执照注册号',
+  `business_address` varchar(200) DEFAULT NULL COMMENT '公司注册地址',
+  `business_phone` varchar(20) DEFAULT NULL COMMENT '公司电话',
+  `legal_representaive` varchar(20) DEFAULT NULL COMMENT '公司法人',
+  `registered_capital` varchar(64) DEFAULT NULL COMMENT '注册资本',
+  `enterprise_type` varchar(1) DEFAULT NULL COMMENT '公司类型',
+  `business_scope` text COMMENT '经营范围',
+  `enabled_status` varchar(1) DEFAULT NULL COMMENT '状态 0停用 1启用',
+  `create_by` bigint(11) DEFAULT NULL COMMENT '创建人',
+  `create_date` datetime DEFAULT NULL COMMENT '创建时间',
+  `update_by` bigint(11) DEFAULT NULL COMMENT '最后更新人',
+  `update_date` datetime DEFAULT NULL COMMENT '最后更新时间',
+  PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='品牌联盟供应商信息表';
+
+-- ----------------------------
+-- Records of brand_supplier
+-- ----------------------------
+
+DROP TABLE IF EXISTS brand_identification_code;
+CREATE TABLE brand_identification_code (                                          
+	id int(11) NOT NULL AUTO_INCREMENT COMMENT '商品标识码ID',  
+	identificationCode varchar(8) NOT NULL COMMENT '8位的唯一标识码',          
+	brandProductID int(11) DEFAULT NULL COMMENT '对应的商品ID',                 
+	createTime DATETIME NOT NULL COMMENT '创建时间',            
+	PRIMARY KEY (id)                                        
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='品牌联盟商品唯一标识码';
+
+-- 2016年5月21日00:20:33
+
+ALTER TABLE `brand_product`
+ADD UNIQUE INDEX `sn` (`SN`) ,
+ADD UNIQUE INDEX `file_number` (`file_number`) ,
+ADD UNIQUE INDEX `identification_code` (`identification_code`) ;

+ 24 - 0
db/hehe.sql

@@ -0,0 +1,24 @@
+DROP TABLE IF EXISTS `hehe_coupon`;
+CREATE TABLE `hehe_coupon` (
+  `id` bigint(11) NOT NULL AUTO_INCREMENT,
+  `number` varchar(16) NOT NULL COMMENT '优惠券编号',
+  `info` varchar(80) DEFAULT NULL COMMENT '优惠信息',
+  `start_time` datetime DEFAULT NULL COMMENT '有效期开始时间',
+  `end_time` datetime DEFAULT NULL COMMENT '有效期截止时间',
+  `status` varchar(1) DEFAULT NULL COMMENT '使用状态',
+  `use_time` datetime DEFAULT NULL COMMENT '使用时间',
+  `enabled_status` varchar(1) DEFAULT '1' COMMENT '状态 0停用 1启用',
+  `create_date` datetime DEFAULT NULL COMMENT '创建时间',
+  `create_by` bigint(11) DEFAULT NULL COMMENT '创建人',
+  `update_date` datetime DEFAULT NULL COMMENT '更新时间',
+  `update_by` bigint(11) DEFAULT NULL COMMENT '更新人',
+  `remarks` text COMMENT '备注',
+  PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='优惠券信息表';
+
+DROP TABLE IF EXISTS `hehe_coupon_product`;
+CREATE TABLE `hehe_coupon_product` (
+  `coupon_id` bigint(11) DEFAULT NULL COMMENT '优惠券ID',
+  `product_id` bigint(11) DEFAULT NULL COMMENT '商品ID'
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='优惠券-商品关系表';
+

+ 105 - 0
db/info.sql

@@ -0,0 +1,105 @@
+DROP TABLE IF EXISTS `info_type`;
+CREATE TABLE `info_type` (
+  `id` bigint(11) NOT NULL AUTO_INCREMENT,
+  `name` varchar(10) NOT NULL COMMENT '分类名称',
+  `sort` decimal(10,0) NOT NULL DEFAULT '0' COMMENT '排序(升序)',
+  `enabledStatus` varchar(1) DEFAULT '0' COMMENT '启用/禁用状态',
+  `createBy` bigint(11) DEFAULT NULL COMMENT '创建人',
+  `createDate` datetime DEFAULT NULL COMMENT '创建时间',
+  `updateBy` bigint(11) DEFAULT NULL COMMENT '最后更新人',
+  `updateDate` datetime DEFAULT NULL COMMENT '最后更新时间',
+  PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='信息分类表';
+
+DROP TABLE IF EXISTS `info`;
+CREATE TABLE `info` (
+  `id` bigint(11) NOT NULL AUTO_INCREMENT,
+  `typeId` bigint(11) DEFAULT NULL COMMENT '信息分类',
+  `title` varchar(255) DEFAULT NULL COMMENT '标题',
+  `label` varchar(255) DEFAULT NULL COMMENT '信息标签',
+  `publisher` varchar(255) DEFAULT NULL COMMENT '发布人',
+  `recommendContent` text COMMENT '推荐语',
+  `infoContent` text COMMENT '信息内容',
+  `guidanceImage` text COMMENT '引导图',
+  `pubdate` datetime DEFAULT NULL COMMENT '发布时间',
+  `recommendStatus` varchar(1) DEFAULT NULL COMMENT '推荐状态 0停用 1启用',
+  `enabledStatus` varchar(1) DEFAULT NULL COMMENT '启用/禁用状态',
+  `basePraise` bigint(11) DEFAULT NULL COMMENT '基础点赞',
+  `createBy` varchar(64) DEFAULT NULL COMMENT '创建人',
+  `createDate` datetime DEFAULT NULL COMMENT '创建时间',
+  `updateBy` varchar(64) DEFAULT NULL COMMENT '最后更新人',
+  `updateDate` datetime DEFAULT NULL COMMENT '最后更新时间',
+  PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='信息基础表';
+
+DROP TABLE IF EXISTS `info_praise`;
+CREATE TABLE `info_praise` (
+  `infoId` bigint(20) NOT NULL,
+  `num` bigint(20) DEFAULT NULL COMMENT '点赞数量',
+  PRIMARY KEY (`infoId`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='点赞表';
+
+DROP TABLE IF EXISTS `info_ad`;
+CREATE TABLE `info_ad` (
+  `id` bigint(11) NOT NULL AUTO_INCREMENT,
+  `serviceObject` varchar(100) NOT NULL COMMENT '业务方/服务对象',
+  `link` text COMMENT '链接',
+  `location` varchar(1) DEFAULT NULL COMMENT '广告位置 1 信息列表 2信息图片',
+  `recommendContent` text COMMENT '推荐语',
+  `title` varchar(255) DEFAULT NULL COMMENT '标题',
+  `guidanceImage` text COMMENT '引导图',
+  `clickRate` bigint(11) DEFAULT NULL COMMENT '点击量',
+  `enabledStatus` varchar(1) DEFAULT NULL COMMENT '启用/禁用状态',
+  `createBy` varchar(64) DEFAULT NULL COMMENT '创建人',
+  `createDate` datetime DEFAULT NULL COMMENT '创建时间',
+  `updateBy` varchar(64) DEFAULT NULL COMMENT '最后更新人',
+  `updateDate` datetime DEFAULT NULL COMMENT '最后更新时间',
+  PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='广告信息基础表';
+
+DROP TABLE IF EXISTS `info_label`;
+CREATE TABLE `info_label` (
+  `id` bigint(11) NOT NULL AUTO_INCREMENT,
+  `name` varchar(255) NOT NULL COMMENT '标签名',
+  `clickRate` bigint(11) DEFAULT '0' COMMENT '点击量',
+  `createBy` varchar(64) DEFAULT NULL COMMENT '创建人',
+  `createDate` datetime DEFAULT NULL COMMENT '创建时间',
+  `updateBy` varchar(64) DEFAULT NULL COMMENT '最后更新人',
+  `updateDate` datetime DEFAULT NULL COMMENT '最后更新时间',
+  PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='信息标签表';
+
+---------------以上语句已执行----------------------------------------
+
+-----------2016年7月6日16:56:08----------------
+ALTER TABLE `info`
+ADD COLUMN `keyword`  varchar(255) NULL DEFAULT '' COMMENT '关键字' AFTER `publisher`;
+---------------以上语句已执行----------------------------------------
+
+----------------2016年7月8日09:57:28--------------------------------------------
+CREATE TABLE `info_page` (
+  `infoId` bigint(11) NOT NULL COMMENT '信息ID',
+  `page` bigint(11) DEFAULT NULL COMMENT '页码',
+  `infoContent` text NOT NULL COMMENT '信息内容'
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='信息内容分页表';
+
+
+---------------------2016年7月29日15:50:59---------------------
+ALTER TABLE `info` ADD COLUMN `source`  varchar(100) NULL DEFAULT '' COMMENT '来源' AFTER `publisher`;
+------------------以上已执行----------------------------------------
+ALTER TABLE `info_praise` ADD COLUMN `pv`  bigint(11) NULL DEFAULT 0 COMMENT '阅读总量' AFTER `num`;
+ALTER TABLE `info_label`
+MODIFY COLUMN `clickRate`  bigint(11) NULL DEFAULT 0 COMMENT '信息点击量' AFTER `name`,
+ADD COLUMN `labelClickRate`  bigint(11) NULL DEFAULT 0 COMMENT '标签点击量' AFTER `clickRate`,
+ADD COLUMN `infoLabelStatus`  char(1) NULL DEFAULT '1' COMMENT '信息标签状态 0停用 1启用' AFTER `labelClickRate`,
+ADD COLUMN `hotLabelStatus`  char(1) NULL DEFAULT '0' COMMENT '热门标签状态 0停用 1启用' AFTER `infoLabelStatus`,
+ADD COLUMN `recommendLabelStatus`  char(1) NULL DEFAULT '0' COMMENT '推荐标签状态 0停用 1启用' AFTER `hotLabelStatus`;
+------------------以上已执行----------------------------------------
+
+-------------------2016年10月13日10:17:10-----------------------------
+ALTER TABLE `info`
+ADD COLUMN `priorityIndex`  bigint(11) NULL DEFAULT 0 COMMENT '优先级' AFTER `basePraise`;
+
+---------------------------2016年10月17日14:11:14-----------------------
+ALTER TABLE `info_label`
+ADD COLUMN `infoNum`  bigint(11) NULL DEFAULT 0 COMMENT '信息总数' AFTER `labelClickRate`;

+ 989 - 0
db/sys.sql

@@ -0,0 +1,989 @@
+/*
+Navicat MySQL Data Transfer
+
+Source Database       : caimei
+
+Target Server Type    : MYSQL
+Target Server Version : 50173
+File Encoding         : 65001
+
+Date: 2016-05-19 09:43:37
+*/
+
+SET FOREIGN_KEY_CHECKS=0;
+
+-- ----------------------------
+-- Table structure for gen_scheme
+-- ----------------------------
+DROP TABLE IF EXISTS `gen_scheme`;
+CREATE TABLE `gen_scheme` (
+  `id` bigint(64) NOT NULL AUTO_INCREMENT COMMENT '编号',
+  `name` varchar(200) DEFAULT NULL COMMENT '名称',
+  `category` varchar(2000) DEFAULT NULL COMMENT '分类',
+  `package_name` varchar(500) DEFAULT NULL COMMENT '生成包路径',
+  `module_name` varchar(30) DEFAULT NULL COMMENT '生成模块名',
+  `sub_module_name` varchar(30) DEFAULT NULL COMMENT '生成子模块名',
+  `function_name` varchar(500) DEFAULT NULL COMMENT '生成功能名',
+  `function_name_simple` varchar(100) DEFAULT NULL COMMENT '生成功能名(简写)',
+  `function_author` varchar(100) DEFAULT NULL COMMENT '生成功能作者',
+  `gen_table_id` varchar(200) DEFAULT NULL COMMENT '生成表编号',
+  `create_by` varchar(64) DEFAULT NULL COMMENT '创建者',
+  `create_date` datetime DEFAULT NULL COMMENT '创建时间',
+  `update_by` varchar(64) DEFAULT NULL COMMENT '更新者',
+  `update_date` datetime DEFAULT NULL COMMENT '更新时间',
+  `remarks` varchar(255) DEFAULT NULL COMMENT '备注信息',
+  `del_flag` char(1) NOT NULL DEFAULT '0' COMMENT '删除标记(0:正常;1:删除)',
+  PRIMARY KEY (`id`),
+  KEY `gen_scheme_del_flag` (`del_flag`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='生成方案';
+
+-- ----------------------------
+-- Records of gen_scheme
+-- ----------------------------
+
+-- ----------------------------
+-- Table structure for gen_table
+-- ----------------------------
+DROP TABLE IF EXISTS `gen_table`;
+CREATE TABLE `gen_table` (
+  `id` bigint(64) NOT NULL AUTO_INCREMENT COMMENT '编号',
+  `name` varchar(200) DEFAULT NULL COMMENT '名称',
+  `comments` varchar(500) DEFAULT NULL COMMENT '描述',
+  `class_name` varchar(100) DEFAULT NULL COMMENT '实体类名称',
+  `parent_table` varchar(200) DEFAULT NULL COMMENT '关联父表',
+  `parent_table_fk` varchar(100) DEFAULT NULL COMMENT '关联父表外键',
+  `create_by` varchar(64) DEFAULT NULL COMMENT '创建者',
+  `create_date` datetime DEFAULT NULL COMMENT '创建时间',
+  `update_by` varchar(64) DEFAULT NULL COMMENT '更新者',
+  `update_date` datetime DEFAULT NULL COMMENT '更新时间',
+  `remarks` varchar(255) DEFAULT NULL COMMENT '备注信息',
+  `del_flag` char(1) NOT NULL DEFAULT '0' COMMENT '删除标记(0:正常;1:删除)',
+  PRIMARY KEY (`id`),
+  KEY `gen_table_name` (`name`),
+  KEY `gen_table_del_flag` (`del_flag`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='业务表';
+
+-- ----------------------------
+-- Records of gen_table
+-- ----------------------------
+
+-- ----------------------------
+-- Table structure for gen_table_column
+-- ----------------------------
+DROP TABLE IF EXISTS `gen_table_column`;
+CREATE TABLE `gen_table_column` (
+  `id` bigint(64) NOT NULL AUTO_INCREMENT COMMENT '编号',
+  `gen_table_id` varchar(64) DEFAULT NULL COMMENT '归属表编号',
+  `name` varchar(200) DEFAULT NULL COMMENT '名称',
+  `comments` varchar(500) DEFAULT NULL COMMENT '描述',
+  `jdbc_type` varchar(100) DEFAULT NULL COMMENT '列的数据类型的字节长度',
+  `java_type` varchar(500) DEFAULT NULL COMMENT 'JAVA类型',
+  `java_field` varchar(200) DEFAULT NULL COMMENT 'JAVA字段名',
+  `is_pk` char(1) DEFAULT NULL COMMENT '是否主键',
+  `is_null` char(1) DEFAULT NULL COMMENT '是否可为空',
+  `is_insert` char(1) DEFAULT NULL COMMENT '是否为插入字段',
+  `is_edit` char(1) DEFAULT NULL COMMENT '是否编辑字段',
+  `is_list` char(1) DEFAULT NULL COMMENT '是否列表字段',
+  `is_query` char(1) DEFAULT NULL COMMENT '是否查询字段',
+  `query_type` varchar(200) DEFAULT NULL COMMENT '查询方式(等于、不等于、大于、小于、范围、左LIKE、右LIKE、左右LIKE)',
+  `show_type` varchar(200) DEFAULT NULL COMMENT '字段生成方案(文本框、文本域、下拉框、复选框、单选框、字典选择、人员选择、部门选择、区域选择)',
+  `dict_type` varchar(200) DEFAULT NULL COMMENT '字典类型',
+  `settings` varchar(2000) DEFAULT NULL COMMENT '其它设置(扩展字段JSON)',
+  `sort` decimal(10,0) DEFAULT NULL COMMENT '排序(升序)',
+  `create_by` varchar(64) DEFAULT NULL COMMENT '创建者',
+  `create_date` datetime DEFAULT NULL COMMENT '创建时间',
+  `update_by` varchar(64) DEFAULT NULL COMMENT '更新者',
+  `update_date` datetime DEFAULT NULL COMMENT '更新时间',
+  `remarks` varchar(255) DEFAULT NULL COMMENT '备注信息',
+  `del_flag` char(1) NOT NULL DEFAULT '0' COMMENT '删除标记(0:正常;1:删除)',
+  PRIMARY KEY (`id`),
+  KEY `gen_table_column_table_id` (`gen_table_id`),
+  KEY `gen_table_column_name` (`name`),
+  KEY `gen_table_column_sort` (`sort`),
+  KEY `gen_table_column_del_flag` (`del_flag`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='业务表字段';
+
+-- ----------------------------
+-- Records of gen_table_column
+-- ----------------------------
+
+-- ----------------------------
+-- Table structure for gen_template
+-- ----------------------------
+DROP TABLE IF EXISTS `gen_template`;
+CREATE TABLE `gen_template` (
+  `id` bigint(64) NOT NULL AUTO_INCREMENT COMMENT '编号',
+  `name` varchar(200) DEFAULT NULL COMMENT '名称',
+  `category` varchar(2000) DEFAULT NULL COMMENT '分类',
+  `file_path` varchar(500) DEFAULT NULL COMMENT '生成文件路径',
+  `file_name` varchar(200) DEFAULT NULL COMMENT '生成文件名',
+  `content` text COMMENT '内容',
+  `create_by` varchar(64) DEFAULT NULL COMMENT '创建者',
+  `create_date` datetime DEFAULT NULL COMMENT '创建时间',
+  `update_by` varchar(64) DEFAULT NULL COMMENT '更新者',
+  `update_date` datetime DEFAULT NULL COMMENT '更新时间',
+  `remarks` varchar(255) DEFAULT NULL COMMENT '备注信息',
+  `del_flag` char(1) NOT NULL DEFAULT '0' COMMENT '删除标记(0:正常;1:删除)',
+  PRIMARY KEY (`id`),
+  KEY `gen_template_del_falg` (`del_flag`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='代码模板表';
+
+-- ----------------------------
+-- Records of gen_template
+-- ----------------------------
+
+-- ----------------------------
+-- Table structure for sys_area
+-- ----------------------------
+DROP TABLE IF EXISTS `sys_area`;
+CREATE TABLE `sys_area` (
+  `id` bigint(64) NOT NULL AUTO_INCREMENT COMMENT '编号',
+  `parent_id` varchar(64) NOT NULL COMMENT '父级编号',
+  `parent_ids` varchar(2000) NOT NULL COMMENT '所有父级编号',
+  `name` varchar(100) NOT NULL COMMENT '名称',
+  `sort` decimal(10,0) NOT NULL COMMENT '排序',
+  `code` varchar(100) DEFAULT NULL COMMENT '区域编码',
+  `type` char(1) DEFAULT NULL COMMENT '区域类型',
+  `create_by` varchar(64) NOT NULL COMMENT '创建者',
+  `create_date` datetime NOT NULL COMMENT '创建时间',
+  `update_by` varchar(64) NOT NULL COMMENT '更新者',
+  `update_date` datetime NOT NULL COMMENT '更新时间',
+  `remarks` varchar(255) DEFAULT NULL COMMENT '备注信息',
+  `del_flag` char(1) NOT NULL DEFAULT '0' COMMENT '删除标记',
+  PRIMARY KEY (`id`),
+  KEY `sys_area_parent_id` (`parent_id`),
+  KEY `sys_area_del_flag` (`del_flag`)
+) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8 COMMENT='区域表';
+
+-- ----------------------------
+-- Records of sys_area
+-- ----------------------------
+INSERT INTO `sys_area` VALUES ('1', '0', '0,', '中国', '10', '100000', '1', '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '0');
+INSERT INTO `sys_area` VALUES ('2', '1', '0,1,', '广东省', '20', '110000', '2', '1', '2013-05-27 08:00:00', '1', '2016-05-09 11:03:51', '', '0');
+INSERT INTO `sys_area` VALUES ('3', '2', '0,1,2,', '深圳市', '30', '110101', '3', '1', '2013-05-27 08:00:00', '1', '2016-05-09 11:04:02', '', '0');
+INSERT INTO `sys_area` VALUES ('4', '3', '0,1,2,3,', '罗湖区', '40', '110102', '4', '1', '2013-05-27 08:00:00', '1', '2016-05-09 11:04:14', '', '0');
+INSERT INTO `sys_area` VALUES ('5', '3', '0,1,2,3,', '福田区', '50', '110104', '4', '1', '2013-05-27 08:00:00', '1', '2016-05-09 11:04:22', '', '0');
+INSERT INTO `sys_area` VALUES ('6', '3', '0,1,2,3,', '南山区', '60', '110105', '4', '1', '2013-05-27 08:00:00', '1', '2016-05-09 11:04:31', '', '0');
+
+-- ----------------------------
+-- Table structure for sys_dict
+-- ----------------------------
+DROP TABLE IF EXISTS `sys_dict`;
+CREATE TABLE `sys_dict` (
+  `id` bigint(64) NOT NULL AUTO_INCREMENT COMMENT '编号',
+  `value` varchar(100) NOT NULL COMMENT '数据值',
+  `label` varchar(100) NOT NULL COMMENT '标签名',
+  `type` varchar(100) NOT NULL COMMENT '类型',
+  `description` varchar(100) NOT NULL COMMENT '描述',
+  `sort` decimal(10,0) NOT NULL COMMENT '排序(升序)',
+  `parent_id` varchar(64) DEFAULT '0' COMMENT '父级编号',
+  `create_by` varchar(64) NOT NULL COMMENT '创建者',
+  `create_date` datetime NOT NULL COMMENT '创建时间',
+  `update_by` varchar(64) NOT NULL COMMENT '更新者',
+  `update_date` datetime NOT NULL COMMENT '更新时间',
+  `remarks` varchar(255) DEFAULT NULL COMMENT '备注信息',
+  `del_flag` char(1) NOT NULL DEFAULT '0' COMMENT '删除标记',
+  PRIMARY KEY (`id`),
+  KEY `sys_dict_value` (`value`),
+  KEY `sys_dict_label` (`label`),
+  KEY `sys_dict_del_flag` (`del_flag`)
+) ENGINE=InnoDB AUTO_INCREMENT=129 DEFAULT CHARSET=utf8 COMMENT='字典表';
+
+-- ----------------------------
+-- Records of sys_dict
+-- ----------------------------
+INSERT INTO `sys_dict` VALUES ('1', '0', '正常', 'del_flag', '删除标记', '10', '0', '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '0');
+INSERT INTO `sys_dict` VALUES ('2', '1', '删除', 'del_flag', '删除标记', '20', '0', '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '0');
+INSERT INTO `sys_dict` VALUES ('3', '1', '显示', 'show_hide', '显示/隐藏', '10', '0', '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '0');
+INSERT INTO `sys_dict` VALUES ('4', '0', '隐藏', 'show_hide', '显示/隐藏', '20', '0', '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '0');
+INSERT INTO `sys_dict` VALUES ('5', '1', '是', 'yes_no', '是/否', '10', '0', '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '0');
+INSERT INTO `sys_dict` VALUES ('6', '0', '否', 'yes_no', '是/否', '20', '0', '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '0');
+INSERT INTO `sys_dict` VALUES ('7', 'red', '红色', 'color', '颜色值', '10', '0', '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '0');
+INSERT INTO `sys_dict` VALUES ('8', 'green', '绿色', 'color', '颜色值', '20', '0', '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '0');
+INSERT INTO `sys_dict` VALUES ('9', 'blue', '蓝色', 'color', '颜色值', '30', '0', '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '0');
+INSERT INTO `sys_dict` VALUES ('10', 'yellow', '黄色', 'color', '颜色值', '40', '0', '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '0');
+INSERT INTO `sys_dict` VALUES ('11', 'orange', '橙色', 'color', '颜色值', '50', '0', '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '0');
+INSERT INTO `sys_dict` VALUES ('12', 'default', '默认主题', 'theme', '主题方案', '10', '0', '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '0');
+INSERT INTO `sys_dict` VALUES ('13', 'cerulean', '天蓝主题', 'theme', '主题方案', '20', '0', '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '0');
+INSERT INTO `sys_dict` VALUES ('14', 'readable', '橙色主题', 'theme', '主题方案', '30', '0', '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '0');
+INSERT INTO `sys_dict` VALUES ('15', 'united', '红色主题', 'theme', '主题方案', '40', '0', '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '0');
+INSERT INTO `sys_dict` VALUES ('16', 'flat', 'Flat主题', 'theme', '主题方案', '60', '0', '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '0');
+INSERT INTO `sys_dict` VALUES ('17', '1', '国家', 'sys_area_type', '区域类型', '10', '0', '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '0');
+INSERT INTO `sys_dict` VALUES ('18', '2', '省份、直辖市', 'sys_area_type', '区域类型', '20', '0', '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '0');
+INSERT INTO `sys_dict` VALUES ('19', '3', '地市', 'sys_area_type', '区域类型', '30', '0', '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '0');
+INSERT INTO `sys_dict` VALUES ('20', '4', '区县', 'sys_area_type', '区域类型', '40', '0', '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '0');
+INSERT INTO `sys_dict` VALUES ('21', '1', '公司', 'sys_office_type', '机构类型', '60', '0', '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '0');
+INSERT INTO `sys_dict` VALUES ('22', '2', '部门', 'sys_office_type', '机构类型', '70', '0', '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '0');
+INSERT INTO `sys_dict` VALUES ('23', '3', '小组', 'sys_office_type', '机构类型', '80', '0', '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '0');
+INSERT INTO `sys_dict` VALUES ('24', '4', '其它', 'sys_office_type', '机构类型', '90', '0', '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '0');
+INSERT INTO `sys_dict` VALUES ('25', '1', '综合部', 'sys_office_common', '快捷通用部门', '30', '0', '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '0');
+INSERT INTO `sys_dict` VALUES ('26', '2', '开发部', 'sys_office_common', '快捷通用部门', '40', '0', '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '0');
+INSERT INTO `sys_dict` VALUES ('27', '3', '人力部', 'sys_office_common', '快捷通用部门', '50', '0', '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '0');
+INSERT INTO `sys_dict` VALUES ('28', '1', '一级', 'sys_office_grade', '机构等级', '10', '0', '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '0');
+INSERT INTO `sys_dict` VALUES ('29', '2', '二级', 'sys_office_grade', '机构等级', '20', '0', '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '0');
+INSERT INTO `sys_dict` VALUES ('30', '3', '三级', 'sys_office_grade', '机构等级', '30', '0', '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '0');
+INSERT INTO `sys_dict` VALUES ('31', '4', '四级', 'sys_office_grade', '机构等级', '40', '0', '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '0');
+INSERT INTO `sys_dict` VALUES ('32', '1', '所有数据', 'sys_data_scope', '数据范围', '10', '0', '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '0');
+INSERT INTO `sys_dict` VALUES ('33', '2', '所在公司及以下数据', 'sys_data_scope', '数据范围', '20', '0', '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '0');
+INSERT INTO `sys_dict` VALUES ('34', '3', '所在公司数据', 'sys_data_scope', '数据范围', '30', '0', '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '0');
+INSERT INTO `sys_dict` VALUES ('35', '4', '所在部门及以下数据', 'sys_data_scope', '数据范围', '40', '0', '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '0');
+INSERT INTO `sys_dict` VALUES ('36', '5', '所在部门数据', 'sys_data_scope', '数据范围', '50', '0', '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '0');
+INSERT INTO `sys_dict` VALUES ('37', '8', '仅本人数据', 'sys_data_scope', '数据范围', '90', '0', '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '0');
+INSERT INTO `sys_dict` VALUES ('38', '9', '按明细设置', 'sys_data_scope', '数据范围', '100', '0', '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '0');
+INSERT INTO `sys_dict` VALUES ('39', '1', '系统管理', 'sys_user_type', '用户类型', '10', '0', '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '0');
+INSERT INTO `sys_dict` VALUES ('40', '2', '部门经理', 'sys_user_type', '用户类型', '20', '0', '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '0');
+INSERT INTO `sys_dict` VALUES ('41', '3', '普通用户', 'sys_user_type', '用户类型', '30', '0', '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '0');
+INSERT INTO `sys_dict` VALUES ('42', 'basic', '基础主题', 'cms_theme', '站点主题', '10', '0', '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '0');
+INSERT INTO `sys_dict` VALUES ('43', 'blue', '蓝色主题', 'cms_theme', '站点主题', '20', '0', '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '1');
+INSERT INTO `sys_dict` VALUES ('44', 'red', '红色主题', 'cms_theme', '站点主题', '30', '0', '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '1');
+INSERT INTO `sys_dict` VALUES ('45', 'article', '文章模型', 'cms_module', '栏目模型', '10', '0', '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '0');
+INSERT INTO `sys_dict` VALUES ('46', 'picture', '图片模型', 'cms_module', '栏目模型', '20', '0', '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '1');
+INSERT INTO `sys_dict` VALUES ('47', 'download', '下载模型', 'cms_module', '栏目模型', '30', '0', '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '1');
+INSERT INTO `sys_dict` VALUES ('48', 'link', '链接模型', 'cms_module', '栏目模型', '40', '0', '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '0');
+INSERT INTO `sys_dict` VALUES ('49', 'special', '专题模型', 'cms_module', '栏目模型', '50', '0', '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '1');
+INSERT INTO `sys_dict` VALUES ('50', '0', '默认展现方式', 'cms_show_modes', '展现方式', '10', '0', '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '0');
+INSERT INTO `sys_dict` VALUES ('51', '1', '首栏目内容列表', 'cms_show_modes', '展现方式', '20', '0', '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '0');
+INSERT INTO `sys_dict` VALUES ('52', '2', '栏目第一条内容', 'cms_show_modes', '展现方式', '30', '0', '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '0');
+INSERT INTO `sys_dict` VALUES ('53', '0', '发布', 'cms_del_flag', '内容状态', '10', '0', '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '0');
+INSERT INTO `sys_dict` VALUES ('54', '1', '删除', 'cms_del_flag', '内容状态', '20', '0', '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '0');
+INSERT INTO `sys_dict` VALUES ('55', '2', '审核', 'cms_del_flag', '内容状态', '15', '0', '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '0');
+INSERT INTO `sys_dict` VALUES ('56', '1', '首页焦点图', 'cms_posid', '推荐位', '10', '0', '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '0');
+INSERT INTO `sys_dict` VALUES ('57', '2', '栏目页文章推荐', 'cms_posid', '推荐位', '20', '0', '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '0');
+INSERT INTO `sys_dict` VALUES ('58', '1', '咨询', 'cms_guestbook', '留言板分类', '10', '0', '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '0');
+INSERT INTO `sys_dict` VALUES ('59', '2', '建议', 'cms_guestbook', '留言板分类', '20', '0', '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '0');
+INSERT INTO `sys_dict` VALUES ('60', '3', '投诉', 'cms_guestbook', '留言板分类', '30', '0', '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '0');
+INSERT INTO `sys_dict` VALUES ('61', '4', '其它', 'cms_guestbook', '留言板分类', '40', '0', '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '0');
+INSERT INTO `sys_dict` VALUES ('62', '1', '公休', 'oa_leave_type', '请假类型', '10', '0', '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '0');
+INSERT INTO `sys_dict` VALUES ('63', '2', '病假', 'oa_leave_type', '请假类型', '20', '0', '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '0');
+INSERT INTO `sys_dict` VALUES ('64', '3', '事假', 'oa_leave_type', '请假类型', '30', '0', '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '0');
+INSERT INTO `sys_dict` VALUES ('65', '4', '调休', 'oa_leave_type', '请假类型', '40', '0', '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '0');
+INSERT INTO `sys_dict` VALUES ('66', '5', '婚假', 'oa_leave_type', '请假类型', '60', '0', '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '0');
+INSERT INTO `sys_dict` VALUES ('67', '1', '接入日志', 'sys_log_type', '日志类型', '30', '0', '1', '2013-06-03 08:00:00', '1', '2013-06-03 08:00:00', null, '0');
+INSERT INTO `sys_dict` VALUES ('68', '2', '异常日志', 'sys_log_type', '日志类型', '40', '0', '1', '2013-06-03 08:00:00', '1', '2013-06-03 08:00:00', null, '0');
+INSERT INTO `sys_dict` VALUES ('69', 'leave', '请假流程', 'act_type', '流程类型', '10', '0', '1', '2013-06-03 08:00:00', '1', '2013-06-03 08:00:00', null, '0');
+INSERT INTO `sys_dict` VALUES ('70', 'test_audit', '审批测试流程', 'act_type', '流程类型', '20', '0', '1', '2013-06-03 08:00:00', '1', '2013-06-03 08:00:00', null, '0');
+INSERT INTO `sys_dict` VALUES ('71', '1', '分类1', 'act_category', '流程分类', '10', '0', '1', '2013-06-03 08:00:00', '1', '2013-06-03 08:00:00', null, '0');
+INSERT INTO `sys_dict` VALUES ('72', '2', '分类2', 'act_category', '流程分类', '20', '0', '1', '2013-06-03 08:00:00', '1', '2013-06-03 08:00:00', null, '0');
+INSERT INTO `sys_dict` VALUES ('73', 'crud', '增删改查', 'gen_category', '代码生成分类', '10', '0', '1', '2013-10-28 08:00:00', '1', '2013-10-28 08:00:00', null, '1');
+INSERT INTO `sys_dict` VALUES ('74', 'crud_many', '增删改查(包含从表)', 'gen_category', '代码生成分类', '20', '0', '1', '2013-10-28 08:00:00', '1', '2013-10-28 08:00:00', null, '1');
+INSERT INTO `sys_dict` VALUES ('75', 'tree', '树结构', 'gen_category', '代码生成分类', '30', '0', '1', '2013-10-28 08:00:00', '1', '2013-10-28 08:00:00', null, '1');
+INSERT INTO `sys_dict` VALUES ('76', '=', '=', 'gen_query_type', '查询方式', '10', '0', '1', '2013-10-28 08:00:00', '1', '2013-10-28 08:00:00', null, '1');
+INSERT INTO `sys_dict` VALUES ('77', '!=', '!=', 'gen_query_type', '查询方式', '20', '0', '1', '2013-10-28 08:00:00', '1', '2013-10-28 08:00:00', null, '1');
+INSERT INTO `sys_dict` VALUES ('78', '>', '>', 'gen_query_type', '查询方式', '30', '0', '1', '2013-10-28 08:00:00', '1', '2013-10-28 08:00:00', null, '1');
+INSERT INTO `sys_dict` VALUES ('79', '<', '<', 'gen_query_type', '查询方式', '40', '0', '1', '2013-10-28 08:00:00', '1', '2013-10-28 08:00:00', null, '1');
+INSERT INTO `sys_dict` VALUES ('80', 'between', 'Between', 'gen_query_type', '查询方式', '50', '0', '1', '2013-10-28 08:00:00', '1', '2013-10-28 08:00:00', null, '1');
+INSERT INTO `sys_dict` VALUES ('81', 'like', 'Like', 'gen_query_type', '查询方式', '60', '0', '1', '2013-10-28 08:00:00', '1', '2013-10-28 08:00:00', null, '1');
+INSERT INTO `sys_dict` VALUES ('82', 'left_like', 'Left Like', 'gen_query_type', '查询方式', '70', '0', '1', '2013-10-28 08:00:00', '1', '2013-10-28 08:00:00', null, '1');
+INSERT INTO `sys_dict` VALUES ('83', 'right_like', 'Right Like', 'gen_query_type', '查询方式', '80', '0', '1', '2013-10-28 08:00:00', '1', '2013-10-28 08:00:00', null, '1');
+INSERT INTO `sys_dict` VALUES ('84', 'input', '文本框', 'gen_show_type', '字段生成方案', '10', '0', '1', '2013-10-28 08:00:00', '1', '2013-10-28 08:00:00', null, '1');
+INSERT INTO `sys_dict` VALUES ('85', 'textarea', '文本域', 'gen_show_type', '字段生成方案', '20', '0', '1', '2013-10-28 08:00:00', '1', '2013-10-28 08:00:00', null, '1');
+INSERT INTO `sys_dict` VALUES ('86', 'select', '下拉框', 'gen_show_type', '字段生成方案', '30', '0', '1', '2013-10-28 08:00:00', '1', '2013-10-28 08:00:00', null, '1');
+INSERT INTO `sys_dict` VALUES ('87', 'checkbox', '复选框', 'gen_show_type', '字段生成方案', '40', '0', '1', '2013-10-28 08:00:00', '1', '2013-10-28 08:00:00', null, '1');
+INSERT INTO `sys_dict` VALUES ('88', 'radiobox', '单选框', 'gen_show_type', '字段生成方案', '50', '0', '1', '2013-10-28 08:00:00', '1', '2013-10-28 08:00:00', null, '1');
+INSERT INTO `sys_dict` VALUES ('89', 'dateselect', '日期选择', 'gen_show_type', '字段生成方案', '60', '0', '1', '2013-10-28 08:00:00', '1', '2013-10-28 08:00:00', null, '1');
+INSERT INTO `sys_dict` VALUES ('90', 'userselect', '人员选择\0', 'gen_show_type', '字段生成方案', '70', '0', '1', '2013-10-28 08:00:00', '1', '2013-10-28 08:00:00', null, '1');
+INSERT INTO `sys_dict` VALUES ('91', 'officeselect', '部门选择', 'gen_show_type', '字段生成方案', '80', '0', '1', '2013-10-28 08:00:00', '1', '2013-10-28 08:00:00', null, '1');
+INSERT INTO `sys_dict` VALUES ('92', 'areaselect', '区域选择', 'gen_show_type', '字段生成方案', '90', '0', '1', '2013-10-28 08:00:00', '1', '2013-10-28 08:00:00', null, '1');
+INSERT INTO `sys_dict` VALUES ('93', 'String', 'String', 'gen_java_type', 'Java类型', '10', '0', '1', '2013-10-28 08:00:00', '1', '2013-10-28 08:00:00', null, '1');
+INSERT INTO `sys_dict` VALUES ('94', 'Long', 'Long', 'gen_java_type', 'Java类型', '20', '0', '1', '2013-10-28 08:00:00', '1', '2013-10-28 08:00:00', null, '1');
+INSERT INTO `sys_dict` VALUES ('95', 'dao', '仅持久层', 'gen_category', '代码生成分类\0\0\0\0\0\0', '40', '0', '1', '2013-10-28 08:00:00', '1', '2013-10-28 08:00:00', null, '1');
+INSERT INTO `sys_dict` VALUES ('96', '1', '男', 'sex', '性别', '10', '0', '1', '2013-10-28 08:00:00', '1', '2013-10-28 08:00:00', null, '0');
+INSERT INTO `sys_dict` VALUES ('97', '2', '女', 'sex', '性别', '20', '0', '1', '2013-10-28 08:00:00', '1', '2013-10-28 08:00:00', null, '0');
+INSERT INTO `sys_dict` VALUES ('98', 'Integer', 'Integer', 'gen_java_type', 'Java类型\0\0', '30', '0', '1', '2013-10-28 08:00:00', '1', '2013-10-28 08:00:00', null, '1');
+INSERT INTO `sys_dict` VALUES ('99', 'Double', 'Double', 'gen_java_type', 'Java类型\0\0', '40', '0', '1', '2013-10-28 08:00:00', '1', '2013-10-28 08:00:00', null, '1');
+INSERT INTO `sys_dict` VALUES ('100', 'java.util.Date', 'Date', 'gen_java_type', 'Java类型\0\0', '50', '0', '1', '2013-10-28 08:00:00', '1', '2013-10-28 08:00:00', null, '1');
+INSERT INTO `sys_dict` VALUES ('101', 'com.thinkgem.jeesite.modules.sys.entity.User', 'User', 'gen_java_type', 'Java类型\0\0', '60', '0', '1', '2013-10-28 08:00:00', '1', '2013-10-28 08:00:00', null, '1');
+INSERT INTO `sys_dict` VALUES ('102', 'com.thinkgem.jeesite.modules.sys.entity.Office', 'Office', 'gen_java_type', 'Java类型\0\0', '70', '0', '1', '2013-10-28 08:00:00', '1', '2013-10-28 08:00:00', null, '1');
+INSERT INTO `sys_dict` VALUES ('103', 'com.thinkgem.jeesite.modules.sys.entity.Area', 'Area', 'gen_java_type', 'Java类型\0\0', '80', '0', '1', '2013-10-28 08:00:00', '1', '2013-10-28 08:00:00', null, '1');
+INSERT INTO `sys_dict` VALUES ('104', 'Custom', 'Custom', 'gen_java_type', 'Java类型\0\0', '90', '0', '1', '2013-10-28 08:00:00', '1', '2013-10-28 08:00:00', null, '1');
+INSERT INTO `sys_dict` VALUES ('105', '1', '会议通告\0\0\0\0', 'oa_notify_type', '通知通告类型', '10', '0', '1', '2013-11-08 08:00:00', '1', '2013-11-08 08:00:00', null, '0');
+INSERT INTO `sys_dict` VALUES ('106', '2', '奖惩通告\0\0\0\0', 'oa_notify_type', '通知通告类型', '20', '0', '1', '2013-11-08 08:00:00', '1', '2013-11-08 08:00:00', null, '0');
+INSERT INTO `sys_dict` VALUES ('107', '3', '活动通告\0\0\0\0', 'oa_notify_type', '通知通告类型', '30', '0', '1', '2013-11-08 08:00:00', '1', '2013-11-08 08:00:00', null, '0');
+INSERT INTO `sys_dict` VALUES ('108', '0', '草稿', 'oa_notify_status', '通知通告状态', '10', '0', '1', '2013-11-08 08:00:00', '1', '2013-11-08 08:00:00', null, '0');
+INSERT INTO `sys_dict` VALUES ('109', '1', '发布', 'oa_notify_status', '通知通告状态', '20', '0', '1', '2013-11-08 08:00:00', '1', '2013-11-08 08:00:00', null, '0');
+INSERT INTO `sys_dict` VALUES ('110', '0', '未读', 'oa_notify_read', '通知通告状态', '10', '0', '1', '2013-11-08 08:00:00', '1', '2013-11-08 08:00:00', null, '0');
+INSERT INTO `sys_dict` VALUES ('111', '1', '已读', 'oa_notify_read', '通知通告状态', '20', '0', '1', '2013-11-08 08:00:00', '1', '2013-11-08 08:00:00', null, '0');
+INSERT INTO `sys_dict` VALUES ('112', 'gh_bee9d094d109', '采美365网', 'wxType', '微信公众号类型', '11', '0', '1', '2016-04-28 16:42:44', '1', '2016-05-10 11:26:12', '', '0');
+INSERT INTO `sys_dict` VALUES ('113', 'gh_55ae110204bf', '呵呵商城', 'wxType', '微信公众号类型', '12', '0', '1', '2016-04-28 16:43:24', '1', '2016-05-10 11:28:18', '', '0');
+INSERT INTO `sys_dict` VALUES ('114', '0', '通用', 'wxType', '微信公众号类型', '13', '0', '1', '2016-04-29 16:32:37', '1', '2016-05-04 17:55:34', '', '0');
+INSERT INTO `sys_dict` VALUES ('119', 'text', '文本素材', 'responseType', '事件类型', '31', '0', '1', '2016-05-05 15:22:16', '1', '2016-05-10 10:21:06', '', '0');
+INSERT INTO `sys_dict` VALUES ('120', 'news', '图文素材', 'responseType', '事件类型', '32', '0', '1', '2016-05-05 15:23:02', '1', '2016-05-10 10:21:38', '', '0');
+INSERT INTO `sys_dict` VALUES ('121', 'input', '文本输入', 'msgType', '回复类型', '36', '0', '1', '2016-05-05 15:25:02', '1', '2016-05-10 10:23:03', '', '0');
+INSERT INTO `sys_dict` VALUES ('122', 'click', '点击事件', 'msgType', '回复类型', '37', '0', '1', '2016-05-05 15:25:33', '1', '2016-05-10 10:20:43', '', '0');
+INSERT INTO `sys_dict` VALUES ('123', 'subscribe', '关注', 'msgType', '回复类型', '38', '0', '1', '2016-05-10 10:15:31', '1', '2016-05-10 10:27:42', '', '0');
+INSERT INTO `sys_dict` VALUES ('124', 'scan', '扫码', 'msgType', '回复类型', '39', '0', '1', '2016-05-10 10:24:27', '1', '2016-05-10 10:24:36', '', '0');
+INSERT INTO `sys_dict` VALUES ('125', '1', '有限责任公司', 'enterprise_type', '公司类型', '41', '0', '1', '2016-05-13 10:01:12', '1', '2016-05-13 10:01:12', '', '0');
+INSERT INTO `sys_dict` VALUES ('126', '2', '股份有限公司', 'enterprise_type', '公司类型', '42', '0', '1', '2016-05-13 10:02:47', '1', '2016-05-13 10:02:47', '', '0');
+INSERT INTO `sys_dict` VALUES ('127', '0', '停用', 'enabled_status', '状态', '51', '0', '1', '2016-05-13 10:21:34', '1', '2016-05-13 10:21:34', '', '0');
+INSERT INTO `sys_dict` VALUES ('128', '1', '启用', 'enabled_status', '状态', '52', '0', '1', '2016-05-13 10:22:01', '1', '2016-05-13 10:22:01', '', '0');
+
+-- ----------------------------
+-- Table structure for sys_log
+-- ----------------------------
+DROP TABLE IF EXISTS `sys_log`;
+CREATE TABLE `sys_log` (
+  `id` bigint(64) NOT NULL AUTO_INCREMENT COMMENT '编号',
+  `type` char(1) DEFAULT '1' COMMENT '日志类型',
+  `title` varchar(255) DEFAULT '' COMMENT '日志标题',
+  `create_by` varchar(64) DEFAULT NULL COMMENT '创建者',
+  `create_date` datetime DEFAULT NULL COMMENT '创建时间',
+  `remote_addr` varchar(255) DEFAULT NULL COMMENT '操作IP地址',
+  `user_agent` varchar(255) DEFAULT NULL COMMENT '用户代理',
+  `request_uri` varchar(255) DEFAULT NULL COMMENT '请求URI',
+  `method` varchar(5) DEFAULT NULL COMMENT '操作方式',
+  `params` text COMMENT '操作提交的数据',
+  `exception` text COMMENT '异常信息',
+  PRIMARY KEY (`id`),
+  KEY `sys_log_create_by` (`create_by`),
+  KEY `sys_log_request_uri` (`request_uri`),
+  KEY `sys_log_type` (`type`),
+  KEY `sys_log_create_date` (`create_date`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='日志表';
+
+-- ----------------------------
+-- Records of sys_log
+-- ----------------------------
+
+-- ----------------------------
+-- Table structure for sys_mdict
+-- ----------------------------
+DROP TABLE IF EXISTS `sys_mdict`;
+CREATE TABLE `sys_mdict` (
+  `id` bigint(64) NOT NULL AUTO_INCREMENT COMMENT '编号',
+  `parent_id` varchar(64) NOT NULL COMMENT '父级编号',
+  `parent_ids` varchar(2000) NOT NULL COMMENT '所有父级编号',
+  `name` varchar(100) NOT NULL COMMENT '名称',
+  `sort` decimal(10,0) NOT NULL COMMENT '排序',
+  `description` varchar(100) DEFAULT NULL COMMENT '描述',
+  `create_by` varchar(64) NOT NULL COMMENT '创建者',
+  `create_date` datetime NOT NULL COMMENT '创建时间',
+  `update_by` varchar(64) NOT NULL COMMENT '更新者',
+  `update_date` datetime NOT NULL COMMENT '更新时间',
+  `remarks` varchar(255) DEFAULT NULL COMMENT '备注信息',
+  `del_flag` char(1) NOT NULL DEFAULT '0' COMMENT '删除标记',
+  PRIMARY KEY (`id`),
+  KEY `sys_mdict_parent_id` (`parent_id`),
+  KEY `sys_mdict_del_flag` (`del_flag`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='多级字典表';
+
+-- ----------------------------
+-- Records of sys_mdict
+-- ----------------------------
+
+-- ----------------------------
+-- Table structure for sys_menu
+-- ----------------------------
+DROP TABLE IF EXISTS `sys_menu`;
+CREATE TABLE `sys_menu` (
+  `id` bigint(64) NOT NULL AUTO_INCREMENT COMMENT '编号',
+  `parent_id` varchar(64) NOT NULL COMMENT '父级编号',
+  `parent_ids` varchar(2000) NOT NULL COMMENT '所有父级编号',
+  `name` varchar(100) NOT NULL COMMENT '名称',
+  `sort` decimal(10,0) NOT NULL COMMENT '排序',
+  `href` varchar(2000) DEFAULT NULL COMMENT '链接',
+  `target` varchar(20) DEFAULT NULL COMMENT '目标',
+  `icon` varchar(100) DEFAULT NULL COMMENT '图标',
+  `is_show` char(1) NOT NULL COMMENT '是否在菜单中显示',
+  `permission` varchar(200) DEFAULT NULL COMMENT '权限标识',
+  `create_by` varchar(64) NOT NULL COMMENT '创建者',
+  `create_date` datetime NOT NULL COMMENT '创建时间',
+  `update_by` varchar(64) NOT NULL COMMENT '更新者',
+  `update_date` datetime NOT NULL COMMENT '更新时间',
+  `remarks` varchar(255) DEFAULT NULL COMMENT '备注信息',
+  `del_flag` char(1) NOT NULL DEFAULT '0' COMMENT '删除标记',
+  PRIMARY KEY (`id`),
+  KEY `sys_menu_parent_id` (`parent_id`),
+  KEY `sys_menu_del_flag` (`del_flag`)
+) ENGINE=InnoDB AUTO_INCREMENT=140 DEFAULT CHARSET=utf8 COMMENT='菜单表';
+
+-- ----------------------------
+-- Records of sys_menu
+-- ----------------------------
+INSERT INTO `sys_menu` VALUES ('1', '0', '0,', '功能菜单', '0', null, null, null, '1', null, '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '0');
+INSERT INTO `sys_menu` VALUES ('2', '1', '0,1,', '系统设置', '900', null, null, null, '1', null, '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '0');
+INSERT INTO `sys_menu` VALUES ('3', '2', '0,1,2,', '系统设置', '3', null, null, null, '1', null, '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '0');
+INSERT INTO `sys_menu` VALUES ('4', '3', '0,1,2,3,', '菜单管理', '1', '/sys/menu/', null, 'list-alt', '1', null, '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '0');
+INSERT INTO `sys_menu` VALUES ('5', '4', '0,1,2,3,4,', '查看', '30', null, null, null, '0', 'sys:menu:view', '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '0');
+INSERT INTO `sys_menu` VALUES ('6', '4', '0,1,2,3,4,', '修改', '40', null, null, null, '0', 'sys:menu:edit', '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '0');
+INSERT INTO `sys_menu` VALUES ('7', '13', '0,1,2,13,', '角色管理', '2', '/sys/role/', '', 'lock', '1', '', '1', '2013-05-27 08:00:00', '1', '2016-05-09 11:08:32', '', '0');
+INSERT INTO `sys_menu` VALUES ('8', '7', '0,1,2,13,7,', '查看', '30', null, null, null, '0', 'sys:role:view', '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '0');
+INSERT INTO `sys_menu` VALUES ('9', '7', '0,1,2,13,7,', '修改', '40', null, null, null, '0', 'sys:role:edit', '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '0');
+INSERT INTO `sys_menu` VALUES ('10', '3', '0,1,2,3,', '字典管理', '2', '/sys/dict/', null, 'th-list', '1', null, '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '0');
+INSERT INTO `sys_menu` VALUES ('11', '10', '0,1,2,3,10,', '查看', '30', null, null, null, '0', 'sys:dict:view', '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '0');
+INSERT INTO `sys_menu` VALUES ('12', '10', '0,1,2,3,10,', '修改', '40', null, null, null, '0', 'sys:dict:edit', '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '0');
+INSERT INTO `sys_menu` VALUES ('13', '2', '0,1,2,', '机构用户', '2', null, null, null, '1', null, '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '0');
+INSERT INTO `sys_menu` VALUES ('14', '13', '0,1,2,13,', '区域管理', '4', '/sys/area/', null, 'th', '1', null, '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '0');
+INSERT INTO `sys_menu` VALUES ('15', '14', '0,1,2,13,14,', '查看', '30', null, null, null, '0', 'sys:area:view', '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '0');
+INSERT INTO `sys_menu` VALUES ('16', '14', '0,1,2,13,14,', '修改', '40', null, null, null, '0', 'sys:area:edit', '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '0');
+INSERT INTO `sys_menu` VALUES ('17', '13', '0,1,2,13,', '机构管理', '3', '/sys/office/', null, 'th-large', '1', null, '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '0');
+INSERT INTO `sys_menu` VALUES ('18', '17', '0,1,2,13,17,', '查看', '30', null, null, null, '0', 'sys:office:view', '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '0');
+INSERT INTO `sys_menu` VALUES ('19', '17', '0,1,2,13,17,', '修改', '40', null, null, null, '0', 'sys:office:edit', '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '0');
+INSERT INTO `sys_menu` VALUES ('20', '13', '0,1,2,13,', '用户管理', '1', '/sys/user/index', null, 'user', '1', null, '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '0');
+INSERT INTO `sys_menu` VALUES ('21', '20', '0,1,2,13,20,', '查看', '30', null, null, null, '0', 'sys:user:view', '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '0');
+INSERT INTO `sys_menu` VALUES ('22', '20', '0,1,2,13,20,', '修改', '40', null, null, null, '0', 'sys:user:edit', '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '0');
+INSERT INTO `sys_menu` VALUES ('24', '23', '0,1,2,23', '官方首页', '30', 'http://jeesite.com', '_blank', null, '0', null, '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '0');
+INSERT INTO `sys_menu` VALUES ('27', '2', '0,1,2,', '我的面板', '1', '', '', '', '1', '', '1', '2013-05-27 08:00:00', '1', '2016-04-28 16:29:28', '', '0');
+INSERT INTO `sys_menu` VALUES ('28', '27', '0,1,2,27,', '个人信息', '1', null, null, null, '1', null, '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '0');
+INSERT INTO `sys_menu` VALUES ('29', '28', '0,1,2,27,28,', '个人信息', '30', '/sys/user/info', null, 'user', '1', null, '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '0');
+INSERT INTO `sys_menu` VALUES ('30', '28', '0,1,2,27,28,', '修改密码', '40', '/sys/user/modifyPwd', null, 'lock', '1', null, '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '0');
+INSERT INTO `sys_menu` VALUES ('56', '71', '0,1,2,27,71,', '文件管理', '90', '/../static/ckfinder/ckfinder.html', null, 'folder-open', '1', null, '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '0');
+INSERT INTO `sys_menu` VALUES ('57', '56', '0,1,2,27,40,56,', '查看', '30', null, null, null, '0', 'cms:ckfinder:view', '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '0');
+INSERT INTO `sys_menu` VALUES ('58', '56', '0,1,2,27,40,56,', '上传', '40', null, null, null, '0', 'cms:ckfinder:upload', '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '0');
+INSERT INTO `sys_menu` VALUES ('59', '56', '0,1,2,27,40,56,', '修改', '50', null, null, null, '0', 'cms:ckfinder:edit', '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '0');
+INSERT INTO `sys_menu` VALUES ('67', '2', '0,1,2,', '日志查询', '4', null, null, null, '1', null, '1', '2013-06-03 08:00:00', '1', '2013-06-03 08:00:00', null, '0');
+INSERT INTO `sys_menu` VALUES ('68', '67', '0,1,2,67,', '日志查询', '1', '/sys/log', null, 'pencil', '1', 'sys:log:view', '1', '2013-06-03 08:00:00', '1', '2013-06-03 08:00:00', null, '0');
+INSERT INTO `sys_menu` VALUES ('71', '27', '0,1,2,27,', '文件管理', '2', null, null, null, '1', null, '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '0');
+INSERT INTO `sys_menu` VALUES ('84', '67', '0,1,2,67,', '连接池监视', '2', '/../druid', null, null, '1', null, '1', '2013-10-18 08:00:00', '1', '2013-10-18 08:00:00', null, '0');
+INSERT INTO `sys_menu` VALUES ('85', '76', '0,1,75,76,', '行政区域', '80', '/../static/map/map-city.html', null, null, '1', null, '1', '2013-10-22 08:00:00', '1', '2013-10-22 08:00:00', null, '0');
+INSERT INTO `sys_menu` VALUES ('120', '1', '0,1,', '代码生成', '5000', '', '', '', '1', '', '1', '2016-05-12 13:34:19', '1', '2016-05-12 13:34:19', '', '0');
+INSERT INTO `sys_menu` VALUES ('121', '120', '0,1,120,', '代码生成', '1', '', '', '', '1', '', '1', '2016-05-12 13:35:04', '1', '2016-05-12 13:35:04', '', '0');
+INSERT INTO `sys_menu` VALUES ('122', '121', '0,1,120,121,', '生成方案配置', '2', '/gen/genScheme', '', '', '1', 'gen:genScheme:view,gen:genScheme:edit', '1', '2016-05-12 13:35:28', '1', '2016-05-12 13:56:15', '', '0');
+INSERT INTO `sys_menu` VALUES ('125', '121', '0,1,120,121,', '业务表配置', '1', '/gen/genTable', '', '', '1', 'gen:genTable:view,gen:genTable:edit,gen:genTableColumn:view,gen:genTableColumn:edit', '1', '2016-05-12 13:36:47', '1', '2016-05-12 13:56:24', '', '0');
+INSERT INTO `sys_menu` VALUES ('126', '1', '0,1,', '品牌联盟', '1', '', '', '', '1', '', '1', '2016-05-13 10:30:36', '1', '2016-05-13 10:30:36', '', '0');
+INSERT INTO `sys_menu` VALUES ('127', '126', '0,1,126,', '品牌联盟', '1', '', '', '', '1', '', '1', '2016-05-13 10:30:57', '1', '2016-05-13 11:55:17', '', '0');
+INSERT INTO `sys_menu` VALUES ('128', '127', '0,1,126,127,', '供应商管理', '1', '/brand/brandSupplier', '', '', '1', '', '1', '2016-05-13 10:32:17', '1', '2016-05-13 11:55:34', '', '0');
+INSERT INTO `sys_menu` VALUES ('129', '128', '0,1,126,127,128,', '查看', '30', '', '', '', '0', 'brand:brandSupplier:view', '1', '2016-05-13 10:32:34', '1', '2016-05-13 10:32:34', '', '0');
+INSERT INTO `sys_menu` VALUES ('130', '128', '0,1,126,127,128,', '编辑', '60', '', '', '', '0', 'brand:brandSupplier:edit', '1', '2016-05-13 10:32:59', '1', '2016-05-13 10:32:59', '', '0');
+INSERT INTO `sys_menu` VALUES ('131', '127', '0,1,126,127,', '代理商管理', '2', '/brand/brandAgent', '', '', '1', '', '1', '2016-05-13 14:24:50', '1', '2016-05-13 14:24:50', '', '0');
+INSERT INTO `sys_menu` VALUES ('132', '131', '0,1,126,127,131,', '查看', '30', '', '', '', '0', 'brand:brandAgent:view', '1', '2016-05-13 14:25:37', '1', '2016-05-13 14:25:37', '', '0');
+INSERT INTO `sys_menu` VALUES ('133', '131', '0,1,126,127,131,', '编辑', '60', '', '', '', '0', 'brand:brandAgent:edit', '1', '2016-05-13 14:25:58', '1', '2016-05-13 14:25:58', '', '0');
+INSERT INTO `sys_menu` VALUES ('134', '127', '0,1,126,127,', '购买者管理', '3', '/brand/brandPurchaser', '', '', '1', '', '1', '2016-05-13 14:58:05', '1', '2016-05-13 15:05:30', '', '0');
+INSERT INTO `sys_menu` VALUES ('135', '134', '0,1,126,127,134,', '查看', '30', '', '', '', '0', 'brand:brandPurchaser:view', '1', '2016-05-13 14:58:50', '1', '2016-05-13 14:59:16', '', '0');
+INSERT INTO `sys_menu` VALUES ('136', '134', '0,1,126,127,134,', '编辑', '60', '', '', '', '0', 'brand:brandPurchaser:edit', '1', '2016-05-13 14:59:05', '1', '2016-05-13 14:59:05', '', '0');
+INSERT INTO `sys_menu` VALUES ('137', '127', '0,1,126,127,', '商品管理', '0', '/brand/brandProduct', '', '', '1', '', '1', '2016-05-13 16:01:47', '1', '2016-05-13 16:01:47', '', '0');
+INSERT INTO `sys_menu` VALUES ('138', '137', '0,1,126,127,137,', '查看', '30', '', '', '', '0', 'brand:brandProduct:view', '1', '2016-05-13 16:02:01', '1', '2016-05-13 16:02:01', '', '0');
+INSERT INTO `sys_menu` VALUES ('139', '137', '0,1,126,127,137,', '编辑', '60', '', '', '', '0', 'brand:brandProduct:edit', '1', '2016-05-13 16:02:18', '1', '2016-05-13 16:02:18', '', '0');
+
+-- ----------------------------
+-- Table structure for sys_office
+-- ----------------------------
+DROP TABLE IF EXISTS `sys_office`;
+CREATE TABLE `sys_office` (
+  `id` bigint(64) NOT NULL AUTO_INCREMENT COMMENT '编号',
+  `parent_id` varchar(64) NOT NULL COMMENT '父级编号',
+  `parent_ids` varchar(2000) NOT NULL COMMENT '所有父级编号',
+  `name` varchar(100) NOT NULL COMMENT '名称',
+  `sort` decimal(10,0) NOT NULL COMMENT '排序',
+  `area_id` varchar(64) NOT NULL COMMENT '归属区域',
+  `code` varchar(100) DEFAULT NULL COMMENT '区域编码',
+  `type` char(1) NOT NULL COMMENT '机构类型',
+  `grade` char(1) NOT NULL COMMENT '机构等级',
+  `address` varchar(255) DEFAULT NULL COMMENT '联系地址',
+  `zip_code` varchar(100) DEFAULT NULL COMMENT '邮政编码',
+  `master` varchar(100) DEFAULT NULL COMMENT '负责人',
+  `phone` varchar(200) DEFAULT NULL COMMENT '电话',
+  `fax` varchar(200) DEFAULT NULL COMMENT '传真',
+  `email` varchar(200) DEFAULT NULL COMMENT '邮箱',
+  `USEABLE` varchar(64) DEFAULT NULL COMMENT '是否启用',
+  `PRIMARY_PERSON` varchar(64) DEFAULT NULL COMMENT '主负责人',
+  `DEPUTY_PERSON` varchar(64) DEFAULT NULL COMMENT '副负责人',
+  `create_by` varchar(64) NOT NULL COMMENT '创建者',
+  `create_date` datetime NOT NULL COMMENT '创建时间',
+  `update_by` varchar(64) NOT NULL COMMENT '更新者',
+  `update_date` datetime NOT NULL COMMENT '更新时间',
+  `remarks` varchar(255) DEFAULT NULL COMMENT '备注信息',
+  `del_flag` char(1) NOT NULL DEFAULT '0' COMMENT '删除标记',
+  PRIMARY KEY (`id`),
+  KEY `sys_office_parent_id` (`parent_id`),
+  KEY `sys_office_del_flag` (`del_flag`),
+  KEY `sys_office_type` (`type`)
+) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8 COMMENT='机构表';
+
+-- ----------------------------
+-- Records of sys_office
+-- ----------------------------
+INSERT INTO `sys_office` VALUES ('1', '0', '0,', '总公司', '10', '2', '100000', '1', '1', '', '', '', '', '', '', '1', '', '', '1', '2013-05-27 08:00:00', '1', '2016-05-09 11:04:50', '', '0');
+INSERT INTO `sys_office` VALUES ('2', '1', '0,1,', '公司领导', '10', '2', '100001', '2', '1', null, null, null, null, null, null, '1', null, null, '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '0');
+INSERT INTO `sys_office` VALUES ('3', '1', '0,1,', '综合部', '20', '2', '100002', '2', '1', null, null, null, null, null, null, '1', null, null, '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '0');
+INSERT INTO `sys_office` VALUES ('4', '1', '0,1,', '市场部', '30', '2', '100003', '2', '1', null, null, null, null, null, null, '1', null, null, '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '0');
+INSERT INTO `sys_office` VALUES ('5', '1', '0,1,', '技术部', '40', '2', '100004', '2', '1', null, null, null, null, null, null, '1', null, null, '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '0');
+INSERT INTO `sys_office` VALUES ('6', '1', '0,1,', '研发部', '50', '2', '100005', '2', '1', null, null, null, null, null, null, '1', null, null, '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '0');
+
+-- ----------------------------
+-- Table structure for sys_role
+-- ----------------------------
+DROP TABLE IF EXISTS `sys_role`;
+CREATE TABLE `sys_role` (
+  `id` bigint(64) NOT NULL AUTO_INCREMENT COMMENT '编号',
+  `office_id` varchar(64) DEFAULT NULL COMMENT '归属机构',
+  `name` varchar(100) NOT NULL COMMENT '角色名称',
+  `enname` varchar(255) DEFAULT NULL COMMENT '英文名称',
+  `role_type` varchar(255) DEFAULT NULL COMMENT '角色类型',
+  `data_scope` char(1) DEFAULT NULL COMMENT '数据范围',
+  `is_sys` varchar(64) DEFAULT NULL COMMENT '是否系统数据',
+  `useable` varchar(64) DEFAULT NULL COMMENT '是否可用',
+  `create_by` varchar(64) NOT NULL COMMENT '创建者',
+  `create_date` datetime NOT NULL COMMENT '创建时间',
+  `update_by` varchar(64) NOT NULL COMMENT '更新者',
+  `update_date` datetime NOT NULL COMMENT '更新时间',
+  `remarks` varchar(255) DEFAULT NULL COMMENT '备注信息',
+  `del_flag` char(1) NOT NULL DEFAULT '0' COMMENT '删除标记',
+  PRIMARY KEY (`id`),
+  KEY `sys_role_del_flag` (`del_flag`),
+  KEY `sys_role_enname` (`enname`)
+) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8 COMMENT='角色表';
+
+-- ----------------------------
+-- Records of sys_role
+-- ----------------------------
+INSERT INTO `sys_role` VALUES ('1', '2', '系统管理员', 'dept', 'assignment', '1', '1', '1', '1', '2013-05-27 08:00:00', '1', '2016-05-13 15:00:38', '', '0');
+INSERT INTO `sys_role` VALUES ('6', '1', '普通用户', 'd', 'assignment', '8', null, '1', '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '0');
+
+-- ----------------------------
+-- Table structure for sys_role_menu
+-- ----------------------------
+DROP TABLE IF EXISTS `sys_role_menu`;
+CREATE TABLE `sys_role_menu` (
+  `role_id` varchar(64) NOT NULL COMMENT '角色编号',
+  `menu_id` varchar(64) NOT NULL COMMENT '菜单编号',
+  PRIMARY KEY (`role_id`,`menu_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='角色-菜单';
+
+-- ----------------------------
+-- Records of sys_role_menu
+-- ----------------------------
+INSERT INTO `sys_role_menu` VALUES ('1', '1');
+INSERT INTO `sys_role_menu` VALUES ('1', '10');
+INSERT INTO `sys_role_menu` VALUES ('1', '11');
+INSERT INTO `sys_role_menu` VALUES ('1', '12');
+INSERT INTO `sys_role_menu` VALUES ('1', '120');
+INSERT INTO `sys_role_menu` VALUES ('1', '121');
+INSERT INTO `sys_role_menu` VALUES ('1', '122');
+INSERT INTO `sys_role_menu` VALUES ('1', '125');
+INSERT INTO `sys_role_menu` VALUES ('1', '126');
+INSERT INTO `sys_role_menu` VALUES ('1', '127');
+INSERT INTO `sys_role_menu` VALUES ('1', '128');
+INSERT INTO `sys_role_menu` VALUES ('1', '129');
+INSERT INTO `sys_role_menu` VALUES ('1', '13');
+INSERT INTO `sys_role_menu` VALUES ('1', '130');
+INSERT INTO `sys_role_menu` VALUES ('1', '131');
+INSERT INTO `sys_role_menu` VALUES ('1', '132');
+INSERT INTO `sys_role_menu` VALUES ('1', '133');
+INSERT INTO `sys_role_menu` VALUES ('1', '134');
+INSERT INTO `sys_role_menu` VALUES ('1', '135');
+INSERT INTO `sys_role_menu` VALUES ('1', '136');
+INSERT INTO `sys_role_menu` VALUES ('1', '14');
+INSERT INTO `sys_role_menu` VALUES ('1', '15');
+INSERT INTO `sys_role_menu` VALUES ('1', '16');
+INSERT INTO `sys_role_menu` VALUES ('1', '17');
+INSERT INTO `sys_role_menu` VALUES ('1', '18');
+INSERT INTO `sys_role_menu` VALUES ('1', '19');
+INSERT INTO `sys_role_menu` VALUES ('1', '2');
+INSERT INTO `sys_role_menu` VALUES ('1', '20');
+INSERT INTO `sys_role_menu` VALUES ('1', '21');
+INSERT INTO `sys_role_menu` VALUES ('1', '22');
+INSERT INTO `sys_role_menu` VALUES ('1', '24');
+INSERT INTO `sys_role_menu` VALUES ('1', '27');
+INSERT INTO `sys_role_menu` VALUES ('1', '28');
+INSERT INTO `sys_role_menu` VALUES ('1', '29');
+INSERT INTO `sys_role_menu` VALUES ('1', '3');
+INSERT INTO `sys_role_menu` VALUES ('1', '30');
+INSERT INTO `sys_role_menu` VALUES ('1', '4');
+INSERT INTO `sys_role_menu` VALUES ('1', '5');
+INSERT INTO `sys_role_menu` VALUES ('1', '56');
+INSERT INTO `sys_role_menu` VALUES ('1', '57');
+INSERT INTO `sys_role_menu` VALUES ('1', '58');
+INSERT INTO `sys_role_menu` VALUES ('1', '59');
+INSERT INTO `sys_role_menu` VALUES ('1', '6');
+INSERT INTO `sys_role_menu` VALUES ('1', '67');
+INSERT INTO `sys_role_menu` VALUES ('1', '68');
+INSERT INTO `sys_role_menu` VALUES ('1', '7');
+INSERT INTO `sys_role_menu` VALUES ('1', '71');
+INSERT INTO `sys_role_menu` VALUES ('1', '8');
+INSERT INTO `sys_role_menu` VALUES ('1', '84');
+INSERT INTO `sys_role_menu` VALUES ('1', '85');
+INSERT INTO `sys_role_menu` VALUES ('1', '9');
+INSERT INTO `sys_role_menu` VALUES ('2', '1');
+INSERT INTO `sys_role_menu` VALUES ('2', '10');
+INSERT INTO `sys_role_menu` VALUES ('2', '11');
+INSERT INTO `sys_role_menu` VALUES ('2', '12');
+INSERT INTO `sys_role_menu` VALUES ('2', '13');
+INSERT INTO `sys_role_menu` VALUES ('2', '14');
+INSERT INTO `sys_role_menu` VALUES ('2', '15');
+INSERT INTO `sys_role_menu` VALUES ('2', '16');
+INSERT INTO `sys_role_menu` VALUES ('2', '17');
+INSERT INTO `sys_role_menu` VALUES ('2', '18');
+INSERT INTO `sys_role_menu` VALUES ('2', '19');
+INSERT INTO `sys_role_menu` VALUES ('2', '2');
+INSERT INTO `sys_role_menu` VALUES ('2', '20');
+INSERT INTO `sys_role_menu` VALUES ('2', '21');
+INSERT INTO `sys_role_menu` VALUES ('2', '22');
+INSERT INTO `sys_role_menu` VALUES ('2', '23');
+INSERT INTO `sys_role_menu` VALUES ('2', '24');
+INSERT INTO `sys_role_menu` VALUES ('2', '25');
+INSERT INTO `sys_role_menu` VALUES ('2', '26');
+INSERT INTO `sys_role_menu` VALUES ('2', '27');
+INSERT INTO `sys_role_menu` VALUES ('2', '28');
+INSERT INTO `sys_role_menu` VALUES ('2', '29');
+INSERT INTO `sys_role_menu` VALUES ('2', '3');
+INSERT INTO `sys_role_menu` VALUES ('2', '30');
+INSERT INTO `sys_role_menu` VALUES ('2', '31');
+INSERT INTO `sys_role_menu` VALUES ('2', '32');
+INSERT INTO `sys_role_menu` VALUES ('2', '33');
+INSERT INTO `sys_role_menu` VALUES ('2', '34');
+INSERT INTO `sys_role_menu` VALUES ('2', '35');
+INSERT INTO `sys_role_menu` VALUES ('2', '36');
+INSERT INTO `sys_role_menu` VALUES ('2', '37');
+INSERT INTO `sys_role_menu` VALUES ('2', '38');
+INSERT INTO `sys_role_menu` VALUES ('2', '39');
+INSERT INTO `sys_role_menu` VALUES ('2', '4');
+INSERT INTO `sys_role_menu` VALUES ('2', '40');
+INSERT INTO `sys_role_menu` VALUES ('2', '41');
+INSERT INTO `sys_role_menu` VALUES ('2', '42');
+INSERT INTO `sys_role_menu` VALUES ('2', '43');
+INSERT INTO `sys_role_menu` VALUES ('2', '44');
+INSERT INTO `sys_role_menu` VALUES ('2', '45');
+INSERT INTO `sys_role_menu` VALUES ('2', '46');
+INSERT INTO `sys_role_menu` VALUES ('2', '47');
+INSERT INTO `sys_role_menu` VALUES ('2', '48');
+INSERT INTO `sys_role_menu` VALUES ('2', '49');
+INSERT INTO `sys_role_menu` VALUES ('2', '5');
+INSERT INTO `sys_role_menu` VALUES ('2', '50');
+INSERT INTO `sys_role_menu` VALUES ('2', '51');
+INSERT INTO `sys_role_menu` VALUES ('2', '52');
+INSERT INTO `sys_role_menu` VALUES ('2', '53');
+INSERT INTO `sys_role_menu` VALUES ('2', '54');
+INSERT INTO `sys_role_menu` VALUES ('2', '55');
+INSERT INTO `sys_role_menu` VALUES ('2', '56');
+INSERT INTO `sys_role_menu` VALUES ('2', '57');
+INSERT INTO `sys_role_menu` VALUES ('2', '58');
+INSERT INTO `sys_role_menu` VALUES ('2', '59');
+INSERT INTO `sys_role_menu` VALUES ('2', '6');
+INSERT INTO `sys_role_menu` VALUES ('2', '60');
+INSERT INTO `sys_role_menu` VALUES ('2', '61');
+INSERT INTO `sys_role_menu` VALUES ('2', '62');
+INSERT INTO `sys_role_menu` VALUES ('2', '63');
+INSERT INTO `sys_role_menu` VALUES ('2', '64');
+INSERT INTO `sys_role_menu` VALUES ('2', '65');
+INSERT INTO `sys_role_menu` VALUES ('2', '66');
+INSERT INTO `sys_role_menu` VALUES ('2', '67');
+INSERT INTO `sys_role_menu` VALUES ('2', '68');
+INSERT INTO `sys_role_menu` VALUES ('2', '69');
+INSERT INTO `sys_role_menu` VALUES ('2', '7');
+INSERT INTO `sys_role_menu` VALUES ('2', '70');
+INSERT INTO `sys_role_menu` VALUES ('2', '71');
+INSERT INTO `sys_role_menu` VALUES ('2', '72');
+INSERT INTO `sys_role_menu` VALUES ('2', '73');
+INSERT INTO `sys_role_menu` VALUES ('2', '74');
+INSERT INTO `sys_role_menu` VALUES ('2', '75');
+INSERT INTO `sys_role_menu` VALUES ('2', '76');
+INSERT INTO `sys_role_menu` VALUES ('2', '77');
+INSERT INTO `sys_role_menu` VALUES ('2', '78');
+INSERT INTO `sys_role_menu` VALUES ('2', '79');
+INSERT INTO `sys_role_menu` VALUES ('2', '8');
+INSERT INTO `sys_role_menu` VALUES ('2', '80');
+INSERT INTO `sys_role_menu` VALUES ('2', '81');
+INSERT INTO `sys_role_menu` VALUES ('2', '82');
+INSERT INTO `sys_role_menu` VALUES ('2', '83');
+INSERT INTO `sys_role_menu` VALUES ('2', '84');
+INSERT INTO `sys_role_menu` VALUES ('2', '85');
+INSERT INTO `sys_role_menu` VALUES ('2', '86');
+INSERT INTO `sys_role_menu` VALUES ('2', '87');
+INSERT INTO `sys_role_menu` VALUES ('2', '88');
+INSERT INTO `sys_role_menu` VALUES ('2', '89');
+INSERT INTO `sys_role_menu` VALUES ('2', '9');
+INSERT INTO `sys_role_menu` VALUES ('2', '90');
+INSERT INTO `sys_role_menu` VALUES ('3', '1');
+INSERT INTO `sys_role_menu` VALUES ('3', '10');
+INSERT INTO `sys_role_menu` VALUES ('3', '11');
+INSERT INTO `sys_role_menu` VALUES ('3', '12');
+INSERT INTO `sys_role_menu` VALUES ('3', '13');
+INSERT INTO `sys_role_menu` VALUES ('3', '14');
+INSERT INTO `sys_role_menu` VALUES ('3', '15');
+INSERT INTO `sys_role_menu` VALUES ('3', '16');
+INSERT INTO `sys_role_menu` VALUES ('3', '17');
+INSERT INTO `sys_role_menu` VALUES ('3', '18');
+INSERT INTO `sys_role_menu` VALUES ('3', '19');
+INSERT INTO `sys_role_menu` VALUES ('3', '2');
+INSERT INTO `sys_role_menu` VALUES ('3', '20');
+INSERT INTO `sys_role_menu` VALUES ('3', '21');
+INSERT INTO `sys_role_menu` VALUES ('3', '22');
+INSERT INTO `sys_role_menu` VALUES ('3', '23');
+INSERT INTO `sys_role_menu` VALUES ('3', '24');
+INSERT INTO `sys_role_menu` VALUES ('3', '25');
+INSERT INTO `sys_role_menu` VALUES ('3', '26');
+INSERT INTO `sys_role_menu` VALUES ('3', '27');
+INSERT INTO `sys_role_menu` VALUES ('3', '28');
+INSERT INTO `sys_role_menu` VALUES ('3', '29');
+INSERT INTO `sys_role_menu` VALUES ('3', '3');
+INSERT INTO `sys_role_menu` VALUES ('3', '30');
+INSERT INTO `sys_role_menu` VALUES ('3', '31');
+INSERT INTO `sys_role_menu` VALUES ('3', '32');
+INSERT INTO `sys_role_menu` VALUES ('3', '33');
+INSERT INTO `sys_role_menu` VALUES ('3', '34');
+INSERT INTO `sys_role_menu` VALUES ('3', '35');
+INSERT INTO `sys_role_menu` VALUES ('3', '36');
+INSERT INTO `sys_role_menu` VALUES ('3', '37');
+INSERT INTO `sys_role_menu` VALUES ('3', '38');
+INSERT INTO `sys_role_menu` VALUES ('3', '39');
+INSERT INTO `sys_role_menu` VALUES ('3', '4');
+INSERT INTO `sys_role_menu` VALUES ('3', '40');
+INSERT INTO `sys_role_menu` VALUES ('3', '41');
+INSERT INTO `sys_role_menu` VALUES ('3', '42');
+INSERT INTO `sys_role_menu` VALUES ('3', '43');
+INSERT INTO `sys_role_menu` VALUES ('3', '44');
+INSERT INTO `sys_role_menu` VALUES ('3', '45');
+INSERT INTO `sys_role_menu` VALUES ('3', '46');
+INSERT INTO `sys_role_menu` VALUES ('3', '47');
+INSERT INTO `sys_role_menu` VALUES ('3', '48');
+INSERT INTO `sys_role_menu` VALUES ('3', '49');
+INSERT INTO `sys_role_menu` VALUES ('3', '5');
+INSERT INTO `sys_role_menu` VALUES ('3', '50');
+INSERT INTO `sys_role_menu` VALUES ('3', '51');
+INSERT INTO `sys_role_menu` VALUES ('3', '52');
+INSERT INTO `sys_role_menu` VALUES ('3', '53');
+INSERT INTO `sys_role_menu` VALUES ('3', '54');
+INSERT INTO `sys_role_menu` VALUES ('3', '55');
+INSERT INTO `sys_role_menu` VALUES ('3', '56');
+INSERT INTO `sys_role_menu` VALUES ('3', '57');
+INSERT INTO `sys_role_menu` VALUES ('3', '58');
+INSERT INTO `sys_role_menu` VALUES ('3', '59');
+INSERT INTO `sys_role_menu` VALUES ('3', '6');
+INSERT INTO `sys_role_menu` VALUES ('3', '60');
+INSERT INTO `sys_role_menu` VALUES ('3', '61');
+INSERT INTO `sys_role_menu` VALUES ('3', '62');
+INSERT INTO `sys_role_menu` VALUES ('3', '63');
+INSERT INTO `sys_role_menu` VALUES ('3', '64');
+INSERT INTO `sys_role_menu` VALUES ('3', '65');
+INSERT INTO `sys_role_menu` VALUES ('3', '66');
+INSERT INTO `sys_role_menu` VALUES ('3', '67');
+INSERT INTO `sys_role_menu` VALUES ('3', '68');
+INSERT INTO `sys_role_menu` VALUES ('3', '69');
+INSERT INTO `sys_role_menu` VALUES ('3', '7');
+INSERT INTO `sys_role_menu` VALUES ('3', '70');
+INSERT INTO `sys_role_menu` VALUES ('3', '71');
+INSERT INTO `sys_role_menu` VALUES ('3', '72');
+INSERT INTO `sys_role_menu` VALUES ('3', '73');
+INSERT INTO `sys_role_menu` VALUES ('3', '74');
+INSERT INTO `sys_role_menu` VALUES ('3', '75');
+INSERT INTO `sys_role_menu` VALUES ('3', '76');
+INSERT INTO `sys_role_menu` VALUES ('3', '77');
+INSERT INTO `sys_role_menu` VALUES ('3', '78');
+INSERT INTO `sys_role_menu` VALUES ('3', '79');
+INSERT INTO `sys_role_menu` VALUES ('3', '8');
+INSERT INTO `sys_role_menu` VALUES ('3', '80');
+INSERT INTO `sys_role_menu` VALUES ('3', '81');
+INSERT INTO `sys_role_menu` VALUES ('3', '82');
+INSERT INTO `sys_role_menu` VALUES ('3', '83');
+INSERT INTO `sys_role_menu` VALUES ('3', '84');
+INSERT INTO `sys_role_menu` VALUES ('3', '85');
+INSERT INTO `sys_role_menu` VALUES ('3', '86');
+INSERT INTO `sys_role_menu` VALUES ('3', '87');
+INSERT INTO `sys_role_menu` VALUES ('3', '88');
+INSERT INTO `sys_role_menu` VALUES ('3', '89');
+INSERT INTO `sys_role_menu` VALUES ('3', '9');
+INSERT INTO `sys_role_menu` VALUES ('3', '90');
+
+-- ----------------------------
+-- Table structure for sys_role_office
+-- ----------------------------
+DROP TABLE IF EXISTS `sys_role_office`;
+CREATE TABLE `sys_role_office` (
+  `role_id` varchar(64) NOT NULL COMMENT '角色编号',
+  `office_id` varchar(64) NOT NULL COMMENT '机构编号',
+  PRIMARY KEY (`role_id`,`office_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='角色-机构';
+
+-- ----------------------------
+-- Records of sys_role_office
+-- ----------------------------
+INSERT INTO `sys_role_office` VALUES ('7', '10');
+INSERT INTO `sys_role_office` VALUES ('7', '11');
+INSERT INTO `sys_role_office` VALUES ('7', '12');
+INSERT INTO `sys_role_office` VALUES ('7', '13');
+INSERT INTO `sys_role_office` VALUES ('7', '14');
+INSERT INTO `sys_role_office` VALUES ('7', '15');
+INSERT INTO `sys_role_office` VALUES ('7', '16');
+INSERT INTO `sys_role_office` VALUES ('7', '17');
+INSERT INTO `sys_role_office` VALUES ('7', '18');
+INSERT INTO `sys_role_office` VALUES ('7', '19');
+INSERT INTO `sys_role_office` VALUES ('7', '20');
+INSERT INTO `sys_role_office` VALUES ('7', '21');
+INSERT INTO `sys_role_office` VALUES ('7', '22');
+INSERT INTO `sys_role_office` VALUES ('7', '23');
+INSERT INTO `sys_role_office` VALUES ('7', '24');
+INSERT INTO `sys_role_office` VALUES ('7', '25');
+INSERT INTO `sys_role_office` VALUES ('7', '26');
+INSERT INTO `sys_role_office` VALUES ('7', '7');
+INSERT INTO `sys_role_office` VALUES ('7', '8');
+INSERT INTO `sys_role_office` VALUES ('7', '9');
+
+-- ----------------------------
+-- Table structure for sys_user
+-- ----------------------------
+DROP TABLE IF EXISTS `sys_user`;
+CREATE TABLE `sys_user` (
+  `id` bigint(64) NOT NULL AUTO_INCREMENT COMMENT '编号',
+  `company_id` varchar(64) NOT NULL COMMENT '归属公司',
+  `office_id` varchar(64) NOT NULL COMMENT '归属部门',
+  `login_name` varchar(100) NOT NULL COMMENT '登录名',
+  `password` varchar(100) NOT NULL COMMENT '密码',
+  `no` varchar(100) DEFAULT NULL COMMENT '工号',
+  `name` varchar(100) NOT NULL COMMENT '姓名',
+  `email` varchar(200) DEFAULT NULL COMMENT '邮箱',
+  `phone` varchar(200) DEFAULT NULL COMMENT '电话',
+  `mobile` varchar(200) DEFAULT NULL COMMENT '手机',
+  `user_type` char(1) DEFAULT NULL COMMENT '用户类型',
+  `photo` varchar(1000) DEFAULT NULL COMMENT '用户头像',
+  `login_ip` varchar(100) DEFAULT NULL COMMENT '最后登陆IP',
+  `login_date` datetime DEFAULT NULL COMMENT '最后登陆时间',
+  `login_flag` varchar(64) DEFAULT NULL COMMENT '是否可登录',
+  `create_by` varchar(64) NOT NULL COMMENT '创建者',
+  `create_date` datetime NOT NULL COMMENT '创建时间',
+  `update_by` varchar(64) NOT NULL COMMENT '更新者',
+  `update_date` datetime NOT NULL COMMENT '更新时间',
+  `remarks` varchar(255) DEFAULT NULL COMMENT '备注信息',
+  `del_flag` char(1) NOT NULL DEFAULT '0' COMMENT '删除标记',
+  PRIMARY KEY (`id`),
+  KEY `sys_user_office_id` (`office_id`),
+  KEY `sys_user_login_name` (`login_name`),
+  KEY `sys_user_company_id` (`company_id`),
+  KEY `sys_user_update_date` (`update_date`),
+  KEY `sys_user_del_flag` (`del_flag`)
+) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8 COMMENT='用户表';
+
+-- ----------------------------
+-- Records of sys_user
+-- ----------------------------
+INSERT INTO `sys_user` VALUES ('1', '1', '2', 'test', '2fd651d1e9130ec1fdf2da7f113b0e1eea0b0177d8ccfbde8481d6eb', '0001', '系统管理员', '', '8675', '8675', null, '', '0:0:0:0:0:0:0:1', '2016-05-18 22:21:40', '1', '1', '2013-05-27 08:00:00', '1', '2016-04-20 16:41:51', '最高管理员', '0');
+INSERT INTO `sys_user` VALUES ('2', '1', '2', 'sd_admin', '02a3f0772fcca9f415adc990734b45c6f059c7d33ee28362c4852032', '0002', '管理员', null, null, null, null, null, null, null, '1', '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '0');
+INSERT INTO `sys_user` VALUES ('3', '1', '3', 'sd_zhb', '02a3f0772fcca9f415adc990734b45c6f059c7d33ee28362c4852032', '0003', '综合部', null, null, null, null, null, null, null, '1', '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '0');
+INSERT INTO `sys_user` VALUES ('4', '1', '4', 'sd_scb', '02a3f0772fcca9f415adc990734b45c6f059c7d33ee28362c4852032', '0004', '市场部', null, null, null, null, null, null, null, '1', '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '0');
+INSERT INTO `sys_user` VALUES ('5', '1', '5', 'sd_jsb', '02a3f0772fcca9f415adc990734b45c6f059c7d33ee28362c4852032', '0005', '技术部', null, null, null, null, null, null, null, '1', '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '0');
+INSERT INTO `sys_user` VALUES ('6', '1', '6', 'sd_yfb', '02a3f0772fcca9f415adc990734b45c6f059c7d33ee28362c4852032', '0006', '研发部', null, null, null, null, null, null, null, '1', '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '0');
+INSERT INTO `sys_user` VALUES ('7', '7', '8', 'jn_admin', '02a3f0772fcca9f415adc990734b45c6f059c7d33ee28362c4852032', '0007', '济南领导', null, null, null, null, null, null, null, '1', '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '0');
+INSERT INTO `sys_user` VALUES ('8', '7', '9', 'jn_zhb', '02a3f0772fcca9f415adc990734b45c6f059c7d33ee28362c4852032', '0008', '济南综合部', null, null, null, null, null, null, null, '1', '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '0');
+INSERT INTO `sys_user` VALUES ('9', '7', '10', 'jn_scb', '02a3f0772fcca9f415adc990734b45c6f059c7d33ee28362c4852032', '0009', '济南市场部', null, null, null, null, null, null, null, '1', '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '0');
+INSERT INTO `sys_user` VALUES ('10', '7', '11', 'jn_jsb', '02a3f0772fcca9f415adc990734b45c6f059c7d33ee28362c4852032', '0010', '济南技术部', null, null, null, null, null, null, null, '1', '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '0');
+INSERT INTO `sys_user` VALUES ('11', '12', '13', 'lc_admin', '02a3f0772fcca9f415adc990734b45c6f059c7d33ee28362c4852032', '0011', '济南历城领导', null, null, null, null, null, null, null, '1', '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '0');
+INSERT INTO `sys_user` VALUES ('12', '12', '18', 'lx_admin', '02a3f0772fcca9f415adc990734b45c6f059c7d33ee28362c4852032', '0012', '济南历下领导', null, null, null, null, null, null, null, '1', '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '0');
+INSERT INTO `sys_user` VALUES ('13', '22', '23', 'gx_admin', '02a3f0772fcca9f415adc990734b45c6f059c7d33ee28362c4852032', '0013', '济南高新领导', null, null, null, null, null, null, null, '1', '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '0');
+
+-- ----------------------------
+-- Table structure for sys_user_role
+-- ----------------------------
+DROP TABLE IF EXISTS `sys_user_role`;
+CREATE TABLE `sys_user_role` (
+  `user_id` varchar(64) NOT NULL COMMENT '用户编号',
+  `role_id` varchar(64) NOT NULL COMMENT '角色编号',
+  PRIMARY KEY (`user_id`,`role_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='用户-角色';
+
+-- ----------------------------
+-- Records of sys_user_role
+-- ----------------------------
+INSERT INTO `sys_user_role` VALUES ('1', '1');
+INSERT INTO `sys_user_role` VALUES ('1', '2');
+INSERT INTO `sys_user_role` VALUES ('10', '2');
+INSERT INTO `sys_user_role` VALUES ('11', '3');
+INSERT INTO `sys_user_role` VALUES ('12', '4');
+INSERT INTO `sys_user_role` VALUES ('13', '5');
+INSERT INTO `sys_user_role` VALUES ('14', '6');
+INSERT INTO `sys_user_role` VALUES ('2', '1');
+INSERT INTO `sys_user_role` VALUES ('3', '2');
+INSERT INTO `sys_user_role` VALUES ('4', '3');
+INSERT INTO `sys_user_role` VALUES ('5', '4');
+INSERT INTO `sys_user_role` VALUES ('6', '5');
+INSERT INTO `sys_user_role` VALUES ('7', '2');
+INSERT INTO `sys_user_role` VALUES ('7', '7');
+INSERT INTO `sys_user_role` VALUES ('8', '2');
+INSERT INTO `sys_user_role` VALUES ('9', '1');
+
+-- ----------------------------
+-- Table structure for test_data
+-- ----------------------------
+DROP TABLE IF EXISTS `test_data`;
+CREATE TABLE `test_data` (
+  `id` bigint(64) NOT NULL AUTO_INCREMENT COMMENT '编号',
+  `user_id` varchar(64) DEFAULT NULL COMMENT '归属用户',
+  `office_id` varchar(64) DEFAULT NULL COMMENT '归属部门',
+  `area_id` varchar(64) DEFAULT NULL COMMENT '归属区域',
+  `name` varchar(100) DEFAULT NULL COMMENT '名称',
+  `sex` char(1) DEFAULT NULL COMMENT '性别',
+  `in_date` date DEFAULT NULL COMMENT '加入日期',
+  `create_by` varchar(64) NOT NULL COMMENT '创建者',
+  `create_date` datetime NOT NULL COMMENT '创建时间',
+  `update_by` varchar(64) NOT NULL COMMENT '更新者',
+  `update_date` datetime NOT NULL COMMENT '更新时间',
+  `remarks` varchar(255) DEFAULT NULL COMMENT '备注信息',
+  `del_flag` char(1) NOT NULL DEFAULT '0' COMMENT '删除标记',
+  PRIMARY KEY (`id`),
+  KEY `test_data_del_flag` (`del_flag`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='业务数据表';
+
+-- ----------------------------
+-- Records of test_data
+-- ----------------------------
+
+-- ----------------------------
+-- Table structure for test_data_child
+-- ----------------------------
+DROP TABLE IF EXISTS `test_data_child`;
+CREATE TABLE `test_data_child` (
+  `id` bigint(64) NOT NULL AUTO_INCREMENT COMMENT '编号',
+  `test_data_main_id` varchar(64) DEFAULT NULL COMMENT '业务主表ID',
+  `name` varchar(100) DEFAULT NULL COMMENT '名称',
+  `create_by` varchar(64) NOT NULL COMMENT '创建者',
+  `create_date` datetime NOT NULL COMMENT '创建时间',
+  `update_by` varchar(64) NOT NULL COMMENT '更新者',
+  `update_date` datetime NOT NULL COMMENT '更新时间',
+  `remarks` varchar(255) DEFAULT NULL COMMENT '备注信息',
+  `del_flag` char(1) NOT NULL DEFAULT '0' COMMENT '删除标记',
+  PRIMARY KEY (`id`),
+  KEY `test_data_child_del_flag` (`del_flag`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='业务数据子表';
+
+-- ----------------------------
+-- Records of test_data_child
+-- ----------------------------
+
+-- ----------------------------
+-- Table structure for test_data_main
+-- ----------------------------
+DROP TABLE IF EXISTS `test_data_main`;
+CREATE TABLE `test_data_main` (
+  `id` bigint(64) NOT NULL AUTO_INCREMENT COMMENT '编号',
+  `user_id` varchar(64) DEFAULT NULL COMMENT '归属用户',
+  `office_id` varchar(64) DEFAULT NULL COMMENT '归属部门',
+  `area_id` varchar(64) DEFAULT NULL COMMENT '归属区域',
+  `name` varchar(100) DEFAULT NULL COMMENT '名称',
+  `sex` char(1) DEFAULT NULL COMMENT '性别',
+  `in_date` date DEFAULT NULL COMMENT '加入日期',
+  `create_by` varchar(64) NOT NULL COMMENT '创建者',
+  `create_date` datetime NOT NULL COMMENT '创建时间',
+  `update_by` varchar(64) NOT NULL COMMENT '更新者',
+  `update_date` datetime NOT NULL COMMENT '更新时间',
+  `remarks` varchar(255) DEFAULT NULL COMMENT '备注信息',
+  `del_flag` char(1) NOT NULL DEFAULT '0' COMMENT '删除标记',
+  PRIMARY KEY (`id`),
+  KEY `test_data_main_del_flag` (`del_flag`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='业务数据表';
+
+-- ----------------------------
+-- Records of test_data_main
+-- ----------------------------
+
+-- ----------------------------
+-- Table structure for test_tree
+-- ----------------------------
+DROP TABLE IF EXISTS `test_tree`;
+CREATE TABLE `test_tree` (
+  `id` bigint(64) NOT NULL AUTO_INCREMENT COMMENT '编号',
+  `parent_id` varchar(64) NOT NULL COMMENT '父级编号',
+  `parent_ids` varchar(2000) NOT NULL COMMENT '所有父级编号',
+  `name` varchar(100) NOT NULL COMMENT '名称',
+  `sort` decimal(10,0) NOT NULL COMMENT '排序',
+  `create_by` varchar(64) NOT NULL COMMENT '创建者',
+  `create_date` datetime NOT NULL COMMENT '创建时间',
+  `update_by` varchar(64) NOT NULL COMMENT '更新者',
+  `update_date` datetime NOT NULL COMMENT '更新时间',
+  `remarks` varchar(255) DEFAULT NULL COMMENT '备注信息',
+  `del_flag` char(1) NOT NULL DEFAULT '0' COMMENT '删除标记',
+  PRIMARY KEY (`id`),
+  KEY `test_tree_del_flag` (`del_flag`),
+  KEY `test_data_parent_id` (`parent_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='树结构表';
+
+-- ----------------------------
+-- Records of test_tree
+-- ----------------------------

+ 46 - 0
db/大宗采购6.1.sql

@@ -0,0 +1,46 @@
+
+-- 分期订单 - 应付供应商
+
+alter table bp_order_stages add column `cmFee` DECIMAL(20,2) DEFAULT 0 COMMENT '分期应付采美' AFTER fee;
+alter table bp_order_stages add column `otherFee` DECIMAL(20,2) DEFAULT 0 COMMENT '分期应付三方' AFTER cmFee;
+alter table bp_order_stages add column `shopFee` DECIMAL(20,2) DEFAULT 0 COMMENT '分期总应付供应商' AFTER otherFee;
+
+DROP TABLE IF EXISTS bp_order_stages_shop;
+CREATE TABLE `bp_order_stages_shop` (
+  `id` bigint(11) NOT NULL AUTO_INCREMENT,
+  `stagesId` bigint(11) DEFAULT NULL COMMENT '分期id',
+	`orderId` BIGINT(11) DEFAULT NULL COMMENT '订单id',
+	`stagesNum` INT(11) DEFAULT NULL COMMENT '期数',
+  `shopId` bigint(11) DEFAULT NULL COMMENT '厂商ID',
+	`shopFee` DECIMAL(20,2) DEFAULT 0 COMMENT '应付供应商',
+	`addTime` datetime DEFAULT NULL COMMENT '添加时间',
+  `updateBy` varchar(64) DEFAULT NULL COMMENT '最后修改人',
+  `updateDate` datetime DEFAULT NULL COMMENT '最后更新时间',
+	`createBy` varchar(64) DEFAULT NULL COMMENT '创建人',
+  `createDate` datetime DEFAULT NULL COMMENT '创建时间',
+	`delFlag` varchar(20) DEFAULT '0' COMMENT '删除标记 0 否,其余是',
+  PRIMARY KEY (`id`)
+) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='分期订单应付供应商表';
+
+alter table cm_finance_charge add column `stagesId` bigint(11) DEFAULT NULL COMMENT '分期id 表示分期应付供应商' AFTER orderNo;
+alter table bp_order_product_remark add column `stagesId` bigint(11) DEFAULT NULL COMMENT '分期id 表示分期应付供应商' AFTER orderProductId;
+
+DROP TABLE IF EXISTS cm_finance_charge_stages;
+CREATE TABLE `cm_finance_charge_stages` (
+  `id` bigint(11) NOT NULL AUTO_INCREMENT,
+  `chargeId` bigint(11) DEFAULT NULL COMMENT '出账信息id',
+  `stagesId` bigint(11) DEFAULT NULL COMMENT '分期id',
+	`orderNo` varchar(30) DEFAULT NULL COMMENT '订单编号',
+  `shopId` bigint(11) DEFAULT NULL COMMENT '厂商ID',
+	`shopFee` DECIMAL(20,2) DEFAULT 0 COMMENT '该期该次应付供应商',
+	`addTime` datetime DEFAULT NULL COMMENT '添加时间',
+  `updateBy` varchar(64) DEFAULT NULL COMMENT '最后修改人',
+  `updateDate` datetime DEFAULT NULL COMMENT '最后更新时间',
+	`createBy` varchar(64) DEFAULT NULL COMMENT '创建人',
+  `createDate` datetime DEFAULT NULL COMMENT '创建时间',
+  `delFlag` varchar(20) DEFAULT '0' COMMENT '删除标记 0 否,其余是',
+  PRIMARY KEY (`id`)
+) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='分期应付供应商出账信息表';
+
+
+-------------------------以上已执行于 2018.4.16 --------------------------

+ 5 - 0
db/库分期.sql

@@ -0,0 +1,5 @@
+INSERT INTO `caimei`.`paytype` (`payTypeID`, `name`, `validFlag`, `image`) VALUES ('1009', '在线支付_库分期支付', '1', NULL);
+alter table bp_order add column cooFreeFlag char(1) DEFAULT '1' COMMENT '库分期免息状态 0、免息 1、不免息' AFTER discount;
+alter table bp_order add column cooFreeRate int(3) DEFAULT 0 COMMENT '库分期免息费率 实际计算除以100' AFTER cooFreeFlag;
+alter table bp_order add column cooFreeAmount DECIMAL(20,2) DEFAULT 0.00 COMMENT '库分期免息金额' AFTER cooFreeRate;
+alter table cm_finance_receipts add column cooFreeAmount DECIMAL(20,2) DEFAULT 0.00 COMMENT '库分期免息金额' AFTER deductionAmount;

BIN
doc/1.介绍与安装.docx


BIN
doc/2.文件结构与配置.docx


BIN
doc/3.内置组件的应用.docx


BIN
doc/4.代码生成器的应用.docx


BIN
doc/5.硕正WEB组件的应用.docx


BIN
doc/6.工作流的应用实例.docx


BIN
doc/7.手机端基础接口文档.docx


BIN
doc/8.内容管理模块功能说明.docx


BIN
doc/jeesite_help.chm


+ 55 - 0
doc/接口.txt

@@ -0,0 +1,55 @@
+
+>>地址联动
+	1、加载province
+		接口:/area/loadProvince
+		参数:无
+		返回值:
+			[
+			    {
+			        "id": 1,
+			        "name": "北京市"
+			    },
+			    {
+			        "provinceId": 2,
+			        "name": "天津市"
+			    }
+			]
+	
+	2、根据province加载city
+		接口:/area/loadCity
+		参数:provinceId	
+		返回值:
+			[
+			    {
+			        "id": 3,
+			        "provinceId": 2,
+			        "name": "市辖区"
+			    },
+			    {
+			        "cityId": 4,
+			        "provinceId": 2,
+			        "name": "县"
+			    }
+			]
+	
+	3、根据city加载town
+		接口:/area/loadTown
+		参数:cityId
+		返回值:
+			[
+			    {
+			        "id": 17,
+			        "cityId": 2,
+			        "name": "密云县",
+			        "zip": "100000",
+			        "telZip": "010"
+			    },
+			    {
+			        "id": 18,
+			        "cityId": 2,
+			        "name": "延庆县",
+			        "zip": "100000",
+			        "telZip": "010"
+			    }
+			]
+				

+ 932 - 0
pom.xml

@@ -0,0 +1,932 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+	<groupId>com.caimei</groupId>
+	<version>0.0.1-SNAPSHOT</version>
+	<artifactId>caimei-manager</artifactId>
+	<packaging>war</packaging>
+	<name>caimei-manager</name>
+	<url>http://www.caimei365.com</url>
+	<inceptionYear>2016</inceptionYear>
+
+	<!-- 项目属性 -->
+	<properties>
+
+		<!-- main version setting -->
+		<spring.version>4.2.5.RELEASE</spring.version>
+		<validator.version>5.1.1.Final</validator.version>
+		<mybatis.version>3.2.8</mybatis.version>
+		<mybatis-spring.version>1.2.2</mybatis-spring.version>
+		<druid.version>1.1.23</druid.version>
+		<ehcache.version>2.6.9</ehcache.version>
+		<ehcache-web.version>2.0.4</ehcache-web.version>
+		<shiro.version>1.7.0</shiro.version>
+		<sitemesh.version>2.4.2</sitemesh.version>
+		<activiti.version>5.15.1</activiti.version>
+
+		<!-- tools version setting -->
+		<slf4j.version>1.7.19</slf4j.version>
+		<commons-lang3.version>3.3.2</commons-lang3.version>
+		<commons-io.version>2.4</commons-io.version>
+		<commons-codec.version>1.9</commons-codec.version>
+		<commons-fileupload.version>1.3.1</commons-fileupload.version>
+		<commons-beanutils.version>1.9.1</commons-beanutils.version>
+		<jackson.version>2.2.3</jackson.version>
+		<fastjson.version>1.1.40</fastjson.version>
+		<xstream.version>1.4.7</xstream.version>
+		<guava.version>17.0</guava.version>
+		<dozer.version>5.5.1</dozer.version>
+		<poi.version>3.9</poi.version>
+		<freemarker.version>2.3.20</freemarker.version>
+
+		<!-- jdbc driver setting -->
+		<mysql.driver.version>8.0.18</mysql.driver.version>
+
+		<!-- environment setting -->
+		<jdk.version>1.8</jdk.version>
+		<tomcat.version>2.2</tomcat.version>
+		<jetty.version>7.6.14.v20131031</jetty.version>
+		<webserver.port>8081</webserver.port>
+		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+		<downloadSources>true</downloadSources>
+
+		<!-- 设定编译部署的目标环境 -->
+		<env.type>dev</env.type>
+
+	</properties>
+
+	<profiles>
+		<!-- 开发环境 -->
+		<profile>
+			<id>dev</id>
+			<properties>
+				<env.type>dev</env.type>
+			</properties>
+		</profile>
+		<!-- 开发测试环境 -->
+		<profile>
+			<id>alpha</id>
+			<properties>
+				<env.type>alpha</env.type>
+			</properties>
+		</profile>
+		<!-- 测试环境 -->
+		<profile>
+			<id>beta</id>
+			<properties>
+				<env.type>beta</env.type>
+			</properties>
+		</profile>
+		<!-- 生产正式环境 -->
+		<profile>
+			<id>product</id>
+			<properties>
+				<env.type>product</env.type>
+			</properties>
+		</profile>
+	</profiles>
+
+	<!-- 设定插件仓库 -->
+	<pluginRepositories>
+		<!-- 如有Nexus私服, 取消注释并指向正确的服务器地址. -->
+		<!-- <pluginRepository>
+			<id>nexus-repos</id>
+			<name>Team Nexus Repository</name>
+			<url>http://192.168.11.36:8888/nexus/content/groups/public</url>
+		</pluginRepository> -->
+
+		<pluginRepository>
+            <id>oschina-repos</id>
+            <name>Oschina Releases</name>
+            <url>http://maven.oschina.net/content/groups/public</url>
+        </pluginRepository>
+
+	</pluginRepositories>
+	<!-- 依赖项定义 -->
+	<dependencies>
+
+		<!-- SPRING begin -->
+		<dependency>
+			<groupId>org.springframework</groupId>
+			<artifactId>spring-core</artifactId>
+			<version>${spring.version}</version>
+			<exclusions>
+				<exclusion>
+					<groupId>commons-logging</groupId>
+					<artifactId>commons-logging</artifactId>
+				</exclusion>
+			</exclusions>
+		</dependency>
+		<dependency>
+			<groupId>org.springframework</groupId>
+			<artifactId>spring-beans</artifactId>
+			<version>${spring.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>org.springframework</groupId>
+			<artifactId>spring-context</artifactId>
+			<version>${spring.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>org.springframework</groupId>
+			<artifactId>spring-context-support</artifactId>
+			<version>${spring.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>org.springframework</groupId>
+			<artifactId>spring-aop</artifactId>
+			<version>${spring.version}</version>
+			<exclusions>
+				<exclusion>
+					<groupId>commons-logging</groupId>
+					<artifactId>commons-logging</artifactId>
+				</exclusion>
+			</exclusions>
+		</dependency>
+		<dependency>
+			<groupId>org.springframework</groupId>
+			<artifactId>spring-tx</artifactId>
+			<version>${spring.version}</version>
+		</dependency>
+
+		<!-- spring orm -->
+		<dependency>
+			<groupId>org.springframework</groupId>
+			<artifactId>spring-orm</artifactId>
+			<version>${spring.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>org.springframework</groupId>
+			<artifactId>spring-jdbc</artifactId>
+			<version>${spring.version}</version>
+		</dependency>
+
+		<!-- bean validate -->
+		<dependency>
+			<groupId>org.hibernate</groupId>
+			<artifactId>hibernate-validator</artifactId>
+			<version>${validator.version}</version>
+		</dependency>
+		<!-- SPRING end -->
+
+		<!-- AOP begin -->
+		<dependency>
+			<groupId>org.aspectj</groupId>
+			<artifactId>aspectjrt</artifactId>
+			<version>1.7.4</version>
+		</dependency>
+		<dependency>
+			<groupId>org.aspectj</groupId>
+			<artifactId>aspectjweaver</artifactId>
+			<version>1.7.4</version>
+		</dependency>
+		<dependency>
+			<groupId>cglib</groupId>
+			<artifactId>cglib</artifactId>
+			<version>3.1</version>
+		</dependency>
+		<!-- AOP end -->
+
+		<!-- PERSISTENCE begin -->
+
+		<!-- MyBatis -->
+		<dependency>
+			<groupId>org.mybatis</groupId>
+			<artifactId>mybatis</artifactId>
+			<version>${mybatis.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>org.mybatis</groupId>
+			<artifactId>mybatis-spring</artifactId>
+			<version>${mybatis-spring.version}</version>
+		</dependency>
+
+		<!-- connection pool -->
+		<dependency>
+		     <groupId>com.alibaba</groupId>
+		     <artifactId>druid</artifactId>
+		     <version>${druid.version}</version>
+		</dependency>
+
+		<!-- jdbc driver -->
+		<dependency>
+			<groupId>mysql</groupId>
+			<artifactId>mysql-connector-java</artifactId>
+			<version>${mysql.driver.version}</version>
+			<scope>runtime</scope>
+		</dependency>
+
+		<!-- PERSISTENCE end -->
+
+		<!-- WEB begin -->
+		<dependency>
+			<groupId>org.springframework</groupId>
+			<artifactId>spring-web</artifactId>
+			<version>${spring.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>org.springframework</groupId>
+			<artifactId>spring-webmvc</artifactId>
+			<version>${spring.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>org.springframework</groupId>
+			<artifactId>spring-oxm</artifactId>
+			<version>${spring.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>opensymphony</groupId>
+			<artifactId>sitemesh</artifactId>
+			<version>${sitemesh.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>taglibs</groupId>
+			<artifactId>standard</artifactId>
+			<version>1.1.2</version>
+			<type>jar</type>
+		</dependency>
+		<dependency>
+			<groupId>javax.servlet</groupId>
+			<artifactId>jstl</artifactId>
+			<version>1.2</version>
+			<type>jar</type>
+		</dependency>
+		<dependency>
+			<groupId>javax.servlet</groupId>
+			<artifactId>javax.servlet-api</artifactId>
+			<version>3.1.0</version>
+			<scope>provided</scope>
+		</dependency>
+		<dependency>
+			<groupId>javax.servlet.jsp</groupId>
+			<artifactId>jsp-api</artifactId>
+			<version>2.1</version>
+			<scope>provided</scope>
+		</dependency>
+
+		<!-- CACHE begin -->
+		<dependency>
+			<groupId>net.sf.ehcache</groupId>
+			<artifactId>ehcache-core</artifactId>
+			<version>${ehcache.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>net.sf.ehcache</groupId>
+			<artifactId>ehcache-web</artifactId>
+			<version>${ehcache-web.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>redis.clients</groupId>
+			<artifactId>jedis</artifactId>
+			<version>2.8.1</version>
+		</dependency>
+		<!-- CACHE end -->
+
+		<!-- SECURITY begin -->
+		<dependency>
+			<groupId>org.apache.shiro</groupId>
+			<artifactId>shiro-core</artifactId>
+			<version>${shiro.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.shiro</groupId>
+			<artifactId>shiro-spring</artifactId>
+			<version>${shiro.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.shiro</groupId>
+			<artifactId>shiro-cas</artifactId>
+			<version>${shiro.version}</version>
+			<exclusions>
+				<exclusion>
+					<groupId>commons-logging</groupId>
+					<artifactId>commons-logging</artifactId>
+				</exclusion>
+			</exclusions>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.shiro</groupId>
+			<artifactId>shiro-web</artifactId>
+			<version>${shiro.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.shiro</groupId>
+			<artifactId>shiro-ehcache</artifactId>
+			<version>${shiro.version}</version>
+		</dependency>
+		<!-- SECURITY end -->
+
+		<dependency>
+			<groupId>com.jcraft</groupId>
+			<artifactId>jsch</artifactId>
+			<version>0.1.55</version>
+		</dependency>
+		<dependency>
+			<groupId>org.samba.jcifs</groupId>
+			<artifactId>jcifs</artifactId>
+			<version>1.2.6</version>
+		</dependency>
+
+		<!-- Activiti -->
+		<dependency>
+			<groupId>org.activiti</groupId>
+			<artifactId>activiti-engine</artifactId>
+			<version>${activiti.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>org.activiti</groupId>
+			<artifactId>activiti-spring</artifactId>
+			<version>${activiti.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>org.activiti</groupId>
+			<artifactId>activiti-explorer</artifactId>
+			<version>${activiti.version}</version>
+			<exclusions>
+				<exclusion>
+					<artifactId>vaadin</artifactId>
+					<groupId>com.vaadin</groupId>
+				</exclusion>
+				<exclusion>
+					<artifactId>dcharts-widget</artifactId>
+					<groupId>org.vaadin.addons</groupId>
+				</exclusion>
+				<exclusion>
+					<artifactId>activiti-simple-workflow</artifactId>
+					<groupId>org.activiti</groupId>
+				</exclusion>
+			</exclusions>
+		</dependency>
+		<dependency>
+			<groupId>org.activiti</groupId>
+			<artifactId>activiti-modeler</artifactId>
+            <version>${activiti.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>org.activiti</groupId>
+			<artifactId>activiti-diagram-rest</artifactId>
+			<version>${activiti.version}</version>
+		</dependency>
+
+		<!-- 支持activiti缓存 -->
+		<!-- <dependency>
+			<groupId>org.infinispan</groupId>
+			<artifactId>infinispan-core</artifactId>
+			<version>5.1.7.Final</version>
+		</dependency> -->
+		<!-- https://mvnrepository.com/artifact/org.exoplatform.jcr/exo.jcr.framework.ftpclient -->
+
+
+		<!-- LOGGING begin -->
+		<dependency>
+			<groupId>org.slf4j</groupId>
+			<artifactId>slf4j-api</artifactId>
+			<version>${slf4j.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>org.slf4j</groupId>
+			<artifactId>slf4j-log4j12</artifactId>
+			<version>${slf4j.version}</version>
+		</dependency>
+		<!-- common-logging 实际调用slf4j -->
+		<dependency>
+			<groupId>org.slf4j</groupId>
+			<artifactId>jcl-over-slf4j</artifactId>
+			<version>${slf4j.version}</version>
+		</dependency>
+		<!-- java.util.logging 实际调用slf4j -->
+		<dependency>
+			<groupId>org.slf4j</groupId>
+			<artifactId>jul-to-slf4j</artifactId>
+			<version>${slf4j.version}</version>
+		</dependency>
+		<!-- LOGGING end -->
+
+		<!-- GENERAL UTILS begin -->
+		<dependency>
+			<groupId>org.apache.commons</groupId>
+			<artifactId>commons-lang3</artifactId>
+			<version>${commons-lang3.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>commons-io</groupId>
+			<artifactId>commons-io</artifactId>
+			<version>${commons-io.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>commons-codec</groupId>
+			<artifactId>commons-codec</artifactId>
+			<version>${commons-codec.version}</version>
+		</dependency>
+		<dependency>
+		    <groupId>commons-fileupload</groupId>
+		    <artifactId>commons-fileupload</artifactId>
+		    <version>${commons-fileupload.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>commons-beanutils</groupId>
+			<artifactId>commons-beanutils</artifactId>
+			<version>${commons-beanutils.version}</version>
+			<exclusions>
+				<exclusion>
+					<groupId>commons-logging</groupId>
+					<artifactId>commons-logging</artifactId>
+				</exclusion>
+			</exclusions>
+		</dependency>
+
+		<!-- google java lib -->
+		<dependency>
+			<groupId>com.google.guava</groupId>
+			<artifactId>guava</artifactId>
+			<version>${guava.version}</version>
+		</dependency>
+
+		<!-- jackson json -->
+		<dependency>
+			<groupId>com.fasterxml.jackson.core</groupId>
+			<artifactId>jackson-core</artifactId>
+			<version>${jackson.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>com.fasterxml.jackson.core</groupId>
+			<artifactId>jackson-databind</artifactId>
+			<version>${jackson.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>com.fasterxml.jackson.core</groupId>
+			<artifactId>jackson-annotations</artifactId>
+			<version>${jackson.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>com.fasterxml.jackson.module</groupId>
+			<artifactId>jackson-module-jaxb-annotations</artifactId>
+			<version>${jackson.version}</version>
+		</dependency>
+
+		<!-- xstream xml -->
+		<dependency>
+			<groupId>com.thoughtworks.xstream</groupId>
+			<artifactId>xstream</artifactId>
+			<version>${xstream.version}</version>
+		</dependency>
+
+		<!-- pojo copy -->
+		<dependency>
+			<groupId>net.sf.dozer</groupId>
+			<artifactId>dozer</artifactId>
+			<version>${dozer.version}</version>
+		</dependency>
+
+		<!-- freemarker engine -->
+		<dependency>
+			<groupId>org.freemarker</groupId>
+			<artifactId>freemarker</artifactId>
+			<version>${freemarker.version}</version>
+		</dependency>
+
+		<!-- email -->
+		<dependency>
+			<groupId>javax.mail</groupId>
+			<artifactId>mail</artifactId>
+			<version>1.4.7</version>
+		</dependency>
+		<dependency>
+			<groupId>javax.activation</groupId>
+			<artifactId>activation</artifactId>
+			<version>1.1.1</version>
+		</dependency>
+
+		<!-- poi office -->
+		<dependency>
+			<groupId>org.apache.poi</groupId>
+			<artifactId>poi</artifactId>
+			<version>${poi.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.poi</groupId>
+			<artifactId>poi-ooxml</artifactId>
+			<version>${poi.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.poi</groupId>
+			<artifactId>poi-ooxml-schemas</artifactId>
+			<version>${poi.version}</version>
+		</dependency>
+
+		<!-- image util -->
+		<dependency>
+			<groupId>com.drewnoakes</groupId>
+			<artifactId>metadata-extractor</artifactId>
+			<version>2.6.2</version>
+		</dependency>
+
+		<!-- 条形码、二维码生成  -->
+		<dependency>
+			<groupId>com.google.zxing</groupId>
+			<artifactId>core</artifactId>
+			<version>2.2</version>
+		</dependency>
+		<dependency>
+			<groupId>com.google.zxing</groupId>
+			<artifactId>javase</artifactId>
+			<version>2.2</version>
+		</dependency>
+
+		<!-- 中文分词 -->
+<!--		<dependency>-->
+<!--			<groupId>org.wltea</groupId>-->
+<!--			<artifactId>analyzer</artifactId>-->
+<!--			<version>2012_u6</version>-->
+<!--		</dependency>-->
+		<!-- GENERAL UTILS end -->
+
+		<!-- CKFinder begin -->
+		<dependency>
+			<groupId>net.coobird</groupId>
+			<artifactId>thumbnailator</artifactId>
+			<version>0.4.2</version>
+		</dependency>
+		<dependency>
+			<groupId>com.ckfinder</groupId>
+			<artifactId>apache-ant-zip</artifactId>
+			<version>2.3</version>
+		</dependency>
+		<dependency>
+			<groupId>com.ckfinder</groupId>
+			<artifactId>ckfinder</artifactId>
+			<version>2.3</version>
+		</dependency>
+		<dependency>
+			<groupId>com.ckfinder</groupId>
+			<artifactId>ckfinderplugin-fileeditor</artifactId>
+			<version>2.3</version>
+		</dependency>
+		<dependency>
+			<groupId>com.ckfinder</groupId>
+			<artifactId>ckfinderplugin-imageresize</artifactId>
+			<version>2.3</version>
+		</dependency>
+		<!-- CKFinder end -->
+
+		<!-- TEST begin -->
+		<dependency>
+			<groupId>junit</groupId>
+			<artifactId>junit</artifactId>
+			<version>4.11</version>
+		</dependency>
+		<dependency>
+			<groupId>org.springframework</groupId>
+			<artifactId>spring-test</artifactId>
+			<version>${spring.version}</version>
+		</dependency>
+		<!-- TEST end -->
+
+		<!-- User Agent -->
+		<dependency>
+			<groupId>bitwalker</groupId>
+			<artifactId>UserAgentUtils</artifactId>
+			<version>1.13</version>
+		</dependency>
+
+		<!--  jsoup 对 HTML 文档进行解析和操作 -->
+		<dependency>
+		    <groupId>org.jsoup</groupId>
+		    <artifactId>jsoup</artifactId>
+		    <version>1.9.2</version>
+		</dependency>
+
+		<!-- 自定义jar依赖包 -->
+		<dependency>
+			<groupId>com.caimei</groupId>
+			<artifactId>caimei-common</artifactId>
+			<version>0.0.1-SNAPSHOT</version>
+		</dependency>
+		<dependency>
+			<groupId>caimei</groupId>
+			<artifactId>smsClient</artifactId>
+			<version>1.0</version>
+		</dependency>
+		<!-- jxls begin -->
+		<dependency>
+			<groupId>net.sf.jxls</groupId>
+			<artifactId>jxls-core</artifactId>
+			<version>1.0.6</version>
+		</dependency>
+		<dependency>
+			<groupId>net.sf.jxls</groupId>
+			<artifactId>jxls-reader</artifactId>
+			<version>1.0.6</version>
+		</dependency>
+		<dependency>
+			<groupId>net.sf.json-lib</groupId>
+			<artifactId>json-lib</artifactId>
+			<version>2.4</version>
+			<classifier>jdk15</classifier>
+		</dependency>
+
+		<!-- jxls end -->
+		<dependency>
+		  <groupId>com.caimei</groupId>
+		  <artifactId>caimei-dfs-sdk</artifactId>
+		  <version>0.0.1-SNAPSHOT</version>
+		</dependency>
+
+		<dependency>
+		  <groupId>com.martian</groupId>
+		  <artifactId>martian-core-guard</artifactId>
+		  <version>0.0.1-SNAPSHOT</version>
+		</dependency>
+        <dependency>
+            <groupId>com.caimei</groupId>
+            <artifactId>caimei-common</artifactId>
+            <version>0.0.1-SNAPSHOT</version>
+        </dependency>
+
+		<!--易宝支付sdk-->
+		<dependency>
+			<groupId>com.yeepay</groupId>
+			<artifactId>yop-java-sdk</artifactId>
+			<version>2.2.7</version>
+			<classifier>jdk18</classifier>
+		</dependency>
+
+		<!--对象存储oss-->
+		<dependency>
+			<groupId>com.aliyun.oss</groupId>
+			<artifactId>aliyun-sdk-oss</artifactId>
+			<version>3.10.2</version>
+		</dependency>
+
+		<!--<dependency>
+			<groupId>caimei</groupId>
+			<artifactId>ueditor</artifactId>
+			<version>1.0</version>
+		</dependency>-->
+
+    </dependencies>
+
+	<build>
+		<finalName>manager</finalName>
+		<!-- 设定资源文件的存放地址,根据不同的环境设置不同的目录 -->
+		<resources>
+			<resource>
+				<directory>src/main/resources/</directory>
+				<targetPath>${project.build.outputDirectory}/</targetPath>
+				<excludes>
+					<exclude>config/**</exclude>
+				</excludes>
+				<filtering>true</filtering>
+			</resource>
+			<resource>
+				<directory>src/main/resources/config/${env.type}/</directory>
+				<targetPath>${project.build.outputDirectory}/</targetPath>
+				<filtering>true</filtering>
+			</resource>
+		</resources>
+		<plugins>
+			<!-- Compiler 插件, 设定JDK版本 -->
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-compiler-plugin</artifactId>
+				<version>3.3</version>
+				<configuration>
+					<source>${jdk.version}</source>
+					<target>${jdk.version}</target>
+					<showWarnings>true</showWarnings>
+				</configuration>
+			</plugin>
+
+			<!-- 打包jar文件时,配置manifest文件,加入lib包的jar依赖 -->
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-jar-plugin</artifactId>
+				<version>2.4</version>
+				<!-- <executions>
+					<execution>
+						<phase>prepare-package</phase>
+						<goals>
+							<goal>jar</goal>
+						</goals>
+						<configuration>
+							<classesDirectory>${project.outputDirectory}</classesDirectory>
+							<finalName>jeesite</finalName>
+							<outputDirectory>${project.build.directory}/${project.artifactId}/WEB-INF/lib</outputDirectory>
+							<includes>
+					        	<include>com/thinkgem/jeesite/**</include>
+					       	</includes>
+						</configuration>
+					</execution>
+				</executions> -->
+			</plugin>
+
+			<!-- 混淆代码
+			<plugin>
+				<groupId>com.github.wvengen</groupId>
+				<artifactId>proguard-maven-plugin</artifactId>
+				<version>2.0.6</version>
+				<executions>
+					<execution>
+						<phase>prepare-package</phase>
+						<goals>
+							<goal>proguard</goal>
+						</goals>
+					</execution>
+				</executions>
+				<configuration>
+			        <obfuscate>true</obfuscate>
+			    	<options>
+                        <option>-injars ${project.build.directory}/${project.artifactId}/WEB-INF/lib/jeesite.jar</option>
+                    </options>
+                    <outjar>${project.artifactId}/WEB-INF/lib/jeesite_out.jar</outjar>
+                    <outputDirectory>${project.build.directory}</outputDirectory>
+			        <proguardInclude>${basedir}/proguard.cfg</proguardInclude>
+					<source>${jdk.version}</source>
+					<target>${jdk.version}</target>
+					<encoding>${project.build.sourceEncoding}</encoding>
+					<libs>
+						<lib>${java.home}/lib/rt.jar</lib>
+						<lib>${java.home}/lib/jsse.jar</lib>
+			            <lib>${java.home}/lib/jce.jar</lib>
+					</libs>
+			        <addMavenDescriptor>false</addMavenDescriptor>
+				</configuration>
+				<dependencies>
+					<dependency>
+						<groupId>net.sf.proguard</groupId>
+						<artifactId>proguard-base</artifactId>
+						<version>4.9</version>
+						<scope>runtime</scope>
+					</dependency>
+				</dependencies>
+			</plugin> -->
+
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-surefire-plugin</artifactId>
+				<version>2.18.1</version>
+				<configuration>
+					<skipTests>true</skipTests>
+				</configuration>
+			</plugin>
+			<!-- war 打包插件, 设定war包名称不带版本号 -->
+			<!--<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-war-plugin</artifactId>
+				<version>2.4</version>
+				<configuration>
+					<packagingExcludes>
+						&lt;!&ndash; WEB-INF/classes/com/thinkgem/jeesite/** &ndash;&gt;
+						WEB-INF/classes/org/apache/ibatis/**,
+						WEB-INF/classes/org/mybatis/spring/**
+					</packagingExcludes>
+					<warSourceExcludes>
+						static/bootstrap/2.3.1/docs/**,
+						static/ckeditor/_samples/**,
+						static/ckeditor/_source/**,
+						static/ckfinder/_samples/**,
+						static/ckfinder/help/**,
+						static/compressor*/**,
+						static/jquery-jbox/2.3/docs/**,
+						static/jquery-jbox/2.3/Skins2/**,
+						static/jquery-validation/1.11.0/demo/**,
+						static/jquery-ztree/3.5.12/demo/**,
+						static/My97DatePicker/docs/**,
+						static/supcan/doc/**,
+						static/SuperSlide/demo/**,
+						static/treeTable/demo/**&lt;!&ndash; , &ndash;&gt;
+						&lt;!&ndash; userfiles/** &ndash;&gt;&lt;!&ndash; ,/**/*.jsp &ndash;&gt;,
+						test/**
+					</warSourceExcludes>
+				</configuration>
+			</plugin>-->
+
+			<!-- Eclipse 插件 -->
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-eclipse-plugin</artifactId>
+				<version>2.9</version>
+				<configuration>
+					<downloadSources>${downloadSources}</downloadSources>
+					<downloadJavadocs>false</downloadJavadocs>
+					<wtpversion>2.0</wtpversion>
+					<jeeversion>5.0</jeeversion>
+					<!-- <jeeversion>6.0</jeeversion> -->
+					<additionalConfig>
+						<file>
+							<name>.settings/org.eclipse.core.resources.prefs</name>
+							<content>
+								<![CDATA[eclipse.preferences.version=1${line.separator}encoding/<project>=${project.build.sourceEncoding}${line.separator}]]>
+							</content>
+						</file>
+					</additionalConfig>
+					<additionalProjectnatures>
+						<projectnature>org.springframework.ide.eclipse.core.springnature</projectnature>
+					</additionalProjectnatures>
+				</configuration>
+			</plugin>
+
+			<!-- tomcat6插件 -->
+			<plugin>
+				<groupId>org.apache.tomcat.maven</groupId>
+				<artifactId>tomcat6-maven-plugin</artifactId>
+				<version>${tomcat.version}</version>
+				<configuration>
+					<port>${webserver.port}</port>
+					<path>/</path>
+					<uriEncoding>${project.build.sourceEncoding}</uriEncoding>
+				</configuration>
+			</plugin>
+
+			<!-- tomcat7插件 -->
+			<plugin>
+				<groupId>org.apache.tomcat.maven</groupId>
+				<artifactId>tomcat7-maven-plugin</artifactId>
+				<version>${tomcat.version}</version>
+				<configuration>
+					<port>${webserver.port}</port>
+					<path>/</path>
+					<uriEncoding>${project.build.sourceEncoding}</uriEncoding>
+				</configuration>
+			</plugin>
+
+			<!-- jetty插件 -->
+			<plugin>
+				<groupId>org.mortbay.jetty</groupId>
+				<artifactId>jetty-maven-plugin</artifactId>
+				<version>${jetty.version}</version>
+				<configuration>
+                    <stopKey>exit</stopKey>
+                    <stopPort>9090</stopPort>
+					<connectors>
+						<connector implementation="org.eclipse.jetty.server.nio.SelectChannelConnector">
+							<port>${webserver.port}</port>
+						</connector>
+					</connectors>
+					<webAppConfig>
+						<contextPath>/</contextPath>
+					</webAppConfig>
+					<systemProperties>
+						<systemProperty>
+							<name>org.mortbay.util.URI.charset</name>
+							<value>${project.build.sourceEncoding}</value>
+						</systemProperty>
+					</systemProperties>
+				</configuration>
+			</plugin>
+
+			<!-- resource插件 -->
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-resources-plugin</artifactId>
+				<version>2.6</version>
+			</plugin>
+
+			<!-- install插件 -->
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-install-plugin</artifactId>
+				<version>2.4</version>
+			</plugin>
+
+			<!-- clean插件 -->
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-clean-plugin</artifactId>
+				<version>2.5</version>
+			</plugin>
+
+			<!-- ant插件 -->
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-antrun-plugin</artifactId>
+				<version>1.7</version>
+			</plugin>
+
+			<!-- dependency插件 -->
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-dependency-plugin</artifactId>
+				<version>2.5.1</version>
+			</plugin>
+		</plugins>
+	</build>
+
+	<!-- 开发者信息 -->
+	<developers>
+		<developer>
+			<id>caimei</id>
+			<name>caimei</name>
+			<roles><role>Project lead</role></roles>
+			<timezone>+8</timezone>
+		</developer>
+	</developers>
+
+	<scm>
+		<connection>scm:svn:hsvn://192.168.1.10/website/caimeiProject/caimei-manager</connection>
+		<developerConnection>scm:svn:svn://192.168.1.10/website/caimeiProject/caimei-manager</developerConnection>
+	</scm>
+
+
+</project>

+ 18 - 0
src/main/java/com/caimei/modules/activity/dao/FreeShippingDao.java

@@ -0,0 +1,18 @@
+package com.caimei.modules.activity.dao;
+
+import com.caimei.modules.activity.entity.FreeShipping;
+import com.caimei.modules.activity.model.FreeShippingCount;
+import com.thinkgem.jeesite.common.persistence.CrudDao;
+import com.thinkgem.jeesite.common.persistence.annotation.MyBatisDao;
+
+/**
+ * 包邮券管理DAO接口
+ * @author LG
+ * @version 2016-05-31
+ */
+@MyBatisDao
+public interface FreeShippingDao extends CrudDao<FreeShipping> {
+
+	FreeShippingCount usedCount();
+	
+}

+ 15 - 0
src/main/java/com/caimei/modules/activity/dao/FreeShippingTypeDao.java

@@ -0,0 +1,15 @@
+package com.caimei.modules.activity.dao;
+
+import com.thinkgem.jeesite.common.persistence.CrudDao;
+import com.thinkgem.jeesite.common.persistence.annotation.MyBatisDao;
+import com.caimei.modules.activity.entity.FreeShippingType;
+
+/**
+ * 包邮券设置DAO接口
+ * @author LG
+ * @version 2016-05-31
+ */
+@MyBatisDao
+public interface FreeShippingTypeDao extends CrudDao<FreeShippingType> {
+	
+}

+ 15 - 0
src/main/java/com/caimei/modules/activity/dao/LaserDao.java

@@ -0,0 +1,15 @@
+package com.caimei.modules.activity.dao;
+
+import com.thinkgem.jeesite.common.persistence.CrudDao;
+import com.thinkgem.jeesite.common.persistence.annotation.MyBatisDao;
+import com.caimei.modules.activity.entity.Laser;
+
+/**
+ * 激光之美DAO接口
+ * @author LG
+ * @version 2016-11-14
+ */
+@MyBatisDao
+public interface LaserDao extends CrudDao<Laser> {
+	
+}

+ 165 - 0
src/main/java/com/caimei/modules/activity/entity/FreeShipping.java

@@ -0,0 +1,165 @@
+package com.caimei.modules.activity.entity;
+
+import org.hibernate.validator.constraints.Length;
+
+import com.thinkgem.jeesite.common.persistence.DataEntity;
+
+/**
+ * 包邮券管理Entity
+ * @author LG
+ * @version 2016-05-31
+ */
+public class FreeShipping extends DataEntity<FreeShipping> {
+	
+	private static final long serialVersionUID = 1L;
+	private FreeShippingType freeShippingtTpe;		// 包邮券类型
+	
+	private Long userId;		// 用户Id
+	private String userName;	// 用户名
+	private String userLevelType;//会员等级
+	
+	private Long clubId;		// 会所
+	private String clubName;	// 会所名称
+	private String clubMobile;	// 会所联系电话
+	
+	private String shopOrederNo;//会所订单号
+	private String shopOrderStatus;//订单状态
+	
+	private String status;		// 使用状态 0未使用 1已使用
+	private String enabledStatus;		// 启用/禁用状态
+
+	private Long spId;//创客ID
+	private String spName;//创客名称
+	private String spLevelId;//创客身份
+	private String spMobile;//创客联系电话
+
+	public FreeShipping() {
+		super();
+	}
+
+	public FreeShipping(String id){
+		super(id);
+	}
+
+	public FreeShippingType getFreeShippingtTpe() {
+		return freeShippingtTpe;
+	}
+
+	public void setFreeShippingtTpe(FreeShippingType freeShippingtTpe) {
+		this.freeShippingtTpe = freeShippingtTpe;
+	}
+	
+	public Long getUserId() {
+		return userId;
+	}
+
+	public void setUserId(Long userId) {
+		this.userId = userId;
+	}
+
+	public Long getClubId() {
+		return clubId;
+	}
+
+	public void setClubId(Long clubId) {
+		this.clubId = clubId;
+	}
+	
+	@Length(min=0, max=1, message="使用状态 0未使用 1已使用长度必须介于 0 和 1 之间")
+	public String getStatus() {
+		return status;
+	}
+
+	public void setStatus(String status) {
+		this.status = status;
+	}
+	
+	@Length(min=0, max=1, message="启用/禁用状态长度必须介于 0 和 1 之间")
+	public String getEnabledStatus() {
+		return enabledStatus;
+	}
+
+	public void setEnabledStatus(String enabledStatus) {
+		this.enabledStatus = enabledStatus;
+	}
+
+	public String getUserName() {
+		return userName;
+	}
+
+	public void setUserName(String userName) {
+		this.userName = userName;
+	}
+
+	public String getUserLevelType() {
+		return userLevelType;
+	}
+
+	public void setUserLevelType(String userLevelType) {
+		this.userLevelType = userLevelType;
+	}
+
+	public String getClubName() {
+		return clubName;
+	}
+
+	public void setClubName(String clubName) {
+		this.clubName = clubName;
+	}
+
+	public String getClubMobile() {
+		return clubMobile;
+	}
+
+	public void setClubMobile(String clubMobile) {
+		this.clubMobile = clubMobile;
+	}
+
+	public String getShopOrederNo() {
+		return shopOrederNo;
+	}
+
+	public void setShopOrederNo(String shopOrederNo) {
+		this.shopOrederNo = shopOrederNo;
+	}
+
+	public String getShopOrderStatus() {
+		return shopOrderStatus;
+	}
+
+	public void setShopOrderStatus(String shopOrderStatus) {
+		this.shopOrderStatus = shopOrderStatus;
+	}
+
+	public Long getSpId() {
+		return spId;
+	}
+
+	public void setSpId(Long spId) {
+		this.spId = spId;
+	}
+
+	public String getSpLevelId() {
+		return spLevelId;
+	}
+
+	public void setSpLevelId(String spLevelId) {
+		this.spLevelId = spLevelId;
+	}
+
+	public String getSpName() {
+		return spName;
+	}
+
+	public void setSpName(String spName) {
+		this.spName = spName;
+	}
+
+	public String getSpMobile() {
+		return spMobile;
+	}
+
+	public void setSpMobile(String spMobile) {
+		this.spMobile = spMobile;
+	}
+}

+ 113 - 0
src/main/java/com/caimei/modules/activity/entity/FreeShippingType.java

@@ -0,0 +1,113 @@
+package com.caimei.modules.activity.entity;
+
+import org.hibernate.validator.constraints.Length;
+import java.util.Date;
+import com.fasterxml.jackson.annotation.JsonFormat;
+
+import com.thinkgem.jeesite.common.persistence.DataEntity;
+
+/**
+ * 包邮券设置Entity
+ * @author LG
+ * @version 2016-05-31
+ */
+public class FreeShippingType extends DataEntity<FreeShippingType> {
+	
+	private static final long serialVersionUID = 1L;
+	private String scope;		// 使用范围
+	private String number;		// 可使用数量
+	private Date startTime;		// 有效期开始时间
+	private Date endTime;		// 有效期截止时间
+	private String info;		// 使用须知
+	private String images;		// 网站端图片
+	private String crmImages;		// CRM端图片
+	private String status;		// 可领取状态 0否 1是
+	private String enabledStatus;		// 可使用状态 0否 1是
+	
+	public FreeShippingType() {
+		super();
+	}
+
+	public FreeShippingType(String id){
+		super(id);
+	}
+
+	@Length(min=0, max=100, message="使用范围长度必须介于 0 和 100 之间")
+	public String getScope() {
+		return scope;
+	}
+
+	public void setScope(String scope) {
+		this.scope = scope;
+	}
+	
+	@Length(min=1, max=11, message="可使用数量长度必须介于 1 和 11 之间")
+	public String getNumber() {
+		return number;
+	}
+
+	public void setNumber(String number) {
+		this.number = number;
+	}
+	
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+	public Date getStartTime() {
+		return startTime;
+	}
+
+	public void setStartTime(Date startTime) {
+		this.startTime = startTime;
+	}
+	
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+	public Date getEndTime() {
+		return endTime;
+	}
+
+	public void setEndTime(Date endTime) {
+		this.endTime = endTime;
+	}
+	
+	public String getInfo() {
+		return info;
+	}
+
+	public void setInfo(String info) {
+		this.info = info;
+	}
+	
+	public String getImages() {
+		return images;
+	}
+
+	public void setImages(String images) {
+		this.images = images;
+	}
+	
+	public String getCrmImages() {
+		return crmImages;
+	}
+
+	public void setCrmImages(String crmImages) {
+		this.crmImages = crmImages;
+	}
+	
+	@Length(min=0, max=1, message="可领取状态 0否 1是长度必须介于 0 和 1 之间")
+	public String getStatus() {
+		return status;
+	}
+
+	public void setStatus(String status) {
+		this.status = status;
+	}
+	
+	@Length(min=0, max=1, message="可使用状态 0否 1是长度必须介于 0 和 1 之间")
+	public String getEnabledStatus() {
+		return enabledStatus;
+	}
+
+	public void setEnabledStatus(String enabledStatus) {
+		this.enabledStatus = enabledStatus;
+	}
+	
+}

+ 62 - 0
src/main/java/com/caimei/modules/activity/entity/Laser.java

@@ -0,0 +1,62 @@
+package com.caimei.modules.activity.entity;
+
+import org.hibernate.validator.constraints.Length;
+
+import com.thinkgem.jeesite.common.persistence.DataEntity;
+
+/**
+ * 激光之美Entity
+ * @author LG
+ * @version 2016-11-14
+ */
+public class Laser extends DataEntity<Laser> {
+	
+	private static final long serialVersionUID = 1L;
+	private String title;		// 标题
+	private String image;		// 图片
+	private Integer sortIndex;		// 排序
+	private String enabledStatus;		// 状态
+	
+	public Laser() {
+		super();
+	}
+
+	public Laser(String id){
+		super(id);
+	}
+
+	@Length(min=0, max=200, message="标题长度必须介于 0 和 200 之间")
+	public String getTitle() {
+		return title;
+	}
+
+	public void setTitle(String title) {
+		this.title = title;
+	}
+	
+	public String getImage() {
+		return image;
+	}
+
+	public void setImage(String image) {
+		this.image = image;
+	}
+	
+	public Integer getSortIndex() {
+		return sortIndex;
+	}
+
+	public void setSortIndex(Integer sortIndex) {
+		this.sortIndex = sortIndex;
+	}
+	
+	@Length(min=0, max=1, message="状态长度必须介于 0 和 1 之间")
+	public String getEnabledStatus() {
+		return enabledStatus;
+	}
+
+	public void setEnabledStatus(String enabledStatus) {
+		this.enabledStatus = enabledStatus;
+	}
+	
+}

+ 41 - 0
src/main/java/com/caimei/modules/activity/model/FreeShippingCount.java

@@ -0,0 +1,41 @@
+package com.caimei.modules.activity.model;
+
+/**
+ * 使用情况统计
+ * @author LG
+ * @date  2016年5月31日
+ * @version 1.0
+ */
+public class FreeShippingCount {
+	
+	private Long total; //总数
+	private Long unused;//未使用
+	private Long used;	//已使用
+	private Long unpay;	//未付款
+	
+	public Long getTotal() {
+		return total;
+	}
+	public void setTotal(Long total) {
+		this.total = total;
+	}
+	public Long getUnused() {
+		return unused;
+	}
+	public void setUnused(Long unused) {
+		this.unused = unused;
+	}
+	public Long getUsed() {
+		return used;
+	}
+	public void setUsed(Long used) {
+		this.used = used;
+	}
+	public Long getUnpay() {
+		return unpay;
+	}
+	public void setUnpay(Long unpay) {
+		this.unpay = unpay;
+	}
+
+}

+ 58 - 0
src/main/java/com/caimei/modules/activity/service/FreeShippingService.java

@@ -0,0 +1,58 @@
+package com.caimei.modules.activity.service;
+
+import java.util.List;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import com.thinkgem.jeesite.common.persistence.Page;
+import com.thinkgem.jeesite.common.service.CrudService;
+import com.caimei.modules.activity.dao.FreeShippingDao;
+import com.caimei.modules.activity.entity.FreeShipping;
+import com.caimei.modules.activity.model.FreeShippingCount;
+
+/**
+ * 包邮券管理Service
+ * @author LG
+ * @version 2016-05-31
+ */
+@Service
+@Transactional(readOnly = true)
+public class FreeShippingService extends CrudService<FreeShippingDao, FreeShipping> {
+	
+	@Autowired
+	private FreeShippingDao freeShippingDao;
+
+	public FreeShipping get(String id) {
+		return super.get(id);
+	}
+	
+	public List<FreeShipping> findList(FreeShipping freeShipping) {
+		return super.findList(freeShipping);
+	}
+	
+	public Page<FreeShipping> findPage(Page<FreeShipping> page, FreeShipping freeShipping) {
+		return super.findPage(page, freeShipping);
+	}
+	
+	@Transactional(readOnly = false)
+	public void save(FreeShipping freeShipping) {
+		super.save(freeShipping);
+	}
+	
+	@Transactional(readOnly = false)
+	public void delete(FreeShipping freeShipping) {
+		super.delete(freeShipping);
+	}
+	
+	@Transactional(readOnly = false)
+	public void updateEnabledStatusByIds(String enabledStatus, String[] ids) {
+		freeShippingDao.updateEnabledStatusByIds(enabledStatus,ids);
+	}
+
+	public FreeShippingCount usedCount() {
+		return freeShippingDao.usedCount();
+	}
+	
+}

+ 87 - 0
src/main/java/com/caimei/modules/activity/service/FreeShippingTypeService.java

@@ -0,0 +1,87 @@
+package com.caimei.modules.activity.service;
+
+import java.util.List;
+
+import javax.servlet.http.HttpServletRequest;
+
+import com.caimei.modules.sys.utils.UploadImageUtils;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import com.thinkgem.jeesite.common.config.Global;
+import com.thinkgem.jeesite.common.persistence.Page;
+import com.thinkgem.jeesite.common.service.CrudService;
+import com.caimei.modules.activity.entity.FreeShippingType;
+import com.caimei.modules.brand.utils.ImagePathUtils;
+import com.caimei.utils.Encodes;
+import com.caimei.utils.StringUtils;
+import com.caimei.dfs.image.beens.ImageUploadInfo;
+import com.caimei.modules.activity.dao.FreeShippingTypeDao;
+
+/**
+ * 包邮券设置Service
+ * @author LG
+ * @version 2016-05-31
+ */
+@Service
+@Transactional(readOnly = true)
+public class FreeShippingTypeService extends CrudService<FreeShippingTypeDao, FreeShippingType> {
+
+	public FreeShippingType get(String id) {
+		return super.get(id);
+	}
+	
+	public List<FreeShippingType> findList(FreeShippingType freeShippingType) {
+		return super.findList(freeShippingType);
+	}
+	
+	public Page<FreeShippingType> findPage(Page<FreeShippingType> page, FreeShippingType freeShippingType) {
+		return super.findPage(page, freeShippingType);
+	}
+	
+	@Transactional(readOnly = false)
+	public void save(FreeShippingType freeShippingType, HttpServletRequest request) {
+			//网站图片上传
+			String images=freeShippingType.getImages();
+			if(StringUtils.isNotBlank(images) && !images.contains("http:") && !images.contains("https:")){
+				images=Encodes.urlDecode(images);
+//				String realPath = request.getSession().getServletContext().getRealPath(images);
+                String realPath = UploadImageUtils.getAbsolutePath(images);
+//				realPath=Encodes.urlDecode(realPath);
+				int pointerIndex = realPath.lastIndexOf(".");
+				ImageUploadInfo saveImageSerivce=new ImageUploadInfo();
+				String photoServer = Global.getConfig("photoServer");
+				try {
+					saveImageSerivce = ImagePathUtils.saveImageSerivce(realPath, pointerIndex,realPath);
+					freeShippingType.setImages(photoServer+saveImageSerivce.getSource());
+				} catch (Exception e) {
+					logger.error("网站图片上传错误:"+e.toString(),e);
+				}
+			}
+			//crm图片上传
+			String crmImages=freeShippingType.getCrmImages();
+			if(StringUtils.isNotBlank(crmImages) && !crmImages.contains("http:") && !crmImages.contains("https:")){
+				crmImages=Encodes.urlDecode(crmImages);
+//				String realPath = request.getSession().getServletContext().getRealPath(crmImages);
+                String realPath = UploadImageUtils.getAbsolutePath(crmImages);
+//				realPath=Encodes.urlDecode(realPath);
+				int pointerIndex = realPath.lastIndexOf(".");
+				ImageUploadInfo saveImageSerivce=new ImageUploadInfo();
+				String photoServer = Global.getConfig("photoServer");
+				try {
+					saveImageSerivce = ImagePathUtils.saveImageSerivce(realPath, pointerIndex,realPath);
+					freeShippingType.setCrmImages(photoServer+saveImageSerivce.getSource());
+				} catch (Exception e) {
+					logger.error("crm图片上传错误:"+e.toString(),e);
+				}
+			}
+		
+		super.save(freeShippingType);
+	}
+	
+	@Transactional(readOnly = false)
+	public void delete(FreeShippingType freeShippingType) {
+		super.delete(freeShippingType);
+	}
+	
+}

+ 70 - 0
src/main/java/com/caimei/modules/activity/service/LaserService.java

@@ -0,0 +1,70 @@
+package com.caimei.modules.activity.service;
+
+import java.util.List;
+
+import javax.servlet.http.HttpServletRequest;
+
+import com.caimei.modules.sys.utils.UploadImageUtils;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import com.caimei.dfs.image.beens.ImageUploadInfo;
+import com.caimei.modules.activity.dao.LaserDao;
+import com.caimei.modules.activity.entity.Laser;
+import com.caimei.modules.common.utils.UploadUtils;
+import com.thinkgem.jeesite.common.config.Global;
+import com.thinkgem.jeesite.common.persistence.Page;
+import com.thinkgem.jeesite.common.service.CrudService;
+import com.thinkgem.jeesite.common.utils.Encodes;
+import com.thinkgem.jeesite.common.utils.StringUtils;
+
+/**
+ * 激光之美Service
+ * @author LG
+ * @version 2016-11-14
+ */
+@Service
+@Transactional(readOnly = true)
+public class LaserService extends CrudService<LaserDao, Laser> {
+
+	public Laser get(String id) {
+		return super.get(id);
+	}
+	
+	public List<Laser> findList(Laser laser) {
+		return super.findList(laser);
+	}
+	
+	public Page<Laser> findPage(Page<Laser> page, Laser laser) {
+		return super.findPage(page, laser);
+	}
+	
+	@Transactional(readOnly = false)
+	public void save(Laser laser, HttpServletRequest request) {
+		
+		String photoServer = Global.getConfig("photoServer");//获取文件服务器地址
+		
+		String images=laser.getImage();
+		if(StringUtils.isNotBlank(images) && !images.startsWith("http:")&& !images.startsWith("https:")){
+			images=Encodes.urlDecode(images);
+//			String realPath = request.getSession().getServletContext().getRealPath(images);
+            String realPath = UploadImageUtils.getAbsolutePath(images);
+//			realPath=Encodes.urlDecode(realPath);
+			int pointerIndex = realPath.lastIndexOf(".");
+			ImageUploadInfo saveImageSerivce=new ImageUploadInfo();
+			try {
+				saveImageSerivce = UploadUtils.saveImageSerivce(realPath, pointerIndex,realPath);
+				laser.setImage(photoServer+saveImageSerivce.getSource());
+			} catch (Exception e) {
+				logger.error("图片上传错误:"+e.toString(),e);
+			}
+		}
+		super.save(laser);
+	}
+	
+	@Transactional(readOnly = false)
+	public void delete(Laser laser) {
+		super.delete(laser);
+	}
+	
+}

+ 112 - 0
src/main/java/com/caimei/modules/activity/web/FreeShippingController.java

@@ -0,0 +1,112 @@
+package com.caimei.modules.activity.web;
+
+import java.util.Map;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.ModelAttribute;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.servlet.mvc.support.RedirectAttributes;
+
+import com.caimei.modules.activity.entity.FreeShipping;
+import com.caimei.modules.activity.model.FreeShippingCount;
+import com.caimei.modules.activity.service.FreeShippingService;
+import com.google.common.collect.Maps;
+import com.thinkgem.jeesite.common.config.Global;
+import com.thinkgem.jeesite.common.persistence.Page;
+import com.thinkgem.jeesite.common.utils.StringUtils;
+import com.thinkgem.jeesite.common.web.BaseController;
+
+/**
+ * 包邮券管理Controller
+ * @author LG
+ * @version 2016-05-31
+ */
+@Controller
+@RequestMapping(value = "${adminPath}/activity/freeShipping")
+public class FreeShippingController extends BaseController {
+
+	@Autowired
+	private FreeShippingService freeShippingService;
+	
+	@ModelAttribute
+	public FreeShipping get(@RequestParam(required=false) String id) {
+		FreeShipping entity = null;
+		if (StringUtils.isNotBlank(id)){
+			entity = freeShippingService.get(id);
+		}
+		if (entity == null){
+			entity = new FreeShipping();
+		}
+		return entity;
+	}
+	
+	@RequiresPermissions("activity:freeShipping:view")
+	@RequestMapping(value = {"list", ""})
+	public String list(FreeShipping freeShipping, HttpServletRequest request, HttpServletResponse response, Model model) {
+		Page<FreeShipping> page = freeShippingService.findPage(new Page<FreeShipping>(request, response), freeShipping); 
+		FreeShippingCount count=freeShippingService.usedCount();
+		model.addAttribute("page", page);
+		model.addAttribute("count", count);
+		return "modules/activity/freeShippingList";
+	}
+
+	@RequiresPermissions("activity:freeShipping:view")
+	@RequestMapping(value = "form")
+	public String form(FreeShipping freeShipping, Model model) {
+		model.addAttribute("freeShipping", freeShipping);
+		return "modules/activity/freeShippingForm";
+	}
+
+	@RequiresPermissions("activity:freeShipping:edit")
+	@RequestMapping(value = "save")
+	public String save(FreeShipping freeShipping, Model model, RedirectAttributes redirectAttributes) {
+		if (!beanValidator(model, freeShipping)){
+			return form(freeShipping, model);
+		}
+		freeShippingService.save(freeShipping);
+		addMessage(redirectAttributes, "保存包邮券管理成功");
+		return "redirect:"+Global.getAdminPath()+"/activity/freeShipping/?repage";
+	}
+	
+	@RequiresPermissions("activity:freeShipping:edit")
+	@RequestMapping(value = "delete")
+	public String delete(FreeShipping freeShipping, RedirectAttributes redirectAttributes) {
+		freeShippingService.delete(freeShipping);
+		addMessage(redirectAttributes, "删除包邮券管理成功");
+		return "redirect:"+Global.getAdminPath()+"/activity/freeShipping/?repage";
+	}
+	
+	/**
+	 * 批量修改启用、停用状态
+	 * @param enabledStatus
+	 * @param ids
+	 * @param request
+	 * @param response
+	 * @return
+	 */
+	@RequiresPermissions("hehe:heheCoupon:edit")
+	@ResponseBody
+	@RequestMapping(value="updateEnabledStatus")
+	public Map<String, Object> updateEnabledStatus(String enabledStatus,String[] ids,HttpServletRequest request,HttpServletResponse response){
+		Map<String, Object> map =Maps.newLinkedHashMap();
+		try {
+			freeShippingService.updateEnabledStatusByIds(enabledStatus,ids);
+			map.put("success",true);
+			map.put("msg", "修改成功");
+		} catch (Exception e) {
+			logger.debug(e.toString(),e);
+			map.put("success",false);
+			map.put("msg", "修改失败");
+		}
+        return map;  
+	}
+
+}

+ 80 - 0
src/main/java/com/caimei/modules/activity/web/FreeShippingTypeController.java

@@ -0,0 +1,80 @@
+package com.caimei.modules.activity.web;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.ModelAttribute;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.servlet.mvc.support.RedirectAttributes;
+
+import com.thinkgem.jeesite.common.config.Global;
+import com.thinkgem.jeesite.common.persistence.Page;
+import com.thinkgem.jeesite.common.web.BaseController;
+import com.thinkgem.jeesite.common.utils.StringUtils;
+import com.caimei.modules.activity.entity.FreeShippingType;
+import com.caimei.modules.activity.service.FreeShippingTypeService;
+
+/**
+ * 包邮券设置Controller
+ * @author LG
+ * @version 2016-05-31
+ */
+@Controller
+@RequestMapping(value = "${adminPath}/activity/freeShippingType")
+public class FreeShippingTypeController extends BaseController {
+
+	@Autowired
+	private FreeShippingTypeService freeShippingTypeService;
+	
+	@ModelAttribute
+	public FreeShippingType get(@RequestParam(required=false) String id) {
+		FreeShippingType entity = null;
+		if (StringUtils.isNotBlank(id)){
+			entity = freeShippingTypeService.get(id);
+		}
+		if (entity == null){
+			entity = new FreeShippingType();
+		}
+		return entity;
+	}
+	
+	@RequiresPermissions("activity:freeShippingType:view")
+	@RequestMapping(value = {"list", ""})
+	public String list(FreeShippingType freeShippingType, HttpServletRequest request, HttpServletResponse response, Model model) {
+		Page<FreeShippingType> page = freeShippingTypeService.findPage(new Page<FreeShippingType>(request, response), freeShippingType); 
+		model.addAttribute("page", page);
+		return "modules/activity/freeShippingTypeList";
+	}
+
+	@RequiresPermissions("activity:freeShippingType:view")
+	@RequestMapping(value = "form")
+	public String form(FreeShippingType freeShippingType, Model model) {
+		model.addAttribute("freeShippingType", freeShippingType);
+		return "modules/activity/freeShippingTypeForm";
+	}
+
+	@RequiresPermissions("activity:freeShippingType:edit")
+	@RequestMapping(value = "save")
+	public String save(FreeShippingType freeShippingType, Model model, HttpServletRequest request, RedirectAttributes redirectAttributes) {
+		if (!beanValidator(model, freeShippingType)){
+			return form(freeShippingType, model);
+		}
+		freeShippingTypeService.save(freeShippingType,request);
+		addMessage(redirectAttributes, "保存包邮券设置成功");
+		return "redirect:"+Global.getAdminPath()+"/activity/freeShipping/?repage";
+	}
+	
+	@RequiresPermissions("activity:freeShippingType:edit")
+	@RequestMapping(value = "delete")
+	public String delete(FreeShippingType freeShippingType, RedirectAttributes redirectAttributes) {
+		freeShippingTypeService.delete(freeShippingType);
+		addMessage(redirectAttributes, "删除包邮券设置成功");
+		return "redirect:"+Global.getAdminPath()+"/activity/freeShippingType/?repage";
+	}
+
+}

+ 111 - 0
src/main/java/com/caimei/modules/activity/web/LaserController.java

@@ -0,0 +1,111 @@
+package com.caimei.modules.activity.web;
+
+import java.util.List;
+import java.util.Map;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.commons.collections.CollectionUtils;
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.ModelAttribute;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.servlet.mvc.support.RedirectAttributes;
+
+import com.caimei.modules.activity.entity.Laser;
+import com.caimei.modules.activity.service.LaserService;
+import com.google.common.collect.Maps;
+import com.thinkgem.jeesite.common.config.Global;
+import com.thinkgem.jeesite.common.persistence.Page;
+import com.thinkgem.jeesite.common.utils.StringUtils;
+import com.thinkgem.jeesite.common.web.BaseController;
+
+/**
+ * 激光之美Controller
+ * @author LG
+ * @version 2016-11-14
+ */
+@Controller
+@RequestMapping(value = "${adminPath}/activity/laser")
+public class LaserController extends BaseController {
+
+	@Autowired
+	private LaserService laserService;
+	
+	@ModelAttribute
+	public Laser get(@RequestParam(required=false) String id) {
+		Laser entity = null;
+		if (StringUtils.isNotBlank(id)){
+			entity = laserService.get(id);
+		}
+		if (entity == null){
+			entity = new Laser();
+		}
+		return entity;
+	}
+	
+	@RequiresPermissions("activity:laser:view")
+	@RequestMapping(value = {"list", ""})
+	public String list(Laser laser, HttpServletRequest request, HttpServletResponse response, Model model) {
+		Page<Laser> page = laserService.findPage(new Page<Laser>(request, response), laser); 
+		model.addAttribute("page", page);
+		return "modules/activity/laserList";
+	}
+
+	@RequiresPermissions("activity:laser:view")
+	@RequestMapping(value = "form")
+	public String form(Laser laser, Model model) {
+		if(StringUtils.isEmpty(laser.getId())){
+			laser.getSqlMap().put("orderBy", " ORDER BY a.sortIndex DESC");
+			List<Laser> list = laserService.findList(laser);
+			if(CollectionUtils.isNotEmpty(list)){
+				laser.setSortIndex(list.get(0).getSortIndex()+1);
+			}
+			laser.setEnabledStatus("1");
+		}
+		model.addAttribute("laser", laser);
+		return "modules/activity/laserForm";
+	}
+
+	@RequiresPermissions("activity:laser:edit")
+	@RequestMapping(value = "save")
+	public String save(Laser laser, Model model, RedirectAttributes redirectAttributes, HttpServletRequest request) {
+		if (!beanValidator(model, laser)){
+			return form(laser, model);
+		}
+		laserService.save(laser,request);
+		addMessage(redirectAttributes, "保存激光之美成功");
+		return "redirect:"+Global.getAdminPath()+"/activity/laser/?repage";
+	}
+	
+	@RequiresPermissions("activity:laser:delete")
+	@RequestMapping(value = "delete")
+	public String delete(Laser laser, RedirectAttributes redirectAttributes) {
+		laserService.delete(laser);
+		addMessage(redirectAttributes, "删除激光之美成功");
+		return "redirect:"+Global.getAdminPath()+"/activity/laser/?repage";
+	}
+	
+	@RequiresPermissions("project:project:edit")
+	@ResponseBody
+	@RequestMapping(value="updateEnabledStatus")
+	public Map<String, Object> updateEnabledStatus(String enabledStatus,String[] ids,String [] supplierIDs,HttpServletRequest request,HttpServletResponse response){
+		Map<String, Object> map =Maps.newLinkedHashMap();
+		try {
+			laserService.updateEnabledStatusByIds(enabledStatus,ids);
+			map.put("success",true);
+			map.put("msg", "修改成功");
+		} catch (Exception e) {
+			logger.debug(e.toString(),e);
+			map.put("success",false);
+			map.put("msg", "修改失败");
+		}
+        return map;  
+	}
+
+}

+ 18 - 0
src/main/java/com/caimei/modules/advisory/dao/CmAdvisoryDao.java

@@ -0,0 +1,18 @@
+package com.caimei.modules.advisory.dao;
+
+import com.caimei.modules.advisory.entity.CmAdvisory;
+import com.caimei.modules.user.entity.CmUser;
+import com.thinkgem.jeesite.common.persistence.CrudDao;
+import com.thinkgem.jeesite.common.persistence.annotation.MyBatisDao;
+
+/**
+ * 快速咨询列表DAO接口
+ *
+ * @author plf
+ * @version 2020-04-22
+ */
+@MyBatisDao
+public interface CmAdvisoryDao extends CrudDao<CmAdvisory> {
+
+    CmUser findUser(String mobile);
+}

+ 84 - 0
src/main/java/com/caimei/modules/advisory/entity/CmAdvisory.java

@@ -0,0 +1,84 @@
+package com.caimei.modules.advisory.entity;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.thinkgem.jeesite.common.persistence.DataEntity;
+import org.hibernate.validator.constraints.Length;
+
+import java.util.Date;
+
+/**
+ * 快速咨询列表Entity
+ *
+ * @author plf
+ * @version 2020-04-22
+ */
+public class CmAdvisory extends DataEntity<CmAdvisory> {
+
+    private static final long serialVersionUID = 1L;
+    private String name;        // 姓名
+    private String mobile;        // 联系人手机号
+    private Date commitTime;        // 提交时间
+
+    private Boolean operationsStaff = false;  //是否是运营人员
+    private String clubName;  //会所名称
+    private Boolean clubContactPerson = false; //是否是机构联系人
+
+    public Boolean getClubContactPerson() {
+        return clubContactPerson;
+    }
+
+    public void setClubContactPerson(Boolean clubContactPerson) {
+        this.clubContactPerson = clubContactPerson;
+    }
+
+    public String getClubName() {
+        return clubName;
+    }
+
+    public void setClubName(String clubName) {
+        this.clubName = clubName;
+    }
+
+    public Boolean getOperationsStaff() {
+        return operationsStaff;
+    }
+
+    public void setOperationsStaff(Boolean operationsStaff) {
+        this.operationsStaff = operationsStaff;
+    }
+
+    public CmAdvisory() {
+        super();
+    }
+
+    public CmAdvisory(String id) {
+        super(id);
+    }
+
+    @Length(min = 0, max = 50, message = "姓名长度必须介于 0 和 50 之间")
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    @Length(min = 0, max = 20, message = "联系人手机号长度必须介于 0 和 20 之间")
+    public String getMobile() {
+        return mobile;
+    }
+
+    public void setMobile(String mobile) {
+        this.mobile = mobile;
+    }
+
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    public Date getCommitTime() {
+        return commitTime;
+    }
+
+    public void setCommitTime(Date commitTime) {
+        this.commitTime = commitTime;
+    }
+}

+ 73 - 0
src/main/java/com/caimei/modules/advisory/service/CmAdvisoryService.java

@@ -0,0 +1,73 @@
+package com.caimei.modules.advisory.service;
+
+import com.caimei.modules.advisory.dao.CmAdvisoryDao;
+import com.caimei.modules.advisory.entity.CmAdvisory;
+import com.caimei.modules.user.dao.CmOperationUserDao;
+import com.caimei.modules.user.dao.NewCmClubDao;
+import com.caimei.modules.user.entity.CmOperationUser;
+import com.caimei.modules.user.entity.CmUser;
+import com.caimei.modules.user.entity.NewCmClub;
+import com.thinkgem.jeesite.common.persistence.Page;
+import com.thinkgem.jeesite.common.service.CrudService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.List;
+
+/**
+ * 快速咨询列表Service
+ *
+ * @author plf
+ * @version 2020-04-22
+ */
+@Service
+@Transactional(readOnly = true)
+public class CmAdvisoryService extends CrudService<CmAdvisoryDao, CmAdvisory> {
+    @Autowired
+    private CmAdvisoryDao cmAdvisoryDao;
+    @Autowired
+    private CmOperationUserDao cmOperationUserDao;
+    @Autowired
+    private NewCmClubDao newCmClubDao;
+
+    public CmAdvisory get(String id) {
+        return super.get(id);
+    }
+
+    public List<CmAdvisory> findList(CmAdvisory cmAdvisory) {
+        return super.findList(cmAdvisory);
+    }
+
+    public Page<CmAdvisory> findPage(Page<CmAdvisory> page, CmAdvisory cmAdvisory) {
+        Page<CmAdvisory> advisoryPage = super.findPage(page, cmAdvisory);
+        for (CmAdvisory advisory : advisoryPage.getList()) {
+            CmUser user = cmAdvisoryDao.findUser(advisory.getMobile());
+            if (null != user) {
+                advisory.setClubName(user.getName());
+                advisory.setClubContactPerson(true);
+            }
+            CmOperationUser cmOperationUser = new CmOperationUser();
+            cmOperationUser.setMobile(advisory.getMobile());
+            List<CmOperationUser> operationUsers = cmOperationUserDao.findListBuyBindMobile(cmOperationUser);
+            //判断是否是运营人员
+            if (null != operationUsers && operationUsers.size() > 0) {
+                NewCmClub club = newCmClubDao.getclubByUserId(Integer.valueOf(operationUsers.get(0).getUserID()));
+                advisory.setClubName(club.getName());
+                advisory.setOperationsStaff(true);
+            }
+        }
+        return advisoryPage;
+    }
+
+    @Transactional(readOnly = false)
+    public void save(CmAdvisory cmAdvisory) {
+        super.save(cmAdvisory);
+    }
+
+    @Transactional(readOnly = false)
+    public void delete(CmAdvisory cmAdvisory) {
+        super.delete(cmAdvisory);
+    }
+
+}

+ 79 - 0
src/main/java/com/caimei/modules/advisory/web/CmAdvisoryController.java

@@ -0,0 +1,79 @@
+package com.caimei.modules.advisory.web;
+
+import com.caimei.modules.advisory.entity.CmAdvisory;
+import com.caimei.modules.advisory.service.CmAdvisoryService;
+import com.thinkgem.jeesite.common.config.Global;
+import com.thinkgem.jeesite.common.persistence.Page;
+import com.thinkgem.jeesite.common.utils.StringUtils;
+import com.thinkgem.jeesite.common.web.BaseController;
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.ModelAttribute;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.servlet.mvc.support.RedirectAttributes;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+ * 快速咨询列表Controller
+ * @author plf
+ * @version 2020-04-22
+ */
+@Controller
+@RequestMapping(value = "${adminPath}/advisory/cmAdvisory")
+public class CmAdvisoryController extends BaseController {
+
+	@Autowired
+	private CmAdvisoryService cmAdvisoryService;
+	
+	@ModelAttribute
+	public CmAdvisory get(@RequestParam(required=false) String id) {
+		CmAdvisory entity = null;
+		if (StringUtils.isNotBlank(id)){
+			entity = cmAdvisoryService.get(id);
+		}
+		if (entity == null){
+			entity = new CmAdvisory();
+		}
+		return entity;
+	}
+	
+	@RequiresPermissions("advisory:cmAdvisory:view")
+	@RequestMapping(value = {"list", ""})
+	public String list(CmAdvisory cmAdvisory, HttpServletRequest request, HttpServletResponse response, Model model) {
+		Page<CmAdvisory> page = cmAdvisoryService.findPage(new Page<CmAdvisory>(request, response), cmAdvisory); 
+		model.addAttribute("page", page);
+		return "modules/advisory/cmAdvisoryList";
+	}
+
+	@RequiresPermissions("advisory:cmAdvisory:view")
+	@RequestMapping(value = "form")
+	public String form(CmAdvisory cmAdvisory, Model model) {
+		model.addAttribute("cmAdvisory", cmAdvisory);
+		return "modules/advisory/cmAdvisoryForm";
+	}
+
+	@RequiresPermissions("advisory:cmAdvisory:edit")
+	@RequestMapping(value = "save")
+	public String save(CmAdvisory cmAdvisory, Model model, RedirectAttributes redirectAttributes) {
+		if (!beanValidator(model, cmAdvisory)){
+			return form(cmAdvisory, model);
+		}
+		cmAdvisoryService.save(cmAdvisory);
+		addMessage(redirectAttributes, "保存快速咨询列表成功");
+		return "redirect:"+Global.getAdminPath()+"/advisory/cmAdvisory/?repage";
+	}
+	
+	@RequiresPermissions("advisory:cmAdvisory:delete")
+	@RequestMapping(value = "delete")
+	public String delete(CmAdvisory cmAdvisory, RedirectAttributes redirectAttributes) {
+		cmAdvisoryService.delete(cmAdvisory);
+		addMessage(redirectAttributes, "删除快速咨询列表成功");
+		return "redirect:"+Global.getAdminPath()+"/advisory/cmAdvisory/?repage";
+	}
+
+}

+ 17 - 0
src/main/java/com/caimei/modules/banner/dao/CrmBannerDao.java

@@ -0,0 +1,17 @@
+package com.caimei.modules.banner.dao;
+
+import com.thinkgem.jeesite.common.persistence.CrudDao;
+import com.thinkgem.jeesite.common.persistence.annotation.MyBatisDao;
+import com.caimei.modules.banner.entity.CrmBanner;
+
+/**
+ * CRM首页轮播图DAO接口
+ * @author LG
+ * @version 2016-08-19
+ */
+@MyBatisDao
+public interface CrmBannerDao extends CrudDao<CrmBanner> {
+
+	int countEnabledStatus(String status);
+	
+}

+ 83 - 0
src/main/java/com/caimei/modules/banner/entity/CrmBanner.java

@@ -0,0 +1,83 @@
+package com.caimei.modules.banner.entity;
+
+import org.hibernate.validator.constraints.Length;
+import javax.validation.constraints.NotNull;
+
+import com.thinkgem.jeesite.common.persistence.DataEntity;
+
+/**
+ * CRM首页轮播图Entity
+ * @author LG
+ * @version 2016-08-19
+ */
+public class CrmBanner extends DataEntity<CrmBanner> {
+	
+	private static final long serialVersionUID = 1L;
+	private String title;		// 标题
+	private String link;		// 链接
+	private String appLink;		//app链接
+	private String image;		// 图片
+	private Integer sort;		// 排序
+	private String enabledStatus;		// 状态 0停用 1启用
+	
+	public CrmBanner() {
+		super();
+	}
+
+	public CrmBanner(String id){
+		super(id);
+	}
+
+	@Length(min=1, max=40, message="标题长度必须介于 1 和 40 之间")
+	public String getTitle() {
+		return title;
+	}
+
+	public void setTitle(String title) {
+		this.title = title;
+	}
+	
+	@Length(min=0, max=100, message="链接长度必须介于 0 和 100 之间")
+	public String getLink() {
+		return link;
+	}
+
+	public void setLink(String link) {
+		this.link = link;
+	}
+	
+	public String getAppLink() {
+		return appLink;
+	}
+
+	public void setAppLink(String appLink) {
+		this.appLink = appLink;
+	}
+
+	public String getImage() {
+		return image;
+	}
+
+	public void setImage(String image) {
+		this.image = image;
+	}
+	
+	@NotNull(message="排序不能为空")
+	public Integer getSort() {
+		return sort;
+	}
+
+	public void setSort(Integer sort) {
+		this.sort = sort;
+	}
+	
+	@Length(min=1, max=1, message="状态 0停用 1启用长度必须介于 1 和 1 之间")
+	public String getEnabledStatus() {
+		return enabledStatus;
+	}
+
+	public void setEnabledStatus(String enabledStatus) {
+		this.enabledStatus = enabledStatus;
+	}
+	
+}

+ 77 - 0
src/main/java/com/caimei/modules/banner/service/CrmBannerService.java

@@ -0,0 +1,77 @@
+package com.caimei.modules.banner.service;
+
+import java.util.List;
+
+import javax.servlet.http.HttpServletRequest;
+
+import com.caimei.modules.sys.utils.UploadImageUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import com.thinkgem.jeesite.common.config.Global;
+import com.thinkgem.jeesite.common.persistence.Page;
+import com.thinkgem.jeesite.common.service.CrudService;
+import com.thinkgem.jeesite.common.utils.Encodes;
+import com.thinkgem.jeesite.common.utils.StringUtils;
+import com.caimei.modules.banner.entity.CrmBanner;
+import com.caimei.modules.brand.utils.ImagePathUtils;
+import com.caimei.dfs.image.beens.ImageUploadInfo;
+import com.caimei.modules.banner.dao.CrmBannerDao;
+
+/**
+ * CRM首页轮播图Service
+ * @author LG
+ * @version 2016-08-19
+ */
+@Service
+@Transactional(readOnly = true)
+public class CrmBannerService extends CrudService<CrmBannerDao, CrmBanner> {
+	
+	@Autowired
+	private CrmBannerDao crmBannerDao;
+
+	public CrmBanner get(String id) {
+		return super.get(id);
+	}
+	
+	public List<CrmBanner> findList(CrmBanner crmBanner) {
+		return super.findList(crmBanner);
+	}
+	
+	public Page<CrmBanner> findPage(Page<CrmBanner> page, CrmBanner crmBanner) {
+		return super.findPage(page, crmBanner);
+	}
+	
+	@Transactional(readOnly = false)
+	public void save(CrmBanner crmBanner, HttpServletRequest request) {
+		String image = crmBanner.getImage();
+		if(StringUtils.isNotBlank(image) && !image.startsWith("http://") && !image.startsWith("https://")){
+			String photoServer = Global.getConfig("photoServer");//获取文件服务器地址
+			image=Encodes.urlDecode(image);
+			String realPath = UploadImageUtils.getAbsolutePath(image);
+//			String realPath = request.getSession().getServletContext().getRealPath(image);
+//			realPath=Encodes.urlDecode(realPath);
+			int pointerIndex = realPath.lastIndexOf(".");
+			ImageUploadInfo saveImageSerivce=new ImageUploadInfo();
+			try {
+				logger.info("---------lijunp-hotoServer:"+photoServer+"---image:"+image+"---realPath:"+realPath);
+				saveImageSerivce = ImagePathUtils.saveImageSerivce(realPath, pointerIndex,realPath);
+				crmBanner.setImage(photoServer+saveImageSerivce.getSource());
+			} catch (Exception e) {
+				logger.error("图片上传错误:"+e.toString(),e);
+			}
+		}
+		super.save(crmBanner);
+	}
+	
+	@Transactional(readOnly = false)
+	public void delete(CrmBanner crmBanner) {
+		super.delete(crmBanner);
+	}
+
+	public int countEnabledStatus(String status) {
+		return crmBannerDao.countEnabledStatus(status);
+	}
+	
+}

+ 159 - 0
src/main/java/com/caimei/modules/banner/web/CrmBannerController.java

@@ -0,0 +1,159 @@
+package com.caimei.modules.banner.web;
+
+import java.util.Map;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.ModelAttribute;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.servlet.mvc.support.RedirectAttributes;
+
+import com.caimei.modules.banner.entity.CrmBanner;
+import com.caimei.modules.banner.service.CrmBannerService;
+import com.google.common.collect.Maps;
+import com.thinkgem.jeesite.common.config.Global;
+import com.thinkgem.jeesite.common.persistence.Page;
+import com.thinkgem.jeesite.common.utils.StringUtils;
+import com.thinkgem.jeesite.common.web.BaseController;
+
+/**
+ * CRM首页轮播图Controller
+ * @author LG
+ * @version 2016-08-19
+ */
+@Controller
+@RequestMapping(value = "${adminPath}/banner/crmBanner")
+public class CrmBannerController extends BaseController {
+
+	@Autowired
+	private CrmBannerService crmBannerService;
+	
+	@ModelAttribute
+	public CrmBanner get(@RequestParam(required=false) String id) {
+		CrmBanner entity = null;
+		if (StringUtils.isNotBlank(id)){
+			entity = crmBannerService.get(id);
+		}
+		if (entity == null){
+			entity = new CrmBanner();
+		}
+		return entity;
+	}
+	
+	@RequiresPermissions("banner:crmBanner:view")
+	@RequestMapping(value = {"list", ""})
+	public String list(CrmBanner crmBanner, HttpServletRequest request, HttpServletResponse response, Model model) {
+		Page<CrmBanner> page = crmBannerService.findPage(new Page<CrmBanner>(request, response), crmBanner); 
+		model.addAttribute("page", page);
+		return "modules/banner/crmBannerList";
+	}
+
+	@RequiresPermissions("banner:crmBanner:view")
+	@RequestMapping(value = "form")
+	public String form(CrmBanner crmBanner, Model model) {
+		model.addAttribute("crmBanner", crmBanner);
+		return "modules/banner/crmBannerForm";
+	}
+
+	@RequiresPermissions("banner:crmBanner:edit")
+	@RequestMapping(value = "save")
+	public String save(CrmBanner crmBanner, Model model, RedirectAttributes redirectAttributes, HttpServletRequest request) {
+		if(checkValidator(model, crmBanner)){//参数、必填验证
+			return form(crmBanner, model);
+		}
+		crmBannerService.save(crmBanner,request);
+		addMessage(redirectAttributes, "保存CRM首页轮播图成功");
+		return "redirect:"+Global.getAdminPath()+"/banner/crmBanner/?repage";
+	}
+	
+	private boolean checkValidator(Model model,CrmBanner crmBanner) {
+		if (!beanValidator(model, crmBanner)){
+			return true;
+		}
+		if(StringUtils.getStringLength(crmBanner.getTitle())>40){
+			model.addAttribute("message", "标题过长!");
+			return true;
+		}
+		if(StringUtils.isNotBlank(crmBanner.getLink()) &&StringUtils.getStringLength(crmBanner.getTitle())>100){
+			model.addAttribute("message", "链接过长!");
+			return true;
+		}
+		if(StringUtils.equals(crmBanner.getEnabledStatus(), "1")){
+			CrmBanner crmBanner2 = crmBannerService.get(crmBanner.getId());
+			if(null!=crmBanner2){
+				if(!StringUtils.equals(crmBanner2.getEnabledStatus(), "1") && crmBannerService.countEnabledStatus("1")>=9){
+					model.addAttribute("message", "最多只能启用9项,请先停用!");
+					return true;
+				}
+			}else if(crmBannerService.countEnabledStatus("1")>=9){
+				model.addAttribute("message", "最多只能启用9项,请先停用!");
+				return true;
+			}
+		}
+		return false;
+	}
+	
+	@RequiresPermissions("banner:crmBanner:delete")
+	@RequestMapping(value = "delete")
+	public String delete(CrmBanner crmBanner, RedirectAttributes redirectAttributes) {
+		crmBannerService.delete(crmBanner);
+		addMessage(redirectAttributes, "删除CRM首页轮播图成功");
+		return "redirect:"+Global.getAdminPath()+"/banner/crmBanner/?repage";
+	}
+	
+	/**
+	 * 批量修改启用、停用状态
+	 * @param enabledStatus
+	 * @param ids
+	 * @param request
+	 * @param response
+	 * @return
+	 */
+	@RequiresPermissions("banner:crmBanner:edit")
+	@ResponseBody
+	@RequestMapping(value="updateEnabledStatus")
+	public Map<String, Object> updateEnabledStatus(String status,String[] ids,HttpServletRequest request,HttpServletResponse response){
+		Map<String, Object> map =Maps.newLinkedHashMap();
+		try {
+			crmBannerService.updateEnabledStatusByIds(status,ids);
+			map.put("success",true);
+			map.put("msg", "修改成功");
+		} catch (Exception e) {
+			logger.debug(e.toString(),e);
+			map.put("success",false);
+			map.put("msg", "修改失败");
+		}
+        return map;  
+	}
+
+	/**
+	 * 状态统计
+	 * @param enabledStatus
+	 * @param request
+	 * @param response
+	 * @return
+	 */
+	@RequiresPermissions("banner:crmBanner:view")
+	@ResponseBody
+	@RequestMapping(value="countEnabledStatus")
+	public Map<String, Object> countEnabledStatus(String status,HttpServletRequest request,HttpServletResponse response){
+		Map<String, Object> map =Maps.newLinkedHashMap();
+		try {
+			int count=crmBannerService.countEnabledStatus(status);
+			map.put("success",true);
+			map.put("count",count);
+		} catch (Exception e) {
+			logger.debug(e.toString(),e);
+			map.put("success",false);
+			map.put("count",0);
+		}
+        return map;  
+	}
+}

+ 53 - 0
src/main/java/com/caimei/modules/basesetting/dao/AddressDao.java

@@ -0,0 +1,53 @@
+package com.caimei.modules.basesetting.dao;
+
+import java.util.List;
+
+import com.caimei.modules.basesetting.entity.City;
+import com.caimei.modules.basesetting.entity.Province;
+import com.caimei.modules.basesetting.entity.Town;
+import com.thinkgem.jeesite.common.persistence.CrudDao;
+import com.thinkgem.jeesite.common.persistence.annotation.MyBatisDao;
+import com.caimei.modules.basesetting.entity.Address;
+
+/**
+ * 地址信息DAO接口
+ * @author jiangjunwen
+ * @version 2017-03-28
+ */
+@MyBatisDao
+public interface AddressDao extends CrudDao<Address> {
+
+    List<Address> getAddressByTownId(Integer townID);
+
+    List<Province> findProvincePage();
+
+    List<City> findCityPage(City city);
+
+    List<Town> findTownPage(Town town);
+
+    void insertProvince(Province province);
+
+    void updateProvince(Province province);
+
+    Integer getMaxProvinceId();
+
+    Province findProvinceByName(String name);
+
+    City findCityByName(String name);
+
+    Integer getMaxCityId();
+
+    void insertCity(City city);
+
+    void updateCity(City city);
+
+    Town findTownByName(String name);
+
+    Integer getMaxTownyId();
+
+    void insertTown(Town town);
+
+    void updateTown(Town town);
+
+    City findCityById(Integer cityID);
+}

+ 29 - 0
src/main/java/com/caimei/modules/basesetting/dao/HelpPageDao.java

@@ -0,0 +1,29 @@
+package com.caimei.modules.basesetting.dao;
+
+import com.caimei.modules.basesetting.entity.Helppage;
+import com.caimei.modules.basesetting.entity.BaseType;
+import com.thinkgem.jeesite.common.persistence.CrudDao;
+import com.thinkgem.jeesite.common.persistence.annotation.MyBatisDao;
+
+import java.util.List;
+
+/**
+ * Description
+ *
+ * @author : Charles
+ * @date : 2020/4/17
+ */
+@MyBatisDao
+public interface HelpPageDao extends CrudDao<Helppage> {
+    List<BaseType> findHelpPageType();
+
+    List<Helppage> findHelppageList(Helppage helppage);
+
+    Helppage getById(String id);
+
+    void updateHelpPage(Helppage helppage);
+
+    void insertHelpPage(Helppage helppage);
+
+    Integer getMaxHelpPageId();
+}

+ 32 - 0
src/main/java/com/caimei/modules/basesetting/dao/KeywordDao.java

@@ -0,0 +1,32 @@
+package com.caimei.modules.basesetting.dao;
+
+import com.caimei.modules.basesetting.entity.BaseType;
+import com.caimei.modules.basesetting.entity.Keyword;
+import com.thinkgem.jeesite.common.persistence.CrudDao;
+import com.thinkgem.jeesite.common.persistence.annotation.MyBatisDao;
+
+import java.util.List;
+
+/**
+ * Description
+ *
+ * @author : Charles
+ * @date : 2020/4/17
+ */
+@MyBatisDao
+public interface KeywordDao extends CrudDao<Keyword> {
+
+    Keyword getById(String id);
+
+    List<Keyword> findKeyWordList(Keyword keyword);
+
+    void updateKeyWord(Keyword keyword);
+
+    List<BaseType> findLabelType();
+
+    Integer getMaxKeyWordId();
+
+    void insertHelpPage(Keyword keyword);
+
+    void deleteKeyWord(Integer id);
+}

+ 130 - 0
src/main/java/com/caimei/modules/basesetting/entity/Address.java

@@ -0,0 +1,130 @@
+package com.caimei.modules.basesetting.entity;
+
+import com.thinkgem.jeesite.common.persistence.DataEntity;
+
+/**
+ * 地址信息Entity
+ * @author jiangjunwen
+ * @version 2017-03-28
+ */
+public class Address extends DataEntity<Address> {
+
+	private static final long serialVersionUID = 1L;
+	private Integer addressID;		// 用户地址ID
+	private Integer userID;		// 用户ID
+	private String shouHuoRen;		// 收货人
+	private Integer townID;		// 区ID
+	private String address;		// 详细地址
+	private String postalCode;		// 邮编
+	private String phone;		// 电话
+	private String mobile;		// 手机
+	private String defaultFlag;		// 是否默认收货地址(0 不是默认,1 默认)
+	private String town;//村镇名
+	private String city;//城市名称
+	private String province;//省份名称
+
+	public Address() {
+		super();
+	}
+
+	public Address(String id){
+		super(id);
+	}
+
+
+	public Integer getAddressID() {
+		return addressID;
+	}
+
+	public void setAddressID(Integer addressID) {
+		this.addressID = addressID;
+	}
+
+	public Integer getUserID() {
+		return userID;
+	}
+
+	public void setUserID(Integer userID) {
+		this.userID = userID;
+	}
+
+	public String getShouHuoRen() {
+		return shouHuoRen;
+	}
+
+	public void setShouHuoRen(String shouHuoRen) {
+		this.shouHuoRen = shouHuoRen;
+	}
+
+	public Integer getTownID() {
+		return townID;
+	}
+
+	public void setTownID(Integer townID) {
+		this.townID = townID;
+	}
+
+	public String getAddress() {
+		return address;
+	}
+
+	public void setAddress(String address) {
+		this.address = address;
+	}
+
+	public String getPostalCode() {
+		return postalCode;
+	}
+
+	public void setPostalCode(String postalCode) {
+		this.postalCode = postalCode;
+	}
+
+	public String getPhone() {
+		return phone;
+	}
+
+	public void setPhone(String phone) {
+		this.phone = phone;
+	}
+
+	public String getMobile() {
+		return mobile;
+	}
+
+	public void setMobile(String mobile) {
+		this.mobile = mobile;
+	}
+
+	public String getDefaultFlag() {
+		return defaultFlag;
+	}
+
+	public void setDefaultFlag(String defaultFlag) {
+		this.defaultFlag = defaultFlag;
+	}
+
+	public String getTown() {
+		return town;
+	}
+
+	public void setTown(String town) {
+		this.town = town;
+	}
+
+	public String getCity() {
+		return city;
+	}
+
+	public void setCity(String city) {
+		this.city = city;
+	}
+
+	public String getProvince() {
+		return province;
+	}
+
+	public void setProvince(String province) {
+		this.province = province;
+	}
+}

+ 33 - 0
src/main/java/com/caimei/modules/basesetting/entity/BaseType.java

@@ -0,0 +1,33 @@
+package com.caimei.modules.basesetting.entity;
+
+import com.thinkgem.jeesite.common.persistence.DataEntity;
+
+import java.io.Serializable;
+
+/**
+ * c_helppagetype
+ * @author
+ */
+public class BaseType implements Serializable{
+    private Integer id;
+
+    private String typeName;
+
+    private static final long serialVersionUID = 1L;
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public String getTypeName() {
+        return typeName;
+    }
+
+    public void setTypeName(String typeName) {
+        this.typeName = typeName;
+    }
+}

+ 63 - 0
src/main/java/com/caimei/modules/basesetting/entity/City.java

@@ -0,0 +1,63 @@
+package com.caimei.modules.basesetting.entity;
+
+import com.thinkgem.jeesite.common.persistence.DataEntity;
+
+/**
+ * city
+ * @author
+ */
+public class City extends DataEntity<City> {
+    /**
+     * 市ID
+     */
+    private Integer cityID;
+
+    /**
+     * 所属省ID
+     */
+    private Integer provinceID;
+
+    /**
+     * 市名
+     */
+    private String name;
+
+    /**
+     * 是否有效(0 无效,1 有效)
+     */
+    private Integer validFlag;
+
+    private static final long serialVersionUID = 1L;
+
+    public Integer getCityID() {
+        return cityID;
+    }
+
+    public void setCityID(Integer cityID) {
+        this.cityID = cityID;
+    }
+
+    public Integer getProvinceID() {
+        return provinceID;
+    }
+
+    public void setProvinceID(Integer provinceID) {
+        this.provinceID = provinceID;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public Integer getValidFlag() {
+        return validFlag;
+    }
+
+    public void setValidFlag(Integer validFlag) {
+        this.validFlag = validFlag;
+    }
+}

+ 102 - 0
src/main/java/com/caimei/modules/basesetting/entity/Helppage.java

@@ -0,0 +1,102 @@
+package com.caimei.modules.basesetting.entity;
+
+import com.thinkgem.jeesite.common.persistence.DataEntity;
+
+
+/**
+ * helppage
+ * @author
+ */
+public class Helppage extends DataEntity<Helppage> {
+    private Integer helpPageID;
+
+    private String title;
+
+    private String content;
+
+    private String contentTxt;
+
+    private String linkName;
+
+    private Integer sortIndex;
+
+    private String validFlag;
+
+    private Integer helpPageTypeID;
+
+    private String showFlag;
+
+    private static final long serialVersionUID = 1L;
+
+    public Integer getHelpPageID() {
+        return helpPageID;
+    }
+
+    public void setHelpPageID(Integer helpPageID) {
+        this.helpPageID = helpPageID;
+    }
+
+    public String getTitle() {
+        return title;
+    }
+
+    public void setTitle(String title) {
+        this.title = title;
+    }
+
+    public String getContent() {
+        return content;
+    }
+
+    public void setContent(String content) {
+        this.content = content;
+    }
+
+    public String getContentTxt() {
+        return contentTxt;
+    }
+
+    public void setContentTxt(String contentTxt) {
+        this.contentTxt = contentTxt;
+    }
+
+    public String getLinkName() {
+        return linkName;
+    }
+
+    public void setLinkName(String linkName) {
+        this.linkName = linkName;
+    }
+
+    public Integer getSortIndex() {
+        return sortIndex;
+    }
+
+    public void setSortIndex(Integer sortIndex) {
+        this.sortIndex = sortIndex;
+    }
+
+    public String getValidFlag() {
+        return validFlag;
+    }
+
+    public void setValidFlag(String validFlag) {
+        this.validFlag = validFlag;
+    }
+
+    public Integer getHelpPageTypeID() {
+        return helpPageTypeID;
+    }
+
+    public void setHelpPageTypeID(Integer helpPageTypeID) {
+        this.helpPageTypeID = helpPageTypeID;
+    }
+
+    public String getShowFlag() {
+        return showFlag;
+    }
+
+    public void setShowFlag(String showFlag) {
+        this.showFlag = showFlag;
+    }
+}

+ 63 - 0
src/main/java/com/caimei/modules/basesetting/entity/Keyword.java

@@ -0,0 +1,63 @@
+package com.caimei.modules.basesetting.entity;
+
+import com.thinkgem.jeesite.common.persistence.DataEntity;
+
+import java.io.Serializable;
+
+/**
+ * keyword
+ * @author
+ */
+public class Keyword extends DataEntity<Keyword> {
+    private Integer keywordID;
+
+    private String name;
+
+    private Integer sortIndex;
+
+    private String validFlag;
+
+    private Integer labelTypeID;
+
+    private static final long serialVersionUID = 1L;
+
+    public Integer getKeywordID() {
+        return keywordID;
+    }
+
+    public void setKeywordID(Integer keywordID) {
+        this.keywordID = keywordID;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public Integer getSortIndex() {
+        return sortIndex;
+    }
+
+    public void setSortIndex(Integer sortIndex) {
+        this.sortIndex = sortIndex;
+    }
+
+    public String getValidFlag() {
+        return validFlag;
+    }
+
+    public void setValidFlag(String validFlag) {
+        this.validFlag = validFlag;
+    }
+
+    public Integer getLabelTypeID() {
+        return labelTypeID;
+    }
+
+    public void setLabelTypeID(Integer labelTypeID) {
+        this.labelTypeID = labelTypeID;
+    }
+}

+ 73 - 0
src/main/java/com/caimei/modules/basesetting/entity/Province.java

@@ -0,0 +1,73 @@
+package com.caimei.modules.basesetting.entity;
+
+import com.thinkgem.jeesite.common.persistence.DataEntity;
+
+/**
+ * province
+ * @author
+ */
+public class Province extends DataEntity<Province> {
+    private Integer provinceID;
+
+    /**
+     * 名称
+     */
+    private String name;
+
+    /**
+     * 是否可用,1可用
+     */
+    private Integer validFlag;
+
+    /**
+     * 运费
+     */
+    private Double deliveryFee;
+
+    /**
+     * 最低包邮金额
+     */
+    private Double freeMinTotalPrice;
+
+    private static final long serialVersionUID = 1L;
+
+    public Integer getProvinceID() {
+        return provinceID;
+    }
+
+    public void setProvinceID(Integer provinceID) {
+        this.provinceID = provinceID;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public Integer getValidFlag() {
+        return validFlag;
+    }
+
+    public void setValidFlag(Integer validFlag) {
+        this.validFlag = validFlag;
+    }
+
+    public Double getDeliveryFee() {
+        return deliveryFee;
+    }
+
+    public void setDeliveryFee(Double deliveryFee) {
+        this.deliveryFee = deliveryFee;
+    }
+
+    public Double getFreeMinTotalPrice() {
+        return freeMinTotalPrice;
+    }
+
+    public void setFreeMinTotalPrice(Double freeMinTotalPrice) {
+        this.freeMinTotalPrice = freeMinTotalPrice;
+    }
+}

+ 86 - 0
src/main/java/com/caimei/modules/basesetting/entity/Town.java

@@ -0,0 +1,86 @@
+package com.caimei.modules.basesetting.entity;
+
+import com.thinkgem.jeesite.common.persistence.DataEntity;
+
+/**
+ * town
+ * @author
+ */
+public class Town extends DataEntity<Town> {
+    private Integer townID;
+
+    /**
+     * 所在城市Id
+     */
+    private Integer cityID;
+
+    /**
+     * 名称
+     */
+    private String name;
+
+    /**
+     * 邮编
+     */
+    private String zip;
+
+    /**
+     * 电话区号
+     */
+    private String telZip;
+
+    /**
+     * 是否可用,1可用
+     */
+    private Integer validFlag;
+
+    private static final long serialVersionUID = 1L;
+
+    public Integer getTownID() {
+        return townID;
+    }
+
+    public void setTownID(Integer townID) {
+        this.townID = townID;
+    }
+
+    public Integer getCityID() {
+        return cityID;
+    }
+
+    public void setCityID(Integer cityID) {
+        this.cityID = cityID;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getZip() {
+        return zip;
+    }
+
+    public void setZip(String zip) {
+        this.zip = zip;
+    }
+
+    public String getTelZip() {
+        return telZip;
+    }
+
+    public void setTelZip(String telZip) {
+        this.telZip = telZip;
+    }
+
+    public Integer getValidFlag() {
+        return validFlag;
+    }
+
+    public void setValidFlag(Integer validFlag) {
+        this.validFlag = validFlag;
+    }
+}

+ 225 - 0
src/main/java/com/caimei/modules/basesetting/service/AddressService.java

@@ -0,0 +1,225 @@
+package com.caimei.modules.basesetting.service;
+
+import java.util.List;
+import java.util.Map;
+
+import com.caimei.modules.basesetting.entity.City;
+import com.caimei.modules.basesetting.entity.Province;
+import com.caimei.modules.basesetting.entity.Town;
+import com.caimei.utils.StringUtils;
+import com.google.common.collect.Maps;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import com.thinkgem.jeesite.common.persistence.Page;
+import com.thinkgem.jeesite.common.service.CrudService;
+import com.caimei.modules.basesetting.entity.Address;
+import com.caimei.modules.basesetting.dao.AddressDao;
+
+/**
+ * 地址信息Service
+ * @author jiangjunwen
+ * @version 2017-03-28
+ */
+@Service
+@Transactional(readOnly = true)
+public class AddressService extends CrudService<AddressDao, Address> {
+	@Autowired
+	private  AddressDao addressDao;
+	@Override
+	public Address get(String id) {
+		return super.get(id);
+	}
+
+	@Override
+	public List<Address> findList(Address address) {
+		return super.findList(address);
+	}
+
+	@Override
+	public Page<Address> findPage(Page<Address> page, Address address) {
+		return super.findPage(page, address);
+	}
+
+	@Override
+	@Transactional(readOnly = false)
+	public void save(Address address) {
+		super.save(address);
+	}
+
+	@Override
+	@Transactional(readOnly = false)
+	public void delete(Address address) {
+		super.delete(address);
+	}
+	@Transactional(readOnly = false)
+	public List<Address> getAddressByTownId(Integer townId){
+		return  addressDao.getAddressByTownId(townId);
+	}
+
+	public Page<Province> findProvincePage(Page<Province> page, Province province){
+		page.setPageSize(40);
+		province.setPage(page);
+		page.setList(addressDao.findProvincePage());
+		return page;
+	}
+
+    public Page<City> findCityPage(Page<City> page, City city){
+		page.setPageSize(30);
+		city.setPage(page);
+		page.setList(addressDao.findCityPage(city));
+		return page;
+	}
+
+    public City findCityById(Integer cityID){
+    	return addressDao.findCityById(cityID);
+    }
+	public Page<Town> findTownPage(Page<Town> page, Town town){
+		page.setPageSize(30);
+		town.setPage(page);
+		page.setList(addressDao.findTownPage(town));
+		return page;
+	}
+
+	@Transactional(readOnly = false)
+    public Map<String, Object> provinceSave(String name, String id){
+    	Map<String, Object> map = Maps.newLinkedHashMap();
+        try {
+        	if (StringUtils.isEmpty(name)) {
+        		throw new Exception("省份不能为空!");
+			}
+			Province province = new Province();
+			province.setName(name);
+            if (StringUtils.isNotEmpty(id)) {
+            	province.setProvinceID(Integer.parseInt(id));
+                addressDao.updateProvince(province);
+            } else {
+				if (addressDao.findProvinceByName(name) != null) {
+					throw new Exception("省份已存在!");
+				}
+            	Integer provinceId = addressDao.getMaxProvinceId()+1;
+            	province.setProvinceID(provinceId);
+				province.setValidFlag(1);
+				province.setDeliveryFee(10d);
+				province.setFreeMinTotalPrice(1000d);
+            	addressDao.insertProvince(province);
+			}
+            map.put("success", true);
+            map.put("msg", "操作成功");
+        } catch (Exception e) {
+            logger.debug(e.toString(), e);
+            map.put("success", false);
+            map.put("msg", "操作失败");
+        }
+        return map;
+    }
+
+	@Transactional(readOnly = false)
+    public Map<String, Object> provinceUpdate(Province province){
+    	Map<String, Object> map = Maps.newLinkedHashMap();
+        try {
+            addressDao.updateProvince(province);
+            map.put("success", true);
+            map.put("msg", "操作成功");
+        } catch (Exception e) {
+            logger.debug(e.toString(), e);
+            map.put("success", false);
+            map.put("msg", "操作失败");
+        }
+        return map;
+    }
+
+	@Transactional(readOnly = false)
+    public Map<String, Object> citySave(String provinceID, String name, String id){
+    	Map<String, Object> map = Maps.newLinkedHashMap();
+        try {
+        	if (StringUtils.isEmpty(name)) {
+        		throw new Exception("城市不能为空!");
+			}
+			City city = new City();
+			city.setProvinceID(Integer.parseInt(provinceID));
+			city.setName(name);
+            if (StringUtils.isNotEmpty(id)) {
+            	city.setCityID(Integer.parseInt(id));
+                addressDao.updateCity(city);
+            } else {
+				if (addressDao.findCityByName(name) != null) {
+					throw new Exception("城市已存在!");
+				}
+            	Integer cityId = addressDao.getMaxCityId()+1;
+            	city.setCityID(cityId);
+				city.setValidFlag(1);
+            	addressDao.insertCity(city);
+			}
+            map.put("success", true);
+            map.put("msg", "操作成功");
+        } catch (Exception e) {
+            logger.debug(e.toString(), e);
+            map.put("success", false);
+            map.put("msg", "操作失败");
+        }
+        return map;
+    }
+
+	@Transactional(readOnly = false)
+    public Map<String, Object> cityUpdate(City city){
+    	Map<String, Object> map = Maps.newLinkedHashMap();
+        try {
+            addressDao.updateCity(city);
+            map.put("success", true);
+            map.put("msg", "操作成功");
+        } catch (Exception e) {
+            logger.debug(e.toString(), e);
+            map.put("success", false);
+            map.put("msg", "操作失败");
+        }
+        return map;
+    }
+
+	@Transactional(readOnly = false)
+    public Map<String, Object> townSave(Town town){
+    	Map<String, Object> map = Maps.newLinkedHashMap();
+        try {
+        	if (StringUtils.isEmpty(town.getName())) {
+        		throw new Exception("区域不能为空!");
+			}
+            if (StringUtils.isNotEmpty(town.getId())) {
+            	town.setTownID(Integer.parseInt(town.getId()));
+                addressDao.updateTown(town);
+            } else {
+				if (addressDao.findTownByName(town.getName()) != null) {
+					throw new Exception("区域已存在!");
+				}
+            	Integer townId = addressDao.getMaxTownyId()+1;
+            	town.setTownID(townId);
+				town.setValidFlag(1);
+            	addressDao.insertTown(town);
+			}
+            map.put("success", true);
+            map.put("msg", "操作成功");
+        } catch (Exception e) {
+            logger.debug(e.toString(), e);
+            map.put("success", false);
+            map.put("msg", "操作失败");
+        }
+        return map;
+    }
+
+	@Transactional(readOnly = false)
+    public Map<String, Object> townUpdate(Town town){
+    	Map<String, Object> map = Maps.newLinkedHashMap();
+        try {
+            addressDao.updateTown(town);
+            map.put("success", true);
+            map.put("msg", "操作成功");
+        } catch (Exception e) {
+            logger.debug(e.toString(), e);
+            map.put("success", false);
+            map.put("msg", "操作失败");
+        }
+        return map;
+    }
+
+
+}

+ 49 - 0
src/main/java/com/caimei/modules/basesetting/service/HelpPageService.java

@@ -0,0 +1,49 @@
+package com.caimei.modules.basesetting.service;
+
+import com.caimei.modules.basesetting.dao.HelpPageDao;
+import com.caimei.modules.basesetting.entity.Helppage;
+import com.caimei.modules.basesetting.entity.BaseType;
+import com.thinkgem.jeesite.common.persistence.Page;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * 帮助页设置
+ *
+ * @author : Charles
+ * @date : 2020/4/17
+ */
+@Service
+public class HelpPageService {
+
+	@Autowired
+	private HelpPageDao helpPageDao;
+
+    public Helppage getById(String id) {
+        return helpPageDao.getById(id);
+    }
+
+    public Page<Helppage> findHelpPageList(Page<Helppage> page, Helppage helppage) {
+        page.setPageSize(40);
+        helppage.setPage(page);
+        page.setList(helpPageDao.findHelppageList(helppage));
+        return page;
+    }
+    public List<BaseType> findHelpPageType() {
+        List<BaseType> typeList = helpPageDao.findHelpPageType();
+        return typeList;
+    }
+
+    public void saveHelpPage(Helppage helppage) {
+        if (null != helppage.getHelpPageID()) {
+            helpPageDao.updateHelpPage(helppage);
+        }else{
+            Integer helpPageId = helpPageDao.getMaxHelpPageId()+1;
+            helppage.setHelpPageID(helpPageId);
+            helppage.setValidFlag("1");
+            helpPageDao.insertHelpPage(helppage);
+        }
+    }
+}

+ 72 - 0
src/main/java/com/caimei/modules/basesetting/service/KeywordService.java

@@ -0,0 +1,72 @@
+package com.caimei.modules.basesetting.service;
+
+import com.caimei.constants.common.RedisKeyUtil;
+import com.caimei.modules.basesetting.dao.KeywordDao;
+import com.caimei.modules.basesetting.entity.BaseType;
+import com.caimei.modules.basesetting.entity.Keyword;
+import com.caimei.redis.RedisService;
+import com.thinkgem.jeesite.common.persistence.Page;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * Description
+ *
+ * @author : Charles
+ * @date : 2020/4/17
+ */
+@Service
+public class KeywordService {
+	@Autowired
+	private KeywordDao keywordDao;
+	@Autowired
+	private RedisService redisService;
+
+    public Keyword getById(String id) {
+        return keywordDao.getById(id);
+    }
+
+    public Page<Keyword> findKeyWordList(Page<Keyword> page, Keyword keyword) {
+        page.setPageSize(40);
+        keyword.setPage(page);
+        page.setList(keywordDao.findKeyWordList(keyword));
+        return page;
+    }
+
+    public List<BaseType> findLabeltype() {
+        List<BaseType> typeList = keywordDao.findLabelType();
+        return typeList;
+    }
+
+    public void saveKeyWord(Keyword keyword) {
+        if (null != keyword.getKeywordID()) {
+            keywordDao.updateKeyWord(keyword);
+        }else{
+            Integer keywordId = keywordDao.getMaxKeyWordId()+1;
+            keyword.setKeywordID(keywordId);
+            keyword.setValidFlag("1");
+            keywordDao.insertHelpPage(keyword);
+        }
+        cleanRedisCache();
+    }
+
+    public void deleteKeyWord(Integer id) {
+        keywordDao.deleteKeyWord(id);
+        cleanRedisCache();
+    }
+
+	/**
+	 * 有数据变动时需要清除缓存
+	 */
+	private void cleanRedisCache(){
+	    // 热门搜索关键词
+	    String keywordCache = RedisKeyUtil.getSearchKeyWordKey();
+        if (redisService.exists(keywordCache)) {
+            redisService.remove(keywordCache);
+        }
+	}
+
+
+}

+ 97 - 0
src/main/java/com/caimei/modules/basesetting/web/AddressController.java

@@ -0,0 +1,97 @@
+package com.caimei.modules.basesetting.web;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import java.util.List;
+
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.ModelAttribute;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.servlet.mvc.support.RedirectAttributes;
+
+import com.thinkgem.jeesite.common.config.Global;
+import com.thinkgem.jeesite.common.persistence.Page;
+import com.thinkgem.jeesite.common.web.BaseController;
+import com.thinkgem.jeesite.common.utils.StringUtils;
+import com.caimei.modules.basesetting.entity.Address;
+import com.caimei.modules.basesetting.service.AddressService;
+
+/**
+ * 地址信息Controller
+ *
+ * @author jiangjunwen
+ * @version 2017-03-28
+ */
+@Controller
+@RequestMapping(value = "${adminPath}/address/address")
+public class AddressController extends BaseController {
+
+    @Autowired
+    private AddressService addressService;
+
+    @ModelAttribute
+    public Address get(@RequestParam(required = false) String id) {
+        Address entity = null;
+        if (StringUtils.isNotBlank(id)) {
+            entity = addressService.get(id);
+        }
+        if (entity == null) {
+            entity = new Address();
+        }
+        return entity;
+    }
+
+    @RequiresPermissions("address:address:view")
+    @RequestMapping(value = {"list", ""})
+    public String list(Address address, HttpServletRequest request, HttpServletResponse response, Model model) {
+        Page<Address> page = addressService.findPage(new Page<Address>(request, response), address);
+        model.addAttribute("page", page);
+        return "modules/basesetting/addressList";
+    }
+
+    @RequiresPermissions("address:address:view")
+    @RequestMapping(value = "form")
+    public String form(Address address, Model model) {
+        model.addAttribute("address", address);
+        return "modules/basesetting/addressForm";
+    }
+
+    @RequiresPermissions("address:address:edit")
+    @RequestMapping(value = "save")
+    public String save(Address address, Model model, RedirectAttributes redirectAttributes) {
+        if (!beanValidator(model, address)) {
+            return form(address, model);
+        }
+        addressService.save(address);
+        addMessage(redirectAttributes, "保存地址信息成功");
+        return "redirect:" + Global.getAdminPath() + "/address/address/?repage";
+    }
+
+    @RequiresPermissions("address:address:delete")
+    @RequestMapping(value = "delete")
+    public String delete(Address address, RedirectAttributes redirectAttributes) {
+        addressService.delete(address);
+        addMessage(redirectAttributes, "删除地址信息成功");
+        return "redirect:" + Global.getAdminPath() + "/address/address/?repage";
+    }
+
+    @RequestMapping(value = "getAddressByTownId")
+    @ResponseBody
+    public Address getAddressByTownId(@RequestParam(value = "townID", required = false) Integer townId) {
+        if (townId != null && townId.toString() != "") {
+            List<Address> list = addressService.getAddressByTownId(townId);
+            if (list != null && list.size() > 0) {
+                Address address = list.get(0);
+                return address;
+            }
+            return null;
+        }
+        return null;
+    }
+}

+ 97 - 0
src/main/java/com/caimei/modules/basesetting/web/AreaSetController.java

@@ -0,0 +1,97 @@
+package com.caimei.modules.basesetting.web;
+
+import com.caimei.modules.basesetting.entity.City;
+import com.caimei.modules.basesetting.entity.Province;
+import com.caimei.modules.basesetting.entity.Town;
+import com.caimei.modules.basesetting.service.AddressService;
+import com.thinkgem.jeesite.common.persistence.Page;
+import com.thinkgem.jeesite.common.web.BaseController;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.util.Map;
+
+/**
+ * 地域设置
+ *
+ * @author : Charles
+ * @date : 2020/4/15
+ */
+@Controller
+@RequestMapping(value = "${adminPath}/area")
+public class AreaSetController extends BaseController {
+
+    @Autowired
+    private AddressService addressService;
+
+    @RequestMapping("province")
+    public String provinceList(Province province, HttpServletRequest request, HttpServletResponse response, Model model) {
+        Page<Province> page = addressService.findProvincePage(new Page<Province>(request, response), province);
+        model.addAttribute("page", page);
+        return "modules/basesetting/provinceList";
+    }
+
+    @RequestMapping("city")
+    public String cityList(City city, HttpServletRequest request, HttpServletResponse response, Model model) {
+        Page<City> page = addressService.findCityPage(new Page<City>(request, response), city);
+        model.addAttribute("provinceID", city.getProvinceID());
+        model.addAttribute("page", page);
+        return "modules/basesetting/cityList";
+    }
+
+    @RequestMapping("town")
+    public String cityList(Town town, HttpServletRequest request, HttpServletResponse response, Model model) {
+        City city = addressService.findCityById(town.getCityID());
+        Page<Town> page = addressService.findTownPage(new Page<Town>(request, response), town);
+        model.addAttribute("provinceID", city.getProvinceID());
+        model.addAttribute("cityID", town.getCityID());
+        model.addAttribute("page", page);
+        return "modules/basesetting/townList";
+    }
+
+    @RequestMapping("province/save")
+    @ResponseBody
+    public Map<String, Object> provinceSave(String name, String id) {
+        Map<String, Object> map = addressService.provinceSave(name, id);
+        return map;
+    }
+
+    @RequestMapping("city/save")
+    @ResponseBody
+    public Map<String, Object> citySave(String provinceID, String name, String id) {
+        Map<String, Object> map = addressService.citySave(provinceID, name, id);
+        return map;
+    }
+
+    @RequestMapping("town/save")
+    @ResponseBody
+    public Map<String, Object> townSave(Town town) {
+        Map<String, Object> map = addressService.townSave(town);
+        return map;
+    }
+    @RequestMapping("province/update")
+    @ResponseBody
+    public Map<String, Object> provinceUpdate(Province province) {
+        Map<String, Object> map = addressService.provinceUpdate(province);
+        return map;
+    }
+
+    @RequestMapping("city/update")
+    @ResponseBody
+    public Map<String, Object> cityUpdate(City city) {
+        Map<String, Object> map = addressService.cityUpdate(city);
+        return map;
+    }
+
+    @RequestMapping("town/update")
+    @ResponseBody
+    public Map<String, Object> townUpdate(Town town) {
+        Map<String, Object> map = addressService.townUpdate(town);
+        return map;
+    }
+}

+ 106 - 0
src/main/java/com/caimei/modules/basesetting/web/HelpPageController.java

@@ -0,0 +1,106 @@
+package com.caimei.modules.basesetting.web;
+
+import com.caimei.modules.basesetting.dao.HelpPageDao;
+import com.caimei.modules.basesetting.entity.Helppage;
+import com.caimei.modules.basesetting.entity.BaseType;
+import com.caimei.modules.basesetting.service.HelpPageService;
+import com.caimei.redis.RedisService;
+import com.google.common.collect.Maps;
+import com.thinkgem.jeesite.common.config.Global;
+import com.thinkgem.jeesite.common.persistence.Page;
+import com.thinkgem.jeesite.common.utils.StringUtils;
+import com.thinkgem.jeesite.common.web.BaseController;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.ModelAttribute;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 帮助页设置
+ *
+ * @author : Charles
+ * @date : 2020/4/17
+ */
+@Controller
+@RequestMapping(value = "${adminPath}/help")
+public class HelpPageController extends BaseController {
+    @Autowired
+    private HelpPageService helpPageService;
+	@Autowired
+	private HelpPageDao helpPageDao;
+
+	@Autowired
+    private RedisService redisService;
+
+	@ModelAttribute
+	public Helppage get(@RequestParam(required=false) String id) {
+		Helppage entity = null;
+		if (StringUtils.isNotBlank(id)){
+			entity = helpPageService.getById(id);
+		}
+		if (entity == null){
+			entity = new Helppage();
+		}
+		return entity;
+	}
+
+    @RequestMapping("list")
+    public String helpPageList(Helppage helppage, HttpServletRequest request, HttpServletResponse response, Model model) {
+        List<BaseType> typeList = helpPageService.findHelpPageType();
+        Page<Helppage> page = helpPageService.findHelpPageList(new Page<Helppage>(request, response), helppage);
+        model.addAttribute("typeList", typeList);
+        model.addAttribute("page", page);
+        return "modules/basesetting/helpPage";
+    }
+
+    @RequestMapping("form")
+    public String form(Helppage helppage, Model model) {
+        List<BaseType> typeList = helpPageService.findHelpPageType();
+        model.addAttribute("typeList", typeList);
+        model.addAttribute("helppage", helppage);
+        return "modules/basesetting/helpPageEdit";
+    }
+
+    @RequestMapping("save")
+    public String saveHelpPage(Helppage helppage) {
+        helpPageService.saveHelpPage(helppage);
+        cleanRedisCache();
+        return "redirect:" + Global.getAdminPath() + "/help/list/";
+    }
+
+    @RequestMapping("update")
+    @ResponseBody
+    public Map<String, Object> updateHelpPage(Helppage helppage) {
+        Map<String, Object> map = Maps.newLinkedHashMap();
+        try {
+        	helpPageService.saveHelpPage(helppage);
+            cleanRedisCache();
+            map.put("success", true);
+            map.put("msg", "操作成功");
+        } catch (Exception e) {
+            logger.debug(e.toString(), e);
+            map.put("success", false);
+            map.put("msg", "操作失败");
+        }
+        return map;
+    }
+
+    /**
+     * 有数据变动时需要清除缓存
+     */
+    public void cleanRedisCache() {
+        //首页导航栏缓存
+        String getHelpPages = "getFriendLinks::spi";
+        if (redisService.exists(getHelpPages)) {
+            redisService.remove(getHelpPages);
+        }
+    }
+}

+ 104 - 0
src/main/java/com/caimei/modules/basesetting/web/KeyWordController.java

@@ -0,0 +1,104 @@
+package com.caimei.modules.basesetting.web;
+
+import com.caimei.modules.basesetting.entity.BaseType;
+import com.caimei.modules.basesetting.entity.Keyword;
+import com.caimei.modules.basesetting.service.KeywordService;
+import com.google.common.collect.Maps;
+import com.thinkgem.jeesite.common.config.Global;
+import org.springframework.ui.Model;
+import com.thinkgem.jeesite.common.persistence.Page;
+import com.thinkgem.jeesite.common.web.BaseController;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.ModelAttribute;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 帮助页设置
+ *
+ * @author : Charles
+ * @date : 2020/4/17
+ */
+@Controller
+@RequestMapping(value = "${adminPath}/keyword")
+public class KeyWordController extends BaseController {
+    @Autowired
+    private KeywordService keywordService;
+
+	@ModelAttribute
+	public Keyword get(@RequestParam(required=false) String id) {
+		Keyword entity = null;
+		if (StringUtils.isNotBlank(id)){
+			entity = keywordService.getById(id);
+		}
+		if (entity == null){
+			entity = new Keyword();
+		}
+		return entity;
+	}
+
+    @RequestMapping("list")
+    public String keywordList(Keyword keyword, HttpServletRequest request, HttpServletResponse response, Model model) {
+        List<BaseType> typeList = keywordService.findLabeltype();
+        Page<Keyword> page = keywordService.findKeyWordList(new Page<Keyword>(request, response), keyword);
+        model.addAttribute("typeList", typeList);
+        model.addAttribute("page", page);
+        return "modules/basesetting/keyword";
+    }
+
+    @RequestMapping("form")
+    public String form(Keyword keyword, Model model) {
+        List<BaseType> typeList = keywordService.findLabeltype();
+        model.addAttribute("typeList", typeList);
+        model.addAttribute("keyword", keyword);
+        return "modules/basesetting/keywordEdit";
+    }
+
+    @RequestMapping("save")
+    public String saveKeyWord(Keyword keyword) {
+        keywordService.saveKeyWord(keyword);
+        return "redirect:" + Global.getAdminPath() + "/keyword/list/";
+    }
+
+    @RequestMapping("update")
+    @ResponseBody
+    public Map<String, Object> updateKeyWord(Keyword keyword) {
+        Map<String, Object> map = Maps.newLinkedHashMap();
+        try {
+        	keywordService.saveKeyWord(keyword);
+            map.put("success", true);
+            map.put("msg", "操作成功");
+        } catch (Exception e) {
+            logger.debug(e.toString(), e);
+            map.put("success", false);
+            map.put("msg", "操作失败");
+        }
+        return map;
+    }
+
+    @RequestMapping("delete")
+    @ResponseBody
+    public Map<String, Object> deleteKeyWord(Integer id) {
+        Map<String, Object> map = Maps.newLinkedHashMap();
+        try {
+        	keywordService.deleteKeyWord(id);
+            map.put("success", true);
+            map.put("msg", "操作成功");
+        } catch (Exception e) {
+            logger.debug(e.toString(), e);
+            map.put("success", false);
+            map.put("msg", "操作失败");
+        }
+        return map;
+    }
+
+
+}

+ 26 - 0
src/main/java/com/caimei/modules/brand/dao/BrandAgentDao.java

@@ -0,0 +1,26 @@
+package com.caimei.modules.brand.dao;
+
+import java.util.Map;
+
+import com.caimei.modules.brand.entity.BrandAgent;
+import com.thinkgem.jeesite.common.persistence.CrudDao;
+import com.thinkgem.jeesite.common.persistence.annotation.MyBatisDao;
+
+/**
+ * 品牌联盟代理商DAO接口
+ * @author LG
+ * @version 2016-05-13
+ */
+@MyBatisDao
+public interface BrandAgentDao extends CrudDao<BrandAgent> {
+
+	/**
+	 * <p>Description: 更新启用/停用状态</p>
+	 * <p>Company: caimei365</p> 
+	 * @author dmeng
+	 * @date 2016年5月17日 下午5:32:03
+	 * @param param
+	 */
+	void changeStatus(Map<String, Object> param);
+	
+}

+ 33 - 0
src/main/java/com/caimei/modules/brand/dao/BrandIdentificationCodeDao.java

@@ -0,0 +1,33 @@
+package com.caimei.modules.brand.dao;
+
+import org.apache.ibatis.annotations.Param;
+
+import com.caimei.modules.brand.entity.BrandIdentificationCode;
+import com.thinkgem.jeesite.common.persistence.CrudDao;
+import com.thinkgem.jeesite.common.persistence.annotation.MyBatisDao;
+
+/**
+ * 品牌联盟代理商DAO接口
+ * @author LG
+ * @version 2016-05-13
+ */
+@MyBatisDao
+public interface BrandIdentificationCodeDao extends CrudDao<BrandIdentificationCode> {
+
+	/**
+	 * 
+	 * <p>Description: 获取一个未使用的商品标识码</p>
+	 * <p>Company: caimei365</p> 
+	 * @author dmeng
+	 * @date 2016年5月20日 上午11:51:07
+	 * @return
+	 */
+	BrandIdentificationCode getIdentificationCode();
+	
+	Long getUnusedNum();
+	
+	int useCode(BrandIdentificationCode brandIdentificationCode);
+	
+	BrandIdentificationCode getByCode(@Param("code") String code);
+	
+}

+ 33 - 0
src/main/java/com/caimei/modules/brand/dao/BrandProductDao.java

@@ -0,0 +1,33 @@
+package com.caimei.modules.brand.dao;
+
+import java.util.Map;
+
+import com.caimei.modules.brand.entity.BrandProduct;
+import com.thinkgem.jeesite.common.persistence.CrudDao;
+import com.thinkgem.jeesite.common.persistence.annotation.MyBatisDao;
+
+/**
+ * 品牌联盟商品DAO接口
+ * @author LG
+ * @version 2016-05-13
+ */
+@MyBatisDao
+public interface BrandProductDao extends CrudDao<BrandProduct> {
+	
+	/**
+	 * <p>Description: 更新启用/停用状态</p>
+	 * <p>Company: caimei365</p> 
+	 * @author dmeng
+	 * @date 2016年5月17日 下午5:32:03
+	 * @param param
+	 */
+	void changeStatus(Map<String, Object> param);
+
+	/**
+	 * 批量修改状态
+	 * @param enabledStatus
+	 * @param ids
+	 */
+	int updateEnabledStatusByIds(String enabledStatus, String[] ids);
+	
+}

+ 21 - 0
src/main/java/com/caimei/modules/brand/dao/BrandProductsDao.java

@@ -0,0 +1,21 @@
+package com.caimei.modules.brand.dao;
+
+import java.util.List;
+
+import com.caimei.modules.brand.entity.BrandProducts;
+import com.thinkgem.jeesite.common.persistence.CrudDao;
+import com.thinkgem.jeesite.common.persistence.annotation.MyBatisDao;
+
+/**
+ * 商品管理DAO接口
+ * @author LG
+ * @version 2016-08-24
+ */
+@MyBatisDao
+public interface BrandProductsDao extends CrudDao<BrandProducts> {
+
+	List<BrandProducts> findBySn(String sn);
+
+	List<BrandProducts> findByIdentificationCode(String identificationCode);
+	
+}

+ 26 - 0
src/main/java/com/caimei/modules/brand/dao/BrandPurchaserDao.java

@@ -0,0 +1,26 @@
+package com.caimei.modules.brand.dao;
+
+import java.util.Map;
+
+import com.caimei.modules.brand.entity.BrandPurchaser;
+import com.thinkgem.jeesite.common.persistence.CrudDao;
+import com.thinkgem.jeesite.common.persistence.annotation.MyBatisDao;
+
+/**
+ * 品牌联盟购买者DAO接口
+ * @author LG
+ * @version 2016-05-13
+ */
+@MyBatisDao
+public interface BrandPurchaserDao extends CrudDao<BrandPurchaser> {
+	
+	/**
+	 * <p>Description: 更新启用/停用状态</p>
+	 * <p>Company: caimei365</p> 
+	 * @author dmeng
+	 * @date 2016年5月17日 下午5:32:03
+	 * @param param
+	 */
+	void changeStatus(Map<String, Object> param);
+	
+}

+ 26 - 0
src/main/java/com/caimei/modules/brand/dao/BrandSupplierDao.java

@@ -0,0 +1,26 @@
+package com.caimei.modules.brand.dao;
+
+import java.util.Map;
+
+import com.thinkgem.jeesite.common.persistence.CrudDao;
+import com.thinkgem.jeesite.common.persistence.annotation.MyBatisDao;
+import com.caimei.modules.brand.entity.BrandSupplier;
+
+/**
+ * 品牌供应商DAO接口
+ * @author LG
+ * @version 2016-05-13
+ */
+@MyBatisDao
+public interface BrandSupplierDao extends CrudDao<BrandSupplier> {
+	
+	/**
+	 * <p>Description: 更新启用/停用状态</p>
+	 * <p>Company: caimei365</p> 
+	 * @author dmeng
+	 * @date 2016年5月17日 下午5:32:03
+	 * @param param
+	 */
+	void changeStatus(Map<String, Object> param);
+
+}

+ 19 - 0
src/main/java/com/caimei/modules/brand/dao/CmBrandDao.java

@@ -0,0 +1,19 @@
+package com.caimei.modules.brand.dao;
+
+import com.thinkgem.jeesite.common.persistence.CrudDao;
+import com.thinkgem.jeesite.common.persistence.annotation.MyBatisDao;
+import com.caimei.modules.brand.entity.CmBrand;
+
+import java.util.List;
+
+/**
+ * 采美品牌DAO接口
+ * @author Lijun
+ * @version 2019-04-19
+ */
+@MyBatisDao
+public interface CmBrandDao extends CrudDao<CmBrand> {
+    CmBrand findBradByName(CmBrand cmBrand) ;
+
+    List<CmBrand> getList();
+}

+ 10 - 0
src/main/java/com/caimei/modules/brand/dao/ProductModelDao.java

@@ -0,0 +1,10 @@
+package com.caimei.modules.brand.dao;
+
+import com.caimei.modules.brand.model.ProductModel;
+import com.thinkgem.jeesite.common.persistence.CrudDao;
+import com.thinkgem.jeesite.common.persistence.annotation.MyBatisDao;
+
+@MyBatisDao
+public interface ProductModelDao extends CrudDao<ProductModel> {
+
+}

+ 10 - 0
src/main/java/com/caimei/modules/brand/dao/ShopModelDao.java

@@ -0,0 +1,10 @@
+package com.caimei.modules.brand.dao;
+
+import com.caimei.modules.brand.model.ShopModel;
+import com.thinkgem.jeesite.common.persistence.CrudDao;
+import com.thinkgem.jeesite.common.persistence.annotation.MyBatisDao;
+
+@MyBatisDao
+public interface ShopModelDao extends CrudDao<ShopModel> {
+
+}

+ 131 - 0
src/main/java/com/caimei/modules/brand/entity/BrandAgent.java

@@ -0,0 +1,131 @@
+package com.caimei.modules.brand.entity;
+
+import org.hibernate.validator.constraints.Length;
+
+import com.thinkgem.jeesite.common.persistence.DataEntity;
+
+/**
+ * 品牌联盟代理商Entity
+ * @author LG
+ * @version 2016-05-13
+ */
+public class BrandAgent extends DataEntity<BrandAgent> {
+	
+	private static final long serialVersionUID = 1L;
+	private String name;		// 代理商名称
+	private String businessLicense;		// 营业执照注册号
+	private String businessAddress;		// 公司注册地址
+	private String businessPhone;		// 公司电话
+	private String legalRepresentaive;		// 公司法人
+	private String registeredCapital;		// 注册资本
+	private String enterpriseType;		// 公司类型
+	private String businessScope;		// 经营范围
+	private String enabledStatus;		// 状态 0停用 1启用
+	
+	private Integer productTypeCount; // 商品种类
+	private Integer productTotalCount; // 商品总数
+	
+	public BrandAgent() {
+		super();
+	}
+
+	public BrandAgent(String id){
+		super(id);
+	}
+
+	@Length(min=0, max=100, message="代理商名称长度必须介于 0 和 100 之间")
+	public String getName() {
+		return name;
+	}
+
+	public void setName(String name) {
+		this.name = name;
+	}
+	
+	@Length(min=0, max=100, message="营业执照注册号长度必须介于 0 和 100 之间")
+	public String getBusinessLicense() {
+		return businessLicense;
+	}
+
+	public void setBusinessLicense(String businessLicense) {
+		this.businessLicense = businessLicense;
+	}
+	
+	@Length(min=0, max=200, message="公司注册地址长度必须介于 0 和 200 之间")
+	public String getBusinessAddress() {
+		return businessAddress;
+	}
+
+	public void setBusinessAddress(String businessAddress) {
+		this.businessAddress = businessAddress;
+	}
+	
+	@Length(min=0, max=20, message="公司电话长度必须介于 0 和 20 之间")
+	public String getBusinessPhone() {
+		return businessPhone;
+	}
+
+	public void setBusinessPhone(String businessPhone) {
+		this.businessPhone = businessPhone;
+	}
+	
+	@Length(min=0, max=20, message="公司法人长度必须介于 0 和 20 之间")
+	public String getLegalRepresentaive() {
+		return legalRepresentaive;
+	}
+
+	public void setLegalRepresentaive(String legalRepresentaive) {
+		this.legalRepresentaive = legalRepresentaive;
+	}
+	
+	public String getRegisteredCapital() {
+		return registeredCapital;
+	}
+
+	public void setRegisteredCapital(String registeredCapital) {
+		this.registeredCapital = registeredCapital;
+	}
+	
+	@Length(min=0, max=1, message="公司类型长度必须介于 0 和 1 之间")
+	public String getEnterpriseType() {
+		return enterpriseType;
+	}
+
+	public void setEnterpriseType(String enterpriseType) {
+		this.enterpriseType = enterpriseType;
+	}
+	
+	public String getBusinessScope() {
+		return businessScope;
+	}
+
+	public void setBusinessScope(String businessScope) {
+		this.businessScope = businessScope;
+	}
+	
+	@Length(min=0, max=1, message="状态 0停用 1启用长度必须介于 0 和 1 之间")
+	public String getEnabledStatus() {
+		return enabledStatus;
+	}
+
+	public void setEnabledStatus(String enabledStatus) {
+		this.enabledStatus = enabledStatus;
+	}
+
+	public Integer getProductTypeCount() {
+		return productTypeCount;
+	}
+
+	public void setProductTypeCount(Integer productTypeCount) {
+		this.productTypeCount = productTypeCount;
+	}
+
+	public Integer getProductTotalCount() {
+		return productTotalCount;
+	}
+
+	public void setProductTotalCount(Integer productTotalCount) {
+		this.productTotalCount = productTotalCount;
+	}
+
+}

+ 89 - 0
src/main/java/com/caimei/modules/brand/entity/BrandAndProductType.java

@@ -0,0 +1,89 @@
+package com.caimei.modules.brand.entity;
+
+/**
+ * 商品分类和品牌导入使用对象
+ */
+public class BrandAndProductType {
+    private Integer productId;//商品Id
+    private Integer brandId;//品牌Id
+    private String brandName;//品牌名字
+    private String bigTypeName;//大分类名字
+    private String smallTypeName;//二级分类名字
+    private String tinyTypeName;//小分类名字
+    private Integer bigTypeID;
+    private Integer smallTypeID;
+    private Integer tinyTypeID;
+
+
+    public Integer getProductId() {
+        return productId;
+    }
+
+    public void setProductId(Integer productId) {
+        this.productId = productId;
+    }
+
+    public Integer getBrandId() {
+        return brandId;
+    }
+
+    public void setBrandId(Integer brandId) {
+        this.brandId = brandId;
+    }
+
+    public String getBrandName() {
+        return brandName;
+    }
+
+    public void setBrandName(String brandName) {
+        this.brandName = brandName;
+    }
+
+    public String getBigTypeName() {
+        return bigTypeName;
+    }
+
+    public void setBigTypeName(String bigTypeName) {
+        this.bigTypeName = bigTypeName;
+    }
+
+    public String getSmallTypeName() {
+        return smallTypeName;
+    }
+
+    public void setSmallTypeName(String smallTypeName) {
+        this.smallTypeName = smallTypeName;
+    }
+
+    public String getTinyTypeName() {
+        return tinyTypeName;
+    }
+
+    public void setTinyTypeName(String tinyTypeName) {
+        this.tinyTypeName = tinyTypeName;
+    }
+
+    public Integer getBigTypeID() {
+        return bigTypeID;
+    }
+
+    public void setBigTypeID(Integer bigTypeID) {
+        this.bigTypeID = bigTypeID;
+    }
+
+    public Integer getSmallTypeID() {
+        return smallTypeID;
+    }
+
+    public void setSmallTypeID(Integer smallTypeID) {
+        this.smallTypeID = smallTypeID;
+    }
+
+    public Integer getTinyTypeID() {
+        return tinyTypeID;
+    }
+
+    public void setTinyTypeID(Integer tinyTypeID) {
+        this.tinyTypeID = tinyTypeID;
+    }
+}

+ 65 - 0
src/main/java/com/caimei/modules/brand/entity/BrandIdentificationCode.java

@@ -0,0 +1,65 @@
+package com.caimei.modules.brand.entity;
+
+import org.hibernate.validator.constraints.Length;
+import java.util.Date;
+import com.fasterxml.jackson.annotation.JsonFormat;
+
+import com.thinkgem.jeesite.common.persistence.DataEntity;
+
+/**
+ * 商品标识码Entity
+ * @author demon
+ * @version 2016-05-20
+ */
+public class BrandIdentificationCode extends DataEntity<BrandIdentificationCode> {
+	
+	private static final long serialVersionUID = 1L;
+	private String identificationCode;		// 8位的唯一标识码
+	private Integer brandProductID;		// 对应的商品ID
+	private Date createTime;		// 创建时间
+	
+	private Integer status; // 是否已使用 -1:已使用(不可用), 1:未使用(可用)
+	
+	public BrandIdentificationCode() {
+		super();
+	}
+
+	public BrandIdentificationCode(String id){
+		super(id);
+	}
+
+	@Length(min=0, max=8, message="8位的唯一标识码长度必须介于 0 和 8 之间")
+	public String getIdentificationCode() {
+		return identificationCode;
+	}
+
+	public void setIdentificationCode(String identificationCode) {
+		this.identificationCode = identificationCode;
+	}
+	
+	public Integer getBrandProductID() {
+		return brandProductID;
+	}
+
+	public void setBrandProductID(Integer brandProductID) {
+		this.brandProductID = brandProductID;
+	}
+	
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+	public Date getCreateTime() {
+		return createTime;
+	}
+
+	public void setCreateTime(Date createTime) {
+		this.createTime = createTime;
+	}
+
+	public Integer getStatus() {
+		return status;
+	}
+
+	public void setStatus(Integer status) {
+		this.status = status;
+	}
+	
+}

+ 258 - 0
src/main/java/com/caimei/modules/brand/entity/BrandProduct.java

@@ -0,0 +1,258 @@
+package com.caimei.modules.brand.entity;
+
+import java.util.Date;
+
+import org.hibernate.validator.constraints.Length;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.thinkgem.jeesite.common.persistence.DataEntity;
+
+/**
+ * 品牌联盟商品Entity
+ * @author LG
+ * @version 2016-05-13
+ */
+public class BrandProduct extends DataEntity<BrandProduct> {
+	
+	private static final long serialVersionUID = 1L;
+	private Long productID;		// 网站商品id
+	
+	private BrandSupplier brandSupplier;//供应商
+	private BrandAgent brandAgent;//代理商
+	private BrandPurchaser brandPurchaser;//购买者
+	
+	private String fileNumber;		// 档案编号
+	private Date licenseStartDate;		// 证书有效开始日期
+	private Date licenseEndDate;		// 证书有效截止日期
+	private String name;		// 商品名称(进入页)
+	private String licenseName;		// 商品名称(证书)
+	private String sn;		// 商品SN码
+	private Date factoryDate;		// 出厂日期
+	private String serviceLife;		// 使用期限
+	private String purpose;		// 商品用途
+	private String images;		// 商品略缩图片,多个图片用|隔开
+	private String largeImages; //商品大图,多个图片用|隔开
+	private String parameter;		// 产品参数
+	private String parameterImages;		// 参数图片,多个图片用 |隔开
+	private String parameterLargeImages;		// 参数大图片,多个图片用 |隔开
+	private String showAgent; //是否显示代理商 0否 1是
+	private String showPurchaser; //是否显示购买者 0否 1是
+	
+	private String enabledStatus;		// 状态 0停用 1启用
+	private String scanNum;		// 扫码人数
+	private String queryNum;		// 查看商品人数
+	private String identificationCode;		// 标识码:8位随机不重复
+	
+	public BrandProduct() {
+		super();
+	}
+
+	public BrandProduct(String id){
+		super(id);
+	}
+
+	public Long getProductID() {
+		return productID;
+	}
+
+	public void setProductID(Long productID) {
+		this.productID = productID;
+	}
+	
+	public BrandSupplier getBrandSupplier() {
+		return brandSupplier;
+	}
+
+	public void setBrandSupplier(BrandSupplier brandSupplier) {
+		this.brandSupplier = brandSupplier;
+	}
+
+	public BrandAgent getBrandAgent() {
+		return brandAgent;
+	}
+
+	public void setBrandAgent(BrandAgent brandAgent) {
+		this.brandAgent = brandAgent;
+	}
+
+	public BrandPurchaser getBrandPurchaser() {
+		return brandPurchaser;
+	}
+
+	public void setBrandPurchaser(BrandPurchaser brandPurchaser) {
+		this.brandPurchaser = brandPurchaser;
+	}
+
+	@Length(min=0, max=100, message="档案编号长度必须介于 0 和 100 之间")
+	public String getFileNumber() {
+		return fileNumber;
+	}
+
+	public void setFileNumber(String fileNumber) {
+		this.fileNumber = fileNumber;
+	}
+	
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+	public Date getLicenseStartDate() {
+		return licenseStartDate;
+	}
+
+	public void setLicenseStartDate(Date licenseStartDate) {
+		this.licenseStartDate = licenseStartDate;
+	}
+	
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+	public Date getLicenseEndDate() {
+		return licenseEndDate;
+	}
+
+	public void setLicenseEndDate(Date licenseEndDate) {
+		this.licenseEndDate = licenseEndDate;
+	}
+	
+	@Length(min=0, max=100, message="商品名称(进入页)长度必须介于 0 和 100 之间")
+	public String getName() {
+		return name;
+	}
+
+	public void setName(String name) {
+		this.name = name;
+	}
+	
+	@Length(min=0, max=100, message="商品名称(证书)长度必须介于 0 和 100 之间")
+	public String getLicenseName() {
+		return licenseName;
+	}
+
+	public void setLicenseName(String licenseName) {
+		this.licenseName = licenseName;
+	}
+	
+	@Length(min=0, max=100, message="商品SN码长度必须介于 0 和 100 之间")
+	public String getSn() {
+		return sn;
+	}
+
+	public void setSn(String sn) {
+		this.sn = sn;
+	}
+	
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+	public Date getFactoryDate() {
+		return factoryDate;
+	}
+
+	public void setFactoryDate(Date factoryDate) {
+		this.factoryDate = factoryDate;
+	}
+	
+	@Length(min=0, max=9, message="使用期限长度必须介于 0 和 9 之间")
+	public String getServiceLife() {
+		return serviceLife;
+	}
+
+	public void setServiceLife(String serviceLife) {
+		this.serviceLife = serviceLife;
+	}
+	
+	public String getPurpose() {
+		return purpose;
+	}
+
+	public void setPurpose(String purpose) {
+		this.purpose = purpose;
+	}
+	
+	public String getImages() {
+		return images;
+	}
+
+	public void setImages(String images) {
+		this.images = images;
+	}
+	
+	public String getLargeImages() {
+		return largeImages;
+	}
+
+	public void setLargeImages(String largeImages) {
+		this.largeImages = largeImages;
+	}
+
+	public String getParameter() {
+		return parameter;
+	}
+
+	public void setParameter(String parameter) {
+		this.parameter = parameter;
+	}
+	
+	public String getParameterImages() {
+		return parameterImages;
+	}
+
+	public void setParameterImages(String parameterImages) {
+		this.parameterImages = parameterImages;
+	}
+	
+	public String getParameterLargeImages() {
+		return parameterLargeImages;
+	}
+
+	public void setParameterLargeImages(String parameterLargeImages) {
+		this.parameterLargeImages = parameterLargeImages;
+	}
+
+	public String getShowAgent() {
+		return showAgent;
+	}
+
+	public void setShowAgent(String showAgent) {
+		this.showAgent = showAgent;
+	}
+
+	public String getShowPurchaser() {
+		return showPurchaser;
+	}
+
+	public void setShowPurchaser(String showPurchaser) {
+		this.showPurchaser = showPurchaser;
+	}
+
+	@Length(min=0, max=1, message="状态 0停用 1启用长度必须介于 0 和 1 之间")
+	public String getEnabledStatus() {
+		return enabledStatus;
+	}
+
+	public void setEnabledStatus(String enabledStatus) {
+		this.enabledStatus = enabledStatus;
+	}
+	
+	@Length(min=0, max=9, message="扫码人数长度必须介于 0 和 9 之间")
+	public String getScanNum() {
+		return scanNum;
+	}
+
+	public void setScanNum(String scanNum) {
+		this.scanNum = scanNum;
+	}
+	
+	@Length(min=0, max=9, message="查看商品人数长度必须介于 0 和 9 之间")
+	public String getQueryNum() {
+		return queryNum;
+	}
+
+	public void setQueryNum(String queryNum) {
+		this.queryNum = queryNum;
+	}
+	
+	@Length(min=0, max=8, message="标识码:8位随机不重复长度必须介于 0 和 8 之间")
+	public String getIdentificationCode() {
+		return identificationCode;
+	}
+
+	public void setIdentificationCode(String identificationCode) {
+		this.identificationCode = identificationCode;
+	}
+	
+}

+ 137 - 0
src/main/java/com/caimei/modules/brand/entity/BrandProducts.java

@@ -0,0 +1,137 @@
+package com.caimei.modules.brand.entity;
+
+import org.hibernate.validator.constraints.Length;
+
+import com.thinkgem.jeesite.common.persistence.DataEntity;
+
+/**
+ * 商品管理Entity
+ * @author LG
+ * @version 2016-08-24
+ */
+public class BrandProducts extends DataEntity<BrandProducts> {
+	
+	private static final long serialVersionUID = 1L;
+	private String name;		// 名称
+	private String sn;		// 商品SN码
+	private String images;		// 商品图片,多个图片用 | 隔开
+	private String largeImages;		// 商品图片大图,多个以|隔开
+	private String parameter;		// 产品参数
+	private String parameterImages;		// 参数图片,多个图片用 | 隔开
+	private String parameterLargeImages;		// 参数大图片,多个图片用 | 隔开
+	private String purchase;		// 购买公司
+	private Integer scanNum;		// 扫码人数
+	private Integer queryNum;		// 查看商品人数
+	private String identificationCode;		// 标识码:8位随机不重复
+	private String enabledStatus;		// 启用/禁用状态
+	
+	public BrandProducts() {
+		super();
+	}
+
+	public BrandProducts(String id){
+		super(id);
+	}
+
+	@Length(min=0, max=100, message="名称长度必须介于 0 和 100 之间")
+	public String getName() {
+		return name;
+	}
+
+	public void setName(String name) {
+		this.name = name;
+	}
+	
+	@Length(min=0, max=100, message="商品SN码长度必须介于 0 和 100 之间")
+	public String getSn() {
+		return sn;
+	}
+
+	public void setSn(String sn) {
+		this.sn = sn;
+	}
+	
+	public String getImages() {
+		return images;
+	}
+
+	public void setImages(String images) {
+		this.images = images;
+	}
+	
+	public String getLargeImages() {
+		return largeImages;
+	}
+
+	public void setLargeImages(String largeImages) {
+		this.largeImages = largeImages;
+	}
+	
+	public String getParameter() {
+		return parameter;
+	}
+
+	public void setParameter(String parameter) {
+		this.parameter = parameter;
+	}
+	
+	public String getParameterImages() {
+		return parameterImages;
+	}
+
+	public void setParameterImages(String parameterImages) {
+		this.parameterImages = parameterImages;
+	}
+	
+	public String getParameterLargeImages() {
+		return parameterLargeImages;
+	}
+
+	public void setParameterLargeImages(String parameterLargeImages) {
+		this.parameterLargeImages = parameterLargeImages;
+	}
+	
+	@Length(min=0, max=100, message="购买公司长度必须介于 0 和 100 之间")
+	public String getPurchase() {
+		return purchase;
+	}
+
+	public void setPurchase(String purchase) {
+		this.purchase = purchase;
+	}
+	
+	public Integer getScanNum() {
+		return scanNum;
+	}
+
+	public void setScanNum(Integer scanNum) {
+		this.scanNum = scanNum;
+	}
+	
+	public Integer getQueryNum() {
+		return queryNum;
+	}
+
+	public void setQueryNum(Integer queryNum) {
+		this.queryNum = queryNum;
+	}
+	
+	@Length(min=0, max=8, message="标识码:8位随机不重复长度必须介于 0 和 8 之间")
+	public String getIdentificationCode() {
+		return identificationCode;
+	}
+
+	public void setIdentificationCode(String identificationCode) {
+		this.identificationCode = identificationCode;
+	}
+	
+	@Length(min=0, max=1, message="启用/禁用状态长度必须介于 0 和 1 之间")
+	public String getEnabledStatus() {
+		return enabledStatus;
+	}
+
+	public void setEnabledStatus(String enabledStatus) {
+		this.enabledStatus = enabledStatus;
+	}
+	
+}

+ 103 - 0
src/main/java/com/caimei/modules/brand/entity/BrandPurchaser.java

@@ -0,0 +1,103 @@
+package com.caimei.modules.brand.entity;
+
+import java.util.Date;
+
+import org.hibernate.validator.constraints.Length;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.thinkgem.jeesite.common.persistence.DataEntity;
+
+/**
+ * 品牌联盟购买者Entity
+ * @author LG
+ * @version 2016-05-13
+ */
+public class BrandPurchaser extends DataEntity<BrandPurchaser> {
+	
+	private static final long serialVersionUID = 1L;
+	private String name;		// 购买者名称
+	private Date purchaseDate;		// 购买日期
+	private String intro;		// 简介
+	private String publictyMaterialImages;		// 宣传资料图片
+	private String largeImages;		// 宣传资料大图片
+	private String enabledStatus;		// 状态 0停用 1启用
+	
+	private Integer productTypeCount; // 商品种类
+	private Integer productTotalCount; // 商品总数
+	
+	public BrandPurchaser() {
+		super();
+	}
+
+	public BrandPurchaser(String id){
+		super(id);
+	}
+
+	@Length(min=0, max=100, message="购买者名称长度必须介于 0 和 100 之间")
+	public String getName() {
+		return name;
+	}
+
+	public void setName(String name) {
+		this.name = name;
+	}
+	
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+	public Date getPurchaseDate() {
+		return purchaseDate;
+	}
+
+	public void setPurchaseDate(Date purchaseDate) {
+		this.purchaseDate = purchaseDate;
+	}
+	
+	public String getIntro() {
+		return intro;
+	}
+
+	public void setIntro(String intro) {
+		this.intro = intro;
+	}
+	
+	public String getPublictyMaterialImages() {
+		return publictyMaterialImages;
+	}
+
+	public void setPublictyMaterialImages(String publictyMaterialImages) {
+		this.publictyMaterialImages = publictyMaterialImages;
+	}
+
+	public String getLargeImages() {
+		return largeImages;
+	}
+
+	public void setLargeImages(String largeImages) {
+		this.largeImages = largeImages;
+	}
+
+	@Length(min=0, max=1, message="状态 0停用 1启用长度必须介于 0 和 1 之间")
+	public String getEnabledStatus() {
+		return enabledStatus;
+	}
+
+	public void setEnabledStatus(String enabledStatus) {
+		this.enabledStatus = enabledStatus;
+	}
+
+	public Integer getProductTypeCount() {
+		return productTypeCount;
+	}
+
+	public void setProductTypeCount(Integer productTypeCount) {
+		this.productTypeCount = productTypeCount;
+	}
+
+	public Integer getProductTotalCount() {
+		return productTotalCount;
+	}
+
+	public void setProductTotalCount(Integer productTotalCount) {
+		this.productTotalCount = productTotalCount;
+	}
+	
+}

+ 159 - 0
src/main/java/com/caimei/modules/brand/entity/BrandSupplier.java

@@ -0,0 +1,159 @@
+package com.caimei.modules.brand.entity;
+
+import org.hibernate.validator.constraints.Length;
+
+import com.thinkgem.jeesite.common.persistence.DataEntity;
+
+/**
+ * 品牌供应商Entity
+ * @author LG
+ * @version 2016-05-13
+ */
+public class BrandSupplier extends DataEntity<BrandSupplier> {
+	
+	private static final long serialVersionUID = 1L;
+	private Long shopID;		// 网站供应商id
+	private String LOGO;		// 供应商LOGO
+	private String name;		// 供应商名称
+	private String businessLicense;		// 营业执照注册号
+	private String businessAddress;		// 公司注册地址
+	private String businessPhone;		// 公司电话
+	private String legalRepresentaive;		// 公司法人
+	private String registeredCapital;		// 注册资本
+	private String enterpriseType;		// 公司类型
+	private String businessScope;		// 经营范围
+	private String enabledStatus;		// 状态 0停用 1启用
+	
+	private String shopName; // 绑定的供应商名称
+	private Integer productTypeCount; // 商品种类
+	private Integer productTotalCount; // 商品总数
+	
+	public BrandSupplier() {
+		super();
+	}
+
+	public BrandSupplier(String id){
+		super(id);
+	}
+
+	public Long getShopID() {
+		return shopID;
+	}
+
+	public void setShopID(Long shopID) {
+		this.shopID = shopID;
+	}
+	
+	@Length(min=0, max=100, message="供应商LOGO长度必须介于 0 和 100 之间")
+	public String getLOGO() {
+		return LOGO;
+	}
+
+	public void setLOGO(String LOGO) {
+		this.LOGO = LOGO;
+	}
+	
+	@Length(min=0, max=100, message="供应商名称长度必须介于 0 和 100 之间")
+	public String getName() {
+		return name;
+	}
+
+	public void setName(String name) {
+		this.name = name;
+	}
+	
+	@Length(min=0, max=100, message="营业执照注册号长度必须介于 0 和 100 之间")
+	public String getBusinessLicense() {
+		return businessLicense;
+	}
+
+	public void setBusinessLicense(String businessLicense) {
+		this.businessLicense = businessLicense;
+	}
+	
+	@Length(min=0, max=200, message="公司注册地址长度必须介于 0 和 200 之间")
+	public String getBusinessAddress() {
+		return businessAddress;
+	}
+
+	public void setBusinessAddress(String businessAddress) {
+		this.businessAddress = businessAddress;
+	}
+	
+	@Length(min=0, max=20, message="公司电话长度必须介于 0 和 20 之间")
+	public String getBusinessPhone() {
+		return businessPhone;
+	}
+
+	public void setBusinessPhone(String businessPhone) {
+		this.businessPhone = businessPhone;
+	}
+	
+	@Length(min=0, max=20, message="公司法人长度必须介于 0 和 20 之间")
+	public String getLegalRepresentaive() {
+		return legalRepresentaive;
+	}
+
+	public void setLegalRepresentaive(String legalRepresentaive) {
+		this.legalRepresentaive = legalRepresentaive;
+	}
+	
+	public String getRegisteredCapital() {
+		return registeredCapital;
+	}
+
+	public void setRegisteredCapital(String registeredCapital) {
+		this.registeredCapital = registeredCapital;
+	}
+	
+	@Length(min=0, max=1, message="公司类型长度必须介于 0 和 1 之间")
+	public String getEnterpriseType() {
+		return enterpriseType;
+	}
+
+	public void setEnterpriseType(String enterpriseType) {
+		this.enterpriseType = enterpriseType;
+	}
+	
+	public String getBusinessScope() {
+		return businessScope;
+	}
+
+	public void setBusinessScope(String businessScope) {
+		this.businessScope = businessScope;
+	}
+	
+	@Length(min=0, max=1, message="状态 0停用 1启用长度必须介于 0 和 1 之间")
+	public String getEnabledStatus() {
+		return enabledStatus;
+	}
+
+	public void setEnabledStatus(String enabledStatus) {
+		this.enabledStatus = enabledStatus;
+	}
+
+	public String getShopName() {
+		return shopName;
+	}
+
+	public void setShopName(String shopName) {
+		this.shopName = shopName;
+	}
+
+	public Integer getProductTypeCount() {
+		return productTypeCount;
+	}
+
+	public void setProductTypeCount(Integer productTypeCount) {
+		this.productTypeCount = productTypeCount;
+	}
+
+	public Integer getProductTotalCount() {
+		return productTotalCount;
+	}
+
+	public void setProductTotalCount(Integer productTotalCount) {
+		this.productTotalCount = productTotalCount;
+	}
+	
+}

+ 142 - 0
src/main/java/com/caimei/modules/brand/entity/CmBrand.java

@@ -0,0 +1,142 @@
+package com.caimei.modules.brand.entity;
+
+import org.hibernate.validator.constraints.Length;
+
+import com.thinkgem.jeesite.common.persistence.DataEntity;
+
+import java.beans.Transient;
+
+/**
+ * 采美品牌Entity
+ * @author Lijun
+ * @version 2019-04-19
+ */
+public class CmBrand extends DataEntity<CmBrand> {
+	
+	private static final long serialVersionUID = 1L;
+	private String name;		// 品牌名字
+	private String source;		// 添加来源 0:后台添加 ,1:供应商添加
+	private String userID;		// 添加用户ID,后台则为后台用户ID,供应商则为供应商用户ID
+	private String status;		// 品牌状态 0:待审核,1:审核通过,2:审核失败
+	private String auditNote;		// 审核备注
+	private String auditStatus;		// 审核备注
+	private String sort;		// 排序
+	private String logo;		//品牌logo
+	private String description;
+
+	private String shopName;//供应商名称
+	private String shopMobile;//供应商手机号
+
+	private String descriptionFlag;// 品牌描述有无标记  1有   0无
+	
+	public CmBrand() {
+		super();
+	}
+
+	public CmBrand(String id){
+		super(id);
+	}
+
+	@Length(min=0, max=50, message="品牌名字长度必须介于 0 和 50 之间")
+	public String getName() {
+		return name;
+	}
+
+	public void setName(String name) {
+		this.name = name;
+	}
+	
+	@Length(min=0, max=1, message="添加来源 0:后台添加 ,1:供应商添加长度必须介于 0 和 1 之间")
+	public String getSource() {
+		return source;
+	}
+
+	public void setSource(String source) {
+		this.source = source;
+	}
+	
+	@Length(min=0, max=11, message="添加用户ID,后台则为后台用户ID,供应商则为供应商用户ID长度必须介于 0 和 11 之间")
+	public String getUserID() {
+		return userID;
+	}
+
+	public void setUserID(String userID) {
+		this.userID = userID;
+	}
+	
+	@Length(min=0, max=1, message="品牌状态 0:待审核,1:审核通过,2:审核失败长度必须介于 0 和 1 之间")
+	public String getStatus() {
+		return status;
+	}
+
+	public void setStatus(String status) {
+		this.status = status;
+	}
+	
+	@Length(min=0, max=50, message="审核备注长度必须介于 0 和 50 之间")
+	public String getAuditNote() {
+		return auditNote;
+	}
+
+	public void setAuditNote(String auditNote) {
+		this.auditNote = auditNote;
+	}
+	
+	@Length(min=0, max=11, message="排序长度必须介于 0 和 11 之间")
+	public String getSort() {
+		return sort;
+	}
+
+	public void setSort(String sort) {
+		this.sort = sort;
+	}
+
+	public String getShopName() {
+		return shopName;
+	}
+
+	public void setShopName(String shopName) {
+		this.shopName = shopName;
+	}
+
+	public String getShopMobile() {
+		return shopMobile;
+	}
+
+	public void setShopMobile(String shopMobile) {
+		this.shopMobile = shopMobile;
+	}
+
+	public String getAuditStatus() {
+		return auditStatus;
+	}
+
+	public void setAuditStatus(String auditStatus) {
+		this.auditStatus = auditStatus;
+	}
+
+	public String getLogo() {
+		return logo;
+	}
+
+	public void setLogo(String logo) {
+		this.logo = logo;
+	}
+
+	public String getDescription() {
+		return description;
+	}
+
+	public void setDescription(String description) {
+		this.description = description;
+	}
+
+	@Transient
+	public String getDescriptionFlag() {
+		return descriptionFlag;
+	}
+
+	public void setDescriptionFlag(String descriptionFlag) {
+		this.descriptionFlag = descriptionFlag;
+	}
+}

+ 41 - 0
src/main/java/com/caimei/modules/brand/model/ProductModel.java

@@ -0,0 +1,41 @@
+package com.caimei.modules.brand.model;
+
+import com.thinkgem.jeesite.common.persistence.DataEntity;
+
+
+public class ProductModel extends DataEntity<ProductModel> {
+	
+	private static final long serialVersionUID = 1L;
+	
+	private Long productID;
+	private String productName;
+	private Long shopID;
+	private String shopName;
+	public Long getProductID() {
+		return productID;
+	}
+	public void setProductID(Long productID) {
+		this.productID = productID;
+	}
+	public String getProductName() {
+		return productName;
+	}
+	public void setProductName(String productName) {
+		this.productName = productName;
+	}
+	public Long getShopID() {
+		return shopID;
+	}
+	public void setShopID(Long shopID) {
+		this.shopID = shopID;
+	}
+	public String getShopName() {
+		return shopName;
+	}
+	public void setShopName(String shopName) {
+		this.shopName = shopName;
+	}
+	
+	
+
+}

+ 40 - 0
src/main/java/com/caimei/modules/brand/model/ShopModel.java

@@ -0,0 +1,40 @@
+package com.caimei.modules.brand.model;
+
+import com.thinkgem.jeesite.common.persistence.DataEntity;
+
+public class ShopModel extends DataEntity<ShopModel> {
+
+	private static final long serialVersionUID = 1L;
+
+	private Integer shopID;
+	private String shopName;
+	private String logo;
+	private String ledgerNo;
+	
+	public Integer getShopID() {
+		return shopID;
+	}
+	public void setShopID(Integer shopID) {
+		this.shopID = shopID;
+	}
+	public String getShopName() {
+		return shopName;
+	}
+	public void setShopName(String shopName) {
+		this.shopName = shopName;
+	}
+	public String getLogo() {
+		return logo;
+	}
+	public void setLogo(String logo) {
+		this.logo = logo;
+	}
+
+	public String getLedgerNo() {
+		return ledgerNo;
+	}
+
+	public void setLedgerNo(String ledgerNo) {
+		this.ledgerNo = ledgerNo;
+	}
+}

+ 58 - 0
src/main/java/com/caimei/modules/brand/service/BrandAgentService.java

@@ -0,0 +1,58 @@
+package com.caimei.modules.brand.service;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import com.caimei.modules.brand.dao.BrandAgentDao;
+import com.caimei.modules.brand.entity.BrandAgent;
+import com.thinkgem.jeesite.common.persistence.Page;
+import com.thinkgem.jeesite.common.service.CrudService;
+
+/**
+ * 品牌联盟代理商Service
+ * @author LG
+ * @version 2016-05-13
+ */
+@Service
+@Transactional(readOnly = true)
+public class BrandAgentService extends CrudService<BrandAgentDao, BrandAgent> {
+
+	@Autowired
+	private BrandAgentDao brandAgentDao;
+	
+	public BrandAgent get(String id) {
+		return super.get(id);
+	}
+	
+	public List<BrandAgent> findList(BrandAgent brandAgent) {
+		return super.findList(brandAgent);
+	}
+	
+	public Page<BrandAgent> findPage(Page<BrandAgent> page, BrandAgent brandAgent) {
+		return super.findPage(page, brandAgent);
+	}
+	
+	@Transactional(readOnly = false)
+	public void save(BrandAgent brandAgent) {
+		super.save(brandAgent);
+	}
+	
+	@Transactional(readOnly = false)
+	public void delete(BrandAgent brandAgent) {
+		super.delete(brandAgent);
+	}
+	
+	@Transactional(readOnly = false)
+	public void changeStatus(BrandAgent brandAgent) {
+		Map<String, Object> param = new HashMap<String, Object>();
+		param.put("id", brandAgent.getId());
+		param.put("enabledStatus", brandAgent.getEnabledStatus());
+		brandAgentDao.changeStatus(param);
+	}
+	
+}

+ 93 - 0
src/main/java/com/caimei/modules/brand/service/BrandIdentificationCodeService.java

@@ -0,0 +1,93 @@
+package com.caimei.modules.brand.service;
+
+import java.util.Date;
+import java.util.List;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import com.caimei.modules.brand.dao.BrandIdentificationCodeDao;
+import com.caimei.modules.brand.entity.BrandIdentificationCode;
+import com.caimei.utils.RandomStringUtil;
+import com.thinkgem.jeesite.common.persistence.Page;
+import com.thinkgem.jeesite.common.service.CrudService;
+
+/**
+ * 商品标识码Service
+ * @author demon
+ * @version 2016-05-20
+ */
+@Service
+@Transactional(readOnly = true)
+public class BrandIdentificationCodeService extends CrudService<BrandIdentificationCodeDao, BrandIdentificationCode> {
+
+	@Autowired
+	private BrandIdentificationCodeDao brandIdentificationCodeDao;
+	
+	public BrandIdentificationCode get(String id) {
+		return super.get(id);
+	}
+	
+	public List<BrandIdentificationCode> findList(BrandIdentificationCode brandIndentificationCode) {
+		return super.findList(brandIndentificationCode);
+	}
+	
+	public Page<BrandIdentificationCode> findPage(Page<BrandIdentificationCode> page, BrandIdentificationCode brandIndentificationCode) {
+		return super.findPage(page, brandIndentificationCode);
+	}
+	
+	@Transactional(readOnly = false)
+	public void save(BrandIdentificationCode brandIndentificationCode) {
+		super.save(brandIndentificationCode);
+	}
+	
+	@Transactional(readOnly = false)
+	public void delete(BrandIdentificationCode brandIndentificationCode) {
+		super.delete(brandIndentificationCode);
+	}
+	
+	/**
+	 * <p>Description: 获取一个未使用的标识码</p>
+	 * <p>Company: caimei365</p> 
+	 * @author dmeng
+	 * @date 2016年5月20日 下午2:12:23
+	 * @return 如果已用完会重新插入一个并返回
+	 */
+	@Transactional(readOnly = false)
+	public BrandIdentificationCode getOne() {
+		BrandIdentificationCode idCode = brandIdentificationCodeDao.getIdentificationCode();
+		if(idCode == null) {
+			idCode = new BrandIdentificationCode();
+			idCode.setIdentificationCode(RandomStringUtil.getRandomString());
+			idCode.setCreateTime(new Date());
+			brandIdentificationCodeDao.insert(idCode);
+		}
+		return idCode;
+	}
+	
+	/**
+	 * <p>Description: 生成标识码</p>
+	 * <p>Company: caimei365</p> 
+	 * @author dmeng
+	 * @date 2016年5月20日 下午3:42:18
+	 * @param genCount 生成数量
+	 */
+	@Transactional(readOnly = false)
+	public void generate(Integer genCount) {
+		if(genCount != null && genCount > 0) {
+			for(int i=0; i<genCount; i++) {
+				BrandIdentificationCode idCode = new BrandIdentificationCode();
+				idCode.setIdentificationCode(RandomStringUtil.getRandomString());
+				idCode.setCreateTime(new Date());
+				brandIdentificationCodeDao.insert(idCode);
+			}
+		}
+	}
+	
+	@Transactional(readOnly = false)
+	public Long getUnusedNum() {
+		return this.brandIdentificationCodeDao.getUnusedNum();
+	}
+	
+}

+ 264 - 0
src/main/java/com/caimei/modules/brand/service/BrandProductService.java

@@ -0,0 +1,264 @@
+package com.caimei.modules.brand.service;
+
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Random;
+
+import javax.servlet.http.HttpServletRequest;
+
+import com.caimei.modules.sys.utils.UploadImageUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import com.caimei.dfs.image.beens.ImageUploadInfo;
+import com.caimei.modules.brand.dao.BrandAgentDao;
+import com.caimei.modules.brand.dao.BrandIdentificationCodeDao;
+import com.caimei.modules.brand.dao.BrandProductDao;
+import com.caimei.modules.brand.dao.BrandPurchaserDao;
+import com.caimei.modules.brand.dao.BrandSupplierDao;
+import com.caimei.modules.brand.entity.BrandAgent;
+import com.caimei.modules.brand.entity.BrandIdentificationCode;
+import com.caimei.modules.brand.entity.BrandProduct;
+import com.caimei.modules.brand.entity.BrandPurchaser;
+import com.caimei.modules.brand.entity.BrandSupplier;
+import com.caimei.modules.brand.utils.ImagePathUtils;
+import com.caimei.utils.DateUtils;
+import com.caimei.utils.Encodes;
+import com.caimei.utils.RandomStringUtil;
+import com.caimei.utils.StringUtils;
+import com.google.common.collect.Lists;
+import com.thinkgem.jeesite.common.config.Global;
+import com.thinkgem.jeesite.common.persistence.Page;
+import com.thinkgem.jeesite.common.service.CrudService;
+import com.thinkgem.jeesite.common.utils.FileUtils;
+
+/**
+ * 品牌联盟商品Service
+ * @author LG
+ * @version 2016-05-13
+ */
+@Service
+@Transactional(readOnly = true)
+public class BrandProductService extends CrudService<BrandProductDao, BrandProduct> {
+
+	Object obj = new Object();
+	
+	@Autowired
+	private BrandAgentDao brandAgentDao;
+	
+	@Autowired
+	private BrandPurchaserDao brandPurchaserDao;
+	
+	@Autowired
+	private BrandSupplierDao brandSupplierDao;
+	
+	@Autowired
+	private BrandProductDao brandProductDao;
+	@Autowired
+	private BrandIdentificationCodeDao brandIdentificationCodeDao;
+	
+	public BrandProduct get(String id) {
+		BrandProduct brandProduct = super.get(id);
+		
+		if(null!=brandProduct.getBrandAgent()&&StringUtils.isNotBlank(brandProduct.getBrandAgent().getId()))
+		brandProduct.setBrandAgent(brandAgentDao.get(brandProduct.getBrandAgent().getId()));
+		
+		if(null!=brandProduct.getBrandPurchaser()&&StringUtils.isNotBlank(brandProduct.getBrandPurchaser().getId()))
+		brandProduct.setBrandPurchaser(brandPurchaserDao.get(brandProduct.getBrandPurchaser().getId()));
+		
+		if(null!=brandProduct.getBrandSupplier()&&StringUtils.isNotBlank(brandProduct.getBrandSupplier().getId()))
+		brandProduct.setBrandSupplier(brandSupplierDao.get(brandProduct.getBrandSupplier().getId()));
+		
+		return brandProduct;
+	}
+	
+	public List<BrandProduct> findList(BrandProduct brandProduct) {
+		return super.findList(brandProduct);
+	}
+	
+	public Page<BrandProduct> findPage(Page<BrandProduct> page, BrandProduct brandProduct) {
+		return super.findPage(page, brandProduct);
+	}
+	
+	@Transactional(readOnly = false)
+	public String save(BrandProduct brandProduct, HttpServletRequest request){
+		String message="";
+		//供应商
+		BrandSupplier brandSupplier = brandProduct.getBrandSupplier();
+		if(StringUtils.isBlank(brandSupplier.getId())){
+			//LOGO
+			String LOGO=brandSupplier.getLOGO();
+			if(StringUtils.isNotBlank(LOGO)){
+				LOGO=Encodes.urlDecode(LOGO);
+//				String realPath = request.getSession().getServletContext().getRealPath(LOGO);
+                String realPath = UploadImageUtils.getAbsolutePath(LOGO);
+//				realPath=Encodes.urlDecode(realPath);
+				int pointerIndex = realPath.lastIndexOf(".");
+				ImageUploadInfo saveImageSerivce=new ImageUploadInfo();
+				String photoServer = Global.getConfig("photoServer");
+				try {
+					saveImageSerivce = ImagePathUtils.saveImageSerivce(realPath, pointerIndex,realPath);
+					brandSupplier.setLOGO(photoServer+saveImageSerivce.getSource());
+				} catch (Exception e) {
+					logger.error("LOGO图片上传错误:"+e.toString(),e);
+					message+="LOGO图片上传错误.";
+				}
+			}
+			brandSupplier.preInsert();
+			brandSupplierDao.insert(brandSupplier);
+		}
+		
+		String message1 = saveAgentAndProduct(brandProduct, request);
+		return message+message1;
+	}
+	
+	@Transactional(readOnly = false)
+	public void sameProductSave(BrandProduct brandProduct, HttpServletRequest request) {
+		saveAgentAndProduct(brandProduct, request);
+	}
+
+	private String saveAgentAndProduct(BrandProduct brandProduct, HttpServletRequest request){
+		String message="";
+		//代理商
+		BrandAgent brandAgent = brandProduct.getBrandAgent();
+		if(null!=brandAgent && StringUtils.isBlank(brandAgent.getId())){
+			if(StringUtils.isNotBlank(brandAgent.getName())){
+				brandAgent.preInsert();
+				brandAgentDao.insert(brandAgent);
+			}else{
+				brandProduct.setBrandAgent(new BrandAgent());
+			}
+		}
+
+		//购买者
+		BrandPurchaser brandPurchaser = brandProduct.getBrandPurchaser();
+		if(null!=brandPurchaser && StringUtils.isBlank(brandPurchaser.getId())){
+			//宣传资料
+			// 1000x1000 水印蒙板
+			String maskTemplates = FileUtils.class.getClassLoader().getResource("templates/images/1000_1000.png").getPath();
+			String[] iamgeArray = StringUtils.split(brandPurchaser.getPublictyMaterialImages(),"|");
+			List<String> imagesList=Lists.newArrayList();
+			List<String> largeImageList=Lists.newArrayList();
+			if(StringUtils.isNotBlank(brandPurchaser.getPublictyMaterialImages())){
+				try {
+					ImagePathUtils.getImagesPath(request, maskTemplates, iamgeArray, imagesList, largeImageList);
+					brandPurchaser.setPublictyMaterialImages(StringUtils.join(imagesList, "|"));
+					brandPurchaser.setLargeImages(StringUtils.join(largeImageList, "|"));
+				} catch (Exception e) {
+					logger.error("购买者图片上传错误:"+e.toString(),e);
+					message+="购买者 宣传资料图片上传失败.";
+				}
+			}
+			if(StringUtils.isNotBlank(brandPurchaser.getName())){
+				brandPurchaser.preInsert();
+				brandPurchaserDao.insert(brandPurchaser);
+			}else{
+				brandProduct.setBrandPurchaser(new BrandPurchaser());
+			}
+		}
+		//档案编号
+		if(StringUtils.isBlank(brandProduct.getFileNumber())){
+			brandProduct.setFileNumber(createNo(DateUtils.formatDate(brandProduct.getLicenseStartDate(),"yyyyMMdd")));
+		}
+		
+		//商品图片
+		// 1000x1000 水印蒙板
+		String maskTemplates = FileUtils.class.getClassLoader().getResource("templates/images/1000_1000.png").getPath();
+		String[] iamgeArray = StringUtils.split(brandProduct.getImages(),"|");
+		List<String> imagesList=Lists.newArrayList();
+		List<String> largeImageList=Lists.newArrayList();
+		if(StringUtils.isNotBlank(brandProduct.getImages())) {
+			try {
+				ImagePathUtils.getImagesPath(request, maskTemplates, iamgeArray, imagesList, largeImageList);
+				brandProduct.setImages(StringUtils.join(imagesList, "|"));
+				brandProduct.setLargeImages(StringUtils.join(largeImageList, "|"));
+			} catch (Exception e) {
+				logger.error("商品图片上传错误:"+e.toString(),e);
+				message+="商品图片上传失败.";
+			}
+		}
+		//参数图片
+		// 1000_562 水印蒙板
+		maskTemplates = FileUtils.class.getClassLoader().getResource("templates/images/1000_562.png").getPath();
+		iamgeArray = StringUtils.split(brandProduct.getParameterImages(),"|");
+		imagesList=Lists.newArrayList();
+		largeImageList=Lists.newArrayList();
+		if(StringUtils.isNotBlank(brandProduct.getParameterImages())){
+			try {
+				ImagePathUtils.getImagesPath(request, maskTemplates, iamgeArray, imagesList, largeImageList);
+				brandProduct.setParameterImages(StringUtils.join(imagesList, "|"));
+				brandProduct.setParameterLargeImages(StringUtils.join(largeImageList, "|"));
+			} catch (Exception e) {
+				logger.error("参数图片上传错误:"+e.toString(),e);
+				message+="参数图片上传失败.";
+			}
+		}
+		synchronized(obj) {
+			//标识码
+			BrandIdentificationCode idCode = null;
+			boolean useCode = false;
+			if(StringUtils.isBlank(brandProduct.getId())){
+				idCode = brandIdentificationCodeDao.getIdentificationCode();
+				if(idCode == null) {
+					idCode = new BrandIdentificationCode();
+					idCode.setIdentificationCode(RandomStringUtil.getRandomString());
+					idCode.setCreateTime(new Date());
+					brandIdentificationCodeDao.insert(idCode);
+				}
+				brandProduct.setIdentificationCode(idCode.getIdentificationCode());
+				useCode = true;
+			}
+		
+			super.save(brandProduct);
+			
+			if(useCode){
+				// 标识码置为已使用
+				BrandIdentificationCode code = new BrandIdentificationCode();
+				code.setId(idCode.getId());
+				code.setBrandProductID(Integer.parseInt(brandProduct.getId()));
+				brandIdentificationCodeDao.useCode(code);
+			}
+		}
+		return message;
+	}
+	
+	@Transactional(readOnly = false)
+	public void delete(BrandProduct brandProduct) {
+		super.delete(brandProduct);
+	}
+	
+	/*
+	 * 生成档案编号
+	 */
+	private String createNo(String date) {
+		Random random = new Random();
+		String[] abcDic = {"A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","X"};
+		String no = "";
+		for(int i = 0; i < 2; i++) {
+			int ran = random.nextInt(abcDic.length);
+			no += abcDic[ran];
+		}
+		no += date;
+		no += System.currentTimeMillis();
+		no += random.nextInt(10);
+		return no;
+	}
+	
+
+	@Transactional(readOnly = false)
+	public void changeStatus(BrandProduct brandProduct) {
+		Map<String, Object> param = new HashMap<String, Object>();
+		param.put("id", brandProduct.getId());
+		param.put("enabledStatus", brandProduct.getEnabledStatus());
+		brandProductDao.changeStatus(param);
+	}
+	
+	@Transactional(readOnly = false)
+	public void updateEnabledStatusByIds(String enabledStatus, String[] ids) {
+		brandProductDao.updateEnabledStatusByIds(enabledStatus,ids);
+	}
+	
+}

+ 179 - 0
src/main/java/com/caimei/modules/brand/service/BrandProductsService.java

@@ -0,0 +1,179 @@
+package com.caimei.modules.brand.service;
+
+import java.util.Date;
+import java.util.List;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.apache.commons.collections.CollectionUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import com.caimei.modules.brand.dao.BrandIdentificationCodeDao;
+import com.caimei.modules.brand.dao.BrandProductsDao;
+import com.caimei.modules.brand.entity.BrandIdentificationCode;
+import com.caimei.modules.brand.entity.BrandProducts;
+import com.caimei.modules.brand.utils.ImagePathUtils;
+import com.caimei.utils.RandomStringUtil;
+import com.caimei.utils.StringUtils;
+import com.google.common.collect.Lists;
+import com.thinkgem.jeesite.common.persistence.Page;
+import com.thinkgem.jeesite.common.service.CrudService;
+import com.thinkgem.jeesite.common.utils.FileUtils;
+
+/**
+ * 商品管理Service
+ * @author LG
+ * @version 2016-08-24
+ */
+@Service
+@Transactional(readOnly = true)
+public class BrandProductsService extends CrudService<BrandProductsDao, BrandProducts> {
+	
+	@Autowired
+	private BrandProductsDao brandProductsDao;
+
+	@Autowired
+	private BrandIdentificationCodeDao brandIdentificationCodeDao;
+	
+	Object obj = new Object();
+	
+	public BrandProducts get(String id) {
+		return super.get(id);
+	}
+	
+	public List<BrandProducts> findList(BrandProducts brandProducts) {
+		return super.findList(brandProducts);
+	}
+	
+	public Page<BrandProducts> findPage(Page<BrandProducts> page, BrandProducts brandProducts) {
+		return super.findPage(page, brandProducts);
+	}
+	
+	@Transactional(readOnly = false)
+	public void save(BrandProducts brandProducts,HttpServletRequest request) throws Exception {
+		//商品图片
+		// 1000x1000 水印蒙板
+		String maskTemplates = FileUtils.class.getClassLoader().getResource("templates/images/1000_1000.png").getPath();
+		String[] iamgeArray = StringUtils.split(brandProducts.getImages(),"|");
+		List<String> imagesList=Lists.newArrayList();
+		List<String> largeImageList=Lists.newArrayList();
+		if(StringUtils.isNotBlank(brandProducts.getImages())) {
+			try {
+				ImagePathUtils.getImagesPath(request, maskTemplates, iamgeArray, imagesList, largeImageList);
+				brandProducts.setImages(StringUtils.join(imagesList, "|"));
+				brandProducts.setLargeImages(StringUtils.join(largeImageList, "|"));
+			} catch (Exception e) {
+				logger.error("商品图片上传错误:"+e.toString(),e);
+			}
+		}
+		//参数图片
+		// 1000_562 水印蒙板
+		if(StringUtils.isNotBlank(brandProducts.getParameterImages())){
+		maskTemplates = FileUtils.class.getClassLoader().getResource("templates/images/1000_562.png").getPath();
+		iamgeArray = StringUtils.split(brandProducts.getParameterImages(),"|");
+		imagesList=Lists.newArrayList();
+		largeImageList=Lists.newArrayList();
+			try {
+				ImagePathUtils.getImagesPath(request, maskTemplates, iamgeArray, imagesList, largeImageList);
+				brandProducts.setParameterImages(StringUtils.join(imagesList, "|"));
+				brandProducts.setParameterLargeImages(StringUtils.join(largeImageList, "|"));
+			} catch (Exception e) {
+				logger.error("参数图片上传错误:"+e.toString(),e);
+			}
+		}
+		
+		synchronized(obj) {
+			//标识码
+			BrandIdentificationCode idCode = null;
+			boolean useCode = false;
+			if(StringUtils.isBlank(brandProducts.getId())){ //新增商品
+				if(StringUtils.isBlank(brandProducts.getIdentificationCode())){//若没填写商品标志码
+					// 没有填写先不分配标识码
+					/*idCode = brandIdentificationCodeDao.getIdentificationCode();
+					if(idCode == null) {
+						idCode = new BrandIdentificationCode();
+						idCode.setIdentificationCode(RandomStringUtil.getRandomString());
+						idCode.setCreateTime(new Date());
+						brandIdentificationCodeDao.insert(idCode);
+					}
+					brandProducts.setIdentificationCode(idCode.getIdentificationCode());
+					useCode = true;*/
+				}else{
+					/*List<BrandProducts> list = brandProductsDao.findByIdentificationCode(brandProducts.getIdentificationCode());
+					if(CollectionUtils.isEmpty(list)){
+						idCode = new BrandIdentificationCode();
+						idCode.setIdentificationCode(brandProducts.getIdentificationCode());
+						idCode.setCreateTime(new Date());
+						brandIdentificationCodeDao.insert(idCode);
+						useCode = true;
+					}else{
+						throw new Exception("商品标志码已存在!");
+					}*/
+					idCode = brandIdentificationCodeDao.getByCode(brandProducts.getIdentificationCode());
+					if(idCode == null) {
+						throw new Exception("商品标志码不存在!");
+					} else if(idCode.getBrandProductID() != null) {
+						throw new Exception("商品标志码已使用!");
+					}
+					useCode = true;
+				}
+			}else{//修改
+				BrandProducts db = brandProductsDao.get(brandProducts.getId());
+				if(!StringUtils.equals(db.getIdentificationCode(), brandProducts.getIdentificationCode())){
+					/*******置空以前的IdentificationCode商品ID***********/
+					idCode = new BrandIdentificationCode();
+					idCode.setIdentificationCode(db.getIdentificationCode());
+					List<BrandIdentificationCode> findList = brandIdentificationCodeDao.findList(idCode);
+					idCode=findList.get(0);
+					brandIdentificationCodeDao.delete(idCode);
+					/******************/
+					/*List<BrandProducts> list = brandProductsDao.findByIdentificationCode(brandProducts.getIdentificationCode());
+					if(CollectionUtils.isEmpty(list)){
+						idCode = new BrandIdentificationCode();
+						idCode.setIdentificationCode(brandProducts.getIdentificationCode());
+						idCode.setCreateTime(new Date());
+						brandIdentificationCodeDao.insert(idCode);
+						useCode = true;
+					}else{
+						throw new Exception("商品标志码已存在!");
+					}*/
+					idCode = brandIdentificationCodeDao.getByCode(brandProducts.getIdentificationCode());
+					if(idCode == null) {
+						throw new Exception("商品标志码不存在!");
+					} else if(idCode.getBrandProductID() != null) {
+						throw new Exception("商品标志码已使用!");
+					}
+					useCode = true;
+				}
+			}
+		
+			super.save(brandProducts);
+			
+			if(useCode){
+				// 标识码置为已使用
+				BrandIdentificationCode code = new BrandIdentificationCode();
+				code.setId(idCode.getId());
+				code.setBrandProductID(Integer.parseInt(brandProducts.getId()));
+				brandIdentificationCodeDao.useCode(code);
+			}
+		}
+		
+		//super.save(brandProducts);
+	}
+	
+	@Transactional(readOnly = false)
+	public void delete(BrandProducts brandProducts) {
+		super.delete(brandProducts);
+	}
+
+	public List<BrandProducts> findBySn(String sn) {
+		return brandProductsDao.findBySn(sn);
+	}
+
+	public List<BrandProducts> findByIdentificationCode(String identificationCode) {
+		return brandProductsDao.findByIdentificationCode(identificationCode);
+	}
+	
+}

+ 78 - 0
src/main/java/com/caimei/modules/brand/service/BrandPurchaserService.java

@@ -0,0 +1,78 @@
+package com.caimei.modules.brand.service;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import com.caimei.modules.brand.dao.BrandPurchaserDao;
+import com.caimei.modules.brand.entity.BrandPurchaser;
+import com.caimei.modules.brand.utils.ImagePathUtils;
+import com.caimei.utils.StringUtils;
+import com.google.common.collect.Lists;
+import com.thinkgem.jeesite.common.persistence.Page;
+import com.thinkgem.jeesite.common.service.CrudService;
+import com.thinkgem.jeesite.common.utils.FileUtils;
+
+/**
+ * 品牌联盟购买者Service
+ * @author LG
+ * @version 2016-05-13
+ */
+@Service
+@Transactional(readOnly = true)
+public class BrandPurchaserService extends CrudService<BrandPurchaserDao, BrandPurchaser> {
+
+	@Autowired
+	private BrandPurchaserDao brandPurchaserDao;
+	
+	public BrandPurchaser get(String id) {
+		return super.get(id);
+	}
+	
+	public List<BrandPurchaser> findList(BrandPurchaser brandPurchaser) {
+		return super.findList(brandPurchaser);
+	}
+	
+	public Page<BrandPurchaser> findPage(Page<BrandPurchaser> page, BrandPurchaser brandPurchaser) {
+		return super.findPage(page, brandPurchaser);
+	}
+	
+	@Transactional(readOnly = false)
+	public void save(BrandPurchaser brandPurchaser, HttpServletRequest request) {
+		// TODO 判断是否需要打水印 start with http ?
+		// 宣传资料
+		// 1000x1000 水印蒙板
+		String maskTemplates = FileUtils.class.getClassLoader().getResource("templates/images/1000_1000.png").getPath();
+		String[] imageArray = StringUtils.split(brandPurchaser.getPublictyMaterialImages(),"|");
+		List<String> imagesList=Lists.newArrayList();
+		List<String> largeImageList=Lists.newArrayList();
+		if(StringUtils.isNotBlank(brandPurchaser.getPublictyMaterialImages())){
+			ImagePathUtils.getImagesPath(request, maskTemplates, imageArray, imagesList, largeImageList);
+			brandPurchaser.setPublictyMaterialImages(StringUtils.join(imagesList, "|"));
+			brandPurchaser.setLargeImages(StringUtils.join(largeImageList, "|"));
+
+		}
+		
+		super.save(brandPurchaser);
+	}
+	
+	@Transactional(readOnly = false)
+	public void delete(BrandPurchaser brandPurchaser) {
+		super.delete(brandPurchaser);
+	}
+	
+	@Transactional(readOnly = false)
+	public void changeStatus(BrandPurchaser brandPurchaser) {
+		Map<String, Object> param = new HashMap<String, Object>();
+		param.put("id", brandPurchaser.getId());
+		param.put("enabledStatus", brandPurchaser.getEnabledStatus());
+		brandPurchaserDao.changeStatus(param);
+	}
+	
+}

+ 84 - 0
src/main/java/com/caimei/modules/brand/service/BrandSupplierService.java

@@ -0,0 +1,84 @@
+package com.caimei.modules.brand.service;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import com.caimei.modules.brand.dao.BrandProductDao;
+import com.caimei.modules.brand.dao.BrandSupplierDao;
+import com.caimei.modules.brand.entity.BrandSupplier;
+import com.thinkgem.jeesite.common.persistence.Page;
+import com.thinkgem.jeesite.common.service.CrudService;
+import com.thinkgem.jeesite.common.utils.StringUtils;
+
+/**
+ * 品牌供应商Service
+ * @author LG
+ * @version 2016-05-13
+ */
+@Service
+@Transactional(readOnly = true)
+public class BrandSupplierService extends CrudService<BrandSupplierDao, BrandSupplier> {
+
+	@Autowired
+	private BrandSupplierDao brandSupplierDao;
+	
+	@Autowired
+	private BrandProductDao brandProductDao;
+	
+	
+	public BrandSupplier get(String id) {
+		return super.get(id);
+	}
+	
+	public List<BrandSupplier> findList(BrandSupplier brandSupplier) {
+		return super.findList(brandSupplier);
+	}
+	
+	public Page<BrandSupplier> findPage(Page<BrandSupplier> page, BrandSupplier brandSupplier) {
+		return super.findPage(page, brandSupplier);
+	}
+	
+	@Transactional(readOnly = false)
+	public void save(BrandSupplier brandSupplier) {
+		if(StringUtils.isNotBlank(brandSupplier.getId())){
+			Map<String, Object> param = new HashMap<String, Object>();
+			param.put("supplierID", brandSupplier.getId());
+			param.put("enabledStatus", brandSupplier.getEnabledStatus());
+			this.brandProductDao.changeStatus(param );
+		}
+		super.save(brandSupplier);
+	}
+	
+	@Transactional(readOnly = false)
+	public void delete(BrandSupplier brandSupplier) {
+		super.delete(brandSupplier);
+	}
+	
+	@Transactional(readOnly = false)
+	public void changeStatus(BrandSupplier brandSupplier) {
+		// 更新供应商状态
+		Map<String, Object> param = new HashMap<String, Object>();
+		param.put("id", brandSupplier.getId());
+		param.put("enabledStatus", brandSupplier.getEnabledStatus());
+		brandSupplierDao.changeStatus(param);
+		
+		// 关联更新其下所有商品的状态
+		param.clear();
+		param.put("supplierID", brandSupplier.getId());
+		param.put("enabledStatus", brandSupplier.getEnabledStatus());
+		this.brandProductDao.changeStatus(param );
+		
+	}
+	@Transactional(readOnly = false)
+	public void updateEnabledStatusByIds(String enabledStatus, String[] ids) {
+		brandSupplierDao.updateEnabledStatusByIds(enabledStatus,ids);
+	}
+	
+	
+	
+}

+ 55 - 0
src/main/java/com/caimei/modules/brand/service/CmBrandService.java

@@ -0,0 +1,55 @@
+package com.caimei.modules.brand.service;
+
+import java.util.List;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import com.thinkgem.jeesite.common.persistence.Page;
+import com.thinkgem.jeesite.common.service.CrudService;
+import com.caimei.modules.brand.entity.CmBrand;
+import com.caimei.modules.brand.dao.CmBrandDao;
+
+/**
+ * 采美品牌Service
+ * @author Lijun
+ * @version 2019-04-19
+ */
+@Service
+@Transactional(readOnly = true)
+public class CmBrandService extends CrudService<CmBrandDao, CmBrand> {
+
+	@Autowired
+	private CmBrandDao cmBrandDao;
+
+	public CmBrand get(String id) {
+		return super.get(id);
+	}
+	
+	public List<CmBrand> findList(CmBrand cmBrand) {
+		return super.findList(cmBrand);
+	}
+	
+	public Page<CmBrand> findPage(Page<CmBrand> page, CmBrand cmBrand) {
+		return super.findPage(page, cmBrand);
+	}
+	
+	@Transactional(readOnly = false)
+	public void save(CmBrand cmBrand) {
+		super.save(cmBrand);
+	}
+	
+	@Transactional(readOnly = false)
+	public void delete(CmBrand cmBrand) {
+		super.delete(cmBrand);
+	}
+
+	public CmBrand findBradByName(CmBrand cmBrand){
+		return cmBrandDao.findBradByName(cmBrand);
+	}
+
+	public List<CmBrand> getList() {
+		return cmBrandDao.getList();
+	}
+}

+ 15 - 0
src/main/java/com/caimei/modules/brand/service/ProductModelService.java

@@ -0,0 +1,15 @@
+package com.caimei.modules.brand.service;
+
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import com.caimei.modules.brand.dao.ProductModelDao;
+import com.caimei.modules.brand.model.ProductModel;
+import com.thinkgem.jeesite.common.service.CrudService;
+
+
+@Service
+@Transactional(readOnly = true)
+public class ProductModelService extends CrudService<ProductModelDao, ProductModel> {
+
+}

+ 15 - 0
src/main/java/com/caimei/modules/brand/service/ShopModelService.java

@@ -0,0 +1,15 @@
+package com.caimei.modules.brand.service;
+
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import com.caimei.modules.brand.dao.ShopModelDao;
+import com.caimei.modules.brand.model.ShopModel;
+import com.thinkgem.jeesite.common.service.CrudService;
+
+
+@Service
+@Transactional(readOnly = true)
+public class ShopModelService extends CrudService<ShopModelDao, ShopModel> {
+
+}

+ 108 - 0
src/main/java/com/caimei/modules/brand/utils/ImageMarkLogoByIcon.java

@@ -0,0 +1,108 @@
+/**
+ * <p>Description: Copyright © 2014-2015 CAIMEI365.com All Rights Reserved</p>
+ * @author xun.zhang
+ * @date 2016年5月13日 上午9:49:16
+ */
+package com.caimei.modules.brand.utils;
+
+import java.awt.AlphaComposite;
+import java.awt.Graphics2D;
+import java.awt.Image;
+import java.awt.RenderingHints;
+import java.awt.image.BufferedImage;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.OutputStream;
+
+import javax.imageio.ImageIO;
+import javax.swing.ImageIcon;
+  
+/**
+ * 
+ * <p>Title: ImageMarkLogoByIcon</p>
+ * <p>Description: 图片加水印,设置透明度</p>
+ * <p>Company: caimei365</p> 
+ * @author xun.zhang
+ * @date 2016年5月13日 上午9:52:11
+ */
+public class ImageMarkLogoByIcon {   
+  
+    /**  
+     * @param args  
+     */  
+    public static void main(String[] args) {   
+        String srcImgPath = "E:/work/文档/hehe/bg3282.jpg";   
+        String iconPath = "E:/work/文档/hehe/1.png";   
+        String targerPath = "E:/work/文档/hehe/test.jpg" ; 
+         // 给图片添加水印   
+        ImageMarkLogoByIcon.markImageByIcon(iconPath, srcImgPath, targerPath);  
+    }  
+    
+    /**  
+     * 给图片添加水印  
+     * @param iconPath 水印图片路径  
+     * @param srcImgPath 源图片路径  
+     * @param targerPath 目标图片路径  
+     */  
+    public static void markImageByIcon(String iconPath, String srcImgPath,   
+            String targerPath) {   
+        markImageByIcon(iconPath, srcImgPath, targerPath, null) ; 
+    }
+    
+    /**  
+     * 给图片添加水印、可设置水印图片旋转角度  
+     * @param iconPath 水印图片路径  
+     * @param srcImgPath 源图片路径  
+     * @param targerPath 目标图片路径  
+     * @param degree 水印图片旋转角度
+     */  
+    public static void markImageByIcon(String iconPath, String srcImgPath,   
+            String targerPath, Integer degree) {   
+        OutputStream os = null;   
+        try {   
+            Image srcImg = ImageIO.read(new File(srcImgPath)); 
+            BufferedImage buffImg = new BufferedImage(srcImg.getWidth(null),   
+                    srcImg.getHeight(null), BufferedImage.TYPE_INT_RGB); 
+            // 得到画笔对象   
+            // Graphics g= buffImg.getGraphics();   
+            Graphics2D g = buffImg.createGraphics();   
+  
+            // 设置对线段的锯齿状边缘处理   
+            g.setRenderingHint(RenderingHints.KEY_INTERPOLATION,   
+                    RenderingHints.VALUE_INTERPOLATION_BILINEAR);   
+  
+            g.drawImage(srcImg.getScaledInstance(srcImg.getWidth(null), srcImg   
+                    .getHeight(null), Image.SCALE_SMOOTH), 0, 0, null);   
+  
+            if (null != degree) {   
+                // 设置水印旋转   
+                g.rotate(Math.toRadians(degree),   
+                        (double) buffImg.getWidth() / 2, (double) buffImg   
+                                .getHeight() / 2);   
+            }   
+            // 水印图象的路径 水印一般为gif或者png的,这样可设置透明度  
+            ImageIcon imgIcon = new ImageIcon(iconPath);   
+            // 得到Image对象。   
+            Image img = imgIcon.getImage();   
+            float alpha = 0.5f; // 透明度   
+            g.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_ATOP,   
+                    alpha));   
+            // 表示水印图片的位置   
+            g.drawImage(img, 0, 0, null);   
+            g.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER));   
+            g.dispose();   
+            os = new FileOutputStream(targerPath);   
+            // 生成图片   
+            ImageIO.write(buffImg, "JPG", os);   
+        } catch (Exception e) {   
+            e.printStackTrace();   
+        } finally {   
+            try {   
+                if (null != os)   
+                    os.close();   
+            } catch (Exception e) {   
+                e.printStackTrace();   
+            }   
+        }   
+    }   
+}

+ 98 - 0
src/main/java/com/caimei/modules/brand/utils/ImagePathUtils.java

@@ -0,0 +1,98 @@
+package com.caimei.modules.brand.utils;
+
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.InputStream;
+import java.io.UnsupportedEncodingException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+import javax.servlet.http.HttpServletRequest;
+
+import com.caimei.modules.sys.utils.UploadImageUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.caimei.dfs.image.ImageUpload;
+import com.caimei.dfs.image.beens.ImageSize;
+import com.caimei.dfs.image.beens.ImageUploadInfo;
+import com.caimei.utils.Encodes;
+import com.thinkgem.jeesite.common.config.Global;
+import com.thinkgem.jeesite.common.utils.StringUtils;
+
+public class ImagePathUtils {
+	
+	public  final static Logger logger = LoggerFactory.getLogger(ImagePathUtils.class);
+	
+	/**
+	 * 得到图片地址
+	 * @param request
+	 * @param maskTemplates
+	 * @param iamgeArray
+	 * @param imagesList
+	 * @param largeImageList
+	 * @throws UnsupportedEncodingException 
+	 */
+	public static void getImagesPath(HttpServletRequest request, String maskTemplates, String[] iamgeArray,
+			List<String> imagesList, List<String> largeImageList){
+		for (String iamge : iamgeArray) {
+			iamge=Encodes.urlDecode(iamge);
+			if(!iamge.contains("http:") && !iamge.contains("https:")){
+//			String realPath = request.getSession().getServletContext().getRealPath(iamge);
+				String realPath = UploadImageUtils.getAbsolutePath(iamge);
+//			realPath=Encodes.urlDecode(realPath);
+			int pointerIndex = realPath.lastIndexOf(".");
+			String targetPath = realPath.substring(0, pointerIndex)+"_watermask"+realPath.substring(pointerIndex);
+			// 打水印
+			ImageMarkLogoByIcon.markImageByIcon(maskTemplates, realPath, targetPath);
+			
+			// 保存到图片服务器
+			ImageUploadInfo imageUploadInfo = saveImageSerivce(realPath, pointerIndex, targetPath);
+			Map<String, String> slaveMap = imageUploadInfo.getSlaveMap();
+			if(slaveMap == null) {
+				logger.error("[LG]source ===> " + imageUploadInfo.getSource());
+				logger.error("[LG]slaveMap ===> " + imageUploadInfo.getSlaveMap());
+				imageUploadInfo = saveImageSerivce(realPath, pointerIndex, targetPath);
+				slaveMap = imageUploadInfo.getSlaveMap();
+			}
+			String photoServer = Global.getConfig("photoServer");
+			largeImageList.add(photoServer+imageUploadInfo.getSource()) ;
+			
+			imagesList.add(photoServer+slaveMap.get("500x500"));
+			
+			}else{
+				String[] s = iamge.split("_500x500");
+				largeImageList.add(s[0]+s[1]);
+				imagesList.add((iamge));
+			}
+		}
+	}
+	
+	/**
+	 * 保存到图片服务器
+	 * @param realPath
+	 * @param pointerIndex
+	 * @param targetPath
+	 */
+	public static ImageUploadInfo saveImageSerivce(String realPath, int pointerIndex, String targetPath) {
+		ImageUploadInfo imageUploadInfo =new ImageUploadInfo();
+		try {
+			InputStream inStream = new FileInputStream(targetPath);
+			List<ImageSize> sizeList = new ArrayList<>();
+			ImageSize imageSize = new ImageSize(500);
+			sizeList.add(imageSize);
+			 imageUploadInfo = ImageUpload.resizeMaxSizeUpload(inStream, realPath.substring(pointerIndex+1), sizeList, null);
+//			System.out.println("source ===> " + imageUploadInfo.getSource());
+//			for(Map.Entry<String, String> entry : imageUploadInfo.getSlaveMap().entrySet()) {
+//				System.out.println("key ===> " + entry.getKey() + "," + "value ===> " + entry.getValue());
+//			}
+		} catch (FileNotFoundException e) {
+			e.printStackTrace();
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+		return imageUploadInfo;
+	}
+
+}

+ 124 - 0
src/main/java/com/caimei/modules/brand/web/BrandAgentController.java

@@ -0,0 +1,124 @@
+package com.caimei.modules.brand.web;
+
+import java.io.UnsupportedEncodingException;
+import java.net.URLEncoder;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.ModelAttribute;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.servlet.mvc.support.RedirectAttributes;
+
+import com.caimei.modules.brand.entity.BrandAgent;
+import com.caimei.modules.brand.service.BrandAgentService;
+import com.thinkgem.jeesite.common.config.Global;
+import com.thinkgem.jeesite.common.persistence.Page;
+import com.thinkgem.jeesite.common.utils.StringUtils;
+import com.thinkgem.jeesite.common.web.BaseController;
+
+/**
+ * 品牌联盟代理商Controller
+ * @author LG
+ * @version 2016-05-13
+ */
+@Controller
+@RequestMapping(value = "${adminPath}/brand/brandAgent")
+public class BrandAgentController extends BaseController {
+
+	@Autowired
+	private BrandAgentService brandAgentService;
+	
+	@ModelAttribute
+	public BrandAgent get(@RequestParam(required=false) String id) {
+		BrandAgent entity = null;
+		if (StringUtils.isNotBlank(id)){
+			entity = brandAgentService.get(id);
+		}
+		if (entity == null){
+			entity = new BrandAgent();
+		}
+		return entity;
+	}
+	
+	@RequiresPermissions("brand:brandAgent:view")
+	@RequestMapping(value = {"list", ""})
+	public String list(BrandAgent brandAgent, HttpServletRequest request, HttpServletResponse response, Model model) {
+		Page<BrandAgent> page = brandAgentService.findPage(new Page<BrandAgent>(request, response), brandAgent); 
+		model.addAttribute("page", page);
+		return "modules/brand/brandAgentList";
+	}
+
+	@RequiresPermissions("brand:brandAgent:view")
+	@RequestMapping(value = "form")
+	public String form(BrandAgent brandAgent, Integer drawboardType, String redirectUrl, Model model) {
+		model.addAttribute("brandAgent", brandAgent);
+		model.addAttribute("drawboardType", drawboardType);
+		model.addAttribute("redirectUrl", redirectUrl);
+		if(StringUtils.isNotBlank(brandAgent.getName())) {
+			try {
+				model.addAttribute("bname", URLEncoder.encode(URLEncoder.encode(brandAgent.getName(), "utf-8"), "utf-8"));
+			} catch (UnsupportedEncodingException e) {
+				e.printStackTrace();
+			}
+		}
+		return "modules/brand/brandAgentForm";
+	}
+
+	@RequiresPermissions("brand:brandAgent:edit")
+	@RequestMapping(value = "save")
+	public String save(BrandAgent brandAgent, Integer drawboardType, String redirectUrl, Model model, RedirectAttributes redirectAttributes) {
+		if (!beanValidator(model, brandAgent)){
+			return form(brandAgent, drawboardType, redirectUrl, model);
+		}
+		brandAgentService.save(brandAgent);
+		if(drawboardType != null && drawboardType == 1) {
+			String bname = "";
+			try {
+				bname = URLEncoder.encode(URLEncoder.encode(brandAgent.getName(), "utf-8"), "utf-8");
+			} catch (UnsupportedEncodingException e) {
+				e.printStackTrace();
+			}
+			return "redirect:" + Global.getAdminPath()+ redirectUrl + "?drawboardType=" + drawboardType + "&bid=" + brandAgent.getId() + "&bname=" + bname;
+		}
+		addMessage(redirectAttributes, "保存品牌联盟代理商成功");
+		return "redirect:"+Global.getAdminPath()+"/brand/brandAgent/?repage";
+	}
+	
+	@RequiresPermissions("brand:brandAgent:edit")
+	@RequestMapping(value = "delete")
+	public String delete(BrandAgent brandAgent, RedirectAttributes redirectAttributes) {
+		brandAgentService.delete(brandAgent);
+		addMessage(redirectAttributes, "删除品牌联盟代理商成功");
+		return "redirect:"+Global.getAdminPath()+"/brand/brandAgent/?repage";
+	}
+	
+	/**
+	 * 品牌联盟代理商单选框
+	 * @param brandAgent
+	 * @param request
+	 * @param response
+	 * @param model
+	 * @return
+	 */
+	@RequestMapping(value = { "agentList_singleselect" })
+	public String agentListPageSingle(BrandAgent brandAgent,HttpServletRequest request, HttpServletResponse response, Model model) {
+		Page<BrandAgent> page = brandAgentService.findPage(new Page<BrandAgent>(request, response), brandAgent); 
+		model.addAttribute("page", page);
+		return "modules/brand/agentList_singleselect";
+	}
+	
+	@RequiresPermissions("brand:brandAgent:edit")
+	@RequestMapping(value = "changeStatus")
+	public String changeStatus(BrandAgent brandAgent, RedirectAttributes redirectAttributes) {
+		brandAgentService.changeStatus(brandAgent);
+		addMessage(redirectAttributes, "更新品牌联盟代理商状态成功");
+		return "redirect:"+Global.getAdminPath()+"/brand/brandAgent/?repage";
+	}
+
+}

+ 93 - 0
src/main/java/com/caimei/modules/brand/web/BrandIdentificationCodeController.java

@@ -0,0 +1,93 @@
+package com.caimei.modules.brand.web;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.ModelAttribute;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.servlet.mvc.support.RedirectAttributes;
+
+import com.caimei.modules.brand.entity.BrandIdentificationCode;
+import com.caimei.modules.brand.service.BrandIdentificationCodeService;
+import com.thinkgem.jeesite.common.config.Global;
+import com.thinkgem.jeesite.common.persistence.Page;
+import com.thinkgem.jeesite.common.utils.StringUtils;
+import com.thinkgem.jeesite.common.web.BaseController;
+
+/**
+ * 商品标识码Controller
+ * @author demon
+ * @version 2016-05-20
+ */
+@Controller
+@RequestMapping(value = "${adminPath}/brand/brandIdentificationCode")
+public class BrandIdentificationCodeController extends BaseController {
+
+	@Autowired
+	private BrandIdentificationCodeService brandIdentificationCodeService;
+	
+	@ModelAttribute
+	public BrandIdentificationCode get(@RequestParam(required=false) String id) {
+		BrandIdentificationCode entity = null;
+		if (StringUtils.isNotBlank(id)){
+			entity = brandIdentificationCodeService.get(id);
+		}
+		if (entity == null){
+			entity = new BrandIdentificationCode();
+		}
+		return entity;
+	}
+	
+	@RequiresPermissions("brand:brandIdentificationCode:view")
+	@RequestMapping(value = {"list", ""})
+	public String list(BrandIdentificationCode brandIdentificationCode, HttpServletRequest request, HttpServletResponse response, Model model) {
+		Page<BrandIdentificationCode> page = brandIdentificationCodeService.findPage(new Page<BrandIdentificationCode>(request, response), brandIdentificationCode); 
+		model.addAttribute("page", page);
+		model.addAttribute("unusedNum", brandIdentificationCodeService.getUnusedNum());
+		return "modules/brand/brandIdentificationCodeList";
+	}
+
+	@RequiresPermissions("brand:brandIdentificationCode:view")
+	@RequestMapping(value = "form")
+	public String form(BrandIdentificationCode brandIdentificationCode, Model model) {
+		model.addAttribute("brandIdentificationCode", brandIdentificationCode);
+		return "modules/brand/brandIdentificationCodeForm";
+	}
+
+	@RequiresPermissions("brand:brandIdentificationCode:edit")
+	@RequestMapping(value = "save")
+	public String save(BrandIdentificationCode brandIdentificationCode, Model model, RedirectAttributes redirectAttributes) {
+		if (!beanValidator(model, brandIdentificationCode)){
+			return form(brandIdentificationCode, model);
+		}
+		brandIdentificationCodeService.save(brandIdentificationCode);
+		addMessage(redirectAttributes, "保存商品标识码成功");
+		return "redirect:"+Global.getAdminPath()+"/brand/brandIdentificationCode/?repage";
+	}
+	
+	@RequiresPermissions("brand:brandIdentificationCode:edit")
+	@RequestMapping(value = "delete")
+	public String delete(BrandIdentificationCode brandIdentificationCode, RedirectAttributes redirectAttributes) {
+		brandIdentificationCodeService.delete(brandIdentificationCode);
+		addMessage(redirectAttributes, "删除商品标识码成功");
+		return "redirect:"+Global.getAdminPath()+"/brand/brandIdentificationCode/?repage";
+	}
+	
+	@RequiresPermissions("brand:brandIdentificationCode:edit")
+	@RequestMapping(value = "generate")
+	public String generate(Integer genCount, Model model, RedirectAttributes redirectAttributes) {
+		if(genCount == null || genCount <= 0) {
+			addMessage(redirectAttributes, "请输入正确的生成数量");
+		} else {
+			brandIdentificationCodeService.generate(genCount);
+			addMessage(redirectAttributes, "生成商品标识码成功");
+		}
+		return "redirect:"+Global.getAdminPath()+"/brand/brandIdentificationCode/?repage";
+	}
+
+}

+ 396 - 0
src/main/java/com/caimei/modules/brand/web/BrandProductController.java

@@ -0,0 +1,396 @@
+package com.caimei.modules.brand.web;
+
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import java.net.URLEncoder;
+import java.util.List;
+import java.util.Map;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpSession;
+
+import org.apache.commons.collections.CollectionUtils;
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.ModelAttribute;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.servlet.mvc.support.RedirectAttributes;
+
+import com.caimei.modules.brand.entity.BrandAgent;
+import com.caimei.modules.brand.entity.BrandProduct;
+import com.caimei.modules.brand.entity.BrandPurchaser;
+import com.caimei.modules.brand.entity.BrandSupplier;
+import com.caimei.modules.brand.model.ProductModel;
+import com.caimei.modules.brand.service.BrandProductService;
+import com.caimei.modules.brand.service.BrandSupplierService;
+import com.caimei.modules.brand.service.ProductModelService;
+import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
+import com.thinkgem.jeesite.common.config.Global;
+import com.thinkgem.jeesite.common.persistence.Page;
+import com.thinkgem.jeesite.common.utils.StringUtils;
+import com.thinkgem.jeesite.common.web.BaseController;
+
+/**
+ * 品牌联盟商品Controller
+ * @author LG
+ * @version 2016-05-13
+ */
+@Controller
+@RequestMapping(value = "${adminPath}/brand/brandProduct")
+public class BrandProductController extends BaseController {
+
+	@Autowired
+	private BrandProductService brandProductService;
+	
+	@Autowired
+	private BrandSupplierService brandSupplierService;
+	
+	@Autowired
+	private ProductModelService productModelService;
+	
+	@ModelAttribute
+	public BrandProduct get(@RequestParam(required=false) String id) {
+		BrandProduct entity = null;
+		if (StringUtils.isNotBlank(id)){
+			entity = brandProductService.get(id);
+		}
+		if (entity == null){
+			entity = new BrandProduct();
+		}
+		return entity;
+	}
+	
+	@RequiresPermissions("brand:brandProduct:view")
+	@RequestMapping(value = {"list", ""})
+	public String list(BrandProduct brandProduct, HttpSession session,HttpServletRequest request, HttpServletResponse response, Model model) {
+		session.removeAttribute("brandProduct_session_edit");
+		session.removeAttribute("brandProduct_session");
+		Page<BrandProduct> page = brandProductService.findPage(new Page<BrandProduct>(request, response), brandProduct); 
+		List<BrandProduct> list = page.getList();
+		List<BrandProduct> list1=Lists.newArrayList();
+		if(CollectionUtils.isNotEmpty(list)){
+			for (int i = 0; i < list.size(); i++) {
+				brandProduct=brandProductService.get(list.get(i).getId());
+				list1.add(i, brandProduct);
+			}
+		}
+		page.setList(list1);
+		model.addAttribute("page", page);
+		return "modules/brand/brandProductList";
+	}
+
+	@RequiresPermissions("brand:brandProduct:view")
+	@RequestMapping(value = "form")
+	public String form(BrandProduct brandProduct, Model model,HttpSession session, @RequestParam(defaultValue="-1") Integer drawboardType,  String bid,String bname) {
+		if(drawboardType > -1 && bid != null && bid.trim().length() > 0 && !bid.equals("0")) {	
+			BrandProduct bp = (BrandProduct) session.getAttribute("brandProduct_session_edit");
+			if(null!=bp)brandProduct=bp;
+			session.removeAttribute("brandProduct_session_edit");
+			switch (drawboardType) {
+			case 0:
+				BrandSupplier brandSupplier = new BrandSupplier();
+				brandSupplier.setId(bid+"");
+				brandSupplier.setName(bname);
+				brandProduct.setBrandSupplier(brandSupplier);
+				break;
+			case 1:
+				BrandAgent brandAgent = new BrandAgent();
+				brandAgent.setId(bid+"");
+				brandAgent.setName(bname);
+				brandProduct.setBrandAgent(brandAgent);
+				break;
+			case 2:
+				BrandPurchaser brandPurchaser = new BrandPurchaser();
+				brandPurchaser.setId(bid+"");
+				brandPurchaser.setName(bname);
+				brandProduct.setBrandPurchaser(brandPurchaser);
+				break;
+			default:
+				break;
+			}
+			session.setAttribute("brandProduct_session_edit", brandProduct);
+			session.setMaxInactiveInterval(10*60);// 以秒为单位
+		}
+		model.addAttribute("brandProduct", brandProduct);
+		if(StringUtils.isNotBlank(brandProduct.getId())){
+			ProductModel productModel = productModelService.get(brandProduct.getProductID()+"");
+			model.addAttribute("productModel", productModel);
+			return "modules/brand/brandProductEdit";
+		}
+		
+		return "modules/brand/brandProductForm";
+	}
+	
+	@RequiresPermissions("brand:brandProduct:edit")
+	@RequestMapping(value = "save")
+	public String save(BrandProduct brandProduct,Model model, HttpSession session,RedirectAttributes redirectAttributes, HttpServletRequest request) {
+		if(StringUtils.isNotBlank(brandProduct.getId())){
+			BrandProduct bp = (BrandProduct) session.getAttribute("brandProduct_session_edit");
+			if(null!=bp){brandProduct=bp;}
+		}
+		session.removeAttribute("brandProduct_session_edit");
+		
+		String save="";
+		try {
+			save = brandProductService.save(brandProduct,request);
+			addMessage(redirectAttributes, "保存品牌联盟商品成功");
+		} catch (Exception e) {
+			logger.error(e.toString(),e);
+			addMessage(redirectAttributes, "图片上传错误:"+save);
+		}
+		
+		return "redirect:"+Global.getAdminPath()+"/brand/brandProduct/?repage";
+	}
+	
+	@RequiresPermissions("brand:brandProduct:edit")
+	@RequestMapping(value = "delete")
+	public String delete(BrandProduct brandProduct, RedirectAttributes redirectAttributes) {
+		brandProductService.delete(brandProduct);
+		addMessage(redirectAttributes, "删除品牌联盟商品成功");
+		return "redirect:"+Global.getAdminPath()+"/brand/brandProduct/?repage";
+	}
+	
+	/**
+	 * 商品-厂商 单选窗口
+	 * @param request
+	 * @param response
+	 * @param model
+	 * @return
+	 */
+	@RequestMapping(value = { "productList_singleselect" })
+	public String listAllSingle(ProductModel productModel,HttpServletRequest request, HttpServletResponse response, Model model) {
+		Page<ProductModel> page = productModelService.findPage(new Page<ProductModel>(request, response), productModel); 
+		model.addAttribute("page", page);
+		return "modules/brand/productList_singleselect";
+	}
+	
+	/**
+	 * 
+	 * <p>Description: 新增同类商品</p>
+	 * <p>Company: caimei365</p> 
+	 * @author xun.zhang
+	 * @date 2016年5月18日 上午10:31:01
+	 * @param brandProduct
+	 * @param model
+	 * @return
+	 */
+	@RequiresPermissions("brand:brandProduct:view")
+	@RequestMapping(value = "sameProductForm")
+	public String sameProductForm(BrandProduct brandProduct, Model model, HttpSession session, @RequestParam(defaultValue="-1") Integer drawboardType, @RequestParam(defaultValue="") String bid, @RequestParam(defaultValue="") String bname) {
+		if(drawboardType > -1 && bid != null && bid.trim().length() > 0 && !bid.equals("0")) {
+			brandProduct = (BrandProduct) session.getAttribute("brandProduct_session");
+			try {
+				bname = URLDecoder.decode(bname, "utf8");
+			} catch (UnsupportedEncodingException e) {
+				e.printStackTrace();
+			}
+			if("0".equals(bid)) {
+				bid = "";
+			}
+			if(drawboardType == 0) {
+				BrandSupplier brandSupplier = new BrandSupplier();
+				brandSupplier.setId(bid+"");
+				brandSupplier.setName(bname);
+				brandProduct.setBrandSupplier(brandSupplier);
+			}else if(drawboardType == 1) {
+				BrandAgent brandAgent = new BrandAgent();
+				brandAgent.setId(bid+"");
+				brandAgent.setName(bname);
+				brandProduct.setBrandAgent(brandAgent);
+			}else if(drawboardType == 2) {
+				BrandPurchaser brandPurchaser = new BrandPurchaser();
+				brandPurchaser.setId(bid+"");
+				brandPurchaser.setName(bname);
+				brandProduct.setBrandPurchaser(brandPurchaser);
+			}
+		}else {
+			brandProduct.setBrandAgent(null);
+			brandProduct.setBrandPurchaser(null);
+			brandProduct.setSn(null);
+			brandProduct.setShowAgent("0");
+			brandProduct.setShowPurchaser("0");
+		}
+		brandProduct.setFileNumber(null);
+		model.addAttribute("brandProduct", brandProduct);
+		return "modules/brand/brandSameProductForm";
+	}
+	
+	/**
+	 * 
+	 * <p>Description: 中途去编辑供应商信息、代理商信息、购买者信息的跳板</p>
+	 * <p>Company: caimei365</p> 
+	 * @author xun.zhang
+	 * @date 2016年5月18日 上午10:37:20
+	 * @param brandProduct
+	 * @param model
+	 * @param drawboardType 跳转到相应的编辑页面(0 供应商,1 代理商,2 购买者)
+	 * @return
+	 */
+	@RequestMapping(value = "drawboard")
+	public String drawboard(BrandProduct brandProduct, 
+							Model model, 
+							HttpSession session, 
+							Integer drawboardType,
+							@RequestParam(defaultValue="") String bid,
+							@RequestParam(defaultValue="0") String showAgent,
+							@RequestParam(defaultValue="0") String showPurchaser) {
+		brandProduct.setFileNumber(null);
+		brandProduct.setShowAgent(showAgent);
+		brandProduct.setShowPurchaser(showPurchaser);
+		session.setAttribute("brandProduct_session", brandProduct);
+		session.setMaxInactiveInterval(10*60);// 以秒为单位
+		String redirectUrl = "";
+		if(drawboardType == 0) {
+			redirectUrl = "/brand/brandSupplier/form";
+		}else if(drawboardType == 1) {
+			redirectUrl = "/brand/brandAgent/form";
+		}else if(drawboardType == 2) {
+			redirectUrl = "/brand/brandPurchaser/form";
+		}
+		try {
+			redirectUrl += "?drawboardType="+drawboardType+"&redirectUrl="+URLEncoder.encode("/brand/brandProduct/sameProductForm", "utf8");
+			if(!"".equals(bid)) {
+				redirectUrl += "&id=" + bid;
+			}
+		} catch (UnsupportedEncodingException e) {
+			e.printStackTrace();
+		}
+		return "redirect:"+Global.getAdminPath()+redirectUrl;
+	}
+	
+	
+	/**
+	 * 编辑商品
+	 * <p>Description: 中途去编辑供应商信息、代理商信息、购买者信息的跳板</p>
+	 * <p>Company: caimei365</p> 
+	 * @author xun.zhang
+	 * @date 2016年5月18日 上午10:37:20
+	 * @param brandProduct
+	 * @param model
+	 * @param drawboardType 跳转到相应的编辑页面(0 供应商,1 代理商,2 购买者)
+	 * @return
+	 */
+	@RequestMapping(value = "drawboardEdit")
+	public String drawboardEdit(BrandProduct brandProduct, Model model, HttpSession session, Integer drawboardType,String bid) {
+		//brandProduct.setFileNumber(null);
+		BrandProduct bp = (BrandProduct) session.getAttribute("brandProduct_session_edit");
+		if(null!=bp){
+			brandProduct=bp;
+		}else{
+			session.setAttribute("brandProduct_session_edit", brandProduct);
+			session.setMaxInactiveInterval(10*60);// 以秒为单位
+		}
+		String redirectUrl = "";
+		if(drawboardType == 0) {
+			redirectUrl = "/brand/brandSupplier/form";
+		}else if(drawboardType == 1) {
+			redirectUrl = "/brand/brandAgent/form";
+		}else if(drawboardType == 2) {
+			redirectUrl = "/brand/brandPurchaser/form";
+		}
+		redirectUrl += "?id="+bid+"&drawboardType="+drawboardType+"&redirectUrl=/brand/brandProduct/form";
+		return "redirect:"+Global.getAdminPath()+redirectUrl;
+	}
+	
+	@RequiresPermissions("brand:brandProduct:edit")
+	@RequestMapping(value = "sameProductSave")
+	public String sameProductSave(BrandProduct brandProduct, RedirectAttributes redirectAttributes, Model model, HttpServletRequest request) {
+		brandProduct.setId(null);
+		brandProduct.setFileNumber(null);
+		brandProductService.sameProductSave(brandProduct, request);
+		addMessage(redirectAttributes, "保存品牌联盟商品成功");
+		return "redirect:"+Global.getAdminPath()+"/brand/brandProduct/?repage";
+	}
+
+	@RequiresPermissions("brand:brandProduct:edit")
+	@RequestMapping(value = "changeStatus")
+	public String changeStatus(BrandProduct brandProduct, RedirectAttributes redirectAttributes) {
+		brandProductService.changeStatus(brandProduct);
+		if(StringUtils.equals("1", brandProduct.getEnabledStatus())){
+			String [] supplierIDs=new String[1];
+			supplierIDs[0]=brandProduct.getBrandSupplier().getId();
+			brandSupplierService.updateEnabledStatusByIds(brandProduct.getEnabledStatus(),supplierIDs);
+		}
+		addMessage(redirectAttributes, "更新品牌联盟商品状态成功");
+		return "redirect:"+Global.getAdminPath()+"/brand/brandProduct/?repage";
+	}
+	
+	/**
+	 * 批量修改启用、停用状态
+	 * @param enabledStatus
+	 * @param ids
+	 * @param request
+	 * @param response
+	 * @return
+	 */
+	@RequiresPermissions("brand:brandProduct:edit")
+	@ResponseBody
+	@RequestMapping(value="updateEnabledStatus")
+	public Map<String, Object> updateEnabledStatus(String enabledStatus,String[] ids,String [] supplierIDs,HttpServletRequest request,HttpServletResponse response){
+		Map<String, Object> map =Maps.newLinkedHashMap();
+		try {
+			brandProductService.updateEnabledStatusByIds(enabledStatus,ids);
+			if(StringUtils.equals("1",enabledStatus)){
+				brandSupplierService.updateEnabledStatusByIds(enabledStatus,supplierIDs);
+			}
+			map.put("success",true);
+			map.put("msg", "修改成功");
+		} catch (Exception e) {
+			logger.debug(e.toString(),e);
+			map.put("success",false);
+			map.put("msg", "修改失败");
+		}
+        return map;  
+	}
+	
+	/**
+	 * 修改显示项
+	 * @param brandProduct
+	 * @param request
+	 * @param response
+	 * @return
+	 */
+	@RequiresPermissions("brand:brandProduct:edit")
+	@ResponseBody
+	@RequestMapping(value="updateShow")
+	public Map<String, Object> updateShow(BrandProduct brandProduct,HttpServletRequest request,HttpServletResponse response){
+		Map<String, Object> map =Maps.newLinkedHashMap();
+		try {
+			brandProductService.save(brandProduct);
+			map.put("success",true);
+			map.put("msg", "修改成功");
+		} catch (Exception e) {
+			logger.debug(e.toString(),e);
+			map.put("success",false);
+			map.put("msg", "修改失败");
+		}
+		return map;  
+	}
+	
+	/**
+	 * 验证Sn码是否存在
+	 * @param mobileNo
+	 * @return
+	 */
+	@ResponseBody
+	@RequestMapping(value = "checkSn")
+	public String checkSn(String sn,String oldSn) {
+		if(StringUtils.equals(sn, oldSn)){
+			return "true";
+		}
+		BrandProduct brandProduct=new BrandProduct();
+		brandProduct.setSn(sn);
+		List<BrandProduct> list = brandProductService.findList(brandProduct);
+		if(CollectionUtils.isEmpty(list)){
+			return "true";
+		}
+		return "false";
+	}
+	
+}

+ 163 - 0
src/main/java/com/caimei/modules/brand/web/BrandProductsController.java

@@ -0,0 +1,163 @@
+package com.caimei.modules.brand.web;
+
+import java.util.List;
+import java.util.Map;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.commons.collections.CollectionUtils;
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.ModelAttribute;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.servlet.mvc.support.RedirectAttributes;
+
+import com.caimei.modules.brand.entity.BrandProducts;
+import com.caimei.modules.brand.service.BrandProductsService;
+import com.google.common.collect.Maps;
+import com.thinkgem.jeesite.common.config.Global;
+import com.thinkgem.jeesite.common.persistence.Page;
+import com.thinkgem.jeesite.common.utils.StringUtils;
+import com.thinkgem.jeesite.common.web.BaseController;
+
+/**
+ * 商品管理Controller
+ * @author LG
+ * @version 2016-08-24
+ */
+@Controller
+@RequestMapping(value = "${adminPath}/brand/brandProducts")
+public class BrandProductsController extends BaseController {
+
+	@Autowired
+	private BrandProductsService brandProductsService;
+	
+	@ModelAttribute
+	public BrandProducts get(@RequestParam(required=false) String id) {
+		BrandProducts entity = null;
+		if (StringUtils.isNotBlank(id)){
+			entity = brandProductsService.get(id);
+		}
+		if (entity == null){
+			entity = new BrandProducts();
+		}
+		return entity;
+	}
+	
+	@RequiresPermissions("brand:brandProducts:view")
+	@RequestMapping(value = {"list", ""})
+	public String list(BrandProducts brandProducts, HttpServletRequest request, HttpServletResponse response, Model model) {
+		Page<BrandProducts> page = brandProductsService.findPage(new Page<BrandProducts>(request, response), brandProducts); 
+		model.addAttribute("page", page);
+		return "modules/brand/brandProductsList";
+	}
+
+	@RequiresPermissions("brand:brandProducts:view")
+	@RequestMapping(value = "form")
+	public String form(BrandProducts brandProducts, Model model) {
+		model.addAttribute("brandProducts", brandProducts);
+		return "modules/brand/brandProductsForm";
+	}
+	
+	@RequiresPermissions("brand:brandProducts:view")
+	@RequestMapping(value = "sameform")
+	public String sameform(BrandProducts brandProducts, Model model) {
+		brandProducts.setId(null);
+		brandProducts.setSn(null);
+		brandProducts.setIdentificationCode(null);
+		brandProducts.setQueryNum(0);
+		brandProducts.setScanNum(0);
+		model.addAttribute("brandProducts", brandProducts);
+		return "modules/brand/brandProductsForm";
+	}
+
+	@RequiresPermissions("brand:brandProducts:edit")
+	@RequestMapping(value = "save")
+	public String save(BrandProducts brandProducts, Model model, RedirectAttributes redirectAttributes, HttpServletRequest request) {
+		if (!beanValidator(model, brandProducts)){
+			return form(brandProducts, model);
+		}
+		try {
+			brandProductsService.save(brandProducts,request);
+			addMessage(redirectAttributes, "保存商品管理成功");
+		} catch (Exception e) {
+			logger.error(e.toString(),e);
+			addMessage(redirectAttributes, "保存失败:"+e.toString());
+		}
+		return "redirect:"+Global.getAdminPath()+"/brand/brandProducts/?repage";
+	}
+	
+	@RequiresPermissions("brand:brandProducts:delete")
+	@RequestMapping(value = "delete")
+	public String delete(BrandProducts brandProducts, RedirectAttributes redirectAttributes) {
+		brandProductsService.delete(brandProducts);
+		addMessage(redirectAttributes, "删除商品管理成功");
+		return "redirect:"+Global.getAdminPath()+"/brand/brandProducts/?repage";
+	}
+
+	/**
+	 * 批量修改启用、停用状态
+	 * @param enabledStatus
+	 * @param ids
+	 * @param request
+	 * @param response
+	 * @return
+	 */
+	@RequiresPermissions("brand:brandProduct:edit")
+	@ResponseBody
+	@RequestMapping(value="updateEnabledStatus")
+	public Map<String, Object> updateEnabledStatus(String status,String[] ids,HttpServletRequest request,HttpServletResponse response){
+		Map<String, Object> map =Maps.newLinkedHashMap();
+		try {
+			brandProductsService.updateEnabledStatusByIds(status,ids);
+			map.put("success",true);
+			map.put("msg", "修改成功");
+		} catch (Exception e) {
+			logger.debug(e.toString(),e);
+			map.put("success",false);
+			map.put("msg", "修改失败");
+		}
+        return map;  
+	}
+	
+	/**
+	 * 验证Sn码是否存在
+	 * @param Sn
+	 * @return
+	 */
+	@ResponseBody
+	@RequestMapping(value = "checkSn")
+	public String checkSn(String sn,String oldSn) {
+		if(StringUtils.equals(sn, oldSn)){
+			return "true";
+		}
+		List<BrandProducts> list = brandProductsService.findBySn(sn);
+		if(CollectionUtils.isEmpty(list)){
+			return "true";
+		}
+		return "false";
+	}
+	
+	/**
+	 * 验证identificationCode码是否存在
+	 * @param identificationCode
+	 * @return
+	 */
+	@ResponseBody
+	@RequestMapping(value = "checkIdentificationCode")
+	public String checkIdentificationCode(String identificationCode,String oldidentificationCode) {
+		if(StringUtils.equals(identificationCode, oldidentificationCode)){
+			return "true";
+		}
+		List<BrandProducts> list = brandProductsService.findByIdentificationCode(identificationCode);
+		if(CollectionUtils.isEmpty(list)){
+			return "true";
+		}
+		return "false";
+	}
+}

+ 127 - 0
src/main/java/com/caimei/modules/brand/web/BrandPurchaserController.java

@@ -0,0 +1,127 @@
+package com.caimei.modules.brand.web;
+
+import java.io.UnsupportedEncodingException;
+import java.net.URLEncoder;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.ModelAttribute;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.servlet.mvc.support.RedirectAttributes;
+
+import com.caimei.modules.brand.entity.BrandPurchaser;
+import com.caimei.modules.brand.service.BrandPurchaserService;
+import com.thinkgem.jeesite.common.config.Global;
+import com.thinkgem.jeesite.common.persistence.Page;
+import com.thinkgem.jeesite.common.utils.StringUtils;
+import com.thinkgem.jeesite.common.web.BaseController;
+
+/**
+ * 品牌联盟购买者Controller
+ * @author LG
+ * @version 2016-05-13
+ */
+@Controller
+@RequestMapping(value = "${adminPath}/brand/brandPurchaser")
+public class BrandPurchaserController extends BaseController {
+
+	@Autowired
+	private BrandPurchaserService brandPurchaserService;
+	
+	@ModelAttribute
+	public BrandPurchaser get(@RequestParam(required=false) String id) {
+		BrandPurchaser entity = null;
+		if (StringUtils.isNotBlank(id)){
+			entity = brandPurchaserService.get(id);
+		}
+		if (entity == null){
+			entity = new BrandPurchaser();
+		}
+		return entity;
+	}
+	
+	@RequiresPermissions("brand:brandPurchaser:view")
+	@RequestMapping(value = {"list", ""})
+	public String list(BrandPurchaser brandPurchaser, HttpServletRequest request, HttpServletResponse response, Model model) {
+//		System.out.println("BrandPurchaserController.save()>>> watermark" + request.getSession().getServletContext().getRealPath("watermark"));
+		Page<BrandPurchaser> page = brandPurchaserService.findPage(new Page<BrandPurchaser>(request, response), brandPurchaser); 
+		model.addAttribute("page", page);
+		return "modules/brand/brandPurchaserList";
+	}
+
+	@RequiresPermissions("brand:brandPurchaser:view")
+	@RequestMapping(value = "form")
+	public String form(BrandPurchaser brandPurchaser, Integer drawboardType, String redirectUrl, Model model) {
+		model.addAttribute("brandPurchaser", brandPurchaser);
+		model.addAttribute("drawboardType", drawboardType);
+		model.addAttribute("redirectUrl", redirectUrl);
+		if(StringUtils.isNotBlank(brandPurchaser.getName())) {
+			try {
+				model.addAttribute("bname", URLEncoder.encode(URLEncoder.encode(brandPurchaser.getName(), "utf-8"), "utf-8"));
+			} catch (UnsupportedEncodingException e) {
+				e.printStackTrace();
+			}
+		}
+		return "modules/brand/brandPurchaserForm";
+	}
+
+	@RequiresPermissions("brand:brandPurchaser:edit")
+	@RequestMapping(value = "save")
+	public String save(BrandPurchaser brandPurchaser, Integer drawboardType, String redirectUrl, Model model, RedirectAttributes redirectAttributes, HttpServletRequest request) {
+		if (!beanValidator(model, brandPurchaser)){
+			return form(brandPurchaser, drawboardType, redirectUrl, model);
+		}
+		
+		brandPurchaserService.save(brandPurchaser, request);
+		if(drawboardType != null && drawboardType == 2) {
+			String bname = "";
+			try {
+				bname = URLEncoder.encode(URLEncoder.encode(brandPurchaser.getName(), "utf-8"), "utf-8");
+			} catch (UnsupportedEncodingException e) {
+				e.printStackTrace();
+			}
+			return "redirect:" + Global.getAdminPath()+ redirectUrl + "?drawboardType=" + drawboardType + "&bid=" + brandPurchaser.getId() + "&bname=" + bname;
+		}
+		
+		addMessage(redirectAttributes, "保存品牌联盟购买者成功");
+		return "redirect:"+Global.getAdminPath()+"/brand/brandPurchaser/?repage";
+	}
+	
+	@RequiresPermissions("brand:brandPurchaser:edit")
+	@RequestMapping(value = "delete")
+	public String delete(BrandPurchaser brandPurchaser, RedirectAttributes redirectAttributes) {
+		brandPurchaserService.delete(brandPurchaser);
+		addMessage(redirectAttributes, "删除品牌联盟购买者成功");
+		return "redirect:"+Global.getAdminPath()+"/brand/brandPurchaser/?repage";
+	}
+	
+	/**
+	 * 购买者单选框
+	 * @param brandPurchaser
+	 * @param request
+	 * @param response
+	 * @param model
+	 * @return
+	 */
+	@RequestMapping(value = { "purchaserList_singleselect" })
+	public String purchaserListPageSingle(BrandPurchaser brandPurchaser,HttpServletRequest request, HttpServletResponse response, Model model) {
+		Page<BrandPurchaser> page = brandPurchaserService.findPage(new Page<BrandPurchaser>(request, response), brandPurchaser); 
+		model.addAttribute("page", page);
+		return "modules/brand/purchaserList_singleselect";
+	}
+
+	@RequiresPermissions("brand:brandPurchaser:edit")
+	@RequestMapping(value = "changeStatus")
+	public String changeStatus(BrandPurchaser brandPurchaser, RedirectAttributes redirectAttributes) {
+		brandPurchaserService.changeStatus(brandPurchaser);
+		addMessage(redirectAttributes, "更新品牌联盟购买者状态成功");
+		return "redirect:"+Global.getAdminPath()+"/brand/brandPurchaser/?repage";
+	}
+	
+}

+ 136 - 0
src/main/java/com/caimei/modules/brand/web/BrandSupplierController.java

@@ -0,0 +1,136 @@
+package com.caimei.modules.brand.web;
+
+import java.io.UnsupportedEncodingException;
+import java.net.URLEncoder;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.ModelAttribute;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.servlet.mvc.support.RedirectAttributes;
+
+import com.caimei.modules.brand.entity.BrandSupplier;
+import com.caimei.modules.brand.model.ShopModel;
+import com.caimei.modules.brand.service.BrandSupplierService;
+import com.caimei.modules.brand.service.ShopModelService;
+import com.thinkgem.jeesite.common.config.Global;
+import com.thinkgem.jeesite.common.persistence.Page;
+import com.thinkgem.jeesite.common.utils.StringUtils;
+import com.thinkgem.jeesite.common.web.BaseController;
+
+/**
+ * 品牌供应商Controller
+ * @author LG
+ * @version 2016-05-13
+ */
+@Controller
+@RequestMapping(value = "${adminPath}/brand/brandSupplier")
+public class BrandSupplierController extends BaseController {
+
+	@Autowired
+	private BrandSupplierService brandSupplierService;
+	@Autowired
+	private ShopModelService supplierModelService;
+	
+	@ModelAttribute
+	public BrandSupplier get(@RequestParam(required=false) String id) {
+		BrandSupplier entity = null;
+		if (StringUtils.isNotBlank(id)){
+			entity = brandSupplierService.get(id);
+		}
+		if (entity == null){
+			entity = new BrandSupplier();
+		}
+		return entity;
+	}
+	
+	@RequiresPermissions("brand:brandSupplier:view")
+	@RequestMapping(value = {"list", ""})
+	public String list(BrandSupplier brandSupplier, HttpServletRequest request, HttpServletResponse response, Model model) {
+		Page<BrandSupplier> page = brandSupplierService.findPage(new Page<BrandSupplier>(request, response), brandSupplier); 
+		model.addAttribute("page", page);
+		return "modules/brand/brandSupplierList";
+	}
+
+	@RequiresPermissions("brand:brandSupplier:view")
+	@RequestMapping(value = "form")
+	public String form(BrandSupplier brandSupplier, Integer drawboardType, String redirectUrl, Model model) {
+		model.addAttribute("brandSupplier", brandSupplier);
+		model.addAttribute("drawboardType", drawboardType);
+		model.addAttribute("redirectUrl", redirectUrl);
+		if(StringUtils.isNotBlank(brandSupplier.getName())) {
+			try {
+				model.addAttribute("bname", URLEncoder.encode(URLEncoder.encode(brandSupplier.getName(), "utf-8"), "utf-8"));
+			} catch (UnsupportedEncodingException e) {
+				e.printStackTrace();
+			}
+		}
+		return "modules/brand/brandSupplierForm";
+	}
+
+	@RequiresPermissions("brand:brandSupplier:edit")
+	@RequestMapping(value = "save")
+	public String save(BrandSupplier brandSupplier, Integer drawboardType, String redirectUrl, Model model, RedirectAttributes redirectAttributes) {
+		if (!beanValidator(model, brandSupplier)){
+			return form(brandSupplier, drawboardType, redirectUrl, model);
+		}
+		brandSupplierService.save(brandSupplier);
+		if(drawboardType != null && drawboardType == 0) {
+			String bname = "";
+			try {
+				bname = URLEncoder.encode(URLEncoder.encode(brandSupplier.getName(), "utf-8"), "utf-8");
+			} catch (UnsupportedEncodingException e) {
+				e.printStackTrace();
+			}
+			return "redirect:" + Global.getAdminPath()+ redirectUrl + "?drawboardType=" + drawboardType + "&bid=" + brandSupplier.getId() + "&bname=" + bname;
+		}
+		
+		addMessage(redirectAttributes, "保存品牌供应商成功");
+		return "redirect:"+Global.getAdminPath()+"/brand/brandSupplier/?repage";
+	}
+	
+	@RequiresPermissions("brand:brandSupplier:edit")
+	@RequestMapping(value = "delete")
+	public String delete(BrandSupplier brandSupplier, RedirectAttributes redirectAttributes) {
+		brandSupplierService.delete(brandSupplier);
+		addMessage(redirectAttributes, "删除品牌供应商成功");
+		return "redirect:"+Global.getAdminPath()+"/brand/brandSupplier/?repage";
+	}
+	
+	@RequestMapping(value = { "shopList_singleselect" })
+	public String listPageSingle(ShopModel shopModel,HttpServletRequest request, HttpServletResponse response, Model model) {
+		Page<ShopModel> page = supplierModelService.findPage(new Page<ShopModel>(request, response), shopModel); 
+		model.addAttribute("page", page);
+		return "modules/brand/shopList_singleselect";
+	}
+	
+	/**
+	 * 品牌供应商单选框
+	 * @param brandSupplier
+	 * @param request
+	 * @param response
+	 * @param model
+	 * @return
+	 */
+	@RequestMapping(value = { "supplierList_singleselect" })
+	public String supplierListPageSingle(BrandSupplier brandSupplier,HttpServletRequest request, HttpServletResponse response, Model model) {
+		Page<BrandSupplier> page = brandSupplierService.findPage(new Page<BrandSupplier>(request, response), brandSupplier); 
+		model.addAttribute("page", page);
+		return "modules/brand/supplierList_singleselect";
+	}
+	
+	@RequiresPermissions("brand:brandSupplier:edit")
+	@RequestMapping(value = "changeStatus")
+	public String changeStatus(BrandSupplier brandSupplier, Model model, RedirectAttributes redirectAttributes) {
+		brandSupplierService.changeStatus(brandSupplier);
+		addMessage(redirectAttributes, "更新品牌供应商状态成功");
+		return "redirect:"+Global.getAdminPath()+"/brand/brandSupplier/?repage";
+	}
+
+}

+ 512 - 0
src/main/java/com/caimei/modules/brand/web/CmBrandController.java

@@ -0,0 +1,512 @@
+package com.caimei.modules.brand.web;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import com.caimei.modules.brand.entity.BrandAndProductType;
+import com.caimei.modules.coupon.entity.CmCoupon;
+import com.caimei.modules.coupon.entity.ReadExcel;
+import com.caimei.modules.miniprogram.utils.UploadPicUtils;
+import com.caimei.modules.product.dao.ProductDao;
+import com.caimei.modules.product.entity.Product;
+import com.caimei.modules.sys.utils.SMSUtils;
+import com.thinkgem.jeesite.modules.sys.utils.UserUtils;
+import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.collections.map.HashedMap;
+import org.apache.poi.hssf.usermodel.HSSFCell;
+import org.apache.poi.hssf.usermodel.HSSFWorkbook;
+import org.apache.poi.ss.usermodel.Cell;
+import org.apache.poi.ss.usermodel.Row;
+import org.apache.poi.ss.usermodel.Sheet;
+import org.apache.poi.ss.usermodel.Workbook;
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.ModelAttribute;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.servlet.mvc.support.RedirectAttributes;
+
+import com.thinkgem.jeesite.common.config.Global;
+import com.thinkgem.jeesite.common.persistence.Page;
+import com.thinkgem.jeesite.common.web.BaseController;
+import com.thinkgem.jeesite.common.utils.StringUtils;
+import com.caimei.modules.brand.entity.CmBrand;
+import com.caimei.modules.brand.service.CmBrandService;
+
+import java.math.BigDecimal;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 采美品牌Controller
+ * @author Lijun
+ * @version 2019-04-19
+ */
+@Controller
+@RequestMapping(value = "${adminPath}/brand/cmBrand")
+public class CmBrandController extends BaseController {
+
+	//总行数
+	private int totalRows = 0;
+	//总条数
+	private int totalCells = 0;
+	//错误信息接收器
+	private String errorMsg;
+
+
+	@Autowired
+	private CmBrandService cmBrandService;
+	@Autowired
+	private ProductDao productDao;
+	
+	@ModelAttribute
+	public CmBrand get(@RequestParam(required=false) String id) {
+		CmBrand entity = null;
+		if (StringUtils.isNotBlank(id)){
+			entity = cmBrandService.get(id);
+		}
+		if (entity == null){
+			entity = new CmBrand();
+		}
+		return entity;
+	}
+	
+	@RequiresPermissions("brand:cmBrand:view")
+	@RequestMapping(value = {"list", ""})
+	public String list(CmBrand cmBrand, HttpServletRequest request, HttpServletResponse response, Model model) {
+		Page<CmBrand> page = cmBrandService.findPage(new Page<CmBrand>(request, response), cmBrand); 
+		model.addAttribute("page", page);
+		return "modules/brand/cmBrandList";
+	}
+
+	@RequiresPermissions("brand:cmBrand:view")
+	@RequestMapping(value = "form")
+	public String form(CmBrand cmBrand, Model model) {
+		model.addAttribute("cmBrand", cmBrand);
+		String auditNote = cmBrand.getAuditNote();
+		if(StringUtils.isNotEmpty(auditNote)){
+			if(StringUtils.equals("填写错误",auditNote)){
+				cmBrand.setAuditStatus("1");
+			}else{
+				cmBrand.setAuditStatus("2");
+			}
+		}else{
+			cmBrand.setAuditStatus("0");
+		}
+		return "modules/brand/cmBrandForm";
+	}
+
+	@RequiresPermissions("brand:cmBrand:edit")
+	@RequestMapping(value = "save")
+	public String save(CmBrand cmBrand, Model model, RedirectAttributes redirectAttributes,HttpServletRequest request) {
+		if (!beanValidator(model, cmBrand)){
+			return form(cmBrand, model);
+		}
+		//判断输入的名字是否已存在
+		CmBrand cmBrandByName = cmBrandService.findBradByName(cmBrand);
+//		if (StringUtils.isNotBlank(cmBrand.getLogo())) {
+//			String img = UploadPicUtils.saveImageToServer(cmBrand.getLogo(), request);
+//			cmBrand.setLogo(img);
+//		}
+		if(null != cmBrandByName){
+			addMessage(redirectAttributes, "该品牌已存在");
+		}else{
+			//判断是新增加还是修改
+			if(StringUtils.isEmpty(cmBrand.getId())){//新增
+				cmBrand.setCreateDate(new Date());
+				cmBrand.setStatus("1");//采美添加默认通过--品牌状态 0:待审核,1:审核通过,2:审核失败
+				cmBrand.setSource("0");//添加来源 0:后台添加 ,1:供应商添加
+				cmBrand.setSort("0");
+				cmBrand.setUserID(UserUtils.getUser()+"");
+			}else{//修改
+				String status = cmBrand.getStatus();
+				CmBrand oldBrand = cmBrandService.get(cmBrand.getId());//获取修改前的品牌信息
+				String oldStatus = oldBrand.getStatus();//老的状态
+				if(!StringUtils.equals(status,oldStatus)){//重新修改状态才发送短信提示(防止重复编辑重复发送短信)
+					if(StringUtils.equals("1",status)){
+						String mobile = cmBrand.getShopMobile();
+						if (StringUtils.isNotEmpty(mobile)) {
+							SMSUtils.sendSms(mobile, "您提交的["+cmBrand.getName()+"]品牌申请,已审核成功");
+						}
+					}
+					if(StringUtils.equals("2",status)){
+						String auditNote = cmBrand.getAuditNote();
+						if(StringUtils.isEmpty(auditNote)){
+							addMessage(model, "请输入失败原因!!");
+							return form(cmBrand, model);
+						}
+						String mobile = cmBrand.getShopMobile();
+						if (StringUtils.isNotEmpty(mobile)) {
+							SMSUtils.sendSms(mobile, "抱歉,您提交的["+cmBrand.getName()+"]品牌申请,由于"+cmBrand.getAuditNote()+"审核失败,请重新修改提交!");
+						}
+					}
+				}else{
+					if(StringUtils.equals("2",status)){
+						String auditNote = cmBrand.getAuditNote();
+						if(StringUtils.isEmpty(auditNote)){
+							addMessage(model, "请输入失败原因!!");
+							return form(cmBrand, model);
+						}
+					}
+				}
+
+			}
+
+
+			cmBrand.setUpdateDate(new Date());
+			cmBrandService.save(cmBrand);
+			addMessage(redirectAttributes, "保存品牌成功");
+		}
+		return "redirect:"+Global.getAdminPath()+"/brand/cmBrand/";
+	}
+	
+	@RequiresPermissions("brand:cmBrand:delete")
+	@RequestMapping(value = "delete")
+	public String delete(CmBrand cmBrand, RedirectAttributes redirectAttributes) {
+		Date date = new Date();
+		cmBrand.setUpdateDate(date);
+		cmBrand.setDelFlag(date.getTime()+"");
+		//删除品牌表格内容
+		cmBrandService.delete(cmBrand);
+		//清理对应品牌商品信息(标记品牌为null)
+		productDao.updateProductByBrandId(Integer.parseInt(cmBrand.getId()));
+		addMessage(redirectAttributes, "删除品牌成功");
+		return "redirect:"+Global.getAdminPath()+"/brand/cmBrand/?repage";
+	}
+
+	@RequiresPermissions("brand:cmBrand:view")
+	@RequestMapping(value = {"uploadList"})
+	public String uploadList() {
+		return "modules/brand/brandUpload";
+	}
+
+	@ResponseBody
+	@RequestMapping(value = "import")
+	public Map<String,Object> cibeShopImport(@RequestParam(value="file",required = false) MultipartFile file, HttpServletRequest request, HttpServletResponse response, Model model){
+		Map<String,Object> map = new HashedMap();
+		try{
+			try {
+				//xls  2003版本
+				Workbook wb = new HSSFWorkbook(file.getInputStream());
+				// 得到第一个shell
+				Sheet sheet = wb.getSheetAt(0);
+				// 得到Excel的行数
+				this.totalRows = sheet.getPhysicalNumberOfRows();
+				// 得到Excel的列数(前提是有行数)
+				if (totalRows > 1 && sheet.getRow(0) != null) {
+					this.totalCells = sheet.getRow(0).getPhysicalNumberOfCells();
+				}
+				List<BrandAndProductType> brandAndProductType = new ArrayList<>();
+				// 循环Excel行数
+				for (int r = 1; r < totalRows; r++) {
+					Row row = sheet.getRow(r);
+					if (row == null){
+						continue;
+					}
+					BrandAndProductType brandAndProduct = new BrandAndProductType();
+					// 循环Excel的列
+					for (int c = 0; c < this.totalCells; c++) {
+						Cell cell = row.getCell(c);
+						if (null != cell) {
+							String value = getFieldValue(cell);
+							switch (c){
+								case 0:
+									brandAndProduct.setBrandName(value); //品牌名字
+									break;
+								case 1:
+									break;
+								case 2:
+									break;
+								case 3:
+									break;
+								case 4:
+									break;
+								case 5:
+									break;
+								case 6:
+									break;
+								default:
+									break;
+							}
+						}
+					}
+					// 添加到list
+					brandAndProductType.add(brandAndProduct);
+				}
+
+				//将转化对象插入品牌库
+				if(CollectionUtils.isNotEmpty(brandAndProductType)){
+					for(BrandAndProductType b:brandAndProductType){
+						String brandName = b.getBrandName();
+						CmBrand cmBrand  = new CmBrand();
+						cmBrand.setName(brandName);
+						cmBrand.setSource("0");
+						cmBrand.setUserID("1");
+						cmBrand.setStatus("1");
+						cmBrand.setSort("0");
+						cmBrand.setDelFlag("0");
+						cmBrand.setCreateDate(new Date());
+						cmBrand.setUpdateDate(new Date());
+						cmBrandService.save(cmBrand);
+					}
+				}
+
+			} catch (Exception e) {
+				e.printStackTrace();
+			}
+			map.put("success",true);
+			map.put("msg", "上传成功");
+		}catch (Exception e){
+			e.printStackTrace();
+			logger.error(e.getMessage());
+			map.put("success",false);
+			map.put("msg", "上传失败");
+		}
+		return map;
+	}
+
+	@ResponseBody
+	@RequestMapping(value = "import1")
+	public Map<String,Object> import1(@RequestParam(value="file",required = false) MultipartFile file, HttpServletRequest request, HttpServletResponse response, Model model){
+		Map<String,Object> map = new HashedMap();
+		try{
+			try {
+				Workbook wb = new HSSFWorkbook(file.getInputStream());
+				// 得到第一个shell
+				Sheet sheet = wb.getSheetAt(0);
+				// 得到Excel的行数
+				this.totalRows = sheet.getPhysicalNumberOfRows();
+				// 得到Excel的列数(前提是有行数)
+				if (totalRows > 1 && sheet.getRow(0) != null) {
+					this.totalCells = sheet.getRow(0).getPhysicalNumberOfCells();
+				}
+				List<BrandAndProductType> brandAndProductType = new ArrayList<>();
+				// 循环Excel行数
+				for (int r = 1; r < totalRows; r++) {
+					Row row = sheet.getRow(r);
+					if (row == null){
+						continue;
+					}
+					BrandAndProductType brandAndProduct = new BrandAndProductType();
+					// 循环Excel的列
+					for (int c = 0; c < this.totalCells; c++) {
+						Cell cell = row.getCell(c);
+						if (null != cell) {
+							String value = getFieldValue(cell);
+							switch (c){
+								case 0:
+									brandAndProduct.setProductId((int)Double.parseDouble(value));
+									break;
+								case 1:
+									break;
+								case 2:
+									break;
+								case 3:
+									brandAndProduct.setBrandName(value);
+									break;
+								case 4:
+									break;
+								case 5:
+									break;
+								case 6:
+									break;
+								default:
+									break;
+							}
+						}
+					}
+					// 添加到list
+					brandAndProductType.add(brandAndProduct);
+				}
+
+				//将转化对象更新到商品表
+				if(CollectionUtils.isNotEmpty(brandAndProductType)){
+					for(BrandAndProductType b:brandAndProductType){
+						//通过名字查询品牌
+						String brandName = b.getBrandName();
+						CmBrand cmBrand = new CmBrand();
+						cmBrand.setName(brandName);
+						CmBrand bradByName = cmBrandService.findBradByName(cmBrand);
+						if(null != bradByName){
+							String id = bradByName.getId();
+							Integer productId = b.getProductId();
+							Product product = new Product();
+							product.setBrandID(Integer.parseInt(id));
+							product.setProductID(productId);
+							productDao.updateBrnadId(product);
+						}else{
+							logger.info("---------------------商品不存在该品牌productId"+b.getProductId());
+						}
+					}
+				}
+
+			} catch (Exception e) {
+				logger.info(">>>>>>>>>>>>>>>>>>>>>>>>上次异常");
+				e.printStackTrace();
+			}
+			map.put("success",true);
+			map.put("msg", "上传成功");
+		}catch (Exception e){
+			e.printStackTrace();
+			logger.error(e.getMessage());
+			map.put("success",false);
+			map.put("msg", "上传失败");
+		}
+		return map;
+	}
+
+
+	@ResponseBody
+	@RequestMapping(value = "import2")
+	public Map<String,Object> import2(@RequestParam(value="file",required = false) MultipartFile file, HttpServletRequest request, HttpServletResponse response, Model model){
+		Map<String,Object> map = new HashedMap();
+		try{
+			try {
+				Workbook wb = new HSSFWorkbook(file.getInputStream());
+				// 得到第一个shell
+				Sheet sheet = wb.getSheetAt(0);
+				// 得到Excel的行数
+				this.totalRows = sheet.getPhysicalNumberOfRows();
+				// 得到Excel的列数(前提是有行数)
+				if (totalRows > 1 && sheet.getRow(0) != null) {
+					this.totalCells = sheet.getRow(0).getPhysicalNumberOfCells();
+				}
+				List<BrandAndProductType> brandAndProductType = new ArrayList<>();
+				// 循环Excel行数
+				for (int r = 1; r < totalRows; r++) {
+					Row row = sheet.getRow(r);
+					if (row == null){
+						continue;
+					}
+					BrandAndProductType brandAndProduct = new BrandAndProductType();
+					// 循环Excel的列
+					for (int c = 0; c < this.totalCells; c++) {
+						Cell cell = row.getCell(c);
+						if (null != cell) {
+							String value = getFieldValue(cell);
+							switch (c){
+								case 0:
+									brandAndProduct.setProductId((int)Double.parseDouble(value)); //商品ID
+									logger.info("__________________________product"+value);
+									break;
+								case 1:
+									break;
+								case 2:
+									break;
+								case 3:
+									break;
+								case 4:
+//									会所常用品(HSCY)-美容工具(MRGJ)-小工具(XGJ)
+
+									//去掉value中的括号以及括号里内容
+									String[] split = value.split("-");
+									int length = split.length;
+									if(length == 3){
+										String s = split[0];
+										String s1 = split[1];
+										String s2 = split[2];
+										int i = s.indexOf("(");
+										String substring = s.substring(0, i);
+
+										int i1 = s1.indexOf("(");
+										String substring1 = s1.substring(0, i1);
+
+										int i2 = s2.indexOf("(");
+										String substring2 = s2.substring(0, i2);
+
+										brandAndProduct.setBigTypeName(substring);//大分类
+										brandAndProduct.setSmallTypeName(substring1);//二级分类
+										brandAndProduct.setTinyTypeName(substring2);//小分类名字
+									}
+									break;
+								case 5:
+									break;
+								case 6:
+									break;
+								default:
+									break;
+							}
+						}
+					}
+					// 添加到list
+					brandAndProductType.add(brandAndProduct);
+				}
+
+				//将转化对象插入品牌库
+				if(CollectionUtils.isNotEmpty(brandAndProductType)){
+					for(BrandAndProductType b:brandAndProductType){
+						String bigTypeName = b.getBigTypeName();
+						String smallTypeName = b.getSmallTypeName();
+						String tinyTypeName = b.getTinyTypeName();
+
+						List<BrandAndProductType> productByTypeName = productDao.getProductByTypeName(bigTypeName, smallTypeName, tinyTypeName);
+						if(CollectionUtils.isNotEmpty(productByTypeName) && productByTypeName.size() == 1){
+							BrandAndProductType brandAndProductType1 = productByTypeName.get(0);
+							Integer tinyTypeID = brandAndProductType1.getTinyTypeID();
+							Product product = new Product();
+							product.setProductID(b.getProductId());
+							product.setTinyTypeID(tinyTypeID);
+							productDao.updateTinyType(product);
+						}
+						else{
+							logger.info("----------------------商品分类异常ProductId"+b.getProductId());
+						}
+					}
+				}
+			} catch (Exception e) {
+				logger.info(">>>>>>>>>>>>>>>>>>>>>>>>上次异常");
+				e.printStackTrace();
+			}
+			map.put("success",true);
+			map.put("msg", "上传成功");
+		}catch (Exception e){
+			e.printStackTrace();
+			logger.error(e.getMessage());
+			map.put("success",false);
+			map.put("msg", "上传失败");
+		}
+		return map;
+	}
+
+	public String getFieldValue(Cell cell){
+		String value = null;
+		if(cell.getCellType() == HSSFCell.CELL_TYPE_NUMERIC){
+			value = String.valueOf(cell.getNumericCellValue());
+		}else {
+			value = cell.getStringCellValue();
+		}
+		return value;
+	}
+
+	public int getTotalRows() {
+		return totalRows;
+	}
+
+	public void setTotalRows(int totalRows) {
+		this.totalRows = totalRows;
+	}
+
+	public int getTotalCells() {
+		return totalCells;
+	}
+
+	public void setTotalCells(int totalCells) {
+		this.totalCells = totalCells;
+	}
+
+	public String getErrorMsg() {
+		return errorMsg;
+	}
+
+	public void setErrorMsg(String errorMsg) {
+		this.errorMsg = errorMsg;
+	}
+
+}

+ 15 - 0
src/main/java/com/caimei/modules/bulkpurchase/dao/BpClauseDao.java

@@ -0,0 +1,15 @@
+package com.caimei.modules.bulkpurchase.dao;
+
+import com.thinkgem.jeesite.common.persistence.CrudDao;
+import com.thinkgem.jeesite.common.persistence.annotation.MyBatisDao;
+import com.caimei.modules.bulkpurchase.entity.BpClause;
+
+/**
+ * 条款信息DAO接口
+ * @author LG
+ * @version 2017-08-24
+ */
+@MyBatisDao
+public interface BpClauseDao extends CrudDao<BpClause> {
+	
+}

+ 24 - 0
src/main/java/com/caimei/modules/bulkpurchase/dao/BpOrderCirculationDao.java

@@ -0,0 +1,24 @@
+package com.caimei.modules.bulkpurchase.dao;
+
+import com.caimei.modules.bulkpurchase.entity.BpOrderCirculation;
+import com.thinkgem.jeesite.common.persistence.CrudDao;
+import com.thinkgem.jeesite.common.persistence.annotation.MyBatisDao;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * .订单传阅DAO
+ *
+ * @author ZCP
+ * @version 2017-08-03
+ **/
+@MyBatisDao
+public interface BpOrderCirculationDao extends CrudDao<BpOrderCirculation> {
+
+    List<BpOrderCirculation> findAllList(BpOrderCirculation bpOrderCirculation);
+    void delete(Long userId);
+
+    void update(@Param("userId") String userId, @Param("buyerRole") String buyerRole,
+                @Param("shopRole") String shopRole, @Param("updateTime") String updateTime);
+}

+ 15 - 0
src/main/java/com/caimei/modules/bulkpurchase/dao/BpOrderProductRemarkDao.java

@@ -0,0 +1,15 @@
+package com.caimei.modules.bulkpurchase.dao;
+
+import com.thinkgem.jeesite.common.persistence.CrudDao;
+import com.thinkgem.jeesite.common.persistence.annotation.MyBatisDao;
+import com.caimei.modules.bulkpurchase.entity.BpOrderProductRemark;
+
+/**
+ * 大宗采购订单商品备注DAO接口
+ * @author LiJun
+ * @version 2018-04-03
+ */
+@MyBatisDao
+public interface BpOrderProductRemarkDao extends CrudDao<BpOrderProductRemark> {
+	
+}

Some files were not shown because too many files changed in this diff